1import { a as __toESM } from "./rolldown-runtime-Cql5ZV07.js"; 2import { p as require_react } from "./vendor-charts-D81iZKCV.js"; 3import { g as require_compiler_runtime, t as require_jsx_runtime } from "./vendor-react-HZz3WA9p.js"; 4import { Yn as trackMethodCall, _t as SelectTrigger, gt as SelectItem, ht as SelectContent, mr as Input, mt as Select, vt as SelectValue } from "./main-DDHJZG-i.js"; 5var import_compiler_runtime = /* @__PURE__ */ __toESM(require_compiler_runtime()); 6var import_react = /* @__PURE__ */ __toESM(require_react()); 7var import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime()); 8const DEFAULT_CUSTOM_SETTING = { 9 Monday: { 10 from: "17:00", 11 to: "06:59" 12 }, 13 Tuesday: { 14 from: "17:00", 15 to: "06:59" 16 }, 17 Wednesday: { 18 from: "17:00", 19 to: "06:59" 20 }, 21 Thursday: { 22 from: "17:00", 23 to: "06:59" 24 }, 25 Friday: { 26 from: "17:00", 27 to: "06:59" 28 }, 29 Saturday: { 30 from: "17:00", 31 to: "06:59" 32 }, 33 Sunday: { 34 from: "17:00", 35 to: "06:59" 36 } 37}; 38const DEFAULT_DISALLOW_TIME = { 39 type: "Weekends", 40 from: "11:00", 41 to: "23:59" 42}; 43var DAYS_ORDER = [ 44 "Monday", 45 "Tuesday", 46 "Wednesday", 47 "Thursday", 48 "Friday", 49 "Saturday", 50 "Sunday" 51]; 52var SCHEDULE_LABEL_MAP = { 53 Weekends: "Weekends", 54 Weekdays: "Weekdays", 55 "7_days_a_week": "7 days a week", 56 Custom: "Custom" 57}; 58var SCHEDULE_VALUE_TO_TYPE = { 59 Weekends: "Weekends", 60 Weekdays: "Weekdays", 61 "7 days a week": "7_days_a_week", 62 Custom: "Custom" 63}; 64var TimeInput = (t0) => { 65 const $ = (0, import_compiler_runtime.c)(14); 66 const { from, to, onFromChange, onToChange } = t0; 67 let t1; 68 if ($[0] !== onFromChange) { 69 t1 = (e) => onFromChange(e.target.value); 70 $[0] = onFromChange; 71 $[1] = t1; 72 } else t1 = $[1]; 73 let t2; 74 if ($[2] !== from || $[3] !== t1) { 75 t2 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, { 76 type: "time", 77 value: from, 78 onChange: t1, 79 className: "[&::-webkit-calendar-picker-indicator]:hidden" 80 }); 81 $[2] = from; 82 $[3] = t1; 83 $[4] = t2; 84 } else t2 = $[4]; 85 let t3; 86 if ($[5] === Symbol.for("react.memo_cache_sentinel")) { 87 t3 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { 88 className: "text-sm text-muted-foreground", 89 children: "to" 90 }); 91 $[5] = t3; 92 } else t3 = $[5]; 93 let t4; 94 if ($[6] !== onToChange) { 95 t4 = (e_0) => onToChange(e_0.target.value); 96 $[6] = onToChange; 97 $[7] = t4; 98 } else t4 = $[7]; 99 let t5; 100 if ($[8] !== t4 || $[9] !== to) { 101 t5 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, { 102 type: "time", 103 value: to, 104 onChange: t4, 105 className: "[&::-webkit-calendar-picker-indicator]:hidden" 106 }); 107 $[8] = t4; 108 $[9] = to; 109 $[10] = t5; 110 } else t5 = $[10]; 111 let t6; 112 if ($[11] !== t2 || $[12] !== t5) { 113 t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 114 className: "flex w-[260px] items-center gap-2", 115 children: [ 116 t2, 117 t3, 118 t5 119 ] 120 }); 121 $[11] = t2; 122 $[12] = t5; 123 $[13] = t6; 124 } else t6 = $[13]; 125 return t6; 126}; 127const AlertTimePicker = (t0) => { 128 const $ = (0, import_compiler_runtime.c)(47); 129 const { value, onChange } = t0; 130 const [customSetting, setCustomSetting] = (0, import_react.useState)(value.customSetting ?? DEFAULT_CUSTOM_SETTING); 131 const scheduleLabel = SCHEDULE_LABEL_MAP[value.type]; 132 const isCustom = value.type === "Custom"; 133 let t1; 134 if ($[0] !== customSetting || $[1] !== onChange || $[2] !== value) { 135 t1 = (label) => { 136 trackMethodCall("handleScheduleChange", [label]); 137 const type = SCHEDULE_VALUE_TO_TYPE[label]; 138 onChange({ 139 ...value, 140 type, 141 customSetting: type === "Custom" ? customSetting : void 0 142 }); 143 }; 144 $[0] = customSetting; 145 $[1] = onChange; 146 $[2] = value; 147 $[3] = t1; 148 } else t1 = $[3]; 149 const handleScheduleChange = t1; 150 let t2; 151 if ($[4] !== onChange || $[5] !== value) { 152 t2 = (from) => { 153 trackMethodCall("handleFromChange", [from]); 154 return onChange({ 155 ...value, 156 from 157 }); 158 }; 159 $[4] = onChange; 160 $[5] = value; 161 $[6] = t2; 162 } else t2 = $[6]; 163 const handleFromChange = t2; 164 let t3; 165 if ($[7] !== onChange || $[8] !== value) { 166 t3 = (to) => { 167 trackMethodCall("handleToChange", [to]); 168 return onChange({ 169 ...value, 170 to 171 }); 172 }; 173 $[7] = onChange; 174 $[8] = value; 175 $[9] = t3; 176 } else t3 = $[9]; 177 const handleToChange = t3; 178 let t4; 179 if ($[10] !== customSetting || $[11] !== onChange || $[12] !== value) { 180 t4 = (day, from_0) => { 181 trackMethodCall("handleCustomDayFromChange", [day, from_0]); 182 const updated = { 183 ...customSetting, 184 [day]: { 185 ...customSetting[day], 186 from: from_0 187 } 188 }; 189 setCustomSetting(updated); 190 onChange({ 191 ...value, 192 customSetting: updated 193 }); 194 }; 195 $[10] = customSetting; 196 $[11] = onChange; 197 $[12] = value; 198 $[13] = t4; 199 } else t4 = $[13]; 200 const handleCustomDayFromChange = t4; 201 let t5; 202 if ($[14] !== customSetting || $[15] !== onChange || $[16] !== value) { 203 t5 = (day_0, to_0) => { 204 trackMethodCall("handleCustomDayToChange", [day_0, to_0]); 205 const updated_0 = { 206 ...customSetting, 207 [day_0]: { 208 ...customSetting[day_0], 209 to: to_0 210 } 211 }; 212 setCustomSetting(updated_0); 213 onChange({ 214 ...value, 215 customSetting: updated_0 216 }); 217 }; 218 $[14] = customSetting; 219 $[15] = onChange; 220 $[16] = value; 221 $[17] = t5; 222 } else t5 = $[17]; 223 const handleCustomDayToChange = t5; 224 let t6; 225 if ($[18] === Symbol.for("react.memo_cache_sentinel")) { 226 t6 = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectTrigger, { 227 className: "w-50", 228 children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectValue, { placeholder: "Select schedule" }) 229 }); 230 $[18] = t6; 231 } else t6 = $[18]; 232 let t7; 233 if ($[19] === Symbol.for("react.memo_cache_sentinel")) { 234 t7 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(SelectContent, { children: [
235 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItem, { 236 value: "Weekends", 237 children: "Weekends" 238 }), 239 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItem, { 240 value: "Weekdays", 241 children: "Weekdays" 242 }), 243 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItem, { 244 value: "7 days a week", 245 children: "7 days a week" 246 }), 247 /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItem, { 248 value: "Custom", 249 children: "Custom" 250 }) 251 ] }); 252 $[19] = t7; 253 } else t7 = $[19]; 254 let t8; 255 if ($[20] !== handleScheduleChange || $[21] !== scheduleLabel) { 256 t8 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Select, { 257 value: scheduleLabel, 258 onValueChange: handleScheduleChange, 259 children: [t6, t7] 260 }); 261 $[20] = handleScheduleChange; 262 $[21] = scheduleLabel; 263 $[22] = t8; 264 } else t8 = $[22]; 265 let t9; 266 if ($[23] !== handleFromChange || $[24] !== handleToChange || $[25] !== isCustom || $[26] !== value.from || $[27] !== value.to) { 267 t9 = !isCustom && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TimeInput, { 268 from: value.from, 269 to: value.to, 270 onFromChange: handleFromChange, 271 onToChange: handleToChange 272 }); 273 $[23] = handleFromChange; 274 $[24] = handleToChange; 275 $[25] = isCustom; 276 $[26] = value.from; 277 $[27] = value.to; 278 $[28] = t9; 279 } else t9 = $[28]; 280 let t10; 281 if ($[29] !== t8 || $[30] !== t9) { 282 t10 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 283 className: "flex items-center gap-5", 284 children: [t8, t9] 285 }); 286 $[29] = t8; 287 $[30] = t9; 288 $[31] = t10; 289 } else t10 = $[31]; 290 let t11; 291 if ($[32] !== isCustom || $[33] !== scheduleLabel || $[34] !== value.from || $[35] !== value.to) { 292 t11 = !isCustom && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { 293 className: "text-sm text-muted-foreground", 294 children: [ 295 "You won't receive alerts on ", 296 scheduleLabel, 297 ", from ", 298 value.from, 299 " until ", 300 value.to, 301 "." 302 ] 303 }); 304 $[32] = isCustom; 305 $[33] = scheduleLabel; 306 $[34] = value.from; 307 $[35] = value.to; 308 $[36] = t11; 309 } else t11 = $[36]; 310 let t12; 311 if ($[37] !== customSetting || $[38] !== handleCustomDayFromChange || $[39] !== handleCustomDayToChange || $[40] !== isCustom || $[41] !== value.customSetting) { 312 t12 = isCustom && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { 313 className: "flex flex-col gap-3", 314 children: DAYS_ORDER.map((day_1) => { 315 const dayTime = value.customSetting?.[day_1] ?? customSetting[day_1]; 316 return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 317 className: "flex items-center gap-4", 318 children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { 319 className: "w-24 text-sm font-medium text-foreground", 320 children: day_1 321 }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TimeInput, { 322 from: dayTime.from, 323 to: dayTime.to, 324 onFromChange: (v) => handleCustomDayFromChange(day_1, v), 325 onToChange: (v_0) => handleCustomDayToChange(day_1, v_0) 326 })] 327 }, day_1); 328 }) 329 }); 330 $[37] = customSetting; 331 $[38] = handleCustomDayFromChange; 332 $[39] = handleCustomDayToChange; 333 $[40] = isCustom; 334 $[41] = value.customSetting; 335 $[42] = t12; 336 } else t12 = $[42]; 337 let t13; 338 if ($[43] !== t10 || $[44] !== t11 || $[45] !== t12) { 339 t13 = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { 340 className: "flex flex-col gap-3", 341 children: [ 342 t10, 343 t11, 344 t12 345 ] 346 }); 347 $[43] = t10; 348 $[44] = t11; 349 $[45] = t12; 350 $[46] = t13; 351 } else t13 = $[46]; 352 return t13; 353}; 354export { DEFAULT_CUSTOM_SETTING as n, DEFAULT_DISALLOW_TIME as r, AlertTimePicker as t };
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.