diff --git a/web2/components/light/light-card.tsx b/web2/components/light/light-card.tsx index 88b73a21..428795c8 100644 --- a/web2/components/light/light-card.tsx +++ b/web2/components/light/light-card.tsx @@ -7,13 +7,13 @@ import { hsvaToRgba, rgbaToHsva } from "@uiw/color-convert"; import { Sun, Moon, Palette, X, Pencil } from "lucide-react"; import { Button } from "@/components/ui/button"; import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; -import { api } from "@/lib/api"; -import { useRateLimitMerge } from "@/hooks/use-rate-limit-merge"; +import { useUpdateState } from "@/hooks/use-update-state"; import { LightStatusIcon } from "./light-status-icon"; import { RemoteTypeCapabilities } from "./remote-data"; import { Input } from "@/components/ui/input"; import { z } from "zod"; import { schemas } from "@/api/api-zod"; +import { LightControl } from "./light-control"; export type NormalizedLightMode = "white" | "color" | "scene" | "night"; @@ -36,116 +36,13 @@ export function LightCard({ onClose, onNameChange, }: LightCardProps) { - const [rateLimitedState, setRateLimitedState, clearRateLimitedState] = - useRateLimitMerge< - z.infer - >({}, 500); - const lastUpdateTimeRef = useRef(0); - - const sendUpdate = async ( - state: z.infer - ) => { - const response = await api.putGatewaysDeviceIdRemoteTypeGroupId(state, { - params: { - remoteType: id.device_type, - deviceId: id.device_id, - groupId: id.group_id, - }, - queries: { - fmt: "normalized", - blockOnQueue: true, - }, - }); - if (response) { - _updateState( - response as Partial> - ); - } - }; - - const updateState = ( - newState: Partial> - ) => { - _updateState(newState); - const now = Date.now(); - if (now - lastUpdateTimeRef.current >= 500) { - // If it's been more than 500ms since the last update, send immediately - sendUpdate(newState); - lastUpdateTimeRef.current = now; - clearRateLimitedState(); - } else { - // Otherwise, buffer the update - setRateLimitedState((prevState) => ({ ...prevState, ...newState })); - } - }; - - const sendCommand = async ( - command: z.infer - ) => { - return await sendUpdate({ command: command }); - }; - - // useEffect to send updates when rateLimitedState changes - useEffect(() => { - if (Object.keys(rateLimitedState.value).length > 0) { - const now = Date.now(); - if (now - lastUpdateTimeRef.current >= 500) { - sendUpdate(rateLimitedState.value); - lastUpdateTimeRef.current = now; - clearRateLimitedState(); - } - } - }, [rateLimitedState]); - + const { updateState } = useUpdateState(id, _updateState); + const [isEditing, setIsEditing] = useState(false); + const [editedName, setEditedName] = useState(name); const handleSwitchChange = (checked: boolean) => { updateState({ state: checked ? "ON" : "OFF" }); }; - const handleBrightnessChange = (value: number[]) => { - updateState({ level: value[0] }); - }; - - const handleColorTempChange = (value: number[]) => { - updateState({ kelvin: value[0] }); - _updateState({ color_mode: schemas.ColorMode.Values.color_temp }); - }; - - const handleColorChange = (color: { - hsva: { h: number; s: number; v: number; a: number }; - }) => { - const rgba = hsvaToRgba(color.hsva); - updateState({ - color: { r: rgba.r, g: rgba.g, b: rgba.b }, - }); - _updateState({ color_mode: schemas.ColorMode.Values.rgb }); - }; - - const convertedColor = rgbaToHsva( - state.color ? { ...state.color, a: 1 } : { r: 255, g: 255, b: 255, a: 1 } - ); - - const handleModeChange = (value: z.infer) => { - _updateState({ color_mode: value }); - if (value === schemas.ColorMode.Values.color_temp) { - sendCommand(schemas.GroupStateCommand.Values.set_white); - } else if (value === schemas.ColorMode.Values.rgb) { - updateState({ - color: { - r: state.color?.r || 255, - g: state.color?.g || 0, - b: state.color?.b || 255, - }, - }); - } else if (value === schemas.ColorMode.Values.onoff) { - sendCommand(schemas.GroupStateCommand.Values.night_mode); - } - }; - - const capabilities = RemoteTypeCapabilities[id.device_type]; - - const [isEditing, setIsEditing] = useState(false); - const [editedName, setEditedName] = useState(name); - const handleNameEdit = () => { setIsEditing(true); }; @@ -202,97 +99,11 @@ export function LightCard({ - {state.state === "ON" ? ( -
- {capabilities.color && ( -
-
- -
-
- -
-
- )} - {capabilities.brightness && ( -
- - -
- )} - {capabilities.colorTemp && ( -
- - -
- )} -
-
Mode
- - {capabilities.colorTemp && ( - - - White - - )} - {capabilities.color && ( - - - Color - - )} - - - Night - - -
-
- ) : ( -
-

Light is off

-
- )} -
-
- - -
+
); diff --git a/web2/components/light/light-control.tsx b/web2/components/light/light-control.tsx new file mode 100644 index 00000000..2324a396 --- /dev/null +++ b/web2/components/light/light-control.tsx @@ -0,0 +1,220 @@ +import React from "react"; +import { Slider } from "@/components/ui/slider"; +import Wheel from "@uiw/react-color-wheel"; +import { hsvaToRgba, rgbaToHsva } from "@uiw/color-convert"; +import { Sun, Moon, Palette } from "lucide-react"; +import { Button } from "@/components/ui/button"; +import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; +import { RemoteTypeCapabilities } from "./remote-data"; +import { z } from "zod"; +import { schemas } from "@/api/api-zod"; +import { getGroupCountForRemoteType } from "@/lib/utils"; + +interface LightControlProps { + state: z.infer; + capabilities: typeof RemoteTypeCapabilities[keyof typeof RemoteTypeCapabilities]; + updateState: (payload: Partial>) => void; + deviceType?: z.infer; + onGroupChange?: (groupId: number) => void; + currentGroupId?: number; +} + +export function LightControl({ + state, + capabilities, + updateState, + deviceType, + onGroupChange, + currentGroupId, +}: LightControlProps) { + const handleBrightnessChange = (value: number[]) => { + updateState({ level: value[0] }); + }; + + const handleColorTempChange = (value: number[]) => { + updateState({ kelvin: value[0] }); + updateState({ color_mode: schemas.ColorMode.Values.color_temp }); + }; + + const handleColorChange = (color: { + hsva: { h: number; s: number; v: number; a: number }; + }) => { + const rgba = hsvaToRgba(color.hsva); + updateState({ + color: { r: rgba.r, g: rgba.g, b: rgba.b }, + }); + updateState({ color_mode: schemas.ColorMode.Values.rgb }); + }; + + const sendCommand = (command: z.infer) => { + updateState({ command: command }); + }; + + const convertedColor = rgbaToHsva( + state.color ? { ...state.color, a: 1 } : { r: 255, g: 255, b: 255, a: 1 } + ); + + const handleModeChange = (value: z.infer) => { + updateState({ color_mode: value }); + if (value === schemas.ColorMode.Values.color_temp) { + sendCommand(schemas.GroupStateCommand.Values.set_white); + } else if (value === schemas.ColorMode.Values.rgb) { + updateState({ + color: { + r: state.color?.r || 255, + g: state.color?.g || 0, + b: state.color?.b || 255, + }, + }); + } else if (value === schemas.ColorMode.Values.onoff) { + sendCommand(schemas.GroupStateCommand.Values.night_mode); + } + }; + + const handleModeIncrement = () => { + updateState({ command: schemas.GroupStateCommand.Values.next_mode }); + }; + + const handleModeDecrement = () => { + updateState({ command: schemas.GroupStateCommand.Values.previous_mode }); + }; + + const handleSpeedIncrement = () => { + updateState({ command: schemas.GroupStateCommand.Values.mode_speed_up }); + }; + + const handleSpeedDecrement = () => { + updateState({ command: schemas.GroupStateCommand.Values.mode_speed_down }); + }; + + const groupCount = deviceType ? getGroupCountForRemoteType(deviceType) : 4; + + return ( +
+ {onGroupChange && ( +
+ + onGroupChange(parseInt(value, 10))} + className="justify-start mt-2" + > + {Array.from({ length: groupCount }, (_, i) => ( + + {i + 1} + + ))} + +
+ )} + {state.state === "ON" ? ( + <> + {capabilities.color && ( +
+
+ +
+
+ +
+
+ )} + {capabilities.brightness && ( +
+ + +
+ )} + {capabilities.colorTemp && ( +
+ + +
+ )} +
+
Mode
+ + {capabilities.colorTemp && ( + + + White + + )} + {capabilities.color && ( + + + Color + + )} + + + Night + + +
+
+
Scene
+
+
+ +
Scene
+ +
+
+ +
Speed
+ +
+
+
+
+
+ + +
+ + ) : ( +
+

Light is off

+
+ )} +
+ ); +} \ No newline at end of file diff --git a/web2/components/light/light-list.tsx b/web2/components/light/light-list.tsx index 712f6c1c..b23a6077 100644 --- a/web2/components/light/light-list.tsx +++ b/web2/components/light/light-list.tsx @@ -194,7 +194,7 @@ export function LightList() { ) : ( - lightStates.lights.map((light, index) => ( + lightStates.lights.filter((light) => !light.ephemeral).map((light, index) => (
; + state: z.infer; + _updateState: ( + newState: Partial> + ) => void; +}) { + const { updateState } = useUpdateState(bulbId, _updateState); + + return ( + + ); +} + +export function ManualControlCard() { + const { lightStates, dispatch } = useLightState(); + const [deviceId, setDeviceId] = useState(""); + const [deviceType, setDeviceType] = useState(""); + const [groupId, setGroupId] = useState(0); + const [initialized, setInitialized] = useState(false); + + useEffect(() => { + if (deviceId && deviceType && groupId) { + setInitialized(true); + } else { + setInitialized(false); + } + }, [deviceId, deviceType, groupId]); + + const updateState = ( + newState: Partial> + ) => { + if (initialized) { + console.log("updateState", newState); + dispatch({ + type: "UPDATE_STATE", + device: { + device_id: parseDeviceId(deviceId), + device_type: deviceType, + group_id: groupId, + }, + payload: newState, + }); + } + }; + + const currentLightState = lightStates.lights.find( + (light) => + light.device.device_id === parseDeviceId(deviceId) && + light.device.device_type === deviceType && + light.device.group_id === groupId + )?.state || { + state: "OFF", + level: 0, + color_mode: schemas.ColorMode.Values.onoff, + }; + + const handleAliasSelect = ( + light: z.infer + ) => { + setDeviceId(light.device.device_id.toString()); + setDeviceType(light.device.device_type); + setGroupId(light.device.group_id); + }; + + return ( + + +
+ Manual Control + {initialized && ( + + updateState({ state: checked ? "ON" : "OFF" }) + } + /> + )} +
+ + setDeviceId(e.target.value)} + /> + + setGroupId(parseInt(value, 10))} + > + {deviceType && + Array.from( + { + length: getGroupCountForRemoteType( + deviceType as z.infer + ), + }, + (_, i) => ( + + {i + 1} + + ) + )} + +
+ {initialized && ( + + + } + state={currentLightState} + _updateState={updateState} + /> + + )} +
+ ); +} diff --git a/web2/components/light/new-light-form.tsx b/web2/components/light/new-light-form.tsx index 603e409b..cbe27581 100644 --- a/web2/components/light/new-light-form.tsx +++ b/web2/components/light/new-light-form.tsx @@ -23,6 +23,7 @@ import { import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group"; import { RemoteTypeDescriptions } from "@/components/light/remote-data"; import { schemas } from "@/api"; +import { getGroupCountForRemoteType, parseDeviceId } from "@/lib/utils"; const schema = z.object({ name: z.string().min(1, { message: "Name is required." }), @@ -38,20 +39,6 @@ interface NewLightFormProps { onSubmit: (data: z.infer) => void; } -const getGroupCountForRemoteType = ( - remoteType: z.infer -): number => { - // Stub function - replace with actual logic - switch (remoteType) { - case schemas.RemoteType.Values.fut089: - return 8; - case schemas.RemoteType.Values.rgb: - return 1; - default: - return 4; - } -}; - export function NewLightForm({ onSubmit }: NewLightFormProps) { const form = useForm>({ resolver: zodResolver(schema), @@ -61,9 +48,7 @@ export function NewLightForm({ onSubmit }: NewLightFormProps) { }); const handleSubmit = (data: z.infer) => { - const parsedDeviceId = data.device_id.startsWith("0x") - ? parseInt(data.device_id, 16) - : parseInt(data.device_id, 10); + const parsedDeviceId = parseDeviceId(data.device_id); const parsedData = { ...data, diff --git a/web2/components/light/state.ts b/web2/components/light/state.ts index c7d9fa6d..7ebd3aa5 100644 --- a/web2/components/light/state.ts +++ b/web2/components/light/state.ts @@ -4,7 +4,7 @@ import { schemas } from "@/api/api-zod"; import { z } from "zod"; export interface LightIndexState { - lights: z.infer[]; + lights: (z.infer & { ephemeral: boolean })[]; isLoading: boolean; } @@ -56,14 +56,32 @@ export function reducer( ): LightIndexState { switch (action.type) { case "UPDATE_STATE": - return { - ...state, - lights: state.lights.map((light) => - devicesAreEqual(light.device, action.device) - ? { ...light, state: { ...light.state, ...action.payload } } - : light - ), - }; + const lightExists = state.lights.some((light) => + devicesAreEqual(light.device, action.device) + ); + + if (lightExists) { + return { + ...state, + lights: state.lights.map((light) => + devicesAreEqual(light.device, action.device) + ? { ...light, state: { ...light.state, ...action.payload } } + : light + ), + }; + } else { + const newLight: z.infer & { + ephemeral: boolean; + } = { + device: { ...action.device } as z.infer["device"], + state: { ...action.payload }, + ephemeral: true, + }; + return { + ...state, + lights: [...state.lights, newLight], + }; + } case "UPDATE_ALL_STATE": return { ...state, @@ -75,7 +93,10 @@ export function reducer( case "SET_LIGHTS": return { ...state, - lights: action.lights, + lights: action.lights.map((light) => ({ + ...light, + ephemeral: false, + })), isLoading: false, }; case "DELETE_LIGHT": @@ -86,7 +107,6 @@ export function reducer( ), }; case "ADD_LIGHT": - console.log(action.device); const device = { id: action.device.id!, device_id: action.device.device_id!, @@ -96,7 +116,7 @@ export function reducer( }; return { ...state, - lights: [...state.lights, { device, state: { state: "OFF" } }], + lights: [...state.lights, { device, state: { state: "OFF" }, ephemeral: false }], }; case "UPDATE_LIGHT_NAME": return { diff --git a/web2/dist/versions/1.0.8/bundle.css b/web2/dist/versions/1.0.8/bundle.css new file mode 100644 index 00000000..b9a82e9e --- /dev/null +++ b/web2/dist/versions/1.0.8/bundle.css @@ -0,0 +1 @@ +:root{--background: 0 0% 100%;--foreground: 222.2 84% 4.9%;--card: 0 0% 100%;--card-foreground: 222.2 84% 4.9%;--popover: 0 0% 100%;--popover-foreground: 222.2 84% 4.9%;--primary: 222.2 47.4% 11.2%;--primary-foreground: 210 40% 98%;--secondary: 210 40% 96.1%;--secondary-foreground: 222.2 47.4% 11.2%;--muted: 210 40% 96.1%;--muted-foreground: 215.4 16.3% 46.9%;--accent: 210 40% 96.1%;--accent-foreground: 222.2 47.4% 11.2%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 210 40% 98%;--border: 214.3 31.8% 91.4%;--input: 214.3 31.8% 91.4%;--ring: 222.2 84% 4.9%;--radius: .5rem;--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%}.dark{--background: 222.2 84% 4.9%;--foreground: 210 40% 98%;--card: 222.2 84% 4.9%;--card-foreground: 210 40% 98%;--popover: 222.2 84% 4.9%;--popover-foreground: 210 40% 98%;--primary: 210 40% 98%;--primary-foreground: 222.2 47.4% 11.2%;--secondary: 217.2 32.6% 17.5%;--secondary-foreground: 210 40% 98%;--muted: 217.2 32.6% 17.5%;--muted-foreground: 215 20.2% 65.1%;--accent: 217.2 32.6% 17.5%;--accent-foreground: 210 40% 98%;--destructive: 0 62.8% 30.6%;--destructive-foreground: 210 40% 98%;--border: 217.2 32.6% 17.5%;--input: 217.2 32.6% 17.5%;--ring: 212.7 26.8% 83.9%;--chart-1: 220 70% 50%;--chart-2: 160 60% 45%;--chart-3: 30 80% 55%;--chart-4: 280 65% 60%;--chart-5: 340 75% 55%}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}[type=text],input:where(:not([type])),[type=email],[type=url],[type=password],[type=number],[type=date],[type=datetime-local],[type=month],[type=search],[type=tel],[type=time],[type=week],[multiple],textarea,select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-width:1px;border-radius:0;padding:.5rem .75rem;font-size:1rem;line-height:1.5rem;--tw-shadow: 0 0 #0000}[type=text]:focus,input:where(:not([type])):focus,[type=email]:focus,[type=url]:focus,[type=password]:focus,[type=number]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=month]:focus,[type=search]:focus,[type=tel]:focus,[type=time]:focus,[type=week]:focus,[multiple]:focus,textarea:focus,select:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);border-color:#2563eb}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-top:0;padding-bottom:0}select{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size="1"])){background-image:initial;background-position:initial;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;display:inline-block;vertical-align:middle;background-origin:border-box;-webkit-user-select:none;-moz-user-select:none;user-select:none;flex-shrink:0;height:1rem;width:1rem;color:#2563eb;background-color:#fff;border-color:#6b7280;border-width:1px;--tw-shadow: 0 0 #0000}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{outline:2px solid transparent;outline-offset:2px;--tw-ring-inset: var(--tw-empty, );--tw-ring-offset-width: 2px;--tw-ring-offset-color: #fff;--tw-ring-color: #2563eb;--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}[type=checkbox]:checked,[type=radio]:checked{border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}[type=checkbox]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e")}@media (forced-colors: active){[type=checkbox]:checked{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=radio]:checked{background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e")}@media (forced-colors: active){[type=radio]:checked{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=checkbox]:checked:hover,[type=checkbox]:checked:focus,[type=radio]:checked:hover,[type=radio]:checked:focus{border-color:transparent;background-color:currentColor}[type=checkbox]:indeterminate{background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e");border-color:transparent;background-color:currentColor;background-size:100% 100%;background-position:center;background-repeat:no-repeat}@media (forced-colors: active){[type=checkbox]:indeterminate{-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}}[type=checkbox]:indeterminate:hover,[type=checkbox]:indeterminate:focus{border-color:transparent;background-color:currentColor}[type=file]{background:unset;border-color:inherit;border-width:0;border-radius:0;padding:0;font-size:unset;line-height:inherit}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width: 1400px){.container{max-width:1400px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{inset:0}.left-0{left:0}.left-2{left:.5rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-2{right:.5rem}.top-0{top:0}.top-2{top:.5rem}.top-\[1px\]{top:1px}.top-\[50\%\]{top:50%}.top-\[60\%\]{top:60%}.top-full{top:100%}.z-10{z-index:10}.z-50{z-index:50}.z-\[100\]{z-index:100}.z-\[1\]{z-index:1}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.-mx-4{margin-left:-1rem;margin-right:-1rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-10{margin-top:2.5rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-8{margin-top:2rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.contents{display:contents}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-24{height:6rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[calc\(100vh-2rem\)\]{height:calc(100vh - 2rem)}.h-\[var\(--radix-navigation-menu-viewport-height\)\]{height:var(--radix-navigation-menu-viewport-height)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-96{max-height:24rem}.max-h-\[300px\]{max-height:300px}.max-h-screen{max-height:100vh}.\!min-h-9{min-height:2.25rem!important}.min-h-10{min-height:2.5rem}.min-h-96{min-height:24rem}.w-1\/2{width:50%}.w-1\/5{width:20%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/5{width:60%}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-72{width:18rem}.w-96{width:24rem}.w-\[150px\]{width:150px}.w-\[160px\]{width:160px}.w-\[180px\]{width:180px}.w-\[200px\]{width:200px}.w-\[250px\]{width:250px}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.min-w-96{min-width:24rem}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-72{max-width:18rem}.max-w-96{max-width:24rem}.max-w-max{max-width:-moz-max-content;max-width:max-content}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.flex-grow,.grow{flex-grow:1}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate: 45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x: 1;--tw-scale-y: 1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.\!cursor-default{cursor:default!important}.cursor-default{cursor:default}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-none{touch-action:none}.\!select-none{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-none{list-style-type:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-\[3fr_3fr_3fr_1fr\]{grid-template-columns:3fr 3fr 3fr 1fr}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-normal{justify-content:normal}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.25rem * var(--tw-space-x-reverse));margin-left:calc(.25rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-10>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2.5rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-\[inherit\]{border-radius:inherit}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-l-none{border-top-left-radius:0;border-bottom-left-radius:0}.rounded-r-none{border-top-right-radius:0;border-bottom-right-radius:0}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-none{border-style:none}.border-border{border-color:hsl(var(--border))}.border-destructive{border-color:hsl(var(--destructive))}.border-destructive\/50{border-color:hsl(var(--destructive) / .5)}.border-gray-400{--tw-border-opacity: 1;border-color:rgb(156 163 175 / var(--tw-border-opacity))}.border-input{border-color:hsl(var(--input))}.border-primary{border-color:hsl(var(--primary))}.border-transparent{border-color:transparent}.border-l-transparent{border-left-color:transparent}.border-t-transparent{border-top-color:transparent}.bg-accent{background-color:hsl(var(--accent))}.bg-background{background-color:hsl(var(--background))}.bg-black\/80{background-color:#000c}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-transparent{background-color:transparent}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\[1px\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.pb-4{padding-bottom:1rem}.pl-3{padding-left:.75rem}.pl-8{padding-left:2rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-10{padding-top:2.5rem}.text-left{text-align:left}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.\!text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-2xl{font-size:1.5rem;line-height:2rem}.text-6xl{font-size:3.75rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-accent-foreground{color:hsl(var(--accent-foreground))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity))}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}.text-slate-900{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.decoration-2{text-decoration-thickness:2px}.underline-offset-4{text-underline-offset:4px}.underline-offset-8{text-underline-offset:8px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.\!outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-ring{--tw-ring-color: hsl(var(--ring))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:cursor-pointer:hover{cursor:pointer}.hover\:border-none:hover{border-style:none}.hover\:border-slate-400:hover{--tw-border-opacity: 1;border-color:rgb(148 163 184 / var(--tw-border-opacity))}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive) / .8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted:hover{background-color:hsl(var(--muted))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary) / .8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-red-100:hover{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity))}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-transparent:hover{background-color:transparent}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.hover\:text-muted-foreground:hover{color:hsl(var(--muted-foreground))}.hover\:text-red-700:hover{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity))}.hover\:text-slate-900:hover{--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-background:focus-visible{--tw-ring-offset-color: hsl(var(--background))}.active\:bg-accent\/90:active{background-color:hsl(var(--accent) / .9)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\=true\]\:pointer-events-none[data-disabled=true],.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:translate-x-5[data-state=checked]{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=unchecked\]\:translate-x-0[data-state=unchecked],.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[active\]\:bg-accent\/50[data-active]{background-color:hsl(var(--accent) / .5)}.data-\[selected\=\'true\'\]\:bg-accent[data-selected=true]{background-color:hsl(var(--accent))}.data-\[state\=checked\]\:bg-primary[data-state=checked]{background-color:hsl(var(--primary))}.data-\[state\=on\]\:bg-accent[data-state=on],.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-accent\/50[data-state=open]{background-color:hsl(var(--accent) / .5)}.data-\[state\=unchecked\]\:bg-input[data-state=unchecked]{background-color:hsl(var(--input))}.data-\[selected\=true\]\:text-accent-foreground[data-selected=true],.data-\[state\=on\]\:text-accent-foreground[data-state=on]{color:hsl(var(--accent-foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\=true\]\:opacity-50[data-disabled=true],.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[motion\^\=from-\]\:animate-in[data-motion^=from-],.data-\[state\=open\]\:animate-in[data-state=open],.data-\[state\=visible\]\:animate-in[data-state=visible]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[motion\^\=to-\]\:animate-out[data-motion^=to-],.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[state\=hidden\]\:animate-out[data-state=hidden],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[motion\^\=from-\]\:fade-in[data-motion^=from-]{--tw-enter-opacity: 0}.data-\[motion\^\=to-\]\:fade-out[data-motion^=to-],.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=hidden\]\:fade-out[data-state=hidden]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open],.data-\[state\=visible\]\:fade-in[data-state=visible]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-90[data-state=open]{--tw-enter-scale: .9}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[motion\=from-end\]\:slide-in-from-right-52[data-motion=from-end]{--tw-enter-translate-x: 13rem}.data-\[motion\=from-start\]\:slide-in-from-left-52[data-motion=from-start]{--tw-enter-translate-x: -13rem}.data-\[motion\=to-end\]\:slide-out-to-right-52[data-motion=to-end]{--tw-exit-translate-x: 13rem}.data-\[motion\=to-start\]\:slide-out-to-left-52[data-motion=to-start]{--tw-exit-translate-x: -13rem}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right-full[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.group[data-state=open] .group-data-\[state\=open\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}.dark\:text-slate-100:is(.dark *){--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity))}.dark\:text-slate-400:is(.dark *){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}.dark\:hover\:border-slate-500:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity))}.dark\:hover\:text-slate-100:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(241 245 249 / var(--tw-text-opacity))}.dark\:hover\:text-slate-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}@media (min-width: 640px){.sm\:bottom-0{bottom:0}.sm\:right-0{right:0}.sm\:top-auto{top:auto}.sm\:flex-row{flex-direction:row}.sm\:flex-col{flex-direction:column}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}.data-\[state\=open\]\:sm\:slide-in-from-bottom-full[data-state=open]{--tw-enter-translate-y: 100%}}@media (min-width: 768px){.md\:absolute{position:absolute}.md\:w-\[var\(--radix-navigation-menu-viewport-width\)\]{width:var(--radix-navigation-menu-viewport-width)}.md\:w-auto{width:auto}.md\:max-w-\[420px\]{max-width:420px}}@media (min-width: 1024px){.lg\:flex-row{flex-direction:row}.lg\:flex-col{flex-direction:column}.lg\:space-x-0>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(0px * var(--tw-space-x-reverse));margin-left:calc(0px * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-x-12>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(3rem * var(--tw-space-x-reverse));margin-left:calc(3rem * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.lg\:space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.lg\:space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}}@media (min-width: 1280px){.xl\:w-1\/5{width:20%}}.dark\:\[\&\:not\(\:has\(svg\)\)\]\:text-red-500:not(:has(svg)):is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.dark\:\[\&\>\*\]\:text-red-500>*:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y: -3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.dark\:\[\&\>svg\]\:text-red-500>svg:is(.dark *){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&_\[cmdk-group-heading\]\]\:px-2 [cmdk-group-heading]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-group-heading\]\]\:py-1\.5 [cmdk-group-heading]{padding-top:.375rem;padding-bottom:.375rem}.\[\&_\[cmdk-group-heading\]\]\:text-xs [cmdk-group-heading]{font-size:.75rem;line-height:1rem}.\[\&_\[cmdk-group-heading\]\]\:font-medium [cmdk-group-heading]{font-weight:500}.\[\&_\[cmdk-group-heading\]\]\:text-muted-foreground [cmdk-group-heading]{color:hsl(var(--muted-foreground))}.\[\&_\[cmdk-group\]\:not\(\[hidden\]\)_\~\[cmdk-group\]\]\:pt-0 [cmdk-group]:not([hidden])~[cmdk-group]{padding-top:0}.\[\&_\[cmdk-group\]\]\:px-2 [cmdk-group]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:h-5 [cmdk-input-wrapper] svg{height:1.25rem}.\[\&_\[cmdk-input-wrapper\]_svg\]\:w-5 [cmdk-input-wrapper] svg{width:1.25rem}.\[\&_\[cmdk-input\]\]\:h-12 [cmdk-input]{height:3rem}.\[\&_\[cmdk-item\]\]\:px-2 [cmdk-item]{padding-left:.5rem;padding-right:.5rem}.\[\&_\[cmdk-item\]\]\:py-3 [cmdk-item]{padding-top:.75rem;padding-bottom:.75rem}.\[\&_\[cmdk-item\]_svg\]\:h-5 [cmdk-item] svg{height:1.25rem}.\[\&_\[cmdk-item\]_svg\]\:w-5 [cmdk-item] svg{width:1.25rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625} diff --git a/web2/dist/versions/1.0.8/bundle.js b/web2/dist/versions/1.0.8/bundle.js new file mode 100644 index 00000000..09e03f6b --- /dev/null +++ b/web2/dist/versions/1.0.8/bundle.js @@ -0,0 +1,351 @@ +"use strict";(()=>{var vB=Object.create;var f4=Object.defineProperty;var CB=Object.getOwnPropertyDescriptor;var wB=Object.getOwnPropertyNames;var xB=Object.getPrototypeOf,yB=Object.prototype.hasOwnProperty;var kt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bB=(e,t)=>{for(var r in t)f4(e,r,{get:t[r],enumerable:!0})},LB=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of wB(t))!yB.call(e,n)&&n!==r&&f4(e,n,{get:()=>t[n],enumerable:!(o=CB(t,n))||o.enumerable});return e};var B=(e,t,r)=>(r=e!=null?vB(xB(e)):{},LB(t||!e||!e.__esModule?f4(r,"default",{value:e,enumerable:!0}):r,e));var tw=kt(Qe=>{"use strict";var Fc=Symbol.for("react.element"),IB=Symbol.for("react.portal"),SB=Symbol.for("react.fragment"),RB=Symbol.for("react.strict_mode"),_B=Symbol.for("react.profiler"),AB=Symbol.for("react.provider"),MB=Symbol.for("react.context"),TB=Symbol.for("react.forward_ref"),PB=Symbol.for("react.suspense"),kB=Symbol.for("react.memo"),EB=Symbol.for("react.lazy"),zC=Symbol.iterator;function OB(e){return e===null||typeof e!="object"?null:(e=zC&&e[zC]||e["@@iterator"],typeof e=="function"?e:null)}var $C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},XC=Object.assign,qC={};function El(e,t,r){this.props=e,this.context=t,this.refs=qC,this.updater=r||$C}El.prototype.isReactComponent={};El.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};El.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function YC(){}YC.prototype=El.prototype;function m4(e,t,r){this.props=e,this.context=t,this.refs=qC,this.updater=r||$C}var h4=m4.prototype=new YC;h4.constructor=m4;XC(h4,El.prototype);h4.isPureReactComponent=!0;var jC=Array.isArray,JC=Object.prototype.hasOwnProperty,g4={current:null},QC={key:!0,ref:!0,__self:!0,__source:!0};function KC(e,t,r){var o,n={},a=null,s=null;if(t!=null)for(o in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(a=""+t.key),t)JC.call(t,o)&&!QC.hasOwnProperty(o)&&(n[o]=t[o]);var u=arguments.length-2;if(u===1)n.children=r;else if(1{"use strict";rw.exports=tw()});var fw=kt(Zt=>{"use strict";function y4(e,t){var r=e.length;e.push(t);e:for(;0>>1,n=e[o];if(0>>1;oB2(u,r))cB2(d,u)?(e[o]=d,e[c]=r,o=c):(e[o]=u,e[s]=r,o=s);else if(cB2(d,r))e[o]=d,e[c]=r,o=c;else break e}}return t}function B2(e,t){var r=e.sortIndex-t.sortIndex;return r!==0?r:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(ow=performance,Zt.unstable_now=function(){return ow.now()}):(C4=Date,nw=C4.now(),Zt.unstable_now=function(){return C4.now()-nw});var ow,C4,nw,Ma=[],Xi=[],NB=1,Tn=null,eo=3,W2=!1,us=!1,Nc=!1,sw=typeof setTimeout=="function"?setTimeout:null,lw=typeof clearTimeout=="function"?clearTimeout:null,aw=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b4(e){for(var t=ta(Xi);t!==null;){if(t.callback===null)G2(Xi);else if(t.startTime<=e)G2(Xi),t.sortIndex=t.expirationTime,y4(Ma,t);else break;t=ta(Xi)}}function L4(e){if(Nc=!1,b4(e),!us)if(ta(Ma)!==null)us=!0,S4(I4);else{var t=ta(Xi);t!==null&&R4(L4,t.startTime-e)}}function I4(e,t){us=!1,Nc&&(Nc=!1,lw(Bc),Bc=-1),W2=!0;var r=eo;try{for(b4(t),Tn=ta(Ma);Tn!==null&&(!(Tn.expirationTime>t)||e&&!dw());){var o=Tn.callback;if(typeof o=="function"){Tn.callback=null,eo=Tn.priorityLevel;var n=o(Tn.expirationTime<=t);t=Zt.unstable_now(),typeof n=="function"?Tn.callback=n:Tn===ta(Ma)&&G2(Ma),b4(t)}else G2(Ma);Tn=ta(Ma)}if(Tn!==null)var a=!0;else{var s=ta(Xi);s!==null&&R4(L4,s.startTime-t),a=!1}return a}finally{Tn=null,eo=r,W2=!1}}var z2=!1,Z2=null,Bc=-1,uw=5,cw=-1;function dw(){return!(Zt.unstable_now()-cwe||125o?(e.sortIndex=r,y4(Xi,e),ta(Ma)===null&&e===ta(Xi)&&(Nc?(lw(Bc),Bc=-1):Nc=!0,R4(L4,r-o))):(e.sortIndex=n,y4(Ma,e),us||W2||(us=!0,S4(I4))),e};Zt.unstable_shouldYield=dw;Zt.unstable_wrapCallback=function(e){var t=eo;return function(){var r=eo;eo=t;try{return e.apply(this,arguments)}finally{eo=r}}}});var mw=kt((Eee,pw)=>{"use strict";pw.exports=fw()});var Cb=kt(dn=>{"use strict";var BB=j(),un=mw();function te(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),q4=Object.prototype.hasOwnProperty,ZB=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,hw={},gw={};function GB(e){return q4.call(gw,e)?!0:q4.call(hw,e)?!1:ZB.test(e)?gw[e]=!0:(hw[e]=!0,!1)}function WB(e,t,r,o){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function zB(e,t,r,o){if(t===null||typeof t>"u"||WB(e,t,r,o))return!0;if(o)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function wo(e,t,r,o,n,a,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=s}var $r={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){$r[e]=new wo(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];$r[t]=new wo(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){$r[e]=new wo(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){$r[e]=new wo(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){$r[e]=new wo(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){$r[e]=new wo(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){$r[e]=new wo(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){$r[e]=new wo(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){$r[e]=new wo(e,5,!1,e.toLowerCase(),null,!1,!1)});var Z8=/[\-:]([a-z])/g;function G8(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Z8,G8);$r[t]=new wo(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Z8,G8);$r[t]=new wo(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Z8,G8);$r[t]=new wo(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){$r[e]=new wo(e,1,!1,e.toLowerCase(),null,!1,!1)});$r.xlinkHref=new wo("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){$r[e]=new wo(e,1,!1,e.toLowerCase(),null,!0,!0)});function W8(e,t,r,o){var n=$r.hasOwnProperty(t)?$r[t]:null;(n!==null?n.type!==0:o||!(2u||n[s]!==a[u]){var c=` +`+n[s].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=s&&0<=u);break}}}finally{A4=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?qc(e):""}function jB(e){switch(e.tag){case 5:return qc(e.type);case 16:return qc("Lazy");case 13:return qc("Suspense");case 19:return qc("SuspenseList");case 0:case 2:case 15:return e=M4(e.type,!1),e;case 11:return e=M4(e.type.render,!1),e;case 1:return e=M4(e.type,!0),e;default:return""}}function K4(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Fl:return"Fragment";case Vl:return"Portal";case Y4:return"Profiler";case z8:return"StrictMode";case J4:return"Suspense";case Q4:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Lx:return(e.displayName||"Context")+".Consumer";case bx:return(e._context.displayName||"Context")+".Provider";case j8:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U8:return t=e.displayName||null,t!==null?t:K4(e.type)||"Memo";case Yi:t=e._payload,e=e._init;try{return K4(e(t))}catch{}}return null}function UB(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return K4(t);case 8:return t===z8?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function c1(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Sx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $B(e){var t=Sx(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(s){o=""+s,a.call(this,s)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return o},setValue:function(s){o=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function U2(e){e._valueTracker||(e._valueTracker=$B(e))}function Rx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),o="";return e&&(o=Sx(e)?e.checked?"true":"false":e.value),e=o,e!==r?(t.setValue(e),!0):!1}function yf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function e8(e,t){var r=t.checked;return rr({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Cw(e,t){var r=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;r=c1(t.value!=null?t.value:r),e._wrapperState={initialChecked:o,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function _x(e,t){t=t.checked,t!=null&&W8(e,"checked",t,!1)}function t8(e,t){_x(e,t);var r=c1(t.value),o=t.type;if(r!=null)o==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?r8(e,t.type,r):t.hasOwnProperty("defaultValue")&&r8(e,t.type,c1(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ww(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function r8(e,t,r){(t!=="number"||yf(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Yc=Array.isArray;function Xl(e,t,r,o){if(e=e.options,t){t={};for(var n=0;n"+t.valueOf().toString()+"",t=$2.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ud(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Kc={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},XB=["Webkit","ms","Moz","O"];Object.keys(Kc).forEach(function(e){XB.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Kc[t]=Kc[e]})});function Px(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Kc.hasOwnProperty(e)&&Kc[e]?(""+t).trim():t+"px"}function kx(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var o=r.indexOf("--")===0,n=Px(r,t[r],o);r==="float"&&(r="cssFloat"),o?e.setProperty(r,n):e[r]=n}}var qB=rr({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function a8(e,t){if(t){if(qB[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(te(62))}}function i8(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var s8=null;function $8(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var l8=null,ql=null,Yl=null;function bw(e){if(e=_d(e)){if(typeof l8!="function")throw Error(te(280));var t=e.stateNode;t&&(t=qf(t),l8(e.stateNode,e.type,t))}}function Ex(e){ql?Yl?Yl.push(e):Yl=[e]:ql=e}function Ox(){if(ql){var e=ql,t=Yl;if(Yl=ql=null,bw(e),t)for(e=0;e>>=0,e===0?32:31-(iZ(e)/sZ|0)|0}var X2=64,q2=4194304;function Jc(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sf(e,t){var r=e.pendingLanes;if(r===0)return 0;var o=0,n=e.suspendedLanes,a=e.pingedLanes,s=r&268435455;if(s!==0){var u=s&~n;u!==0?o=Jc(u):(a&=s,a!==0&&(o=Jc(a)))}else s=r&~n,s!==0?o=Jc(s):a!==0&&(o=Jc(a));if(o===0)return 0;if(t!==0&&t!==o&&!(t&n)&&(n=o&-o,a=t&-t,n>=a||n===16&&(a&4194240)!==0))return t;if(o&4&&(o|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0r;r++)t.push(e);return t}function Sd(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ia(t),e[t]=r}function dZ(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var o=e.eventTimes;for(e=e.expirationTimes;0=td),Pw=" ",kw=!1;function ey(e,t){switch(e){case"keyup":return NZ.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ty(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Dl=!1;function ZZ(e,t){switch(e){case"compositionend":return ty(t);case"keypress":return t.which!==32?null:(kw=!0,Pw);case"textInput":return e=t.data,e===Pw&&kw?null:e;default:return null}}function GZ(e,t){if(Dl)return e==="compositionend"||!tp&&ey(e,t)?(e=Qx(),ff=Q8=e1=null,Dl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:r,offset:t-e};e=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Hw(r)}}function ay(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ay(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function iy(){for(var e=window,t=yf();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=yf(e.document)}return t}function rp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function JZ(e){var t=iy(),r=e.focusedElem,o=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&ay(r.ownerDocument.documentElement,r)){if(o!==null&&rp(r)){if(t=o.start,e=o.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var n=r.textContent.length,a=Math.min(o.start,n);o=o.end===void 0?a:Math.min(o.end,n),!e.extend&&a>o&&(n=o,o=a,a=n),n=Vw(r,a);var s=Vw(r,o);n&&s&&(e.rangeCount!==1||e.anchorNode!==n.node||e.anchorOffset!==n.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(n.node,n.offset),e.removeAllRanges(),a>o?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Nl=null,m8=null,od=null,h8=!1;function Fw(e,t,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;h8||Nl==null||Nl!==yf(o)||(o=Nl,"selectionStart"in o&&rp(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),od&&hd(od,o)||(od=o,o=Af(m8,"onSelect"),0Gl||(e.current=y8[Gl],y8[Gl]=null,Gl--)}function Gt(e,t){Gl++,y8[Gl]=e.current,e.current=t}var d1={},no=p1(d1),Do=p1(!1),vs=d1;function tu(e,t){var r=e.type.contextTypes;if(!r)return d1;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var n={},a;for(a in r)n[a]=t[a];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n),n}function No(e){return e=e.childContextTypes,e!=null}function Tf(){$t(Do),$t(no)}function Uw(e,t,r){if(no.current!==d1)throw Error(te(168));Gt(no,t),Gt(Do,r)}function hy(e,t,r){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return r;o=o.getChildContext();for(var n in o)if(!(n in t))throw Error(te(108,UB(e)||"Unknown",n));return rr({},r,o)}function Pf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||d1,vs=no.current,Gt(no,e),Gt(Do,Do.current),!0}function $w(e,t,r){var o=e.stateNode;if(!o)throw Error(te(169));r?(e=hy(e,t,vs),o.__reactInternalMemoizedMergedChildContext=e,$t(Do),$t(no),Gt(no,e)):$t(Do),Gt(Do,r)}var di=null,Yf=!1,B4=!1;function gy(e){di===null?di=[e]:di.push(e)}function sG(e){Yf=!0,gy(e)}function m1(){if(!B4&&di!==null){B4=!0;var e=0,t=At;try{var r=di;for(At=1;e>=s,n-=s,fi=1<<32-ia(t)+n|r<H?($=A,A=null):$=A.sibling;var U=v(C,A,I[H],_);if(U===null){A===null&&(A=$);break}e&&A&&U.alternate===null&&t(C,A),w=a(U,w,H),E===null?M=U:E.sibling=U,E=U,A=$}if(H===I.length)return r(C,A),Jt&&cs(C,H),M;if(A===null){for(;HH?($=A,A=null):$=A.sibling;var ee=v(C,A,U.value,_);if(ee===null){A===null&&(A=$);break}e&&A&&ee.alternate===null&&t(C,A),w=a(ee,w,H),E===null?M=ee:E.sibling=ee,E=ee,A=$}if(U.done)return r(C,A),Jt&&cs(C,H),M;if(A===null){for(;!U.done;H++,U=I.next())U=m(C,U.value,_),U!==null&&(w=a(U,w,H),E===null?M=U:E.sibling=U,E=U);return Jt&&cs(C,H),M}for(A=o(C,A);!U.done;H++,U=I.next())U=x(A,C,H,U.value,_),U!==null&&(e&&U.alternate!==null&&A.delete(U.key===null?H:U.key),w=a(U,w,H),E===null?M=U:E.sibling=U,E=U);return e&&A.forEach(function(W){return t(C,W)}),Jt&&cs(C,H),M}function b(C,w,I,_){if(typeof I=="object"&&I!==null&&I.type===Fl&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case j2:e:{for(var M=I.key,E=w;E!==null;){if(E.key===M){if(M=I.type,M===Fl){if(E.tag===7){r(C,E.sibling),w=n(E,I.props.children),w.return=C,C=w;break e}}else if(E.elementType===M||typeof M=="object"&&M!==null&&M.$$typeof===Yi&&Yw(M)===E.type){r(C,E.sibling),w=n(E,I.props),w.ref=jc(C,E,I),w.return=C,C=w;break e}r(C,E);break}else t(C,E);E=E.sibling}I.type===Fl?(w=gs(I.props.children,C.mode,_,I.key),w.return=C,C=w):(_=xf(I.type,I.key,I.props,null,C.mode,_),_.ref=jc(C,w,I),_.return=C,C=_)}return s(C);case Vl:e:{for(E=I.key;w!==null;){if(w.key===E)if(w.tag===4&&w.stateNode.containerInfo===I.containerInfo&&w.stateNode.implementation===I.implementation){r(C,w.sibling),w=n(w,I.children||[]),w.return=C,C=w;break e}else{r(C,w);break}else t(C,w);w=w.sibling}w=X4(I,C.mode,_),w.return=C,C=w}return s(C);case Yi:return E=I._init,b(C,w,E(I._payload),_)}if(Yc(I))return y(C,w,I,_);if(Zc(I))return g(C,w,I,_);sf(C,I)}return typeof I=="string"&&I!==""||typeof I=="number"?(I=""+I,w!==null&&w.tag===6?(r(C,w.sibling),w=n(w,I),w.return=C,C=w):(r(C,w),w=$4(I,C.mode,_),w.return=C,C=w),s(C)):r(C,w)}return b}var ou=xy(!0),yy=xy(!1),Of=p1(null),Hf=null,jl=null,ip=null;function sp(){ip=jl=Hf=null}function lp(e){var t=Of.current;$t(Of),e._currentValue=t}function I8(e,t,r){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===r)break;e=e.return}}function Ql(e,t){Hf=e,ip=jl=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Fo=!0),e.firstContext=null)}function Hn(e){var t=e._currentValue;if(ip!==e)if(e={context:e,memoizedValue:t,next:null},jl===null){if(Hf===null)throw Error(te(308));jl=e,Hf.dependencies={lanes:0,firstContext:e}}else jl=jl.next=e;return t}var ps=null;function up(e){ps===null?ps=[e]:ps.push(e)}function by(e,t,r,o){var n=t.interleaved;return n===null?(r.next=r,up(t)):(r.next=n.next,n.next=r),t.interleaved=r,vi(e,o)}function vi(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Ji=!1;function cp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ly(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function mi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function i1(e,t,r){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,pt&2){var n=o.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),o.pending=t,vi(e,r)}return n=o.interleaved,n===null?(t.next=t,up(o)):(t.next=n.next,n.next=t),o.interleaved=t,vi(e,r)}function mf(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,q8(e,r)}}function Jw(e,t){var r=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var n=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?n=a=s:a=a.next=s,r=r.next}while(r!==null);a===null?n=a=t:a=a.next=t}else n=a=t;r={baseState:o.baseState,firstBaseUpdate:n,lastBaseUpdate:a,shared:o.shared,effects:o.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Vf(e,t,r,o){var n=e.updateQueue;Ji=!1;var a=n.firstBaseUpdate,s=n.lastBaseUpdate,u=n.shared.pending;if(u!==null){n.shared.pending=null;var c=u,d=c.next;c.next=null,s===null?a=d:s.next=d,s=c;var p=e.alternate;p!==null&&(p=p.updateQueue,u=p.lastBaseUpdate,u!==s&&(u===null?p.firstBaseUpdate=d:u.next=d,p.lastBaseUpdate=c))}if(a!==null){var m=n.baseState;s=0,p=d=c=null,u=a;do{var v=u.lane,x=u.eventTime;if((o&v)===v){p!==null&&(p=p.next={eventTime:x,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var y=e,g=u;switch(v=t,x=r,g.tag){case 1:if(y=g.payload,typeof y=="function"){m=y.call(x,m,v);break e}m=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,v=typeof y=="function"?y.call(x,m,v):y,v==null)break e;m=rr({},m,v);break e;case 2:Ji=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,v=n.effects,v===null?n.effects=[u]:v.push(u))}else x={eventTime:x,lane:v,tag:u.tag,payload:u.payload,callback:u.callback,next:null},p===null?(d=p=x,c=m):p=p.next=x,s|=v;if(u=u.next,u===null){if(u=n.shared.pending,u===null)break;v=u,u=v.next,v.next=null,n.lastBaseUpdate=v,n.shared.pending=null}}while(!0);if(p===null&&(c=m),n.baseState=c,n.firstBaseUpdate=d,n.lastBaseUpdate=p,t=n.shared.interleaved,t!==null){n=t;do s|=n.lane,n=n.next;while(n!==t)}else a===null&&(n.shared.lanes=0);xs|=s,e.lanes=s,e.memoizedState=m}}function Qw(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var o=G4.transition;G4.transition={};try{e(!1),t()}finally{At=r,G4.transition=o}}function By(){return Vn().memoizedState}function dG(e,t,r){var o=l1(e);if(r={lane:o,action:r,hasEagerState:!1,eagerState:null,next:null},Zy(e))Gy(t,r);else if(r=by(e,t,r,o),r!==null){var n=Co();sa(r,e,o,n),Wy(r,t,o)}}function fG(e,t,r){var o=l1(e),n={lane:o,action:r,hasEagerState:!1,eagerState:null,next:null};if(Zy(e))Gy(t,n);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var s=t.lastRenderedState,u=a(s,r);if(n.hasEagerState=!0,n.eagerState=u,la(u,s)){var c=t.interleaved;c===null?(n.next=n,up(t)):(n.next=c.next,c.next=n),t.interleaved=n;return}}catch{}finally{}r=by(e,t,n,o),r!==null&&(n=Co(),sa(r,e,o,n),Wy(r,t,o))}}function Zy(e){var t=e.alternate;return e===tr||t!==null&&t===tr}function Gy(e,t){nd=Df=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Wy(e,t,r){if(r&4194240){var o=t.lanes;o&=e.pendingLanes,r|=o,t.lanes=r,q8(e,r)}}var Nf={readContext:Hn,useCallback:to,useContext:to,useEffect:to,useImperativeHandle:to,useInsertionEffect:to,useLayoutEffect:to,useMemo:to,useReducer:to,useRef:to,useState:to,useDebugValue:to,useDeferredValue:to,useTransition:to,useMutableSource:to,useSyncExternalStore:to,useId:to,unstable_isNewReconciler:!1},pG={readContext:Hn,useCallback:function(e,t){return Pa().memoizedState=[e,t===void 0?null:t],e},useContext:Hn,useEffect:ex,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,gf(4194308,4,Hy.bind(null,t,e),r)},useLayoutEffect:function(e,t){return gf(4194308,4,e,t)},useInsertionEffect:function(e,t){return gf(4,2,e,t)},useMemo:function(e,t){var r=Pa();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var o=Pa();return t=r!==void 0?r(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=dG.bind(null,tr,e),[o.memoizedState,e]},useRef:function(e){var t=Pa();return e={current:e},t.memoizedState=e},useState:Kw,useDebugValue:Cp,useDeferredValue:function(e){return Pa().memoizedState=e},useTransition:function(){var e=Kw(!1),t=e[0];return e=cG.bind(null,e[1]),Pa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var o=tr,n=Pa();if(Jt){if(r===void 0)throw Error(te(407));r=r()}else{if(r=t(),Fr===null)throw Error(te(349));ws&30||_y(o,t,r)}n.memoizedState=r;var a={value:r,getSnapshot:t};return n.queue=a,ex(My.bind(null,o,a,e),[e]),o.flags|=2048,Ld(9,Ay.bind(null,o,a,r,t),void 0,null),r},useId:function(){var e=Pa(),t=Fr.identifierPrefix;if(Jt){var r=pi,o=fi;r=(o&~(1<<32-ia(o)-1)).toString(32)+r,t=":"+t+"R"+r,r=yd++,0<\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=s.createElement(r,{is:o.is}):(e=s.createElement(r),r==="select"&&(s=e,o.multiple?s.multiple=!0:o.size&&(s.size=o.size))):e=s.createElementNS(e,r),e[ka]=t,e[Cd]=o,Ky(e,t,!1,!1),t.stateNode=e;e:{switch(s=i8(r,o),r){case"dialog":Ut("cancel",e),Ut("close",e),n=o;break;case"iframe":case"object":case"embed":Ut("load",e),n=o;break;case"video":case"audio":for(n=0;niu&&(t.flags|=128,o=!0,Uc(a,!1),t.lanes=4194304)}else{if(!o)if(e=Ff(s),e!==null){if(t.flags|=128,o=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Uc(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Jt)return ro(t),null}else 2*mr()-a.renderingStartTime>iu&&r!==1073741824&&(t.flags|=128,o=!0,Uc(a,!1),t.lanes=4194304);a.isBackwards?(s.sibling=t.child,t.child=s):(r=a.last,r!==null?r.sibling=s:t.child=s,a.last=s)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=mr(),t.sibling=null,r=er.current,Gt(er,o?r&1|2:r&1),t):(ro(t),null);case 22:case 23:return Ip(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&t.mode&1?an&1073741824&&(ro(t),t.subtreeFlags&6&&(t.flags|=8192)):ro(t),null;case 24:return null;case 25:return null}throw Error(te(156,t.tag))}function yG(e,t){switch(np(t),t.tag){case 1:return No(t.type)&&Tf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return nu(),$t(Do),$t(no),pp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return fp(t),null;case 13:if($t(er),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));ru()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $t(er),null;case 4:return nu(),null;case 10:return lp(t.type._context),null;case 22:case 23:return Ip(),null;case 24:return null;default:return null}}var uf=!1,oo=!1,bG=typeof WeakSet=="function"?WeakSet:Set,ve=null;function Ul(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(o){lr(e,t,o)}else r.current=null}function E8(e,t,r){try{r()}catch(o){lr(e,t,o)}}var dx=!1;function LG(e,t){if(g8=Rf,e=iy(),rp(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var n=o.anchorOffset,a=o.focusNode;o=o.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var s=0,u=-1,c=-1,d=0,p=0,m=e,v=null;t:for(;;){for(var x;m!==r||n!==0&&m.nodeType!==3||(u=s+n),m!==a||o!==0&&m.nodeType!==3||(c=s+o),m.nodeType===3&&(s+=m.nodeValue.length),(x=m.firstChild)!==null;)v=m,m=x;for(;;){if(m===e)break t;if(v===r&&++d===n&&(u=s),v===a&&++p===o&&(c=s),(x=m.nextSibling)!==null)break;m=v,v=m.parentNode}m=x}r=u===-1||c===-1?null:{start:u,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(v8={focusedElem:e,selectionRange:r},Rf=!1,ve=t;ve!==null;)if(t=ve,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ve=e;else for(;ve!==null;){t=ve;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,b=y.memoizedState,C=t.stateNode,w=C.getSnapshotBeforeUpdate(t.elementType===t.type?g:oa(t.type,g),b);C.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var I=t.stateNode.containerInfo;I.nodeType===1?I.textContent="":I.nodeType===9&&I.documentElement&&I.removeChild(I.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(te(163))}}catch(_){lr(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,ve=e;break}ve=t.return}return y=dx,dx=!1,y}function ad(e,t,r){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var n=o=o.next;do{if((n.tag&e)===e){var a=n.destroy;n.destroy=void 0,a!==void 0&&E8(t,r,a)}n=n.next}while(n!==o)}}function Kf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var o=r.create;r.destroy=o()}r=r.next}while(r!==t)}}function O8(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function rb(e){var t=e.alternate;t!==null&&(e.alternate=null,rb(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ka],delete t[Cd],delete t[x8],delete t[aG],delete t[iG])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ob(e){return e.tag===5||e.tag===3||e.tag===4}function fx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ob(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function H8(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Mf));else if(o!==4&&(e=e.child,e!==null))for(H8(e,t,r),e=e.sibling;e!==null;)H8(e,t,r),e=e.sibling}function V8(e,t,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(V8(e,t,r),e=e.sibling;e!==null;)V8(e,t,r),e=e.sibling}var jr=null,na=!1;function qi(e,t,r){for(r=r.child;r!==null;)nb(e,t,r),r=r.sibling}function nb(e,t,r){if(Ea&&typeof Ea.onCommitFiberUnmount=="function")try{Ea.onCommitFiberUnmount(jf,r)}catch{}switch(r.tag){case 5:oo||Ul(r,t);case 6:var o=jr,n=na;jr=null,qi(e,t,r),jr=o,na=n,jr!==null&&(na?(e=jr,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):jr.removeChild(r.stateNode));break;case 18:jr!==null&&(na?(e=jr,r=r.stateNode,e.nodeType===8?N4(e.parentNode,r):e.nodeType===1&&N4(e,r),pd(e)):N4(jr,r.stateNode));break;case 4:o=jr,n=na,jr=r.stateNode.containerInfo,na=!0,qi(e,t,r),jr=o,na=n;break;case 0:case 11:case 14:case 15:if(!oo&&(o=r.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){n=o=o.next;do{var a=n,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&E8(r,t,s),n=n.next}while(n!==o)}qi(e,t,r);break;case 1:if(!oo&&(Ul(r,t),o=r.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=r.memoizedProps,o.state=r.memoizedState,o.componentWillUnmount()}catch(u){lr(r,t,u)}qi(e,t,r);break;case 21:qi(e,t,r);break;case 22:r.mode&1?(oo=(o=oo)||r.memoizedState!==null,qi(e,t,r),oo=o):qi(e,t,r);break;default:qi(e,t,r)}}function px(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new bG),t.forEach(function(o){var n=kG.bind(null,e,o);r.has(o)||(r.add(o),o.then(n,n))})}}function ra(e,t){var r=t.deletions;if(r!==null)for(var o=0;on&&(n=s),o&=~a}if(o=n,o=mr()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*SG(o/1960))-o,10e?16:e,t1===null)var o=!1;else{if(e=t1,t1=null,Gf=0,pt&6)throw Error(te(331));var n=pt;for(pt|=4,ve=e.current;ve!==null;){var a=ve,s=a.child;if(ve.flags&16){var u=a.deletions;if(u!==null){for(var c=0;cmr()-bp?hs(e,0):yp|=r),Bo(e,t)}function fb(e,t){t===0&&(e.mode&1?(t=q2,q2<<=1,!(q2&130023424)&&(q2=4194304)):t=1);var r=Co();e=vi(e,t),e!==null&&(Sd(e,t,r),Bo(e,r))}function PG(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),fb(e,r)}function kG(e,t){var r=0;switch(e.tag){case 13:var o=e.stateNode,n=e.memoizedState;n!==null&&(r=n.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(te(314))}o!==null&&o.delete(t),fb(e,r)}var pb;pb=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Do.current)Fo=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Fo=!1,wG(e,t,r);Fo=!!(e.flags&131072)}else Fo=!1,Jt&&t.flags&1048576&&vy(t,Ef,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;vf(e,t),e=t.pendingProps;var n=tu(t,no.current);Ql(t,r),n=hp(null,t,o,e,n,r);var a=gp();return t.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,No(o)?(a=!0,Pf(t)):a=!1,t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,cp(t),n.updater=Qf,t.stateNode=n,n._reactInternals=t,R8(t,o,e,r),t=M8(null,t,o,!0,a,r)):(t.tag=0,Jt&&a&&op(t),vo(null,t,n,r),t=t.child),t;case 16:o=t.elementType;e:{switch(vf(e,t),e=t.pendingProps,n=o._init,o=n(o._payload),t.type=o,n=t.tag=OG(o),e=oa(o,e),n){case 0:t=A8(null,t,o,e,r);break e;case 1:t=lx(null,t,o,e,r);break e;case 11:t=ix(null,t,o,e,r);break e;case 14:t=sx(null,t,o,oa(o.type,e),r);break e}throw Error(te(306,o,""))}return t;case 0:return o=t.type,n=t.pendingProps,n=t.elementType===o?n:oa(o,n),A8(e,t,o,n,r);case 1:return o=t.type,n=t.pendingProps,n=t.elementType===o?n:oa(o,n),lx(e,t,o,n,r);case 3:e:{if(Yy(t),e===null)throw Error(te(387));o=t.pendingProps,a=t.memoizedState,n=a.element,Ly(e,t),Vf(t,o,null,r);var s=t.memoizedState;if(o=s.element,a.isDehydrated)if(a={element:o,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){n=au(Error(te(423)),t),t=ux(e,t,o,r,n);break e}else if(o!==n){n=au(Error(te(424)),t),t=ux(e,t,o,r,n);break e}else for(sn=a1(t.stateNode.containerInfo.firstChild),ln=t,Jt=!0,aa=null,r=yy(t,null,o,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ru(),o===n){t=Ci(e,t,r);break e}vo(e,t,o,r)}t=t.child}return t;case 5:return Iy(t),e===null&&L8(t),o=t.type,n=t.pendingProps,a=e!==null?e.memoizedProps:null,s=n.children,C8(o,n)?s=null:a!==null&&C8(o,a)&&(t.flags|=32),qy(e,t),vo(e,t,s,r),t.child;case 6:return e===null&&L8(t),null;case 13:return Jy(e,t,r);case 4:return dp(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=ou(t,null,o,r):vo(e,t,o,r),t.child;case 11:return o=t.type,n=t.pendingProps,n=t.elementType===o?n:oa(o,n),ix(e,t,o,n,r);case 7:return vo(e,t,t.pendingProps,r),t.child;case 8:return vo(e,t,t.pendingProps.children,r),t.child;case 12:return vo(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(o=t.type._context,n=t.pendingProps,a=t.memoizedProps,s=n.value,Gt(Of,o._currentValue),o._currentValue=s,a!==null)if(la(a.value,s)){if(a.children===n.children&&!Do.current){t=Ci(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var u=a.dependencies;if(u!==null){s=a.child;for(var c=u.firstContext;c!==null;){if(c.context===o){if(a.tag===1){c=mi(-1,r&-r),c.tag=2;var d=a.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?c.next=c:(c.next=p.next,p.next=c),d.pending=c}}a.lanes|=r,c=a.alternate,c!==null&&(c.lanes|=r),I8(a.return,r,t),u.lanes|=r;break}c=c.next}}else if(a.tag===10)s=a.type===t.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(te(341));s.lanes|=r,u=s.alternate,u!==null&&(u.lanes|=r),I8(s,r,t),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===t){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}vo(e,t,n.children,r),t=t.child}return t;case 9:return n=t.type,o=t.pendingProps.children,Ql(t,r),n=Hn(n),o=o(n),t.flags|=1,vo(e,t,o,r),t.child;case 14:return o=t.type,n=oa(o,t.pendingProps),n=oa(o.type,n),sx(e,t,o,n,r);case 15:return $y(e,t,t.type,t.pendingProps,r);case 17:return o=t.type,n=t.pendingProps,n=t.elementType===o?n:oa(o,n),vf(e,t),t.tag=1,No(o)?(e=!0,Pf(t)):e=!1,Ql(t,r),zy(t,o,n),R8(t,o,n,r),M8(null,t,o,!0,e,r);case 19:return Qy(e,t,r);case 22:return Xy(e,t,r)}throw Error(te(156,t.tag))};function mb(e,t){return Zx(e,t)}function EG(e,t,r,o){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function En(e,t,r,o){return new EG(e,t,r,o)}function Rp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function OG(e){if(typeof e=="function")return Rp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===j8)return 11;if(e===U8)return 14}return 2}function u1(e,t){var r=e.alternate;return r===null?(r=En(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function xf(e,t,r,o,n,a){var s=2;if(o=e,typeof e=="function")Rp(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Fl:return gs(r.children,n,a,t);case z8:s=8,n|=8;break;case Y4:return e=En(12,r,t,n|2),e.elementType=Y4,e.lanes=a,e;case J4:return e=En(13,r,t,n),e.elementType=J4,e.lanes=a,e;case Q4:return e=En(19,r,t,n),e.elementType=Q4,e.lanes=a,e;case Ix:return t9(r,n,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case bx:s=10;break e;case Lx:s=9;break e;case j8:s=11;break e;case U8:s=14;break e;case Yi:s=16,o=null;break e}throw Error(te(130,e==null?e:typeof e,""))}return t=En(s,r,t,n),t.elementType=e,t.type=o,t.lanes=a,t}function gs(e,t,r,o){return e=En(7,e,o,t),e.lanes=r,e}function t9(e,t,r,o){return e=En(22,e,o,t),e.elementType=Ix,e.lanes=r,e.stateNode={isHidden:!1},e}function $4(e,t,r){return e=En(6,e,null,t),e.lanes=r,e}function X4(e,t,r){return t=En(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function HG(e,t,r,o,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=P4(0),this.expirationTimes=P4(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=P4(0),this.identifierPrefix=o,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function _p(e,t,r,o,n,a,s,u,c){return e=new HG(e,t,r,u,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=En(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:o,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},cp(a),e}function VG(e,t,r){var o=3{"use strict";function wb(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wb)}catch(e){console.error(e)}}wb(),xb.exports=Cb()});var bb=kt(Pp=>{"use strict";var yb=Ha();Pp.createRoot=yb.createRoot,Pp.hydrateRoot=yb.hydrateRoot;var Vee});var iI=kt(N9=>{"use strict";var Qj=j(),Kj=Symbol.for("react.element"),eU=Symbol.for("react.fragment"),tU=Object.prototype.hasOwnProperty,rU=Qj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,oU={key:!0,ref:!0,__self:!0,__source:!0};function aI(e,t,r){var o,n={},a=null,s=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(s=t.ref);for(o in t)tU.call(t,o)&&!oU.hasOwnProperty(o)&&(n[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps,t)n[o]===void 0&&(n[o]=t[o]);return{$$typeof:Kj,type:e,key:a,ref:s,props:n,_owner:rU.current}}N9.Fragment=eU;N9.jsx=aI;N9.jsxs=aI});var Et=kt((Kae,sI)=>{"use strict";sI.exports=iI()});var wa=kt(bt=>{"use strict";Object.defineProperty(bt,"__esModule",{value:!0});bt.isEventSourceSupported=bt.isReactNative=bt.ReadyState=bt.DEFAULT_HEARTBEAT=bt.UNPARSABLE_JSON_OBJECT=bt.DEFAULT_RECONNECT_INTERVAL_MS=bt.DEFAULT_RECONNECT_LIMIT=bt.SOCKET_IO_PING_CODE=bt.SOCKET_IO_PATH=bt.SOCKET_IO_PING_INTERVAL=bt.DEFAULT_EVENT_SOURCE_OPTIONS=bt.EMPTY_EVENT_HANDLERS=bt.DEFAULT_OPTIONS=void 0;var jq=1,Uq=1e3*jq;bt.DEFAULT_OPTIONS={};bt.EMPTY_EVENT_HANDLERS={};bt.DEFAULT_EVENT_SOURCE_OPTIONS={withCredentials:!1,events:bt.EMPTY_EVENT_HANDLERS};bt.SOCKET_IO_PING_INTERVAL=25*Uq;bt.SOCKET_IO_PATH="/socket.io/?EIO=3&transport=websocket";bt.SOCKET_IO_PING_CODE="2";bt.DEFAULT_RECONNECT_LIMIT=20;bt.DEFAULT_RECONNECT_INTERVAL_MS=5e3;bt.UNPARSABLE_JSON_OBJECT={};bt.DEFAULT_HEARTBEAT={message:"ping",timeout:6e4,interval:25e3};var dM;(function(e){e[e.UNINSTANTIATED=-1]="UNINSTANTIATED",e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(dM||(bt.ReadyState=dM={}));var $q=function(){try{return"EventSource"in globalThis}catch{return!1}};bt.isReactNative=typeof navigator<"u"&&navigator.product==="ReactNative";bt.isEventSourceSupported=!bt.isReactNative&&$q()});var J5=kt(xa=>{"use strict";Object.defineProperty(xa,"__esModule",{value:!0});xa.resetWebSockets=xa.sharedWebSockets=void 0;xa.sharedWebSockets={};var Xq=function(e){if(e&&xa.sharedWebSockets.hasOwnProperty(e))delete xa.sharedWebSockets[e];else for(var t in xa.sharedWebSockets)xa.sharedWebSockets.hasOwnProperty(t)&&delete xa.sharedWebSockets[t]};xa.resetWebSockets=Xq});var K5=kt(z1=>{"use strict";Object.defineProperty(z1,"__esModule",{value:!0});z1.setUpSocketIOPing=z1.appendQueryParams=z1.parseSocketIOUrl=void 0;var Q5=wa(),qq=function(e){if(e){var t=/^https|wss/.test(e),r=e.replace(/^(https?|wss?)(:\/\/)?/,""),o=r.replace(/\/$/,""),n=t?"wss":"ws";return"".concat(n,"://").concat(o).concat(Q5.SOCKET_IO_PATH)}else if(e===""){var t=/^https/.test(window.location.protocol),n=t?"wss":"ws",a=window.location.port?":".concat(window.location.port):"";return"".concat(n,"://").concat(window.location.hostname).concat(a).concat(Q5.SOCKET_IO_PATH)}return e};z1.parseSocketIOUrl=qq;var Yq=function(e,t){t===void 0&&(t={});var r=/\?([\w]+=[\w]+)/,o=r.test(e),n="".concat(Object.entries(t).reduce(function(a,s){var u=s[0],c=s[1];return a+"".concat(u,"=").concat(c,"&")},"").slice(0,-1));return"".concat(e).concat(o?"&":"?").concat(n)};z1.appendQueryParams=Yq;var Jq=function(e,t){t===void 0&&(t=Q5.SOCKET_IO_PING_INTERVAL);var r=function(){return e(Q5.SOCKET_IO_PING_CODE)};return window.setInterval(r,t)};z1.setUpSocketIOPing=Jq});var ch=kt(uh=>{"use strict";Object.defineProperty(uh,"__esModule",{value:!0});uh.heartbeat=Qq;var lh=wa();function Qq(e,t){var r=t||{},o=r.interval,n=o===void 0?lh.DEFAULT_HEARTBEAT.interval:o,a=r.timeout,s=a===void 0?lh.DEFAULT_HEARTBEAT.timeout:a,u=r.message,c=u===void 0?lh.DEFAULT_HEARTBEAT.message:u,d=!1,p=setInterval(function(){try{typeof c=="function"?e.send(c()):e.send(c)}catch{}},n),m=setInterval(function(){d?d=!1:e.close()},s);return e.addEventListener("close",function(){clearInterval(p),clearInterval(m)}),function(){d=!0}}});var e3=kt(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.resetSubscribers=xn.removeSubscriber=xn.addSubscriber=xn.hasSubscribers=xn.getSubscribers=void 0;var ya={},Kq=[],eY=function(e){return(0,xn.hasSubscribers)(e)?Array.from(ya[e]):Kq};xn.getSubscribers=eY;var tY=function(e){var t;return((t=ya[e])===null||t===void 0?void 0:t.size)>0};xn.hasSubscribers=tY;var rY=function(e,t){ya[e]=ya[e]||new Set,ya[e].add(t)};xn.addSubscriber=rY;var oY=function(e,t){ya[e].delete(t)};xn.removeSubscriber=oY;var nY=function(e){if(e&&ya.hasOwnProperty(e))delete ya[e];else for(var t in ya)ya.hasOwnProperty(t)&&delete ya[t]};xn.resetSubscribers=nY});var r3=kt(t3=>{"use strict";Object.defineProperty(t3,"__esModule",{value:!0});t3.assertIsWebSocket=sY;t3.resetGlobalState=lY;var aY=J5(),iY=e3();function sY(e,t){if(!t&&!(e instanceof WebSocket))throw new Error("")}function lY(e){(0,iY.resetSubscribers)(e),(0,aY.resetWebSockets)(e)}});var fM=kt(Ku=>{"use strict";var o3=Ku&&Ku.__assign||function(){return o3=Object.assign||function(e){for(var t,r=1,o=arguments.length;r{"use strict";var n3=ec&&ec.__assign||function(){return n3=Object.assign||function(e){for(var t,r=1,o=arguments.length;r{"use strict";Object.defineProperty(a3,"__esModule",{value:!0});a3.createOrJoinSocket=void 0;var j1=J5(),P0=wa(),SY=fM(),RY=pM(),dh=e3(),_Y=function(e,t,r,o,n){return function(){if((0,dh.removeSubscriber)(e,t),!(0,dh.hasSubscribers)(e)){try{var a=j1.sharedWebSockets[e];a instanceof WebSocket&&(a.onclose=function(s){r.current.onClose&&r.current.onClose(s),o(P0.ReadyState.CLOSED)}),a.close()}catch{}n&&n(),delete j1.sharedWebSockets[e]}}},AY=function(e,t,r,o,n,a,s,u){if(!P0.isEventSourceSupported&&o.current.eventSourceOptions)throw P0.isReactNative?new Error("EventSource is not supported in ReactNative"):new Error("EventSource is not supported");if(o.current.share){var c=null;j1.sharedWebSockets[t]===void 0?(j1.sharedWebSockets[t]=o.current.eventSourceOptions?new EventSource(t,o.current.eventSourceOptions):new WebSocket(t,o.current.protocols),e.current=j1.sharedWebSockets[t],r(P0.ReadyState.CONNECTING),c=(0,RY.attachSharedListeners)(j1.sharedWebSockets[t],t,o,u)):(e.current=j1.sharedWebSockets[t],r(j1.sharedWebSockets[t].readyState));var d={setLastMessage:n,setReadyState:r,optionsRef:o,reconnectCount:s,reconnect:a};return(0,dh.addSubscriber)(t,d),_Y(t,d,o,r,c)}else{if(e.current=o.current.eventSourceOptions?new EventSource(t,o.current.eventSourceOptions):new WebSocket(t,o.current.protocols),r(P0.ReadyState.CONNECTING),!e.current)throw new Error("WebSocket failed to be created");return(0,SY.attachListeners)(e.current,{setLastMessage:n,setReadyState:r},o,a.current,s,u)}};a3.createOrJoinSocket=AY});var vM=kt(ba=>{"use strict";var MY=ba&&ba.__awaiter||function(e,t,r,o){function n(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function u(p){try{d(o.next(p))}catch(m){s(m)}}function c(p){try{d(o.throw(p))}catch(m){s(m)}}function d(p){p.done?a(p.value):n(p.value).then(u,c)}d((o=o.apply(e,t||[])).next())})},TY=ba&&ba.__generator||function(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,n,a,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=u(0),s.throw=u(1),s.return=u(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(d){return function(p){return c([d,p])}}function c(d){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,d[0]&&(r=0)),r;)try{if(o=1,n&&(a=d[0]&2?n.return:d[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,d[1])).done)return a;switch(n=0,a&&(d=[d[0]&2,a.value]),d[0]){case 0:case 1:a=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,n=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.websocketWrapper=void 0;var OY=function(e,t){return new Proxy(e,{get:function(r,o){var n=r[o];return o==="reconnect"?t:typeof n=="function"?(console.error("Calling methods directly on the websocket is not supported at this moment. You must use the methods returned by useWebSocket."),function(){}):n},set:function(r,o,n){return/^on/.test(o)?(console.warn("The websocket's event handlers should be defined through the options object passed into useWebSocket."),!1):(r[o]=n,!0)}})};tc.websocketWrapper=OY;tc.default=tc.websocketWrapper});var i3=kt(jn=>{"use strict";var U1=jn&&jn.__assign||function(){return U1=Object.assign||function(e){for(var t,r=1,o=arguments.length;r0&&a[a.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!a||d[1]>a[0]&&d[1]{"use strict";var s3=rc&&rc.__assign||function(){return s3=Object.assign||function(e){for(var t,r=1,o=arguments.length;r{"use strict";var l3=$1&&$1.__assign||function(){return l3=Object.assign||function(e){for(var t,r=1,o=arguments.length;r{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.resetGlobalState=Un.useEventSource=Un.ReadyState=Un.useSocketIO=Un.default=void 0;var qY=i3();Object.defineProperty(Un,"default",{enumerable:!0,get:function(){return qY.useWebSocket}});var YY=yM();Object.defineProperty(Un,"useSocketIO",{enumerable:!0,get:function(){return YY.useSocketIO}});var JY=wa();Object.defineProperty(Un,"ReadyState",{enumerable:!0,get:function(){return JY.ReadyState}});var QY=IM();Object.defineProperty(Un,"useEventSource",{enumerable:!0,get:function(){return QY.useEventSource}});var KY=r3();Object.defineProperty(Un,"resetGlobalState",{enumerable:!0,get:function(){return KY.resetGlobalState}})});var wT=kt(Tt=>{"use strict";var Gr=typeof Symbol=="function"&&Symbol.for,wh=Gr?Symbol.for("react.element"):60103,xh=Gr?Symbol.for("react.portal"):60106,b3=Gr?Symbol.for("react.fragment"):60107,L3=Gr?Symbol.for("react.strict_mode"):60108,I3=Gr?Symbol.for("react.profiler"):60114,S3=Gr?Symbol.for("react.provider"):60109,R3=Gr?Symbol.for("react.context"):60110,yh=Gr?Symbol.for("react.async_mode"):60111,_3=Gr?Symbol.for("react.concurrent_mode"):60111,A3=Gr?Symbol.for("react.forward_ref"):60112,M3=Gr?Symbol.for("react.suspense"):60113,gJ=Gr?Symbol.for("react.suspense_list"):60120,T3=Gr?Symbol.for("react.memo"):60115,P3=Gr?Symbol.for("react.lazy"):60116,vJ=Gr?Symbol.for("react.block"):60121,CJ=Gr?Symbol.for("react.fundamental"):60117,wJ=Gr?Symbol.for("react.responder"):60118,xJ=Gr?Symbol.for("react.scope"):60119;function yn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case wh:switch(e=e.type,e){case yh:case _3:case b3:case I3:case L3:case M3:return e;default:switch(e=e&&e.$$typeof,e){case R3:case A3:case P3:case T3:case S3:return e;default:return t}}case xh:return t}}}function CT(e){return yn(e)===_3}Tt.AsyncMode=yh;Tt.ConcurrentMode=_3;Tt.ContextConsumer=R3;Tt.ContextProvider=S3;Tt.Element=wh;Tt.ForwardRef=A3;Tt.Fragment=b3;Tt.Lazy=P3;Tt.Memo=T3;Tt.Portal=xh;Tt.Profiler=I3;Tt.StrictMode=L3;Tt.Suspense=M3;Tt.isAsyncMode=function(e){return CT(e)||yn(e)===yh};Tt.isConcurrentMode=CT;Tt.isContextConsumer=function(e){return yn(e)===R3};Tt.isContextProvider=function(e){return yn(e)===S3};Tt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===wh};Tt.isForwardRef=function(e){return yn(e)===A3};Tt.isFragment=function(e){return yn(e)===b3};Tt.isLazy=function(e){return yn(e)===P3};Tt.isMemo=function(e){return yn(e)===T3};Tt.isPortal=function(e){return yn(e)===xh};Tt.isProfiler=function(e){return yn(e)===I3};Tt.isStrictMode=function(e){return yn(e)===L3};Tt.isSuspense=function(e){return yn(e)===M3};Tt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===b3||e===_3||e===I3||e===L3||e===M3||e===gJ||typeof e=="object"&&e!==null&&(e.$$typeof===P3||e.$$typeof===T3||e.$$typeof===S3||e.$$typeof===R3||e.$$typeof===A3||e.$$typeof===CJ||e.$$typeof===wJ||e.$$typeof===xJ||e.$$typeof===vJ)};Tt.typeOf=yn});var yT=kt((T2e,xT)=>{"use strict";xT.exports=wT()});var AT=kt((P2e,_T)=>{"use strict";var bh=yT(),yJ={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},bJ={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},LJ={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ST={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Lh={};Lh[bh.ForwardRef]=LJ;Lh[bh.Memo]=ST;function bT(e){return bh.isMemo(e)?ST:Lh[e.$$typeof]||yJ}var IJ=Object.defineProperty,SJ=Object.getOwnPropertyNames,LT=Object.getOwnPropertySymbols,RJ=Object.getOwnPropertyDescriptor,_J=Object.getPrototypeOf,IT=Object.prototype;function RT(e,t,r){if(typeof t!="string"){if(IT){var o=_J(t);o&&o!==IT&&RT(e,o,r)}var n=SJ(t);LT&&(n=n.concat(LT(t)));for(var a=bT(e),s=bT(t),u=0;u{(function(){var e,t="4.17.21",r=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",n="Expected a function",a="Invalid `variable` option passed into `_.template`",s="__lodash_hash_undefined__",u=500,c="__lodash_placeholder__",d=1,p=2,m=4,v=1,x=2,y=1,g=2,b=4,C=8,w=16,I=32,_=64,M=128,E=256,A=512,H=30,$="...",U=800,ee=16,W=1,ie=2,Y=3,ae=1/0,J=9007199254740991,me=17976931348623157e292,se=NaN,we=4294967295,Ke=we-1,It=we>>>1,st=[["ary",M],["bind",y],["bindKey",g],["curry",C],["curryRight",w],["flip",A],["partial",I],["partialRight",_],["rearg",E]],dt="[object Arguments]",St="[object Array]",Lr="[object AsyncFunction]",Rt="[object Boolean]",xe="[object Date]",qe="[object DOMException]",Pt="[object Error]",lt="[object Function]",ft="[object GeneratorFunction]",Ye="[object Map]",Qt="[object Number]",fo="[object Null]",Jr="[object Object]",J1="[object Promise]",vl="[object Proxy]",k="[object RegExp]",D="[object Set]",G="[object String]",ce="[object Symbol]",ue="[object Undefined]",oe="[object WeakMap]",Le="[object WeakSet]",et="[object ArrayBuffer]",zt="[object DataView]",ir="[object Float32Array]",Yn="[object Float64Array]",wc="[object Int8Array]",Q1="[object Int16Array]",K1="[object Int32Array]",xc="[object Uint8Array]",Cl="[object Uint8ClampedArray]",yc="[object Uint16Array]",wl="[object Uint32Array]",Dk=/\b__p \+= '';/g,Nk=/\b(__p \+=) '' \+/g,Bk=/(__e\(.*?\)|\b__t\)) \+\n'';/g,hg=/&(?:amp|lt|gt|quot|#39);/g,gg=/[&<>"']/g,Zk=RegExp(hg.source),Gk=RegExp(gg.source),Wk=/<%-([\s\S]+?)%>/g,zk=/<%([\s\S]+?)%>/g,vg=/<%=([\s\S]+?)%>/g,jk=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Uk=/^\w*$/,$k=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,e7=/[\\^$.*+?()[\]{}|]/g,Xk=RegExp(e7.source),t7=/^\s+/,qk=/\s/,Yk=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Jk=/\{\n\/\* \[wrapped with (.+)\] \*/,Qk=/,? & /,Kk=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,eE=/[()=,{}\[\]\/\s]/,tE=/\\(\\)?/g,rE=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Cg=/\w*$/,oE=/^[-+]0x[0-9a-f]+$/i,nE=/^0b[01]+$/i,aE=/^\[object .+?Constructor\]$/,iE=/^0o[0-7]+$/i,sE=/^(?:0|[1-9]\d*)$/,lE=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,q0=/($^)/,uE=/['\n\r\u2028\u2029\\]/g,Y0="\\ud800-\\udfff",cE="\\u0300-\\u036f",dE="\\ufe20-\\ufe2f",fE="\\u20d0-\\u20ff",wg=cE+dE+fE,xg="\\u2700-\\u27bf",yg="a-z\\xdf-\\xf6\\xf8-\\xff",pE="\\xac\\xb1\\xd7\\xf7",mE="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",hE="\\u2000-\\u206f",gE=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bg="A-Z\\xc0-\\xd6\\xd8-\\xde",Lg="\\ufe0e\\ufe0f",Ig=pE+mE+hE+gE,r7="['\u2019]",vE="["+Y0+"]",Sg="["+Ig+"]",J0="["+wg+"]",Rg="\\d+",CE="["+xg+"]",_g="["+yg+"]",Ag="[^"+Y0+Ig+Rg+xg+yg+bg+"]",o7="\\ud83c[\\udffb-\\udfff]",wE="(?:"+J0+"|"+o7+")",Mg="[^"+Y0+"]",n7="(?:\\ud83c[\\udde6-\\uddff]){2}",a7="[\\ud800-\\udbff][\\udc00-\\udfff]",xl="["+bg+"]",Tg="\\u200d",Pg="(?:"+_g+"|"+Ag+")",xE="(?:"+xl+"|"+Ag+")",kg="(?:"+r7+"(?:d|ll|m|re|s|t|ve))?",Eg="(?:"+r7+"(?:D|LL|M|RE|S|T|VE))?",Og=wE+"?",Hg="["+Lg+"]?",yE="(?:"+Tg+"(?:"+[Mg,n7,a7].join("|")+")"+Hg+Og+")*",bE="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",LE="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vg=Hg+Og+yE,IE="(?:"+[CE,n7,a7].join("|")+")"+Vg,SE="(?:"+[Mg+J0+"?",J0,n7,a7,vE].join("|")+")",RE=RegExp(r7,"g"),_E=RegExp(J0,"g"),i7=RegExp(o7+"(?="+o7+")|"+SE+Vg,"g"),AE=RegExp([xl+"?"+_g+"+"+kg+"(?="+[Sg,xl,"$"].join("|")+")",xE+"+"+Eg+"(?="+[Sg,xl+Pg,"$"].join("|")+")",xl+"?"+Pg+"+"+kg,xl+"+"+Eg,LE,bE,Rg,IE].join("|"),"g"),ME=RegExp("["+Tg+Y0+wg+Lg+"]"),TE=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,PE=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],kE=-1,jt={};jt[ir]=jt[Yn]=jt[wc]=jt[Q1]=jt[K1]=jt[xc]=jt[Cl]=jt[yc]=jt[wl]=!0,jt[dt]=jt[St]=jt[et]=jt[Rt]=jt[zt]=jt[xe]=jt[Pt]=jt[lt]=jt[Ye]=jt[Qt]=jt[Jr]=jt[k]=jt[D]=jt[G]=jt[oe]=!1;var Bt={};Bt[dt]=Bt[St]=Bt[et]=Bt[zt]=Bt[Rt]=Bt[xe]=Bt[ir]=Bt[Yn]=Bt[wc]=Bt[Q1]=Bt[K1]=Bt[Ye]=Bt[Qt]=Bt[Jr]=Bt[k]=Bt[D]=Bt[G]=Bt[ce]=Bt[xc]=Bt[Cl]=Bt[yc]=Bt[wl]=!0,Bt[Pt]=Bt[lt]=Bt[oe]=!1;var EE={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},OE={"&":"&","<":"<",">":">",'"':""","'":"'"},HE={"&":"&","<":"<",">":">",""":'"',"'":"'"},VE={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},FE=parseFloat,DE=parseInt,Fg=typeof global=="object"&&global&&global.Object===Object&&global,NE=typeof self=="object"&&self&&self.Object===Object&&self,Or=Fg||NE||Function("return this")(),s7=typeof Cc=="object"&&Cc&&!Cc.nodeType&&Cc,es=s7&&typeof $0=="object"&&$0&&!$0.nodeType&&$0,Dg=es&&es.exports===s7,l7=Dg&&Fg.process,bn=function(){try{var V=es&&es.require&&es.require("util").types;return V||l7&&l7.binding&&l7.binding("util")}catch{}}(),Ng=bn&&bn.isArrayBuffer,Bg=bn&&bn.isDate,Zg=bn&&bn.isMap,Gg=bn&&bn.isRegExp,Wg=bn&&bn.isSet,zg=bn&&bn.isTypedArray;function Ko(V,z,Z){switch(Z.length){case 0:return V.call(z);case 1:return V.call(z,Z[0]);case 2:return V.call(z,Z[0],Z[1]);case 3:return V.call(z,Z[0],Z[1],Z[2])}return V.apply(z,Z)}function BE(V,z,Z,ge){for(var Fe=-1,gt=V==null?0:V.length;++Fe-1}function u7(V,z,Z){for(var ge=-1,Fe=V==null?0:V.length;++ge-1;);return Z}function Qg(V,z){for(var Z=V.length;Z--&&yl(z,V[Z],0)>-1;);return Z}function qE(V,z){for(var Z=V.length,ge=0;Z--;)V[Z]===z&&++ge;return ge}var YE=p7(EE),JE=p7(OE);function QE(V){return"\\"+VE[V]}function KE(V,z){return V==null?e:V[z]}function bl(V){return ME.test(V)}function eO(V){return TE.test(V)}function tO(V){for(var z,Z=[];!(z=V.next()).done;)Z.push(z.value);return Z}function v7(V){var z=-1,Z=Array(V.size);return V.forEach(function(ge,Fe){Z[++z]=[Fe,ge]}),Z}function Kg(V,z){return function(Z){return V(z(Z))}}function Bi(V,z){for(var Z=-1,ge=V.length,Fe=0,gt=[];++Z-1}function GO(i,l){var f=this.__data__,h=h2(f,i);return h<0?(++this.size,f.push([i,l])):f[h][1]=l,this}ti.prototype.clear=DO,ti.prototype.delete=NO,ti.prototype.get=BO,ti.prototype.has=ZO,ti.prototype.set=GO;function ri(i){var l=-1,f=i==null?0:i.length;for(this.clear();++l=l?i:l)),i}function Rn(i,l,f,h,L,R){var T,O=l&d,F=l&p,X=l&m;if(f&&(T=L?f(i,h,L,R):f(i)),T!==e)return T;if(!Kt(i))return i;var q=De(i);if(q){if(T=UH(i),!O)return ko(i,T)}else{var Q=Kr(i),de=Q==lt||Q==ft;if($i(i))return Hv(i,O);if(Q==Jr||Q==dt||de&&!L){if(T=F||de?{}:eC(i),!O)return F?HH(i,nH(T,i)):OH(i,dv(T,i))}else{if(!Bt[Q])return L?i:{};T=$H(i,Q,O)}}R||(R=new Qn);var ye=R.get(i);if(ye)return ye;R.set(i,T),MC(i)?i.forEach(function(Pe){T.add(Rn(Pe,l,f,Pe,i,R))}):_C(i)&&i.forEach(function(Pe,Je){T.set(Je,Rn(Pe,l,f,Je,i,R))});var Te=X?F?W7:G7:F?Oo:Hr,$e=q?e:Te(i);return Ln($e||i,function(Pe,Je){$e&&(Je=Pe,Pe=i[Je]),Ac(T,Je,Rn(Pe,l,f,Je,i,R))}),T}function aH(i){var l=Hr(i);return function(f){return fv(f,i,l)}}function fv(i,l,f){var h=f.length;if(i==null)return!h;for(i=Dt(i);h--;){var L=f[h],R=l[L],T=i[L];if(T===e&&!(L in i)||!R(T))return!1}return!0}function pv(i,l,f){if(typeof i!="function")throw new In(n);return Hc(function(){i.apply(e,f)},l)}function Mc(i,l,f,h){var L=-1,R=Q0,T=!0,O=i.length,F=[],X=l.length;if(!O)return F;f&&(l=Yt(l,en(f))),h?(R=u7,T=!1):l.length>=r&&(R=bc,T=!1,l=new os(l));e:for(;++LL?0:L+f),h=h===e||h>L?L:ze(h),h<0&&(h+=L),h=f>h?0:PC(h);f0&&f(O)?l>1?zr(O,l-1,f,h,L):Ni(L,O):h||(L[L.length]=O)}return L}var I7=Zv(),gv=Zv(!0);function Ra(i,l){return i&&I7(i,l,Hr)}function S7(i,l){return i&&gv(i,l,Hr)}function v2(i,l){return Di(l,function(f){return si(i[f])})}function as(i,l){l=ji(l,i);for(var f=0,h=l.length;i!=null&&fl}function lH(i,l){return i!=null&&_t.call(i,l)}function uH(i,l){return i!=null&&l in Dt(i)}function cH(i,l,f){return i>=Qr(l,f)&&i=120&&q.length>=120)?new os(T&&q):e}q=i[0];var Q=-1,de=O[0];e:for(;++Q-1;)O!==i&&l2.call(O,F,1),l2.call(i,F,1);return i}function _v(i,l){for(var f=i?l.length:0,h=f-1;f--;){var L=l[f];if(f==h||L!==R){var R=L;ii(L)?l2.call(i,L,1):H7(i,L)}}return i}function k7(i,l){return i+d2(sv()*(l-i+1))}function LH(i,l,f,h){for(var L=-1,R=Sr(c2((l-i)/(f||1)),0),T=Z(R);R--;)T[h?R:++L]=i,i+=f;return T}function E7(i,l){var f="";if(!i||l<1||l>J)return f;do l%2&&(f+=i),l=d2(l/2),l&&(i+=i);while(l);return f}function Xe(i,l){return Y7(oC(i,l,Ho),i+"")}function IH(i){return cv(kl(i))}function SH(i,l){var f=kl(i);return A2(f,ns(l,0,f.length))}function kc(i,l,f,h){if(!Kt(i))return i;l=ji(l,i);for(var L=-1,R=l.length,T=R-1,O=i;O!=null&&++LL?0:L+l),f=f>L?L:f,f<0&&(f+=L),L=l>f?0:f-l>>>0,l>>>=0;for(var R=Z(L);++h>>1,T=i[R];T!==null&&!rn(T)&&(f?T<=l:T=r){var X=l?null:NH(i);if(X)return e2(X);T=!1,L=bc,F=new os}else F=l?[]:O;e:for(;++h=h?i:_n(i,l,f)}var Ov=gO||function(i){return Or.clearTimeout(i)};function Hv(i,l){if(l)return i.slice();var f=i.length,h=rv?rv(f):new i.constructor(f);return i.copy(h),h}function N7(i){var l=new i.constructor(i.byteLength);return new i2(l).set(new i2(i)),l}function TH(i,l){var f=l?N7(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.byteLength)}function PH(i){var l=new i.constructor(i.source,Cg.exec(i));return l.lastIndex=i.lastIndex,l}function kH(i){return _c?Dt(_c.call(i)):{}}function Vv(i,l){var f=l?N7(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.length)}function Fv(i,l){if(i!==l){var f=i!==e,h=i===null,L=i===i,R=rn(i),T=l!==e,O=l===null,F=l===l,X=rn(l);if(!O&&!X&&!R&&i>l||R&&T&&F&&!O&&!X||h&&T&&F||!f&&F||!L)return 1;if(!h&&!R&&!X&&i=O)return F;var X=f[h];return F*(X=="desc"?-1:1)}}return i.index-l.index}function Dv(i,l,f,h){for(var L=-1,R=i.length,T=f.length,O=-1,F=l.length,X=Sr(R-T,0),q=Z(F+X),Q=!h;++O1?f[L-1]:e,T=L>2?f[2]:e;for(R=i.length>3&&typeof R=="function"?(L--,R):e,T&&mo(f[0],f[1],T)&&(R=L<3?e:R,L=1),l=Dt(l);++h-1?L[R?l[T]:T]:e}}function zv(i){return ai(function(l){var f=l.length,h=f,L=Sn.prototype.thru;for(i&&l.reverse();h--;){var R=l[h];if(typeof R!="function")throw new In(n);if(L&&!T&&R2(R)=="wrapper")var T=new Sn([],!0)}for(h=T?h:f;++h1&&at.reverse(),q&&FO))return!1;var X=R.get(i),q=R.get(l);if(X&&q)return X==l&&q==i;var Q=-1,de=!0,ye=f&x?new os:e;for(R.set(i,l),R.set(l,i);++Q1?"& ":"")+l[h],l=l.join(f>2?", ":" "),i.replace(Yk,`{ +/* [wrapped with `+l+`] */ +`)}function qH(i){return De(i)||ls(i)||!!(av&&i&&i[av])}function ii(i,l){var f=typeof i;return l=l??J,!!l&&(f=="number"||f!="symbol"&&sE.test(i))&&i>-1&&i%1==0&&i0){if(++l>=U)return arguments[0]}else l=0;return i.apply(e,arguments)}}function A2(i,l){var f=-1,h=i.length,L=h-1;for(l=l===e?h:l;++f1?i[l-1]:e;return f=typeof f=="function"?(i.pop(),f):e,hC(i,f)});function gC(i){var l=S(i);return l.__chain__=!0,l}function iF(i,l){return l(i),i}function M2(i,l){return l(i)}var sF=ai(function(i){var l=i.length,f=l?i[0]:0,h=this.__wrapped__,L=function(R){return L7(R,i)};return l>1||this.__actions__.length||!(h instanceof tt)||!ii(f)?this.thru(L):(h=h.slice(f,+f+(l?1:0)),h.__actions__.push({func:M2,args:[L],thisArg:e}),new Sn(h,this.__chain__).thru(function(R){return l&&!R.length&&R.push(e),R}))});function lF(){return gC(this)}function uF(){return new Sn(this.value(),this.__chain__)}function cF(){this.__values__===e&&(this.__values__=TC(this.value()));var i=this.__index__>=this.__values__.length,l=i?e:this.__values__[this.__index__++];return{done:i,value:l}}function dF(){return this}function fF(i){for(var l,f=this;f instanceof m2;){var h=uC(f);h.__index__=0,h.__values__=e,l?L.__wrapped__=h:l=h;var L=h;f=f.__wrapped__}return L.__wrapped__=i,l}function pF(){var i=this.__wrapped__;if(i instanceof tt){var l=i;return this.__actions__.length&&(l=new tt(this)),l=l.reverse(),l.__actions__.push({func:M2,args:[J7],thisArg:e}),new Sn(l,this.__chain__)}return this.thru(J7)}function mF(){return kv(this.__wrapped__,this.__actions__)}var hF=y2(function(i,l,f){_t.call(i,f)?++i[f]:oi(i,f,1)});function gF(i,l,f){var h=De(i)?jg:iH;return f&&mo(i,l,f)&&(l=e),h(i,Me(l,3))}function vF(i,l){var f=De(i)?Di:hv;return f(i,Me(l,3))}var CF=Wv(cC),wF=Wv(dC);function xF(i,l){return zr(T2(i,l),1)}function yF(i,l){return zr(T2(i,l),ae)}function bF(i,l,f){return f=f===e?1:ze(f),zr(T2(i,l),f)}function vC(i,l){var f=De(i)?Ln:Wi;return f(i,Me(l,3))}function CC(i,l){var f=De(i)?ZE:mv;return f(i,Me(l,3))}var LF=y2(function(i,l,f){_t.call(i,f)?i[f].push(l):oi(i,f,[l])});function IF(i,l,f,h){i=Eo(i)?i:kl(i),f=f&&!h?ze(f):0;var L=i.length;return f<0&&(f=Sr(L+f,0)),H2(i)?f<=L&&i.indexOf(l,f)>-1:!!L&&yl(i,l,f)>-1}var SF=Xe(function(i,l,f){var h=-1,L=typeof l=="function",R=Eo(i)?Z(i.length):[];return Wi(i,function(T){R[++h]=L?Ko(l,T,f):Tc(T,l,f)}),R}),RF=y2(function(i,l,f){oi(i,f,l)});function T2(i,l){var f=De(i)?Yt:yv;return f(i,Me(l,3))}function _F(i,l,f,h){return i==null?[]:(De(l)||(l=l==null?[]:[l]),f=h?e:f,De(f)||(f=f==null?[]:[f]),Sv(i,l,f))}var AF=y2(function(i,l,f){i[f?0:1].push(l)},function(){return[[],[]]});function MF(i,l,f){var h=De(i)?c7:qg,L=arguments.length<3;return h(i,Me(l,4),f,L,Wi)}function TF(i,l,f){var h=De(i)?GE:qg,L=arguments.length<3;return h(i,Me(l,4),f,L,mv)}function PF(i,l){var f=De(i)?Di:hv;return f(i,E2(Me(l,3)))}function kF(i){var l=De(i)?cv:IH;return l(i)}function EF(i,l,f){(f?mo(i,l,f):l===e)?l=1:l=ze(l);var h=De(i)?tH:SH;return h(i,l)}function OF(i){var l=De(i)?rH:_H;return l(i)}function HF(i){if(i==null)return 0;if(Eo(i))return H2(i)?Ll(i):i.length;var l=Kr(i);return l==Ye||l==D?i.size:M7(i).length}function VF(i,l,f){var h=De(i)?d7:AH;return f&&mo(i,l,f)&&(l=e),h(i,Me(l,3))}var FF=Xe(function(i,l){if(i==null)return[];var f=l.length;return f>1&&mo(i,l[0],l[1])?l=[]:f>2&&mo(l[0],l[1],l[2])&&(l=[l[0]]),Sv(i,zr(l,1),[])}),P2=vO||function(){return Or.Date.now()};function DF(i,l){if(typeof l!="function")throw new In(n);return i=ze(i),function(){if(--i<1)return l.apply(this,arguments)}}function wC(i,l,f){return l=f?e:l,l=i&&l==null?i.length:l,ni(i,M,e,e,e,e,l)}function xC(i,l){var f;if(typeof l!="function")throw new In(n);return i=ze(i),function(){return--i>0&&(f=l.apply(this,arguments)),i<=1&&(l=e),f}}var K7=Xe(function(i,l,f){var h=y;if(f.length){var L=Bi(f,Tl(K7));h|=I}return ni(i,h,l,f,L)}),yC=Xe(function(i,l,f){var h=y|g;if(f.length){var L=Bi(f,Tl(yC));h|=I}return ni(l,h,i,f,L)});function bC(i,l,f){l=f?e:l;var h=ni(i,C,e,e,e,e,e,l);return h.placeholder=bC.placeholder,h}function LC(i,l,f){l=f?e:l;var h=ni(i,w,e,e,e,e,e,l);return h.placeholder=LC.placeholder,h}function IC(i,l,f){var h,L,R,T,O,F,X=0,q=!1,Q=!1,de=!0;if(typeof i!="function")throw new In(n);l=Mn(l)||0,Kt(f)&&(q=!!f.leading,Q="maxWait"in f,R=Q?Sr(Mn(f.maxWait)||0,l):R,de="trailing"in f?!!f.trailing:de);function ye(pr){var ea=h,ui=L;return h=L=e,X=pr,T=i.apply(ui,ea),T}function Te(pr){return X=pr,O=Hc(Je,l),q?ye(pr):T}function $e(pr){var ea=pr-F,ui=pr-X,WC=l-ea;return Q?Qr(WC,R-ui):WC}function Pe(pr){var ea=pr-F,ui=pr-X;return F===e||ea>=l||ea<0||Q&&ui>=R}function Je(){var pr=P2();if(Pe(pr))return at(pr);O=Hc(Je,$e(pr))}function at(pr){return O=e,de&&h?ye(pr):(h=L=e,T)}function on(){O!==e&&Ov(O),X=0,h=F=L=O=e}function ho(){return O===e?T:at(P2())}function nn(){var pr=P2(),ea=Pe(pr);if(h=arguments,L=this,F=pr,ea){if(O===e)return Te(F);if(Q)return Ov(O),O=Hc(Je,l),ye(F)}return O===e&&(O=Hc(Je,l)),T}return nn.cancel=on,nn.flush=ho,nn}var NF=Xe(function(i,l){return pv(i,1,l)}),BF=Xe(function(i,l,f){return pv(i,Mn(l)||0,f)});function ZF(i){return ni(i,A)}function k2(i,l){if(typeof i!="function"||l!=null&&typeof l!="function")throw new In(n);var f=function(){var h=arguments,L=l?l.apply(this,h):h[0],R=f.cache;if(R.has(L))return R.get(L);var T=i.apply(this,h);return f.cache=R.set(L,T)||R,T};return f.cache=new(k2.Cache||ri),f}k2.Cache=ri;function E2(i){if(typeof i!="function")throw new In(n);return function(){var l=arguments;switch(l.length){case 0:return!i.call(this);case 1:return!i.call(this,l[0]);case 2:return!i.call(this,l[0],l[1]);case 3:return!i.call(this,l[0],l[1],l[2])}return!i.apply(this,l)}}function GF(i){return xC(2,i)}var WF=MH(function(i,l){l=l.length==1&&De(l[0])?Yt(l[0],en(Me())):Yt(zr(l,1),en(Me()));var f=l.length;return Xe(function(h){for(var L=-1,R=Qr(h.length,f);++L=l}),ls=Cv(function(){return arguments}())?Cv:function(i){return sr(i)&&_t.call(i,"callee")&&!nv.call(i,"callee")},De=Z.isArray,nD=Ng?en(Ng):fH;function Eo(i){return i!=null&&O2(i.length)&&!si(i)}function fr(i){return sr(i)&&Eo(i)}function aD(i){return i===!0||i===!1||sr(i)&&po(i)==Rt}var $i=wO||d4,iD=Bg?en(Bg):pH;function sD(i){return sr(i)&&i.nodeType===1&&!Vc(i)}function lD(i){if(i==null)return!0;if(Eo(i)&&(De(i)||typeof i=="string"||typeof i.splice=="function"||$i(i)||Pl(i)||ls(i)))return!i.length;var l=Kr(i);if(l==Ye||l==D)return!i.size;if(Oc(i))return!M7(i).length;for(var f in i)if(_t.call(i,f))return!1;return!0}function uD(i,l){return Pc(i,l)}function cD(i,l,f){f=typeof f=="function"?f:e;var h=f?f(i,l):e;return h===e?Pc(i,l,e,f):!!h}function t4(i){if(!sr(i))return!1;var l=po(i);return l==Pt||l==qe||typeof i.message=="string"&&typeof i.name=="string"&&!Vc(i)}function dD(i){return typeof i=="number"&&iv(i)}function si(i){if(!Kt(i))return!1;var l=po(i);return l==lt||l==ft||l==Lr||l==vl}function RC(i){return typeof i=="number"&&i==ze(i)}function O2(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=J}function Kt(i){var l=typeof i;return i!=null&&(l=="object"||l=="function")}function sr(i){return i!=null&&typeof i=="object"}var _C=Zg?en(Zg):hH;function fD(i,l){return i===l||A7(i,l,j7(l))}function pD(i,l,f){return f=typeof f=="function"?f:e,A7(i,l,j7(l),f)}function mD(i){return AC(i)&&i!=+i}function hD(i){if(QH(i))throw new Fe(o);return wv(i)}function gD(i){return i===null}function vD(i){return i==null}function AC(i){return typeof i=="number"||sr(i)&&po(i)==Qt}function Vc(i){if(!sr(i)||po(i)!=Jr)return!1;var l=s2(i);if(l===null)return!0;var f=_t.call(l,"constructor")&&l.constructor;return typeof f=="function"&&f instanceof f&&o2.call(f)==pO}var r4=Gg?en(Gg):gH;function CD(i){return RC(i)&&i>=-J&&i<=J}var MC=Wg?en(Wg):vH;function H2(i){return typeof i=="string"||!De(i)&&sr(i)&&po(i)==G}function rn(i){return typeof i=="symbol"||sr(i)&&po(i)==ce}var Pl=zg?en(zg):CH;function wD(i){return i===e}function xD(i){return sr(i)&&Kr(i)==oe}function yD(i){return sr(i)&&po(i)==Le}var bD=S2(T7),LD=S2(function(i,l){return i<=l});function TC(i){if(!i)return[];if(Eo(i))return H2(i)?Jn(i):ko(i);if(Lc&&i[Lc])return tO(i[Lc]());var l=Kr(i),f=l==Ye?v7:l==D?e2:kl;return f(i)}function li(i){if(!i)return i===0?i:0;if(i=Mn(i),i===ae||i===-ae){var l=i<0?-1:1;return l*me}return i===i?i:0}function ze(i){var l=li(i),f=l%1;return l===l?f?l-f:l:0}function PC(i){return i?ns(ze(i),0,we):0}function Mn(i){if(typeof i=="number")return i;if(rn(i))return se;if(Kt(i)){var l=typeof i.valueOf=="function"?i.valueOf():i;i=Kt(l)?l+"":l}if(typeof i!="string")return i===0?i:+i;i=Yg(i);var f=nE.test(i);return f||iE.test(i)?DE(i.slice(2),f?2:8):oE.test(i)?se:+i}function kC(i){return _a(i,Oo(i))}function ID(i){return i?ns(ze(i),-J,J):i===0?i:0}function xt(i){return i==null?"":tn(i)}var SD=Al(function(i,l){if(Oc(l)||Eo(l)){_a(l,Hr(l),i);return}for(var f in l)_t.call(l,f)&&Ac(i,f,l[f])}),EC=Al(function(i,l){_a(l,Oo(l),i)}),V2=Al(function(i,l,f,h){_a(l,Oo(l),i,h)}),RD=Al(function(i,l,f,h){_a(l,Hr(l),i,h)}),_D=ai(L7);function AD(i,l){var f=_l(i);return l==null?f:dv(f,l)}var MD=Xe(function(i,l){i=Dt(i);var f=-1,h=l.length,L=h>2?l[2]:e;for(L&&mo(l[0],l[1],L)&&(h=1);++f1),R}),_a(i,W7(i),f),h&&(f=Rn(f,d|p|m,BH));for(var L=l.length;L--;)H7(f,l[L]);return f});function $D(i,l){return HC(i,E2(Me(l)))}var XD=ai(function(i,l){return i==null?{}:yH(i,l)});function HC(i,l){if(i==null)return{};var f=Yt(W7(i),function(h){return[h]});return l=Me(l),Rv(i,f,function(h,L){return l(h,L[0])})}function qD(i,l,f){l=ji(l,i);var h=-1,L=l.length;for(L||(L=1,i=e);++hl){var h=i;i=l,l=h}if(f||i%1||l%1){var L=sv();return Qr(i+L*(l-i+FE("1e-"+((L+"").length-1))),l)}return k7(i,l)}var iN=Ml(function(i,l,f){return l=l.toLowerCase(),i+(f?DC(l):l)});function DC(i){return a4(xt(i).toLowerCase())}function NC(i){return i=xt(i),i&&i.replace(lE,YE).replace(_E,"")}function sN(i,l,f){i=xt(i),l=tn(l);var h=i.length;f=f===e?h:ns(ze(f),0,h);var L=f;return f-=l.length,f>=0&&i.slice(f,L)==l}function lN(i){return i=xt(i),i&&Gk.test(i)?i.replace(gg,JE):i}function uN(i){return i=xt(i),i&&Xk.test(i)?i.replace(e7,"\\$&"):i}var cN=Ml(function(i,l,f){return i+(f?"-":"")+l.toLowerCase()}),dN=Ml(function(i,l,f){return i+(f?" ":"")+l.toLowerCase()}),fN=Gv("toLowerCase");function pN(i,l,f){i=xt(i),l=ze(l);var h=l?Ll(i):0;if(!l||h>=l)return i;var L=(l-h)/2;return I2(d2(L),f)+i+I2(c2(L),f)}function mN(i,l,f){i=xt(i),l=ze(l);var h=l?Ll(i):0;return l&&h>>0,f?(i=xt(i),i&&(typeof l=="string"||l!=null&&!r4(l))&&(l=tn(l),!l&&bl(i))?Ui(Jn(i),0,f):i.split(l,f)):[]}var yN=Ml(function(i,l,f){return i+(f?" ":"")+a4(l)});function bN(i,l,f){return i=xt(i),f=f==null?0:ns(ze(f),0,i.length),l=tn(l),i.slice(f,f+l.length)==l}function LN(i,l,f){var h=S.templateSettings;f&&mo(i,l,f)&&(l=e),i=xt(i),l=V2({},l,h,qv);var L=V2({},l.imports,h.imports,qv),R=Hr(L),T=g7(L,R),O,F,X=0,q=l.interpolate||q0,Q="__p += '",de=C7((l.escape||q0).source+"|"+q.source+"|"+(q===vg?rE:q0).source+"|"+(l.evaluate||q0).source+"|$","g"),ye="//# sourceURL="+(_t.call(l,"sourceURL")?(l.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++kE+"]")+` +`;i.replace(de,function(Pe,Je,at,on,ho,nn){return at||(at=on),Q+=i.slice(X,nn).replace(uE,QE),Je&&(O=!0,Q+=`' + +__e(`+Je+`) + +'`),ho&&(F=!0,Q+=`'; +`+ho+`; +__p += '`),at&&(Q+=`' + +((__t = (`+at+`)) == null ? '' : __t) + +'`),X=nn+Pe.length,Pe}),Q+=`'; +`;var Te=_t.call(l,"variable")&&l.variable;if(!Te)Q=`with (obj) { +`+Q+` +} +`;else if(eE.test(Te))throw new Fe(a);Q=(F?Q.replace(Dk,""):Q).replace(Nk,"$1").replace(Bk,"$1;"),Q="function("+(Te||"obj")+`) { +`+(Te?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(O?", __e = _.escape":"")+(F?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+Q+`return __p +}`;var $e=ZC(function(){return gt(R,ye+"return "+Q).apply(e,T)});if($e.source=Q,t4($e))throw $e;return $e}function IN(i){return xt(i).toLowerCase()}function SN(i){return xt(i).toUpperCase()}function RN(i,l,f){if(i=xt(i),i&&(f||l===e))return Yg(i);if(!i||!(l=tn(l)))return i;var h=Jn(i),L=Jn(l),R=Jg(h,L),T=Qg(h,L)+1;return Ui(h,R,T).join("")}function _N(i,l,f){if(i=xt(i),i&&(f||l===e))return i.slice(0,ev(i)+1);if(!i||!(l=tn(l)))return i;var h=Jn(i),L=Qg(h,Jn(l))+1;return Ui(h,0,L).join("")}function AN(i,l,f){if(i=xt(i),i&&(f||l===e))return i.replace(t7,"");if(!i||!(l=tn(l)))return i;var h=Jn(i),L=Jg(h,Jn(l));return Ui(h,L).join("")}function MN(i,l){var f=H,h=$;if(Kt(l)){var L="separator"in l?l.separator:L;f="length"in l?ze(l.length):f,h="omission"in l?tn(l.omission):h}i=xt(i);var R=i.length;if(bl(i)){var T=Jn(i);R=T.length}if(f>=R)return i;var O=f-Ll(h);if(O<1)return h;var F=T?Ui(T,0,O).join(""):i.slice(0,O);if(L===e)return F+h;if(T&&(O+=F.length-O),r4(L)){if(i.slice(O).search(L)){var X,q=F;for(L.global||(L=C7(L.source,xt(Cg.exec(L))+"g")),L.lastIndex=0;X=L.exec(q);)var Q=X.index;F=F.slice(0,Q===e?O:Q)}}else if(i.indexOf(tn(L),O)!=O){var de=F.lastIndexOf(L);de>-1&&(F=F.slice(0,de))}return F+h}function TN(i){return i=xt(i),i&&Zk.test(i)?i.replace(hg,aO):i}var PN=Ml(function(i,l,f){return i+(f?" ":"")+l.toUpperCase()}),a4=Gv("toUpperCase");function BC(i,l,f){return i=xt(i),l=f?e:l,l===e?eO(i)?lO(i):jE(i):i.match(l)||[]}var ZC=Xe(function(i,l){try{return Ko(i,e,l)}catch(f){return t4(f)?f:new Fe(f)}}),kN=ai(function(i,l){return Ln(l,function(f){f=Aa(f),oi(i,f,K7(i[f],i))}),i});function EN(i){var l=i==null?0:i.length,f=Me();return i=l?Yt(i,function(h){if(typeof h[1]!="function")throw new In(n);return[f(h[0]),h[1]]}):[],Xe(function(h){for(var L=-1;++LJ)return[];var f=we,h=Qr(i,we);l=Me(l),i-=we;for(var L=h7(h,l);++f0||l<0)?new tt(f):(i<0?f=f.takeRight(-i):i&&(f=f.drop(i)),l!==e&&(l=ze(l),f=l<0?f.dropRight(-l):f.take(l-i)),f)},tt.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},tt.prototype.toArray=function(){return this.take(we)},Ra(tt.prototype,function(i,l){var f=/^(?:filter|find|map|reject)|While$/.test(l),h=/^(?:head|last)$/.test(l),L=S[h?"take"+(l=="last"?"Right":""):l],R=h||/^find/.test(l);L&&(S.prototype[l]=function(){var T=this.__wrapped__,O=h?[1]:arguments,F=T instanceof tt,X=O[0],q=F||De(T),Q=function(Je){var at=L.apply(S,Ni([Je],O));return h&&de?at[0]:at};q&&f&&typeof X=="function"&&X.length!=1&&(F=q=!1);var de=this.__chain__,ye=!!this.__actions__.length,Te=R&&!de,$e=F&&!ye;if(!R&&q){T=$e?T:new tt(this);var Pe=i.apply(T,O);return Pe.__actions__.push({func:M2,args:[Q],thisArg:e}),new Sn(Pe,de)}return Te&&$e?i.apply(this,O):(Pe=this.thru(Q),Te?h?Pe.value()[0]:Pe.value():Pe)})}),Ln(["pop","push","shift","sort","splice","unshift"],function(i){var l=t2[i],f=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",h=/^(?:pop|shift)$/.test(i);S.prototype[i]=function(){var L=arguments;if(h&&!this.__chain__){var R=this.value();return l.apply(De(R)?R:[],L)}return this[f](function(T){return l.apply(De(T)?T:[],L)})}}),Ra(tt.prototype,function(i,l){var f=S[l];if(f){var h=f.name+"";_t.call(Rl,h)||(Rl[h]=[]),Rl[h].push({name:l,func:f})}}),Rl[b2(e,g).name]=[{name:"wrapper",func:e}],tt.prototype.clone=TO,tt.prototype.reverse=PO,tt.prototype.value=kO,S.prototype.at=sF,S.prototype.chain=lF,S.prototype.commit=uF,S.prototype.next=cF,S.prototype.plant=fF,S.prototype.reverse=pF,S.prototype.toJSON=S.prototype.valueOf=S.prototype.value=mF,S.prototype.first=S.prototype.head,Lc&&(S.prototype[Lc]=dF),S},Zi=uO();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Or._=Zi,define(function(){return Zi})):es?((es.exports=Zi)._=Zi,s7._=Zi):Or._=Zi}).call(Cc)});var Po=B(j()),Vk=B(bb());var yo=B(j());function Md(e,t){return function(){return e.apply(t,arguments)}}var{toString:ZG}=Object.prototype,{getPrototypeOf:Op}=Object,s9=(e=>t=>{let r=ZG.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),ua=e=>(e=e.toLowerCase(),t=>s9(t)===e),l9=e=>t=>typeof t===e,{isArray:uu}=Array,Td=l9("undefined");function GG(e){return e!==null&&!Td(e)&&e.constructor!==null&&!Td(e.constructor)&&fn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var Sb=ua("ArrayBuffer");function WG(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&Sb(e.buffer),t}var zG=l9("string"),fn=l9("function"),Rb=l9("number"),u9=e=>e!==null&&typeof e=="object",jG=e=>e===!0||e===!1,i9=e=>{if(s9(e)!=="object")return!1;let t=Op(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},UG=ua("Date"),$G=ua("File"),XG=ua("Blob"),qG=ua("FileList"),YG=e=>u9(e)&&fn(e.pipe),JG=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||fn(e.append)&&((t=s9(e))==="formdata"||t==="object"&&fn(e.toString)&&e.toString()==="[object FormData]"))},QG=ua("URLSearchParams"),[KG,eW,tW,rW]=["ReadableStream","Request","Response","Headers"].map(ua),oW=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Pd(e,t,{allOwnKeys:r=!1}={}){if(e===null||typeof e>"u")return;let o,n;if(typeof e!="object"&&(e=[e]),uu(e))for(o=0,n=e.length;o0;)if(n=r[o],t===n.toLowerCase())return n;return null}var Is=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Ab=e=>!Td(e)&&e!==Is;function Ep(){let{caseless:e}=Ab(this)&&this||{},t={},r=(o,n)=>{let a=e&&_b(t,n)||n;i9(t[a])&&i9(o)?t[a]=Ep(t[a],o):i9(o)?t[a]=Ep({},o):uu(o)?t[a]=o.slice():t[a]=o};for(let o=0,n=arguments.length;o(Pd(t,(n,a)=>{r&&fn(n)?e[a]=Md(n,r):e[a]=n},{allOwnKeys:o}),e),aW=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),iW=(e,t,r,o)=>{e.prototype=Object.create(t.prototype,o),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},sW=(e,t,r,o)=>{let n,a,s,u={};if(t=t||{},e==null)return t;do{for(n=Object.getOwnPropertyNames(e),a=n.length;a-- >0;)s=n[a],(!o||o(s,e,t))&&!u[s]&&(t[s]=e[s],u[s]=!0);e=r!==!1&&Op(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},lW=(e,t,r)=>{e=String(e),(r===void 0||r>e.length)&&(r=e.length),r-=t.length;let o=e.indexOf(t,r);return o!==-1&&o===r},uW=e=>{if(!e)return null;if(uu(e))return e;let t=e.length;if(!Rb(t))return null;let r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},cW=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Op(Uint8Array)),dW=(e,t)=>{let o=(e&&e[Symbol.iterator]).call(e),n;for(;(n=o.next())&&!n.done;){let a=n.value;t.call(e,a[0],a[1])}},fW=(e,t)=>{let r,o=[];for(;(r=e.exec(t))!==null;)o.push(r);return o},pW=ua("HTMLFormElement"),mW=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(r,o,n){return o.toUpperCase()+n}),Lb=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),hW=ua("RegExp"),Mb=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),o={};Pd(r,(n,a)=>{let s;(s=t(n,a,e))!==!1&&(o[a]=s||n)}),Object.defineProperties(e,o)},gW=e=>{Mb(e,(t,r)=>{if(fn(e)&&["arguments","caller","callee"].indexOf(r)!==-1)return!1;let o=e[r];if(fn(o)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},vW=(e,t)=>{let r={},o=n=>{n.forEach(a=>{r[a]=!0})};return uu(e)?o(e):o(String(e).split(t)),r},CW=()=>{},wW=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,kp="abcdefghijklmnopqrstuvwxyz",Ib="0123456789",Tb={DIGIT:Ib,ALPHA:kp,ALPHA_DIGIT:kp+kp.toUpperCase()+Ib},xW=(e=16,t=Tb.ALPHA_DIGIT)=>{let r="",{length:o}=t;for(;e--;)r+=t[Math.random()*o|0];return r};function yW(e){return!!(e&&fn(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}var bW=e=>{let t=new Array(10),r=(o,n)=>{if(u9(o)){if(t.indexOf(o)>=0)return;if(!("toJSON"in o)){t[n]=o;let a=uu(o)?[]:{};return Pd(o,(s,u)=>{let c=r(s,n+1);!Td(c)&&(a[u]=c)}),t[n]=void 0,a}}return o};return r(e,0)},LW=ua("AsyncFunction"),IW=e=>e&&(u9(e)||fn(e))&&fn(e.then)&&fn(e.catch),Pb=((e,t)=>e?setImmediate:t?((r,o)=>(Is.addEventListener("message",({source:n,data:a})=>{n===Is&&a===r&&o.length&&o.shift()()},!1),n=>{o.push(n),Is.postMessage(r,"*")}))(`axios@${Math.random()}`,[]):r=>setTimeout(r))(typeof setImmediate=="function",fn(Is.postMessage)),SW=typeof queueMicrotask<"u"?queueMicrotask.bind(Is):typeof process<"u"&&process.nextTick||Pb,N={isArray:uu,isArrayBuffer:Sb,isBuffer:GG,isFormData:JG,isArrayBufferView:WG,isString:zG,isNumber:Rb,isBoolean:jG,isObject:u9,isPlainObject:i9,isReadableStream:KG,isRequest:eW,isResponse:tW,isHeaders:rW,isUndefined:Td,isDate:UG,isFile:$G,isBlob:XG,isRegExp:hW,isFunction:fn,isStream:YG,isURLSearchParams:QG,isTypedArray:cW,isFileList:qG,forEach:Pd,merge:Ep,extend:nW,trim:oW,stripBOM:aW,inherits:iW,toFlatObject:sW,kindOf:s9,kindOfTest:ua,endsWith:lW,toArray:uW,forEachEntry:dW,matchAll:fW,isHTMLForm:pW,hasOwnProperty:Lb,hasOwnProp:Lb,reduceDescriptors:Mb,freezeMethods:gW,toObjectSet:vW,toCamelCase:mW,noop:CW,toFiniteNumber:wW,findKey:_b,global:Is,isContextDefined:Ab,ALPHABET:Tb,generateString:xW,isSpecCompliantForm:yW,toJSONObject:bW,isAsyncFn:LW,isThenable:IW,setImmediate:Pb,asap:SW};function cu(e,t,r,o,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),o&&(this.request=o),n&&(this.response=n,this.status=n.status?n.status:null)}N.inherits(cu,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:N.toJSONObject(this.config),code:this.code,status:this.status}}});var kb=cu.prototype,Eb={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Eb[e]={value:e}});Object.defineProperties(cu,Eb);Object.defineProperty(kb,"isAxiosError",{value:!0});cu.from=(e,t,r,o,n,a)=>{let s=Object.create(kb);return N.toFlatObject(e,s,function(c){return c!==Error.prototype},u=>u!=="isAxiosError"),cu.call(s,e.message,t,r,o,n),s.cause=e,s.name=e.name,a&&Object.assign(s,a),s};var Oe=cu;var c9=null;function Hp(e){return N.isPlainObject(e)||N.isArray(e)}function Hb(e){return N.endsWith(e,"[]")?e.slice(0,-2):e}function Ob(e,t,r){return e?e.concat(t).map(function(n,a){return n=Hb(n),!r&&a?"["+n+"]":n}).join(r?".":""):t}function RW(e){return N.isArray(e)&&!e.some(Hp)}var _W=N.toFlatObject(N,{},null,function(t){return/^is[A-Z]/.test(t)});function AW(e,t,r){if(!N.isObject(e))throw new TypeError("target must be an object");t=t||new(c9||FormData),r=N.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,b){return!N.isUndefined(b[g])});let o=r.metaTokens,n=r.visitor||p,a=r.dots,s=r.indexes,c=(r.Blob||typeof Blob<"u"&&Blob)&&N.isSpecCompliantForm(t);if(!N.isFunction(n))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(N.isDate(y))return y.toISOString();if(!c&&N.isBlob(y))throw new Oe("Blob is not supported. Use a Buffer instead.");return N.isArrayBuffer(y)||N.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function p(y,g,b){let C=y;if(y&&!b&&typeof y=="object"){if(N.endsWith(g,"{}"))g=o?g:g.slice(0,-2),y=JSON.stringify(y);else if(N.isArray(y)&&RW(y)||(N.isFileList(y)||N.endsWith(g,"[]"))&&(C=N.toArray(y)))return g=Hb(g),C.forEach(function(I,_){!(N.isUndefined(I)||I===null)&&t.append(s===!0?Ob([g],_,a):s===null?g:g+"[]",d(I))}),!1}return Hp(y)?!0:(t.append(Ob(b,g,a),d(y)),!1)}let m=[],v=Object.assign(_W,{defaultVisitor:p,convertValue:d,isVisitable:Hp});function x(y,g){if(!N.isUndefined(y)){if(m.indexOf(y)!==-1)throw Error("Circular reference detected in "+g.join("."));m.push(y),N.forEach(y,function(C,w){(!(N.isUndefined(C)||C===null)&&n.call(t,C,N.isString(w)?w.trim():w,g,v))===!0&&x(C,g?g.concat(w):[w])}),m.pop()}}if(!N.isObject(e))throw new TypeError("data must be an object");return x(e),t}var h1=AW;function Vb(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(o){return t[o]})}function Fb(e,t){this._pairs=[],e&&h1(e,this,t)}var Db=Fb.prototype;Db.append=function(t,r){this._pairs.push([t,r])};Db.toString=function(t){let r=t?function(o){return t.call(this,o,Vb)}:Vb;return this._pairs.map(function(n){return r(n[0])+"="+r(n[1])},"").join("&")};var d9=Fb;function MW(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function kd(e,t,r){if(!t)return e;let o=r&&r.encode||MW,n=r&&r.serialize,a;if(n?a=n(t,r):a=N.isURLSearchParams(t)?t.toString():new d9(t,r).toString(o),a){let s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}var Vp=class{constructor(){this.handlers=[]}use(t,r,o){return this.handlers.push({fulfilled:t,rejected:r,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){N.forEach(this.handlers,function(o){o!==null&&t(o)})}},Fp=Vp;var f9={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Nb=typeof URLSearchParams<"u"?URLSearchParams:d9;var Bb=typeof FormData<"u"?FormData:null;var Zb=typeof Blob<"u"?Blob:null;var Gb={isBrowser:!0,classes:{URLSearchParams:Nb,FormData:Bb,Blob:Zb},protocols:["http","https","file","blob","url","data"]};var Bp={};bB(Bp,{hasBrowserEnv:()=>Np,hasStandardBrowserEnv:()=>TW,hasStandardBrowserWebWorkerEnv:()=>PW,navigator:()=>Dp,origin:()=>kW});var Np=typeof window<"u"&&typeof document<"u",Dp=typeof navigator=="object"&&navigator||void 0,TW=Np&&(!Dp||["ReactNative","NativeScript","NS"].indexOf(Dp.product)<0),PW=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",kW=Np&&window.location.href||"http://localhost";var hr={...Bp,...Gb};function Zp(e,t){return h1(e,new hr.classes.URLSearchParams,Object.assign({visitor:function(r,o,n,a){return hr.isNode&&N.isBuffer(r)?(this.append(o,r.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function EW(e){return N.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function OW(e){let t={},r=Object.keys(e),o,n=r.length,a;for(o=0;o=r.length;return s=!s&&N.isArray(n)?n.length:s,c?(N.hasOwnProp(n,s)?n[s]=[n[s],o]:n[s]=o,!u):((!n[s]||!N.isObject(n[s]))&&(n[s]=[]),t(r,o,n[s],a)&&N.isArray(n[s])&&(n[s]=OW(n[s])),!u)}if(N.isFormData(e)&&N.isFunction(e.entries)){let r={};return N.forEachEntry(e,(o,n)=>{t(EW(o),n,r,0)}),r}return null}var p9=HW;function VW(e,t,r){if(N.isString(e))try{return(t||JSON.parse)(e),N.trim(e)}catch(o){if(o.name!=="SyntaxError")throw o}return(r||JSON.stringify)(e)}var Gp={transitional:f9,adapter:["xhr","http","fetch"],transformRequest:[function(t,r){let o=r.getContentType()||"",n=o.indexOf("application/json")>-1,a=N.isObject(t);if(a&&N.isHTMLForm(t)&&(t=new FormData(t)),N.isFormData(t))return n?JSON.stringify(p9(t)):t;if(N.isArrayBuffer(t)||N.isBuffer(t)||N.isStream(t)||N.isFile(t)||N.isBlob(t)||N.isReadableStream(t))return t;if(N.isArrayBufferView(t))return t.buffer;if(N.isURLSearchParams(t))return r.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(a){if(o.indexOf("application/x-www-form-urlencoded")>-1)return Zp(t,this.formSerializer).toString();if((u=N.isFileList(t))||o.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return h1(u?{"files[]":t}:t,c&&new c,this.formSerializer)}}return a||n?(r.setContentType("application/json",!1),VW(t)):t}],transformResponse:[function(t){let r=this.transitional||Gp.transitional,o=r&&r.forcedJSONParsing,n=this.responseType==="json";if(N.isResponse(t)||N.isReadableStream(t))return t;if(t&&N.isString(t)&&(o&&!this.responseType||n)){let s=!(r&&r.silentJSONParsing)&&n;try{return JSON.parse(t)}catch(u){if(s)throw u.name==="SyntaxError"?Oe.from(u,Oe.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:hr.classes.FormData,Blob:hr.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};N.forEach(["delete","get","head","post","put","patch"],e=>{Gp.headers[e]={}});var du=Gp;var FW=N.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Wb=e=>{let t={},r,o,n;return e&&e.split(` +`).forEach(function(s){n=s.indexOf(":"),r=s.substring(0,n).trim().toLowerCase(),o=s.substring(n+1).trim(),!(!r||t[r]&&FW[r])&&(r==="set-cookie"?t[r]?t[r].push(o):t[r]=[o]:t[r]=t[r]?t[r]+", "+o:o)}),t};var zb=Symbol("internals");function Ed(e){return e&&String(e).trim().toLowerCase()}function m9(e){return e===!1||e==null?e:N.isArray(e)?e.map(m9):String(e)}function DW(e){let t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,o;for(;o=r.exec(e);)t[o[1]]=o[2];return t}var NW=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Wp(e,t,r,o,n){if(N.isFunction(o))return o.call(this,t,r);if(n&&(t=r),!!N.isString(t)){if(N.isString(o))return t.indexOf(o)!==-1;if(N.isRegExp(o))return o.test(t)}}function BW(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,r,o)=>r.toUpperCase()+o)}function ZW(e,t){let r=N.toCamelCase(" "+t);["get","set","has"].forEach(o=>{Object.defineProperty(e,o+r,{value:function(n,a,s){return this[o].call(this,t,n,a,s)},configurable:!0})})}var fu=class{constructor(t){t&&this.set(t)}set(t,r,o){let n=this;function a(u,c,d){let p=Ed(c);if(!p)throw new Error("header name must be a non-empty string");let m=N.findKey(n,p);(!m||n[m]===void 0||d===!0||d===void 0&&n[m]!==!1)&&(n[m||c]=m9(u))}let s=(u,c)=>N.forEach(u,(d,p)=>a(d,p,c));if(N.isPlainObject(t)||t instanceof this.constructor)s(t,r);else if(N.isString(t)&&(t=t.trim())&&!NW(t))s(Wb(t),r);else if(N.isHeaders(t))for(let[u,c]of t.entries())a(c,u,o);else t!=null&&a(r,t,o);return this}get(t,r){if(t=Ed(t),t){let o=N.findKey(this,t);if(o){let n=this[o];if(!r)return n;if(r===!0)return DW(n);if(N.isFunction(r))return r.call(this,n,o);if(N.isRegExp(r))return r.exec(n);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,r){if(t=Ed(t),t){let o=N.findKey(this,t);return!!(o&&this[o]!==void 0&&(!r||Wp(this,this[o],o,r)))}return!1}delete(t,r){let o=this,n=!1;function a(s){if(s=Ed(s),s){let u=N.findKey(o,s);u&&(!r||Wp(o,o[u],u,r))&&(delete o[u],n=!0)}}return N.isArray(t)?t.forEach(a):a(t),n}clear(t){let r=Object.keys(this),o=r.length,n=!1;for(;o--;){let a=r[o];(!t||Wp(this,this[a],a,t,!0))&&(delete this[a],n=!0)}return n}normalize(t){let r=this,o={};return N.forEach(this,(n,a)=>{let s=N.findKey(o,a);if(s){r[s]=m9(n),delete r[a];return}let u=t?BW(a):String(a).trim();u!==a&&delete r[a],r[u]=m9(n),o[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let r=Object.create(null);return N.forEach(this,(o,n)=>{o!=null&&o!==!1&&(r[n]=t&&N.isArray(o)?o.join(", "):o)}),r}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,r])=>t+": "+r).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){let o=new this(t);return r.forEach(n=>o.set(n)),o}static accessor(t){let o=(this[zb]=this[zb]={accessors:{}}).accessors,n=this.prototype;function a(s){let u=Ed(s);o[u]||(ZW(n,s),o[u]=!0)}return N.isArray(t)?t.forEach(a):a(t),this}};fu.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);N.reduceDescriptors(fu.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(o){this[r]=o}}});N.freezeMethods(fu);var Ar=fu;function Od(e,t){let r=this||du,o=t||r,n=Ar.from(o.headers),a=o.data;return N.forEach(e,function(u){a=u.call(r,a,n.normalize(),t?t.status:void 0)}),n.normalize(),a}function Hd(e){return!!(e&&e.__CANCEL__)}function jb(e,t,r){Oe.call(this,e??"canceled",Oe.ERR_CANCELED,t,r),this.name="CanceledError"}N.inherits(jb,Oe,{__CANCEL__:!0});var Va=jb;function Vd(e,t,r){let o=r.config.validateStatus;!r.status||!o||o(r.status)?e(r):t(new Oe("Request failed with status code "+r.status,[Oe.ERR_BAD_REQUEST,Oe.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function zp(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function GW(e,t){e=e||10;let r=new Array(e),o=new Array(e),n=0,a=0,s;return t=t!==void 0?t:1e3,function(c){let d=Date.now(),p=o[a];s||(s=d),r[n]=c,o[n]=d;let m=a,v=0;for(;m!==n;)v+=r[m++],m=m%e;if(n=(n+1)%e,n===a&&(a=(a+1)%e),d-s{r=p,n=null,a&&(clearTimeout(a),a=null),e.apply(null,d)};return[(...d)=>{let p=Date.now(),m=p-r;m>=o?s(d,p):(n=d,a||(a=setTimeout(()=>{a=null,s(n)},o-m)))},()=>n&&s(n)]}var $b=WW;var pu=(e,t,r=3)=>{let o=0,n=Ub(50,250);return $b(a=>{let s=a.loaded,u=a.lengthComputable?a.total:void 0,c=s-o,d=n(c),p=s<=u;o=s;let m={loaded:s,total:u,progress:u?s/u:void 0,bytes:c,rate:d||void 0,estimated:d&&u&&p?(u-s)/d:void 0,event:a,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(m)},r)},jp=(e,t)=>{let r=e!=null;return[o=>t[0]({lengthComputable:r,total:e,loaded:o}),t[1]]},Up=e=>(...t)=>N.asap(()=>e(...t));var Xb=hr.hasStandardBrowserEnv?function(){let t=hr.navigator&&/(msie|trident)/i.test(hr.navigator.userAgent),r=document.createElement("a"),o;function n(a){let s=a;return t&&(r.setAttribute("href",s),s=r.href),r.setAttribute("href",s),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return o=n(window.location.href),function(s){let u=N.isString(s)?n(s):s;return u.protocol===o.protocol&&u.host===o.host}}():function(){return function(){return!0}}();var qb=hr.hasStandardBrowserEnv?{write(e,t,r,o,n,a){let s=[e+"="+encodeURIComponent(t)];N.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),N.isString(o)&&s.push("path="+o),N.isString(n)&&s.push("domain="+n),a===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){let t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $p(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Xp(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Fd(e,t){return e&&!$p(t)?Xp(e,t):t}var Yb=e=>e instanceof Ar?{...e}:e;function ca(e,t){t=t||{};let r={};function o(d,p,m){return N.isPlainObject(d)&&N.isPlainObject(p)?N.merge.call({caseless:m},d,p):N.isPlainObject(p)?N.merge({},p):N.isArray(p)?p.slice():p}function n(d,p,m){if(N.isUndefined(p)){if(!N.isUndefined(d))return o(void 0,d,m)}else return o(d,p,m)}function a(d,p){if(!N.isUndefined(p))return o(void 0,p)}function s(d,p){if(N.isUndefined(p)){if(!N.isUndefined(d))return o(void 0,d)}else return o(void 0,p)}function u(d,p,m){if(m in t)return o(d,p);if(m in e)return o(void 0,d)}let c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:u,headers:(d,p)=>n(Yb(d),Yb(p),!0)};return N.forEach(Object.keys(Object.assign({},e,t)),function(p){let m=c[p]||n,v=m(e[p],t[p],p);N.isUndefined(v)&&m!==u||(r[p]=v)}),r}var h9=e=>{let t=ca({},e),{data:r,withXSRFToken:o,xsrfHeaderName:n,xsrfCookieName:a,headers:s,auth:u}=t;t.headers=s=Ar.from(s),t.url=kd(Fd(t.baseURL,t.url),e.params,e.paramsSerializer),u&&s.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let c;if(N.isFormData(r)){if(hr.hasStandardBrowserEnv||hr.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){let[d,...p]=c?c.split(";").map(m=>m.trim()).filter(Boolean):[];s.setContentType([d||"multipart/form-data",...p].join("; "))}}if(hr.hasStandardBrowserEnv&&(o&&N.isFunction(o)&&(o=o(t)),o||o!==!1&&Xb(t.url))){let d=n&&a&&qb.read(a);d&&s.set(n,d)}return t};var zW=typeof XMLHttpRequest<"u",Jb=zW&&function(e){return new Promise(function(r,o){let n=h9(e),a=n.data,s=Ar.from(n.headers).normalize(),{responseType:u,onUploadProgress:c,onDownloadProgress:d}=n,p,m,v,x,y;function g(){x&&x(),y&&y(),n.cancelToken&&n.cancelToken.unsubscribe(p),n.signal&&n.signal.removeEventListener("abort",p)}let b=new XMLHttpRequest;b.open(n.method.toUpperCase(),n.url,!0),b.timeout=n.timeout;function C(){if(!b)return;let I=Ar.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),M={data:!u||u==="text"||u==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:I,config:e,request:b};Vd(function(A){r(A),g()},function(A){o(A),g()},M),b=null}"onloadend"in b?b.onloadend=C:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(C)},b.onabort=function(){b&&(o(new Oe("Request aborted",Oe.ECONNABORTED,e,b)),b=null)},b.onerror=function(){o(new Oe("Network Error",Oe.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let _=n.timeout?"timeout of "+n.timeout+"ms exceeded":"timeout exceeded",M=n.transitional||f9;n.timeoutErrorMessage&&(_=n.timeoutErrorMessage),o(new Oe(_,M.clarifyTimeoutError?Oe.ETIMEDOUT:Oe.ECONNABORTED,e,b)),b=null},a===void 0&&s.setContentType(null),"setRequestHeader"in b&&N.forEach(s.toJSON(),function(_,M){b.setRequestHeader(M,_)}),N.isUndefined(n.withCredentials)||(b.withCredentials=!!n.withCredentials),u&&u!=="json"&&(b.responseType=n.responseType),d&&([v,y]=pu(d,!0),b.addEventListener("progress",v)),c&&b.upload&&([m,x]=pu(c),b.upload.addEventListener("progress",m),b.upload.addEventListener("loadend",x)),(n.cancelToken||n.signal)&&(p=I=>{b&&(o(!I||I.type?new Va(null,e,b):I),b.abort(),b=null)},n.cancelToken&&n.cancelToken.subscribe(p),n.signal&&(n.signal.aborted?p():n.signal.addEventListener("abort",p)));let w=zp(n.url);if(w&&hr.protocols.indexOf(w)===-1){o(new Oe("Unsupported protocol "+w+":",Oe.ERR_BAD_REQUEST,e));return}b.send(a||null)})};var jW=(e,t)=>{let{length:r}=e=e?e.filter(Boolean):[];if(t||r){let o=new AbortController,n,a=function(d){if(!n){n=!0,u();let p=d instanceof Error?d:this.reason;o.abort(p instanceof Oe?p:new Va(p instanceof Error?p.message:p))}},s=t&&setTimeout(()=>{s=null,a(new Oe(`timeout ${t} of ms exceeded`,Oe.ETIMEDOUT))},t),u=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(a):d.removeEventListener("abort",a)}),e=null)};e.forEach(d=>d.addEventListener("abort",a));let{signal:c}=o;return c.unsubscribe=()=>N.asap(u),c}},Qb=jW;var UW=function*(e,t){let r=e.byteLength;if(!t||r{let n=$W(e,t),a=0,s,u=c=>{s||(s=!0,o&&o(c))};return new ReadableStream({async pull(c){try{let{done:d,value:p}=await n.next();if(d){u(),c.close();return}let m=p.byteLength;if(r){let v=a+=m;r(v)}c.enqueue(new Uint8Array(p))}catch(d){throw u(d),d}},cancel(c){return u(c),n.return()}},{highWaterMark:2})};var v9=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",eL=v9&&typeof ReadableStream=="function",qW=v9&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),tL=(e,...t)=>{try{return!!e(...t)}catch{return!1}},YW=eL&&tL(()=>{let e=!1,t=new Request(hr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Kb=64*1024,Yp=eL&&tL(()=>N.isReadableStream(new Response("").body)),g9={stream:Yp&&(e=>e.body)};v9&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!g9[t]&&(g9[t]=N.isFunction(e[t])?r=>r[t]():(r,o)=>{throw new Oe(`Response type '${t}' is not supported`,Oe.ERR_NOT_SUPPORT,o)})})})(new Response);var JW=async e=>{if(e==null)return 0;if(N.isBlob(e))return e.size;if(N.isSpecCompliantForm(e))return(await new Request(hr.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(N.isArrayBufferView(e)||N.isArrayBuffer(e))return e.byteLength;if(N.isURLSearchParams(e)&&(e=e+""),N.isString(e))return(await qW(e)).byteLength},QW=async(e,t)=>{let r=N.toFiniteNumber(e.getContentLength());return r??JW(t)},rL=v9&&(async e=>{let{url:t,method:r,data:o,signal:n,cancelToken:a,timeout:s,onDownloadProgress:u,onUploadProgress:c,responseType:d,headers:p,withCredentials:m="same-origin",fetchOptions:v}=h9(e);d=d?(d+"").toLowerCase():"text";let x=Qb([n,a&&a.toAbortSignal()],s),y,g=x&&x.unsubscribe&&(()=>{x.unsubscribe()}),b;try{if(c&&YW&&r!=="get"&&r!=="head"&&(b=await QW(p,o))!==0){let M=new Request(t,{method:"POST",body:o,duplex:"half"}),E;if(N.isFormData(o)&&(E=M.headers.get("content-type"))&&p.setContentType(E),M.body){let[A,H]=jp(b,pu(Up(c)));o=qp(M.body,Kb,A,H)}}N.isString(m)||(m=m?"include":"omit");let C="credentials"in Request.prototype;y=new Request(t,{...v,signal:x,method:r.toUpperCase(),headers:p.normalize().toJSON(),body:o,duplex:"half",credentials:C?m:void 0});let w=await fetch(y),I=Yp&&(d==="stream"||d==="response");if(Yp&&(u||I&&g)){let M={};["status","statusText","headers"].forEach($=>{M[$]=w[$]});let E=N.toFiniteNumber(w.headers.get("content-length")),[A,H]=u&&jp(E,pu(Up(u),!0))||[];w=new Response(qp(w.body,Kb,A,()=>{H&&H(),g&&g()}),M)}d=d||"text";let _=await g9[N.findKey(g9,d)||"text"](w,e);return!I&&g&&g(),await new Promise((M,E)=>{Vd(M,E,{data:_,headers:Ar.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:y})})}catch(C){throw g&&g(),C&&C.name==="TypeError"&&/fetch/i.test(C.message)?Object.assign(new Oe("Network Error",Oe.ERR_NETWORK,e,y),{cause:C.cause||C}):Oe.from(C,C&&C.code,e,y)}});var Jp={http:c9,xhr:Jb,fetch:rL};N.forEach(Jp,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});var oL=e=>`- ${e}`,KW=e=>N.isFunction(e)||e===null||e===!1,C9={getAdapter:e=>{e=N.isArray(e)?e:[e];let{length:t}=e,r,o,n={};for(let a=0;a`adapter ${u} `+(c===!1?"is not supported by the environment":"is not available in the build")),s=t?a.length>1?`since : +`+a.map(oL).join(` +`):" "+oL(a[0]):"as no adapter specified";throw new Oe("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return o},adapters:Jp};function Qp(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Va(null,e)}function w9(e){return Qp(e),e.headers=Ar.from(e.headers),e.data=Od.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),C9.getAdapter(e.adapter||du.adapter)(e).then(function(o){return Qp(e),o.data=Od.call(e,e.transformResponse,o),o.headers=Ar.from(o.headers),o},function(o){return Hd(o)||(Qp(e),o&&o.response&&(o.response.data=Od.call(e,e.transformResponse,o.response),o.response.headers=Ar.from(o.response.headers))),Promise.reject(o)})}var x9="1.7.7";var Kp={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Kp[e]=function(o){return typeof o===e||"a"+(t<1?"n ":" ")+e}});var nL={};Kp.transitional=function(t,r,o){function n(a,s){return"[Axios v"+x9+"] Transitional option '"+a+"'"+s+(o?". "+o:"")}return(a,s,u)=>{if(t===!1)throw new Oe(n(s," has been removed"+(r?" in "+r:"")),Oe.ERR_DEPRECATED);return r&&!nL[s]&&(nL[s]=!0,console.warn(n(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(a,s,u):!0}};function ez(e,t,r){if(typeof e!="object")throw new Oe("options must be an object",Oe.ERR_BAD_OPTION_VALUE);let o=Object.keys(e),n=o.length;for(;n-- >0;){let a=o[n],s=t[a];if(s){let u=e[a],c=u===void 0||s(u,a,e);if(c!==!0)throw new Oe("option "+a+" must be "+c,Oe.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new Oe("Unknown option "+a,Oe.ERR_BAD_OPTION)}}var y9={assertOptions:ez,validators:Kp};var g1=y9.validators,mu=class{constructor(t){this.defaults=t,this.interceptors={request:new Fp,response:new Fp}}async request(t,r){try{return await this._request(t,r)}catch(o){if(o instanceof Error){let n;Error.captureStackTrace?Error.captureStackTrace(n={}):n=new Error;let a=n.stack?n.stack.replace(/^.+\n/,""):"";try{o.stack?a&&!String(o.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(o.stack+=` +`+a):o.stack=a}catch{}}throw o}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=ca(this.defaults,r);let{transitional:o,paramsSerializer:n,headers:a}=r;o!==void 0&&y9.assertOptions(o,{silentJSONParsing:g1.transitional(g1.boolean),forcedJSONParsing:g1.transitional(g1.boolean),clarifyTimeoutError:g1.transitional(g1.boolean)},!1),n!=null&&(N.isFunction(n)?r.paramsSerializer={serialize:n}:y9.assertOptions(n,{encode:g1.function,serialize:g1.function},!0)),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=a&&N.merge(a.common,a[r.method]);a&&N.forEach(["delete","get","head","post","put","patch","common"],y=>{delete a[y]}),r.headers=Ar.concat(s,a);let u=[],c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(r)===!1||(c=c&&g.synchronous,u.unshift(g.fulfilled,g.rejected))});let d=[];this.interceptors.response.forEach(function(g){d.push(g.fulfilled,g.rejected)});let p,m=0,v;if(!c){let y=[w9.bind(this),void 0];for(y.unshift.apply(y,u),y.push.apply(y,d),v=y.length,p=Promise.resolve(r);m{if(!o._listeners)return;let a=o._listeners.length;for(;a-- >0;)o._listeners[a](n);o._listeners=null}),this.promise.then=n=>{let a,s=new Promise(u=>{o.subscribe(u),a=u}).then(n);return s.cancel=function(){o.unsubscribe(a)},s},t(function(a,s,u){o.reason||(o.reason=new Va(a,s,u),r(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){let t=new AbortController,r=o=>{t.abort(o)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new e(function(n){t=n}),cancel:t}}},aL=e6;function t6(e){return function(r){return e.apply(null,r)}}function r6(e){return N.isObject(e)&&e.isAxiosError===!0}var o6={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(o6).forEach(([e,t])=>{o6[t]=e});var iL=o6;function sL(e){let t=new Dd(e),r=Md(Dd.prototype.request,t);return N.extend(r,Dd.prototype,t,{allOwnKeys:!0}),N.extend(r,t,null,{allOwnKeys:!0}),r.create=function(n){return sL(ca(e,n))},r}var wr=sL(du);wr.Axios=Dd;wr.CanceledError=Va;wr.CancelToken=aL;wr.isCancel=Hd;wr.VERSION=x9;wr.toFormData=h1;wr.AxiosError=Oe;wr.Cancel=wr.CanceledError;wr.all=function(t){return Promise.all(t)};wr.spread=t6;wr.isAxiosError=r6;wr.mergeConfig=ca;wr.AxiosHeaders=Ar;wr.formToJSON=e=>p9(N.isHTMLForm(e)?new FormData(e):e);wr.getAdapter=C9.getAdapter;wr.HttpStatusCode=iL;wr.default=wr;var b9=wr;var{Axios:Boe,AxiosError:tz,CanceledError:Zoe,isCancel:Goe,CancelToken:Woe,VERSION:zoe,all:joe,Cancel:Uoe,isAxiosError:$oe,spread:Xoe,toFormData:qoe,AxiosHeaders:Yoe,HttpStatusCode:Joe,formToJSON:Qoe,getAdapter:Koe,mergeConfig:ene}=b9;var ut;(function(e){e.assertEqual=n=>n;function t(n){}e.assertIs=t;function r(n){throw new Error}e.assertNever=r,e.arrayToEnum=n=>{let a={};for(let s of n)a[s]=s;return a},e.getValidEnumValues=n=>{let a=e.objectKeys(n).filter(u=>typeof n[n[u]]!="number"),s={};for(let u of a)s[u]=n[u];return e.objectValues(s)},e.objectValues=n=>e.objectKeys(n).map(function(a){return n[a]}),e.objectKeys=typeof Object.keys=="function"?n=>Object.keys(n):n=>{let a=[];for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&a.push(s);return a},e.find=(n,a)=>{for(let s of n)if(a(s))return s},e.isInteger=typeof Number.isInteger=="function"?n=>Number.isInteger(n):n=>typeof n=="number"&&isFinite(n)&&Math.floor(n)===n;function o(n,a=" | "){return n.map(s=>typeof s=="string"?`'${s}'`:s).join(a)}e.joinValues=o,e.jsonStringifyReplacer=(n,a)=>typeof a=="bigint"?a.toString():a})(ut||(ut={}));var a6;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(a6||(a6={}));var he=ut.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),v1=e=>{switch(typeof e){case"undefined":return he.undefined;case"string":return he.string;case"number":return isNaN(e)?he.nan:he.number;case"boolean":return he.boolean;case"function":return he.function;case"bigint":return he.bigint;case"symbol":return he.symbol;case"object":return Array.isArray(e)?he.array:e===null?he.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?he.promise:typeof Map<"u"&&e instanceof Map?he.map:typeof Set<"u"&&e instanceof Set?he.set:typeof Date<"u"&&e instanceof Date?he.date:he.object;default:return he.unknown}},re=ut.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),rz=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),pn=class e extends Error{constructor(t){super(),this.issues=[],this.addIssue=o=>{this.issues=[...this.issues,o]},this.addIssues=(o=[])=>{this.issues=[...this.issues,...o]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let r=t||function(a){return a.message},o={_errors:[]},n=a=>{for(let s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)o._errors.push(r(s));else{let u=o,c=0;for(;cr.message){let r={},o=[];for(let n of this.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}get formErrors(){return this.flatten()}};pn.create=e=>new pn(e);var vu=(e,t)=>{let r;switch(e.code){case re.invalid_type:e.received===he.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case re.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ut.jsonStringifyReplacer)}`;break;case re.unrecognized_keys:r=`Unrecognized key(s) in object: ${ut.joinValues(e.keys,", ")}`;break;case re.invalid_union:r="Invalid input";break;case re.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ut.joinValues(e.options)}`;break;case re.invalid_enum_value:r=`Invalid enum value. Expected ${ut.joinValues(e.options)}, received '${e.received}'`;break;case re.invalid_arguments:r="Invalid function arguments";break;case re.invalid_return_type:r="Invalid function return type";break;case re.invalid_date:r="Invalid date";break;case re.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:ut.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case re.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case re.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case re.custom:r="Invalid input";break;case re.invalid_intersection_types:r="Intersection results could not be merged";break;case re.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case re.not_finite:r="Number must be finite";break;default:r=t.defaultError,ut.assertNever(e)}return{message:r}},cL=vu;function oz(e){cL=e}function L9(){return cL}var I9=e=>{let{data:t,path:r,errorMaps:o,issueData:n}=e,a=[...r,...n.path||[]],s={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let u="",c=o.filter(d=>!!d).slice().reverse();for(let d of c)u=d(s,{data:t,defaultError:u}).message;return{...n,path:a,message:u}},nz=[];function pe(e,t){let r=L9(),o=I9({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===vu?void 0:vu].filter(n=>!!n)});e.common.issues.push(o)}var ao=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let o=[];for(let n of r){if(n.status==="aborted")return Ee;n.status==="dirty"&&t.dirty(),o.push(n.value)}return{status:t.value,value:o}}static async mergeObjectAsync(t,r){let o=[];for(let n of r){let a=await n.key,s=await n.value;o.push({key:a,value:s})}return e.mergeObjectSync(t,o)}static mergeObjectSync(t,r){let o={};for(let n of r){let{key:a,value:s}=n;if(a.status==="aborted"||s.status==="aborted")return Ee;a.status==="dirty"&&t.dirty(),s.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof s.value<"u"||n.alwaysSet)&&(o[a.value]=s.value)}return{status:t.value,value:o}}},Ee=Object.freeze({status:"aborted"}),gu=e=>({status:"dirty",value:e}),xo=e=>({status:"valid",value:e}),i6=e=>e.status==="aborted",s6=e=>e.status==="dirty",Zd=e=>e.status==="valid",Gd=e=>typeof Promise<"u"&&e instanceof Promise;function S9(e,t,r,o){if(r==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?o:r==="a"?o.call(e):o?o.value:t.get(e)}function dL(e,t,r,o,n){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?n.call(e,r):n?n.value=r:t.set(e,r),r}var Ie;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ie||(Ie={}));var Nd,Bd,Dn=class{constructor(t,r,o,n){this._cachedPath=[],this.parent=t,this.data=r,this._path=o,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},lL=(e,t)=>{if(Zd(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new pn(e.common.issues);return this._error=r,this._error}}};function Ze(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:o,description:n}=e;if(t&&(r||o))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:n}:{errorMap:(s,u)=>{var c,d;let{message:p}=e;return s.code==="invalid_enum_value"?{message:p??u.defaultError}:typeof u.data>"u"?{message:(c=p??o)!==null&&c!==void 0?c:u.defaultError}:s.code!=="invalid_type"?{message:u.defaultError}:{message:(d=p??r)!==null&&d!==void 0?d:u.defaultError}},description:n}}var Ge=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return v1(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:v1(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new ao,ctx:{common:t.parent.common,data:t.data,parsedType:v1(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Gd(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let o=this.safeParse(t,r);if(o.success)return o.data;throw o.error}safeParse(t,r){var o;let n={common:{issues:[],async:(o=r?.async)!==null&&o!==void 0?o:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:v1(t)},a=this._parseSync({data:t,path:n.path,parent:n});return lL(n,a)}async parseAsync(t,r){let o=await this.safeParseAsync(t,r);if(o.success)return o.data;throw o.error}async safeParseAsync(t,r){let o={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:v1(t)},n=this._parse({data:t,path:o.path,parent:o}),a=await(Gd(n)?n:Promise.resolve(n));return lL(o,a)}refine(t,r){let o=n=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(n):r;return this._refinement((n,a)=>{let s=t(n),u=()=>a.addIssue({code:re.custom,...o(n)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(u(),!1)):s?!0:(u(),!1)})}refinement(t,r){return this._refinement((o,n)=>t(o)?!0:(n.addIssue(typeof r=="function"?r(o,n):r),!1))}_refinement(t){return new mn({schema:this,typeName:ke.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Fn.create(this,this._def)}nullable(){return Da.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return bi.create(this,this._def)}promise(){return x1.create(this,this._def)}or(t){return Ps.create([this,t],this._def)}and(t){return ks.create(this,t,this._def)}transform(t){return new mn({...Ze(this._def),schema:this,typeName:ke.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Fs({...Ze(this._def),innerType:this,defaultValue:r,typeName:ke.ZodDefault})}brand(){return new Wd({typeName:ke.ZodBranded,type:this,...Ze(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Ds({...Ze(this._def),innerType:this,catchValue:r,typeName:ke.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return zd.create(this,t)}readonly(){return Ns.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},az=/^c[^\s-]{8,}$/i,iz=/^[0-9a-z]+$/,sz=/^[0-9A-HJKMNP-TV-Z]{26}$/,lz=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,uz=/^[a-z0-9_-]{21}$/i,cz=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,dz=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,fz="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",n6,pz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mz=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,hz=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,fL="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",gz=new RegExp(`^${fL}$`);function pL(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function vz(e){return new RegExp(`^${pL(e)}$`)}function mL(e){let t=`${fL}T${pL(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Cz(e,t){return!!((t==="v4"||!t)&&pz.test(e)||(t==="v6"||!t)&&mz.test(e))}var C1=class e extends Ge{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==he.string){let a=this._getOrReturnCtx(t);return pe(a,{code:re.invalid_type,expected:he.string,received:a.parsedType}),Ee}let o=new ao,n;for(let a of this._def.checks)if(a.kind==="min")t.data.lengtha.value&&(n=this._getOrReturnCtx(t,n),pe(n,{code:re.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),o.dirty());else if(a.kind==="length"){let s=t.data.length>a.value,u=t.data.lengtht.test(n),{validation:r,code:re.invalid_string,...Ie.errToObj(o)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ie.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ie.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ie.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ie.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Ie.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ie.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ie.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ie.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Ie.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ie.errToObj(t)})}datetime(t){var r,o;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(r=t?.offset)!==null&&r!==void 0?r:!1,local:(o=t?.local)!==null&&o!==void 0?o:!1,...Ie.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...Ie.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...Ie.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Ie.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...Ie.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Ie.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Ie.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Ie.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Ie.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Ie.errToObj(r)})}nonempty(t){return this.min(1,Ie.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new C1({checks:[],typeName:ke.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Ze(e)})};function wz(e,t){let r=(e.toString().split(".")[1]||"").length,o=(t.toString().split(".")[1]||"").length,n=r>o?r:o,a=parseInt(e.toFixed(n).replace(".","")),s=parseInt(t.toFixed(n).replace(".",""));return a%s/Math.pow(10,n)}var Ss=class e extends Ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==he.number){let a=this._getOrReturnCtx(t);return pe(a,{code:re.invalid_type,expected:he.number,received:a.parsedType}),Ee}let o,n=new ao;for(let a of this._def.checks)a.kind==="int"?ut.isInteger(t.data)||(o=this._getOrReturnCtx(t,o),pe(o,{code:re.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(o=this._getOrReturnCtx(t,o),pe(o,{code:re.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?wz(t.data,a.value)!==0&&(o=this._getOrReturnCtx(t,o),pe(o,{code:re.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(o=this._getOrReturnCtx(t,o),pe(o,{code:re.not_finite,message:a.message}),n.dirty()):ut.assertNever(a);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ie.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ie.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ie.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ie.toString(r))}setLimit(t,r,o,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:o,message:Ie.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ie.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ie.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ie.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ie.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ie.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ie.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Ie.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ie.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ie.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&ut.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let o of this._def.checks){if(o.kind==="finite"||o.kind==="int"||o.kind==="multipleOf")return!0;o.kind==="min"?(r===null||o.value>r)&&(r=o.value):o.kind==="max"&&(t===null||o.valuenew Ss({checks:[],typeName:ke.ZodNumber,coerce:e?.coerce||!1,...Ze(e)});var Rs=class e extends Ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==he.bigint){let a=this._getOrReturnCtx(t);return pe(a,{code:re.invalid_type,expected:he.bigint,received:a.parsedType}),Ee}let o,n=new ao;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.dataa.value:t.data>=a.value)&&(o=this._getOrReturnCtx(t,o),pe(o,{code:re.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(o=this._getOrReturnCtx(t,o),pe(o,{code:re.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):ut.assertNever(a);return{status:n.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Ie.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Ie.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Ie.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Ie.toString(r))}setLimit(t,r,o,n){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:o,message:Ie.toString(n)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ie.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ie.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ie.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ie.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Ie.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value{var t;return new Rs({checks:[],typeName:ke.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Ze(e)})};var _s=class extends Ge{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==he.boolean){let o=this._getOrReturnCtx(t);return pe(o,{code:re.invalid_type,expected:he.boolean,received:o.parsedType}),Ee}return xo(t.data)}};_s.create=e=>new _s({typeName:ke.ZodBoolean,coerce:e?.coerce||!1,...Ze(e)});var As=class e extends Ge{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==he.date){let a=this._getOrReturnCtx(t);return pe(a,{code:re.invalid_type,expected:he.date,received:a.parsedType}),Ee}if(isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return pe(a,{code:re.invalid_date}),Ee}let o=new ao,n;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()a.value&&(n=this._getOrReturnCtx(t,n),pe(n,{code:re.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),o.dirty()):ut.assertNever(a);return{status:o.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Ie.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Ie.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew As({checks:[],coerce:e?.coerce||!1,typeName:ke.ZodDate,...Ze(e)});var Cu=class extends Ge{_parse(t){if(this._getType(t)!==he.symbol){let o=this._getOrReturnCtx(t);return pe(o,{code:re.invalid_type,expected:he.symbol,received:o.parsedType}),Ee}return xo(t.data)}};Cu.create=e=>new Cu({typeName:ke.ZodSymbol,...Ze(e)});var Ms=class extends Ge{_parse(t){if(this._getType(t)!==he.undefined){let o=this._getOrReturnCtx(t);return pe(o,{code:re.invalid_type,expected:he.undefined,received:o.parsedType}),Ee}return xo(t.data)}};Ms.create=e=>new Ms({typeName:ke.ZodUndefined,...Ze(e)});var Ts=class extends Ge{_parse(t){if(this._getType(t)!==he.null){let o=this._getOrReturnCtx(t);return pe(o,{code:re.invalid_type,expected:he.null,received:o.parsedType}),Ee}return xo(t.data)}};Ts.create=e=>new Ts({typeName:ke.ZodNull,...Ze(e)});var w1=class extends Ge{constructor(){super(...arguments),this._any=!0}_parse(t){return xo(t.data)}};w1.create=e=>new w1({typeName:ke.ZodAny,...Ze(e)});var yi=class extends Ge{constructor(){super(...arguments),this._unknown=!0}_parse(t){return xo(t.data)}};yi.create=e=>new yi({typeName:ke.ZodUnknown,...Ze(e)});var da=class extends Ge{_parse(t){let r=this._getOrReturnCtx(t);return pe(r,{code:re.invalid_type,expected:he.never,received:r.parsedType}),Ee}};da.create=e=>new da({typeName:ke.ZodNever,...Ze(e)});var wu=class extends Ge{_parse(t){if(this._getType(t)!==he.undefined){let o=this._getOrReturnCtx(t);return pe(o,{code:re.invalid_type,expected:he.void,received:o.parsedType}),Ee}return xo(t.data)}};wu.create=e=>new wu({typeName:ke.ZodVoid,...Ze(e)});var bi=class e extends Ge{_parse(t){let{ctx:r,status:o}=this._processInputParams(t),n=this._def;if(r.parsedType!==he.array)return pe(r,{code:re.invalid_type,expected:he.array,received:r.parsedType}),Ee;if(n.exactLength!==null){let s=r.data.length>n.exactLength.value,u=r.data.lengthn.maxLength.value&&(pe(r,{code:re.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),o.dirty()),r.common.async)return Promise.all([...r.data].map((s,u)=>n.type._parseAsync(new Dn(r,s,r.path,u)))).then(s=>ao.mergeArray(o,s));let a=[...r.data].map((s,u)=>n.type._parseSync(new Dn(r,s,r.path,u)));return ao.mergeArray(o,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:Ie.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:Ie.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:Ie.toString(r)}})}nonempty(t){return this.min(1,t)}};bi.create=(e,t)=>new bi({type:e,minLength:null,maxLength:null,exactLength:null,typeName:ke.ZodArray,...Ze(t)});function hu(e){if(e instanceof Zo){let t={};for(let r in e.shape){let o=e.shape[r];t[r]=Fn.create(hu(o))}return new Zo({...e._def,shape:()=>t})}else return e instanceof bi?new bi({...e._def,type:hu(e.element)}):e instanceof Fn?Fn.create(hu(e.unwrap())):e instanceof Da?Da.create(hu(e.unwrap())):e instanceof Fa?Fa.create(e.items.map(t=>hu(t))):e}var Zo=class e extends Ge{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=ut.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==he.object){let d=this._getOrReturnCtx(t);return pe(d,{code:re.invalid_type,expected:he.object,received:d.parsedType}),Ee}let{status:o,ctx:n}=this._processInputParams(t),{shape:a,keys:s}=this._getCached(),u=[];if(!(this._def.catchall instanceof da&&this._def.unknownKeys==="strip"))for(let d in n.data)s.includes(d)||u.push(d);let c=[];for(let d of s){let p=a[d],m=n.data[d];c.push({key:{status:"valid",value:d},value:p._parse(new Dn(n,m,n.path,d)),alwaysSet:d in n.data})}if(this._def.catchall instanceof da){let d=this._def.unknownKeys;if(d==="passthrough")for(let p of u)c.push({key:{status:"valid",value:p},value:{status:"valid",value:n.data[p]}});else if(d==="strict")u.length>0&&(pe(n,{code:re.unrecognized_keys,keys:u}),o.dirty());else if(d!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let d=this._def.catchall;for(let p of u){let m=n.data[p];c.push({key:{status:"valid",value:p},value:d._parse(new Dn(n,m,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let d=[];for(let p of c){let m=await p.key,v=await p.value;d.push({key:m,value:v,alwaysSet:p.alwaysSet})}return d}).then(d=>ao.mergeObjectSync(o,d)):ao.mergeObjectSync(o,c)}get shape(){return this._def.shape()}strict(t){return Ie.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,o)=>{var n,a,s,u;let c=(s=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,r,o).message)!==null&&s!==void 0?s:o.defaultError;return r.code==="unrecognized_keys"?{message:(u=Ie.errToObj(t).message)!==null&&u!==void 0?u:c}:{message:c}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ke.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};return ut.objectKeys(t).forEach(o=>{t[o]&&this.shape[o]&&(r[o]=this.shape[o])}),new e({...this._def,shape:()=>r})}omit(t){let r={};return ut.objectKeys(this.shape).forEach(o=>{t[o]||(r[o]=this.shape[o])}),new e({...this._def,shape:()=>r})}deepPartial(){return hu(this)}partial(t){let r={};return ut.objectKeys(this.shape).forEach(o=>{let n=this.shape[o];t&&!t[o]?r[o]=n:r[o]=n.optional()}),new e({...this._def,shape:()=>r})}required(t){let r={};return ut.objectKeys(this.shape).forEach(o=>{if(t&&!t[o])r[o]=this.shape[o];else{let a=this.shape[o];for(;a instanceof Fn;)a=a._def.innerType;r[o]=a}}),new e({...this._def,shape:()=>r})}keyof(){return hL(ut.objectKeys(this.shape))}};Zo.create=(e,t)=>new Zo({shape:()=>e,unknownKeys:"strip",catchall:da.create(),typeName:ke.ZodObject,...Ze(t)});Zo.strictCreate=(e,t)=>new Zo({shape:()=>e,unknownKeys:"strict",catchall:da.create(),typeName:ke.ZodObject,...Ze(t)});Zo.lazycreate=(e,t)=>new Zo({shape:e,unknownKeys:"strip",catchall:da.create(),typeName:ke.ZodObject,...Ze(t)});var Ps=class extends Ge{_parse(t){let{ctx:r}=this._processInputParams(t),o=this._def.options;function n(a){for(let u of a)if(u.result.status==="valid")return u.result;for(let u of a)if(u.result.status==="dirty")return r.common.issues.push(...u.ctx.common.issues),u.result;let s=a.map(u=>new pn(u.ctx.common.issues));return pe(r,{code:re.invalid_union,unionErrors:s}),Ee}if(r.common.async)return Promise.all(o.map(async a=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await a._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(n);{let a,s=[];for(let c of o){let d={...r,common:{...r.common,issues:[]},parent:null},p=c._parseSync({data:r.data,path:r.path,parent:d});if(p.status==="valid")return p;p.status==="dirty"&&!a&&(a={result:p,ctx:d}),d.common.issues.length&&s.push(d.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let u=s.map(c=>new pn(c));return pe(r,{code:re.invalid_union,unionErrors:u}),Ee}}get options(){return this._def.options}};Ps.create=(e,t)=>new Ps({options:e,typeName:ke.ZodUnion,...Ze(t)});var xi=e=>e instanceof Es?xi(e.schema):e instanceof mn?xi(e.innerType()):e instanceof Os?[e.value]:e instanceof Hs?e.options:e instanceof Vs?ut.objectValues(e.enum):e instanceof Fs?xi(e._def.innerType):e instanceof Ms?[void 0]:e instanceof Ts?[null]:e instanceof Fn?[void 0,...xi(e.unwrap())]:e instanceof Da?[null,...xi(e.unwrap())]:e instanceof Wd||e instanceof Ns?xi(e.unwrap()):e instanceof Ds?xi(e._def.innerType):[],R9=class e extends Ge{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==he.object)return pe(r,{code:re.invalid_type,expected:he.object,received:r.parsedType}),Ee;let o=this.discriminator,n=r.data[o],a=this.optionsMap.get(n);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(pe(r,{code:re.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[o]}),Ee)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,o){let n=new Map;for(let a of r){let s=xi(a.shape[t]);if(!s.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let u of s){if(n.has(u))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(u)}`);n.set(u,a)}}return new e({typeName:ke.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:n,...Ze(o)})}};function l6(e,t){let r=v1(e),o=v1(t);if(e===t)return{valid:!0,data:e};if(r===he.object&&o===he.object){let n=ut.objectKeys(t),a=ut.objectKeys(e).filter(u=>n.indexOf(u)!==-1),s={...e,...t};for(let u of a){let c=l6(e[u],t[u]);if(!c.valid)return{valid:!1};s[u]=c.data}return{valid:!0,data:s}}else if(r===he.array&&o===he.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let a=0;a{if(i6(a)||i6(s))return Ee;let u=l6(a.value,s.value);return u.valid?((s6(a)||s6(s))&&r.dirty(),{status:r.value,value:u.data}):(pe(o,{code:re.invalid_intersection_types}),Ee)};return o.common.async?Promise.all([this._def.left._parseAsync({data:o.data,path:o.path,parent:o}),this._def.right._parseAsync({data:o.data,path:o.path,parent:o})]).then(([a,s])=>n(a,s)):n(this._def.left._parseSync({data:o.data,path:o.path,parent:o}),this._def.right._parseSync({data:o.data,path:o.path,parent:o}))}};ks.create=(e,t,r)=>new ks({left:e,right:t,typeName:ke.ZodIntersection,...Ze(r)});var Fa=class e extends Ge{_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.parsedType!==he.array)return pe(o,{code:re.invalid_type,expected:he.array,received:o.parsedType}),Ee;if(o.data.lengththis._def.items.length&&(pe(o,{code:re.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...o.data].map((s,u)=>{let c=this._def.items[u]||this._def.rest;return c?c._parse(new Dn(o,s,o.path,u)):null}).filter(s=>!!s);return o.common.async?Promise.all(a).then(s=>ao.mergeArray(r,s)):ao.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Fa.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fa({items:e,typeName:ke.ZodTuple,rest:null,...Ze(t)})};var _9=class e extends Ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.parsedType!==he.object)return pe(o,{code:re.invalid_type,expected:he.object,received:o.parsedType}),Ee;let n=[],a=this._def.keyType,s=this._def.valueType;for(let u in o.data)n.push({key:a._parse(new Dn(o,u,o.path,u)),value:s._parse(new Dn(o,o.data[u],o.path,u)),alwaysSet:u in o.data});return o.common.async?ao.mergeObjectAsync(r,n):ao.mergeObjectSync(r,n)}get element(){return this._def.valueType}static create(t,r,o){return r instanceof Ge?new e({keyType:t,valueType:r,typeName:ke.ZodRecord,...Ze(o)}):new e({keyType:C1.create(),valueType:t,typeName:ke.ZodRecord,...Ze(r)})}},xu=class extends Ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.parsedType!==he.map)return pe(o,{code:re.invalid_type,expected:he.map,received:o.parsedType}),Ee;let n=this._def.keyType,a=this._def.valueType,s=[...o.data.entries()].map(([u,c],d)=>({key:n._parse(new Dn(o,u,o.path,[d,"key"])),value:a._parse(new Dn(o,c,o.path,[d,"value"]))}));if(o.common.async){let u=new Map;return Promise.resolve().then(async()=>{for(let c of s){let d=await c.key,p=await c.value;if(d.status==="aborted"||p.status==="aborted")return Ee;(d.status==="dirty"||p.status==="dirty")&&r.dirty(),u.set(d.value,p.value)}return{status:r.value,value:u}})}else{let u=new Map;for(let c of s){let d=c.key,p=c.value;if(d.status==="aborted"||p.status==="aborted")return Ee;(d.status==="dirty"||p.status==="dirty")&&r.dirty(),u.set(d.value,p.value)}return{status:r.value,value:u}}}};xu.create=(e,t,r)=>new xu({valueType:t,keyType:e,typeName:ke.ZodMap,...Ze(r)});var yu=class e extends Ge{_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.parsedType!==he.set)return pe(o,{code:re.invalid_type,expected:he.set,received:o.parsedType}),Ee;let n=this._def;n.minSize!==null&&o.data.sizen.maxSize.value&&(pe(o,{code:re.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),r.dirty());let a=this._def.valueType;function s(c){let d=new Set;for(let p of c){if(p.status==="aborted")return Ee;p.status==="dirty"&&r.dirty(),d.add(p.value)}return{status:r.value,value:d}}let u=[...o.data.values()].map((c,d)=>a._parse(new Dn(o,c,o.path,d)));return o.common.async?Promise.all(u).then(c=>s(c)):s(u)}min(t,r){return new e({...this._def,minSize:{value:t,message:Ie.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:Ie.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};yu.create=(e,t)=>new yu({valueType:e,minSize:null,maxSize:null,typeName:ke.ZodSet,...Ze(t)});var A9=class e extends Ge{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==he.function)return pe(r,{code:re.invalid_type,expected:he.function,received:r.parsedType}),Ee;function o(u,c){return I9({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,L9(),vu].filter(d=>!!d),issueData:{code:re.invalid_arguments,argumentsError:c}})}function n(u,c){return I9({data:u,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,L9(),vu].filter(d=>!!d),issueData:{code:re.invalid_return_type,returnTypeError:c}})}let a={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof x1){let u=this;return xo(async function(...c){let d=new pn([]),p=await u._def.args.parseAsync(c,a).catch(x=>{throw d.addIssue(o(c,x)),d}),m=await Reflect.apply(s,this,p);return await u._def.returns._def.type.parseAsync(m,a).catch(x=>{throw d.addIssue(n(m,x)),d})})}else{let u=this;return xo(function(...c){let d=u._def.args.safeParse(c,a);if(!d.success)throw new pn([o(c,d.error)]);let p=Reflect.apply(s,this,d.data),m=u._def.returns.safeParse(p,a);if(!m.success)throw new pn([n(p,m.error)]);return m.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Fa.create(t).rest(yi.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,o){return new e({args:t||Fa.create([]).rest(yi.create()),returns:r||yi.create(),typeName:ke.ZodFunction,...Ze(o)})}},Es=class extends Ge{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};Es.create=(e,t)=>new Es({getter:e,typeName:ke.ZodLazy,...Ze(t)});var Os=class extends Ge{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return pe(r,{received:r.data,code:re.invalid_literal,expected:this._def.value}),Ee}return{status:"valid",value:t.data}}get value(){return this._def.value}};Os.create=(e,t)=>new Os({value:e,typeName:ke.ZodLiteral,...Ze(t)});function hL(e,t){return new Hs({values:e,typeName:ke.ZodEnum,...Ze(t)})}var Hs=class e extends Ge{constructor(){super(...arguments),Nd.set(this,void 0)}_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),o=this._def.values;return pe(r,{expected:ut.joinValues(o),received:r.parsedType,code:re.invalid_type}),Ee}if(S9(this,Nd,"f")||dL(this,Nd,new Set(this._def.values),"f"),!S9(this,Nd,"f").has(t.data)){let r=this._getOrReturnCtx(t),o=this._def.values;return pe(r,{received:r.data,code:re.invalid_enum_value,options:o}),Ee}return xo(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(o=>!t.includes(o)),{...this._def,...r})}};Nd=new WeakMap;Hs.create=hL;var Vs=class extends Ge{constructor(){super(...arguments),Bd.set(this,void 0)}_parse(t){let r=ut.getValidEnumValues(this._def.values),o=this._getOrReturnCtx(t);if(o.parsedType!==he.string&&o.parsedType!==he.number){let n=ut.objectValues(r);return pe(o,{expected:ut.joinValues(n),received:o.parsedType,code:re.invalid_type}),Ee}if(S9(this,Bd,"f")||dL(this,Bd,new Set(ut.getValidEnumValues(this._def.values)),"f"),!S9(this,Bd,"f").has(t.data)){let n=ut.objectValues(r);return pe(o,{received:o.data,code:re.invalid_enum_value,options:n}),Ee}return xo(t.data)}get enum(){return this._def.values}};Bd=new WeakMap;Vs.create=(e,t)=>new Vs({values:e,typeName:ke.ZodNativeEnum,...Ze(t)});var x1=class extends Ge{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==he.promise&&r.common.async===!1)return pe(r,{code:re.invalid_type,expected:he.promise,received:r.parsedType}),Ee;let o=r.parsedType===he.promise?r.data:Promise.resolve(r.data);return xo(o.then(n=>this._def.type.parseAsync(n,{path:r.path,errorMap:r.common.contextualErrorMap})))}};x1.create=(e,t)=>new x1({type:e,typeName:ke.ZodPromise,...Ze(t)});var mn=class extends Ge{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:o}=this._processInputParams(t),n=this._def.effect||null,a={addIssue:s=>{pe(o,s),s.fatal?r.abort():r.dirty()},get path(){return o.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="preprocess"){let s=n.transform(o.data,a);if(o.common.async)return Promise.resolve(s).then(async u=>{if(r.value==="aborted")return Ee;let c=await this._def.schema._parseAsync({data:u,path:o.path,parent:o});return c.status==="aborted"?Ee:c.status==="dirty"||r.value==="dirty"?gu(c.value):c});{if(r.value==="aborted")return Ee;let u=this._def.schema._parseSync({data:s,path:o.path,parent:o});return u.status==="aborted"?Ee:u.status==="dirty"||r.value==="dirty"?gu(u.value):u}}if(n.type==="refinement"){let s=u=>{let c=n.refinement(u,a);if(o.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return u};if(o.common.async===!1){let u=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});return u.status==="aborted"?Ee:(u.status==="dirty"&&r.dirty(),s(u.value),{status:r.value,value:u.value})}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(u=>u.status==="aborted"?Ee:(u.status==="dirty"&&r.dirty(),s(u.value).then(()=>({status:r.value,value:u.value}))))}if(n.type==="transform")if(o.common.async===!1){let s=this._def.schema._parseSync({data:o.data,path:o.path,parent:o});if(!Zd(s))return s;let u=n.transform(s.value,a);if(u instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:u}}else return this._def.schema._parseAsync({data:o.data,path:o.path,parent:o}).then(s=>Zd(s)?Promise.resolve(n.transform(s.value,a)).then(u=>({status:r.value,value:u})):s);ut.assertNever(n)}};mn.create=(e,t,r)=>new mn({schema:e,typeName:ke.ZodEffects,effect:t,...Ze(r)});mn.createWithPreprocess=(e,t,r)=>new mn({schema:t,effect:{type:"preprocess",transform:e},typeName:ke.ZodEffects,...Ze(r)});var Fn=class extends Ge{_parse(t){return this._getType(t)===he.undefined?xo(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Fn.create=(e,t)=>new Fn({innerType:e,typeName:ke.ZodOptional,...Ze(t)});var Da=class extends Ge{_parse(t){return this._getType(t)===he.null?xo(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Da.create=(e,t)=>new Da({innerType:e,typeName:ke.ZodNullable,...Ze(t)});var Fs=class extends Ge{_parse(t){let{ctx:r}=this._processInputParams(t),o=r.data;return r.parsedType===he.undefined&&(o=this._def.defaultValue()),this._def.innerType._parse({data:o,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Fs.create=(e,t)=>new Fs({innerType:e,typeName:ke.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ze(t)});var Ds=class extends Ge{_parse(t){let{ctx:r}=this._processInputParams(t),o={...r,common:{...r.common,issues:[]}},n=this._def.innerType._parse({data:o.data,path:o.path,parent:{...o}});return Gd(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new pn(o.common.issues)},input:o.data})})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new pn(o.common.issues)},input:o.data})}}removeCatch(){return this._def.innerType}};Ds.create=(e,t)=>new Ds({innerType:e,typeName:ke.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ze(t)});var bu=class extends Ge{_parse(t){if(this._getType(t)!==he.nan){let o=this._getOrReturnCtx(t);return pe(o,{code:re.invalid_type,expected:he.nan,received:o.parsedType}),Ee}return{status:"valid",value:t.data}}};bu.create=e=>new bu({typeName:ke.ZodNaN,...Ze(e)});var xz=Symbol("zod_brand"),Wd=class extends Ge{_parse(t){let{ctx:r}=this._processInputParams(t),o=r.data;return this._def.type._parse({data:o,path:r.path,parent:r})}unwrap(){return this._def.type}},zd=class e extends Ge{_parse(t){let{status:r,ctx:o}=this._processInputParams(t);if(o.common.async)return(async()=>{let a=await this._def.in._parseAsync({data:o.data,path:o.path,parent:o});return a.status==="aborted"?Ee:a.status==="dirty"?(r.dirty(),gu(a.value)):this._def.out._parseAsync({data:a.value,path:o.path,parent:o})})();{let n=this._def.in._parseSync({data:o.data,path:o.path,parent:o});return n.status==="aborted"?Ee:n.status==="dirty"?(r.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:o.path,parent:o})}}static create(t,r){return new e({in:t,out:r,typeName:ke.ZodPipeline})}},Ns=class extends Ge{_parse(t){let r=this._def.innerType._parse(t),o=n=>(Zd(n)&&(n.value=Object.freeze(n.value)),n);return Gd(r)?r.then(n=>o(n)):o(r)}unwrap(){return this._def.innerType}};Ns.create=(e,t)=>new Ns({innerType:e,typeName:ke.ZodReadonly,...Ze(t)});function gL(e,t={},r){return e?w1.create().superRefine((o,n)=>{var a,s;if(!e(o)){let u=typeof t=="function"?t(o):typeof t=="string"?{message:t}:t,c=(s=(a=u.fatal)!==null&&a!==void 0?a:r)!==null&&s!==void 0?s:!0,d=typeof u=="string"?{message:u}:u;n.addIssue({code:"custom",...d,fatal:c})}}):w1.create()}var yz={object:Zo.lazycreate},ke;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(ke||(ke={}));var bz=(e,t={message:`Input not instance of ${e.name}`})=>gL(r=>r instanceof e,t),vL=C1.create,CL=Ss.create,Lz=bu.create,Iz=Rs.create,wL=_s.create,Sz=As.create,Rz=Cu.create,_z=Ms.create,Az=Ts.create,Mz=w1.create,Tz=yi.create,Pz=da.create,kz=wu.create,Ez=bi.create,Oz=Zo.create,Hz=Zo.strictCreate,Vz=Ps.create,Fz=R9.create,Dz=ks.create,Nz=Fa.create,Bz=_9.create,Zz=xu.create,Gz=yu.create,Wz=A9.create,zz=Es.create,jz=Os.create,Uz=Hs.create,$z=Vs.create,Xz=x1.create,uL=mn.create,qz=Fn.create,Yz=Da.create,Jz=mn.createWithPreprocess,Qz=zd.create,Kz=()=>vL().optional(),ej=()=>CL().optional(),tj=()=>wL().optional(),rj={string:e=>C1.create({...e,coerce:!0}),number:e=>Ss.create({...e,coerce:!0}),boolean:e=>_s.create({...e,coerce:!0}),bigint:e=>Rs.create({...e,coerce:!0}),date:e=>As.create({...e,coerce:!0})},oj=Ee,P=Object.freeze({__proto__:null,defaultErrorMap:vu,setErrorMap:oz,getErrorMap:L9,makeIssue:I9,EMPTY_PATH:nz,addIssueToContext:pe,ParseStatus:ao,INVALID:Ee,DIRTY:gu,OK:xo,isAborted:i6,isDirty:s6,isValid:Zd,isAsync:Gd,get util(){return ut},get objectUtil(){return a6},ZodParsedType:he,getParsedType:v1,ZodType:Ge,datetimeRegex:mL,ZodString:C1,ZodNumber:Ss,ZodBigInt:Rs,ZodBoolean:_s,ZodDate:As,ZodSymbol:Cu,ZodUndefined:Ms,ZodNull:Ts,ZodAny:w1,ZodUnknown:yi,ZodNever:da,ZodVoid:wu,ZodArray:bi,ZodObject:Zo,ZodUnion:Ps,ZodDiscriminatedUnion:R9,ZodIntersection:ks,ZodTuple:Fa,ZodRecord:_9,ZodMap:xu,ZodSet:yu,ZodFunction:A9,ZodLazy:Es,ZodLiteral:Os,ZodEnum:Hs,ZodNativeEnum:Vs,ZodPromise:x1,ZodEffects:mn,ZodTransformer:mn,ZodOptional:Fn,ZodNullable:Da,ZodDefault:Fs,ZodCatch:Ds,ZodNaN:bu,BRAND:xz,ZodBranded:Wd,ZodPipeline:zd,ZodReadonly:Ns,custom:gL,Schema:Ge,ZodSchema:Ge,late:yz,get ZodFirstPartyTypeKind(){return ke},coerce:rj,any:Mz,array:Ez,bigint:Iz,boolean:wL,date:Sz,discriminatedUnion:Fz,effect:uL,enum:Uz,function:Wz,instanceof:bz,intersection:Dz,lazy:zz,literal:jz,map:Zz,nan:Lz,nativeEnum:$z,never:Pz,null:Az,nullable:Yz,number:CL,object:Oz,oboolean:tj,onumber:ej,optional:qz,ostring:Kz,pipeline:Qz,preprocess:Jz,promise:Xz,record:Bz,set:Gz,strictObject:Hz,string:vL,symbol:Rz,transformer:uL,tuple:Nz,undefined:_z,union:Vz,unknown:Tz,void:kz,NEVER:oj,ZodIssueCode:re,quotelessJson:rz,ZodError:pn});function nj(e,t){let r={...e};for(let o of t)delete r[o];return r}var aj=/:([a-zA-Z_][a-zA-Z0-9_]*)/g;function ij(e){let t=e.url,r=e.params;return r&&(t=t.replace(aj,(o,n)=>n in r?`${r[n]}`:o)),t}function xL(e,t,r){return e.find(o=>o.method===t&&o.path===r)}function sj(e){let t=new FormData;for(let r in e)t.append(r,e[r]);return{data:t}}var M9=class extends Error{constructor(e,t,r,o){super(e),this.config=t,this.data=r,this.cause=o}},lj={name:"form-data",request:async(e,t)=>{if(typeof t.data!="object"||Array.isArray(t.data))throw new M9("Zodios: multipart/form-data body must be an object",t);let r=sj(t.data);return{...t,data:r.data,headers:{...t.headers,...r.headers}}}};function uj(){return lj}var cj={name:"form-url",request:async(e,t)=>{if(typeof t.data!="object"||Array.isArray(t.data))throw new M9("Zodios: application/x-www-form-urlencoded body must be an object",t);return{...t,data:new URLSearchParams(t.data).toString(),headers:{...t.headers,"Content-Type":"application/x-www-form-urlencoded"}}}};function dj(){return cj}function yL(e,t){return{request:async(r,o)=>({...o,headers:{...o.headers,[e]:t}})}}function bL(e){return[!0,"response","all"].includes(e)}function LL(e){return[!0,"request","all"].includes(e)}function fj({validate:e,transform:t,sendDefaults:r}){return{name:"zod-validation",request:LL(e)?async(o,n)=>{let a=xL(o,n.method,n.url);if(!a)throw new Error(`No endpoint found for ${n.method} ${n.url}`);let{parameters:s}=a;if(!s)return n;let u={...n,queries:{...n.queries},headers:{...n.headers},params:{...n.params}},c={Query:m=>{var v;return(v=u.queries)==null?void 0:v[m]},Body:m=>u.data,Header:m=>{var v;return(v=u.headers)==null?void 0:v[m]},Path:m=>{var v;return(v=u.params)==null?void 0:v[m]}},d={Query:(m,v)=>u.queries[m]=v,Body:(m,v)=>u.data=v,Header:(m,v)=>u.headers[m]=v,Path:(m,v)=>u.params[m]=v},p=LL(t);for(let m of s){let{name:v,schema:x,type:y}=m,g=c[y](v);if(r||g!==void 0){let b=await x.safeParseAsync(g);if(!b.success)throw new M9(`Zodios: Invalid ${y} parameter '${v}'`,n,g,b.error);p&&d[y](v,b.data)}}return u}:void 0,response:bL(e)?async(o,n,a)=>{var s,u,c,d;let p=xL(o,n.method,n.url);if(!p)throw new Error(`No endpoint found for ${n.method} ${n.url}`);if((u=(s=a.headers)==null?void 0:s["content-type"])!=null&&u.includes("application/json")||(d=(c=a.headers)==null?void 0:c["content-type"])!=null&&d.includes("application/vnd.api+json")){let m=await p.response.safeParseAsync(a.data);if(!m.success)throw new M9(`Zodios: Invalid response from endpoint '${p.method} ${p.path}' +status: ${a.status} ${a.statusText} +cause: +${m.error.message} +received: +${JSON.stringify(a.data,null,2)}`,n,a.data,m.error);bL(t)&&(a.data=m.data)}return a}:void 0}}var IL=class{constructor(e,t){this.plugins=[],this.key=`${e}-${t}`}indexOf(e){return this.plugins.findIndex(t=>t?.name===e)}use(e){if(e.name){let t=this.indexOf(e.name);if(t!==-1)return this.plugins[t]=e,{key:this.key,value:t}}return this.plugins.push(e),{key:this.key,value:this.plugins.length-1}}eject(e){if(typeof e=="string"){let t=this.indexOf(e);if(t===-1)throw new Error(`Plugin with name '${e}' not found`);this.plugins[t]=void 0}else{if(e.key!==this.key)throw new Error(`Plugin with key '${e.key}' is not registered for endpoint '${this.key}'`);this.plugins[e.value]=void 0}}async interceptRequest(e,t){let r=t;for(let o of this.plugins)o!=null&&o.request&&(r=await o.request(e,r));return r}async interceptResponse(e,t,r){let o=r;for(let n=this.plugins.length-1;n>=0;n--){let a=this.plugins[n];a&&(o=o.then(a!=null&&a.response?s=>a.response(e,t,s):void 0,a!=null&&a.error?s=>a.error(e,t,s):void 0))}return o}count(){return this.plugins.reduce((e,t)=>t?e+1:e,0)}};function SL(e){let t=new Set;for(let o of e){let n=`${o.method} ${o.path}`;if(t.has(n))throw new Error(`Zodios: Duplicate path '${n}'`);t.add(n)}let r=new Set;for(let o of e)if(o.alias){if(r.has(o.alias))throw new Error(`Zodios: Duplicate alias '${o.alias}'`);r.add(o.alias)}for(let o of e)if(o.parameters&&o.parameters.filter(n=>n.type==="Body").length>1)throw new Error(`Zodios: Multiple body parameters in endpoint '${o.path}'`)}function RL(e){return SL(e),e}var pj=class{constructor(e,t,r){this.endpointPlugins=new Map;let o;if(!e)throw Array.isArray(t)?new Error("Zodios: missing base url"):new Error("Zodios: missing api description");let n;if(typeof e=="string"&&Array.isArray(t))n=e,this.api=t,o=r||{};else if(Array.isArray(e)&&!Array.isArray(t))this.api=e,o=t||{};else throw new Error("Zodios: api must be an array");SL(this.api),this.options={validate:!0,transform:!0,sendDefaults:!1,...o},this.options.axiosInstance?this.axiosInstance=this.options.axiosInstance:this.axiosInstance=b9.create({...this.options.axiosConfig}),n&&(this.axiosInstance.defaults.baseURL=n),this.injectAliasEndpoints(),this.initPlugins(),[!0,"all","request","response"].includes(this.options.validate)&&this.use(fj(this.options))}initPlugins(){this.endpointPlugins.set("any-any",new IL("any","any")),this.api.forEach(e=>{let t=new IL(e.method,e.path);switch(e.requestFormat){case"binary":t.use(yL("Content-Type","application/octet-stream"));break;case"form-data":t.use(uj());break;case"form-url":t.use(dj());break;case"text":t.use(yL("Content-Type","text/plain"));break}this.endpointPlugins.set(`${e.method}-${e.path}`,t)})}getAnyEndpointPlugins(){return this.endpointPlugins.get("any-any")}findAliasEndpointPlugins(e){let t=this.api.find(r=>r.alias===e);if(t)return this.endpointPlugins.get(`${t.method}-${t.path}`)}findEnpointPlugins(e,t){return this.endpointPlugins.get(`${e}-${t}`)}get baseURL(){return this.axiosInstance.defaults.baseURL}get axios(){return this.axiosInstance}use(...e){if(typeof e[0]=="object")return this.getAnyEndpointPlugins().use(e[0]);if(typeof e[0]=="string"&&typeof e[1]=="object"){let t=this.findAliasEndpointPlugins(e[0]);if(!t)throw new Error(`Zodios: no alias '${e[0]}' found to register plugin`);return t.use(e[1])}else if(typeof e[0]=="string"&&typeof e[1]=="string"&&typeof e[2]=="object"){let t=this.findEnpointPlugins(e[0],e[1]);if(!t)throw new Error(`Zodios: no endpoint '${e[0]} ${e[1]}' found to register plugin`);return t.use(e[2])}throw new Error("Zodios: invalid plugin registration")}eject(e){var t;if(typeof e=="string"){this.getAnyEndpointPlugins().eject(e);return}(t=this.endpointPlugins.get(e.key))==null||t.eject(e)}injectAliasEndpoints(){this.api.forEach(e=>{e.alias&&(["post","put","patch","delete"].includes(e.method)?this[e.alias]=(t,r)=>this.request({...r,method:e.method,url:e.path,data:t}):this[e.alias]=t=>this.request({...t,method:e.method,url:e.path}))})}async request(e){let t=e,r=this.getAnyEndpointPlugins(),o=this.findEnpointPlugins(t.method,t.url);t=await r.interceptRequest(this.api,t),o&&(t=await o.interceptRequest(this.api,t));let n=this.axiosInstance.request({...nj(t,["params","queries"]),url:ij(t),params:t.queries});return o&&(n=o.interceptResponse(this.api,t,n)),n=r.interceptResponse(this.api,t,n),(await n).data}async get(e,...[t]){return this.request({...t,method:"get",url:e})}async post(e,t,...[r]){return this.request({...r,method:"post",url:e,data:t})}async put(e,t,...[r]){return this.request({...r,method:"put",url:e,data:t})}async patch(e,t,...[r]){return this.request({...r,method:"patch",url:e,data:t})}async delete(e,t,...[r]){return this.request({...r,method:"delete",url:e,data:t})}},u6=pj;var Xd=P.enum(["rgbw","cct","rgb_cct","rgb","fut089","fut091","fut020"]),c6=P.object({alias:P.string(),id:P.number().int().optional(),device_id:P.number().int(),group_id:P.number().int(),device_type:Xd}).passthrough(),_L=P.object({alias:P.string(),device_id:P.number().int(),group_id:P.number().int()}).partial().passthrough(),Mr=P.object({success:P.boolean(),error:P.string().describe("If an error occurred, message specifying what went wrong").optional()}).passthrough(),k9=P.enum(["ON","OFF"]),h6=P.enum(["brightness","rgb","color_temp","onoff"]),Ud=P.object({alias:P.string(),state:k9.describe("On/Off state"),color:P.object({r:P.number().int(),g:P.number().int(),b:P.number().int()}).passthrough(),level:P.number().int().gte(0).lte(100),kelvin:P.number().int().gte(0).lte(100),color_mode:h6.describe(`Describes the current color mode of the bulb. Useful for HomeAssistant. +`)}).partial().passthrough(),AL=P.object({state:Ud.describe("Group state with a static set of fields"),device:P.object({id:P.number(),device_id:P.number(),device_type:Xd,group_id:P.number(),alias:P.string()}).passthrough()}).passthrough(),O9=P.object({device_id:P.number().int().gte(0).lte(65536),group_id:P.number().int().gte(0).lte(8),device_type:Xd}).passthrough(),d6=P.enum(["unpair","pair","set_white","night_mode","level_up","level_down","temperature_up","temperature_down","next_mode","previous_mode","mode_speed_down","mode_speed_up","toggle"]),ML=P.enum(["hue","saturation","brightness","level","kelvin","color_temp","color","status"]),$d=P.union([P.number(),P.string()]),g6=P.object({field:ML.describe(`If transitioning 'status': * If transitioning to 'OFF', will fade to 0 brightness and then turn off. * If transitioning to 'ON', will turn on, set brightness to 0, and fade to brightness 100. +`),start_value:$d.describe("Either an int value or a color"),end_value:$d.describe("Either an int value or a color"),duration:P.number().describe("Duration of transition, measured in seconds"),period:P.number().int().describe("Length of time between updates in a transition, measured in milliseconds")}).partial().passthrough(),v6=P.object({command:P.union([d6,P.object({command:P.literal("transition"),args:g6}).partial().passthrough()]),commands:P.array(d6)}).partial().passthrough(),Bs=P.object({state:k9.describe("On/Off state"),status:k9.describe("On/Off state"),hue:P.number().int().gte(0).lte(359).describe("Color hue. Will change bulb to color mode."),saturation:P.number().int().gte(0).lte(100).describe("Color saturation. Will normally change bulb to color mode."),kelvin:P.number().int().gte(0).lte(100).describe("White temperature. 0 is coolest, 100 is warmest."),temperature:P.number().int().gte(0).lte(100).describe("Alias for `kelvin`."),color_temp:P.number().int().gte(153).lte(370).describe("White temperature measured in mireds. Lower values are cooler."),mode:P.number().int().describe("Party mode ID. Actual effect depends on the bulb."),color:P.union([P.string(),P.object({r:P.number().int(),g:P.number().int(),b:P.number().int()}).partial().passthrough()]),level:P.number().int().gte(0).lte(100).describe("Brightness on a 0-100 scale."),brightness:P.number().int().gte(0).lte(255).describe("Brightness on a 0-255 scale."),effect:P.enum(["night_mode","white_mode"]),transition:P.number().describe(`Enables a transition from current state to the provided state. +`),color_mode:h6.describe(`Describes the current color mode of the bulb. Useful for HomeAssistant. +`)}).partial().passthrough(),TL=P.object({gateways:P.array(O9),update:P.union([v6,Bs])}).partial().passthrough(),PL=P.object({firmware:P.string().describe("Always set to 'milight-hub'"),version:P.string().describe("Semver version string"),ip_address:P.string(),reset_reason:P.string().describe("Reason the system was last rebooted"),variant:P.string().describe("Firmware variant (e.g., d1_mini, nodemcuv2)"),free_heap:P.number().int().describe("Amount of free heap remaining (measured in bytes)"),arduino_version:P.string().describe("Version of Arduino SDK firmware was built with"),queue_stats:P.object({length:P.number().int().describe("Number of enqueued packets to be sent"),dropped_packets:P.number().int().describe("Number of packets that have been dropped since last reboot")}).partial().passthrough(),mqtt:P.object({configured:P.boolean(),connected:P.boolean(),status:P.string()}).partial().passthrough()}).partial().passthrough(),f6=P.object({success:P.boolean(),message:P.string()}).passthrough(),kL=P.object({command:P.enum(["restart","clear_wifi_config"])}).passthrough(),jd=P.enum(["Off","Slow toggle","Fast toggle","Slow blip","Fast blip","Flicker","On"]),p6=P.enum(["LOW","MID","HIGH"]),EL=P.enum(["state","status","brightness","level","hue","saturation","color","mode","kelvin","color_temp","bulb_mode","computed_color","effect","device_id","group_id","device_type","oh_color","hex_color","color_mode"]),T9=P.object({admin_username:P.string().describe("If specified along with a password, HTTP basic auth will be enabled to access the web interface and the REST API.").default(""),admin_password:P.string().describe("If specified along with a username, HTTP basic auth will be enabled to access the web interface and the REST API.").default(""),ce_pin:P.number().int().describe("CE pin to use for SPI radio (nRF24, LT8900)").default(4),csn_pin:P.number().int().describe("CSN pin to use with nRF24").default(15),reset_pin:P.number().int().describe("Reset pin to use with LT8900").default(0),led_pin:P.number().int().describe("Pin to control for status LED. Set to a negative value to invert on/off status.").default(-2),packet_repeats:P.number().int().describe("Number of times to resend the same 2.4 GHz milight packet when a command is sent.").default(50),http_repeat_factor:P.number().int().describe("Packet repeats resulting from REST commands will be multiplied by this number.").default(1),auto_restart_period:P.number().int().describe("Automatically restart the device after the number of specified minutes. Use 0 to disable.").default(0),mqtt_server:P.union([P.string(),P.string()]).describe("MQTT server to connect to. Can contain port number in the form 'mqtt-hostname:1883'. Leave empty to disable MQTT.").nullable(),mqtt_username:P.string().describe("If specified, use this username to authenticate with the MQTT server."),mqtt_password:P.string().describe("If specified, use this password to authenticate with the MQTT server."),mqtt_topic_pattern:P.string().describe("Topic pattern to listen on for commands. More detail on the format in README."),mqtt_update_topic_pattern:P.string().describe("Topic pattern individual intercepted commands will be sent to. More detail on the format in README."),mqtt_state_topic_pattern:P.string().describe("Topic pattern device state will be sent to. More detail on the format in README."),mqtt_client_status_topic:P.string().describe("Topic client status will be sent to."),mqtt_retain:P.boolean().describe("If true, messages sent to state and client status topics will be published with the retain flag.").default(!0),simple_mqtt_client_status:P.boolean().describe("If true, will use a simple enum flag (`connected` or `disconnected`) to indicate status. If false, will send a rich JSON message including IP address, version, etc.").default(!0),radio_interface_type:P.enum(["nRF24","LT8900"]).describe("Type of radio interface to use. NRF24 is better supported and more common. Only use LT8900 if you're sure you mean to!").default("nRF24"),discovery_port:P.number().int().describe("UDP port used for milight's discovery protocol. Set to 0 to disable.").default(48899),listen_repeats:P.number().int().describe("Controls how many cycles are spent listening for packets. Set to 0 to disable passive listening.").default(3),ignored_listen_protocols:P.array(P.enum(["RGBW","CCT","FUT089","RGB","FUT020"])).describe("Improve listen reliability by ignoring specific protocol types. Leave empty if you are unsure.").default([]),state_flush_interval:P.number().int().describe("Controls how many miliseconds must pass between states being flushed to persistent storage. Set to 0 to disable throttling.").default(1e4),mqtt_state_rate_limit:P.number().int().describe("Controls how many miliseconds must pass between MQTT state updates. Set to 0 to disable throttling.").default(500),mqtt_debounce_delay:P.number().int().describe("Controls how much time has to pass after the last status update was queued.").default(500),packet_repeat_throttle_threshold:P.number().int().describe("Controls how packet repeats are throttled. Packets sent with less time (measured in milliseconds) between them than this value (in milliseconds) will cause packet repeats to be throttled down. More than this value will unthrottle up.").default(200),packet_repeat_throttle_sensitivity:P.number().int().gte(0).lte(1e3).describe("Controls how packet repeats are throttled. Higher values cause packets to be throttled up and down faster. Set to 0 to disable throttling.").default(0),packet_repeat_minimum:P.number().int().describe("Controls how far throttling can decrease the number of repeated packets").default(3),enable_automatic_mode_switching:P.boolean().describe("When making updates to hue or white temperature in a different bulb mode, switch back to the original bulb mode after applying the setting change.").default(!1),led_mode_wifi_config:jd,led_mode_wifi_failed:jd,led_mode_operating:jd,led_mode_packet:jd,led_mode_packet_count:P.number().int().describe("Number of times the LED will flash when packets are changing").default(3),hostname:P.string().regex(/[a-zA-Z0-9-]+/).describe("Hostname that will be advertized on a DHCP request").default("milight-hub"),rf24_power_level:P.enum(["MIN","LOW","HIGH","MAX"]).describe("Power level used when packets are sent. See nRF24 documentation for further detail.").default("MAX"),rf24_listen_channel:p6,wifi_static_ip:P.string().describe("If specified, the static IP address to use"),wifi_static_ip_gateway:P.string().describe("If specified along with static IP, the gateway address to use"),wifi_static_ip_netmask:P.string().describe("If specified along with static IP, the netmask to use"),packet_repeats_per_loop:P.number().int().describe("Packets are sent asynchronously. This number controls the number of repeats sent during each iteration. Increase this number to improve packet throughput. Decrease to improve system multi-tasking.").default(10),home_assistant_discovery_prefix:P.string().describe("If specified along with MQTT settings, will enable HomeAssistant MQTT discovery using the specified discovery prefix. HomeAssistant's default is `homeassistant/`.").default("homeassistant/"),wifi_mode:P.enum(["b","g","n"]).describe("Forces WiFi into the spcified mode. Try using B or G mode if you are having stability issues. Changing this may cause the device to momentarily lose connection to the network.").default("n"),rf24_channels:P.array(p6).describe("Defines which channels we send on. Each remote type has three channels. We can send on any subset of these."),gateway_configs:P.array(P.array(P.number().int())).describe("List of UDP servers, stored as 3-long arrays. Elements are 1) remote ID to bind to, 2) UDP port to listen on, 3) protocol version (5 or 6)"),group_state_fields:P.array(EL),group_id_aliases:P.object({}).partial().passthrough().describe(`DEPRECATED (use /aliases routes instead) + +Keys are aliases, values are 3-long arrays with same schema as items in 'device_ids'. +`),default_transition_period:P.number().int().describe(`Default number of milliseconds between transition packets. Set this value lower for more granular transitions, or higher if +you are having performance issues during transitions. +`)}).partial().passthrough(),mj=P.object({packet_info:P.string()}).partial().passthrough(),P9=P.union([P.number(),P.string()]).describe("2-byte device ID. Can be decimal or hexadecimal."),m6=Bs.and(v6),OL=P.object({packet:P.string().regex(/([A-Fa-f0-9]{2}[ ])+/).describe("Raw packet to send"),num_repeats:P.number().int().gte(1).describe("Number of repeated packets to send")}).partial().passthrough(),E9=g6.and(P.object({id:P.number().int(),last_sent:P.number().int().describe("Timestamp since last update was sent."),bulb:O9,type:P.enum(["field","color"]).describe(`Specifies whether this is a simple field transition, or a color transition. +`),current_value:$d,end_value:$d}).partial().passthrough()),HL=E9.and(O9),VL=P.object({t:P.literal("packet").describe("Type of message").optional(),d:P.object({di:P.number().int().describe("Device ID"),gi:P.number().int().describe("Group ID"),rt:Xd.describe("Type of remote to read a packet from. If unspecified, will read packets from all remote types.")}).passthrough().describe("The bulb that the packet is for"),p:P.array(P.number().int()).describe("Raw packet data"),s:Ud.describe("Group state with a static set of fields"),u:P.object({}).partial().passthrough().describe("The command represented by the packet")}).passthrough(),hj=VL,gj=P.array(P.unknown()),rt={RemoteType:Xd,Alias:c6,putAliasesId_Body:_L,BooleanResponse:Mr,State:k9,ColorMode:h6,NormalizedGroupState:Ud,GatewayListItem:AL,BulbId:O9,GroupStateCommand:d6,TransitionField:ML,TransitionValue:$d,TransitionArgs:g6,GroupStateCommands:v6,GroupState:Bs,UpdateBatch:TL,About:PL,BooleanResponseWithMessage:f6,postSystem_Body:kL,LedMode:jd,RF24Channel:p6,GroupStateField:EL,Settings:T9,ReadPacket:mj,device_id:P9,putGatewaysDeviceIdRemoteTypeGroupId_Body:m6,postRaw_commandsRemoteType_Body:OL,TransitionData:E9,postTransitions_Body:HL,PacketMessage:VL,WebSocketMessage:hj,DeviceId:gj},FL=RL([{method:"get",path:"/about",alias:"getAbout",requestFormat:"json",response:PL},{method:"post",path:"/aliases",alias:"postAliases",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:c6}],response:P.object({id:P.number().int()}).partial().passthrough()},{method:"get",path:"/aliases",alias:"getAliases",requestFormat:"json",response:P.object({aliases:P.array(c6),page:P.number().int(),count:P.number().int(),num_pages:P.number().int()}).partial().passthrough()},{method:"get",path:"/aliases.bin",alias:"getAliases_bin",requestFormat:"json",response:P.void()},{method:"post",path:"/aliases.bin",alias:"postAliases_bin",requestFormat:"form-data",parameters:[{name:"body",type:"Body",schema:P.object({file:P.instanceof(File)}).partial().passthrough()}],response:Mr},{method:"put",path:"/aliases/:id",alias:"putAliasesId",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:_L},{name:"id",type:"Path",schema:P.number().int()}],response:Mr},{method:"delete",path:"/aliases/:id",alias:"deleteAliasesId",requestFormat:"json",parameters:[{name:"id",type:"Path",schema:P.number().int()}],response:Mr},{method:"post",path:"/backup",alias:"postBackup",requestFormat:"form-data",parameters:[{name:"body",type:"Body",schema:P.object({file:P.instanceof(File)}).partial().passthrough()}],response:f6,errors:[{status:400,description:"error",schema:f6}]},{method:"get",path:"/backup",alias:"getBackup",requestFormat:"json",response:P.void()},{method:"post",path:"/firmware",alias:"postFirmware",requestFormat:"form-data",parameters:[{name:"body",description:"Firmware file",type:"Body",schema:P.object({fileName:P.instanceof(File)}).partial().passthrough()}],response:P.void(),errors:[{status:500,description:"server error",schema:P.void()}]},{method:"get",path:"/gateway_traffic",alias:"getGateway_traffic",description:"Read a packet from any remote type. Does not return a response until a packet is read.",requestFormat:"json",response:P.object({packet_info:P.string()}).partial().passthrough()},{method:"get",path:"/gateway_traffic/:remoteType",alias:"getGateway_trafficRemoteType",description:"Read a packet from the given remote type. Does not return a response until a packet is read. If `remote-type` is unspecified, will read from all remote types simultaneously.",requestFormat:"json",parameters:[{name:"remoteType",type:"Path",schema:P.enum(["rgbw","cct","rgb_cct","rgb","fut089","fut091","fut020"]).describe("Type of remote to read a packet from. If unspecified, will read packets from all remote types.")}],response:P.object({packet_info:P.string()}).partial().passthrough()},{method:"get",path:"/gateways",alias:"getGateways",requestFormat:"json",response:P.array(AL)},{method:"put",path:"/gateways",alias:"putGateways",description:"Update a batch of gateways with the provided parameters.",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:P.array(TL)}],response:Mr},{method:"get",path:"/gateways/:deviceAlias",alias:"getGatewaysDeviceAlias",requestFormat:"json",parameters:[{name:"deviceAlias",type:"Path",schema:P.string().describe("Device alias saved in settings")}],response:Bs,errors:[{status:404,description:"provided device alias does not exist",schema:P.void()}]},{method:"put",path:"/gateways/:deviceAlias",alias:"putGatewaysDeviceAlias",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:m6},{name:"deviceAlias",type:"Path",schema:P.string().describe("Device alias saved in settings")},{name:"blockOnQueue",type:"Query",schema:P.boolean().describe("If true, response will block on update packets being sent before returning").optional()},{name:"fmt",type:"Query",schema:P.literal("normalized").describe("If set to `normalized`, the response will be in normalized format.").optional()}],response:P.union([Mr,Bs,Ud]),errors:[{status:400,description:"error with request",schema:Mr}]},{method:"delete",path:"/gateways/:deviceAlias",alias:"deleteGatewaysDeviceAlias",description:"Usets all known values for state fields for the corresponding device. If MQTT is configured, the retained state message corresponding to this device will also be deleted.",requestFormat:"json",parameters:[{name:"deviceAlias",type:"Path",schema:P.string().describe("Device alias saved in settings")}],response:Mr},{method:"get",path:"/gateways/:deviceId/:remoteType/:groupId",alias:"getGatewaysDeviceIdRemoteTypeGroupId",description:"If `blockOnQueue` is provided, a response will not be returned until any unprocessed packets in the command queue are finished sending.",requestFormat:"json",parameters:[{name:"deviceId",type:"Path",schema:P9},{name:"remoteType",type:"Path",schema:P.enum(["rgbw","cct","rgb_cct","rgb","fut089","fut091","fut020"]).describe("Type of remote to read a packet from. If unspecified, will read packets from all remote types.")},{name:"groupId",type:"Path",schema:P.number().int().gte(0).lte(8).describe("Group ID. Should be 0-8, depending on remote type. Group 0 is a 'wildcard' group. All bulbs paired with the same device ID will respond to commands sent to Group 0.")},{name:"blockOnQueue",type:"Query",schema:P.boolean().describe("If true, response will block on update packets being sent before returning").optional()}],response:Bs},{method:"put",path:"/gateways/:deviceId/:remoteType/:groupId",alias:"putGatewaysDeviceIdRemoteTypeGroupId",description:`Update state of the bulbs with the provided parameters. Existing parameters will be unchanged. +if `blockOnQueue` is set to true, the response will not return until packets corresponding to the commands sent are processed, and the updated `GroupState` will be returned. If `blockOnQueue` is false or not provided, a simple response indicating success will be returned. +if `fmt` is set to `normalized`, the response will be in normalized format.`,requestFormat:"json",parameters:[{name:"body",type:"Body",schema:m6},{name:"deviceId",type:"Path",schema:P9},{name:"remoteType",type:"Path",schema:P.enum(["rgbw","cct","rgb_cct","rgb","fut089","fut091","fut020"]).describe("Type of remote to read a packet from. If unspecified, will read packets from all remote types.")},{name:"groupId",type:"Path",schema:P.number().int().gte(0).lte(8).describe("Group ID. Should be 0-8, depending on remote type. Group 0 is a 'wildcard' group. All bulbs paired with the same device ID will respond to commands sent to Group 0.")},{name:"blockOnQueue",type:"Query",schema:P.boolean().describe("If true, response will block on update packets being sent before returning").optional()},{name:"fmt",type:"Query",schema:P.literal("normalized").describe("If set to `normalized`, the response will be in normalized format.").optional()}],response:P.union([Mr,Bs,Ud]),errors:[{status:400,description:"error with request",schema:Mr}]},{method:"delete",path:"/gateways/:deviceId/:remoteType/:groupId",alias:"deleteGatewaysDeviceIdRemoteTypeGroupId",description:"Usets all known values for state fields for the corresponding device. If MQTT is configured, the retained state message corresponding to this device will also be deleted.",requestFormat:"json",parameters:[{name:"deviceId",type:"Path",schema:P9},{name:"remoteType",type:"Path",schema:P.enum(["rgbw","cct","rgb_cct","rgb","fut089","fut091","fut020"]).describe("Type of remote to read a packet from. If unspecified, will read packets from all remote types.")},{name:"groupId",type:"Path",schema:P.number().int().gte(0).lte(8).describe("Group ID. Should be 0-8, depending on remote type. Group 0 is a 'wildcard' group. All bulbs paired with the same device ID will respond to commands sent to Group 0.")}],response:Mr},{method:"post",path:"/raw_commands/:remoteType",alias:"postRaw_commandsRemoteType",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:OL},{name:"remoteType",type:"Path",schema:P.enum(["rgbw","cct","rgb_cct","rgb","fut089","fut091","fut020"]).describe("Type of remote to read a packet from. If unspecified, will read packets from all remote types.")}],response:P.void()},{method:"get",path:"/remote_configs",alias:"getRemote_configs",requestFormat:"json",response:P.void()},{method:"get",path:"/settings",alias:"getSettings",requestFormat:"json",response:T9},{method:"put",path:"/settings",alias:"putSettings",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:T9}],response:Mr},{method:"post",path:"/settings",alias:"postSettings",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:T9}],response:Mr},{method:"post",path:"/system",alias:"postSystem",description:`Send commands to the system. Supported commands: +1. `restart`. Restart the ESP8266. +1. `clear_wifi_config`. Clears on-board wifi information. ESP8266 will reboot and enter wifi config mode. +`,requestFormat:"json",parameters:[{name:"body",type:"Body",schema:kL}],response:Mr,errors:[{status:400,description:"error",schema:Mr}]},{method:"get",path:"/transitions",alias:"getTransitions",requestFormat:"json",response:P.array(E9)},{method:"post",path:"/transitions",alias:"postTransitions",requestFormat:"json",parameters:[{name:"body",type:"Body",schema:HL}],response:Mr,errors:[{status:400,description:"error",schema:Mr}]},{method:"get",path:"/transitions/:id",alias:"getTransitionsId",requestFormat:"json",parameters:[{name:"id",type:"Path",schema:P.number().int().describe("ID of transition. This will be an auto-incrementing number reset after a restart.")}],response:E9,errors:[{status:404,description:"Provided transition ID not found",schema:P.void()}]},{method:"delete",path:"/transitions/:id",alias:"deleteTransitionsId",requestFormat:"json",parameters:[{name:"id",type:"Path",schema:P.number().int().describe("ID of transition. This will be an auto-incrementing number reset after a restart.")}],response:Mr,errors:[{status:404,description:"Provided transition ID not found",schema:Mr}]}]),hn=new u6(FL);function DL(e,t){return new u6(e,FL,t)}function NL(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t{let t=wj(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{let u=s.split(x6);return u[0]===""&&u.length!==1&&u.shift(),WL(u,t)||Cj(s)},getConflictingClassGroupIds:(s,u)=>{let c=r[s]||[];return u&&o[s]?[...c,...o[s]]:c}}},WL=(e,t)=>{if(e.length===0)return t.classGroupId;let r=e[0],o=t.nextPart.get(r),n=o?WL(e.slice(1),o):void 0;if(n)return n;if(t.validators.length===0)return;let a=e.join(x6);return t.validators.find(({validator:s})=>s(a))?.classGroupId},ZL=/^\[(.+)\]$/,Cj=e=>{if(ZL.test(e)){let t=ZL.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},wj=e=>{let{theme:t,prefix:r}=e,o={nextPart:new Map,validators:[]};return yj(Object.entries(e.classGroups),r).forEach(([a,s])=>{w6(s,o,a,t)}),o},w6=(e,t,r,o)=>{e.forEach(n=>{if(typeof n=="string"){let a=n===""?t:GL(t,n);a.classGroupId=r;return}if(typeof n=="function"){if(xj(n)){w6(n(o),t,r,o);return}t.validators.push({validator:n,classGroupId:r});return}Object.entries(n).forEach(([a,s])=>{w6(s,GL(t,a),r,o)})})},GL=(e,t)=>{let r=e;return t.split(x6).forEach(o=>{r.nextPart.has(o)||r.nextPart.set(o,{nextPart:new Map,validators:[]}),r=r.nextPart.get(o)}),r},xj=e=>e.isThemeGetter,yj=(e,t)=>t?e.map(([r,o])=>{let n=o.map(a=>typeof a=="string"?t+a:typeof a=="object"?Object.fromEntries(Object.entries(a).map(([s,u])=>[t+s,u])):a);return[r,n]}):e,bj=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,o=new Map,n=(a,s)=>{r.set(a,s),t++,t>e&&(t=0,o=r,r=new Map)};return{get(a){let s=r.get(a);if(s!==void 0)return s;if((s=o.get(a))!==void 0)return n(a,s),s},set(a,s){r.has(a)?r.set(a,s):n(a,s)}}},zL="!",Lj=e=>{let{separator:t,experimentalParseClassName:r}=e,o=t.length===1,n=t[0],a=t.length,s=u=>{let c=[],d=0,p=0,m;for(let b=0;bp?m-p:void 0;return{modifiers:c,hasImportantModifier:x,baseClassName:y,maybePostfixModifierPosition:g}};return r?u=>r({className:u,parseClassName:s}):s},Ij=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(o=>{o[0]==="["?(t.push(...r.sort(),o),r=[]):r.push(o)}),t.push(...r.sort()),t},Sj=e=>({cache:bj(e.cacheSize),parseClassName:Lj(e),...vj(e)}),Rj=/\s+/,_j=(e,t)=>{let{parseClassName:r,getClassGroupId:o,getConflictingClassGroupIds:n}=t,a=[],s=e.trim().split(Rj),u="";for(let c=s.length-1;c>=0;c-=1){let d=s[c],{modifiers:p,hasImportantModifier:m,baseClassName:v,maybePostfixModifierPosition:x}=r(d),y=!!x,g=o(y?v.substring(0,x):v);if(!g){if(!y){u=d+(u.length>0?" "+u:u);continue}if(g=o(v),!g){u=d+(u.length>0?" "+u:u);continue}y=!1}let b=Ij(p).join(":"),C=m?b+zL:b,w=C+g;if(a.includes(w))continue;a.push(w);let I=n(g,y);for(let _=0;_0?" "+u:u)}return u};function Aj(){let e=0,t,r,o="";for(;e{if(typeof e=="string")return e;let t,r="";for(let o=0;om(p),e());return r=Sj(d),o=r.cache.get,n=r.cache.set,a=u,u(c)}function u(c){let d=o(c);if(d)return d;let p=_j(c,r);return n(c,p),p}return function(){return a(Aj.apply(null,arguments))}}var Xt=e=>{let t=r=>r[e]||[];return t.isThemeGetter=!0,t},UL=/^\[(?:([a-z-]+):)?(.+)\]$/i,Tj=/^\d+\/\d+$/,Pj=new Set(["px","full","screen"]),kj=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ej=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Oj=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Hj=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Vj=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Li=e=>Lu(e)||Pj.has(e)||Tj.test(e),y1=e=>Iu(e,"length",zj),Lu=e=>!!e&&!Number.isNaN(Number(e)),C6=e=>Iu(e,"number",Lu),qd=e=>!!e&&Number.isInteger(Number(e)),Fj=e=>e.endsWith("%")&&Lu(e.slice(0,-1)),je=e=>UL.test(e),b1=e=>kj.test(e),Dj=new Set(["length","size","percentage"]),Nj=e=>Iu(e,Dj,$L),Bj=e=>Iu(e,"position",$L),Zj=new Set(["image","url"]),Gj=e=>Iu(e,Zj,Uj),Wj=e=>Iu(e,"",jj),Yd=()=>!0,Iu=(e,t,r)=>{let o=UL.exec(e);return o?o[1]?typeof t=="string"?o[1]===t:t.has(o[1]):r(o[2]):!1},zj=e=>Ej.test(e)&&!Oj.test(e),$L=()=>!1,jj=e=>Hj.test(e),Uj=e=>Vj.test(e);var $j=()=>{let e=Xt("colors"),t=Xt("spacing"),r=Xt("blur"),o=Xt("brightness"),n=Xt("borderColor"),a=Xt("borderRadius"),s=Xt("borderSpacing"),u=Xt("borderWidth"),c=Xt("contrast"),d=Xt("grayscale"),p=Xt("hueRotate"),m=Xt("invert"),v=Xt("gap"),x=Xt("gradientColorStops"),y=Xt("gradientColorStopPositions"),g=Xt("inset"),b=Xt("margin"),C=Xt("opacity"),w=Xt("padding"),I=Xt("saturate"),_=Xt("scale"),M=Xt("sepia"),E=Xt("skew"),A=Xt("space"),H=Xt("translate"),$=()=>["auto","contain","none"],U=()=>["auto","hidden","clip","visible","scroll"],ee=()=>["auto",je,t],W=()=>[je,t],ie=()=>["",Li,y1],Y=()=>["auto",Lu,je],ae=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],J=()=>["solid","dashed","dotted","double","none"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],se=()=>["start","end","center","between","around","evenly","stretch"],we=()=>["","0",je],Ke=()=>["auto","avoid","all","avoid-page","page","left","right","column"],It=()=>[Lu,je];return{cacheSize:500,separator:":",theme:{colors:[Yd],spacing:[Li,y1],blur:["none","",b1,je],brightness:It(),borderColor:[e],borderRadius:["none","","full",b1,je],borderSpacing:W(),borderWidth:ie(),contrast:It(),grayscale:we(),hueRotate:It(),invert:we(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[Fj,y1],inset:ee(),margin:ee(),opacity:It(),padding:W(),saturate:It(),scale:It(),sepia:we(),skew:It(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",je]}],container:["container"],columns:[{columns:[b1]}],"break-after":[{"break-after":Ke()}],"break-before":[{"break-before":Ke()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ae(),je]}],overflow:[{overflow:U()}],"overflow-x":[{"overflow-x":U()}],"overflow-y":[{"overflow-y":U()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[g]}],"inset-x":[{"inset-x":[g]}],"inset-y":[{"inset-y":[g]}],start:[{start:[g]}],end:[{end:[g]}],top:[{top:[g]}],right:[{right:[g]}],bottom:[{bottom:[g]}],left:[{left:[g]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",qd,je]}],basis:[{basis:ee()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",je]}],grow:[{grow:we()}],shrink:[{shrink:we()}],order:[{order:["first","last","none",qd,je]}],"grid-cols":[{"grid-cols":[Yd]}],"col-start-end":[{col:["auto",{span:["full",qd,je]},je]}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":[Yd]}],"row-start-end":[{row:["auto",{span:[qd,je]},je]}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",je]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",je]}],gap:[{gap:[v]}],"gap-x":[{"gap-x":[v]}],"gap-y":[{"gap-y":[v]}],"justify-content":[{justify:["normal",...se()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...se(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...se(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[b]}],mx:[{mx:[b]}],my:[{my:[b]}],ms:[{ms:[b]}],me:[{me:[b]}],mt:[{mt:[b]}],mr:[{mr:[b]}],mb:[{mb:[b]}],ml:[{ml:[b]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",je,t]}],"min-w":[{"min-w":[je,t,"min","max","fit"]}],"max-w":[{"max-w":[je,t,"none","full","min","max","fit","prose",{screen:[b1]},b1]}],h:[{h:[je,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[je,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[je,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[je,t,"auto","min","max","fit"]}],"font-size":[{text:["base",b1,y1]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",C6]}],"font-family":[{font:[Yd]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",je]}],"line-clamp":[{"line-clamp":["none",Lu,C6]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Li,je]}],"list-image":[{"list-image":["none",je]}],"list-style-type":[{list:["none","disc","decimal",je]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[C]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[C]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Li,y1]}],"underline-offset":[{"underline-offset":["auto",Li,je]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[C]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ae(),Bj]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Nj]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Gj]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[C]}],"border-style":[{border:[...J(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[C]}],"divide-style":[{divide:J()}],"border-color":[{border:[n]}],"border-color-x":[{"border-x":[n]}],"border-color-y":[{"border-y":[n]}],"border-color-s":[{"border-s":[n]}],"border-color-e":[{"border-e":[n]}],"border-color-t":[{"border-t":[n]}],"border-color-r":[{"border-r":[n]}],"border-color-b":[{"border-b":[n]}],"border-color-l":[{"border-l":[n]}],"divide-color":[{divide:[n]}],"outline-style":[{outline:["",...J()]}],"outline-offset":[{"outline-offset":[Li,je]}],"outline-w":[{outline:[Li,y1]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[C]}],"ring-offset-w":[{"ring-offset":[Li,y1]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",b1,Wj]}],"shadow-color":[{shadow:[Yd]}],opacity:[{opacity:[C]}],"mix-blend":[{"mix-blend":[...me(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":me()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[o]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",b1,je]}],grayscale:[{grayscale:[d]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[m]}],saturate:[{saturate:[I]}],sepia:[{sepia:[M]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[d]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[m]}],"backdrop-opacity":[{"backdrop-opacity":[C]}],"backdrop-saturate":[{"backdrop-saturate":[I]}],"backdrop-sepia":[{"backdrop-sepia":[M]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",je]}],duration:[{duration:It()}],ease:[{ease:["linear","in","out","in-out",je]}],delay:[{delay:It()}],animate:[{animate:["none","spin","ping","pulse","bounce",je]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[_]}],"scale-x":[{"scale-x":[_]}],"scale-y":[{"scale-y":[_]}],rotate:[{rotate:[qd,je]}],"translate-x":[{"translate-x":[H]}],"translate-y":[{"translate-y":[H]}],"skew-x":[{"skew-x":[E]}],"skew-y":[{"skew-y":[E]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",je]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",je]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",je]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Li,y1,C6]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};var XL=Mj($j);function K(...e){return XL(BL(e))}var Su=e=>e.startsWith("0x")?parseInt(e,16):parseInt(e,10),Ru=e=>{switch(e){case rt.RemoteType.Values.fut089:return 8;case rt.RemoteType.Values.rgb:return 1;default:return 4}};var Ii=B(j());var Jd=Ii.default.forwardRef(({href:e,className:t,...r},o)=>Ii.default.createElement("a",{ref:o,href:e,className:K("hover:border-slate-400 dark:hover:border-slate-500 text-slate-700 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-300",t),...r}));Jd.displayName="Link";var H9=Ii.default.forwardRef(({href:e,className:t,...r},o)=>{let[n,a]=(0,Ii.useState)(!1);return(0,Ii.useEffect)(()=>{let s=()=>{a(window.location.hash===e)};return s(),window.addEventListener("popstate",s),()=>{window.removeEventListener("popstate",s)}},[e]),Ii.default.createElement(Jd,{ref:o,href:e,className:K({"underline decoration-2 underline-offset-8":n},t),...r})});H9.displayName="NavLink";var F9=B(j());var qL=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),V9=(...e)=>e.filter((t,r,o)=>!!t&&o.indexOf(t)===r).join(" ");var Qd=B(j());var YL={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var JL=(0,Qd.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:o,className:n="",children:a,iconNode:s,...u},c)=>(0,Qd.createElement)("svg",{ref:c,...YL,width:t,height:t,stroke:e,strokeWidth:o?Number(r)*24/Number(t):r,className:V9("lucide",n),...u},[...s.map(([d,p])=>(0,Qd.createElement)(d,p)),...Array.isArray(a)?a:[a]]));var ot=(e,t)=>{let r=(0,F9.forwardRef)(({className:o,...n},a)=>(0,F9.createElement)(JL,{ref:a,iconNode:t,className:V9(`lucide-${qL(e)}`,o),...n}));return r.displayName=`${e}`,r};var Kd=ot("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var _u=ot("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var e0=ot("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var L1=ot("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var I1=ot("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);var t0=ot("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);var r0=ot("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var o0=ot("Loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);var Zs=ot("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);var n0=ot("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);var Gs=ot("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);var Ws=ot("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var a0=ot("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var zs=ot("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);var i0=ot("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var s0=ot("Trash",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}]]);var S1=ot("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var Si=ot("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var Dr=B(j());var Na=B(j());function D9(e,t){return e.device_id===t.device_id&&e.device_type===t.device_type&&e.group_id===t.group_id}function QL(e,t){switch(t.type){case"UPDATE_STATE":if(e.lights.some(n=>D9(n.device,t.device)))return{...e,lights:e.lights.map(n=>D9(n.device,t.device)?{...n,state:{...n.state,...t.payload}}:n)};{let n={device:{...t.device},state:{...t.payload},ephemeral:!0};return{...e,lights:[...e.lights,n]}}case"UPDATE_ALL_STATE":return{...e,lights:e.lights.map(n=>({...n,state:t.payload}))};case"SET_LIGHTS":return{...e,lights:t.lights.map(n=>({...n,ephemeral:!1})),isLoading:!1};case"DELETE_LIGHT":return{...e,lights:e.lights.filter(n=>!D9(n.device,t.device))};case"ADD_LIGHT":let o={id:t.device.id,device_id:t.device.device_id,device_type:t.device.device_type,group_id:t.device.group_id,alias:t.device.alias};return{...e,lights:[...e.lights,{device:o,state:{state:"OFF"},ephemeral:!1}]};case"UPDATE_LIGHT_NAME":return{...e,lights:e.lights.map(n=>D9(n.device,t.device)?{...n,device:{...n.device,alias:t.name}}:n)};default:return e}}var KL=(0,Na.createContext)(null),eI=({children:e})=>{let[t,r]=(0,Na.useReducer)(QL,{lights:[],isLoading:!0});return(0,Na.useEffect)(()=>{(async()=>{let n=await hn.getGateways();r({type:"SET_LIGHTS",lights:n})})()},[]),Na.default.createElement(KL.Provider,{value:{lightStates:t,dispatch:r}},e)},Au=()=>{let e=(0,Na.useContext)(KL);if(!e)throw new Error("useLightState must be used within a LightProvider");return e};var tI=(0,Dr.createContext)(null),rI=({children:e})=>{let{lightStates:t}=Au(),[r,o]=(0,Dr.useState)(null),[n,a]=(0,Dr.useState)(null),[s,u]=(0,Dr.useState)(!0),[c,d]=(0,Dr.useState)(!0),[p,m]=(0,Dr.useState)("light"),v=(0,Dr.useCallback)(()=>{d(!0),hn.getAbout().then(a).finally(()=>d(!1))},[]);(0,Dr.useEffect)(()=>{let g=localStorage.getItem("theme"),b=window.matchMedia("(prefers-color-scheme: dark)").matches;m(g||(b?"dark":"light"))},[]),(0,Dr.useEffect)(()=>{let g=async()=>{let[b,C]=await Promise.all([hn.getSettings(),hn.getAbout()]);o(b),a(C),u(!1),d(!1)};!t.isLoading&&s&&g()},[t.isLoading,s]);let x=g=>{let b={...r,...g};o(b),hn.putSettings(b)},y=()=>{let g=p==="dark"?"light":"dark";m(g),localStorage.setItem("theme",g)};return(0,Dr.useEffect)(()=>{p==="dark"?document.body.className="dark":document.body.className=""},[p]),Dr.default.createElement(tI.Provider,{value:{settings:r,about:n,updateSettings:x,isLoading:s,isLoadingAbout:c,theme:p,toggleTheme:y,reloadAbout:v}},e)},Ri=()=>{let e=(0,Dr.useContext)(tI);if(!e)throw new Error("useSettings must be used within a SettingsProvider");return e};function Xj(){let{theme:e,toggleTheme:t}=Ri();return yo.createElement("button",{onClick:t,className:"text-slate-500 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-100"},e==="dark"?yo.createElement(zs,{size:20}):yo.createElement(Zs,{size:20}))}function oI({className:e,...t}){let{settings:r,isLoading:o}=Ri();return yo.createElement("div",{className:"w-full"},yo.createElement("div",{className:"flex h-16 items-center px-4 justify-between"},yo.createElement("div",{className:"flex items-center"},yo.createElement(Jd,{className:"hover:text-slate-900 dark:hover:text-slate-100 text-slate-900 dark:text-slate-100 text-lg font-bold",href:"#/dashboard"},o?"MiLight Hub":`MiLight Hub: ${r?.hostname}`),yo.createElement("nav",{className:K("flex items-center space-x-4 lg:space-x-6 mx-6",e),...t},yo.createElement(H9,{href:"#/dashboard"},"Dashboard"),yo.createElement(H9,{href:"#/sniffer"},"Sniffer"))),yo.createElement("div",{className:"flex items-center space-x-4"},yo.createElement(Xj,null),yo.createElement(Jd,{href:"#/settings",className:"text-slate-500 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-100"},yo.createElement(a0,{size:24})))))}var c3=B(j());var Ve=B(j());var Go=B(j());var js=Go.forwardRef(({className:e,...t},r)=>Go.createElement("div",{ref:r,className:K("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));js.displayName="Card";var Ba=Go.forwardRef(({className:e,...t},r)=>Go.createElement("div",{ref:r,className:K("flex flex-col space-y-1.5 p-6",e),...t}));Ba.displayName="CardHeader";var Za=Go.forwardRef(({className:e,...t},r)=>Go.createElement("h3",{ref:r,className:K("text-2xl font-semibold leading-none tracking-tight",e),...t}));Za.displayName="CardTitle";var qj=Go.forwardRef(({className:e,...t},r)=>Go.createElement("p",{ref:r,className:K("text-sm text-muted-foreground",e),...t}));qj.displayName="CardDescription";var Ga=Go.forwardRef(({className:e,...t},r)=>Go.createElement("div",{ref:r,className:K("p-6 pt-0",e),...t}));Ga.displayName="CardContent";var Yj=Go.forwardRef(({className:e,...t},r)=>Go.createElement("div",{ref:r,className:K("flex items-center p-6 pt-0",e),...t}));Yj.displayName="CardFooter";var l0=B(j());var za=B(j(),1);function Se(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),r===!1||!n.defaultPrevented)return t?.(n)}}var nI=B(j(),1);function Jj(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function y6(...e){return t=>e.forEach(r=>Jj(r,t))}function Ue(...e){return nI.useCallback(y6(...e),e)}var Nn=B(j(),1),b6=B(Et(),1);function lI(e,t){let r=Nn.createContext(t),o=a=>{let{children:s,...u}=a,c=Nn.useMemo(()=>u,Object.values(u));return(0,b6.jsx)(r.Provider,{value:c,children:s})};o.displayName=e+"Provider";function n(a){let s=Nn.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[o,n]}function Wa(e,t=[]){let r=[];function o(a,s){let u=Nn.createContext(s),c=r.length;r=[...r,s];let d=m=>{let{scope:v,children:x,...y}=m,g=v?.[e]?.[c]||u,b=Nn.useMemo(()=>y,Object.values(y));return(0,b6.jsx)(g.Provider,{value:b,children:x})};d.displayName=a+"Provider";function p(m,v){let x=v?.[e]?.[c]||u,y=Nn.useContext(x);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${m}\` must be used within \`${a}\``)}return[d,p]}let n=()=>{let a=r.map(s=>Nn.createContext(s));return function(u){let c=u?.[e]||a;return Nn.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return n.scopeName=e,[o,nU(n,...t)]}function nU(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let o=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(a){let s=o.reduce((u,{useScope:c,scopeName:d})=>{let m=c(a)[`__scope${d}`];return{...u,...m}},{});return Nn.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var R1=B(j(),1);var Mu=B(j(),1);function ur(e){let t=Mu.useRef(e);return Mu.useEffect(()=>{t.current=e}),Mu.useMemo(()=>(...r)=>t.current?.(...r),[])}function Nr({prop:e,defaultProp:t,onChange:r=()=>{}}){let[o,n]=aU({defaultProp:t,onChange:r}),a=e!==void 0,s=a?e:o,u=ur(r),c=R1.useCallback(d=>{if(a){let m=typeof d=="function"?d(e):d;m!==e&&u(m)}else n(d)},[a,e,n,u]);return[s,c]}function aU({defaultProp:e,onChange:t}){let r=R1.useState(e),[o]=r,n=R1.useRef(o),a=ur(t);return R1.useEffect(()=>{n.current!==o&&(a(o),n.current=o)},[o,n,a]),r}var B9=B(j(),1);function Tu(e){let t=B9.useRef({value:e,previous:e});return B9.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var cI=B(j(),1);var uI=B(j(),1),or=globalThis?.document?uI.useLayoutEffect:()=>{};function Pu(e){let[t,r]=cI.useState(void 0);return or(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let o=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;let a=n[0],s,u;if("borderBoxSize"in a){let c=a.borderBoxSize,d=Array.isArray(c)?c[0]:c;s=d.inlineSize,u=d.blockSize}else s=e.offsetWidth,u=e.offsetHeight;r({width:s,height:u})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var dI=B(j(),1),fI=B(Ha(),1);var Xr=B(j(),1);var ku=B(Et(),1),Wo=Xr.forwardRef((e,t)=>{let{children:r,...o}=e,n=Xr.Children.toArray(r),a=n.find(sU);if(a){let s=a.props.children,u=n.map(c=>c===a?Xr.Children.count(s)>1?Xr.Children.only(null):Xr.isValidElement(s)?s.props.children:null:c);return(0,ku.jsx)(L6,{...o,ref:t,children:Xr.isValidElement(s)?Xr.cloneElement(s,void 0,u):null})}return(0,ku.jsx)(L6,{...o,ref:t,children:r})});Wo.displayName="Slot";var L6=Xr.forwardRef((e,t)=>{let{children:r,...o}=e;if(Xr.isValidElement(r)){let n=uU(r);return Xr.cloneElement(r,{...lU(o,r.props),ref:t?y6(t,n):n})}return Xr.Children.count(r)>1?Xr.Children.only(null):null});L6.displayName="SlotClone";var iU=({children:e})=>(0,ku.jsx)(ku.Fragment,{children:e});function sU(e){return Xr.isValidElement(e)&&e.type===iU}function lU(e,t){let r={...t};for(let o in t){let n=e[o],a=t[o];/^on[A-Z]/.test(o)?n&&a?r[o]=(...u)=>{a(...u),n(...u)}:n&&(r[o]=n):o==="style"?r[o]={...n,...a}:o==="className"&&(r[o]=[n,a].filter(Boolean).join(" "))}return{...e,...r}}function uU(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var pI=B(Et(),1),cU=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],be=cU.reduce((e,t)=>{let r=dI.forwardRef((o,n)=>{let{asChild:a,...s}=o,u=a?Wo:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),(0,pI.jsx)(u,{...s,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Z9(e,t){e&&fI.flushSync(()=>e.dispatchEvent(t))}var Us=B(Et(),1),I6="Switch",[dU,wie]=Wa(I6),[fU,pU]=dU(I6),mI=za.forwardRef((e,t)=>{let{__scopeSwitch:r,name:o,checked:n,defaultChecked:a,required:s,disabled:u,value:c="on",onCheckedChange:d,form:p,...m}=e,[v,x]=za.useState(null),y=Ue(t,I=>x(I)),g=za.useRef(!1),b=v?p||!!v.closest("form"):!0,[C=!1,w]=Nr({prop:n,defaultProp:a,onChange:d});return(0,Us.jsxs)(fU,{scope:r,checked:C,disabled:u,children:[(0,Us.jsx)(be.button,{type:"button",role:"switch","aria-checked":C,"aria-required":s,"data-state":vI(C),"data-disabled":u?"":void 0,disabled:u,value:c,...m,ref:y,onClick:Se(e.onClick,I=>{w(_=>!_),b&&(g.current=I.isPropagationStopped(),g.current||I.stopPropagation())})}),b&&(0,Us.jsx)(mU,{control:v,bubbles:!g.current,name:o,value:c,checked:C,required:s,disabled:u,form:p,style:{transform:"translateX(-100%)"}})]})});mI.displayName=I6;var hI="SwitchThumb",gI=za.forwardRef((e,t)=>{let{__scopeSwitch:r,...o}=e,n=pU(hI,r);return(0,Us.jsx)(be.span,{"data-state":vI(n.checked),"data-disabled":n.disabled?"":void 0,...o,ref:t})});gI.displayName=hI;var mU=e=>{let{control:t,checked:r,bubbles:o=!0,...n}=e,a=za.useRef(null),s=Tu(r),u=Pu(t);return za.useEffect(()=>{let c=a.current,d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(s!==r&&m){let v=new Event("click",{bubbles:o});m.call(c,r),c.dispatchEvent(v)}},[s,r,o]),(0,Us.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...n,tabIndex:-1,ref:a,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function vI(e){return e?"checked":"unchecked"}var S6=mI,CI=gI;var _1=l0.forwardRef(({className:e,...t},r)=>l0.createElement(S6,{className:K("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:r},l0.createElement(CI,{className:K("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})));_1.displayName=S6.displayName;var Br=B(j());var Wt=B(j(),1);var G9=B(j(),1);var gU=G9.useId||(()=>{}),vU=0;function ja(e){let[t,r]=G9.useState(gU());return or(()=>{e||r(o=>o??String(vU++))},[e]),e||(t?`radix-${t}`:"")}var nr=B(j(),1);var wI=B(j(),1);function xI(e,t=globalThis?.document){let r=ur(e);wI.useEffect(()=>{let o=n=>{n.key==="Escape"&&r(n)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[r,t])}var _6=B(Et(),1),CU="DismissableLayer",R6="dismissableLayer.update",wU="dismissableLayer.pointerDownOutside",xU="dismissableLayer.focusOutside",yI,LI=nr.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Eu=nr.forwardRef((e,t)=>{let{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:n,onFocusOutside:a,onInteractOutside:s,onDismiss:u,...c}=e,d=nr.useContext(LI),[p,m]=nr.useState(null),v=p?.ownerDocument??globalThis?.document,[,x]=nr.useState({}),y=Ue(t,A=>m(A)),g=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),C=g.indexOf(b),w=p?g.indexOf(p):-1,I=d.layersWithOutsidePointerEventsDisabled.size>0,_=w>=C,M=bU(A=>{let H=A.target,$=[...d.branches].some(U=>U.contains(H));!_||$||(n?.(A),s?.(A),A.defaultPrevented||u?.())},v),E=LU(A=>{let H=A.target;[...d.branches].some(U=>U.contains(H))||(a?.(A),s?.(A),A.defaultPrevented||u?.())},v);return xI(A=>{w===d.layers.size-1&&(o?.(A),!A.defaultPrevented&&u&&(A.preventDefault(),u()))},v),nr.useEffect(()=>{if(p)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(yI=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),bI(),()=>{r&&d.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=yI)}},[p,v,r,d]),nr.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),bI())},[p,d]),nr.useEffect(()=>{let A=()=>x({});return document.addEventListener(R6,A),()=>document.removeEventListener(R6,A)},[]),(0,_6.jsx)(be.div,{...c,ref:y,style:{pointerEvents:I?_?"auto":"none":void 0,...e.style},onFocusCapture:Se(e.onFocusCapture,E.onFocusCapture),onBlurCapture:Se(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:Se(e.onPointerDownCapture,M.onPointerDownCapture)})});Eu.displayName=CU;var yU="DismissableLayerBranch",II=nr.forwardRef((e,t)=>{let r=nr.useContext(LI),o=nr.useRef(null),n=Ue(t,o);return nr.useEffect(()=>{let a=o.current;if(a)return r.branches.add(a),()=>{r.branches.delete(a)}},[r.branches]),(0,_6.jsx)(be.div,{...e,ref:n})});II.displayName=yU;function bU(e,t=globalThis?.document){let r=ur(e),o=nr.useRef(!1),n=nr.useRef(()=>{});return nr.useEffect(()=>{let a=u=>{if(u.target&&!o.current){let d=function(){SI(wU,r,p,{discrete:!0})};var c=d;let p={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",n.current),n.current=d,t.addEventListener("click",n.current,{once:!0})):d()}else t.removeEventListener("click",n.current);o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",n.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function LU(e,t=globalThis?.document){let r=ur(e),o=nr.useRef(!1);return nr.useEffect(()=>{let n=a=>{a.target&&!o.current&&SI(xU,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",n),()=>t.removeEventListener("focusin",n)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function bI(){let e=new CustomEvent(R6);document.dispatchEvent(e)}function SI(e,t,r,{discrete:o}){let n=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?Z9(n,a):n.dispatchEvent(a)}var RI=Eu,_I=II;var Bn=B(j(),1);var kI=B(Et(),1),A6="focusScope.autoFocusOnMount",M6="focusScope.autoFocusOnUnmount",AI={bubbles:!1,cancelable:!0},SU="FocusScope",u0=Bn.forwardRef((e,t)=>{let{loop:r=!1,trapped:o=!1,onMountAutoFocus:n,onUnmountAutoFocus:a,...s}=e,[u,c]=Bn.useState(null),d=ur(n),p=ur(a),m=Bn.useRef(null),v=Ue(t,g=>c(g)),x=Bn.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;Bn.useEffect(()=>{if(o){let w=function(E){if(x.paused||!u)return;let A=E.target;u.contains(A)?m.current=A:A1(m.current,{select:!0})},I=function(E){if(x.paused||!u)return;let A=E.relatedTarget;A!==null&&(u.contains(A)||A1(m.current,{select:!0}))},_=function(E){if(document.activeElement===document.body)for(let H of E)H.removedNodes.length>0&&A1(u)};var g=w,b=I,C=_;document.addEventListener("focusin",w),document.addEventListener("focusout",I);let M=new MutationObserver(_);return u&&M.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",w),document.removeEventListener("focusout",I),M.disconnect()}}},[o,u,x.paused]),Bn.useEffect(()=>{if(u){TI.add(x);let g=document.activeElement;if(!u.contains(g)){let C=new CustomEvent(A6,AI);u.addEventListener(A6,d),u.dispatchEvent(C),C.defaultPrevented||(RU(PU(EI(u)),{select:!0}),document.activeElement===g&&A1(u))}return()=>{u.removeEventListener(A6,d),setTimeout(()=>{let C=new CustomEvent(M6,AI);u.addEventListener(M6,p),u.dispatchEvent(C),C.defaultPrevented||A1(g??document.body,{select:!0}),u.removeEventListener(M6,p),TI.remove(x)},0)}}},[u,d,p,x]);let y=Bn.useCallback(g=>{if(!r&&!o||x.paused)return;let b=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,C=document.activeElement;if(b&&C){let w=g.currentTarget,[I,_]=_U(w);I&&_?!g.shiftKey&&C===_?(g.preventDefault(),r&&A1(I,{select:!0})):g.shiftKey&&C===I&&(g.preventDefault(),r&&A1(_,{select:!0})):C===w&&g.preventDefault()}},[r,o,x.paused]);return(0,kI.jsx)(be.div,{tabIndex:-1,...s,ref:v,onKeyDown:y})});u0.displayName=SU;function RU(e,{select:t=!1}={}){let r=document.activeElement;for(let o of e)if(A1(o,{select:t}),document.activeElement!==r)return}function _U(e){let t=EI(e),r=MI(t,e),o=MI(t.reverse(),e);return[r,o]}function EI(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{let n=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||n?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function MI(e,t){for(let r of e)if(!AU(r,{upTo:t}))return r}function AU(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function MU(e){return e instanceof HTMLInputElement&&"select"in e}function A1(e,{select:t=!1}={}){if(e&&e.focus){let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&MU(e)&&t&&e.select()}}var TI=TU();function TU(){let e=[];return{add(t){let r=e[0];t!==r&&r?.pause(),e=PI(e,t),e.unshift(t)},remove(t){e=PI(e,t),e[0]?.resume()}}}function PI(e,t){let r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function PU(e){return e.filter(t=>t.tagName!=="A")}var W9=B(j(),1),OI=B(Ha(),1);var HI=B(Et(),1),kU="Portal",$s=W9.forwardRef((e,t)=>{let{container:r,...o}=e,[n,a]=W9.useState(!1);or(()=>a(!0),[]);let s=r||n&&globalThis?.document?.body;return s?OI.default.createPortal((0,HI.jsx)(be.div,{...o,ref:t}),s):null});$s.displayName=kU;var zo=B(j(),1);var VI=B(j(),1);function EU(e,t){return VI.useReducer((r,o)=>t[r][o]??r,e)}var Xs=e=>{let{present:t,children:r}=e,o=OU(t),n=typeof r=="function"?r({present:o.isPresent}):zo.Children.only(r),a=Ue(o.ref,HU(n));return typeof r=="function"||o.isPresent?zo.cloneElement(n,{ref:a}):null};Xs.displayName="Presence";function OU(e){let[t,r]=zo.useState(),o=zo.useRef({}),n=zo.useRef(e),a=zo.useRef("none"),s=e?"mounted":"unmounted",[u,c]=EU(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return zo.useEffect(()=>{let d=z9(o.current);a.current=u==="mounted"?d:"none"},[u]),or(()=>{let d=o.current,p=n.current;if(p!==e){let v=a.current,x=z9(d);e?c("MOUNT"):x==="none"||d?.display==="none"?c("UNMOUNT"):c(p&&v!==x?"ANIMATION_OUT":"UNMOUNT"),n.current=e}},[e,c]),or(()=>{if(t){let d,p=t.ownerDocument.defaultView??window,m=x=>{let g=z9(o.current).includes(x.animationName);if(x.target===t&&g&&(c("ANIMATION_END"),!n.current)){let b=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=b)})}},v=x=>{x.target===t&&(a.current=z9(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",m),t.addEventListener("animationend",m),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",m),t.removeEventListener("animationend",m)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:zo.useCallback(d=>{d&&(o.current=getComputedStyle(d)),r(d)},[])}}function z9(e){return e?.animationName||"none"}function HU(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var DI=B(j(),1),T6=0;function j9(){DI.useEffect(()=>{let e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??FI()),document.body.insertAdjacentElement("beforeend",e[1]??FI()),T6++,()=>{T6===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),T6--}},[])}function FI(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var jo=function(){return jo=Object.assign||function(t){for(var r,o=1,n=arguments.length;o"u")return GU;var t=WU(e),r=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-r+t[2]-t[0])}};var zU=d0(),Ou="data-scroll-locked",jU=function(e,t,r,o){var n=e.left,a=e.top,s=e.right,u=e.gap;return r===void 0&&(r="margin"),` + .`.concat(P6,` { + overflow: hidden `).concat(o,`; + padding-right: `).concat(u,"px ").concat(o,`; + } + body[`).concat(Ou,`] { + overflow: hidden `).concat(o,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(o,";"),r==="margin"&&` + padding-left: `.concat(n,`px; + padding-top: `).concat(a,`px; + padding-right: `).concat(s,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(o,`; + `),r==="padding"&&"padding-right: ".concat(u,"px ").concat(o,";")].filter(Boolean).join(""),` + } + + .`).concat(qs,` { + right: `).concat(u,"px ").concat(o,`; + } + + .`).concat(Ys,` { + margin-right: `).concat(u,"px ").concat(o,`; + } + + .`).concat(qs," .").concat(qs,` { + right: 0 `).concat(o,`; + } + + .`).concat(Ys," .").concat(Ys,` { + margin-right: 0 `).concat(o,`; + } + + body[`).concat(Ou,`] { + `).concat(k6,": ").concat(u,`px; + } +`)},XI=function(){var e=parseInt(document.body.getAttribute(Ou)||"0",10);return isFinite(e)?e:0},UU=function(){Hu.useEffect(function(){return document.body.setAttribute(Ou,(XI()+1).toString()),function(){var e=XI()-1;e<=0?document.body.removeAttribute(Ou):document.body.setAttribute(Ou,e.toString())}},[])},Z6=function(e){var t=e.noRelative,r=e.noImportant,o=e.gapMode,n=o===void 0?"margin":o;UU();var a=Hu.useMemo(function(){return B6(n)},[n]);return Hu.createElement(zU,{styles:jU(a,!t,n,r?"":"!important")})};var G6=!1;if(typeof window<"u")try{f0=Object.defineProperty({},"passive",{get:function(){return G6=!0,!0}}),window.addEventListener("test",f0,f0),window.removeEventListener("test",f0,f0)}catch{G6=!1}var f0,Js=G6?{passive:!1}:!1;var $U=function(e){return e.tagName==="TEXTAREA"},qI=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!$U(e)&&r[t]==="visible")},XU=function(e){return qI(e,"overflowY")},qU=function(e){return qI(e,"overflowX")},W6=function(e,t){var r=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var n=YI(e,o);if(n){var a=JI(e,o),s=a[1],u=a[2];if(s>u)return!0}o=o.parentNode}while(o&&o!==r.body);return!1},YU=function(e){var t=e.scrollTop,r=e.scrollHeight,o=e.clientHeight;return[t,r,o]},JU=function(e){var t=e.scrollLeft,r=e.scrollWidth,o=e.clientWidth;return[t,r,o]},YI=function(e,t){return e==="v"?XU(t):qU(t)},JI=function(e,t){return e==="v"?YU(t):JU(t)},QU=function(e,t){return e==="h"&&t==="rtl"?-1:1},QI=function(e,t,r,o,n){var a=QU(e,window.getComputedStyle(t).direction),s=a*o,u=r.target,c=t.contains(u),d=!1,p=s>0,m=0,v=0;do{var x=JI(e,u),y=x[0],g=x[1],b=x[2],C=g-b-a*y;(y||C)&&YI(e,u)&&(m+=C,v+=y),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!c&&u!==document.body||c&&(t.contains(u)||t===u));return(p&&(n&&Math.abs(m)<1||!n&&s>m)||!p&&(n&&Math.abs(v)<1||!n&&-s>v))&&(d=!0),d};var Y9=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},KI=function(e){return[e.deltaX,e.deltaY]},eS=function(e){return e&&"current"in e?e.current:e},KU=function(e,t){return e[0]===t[0]&&e[1]===t[1]},e$=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},t$=0,Vu=[];function tS(e){var t=qt.useRef([]),r=qt.useRef([0,0]),o=qt.useRef(),n=qt.useState(t$++)[0],a=qt.useState(d0)[0],s=qt.useRef(e);qt.useEffect(function(){s.current=e},[e]),qt.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(n));var g=NI([e.lockRef.current],(e.shards||[]).map(eS),!0).filter(Boolean);return g.forEach(function(b){return b.classList.add("allow-interactivity-".concat(n))}),function(){document.body.classList.remove("block-interactivity-".concat(n)),g.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(n))})}}},[e.inert,e.lockRef.current,e.shards]);var u=qt.useCallback(function(g,b){if("touches"in g&&g.touches.length===2||g.type==="wheel"&&g.ctrlKey)return!s.current.allowPinchZoom;var C=Y9(g),w=r.current,I="deltaX"in g?g.deltaX:w[0]-C[0],_="deltaY"in g?g.deltaY:w[1]-C[1],M,E=g.target,A=Math.abs(I)>Math.abs(_)?"h":"v";if("touches"in g&&A==="h"&&E.type==="range")return!1;var H=W6(A,E);if(!H)return!0;if(H?M=A:(M=A==="v"?"h":"v",H=W6(A,E)),!H)return!1;if(!o.current&&"changedTouches"in g&&(I||_)&&(o.current=M),!M)return!0;var $=o.current||M;return QI($,b,g,$==="h"?I:_,!0)},[]),c=qt.useCallback(function(g){var b=g;if(!(!Vu.length||Vu[Vu.length-1]!==a)){var C="deltaY"in b?KI(b):Y9(b),w=t.current.filter(function(M){return M.name===b.type&&(M.target===b.target||b.target===M.shadowParent)&&KU(M.delta,C)})[0];if(w&&w.should){b.cancelable&&b.preventDefault();return}if(!w){var I=(s.current.shards||[]).map(eS).filter(Boolean).filter(function(M){return M.contains(b.target)}),_=I.length>0?u(b,I[0]):!s.current.noIsolation;_&&b.cancelable&&b.preventDefault()}}},[]),d=qt.useCallback(function(g,b,C,w){var I={name:g,delta:b,target:C,should:w,shadowParent:r$(C)};t.current.push(I),setTimeout(function(){t.current=t.current.filter(function(_){return _!==I})},1)},[]),p=qt.useCallback(function(g){r.current=Y9(g),o.current=void 0},[]),m=qt.useCallback(function(g){d(g.type,KI(g),g.target,u(g,e.lockRef.current))},[]),v=qt.useCallback(function(g){d(g.type,Y9(g),g.target,u(g,e.lockRef.current))},[]);qt.useEffect(function(){return Vu.push(a),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",c,Js),document.addEventListener("touchmove",c,Js),document.addEventListener("touchstart",p,Js),function(){Vu=Vu.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,Js),document.removeEventListener("touchmove",c,Js),document.removeEventListener("touchstart",p,Js)}},[]);var x=e.removeScrollBar,y=e.inert;return qt.createElement(qt.Fragment,null,y?qt.createElement(a,{styles:e$(n)}):null,x?qt.createElement(Z6,{gapMode:e.gapMode}):null)}function r$(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var rS=H6(q9,tS);var oS=J9.forwardRef(function(e,t){return J9.createElement(c0,jo({},e,{ref:t,sideCar:rS}))});oS.classNames=c0.classNames;var p0=oS;var o$=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Fu=new WeakMap,Q9=new WeakMap,K9={},z6=0,nS=function(e){return e&&(e.host||nS(e.parentNode))},n$=function(e,t){return t.map(function(r){if(e.contains(r))return r;var o=nS(r);return o&&e.contains(o)?o:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},a$=function(e,t,r,o){var n=n$(t,Array.isArray(e)?e:[e]);K9[r]||(K9[r]=new WeakMap);var a=K9[r],s=[],u=new Set,c=new Set(n),d=function(m){!m||u.has(m)||(u.add(m),d(m.parentNode))};n.forEach(d);var p=function(m){!m||c.has(m)||Array.prototype.forEach.call(m.children,function(v){if(u.has(v))p(v);else try{var x=v.getAttribute(o),y=x!==null&&x!=="false",g=(Fu.get(v)||0)+1,b=(a.get(v)||0)+1;Fu.set(v,g),a.set(v,b),s.push(v),g===1&&y&&Q9.set(v,!0),b===1&&v.setAttribute(r,"true"),y||v.setAttribute(o,"true")}catch(C){console.error("aria-hidden: cannot operate on ",v,C)}})};return p(t),u.clear(),z6++,function(){s.forEach(function(m){var v=Fu.get(m)-1,x=a.get(m)-1;Fu.set(m,v),a.set(m,x),v||(Q9.has(m)||m.removeAttribute(o),Q9.delete(m)),x||m.removeAttribute(r)}),z6--,z6||(Fu=new WeakMap,Fu=new WeakMap,Q9=new WeakMap,K9={})}},e5=function(e,t,r){r===void 0&&(r="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),n=t||o$(e);return n?(o.push.apply(o,Array.from(n.querySelectorAll("[aria-live]"))),a$(o,n,r,"aria-hidden")):function(){return null}};var Ot=B(Et(),1),j6="Dialog",[aS,dse]=Wa(j6),[i$,fa]=aS(j6),iS=e=>{let{__scopeDialog:t,children:r,open:o,defaultOpen:n,onOpenChange:a,modal:s=!0}=e,u=Wt.useRef(null),c=Wt.useRef(null),[d=!1,p]=Nr({prop:o,defaultProp:n,onChange:a});return(0,Ot.jsx)(i$,{scope:t,triggerRef:u,contentRef:c,contentId:ja(),titleId:ja(),descriptionId:ja(),open:d,onOpenChange:p,onOpenToggle:Wt.useCallback(()=>p(m=>!m),[p]),modal:s,children:r})};iS.displayName=j6;var sS="DialogTrigger",lS=Wt.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,n=fa(sS,r),a=Ue(t,n.triggerRef);return(0,Ot.jsx)(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":X6(n.open),...o,ref:a,onClick:Se(e.onClick,n.onOpenToggle)})});lS.displayName=sS;var U6="DialogPortal",[s$,uS]=aS(U6,{forceMount:void 0}),cS=e=>{let{__scopeDialog:t,forceMount:r,children:o,container:n}=e,a=fa(U6,t);return(0,Ot.jsx)(s$,{scope:t,forceMount:r,children:Wt.Children.map(o,s=>(0,Ot.jsx)(Xs,{present:r||a.open,children:(0,Ot.jsx)($s,{asChild:!0,container:n,children:s})}))})};cS.displayName=U6;var t5="DialogOverlay",dS=Wt.forwardRef((e,t)=>{let r=uS(t5,e.__scopeDialog),{forceMount:o=r.forceMount,...n}=e,a=fa(t5,e.__scopeDialog);return a.modal?(0,Ot.jsx)(Xs,{present:o||a.open,children:(0,Ot.jsx)(l$,{...n,ref:t})}):null});dS.displayName=t5;var l$=Wt.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,n=fa(t5,r);return(0,Ot.jsx)(p0,{as:Wo,allowPinchZoom:!0,shards:[n.contentRef],children:(0,Ot.jsx)(be.div,{"data-state":X6(n.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),Qs="DialogContent",fS=Wt.forwardRef((e,t)=>{let r=uS(Qs,e.__scopeDialog),{forceMount:o=r.forceMount,...n}=e,a=fa(Qs,e.__scopeDialog);return(0,Ot.jsx)(Xs,{present:o||a.open,children:a.modal?(0,Ot.jsx)(u$,{...n,ref:t}):(0,Ot.jsx)(c$,{...n,ref:t})})});fS.displayName=Qs;var u$=Wt.forwardRef((e,t)=>{let r=fa(Qs,e.__scopeDialog),o=Wt.useRef(null),n=Ue(t,r.contentRef,o);return Wt.useEffect(()=>{let a=o.current;if(a)return e5(a)},[]),(0,Ot.jsx)(pS,{...e,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Se(e.onCloseAutoFocus,a=>{a.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Se(e.onPointerDownOutside,a=>{let s=a.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0;(s.button===2||u)&&a.preventDefault()}),onFocusOutside:Se(e.onFocusOutside,a=>a.preventDefault())})}),c$=Wt.forwardRef((e,t)=>{let r=fa(Qs,e.__scopeDialog),o=Wt.useRef(!1),n=Wt.useRef(!1);return(0,Ot.jsx)(pS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||r.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,n.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(n.current=!0));let s=a.target;r.triggerRef.current?.contains(s)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&n.current&&a.preventDefault()}})}),pS=Wt.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:n,onCloseAutoFocus:a,...s}=e,u=fa(Qs,r),c=Wt.useRef(null),d=Ue(t,c);return j9(),(0,Ot.jsxs)(Ot.Fragment,{children:[(0,Ot.jsx)(u0,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:n,onUnmountAutoFocus:a,children:(0,Ot.jsx)(Eu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":X6(u.open),...s,ref:d,onDismiss:()=>u.onOpenChange(!1)})}),(0,Ot.jsxs)(Ot.Fragment,{children:[(0,Ot.jsx)(d$,{titleId:u.titleId}),(0,Ot.jsx)(p$,{contentRef:c,descriptionId:u.descriptionId})]})]})}),$6="DialogTitle",mS=Wt.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,n=fa($6,r);return(0,Ot.jsx)(be.h2,{id:n.titleId,...o,ref:t})});mS.displayName=$6;var hS="DialogDescription",gS=Wt.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,n=fa(hS,r);return(0,Ot.jsx)(be.p,{id:n.descriptionId,...o,ref:t})});gS.displayName=hS;var vS="DialogClose",CS=Wt.forwardRef((e,t)=>{let{__scopeDialog:r,...o}=e,n=fa(vS,r);return(0,Ot.jsx)(be.button,{type:"button",...o,ref:t,onClick:Se(e.onClick,()=>n.onOpenChange(!1))})});CS.displayName=vS;function X6(e){return e?"open":"closed"}var wS="DialogTitleWarning",[fse,xS]=lI(wS,{contentName:Qs,titleName:$6,docsSlug:"dialog"}),d$=({titleId:e})=>{let t=xS(wS),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return Wt.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},f$="DialogDescriptionWarning",p$=({contentRef:e,descriptionId:t})=>{let o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${xS(f$).contentName}}.`;return Wt.useEffect(()=>{let n=e.current?.getAttribute("aria-describedby");t&&n&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},yS=iS,bS=lS,LS=cS,q6=dS,Y6=fS,J6=mS,Q6=gS,IS=CS;var m0=yS,SS=bS,h$=LS;var RS=Br.forwardRef(({className:e,...t},r)=>Br.createElement(q6,{ref:r,className:K("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));RS.displayName=q6.displayName;var Du=Br.forwardRef(({className:e,children:t,closeButton:r=!0,...o},n)=>Br.createElement(h$,null,Br.createElement(RS,null),Br.createElement(Y6,{ref:n,className:K("fixed left-[50%] top-[50%] z-50 grid translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...o},Br.createElement("div",{className:K("relative",r?"pr-6":"")},t,r&&Br.createElement(IS,{className:"absolute right-0 top-0 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"},Br.createElement(Si,{className:"h-4 w-4"}),Br.createElement("span",{className:"sr-only"},"Close"))))));Du.displayName=Y6.displayName;var h0=({className:e,...t})=>Br.createElement("div",{className:K("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});h0.displayName="DialogHeader";var K6=({className:e,...t})=>Br.createElement("div",{className:K("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});K6.displayName="DialogFooter";var g0=Br.forwardRef(({className:e,...t},r)=>Br.createElement(J6,{ref:r,className:K("text-lg font-semibold leading-none tracking-tight",e),...t}));g0.displayName=J6.displayName;var em=Br.forwardRef(({className:e,...t},r)=>Br.createElement(Q6,{ref:r,className:K("text-sm text-muted-foreground",e),...t}));em.displayName=Q6.displayName;var _S=B(j());function r5({state:e}){let t="gray",r=e.color_mode||"white";return e.state==="ON"&&(r==="rgb"&&e.color?t=`rgba(${e.color.r}, ${e.color.g}, ${e.color.b}, 1)`:e.color_mode==="color_temp"&&e.kelvin!==void 0?e.kelvin<50?t="lightblue":t="orange":r==="white"&&(t="yellow")),_S.default.createElement(r0,{size:24,style:{color:t}})}var _i=B(j());var o5=B(j());function AS(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,PS=MS,Zn=(e,t)=>r=>{var o;if(t?.variants==null)return PS(e,r?.class,r?.className);let{variants:n,defaultVariants:a}=t,s=Object.keys(n).map(d=>{let p=r?.[d],m=a?.[d];if(p===null)return null;let v=TS(p)||TS(m);return n[d][v]}),u=r&&Object.entries(r).reduce((d,p)=>{let[m,v]=p;return v===void 0||(d[m]=v),d},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((d,p)=>{let{class:m,className:v,...x}=p;return Object.entries(x).every(y=>{let[g,b]=y;return Array.isArray(b)?b.includes({...a,...u}[g]):{...a,...u}[g]===b})?[...d,m,v]:d},[]);return PS(e,s,c,r?.class,r?.className)};var g$=Zn("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),yt=o5.forwardRef(({className:e,variant:t,size:r,asChild:o=!1,...n},a)=>o5.createElement(o?Wo:"button",{className:K(g$({variant:t,size:r,className:e})),ref:a,...n}));yt.displayName="Button";var v$=({title:e,description:t,open:r,setOpen:o,onConfirm:n,onCancel:a,confirmText:s="Confirm",cancelText:u="Cancel"})=>_i.createElement(m0,{open:r,onOpenChange:o},_i.createElement(Du,null,_i.createElement(h0,null,_i.createElement(g0,null,e)),_i.createElement(em,{className:"my-4"},t),_i.createElement(K6,null,_i.createElement(yt,{onClick:()=>{o(!1),a?.()},variant:"outline"},u),_i.createElement(yt,{onClick:()=>{o(!1),n?.()},variant:"destructive"},s)))),kS=v$;var nt=B(j());var Mt=B(j(),1),x0=e=>e.type==="checkbox",Bu=e=>e instanceof Date,bo=e=>e==null,GS=e=>typeof e=="object",xr=e=>!bo(e)&&!Array.isArray(e)&&GS(e)&&!Bu(e),WS=e=>xr(e)&&e.target?x0(e.target)?e.target.checked:e.target.value:e,C$=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,zS=(e,t)=>e.has(C$(t)),w$=e=>{let t=e.constructor&&e.constructor.prototype;return xr(t)&&t.hasOwnProperty("isPrototypeOf")},nm=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Uo(e){let t,r=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(nm&&(e instanceof Blob||e instanceof FileList))&&(r||xr(e)))if(t=r?[]:{},!r&&!w$(e))t=e;else for(let o in e)e.hasOwnProperty(o)&&(t[o]=Uo(e[o]));else return e;return t}var d5=e=>Array.isArray(e)?e.filter(Boolean):[],cr=e=>e===void 0,le=(e,t,r)=>{if(!t||!xr(e))return r;let o=d5(t.split(/[,[\].]+?/)).reduce((n,a)=>bo(n)?n:n[a],e);return cr(o)||o===e?cr(e[t])?r:e[t]:o},Gn=e=>typeof e=="boolean",am=e=>/^\w*$/.test(e),jS=e=>d5(e.replace(/["|']|\]/g,"").split(/\.|\[/)),vt=(e,t,r)=>{let o=-1,n=am(t)?[t]:jS(t),a=n.length,s=a-1;for(;++oMt.default.useContext(US),f5=e=>{let{children:t,...r}=e;return Mt.default.createElement(US.Provider,{value:r},t)},$S=(e,t,r,o=!0)=>{let n={defaultValues:t._defaultValues};for(let a in e)Object.defineProperty(n,a,{get:()=>{let s=a;return t._proxyFormState[s]!==pa.all&&(t._proxyFormState[s]=!o||pa.all),r&&(r[s]=!0),e[s]}});return n},$o=e=>xr(e)&&!Object.keys(e).length,XS=(e,t,r,o)=>{r(e);let{name:n,...a}=e;return $o(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(s=>t[s]===(!o||pa.all))},C0=e=>Array.isArray(e)?e:[e],qS=(e,t,r)=>!e||!t||e===t||C0(e).some(o=>o&&(r?o===t:o.startsWith(t)||t.startsWith(o)));function im(e){let t=Mt.default.useRef(e);t.current=e,Mt.default.useEffect(()=>{let r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}},[e.disabled])}function x$(e){let t=so(),{control:r=t.control,disabled:o,name:n,exact:a}=e||{},[s,u]=Mt.default.useState(r._formState),c=Mt.default.useRef(!0),d=Mt.default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),p=Mt.default.useRef(n);return p.current=n,im({disabled:o,next:m=>c.current&&qS(p.current,m.name,a)&&XS(m,d.current,r._updateFormState)&&u({...r._formState,...m}),subject:r._subjects.state}),Mt.default.useEffect(()=>(c.current=!0,d.current.isValid&&r._updateValid(!0),()=>{c.current=!1}),[r]),$S(s,r,d.current,!1)}var Ua=e=>typeof e=="string",YS=(e,t,r,o,n)=>Ua(e)?(o&&t.watch.add(e),le(r,e,n)):Array.isArray(e)?e.map(a=>(o&&t.watch.add(a),le(r,a))):(o&&(t.watchAll=!0),r);function sm(e){let t=so(),{control:r=t.control,name:o,defaultValue:n,disabled:a,exact:s}=e||{},u=Mt.default.useRef(o);u.current=o,im({disabled:a,subject:r._subjects.values,next:p=>{qS(u.current,p.name,s)&&d(Uo(YS(u.current,r._names,p.values||r._formValues,!1,n)))}});let[c,d]=Mt.default.useState(r._getWatch(o,n));return Mt.default.useEffect(()=>r._removeUnmounted()),c}function y$(e){let t=so(),{name:r,disabled:o,control:n=t.control,shouldUnregister:a}=e,s=zS(n._names.array,r),u=sm({control:n,name:r,defaultValue:le(n._formValues,r,le(n._defaultValues,r,e.defaultValue)),exact:!0}),c=x$({control:n,name:r,exact:!0}),d=Mt.default.useRef(n.register(r,{...e.rules,value:u,...Gn(e.disabled)?{disabled:e.disabled}:{}}));return Mt.default.useEffect(()=>{let p=n._options.shouldUnregister||a,m=(v,x)=>{let y=le(n._fields,v);y&&y._f&&(y._f.mount=x)};if(m(r,!0),p){let v=Uo(le(n._options.defaultValues,r));vt(n._defaultValues,r,v),cr(le(n._formValues,r))&&vt(n._formValues,r,v)}return()=>{(s?p&&!n._state.action:p)?n.unregister(r):m(r,!1)}},[r,n,s,a]),Mt.default.useEffect(()=>{le(n._fields,r)&&n._updateDisabledField({disabled:o,fields:n._fields,name:r,value:le(n._fields,r)._f.value})},[o,r,n]),{field:{name:r,value:u,...Gn(o)||c.disabled?{disabled:c.disabled||o}:{},onChange:Mt.default.useCallback(p=>d.current.onChange({target:{value:WS(p),name:r},type:i5.CHANGE}),[r]),onBlur:Mt.default.useCallback(()=>d.current.onBlur({target:{value:le(n._formValues,r),name:r},type:i5.BLUR}),[r,n]),ref:Mt.default.useCallback(p=>{let m=le(n._fields,r);m&&p&&(m._f.ref={focus:()=>p.focus(),select:()=>p.select(),setCustomValidity:v=>p.setCustomValidity(v),reportValidity:()=>p.reportValidity()})},[n._fields,r])},formState:c,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!le(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!le(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!le(c.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!le(c.validatingFields,r)},error:{enumerable:!0,get:()=>le(c.errors,r)}})}}var T1=e=>e.render(y$(e));var lm=(e,t,r,o,n)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[o]:n||!0}}:{};var ES=e=>({isOnSubmit:!e||e===pa.onSubmit,isOnBlur:e===pa.onBlur,isOnChange:e===pa.onChange,isOnAll:e===pa.all,isOnTouch:e===pa.onTouched}),OS=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length)))),w0=(e,t,r,o)=>{for(let n of r||Object.keys(e)){let a=le(e,n);if(a){let{_f:s,...u}=a;if(s){if(s.refs&&s.refs[0]&&t(s.refs[0],n)&&!o)return!0;if(s.ref&&t(s.ref,s.name)&&!o)return!0;if(w0(u,t))break}else if(xr(u)&&w0(u,t))break}}},b$=(e,t,r)=>{let o=C0(le(e,r));return vt(o,"root",t[r]),vt(e,r,o),e},um=e=>e.type==="file",Mi=e=>typeof e=="function",s5=e=>{if(!nm)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},a5=e=>Ua(e),cm=e=>e.type==="radio",l5=e=>e instanceof RegExp,HS={value:!1,isValid:!1},VS={value:!0,isValid:!0},JS=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!cr(e[0].attributes.value)?cr(e[0].value)||e[0].value===""?VS:{value:e[0].value,isValid:!0}:VS:HS}return HS},FS={isValid:!1,value:null},QS=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,FS):FS;function DS(e,t,r="validate"){if(a5(e)||Array.isArray(e)&&e.every(a5)||Gn(e)&&!e)return{type:r,message:a5(e)?e:"",ref:t}}var Nu=e=>xr(e)&&!l5(e)?e:{value:e,message:""},NS=async(e,t,r,o,n)=>{let{ref:a,refs:s,required:u,maxLength:c,minLength:d,min:p,max:m,pattern:v,validate:x,name:y,valueAsNumber:g,mount:b,disabled:C}=e._f,w=le(t,y);if(!b||C)return{};let I=s?s[0]:a,_=W=>{o&&I.reportValidity&&(I.setCustomValidity(Gn(W)?"":W||""),I.reportValidity())},M={},E=cm(a),A=x0(a),H=E||A,$=(g||um(a))&&cr(a.value)&&cr(w)||s5(a)&&a.value===""||w===""||Array.isArray(w)&&!w.length,U=lm.bind(null,y,r,M),ee=(W,ie,Y,ae=Ai.maxLength,J=Ai.minLength)=>{let me=W?ie:Y;M[y]={type:W?ae:J,message:me,ref:a,...U(W?ae:J,me)}};if(n?!Array.isArray(w)||!w.length:u&&(!H&&($||bo(w))||Gn(w)&&!w||A&&!JS(s).isValid||E&&!QS(s).isValid)){let{value:W,message:ie}=a5(u)?{value:!!u,message:u}:Nu(u);if(W&&(M[y]={type:Ai.required,message:ie,ref:I,...U(Ai.required,ie)},!r))return _(ie),M}if(!$&&(!bo(p)||!bo(m))){let W,ie,Y=Nu(m),ae=Nu(p);if(!bo(w)&&!isNaN(w)){let J=a.valueAsNumber||w&&+w;bo(Y.value)||(W=J>Y.value),bo(ae.value)||(ie=Jnew Date(new Date().toDateString()+" "+Ke),se=a.type=="time",we=a.type=="week";Ua(Y.value)&&w&&(W=se?me(w)>me(Y.value):we?w>Y.value:J>new Date(Y.value)),Ua(ae.value)&&w&&(ie=se?me(w)+W.value,ae=!bo(ie.value)&&w.length<+ie.value;if((Y||ae)&&(ee(Y,W.message,ie.message),!r))return _(M[y].message),M}if(v&&!$&&Ua(w)){let{value:W,message:ie}=Nu(v);if(l5(W)&&!w.match(W)&&(M[y]={type:Ai.pattern,message:ie,ref:a,...U(Ai.pattern,ie)},!r))return _(ie),M}if(x){if(Mi(x)){let W=await x(w,t),ie=DS(W,I);if(ie&&(M[y]={...ie,...U(Ai.validate,ie.message)},!r))return _(ie.message),M}else if(xr(x)){let W={};for(let ie in x){if(!$o(W)&&!r)break;let Y=DS(await x[ie](w,t),I,ie);Y&&(W={...Y,...U(ie,Y.message)},_(Y.message),r&&(M[y]=W))}if(!$o(W)&&(M[y]={ref:I,...W},!r))return M}}return _(!0),M};function L$(e,t){let r=t.slice(0,-1).length,o=0;for(;o{let e=[];return{get observers(){return e},next:n=>{for(let a of e)a.next&&a.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(a=>a!==n)}}),unsubscribe:()=>{e=[]}}},u5=e=>bo(e)||!GS(e);function M1(e,t){if(u5(e)||u5(t))return e===t;if(Bu(e)&&Bu(t))return e.getTime()===t.getTime();let r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;for(let n of r){let a=e[n];if(!o.includes(n))return!1;if(n!=="ref"){let s=t[n];if(Bu(a)&&Bu(s)||xr(a)&&xr(s)||Array.isArray(a)&&Array.isArray(s)?!M1(a,s):a!==s)return!1}}return!0}var KS=e=>e.type==="select-multiple",S$=e=>cm(e)||x0(e),rm=e=>s5(e)&&e.isConnected,eR=e=>{for(let t in e)if(Mi(e[t]))return!0;return!1};function c5(e,t={}){let r=Array.isArray(e);if(xr(e)||r)for(let o in e)Array.isArray(e[o])||xr(e[o])&&!eR(e[o])?(t[o]=Array.isArray(e[o])?[]:{},c5(e[o],t[o])):bo(e[o])||(t[o]=!0);return t}function tR(e,t,r){let o=Array.isArray(e);if(xr(e)||o)for(let n in e)Array.isArray(e[n])||xr(e[n])&&!eR(e[n])?cr(t)||u5(r[n])?r[n]=Array.isArray(e[n])?c5(e[n],[]):{...c5(e[n])}:tR(e[n],bo(t)?{}:t[n],r[n]):r[n]=!M1(e[n],t[n]);return r}var n5=(e,t)=>tR(e,t,c5(t)),rR=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:o})=>cr(e)?e:t?e===""?NaN:e&&+e:r&&Ua(e)?new Date(e):o?o(e):e;function om(e){let t=e.ref;if(!(e.refs?e.refs.every(r=>r.disabled):t.disabled))return um(t)?t.files:cm(t)?QS(e.refs).value:KS(t)?[...t.selectedOptions].map(({value:r})=>r):x0(t)?JS(e.refs).value:rR(cr(t.value)?e.ref.value:t.value,e)}var R$=(e,t,r,o)=>{let n={};for(let a of e){let s=le(t,a);s&&vt(n,a,s._f)}return{criteriaMode:r,names:[...e],fields:n,shouldUseNativeValidation:o}},v0=e=>cr(e)?e:l5(e)?e.source:xr(e)?l5(e.value)?e.value.source:e.value:e,BS="AsyncFunction",_$=e=>(!e||!e.validate)&&!!(Mi(e.validate)&&e.validate.constructor.name===BS||xr(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===BS)),A$=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function ZS(e,t,r){let o=le(e,r);if(o||am(r))return{error:o,name:r};let n=r.split(".");for(;n.length;){let a=n.join("."),s=le(t,a),u=le(e,a);if(s&&!Array.isArray(s)&&r!==a)return{name:r};if(u&&u.type)return{name:a,error:u};n.pop()}return{name:r}}var M$=(e,t,r,o,n)=>n.isOnAll?!1:!r&&n.isOnTouch?!(t||e):(r?o.isOnBlur:n.isOnBlur)?!e:(r?o.isOnChange:n.isOnChange)?e:!0,T$=(e,t)=>!d5(le(e,t)).length&&Tr(e,t),P$={mode:pa.onSubmit,reValidateMode:pa.onChange,shouldFocusError:!0};function k$(e={}){let t={...P$,...e},r={submitCount:0,isDirty:!1,isLoading:Mi(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},o={},n=xr(t.defaultValues)||xr(t.values)?Uo(t.defaultValues||t.values)||{}:{},a=t.shouldUnregister?{}:Uo(n),s={action:!1,mount:!1,watch:!1},u={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,d=0,p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={values:tm(),array:tm(),state:tm()},v=ES(t.mode),x=ES(t.reValidateMode),y=t.criteriaMode===pa.all,g=k=>D=>{clearTimeout(d),d=setTimeout(k,D)},b=async k=>{if(p.isValid||k){let D=t.resolver?$o((await H()).errors):await U(o,!0);D!==r.isValid&&m.state.next({isValid:D})}},C=(k,D)=>{(p.isValidating||p.validatingFields)&&((k||Array.from(u.mount)).forEach(G=>{G&&(D?vt(r.validatingFields,G,D):Tr(r.validatingFields,G))}),m.state.next({validatingFields:r.validatingFields,isValidating:!$o(r.validatingFields)}))},w=(k,D=[],G,ce,ue=!0,oe=!0)=>{if(ce&&G){if(s.action=!0,oe&&Array.isArray(le(o,k))){let Le=G(le(o,k),ce.argA,ce.argB);ue&&vt(o,k,Le)}if(oe&&Array.isArray(le(r.errors,k))){let Le=G(le(r.errors,k),ce.argA,ce.argB);ue&&vt(r.errors,k,Le),T$(r.errors,k)}if(p.touchedFields&&oe&&Array.isArray(le(r.touchedFields,k))){let Le=G(le(r.touchedFields,k),ce.argA,ce.argB);ue&&vt(r.touchedFields,k,Le)}p.dirtyFields&&(r.dirtyFields=n5(n,a)),m.state.next({name:k,isDirty:W(k,D),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else vt(a,k,D)},I=(k,D)=>{vt(r.errors,k,D),m.state.next({errors:r.errors})},_=k=>{r.errors=k,m.state.next({errors:r.errors,isValid:!1})},M=(k,D,G,ce)=>{let ue=le(o,k);if(ue){let oe=le(a,k,cr(G)?le(n,k):G);cr(oe)||ce&&ce.defaultChecked||D?vt(a,k,D?oe:om(ue._f)):ae(k,oe),s.mount&&b()}},E=(k,D,G,ce,ue)=>{let oe=!1,Le=!1,et={name:k},zt=!!(le(o,k)&&le(o,k)._f&&le(o,k)._f.disabled);if(!G||ce){p.isDirty&&(Le=r.isDirty,r.isDirty=et.isDirty=W(),oe=Le!==et.isDirty);let ir=zt||M1(le(n,k),D);Le=!!(!zt&&le(r.dirtyFields,k)),ir||zt?Tr(r.dirtyFields,k):vt(r.dirtyFields,k,!0),et.dirtyFields=r.dirtyFields,oe=oe||p.dirtyFields&&Le!==!ir}if(G){let ir=le(r.touchedFields,k);ir||(vt(r.touchedFields,k,G),et.touchedFields=r.touchedFields,oe=oe||p.touchedFields&&ir!==G)}return oe&&ue&&m.state.next(et),oe?et:{}},A=(k,D,G,ce)=>{let ue=le(r.errors,k),oe=p.isValid&&Gn(D)&&r.isValid!==D;if(e.delayError&&G?(c=g(()=>I(k,G)),c(e.delayError)):(clearTimeout(d),c=null,G?vt(r.errors,k,G):Tr(r.errors,k)),(G?!M1(ue,G):ue)||!$o(ce)||oe){let Le={...ce,...oe&&Gn(D)?{isValid:D}:{},errors:r.errors,name:k};r={...r,...Le},m.state.next(Le)}},H=async k=>{C(k,!0);let D=await t.resolver(a,t.context,R$(k||u.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return C(k),D},$=async k=>{let{errors:D}=await H(k);if(k)for(let G of k){let ce=le(D,G);ce?vt(r.errors,G,ce):Tr(r.errors,G)}else r.errors=D;return D},U=async(k,D,G={valid:!0})=>{for(let ce in k){let ue=k[ce];if(ue){let{_f:oe,...Le}=ue;if(oe){let et=u.array.has(oe.name),zt=ue._f&&_$(ue._f);zt&&p.validatingFields&&C([ce],!0);let ir=await NS(ue,a,y,t.shouldUseNativeValidation&&!D,et);if(zt&&p.validatingFields&&C([ce]),ir[oe.name]&&(G.valid=!1,D))break;!D&&(le(ir,oe.name)?et?b$(r.errors,ir,oe.name):vt(r.errors,oe.name,ir[oe.name]):Tr(r.errors,oe.name))}!$o(Le)&&await U(Le,D,G)}}return G.valid},ee=()=>{for(let k of u.unMount){let D=le(o,k);D&&(D._f.refs?D._f.refs.every(G=>!rm(G)):!rm(D._f.ref))&&Rt(k)}u.unMount=new Set},W=(k,D)=>(k&&D&&vt(a,k,D),!M1(It(),n)),ie=(k,D,G)=>YS(k,u,{...s.mount?a:cr(D)?n:Ua(k)?{[k]:D}:D},G,D),Y=k=>d5(le(s.mount?a:n,k,e.shouldUnregister?le(n,k,[]):[])),ae=(k,D,G={})=>{let ce=le(o,k),ue=D;if(ce){let oe=ce._f;oe&&(!oe.disabled&&vt(a,k,rR(D,oe)),ue=s5(oe.ref)&&bo(D)?"":D,KS(oe.ref)?[...oe.ref.options].forEach(Le=>Le.selected=ue.includes(Le.value)):oe.refs?x0(oe.ref)?oe.refs.length>1?oe.refs.forEach(Le=>(!Le.defaultChecked||!Le.disabled)&&(Le.checked=Array.isArray(ue)?!!ue.find(et=>et===Le.value):ue===Le.value)):oe.refs[0]&&(oe.refs[0].checked=!!ue):oe.refs.forEach(Le=>Le.checked=Le.value===ue):um(oe.ref)?oe.ref.value="":(oe.ref.value=ue,oe.ref.type||m.values.next({name:k,values:{...a}})))}(G.shouldDirty||G.shouldTouch)&&E(k,ue,G.shouldTouch,G.shouldDirty,!0),G.shouldValidate&&Ke(k)},J=(k,D,G)=>{for(let ce in D){let ue=D[ce],oe=`${k}.${ce}`,Le=le(o,oe);(u.array.has(k)||!u5(ue)||Le&&!Le._f)&&!Bu(ue)?J(oe,ue,G):ae(oe,ue,G)}},me=(k,D,G={})=>{let ce=le(o,k),ue=u.array.has(k),oe=Uo(D);vt(a,k,oe),ue?(m.array.next({name:k,values:{...a}}),(p.isDirty||p.dirtyFields)&&G.shouldDirty&&m.state.next({name:k,dirtyFields:n5(n,a),isDirty:W(k,oe)})):ce&&!ce._f&&!bo(oe)?J(k,oe,G):ae(k,oe,G),OS(k,u)&&m.state.next({...r}),m.values.next({name:s.mount?k:void 0,values:{...a}})},se=async k=>{s.mount=!0;let D=k.target,G=D.name,ce=!0,ue=le(o,G),oe=()=>D.type?om(ue._f):WS(k),Le=et=>{ce=Number.isNaN(et)||M1(et,le(a,G,et))};if(ue){let et,zt,ir=oe(),Yn=k.type===i5.BLUR||k.type===i5.FOCUS_OUT,wc=!A$(ue._f)&&!t.resolver&&!le(r.errors,G)&&!ue._f.deps||M$(Yn,le(r.touchedFields,G),r.isSubmitted,x,v),Q1=OS(G,u,Yn);vt(a,G,ir),Yn?(ue._f.onBlur&&ue._f.onBlur(k),c&&c(0)):ue._f.onChange&&ue._f.onChange(k);let K1=E(G,ir,Yn,!1),xc=!$o(K1)||Q1;if(!Yn&&m.values.next({name:G,type:k.type,values:{...a}}),wc)return p.isValid&&(e.mode==="onBlur"?Yn&&b():b()),xc&&m.state.next({name:G,...Q1?{}:K1});if(!Yn&&Q1&&m.state.next({...r}),t.resolver){let{errors:Cl}=await H([G]);if(Le(ir),ce){let yc=ZS(r.errors,o,G),wl=ZS(Cl,o,yc.name||G);et=wl.error,G=wl.name,zt=$o(Cl)}}else C([G],!0),et=(await NS(ue,a,y,t.shouldUseNativeValidation))[G],C([G]),Le(ir),ce&&(et?zt=!1:p.isValid&&(zt=await U(o,!0)));ce&&(ue._f.deps&&Ke(ue._f.deps),A(G,zt,et,K1))}},we=(k,D)=>{if(le(r.errors,D)&&k.focus)return k.focus(),1},Ke=async(k,D={})=>{let G,ce,ue=C0(k);if(t.resolver){let oe=await $(cr(k)?k:ue);G=$o(oe),ce=k?!ue.some(Le=>le(oe,Le)):G}else k?(ce=(await Promise.all(ue.map(async oe=>{let Le=le(o,oe);return await U(Le&&Le._f?{[oe]:Le}:Le)}))).every(Boolean),!(!ce&&!r.isValid)&&b()):ce=G=await U(o);return m.state.next({...!Ua(k)||p.isValid&&G!==r.isValid?{}:{name:k},...t.resolver||!k?{isValid:G}:{},errors:r.errors}),D.shouldFocus&&!ce&&w0(o,we,k?ue:u.mount),ce},It=k=>{let D={...s.mount?a:n};return cr(k)?D:Ua(k)?le(D,k):k.map(G=>le(D,G))},st=(k,D)=>({invalid:!!le((D||r).errors,k),isDirty:!!le((D||r).dirtyFields,k),error:le((D||r).errors,k),isValidating:!!le(r.validatingFields,k),isTouched:!!le((D||r).touchedFields,k)}),dt=k=>{k&&C0(k).forEach(D=>Tr(r.errors,D)),m.state.next({errors:k?r.errors:{}})},St=(k,D,G)=>{let ce=(le(o,k,{_f:{}})._f||{}).ref,ue=le(r.errors,k)||{},{ref:oe,message:Le,type:et,...zt}=ue;vt(r.errors,k,{...zt,...D,ref:ce}),m.state.next({name:k,errors:r.errors,isValid:!1}),G&&G.shouldFocus&&ce&&ce.focus&&ce.focus()},Lr=(k,D)=>Mi(k)?m.values.subscribe({next:G=>k(ie(void 0,D),G)}):ie(k,D,!0),Rt=(k,D={})=>{for(let G of k?C0(k):u.mount)u.mount.delete(G),u.array.delete(G),D.keepValue||(Tr(o,G),Tr(a,G)),!D.keepError&&Tr(r.errors,G),!D.keepDirty&&Tr(r.dirtyFields,G),!D.keepTouched&&Tr(r.touchedFields,G),!D.keepIsValidating&&Tr(r.validatingFields,G),!t.shouldUnregister&&!D.keepDefaultValue&&Tr(n,G);m.values.next({values:{...a}}),m.state.next({...r,...D.keepDirty?{isDirty:W()}:{}}),!D.keepIsValid&&b()},xe=({disabled:k,name:D,field:G,fields:ce,value:ue})=>{if(Gn(k)&&s.mount||k){let oe=k?void 0:cr(ue)?om(G?G._f:le(ce,D)._f):ue;vt(a,D,oe),E(D,oe,!1,!1,!0)}},qe=(k,D={})=>{let G=le(o,k),ce=Gn(D.disabled)||Gn(e.disabled);return vt(o,k,{...G||{},_f:{...G&&G._f?G._f:{ref:{name:k}},name:k,mount:!0,...D}}),u.mount.add(k),G?xe({field:G,disabled:Gn(D.disabled)?D.disabled:e.disabled,name:k,value:D.value}):M(k,!0,D.value),{...ce?{disabled:D.disabled||e.disabled}:{},...t.progressive?{required:!!D.required,min:v0(D.min),max:v0(D.max),minLength:v0(D.minLength),maxLength:v0(D.maxLength),pattern:v0(D.pattern)}:{},name:k,onChange:se,onBlur:se,ref:ue=>{if(ue){qe(k,D),G=le(o,k);let oe=cr(ue.value)&&ue.querySelectorAll&&ue.querySelectorAll("input,select,textarea")[0]||ue,Le=S$(oe),et=G._f.refs||[];if(Le?et.find(zt=>zt===oe):oe===G._f.ref)return;vt(o,k,{_f:{...G._f,...Le?{refs:[...et.filter(rm),oe,...Array.isArray(le(n,k))?[{}]:[]],ref:{type:oe.type,name:k}}:{ref:oe}}}),M(k,!1,void 0,oe)}else G=le(o,k,{}),G._f&&(G._f.mount=!1),(t.shouldUnregister||D.shouldUnregister)&&!(zS(u.array,k)&&s.action)&&u.unMount.add(k)}}},Pt=()=>t.shouldFocusError&&w0(o,we,u.mount),lt=k=>{Gn(k)&&(m.state.next({disabled:k}),w0(o,(D,G)=>{let ce=le(o,G);ce&&(D.disabled=ce._f.disabled||k,Array.isArray(ce._f.refs)&&ce._f.refs.forEach(ue=>{ue.disabled=ce._f.disabled||k}))},0,!1))},ft=(k,D)=>async G=>{let ce;G&&(G.preventDefault&&G.preventDefault(),G.persist&&G.persist());let ue=Uo(a);if(m.state.next({isSubmitting:!0}),t.resolver){let{errors:oe,values:Le}=await H();r.errors=oe,ue=Le}else await U(o);if(Tr(r.errors,"root"),$o(r.errors)){m.state.next({errors:{}});try{await k(ue,G)}catch(oe){ce=oe}}else D&&await D({...r.errors},G),Pt(),setTimeout(Pt);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:$o(r.errors)&&!ce,submitCount:r.submitCount+1,errors:r.errors}),ce)throw ce},Ye=(k,D={})=>{le(o,k)&&(cr(D.defaultValue)?me(k,Uo(le(n,k))):(me(k,D.defaultValue),vt(n,k,Uo(D.defaultValue))),D.keepTouched||Tr(r.touchedFields,k),D.keepDirty||(Tr(r.dirtyFields,k),r.isDirty=D.defaultValue?W(k,Uo(le(n,k))):W()),D.keepError||(Tr(r.errors,k),p.isValid&&b()),m.state.next({...r}))},Qt=(k,D={})=>{let G=k?Uo(k):n,ce=Uo(G),ue=$o(k),oe=ue?n:ce;if(D.keepDefaultValues||(n=G),!D.keepValues){if(D.keepDirtyValues)for(let Le of u.mount)le(r.dirtyFields,Le)?vt(oe,Le,le(a,Le)):me(Le,le(oe,Le));else{if(nm&&cr(k))for(let Le of u.mount){let et=le(o,Le);if(et&&et._f){let zt=Array.isArray(et._f.refs)?et._f.refs[0]:et._f.ref;if(s5(zt)){let ir=zt.closest("form");if(ir){ir.reset();break}}}}o={}}a=e.shouldUnregister?D.keepDefaultValues?Uo(n):{}:Uo(oe),m.array.next({values:{...oe}}),m.values.next({values:{...oe}})}u={mount:D.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!p.isValid||!!D.keepIsValid||!!D.keepDirtyValues,s.watch=!!e.shouldUnregister,m.state.next({submitCount:D.keepSubmitCount?r.submitCount:0,isDirty:ue?!1:D.keepDirty?r.isDirty:!!(D.keepDefaultValues&&!M1(k,n)),isSubmitted:D.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:ue?{}:D.keepDirtyValues?D.keepDefaultValues&&a?n5(n,a):r.dirtyFields:D.keepDefaultValues&&k?n5(n,k):D.keepDirty?r.dirtyFields:{},touchedFields:D.keepTouched?r.touchedFields:{},errors:D.keepErrors?r.errors:{},isSubmitSuccessful:D.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},fo=(k,D)=>Qt(Mi(k)?k(a):k,D);return{control:{register:qe,unregister:Rt,getFieldState:st,handleSubmit:ft,setError:St,_executeSchema:H,_getWatch:ie,_getDirty:W,_updateValid:b,_removeUnmounted:ee,_updateFieldArray:w,_updateDisabledField:xe,_getFieldArray:Y,_reset:Qt,_resetDefaultValues:()=>Mi(t.defaultValues)&&t.defaultValues().then(k=>{fo(k,t.resetOptions),m.state.next({isLoading:!1})}),_updateFormState:k=>{r={...r,...k}},_disableForm:lt,_subjects:m,_proxyFormState:p,_setErrors:_,get _fields(){return o},get _formValues(){return a},get _state(){return s},set _state(k){s=k},get _defaultValues(){return n},get _names(){return u},set _names(k){u=k},get _formState(){return r},set _formState(k){r=k},get _options(){return t},set _options(k){t={...t,...k}}},trigger:Ke,register:qe,handleSubmit:ft,watch:Lr,setValue:me,getValues:It,reset:fo,resetField:Ye,clearErrors:dt,unregister:Rt,setError:St,setFocus:(k,D={})=>{let G=le(o,k),ce=G&&G._f;if(ce){let ue=ce.refs?ce.refs[0]:ce.ref;ue.focus&&(ue.focus(),D.shouldSelect&&ue.select())}},getFieldState:st}}function p5(e={}){let t=Mt.default.useRef(),r=Mt.default.useRef(),[o,n]=Mt.default.useState({isDirty:!1,isValidating:!1,isLoading:Mi(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Mi(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...k$(e),formState:o});let a=t.current.control;return a._options=e,im({subject:a._subjects.state,next:s=>{XS(s,a._proxyFormState,a._updateFormState,!0)&&n({...a._formState})}}),Mt.default.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),Mt.default.useEffect(()=>{if(a._proxyFormState.isDirty){let s=a._getDirty();s!==o.isDirty&&a._subjects.state.next({isDirty:s})}},[a,o.isDirty]),Mt.default.useEffect(()=>{e.values&&!M1(e.values,r.current)?(a._reset(e.values,a._options.resetOptions),r.current=e.values,n(s=>({...s}))):a._resetDefaultValues()},[e.values,a]),Mt.default.useEffect(()=>{e.errors&&a._setErrors(e.errors)},[e.errors,a]),Mt.default.useEffect(()=>{a._state.mount||(a._updateValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),Mt.default.useEffect(()=>{e.shouldUnregister&&a._subjects.values.next({values:a._getWatch()})},[e.shouldUnregister,a]),t.current.formState=$S(o,a),t.current}var oR=(e,t,r)=>{if(e&&"reportValidity"in e){let o=le(r,t);e.setCustomValidity(o&&o.message||""),e.reportValidity()}},dm=(e,t)=>{for(let r in t.fields){let o=t.fields[r];o&&o.ref&&"reportValidity"in o.ref?oR(o.ref,r,e):o.refs&&o.refs.forEach(n=>oR(n,r,e))}},nR=(e,t)=>{t.shouldUseNativeValidation&&dm(e,t);let r={};for(let o in e){let n=le(t.fields,o),a=Object.assign(e[o]||{},{ref:n&&n.ref});if(E$(t.names||Object.keys(e),o)){let s=Object.assign({},le(r,o));vt(s,"root",a),vt(r,o,s)}else vt(r,o,a)}return r},E$=(e,t)=>e.some(r=>r.startsWith(t+"."));var O$=function(e,t){for(var r={};e.length;){var o=e[0],n=o.code,a=o.message,s=o.path.join(".");if(!r[s])if("unionErrors"in o){var u=o.unionErrors[0].errors[0];r[s]={message:u.message,type:u.code}}else r[s]={message:a,type:n};if("unionErrors"in o&&o.unionErrors.forEach(function(p){return p.errors.forEach(function(m){return e.push(m)})}),t){var c=r[s].types,d=c&&c[o.code];r[s]=lm(s,t,r,n,d?[].concat(d,o.message):o.message)}e.shift()}return r},m5=function(e,t,r){return r===void 0&&(r={}),function(o,n,a){try{return Promise.resolve(function(s,u){try{var c=Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](o,t)).then(function(d){return a.shouldUseNativeValidation&&dm({},a),{errors:{},values:r.raw?o:d}})}catch(d){return u(d)}return c&&c.then?c.then(void 0,u):c}(0,function(s){if(function(u){return Array.isArray(u?.errors)}(s))return{values:{},errors:nR(O$(s.errors,!a.shouldUseNativeValidation&&a.criteriaMode==="all"),a)};throw s}))}catch(s){return Promise.reject(s)}}};var ar=B(j());var h5=B(j());var aR=B(j(),1);var iR=B(Et(),1),H$="Label",sR=aR.forwardRef((e,t)=>(0,iR.jsx)(be.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));sR.displayName=H$;var fm=sR;var F$=Zn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),pm=h5.forwardRef(({className:e,...t},r)=>h5.createElement(fm,{ref:r,className:K(F$(),e),...t}));pm.displayName=fm.displayName;var lR=f5,uR=ar.createContext({}),gn=({...e})=>ar.createElement(uR.Provider,{value:{name:e.name}},ar.createElement(T1,{...e})),g5=()=>{let e=ar.useContext(uR),t=ar.useContext(cR),{getFieldState:r,formState:o}=so(),n=r(e.name,o);if(!e)throw new Error("useFormField should be used within ");let{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...n}},cR=ar.createContext({}),vn=ar.forwardRef(({className:e,...t},r)=>{let o=ar.useId();return ar.createElement(cR.Provider,{value:{id:o}},ar.createElement("div",{ref:r,className:K("space-y-2",e),...t}))});vn.displayName="FormItem";var Cn=ar.forwardRef(({className:e,...t},r)=>{let{error:o,formItemId:n}=g5();return ar.createElement(pm,{ref:r,className:K(o&&"text-destructive",e),htmlFor:n,...t})});Cn.displayName="FormLabel";var Xo=ar.forwardRef(({...e},t)=>{let{error:r,formItemId:o,formDescriptionId:n,formMessageId:a}=g5();return ar.createElement(Wo,{ref:t,id:o,"aria-describedby":r?`${n} ${a}`:`${n}`,"aria-invalid":!!r,...e})});Xo.displayName="FormControl";var Ks=ar.forwardRef(({className:e,...t},r)=>{let{formDescriptionId:o}=g5();return ar.createElement("p",{ref:r,id:o,className:K("text-sm text-muted-foreground",e),...t})});Ks.displayName="FormDescription";var P1=ar.forwardRef(({className:e,children:t,...r},o)=>{let{error:n,formMessageId:a}=g5(),s=n?String(n?.message):t;return s?ar.createElement("p",{ref:o,id:a,className:K("text-sm font-medium text-destructive",e),...r},s):null});P1.displayName="FormMessage";var v5=B(j());var lo=v5.forwardRef(({className:e,type:t,...r},o)=>v5.createElement("input",{type:t,className:K("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));lo.displayName="Input";var Ht=B(j());var fe=B(j(),1),Tm=B(Ha(),1);function Zu(e,[t,r]){return Math.min(r,Math.max(t,e))}var k1=B(j(),1);var Ti=B(j(),1),dR=B(Et(),1);function fR(e,t=[]){let r=[];function o(a,s){let u=Ti.createContext(s),c=r.length;r=[...r,s];function d(m){let{scope:v,children:x,...y}=m,g=v?.[e][c]||u,b=Ti.useMemo(()=>y,Object.values(y));return(0,dR.jsx)(g.Provider,{value:b,children:x})}function p(m,v){let x=v?.[e][c]||u,y=Ti.useContext(x);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${m}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",[d,p]}let n=()=>{let a=r.map(s=>Ti.createContext(s));return function(u){let c=u?.[e]||a;return Ti.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return n.scopeName=e,[o,D$(n,...t)]}function D$(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let o=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(a){let s=o.reduce((u,{useScope:c,scopeName:d})=>{let m=c(a)[`__scope${d}`];return{...u,...m}},{});return Ti.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var C5=B(Et(),1);function E1(e){let t=e+"CollectionProvider",[r,o]=fR(t),[n,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=x=>{let{scope:y,children:g}=x,b=k1.default.useRef(null),C=k1.default.useRef(new Map).current;return(0,C5.jsx)(n,{scope:y,itemMap:C,collectionRef:b,children:g})};s.displayName=t;let u=e+"CollectionSlot",c=k1.default.forwardRef((x,y)=>{let{scope:g,children:b}=x,C=a(u,g),w=Ue(y,C.collectionRef);return(0,C5.jsx)(Wo,{ref:w,children:b})});c.displayName=u;let d=e+"CollectionItemSlot",p="data-radix-collection-item",m=k1.default.forwardRef((x,y)=>{let{scope:g,children:b,...C}=x,w=k1.default.useRef(null),I=Ue(y,w),_=a(d,g);return k1.default.useEffect(()=>(_.itemMap.set(w,{ref:w,...C}),()=>void _.itemMap.delete(w))),(0,C5.jsx)(Wo,{[p]:"",ref:I,children:b})});m.displayName=d;function v(x){let y=a(e+"CollectionConsumer",x);return k1.default.useCallback(()=>{let b=y.collectionRef.current;if(!b)return[];let C=Array.from(b.querySelectorAll(`[${p}]`));return Array.from(y.itemMap.values()).sort((_,M)=>C.indexOf(_.ref.current)-C.indexOf(M.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:c,ItemSlot:m},v,o]}var w5=B(j(),1),N$=B(Et(),1),B$=w5.createContext(void 0);function O1(e){let t=w5.useContext(B$);return e||t||"ltr"}var wn=B(j(),1);var pR=["top","right","bottom","left"];var $a=Math.min,Lo=Math.max,b0=Math.round,L0=Math.floor,Pi=e=>({x:e,y:e}),Z$={left:"right",right:"left",bottom:"top",top:"bottom"},G$={start:"end",end:"start"};function y5(e,t,r){return Lo(e,$a(t,r))}function Xa(e,t){return typeof e=="function"?e(t):e}function qa(e){return e.split("-")[0]}function el(e){return e.split("-")[1]}function b5(e){return e==="x"?"y":"x"}function L5(e){return e==="y"?"height":"width"}function ki(e){return["top","bottom"].includes(qa(e))?"y":"x"}function I5(e){return b5(ki(e))}function mR(e,t,r){r===void 0&&(r=!1);let o=el(e),n=I5(e),a=L5(n),s=n==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=y0(s)),[s,y0(s)]}function hR(e){let t=y0(e);return[x5(e),t,x5(t)]}function x5(e){return e.replace(/start|end/g,t=>G$[t])}function W$(e,t,r){let o=["left","right"],n=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?n:o:t?o:n;case"left":case"right":return t?a:s;default:return[]}}function gR(e,t,r,o){let n=el(e),a=W$(qa(e),r==="start",o);return n&&(a=a.map(s=>s+"-"+n),t&&(a=a.concat(a.map(x5)))),a}function y0(e){return e.replace(/left|right|bottom|top/g,t=>Z$[t])}function z$(e){return{top:0,right:0,bottom:0,left:0,...e}}function mm(e){return typeof e!="number"?z$(e):{top:e,right:e,bottom:e,left:e}}function tl(e){let{x:t,y:r,width:o,height:n}=e;return{width:o,height:n,top:r,left:t,right:t+o,bottom:r+n,x:t,y:r}}function vR(e,t,r){let{reference:o,floating:n}=e,a=ki(t),s=I5(t),u=L5(s),c=qa(t),d=a==="y",p=o.x+o.width/2-n.width/2,m=o.y+o.height/2-n.height/2,v=o[u]/2-n[u]/2,x;switch(c){case"top":x={x:p,y:o.y-n.height};break;case"bottom":x={x:p,y:o.y+o.height};break;case"right":x={x:o.x+o.width,y:m};break;case"left":x={x:o.x-n.width,y:m};break;default:x={x:o.x,y:o.y}}switch(el(t)){case"start":x[s]-=v*(r&&d?-1:1);break;case"end":x[s]+=v*(r&&d?-1:1);break}return x}var xR=async(e,t,r)=>{let{placement:o="bottom",strategy:n="absolute",middleware:a=[],platform:s}=r,u=a.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t)),d=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:p,y:m}=vR(d,o,c),v=o,x={},y=0;for(let g=0;g({name:"arrow",options:e,async fn(t){let{x:r,y:o,placement:n,rects:a,platform:s,elements:u,middlewareData:c}=t,{element:d,padding:p=0}=Xa(e,t)||{};if(d==null)return{};let m=mm(p),v={x:r,y:o},x=I5(n),y=L5(x),g=await s.getDimensions(d),b=x==="y",C=b?"top":"left",w=b?"bottom":"right",I=b?"clientHeight":"clientWidth",_=a.reference[y]+a.reference[x]-v[x]-a.floating[y],M=v[x]-a.reference[x],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d)),A=E?E[I]:0;(!A||!await(s.isElement==null?void 0:s.isElement(E)))&&(A=u.floating[I]||a.floating[y]);let H=_/2-M/2,$=A/2-g[y]/2-1,U=$a(m[C],$),ee=$a(m[w],$),W=U,ie=A-g[y]-ee,Y=A/2-g[y]/2+H,ae=y5(W,Y,ie),J=!c.arrow&&el(n)!=null&&Y!==ae&&a.reference[y]/2-(YY<=0)){var ee,W;let Y=(((ee=a.flip)==null?void 0:ee.index)||0)+1,ae=A[Y];if(ae)return{data:{index:Y,overflows:U},reset:{placement:ae}};let J=(W=U.filter(me=>me.overflows[0]<=0).sort((me,se)=>me.overflows[1]-se.overflows[1])[0])==null?void 0:W.placement;if(!J)switch(x){case"bestFit":{var ie;let me=(ie=U.filter(se=>{if(E){let we=ki(se.placement);return we===w||we==="y"}return!0}).map(se=>[se.placement,se.overflows.filter(we=>we>0).reduce((we,Ke)=>we+Ke,0)]).sort((se,we)=>se[1]-we[1])[0])==null?void 0:ie[0];me&&(J=me);break}case"initialPlacement":J=u;break}if(n!==J)return{reset:{placement:J}}}return{}}}};function CR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wR(e){return pR.some(t=>e[t]>=0)}var LR=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){let{rects:r}=t,{strategy:o="referenceHidden",...n}=Xa(e,t);switch(o){case"referenceHidden":{let a=await Gu(t,{...n,elementContext:"reference"}),s=CR(a,r.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:wR(s)}}}case"escaped":{let a=await Gu(t,{...n,altBoundary:!0}),s=CR(a,r.floating);return{data:{escapedOffsets:s,escaped:wR(s)}}}default:return{}}}}};async function j$(e,t){let{placement:r,platform:o,elements:n}=e,a=await(o.isRTL==null?void 0:o.isRTL(n.floating)),s=qa(r),u=el(r),c=ki(r)==="y",d=["left","top"].includes(s)?-1:1,p=a&&c?-1:1,m=Xa(t,e),{mainAxis:v,crossAxis:x,alignmentAxis:y}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof y=="number"&&(x=u==="end"?y*-1:y),c?{x:x*p,y:v*d}:{x:v*d,y:x*p}}var IR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,o;let{x:n,y:a,placement:s,middlewareData:u}=t,c=await j$(t,e);return s===((r=u.offset)==null?void 0:r.placement)&&(o=u.arrow)!=null&&o.alignmentOffset?{}:{x:n+c.x,y:a+c.y,data:{...c,placement:s}}}}},SR=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:r,y:o,placement:n}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:u={fn:b=>{let{x:C,y:w}=b;return{x:C,y:w}}},...c}=Xa(e,t),d={x:r,y:o},p=await Gu(t,c),m=ki(qa(n)),v=b5(m),x=d[v],y=d[m];if(a){let b=v==="y"?"top":"left",C=v==="y"?"bottom":"right",w=x+p[b],I=x-p[C];x=y5(w,x,I)}if(s){let b=m==="y"?"top":"left",C=m==="y"?"bottom":"right",w=y+p[b],I=y-p[C];y=y5(w,y,I)}let g=u.fn({...t,[v]:x,[m]:y});return{...g,data:{x:g.x-r,y:g.y-o,enabled:{[v]:a,[m]:s}}}}}},RR=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:o,placement:n,rects:a,middlewareData:s}=t,{offset:u=0,mainAxis:c=!0,crossAxis:d=!0}=Xa(e,t),p={x:r,y:o},m=ki(n),v=b5(m),x=p[v],y=p[m],g=Xa(u,t),b=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){let I=v==="y"?"height":"width",_=a.reference[v]-a.floating[I]+b.mainAxis,M=a.reference[v]+a.reference[I]-b.mainAxis;x<_?x=_:x>M&&(x=M)}if(d){var C,w;let I=v==="y"?"width":"height",_=["top","left"].includes(qa(n)),M=a.reference[m]-a.floating[I]+(_&&((C=s.offset)==null?void 0:C[m])||0)+(_?0:b.crossAxis),E=a.reference[m]+a.reference[I]+(_?0:((w=s.offset)==null?void 0:w[m])||0)-(_?b.crossAxis:0);yE&&(y=E)}return{[v]:x,[m]:y}}}},_R=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,o;let{placement:n,rects:a,platform:s,elements:u}=t,{apply:c=()=>{},...d}=Xa(e,t),p=await Gu(t,d),m=qa(n),v=el(n),x=ki(n)==="y",{width:y,height:g}=a.floating,b,C;m==="top"||m==="bottom"?(b=m,C=v===(await(s.isRTL==null?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(C=m,b=v==="end"?"top":"bottom");let w=g-p.top-p.bottom,I=y-p.left-p.right,_=$a(g-p[b],w),M=$a(y-p[C],I),E=!t.middlewareData.shift,A=_,H=M;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(H=I),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(A=w),E&&!v){let U=Lo(p.left,0),ee=Lo(p.right,0),W=Lo(p.top,0),ie=Lo(p.bottom,0);x?H=y-2*(U!==0||ee!==0?U+ee:Lo(p.left,p.right)):A=g-2*(W!==0||ie!==0?W+ie:Lo(p.top,p.bottom))}await c({...t,availableWidth:H,availableHeight:A});let $=await s.getDimensions(u.floating);return y!==$.width||g!==$.height?{reset:{rects:!0}}:{}}}};function S5(){return typeof window<"u"}function ol(e){return MR(e)?(e.nodeName||"").toLowerCase():"#document"}function qo(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ma(e){var t;return(t=(MR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function MR(e){return S5()?e instanceof Node||e instanceof qo(e).Node:!1}function Wn(e){return S5()?e instanceof Element||e instanceof qo(e).Element:!1}function ha(e){return S5()?e instanceof HTMLElement||e instanceof qo(e).HTMLElement:!1}function AR(e){return!S5()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qo(e).ShadowRoot}function Wu(e){let{overflow:t,overflowX:r,overflowY:o,display:n}=zn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!["inline","contents"].includes(n)}function TR(e){return["table","td","th"].includes(ol(e))}function I0(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function R5(e){let t=_5(),r=Wn(e)?zn(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(r.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(r.contain||"").includes(o))}function PR(e){let t=Ei(e);for(;ha(t)&&!nl(t);){if(R5(t))return t;if(I0(t))return null;t=Ei(t)}return null}function _5(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function nl(e){return["html","body","#document"].includes(ol(e))}function zn(e){return qo(e).getComputedStyle(e)}function S0(e){return Wn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ei(e){if(ol(e)==="html")return e;let t=e.assignedSlot||e.parentNode||AR(e)&&e.host||ma(e);return AR(t)?t.host:t}function kR(e){let t=Ei(e);return nl(t)?e.ownerDocument?e.ownerDocument.body:e.body:ha(t)&&Wu(t)?t:kR(t)}function rl(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);let n=kR(e),a=n===((o=e.ownerDocument)==null?void 0:o.body),s=qo(n);if(a){let u=A5(s);return t.concat(s,s.visualViewport||[],Wu(n)?n:[],u&&r?rl(u):[])}return t.concat(n,rl(n,[],r))}function A5(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function HR(e){let t=zn(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,n=ha(e),a=n?e.offsetWidth:r,s=n?e.offsetHeight:o,u=b0(r)!==a||b0(o)!==s;return u&&(r=a,o=s),{width:r,height:o,$:u}}function vm(e){return Wn(e)?e:e.contextElement}function zu(e){let t=vm(e);if(!ha(t))return Pi(1);let r=t.getBoundingClientRect(),{width:o,height:n,$:a}=HR(t),s=(a?b0(r.width):r.width)/o,u=(a?b0(r.height):r.height)/n;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}var U$=Pi(0);function VR(e){let t=qo(e);return!_5()||!t.visualViewport?U$:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $$(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==qo(e)?!1:t}function al(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);let n=e.getBoundingClientRect(),a=vm(e),s=Pi(1);t&&(o?Wn(o)&&(s=zu(o)):s=zu(e));let u=$$(a,r,o)?VR(a):Pi(0),c=(n.left+u.x)/s.x,d=(n.top+u.y)/s.y,p=n.width/s.x,m=n.height/s.y;if(a){let v=qo(a),x=o&&Wn(o)?qo(o):o,y=v,g=A5(y);for(;g&&o&&x!==y;){let b=zu(g),C=g.getBoundingClientRect(),w=zn(g),I=C.left+(g.clientLeft+parseFloat(w.paddingLeft))*b.x,_=C.top+(g.clientTop+parseFloat(w.paddingTop))*b.y;c*=b.x,d*=b.y,p*=b.x,m*=b.y,c+=I,d+=_,y=qo(g),g=A5(y)}}return tl({width:p,height:m,x:c,y:d})}function X$(e){let{elements:t,rect:r,offsetParent:o,strategy:n}=e,a=n==="fixed",s=ma(o),u=t?I0(t.floating):!1;if(o===s||u&&a)return r;let c={scrollLeft:0,scrollTop:0},d=Pi(1),p=Pi(0),m=ha(o);if((m||!m&&!a)&&((ol(o)!=="body"||Wu(s))&&(c=S0(o)),ha(o))){let v=al(o);d=zu(o),p.x=v.x+o.clientLeft,p.y=v.y+o.clientTop}return{width:r.width*d.x,height:r.height*d.y,x:r.x*d.x-c.scrollLeft*d.x+p.x,y:r.y*d.y-c.scrollTop*d.y+p.y}}function q$(e){return Array.from(e.getClientRects())}function gm(e,t){let r=S0(e).scrollLeft;return t?t.left+r:al(ma(e)).left+r}function Y$(e){let t=ma(e),r=S0(e),o=e.ownerDocument.body,n=Lo(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Lo(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),s=-r.scrollLeft+gm(e),u=-r.scrollTop;return zn(o).direction==="rtl"&&(s+=Lo(t.clientWidth,o.clientWidth)-n),{width:n,height:a,x:s,y:u}}function J$(e,t){let r=qo(e),o=ma(e),n=r.visualViewport,a=o.clientWidth,s=o.clientHeight,u=0,c=0;if(n){a=n.width,s=n.height;let d=_5();(!d||d&&t==="fixed")&&(u=n.offsetLeft,c=n.offsetTop)}return{width:a,height:s,x:u,y:c}}function Q$(e,t){let r=al(e,!0,t==="fixed"),o=r.top+e.clientTop,n=r.left+e.clientLeft,a=ha(e)?zu(e):Pi(1),s=e.clientWidth*a.x,u=e.clientHeight*a.y,c=n*a.x,d=o*a.y;return{width:s,height:u,x:c,y:d}}function ER(e,t,r){let o;if(t==="viewport")o=J$(e,r);else if(t==="document")o=Y$(ma(e));else if(Wn(t))o=Q$(t,r);else{let n=VR(e);o={...t,x:t.x-n.x,y:t.y-n.y}}return tl(o)}function FR(e,t){let r=Ei(e);return r===t||!Wn(r)||nl(r)?!1:zn(r).position==="fixed"||FR(r,t)}function K$(e,t){let r=t.get(e);if(r)return r;let o=rl(e,[],!1).filter(u=>Wn(u)&&ol(u)!=="body"),n=null,a=zn(e).position==="fixed",s=a?Ei(e):e;for(;Wn(s)&&!nl(s);){let u=zn(s),c=R5(s);!c&&u.position==="fixed"&&(n=null),(a?!c&&!n:!c&&u.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||Wu(s)&&!c&&FR(e,s))?o=o.filter(p=>p!==s):n=u,s=Ei(s)}return t.set(e,o),o}function eX(e){let{element:t,boundary:r,rootBoundary:o,strategy:n}=e,s=[...r==="clippingAncestors"?I0(t)?[]:K$(t,this._c):[].concat(r),o],u=s[0],c=s.reduce((d,p)=>{let m=ER(t,p,n);return d.top=Lo(m.top,d.top),d.right=$a(m.right,d.right),d.bottom=$a(m.bottom,d.bottom),d.left=Lo(m.left,d.left),d},ER(t,u,n));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function tX(e){let{width:t,height:r}=HR(e);return{width:t,height:r}}function rX(e,t,r){let o=ha(t),n=ma(t),a=r==="fixed",s=al(e,!0,a,t),u={scrollLeft:0,scrollTop:0},c=Pi(0);if(o||!o&&!a)if((ol(t)!=="body"||Wu(n))&&(u=S0(t)),o){let x=al(t,!0,a,t);c.x=x.x+t.clientLeft,c.y=x.y+t.clientTop}else n&&(c.x=gm(n));let d=0,p=0;if(n&&!o&&!a){let x=n.getBoundingClientRect();p=x.top+u.scrollTop,d=x.left+u.scrollLeft-gm(n,x)}let m=s.left+u.scrollLeft-c.x-d,v=s.top+u.scrollTop-c.y-p;return{x:m,y:v,width:s.width,height:s.height}}function hm(e){return zn(e).position==="static"}function OR(e,t){if(!ha(e)||zn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ma(e)===r&&(r=r.ownerDocument.body),r}function DR(e,t){let r=qo(e);if(I0(e))return r;if(!ha(e)){let n=Ei(e);for(;n&&!nl(n);){if(Wn(n)&&!hm(n))return n;n=Ei(n)}return r}let o=OR(e,t);for(;o&&TR(o)&&hm(o);)o=OR(o,t);return o&&nl(o)&&hm(o)&&!R5(o)?r:o||PR(e)||r}var oX=async function(e){let t=this.getOffsetParent||DR,r=this.getDimensions,o=await r(e.floating);return{reference:rX(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function nX(e){return zn(e).direction==="rtl"}var NR={convertOffsetParentRelativeRectToViewportRelativeRect:X$,getDocumentElement:ma,getClippingRect:eX,getOffsetParent:DR,getElementRects:oX,getClientRects:q$,getDimensions:tX,getScale:zu,isElement:Wn,isRTL:nX};function aX(e,t){let r=null,o,n=ma(e);function a(){var u;clearTimeout(o),(u=r)==null||u.disconnect(),r=null}function s(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),a();let{left:d,top:p,width:m,height:v}=e.getBoundingClientRect();if(u||t(),!m||!v)return;let x=L0(p),y=L0(n.clientWidth-(d+m)),g=L0(n.clientHeight-(p+v)),b=L0(d),w={rootMargin:-x+"px "+-y+"px "+-g+"px "+-b+"px",threshold:Lo(0,$a(1,c))||1},I=!0;function _(M){let E=M[0].intersectionRatio;if(E!==c){if(!I)return s();E?s(!1,E):o=setTimeout(()=>{s(!1,1e-7)},1e3)}I=!1}try{r=new IntersectionObserver(_,{...w,root:n.ownerDocument})}catch{r=new IntersectionObserver(_,w)}r.observe(e)}return s(!0),a}function R0(e,t,r,o){o===void 0&&(o={});let{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=vm(e),p=n||a?[...d?rl(d):[],...rl(t)]:[];p.forEach(C=>{n&&C.addEventListener("scroll",r,{passive:!0}),a&&C.addEventListener("resize",r)});let m=d&&u?aX(d,r):null,v=-1,x=null;s&&(x=new ResizeObserver(C=>{let[w]=C;w&&w.target===d&&x&&(x.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var I;(I=x)==null||I.observe(t)})),r()}),d&&!c&&x.observe(d),x.observe(t));let y,g=c?al(e):null;c&&b();function b(){let C=al(e);g&&(C.x!==g.x||C.y!==g.y||C.width!==g.width||C.height!==g.height)&&r(),g=C,y=requestAnimationFrame(b)}return r(),()=>{var C;p.forEach(w=>{n&&w.removeEventListener("scroll",r),a&&w.removeEventListener("resize",r)}),m?.(),(C=x)==null||C.disconnect(),x=null,c&&cancelAnimationFrame(y)}}var BR=IR;var ZR=SR,GR=bR,WR=_R,zR=LR,Cm=yR;var jR=RR,wm=(e,t,r)=>{let o=new Map,n={platform:NR,...r},a={...n.platform,_c:o};return xR(e,t,{...n,platform:a})};var yr=B(j(),1),P5=B(j(),1),$R=B(Ha(),1),M5=typeof document<"u"?P5.useLayoutEffect:P5.useEffect;function T5(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,o,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!T5(e[o],t[o]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,n[o]))return!1;for(o=r;o--!==0;){let a=n[o];if(!(a==="_owner"&&e.$$typeof)&&!T5(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function XR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function UR(e,t){let r=XR(e);return Math.round(t*r)/r}function xm(e){let t=yr.useRef(e);return M5(()=>{t.current=e}),t}function qR(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:n,elements:{reference:a,floating:s}={},transform:u=!0,whileElementsMounted:c,open:d}=e,[p,m]=yr.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[v,x]=yr.useState(o);T5(v,o)||x(o);let[y,g]=yr.useState(null),[b,C]=yr.useState(null),w=yr.useCallback(se=>{se!==E.current&&(E.current=se,g(se))},[]),I=yr.useCallback(se=>{se!==A.current&&(A.current=se,C(se))},[]),_=a||y,M=s||b,E=yr.useRef(null),A=yr.useRef(null),H=yr.useRef(p),$=c!=null,U=xm(c),ee=xm(n),W=xm(d),ie=yr.useCallback(()=>{if(!E.current||!A.current)return;let se={placement:t,strategy:r,middleware:v};ee.current&&(se.platform=ee.current),wm(E.current,A.current,se).then(we=>{let Ke={...we,isPositioned:W.current!==!1};Y.current&&!T5(H.current,Ke)&&(H.current=Ke,$R.flushSync(()=>{m(Ke)}))})},[v,t,r,ee,W]);M5(()=>{d===!1&&H.current.isPositioned&&(H.current.isPositioned=!1,m(se=>({...se,isPositioned:!1})))},[d]);let Y=yr.useRef(!1);M5(()=>(Y.current=!0,()=>{Y.current=!1}),[]),M5(()=>{if(_&&(E.current=_),M&&(A.current=M),_&&M){if(U.current)return U.current(_,M,ie);ie()}},[_,M,ie,U,$]);let ae=yr.useMemo(()=>({reference:E,floating:A,setReference:w,setFloating:I}),[w,I]),J=yr.useMemo(()=>({reference:_,floating:M}),[_,M]),me=yr.useMemo(()=>{let se={position:r,left:0,top:0};if(!J.floating)return se;let we=UR(J.floating,p.x),Ke=UR(J.floating,p.y);return u?{...se,transform:"translate("+we+"px, "+Ke+"px)",...XR(J.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:we,top:Ke}},[r,u,J.floating,p.x,p.y]);return yr.useMemo(()=>({...p,update:ie,refs:ae,elements:J,floatingStyles:me}),[p,ie,ae,J,me])}var iX=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){let{element:o,padding:n}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?Cm({element:o.current,padding:n}).fn(r):{}:o?Cm({element:o,padding:n}).fn(r):{}}}},YR=(e,t)=>({...BR(e),options:[e,t]}),JR=(e,t)=>({...ZR(e),options:[e,t]}),QR=(e,t)=>({...jR(e),options:[e,t]}),KR=(e,t)=>({...GR(e),options:[e,t]}),e_=(e,t)=>({...WR(e),options:[e,t]});var t_=(e,t)=>({...zR(e),options:[e,t]});var r_=(e,t)=>({...iX(e),options:[e,t]});var o_=B(j(),1);var ym=B(Et(),1),sX="Arrow",n_=o_.forwardRef((e,t)=>{let{children:r,width:o=10,height:n=5,...a}=e;return(0,ym.jsx)(be.svg,{...a,ref:t,width:o,height:n,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,ym.jsx)("polygon",{points:"0,0 30,0 15,10"})})});n_.displayName=sX;var a_=n_;var Oi=B(j(),1),i_=B(Et(),1);function s_(e,t=[]){let r=[];function o(a,s){let u=Oi.createContext(s),c=r.length;r=[...r,s];function d(m){let{scope:v,children:x,...y}=m,g=v?.[e][c]||u,b=Oi.useMemo(()=>y,Object.values(y));return(0,i_.jsx)(g.Provider,{value:b,children:x})}function p(m,v){let x=v?.[e][c]||u,y=Oi.useContext(x);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${m}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",[d,p]}let n=()=>{let a=r.map(s=>Oi.createContext(s));return function(u){let c=u?.[e]||a;return Oi.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return n.scopeName=e,[o,uX(n,...t)]}function uX(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let o=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(a){let s=o.reduce((u,{useScope:c,scopeName:d})=>{let m=c(a)[`__scope${d}`];return{...u,...m}},{});return Oi.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var H1=B(Et(),1);var bm="Popper",[l_,Lm]=s_(bm),[cX,u_]=l_(bm),c_=e=>{let{__scopePopper:t,children:r}=e,[o,n]=wn.useState(null);return(0,H1.jsx)(cX,{scope:t,anchor:o,onAnchorChange:n,children:r})};c_.displayName=bm;var d_="PopperAnchor",f_=wn.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:o,...n}=e,a=u_(d_,r),s=wn.useRef(null),u=Ue(t,s);return wn.useEffect(()=>{a.onAnchorChange(o?.current||s.current)}),o?null:(0,H1.jsx)(be.div,{...n,ref:u})});f_.displayName=d_;var Im="PopperContent",[dX,fX]=l_(Im),p_=wn.forwardRef((e,t)=>{let{__scopePopper:r,side:o="bottom",sideOffset:n=0,align:a="center",alignOffset:s=0,arrowPadding:u=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:m="partial",hideWhenDetached:v=!1,updatePositionStrategy:x="optimized",onPlaced:y,...g}=e,b=u_(Im,r),[C,w]=wn.useState(null),I=Ue(t,xe=>w(xe)),[_,M]=wn.useState(null),E=Pu(_),A=E?.width??0,H=E?.height??0,$=o+(a!=="center"?"-"+a:""),U=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},ee=Array.isArray(d)?d:[d],W=ee.length>0,ie={padding:U,boundary:ee.filter(mX),altBoundary:W},{refs:Y,floatingStyles:ae,placement:J,isPositioned:me,middlewareData:se}=qR({strategy:"fixed",placement:$,whileElementsMounted:(...xe)=>R0(...xe,{animationFrame:x==="always"}),elements:{reference:b.anchor},middleware:[YR({mainAxis:n+H,alignmentAxis:s}),c&&JR({mainAxis:!0,crossAxis:!1,limiter:m==="partial"?QR():void 0,...ie}),c&&KR({...ie}),e_({...ie,apply:({elements:xe,rects:qe,availableWidth:Pt,availableHeight:lt})=>{let{width:ft,height:Ye}=qe.reference,Qt=xe.floating.style;Qt.setProperty("--radix-popper-available-width",`${Pt}px`),Qt.setProperty("--radix-popper-available-height",`${lt}px`),Qt.setProperty("--radix-popper-anchor-width",`${ft}px`),Qt.setProperty("--radix-popper-anchor-height",`${Ye}px`)}}),_&&r_({element:_,padding:u}),hX({arrowWidth:A,arrowHeight:H}),v&&t_({strategy:"referenceHidden",...ie})]}),[we,Ke]=g_(J),It=ur(y);or(()=>{me&&It?.()},[me,It]);let st=se.arrow?.x,dt=se.arrow?.y,St=se.arrow?.centerOffset!==0,[Lr,Rt]=wn.useState();return or(()=>{C&&Rt(window.getComputedStyle(C).zIndex)},[C]),(0,H1.jsx)("div",{ref:Y.setFloating,"data-radix-popper-content-wrapper":"",style:{...ae,transform:me?ae.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Lr,"--radix-popper-transform-origin":[se.transformOrigin?.x,se.transformOrigin?.y].join(" "),...se.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,H1.jsx)(dX,{scope:r,placedSide:we,onArrowChange:M,arrowX:st,arrowY:dt,shouldHideArrow:St,children:(0,H1.jsx)(be.div,{"data-side":we,"data-align":Ke,...g,ref:I,style:{...g.style,animation:me?void 0:"none"}})})})});p_.displayName=Im;var m_="PopperArrow",pX={top:"bottom",right:"left",bottom:"top",left:"right"},h_=wn.forwardRef(function(t,r){let{__scopePopper:o,...n}=t,a=fX(m_,o),s=pX[a.placedSide];return(0,H1.jsx)("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:(0,H1.jsx)(a_,{...n,ref:r,style:{...n.style,display:"block"}})})});h_.displayName=m_;function mX(e){return e!==null}var hX=e=>({name:"transformOrigin",options:e,fn(t){let{placement:r,rects:o,middlewareData:n}=t,s=n.arrow?.centerOffset!==0,u=s?0:e.arrowWidth,c=s?0:e.arrowHeight,[d,p]=g_(r),m={start:"0%",center:"50%",end:"100%"}[p],v=(n.arrow?.x??0)+u/2,x=(n.arrow?.y??0)+c/2,y="",g="";return d==="bottom"?(y=s?m:`${v}px`,g=`${-c}px`):d==="top"?(y=s?m:`${v}px`,g=`${o.floating.height+c}px`):d==="right"?(y=`${-c}px`,g=s?m:`${x}px`):d==="left"&&(y=`${o.floating.width+c}px`,g=s?m:`${x}px`),{data:{x:y,y:g}}}});function g_(e){let[t,r="center"]=e.split("-");return[t,r]}var v_=c_,C_=f_,w_=p_,x_=h_;var y_=B(j(),1);var b_=B(Et(),1),vX="VisuallyHidden",ju=y_.forwardRef((e,t)=>(0,b_.jsx)(be.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));ju.displayName=vX;var Ae=B(Et(),1),CX=[" ","Enter","ArrowUp","ArrowDown"],wX=[" ","Enter"],A0="Select",[E5,O5,xX]=E1(A0),[Uu,Kle]=Wa(A0,[xX,Lm]),H5=Lm(),[yX,V1]=Uu(A0),[bX,LX]=Uu(A0),L_=e=>{let{__scopeSelect:t,children:r,open:o,defaultOpen:n,onOpenChange:a,value:s,defaultValue:u,onValueChange:c,dir:d,name:p,autoComplete:m,disabled:v,required:x,form:y}=e,g=H5(t),[b,C]=fe.useState(null),[w,I]=fe.useState(null),[_,M]=fe.useState(!1),E=O1(d),[A=!1,H]=Nr({prop:o,defaultProp:n,onChange:a}),[$,U]=Nr({prop:s,defaultProp:u,onChange:c}),ee=fe.useRef(null),W=b?y||!!b.closest("form"):!0,[ie,Y]=fe.useState(new Set),ae=Array.from(ie).map(J=>J.props.value).join(";");return(0,Ae.jsx)(v_,{...g,children:(0,Ae.jsxs)(yX,{required:x,scope:t,trigger:b,onTriggerChange:C,valueNode:w,onValueNodeChange:I,valueNodeHasChildren:_,onValueNodeHasChildrenChange:M,contentId:ja(),value:$,onValueChange:U,open:A,onOpenChange:H,dir:E,triggerPointerDownPosRef:ee,disabled:v,children:[(0,Ae.jsx)(E5.Provider,{scope:t,children:(0,Ae.jsx)(bX,{scope:e.__scopeSelect,onNativeOptionAdd:fe.useCallback(J=>{Y(me=>new Set(me).add(J))},[]),onNativeOptionRemove:fe.useCallback(J=>{Y(me=>{let se=new Set(me);return se.delete(J),se})},[]),children:r})}),W?(0,Ae.jsxs)(X_,{"aria-hidden":!0,required:x,tabIndex:-1,name:p,autoComplete:m,value:$,onChange:J=>U(J.target.value),disabled:v,form:y,children:[$===void 0?(0,Ae.jsx)("option",{value:""}):null,Array.from(ie)]},ae):null]})})};L_.displayName=A0;var I_="SelectTrigger",S_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,disabled:o=!1,...n}=e,a=H5(r),s=V1(I_,r),u=s.disabled||o,c=Ue(t,s.onTriggerChange),d=O5(r),p=fe.useRef("touch"),[m,v,x]=q_(g=>{let b=d().filter(I=>!I.disabled),C=b.find(I=>I.value===s.value),w=Y_(b,g,C);w!==void 0&&s.onValueChange(w.value)}),y=g=>{u||(s.onOpenChange(!0),x()),g&&(s.triggerPointerDownPosRef.current={x:Math.round(g.pageX),y:Math.round(g.pageY)})};return(0,Ae.jsx)(C_,{asChild:!0,...a,children:(0,Ae.jsx)(be.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":$_(s.value)?"":void 0,...n,ref:c,onClick:Se(n.onClick,g=>{g.currentTarget.focus(),p.current!=="mouse"&&y(g)}),onPointerDown:Se(n.onPointerDown,g=>{p.current=g.pointerType;let b=g.target;b.hasPointerCapture(g.pointerId)&&b.releasePointerCapture(g.pointerId),g.button===0&&g.ctrlKey===!1&&g.pointerType==="mouse"&&(y(g),g.preventDefault())}),onKeyDown:Se(n.onKeyDown,g=>{let b=m.current!=="";!(g.ctrlKey||g.altKey||g.metaKey)&&g.key.length===1&&v(g.key),!(b&&g.key===" ")&&CX.includes(g.key)&&(y(),g.preventDefault())})})})});S_.displayName=I_;var R_="SelectValue",__=fe.forwardRef((e,t)=>{let{__scopeSelect:r,className:o,style:n,children:a,placeholder:s="",...u}=e,c=V1(R_,r),{onValueNodeHasChildrenChange:d}=c,p=a!==void 0,m=Ue(t,c.onValueNodeChange);return or(()=>{d(p)},[d,p]),(0,Ae.jsx)(be.span,{...u,ref:m,style:{pointerEvents:"none"},children:$_(c.value)?(0,Ae.jsx)(Ae.Fragment,{children:s}):a})});__.displayName=R_;var IX="SelectIcon",A_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,children:o,...n}=e;return(0,Ae.jsx)(be.span,{"aria-hidden":!0,...n,ref:t,children:o||"\u25BC"})});A_.displayName=IX;var SX="SelectPortal",M_=e=>(0,Ae.jsx)($s,{asChild:!0,...e});M_.displayName=SX;var il="SelectContent",T_=fe.forwardRef((e,t)=>{let r=V1(il,e.__scopeSelect),[o,n]=fe.useState();if(or(()=>{n(new DocumentFragment)},[]),!r.open){let a=o;return a?Tm.createPortal((0,Ae.jsx)(P_,{scope:e.__scopeSelect,children:(0,Ae.jsx)(E5.Slot,{scope:e.__scopeSelect,children:(0,Ae.jsx)("div",{children:e.children})})}),a):null}return(0,Ae.jsx)(k_,{...e,ref:t})});T_.displayName=il;var ga=10,[P_,F1]=Uu(il),RX="SelectContentImpl",k_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:a,onPointerDownOutside:s,side:u,sideOffset:c,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:x,sticky:y,hideWhenDetached:g,avoidCollisions:b,...C}=e,w=V1(il,r),[I,_]=fe.useState(null),[M,E]=fe.useState(null),A=Ue(t,xe=>_(xe)),[H,$]=fe.useState(null),[U,ee]=fe.useState(null),W=O5(r),[ie,Y]=fe.useState(!1),ae=fe.useRef(!1);fe.useEffect(()=>{if(I)return e5(I)},[I]),j9();let J=fe.useCallback(xe=>{let[qe,...Pt]=W().map(Ye=>Ye.ref.current),[lt]=Pt.slice(-1),ft=document.activeElement;for(let Ye of xe)if(Ye===ft||(Ye?.scrollIntoView({block:"nearest"}),Ye===qe&&M&&(M.scrollTop=0),Ye===lt&&M&&(M.scrollTop=M.scrollHeight),Ye?.focus(),document.activeElement!==ft))return},[W,M]),me=fe.useCallback(()=>J([H,I]),[J,H,I]);fe.useEffect(()=>{ie&&me()},[ie,me]);let{onOpenChange:se,triggerPointerDownPosRef:we}=w;fe.useEffect(()=>{if(I){let xe={x:0,y:0},qe=lt=>{xe={x:Math.abs(Math.round(lt.pageX)-(we.current?.x??0)),y:Math.abs(Math.round(lt.pageY)-(we.current?.y??0))}},Pt=lt=>{xe.x<=10&&xe.y<=10?lt.preventDefault():I.contains(lt.target)||se(!1),document.removeEventListener("pointermove",qe),we.current=null};return we.current!==null&&(document.addEventListener("pointermove",qe),document.addEventListener("pointerup",Pt,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",qe),document.removeEventListener("pointerup",Pt,{capture:!0})}}},[I,se,we]),fe.useEffect(()=>{let xe=()=>se(!1);return window.addEventListener("blur",xe),window.addEventListener("resize",xe),()=>{window.removeEventListener("blur",xe),window.removeEventListener("resize",xe)}},[se]);let[Ke,It]=q_(xe=>{let qe=W().filter(ft=>!ft.disabled),Pt=qe.find(ft=>ft.ref.current===document.activeElement),lt=Y_(qe,xe,Pt);lt&&setTimeout(()=>lt.ref.current.focus())}),st=fe.useCallback((xe,qe,Pt)=>{let lt=!ae.current&&!Pt;(w.value!==void 0&&w.value===qe||lt)&&($(xe),lt&&(ae.current=!0))},[w.value]),dt=fe.useCallback(()=>I?.focus(),[I]),St=fe.useCallback((xe,qe,Pt)=>{let lt=!ae.current&&!Pt;(w.value!==void 0&&w.value===qe||lt)&&ee(xe)},[w.value]),Lr=o==="popper"?Sm:E_,Rt=Lr===Sm?{side:u,sideOffset:c,align:d,alignOffset:p,arrowPadding:m,collisionBoundary:v,collisionPadding:x,sticky:y,hideWhenDetached:g,avoidCollisions:b}:{};return(0,Ae.jsx)(P_,{scope:r,content:I,viewport:M,onViewportChange:E,itemRefCallback:st,selectedItem:H,onItemLeave:dt,itemTextRefCallback:St,focusSelectedItem:me,selectedItemText:U,position:o,isPositioned:ie,searchRef:Ke,children:(0,Ae.jsx)(p0,{as:Wo,allowPinchZoom:!0,children:(0,Ae.jsx)(u0,{asChild:!0,trapped:w.open,onMountAutoFocus:xe=>{xe.preventDefault()},onUnmountAutoFocus:Se(n,xe=>{w.trigger?.focus({preventScroll:!0}),xe.preventDefault()}),children:(0,Ae.jsx)(Eu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:xe=>xe.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:(0,Ae.jsx)(Lr,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:xe=>xe.preventDefault(),...C,...Rt,onPlaced:()=>Y(!0),ref:A,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:Se(C.onKeyDown,xe=>{let qe=xe.ctrlKey||xe.altKey||xe.metaKey;if(xe.key==="Tab"&&xe.preventDefault(),!qe&&xe.key.length===1&&It(xe.key),["ArrowUp","ArrowDown","Home","End"].includes(xe.key)){let lt=W().filter(ft=>!ft.disabled).map(ft=>ft.ref.current);if(["ArrowUp","End"].includes(xe.key)&&(lt=lt.slice().reverse()),["ArrowUp","ArrowDown"].includes(xe.key)){let ft=xe.target,Ye=lt.indexOf(ft);lt=lt.slice(Ye+1)}setTimeout(()=>J(lt)),xe.preventDefault()}})})})})})})});k_.displayName=RX;var _X="SelectItemAlignedPosition",E_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:o,...n}=e,a=V1(il,r),s=F1(il,r),[u,c]=fe.useState(null),[d,p]=fe.useState(null),m=Ue(t,A=>p(A)),v=O5(r),x=fe.useRef(!1),y=fe.useRef(!0),{viewport:g,selectedItem:b,selectedItemText:C,focusSelectedItem:w}=s,I=fe.useCallback(()=>{if(a.trigger&&a.valueNode&&u&&d&&g&&b&&C){let A=a.trigger.getBoundingClientRect(),H=d.getBoundingClientRect(),$=a.valueNode.getBoundingClientRect(),U=C.getBoundingClientRect();if(a.dir!=="rtl"){let ft=U.left-H.left,Ye=$.left-ft,Qt=A.left-Ye,fo=A.width+Qt,Jr=Math.max(fo,H.width),J1=window.innerWidth-ga,vl=Zu(Ye,[ga,Math.max(ga,J1-Jr)]);u.style.minWidth=fo+"px",u.style.left=vl+"px"}else{let ft=H.right-U.right,Ye=window.innerWidth-$.right-ft,Qt=window.innerWidth-A.right-Ye,fo=A.width+Qt,Jr=Math.max(fo,H.width),J1=window.innerWidth-ga,vl=Zu(Ye,[ga,Math.max(ga,J1-Jr)]);u.style.minWidth=fo+"px",u.style.right=vl+"px"}let ee=v(),W=window.innerHeight-ga*2,ie=g.scrollHeight,Y=window.getComputedStyle(d),ae=parseInt(Y.borderTopWidth,10),J=parseInt(Y.paddingTop,10),me=parseInt(Y.borderBottomWidth,10),se=parseInt(Y.paddingBottom,10),we=ae+J+ie+se+me,Ke=Math.min(b.offsetHeight*5,we),It=window.getComputedStyle(g),st=parseInt(It.paddingTop,10),dt=parseInt(It.paddingBottom,10),St=A.top+A.height/2-ga,Lr=W-St,Rt=b.offsetHeight/2,xe=b.offsetTop+Rt,qe=ae+J+xe,Pt=we-qe;if(qe<=St){let ft=ee.length>0&&b===ee[ee.length-1].ref.current;u.style.bottom="0px";let Ye=d.clientHeight-g.offsetTop-g.offsetHeight,Qt=Math.max(Lr,Rt+(ft?dt:0)+Ye+me),fo=qe+Qt;u.style.height=fo+"px"}else{let ft=ee.length>0&&b===ee[0].ref.current;u.style.top="0px";let Qt=Math.max(St,ae+g.offsetTop+(ft?st:0)+Rt)+Pt;u.style.height=Qt+"px",g.scrollTop=qe-St+g.offsetTop}u.style.margin=`${ga}px 0`,u.style.minHeight=Ke+"px",u.style.maxHeight=W+"px",o?.(),requestAnimationFrame(()=>x.current=!0)}},[v,a.trigger,a.valueNode,u,d,g,b,C,a.dir,o]);or(()=>I(),[I]);let[_,M]=fe.useState();or(()=>{d&&M(window.getComputedStyle(d).zIndex)},[d]);let E=fe.useCallback(A=>{A&&y.current===!0&&(I(),w?.(),y.current=!1)},[I,w]);return(0,Ae.jsx)(MX,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:x,onScrollButtonChange:E,children:(0,Ae.jsx)("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:(0,Ae.jsx)(be.div,{...n,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});E_.displayName=_X;var AX="SelectPopperPosition",Sm=fe.forwardRef((e,t)=>{let{__scopeSelect:r,align:o="start",collisionPadding:n=ga,...a}=e,s=H5(r);return(0,Ae.jsx)(w_,{...s,...a,ref:t,align:o,collisionPadding:n,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Sm.displayName=AX;var[MX,Pm]=Uu(il,{}),Rm="SelectViewport",O_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,nonce:o,...n}=e,a=F1(Rm,r),s=Pm(Rm,r),u=Ue(t,a.onViewportChange),c=fe.useRef(0);return(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),(0,Ae.jsx)(E5.Slot,{scope:r,children:(0,Ae.jsx)(be.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:Se(n.onScroll,d=>{let p=d.currentTarget,{contentWrapper:m,shouldExpandOnScrollRef:v}=s;if(v?.current&&m){let x=Math.abs(c.current-p.scrollTop);if(x>0){let y=window.innerHeight-ga*2,g=parseFloat(m.style.minHeight),b=parseFloat(m.style.height),C=Math.max(g,b);if(C0?_:0,m.style.justifyContent="flex-end")}}}c.current=p.scrollTop})})})]})});O_.displayName=Rm;var H_="SelectGroup",[TX,PX]=Uu(H_),kX=fe.forwardRef((e,t)=>{let{__scopeSelect:r,...o}=e,n=ja();return(0,Ae.jsx)(TX,{scope:r,id:n,children:(0,Ae.jsx)(be.div,{role:"group","aria-labelledby":n,...o,ref:t})})});kX.displayName=H_;var V_="SelectLabel",F_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,...o}=e,n=PX(V_,r);return(0,Ae.jsx)(be.div,{id:n.id,...o,ref:t})});F_.displayName=V_;var k5="SelectItem",[EX,D_]=Uu(k5),N_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,value:o,disabled:n=!1,textValue:a,...s}=e,u=V1(k5,r),c=F1(k5,r),d=u.value===o,[p,m]=fe.useState(a??""),[v,x]=fe.useState(!1),y=Ue(t,w=>c.itemRefCallback?.(w,o,n)),g=ja(),b=fe.useRef("touch"),C=()=>{n||(u.onValueChange(o),u.onOpenChange(!1))};if(o==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,Ae.jsx)(EX,{scope:r,value:o,disabled:n,textId:g,isSelected:d,onItemTextChange:fe.useCallback(w=>{m(I=>I||(w?.textContent??"").trim())},[]),children:(0,Ae.jsx)(E5.ItemSlot,{scope:r,value:o,disabled:n,textValue:p,children:(0,Ae.jsx)(be.div,{role:"option","aria-labelledby":g,"data-highlighted":v?"":void 0,"aria-selected":d&&v,"data-state":d?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:y,onFocus:Se(s.onFocus,()=>x(!0)),onBlur:Se(s.onBlur,()=>x(!1)),onClick:Se(s.onClick,()=>{b.current!=="mouse"&&C()}),onPointerUp:Se(s.onPointerUp,()=>{b.current==="mouse"&&C()}),onPointerDown:Se(s.onPointerDown,w=>{b.current=w.pointerType}),onPointerMove:Se(s.onPointerMove,w=>{b.current=w.pointerType,n?c.onItemLeave?.():b.current==="mouse"&&w.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(s.onPointerLeave,w=>{w.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Se(s.onKeyDown,w=>{c.searchRef?.current!==""&&w.key===" "||(wX.includes(w.key)&&C(),w.key===" "&&w.preventDefault())})})})})});N_.displayName=k5;var _0="SelectItemText",B_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,className:o,style:n,...a}=e,s=V1(_0,r),u=F1(_0,r),c=D_(_0,r),d=LX(_0,r),[p,m]=fe.useState(null),v=Ue(t,C=>m(C),c.onItemTextChange,C=>u.itemTextRefCallback?.(C,c.value,c.disabled)),x=p?.textContent,y=fe.useMemo(()=>(0,Ae.jsx)("option",{value:c.value,disabled:c.disabled,children:x},c.value),[c.disabled,c.value,x]),{onNativeOptionAdd:g,onNativeOptionRemove:b}=d;return or(()=>(g(y),()=>b(y)),[g,b,y]),(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)(be.span,{id:c.textId,...a,ref:v}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?Tm.createPortal(a.children,s.valueNode):null]})});B_.displayName=_0;var Z_="SelectItemIndicator",G_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,...o}=e;return D_(Z_,r).isSelected?(0,Ae.jsx)(be.span,{"aria-hidden":!0,...o,ref:t}):null});G_.displayName=Z_;var _m="SelectScrollUpButton",W_=fe.forwardRef((e,t)=>{let r=F1(_m,e.__scopeSelect),o=Pm(_m,e.__scopeSelect),[n,a]=fe.useState(!1),s=Ue(t,o.onScrollButtonChange);return or(()=>{if(r.viewport&&r.isPositioned){let c=function(){let p=d.scrollTop>0;a(p)};var u=c;let d=r.viewport;return c(),d.addEventListener("scroll",c),()=>d.removeEventListener("scroll",c)}},[r.viewport,r.isPositioned]),n?(0,Ae.jsx)(j_,{...e,ref:s,onAutoScroll:()=>{let{viewport:u,selectedItem:c}=r;u&&c&&(u.scrollTop=u.scrollTop-c.offsetHeight)}}):null});W_.displayName=_m;var Am="SelectScrollDownButton",z_=fe.forwardRef((e,t)=>{let r=F1(Am,e.__scopeSelect),o=Pm(Am,e.__scopeSelect),[n,a]=fe.useState(!1),s=Ue(t,o.onScrollButtonChange);return or(()=>{if(r.viewport&&r.isPositioned){let c=function(){let p=d.scrollHeight-d.clientHeight,m=Math.ceil(d.scrollTop)d.removeEventListener("scroll",c)}},[r.viewport,r.isPositioned]),n?(0,Ae.jsx)(j_,{...e,ref:s,onAutoScroll:()=>{let{viewport:u,selectedItem:c}=r;u&&c&&(u.scrollTop=u.scrollTop+c.offsetHeight)}}):null});z_.displayName=Am;var j_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,onAutoScroll:o,...n}=e,a=F1("SelectScrollButton",r),s=fe.useRef(null),u=O5(r),c=fe.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return fe.useEffect(()=>()=>c(),[c]),or(()=>{u().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),(0,Ae.jsx)(be.div,{"aria-hidden":!0,...n,ref:t,style:{flexShrink:0,...n.style},onPointerDown:Se(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:Se(n.onPointerMove,()=>{a.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:Se(n.onPointerLeave,()=>{c()})})}),OX="SelectSeparator",U_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,...o}=e;return(0,Ae.jsx)(be.div,{"aria-hidden":!0,...o,ref:t})});U_.displayName=OX;var Mm="SelectArrow",HX=fe.forwardRef((e,t)=>{let{__scopeSelect:r,...o}=e,n=H5(r),a=V1(Mm,r),s=F1(Mm,r);return a.open&&s.position==="popper"?(0,Ae.jsx)(x_,{...n,...o,ref:t}):null});HX.displayName=Mm;function $_(e){return e===""||e===void 0}var X_=fe.forwardRef((e,t)=>{let{value:r,...o}=e,n=fe.useRef(null),a=Ue(t,n),s=Tu(r);return fe.useEffect(()=>{let u=n.current,c=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(c,"value").set;if(s!==r&&p){let m=new Event("change",{bubbles:!0});p.call(u,r),u.dispatchEvent(m)}},[s,r]),(0,Ae.jsx)(ju,{asChild:!0,children:(0,Ae.jsx)("select",{...o,ref:a,defaultValue:r})})});X_.displayName="BubbleSelect";function q_(e){let t=ur(e),r=fe.useRef(""),o=fe.useRef(0),n=fe.useCallback(s=>{let u=r.current+s;t(u),function c(d){r.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>c(""),1e3))}(u)},[t]),a=fe.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return fe.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,n,a]}function Y_(e,t,r){let n=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=r?e.indexOf(r):-1,s=VX(e,Math.max(a,0));n.length===1&&(s=s.filter(d=>d!==r));let c=s.find(d=>d.textValue.toLowerCase().startsWith(n.toLowerCase()));return c!==r?c:void 0}function VX(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var J_=L_,km=S_,Q_=__,K_=A_,eA=M_,Em=T_,tA=O_;var Om=F_,Hm=N_,rA=B_,oA=G_,Vm=W_,Fm=z_,Dm=U_;var sl=J_;var ll=Q_,D1=Ht.forwardRef(({className:e,children:t,...r},o)=>Ht.createElement(km,{ref:o,className:K("flex min-h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r},t,Ht.createElement(K_,{asChild:!0},Ht.createElement(_u,{className:"h-4 w-4 opacity-50"}))));D1.displayName=km.displayName;var nA=Ht.forwardRef(({className:e,...t},r)=>Ht.createElement(Vm,{ref:r,className:K("flex cursor-default items-center justify-center py-1",e),...t},Ht.createElement(e0,{className:"h-4 w-4"})));nA.displayName=Vm.displayName;var aA=Ht.forwardRef(({className:e,...t},r)=>Ht.createElement(Fm,{ref:r,className:K("flex cursor-default items-center justify-center py-1",e),...t},Ht.createElement(_u,{className:"h-4 w-4"})));aA.displayName=Fm.displayName;var N1=Ht.forwardRef(({className:e,children:t,position:r="popper",...o},n)=>Ht.createElement(eA,null,Ht.createElement(Em,{ref:n,className:K("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...o},Ht.createElement(nA,null),Ht.createElement(tA,{className:K("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},t),Ht.createElement(aA,null))));N1.displayName=Em.displayName;var DX=Ht.forwardRef(({className:e,...t},r)=>Ht.createElement(Om,{ref:r,className:K("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));DX.displayName=Om.displayName;var B1=Ht.forwardRef(({className:e,children:t,...r},o)=>Ht.createElement(Hm,{ref:o,className:K("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r},Ht.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},Ht.createElement(oA,null,Ht.createElement(Kd,{className:"h-4 w-4"}))),Ht.createElement(rA,null,t)));B1.displayName=Hm.displayName;var NX=Ht.forwardRef(({className:e,...t},r)=>Ht.createElement(Dm,{ref:r,className:K("-mx-1 my-1 h-px bg-muted",e),...t}));NX.displayName=Dm.displayName;var Ca=B(j());var va=B(j(),1);var Hi=B(j(),1),iA=B(Et(),1);function sA(e,t=[]){let r=[];function o(a,s){let u=Hi.createContext(s),c=r.length;r=[...r,s];function d(m){let{scope:v,children:x,...y}=m,g=v?.[e][c]||u,b=Hi.useMemo(()=>y,Object.values(y));return(0,iA.jsx)(g.Provider,{value:b,children:x})}function p(m,v){let x=v?.[e][c]||u,y=Hi.useContext(x);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${m}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",[d,p]}let n=()=>{let a=r.map(s=>Hi.createContext(s));return function(u){let c=u?.[e]||a;return Hi.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return n.scopeName=e,[o,BX(n,...t)]}function BX(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let o=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(a){let s=o.reduce((u,{useScope:c,scopeName:d})=>{let m=c(a)[`__scope${d}`];return{...u,...m}},{});return Hi.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Zr=B(j(),1);var Vi=B(j(),1),lA=B(Et(),1);function uA(e,t=[]){let r=[];function o(a,s){let u=Vi.createContext(s),c=r.length;r=[...r,s];function d(m){let{scope:v,children:x,...y}=m,g=v?.[e][c]||u,b=Vi.useMemo(()=>y,Object.values(y));return(0,lA.jsx)(g.Provider,{value:b,children:x})}function p(m,v){let x=v?.[e][c]||u,y=Vi.useContext(x);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${m}\` must be used within \`${a}\``)}return d.displayName=a+"Provider",[d,p]}let n=()=>{let a=r.map(s=>Vi.createContext(s));return function(u){let c=u?.[e]||a;return Vi.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return n.scopeName=e,[o,ZX(n,...t)]}function ZX(...e){let t=e[0];if(e.length===1)return t;let r=()=>{let o=e.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(a){let s=o.reduce((u,{useScope:c,scopeName:d})=>{let m=c(a)[`__scope${d}`];return{...u,...m}},{});return Vi.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Z1=B(Et(),1),Nm="rovingFocusGroup.onEntryFocus",GX={bubbles:!1,cancelable:!0},V5="RovingFocusGroup",[Bm,cA,WX]=E1(V5),[zX,Zm]=uA(V5,[WX]),[jX,UX]=zX(V5),dA=Zr.forwardRef((e,t)=>(0,Z1.jsx)(Bm.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,Z1.jsx)(Bm.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,Z1.jsx)($X,{...e,ref:t})})}));dA.displayName=V5;var $X=Zr.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:o,loop:n=!1,dir:a,currentTabStopId:s,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...m}=e,v=Zr.useRef(null),x=Ue(t,v),y=O1(a),[g=null,b]=Nr({prop:s,defaultProp:u,onChange:c}),[C,w]=Zr.useState(!1),I=ur(d),_=cA(r),M=Zr.useRef(!1),[E,A]=Zr.useState(0);return Zr.useEffect(()=>{let H=v.current;if(H)return H.addEventListener(Nm,I),()=>H.removeEventListener(Nm,I)},[I]),(0,Z1.jsx)(jX,{scope:r,orientation:o,dir:y,loop:n,currentTabStopId:g,onItemFocus:Zr.useCallback(H=>b(H),[b]),onItemShiftTab:Zr.useCallback(()=>w(!0),[]),onFocusableItemAdd:Zr.useCallback(()=>A(H=>H+1),[]),onFocusableItemRemove:Zr.useCallback(()=>A(H=>H-1),[]),children:(0,Z1.jsx)(be.div,{tabIndex:C||E===0?-1:0,"data-orientation":o,...m,ref:x,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{M.current=!0}),onFocus:Se(e.onFocus,H=>{let $=!M.current;if(H.target===H.currentTarget&&$&&!C){let U=new CustomEvent(Nm,GX);if(H.currentTarget.dispatchEvent(U),!U.defaultPrevented){let ee=_().filter(J=>J.focusable),W=ee.find(J=>J.active),ie=ee.find(J=>J.id===g),ae=[W,ie,...ee].filter(Boolean).map(J=>J.ref.current);mA(ae,p)}}M.current=!1}),onBlur:Se(e.onBlur,()=>w(!1))})})}),fA="RovingFocusGroupItem",pA=Zr.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:o=!0,active:n=!1,tabStopId:a,...s}=e,u=ja(),c=a||u,d=UX(fA,r),p=d.currentTabStopId===c,m=cA(r),{onFocusableItemAdd:v,onFocusableItemRemove:x}=d;return Zr.useEffect(()=>{if(o)return v(),()=>x()},[o,v,x]),(0,Z1.jsx)(Bm.ItemSlot,{scope:r,id:c,focusable:o,active:n,children:(0,Z1.jsx)(be.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:Se(e.onMouseDown,y=>{o?d.onItemFocus(c):y.preventDefault()}),onFocus:Se(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:Se(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){d.onItemShiftTab();return}if(y.target!==y.currentTarget)return;let g=YX(y,d.orientation,d.dir);if(g!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let C=m().filter(w=>w.focusable).map(w=>w.ref.current);if(g==="last")C.reverse();else if(g==="prev"||g==="next"){g==="prev"&&C.reverse();let w=C.indexOf(y.currentTarget);C=d.loop?JX(C,w+1):C.slice(w+1)}setTimeout(()=>mA(C))}})})})});pA.displayName=fA;var XX={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function qX(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function YX(e,t,r){let o=qX(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return XX[o]}function mA(e,t=!1){let r=document.activeElement;for(let o of e)if(o===r||(o.focus({preventScroll:t}),document.activeElement!==r))return}function JX(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var hA=dA,gA=pA;var vA=B(j(),1);var CA=B(Et(),1),KX="Toggle",F5=vA.forwardRef((e,t)=>{let{pressed:r,defaultPressed:o=!1,onPressedChange:n,...a}=e,[s=!1,u]=Nr({prop:r,onChange:n,defaultProp:o});return(0,CA.jsx)(be.button,{type:"button","aria-pressed":s,"data-state":s?"on":"off","data-disabled":e.disabled?"":void 0,...a,ref:t,onClick:Se(e.onClick,()=>{e.disabled||u(!s)})})});F5.displayName=KX;var Gm=F5;var Io=B(Et(),1),$u="ToggleGroup",[xA,Iue]=sA($u,[Zm]),yA=Zm(),Wm=va.default.forwardRef((e,t)=>{let{type:r,...o}=e;if(r==="single")return(0,Io.jsx)(tq,{...o,ref:t});if(r==="multiple")return(0,Io.jsx)(rq,{...o,ref:t});throw new Error(`Missing prop \`type\` expected on \`${$u}\``)});Wm.displayName=$u;var[bA,LA]=xA($u),tq=va.default.forwardRef((e,t)=>{let{value:r,defaultValue:o,onValueChange:n=()=>{},...a}=e,[s,u]=Nr({prop:r,defaultProp:o,onChange:n});return(0,Io.jsx)(bA,{scope:e.__scopeToggleGroup,type:"single",value:s?[s]:[],onItemActivate:u,onItemDeactivate:va.default.useCallback(()=>u(""),[u]),children:(0,Io.jsx)(IA,{...a,ref:t})})}),rq=va.default.forwardRef((e,t)=>{let{value:r,defaultValue:o,onValueChange:n=()=>{},...a}=e,[s=[],u]=Nr({prop:r,defaultProp:o,onChange:n}),c=va.default.useCallback(p=>u((m=[])=>[...m,p]),[u]),d=va.default.useCallback(p=>u((m=[])=>m.filter(v=>v!==p)),[u]);return(0,Io.jsx)(bA,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:c,onItemDeactivate:d,children:(0,Io.jsx)(IA,{...a,ref:t})})});Wm.displayName=$u;var[oq,nq]=xA($u),IA=va.default.forwardRef((e,t)=>{let{__scopeToggleGroup:r,disabled:o=!1,rovingFocus:n=!0,orientation:a,dir:s,loop:u=!0,...c}=e,d=yA(r),p=O1(s),m={role:"group",dir:p,...c};return(0,Io.jsx)(oq,{scope:r,rovingFocus:n,disabled:o,children:n?(0,Io.jsx)(hA,{asChild:!0,...d,orientation:a,dir:p,loop:u,children:(0,Io.jsx)(be.div,{...m,ref:t})}):(0,Io.jsx)(be.div,{...m,ref:t})})}),D5="ToggleGroupItem",SA=va.default.forwardRef((e,t)=>{let r=LA(D5,e.__scopeToggleGroup),o=nq(D5,e.__scopeToggleGroup),n=yA(e.__scopeToggleGroup),a=r.value.includes(e.value),s=o.disabled||e.disabled,u={...e,pressed:a,disabled:s},c=va.default.useRef(null);return o.rovingFocus?(0,Io.jsx)(gA,{asChild:!0,...n,focusable:!s,active:a,ref:c,children:(0,Io.jsx)(wA,{...u,ref:t})}):(0,Io.jsx)(wA,{...u,ref:t})});SA.displayName=D5;var wA=va.default.forwardRef((e,t)=>{let{__scopeToggleGroup:r,value:o,...n}=e,a=LA(D5,r),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},u=a.type==="single"?s:void 0;return(0,Io.jsx)(F5,{...u,...n,ref:t,onPressedChange:c=>{c?a.onItemActivate(o):a.onItemDeactivate(o)}})}),zm=Wm,jm=SA;var N5=B(j());var Um=Zn("inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground"},size:{default:"h-10 px-3",sm:"h-9 px-2.5",lg:"h-11 px-5"}},defaultVariants:{variant:"default",size:"default"}}),iq=N5.forwardRef(({className:e,variant:t,size:r,...o},n)=>N5.createElement(Gm,{ref:n,className:K(Um({variant:t,size:r,className:e})),...o}));iq.displayName=Gm.displayName;var RA=Ca.createContext({size:"default",variant:"default"}),Yo=Ca.forwardRef(({className:e,variant:t,size:r,children:o,...n},a)=>Ca.createElement(zm,{ref:a,className:K("flex items-center gap-1",e),...n},Ca.createElement(RA.Provider,{value:{variant:t,size:r}},o)));Yo.displayName=zm.displayName;var qr=Ca.forwardRef(({className:e,children:t,variant:r,size:o,...n},a)=>{let s=Ca.useContext(RA);return Ca.createElement(jm,{ref:a,className:K(Um({variant:s.variant||r,size:s.size||o}),e),...n},t)});qr.displayName=jm.displayName;var B5={rgbw:"Compatible with FUT014, FUT016, FUT103, FUT005, FUT006, FUT007 bulbs.",cct:"Compatible with FUT011, FUT017, FUT019 bulbs.",rgb_cct:"Compatible with FUT012, FUT013, FUT014, FUT015, FUT103, FUT104, FUT105, and many RGB/CCT LED Strip Controllers.",rgb:"Compatible with most RGB LED Strip Controllers.",fut089:"Compatible with most newer RGB + dual white bulbs and controllers.",fut091:"Compatible with most newer dual white bulbs and controllers.",fut020:"Compatible with some RGB LED strip controllers."},Z5={rgbw:{brightness:!0,color:!0,colorTemp:!1},cct:{brightness:!0,color:!1,colorTemp:!0},rgb_cct:{brightness:!0,color:!0,colorTemp:!0},rgb:{brightness:!0,color:!0,colorTemp:!1},fut089:{brightness:!0,color:!0,colorTemp:!0},fut091:{brightness:!0,color:!1,colorTemp:!0},fut020:{brightness:!0,color:!0,colorTemp:!1}};var sq=P.object({name:P.string().min(1,{message:"Name is required."}),device_type:P.nativeEnum(rt.RemoteType.Values),device_id:P.string().regex(/^(0x[0-9A-Fa-f]+|[0-9]+)$/,{message:"Invalid device ID format. It should be a hexadecimal number starting with 0x or a decimal number."}),group_id:P.number().int().min(0).max(8)});function lq({onSubmit:e}){let t=p5({resolver:m5(sq),defaultValues:{group_id:0}}),r=a=>{let s=Su(a.device_id),u={...a,alias:a.name,device_id:s};e(u)},o=t.watch("device_type"),n=Ru(o);return nt.default.createElement(lR,{...t},nt.default.createElement("form",{onSubmit:t.handleSubmit(r),className:"space-y-8"},nt.default.createElement(gn,{control:t.control,name:"name",render:({field:a})=>nt.default.createElement(vn,null,nt.default.createElement(Cn,null,"Name"),nt.default.createElement(Xo,null,nt.default.createElement(lo,{autoComplete:"off",placeholder:"Name for this light",...a})),nt.default.createElement(P1,null))}),nt.default.createElement(gn,{control:t.control,name:"device_type",render:({field:a})=>nt.default.createElement(vn,null,nt.default.createElement(Cn,null,"Remote Type"),nt.default.createElement(sl,{onValueChange:a.onChange,defaultValue:a.value},nt.default.createElement(Xo,null,nt.default.createElement(D1,null,nt.default.createElement(ll,{placeholder:"Select a remote type"}))),nt.default.createElement(N1,{className:"max-w-96"},Object.values(rt.RemoteType.Values).map(s=>nt.default.createElement(B1,{key:s,value:s,className:"group"},nt.default.createElement("div",{className:"flex flex-col items-start max-w-72"},nt.default.createElement("div",{className:"font-medium"},s),nt.default.createElement("div",{className:"text-sm text-muted-foreground break-words w-full text-left"},B5[s])))))),nt.default.createElement(P1,null))}),nt.default.createElement(gn,{control:t.control,name:"device_id",render:({field:a})=>nt.default.createElement(vn,null,nt.default.createElement(Cn,null,"Device ID"),nt.default.createElement(Xo,null,nt.default.createElement(lo,{type:"text",autoComplete:"off",placeholder:"Enter device ID",...a})),nt.default.createElement(P1,null))}),nt.default.createElement(gn,{control:t.control,name:"group_id",render:({field:a})=>nt.default.createElement(vn,null,nt.default.createElement(Cn,null,"Group ID"),nt.default.createElement(Xo,null,nt.default.createElement(Yo,{type:"single",variant:"outline",value:a.value.toString(),onValueChange:s=>a.onChange(parseInt(s,10))},Array.from({length:n},(s,u)=>nt.default.createElement(qr,{key:u,value:(u+1).toString()},u+1)))),nt.default.createElement(P1,null))}),nt.default.createElement(yt,{type:"submit"},"Submit")))}var _A=lq;var kr=B(j());var MA=B(j());var ul=B(j());function AA(e,t){let[r,o]=(0,ul.useState)({value:e,serial:0}),n=(0,ul.useRef)(null),a=(0,ul.useRef)(0);return(0,ul.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]),[r,c=>{let d=Date.now(),p=d-a.current,m=v=>{a.current=d;let x=typeof c=="function"?c(v.value):c;return{value:typeof v.value=="object"&&typeof x=="object"?{...v.value,...x}:x,serial:v.serial+1}};p>=t?o(m):(n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{o(m)},t-p))},()=>{o({value:e,serial:0}),a.current=0,n.current&&clearTimeout(n.current)}]}var uq="/",G1=DL(uq);function G5(e,t){let[r,o,n]=AA({},500),a=(0,MA.useRef)(0),s=async c=>{let d=await G1.putGatewaysDeviceIdRemoteTypeGroupId(c,{params:{remoteType:e.device_type,deviceId:e.device_id,groupId:e.group_id},queries:{fmt:"normalized",blockOnQueue:!0}});d&&t(d)};return{updateState:c=>{t(c);let d=Date.now();d-a.current>=500?(s(c),a.current=d,n()):o(p=>({...p,...c}))},rateLimitedState:r,sendUpdate:s,clearRateLimitedState:n}}var He=B(j());var cl=B(j());var Nt=B(j(),1);var Pr=B(Et(),1),TA=["PageUp","PageDown"],PA=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],kA={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Xu="Slider",[$m,cq,dq]=E1(Xu),[EA,ice]=Wa(Xu,[dq]),[fq,W5]=EA(Xu),OA=Nt.forwardRef((e,t)=>{let{name:r,min:o=0,max:n=100,step:a=1,orientation:s="horizontal",disabled:u=!1,minStepsBetweenThumbs:c=0,defaultValue:d=[o],value:p,onValueChange:m=()=>{},onValueCommit:v=()=>{},inverted:x=!1,form:y,...g}=e,b=Nt.useRef(new Set),C=Nt.useRef(0),I=s==="horizontal"?pq:mq,[_=[],M]=Nr({prop:p,defaultProp:d,onChange:ee=>{[...b.current][C.current]?.focus(),m(ee)}}),E=Nt.useRef(_);function A(ee){let W=wq(_,ee);U(ee,W)}function H(ee){U(ee,C.current)}function $(){let ee=E.current[C.current];_[C.current]!==ee&&v(_)}function U(ee,W,{commit:ie}={commit:!1}){let Y=Lq(a),ae=Iq(Math.round((ee-o)/a)*a+o,Y),J=Zu(ae,[o,n]);M((me=[])=>{let se=vq(me,J,W);if(bq(se,c*a)){C.current=se.indexOf(J);let we=String(se)!==String(me);return we&&ie&&v(se),we?se:me}else return me})}return(0,Pr.jsx)(fq,{scope:e.__scopeSlider,name:r,disabled:u,min:o,max:n,valueIndexToChangeRef:C,thumbs:b.current,values:_,orientation:s,form:y,children:(0,Pr.jsx)($m.Provider,{scope:e.__scopeSlider,children:(0,Pr.jsx)($m.Slot,{scope:e.__scopeSlider,children:(0,Pr.jsx)(I,{"aria-disabled":u,"data-disabled":u?"":void 0,...g,ref:t,onPointerDown:Se(g.onPointerDown,()=>{u||(E.current=_)}),min:o,max:n,inverted:x,onSlideStart:u?void 0:A,onSlideMove:u?void 0:H,onSlideEnd:u?void 0:$,onHomeKeyDown:()=>!u&&U(o,0,{commit:!0}),onEndKeyDown:()=>!u&&U(n,_.length-1,{commit:!0}),onStepKeyDown:({event:ee,direction:W})=>{if(!u){let ae=TA.includes(ee.key)||ee.shiftKey&&PA.includes(ee.key)?10:1,J=C.current,me=_[J],se=a*ae*W;U(me+se,J,{commit:!0})}}})})})})});OA.displayName=Xu;var[HA,VA]=EA(Xu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),pq=Nt.forwardRef((e,t)=>{let{min:r,max:o,dir:n,inverted:a,onSlideStart:s,onSlideMove:u,onSlideEnd:c,onStepKeyDown:d,...p}=e,[m,v]=Nt.useState(null),x=Ue(t,I=>v(I)),y=Nt.useRef(),g=O1(n),b=g==="ltr",C=b&&!a||!b&&a;function w(I){let _=y.current||m.getBoundingClientRect(),M=[0,_.width],A=Ym(M,C?[r,o]:[o,r]);return y.current=_,A(I-_.left)}return(0,Pr.jsx)(HA,{scope:e.__scopeSlider,startEdge:C?"left":"right",endEdge:C?"right":"left",direction:C?1:-1,size:"width",children:(0,Pr.jsx)(FA,{dir:g,"data-orientation":"horizontal",...p,ref:x,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:I=>{let _=w(I.clientX);s?.(_)},onSlideMove:I=>{let _=w(I.clientX);u?.(_)},onSlideEnd:()=>{y.current=void 0,c?.()},onStepKeyDown:I=>{let M=kA[C?"from-left":"from-right"].includes(I.key);d?.({event:I,direction:M?-1:1})}})})}),mq=Nt.forwardRef((e,t)=>{let{min:r,max:o,inverted:n,onSlideStart:a,onSlideMove:s,onSlideEnd:u,onStepKeyDown:c,...d}=e,p=Nt.useRef(null),m=Ue(t,p),v=Nt.useRef(),x=!n;function y(g){let b=v.current||p.current.getBoundingClientRect(),C=[0,b.height],I=Ym(C,x?[o,r]:[r,o]);return v.current=b,I(g-b.top)}return(0,Pr.jsx)(HA,{scope:e.__scopeSlider,startEdge:x?"bottom":"top",endEdge:x?"top":"bottom",size:"height",direction:x?1:-1,children:(0,Pr.jsx)(FA,{"data-orientation":"vertical",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:g=>{let b=y(g.clientY);a?.(b)},onSlideMove:g=>{let b=y(g.clientY);s?.(b)},onSlideEnd:()=>{v.current=void 0,u?.()},onStepKeyDown:g=>{let C=kA[x?"from-bottom":"from-top"].includes(g.key);c?.({event:g,direction:C?-1:1})}})})}),FA=Nt.forwardRef((e,t)=>{let{__scopeSlider:r,onSlideStart:o,onSlideMove:n,onSlideEnd:a,onHomeKeyDown:s,onEndKeyDown:u,onStepKeyDown:c,...d}=e,p=W5(Xu,r);return(0,Pr.jsx)(be.span,{...d,ref:t,onKeyDown:Se(e.onKeyDown,m=>{m.key==="Home"?(s(m),m.preventDefault()):m.key==="End"?(u(m),m.preventDefault()):TA.concat(PA).includes(m.key)&&(c(m),m.preventDefault())}),onPointerDown:Se(e.onPointerDown,m=>{let v=m.target;v.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(v)?v.focus():o(m)}),onPointerMove:Se(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&n(m)}),onPointerUp:Se(e.onPointerUp,m=>{let v=m.target;v.hasPointerCapture(m.pointerId)&&(v.releasePointerCapture(m.pointerId),a(m))})})}),DA="SliderTrack",NA=Nt.forwardRef((e,t)=>{let{__scopeSlider:r,...o}=e,n=W5(DA,r);return(0,Pr.jsx)(be.span,{"data-disabled":n.disabled?"":void 0,"data-orientation":n.orientation,...o,ref:t})});NA.displayName=DA;var Xm="SliderRange",BA=Nt.forwardRef((e,t)=>{let{__scopeSlider:r,...o}=e,n=W5(Xm,r),a=VA(Xm,r),s=Nt.useRef(null),u=Ue(t,s),c=n.values.length,d=n.values.map(v=>GA(v,n.min,n.max)),p=c>1?Math.min(...d):0,m=100-Math.max(...d);return(0,Pr.jsx)(be.span,{"data-orientation":n.orientation,"data-disabled":n.disabled?"":void 0,...o,ref:u,style:{...e.style,[a.startEdge]:p+"%",[a.endEdge]:m+"%"}})});BA.displayName=Xm;var qm="SliderThumb",ZA=Nt.forwardRef((e,t)=>{let r=cq(e.__scopeSlider),[o,n]=Nt.useState(null),a=Ue(t,u=>n(u)),s=Nt.useMemo(()=>o?r().findIndex(u=>u.ref.current===o):-1,[r,o]);return(0,Pr.jsx)(hq,{...e,ref:a,index:s})}),hq=Nt.forwardRef((e,t)=>{let{__scopeSlider:r,index:o,name:n,...a}=e,s=W5(qm,r),u=VA(qm,r),[c,d]=Nt.useState(null),p=Ue(t,w=>d(w)),m=c?s.form||!!c.closest("form"):!0,v=Pu(c),x=s.values[o],y=x===void 0?0:GA(x,s.min,s.max),g=Cq(o,s.values.length),b=v?.[u.size],C=b?xq(b,y,u.direction):0;return Nt.useEffect(()=>{if(c)return s.thumbs.add(c),()=>{s.thumbs.delete(c)}},[c,s.thumbs]),(0,Pr.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${y}% + ${C}px)`},children:[(0,Pr.jsx)($m.ItemSlot,{scope:e.__scopeSlider,children:(0,Pr.jsx)(be.span,{role:"slider","aria-label":e["aria-label"]||g,"aria-valuemin":s.min,"aria-valuenow":x,"aria-valuemax":s.max,"aria-orientation":s.orientation,"data-orientation":s.orientation,"data-disabled":s.disabled?"":void 0,tabIndex:s.disabled?void 0:0,...a,ref:p,style:x===void 0?{display:"none"}:e.style,onFocus:Se(e.onFocus,()=>{s.valueIndexToChangeRef.current=o})})}),m&&(0,Pr.jsx)(gq,{name:n??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:x},o)]})});ZA.displayName=qm;var gq=e=>{let{value:t,...r}=e,o=Nt.useRef(null),n=Tu(t);return Nt.useEffect(()=>{let a=o.current,s=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(s,"value").set;if(n!==t&&c){let d=new Event("input",{bubbles:!0});c.call(a,t),a.dispatchEvent(d)}},[n,t]),(0,Pr.jsx)("input",{style:{display:"none"},...r,ref:o,defaultValue:t})};function vq(e=[],t,r){let o=[...e];return o[r]=t,o.sort((n,a)=>n-a)}function GA(e,t,r){let a=100/(r-t)*(e-t);return Zu(a,[0,100])}function Cq(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function wq(e,t){if(e.length===1)return 0;let r=e.map(n=>Math.abs(n-t)),o=Math.min(...r);return r.indexOf(o)}function xq(e,t,r){let o=e/2,a=Ym([0,50],[0,o]);return(o-a(t)*r)*r}function yq(e){return e.slice(0,-1).map((t,r)=>e[r+1]-t)}function bq(e,t){if(t>0){let r=yq(e);return Math.min(...r)>=t}return!0}function Ym(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(r-e[0])}}function Lq(e){return(String(e).split(".")[1]||"").length}function Iq(e,t){let r=Math.pow(10,t);return Math.round(e*r)/r}var Jm=OA,WA=NA,zA=BA,jA=ZA;var z5=cl.forwardRef(({className:e,gradient:t,...r},o)=>cl.createElement(Jm,{ref:o,className:K("relative flex w-full touch-none select-none items-center cursor-pointer",e),...r},cl.createElement(WA,{className:K("relative h-2 w-full grow overflow-hidden rounded-full",t?"":"bg-secondary"),style:{background:t}},cl.createElement(zA,{className:K("absolute",t?"":"h-full bg-primary")})),cl.createElement(jA,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})));z5.displayName=Jm.displayName;function Ce(){return Ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{r:t,g:r,b:o,a:n}=e,a=Math.max(t,r,o),s=a-Math.min(t,r,o),u=s?a===t?(r-o)/s:a===r?2+(o-t)/s:4+(t-r)/s:0;return{h:60*(u<0?u+6:u),s:a?s/a*W1:0,v:a/Yu*W1,a:n}};var Rq=e=>{var{h:t,s:r,v:o,a:n}=e,a=(200-r)*o/W1;return{h:t,s:a>0&&a<200?r*o/W1/(a<=W1?a:200-a)*W1:0,l:a/2,a:n}};var fce={grad:Qm/400,turn:Qm,rad:Qm/(Math.PI*2)};var UA=e=>{var{r:t,g:r,b:o}=e,n=t<<16|r<<8|o;return"#"+(a=>new Array(7-a.length).join("0")+a)(n.toString(16))},_q=e=>{var{r:t,g:r,b:o,a:n}=e,a=typeof n=="number"&&(n*255|256).toString(16).slice(1);return""+UA({r:t,g:r,b:o,a:n})+(a||"")},eh=e=>Km(Aq(e)),Aq=e=>{var t=e.replace("#","");/^#?/.test(e)&&t.length===3&&(e="#"+t.charAt(0)+t.charAt(0)+t.charAt(1)+t.charAt(1)+t.charAt(2)+t.charAt(2));var r=new RegExp("[A-Za-z0-9]{2}","g"),[o,n,a=0,s]=e.match(r).map(u=>parseInt(u,16));return{r:o,g:n,b:a,a:(s??255)/Yu}},j5=e=>{var{h:t,s:r,v:o,a:n}=e,a=t/60,s=r/W1,u=o/W1,c=Math.floor(a)%6,d=a-Math.floor(a),p=Yu*u*(1-s),m=Yu*u*(1-s*d),v=Yu*u*(1-s*(1-d));u*=Yu;var x={};switch(c){case 0:x.r=u,x.g=v,x.b=p;break;case 1:x.r=m,x.g=u,x.b=p;break;case 2:x.r=p,x.g=u,x.b=v;break;case 3:x.r=p,x.g=m,x.b=u;break;case 4:x.r=v,x.g=p,x.b=u;break;case 5:x.r=u,x.g=p,x.b=m;break}return x.r=Math.round(x.r),x.g=Math.round(x.g),x.b=Math.round(x.b),Ce({},x,{a:n})};var Mq=e=>{var{r:t,g:r,b:o}=e;return{r:t,g:r,b:o}},Tq=e=>{var{h:t,s:r,l:o}=e;return{h:t,s:r,l:o}},th=e=>UA(j5(e));var Pq=e=>{var{h:t,s:r,v:o}=e;return{h:t,s:r,v:o}};var kq=e=>{var{r:t,g:r,b:o}=e,n=function(p){return p<=.04045?p/12.92:Math.pow((p+.055)/1.055,2.4)},a=n(t/255),s=n(r/255),u=n(o/255),c={};return c.x=a*.4124+s*.3576+u*.1805,c.y=a*.2126+s*.7152+u*.0722,c.bri=a*.0193+s*.1192+u*.9505,c},$A=e=>{var t,r,o,n,a,s,u,c,d;return typeof e=="string"&&rh(e)?(s=eh(e),c=e):typeof e!="string"&&(s=e),s&&(o=Pq(s),a=Rq(s),n=j5(s),d=_q(n),c=th(s),r=Tq(a),t=Mq(n),u=kq(t)),{rgb:t,hsl:r,hsv:o,rgba:n,hsla:a,hsva:s,hex:c,hexa:d,xy:u}};var rh=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);var Jo=B(j());var Ju=B(j());function oh(e){var t=(0,Ju.useRef)(e);return(0,Ju.useEffect)(()=>{t.current=e}),(0,Ju.useCallback)((r,o)=>t.current&&t.current(r,o),[])}var Qu=e=>"touches"in e,nh=e=>{!Qu(e)&&e.preventDefault&&e.preventDefault()},XA=function(t,r,o){return r===void 0&&(r=0),o===void 0&&(o=1),t>o?o:t{var r=e.getBoundingClientRect(),o=Qu(t)?t.touches[0]:t;return{left:XA((o.pageX-(r.left+window.pageXOffset))/r.width),top:XA((o.pageY-(r.top+window.pageYOffset))/r.height),width:r.width,height:r.height,x:o.pageX-(r.left+window.pageXOffset),y:o.pageY-(r.top+window.pageYOffset)}};var qA=B(Et()),Eq=["prefixCls","className","onMove","onDown"],YA=Jo.default.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:o,onMove:n,onDown:a}=e,s=qu(e,Eq),u=(0,Jo.useRef)(null),c=(0,Jo.useRef)(!1),[d,p]=(0,Jo.useState)(!1),m=oh(n),v=oh(a),x=w=>c.current&&!Qu(w)?!1:(c.current=Qu(w),!0),y=(0,Jo.useCallback)(w=>{nh(w);var I=Qu(w)?w.touches.length>0:w.buttons>0;I&&u.current?m&&m(ah(u.current,w),w):p(!1)},[m]),g=(0,Jo.useCallback)(()=>p(!1),[]),b=(0,Jo.useCallback)(w=>{var I=w?window.addEventListener:window.removeEventListener;I(c.current?"touchmove":"mousemove",y),I(c.current?"touchend":"mouseup",g)},[]);(0,Jo.useEffect)(()=>(b(d),()=>{d&&b(!1)}),[d,b]);var C=(0,Jo.useCallback)(w=>{nh(w.nativeEvent),x(w.nativeEvent)&&(v&&v(ah(u.current,w.nativeEvent),w.nativeEvent),p(!0))},[v]);return(0,qA.jsx)("div",Ce({},s,{className:[r,o||""].filter(Boolean).join(" "),style:Ce({},s.style,{touchAction:"none"}),ref:u,tabIndex:0,onMouseDown:C,onTouchStart:C}))});YA.displayName="Interactive";var JA=YA;var yce=B(j()),U5=B(Et()),Oq="rgb(255 255 255) 0px 0px 0px 1.5px, rgb(0 0 0 / 30%) 0px 0px 1px 1px inset, rgb(0 0 0 / 40%) 0px 0px 1px 2px",QA=e=>{var{className:t,color:r,left:o,top:n,style:a,prefixCls:s}=e,u=Ce({},a,{position:"absolute",top:n,left:o}),c=s+"-pointer "+(t||"");return(0,U5.jsx)("div",{className:c,style:u,children:(0,U5.jsx)("div",{className:s+"-fill",style:{width:10,height:10,transform:"translate(-5px, -5px)",boxShadow:Oq,borderRadius:"50%",backgroundColor:"#fff"},children:(0,U5.jsx)("div",{style:{inset:0,borderRadius:"50%",position:"absolute",backgroundColor:r}})})})};var KA=Math.PI*2,Hq=(e,t)=>(e%t+t)%t,Vq=(e,t)=>Math.sqrt(e*e+t*t);function eM(e){var{width:t=0}=e,r=t/2;return{width:t,radius:r,cx:r,cy:r}}function tM(e,t){var{cx:r,cy:o}=eM(e),n=rM(e),a=(180+oM(e,t.h,!0))*(KA/360),s=t.s/100*n,u=e.direction==="clockwise"?-1:1;return{x:r+s*Math.cos(a)*u,y:o+s*Math.sin(a)*u}}function rM(e){var{width:t=0}=e;return t/2}function oM(e,t,r){var o=e.angle||0,n=e.direction;return r&&n==="clockwise"?t=o+t:n==="clockwise"?t=360-o+t:r&&n==="anticlockwise"?t=o+180-t:n==="anticlockwise"&&(t=o-t),Hq(t,360)}function nM(e,t,r){var{cx:o,cy:n}=eM(e),a=rM(e);t=o-t,r=n-r;var s=oM(e,Math.atan2(-r,-t)*(360/KA)),u=Math.min(Vq(t,r),a);return{h:Math.round(s),s:Math.round(100/a*u)}}var dl=B(Et()),Fq=["prefixCls","radius","pointer","className","style","width","height","oval","direction","angle","color","onChange"],Dq="conic-gradient(red, yellow, lime, aqua, blue, magenta, red)",Nq="conic-gradient(red, magenta, blue, aqua, lime, yellow, red)",iM=aM.default.forwardRef((e,t)=>{var{prefixCls:r="w-color-wheel",radius:o=0,pointer:n,className:a,style:s,width:u=200,height:c=200,oval:d,direction:p="anticlockwise",angle:m=180,color:v,onChange:x}=e,y=qu(e,Fq),g=typeof v=="string"&&rh(v)?eh(v):v||{},b=v?th(g):"",C=tM({width:u},g),w={top:"0",left:"0",color:b},I=(E,A)=>{var H=nM({width:u},u-E.x,c-E.y),$={h:H.h,s:H.s,v:g.v,a:g.a};x&&x($A($))},_={zIndex:1,transform:"translate("+C.x+"px, "+C.y+"px) "+(d==="x"||d==="X"?"scaleY(2)":d==="y"||d==="Y"?"scaleX(2)":"")},M=n&&typeof n=="function"?n(Ce({prefixCls:r,style:_},w)):(0,dl.jsx)(QA,Ce({prefixCls:r,style:_},w));return(0,dl.jsxs)(JA,Ce({className:[r,a||""].filter(Boolean).join(" ")},y,{style:Ce({position:"relative",width:u,transform:d==="x"||d==="X"?"scaleY(0.5)":d==="y"||d==="Y"?"scaleX(0.5)":"",height:c},s),ref:t,onMove:I,onDown:I,children:[M,(0,dl.jsx)("div",{style:{position:"absolute",borderRadius:"50%",background:p==="anticlockwise"?Dq:Nq,transform:"rotateZ("+(m+90)+"deg)",inset:0}}),(0,dl.jsx)("div",{style:{position:"absolute",borderRadius:"50%",background:"radial-gradient(circle closest-side, #fff, transparent)",inset:0}}),(0,dl.jsx)("div",{style:{backgroundColor:"#000",borderRadius:"50%",position:"absolute",inset:0,opacity:typeof g.v=="number"?1-g.v/100:0}})]}))});iM.displayName="Wheel";var sM=iM;function $5({state:e,capabilities:t,updateState:r,deviceType:o,onGroupChange:n,currentGroupId:a}){let s=C=>{r({level:C[0]})},u=C=>{r({kelvin:C[0]}),r({color_mode:rt.ColorMode.Values.color_temp})},c=C=>{let w=j5(C.hsva);r({color:{r:w.r,g:w.g,b:w.b}}),r({color_mode:rt.ColorMode.Values.rgb})},d=C=>{r({command:C})},p=Km(e.color?{...e.color,a:1}:{r:255,g:255,b:255,a:1}),m=C=>{r({color_mode:C}),C===rt.ColorMode.Values.color_temp?d(rt.GroupStateCommand.Values.set_white):C===rt.ColorMode.Values.rgb?r({color:{r:e.color?.r||255,g:e.color?.g||0,b:e.color?.b||255}}):C===rt.ColorMode.Values.onoff&&d(rt.GroupStateCommand.Values.night_mode)},v=()=>{r({command:rt.GroupStateCommand.Values.next_mode})},x=()=>{r({command:rt.GroupStateCommand.Values.previous_mode})},y=()=>{r({command:rt.GroupStateCommand.Values.mode_speed_up})},g=()=>{r({command:rt.GroupStateCommand.Values.mode_speed_down})},b=o?Ru(o):4;return He.default.createElement("div",{className:"flex flex-col items-center justify-center space-y-4 h-full"},n&&He.default.createElement("div",{className:"w-full"},He.default.createElement("label",{className:"text-sm font-medium"},"Group"),He.default.createElement(Yo,{type:"single",variant:"outline",value:a?.toString(),onValueChange:C=>n(parseInt(C,10)),className:"justify-start mt-2"},Array.from({length:b},(C,w)=>He.default.createElement(qr,{key:w,value:(w+1).toString()},w+1)))),e.state==="ON"?He.default.createElement(He.default.Fragment,null,t.color&&He.default.createElement("div",{className:"w-full"},He.default.createElement("div",{className:"flex items-center"},He.default.createElement("label",{className:"text-sm font-medium ml-2"},"Color")),He.default.createElement("div",{className:"mt-2 flex justify-center"},He.default.createElement(sM,{width:150,height:150,color:p,onChange:c}))),t.brightness&&He.default.createElement("div",{className:"w-full"},He.default.createElement("label",{className:"text-sm font-medium"},"Brightness"),He.default.createElement(z5,{value:[e.level||0],max:100,step:1,className:"mt-2",onValueChange:s})),t.colorTemp&&He.default.createElement("div",{className:"w-full"},He.default.createElement("label",{className:"text-sm font-medium"},"Color Temperature"),He.default.createElement(z5,{value:[e.kelvin||0],max:100,step:1,className:"mt-2 py-2",onValueChange:u,gradient:"linear-gradient(to right, lightblue, white, orange)"})),He.default.createElement("div",{className:"flex flex-col mt-4 w-full"},He.default.createElement("div",{className:"text-sm font-medium"},"Mode"),He.default.createElement(Yo,{type:"single",value:e.color_mode,onValueChange:m,"aria-label":"Select light mode",className:"justify-normal"},t.colorTemp&&He.default.createElement(qr,{value:rt.ColorMode.Values.color_temp},He.default.createElement(zs,{size:16,className:"mr-2"}),"White"),t.color&&He.default.createElement(qr,{value:rt.ColorMode.Values.rgb},He.default.createElement(n0,{size:16,className:"mr-2"}),"Color"),He.default.createElement(qr,{value:rt.ColorMode.Values.onoff},He.default.createElement(Zs,{size:16,className:"mr-2"}),"Night"))),He.default.createElement("div",{className:"flex flex-col mt-4 w-full"},He.default.createElement("div",{className:"text-sm font-medium"},"Scene"),He.default.createElement("div",{className:"flex flex-row justify-between"},He.default.createElement("div",{className:"flex mt-2"},He.default.createElement(yt,{onClick:x,className:"rounded-r-none",size:"sm",variant:"ghost"},"-"),He.default.createElement("div",{className:"text-sm font-medium bg-muted px-2 flex items-center"},"Scene"),He.default.createElement(yt,{onClick:v,className:"rounded-l-none",size:"sm",variant:"ghost"},"+")),He.default.createElement("div",{className:"flex mt-2"},He.default.createElement(yt,{onClick:g,className:"rounded-r-none",size:"sm",variant:"ghost"},"-"),He.default.createElement("div",{className:"text-sm font-medium bg-muted px-2 flex items-center"},"Speed"),He.default.createElement(yt,{onClick:y,className:"rounded-l-none",size:"sm",variant:"ghost"},"+")))),He.default.createElement("div",{className:"flex-grow"}),He.default.createElement("div",{className:"flex justify-end space-x-4 mt-8 w-full"},He.default.createElement(yt,{size:"sm",onClick:()=>d(rt.GroupStateCommand.Values.pair)},"Pair"),He.default.createElement(yt,{variant:"destructive",size:"sm",onClick:()=>d(rt.GroupStateCommand.Values.unpair)},"Unpair"))):He.default.createElement("div",{className:"flex flex-col items-center justify-center flex-grow"},He.default.createElement("p",{className:"text-muted-foreground"},"Light is off")))}function lM({name:e,state:t,id:r,updateState:o,onClose:n,onNameChange:a}){let{updateState:s}=G5(r,o),[u,c]=(0,kr.useState)(!1),[d,p]=(0,kr.useState)(e),m=y=>{s({state:y?"ON":"OFF"})},v=()=>{c(!0)},x=()=>{c(!1),a(d)};return kr.default.createElement(js,{className:"w-96 min-h-96 flex flex-col"},kr.default.createElement(Ba,{className:"flex flex-row items-center justify-between space-y-0 pb-4"},kr.default.createElement("div",{className:"flex items-center space-x-2"},n&&kr.default.createElement("button",{onClick:n,className:"p2 hover:bg-muted border-none hover:border-none","aria-label":"Close"},kr.default.createElement(Si,{size:20})),u?kr.default.createElement(lo,{value:d,onChange:y=>p(y.target.value),onBlur:x,onKeyPress:y=>y.key==="Enter"&&x(),className:"text-lg font-medium w-40"}):kr.default.createElement(Za,{className:"text-lg font-medium"},e),kr.default.createElement("button",{onClick:u?x:v,className:"p-1 hover:bg-muted rounded-full","aria-label":u?"Save name":"Edit name"},kr.default.createElement(Gs,{size:16})),kr.default.createElement("div",{className:"w-6 h-6 rounded-full bg-muted flex items-center justify-center",title:`Mode: ${t.color_mode}`},kr.default.createElement(r5,{state:t}))),kr.default.createElement("div",{className:"flex items-center space-x-2"},kr.default.createElement(_1,{checked:t.state==="ON",onCheckedChange:m,"aria-label":"Toggle light"}))),kr.default.createElement(Ga,{className:"flex flex-col flex-grow"},kr.default.createElement($5,{state:t,capabilities:Z5[r.device_type],updateState:s})))}var uM=B(j());function uo({className:e,...t}){return uM.default.createElement("div",{className:K("animate-pulse rounded-md bg-muted",e),...t})}var Y5=B(j()),Bq=1,Zq=1e6;var ih=0;function Gq(){return ih=(ih+1)%Number.MAX_SAFE_INTEGER,ih.toString()}var sh=new Map,cM=e=>{if(sh.has(e))return;let t=setTimeout(()=>{sh.delete(e),M0({type:"REMOVE_TOAST",toastId:e})},Zq);sh.set(e,t)},Wq=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Bq)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(r=>r.id===t.toast.id?{...r,...t.toast}:r)};case"DISMISS_TOAST":{let{toastId:r}=t;return r?cM(r):e.toasts.forEach(o=>{cM(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,open:!1}:o)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(r=>r.id!==t.toastId)}}},X5=[],q5={toasts:[]};function M0(e){q5=Wq(q5,e),X5.forEach(t=>{t(q5)})}function zq({...e}){let t=Gq(),r=n=>M0({type:"UPDATE_TOAST",toast:{...n,id:t}}),o=()=>M0({type:"DISMISS_TOAST",toastId:t});return M0({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:n=>{n||o()}}}),{id:t,dismiss:o,update:r}}function Ya(){let[e,t]=Y5.useState(q5);return Y5.useEffect(()=>(X5.push(t),()=>{let r=X5.indexOf(t);r>-1&&X5.splice(r,1)}),[e]),{...e,toast:zq,dismiss:r=>M0({type:"DISMISS_TOAST",toastId:r})}}var Ka=B(j()),RM=B(SM()),_M=(0,Ka.createContext)(null),AM=({children:e})=>{let{lastJsonMessage:t,sendJsonMessage:r}=(0,RM.default)(`ws://${window.location.hostname}:81`,{share:!0,shouldReconnect:()=>!1}),[o,n]=(0,Ka.useState)([]);return(0,Ka.useEffect)(()=>{t!==null&&n(a=>[...a,t])},[t]),Ka.default.createElement(_M.Provider,{value:{lastMessage:o[o.length-1],allMessages:o}},e)},u3=()=>{let e=(0,Ka.useContext)(_M);if(!e)throw new Error("useWebSocketContext must be used within a WebSocketProvider");return e};function MM(){let{lightStates:e,dispatch:t}=Au(),{lastMessage:r}=u3(),[o,n]=(0,Ve.useState)(!1),[a,s]=(0,Ve.useState)(!1),[u,c]=(0,Ve.useState)(null),[d,p]=(0,Ve.useState)(null),[m,v]=(0,Ve.useState)(!1),x=Ya();(0,Ve.useEffect)(()=>{r&&r.t=="packet"&&t({type:"UPDATE_STATE",device:{device_id:r.d.di,group_id:r.d.gi,device_type:r.d.rt},payload:r.s})},[r]);let y=(A,H)=>{t({type:"UPDATE_STATE",device:A.device,payload:H})},g=(A,H)=>{let $={state:H?"ON":"OFF"};y(A,$),G1.putGatewaysDeviceIdRemoteTypeGroupId($,{params:{remoteType:A.device.device_type,deviceId:A.device.device_id,groupId:A.device.group_id},queries:{fmt:"normalized"}})},b=async A=>{try{let H=await G1.postAliases(A);t({type:"ADD_LIGHT",device:{...A,id:H.id}}),v(!1)}catch{x.toast({title:"Error adding light",description:"Please try again",variant:"destructive"})}},C=A=>{c(A),s(!0)},w=async()=>{u&&(await G1.deleteAliasesId(void 0,{params:{id:u.device.id}}),t({type:"DELETE_LIGHT",device:u.device}),c(null)),s(!1)},I=()=>{c(null),s(!1)},_=A=>{p(A.device.id)},M=(A,H)=>{G1.putAliasesId({alias:H},{params:{id:A.device.id}}),t({type:"UPDATE_LIGHT_NAME",device:A.device,name:H})},E=()=>{let A=e.lights.some($=>$.state.state==="ON"),H={gateways:e.lights.map($=>$.device),update:{state:A?"OFF":"ON"}};G1.putGateways([H]).catch($=>{x.toast({title:"Error toggling all lights",description:"Please try again",variant:"destructive"})}),t({type:"UPDATE_ALL_STATE",payload:{state:A?"OFF":"ON"}})};return Ve.default.createElement("div",{className:"flex items-center justify-center mt-10"},Ve.default.createElement(js,{className:"w-96"},Ve.default.createElement(Ba,null,Ve.default.createElement(Za,null,Ve.default.createElement("div",{className:"flex items-center"},Ve.default.createElement("div",{className:"text-lg font-medium flex-grow"},"Lights"),Ve.default.createElement(_1,{checked:e.lights.some(A=>A.state.state==="ON"),onClick:A=>{A.stopPropagation()},onCheckedChange:E,"aria-label":"Toggle all lights"})))),Ve.default.createElement(Ga,null,e.isLoading?Ve.default.createElement("div",{className:"flex justify-center items-center h-24"},Ve.default.createElement("div",{className:"space-y-4"},Ve.default.createElement(uo,{className:"h-4 w-[250px]"}),Ve.default.createElement(uo,{className:"ml-2 h-4 w-[250px]"}),Ve.default.createElement(uo,{className:"h-4 w-[250px]"}))):e.lights.filter(A=>!A.ephemeral).map((A,H)=>Ve.default.createElement("div",{key:H,className:"flex items-center justify-between py-2 cursor-pointer",onClick:()=>_(A)},Ve.default.createElement("div",{className:"flex items-center"},o&&Ve.default.createElement("button",{className:K("text-red-500 hover:text-red-700 mr-2","transition-transform duration-300 ease-in-out","transform scale-100"),onClick:$=>{$.stopPropagation(),C(A)},"aria-label":`Delete ${A.device.alias}`},Ve.default.createElement(s0,{size:16})),Ve.default.createElement("div",{className:"mr-2"},Ve.default.createElement(r5,{state:A.state})),Ve.default.createElement("span",null,A.device.alias)),Ve.default.createElement(_1,{checked:A.state.state==="ON",onClick:$=>{$.stopPropagation()},onCheckedChange:$=>{g(A,$)},"aria-label":`Toggle ${A.device.alias}`}))),Ve.default.createElement("div",{className:"flex justify-end mt-4"},Ve.default.createElement("button",{className:K("text-gray-500 hover:text-gray-700 mr-2","transition-all duration-300 ease-in-out",{"rotate-180":o}),onClick:()=>n(!o),"aria-label":"Toggle delete mode"},Ve.default.createElement(Gs,{size:16})),Ve.default.createElement(m0,{open:m,onOpenChange:v},Ve.default.createElement(SS,{asChild:!0},Ve.default.createElement("button",{className:"text-gray-500 hover:text-gray-700","aria-label":"Add new light",onClick:()=>v(!0)},Ve.default.createElement(Ws,{size:24}))),Ve.default.createElement(Du,{className:"w-1/2 min-w-96 max-w-2xl"},Ve.default.createElement(h0,null,Ve.default.createElement(g0,{className:"mb-4"},"Add new light")),Ve.default.createElement(_A,{onSubmit:b})))))),a&&Ve.default.createElement(kS,{open:a,setOpen:s,onConfirm:w,onCancel:I,title:"Confirm Deletion",description:`Are you sure you want to delete ${u?.device.alias}?`}),d&&Ve.default.createElement(m0,{open:!!d,onOpenChange:()=>p(null)},Ve.default.createElement(Du,{className:"p-0 border-none bg-transparent",closeButton:!1},(()=>{let A=e.lights.find(H=>H.device.id===d);return A&&Ve.default.createElement(lM,{name:A.device.alias,state:A.state,id:A.device,updateState:H=>{y(A,H)},onClose:()=>p(null),onNameChange:H=>{M(A,H)}})})())))}var mt=B(j());function eJ({bulbId:e,state:t,_updateState:r}){let{updateState:o}=G5(e,r);return mt.default.createElement($5,{state:t,capabilities:Z5[e.device_type],updateState:o})}function TM(){let{lightStates:e,dispatch:t}=Au(),[r,o]=(0,mt.useState)(""),[n,a]=(0,mt.useState)(""),[s,u]=(0,mt.useState)(0),[c,d]=(0,mt.useState)(!1);(0,mt.useEffect)(()=>{d(!!(r&&n&&s))},[r,n,s]);let p=x=>{c&&(console.log("updateState",x),t({type:"UPDATE_STATE",device:{device_id:Su(r),device_type:n,group_id:s},payload:x}))},m=e.lights.find(x=>x.device.device_id===Su(r)&&x.device.device_type===n&&x.device.group_id===s)?.state||{state:"OFF",level:0,color_mode:rt.ColorMode.Values.onoff},v=x=>{o(x.device.device_id.toString()),a(x.device.device_type),u(x.device.group_id)};return mt.default.createElement(js,{className:"w-96 min-h-96 flex flex-col"},mt.default.createElement(Ba,{className:"flex flex-col space-y-2"},mt.default.createElement("div",{className:"flex justify-between items-center"},mt.default.createElement(Za,{className:"text-lg font-medium"},"Manual Control"),c&&mt.default.createElement(_1,{checked:m.state==="ON",onCheckedChange:x=>p({state:x?"ON":"OFF"})})),mt.default.createElement(sl,{onValueChange:x=>{let y=e.lights.find(g=>`${g.device.device_id}-${g.device.device_type}-${g.device.group_id}`===x);y&&v(y)}},mt.default.createElement(D1,null,mt.default.createElement(ll,{placeholder:"Select a device alias"})),mt.default.createElement(N1,null,e.lights.map(x=>mt.default.createElement(B1,{key:`${x.device.device_id}-${x.device.device_type}-${x.device.group_id}`,value:`${x.device.device_id}-${x.device.device_type}-${x.device.group_id}`},x.device.alias||`${x.device.device_type} Group ${x.device.group_id}`)))),mt.default.createElement(lo,{placeholder:"Device ID",value:r,onChange:x=>o(x.target.value)}),mt.default.createElement(sl,{onValueChange:a,value:n},mt.default.createElement(D1,null,mt.default.createElement(ll,{placeholder:"Select a remote type"})),mt.default.createElement(N1,{className:"max-w-96"},Object.values(rt.RemoteType.Values).map(x=>mt.default.createElement(B1,{key:x,value:x,className:"group"},mt.default.createElement("div",{className:"flex flex-col items-start max-w-72"},mt.default.createElement("div",{className:"font-medium"},x),mt.default.createElement("div",{className:"text-sm text-muted-foreground break-words w-full text-left"},B5[x])))))),mt.default.createElement(Yo,{type:"single",variant:"outline",value:s.toString(),onValueChange:x=>u(parseInt(x,10))},n&&Array.from({length:Ru(n)},(x,y)=>mt.default.createElement(qr,{key:y,value:(y+1).toString()},y+1)))),c&&mt.default.createElement(Ga,{className:"flex flex-col flex-grow p-4"},mt.default.createElement(eJ,{bulbId:{device_id:Su(r),device_type:n,group_id:s},state:m,_updateState:p})))}function PM(){return c3.default.createElement("div",{className:"flex flex-row space-x-4 items-baseline justify-center"},c3.default.createElement(MM,null),c3.default.createElement(TM,null))}var k0=B(j());function kM(){return k0.default.createElement("div",{className:"flex flex-col items-center justify-center h-full bg-background text-foreground"},k0.default.createElement("h1",{className:"text-6xl font-bold mb-4"},"404"),k0.default.createElement("p",{className:"text-xl mb-8"},"Page Not Found"),k0.default.createElement("a",{href:"#/dashboard",className:"text-primary hover:underline"},"Go back to Dashboard"))}var Wr=B(j());var Qo=B(j());function EM({className:e,items:t,children:r,...o}){let[n,a]=Qo.useState(t[0]?.id||""),s=Qo.Children.toArray(r),u=s.filter(Qo.isValidElement).map(c=>c.props.navId);return Qo.useEffect(()=>{t.forEach(c=>{u.includes(c.id)||console.warn(`Item id "${c.id}" does not match any child's navId`)})},[t,u]),Qo.createElement("div",{className:"container flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0"},Qo.createElement("nav",{className:"flex space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1 mb-4 -mx-4 xl:w-1/5"},t.map(c=>Qo.createElement(yt,{key:c.id,variant:"ghost",className:K(n===c.id?"bg-muted hover:bg-muted":"hover:bg-transparent hover:underline","justify-start"),onClick:()=>a(c.id)},c.title))),Qo.createElement("div",{className:"mt-4 w-full"},s.find(c=>Qo.isValidElement(c)&&c.props.navId===n)))}var X0=B(j());var it=B(j());var Ne=B(j());var E0=e=>e instanceof P.ZodOptional||e instanceof P.ZodNullable?E0(e.unwrap()):e instanceof P.ZodDefault?E0(e.removeDefault()):e instanceof P.ZodUnion?E0(e.options[0]):e,tJ=({field:e,fieldType:t,onChange:r})=>{let o=so(),n=rt.Settings.shape[e],a=E0(n);if(a instanceof P.ZodString||a instanceof P.ZodNumber){let s=t||"text";return t?s=t:a instanceof P.ZodString?s="text":a instanceof P.ZodNumber&&(s="number"),Ne.createElement(T1,{control:o.control,name:e,render:({field:u})=>Ne.createElement(lo,{type:s,...u,value:u.value,onChange:c=>{r?.(e,c.target.value),s==="number"?u.onChange(Number.isNaN(c.target.valueAsNumber)?c.target.value:c.target.valueAsNumber):u.onChange(c.target.value)}})})}else{if(a instanceof P.ZodEnum)return a.options.length<=4?Ne.createElement(T1,{control:o.control,name:e,render:({field:u})=>Ne.createElement(Yo,{type:"single",variant:"outline",onValueChange:c=>{u.onChange(c)},onBlur:()=>{},value:u.value},a.options.map(c=>Ne.createElement(qr,{key:c,value:c},c)))}):Ne.createElement(T1,{control:o.control,name:e,render:({field:u})=>Ne.createElement(sl,{onValueChange:c=>{u.onChange(c),u.onBlur()},value:u.value},Ne.createElement(Xo,null,Ne.createElement(D1,null,Ne.createElement(ll,{placeholder:"Select an option"}))),Ne.createElement(N1,null,a.options.map(c=>Ne.createElement(B1,{key:c,value:c,className:"group"},Ne.createElement("div",{className:"flex flex-col items-start max-w-72"},Ne.createElement("div",{className:"font-medium"},c))))))});if(a instanceof P.ZodBoolean)return Ne.createElement(T1,{control:o.control,name:e,render:({field:s})=>Ne.createElement(Yo,{type:"single",variant:"outline",onValueChange:u=>{s.onChange(u==="true"),s.onBlur()},value:s.value?"true":"false"},Ne.createElement(qr,{value:"true"},"Enabled"),Ne.createElement(qr,{value:"false"},"Disabled"))});if(a instanceof P.ZodArray){let s=E0(a.element);if(s instanceof P.ZodEnum)return Ne.createElement(T1,{control:o.control,name:e,render:({field:u})=>Ne.createElement(Yo,{type:"multiple",variant:"outline",onValueChange:c=>{u.onChange(c),u.onBlur()},value:u.value},s.options.map(c=>Ne.createElement(qr,{key:c,value:c},c)))})}else return Ne.createElement(Ne.Fragment,null)}},rJ=({field:e,nameOverride:t,children:r,className:o})=>{let n=so(),a=rt.Settings.shape[e],s=n.getFieldState(e);return Ne.createElement(gn,{key:e,control:n.control,name:e,render:({field:u})=>Ne.createElement(vn,{className:o},Ne.createElement(Cn,{className:"flex items-center h-8"},Ne.createElement("span",null,t||e.replace(/_/g," ").replace(/\b\w/g,c=>c.toUpperCase())),s.isDirty&&Ne.createElement("span",{className:"text-lg text-muted-foreground ml-1"},"*")),Ne.createElement(Xo,null,r),Ne.createElement(Ks,null,a.description),Ne.createElement(P1,null))})},oJ=({fields:e,fieldNames:t,fieldTypes:r,onChange:o})=>{let n=so();return Ne.createElement("div",{className:"space-y-4"},e.map(a=>Ne.createElement(gn,{key:a,control:n.control,name:a,render:({field:s})=>Ne.createElement(rJ,{field:a,nameOverride:t?.[a]},Ne.createElement(tJ,{field:a,fieldType:r?.[a],onChange:o}))})))},Vt=({title:e,description:t,fields:r,fieldNames:o,fieldTypes:n,children:a,onChange:s})=>Ne.createElement("div",null,e&&Ne.createElement("h2",{className:"text-2xl font-bold"},e),t&&Ne.createElement("p",{className:"text-sm text-gray-500"},t),e&&Ne.createElement("hr",{className:"my-4"}),Ne.createElement(oJ,{fields:r,fieldNames:o,fieldTypes:n,onChange:s}),a),Ro=({children:e})=>Ne.createElement("div",{className:"flex flex-col space-y-10 max-w-xl"},e);var hc=B(j());var co=B(j());function La(e){"@babel/helpers - typeof";return La=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},La(e)}function OM(e,t){if(La(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t||"default");if(La(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function d3(e){var t=OM(e,"string");return La(t)=="symbol"?t:t+""}function pl(e,t,r){return(t=d3(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function HM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,o)}return r}function Re(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,o=Array(t);r0?gr(uc,--Ao):0,sc--,br===10&&(sc=1,C3--),br}function Mo(){return br=Ao2||lc(br)>3?"":" "}function iT(e,t){for(;--t&&Mo()&&!(br<48||br>102||br>57&&br<65||br>70&&br<97););return dc(e,N0()+(t<6&&Xn()==32&&Mo()==32))}function vh(e){for(;Mo();)switch(br){case e:return Ao;case 34:case 39:e!==34&&e!==39&&vh(br);break;case 40:e===41&&vh(e);break;case 92:Mo();break}return Ao}function sT(e,t){for(;Mo()&&e+br!==57;)if(e+br===84&&Xn()===47)break;return"/*"+dc(t,Ao-1)+"*"+ml(e===47?e:Mo())}function lT(e){for(;!lc(Xn());)Mo();return dc(e,Ao)}function dT(e){return x3(y3("",null,null,null,[""],e=w3(e),0,[0],e))}function y3(e,t,r,o,n,a,s,u,c){for(var d=0,p=0,m=s,v=0,x=0,y=0,g=1,b=1,C=1,w=0,I="",_=n,M=a,E=o,A=I;b;)switch(y=w,w=Mo()){case 40:if(y!=108&&gr(A,m-1)==58){F0(A+=ct(fc(w),"&","&\f"),"&\f")!=-1&&(C=-1);break}case 34:case 39:case 91:A+=fc(w);break;case 9:case 10:case 13:case 32:A+=aT(y);break;case 92:A+=iT(N0()-1,7);continue;case 47:switch(Xn()){case 42:case 47:ic(lJ(sT(Mo(),N0()),t,r),c);break;default:A+="/"}break;case 123*g:u[d++]=_o(A)*C;case 125*g:case 59:case 0:switch(w){case 0:case 125:b=0;case 59+p:C==-1&&(A=ct(A,/\f/g,"")),x>0&&_o(A)-m&&ic(x>32?cT(A+";",o,r,m-1):cT(ct(A," ","")+";",o,r,m-2),c);break;case 59:A+=";";default:if(ic(E=uT(A,t,r,d,p,n,u,I,_=[],M=[],m),a),w===123)if(p===0)y3(A,t,E,E,_,a,m,u,M);else switch(v===99&&gr(A,3)===110?100:v){case 100:case 108:case 109:case 115:y3(e,E,E,o&&ic(uT(e,E,E,0,0,n,u,I,n,_=[],m),M),n,M,m,u,o?_:M);break;default:y3(A,E,E,E,[""],M,0,u,M)}}d=p=x=0,g=C=1,I=A="",m=s;break;case 58:m=1+_o(A),x=y;default:if(g<1){if(w==123)--g;else if(w==125&&g++==0&&nT()==125)continue}switch(A+=ml(w),w*g){case 38:C=p>0?1:(A+="\f",-1);break;case 44:u[d++]=(_o(A)-1)*C,C=1;break;case 64:Xn()===45&&(A+=fc(Mo())),v=Xn(),p=m=_o(I=A+=lT(N0())),w++;break;case 45:y===45&&_o(A)==2&&(g=0)}}return a}function uT(e,t,r,o,n,a,s,u,c,d,p){for(var m=n-1,v=n===0?a:[""],x=ac(v),y=0,g=0,b=0;y0?v[C]+" "+w:ct(w,/&\f/g,v[C])))&&(c[b++]=I);return D0(e,t,r,n===0?oc:u,c,d,p)}function lJ(e,t,r){return D0(e,t,r,h3,ml(oT()),X1(e,2,-2),0)}function cT(e,t,r,o){return D0(e,t,r,nc,X1(e,0,o),X1(e,o+1,-1),o)}function hl(e,t){for(var r="",o=ac(e),n=0;n6)switch(gr(e,t+1)){case 109:if(gr(e,t+4)!==45)break;case 102:return ct(e,/(.+:)(.+)-([^]+)/,"$1"+ht+"$2-$3$1"+V0+(gr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~F0(e,"stretch")?vT(ct(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(gr(e,t+1)!==115)break;case 6444:switch(gr(e,_o(e)-3-(~F0(e,"!important")&&10))){case 107:return ct(e,":",":"+ht)+e;case 101:return ct(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ht+(gr(e,14)===45?"inline-":"")+"box$3$1"+ht+"$2$3$1"+Yr+"$2box$3")+e}break;case 5936:switch(gr(e,t+11)){case 114:return ht+e+Yr+ct(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ht+e+Yr+ct(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ht+e+Yr+ct(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return ht+e+Yr+e+e}return e}var mJ=function(t,r,o,n){if(t.length>-1&&!t.return)switch(t.type){case nc:t.return=vT(t.value,t.length);break;case g3:return hl([cc(t,{value:ct(t.value,"@","@"+ht)})],n);case oc:if(t.length)return gh(t.props,function(a){switch(hh(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return hl([cc(t,{props:[ct(a,/:(read-\w+)/,":"+V0+"$1")]})],n);case"::placeholder":return hl([cc(t,{props:[ct(a,/:(plac\w+)/,":"+ht+"input-$1")]}),cc(t,{props:[ct(a,/:(plac\w+)/,":"+V0+"$1")]}),cc(t,{props:[ct(a,/:(plac\w+)/,Yr+"input-$1")]})],n)}return""})}},hJ=[mJ],Ch=function(t){var r=t.key;if(r==="css"){var o=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(o,function(g){var b=g.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var n=t.stylisPlugins||hJ,a={},s,u=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(g){for(var b=g.getAttribute("data-emotion").split(" "),C=1;C=4;++o,n-=4)r=e.charCodeAt(o)&255|(e.charCodeAt(++o)&255)<<8|(e.charCodeAt(++o)&255)<<16|(e.charCodeAt(++o)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(n){case 3:t^=(e.charCodeAt(o+2)&255)<<16;case 2:t^=(e.charCodeAt(o+1)&255)<<8;case 1:t^=e.charCodeAt(o)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var TT={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var MJ=!1,TJ=/[A-Z]|^ms/g,PJ=/_EMO_([^_]+?)_([^]*?)_EMO_/g,OT=function(t){return t.charCodeAt(1)===45},PT=function(t){return t!=null&&typeof t!="boolean"},Rh=hT(function(e){return OT(e)?e:e.replace(TJ,"-$&").toLowerCase()}),kT=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(PJ,function(o,n,a){return ei={name:n,styles:a,next:ei},n})}return TT[t]!==1&&!OT(t)&&typeof r=="number"&&r!==0?r+"px":r},kJ="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function B0(e,t,r){if(r==null)return"";var o=r;if(o.__emotion_styles!==void 0)return o;switch(typeof r){case"boolean":return"";case"object":{var n=r;if(n.anim===1)return ei={name:n.name,styles:n.styles,next:ei},n.name;var a=r;if(a.styles!==void 0){var s=a.next;if(s!==void 0)for(;s!==void 0;)ei={name:s.name,styles:s.styles,next:ei},s=s.next;var u=a.styles+";";return u}return EJ(e,t,r)}case"function":{if(e!==void 0){var c=ei,d=r(e);return ei=c,B0(e,t,d)}break}}var p=r;if(t==null)return p;var m=t[p];return m!==void 0?m:p}function EJ(e,t,r){var o="";if(Array.isArray(r))for(var n=0;n2?r-2:0),n=2;n-1}function ZJ(e){return W0(e)?window.innerHeight:e.clientHeight}function XT(e){return W0(e)?window.pageYOffset:e.scrollTop}function B3(e,t){if(W0(e)){window.scrollTo(0,t);return}e.scrollTop=t}function GJ(e){var t=getComputedStyle(e),r=t.position==="absolute",o=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var n=e;n=n.parentElement;)if(t=getComputedStyle(n),!(r&&t.position==="static")&&o.test(t.overflow+t.overflowY+t.overflowX))return n;return document.documentElement}function WJ(e,t,r,o){return r*((e=e/o-1)*e*e+1)+t}function D3(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:G0,n=XT(e),a=t-n,s=10,u=0;function c(){u+=s;var d=WJ(u,n,a,r);B3(e,d),ur.bottom?B3(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+n,e.scrollHeight)):o.top-n1?r-1:0),n=1;n=y)return{placement:"bottom",maxHeight:t};if($>=y&&!s)return a&&D3(c,U,W),{placement:"bottom",maxHeight:t};if(!s&&$>=o||s&&A>=o){a&&D3(c,U,W);var ie=s?A-_:$-_;return{placement:"bottom",maxHeight:ie}}if(n==="auto"||s){var Y=t,ae=s?E:H;return ae>=o&&(Y=Math.min(ae-_-u,t)),{placement:"top",maxHeight:Y}}if(n==="bottom")return a&&B3(c,U),{placement:"bottom",maxHeight:t};break;case"top":if(E>=y)return{placement:"top",maxHeight:t};if(H>=y&&!s)return a&&D3(c,ee,W),{placement:"top",maxHeight:t};if(!s&&H>=o||s&&E>=o){var J=t;return(!s&&H>=o||s&&E>=o)&&(J=s?E-M:H-M),a&&D3(c,ee,W),{placement:"top",maxHeight:J}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(n,'".'))}return d}function YJ(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var eP=function(t){return t==="auto"?"bottom":t},tP=function(t,r){var o,n=t.placement,a=t.theme,s=a.borderRadius,u=a.spacing,c=a.colors;return Re((o={label:"menu"},pl(o,YJ(n),"100%"),pl(o,"position","absolute"),pl(o,"width","100%"),pl(o,"zIndex",1),o),r?{}:{backgroundColor:c.neutral0,borderRadius:s,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:u.menuGutter,marginTop:u.menuGutter})},rP=(0,Er.createContext)(null),oP=function(t){var r=t.children,o=t.minMenuHeight,n=t.maxMenuHeight,a=t.menuPlacement,s=t.menuPosition,u=t.menuShouldScrollIntoView,c=t.theme,d=(0,Er.useContext)(rP)||{},p=d.setPortalPlacement,m=(0,Er.useRef)(null),v=(0,Er.useState)(n),x=Ia(v,2),y=x[0],g=x[1],b=(0,Er.useState)(null),C=Ia(b,2),w=C[0],I=C[1],_=c.spacing.controlHeight;return F3(function(){var M=m.current;if(M){var E=s==="fixed",A=u&&!E,H=qJ({maxHeight:n,menuEl:M,minHeight:o,placement:a,shouldScroll:A,isFixedPosition:E,controlHeight:_});g(H.maxHeight),I(H.placement),p?.(H.placement)}},[n,a,s,u,o,p,_]),r({ref:m,placerProps:Re(Re({},t),{},{placement:w||eP(a),maxHeight:y})})},JJ=function(t){var r=t.children,o=t.innerRef,n=t.innerProps;return _e("div",Ce({},dr(t,"menu",{menu:!0}),{ref:o},n),r)},QJ=JJ,nP=function(t,r){var o=t.maxHeight,n=t.theme.spacing.baseUnit;return Re({maxHeight:o,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},r?{}:{paddingBottom:n,paddingTop:n})},KJ=function(t){var r=t.children,o=t.innerProps,n=t.innerRef,a=t.isMulti;return _e("div",Ce({},dr(t,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:n},o),r)},aP=function(t,r){var o=t.theme,n=o.spacing.baseUnit,a=o.colors;return Re({textAlign:"center"},r?{}:{color:a.neutral40,padding:"".concat(n*2,"px ").concat(n*3,"px")})},iP=aP,sP=aP,eQ=function(t){var r=t.children,o=r===void 0?"No options":r,n=t.innerProps,a=$n(t,$J);return _e("div",Ce({},dr(Re(Re({},a),{},{children:o,innerProps:n}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),n),o)},tQ=function(t){var r=t.children,o=r===void 0?"Loading...":r,n=t.innerProps,a=$n(t,XJ);return _e("div",Ce({},dr(Re(Re({},a),{},{children:o,innerProps:n}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),n),o)},lP=function(t){var r=t.rect,o=t.offset,n=t.position;return{left:r.left,position:n,top:o,width:r.width,zIndex:1}},rQ=function(t){var r=t.appendTo,o=t.children,n=t.controlElement,a=t.innerProps,s=t.menuPlacement,u=t.menuPosition,c=(0,Er.useRef)(null),d=(0,Er.useRef)(null),p=(0,Er.useState)(eP(s)),m=Ia(p,2),v=m[0],x=m[1],y=(0,Er.useMemo)(function(){return{setPortalPlacement:x}},[]),g=(0,Er.useState)(null),b=Ia(g,2),C=b[0],w=b[1],I=(0,Er.useCallback)(function(){if(n){var A=zJ(n),H=u==="fixed"?0:window.pageYOffset,$=A[v]+H;($!==C?.offset||A.left!==C?.rect.left||A.width!==C?.rect.width)&&w({offset:$,rect:A})}},[n,u,v,C?.offset,C?.rect.left,C?.rect.width]);F3(function(){I()},[I]);var _=(0,Er.useCallback)(function(){typeof d.current=="function"&&(d.current(),d.current=null),n&&c.current&&(d.current=R0(n,c.current,I,{elementResize:"ResizeObserver"in window}))},[n,I]);F3(function(){_()},[_]);var M=(0,Er.useCallback)(function(A){c.current=A,_()},[_]);if(!r&&u!=="fixed"||!C)return null;var E=_e("div",Ce({ref:M},dr(Re(Re({},t),{},{offset:C.offset,position:u,rect:C.rect}),"menuPortal",{"menu-portal":!0}),a),o);return _e(rP.Provider,{value:y},r?(0,jT.createPortal)(E,r):E)},uP=function(t){var r=t.isDisabled,o=t.isRtl;return{label:"container",direction:o?"rtl":void 0,pointerEvents:r?"none":void 0,position:"relative"}},oQ=function(t){var r=t.children,o=t.innerProps,n=t.isDisabled,a=t.isRtl;return _e("div",Ce({},dr(t,"container",{"--is-disabled":n,"--is-rtl":a}),o),r)},cP=function(t,r){var o=t.theme.spacing,n=t.isMulti,a=t.hasValue,s=t.selectProps.controlShouldRenderValue;return Re({alignItems:"center",display:n&&a&&s?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},r?{}:{padding:"".concat(o.baseUnit/2,"px ").concat(o.baseUnit*2,"px")})},nQ=function(t){var r=t.children,o=t.innerProps,n=t.isMulti,a=t.hasValue;return _e("div",Ce({},dr(t,"valueContainer",{"value-container":!0,"value-container--is-multi":n,"value-container--has-value":a}),o),r)},dP=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},aQ=function(t){var r=t.children,o=t.innerProps;return _e("div",Ce({},dr(t,"indicatorsContainer",{indicators:!0}),o),r)},zT,iQ=["size"],sQ=["innerProps","isRtl","size"];var lQ={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},fP=function(t){var r=t.size,o=$n(t,iQ);return _e("svg",Ce({height:r,width:r,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:lQ},o))},Eh=function(t){return _e(fP,Ce({size:20},t),_e("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},pP=function(t){return _e(fP,Ce({size:20},t),_e("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},mP=function(t,r){var o=t.isFocused,n=t.theme,a=n.spacing.baseUnit,s=n.colors;return Re({label:"indicatorContainer",display:"flex",transition:"color 150ms"},r?{}:{color:o?s.neutral60:s.neutral20,padding:a*2,":hover":{color:o?s.neutral80:s.neutral40}})},hP=mP,uQ=function(t){var r=t.children,o=t.innerProps;return _e("div",Ce({},dr(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),o),r||_e(pP,null))},gP=mP,cQ=function(t){var r=t.children,o=t.innerProps;return _e("div",Ce({},dr(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),o),r||_e(Eh,null))},vP=function(t,r){var o=t.isDisabled,n=t.theme,a=n.spacing.baseUnit,s=n.colors;return Re({label:"indicatorSeparator",alignSelf:"stretch",width:1},r?{}:{backgroundColor:o?s.neutral10:s.neutral20,marginBottom:a*2,marginTop:a*2})},dQ=function(t){var r=t.innerProps;return _e("span",Ce({},r,dr(t,"indicatorSeparator",{"indicator-separator":!0})))},fQ=ZT(zT||(zT=GT([` + 0%, 80%, 100% { opacity: 0; } + 40% { opacity: 1; } +`]))),CP=function(t,r){var o=t.isFocused,n=t.size,a=t.theme,s=a.colors,u=a.spacing.baseUnit;return Re({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"},r?{}:{color:o?s.neutral60:s.neutral20,padding:u*2})},Mh=function(t){var r=t.delay,o=t.offset;return _e("span",{css:Z0({animation:"".concat(fQ," 1s ease-in-out ").concat(r,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:o?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},pQ=function(t){var r=t.innerProps,o=t.isRtl,n=t.size,a=n===void 0?4:n,s=$n(t,sQ);return _e("div",Ce({},dr(Re(Re({},s),{},{innerProps:r,isRtl:o,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),r),_e(Mh,{delay:0,offset:o}),_e(Mh,{delay:160,offset:!0}),_e(Mh,{delay:320,offset:!o}))},wP=function(t,r){var o=t.isDisabled,n=t.isFocused,a=t.theme,s=a.colors,u=a.borderRadius,c=a.spacing;return Re({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},r?{}:{backgroundColor:o?s.neutral5:s.neutral0,borderColor:o?s.neutral10:n?s.primary:s.neutral20,borderRadius:u,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(s.primary):void 0,"&:hover":{borderColor:n?s.primary:s.neutral30}})},mQ=function(t){var r=t.children,o=t.isDisabled,n=t.isFocused,a=t.innerRef,s=t.innerProps,u=t.menuIsOpen;return _e("div",Ce({ref:a},dr(t,"control",{control:!0,"control--is-disabled":o,"control--is-focused":n,"control--menu-is-open":u}),s,{"aria-disabled":o||void 0}),r)},hQ=mQ,gQ=["data"],xP=function(t,r){var o=t.theme.spacing;return r?{}:{paddingBottom:o.baseUnit*2,paddingTop:o.baseUnit*2}},vQ=function(t){var r=t.children,o=t.cx,n=t.getStyles,a=t.getClassNames,s=t.Heading,u=t.headingProps,c=t.innerProps,d=t.label,p=t.theme,m=t.selectProps;return _e("div",Ce({},dr(t,"group",{group:!0}),c),_e(s,Ce({},u,{selectProps:m,theme:p,getStyles:n,getClassNames:a,cx:o}),d),_e("div",null,r))},yP=function(t,r){var o=t.theme,n=o.colors,a=o.spacing;return Re({label:"group",cursor:"default",display:"block"},r?{}:{color:n.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:a.baseUnit*3,paddingRight:a.baseUnit*3,textTransform:"uppercase"})},CQ=function(t){var r=$T(t);r.data;var o=$n(r,gQ);return _e("div",Ce({},dr(t,"groupHeading",{"group-heading":!0}),o))},wQ=vQ,xQ=["innerRef","isDisabled","isHidden","inputClassName"],bP=function(t,r){var o=t.isDisabled,n=t.value,a=t.theme,s=a.spacing,u=a.colors;return Re(Re({visibility:o?"hidden":"visible",transform:n?"translateZ(0)":""},yQ),r?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:u.neutral80})},LP={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},yQ={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Re({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},LP)},bQ=function(t){return Re({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},LP)},LQ=function(t){var r=t.cx,o=t.value,n=$T(t),a=n.innerRef,s=n.isDisabled,u=n.isHidden,c=n.inputClassName,d=$n(n,xQ);return _e("div",Ce({},dr(t,"input",{"input-container":!0}),{"data-value":o||""}),_e("input",Ce({className:r({input:!0},c),ref:a,style:bQ(u),disabled:s},d)))},IQ=LQ,IP=function(t,r){var o=t.theme,n=o.spacing,a=o.borderRadius,s=o.colors;return Re({label:"multiValue",display:"flex",minWidth:0},r?{}:{backgroundColor:s.neutral10,borderRadius:a/2,margin:n.baseUnit/2})},SP=function(t,r){var o=t.theme,n=o.borderRadius,a=o.colors,s=t.cropWithEllipsis;return Re({overflow:"hidden",textOverflow:s||s===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},r?{}:{borderRadius:n/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},RP=function(t,r){var o=t.theme,n=o.spacing,a=o.borderRadius,s=o.colors,u=t.isFocused;return Re({alignItems:"center",display:"flex"},r?{}:{borderRadius:a/2,backgroundColor:u?s.dangerLight:void 0,paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:s.dangerLight,color:s.danger}})},_P=function(t){var r=t.children,o=t.innerProps;return _e("div",o,r)},SQ=_P,RQ=_P;function _Q(e){var t=e.children,r=e.innerProps;return _e("div",Ce({role:"button"},r),t||_e(Eh,{size:14}))}var AQ=function(t){var r=t.children,o=t.components,n=t.data,a=t.innerProps,s=t.isDisabled,u=t.removeProps,c=t.selectProps,d=o.Container,p=o.Label,m=o.Remove;return _e(d,{data:n,innerProps:Re(Re({},dr(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),a),selectProps:c},_e(p,{data:n,innerProps:Re({},dr(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},r),_e(m,{data:n,innerProps:Re(Re({},dr(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(r||"option")},u),selectProps:c}))},MQ=AQ,AP=function(t,r){var o=t.isDisabled,n=t.isFocused,a=t.isSelected,s=t.theme,u=s.spacing,c=s.colors;return Re({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},r?{}:{backgroundColor:a?c.primary:n?c.primary25:"transparent",color:o?c.neutral20:a?c.neutral0:"inherit",padding:"".concat(u.baseUnit*2,"px ").concat(u.baseUnit*3,"px"),":active":{backgroundColor:o?void 0:a?c.primary:c.primary50}})},TQ=function(t){var r=t.children,o=t.isDisabled,n=t.isFocused,a=t.isSelected,s=t.innerRef,u=t.innerProps;return _e("div",Ce({},dr(t,"option",{option:!0,"option--is-disabled":o,"option--is-focused":n,"option--is-selected":a}),{ref:s,"aria-disabled":o},u),r)},PQ=TQ,MP=function(t,r){var o=t.theme,n=o.spacing,a=o.colors;return Re({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},r?{}:{color:a.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2})},kQ=function(t){var r=t.children,o=t.innerProps;return _e("div",Ce({},dr(t,"placeholder",{placeholder:!0}),o),r)},EQ=kQ,TP=function(t,r){var o=t.isDisabled,n=t.theme,a=n.spacing,s=n.colors;return Re({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},r?{}:{color:o?s.neutral40:s.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},OQ=function(t){var r=t.children,o=t.isDisabled,n=t.innerProps;return _e("div",Ce({},dr(t,"singleValue",{"single-value":!0,"single-value--is-disabled":o}),n),r)},HQ=OQ,gl={ClearIndicator:cQ,Control:hQ,DropdownIndicator:uQ,DownChevron:pP,CrossIcon:Eh,Group:wQ,GroupHeading:CQ,IndicatorsContainer:aQ,IndicatorSeparator:dQ,Input:IQ,LoadingIndicator:pQ,Menu:QJ,MenuList:KJ,MenuPortal:rQ,LoadingMessage:tQ,NoOptionsMessage:eQ,MultiValue:MQ,MultiValueContainer:SQ,MultiValueLabel:RQ,MultiValueRemove:_Q,Option:PQ,Placeholder:EQ,SelectContainer:oQ,SingleValue:HQ,ValueContainer:nQ},PP=function(t){return Re(Re({},gl),t.components)};var kP=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function VQ(e,t){return!!(e===t||kP(e)&&kP(t))}function FQ(e,t){if(e.length!==t.length)return!1;for(var r=0;r1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return s?"option ".concat(n," is disabled. Select another option."):"option ".concat(n,", selected.");default:return""}},onFocus:function(t){var r=t.context,o=t.focused,n=t.options,a=t.label,s=a===void 0?"":a,u=t.selectValue,c=t.isDisabled,d=t.isSelected,p=t.isAppleDevice,m=function(g,b){return g&&g.length?"".concat(g.indexOf(b)+1," of ").concat(g.length):""};if(r==="value"&&u)return"value ".concat(s," focused, ").concat(m(u,o),".");if(r==="menu"&&p){var v=c?" disabled":"",x="".concat(d?" selected":"").concat(v);return"".concat(s).concat(x,", ").concat(m(n,o),".")}return""},onFilter:function(t){var r=t.inputValue,o=t.resultsMessage;return"".concat(o).concat(r?" for search term "+r:"",".")}},ZQ=function(t){var r=t.ariaSelection,o=t.focusedOption,n=t.focusedValue,a=t.focusableOptions,s=t.isFocused,u=t.selectValue,c=t.selectProps,d=t.id,p=t.isAppleDevice,m=c.ariaLiveMessages,v=c.getOptionLabel,x=c.inputValue,y=c.isMulti,g=c.isOptionDisabled,b=c.isSearchable,C=c.menuIsOpen,w=c.options,I=c.screenReaderStatus,_=c.tabSelectsValue,M=c.isLoading,E=c["aria-label"],A=c["aria-live"],H=(0,Ct.useMemo)(function(){return Re(Re({},BQ),m||{})},[m]),$=(0,Ct.useMemo)(function(){var ae="";if(r&&H.onChange){var J=r.option,me=r.options,se=r.removedValue,we=r.removedValues,Ke=r.value,It=function(qe){return Array.isArray(qe)?null:qe},st=se||J||It(Ke),dt=st?v(st):"",St=me||we||void 0,Lr=St?St.map(v):[],Rt=Re({isDisabled:st&&g(st,u),label:dt,labels:Lr},r);ae=H.onChange(Rt)}return ae},[r,H,g,u,v]),U=(0,Ct.useMemo)(function(){var ae="",J=o||n,me=!!(o&&u&&u.includes(o));if(J&&H.onFocus){var se={focused:J,label:v(J),isDisabled:g(J,u),isSelected:me,options:a,context:J===o?"menu":"value",selectValue:u,isAppleDevice:p};ae=H.onFocus(se)}return ae},[o,n,v,g,H,a,u,p]),ee=(0,Ct.useMemo)(function(){var ae="";if(C&&w.length&&!M&&H.onFilter){var J=I({count:a.length});ae=H.onFilter({inputValue:x,resultsMessage:J})}return ae},[a,x,C,H,w,I,M]),W=r?.action==="initial-input-focus",ie=(0,Ct.useMemo)(function(){var ae="";if(H.guidance){var J=n?"value":C?"menu":"input";ae=H.guidance({"aria-label":E,context:J,isDisabled:o&&g(o,u),isMulti:y,isSearchable:b,tabSelectsValue:_,isInitialFocus:W})}return ae},[E,o,n,y,g,b,C,H,u,_,W]),Y=_e(Ct.Fragment,null,_e("span",{id:"aria-selection"},$),_e("span",{id:"aria-focused"},U),_e("span",{id:"aria-results"},ee),_e("span",{id:"aria-guidance"},ie));return _e(Ct.Fragment,null,_e(OP,{id:d},W&&Y),_e(OP,{"aria-live":A,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!W&&Y))},GQ=ZQ,Vh=[{base:"A",letters:"A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",letters:"\uA732"},{base:"AE",letters:"\xC6\u01FC\u01E2"},{base:"AO",letters:"\uA734"},{base:"AU",letters:"\uA736"},{base:"AV",letters:"\uA738\uA73A"},{base:"AY",letters:"\uA73C"},{base:"B",letters:"B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"},{base:"C",letters:"C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"},{base:"D",letters:"D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"},{base:"DZ",letters:"\u01F1\u01C4"},{base:"Dz",letters:"\u01F2\u01C5"},{base:"E",letters:"E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"},{base:"F",letters:"F\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",letters:"G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"},{base:"H",letters:"H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",letters:"I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",letters:"J\u24BF\uFF2A\u0134\u0248"},{base:"K",letters:"K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",letters:"L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",letters:"\u01C7"},{base:"Lj",letters:"\u01C8"},{base:"M",letters:"M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"},{base:"N",letters:"N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"},{base:"NJ",letters:"\u01CA"},{base:"Nj",letters:"\u01CB"},{base:"O",letters:"O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OI",letters:"\u01A2"},{base:"OO",letters:"\uA74E"},{base:"OU",letters:"\u0222"},{base:"P",letters:"P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",letters:"Q\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",letters:"R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",letters:"S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",letters:"T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"TZ",letters:"\uA728"},{base:"U",letters:"U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",letters:"V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",letters:"\uA760"},{base:"W",letters:"W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",letters:"X\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",letters:"Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",letters:"Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",letters:"a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"},{base:"aa",letters:"\uA733"},{base:"ae",letters:"\xE6\u01FD\u01E3"},{base:"ao",letters:"\uA735"},{base:"au",letters:"\uA737"},{base:"av",letters:"\uA739\uA73B"},{base:"ay",letters:"\uA73D"},{base:"b",letters:"b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"},{base:"c",letters:"c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",letters:"d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"},{base:"dz",letters:"\u01F3\u01C6"},{base:"e",letters:"e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"},{base:"f",letters:"f\u24D5\uFF46\u1E1F\u0192\uA77C"},{base:"g",letters:"g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"},{base:"h",letters:"h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",letters:"\u0195"},{base:"i",letters:"i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",letters:"j\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",letters:"k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",letters:"l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"},{base:"lj",letters:"\u01C9"},{base:"m",letters:"m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",letters:"n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"},{base:"nj",letters:"\u01CC"},{base:"o",letters:"o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"},{base:"oi",letters:"\u01A3"},{base:"ou",letters:"\u0223"},{base:"oo",letters:"\uA74F"},{base:"p",letters:"p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"},{base:"q",letters:"q\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",letters:"r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",letters:"s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"},{base:"t",letters:"t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"tz",letters:"\uA729"},{base:"u",letters:"u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",letters:"v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",letters:"\uA761"},{base:"w",letters:"w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",letters:"x\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",letters:"y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",letters:"z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],WQ=new RegExp("["+Vh.map(function(e){return e.letters}).join("")+"]","g"),UP={};for(Z3=0;Z3-1}},$Q=["innerRef"];function XQ(e){var t=e.innerRef,r=$n(e,$Q),o=KT(r,"onExited","in","enter","exit","appear");return _e("input",Ce({ref:t},o,{css:Z0({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var qQ=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function YQ(e){var t=e.isEnabled,r=e.onBottomArrive,o=e.onBottomLeave,n=e.onTopArrive,a=e.onTopLeave,s=(0,Ct.useRef)(!1),u=(0,Ct.useRef)(!1),c=(0,Ct.useRef)(0),d=(0,Ct.useRef)(null),p=(0,Ct.useCallback)(function(b,C){if(d.current!==null){var w=d.current,I=w.scrollTop,_=w.scrollHeight,M=w.clientHeight,E=d.current,A=C>0,H=_-M-I,$=!1;H>C&&s.current&&(o&&o(b),s.current=!1),A&&u.current&&(a&&a(b),u.current=!1),A&&C>H?(r&&!s.current&&r(b),E.scrollTop=_,$=!0,s.current=!0):!A&&-C>I&&(n&&!u.current&&n(b),E.scrollTop=0,$=!0,u.current=!0),$&&qQ(b)}},[r,o,n,a]),m=(0,Ct.useCallback)(function(b){p(b,b.deltaY)},[p]),v=(0,Ct.useCallback)(function(b){c.current=b.changedTouches[0].clientY},[]),x=(0,Ct.useCallback)(function(b){var C=c.current-b.changedTouches[0].clientY;p(b,C)},[p]),y=(0,Ct.useCallback)(function(b){if(b){var C=JT?{passive:!1}:!1;b.addEventListener("wheel",m,C),b.addEventListener("touchstart",v,C),b.addEventListener("touchmove",x,C)}},[x,v,m]),g=(0,Ct.useCallback)(function(b){b&&(b.removeEventListener("wheel",m,!1),b.removeEventListener("touchstart",v,!1),b.removeEventListener("touchmove",x,!1))},[x,v,m]);return(0,Ct.useEffect)(function(){if(t){var b=d.current;return y(b),function(){g(b)}}},[t,y,g]),function(b){d.current=b}}var VP=["boxSizing","height","overflow","paddingRight","position"],FP={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function DP(e){e.preventDefault()}function NP(e){e.stopPropagation()}function BP(){var e=this.scrollTop,t=this.scrollHeight,r=e+this.offsetHeight;e===0?this.scrollTop=1:r===t&&(this.scrollTop=e-1)}function ZP(){return"ontouchstart"in window||navigator.maxTouchPoints}var GP=!!(typeof window<"u"&&window.document&&window.document.createElement),j0=0,mc={capture:!1,passive:!1};function JQ(e){var t=e.isEnabled,r=e.accountForScrollbars,o=r===void 0?!0:r,n=(0,Ct.useRef)({}),a=(0,Ct.useRef)(null),s=(0,Ct.useCallback)(function(c){if(GP){var d=document.body,p=d&&d.style;if(o&&VP.forEach(function(y){var g=p&&p[y];n.current[y]=g}),o&&j0<1){var m=parseInt(n.current.paddingRight,10)||0,v=document.body?document.body.clientWidth:0,x=window.innerWidth-v+m||0;Object.keys(FP).forEach(function(y){var g=FP[y];p&&(p[y]=g)}),p&&(p.paddingRight="".concat(x,"px"))}d&&ZP()&&(d.addEventListener("touchmove",DP,mc),c&&(c.addEventListener("touchstart",BP,mc),c.addEventListener("touchmove",NP,mc))),j0+=1}},[o]),u=(0,Ct.useCallback)(function(c){if(GP){var d=document.body,p=d&&d.style;j0=Math.max(j0-1,0),o&&j0<1&&VP.forEach(function(m){var v=n.current[m];p&&(p[m]=v)}),d&&ZP()&&(d.removeEventListener("touchmove",DP,mc),c&&(c.removeEventListener("touchstart",BP,mc),c.removeEventListener("touchmove",NP,mc)))}},[o]);return(0,Ct.useEffect)(function(){if(t){var c=a.current;return s(c),function(){u(c)}}},[t,s,u]),function(c){a.current=c}}var QQ=function(t){var r=t.target;return r.ownerDocument.activeElement&&r.ownerDocument.activeElement.blur()},KQ={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function eK(e){var t=e.children,r=e.lockEnabled,o=e.captureEnabled,n=o===void 0?!0:o,a=e.onBottomArrive,s=e.onBottomLeave,u=e.onTopArrive,c=e.onTopLeave,d=YQ({isEnabled:n,onBottomArrive:a,onBottomLeave:s,onTopArrive:u,onTopLeave:c}),p=JQ({isEnabled:r}),m=function(x){d(x),p(x)};return _e(Ct.Fragment,null,r&&_e("div",{onClick:QQ,css:KQ}),t(m))}var tK={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},rK=function(t){var r=t.name,o=t.onFocus;return _e("input",{required:!0,name:r,tabIndex:-1,"aria-hidden":"true",onFocus:o,css:tK,value:"",onChange:function(){}})},oK=rK;function Fh(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function nK(){return Fh(/^iPhone/i)}function XP(){return Fh(/^Mac/i)}function aK(){return Fh(/^iPad/i)||XP()&&navigator.maxTouchPoints>1}function iK(){return nK()||aK()}function sK(){return XP()||iK()}var lK=function(t){return t.label},uK=function(t){return t.label},cK=function(t){return t.value},dK=function(t){return!!t.isDisabled},fK={clearIndicator:gP,container:uP,control:wP,dropdownIndicator:hP,group:xP,groupHeading:yP,indicatorsContainer:dP,indicatorSeparator:vP,input:bP,loadingIndicator:CP,loadingMessage:sP,menu:tP,menuList:nP,menuPortal:lP,multiValue:IP,multiValueLabel:SP,multiValueRemove:RP,noOptionsMessage:iP,option:AP,placeholder:MP,singleValue:TP,valueContainer:cP};var pK={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},mK=4,qP=4,hK=38,gK=qP*2,vK={baseUnit:qP,controlHeight:hK,menuGutter:gK},Oh={borderRadius:mK,colors:pK,spacing:vK},CK={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:kh(),captureMenuScroll:!kh(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:UQ(),formatGroupLabel:lK,getOptionLabel:uK,getOptionValue:cK,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:dK,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!qT(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var r=t.count;return"".concat(r," result").concat(r!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function WP(e,t,r,o){var n=QP(e,t,r),a=KP(e,t,r),s=JP(e,t),u=j3(e,t);return{type:"option",data:t,isDisabled:n,isSelected:a,label:s,value:u,index:o}}function z3(e,t){return e.options.map(function(r,o){if("options"in r){var n=r.options.map(function(s,u){return WP(e,s,t,u)}).filter(function(s){return jP(e,s)});return n.length>0?{type:"group",data:r,options:n,index:o}:void 0}var a=WP(e,r,t,o);return jP(e,a)?a:void 0}).filter(QT)}function YP(e){return e.reduce(function(t,r){return r.type==="group"?t.push.apply(t,m3(r.options.map(function(o){return o.data}))):t.push(r.data),t},[])}function zP(e,t){return e.reduce(function(r,o){return o.type==="group"?r.push.apply(r,m3(o.options.map(function(n){return{data:n.data,id:"".concat(t,"-").concat(o.index,"-").concat(n.index)}}))):r.push({data:o.data,id:"".concat(t,"-").concat(o.index)}),r},[])}function wK(e,t){return YP(z3(e,t))}function jP(e,t){var r=e.inputValue,o=r===void 0?"":r,n=t.data,a=t.isSelected,s=t.label,u=t.value;return(!tk(e)||!a)&&ek(e,{label:s,value:u,data:n},o)}function xK(e,t){var r=e.focusedValue,o=e.selectValue,n=o.indexOf(r);if(n>-1){var a=t.indexOf(r);if(a>-1)return r;if(n-1?r:t[0]}var Hh=function(t,r){var o,n=(o=t.find(function(a){return a.data===r}))===null||o===void 0?void 0:o.id;return n||null},JP=function(t,r){return t.getOptionLabel(r)},j3=function(t,r){return t.getOptionValue(r)};function QP(e,t,r){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,r):!1}function KP(e,t,r){if(r.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,r);var o=j3(e,t);return r.some(function(n){return j3(e,n)===o})}function ek(e,t,r){return e.filterOption?e.filterOption(t,r):!0}var tk=function(t){var r=t.hideSelectedOptions,o=t.isMulti;return r===void 0?o:r},bK=1,Dh=function(e){WM(r,e);var t=UM(r);function r(o){var n;if(BM(this,r),n=t.call(this,o),n.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},n.blockOptionHover=!1,n.isComposing=!1,n.commonProps=void 0,n.initialTouchX=0,n.initialTouchY=0,n.openAfterFocus=!1,n.scrollToFocusedOptionOnUpdate=!1,n.userIsDragging=void 0,n.isAppleDevice=sK(),n.controlRef=null,n.getControlRef=function(c){n.controlRef=c},n.focusedOptionRef=null,n.getFocusedOptionRef=function(c){n.focusedOptionRef=c},n.menuListRef=null,n.getMenuListRef=function(c){n.menuListRef=c},n.inputRef=null,n.getInputRef=function(c){n.inputRef=c},n.focus=n.focusInput,n.blur=n.blurInput,n.onChange=function(c,d){var p=n.props,m=p.onChange,v=p.name;d.name=v,n.ariaOnChange(c,d),m(c,d)},n.setValue=function(c,d,p){var m=n.props,v=m.closeMenuOnSelect,x=m.isMulti,y=m.inputValue;n.onInputChange("",{action:"set-value",prevInputValue:y}),v&&(n.setState({inputIsHiddenAfterUpdate:!x}),n.onMenuClose()),n.setState({clearFocusValueOnUpdate:!0}),n.onChange(c,{action:d,option:p})},n.selectOption=function(c){var d=n.props,p=d.blurInputOnSelect,m=d.isMulti,v=d.name,x=n.state.selectValue,y=m&&n.isOptionSelected(c,x),g=n.isOptionDisabled(c,x);if(y){var b=n.getOptionValue(c);n.setValue(x.filter(function(C){return n.getOptionValue(C)!==b}),"deselect-option",c)}else if(!g)m?n.setValue([].concat(m3(x),[c]),"select-option",c):n.setValue(c,"select-option");else{n.ariaOnChange(c,{action:"select-option",option:c,name:v});return}p&&n.blurInput()},n.removeValue=function(c){var d=n.props.isMulti,p=n.state.selectValue,m=n.getOptionValue(c),v=p.filter(function(y){return n.getOptionValue(y)!==m}),x=z0(d,v,v[0]||null);n.onChange(x,{action:"remove-value",removedValue:c}),n.focusInput()},n.clearValue=function(){var c=n.state.selectValue;n.onChange(z0(n.props.isMulti,[],null),{action:"clear",removedValues:c})},n.popValue=function(){var c=n.props.isMulti,d=n.state.selectValue,p=d[d.length-1],m=d.slice(0,d.length-1),v=z0(c,m,m[0]||null);p&&n.onChange(v,{action:"pop-value",removedValue:p})},n.getFocusedOptionId=function(c){return Hh(n.state.focusableOptionsWithIds,c)},n.getFocusableOptionsWithIds=function(){return zP(z3(n.props,n.state.selectValue),n.getElementId("option"))},n.getValue=function(){return n.state.selectValue},n.cx=function(){for(var c=arguments.length,d=new Array(c),p=0;px||v>x}},n.onTouchEnd=function(c){n.userIsDragging||(n.controlRef&&!n.controlRef.contains(c.target)&&n.menuListRef&&!n.menuListRef.contains(c.target)&&n.blurInput(),n.initialTouchX=0,n.initialTouchY=0)},n.onControlTouchEnd=function(c){n.userIsDragging||n.onControlMouseDown(c)},n.onClearIndicatorTouchEnd=function(c){n.userIsDragging||n.onClearIndicatorMouseDown(c)},n.onDropdownIndicatorTouchEnd=function(c){n.userIsDragging||n.onDropdownIndicatorMouseDown(c)},n.handleInputChange=function(c){var d=n.props.inputValue,p=c.currentTarget.value;n.setState({inputIsHiddenAfterUpdate:!1}),n.onInputChange(p,{action:"input-change",prevInputValue:d}),n.props.menuIsOpen||n.onMenuOpen()},n.onInputFocus=function(c){n.props.onFocus&&n.props.onFocus(c),n.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(n.openAfterFocus||n.props.openMenuOnFocus)&&n.openMenu("first"),n.openAfterFocus=!1},n.onInputBlur=function(c){var d=n.props.inputValue;if(n.menuListRef&&n.menuListRef.contains(document.activeElement)){n.inputRef.focus();return}n.props.onBlur&&n.props.onBlur(c),n.onInputChange("",{action:"input-blur",prevInputValue:d}),n.onMenuClose(),n.setState({focusedValue:null,isFocused:!1})},n.onOptionHover=function(c){if(!(n.blockOptionHover||n.state.focusedOption===c)){var d=n.getFocusableOptions(),p=d.indexOf(c);n.setState({focusedOption:c,focusedOptionId:p>-1?n.getFocusedOptionId(c):null})}},n.shouldHideSelectedOptions=function(){return tk(n.props)},n.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),n.focus()},n.onKeyDown=function(c){var d=n.props,p=d.isMulti,m=d.backspaceRemovesValue,v=d.escapeClearsValue,x=d.inputValue,y=d.isClearable,g=d.isDisabled,b=d.menuIsOpen,C=d.onKeyDown,w=d.tabSelectsValue,I=d.openMenuOnFocus,_=n.state,M=_.focusedOption,E=_.focusedValue,A=_.selectValue;if(!g&&!(typeof C=="function"&&(C(c),c.defaultPrevented))){switch(n.blockOptionHover=!0,c.key){case"ArrowLeft":if(!p||x)return;n.focusValue("previous");break;case"ArrowRight":if(!p||x)return;n.focusValue("next");break;case"Delete":case"Backspace":if(x)return;if(E)n.removeValue(E);else{if(!m)return;p?n.popValue():y&&n.clearValue()}break;case"Tab":if(n.isComposing||c.shiftKey||!b||!w||!M||I&&n.isOptionSelected(M,A))return;n.selectOption(M);break;case"Enter":if(c.keyCode===229)break;if(b){if(!M||n.isComposing)return;n.selectOption(M);break}return;case"Escape":b?(n.setState({inputIsHiddenAfterUpdate:!1}),n.onInputChange("",{action:"menu-close",prevInputValue:x}),n.onMenuClose()):y&&v&&n.clearValue();break;case" ":if(x)return;if(!b){n.openMenu("first");break}if(!M)return;n.selectOption(M);break;case"ArrowUp":b?n.focusOption("up"):n.openMenu("last");break;case"ArrowDown":b?n.focusOption("down"):n.openMenu("first");break;case"PageUp":if(!b)return;n.focusOption("pageup");break;case"PageDown":if(!b)return;n.focusOption("pagedown");break;case"Home":if(!b)return;n.focusOption("first");break;case"End":if(!b)return;n.focusOption("last");break;default:return}c.preventDefault()}},n.state.instancePrefix="react-select-"+(n.props.instanceId||++bK),n.state.selectValue=Th(o.value),o.menuIsOpen&&n.state.selectValue.length){var a=n.getFocusableOptionsWithIds(),s=n.buildFocusableOptions(),u=s.indexOf(n.state.selectValue[0]);n.state.focusableOptionsWithIds=a,n.state.focusedOption=s[u],n.state.focusedOptionId=Hh(a,s[u])}return n}return GM(r,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Ph(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(n){var a=this.props,s=a.isDisabled,u=a.menuIsOpen,c=this.state.isFocused;(c&&!s&&n.isDisabled||c&&u&&!n.menuIsOpen)&&this.focusInput(),c&&s&&!n.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!s&&n.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Ph(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(n,a){this.props.onInputChange(n,a)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(n){var a=this,s=this.state,u=s.selectValue,c=s.isFocused,d=this.buildFocusableOptions(),p=n==="first"?0:d.length-1;if(!this.props.isMulti){var m=d.indexOf(u[0]);m>-1&&(p=m)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:d[p],focusedOptionId:this.getFocusedOptionId(d[p])},function(){return a.onMenuOpen()})}},{key:"focusValue",value:function(n){var a=this.state,s=a.selectValue,u=a.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=s.indexOf(u);u||(c=-1);var d=s.length-1,p=-1;if(s.length){switch(n){case"previous":c===0?p=0:c===-1?p=d:p=c-1;break;case"next":c>-1&&c0&&arguments[0]!==void 0?arguments[0]:"first",a=this.props.pageSize,s=this.state.focusedOption,u=this.getFocusableOptions();if(u.length){var c=0,d=u.indexOf(s);s||(d=-1),n==="up"?c=d>0?d-1:u.length-1:n==="down"?c=(d+1)%u.length:n==="pageup"?(c=d-a,c<0&&(c=0)):n==="pagedown"?(c=d+a,c>u.length-1&&(c=u.length-1)):n==="last"&&(c=u.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:u[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(u[c])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Oh):Re(Re({},Oh),this.props.theme):Oh}},{key:"getCommonProps",value:function(){var n=this.clearValue,a=this.cx,s=this.getStyles,u=this.getClassNames,c=this.getValue,d=this.selectOption,p=this.setValue,m=this.props,v=m.isMulti,x=m.isRtl,y=m.options,g=this.hasValue();return{clearValue:n,cx:a,getStyles:s,getClassNames:u,getValue:c,hasValue:g,isMulti:v,isRtl:x,options:y,selectOption:d,selectProps:m,setValue:p,theme:this.getTheme()}}},{key:"hasValue",value:function(){var n=this.state.selectValue;return n.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var n=this.props,a=n.isClearable,s=n.isMulti;return a===void 0?s:a}},{key:"isOptionDisabled",value:function(n,a){return QP(this.props,n,a)}},{key:"isOptionSelected",value:function(n,a){return KP(this.props,n,a)}},{key:"filterOption",value:function(n,a){return ek(this.props,n,a)}},{key:"formatOptionLabel",value:function(n,a){if(typeof this.props.formatOptionLabel=="function"){var s=this.props.inputValue,u=this.state.selectValue;return this.props.formatOptionLabel(n,{context:a,inputValue:s,selectValue:u})}else return this.getOptionLabel(n)}},{key:"formatGroupLabel",value:function(n){return this.props.formatGroupLabel(n)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var n=this.props,a=n.isDisabled,s=n.isSearchable,u=n.inputId,c=n.inputValue,d=n.tabIndex,p=n.form,m=n.menuIsOpen,v=n.required,x=this.getComponents(),y=x.Input,g=this.state,b=g.inputIsHidden,C=g.ariaSelection,w=this.commonProps,I=u||this.getElementId("input"),_=Re(Re(Re({"aria-autocomplete":"list","aria-expanded":m,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":v,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},m&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?C?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?Lt.createElement(y,Ce({},w,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:I,innerRef:this.getInputRef,isDisabled:a,isHidden:b,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:d,form:p,type:"text",value:c},_)):Lt.createElement(XQ,Ce({id:I,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:G0,onFocus:this.onInputFocus,disabled:a,tabIndex:d,inputMode:"none",form:p,value:""},_))}},{key:"renderPlaceholderOrValue",value:function(){var n=this,a=this.getComponents(),s=a.MultiValue,u=a.MultiValueContainer,c=a.MultiValueLabel,d=a.MultiValueRemove,p=a.SingleValue,m=a.Placeholder,v=this.commonProps,x=this.props,y=x.controlShouldRenderValue,g=x.isDisabled,b=x.isMulti,C=x.inputValue,w=x.placeholder,I=this.state,_=I.selectValue,M=I.focusedValue,E=I.isFocused;if(!this.hasValue()||!y)return C?null:Lt.createElement(m,Ce({},v,{key:"placeholder",isDisabled:g,isFocused:E,innerProps:{id:this.getElementId("placeholder")}}),w);if(b)return _.map(function(H,$){var U=H===M,ee="".concat(n.getOptionLabel(H),"-").concat(n.getOptionValue(H));return Lt.createElement(s,Ce({},v,{components:{Container:u,Label:c,Remove:d},isFocused:U,isDisabled:g,key:ee,index:$,removeProps:{onClick:function(){return n.removeValue(H)},onTouchEnd:function(){return n.removeValue(H)},onMouseDown:function(ie){ie.preventDefault()}},data:H}),n.formatOptionLabel(H,"value"))});if(C)return null;var A=_[0];return Lt.createElement(p,Ce({},v,{data:A,isDisabled:g}),this.formatOptionLabel(A,"value"))}},{key:"renderClearIndicator",value:function(){var n=this.getComponents(),a=n.ClearIndicator,s=this.commonProps,u=this.props,c=u.isDisabled,d=u.isLoading,p=this.state.isFocused;if(!this.isClearable()||!a||c||!this.hasValue()||d)return null;var m={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Lt.createElement(a,Ce({},s,{innerProps:m,isFocused:p}))}},{key:"renderLoadingIndicator",value:function(){var n=this.getComponents(),a=n.LoadingIndicator,s=this.commonProps,u=this.props,c=u.isDisabled,d=u.isLoading,p=this.state.isFocused;if(!a||!d)return null;var m={"aria-hidden":"true"};return Lt.createElement(a,Ce({},s,{innerProps:m,isDisabled:c,isFocused:p}))}},{key:"renderIndicatorSeparator",value:function(){var n=this.getComponents(),a=n.DropdownIndicator,s=n.IndicatorSeparator;if(!a||!s)return null;var u=this.commonProps,c=this.props.isDisabled,d=this.state.isFocused;return Lt.createElement(s,Ce({},u,{isDisabled:c,isFocused:d}))}},{key:"renderDropdownIndicator",value:function(){var n=this.getComponents(),a=n.DropdownIndicator;if(!a)return null;var s=this.commonProps,u=this.props.isDisabled,c=this.state.isFocused,d={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Lt.createElement(a,Ce({},s,{innerProps:d,isDisabled:u,isFocused:c}))}},{key:"renderMenu",value:function(){var n=this,a=this.getComponents(),s=a.Group,u=a.GroupHeading,c=a.Menu,d=a.MenuList,p=a.MenuPortal,m=a.LoadingMessage,v=a.NoOptionsMessage,x=a.Option,y=this.commonProps,g=this.state.focusedOption,b=this.props,C=b.captureMenuScroll,w=b.inputValue,I=b.isLoading,_=b.loadingMessage,M=b.minMenuHeight,E=b.maxMenuHeight,A=b.menuIsOpen,H=b.menuPlacement,$=b.menuPosition,U=b.menuPortalTarget,ee=b.menuShouldBlockScroll,W=b.menuShouldScrollIntoView,ie=b.noOptionsMessage,Y=b.onMenuScrollToTop,ae=b.onMenuScrollToBottom;if(!A)return null;var J=function(dt,St){var Lr=dt.type,Rt=dt.data,xe=dt.isDisabled,qe=dt.isSelected,Pt=dt.label,lt=dt.value,ft=g===Rt,Ye=xe?void 0:function(){return n.onOptionHover(Rt)},Qt=xe?void 0:function(){return n.selectOption(Rt)},fo="".concat(n.getElementId("option"),"-").concat(St),Jr={id:fo,onClick:Qt,onMouseMove:Ye,onMouseOver:Ye,tabIndex:-1,role:"option","aria-selected":n.isAppleDevice?void 0:qe};return Lt.createElement(x,Ce({},y,{innerProps:Jr,data:Rt,isDisabled:xe,isSelected:qe,key:fo,label:Pt,type:Lr,value:lt,isFocused:ft,innerRef:ft?n.getFocusedOptionRef:void 0}),n.formatOptionLabel(dt.data,"menu"))},me;if(this.hasOptions())me=this.getCategorizedOptions().map(function(st){if(st.type==="group"){var dt=st.data,St=st.options,Lr=st.index,Rt="".concat(n.getElementId("group"),"-").concat(Lr),xe="".concat(Rt,"-heading");return Lt.createElement(s,Ce({},y,{key:Rt,data:dt,options:St,Heading:u,headingProps:{id:xe,data:st.data},label:n.formatGroupLabel(st.data)}),st.options.map(function(qe){return J(qe,"".concat(Lr,"-").concat(qe.index))}))}else if(st.type==="option")return J(st,"".concat(st.index))});else if(I){var se=_({inputValue:w});if(se===null)return null;me=Lt.createElement(m,y,se)}else{var we=ie({inputValue:w});if(we===null)return null;me=Lt.createElement(v,y,we)}var Ke={minMenuHeight:M,maxMenuHeight:E,menuPlacement:H,menuPosition:$,menuShouldScrollIntoView:W},It=Lt.createElement(oP,Ce({},y,Ke),function(st){var dt=st.ref,St=st.placerProps,Lr=St.placement,Rt=St.maxHeight;return Lt.createElement(c,Ce({},y,Ke,{innerRef:dt,innerProps:{onMouseDown:n.onMenuMouseDown,onMouseMove:n.onMenuMouseMove},isLoading:I,placement:Lr}),Lt.createElement(eK,{captureEnabled:C,onTopArrive:Y,onBottomArrive:ae,lockEnabled:ee},function(xe){return Lt.createElement(d,Ce({},y,{innerRef:function(Pt){n.getMenuListRef(Pt),xe(Pt)},innerProps:{role:"listbox","aria-multiselectable":y.isMulti,id:n.getElementId("listbox")},isLoading:I,maxHeight:Rt,focusedOption:g}),me)}))});return U||$==="fixed"?Lt.createElement(p,Ce({},y,{appendTo:U,controlElement:this.controlRef,menuPlacement:H,menuPosition:$}),It):It}},{key:"renderFormField",value:function(){var n=this,a=this.props,s=a.delimiter,u=a.isDisabled,c=a.isMulti,d=a.name,p=a.required,m=this.state.selectValue;if(p&&!this.hasValue()&&!u)return Lt.createElement(oK,{name:d,onFocus:this.onValueInputFocus});if(!(!d||u))if(c)if(s){var v=m.map(function(g){return n.getOptionValue(g)}).join(s);return Lt.createElement("input",{name:d,type:"hidden",value:v})}else{var x=m.length>0?m.map(function(g,b){return Lt.createElement("input",{key:"i-".concat(b),name:d,type:"hidden",value:n.getOptionValue(g)})}):Lt.createElement("input",{name:d,type:"hidden",value:""});return Lt.createElement("div",null,x)}else{var y=m[0]?this.getOptionValue(m[0]):"";return Lt.createElement("input",{name:d,type:"hidden",value:y})}}},{key:"renderLiveRegion",value:function(){var n=this.commonProps,a=this.state,s=a.ariaSelection,u=a.focusedOption,c=a.focusedValue,d=a.isFocused,p=a.selectValue,m=this.getFocusableOptions();return Lt.createElement(GQ,Ce({},n,{id:this.getElementId("live-region"),ariaSelection:s,focusedOption:u,focusedValue:c,isFocused:d,selectValue:p,focusableOptions:m,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var n=this.getComponents(),a=n.Control,s=n.IndicatorsContainer,u=n.SelectContainer,c=n.ValueContainer,d=this.props,p=d.className,m=d.id,v=d.isDisabled,x=d.menuIsOpen,y=this.state.isFocused,g=this.commonProps=this.getCommonProps();return Lt.createElement(u,Ce({},g,{className:p,innerProps:{id:m,onKeyDown:this.onKeyDown},isDisabled:v,isFocused:y}),this.renderLiveRegion(),Lt.createElement(a,Ce({},g,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:v,isFocused:y,menuIsOpen:x}),Lt.createElement(c,Ce({},g,{isDisabled:v}),this.renderPlaceholderOrValue(),this.renderInput()),Lt.createElement(s,Ce({},g,{isDisabled:v}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(n,a){var s=a.prevProps,u=a.clearFocusValueOnUpdate,c=a.inputIsHiddenAfterUpdate,d=a.ariaSelection,p=a.isFocused,m=a.prevWasFocused,v=a.instancePrefix,x=n.options,y=n.value,g=n.menuIsOpen,b=n.inputValue,C=n.isMulti,w=Th(y),I={};if(s&&(y!==s.value||x!==s.options||g!==s.menuIsOpen||b!==s.inputValue)){var _=g?wK(n,w):[],M=g?zP(z3(n,w),"".concat(v,"-option")):[],E=u?xK(a,w):null,A=yK(a,_),H=Hh(M,A);I={selectValue:w,focusedOption:A,focusedOptionId:H,focusableOptionsWithIds:M,focusedValue:E,clearFocusValueOnUpdate:!1}}var $=c!=null&&n!==s?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},U=d,ee=p&&m;return p&&!ee&&(U={value:z0(C,w,w[0]||null),options:w,action:"initial-input-focus"},ee=!m),d?.action==="initial-input-focus"&&(U=null),Re(Re(Re({},I),$),{},{prevProps:n,ariaSelection:U,prevWasFocused:ee})}}]),r}(Ct.Component);Dh.defaultProps=CK;var Xfe=B(Ha());var LK=(0,Nh.forwardRef)(function(e,t){var r=NM(e);return rk.createElement(Dh,Ce({ref:t},r))}),ok=LK;var Sa=B(j());function Bh(e,t){if(e==null)return{};var r={},o=Object.keys(e),n,a;for(a=0;a=0)&&(r[n]=e[n]);return r}var IK=["color"],nk=(0,Sa.forwardRef)(function(e,t){var r=e.color,o=r===void 0?"currentColor":r,n=Bh(e,IK);return(0,Sa.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),(0,Sa.createElement)("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))});var SK=["color"],ak=(0,Sa.forwardRef)(function(e,t){var r=e.color,o=r===void 0?"currentColor":r,n=Bh(e,SK);return(0,Sa.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),(0,Sa.createElement)("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))});var RK=["color"],Zh=(0,Sa.forwardRef)(function(e,t){var r=e.color,o=r===void 0?"currentColor":r,n=Bh(e,RK);return(0,Sa.createElement)("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n,{ref:t}),(0,Sa.createElement)("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))});var _K=(e,t)=>{let{value:r,onChange:o,options:n=[],styles:a=GK,classNames:s=ZK,...u}=e,c=co.useId();return co.createElement(ok,{instanceId:c,ref:t,value:r,onChange:o,options:n,unstyled:!0,components:{DropdownIndicator:WK,ClearIndicator:zK,MultiValueRemove:jK,Option:UK,...e.components},styles:a,classNames:s,...u})},U0=co.forwardRef(_K),Gh={base:"flex !min-h-9 w-full rounded-md border border-input bg-transparent pl-3 py-1 pr-1 gap-1 text-sm shadow-sm transition-colors hover:cursor-pointer",focus:"outline-none ring-1 ring-ring",disabled:"cursor-not-allowed opacity-50"},AK="text-sm text-muted-foreground",MK="gap-1",TK="inline-flex items-center gap-2 rounded-md border border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80 px-1.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",PK="gap-1",kK="p-1 rounded-md",EK="bg-border",OK="p-1 rounded-md",HK="p-1 mt-1 border bg-popover shadow-md rounded-md text-popover-foreground",VK="py-2 px-1 text-secondary-foreground text-sm font-semibold",U3={base:"hover:cursor-pointer hover:bg-accent hover:text-accent-foreground px-2 py-1.5 rounded-sm !text-sm !cursor-default !select-none !outline-none font-sans",focus:"active:bg-accent/90 bg-accent text-accent-foreground",disabled:"pointer-events-none opacity-50",selected:""},FK="text-accent-foreground p-2 bg-accent border border-dashed border-border rounded-sm",DK="flex items-center justify-center h-4 w-4 opacity-50",NK="text-accent-foreground p-2 bg-accent",BK=e=>({clearIndicator:t=>K(kK,e?.clearIndicator?.(t)),container:t=>K(e?.container?.(t)),control:t=>K(Gh.base,t.isDisabled&&Gh.disabled,t.isFocused&&Gh.focus,e?.control?.(t)),dropdownIndicator:t=>K(OK,e?.dropdownIndicator?.(t)),group:t=>K(e?.group?.(t)),groupHeading:t=>K(VK,e?.groupHeading?.(t)),indicatorsContainer:t=>K(PK,e?.indicatorsContainer?.(t)),indicatorSeparator:t=>K(EK,e?.indicatorSeparator?.(t)),input:t=>K(e?.input?.(t)),loadingIndicator:t=>K(DK,e?.loadingIndicator?.(t)),loadingMessage:t=>K(NK,e?.loadingMessage?.(t)),menu:t=>K(HK,e?.menu?.(t)),menuList:t=>K(e?.menuList?.(t)),menuPortal:t=>K(e?.menuPortal?.(t)),multiValue:t=>K(TK,e?.multiValue?.(t)),multiValueLabel:t=>K(e?.multiValueLabel?.(t)),multiValueRemove:t=>K(e?.multiValueRemove?.(t)),noOptionsMessage:t=>K(FK,e?.noOptionsMessage?.(t)),option:t=>K(U3.base,t.isFocused&&U3.focus,t.isDisabled&&U3.disabled,t.isSelected&&U3.selected,e?.option?.(t)),placeholder:t=>K(AK,e?.placeholder?.(t)),singleValue:t=>K(e?.singleValue?.(t)),valueContainer:t=>K(MK,e?.valueContainer?.(t))}),ZK=BK({}),GK={input:e=>({...e,"input:focus":{boxShadow:"none"}}),multiValueLabel:e=>({...e,whiteSpace:"normal",overflow:"visible"}),control:e=>({...e,transition:"none"}),menuList:e=>({...e,"::-webkit-scrollbar":{background:"transparent"},"::-webkit-scrollbar-track":{background:"transparent"},"::-webkit-scrollbar-thumb":{background:"hsl(var(--border))"},"::-webkit-scrollbar-thumb:hover":{background:"transparent"}})},WK=e=>co.createElement(gl.DropdownIndicator,{...e},co.createElement(nk,{className:"h-4 w-4 opacity-50"})),zK=e=>co.createElement(gl.ClearIndicator,{...e},co.createElement(Zh,{className:"h-3.5 w-3.5 opacity-50"})),jK=e=>co.createElement(gl.MultiValueRemove,{...e},co.createElement(Zh,{className:"h-3 w-3 opacity-50"})),UK=e=>co.createElement(gl.Option,{...e},co.createElement("div",{className:"flex items-center justify-between"},co.createElement("div",null,e.data.label),e.isSelected&&co.createElement(ak,null)));var ik=B(j());var sk=({className:e})=>ik.createElement(o0,{size:16,className:`animate-spin ${e}`});var $3={Default:{mqtt_topic_pattern:"milight/commands/:device_id/:device_type/:group_id",mqtt_update_topic_pattern:"",mqtt_state_topic_pattern:"milight/state/:device_id/:device_type/:group_id",mqtt_client_status_topic:"milight/client_status",simple_mqtt_client_status:!0},Custom:{}},$K=({})=>{let e=so(),[t,r]=(0,hc.useState)("Custom");(0,hc.useEffect)(()=>{let a=e.getValues();for(let[s,u]of Object.entries($3))if(o(a,u)){r(s);break}},[]);let o=(a,s)=>Object.keys(s).every(u=>a[u]===s[u]),n=a=>{if(r(a),a!=="Custom"){let s=$3[a];for(let[u,c]of Object.entries(s))e.setValue(u,c,{shouldDirty:!0,shouldValidate:!0,shouldTouch:!0});e.handleSubmit(u=>{console.log(u)})()}};return it.createElement("div",{className:"mt-4 flex flex-col gap-4"},it.createElement(gn,{control:e.control,name:"topic_fields_preset",render:()=>it.createElement(vn,null,it.createElement(Cn,null,"Preset"),it.createElement(Xo,null,it.createElement(U0,{options:Object.keys($3).map(a=>({label:a,value:a})),value:{label:t,value:t},onChange:a=>n(a?.value)})),it.createElement(Ks,null,'Customize the MQTT topic patterns. Use the "Default" preset for standard configurations.'))}),t!=="Custom"&&it.createElement("div",{className:"preview-fields"},it.createElement("h4",{className:"text-sm font-medium"},"Preview:"),it.createElement("ul",null,Object.entries($3[t]).map(([a,s])=>it.createElement("li",{key:a,className:"mt-2"},it.createElement("div",null,it.createElement("strong",{className:"text-sm font-medium"},a.replace(/_/g," ").replace(/\b\w/g,u=>u.toUpperCase()),":")),it.createElement("div",null,it.createElement("code",{className:"bg-muted text-sm rounded"},s.toString())),it.createElement("div",{className:"text-sm text-muted-foreground"},rt.Settings.shape[a].description))))),t==="Custom"&&it.createElement(Vt,{fields:["mqtt_topic_pattern","mqtt_update_topic_pattern","mqtt_state_topic_pattern","mqtt_client_status_topic","simple_mqtt_client_status"]}))},XK=()=>{let{about:e,reloadAbout:t,isLoadingAbout:r}=Ri(),[o,n,a]=sm({name:["mqtt_server","mqtt_username","mqtt_password"]}),[s,u]=(0,hc.useState)(!1);(0,hc.useEffect)(()=>{let m;return u(!0),(()=>{clearTimeout(m),m=setTimeout(()=>{o&&(t(),u(!1))},2e3)})(),()=>clearTimeout(m)},[o,n,a]);let c=e?.mqtt?.status??"Unknown",d=e?.mqtt?.connected,p=r||s;return it.createElement(Vt,{title:"MQTT Connection",fields:["mqtt_server","mqtt_username","mqtt_password"],fieldTypes:{mqtt_password:"password"}},e?.mqtt?.configured&&it.createElement("div",{className:"mt-4 flex items-center"},it.createElement("span",{className:"font-medium mr-2"},"MQTT Status:")," ",p?it.createElement("div",{className:"flex items-center"},it.createElement(sk,{className:"mr-2"}),it.createElement(uo,{className:"h-6 w-20 border-gray-400"})):it.createElement("div",{className:"flex items-center"},it.createElement("span",{className:"mx-2"},d?it.createElement(L1,{size:16,className:"text-green-500"}):it.createElement(I1,{size:16,className:"text-red-500"})),it.createElement("code",null,c))))},lk=()=>it.createElement(Ro,null,it.createElement(XK,null),it.createElement(Vt,{title:"MQTT Topics",fields:[]},it.createElement($K,null)),it.createElement(Vt,{title:"Home Assistant MQTT Discovery",fields:["home_assistant_discovery_prefix"]}),it.createElement(Vt,{title:"Advanced",fields:["mqtt_state_rate_limit","mqtt_debounce_delay","mqtt_retain"]}));var X3=B(j());var uk=()=>X3.createElement(Ro,null,X3.createElement(Vt,{title:"\u2699\uFE0F Radio Pins",fields:["ce_pin","csn_pin","reset_pin"],fieldNames:{ce_pin:"Chip Enable (CE) Pin",csn_pin:"Chip Select Not (CSN) Pin",reset_pin:"Reset Pin"}}),X3.createElement(Vt,{title:"\u{1F4A1} LED",fields:["led_pin","led_mode_operating","led_mode_packet","led_mode_wifi_config","led_mode_wifi_failed","led_mode_packet_count"],fieldNames:{led_pin:"LED Pin",led_mode_operating:"LED Mode: Idle",led_mode_packet:"LED Mode: Packet Sent/Received",led_mode_wifi_config:"LED Mode: WiFi in Config Mode",led_mode_wifi_failed:"LED Mode: WiFi Connection Failed",led_mode_packet_count:"LED Packet Blink Count"}}));var q3=B(j());var ck=()=>q3.createElement(Ro,null,q3.createElement(Vt,{title:"\u{1F512} Security",fields:["admin_username","admin_password"],fieldTypes:{admin_password:"password"}}),q3.createElement(Vt,{title:"\u{1F4F6} WiFi",fields:["hostname","wifi_static_ip","wifi_static_ip_gateway","wifi_static_ip_netmask","wifi_mode"],fieldNames:{wifi_static_ip:"Static IP",wifi_static_ip_gateway:"Static IP Gateway",wifi_static_ip_netmask:"Static IP Netmask"}}));var ne=B(j());var q1=B(j());var qK=Zn("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive dark:[&:not(:has(svg))]:text-red-500 dark:[&>svg]:text-red-500 dark:[&>*]:text-red-500"}},defaultVariants:{variant:"default"}}),Wh=q1.forwardRef(({className:e,variant:t,...r},o)=>q1.createElement("div",{ref:o,role:"alert",className:K(qK({variant:t}),e),...r}));Wh.displayName="Alert";var zh=q1.forwardRef(({className:e,...t},r)=>q1.createElement("h5",{ref:r,className:K("mb-1 font-medium leading-none tracking-tight",e),...t}));zh.displayName="AlertTitle";var jh=q1.forwardRef(({className:e,...t},r)=>q1.createElement("div",{ref:r,className:K("text-sm [&_p]:leading-relaxed",e),...t}));jh.displayName="AlertDescription";function YK(e,t){let r=e.split(".").map(Number),o=t.split(".").map(Number);for(let n=0;ns)return 1;if(a{let{toast:e}=Ya();return ne.createElement("div",{className:"space-y-2 mt-10"},ne.createElement(yt,{variant:"destructive",onClick:async()=>{try{e({title:"Reboot initiated",description:"The device will restart shortly.",variant:"default"});let r=await hn.postSystem({command:"restart"});r.success||e({title:"Error initiating reboot",description:r.error,variant:"destructive"})}catch(r){r instanceof Error?e({title:"Error initiating reboot",description:r.message,variant:"destructive"}):e({title:"Error initiating reboot",description:"An unknown error occurred.",variant:"destructive"})}}},"Reboot Now"))},QK=()=>{let{toast:e}=Ya(),[t,r]=ne.useState(null),[o,n]=ne.useState(!1),a=u=>{console.log(u.target.files);let c=u.target.files?.[0];r(c||null)},s=async()=>{if(n(!0),e({title:"Uploading backup",description:"Please wait while your backup is uploaded.",variant:"default"}),!!t)try{let u=await hn.postBackup({file:t});u.success?e({title:"Success",description:u.message,variant:"default"}):e({title:"Error uploading backup",description:u.message,variant:"destructive"})}catch(u){e({title:"Error uploading backup",description:u instanceof Error?u.message:"An unknown error occurred",variant:"destructive"})}finally{r(null),n(!1)}};return ne.createElement("div",{className:"space-y-4"},ne.createElement("p",{className:"text-sm text-muted-foreground"},"Backups contain configuration data and devices you've registered with the hub. It does not contain states of lights."),ne.createElement("div",{className:"space-y-2"},ne.createElement("h3",{className:"text-lg font-medium"},"Create Backup"),ne.createElement(yt,{variant:"secondary",asChild:!0},ne.createElement("a",{href:"/backup",download:"espmh-backup.bin"},"Download Backup"))),ne.createElement("div",{className:"space-y-2"},ne.createElement("h3",{className:"text-lg font-medium mt-10"},"Restore Backup"),ne.createElement("form",{onSubmit:s},ne.createElement("div",{className:"flex items-center space-x-2"},ne.createElement(lo,{type:"file",id:"backupFile",onChange:a,value:t?void 0:"",accept:".bin",className:"flex-grow"}),ne.createElement(yt,{disabled:!t||o,onClick:u=>{u.preventDefault(),s()},variant:"secondary"},"Upload Backup")))))},KK=({currentVersion:e,variant:t})=>{let{toast:r}=Ya(),[o,n]=ne.useState(null),[a,s]=ne.useState(!1),[u,c]=ne.useState(!1),[d,p]=ne.useState(null),m=b=>{let C=b.target.files?.[0];n(C||null)},v=async()=>{c(!0),r({title:"Update started",description:"Do not turn off the device until the update is complete.",variant:"default"}),hn.postFirmware({file:o}).then(()=>{r({title:"Success",description:"The update is complete. The device will restart.",variant:"default"})}).catch(b=>{r({title:"Error uploading firmware",description:b.message,variant:"destructive"})}).finally(()=>{c(!1)})},x=async()=>{s(!0);try{let C=await(await fetch("https://api.github.com/repos/sidoh/esp8266_milight_hub/releases/latest")).json();p({version:C.tag_name,url:C.html_url,body:C.body,download_links:C.assets.map(w=>({name:w.name,url:w.browser_download_url})),release_date:C.published_at})}catch{r({title:"Error checking latest version",description:"Failed to fetch the latest version from GitHub.",variant:"destructive"})}finally{s(!1)}},y=ne.useMemo(()=>!e||!d?!1:YK(d.version,e)>0,[e,d]),g=ne.useMemo(()=>!d||!t?null:d.download_links.find(b=>b.name.toLowerCase().includes(t.toLowerCase())),[d,t]);return console.log(t,d),ne.createElement("div",{className:"space-y-4"},ne.createElement(Wh,{variant:"destructive"},ne.createElement(S1,{className:"h-4 w-4"}),ne.createElement(zh,null,"Warning"),ne.createElement(jh,null,"Always create a backup before updating firmware!")),ne.createElement("div",{className:"space-y-2"},ne.createElement("h3",{className:"text-lg font-medium"},"Upload Firmware"),ne.createElement("form",{onSubmit:v},ne.createElement("div",{className:"flex items-center space-x-2"},ne.createElement(lo,{type:"file",id:"firmwareFile",onChange:m,value:o?void 0:"",accept:".bin",className:"flex-grow"}),ne.createElement(yt,{disabled:!o||u,onClick:b=>{b.preventDefault(),v()},variant:"secondary"},"Upload Firmware")))),!d&&ne.createElement("div",{className:"space-y-2"},ne.createElement("h3",{className:"text-lg font-medium"},"Check for Updates"),ne.createElement("div",{className:"flex items-center space-x-2"},ne.createElement(yt,{onClick:x,disabled:a,variant:"secondary"},a?"Checking...":"Check Latest Version"))),d&&ne.createElement("div",{className:"space-y-2 border p-4 rounded-md"},ne.createElement("h3",{className:"text-lg font-medium"},"Latest Version Information"),ne.createElement("hr",{className:"my-4"}),y&&ne.createElement("p",{className:"text-green-600 font-semibold"},"A new version is available!"),ne.createElement("p",null,ne.createElement("strong",null,"Version:")," ",d.version),ne.createElement("p",null,ne.createElement("strong",null,"Release Date:")," ",new Date(d.release_date).toLocaleString()),ne.createElement("p",null,ne.createElement("strong",null,"Release Notes:")),ne.createElement("pre",{className:"whitespace-pre-wrap text-sm bg-muted p-2 rounded-md"},d.body),ne.createElement("div",{className:"space-x-2"},ne.createElement(yt,{asChild:!0,variant:"outline"},ne.createElement("a",{href:d.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub")),g&&ne.createElement(yt,{asChild:!0,variant:"secondary"},ne.createElement("a",{href:g.url,download:!0},"Download Firmware")))))},eee=({systemInfo:e,isLoading:t})=>t?ne.createElement("div",{className:"space-y-2"},ne.createElement(uo,{className:"h-4 w-[200px]"}),ne.createElement(uo,{className:"h-4 w-[150px]"}),ne.createElement(uo,{className:"h-4 w-[180px]"}),ne.createElement(uo,{className:"h-4 w-[160px]"})):e?ne.createElement("div",{className:"space-y-2"},ne.createElement("div",{className:"flex"},ne.createElement("strong",{className:"w-40"},"Firmware:")," ",e?.firmware),ne.createElement("div",{className:"flex"},ne.createElement("strong",{className:"w-40"},"Version:")," ",e?.version),ne.createElement("div",{className:"flex"},ne.createElement("strong",{className:"w-40"},"IP Address:")," ",e?.ip_address),ne.createElement("div",{className:"flex"},ne.createElement("strong",{className:"w-40"},"Variant:")," ",e?.variant),ne.createElement("div",{className:"flex"},ne.createElement("strong",{className:"w-40"},"Free Heap:")," ",e?.free_heap," ","bytes"),ne.createElement("div",{className:"flex"},ne.createElement("strong",{className:"w-40"},"Arduino Version:")," ",e?.arduino_version),ne.createElement("div",{className:"flex"},ne.createElement("strong",{className:"w-40"},"Last Reset Reason:")," ",e?.reset_reason),ne.createElement("div",{className:"flex"},ne.createElement("strong",{className:"w-40"},"Dropped Packets:")," ",e?.queue_stats?.dropped_packets)):ne.createElement(ne.Fragment,null," "),dk=()=>{let{about:e,isLoadingAbout:t}=Ri();return ne.createElement(Ro,null,ne.createElement(Vt,{title:"\u{1F5A5}\uFE0F System Information",fields:[]},ne.createElement(eee,{systemInfo:e,isLoading:t})),ne.createElement(Vt,{title:"\u{1F527} Firmware",fields:[]},ne.createElement(KK,{currentVersion:e?.version??null,variant:e?.variant??null})),ne.createElement(Vt,{title:"\u{1F4BE} Backups",fields:[]},ne.createElement(QK,null)),ne.createElement(Vt,{title:"\u{1F504} Reboot",fields:["auto_restart_period"]},ne.createElement(JK,null)))};var gc=B(j());var fk=()=>gc.createElement(Ro,null,gc.createElement(Vt,{title:"\u{1F4FB} Device",fields:["radio_interface_type","rf24_power_level","rf24_channels"]}),gc.createElement(Vt,{title:"\u{1F4E1} Listening",fields:["rf24_listen_channel","ignored_listen_protocols","listen_repeats"]}),gc.createElement(Vt,{title:"\u{1F501} Repeats",fields:["packet_repeats","packet_repeats_per_loop"]}),gc.createElement(Vt,{title:"\u23F1\uFE0F Throttling",fields:["packet_repeat_throttle_sensitivity","packet_repeat_throttle_threshold","packet_repeat_minimum"]}));var vr=B(j()),vc=B(j());var Uh={HomeAssistant:["state","brightness","computed_color","mode","color_temp","color_mode"],Custom:[]},tee=()=>{let e=so(),[t,r]=(0,vc.useState)("");return(0,vc.useEffect)(()=>{let o=e.watch("group_state_fields"),n={};o?.forEach(a=>{switch(a){case"state":case"status":n[a]="ON";break;case"brightness":n[a]=75;break;case"level":n[a]=191;break;case"hue":n[a]=180;break;case"saturation":n[a]=100;break;case"color":n[a]={r:0,g:255,b:255};break;case"mode":n[a]=1;break;case"kelvin":n[a]=100;break;case"color_temp":n[a]=370;break;case"bulb_mode":n[a]="white";break;case"computed_color":n.color={r:255,g:255,b:255};break;case"effect":n[a]="1";break;case"device_id":n[a]=1;break;case"group_id":n[a]=1;break;case"device_type":n[a]="rgb_cct";break;case"oh_color":n.color="0,255,255";break;case"hex_color":n.color="#00FFFF";break;case"color_mode":n[a]="rgb";break}}),r(JSON.stringify(n,null,2))},[e.watch("group_state_fields")]),vr.createElement("div",{className:"flex flex-col gap-2 mt-4"},vr.createElement("div",{className:"text-sm font-medium"},"Preview"),vr.createElement("pre",{className:"text-sm text-muted-foreground"},t))},ree=({})=>{let e=so(),[t,r]=(0,vc.useState)("Custom");(0,vc.useEffect)(()=>{let a=new Set(e.getValues("group_state_fields"));for(let[s,u]of Object.entries(Uh))if(o(a,new Set(u))){r(s);break}},[]);let o=(a,s)=>a.size===s.size&&[...a].every(u=>s.has(u)),n=a=>{r(a),a!=="Custom"&&e.setValue("group_state_fields",Uh[a],{shouldDirty:!0,shouldValidate:!0,shouldTouch:!0})};return vr.createElement("div",{className:"mt-4 flex flex-col gap-4"},vr.createElement(gn,{control:e.control,name:"group_state_fields_preset",render:()=>vr.createElement(vn,null,vr.createElement(Cn,null,"Preset"),vr.createElement(Xo,null,vr.createElement(U0,{options:Object.keys(Uh).map(a=>({label:a,value:a})),value:{label:t,value:t},onChange:a=>n(a?.value)})),vr.createElement(Ks,null,"Customize the fields sent in MQTT state updates and in REST API responses. If you're using HomeAssistant, use the preset to ensure compatibility."))}),t==="Custom"&&vr.createElement(gn,{key:"group_state_fields",control:e.control,name:"group_state_fields",render:({field:a})=>vr.createElement(vn,null,vr.createElement(Cn,null,"Custom Fields"),vr.createElement(Xo,null,vr.createElement(U0,{isMulti:!0,options:Object.entries(rt.GroupStateField.Values).map(([s,u])=>({label:s,value:s})),value:a.value?.map(s=>({label:s,value:s})),onChange:s=>{a.onChange(s.map(u=>u.value))}})))}),vr.createElement(tee,null))},pk=()=>vr.createElement(Ro,null,vr.createElement(Vt,{title:"\u{1F527} State Fields",fields:[]},vr.createElement(ree,null)),vr.createElement(Vt,{title:"\u{1F50D} Miscellaneous",fields:["enable_automatic_mode_switching","default_transition_period","state_flush_interval"]}));var Ft=B(j());var oee=[{value:"5",label:"v5"},{value:"6",label:"v6"}],nee=()=>{let{setValue:e,getValues:t}=so(),[r,o]=Ft.useState(()=>t("gateway_configs")||[]),[n,a]=Ft.useState(!1),s=()=>{o([...r,[0,0,6]]),a(!0)},u=p=>{o(r.filter((m,v)=>v!==p)),a(!0)},c=(p,m,v)=>{let x=[...r];x[p][m]=v,o(x),a(!0)},d=()=>{e("gateway_configs",r,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),a(!1)};return Ft.createElement(Ro,null,Ft.createElement(Vt,{title:"Gateway Configurations",fields:[]},Ft.createElement("div",{className:"grid grid-cols-[3fr_3fr_3fr_1fr] gap-2 mb-2 font-semibold"},Ft.createElement("div",null,"Remote ID"),Ft.createElement("div",null,"UDP Port"),Ft.createElement("div",null,"Protocol"),Ft.createElement("div",null,Ft.createElement(yt,{onClick:s,variant:"secondary",size:"icon",className:"rounded-full","aria-label":"Add gateway config"},Ft.createElement(Ws,{className:"h-4 w-4"})))),r.map((p,m)=>Ft.createElement("div",{key:m,className:"grid grid-cols-[3fr_3fr_3fr_1fr] gap-2 mb-2 items-center"},Ft.createElement(lo,{type:"number",value:p[0],onChange:v=>c(m,0,parseInt(v.target.value)),placeholder:"Remote ID"}),Ft.createElement(lo,{type:"number",value:p[1],onChange:v=>c(m,1,parseInt(v.target.value)),placeholder:"UDP Port"}),Ft.createElement(Yo,{type:"single",value:p[2].toString(),onValueChange:v=>c(m,2,parseInt(v))},oee.map(v=>Ft.createElement(qr,{key:v.value,value:v.value},v.label))),Ft.createElement("div",{className:"flex justify-center"},Ft.createElement(yt,{onClick:()=>u(m),variant:"ghost",size:"icon",className:"text-red-500 hover:text-red-700 hover:bg-red-100","aria-label":"Remove gateway config"},Ft.createElement(i0,{className:"h-4 w-4"}))))),Ft.createElement("div",{className:"flex justify-between mt-2"},Ft.createElement(yt,{onClick:d,disabled:!n},"Save Changes")),Ft.createElement("div",{className:"text-sm text-muted-foreground mt-4"},Ft.createElement("p",null,"Add servers which mimic the UDP protocol used by official Milight gateways. You should only use this if you're trying to integrate with a device or service that requires it. MQTT and the REST API are more reliable!"))))},mk=()=>Ft.createElement(Ro,null,Ft.createElement(Vt,{title:"Discovery",fields:["discovery_port"]}),Ft.createElement(nee,null));var gk=B(hk());var aee=[{title:"Network",id:"network"},{title:"Hardware",id:"hardware"},{title:"MQTT",id:"mqtt"},{title:"Radio",id:"radio"},{title:"State",id:"state"},{title:"UDP",id:"udp"},{title:"System",id:"system"}];function $h(){let{settings:e,isLoading:t}=Ri(),r=p5({resolver:m5(rt.Settings),defaultValues:{},mode:"onBlur"}),o=(0,X0.useCallback)((0,gk.debounce)(()=>{let n={};for(let a in r.formState.dirtyFields)n[a]=r.getValues(a);Object.keys(n).length>0&&hn.putSettings(n).then(()=>{r.reset(r.getValues())})},300),[r]);return(0,X0.useEffect)(()=>{let n=r.watch((a,{name:s})=>{!s||!(s in rt.Settings.shape)||o()});return()=>n.unsubscribe()},[r]),(0,X0.useEffect)(()=>{e&&r.reset(e)},[e]),t?Wr.createElement("div",{className:"flex justify-center h-screen space-x-4"},Wr.createElement("div",{className:"w-1/5 h-full max-h-96"},Wr.createElement(uo,{className:"w-full h-full"})),Wr.createElement("div",{className:"w-3/5 h-full flex flex-col space-y-4"},Wr.createElement(uo,{className:"w-full h-10"}),Wr.createElement(uo,{className:"w-full h-10"}),Wr.createElement(uo,{className:"w-full h-10"}))):Wr.createElement(f5,{...r},Wr.createElement("form",{onBlur:o,onSubmit:n=>{n.preventDefault(),r.handleSubmit(o)()}},Wr.createElement(EM,{items:aee},Wr.createElement(ck,{navId:"network"}),Wr.createElement(uk,{navId:"hardware"}),Wr.createElement(lk,{navId:"mqtt"}),Wr.createElement(fk,{navId:"radio"}),Wr.createElement(pk,{navId:"state"}),Wr.createElement(mk,{navId:"udp"}),Wr.createElement(dk,{navId:"system"}))))}var Y1=B(j());var To=B(j());var Be=B(j(),1),Ck=B(Ha(),1);var wt=B(Et(),1),Qh="ToastProvider",[Kh,iee,see]=E1("Toast"),[wk,R5e]=Wa("Toast",[see]),[lee,J3]=wk(Qh),xk=e=>{let{__scopeToast:t,label:r="Notification",duration:o=5e3,swipeDirection:n="right",swipeThreshold:a=50,children:s}=e,[u,c]=Be.useState(null),[d,p]=Be.useState(0),m=Be.useRef(!1),v=Be.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Qh}\`. Expected non-empty \`string\`.`),(0,wt.jsx)(Kh.Provider,{scope:t,children:(0,wt.jsx)(lee,{scope:t,label:r,duration:o,swipeDirection:n,swipeThreshold:a,toastCount:d,viewport:u,onViewportChange:c,onToastAdd:Be.useCallback(()=>p(x=>x+1),[]),onToastRemove:Be.useCallback(()=>p(x=>x-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:v,children:s})})};xk.displayName=Qh;var yk="ToastViewport",uee=["F8"],qh="toast.viewportPause",Yh="toast.viewportResume",bk=Be.forwardRef((e,t)=>{let{__scopeToast:r,hotkey:o=uee,label:n="Notifications ({hotkey})",...a}=e,s=J3(yk,r),u=iee(r),c=Be.useRef(null),d=Be.useRef(null),p=Be.useRef(null),m=Be.useRef(null),v=Ue(t,m,s.onViewportChange),x=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=s.toastCount>0;Be.useEffect(()=>{let b=C=>{o.length!==0&&o.every(I=>C[I]||C.code===I)&&m.current?.focus()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[o]),Be.useEffect(()=>{let b=c.current,C=m.current;if(y&&b&&C){let w=()=>{if(!s.isClosePausedRef.current){let E=new CustomEvent(qh);C.dispatchEvent(E),s.isClosePausedRef.current=!0}},I=()=>{if(s.isClosePausedRef.current){let E=new CustomEvent(Yh);C.dispatchEvent(E),s.isClosePausedRef.current=!1}},_=E=>{!b.contains(E.relatedTarget)&&I()},M=()=>{b.contains(document.activeElement)||I()};return b.addEventListener("focusin",w),b.addEventListener("focusout",_),b.addEventListener("pointermove",w),b.addEventListener("pointerleave",M),window.addEventListener("blur",w),window.addEventListener("focus",I),()=>{b.removeEventListener("focusin",w),b.removeEventListener("focusout",_),b.removeEventListener("pointermove",w),b.removeEventListener("pointerleave",M),window.removeEventListener("blur",w),window.removeEventListener("focus",I)}}},[y,s.isClosePausedRef]);let g=Be.useCallback(({tabbingDirection:b})=>{let w=u().map(I=>{let _=I.ref.current,M=[_,...bee(_)];return b==="forwards"?M:M.reverse()});return(b==="forwards"?w.reverse():w).flat()},[u]);return Be.useEffect(()=>{let b=m.current;if(b){let C=w=>{let I=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!I){let M=document.activeElement,E=w.shiftKey;if(w.target===b&&E){d.current?.focus();return}let $=g({tabbingDirection:E?"backwards":"forwards"}),U=$.findIndex(ee=>ee===M);Xh($.slice(U+1))?w.preventDefault():E?d.current?.focus():p.current?.focus()}};return b.addEventListener("keydown",C),()=>b.removeEventListener("keydown",C)}},[u,g]),(0,wt.jsxs)(_I,{ref:c,role:"region","aria-label":n.replace("{hotkey}",x),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&(0,wt.jsx)(Jh,{ref:d,onFocusFromOutsideViewport:()=>{let b=g({tabbingDirection:"forwards"});Xh(b)}}),(0,wt.jsx)(Kh.Slot,{scope:r,children:(0,wt.jsx)(be.ol,{tabIndex:-1,...a,ref:v})}),y&&(0,wt.jsx)(Jh,{ref:p,onFocusFromOutsideViewport:()=>{let b=g({tabbingDirection:"backwards"});Xh(b)}})]})});bk.displayName=yk;var Lk="ToastFocusProxy",Jh=Be.forwardRef((e,t)=>{let{__scopeToast:r,onFocusFromOutsideViewport:o,...n}=e,a=J3(Lk,r);return(0,wt.jsx)(ju,{"aria-hidden":!0,tabIndex:0,...n,ref:t,style:{position:"fixed"},onFocus:s=>{let u=s.relatedTarget;!a.viewport?.contains(u)&&o()}})});Jh.displayName=Lk;var Q3="Toast",cee="toast.swipeStart",dee="toast.swipeMove",fee="toast.swipeCancel",pee="toast.swipeEnd",Ik=Be.forwardRef((e,t)=>{let{forceMount:r,open:o,defaultOpen:n,onOpenChange:a,...s}=e,[u=!0,c]=Nr({prop:o,defaultProp:n,onChange:a});return(0,wt.jsx)(Xs,{present:r||u,children:(0,wt.jsx)(gee,{open:u,...s,ref:t,onClose:()=>c(!1),onPause:ur(e.onPause),onResume:ur(e.onResume),onSwipeStart:Se(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Se(e.onSwipeMove,d=>{let{x:p,y:m}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${m}px`)}),onSwipeCancel:Se(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Se(e.onSwipeEnd,d=>{let{x:p,y:m}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${m}px`),c(!1)})})})});Ik.displayName=Q3;var[mee,hee]=wk(Q3,{onClose(){}}),gee=Be.forwardRef((e,t)=>{let{__scopeToast:r,type:o="foreground",duration:n,open:a,onClose:s,onEscapeKeyDown:u,onPause:c,onResume:d,onSwipeStart:p,onSwipeMove:m,onSwipeCancel:v,onSwipeEnd:x,...y}=e,g=J3(Q3,r),[b,C]=Be.useState(null),w=Ue(t,Y=>C(Y)),I=Be.useRef(null),_=Be.useRef(null),M=n||g.duration,E=Be.useRef(0),A=Be.useRef(M),H=Be.useRef(0),{onToastAdd:$,onToastRemove:U}=g,ee=ur(()=>{b?.contains(document.activeElement)&&g.viewport?.focus(),s()}),W=Be.useCallback(Y=>{!Y||Y===1/0||(window.clearTimeout(H.current),E.current=new Date().getTime(),H.current=window.setTimeout(ee,Y))},[ee]);Be.useEffect(()=>{let Y=g.viewport;if(Y){let ae=()=>{W(A.current),d?.()},J=()=>{let me=new Date().getTime()-E.current;A.current=A.current-me,window.clearTimeout(H.current),c?.()};return Y.addEventListener(qh,J),Y.addEventListener(Yh,ae),()=>{Y.removeEventListener(qh,J),Y.removeEventListener(Yh,ae)}}},[g.viewport,M,c,d,W]),Be.useEffect(()=>{a&&!g.isClosePausedRef.current&&W(M)},[a,M,g.isClosePausedRef,W]),Be.useEffect(()=>($(),()=>U()),[$,U]);let ie=Be.useMemo(()=>b?Pk(b):null,[b]);return g.viewport?(0,wt.jsxs)(wt.Fragment,{children:[ie&&(0,wt.jsx)(vee,{__scopeToast:r,role:"status","aria-live":o==="foreground"?"assertive":"polite","aria-atomic":!0,children:ie}),(0,wt.jsx)(mee,{scope:r,onClose:ee,children:Ck.createPortal((0,wt.jsx)(Kh.ItemSlot,{scope:r,children:(0,wt.jsx)(RI,{asChild:!0,onEscapeKeyDown:Se(u,()=>{g.isFocusedToastEscapeKeyDownRef.current||ee(),g.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,wt.jsx)(be.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":g.swipeDirection,...y,ref:w,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Se(e.onKeyDown,Y=>{Y.key==="Escape"&&(u?.(Y.nativeEvent),Y.nativeEvent.defaultPrevented||(g.isFocusedToastEscapeKeyDownRef.current=!0,ee()))}),onPointerDown:Se(e.onPointerDown,Y=>{Y.button===0&&(I.current={x:Y.clientX,y:Y.clientY})}),onPointerMove:Se(e.onPointerMove,Y=>{if(!I.current)return;let ae=Y.clientX-I.current.x,J=Y.clientY-I.current.y,me=!!_.current,se=["left","right"].includes(g.swipeDirection),we=["left","up"].includes(g.swipeDirection)?Math.min:Math.max,Ke=se?we(0,ae):0,It=se?0:we(0,J),st=Y.pointerType==="touch"?10:2,dt={x:Ke,y:It},St={originalEvent:Y,delta:dt};me?(_.current=dt,Y3(dee,m,St,{discrete:!1})):vk(dt,g.swipeDirection,st)?(_.current=dt,Y3(cee,p,St,{discrete:!1}),Y.target.setPointerCapture(Y.pointerId)):(Math.abs(ae)>st||Math.abs(J)>st)&&(I.current=null)}),onPointerUp:Se(e.onPointerUp,Y=>{let ae=_.current,J=Y.target;if(J.hasPointerCapture(Y.pointerId)&&J.releasePointerCapture(Y.pointerId),_.current=null,I.current=null,ae){let me=Y.currentTarget,se={originalEvent:Y,delta:ae};vk(ae,g.swipeDirection,g.swipeThreshold)?Y3(pee,x,se,{discrete:!0}):Y3(fee,v,se,{discrete:!0}),me.addEventListener("click",we=>we.preventDefault(),{once:!0})}})})})}),g.viewport)})]}):null}),vee=e=>{let{__scopeToast:t,children:r,...o}=e,n=J3(Q3,t),[a,s]=Be.useState(!1),[u,c]=Be.useState(!1);return xee(()=>s(!0)),Be.useEffect(()=>{let d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),u?null:(0,wt.jsx)($s,{asChild:!0,children:(0,wt.jsx)(ju,{...o,children:a&&(0,wt.jsxs)(wt.Fragment,{children:[n.label," ",r]})})})},Cee="ToastTitle",Sk=Be.forwardRef((e,t)=>{let{__scopeToast:r,...o}=e;return(0,wt.jsx)(be.div,{...o,ref:t})});Sk.displayName=Cee;var wee="ToastDescription",Rk=Be.forwardRef((e,t)=>{let{__scopeToast:r,...o}=e;return(0,wt.jsx)(be.div,{...o,ref:t})});Rk.displayName=wee;var _k="ToastAction",Ak=Be.forwardRef((e,t)=>{let{altText:r,...o}=e;return r.trim()?(0,wt.jsx)(Tk,{altText:r,asChild:!0,children:(0,wt.jsx)(eg,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${_k}\`. Expected non-empty \`string\`.`),null)});Ak.displayName=_k;var Mk="ToastClose",eg=Be.forwardRef((e,t)=>{let{__scopeToast:r,...o}=e,n=hee(Mk,r);return(0,wt.jsx)(Tk,{asChild:!0,children:(0,wt.jsx)(be.button,{type:"button",...o,ref:t,onClick:Se(e.onClick,n.onClose)})})});eg.displayName=Mk;var Tk=Be.forwardRef((e,t)=>{let{__scopeToast:r,altText:o,...n}=e;return(0,wt.jsx)(be.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...n,ref:t})});function Pk(e){let t=[];return Array.from(e.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),yee(o)){let n=o.ariaHidden||o.hidden||o.style.display==="none",a=o.dataset.radixToastAnnounceExclude==="";if(!n)if(a){let s=o.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...Pk(o))}}),t}function Y3(e,t,r,{discrete:o}){let n=r.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?Z9(n,a):n.dispatchEvent(a)}var vk=(e,t,r=0)=>{let o=Math.abs(e.x),n=Math.abs(e.y),a=o>n;return t==="left"||t==="right"?a&&o>r:!a&&n>r};function xee(e=()=>{}){let t=ur(e);or(()=>{let r=0,o=0;return r=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(o)}},[t])}function yee(e){return e.nodeType===e.ELEMENT_NODE}function bee(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{let n=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||n?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Xh(e){let t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var kk=xk,tg=bk,rg=Ik,og=Sk,ng=Rk,ag=Ak,ig=eg;var Ek=kk,sg=To.forwardRef(({className:e,...t},r)=>To.createElement(tg,{ref:r,className:K("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));sg.displayName=tg.displayName;var Iee=Zn("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),lg=To.forwardRef(({className:e,variant:t,...r},o)=>To.createElement(rg,{ref:o,className:K(Iee({variant:t}),e),...r}));lg.displayName=rg.displayName;var See=To.forwardRef(({className:e,...t},r)=>To.createElement(ag,{ref:r,className:K("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));See.displayName=ag.displayName;var ug=To.forwardRef(({className:e,...t},r)=>To.createElement(ig,{ref:r,className:K("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t},To.createElement(Si,{className:"h-4 w-4"})));ug.displayName=ig.displayName;var cg=To.forwardRef(({className:e,...t},r)=>To.createElement(og,{ref:r,className:K("text-sm font-semibold",e),...t}));cg.displayName=og.displayName;var dg=To.forwardRef(({className:e,...t},r)=>To.createElement(ng,{ref:r,className:K("text-sm opacity-90",e),...t}));dg.displayName=ng.displayName;function Ok(){let{toasts:e}=Ya();return Y1.createElement(Ek,null,e.map(function({id:t,title:r,description:o,action:n,...a}){return Y1.createElement(lg,{key:t,...a},Y1.createElement("div",{className:"grid gap-1"},r&&Y1.createElement(cg,null,r),o&&Y1.createElement(dg,null,o)),n,Y1.createElement(ug,null))}),Y1.createElement(sg,null))}var We=B(j());var Hk=B(j());var Ree=Zn("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function K3({className:e,variant:t,...r}){return Hk.createElement("div",{className:K(Ree({variant:t}),e),...r})}var _ee=e=>e.map(t=>t.toString(16).padStart(2,"0").toUpperCase()).join(" ");function Aee(){let{allMessages:e}=u3(),[t,r]=(0,We.useState)(null),o=Ya(),n=u=>{navigator.clipboard.writeText(u).then(()=>{o.toast({title:"Copied to clipboard",description:"Device ID has been copied to clipboard"})}).catch(c=>{console.error("Failed to copy: ",c)})},a=()=>[...e].reverse().map((u,c)=>We.default.createElement(yt,{key:c,variant:"ghost",className:"w-full text-left justify-start flex flex-col items-start p-2 h-auto",onClick:()=>r(u)},We.default.createElement("div",{className:"flex space-x-2 mb-1"},We.default.createElement(K3,{variant:"secondary"},"Device ID: ",u.d.di),We.default.createElement(K3,{variant:"secondary"},"Group ID: ",u.d.gi),We.default.createElement(K3,{variant:"secondary"},"Remote Type: ",u.d.rt)),u.u&&Object.keys(u.u).length>0?We.default.createElement("span",{className:"text-sm text-muted-foreground"},"Command: ",Object.keys(u.u)[0]," = ",JSON.stringify(Object.values(u.u)[0])):We.default.createElement("span",{className:"text-sm text-muted-foreground"},"No command"))),s=u=>We.default.createElement("div",{className:"space-y-2"},We.default.createElement("p",{className:"flex items-center"},We.default.createElement("strong",null,"Device ID:"),We.default.createElement("span",{className:"ml-2"},u.d.di),We.default.createElement(yt,{variant:"ghost",size:"icon",className:"h-6 w-6 ml-2",onClick:()=>n(u.d.di.toString())},We.default.createElement(t0,{className:"h-4 w-4"}))),We.default.createElement("p",null,We.default.createElement("strong",null,"Group ID:")," ",u.d.gi),We.default.createElement("p",null,We.default.createElement("strong",null,"Remote Type:")," ",u.d.rt),We.default.createElement("p",null,We.default.createElement("strong",null,"Packet:")," ",We.default.createElement("code",{className:"bg-muted text-sm p-1 rounded"},_ee(u.p))),We.default.createElement("div",null,We.default.createElement("strong",null,"State:"),We.default.createElement("pre",{className:"text-xs mt-1"},JSON.stringify(u.s,null,2))),u.u&&Object.keys(u.u).length>0&&We.default.createElement("div",null,We.default.createElement("strong",null,"Command:"),Object.entries(u.u).map(([c,d])=>We.default.createElement("div",{key:c,className:"ml-2"},We.default.createElement("strong",null,c,":")," ",JSON.stringify(d)))));return We.default.createElement("div",{className:"grid grid-cols-2 h-[calc(100vh-2rem)] border rounded-lg overflow-hidden"},We.default.createElement("div",{className:"h-full overflow-y-auto border-r"},We.default.createElement(Ba,{className:"border-b"},We.default.createElement(Za,null,"Event List")),We.default.createElement(Ga,{className:"mt-5"},a())),We.default.createElement("div",{className:"h-full overflow-y-auto"},We.default.createElement(Ba,{className:"border-b"},We.default.createElement(Za,null,"Event Details")),We.default.createElement(Ga,{className:"mt-5"},t?s(t):We.default.createElement("p",{className:"text-muted-foreground"},"Select an event to view details"))))}function fg(){return We.default.createElement("div",{className:"container mx-auto p-4"},We.default.createElement(Aee,null))}var pg={"/dashboard":PM,"/not-found":kM,"/settings":$h,"/sniffer":fg};function Fk(){let[e,t]=(0,Po.useState)(null);(0,Po.useEffect)(()=>{let o=()=>{let n=window.location.hash.slice(1);t(n)};return window.addEventListener("hashchange",o),o(),()=>{window.removeEventListener("hashchange",o)}},[]);let r=e?pg[e]||pg["/not-found"]:pg["/dashboard"];return Po.default.createElement(eI,null,Po.default.createElement(rI,null,Po.default.createElement(AM,null,Po.default.createElement("div",{className:"bg-background text-foreground flex flex-col items-center justify-start"},Po.default.createElement("div",{className:"container mx-auto px-4"},Po.default.createElement(oI,null),Po.default.createElement("main",{className:"flex flex-col pt-10"},r&&Po.default.createElement(r,null)),Po.default.createElement(Ok,null))))))}var mg=document.getElementById("page");mg?(mg.innerHTML="",(0,Vk.createRoot)(mg).render(Po.default.createElement(Fk,null))):console.error("Could not find element with id 'page'");})(); +/*! Bundled license information: + +react/cjs/react.production.min.js: + (** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +scheduler/cjs/scheduler.production.min.js: + (** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +react-dom/cjs/react-dom.production.min.js: + (** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +react/cjs/react-jsx-runtime.production.min.js: + (** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +react-is/cjs/react-is.production.min.js: + (** @license React v16.13.1 + * react-is.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + *) + +lodash/lodash.js: + (** + * @license + * Lodash + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + *) + +lucide-react/dist/esm/shared/src/utils.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/defaultAttributes.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/Icon.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/createLucideIcon.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/check.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/chevron-down.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/chevron-up.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/circle-check-big.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/circle-x.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/copy.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/lightbulb.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/loader.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/moon.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/palette.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/pencil.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/plus.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/settings.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/sun.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/trash-2.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/trash.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/triangle-alert.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/icons/x.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) + +lucide-react/dist/esm/lucide-react.js: + (** + * @license lucide-react v0.447.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + *) +*/ diff --git a/web2/dist/versions/1.0.8/index.html b/web2/dist/versions/1.0.8/index.html new file mode 100644 index 00000000..427fd63f --- /dev/null +++ b/web2/dist/versions/1.0.8/index.html @@ -0,0 +1,133 @@ + + + + + + +MiLight Hub + + + + + +
+
Loading...
+
+ + diff --git a/web2/hooks/use-update-state.ts b/web2/hooks/use-update-state.ts new file mode 100644 index 00000000..53c93a0c --- /dev/null +++ b/web2/hooks/use-update-state.ts @@ -0,0 +1,58 @@ +import { useRef } from "react"; +import { useRateLimitMerge } from "@/hooks/use-rate-limit-merge"; +import { api } from "@/lib/api"; +import { z } from "zod"; +import { schemas } from "@/api/api-zod"; + +export function useUpdateState( + id: z.infer, + _updateState: (payload: Partial>) => void +) { + const [rateLimitedState, setRateLimitedState, clearRateLimitedState] = + useRateLimitMerge< + z.infer + >({}, 500); + const lastUpdateTimeRef = useRef(0); + + const sendUpdate = async ( + state: z.infer + ) => { + const response = await api.putGatewaysDeviceIdRemoteTypeGroupId(state, { + params: { + remoteType: id.device_type, + deviceId: id.device_id, + groupId: id.group_id, + }, + queries: { + fmt: "normalized", + blockOnQueue: true, + }, + }); + if (response) { + _updateState( + response as Partial> + ); + } + }; + + const updateState = ( + newState: Partial> + ) => { + _updateState(newState); + const now = Date.now(); + if (now - lastUpdateTimeRef.current >= 500) { + sendUpdate(newState); + lastUpdateTimeRef.current = now; + clearRateLimitedState(); + } else { + setRateLimitedState((prevState) => ({ ...prevState, ...newState })); + } + }; + + return { + updateState, + rateLimitedState, + sendUpdate, + clearRateLimitedState + }; +} \ No newline at end of file diff --git a/web2/lib/utils.ts b/web2/lib/utils.ts index d084ccad..c035598e 100644 --- a/web2/lib/utils.ts +++ b/web2/lib/utils.ts @@ -1,6 +1,28 @@ +import { schemas } from "@/api/api-zod"; import { type ClassValue, clsx } from "clsx" import { twMerge } from "tailwind-merge" +import { z } from "zod"; export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)) } + +export const parseDeviceId = (deviceId: string): number => { + return deviceId.startsWith("0x") + ? parseInt(deviceId, 16) + : parseInt(deviceId, 10); +}; + +export const getGroupCountForRemoteType = ( + remoteType: z.infer +): number => { + // Stub function - replace with actual logic + switch (remoteType) { + case schemas.RemoteType.Values.fut089: + return 8; + case schemas.RemoteType.Values.rgb: + return 1; + default: + return 4; + } +}; \ No newline at end of file diff --git a/web2/package-lock.json b/web2/package-lock.json index 96995871..45a4ad2e 100644 --- a/web2/package-lock.json +++ b/web2/package-lock.json @@ -1,12 +1,12 @@ { "name": "esp8266_milight_hub_ui", - "version": "1.0.7", + "version": "1.0.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "esp8266_milight_hub_ui", - "version": "1.0.7", + "version": "1.0.8", "license": "ISC", "dependencies": { "@headlessui/react": "^2.1.9", diff --git a/web2/package.json b/web2/package.json index 07cf19f5..9f2afc41 100644 --- a/web2/package.json +++ b/web2/package.json @@ -1,6 +1,6 @@ { "name": "esp8266_milight_hub_ui", - "version": "1.0.7", + "version": "1.0.8", "description": "", "main": "index.js", "scripts": { diff --git a/web2/src/pages/dashboard.tsx b/web2/src/pages/dashboard.tsx index c8ea4f01..0979854c 100644 --- a/web2/src/pages/dashboard.tsx +++ b/web2/src/pages/dashboard.tsx @@ -1,10 +1,12 @@ import React from "react"; import { LightList } from "@/components/light/light-list"; +import { ManualControlCard } from "@/components/light/manual-control-card"; export function Dashboard() { return ( -
+
+
); }