0?_:0,m.style.justifyContent="flex-end")}}}c.current=p.scrollTop})})})]})});C_.displayName=dm;var w_="SelectGroup",[vX,CX]=Pu(w_),wX=fe.forwardRef((e,t)=>{let{__scopeSelect:r,...o}=e,n=Na();return(0,Me.jsx)(vX,{scope:r,id:n,children:(0,Me.jsx)(be.div,{role:"group","aria-labelledby":n,...o,ref:t})})});wX.displayName=w_;var x_="SelectLabel",y_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,...o}=e,n=CX(x_,r);return(0,Me.jsx)(be.div,{id:n.id,...o,ref:t})});y_.displayName=x_;var x5="SelectItem",[xX,b_]=Pu(x5),L_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,value:o,disabled:n=!1,textValue:a,...s}=e,u=T1(x5,r),c=P1(x5,r),d=u.value===o,[p,m]=fe.useState(a??""),[g,y]=fe.useState(!1),x=Ue(t,C=>c.itemRefCallback?.(C,o,n)),v=Na(),b=fe.useRef("touch"),w=()=>{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,Me.jsx)(xX,{scope:r,value:o,disabled:n,textId:v,isSelected:d,onItemTextChange:fe.useCallback(C=>{m(I=>I||(C?.textContent??"").trim())},[]),children:(0,Me.jsx)(y5.ItemSlot,{scope:r,value:o,disabled:n,textValue:p,children:(0,Me.jsx)(be.div,{role:"option","aria-labelledby":v,"data-highlighted":g?"":void 0,"aria-selected":d&&g,"data-state":d?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:x,onFocus:Se(s.onFocus,()=>y(!0)),onBlur:Se(s.onBlur,()=>y(!1)),onClick:Se(s.onClick,()=>{b.current!=="mouse"&&w()}),onPointerUp:Se(s.onPointerUp,()=>{b.current==="mouse"&&w()}),onPointerDown:Se(s.onPointerDown,C=>{b.current=C.pointerType}),onPointerMove:Se(s.onPointerMove,C=>{b.current=C.pointerType,n?c.onItemLeave?.():b.current==="mouse"&&C.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Se(s.onPointerLeave,C=>{C.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Se(s.onKeyDown,C=>{c.searchRef?.current!==""&&C.key===" "||(iX.includes(C.key)&&w(),C.key===" "&&C.preventDefault())})})})})});L_.displayName=x5;var f0="SelectItemText",I_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,className:o,style:n,...a}=e,s=T1(f0,r),u=P1(f0,r),c=b_(f0,r),d=cX(f0,r),[p,m]=fe.useState(null),g=Ue(t,w=>m(w),c.onItemTextChange,w=>u.itemTextRefCallback?.(w,c.value,c.disabled)),y=p?.textContent,x=fe.useMemo(()=>(0,Me.jsx)("option",{value:c.value,disabled:c.disabled,children:y},c.value),[c.disabled,c.value,y]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=d;return rr(()=>(v(x),()=>b(x)),[v,b,x]),(0,Me.jsxs)(Me.Fragment,{children:[(0,Me.jsx)(be.span,{id:c.textId,...a,ref:g}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?hm.createPortal(a.children,s.valueNode):null]})});I_.displayName=f0;var S_="SelectItemIndicator",R_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,...o}=e;return b_(S_,r).isSelected?(0,Me.jsx)(be.span,{"aria-hidden":!0,...o,ref:t}):null});R_.displayName=S_;var fm="SelectScrollUpButton",__=fe.forwardRef((e,t)=>{let r=P1(fm,e.__scopeSelect),o=gm(fm,e.__scopeSelect),[n,a]=fe.useState(!1),s=Ue(t,o.onScrollButtonChange);return rr(()=>{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,Me.jsx)(A_,{...e,ref:s,onAutoScroll:()=>{let{viewport:u,selectedItem:c}=r;u&&c&&(u.scrollTop=u.scrollTop-c.offsetHeight)}}):null});__.displayName=fm;var pm="SelectScrollDownButton",M_=fe.forwardRef((e,t)=>{let r=P1(pm,e.__scopeSelect),o=gm(pm,e.__scopeSelect),[n,a]=fe.useState(!1),s=Ue(t,o.onScrollButtonChange);return rr(()=>{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,Me.jsx)(A_,{...e,ref:s,onAutoScroll:()=>{let{viewport:u,selectedItem:c}=r;u&&c&&(u.scrollTop=u.scrollTop+c.offsetHeight)}}):null});M_.displayName=pm;var A_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,onAutoScroll:o,...n}=e,a=P1("SelectScrollButton",r),s=fe.useRef(null),u=b5(r),c=fe.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return fe.useEffect(()=>()=>c(),[c]),rr(()=>{u().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),(0,Me.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()})})}),yX="SelectSeparator",T_=fe.forwardRef((e,t)=>{let{__scopeSelect:r,...o}=e;return(0,Me.jsx)(be.div,{"aria-hidden":!0,...o,ref:t})});T_.displayName=yX;var mm="SelectArrow",bX=fe.forwardRef((e,t)=>{let{__scopeSelect:r,...o}=e,n=L5(r),a=T1(mm,r),s=P1(mm,r);return a.open&&s.position==="popper"?(0,Me.jsx)(n_,{...n,...o,ref:t}):null});bX.displayName=mm;function P_(e){return e===""||e===void 0}var k_=fe.forwardRef((e,t)=>{let{value:r,...o}=e,n=fe.useRef(null),a=Ue(t,n),s=hu(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,Me.jsx)(Tu,{asChild:!0,children:(0,Me.jsx)("select",{...o,ref:a,defaultValue:r})})});k_.displayName="BubbleSelect";function E_(e){let t=lr(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 O_(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=LX(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 LX(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var H_=s_,vm=u_,V_=d_,F_=f_,D_=p_,Cm=m_,B_=C_;var wm=y_,xm=L_,N_=I_,Z_=R_,ym=__,bm=M_,Lm=T_;var I5=H_;var S5=V_,m0=kt.forwardRef(({className:e,children:t,...r},o)=>kt.createElement(vm,{ref:o,className:ee("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,kt.createElement(F_,{asChild:!0},kt.createElement(Ql,{className:"h-4 w-4 opacity-50"}))));m0.displayName=vm.displayName;var G_=kt.forwardRef(({className:e,...t},r)=>kt.createElement(ym,{ref:r,className:ee("flex cursor-default items-center justify-center py-1",e),...t},kt.createElement(vd,{className:"h-4 w-4"})));G_.displayName=ym.displayName;var W_=kt.forwardRef(({className:e,...t},r)=>kt.createElement(bm,{ref:r,className:ee("flex cursor-default items-center justify-center py-1",e),...t},kt.createElement(Ql,{className:"h-4 w-4"})));W_.displayName=bm.displayName;var h0=kt.forwardRef(({className:e,children:t,position:r="popper",...o},n)=>kt.createElement(D_,null,kt.createElement(Cm,{ref:n,className:ee("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},kt.createElement(G_,null),kt.createElement(B_,{className:ee("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]")},t),kt.createElement(W_,null))));h0.displayName=Cm.displayName;var SX=kt.forwardRef(({className:e,...t},r)=>kt.createElement(wm,{ref:r,className:ee("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));SX.displayName=wm.displayName;var g0=kt.forwardRef(({className:e,children:t,...r},o)=>kt.createElement(xm,{ref:o,className:ee("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},kt.createElement("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center"},kt.createElement(Z_,null,kt.createElement(gd,{className:"h-4 w-4"}))),kt.createElement(N_,null,t)));g0.displayName=xm.displayName;var RX=kt.forwardRef(({className:e,...t},r)=>kt.createElement(Lm,{ref:r,className:ee("-mx-1 my-1 h-px bg-muted",e),...t}));RX.displayName=Lm.displayName;var ha=N(U());var ma=N(U(),1);var Ai=N(U(),1),z_=N(Tt(),1);function j_(e,t=[]){let r=[];function o(a,s){let u=Ai.createContext(s),c=r.length;r=[...r,s];function d(m){let{scope:g,children:y,...x}=m,v=g?.[e][c]||u,b=Ai.useMemo(()=>x,Object.values(x));return(0,z_.jsx)(v.Provider,{value:b,children:y})}function p(m,g){let y=g?.[e][c]||u,x=Ai.useContext(y);if(x)return x;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=>Ai.createContext(s));return function(u){let c=u?.[e]||a;return Ai.useMemo(()=>({[`__scope${e}`]:{...u,[e]:c}}),[u,c])}};return n.scopeName=e,[o,_X(n,...t)]}function _X(...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 Ai.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Dr=N(U(),1);var Ti=N(U(),1),U_=N(Tt(),1);function $_(e,t=[]){let r=[];function o(a,s){let u=Ti.createContext(s),c=r.length;r=[...r,s];function d(m){let{scope:g,children:y,...x}=m,v=g?.[e][c]||u,b=Ti.useMemo(()=>x,Object.values(x));return(0,U_.jsx)(v.Provider,{value:b,children:y})}function p(m,g){let y=g?.[e][c]||u,x=Ti.useContext(y);if(x)return x;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,MX(n,...t)]}function MX(...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 k1=N(Tt(),1),Im="rovingFocusGroup.onEntryFocus",AX={bubbles:!1,cancelable:!0},R5="RovingFocusGroup",[Sm,X_,TX]=_1(R5),[PX,Rm]=$_(R5,[TX]),[kX,EX]=PX(R5),q_=Dr.forwardRef((e,t)=>(0,k1.jsx)(Sm.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,k1.jsx)(Sm.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,k1.jsx)(OX,{...e,ref:t})})}));q_.displayName=R5;var OX=Dr.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,g=Dr.useRef(null),y=Ue(t,g),x=M1(a),[v=null,b]=Vr({prop:s,defaultProp:u,onChange:c}),[w,C]=Dr.useState(!1),I=lr(d),_=X_(r),M=Dr.useRef(!1),[T,A]=Dr.useState(0);return Dr.useEffect(()=>{let H=g.current;if(H)return H.addEventListener(Im,I),()=>H.removeEventListener(Im,I)},[I]),(0,k1.jsx)(kX,{scope:r,orientation:o,dir:x,loop:n,currentTabStopId:v,onItemFocus:Dr.useCallback(H=>b(H),[b]),onItemShiftTab:Dr.useCallback(()=>C(!0),[]),onFocusableItemAdd:Dr.useCallback(()=>A(H=>H+1),[]),onFocusableItemRemove:Dr.useCallback(()=>A(H=>H-1),[]),children:(0,k1.jsx)(be.div,{tabIndex:w||T===0?-1:0,"data-orientation":o,...m,ref:y,style:{outline:"none",...e.style},onMouseDown:Se(e.onMouseDown,()=>{M.current=!0}),onFocus:Se(e.onFocus,H=>{let J=!M.current;if(H.target===H.currentTarget&&J&&!w){let Z=new CustomEvent(Im,AX);if(H.currentTarget.dispatchEvent(Z),!Z.defaultPrevented){let Q=_().filter(Y=>Y.focusable),W=Q.find(Y=>Y.active),ie=Q.find(Y=>Y.id===v),ae=[W,ie,...Q].filter(Boolean).map(Y=>Y.ref.current);Q_(ae,p)}}M.current=!1}),onBlur:Se(e.onBlur,()=>C(!1))})})}),Y_="RovingFocusGroupItem",J_=Dr.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:o=!0,active:n=!1,tabStopId:a,...s}=e,u=Na(),c=a||u,d=EX(Y_,r),p=d.currentTabStopId===c,m=X_(r),{onFocusableItemAdd:g,onFocusableItemRemove:y}=d;return Dr.useEffect(()=>{if(o)return g(),()=>y()},[o,g,y]),(0,k1.jsx)(Sm.ItemSlot,{scope:r,id:c,focusable:o,active:n,children:(0,k1.jsx)(be.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...s,ref:t,onMouseDown:Se(e.onMouseDown,x=>{o?d.onItemFocus(c):x.preventDefault()}),onFocus:Se(e.onFocus,()=>d.onItemFocus(c)),onKeyDown:Se(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){d.onItemShiftTab();return}if(x.target!==x.currentTarget)return;let v=FX(x,d.orientation,d.dir);if(v!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let w=m().filter(C=>C.focusable).map(C=>C.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();let C=w.indexOf(x.currentTarget);w=d.loop?DX(w,C+1):w.slice(C+1)}setTimeout(()=>Q_(w))}})})})});J_.displayName=Y_;var HX={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function VX(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function FX(e,t,r){let o=VX(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(o))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(o)))return HX[o]}function Q_(e,t=!1){let r=document.activeElement;for(let o of e)if(o===r||(o.focus({preventScroll:t}),document.activeElement!==r))return}function DX(e,t){return e.map((r,o)=>e[(t+o)%e.length])}var K_=q_,eM=J_;var tM=N(U(),1);var rM=N(Tt(),1),NX="Toggle",_5=tM.forwardRef((e,t)=>{let{pressed:r,defaultPressed:o=!1,onPressedChange:n,...a}=e,[s=!1,u]=Vr({prop:r,onChange:n,defaultProp:o});return(0,rM.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)})})});_5.displayName=NX;var _m=_5;var Co=N(Tt(),1),ku="ToggleGroup",[nM,$le]=j_(ku,[Rm]),aM=Rm(),Mm=ma.default.forwardRef((e,t)=>{let{type:r,...o}=e;if(r==="single")return(0,Co.jsx)(GX,{...o,ref:t});if(r==="multiple")return(0,Co.jsx)(WX,{...o,ref:t});throw new Error(`Missing prop \`type\` expected on \`${ku}\``)});Mm.displayName=ku;var[iM,sM]=nM(ku),GX=ma.default.forwardRef((e,t)=>{let{value:r,defaultValue:o,onValueChange:n=()=>{},...a}=e,[s,u]=Vr({prop:r,defaultProp:o,onChange:n});return(0,Co.jsx)(iM,{scope:e.__scopeToggleGroup,type:"single",value:s?[s]:[],onItemActivate:u,onItemDeactivate:ma.default.useCallback(()=>u(""),[u]),children:(0,Co.jsx)(lM,{...a,ref:t})})}),WX=ma.default.forwardRef((e,t)=>{let{value:r,defaultValue:o,onValueChange:n=()=>{},...a}=e,[s=[],u]=Vr({prop:r,defaultProp:o,onChange:n}),c=ma.default.useCallback(p=>u((m=[])=>[...m,p]),[u]),d=ma.default.useCallback(p=>u((m=[])=>m.filter(g=>g!==p)),[u]);return(0,Co.jsx)(iM,{scope:e.__scopeToggleGroup,type:"multiple",value:s,onItemActivate:c,onItemDeactivate:d,children:(0,Co.jsx)(lM,{...a,ref:t})})});Mm.displayName=ku;var[zX,jX]=nM(ku),lM=ma.default.forwardRef((e,t)=>{let{__scopeToggleGroup:r,disabled:o=!1,rovingFocus:n=!0,orientation:a,dir:s,loop:u=!0,...c}=e,d=aM(r),p=M1(s),m={role:"group",dir:p,...c};return(0,Co.jsx)(zX,{scope:r,rovingFocus:n,disabled:o,children:n?(0,Co.jsx)(K_,{asChild:!0,...d,orientation:a,dir:p,loop:u,children:(0,Co.jsx)(be.div,{...m,ref:t})}):(0,Co.jsx)(be.div,{...m,ref:t})})}),M5="ToggleGroupItem",uM=ma.default.forwardRef((e,t)=>{let r=sM(M5,e.__scopeToggleGroup),o=jX(M5,e.__scopeToggleGroup),n=aM(e.__scopeToggleGroup),a=r.value.includes(e.value),s=o.disabled||e.disabled,u={...e,pressed:a,disabled:s},c=ma.default.useRef(null);return o.rovingFocus?(0,Co.jsx)(eM,{asChild:!0,...n,focusable:!s,active:a,ref:c,children:(0,Co.jsx)(oM,{...u,ref:t})}):(0,Co.jsx)(oM,{...u,ref:t})});uM.displayName=M5;var oM=ma.default.forwardRef((e,t)=>{let{__scopeToggleGroup:r,value:o,...n}=e,a=sM(M5,r),s={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},u=a.type==="single"?s:void 0;return(0,Co.jsx)(_5,{...u,...n,ref:t,onPressedChange:c=>{c?a.onItemActivate(o):a.onItemDeactivate(o)}})}),Am=Mm,Tm=uM;var A5=N(U());var Pm=Dn("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"}}),$X=A5.forwardRef(({className:e,variant:t,size:r,...o},n)=>A5.createElement(_m,{ref:n,className:ee(Pm({variant:t,size:r,className:e})),...o}));$X.displayName=_m.displayName;var cM=ha.createContext({size:"default",variant:"default"}),ga=ha.forwardRef(({className:e,variant:t,size:r,children:o,...n},a)=>ha.createElement(Am,{ref:a,className:ee("flex items-center gap-1",e),...n},ha.createElement(cM.Provider,{value:{variant:t,size:r}},o)));ga.displayName=Am.displayName;var jo=ha.forwardRef(({className:e,children:t,variant:r,size:o,...n},a)=>{let s=ha.useContext(cM);return ha.createElement(Tm,{ref:a,className:ee(Pm({variant:s.variant||r,size:s.size||o}),e),...n},t)});jo.displayName=Tm.displayName;var dM={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."},fM={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 XX=k.object({name:k.string().min(1,{message:"Name is required."}),device_type:k.nativeEnum(At.RemoteType.Values),device_id:k.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:k.number().int().min(0).max(8)}),qX=e=>{switch(e){case At.RemoteType.Values.fut089:return 8;case At.RemoteType.Values.rgb:return 1;default:return 4}};function YX({onSubmit:e}){let t=t5({resolver:r5(XX),defaultValues:{group_id:0}}),r=a=>{let s=a.device_id.startsWith("0x")?parseInt(a.device_id,16):parseInt(a.device_id,10),u={...a,alias:a.name,device_id:s};e(u)},o=t.watch("device_type"),n=qX(o);return rt.default.createElement(US,{...t},rt.default.createElement("form",{onSubmit:t.handleSubmit(r),className:"space-y-8"},rt.default.createElement(fn,{control:t.control,name:"name",render:({field:a})=>rt.default.createElement(pn,null,rt.default.createElement(mn,null,"Name"),rt.default.createElement(Go,null,rt.default.createElement(Wo,{autoComplete:"off",placeholder:"Name for this light",...a})),rt.default.createElement(S1,null))}),rt.default.createElement(fn,{control:t.control,name:"device_type",render:({field:a})=>rt.default.createElement(pn,null,rt.default.createElement(mn,null,"Remote Type"),rt.default.createElement(I5,{onValueChange:a.onChange,defaultValue:a.value},rt.default.createElement(Go,null,rt.default.createElement(m0,null,rt.default.createElement(S5,{placeholder:"Select a remote type"}))),rt.default.createElement(h0,{className:"max-w-96"},Object.values(At.RemoteType.Values).map(s=>rt.default.createElement(g0,{key:s,value:s,className:"group"},rt.default.createElement("div",{className:"flex flex-col items-start max-w-72"},rt.default.createElement("div",{className:"font-medium"},s),rt.default.createElement("div",{className:"text-sm text-muted-foreground break-words w-full text-left"},dM[s])))))),rt.default.createElement(S1,null))}),rt.default.createElement(fn,{control:t.control,name:"device_id",render:({field:a})=>rt.default.createElement(pn,null,rt.default.createElement(mn,null,"Device ID"),rt.default.createElement(Go,null,rt.default.createElement(Wo,{type:"text",autoComplete:"off",placeholder:"Enter device ID",...a})),rt.default.createElement(S1,null))}),rt.default.createElement(fn,{control:t.control,name:"group_id",render:({field:a})=>rt.default.createElement(pn,null,rt.default.createElement(mn,null,"Group ID"),rt.default.createElement(Go,null,rt.default.createElement(ga,{type:"single",variant:"outline",value:a.value.toString(),onValueChange:s=>a.onChange(parseInt(s,10))},Array.from({length:n},(s,u)=>rt.default.createElement(jo,{key:u,value:(u+1).toString()},u+1)))),rt.default.createElement(S1,null))}),rt.default.createElement(Zt,{type:"submit"},"Submit")))}var pM=YX;var Ee=N(U());var qs=N(U());var Ht=N(U(),1);var Ar=N(Tt(),1),mM=["PageUp","PageDown"],hM=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],gM={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Eu="Slider",[km,JX,QX]=_1(Eu),[vM,bue]=Da(Eu,[QX]),[KX,T5]=vM(Eu),CM=Ht.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:g=()=>{},inverted:y=!1,form:x,...v}=e,b=Ht.useRef(new Set),w=Ht.useRef(0),I=s==="horizontal"?eq:tq,[_=[],M]=Vr({prop:p,defaultProp:d,onChange:Q=>{[...b.current][w.current]?.focus(),m(Q)}}),T=Ht.useRef(_);function A(Q){let W=iq(_,Q);Z(Q,W)}function H(Q){Z(Q,w.current)}function J(){let Q=T.current[w.current];_[w.current]!==Q&&g(_)}function Z(Q,W,{commit:ie}={commit:!1}){let q=cq(a),ae=dq(Math.round((Q-o)/a)*a+o,q),Y=Ru(ae,[o,n]);M((me=[])=>{let se=nq(me,Y,W);if(uq(se,c*a)){w.current=se.indexOf(Y);let we=String(se)!==String(me);return we&&ie&&g(se),we?se:me}else return me})}return(0,Ar.jsx)(KX,{scope:e.__scopeSlider,name:r,disabled:u,min:o,max:n,valueIndexToChangeRef:w,thumbs:b.current,values:_,orientation:s,form:x,children:(0,Ar.jsx)(km.Provider,{scope:e.__scopeSlider,children:(0,Ar.jsx)(km.Slot,{scope:e.__scopeSlider,children:(0,Ar.jsx)(I,{"aria-disabled":u,"data-disabled":u?"":void 0,...v,ref:t,onPointerDown:Se(v.onPointerDown,()=>{u||(T.current=_)}),min:o,max:n,inverted:y,onSlideStart:u?void 0:A,onSlideMove:u?void 0:H,onSlideEnd:u?void 0:J,onHomeKeyDown:()=>!u&&Z(o,0,{commit:!0}),onEndKeyDown:()=>!u&&Z(n,_.length-1,{commit:!0}),onStepKeyDown:({event:Q,direction:W})=>{if(!u){let ae=mM.includes(Q.key)||Q.shiftKey&&hM.includes(Q.key)?10:1,Y=w.current,me=_[Y],se=a*ae*W;Z(me+se,Y,{commit:!0})}}})})})})});CM.displayName=Eu;var[wM,xM]=vM(Eu,{startEdge:"left",endEdge:"right",size:"width",direction:1}),eq=Ht.forwardRef((e,t)=>{let{min:r,max:o,dir:n,inverted:a,onSlideStart:s,onSlideMove:u,onSlideEnd:c,onStepKeyDown:d,...p}=e,[m,g]=Ht.useState(null),y=Ue(t,I=>g(I)),x=Ht.useRef(),v=M1(n),b=v==="ltr",w=b&&!a||!b&&a;function C(I){let _=x.current||m.getBoundingClientRect(),M=[0,_.width],A=Hm(M,w?[r,o]:[o,r]);return x.current=_,A(I-_.left)}return(0,Ar.jsx)(wM,{scope:e.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:(0,Ar.jsx)(yM,{dir:v,"data-orientation":"horizontal",...p,ref:y,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:I=>{let _=C(I.clientX);s?.(_)},onSlideMove:I=>{let _=C(I.clientX);u?.(_)},onSlideEnd:()=>{x.current=void 0,c?.()},onStepKeyDown:I=>{let M=gM[w?"from-left":"from-right"].includes(I.key);d?.({event:I,direction:M?-1:1})}})})}),tq=Ht.forwardRef((e,t)=>{let{min:r,max:o,inverted:n,onSlideStart:a,onSlideMove:s,onSlideEnd:u,onStepKeyDown:c,...d}=e,p=Ht.useRef(null),m=Ue(t,p),g=Ht.useRef(),y=!n;function x(v){let b=g.current||p.current.getBoundingClientRect(),w=[0,b.height],I=Hm(w,y?[o,r]:[r,o]);return g.current=b,I(v-b.top)}return(0,Ar.jsx)(wM,{scope:e.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:(0,Ar.jsx)(yM,{"data-orientation":"vertical",...d,ref:m,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{let b=x(v.clientY);a?.(b)},onSlideMove:v=>{let b=x(v.clientY);s?.(b)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:v=>{let w=gM[y?"from-bottom":"from-top"].includes(v.key);c?.({event:v,direction:w?-1:1})}})})}),yM=Ht.forwardRef((e,t)=>{let{__scopeSlider:r,onSlideStart:o,onSlideMove:n,onSlideEnd:a,onHomeKeyDown:s,onEndKeyDown:u,onStepKeyDown:c,...d}=e,p=T5(Eu,r);return(0,Ar.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()):mM.concat(hM).includes(m.key)&&(c(m),m.preventDefault())}),onPointerDown:Se(e.onPointerDown,m=>{let g=m.target;g.setPointerCapture(m.pointerId),m.preventDefault(),p.thumbs.has(g)?g.focus():o(m)}),onPointerMove:Se(e.onPointerMove,m=>{m.target.hasPointerCapture(m.pointerId)&&n(m)}),onPointerUp:Se(e.onPointerUp,m=>{let g=m.target;g.hasPointerCapture(m.pointerId)&&(g.releasePointerCapture(m.pointerId),a(m))})})}),bM="SliderTrack",LM=Ht.forwardRef((e,t)=>{let{__scopeSlider:r,...o}=e,n=T5(bM,r);return(0,Ar.jsx)(be.span,{"data-disabled":n.disabled?"":void 0,"data-orientation":n.orientation,...o,ref:t})});LM.displayName=bM;var Em="SliderRange",IM=Ht.forwardRef((e,t)=>{let{__scopeSlider:r,...o}=e,n=T5(Em,r),a=xM(Em,r),s=Ht.useRef(null),u=Ue(t,s),c=n.values.length,d=n.values.map(g=>RM(g,n.min,n.max)),p=c>1?Math.min(...d):0,m=100-Math.max(...d);return(0,Ar.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+"%"}})});IM.displayName=Em;var Om="SliderThumb",SM=Ht.forwardRef((e,t)=>{let r=JX(e.__scopeSlider),[o,n]=Ht.useState(null),a=Ue(t,u=>n(u)),s=Ht.useMemo(()=>o?r().findIndex(u=>u.ref.current===o):-1,[r,o]);return(0,Ar.jsx)(rq,{...e,ref:a,index:s})}),rq=Ht.forwardRef((e,t)=>{let{__scopeSlider:r,index:o,name:n,...a}=e,s=T5(Om,r),u=xM(Om,r),[c,d]=Ht.useState(null),p=Ue(t,C=>d(C)),m=c?s.form||!!c.closest("form"):!0,g=gu(c),y=s.values[o],x=y===void 0?0:RM(y,s.min,s.max),v=aq(o,s.values.length),b=g?.[u.size],w=b?sq(b,x,u.direction):0;return Ht.useEffect(()=>{if(c)return s.thumbs.add(c),()=>{s.thumbs.delete(c)}},[c,s.thumbs]),(0,Ar.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${x}% + ${w}px)`},children:[(0,Ar.jsx)(km.ItemSlot,{scope:e.__scopeSlider,children:(0,Ar.jsx)(be.span,{role:"slider","aria-label":e["aria-label"]||v,"aria-valuemin":s.min,"aria-valuenow":y,"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:y===void 0?{display:"none"}:e.style,onFocus:Se(e.onFocus,()=>{s.valueIndexToChangeRef.current=o})})}),m&&(0,Ar.jsx)(oq,{name:n??(s.name?s.name+(s.values.length>1?"[]":""):void 0),form:s.form,value:y},o)]})});SM.displayName=Om;var oq=e=>{let{value:t,...r}=e,o=Ht.useRef(null),n=hu(t);return Ht.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,Ar.jsx)("input",{style:{display:"none"},...r,ref:o,defaultValue:t})};function nq(e=[],t,r){let o=[...e];return o[r]=t,o.sort((n,a)=>n-a)}function RM(e,t,r){let a=100/(r-t)*(e-t);return Ru(a,[0,100])}function aq(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function iq(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 sq(e,t,r){let o=e/2,a=Hm([0,50],[0,o]);return(o-a(t)*r)*r}function lq(e){return e.slice(0,-1).map((t,r)=>e[r+1]-t)}function uq(e,t){if(t>0){let r=lq(e);return Math.min(...r)>=t}return!0}function Hm(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 cq(e){return(String(e).split(".")[1]||"").length}function dq(e,t){let r=Math.pow(10,t);return Math.round(e*r)/r}var Vm=CM,_M=LM,MM=IM,AM=SM;var P5=qs.forwardRef(({className:e,gradient:t,...r},o)=>qs.createElement(Vm,{ref:o,className:ee("relative flex w-full touch-none select-none items-center cursor-pointer",e),...r},qs.createElement(_M,{className:ee("relative h-2 w-full grow overflow-hidden rounded-full",t?"":"bg-secondary"),style:{background:t}},qs.createElement(MM,{className:ee("absolute",t?"":"h-full bg-primary")})),qs.createElement(AM,{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"})));P5.displayName=Vm.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*E1:0,v:a/Hu*E1,a:n}};var pq=e=>{var{h:t,s:r,v:o,a:n}=e,a=(200-r)*o/E1;return{h:t,s:a>0&&a<200?r*o/E1/(a<=E1?a:200-a)*E1:0,l:a/2,a:n}};var Mue={grad:Fm/400,turn:Fm,rad:Fm/(Math.PI*2)};var TM=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))},mq=e=>{var{r:t,g:r,b:o,a:n}=e,a=typeof n=="number"&&(n*255|256).toString(16).slice(1);return""+TM({r:t,g:r,b:o,a:n})+(a||"")},Bm=e=>Dm(hq(e)),hq=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)/Hu}},k5=e=>{var{h:t,s:r,v:o,a:n}=e,a=t/60,s=r/E1,u=o/E1,c=Math.floor(a)%6,d=a-Math.floor(a),p=Hu*u*(1-s),m=Hu*u*(1-s*d),g=Hu*u*(1-s*(1-d));u*=Hu;var y={};switch(c){case 0:y.r=u,y.g=g,y.b=p;break;case 1:y.r=m,y.g=u,y.b=p;break;case 2:y.r=p,y.g=u,y.b=g;break;case 3:y.r=p,y.g=m,y.b=u;break;case 4:y.r=g,y.g=p,y.b=u;break;case 5:y.r=u,y.g=p,y.b=m;break}return y.r=Math.round(y.r),y.g=Math.round(y.g),y.b=Math.round(y.b),Ce({},y,{a:n})};var gq=e=>{var{r:t,g:r,b:o}=e;return{r:t,g:r,b:o}},vq=e=>{var{h:t,s:r,l:o}=e;return{h:t,s:r,l:o}},Nm=e=>TM(k5(e));var Cq=e=>{var{h:t,s:r,v:o}=e;return{h:t,s:r,v:o}};var wq=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},PM=e=>{var t,r,o,n,a,s,u,c,d;return typeof e=="string"&&Zm(e)?(s=Bm(e),c=e):typeof e!="string"&&(s=e),s&&(o=Cq(s),a=pq(s),n=k5(s),d=mq(n),c=Nm(s),r=vq(a),t=gq(n),u=wq(t)),{rgb:t,hsl:r,hsv:o,rgba:n,hsla:a,hsva:s,hex:c,hexa:d,xy:u}};var Zm=e=>/^#?([A-Fa-f0-9]{3,4}){1,2}$/.test(e);var Uo=N(U());var Vu=N(U());function Gm(e){var t=(0,Vu.useRef)(e);return(0,Vu.useEffect)(()=>{t.current=e}),(0,Vu.useCallback)((r,o)=>t.current&&t.current(r,o),[])}var Fu=e=>"touches"in e,Wm=e=>{!Fu(e)&&e.preventDefault&&e.preventDefault()},kM=function(t,r,o){return r===void 0&&(r=0),o===void 0&&(o=1),t>o?o:t{var r=e.getBoundingClientRect(),o=Fu(t)?t.touches[0]:t;return{left:kM((o.pageX-(r.left+window.pageXOffset))/r.width),top:kM((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 EM=N(Tt()),xq=["prefixCls","className","onMove","onDown"],OM=Uo.default.forwardRef((e,t)=>{var{prefixCls:r="w-color-interactive",className:o,onMove:n,onDown:a}=e,s=Ou(e,xq),u=(0,Uo.useRef)(null),c=(0,Uo.useRef)(!1),[d,p]=(0,Uo.useState)(!1),m=Gm(n),g=Gm(a),y=C=>c.current&&!Fu(C)?!1:(c.current=Fu(C),!0),x=(0,Uo.useCallback)(C=>{Wm(C);var I=Fu(C)?C.touches.length>0:C.buttons>0;I&&u.current?m&&m(zm(u.current,C),C):p(!1)},[m]),v=(0,Uo.useCallback)(()=>p(!1),[]),b=(0,Uo.useCallback)(C=>{var I=C?window.addEventListener:window.removeEventListener;I(c.current?"touchmove":"mousemove",x),I(c.current?"touchend":"mouseup",v)},[]);(0,Uo.useEffect)(()=>(b(d),()=>{d&&b(!1)}),[d,b]);var w=(0,Uo.useCallback)(C=>{Wm(C.nativeEvent),y(C.nativeEvent)&&(g&&g(zm(u.current,C.nativeEvent),C.nativeEvent),p(!0))},[g]);return(0,EM.jsx)("div",Ce({},s,{className:[r,o||""].filter(Boolean).join(" "),style:Ce({},s.style,{touchAction:"none"}),ref:u,tabIndex:0,onMouseDown:w,onTouchStart:w}))});OM.displayName="Interactive";var HM=OM;var Fue=N(U()),E5=N(Tt()),yq="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",VM=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,E5.jsx)("div",{className:c,style:u,children:(0,E5.jsx)("div",{className:s+"-fill",style:{width:10,height:10,transform:"translate(-5px, -5px)",boxShadow:yq,borderRadius:"50%",backgroundColor:"#fff"},children:(0,E5.jsx)("div",{style:{inset:0,borderRadius:"50%",position:"absolute",backgroundColor:r}})})})};var FM=Math.PI*2,bq=(e,t)=>(e%t+t)%t,Lq=(e,t)=>Math.sqrt(e*e+t*t);function DM(e){var{width:t=0}=e,r=t/2;return{width:t,radius:r,cx:r,cy:r}}function BM(e,t){var{cx:r,cy:o}=DM(e),n=NM(e),a=(180+ZM(e,t.h,!0))*(FM/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 NM(e){var{width:t=0}=e;return t/2}function ZM(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),bq(t,360)}function GM(e,t,r){var{cx:o,cy:n}=DM(e),a=NM(e);t=o-t,r=n-r;var s=ZM(e,Math.atan2(-r,-t)*(360/FM)),u=Math.min(Lq(t,r),a);return{h:Math.round(s),s:Math.round(100/a*u)}}var Ys=N(Tt()),Iq=["prefixCls","radius","pointer","className","style","width","height","oval","direction","angle","color","onChange"],Sq="conic-gradient(red, yellow, lime, aqua, blue, magenta, red)",Rq="conic-gradient(red, magenta, blue, aqua, lime, yellow, red)",zM=WM.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:g,onChange:y}=e,x=Ou(e,Iq),v=typeof g=="string"&&Zm(g)?Bm(g):g||{},b=g?Nm(v):"",w=BM({width:u},v),C={top:"0",left:"0",color:b},I=(T,A)=>{var H=GM({width:u},u-T.x,c-T.y),J={h:H.h,s:H.s,v:v.v,a:v.a};y&&y(PM(J))},_={zIndex:1,transform:"translate("+w.x+"px, "+w.y+"px) "+(d==="x"||d==="X"?"scaleY(2)":d==="y"||d==="Y"?"scaleX(2)":"")},M=n&&typeof n=="function"?n(Ce({prefixCls:r,style:_},C)):(0,Ys.jsx)(VM,Ce({prefixCls:r,style:_},C));return(0,Ys.jsxs)(HM,Ce({className:[r,a||""].filter(Boolean).join(" ")},x,{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,Ys.jsx)("div",{style:{position:"absolute",borderRadius:"50%",background:p==="anticlockwise"?Sq:Rq,transform:"rotateZ("+(m+90)+"deg)",inset:0}}),(0,Ys.jsx)("div",{style:{position:"absolute",borderRadius:"50%",background:"radial-gradient(circle closest-side, #fff, transparent)",inset:0}}),(0,Ys.jsx)("div",{style:{backgroundColor:"#000",borderRadius:"50%",position:"absolute",inset:0,opacity:typeof v.v=="number"?1-v.v/100:0}})]}))});zM.displayName="Wheel";var jM=zM;var _q="/",Js=DL(_q);var Qs=N(U());function UM(e,t){let[r,o]=(0,Qs.useState)({value:e,serial:0}),n=(0,Qs.useRef)(null),a=(0,Qs.useRef)(0);return(0,Qs.useEffect)(()=>()=>{n.current&&clearTimeout(n.current)},[]),[r,c=>{let d=Date.now(),p=d-a.current,m=g=>{a.current=d;let y=typeof c=="function"?c(g.value):c;return{value:typeof g.value=="object"&&typeof y=="object"?{...g.value,...y}:y,serial:g.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)}]}function $M({name:e,state:t,id:r,updateState:o,onClose:n,onNameChange:a}){let[s,u,c]=UM({},500),d=(0,Ee.useRef)(0),p=async Z=>{let Q=await Js.putGatewaysDeviceIdRemoteTypeGroupId(Z,{params:{remoteType:r.device_type,deviceId:r.device_id,groupId:r.group_id},queries:{fmt:"normalized",blockOnQueue:!0}});Q&&o(Q)},m=Z=>{o(Z);let Q=Date.now();Q-d.current>=500?(p(Z),d.current=Q,c()):u(W=>({...W,...Z}))},g=async Z=>await p({command:Z});(0,Ee.useEffect)(()=>{if(Object.keys(s.value).length>0){let Z=Date.now();Z-d.current>=500&&(p(s.value),d.current=Z,c())}},[s]);let y=Z=>{m({state:Z?"ON":"OFF"})},x=Z=>{m({level:Z[0]})},v=Z=>{m({kelvin:Z[0]}),o({color_mode:At.ColorMode.Values.color_temp})},b=Z=>{let Q=k5(Z.hsva);m({color:{r:Q.r,g:Q.g,b:Q.b}}),o({color_mode:At.ColorMode.Values.rgb})},w=Dm(t.color?{...t.color,a:1}:{r:255,g:255,b:255,a:1}),C=Z=>{o({color_mode:Z}),Z===At.ColorMode.Values.color_temp?g(At.GroupStateCommand.Values.set_white):Z===At.ColorMode.Values.rgb?m({color:{r:t.color?.r||255,g:t.color?.g||0,b:t.color?.b||255}}):Z===At.ColorMode.Values.onoff&&g(At.GroupStateCommand.Values.night_mode)},I=fM[r.device_type],[_,M]=(0,Ee.useState)(!1),[T,A]=(0,Ee.useState)(e),H=()=>{M(!0)},J=()=>{M(!1),a(T)};return Ee.default.createElement(jd,{className:"w-96 min-h-96 flex flex-col"},Ee.default.createElement(C1,{className:"flex flex-row items-center justify-between space-y-0 pb-4"},Ee.default.createElement("div",{className:"flex items-center space-x-2"},n&&Ee.default.createElement("button",{onClick:n,className:"p2 hover:bg-muted border-none hover:border-none","aria-label":"Close"},Ee.default.createElement(vi,{size:20})),_?Ee.default.createElement(Wo,{value:T,onChange:Z=>A(Z.target.value),onBlur:J,onKeyPress:Z=>Z.key==="Enter"&&J(),className:"text-lg font-medium w-40"}):Ee.default.createElement(w1,{className:"text-lg font-medium"},e),Ee.default.createElement("button",{onClick:_?J:H,className:"p-1 hover:bg-muted rounded-full","aria-label":_?"Save name":"Edit name"},Ee.default.createElement(hs,{size:16})),Ee.default.createElement("div",{className:"w-6 h-6 rounded-full bg-muted flex items-center justify-center",title:`Mode: ${t.color_mode}`},Ee.default.createElement(z9,{state:t}))),Ee.default.createElement("div",{className:"flex items-center space-x-2"},Ee.default.createElement($d,{checked:t.state==="ON",onCheckedChange:y,"aria-label":"Toggle light"}))),Ee.default.createElement(x1,{className:"flex flex-col flex-grow"},t.state==="ON"?Ee.default.createElement("div",{className:"flex flex-col items-center justify-center space-y-4 h-full"},I.color&&Ee.default.createElement("div",{className:"w-full"},Ee.default.createElement("div",{className:"flex items-center"},Ee.default.createElement("label",{className:"text-sm font-medium ml-2"},"Color")),Ee.default.createElement("div",{className:"mt-2 flex justify-center"},Ee.default.createElement(jM,{width:150,height:150,color:w,onChange:b}))),I.brightness&&Ee.default.createElement("div",{className:"w-full"},Ee.default.createElement("label",{className:"text-sm font-medium"},"Brightness"),Ee.default.createElement(P5,{value:[t.level||0],max:100,step:1,className:"mt-2",onValueChange:x})),I.colorTemp&&Ee.default.createElement("div",{className:"w-full"},Ee.default.createElement("label",{className:"text-sm font-medium"},"Color Temperature"),Ee.default.createElement(P5,{value:[t.kelvin||0],max:100,step:1,className:"mt-2 py-2",onValueChange:v,gradient:"linear-gradient(to right, lightblue, white, orange)"})),Ee.default.createElement("div",{className:"flex flex-col mt-4 w-full"},Ee.default.createElement("div",{className:"text-sm font-medium"},"Mode"),Ee.default.createElement(ga,{type:"single",value:t.color_mode,onValueChange:C,"aria-label":"Select light mode",className:"justify-normal"},I.colorTemp&&Ee.default.createElement(jo,{value:At.ColorMode.Values.color_temp},Ee.default.createElement(vs,{size:16,className:"mr-2"}),"White"),I.color&&Ee.default.createElement(jo,{value:At.ColorMode.Values.rgb},Ee.default.createElement(xd,{size:16,className:"mr-2"}),"Color"),Ee.default.createElement(jo,{value:At.ColorMode.Values.onoff},Ee.default.createElement(ms,{size:16,className:"mr-2"}),"Night")))):Ee.default.createElement("div",{className:"flex flex-col items-center justify-center flex-grow"},Ee.default.createElement("p",{className:"text-muted-foreground"},"Light is off")),Ee.default.createElement("div",{className:"flex-grow"}),Ee.default.createElement("div",{className:"flex justify-end space-x-4 mt-4"},Ee.default.createElement(Zt,{size:"sm",onClick:()=>g(At.GroupStateCommand.Values.pair)},"Pair"),Ee.default.createElement(Zt,{variant:"destructive",size:"sm",onClick:()=>g(At.GroupStateCommand.Values.unpair)},"Unpair"))))}var XM=N(U());function $o({className:e,...t}){return XM.default.createElement("div",{className:ee("animate-pulse rounded-md bg-muted",e),...t})}var V5=N(U()),Mq=1,Aq=1e6;var jm=0;function Tq(){return jm=(jm+1)%Number.MAX_SAFE_INTEGER,jm.toString()}var Um=new Map,qM=e=>{if(Um.has(e))return;let t=setTimeout(()=>{Um.delete(e),v0({type:"REMOVE_TOAST",toastId:e})},Aq);Um.set(e,t)},Pq=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Mq)};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?qM(r):e.toasts.forEach(o=>{qM(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)}}},O5=[],H5={toasts:[]};function v0(e){H5=Pq(H5,e),O5.forEach(t=>{t(H5)})}function kq({...e}){let t=Tq(),r=n=>v0({type:"UPDATE_TOAST",toast:{...n,id:t}}),o=()=>v0({type:"DISMISS_TOAST",toastId:t});return v0({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:n=>{n||o()}}}),{id:t,dismiss:o,update:r}}function va(){let[e,t]=V5.useState(H5);return V5.useEffect(()=>(O5.push(t),()=>{let r=O5.indexOf(t);r>-1&&O5.splice(r,1)}),[e]),{...e,toast:kq,dismiss:r=>v0({type:"DISMISS_TOAST",toastId:r})}}var $a=N(U()),dA=N(cA()),fA=(0,$a.createContext)(null),pA=({children:e})=>{let{lastJsonMessage:t,sendJsonMessage:r}=(0,dA.default)(`ws://${window.location.hostname}:81`,{share:!0,shouldReconnect:()=>!1}),[o,n]=(0,$a.useState)([]);return(0,$a.useEffect)(()=>{t!==null&&n(a=>[...a,t])},[t]),$a.default.createElement(fA.Provider,{value:{lastMessage:o[o.length-1],allMessages:o}},e)},q5=()=>{let e=(0,$a.useContext)(fA);if(!e)throw new Error("useWebSocketContext must be used within a WebSocketProvider");return e};var Xa=N(U());function Km(e,t){return e.device_id===t.device_id&&e.device_type===t.device_type&&e.group_id===t.group_id}function mA(e,t){switch(t.type){case"UPDATE_STATE":return{...e,lights:e.lights.map(o=>Km(o.device,t.device)?{...o,state:{...o.state,...t.payload}}:o)};case"SET_LIGHTS":return{...e,lights:t.lights,isLoading:!1};case"DELETE_LIGHT":return{...e,lights:e.lights.filter(o=>!Km(o.device,t.device))};case"ADD_LIGHT":console.log(t.device);let r={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:r,state:{state:"OFF"}}]};case"UPDATE_LIGHT_NAME":return{...e,lights:e.lights.map(o=>Km(o.device,t.device)?{...o,device:{...o.device,alias:t.name}}:o)};default:return e}}var hA=(0,Xa.createContext)(null),gA=({children:e})=>{let[t,r]=(0,Xa.useReducer)(mA,{lights:[],isLoading:!0});return(0,Xa.useEffect)(()=>{(async()=>{let n=await Hn.getGateways();r({type:"SET_LIGHTS",lights:n})})()},[]),Xa.default.createElement(hA.Provider,{value:{lightStates:t,dispatch:r}},e)},vA=()=>{let e=(0,Xa.useContext)(hA);if(!e)throw new Error("useLightState must be used within a LightProvider");return e};function CA(){let{lightStates:e,dispatch:t}=vA(),{lastMessage:r}=q5(),[o,n]=(0,Ge.useState)(!1),[a,s]=(0,Ge.useState)(!1),[u,c]=(0,Ge.useState)(null),[d,p]=(0,Ge.useState)(null),[m,g]=(0,Ge.useState)(!1),y=va();(0,Ge.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 x=(T,A)=>{t({type:"UPDATE_STATE",device:T.device,payload:A})},v=(T,A)=>{let H={state:A?"ON":"OFF"};x(T,H),Js.putGatewaysDeviceIdRemoteTypeGroupId(H,{params:{remoteType:T.device.device_type,deviceId:T.device.device_id,groupId:T.device.group_id},queries:{fmt:"normalized"}})},b=async T=>{try{let A=await Js.postAliases(T);t({type:"ADD_LIGHT",device:{...T,id:A.id}}),g(!1)}catch{y.toast({title:"Error adding light",description:"Please try again",variant:"destructive"})}},w=T=>{c(T),s(!0)},C=async()=>{u&&(await Js.deleteAliasesId(void 0,{params:{id:u.device.id}}),t({type:"DELETE_LIGHT",device:u.device}),c(null)),s(!1)},I=()=>{c(null),s(!1)},_=T=>{p(T.device.id)},M=(T,A)=>{Js.putAliasesId({alias:A},{params:{id:T.device.id}}),t({type:"UPDATE_LIGHT_NAME",device:T.device,name:A})};return Ge.default.createElement("div",{className:"flex items-center justify-center mt-10"},Ge.default.createElement(jd,{className:"w-96"},Ge.default.createElement(C1,null,Ge.default.createElement(w1,{className:"text-lg font-medium"},"Lights")),Ge.default.createElement(x1,null,e.isLoading?Ge.default.createElement("div",{className:"flex justify-center items-center h-24"},Ge.default.createElement("div",{className:"space-y-4"},Ge.default.createElement($o,{className:"h-4 w-[250px]"}),Ge.default.createElement($o,{className:"ml-2 h-4 w-[250px]"}),Ge.default.createElement($o,{className:"h-4 w-[250px]"}))):e.lights.map((T,A)=>Ge.default.createElement("div",{key:A,className:"flex items-center justify-between py-2 cursor-pointer",onClick:()=>_(T)},Ge.default.createElement("div",{className:"flex items-center"},o&&Ge.default.createElement("button",{className:ee("text-red-500 hover:text-red-700 mr-2","transition-transform duration-300 ease-in-out","transform scale-100"),onClick:H=>{H.stopPropagation(),w(T)},"aria-label":`Delete ${T.device.alias}`},Ge.default.createElement(Ld,{size:16})),Ge.default.createElement("div",{className:"mr-2"},Ge.default.createElement(z9,{state:T.state})),Ge.default.createElement("span",null,T.device.alias)),Ge.default.createElement($d,{checked:T.state.state==="ON",onClick:H=>{H.stopPropagation()},onCheckedChange:H=>{v(T,H)},"aria-label":`Toggle ${T.device.alias}`}))),Ge.default.createElement("div",{className:"flex justify-end mt-4"},Ge.default.createElement("button",{className:ee("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"},Ge.default.createElement(hs,{size:16})),Ge.default.createElement(Kd,{open:m,onOpenChange:g},Ge.default.createElement(uS,{asChild:!0},Ge.default.createElement("button",{className:"text-gray-500 hover:text-gray-700","aria-label":"Add new light",onClick:()=>g(!0)},Ge.default.createElement(gs,{size:24}))),Ge.default.createElement(Lu,{className:"w-1/2 min-w-96 max-w-2xl"},Ge.default.createElement(e0,null,Ge.default.createElement(t0,{className:"mb-4"},"Add new light")),Ge.default.createElement(pM,{onSubmit:b})))))),a&&Ge.default.createElement(gS,{open:a,setOpen:s,onConfirm:C,onCancel:I,title:"Confirm Deletion",description:`Are you sure you want to delete ${u?.device.alias}?`}),d&&Ge.default.createElement(Kd,{open:!!d,onOpenChange:()=>p(null)},Ge.default.createElement(Lu,{className:"p-0 border-none bg-transparent",closeButton:!1},(()=>{let T=e.lights.find(A=>A.device.id===d);return T&&Ge.default.createElement($M,{name:T.device.alias,state:T.state,id:T.device,updateState:A=>{x(T,A)},onClose:()=>p(null),onNameChange:A=>{M(T,A)}})})())))}function wA(){return eh.default.createElement("div",{className:"flex flex-col items-center justify-center"},eh.default.createElement(CA,null))}var x0=N(U());function xA(){return x0.default.createElement("div",{className:"flex flex-col items-center justify-center h-full bg-background text-foreground"},x0.default.createElement("h1",{className:"text-6xl font-bold mb-4"},"404"),x0.default.createElement("p",{className:"text-xl mb-8"},"Page Not Found"),x0.default.createElement("a",{href:"#/dashboard",className:"text-primary hover:underline"},"Go back to Dashboard"))}var Nr=N(U());var Xo=N(U());function yA({className:e,items:t,children:r,...o}){let[n,a]=Xo.useState(t[0]?.id||""),s=Xo.Children.toArray(r),u=s.filter(Xo.isValidElement).map(c=>c.props.navId);return Xo.useEffect(()=>{t.forEach(c=>{u.includes(c.id)||console.warn(`Item id "${c.id}" does not match any child's navId`)})},[t,u]),Xo.createElement("div",{className:"container flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0"},Xo.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=>Xo.createElement(Zt,{key:c.id,variant:"ghost",className:ee(n===c.id?"bg-muted hover:bg-muted":"hover:bg-transparent hover:underline","justify-start"),onClick:()=>a(c.id)},c.title))),Xo.createElement("div",{className:"mt-4 w-full"},s.find(c=>Xo.isValidElement(c)&&c.props.navId===n)))}var D0=N(U());var Yt=N(U());var De=N(U());var y0=e=>e instanceof k.ZodOptional||e instanceof k.ZodNullable?y0(e.unwrap()):e instanceof k.ZodDefault?y0(e.removeDefault()):e instanceof k.ZodUnion?y0(e.options[0]):e,GY=({field:e,fieldType:t})=>{let r=oo(),o=At.Settings.shape[e],n=y0(o);if(n instanceof k.ZodString||n instanceof k.ZodNumber){let a=t||"text";return t?a=t:n instanceof k.ZodString?a="text":n instanceof k.ZodNumber&&(a="number"),De.createElement(I1,{control:r.control,name:e,render:({field:s})=>De.createElement(Wo,{type:a,...s,value:s.value,onChange:u=>a==="number"?s.onChange(Number.isNaN(u.target.valueAsNumber)?u.target.value:u.target.valueAsNumber):s.onChange(u.target.value)})})}else{if(n instanceof k.ZodEnum)return n.options.length<=4?De.createElement(I1,{control:r.control,name:e,render:({field:s})=>De.createElement(ga,{type:"single",variant:"outline",onValueChange:u=>{s.onChange(u)},onBlur:()=>{},value:s.value},n.options.map(u=>De.createElement(jo,{key:u,value:u},u)))}):De.createElement(I1,{control:r.control,name:e,render:({field:s})=>De.createElement(I5,{onValueChange:u=>{s.onChange(u),s.onBlur()},value:s.value},De.createElement(Go,null,De.createElement(m0,null,De.createElement(S5,{placeholder:"Select an option"}))),De.createElement(h0,null,n.options.map(u=>De.createElement(g0,{key:u,value:u,className:"group"},De.createElement("div",{className:"flex flex-col items-start max-w-72"},De.createElement("div",{className:"font-medium"},u))))))});if(n instanceof k.ZodBoolean)return De.createElement(I1,{control:r.control,name:e,render:({field:a})=>De.createElement(ga,{type:"single",variant:"outline",onValueChange:s=>{a.onChange(s==="true"),a.onBlur()},value:a.value?"true":"false"},De.createElement(jo,{value:"true"},"Enabled"),De.createElement(jo,{value:"false"},"Disabled"))});if(n instanceof k.ZodArray){let a=y0(n.element);if(a instanceof k.ZodEnum)return De.createElement(I1,{control:r.control,name:e,render:({field:s})=>De.createElement(ga,{type:"multiple",variant:"outline",onValueChange:u=>{s.onChange(u),s.onBlur()},value:s.value},a.options.map(u=>De.createElement(jo,{key:u,value:u},u)))})}else return De.createElement(De.Fragment,null)}},WY=({field:e,nameOverride:t,children:r,className:o})=>{let n=oo(),a=At.Settings.shape[e],s=n.getFieldState(e);return De.createElement(fn,{key:e,control:n.control,name:e,render:({field:u})=>De.createElement(pn,{className:o},De.createElement(mn,{className:"flex items-center h-8"},De.createElement("span",null,t||e.replace(/_/g," ").replace(/\b\w/g,c=>c.toUpperCase())),s.isDirty&&De.createElement("span",{className:"text-lg text-muted-foreground ml-1"},"*")),De.createElement(Go,null,r),De.createElement(Zs,null,a.description),De.createElement(S1,null))})},zY=({fields:e,fieldNames:t,fieldTypes:r})=>{let o=oo();return De.createElement("div",{className:"space-y-4"},e.map(n=>De.createElement(fn,{key:n,control:o.control,name:n,render:({field:a})=>De.createElement(WY,{field:n,nameOverride:t?.[n]},De.createElement(GY,{field:n,fieldType:r?.[n]}))})))},Vt=({title:e,description:t,fields:r,fieldNames:o,fieldTypes:n,children:a})=>De.createElement("div",null,e&&De.createElement("h2",{className:"text-2xl font-bold"},e),t&&De.createElement("p",{className:"text-sm text-gray-500"},t),e&&De.createElement("hr",{className:"my-4"}),De.createElement(zY,{fields:r,fieldNames:o,fieldTypes:n}),a),xo=({children:e})=>De.createElement("div",{className:"flex flex-col space-y-10 max-w-xl"},e);var E3=N(U());var no=N(U());function ba(e){"@babel/helpers - typeof";return ba=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},ba(e)}function bA(e,t){if(ba(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var o=r.call(e,t||"default");if(ba(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Y5(e){var t=bA(e,"string");return ba(t)=="symbol"?t:t+""}function el(e,t,r){return(t=Y5(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LA(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?hr(Xu,--bo):0,Uu--,yr===10&&(Uu=1,o3--),yr}function Lo(){return yr=bo2||$u(yr)>3?"":" "}function XA(e,t){for(;--t&&Lo()&&!(yr<48||yr>102||yr>57&&yr<65||yr>70&&yr<97););return Yu(e,_0()+(t<6&&jn()==32&&Lo()==32))}function nh(e){for(;Lo();)switch(yr){case e:return bo;case 34:case 39:e!==34&&e!==39&&nh(yr);break;case 40:e===41&&nh(e);break;case 92:Lo();break}return bo}function qA(e,t){for(;Lo()&&e+yr!==57;)if(e+yr===84&&jn()===47)break;return"/*"+Yu(t,bo-1)+"*"+tl(e===47?e:Lo())}function YA(e){for(;!$u(jn());)Lo();return Yu(e,bo)}function KA(e){return a3(i3("",null,null,null,[""],e=n3(e),0,[0],e))}function i3(e,t,r,o,n,a,s,u,c){for(var d=0,p=0,m=s,g=0,y=0,x=0,v=1,b=1,w=1,C=0,I="",_=n,M=a,T=o,A=I;b;)switch(x=C,C=Lo()){case 40:if(x!=108&&hr(A,m-1)==58){S0(A+=st(Ju(C),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:A+=Ju(C);break;case 9:case 10:case 13:case 32:A+=$A(x);break;case 92:A+=XA(_0()-1,7);continue;case 47:switch(jn()){case 42:case 47:ju(qY(qA(Lo(),_0()),t,r),c);break;default:A+="/"}break;case 123*v:u[d++]=yo(A)*w;case 125*v:case 59:case 0:switch(C){case 0:case 125:b=0;case 59+p:w==-1&&(A=st(A,/\f/g,"")),y>0&&yo(A)-m&&ju(y>32?QA(A+";",o,r,m-1):QA(st(A," ","")+";",o,r,m-2),c);break;case 59:A+=";";default:if(ju(T=JA(A,t,r,d,p,n,u,I,_=[],M=[],m),a),C===123)if(p===0)i3(A,t,T,T,_,a,m,u,M);else switch(g===99&&hr(A,3)===110?100:g){case 100:case 108:case 109:case 115:i3(e,T,T,o&&ju(JA(e,T,T,0,0,n,u,I,n,_=[],m),M),n,M,m,u,o?_:M);break;default:i3(A,T,T,T,[""],M,0,u,M)}}d=p=y=0,v=w=1,I=A="",m=s;break;case 58:m=1+yo(A),y=x;default:if(v<1){if(C==123)--v;else if(C==125&&v++==0&&UA()==125)continue}switch(A+=tl(C),C*v){case 38:w=p>0?1:(A+="\f",-1);break;case 44:u[d++]=(yo(A)-1)*w,w=1;break;case 64:jn()===45&&(A+=Ju(Lo())),g=jn(),p=m=yo(I=A+=YA(_0())),C++;break;case 45:x===45&&yo(A)==2&&(v=0)}}return a}function JA(e,t,r,o,n,a,s,u,c,d,p){for(var m=n-1,g=n===0?a:[""],y=zu(g),x=0,v=0,b=0;x0?g[w]+" "+C:st(C,/&\f/g,g[w])))&&(c[b++]=I);return R0(e,t,r,n===0?Gu:u,c,d,p)}function qY(e,t,r){return R0(e,t,r,e3,tl(jA()),D1(e,2,-2),0)}function QA(e,t,r,o){return R0(e,t,r,Wu,D1(e,0,o),D1(e,o+1,-1),o)}function rl(e,t){for(var r="",o=zu(e),n=0;n6)switch(hr(e,t+1)){case 109:if(hr(e,t+4)!==45)break;case 102:return st(e,/(.+:)(.+)-([^]+)/,"$1"+dt+"$2-$3$1"+I0+(hr(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~S0(e,"stretch")?aT(st(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(hr(e,t+1)!==115)break;case 6444:switch(hr(e,yo(e)-3-(~S0(e,"!important")&&10))){case 107:return st(e,":",":"+dt)+e;case 101:return st(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+dt+(hr(e,14)===45?"inline-":"")+"box$3$1"+dt+"$2$3$1"+Ur+"$2box$3")+e}break;case 5936:switch(hr(e,t+11)){case 114:return dt+e+Ur+st(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return dt+e+Ur+st(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return dt+e+Ur+st(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return dt+e+Ur+e+e}return e}var tJ=function(t,r,o,n){if(t.length>-1&&!t.return)switch(t.type){case Wu:t.return=aT(t.value,t.length);break;case t3:return rl([qu(t,{value:st(t.value,"@","@"+dt)})],n);case Gu:if(t.length)return oh(t.props,function(a){switch(rh(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return rl([qu(t,{props:[st(a,/:(read-\w+)/,":"+I0+"$1")]})],n);case"::placeholder":return rl([qu(t,{props:[st(a,/:(plac\w+)/,":"+dt+"input-$1")]}),qu(t,{props:[st(a,/:(plac\w+)/,":"+I0+"$1")]}),qu(t,{props:[st(a,/:(plac\w+)/,Ur+"input-$1")]})],n)}return""})}},rJ=[tJ],ah=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(v){var b=v.getAttribute("data-emotion");b.indexOf(" ")!==-1&&(document.head.appendChild(v),v.setAttribute("data-s",""))})}var n=t.stylisPlugins||rJ,a={},s,u=[];s=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(v){for(var b=v.getAttribute("data-emotion").split(" "),w=1;w=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 CT={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 gJ=!1,vJ=/[A-Z]|^ms/g,CJ=/_EMO_([^_]+?)_([^]*?)_EMO_/g,bT=function(t){return t.charCodeAt(1)===45},wT=function(t){return t!=null&&typeof t!="boolean"},ph=oT(function(e){return bT(e)?e:e.replace(vJ,"-$&").toLowerCase()}),xT=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(CJ,function(o,n,a){return qa={name:n,styles:a,next:qa},n})}return CT[t]!==1&&!bT(t)&&typeof r=="number"&&r!==0?r+"px":r},wJ="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function M0(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 qa={name:n.name,styles:n.styles,next:qa},n.name;var a=r;if(a.styles!==void 0){var s=a.next;if(s!==void 0)for(;s!==void 0;)qa={name:s.name,styles:s.styles,next:qa},s=s.next;var u=a.styles+";";return u}return xJ(e,t,r)}case"function":{if(e!==void 0){var c=qa,d=r(e);return qa=c,M0(e,t,d)}break}}var p=r;if(t==null)return p;var m=t[p];return m!==void 0?m:p}function xJ(e,t,r){var o="";if(Array.isArray(r))for(var n=0;n2?r-2:0),n=2;n-1}function MJ(e){return P0(e)?window.innerHeight:e.clientHeight}function VT(e){return P0(e)?window.pageYOffset:e.scrollTop}function S3(e,t){if(P0(e)){window.scrollTo(0,t);return}e.scrollTop=t}function AJ(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 TJ(e,t,r,o){return r*((e=e/o-1)*e*e+1)+t}function L3(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:T0,n=VT(e),a=t-n,s=10,u=0;function c(){u+=s;var d=TJ(u,n,a,r);S3(e,d),ur.bottom?S3(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+n,e.scrollHeight)):o.top-n1?r-1:0),n=1;n=x)return{placement:"bottom",maxHeight:t};if(J>=x&&!s)return a&&L3(c,Z,W),{placement:"bottom",maxHeight:t};if(!s&&J>=o||s&&A>=o){a&&L3(c,Z,W);var ie=s?A-_:J-_;return{placement:"bottom",maxHeight:ie}}if(n==="auto"||s){var q=t,ae=s?T:H;return ae>=o&&(q=Math.min(ae-_-u,t)),{placement:"top",maxHeight:q}}if(n==="bottom")return a&&S3(c,Z),{placement:"bottom",maxHeight:t};break;case"top":if(T>=x)return{placement:"top",maxHeight:t};if(H>=x&&!s)return a&&L3(c,Q,W),{placement:"top",maxHeight:t};if(!s&&H>=o||s&&T>=o){var Y=t;return(!s&&H>=o||s&&T>=o)&&(Y=s?T-M:H-M),a&&L3(c,Q,W),{placement:"top",maxHeight:Y}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(n,'".'))}return d}function FJ(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var GT=function(t){return t==="auto"?"bottom":t},WT=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"},el(o,FJ(n),"100%"),el(o,"position","absolute"),el(o,"width","100%"),el(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})},zT=(0,Tr.createContext)(null),jT=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,Tr.useContext)(zT)||{},p=d.setPortalPlacement,m=(0,Tr.useRef)(null),g=(0,Tr.useState)(n),y=La(g,2),x=y[0],v=y[1],b=(0,Tr.useState)(null),w=La(b,2),C=w[0],I=w[1],_=c.spacing.controlHeight;return b3(function(){var M=m.current;if(M){var T=s==="fixed",A=u&&!T,H=VJ({maxHeight:n,menuEl:M,minHeight:o,placement:a,shouldScroll:A,isFixedPosition:T,controlHeight:_});v(H.maxHeight),I(H.placement),p?.(H.placement)}},[n,a,s,u,o,p,_]),r({ref:m,placerProps:Re(Re({},t),{},{placement:C||GT(a),maxHeight:x})})},DJ=function(t){var r=t.children,o=t.innerRef,n=t.innerProps;return _e("div",Ce({},cr(t,"menu",{menu:!0}),{ref:o},n),r)},BJ=DJ,UT=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})},NJ=function(t){var r=t.children,o=t.innerProps,n=t.innerRef,a=t.isMulti;return _e("div",Ce({},cr(t,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:n},o),r)},$T=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")})},XT=$T,qT=$T,ZJ=function(t){var r=t.children,o=r===void 0?"No options":r,n=t.innerProps,a=zn(t,OJ);return _e("div",Ce({},cr(Re(Re({},a),{},{children:o,innerProps:n}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),n),o)},GJ=function(t){var r=t.children,o=r===void 0?"Loading...":r,n=t.innerProps,a=zn(t,HJ);return _e("div",Ce({},cr(Re(Re({},a),{},{children:o,innerProps:n}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),n),o)},YT=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}},WJ=function(t){var r=t.appendTo,o=t.children,n=t.controlElement,a=t.innerProps,s=t.menuPlacement,u=t.menuPosition,c=(0,Tr.useRef)(null),d=(0,Tr.useRef)(null),p=(0,Tr.useState)(GT(s)),m=La(p,2),g=m[0],y=m[1],x=(0,Tr.useMemo)(function(){return{setPortalPlacement:y}},[]),v=(0,Tr.useState)(null),b=La(v,2),w=b[0],C=b[1],I=(0,Tr.useCallback)(function(){if(n){var A=PJ(n),H=u==="fixed"?0:window.pageYOffset,J=A[g]+H;(J!==w?.offset||A.left!==w?.rect.left||A.width!==w?.rect.width)&&C({offset:J,rect:A})}},[n,u,g,w?.offset,w?.rect.left,w?.rect.width]);b3(function(){I()},[I]);var _=(0,Tr.useCallback)(function(){typeof d.current=="function"&&(d.current(),d.current=null),n&&c.current&&(d.current=d0(n,c.current,I,{elementResize:"ResizeObserver"in window}))},[n,I]);b3(function(){_()},[_]);var M=(0,Tr.useCallback)(function(A){c.current=A,_()},[_]);if(!r&&u!=="fixed"||!w)return null;var T=_e("div",Ce({ref:M},cr(Re(Re({},t),{},{offset:w.offset,position:u,rect:w.rect}),"menuPortal",{"menu-portal":!0}),a),o);return _e(zT.Provider,{value:x},r?(0,ET.createPortal)(T,r):T)},JT=function(t){var r=t.isDisabled,o=t.isRtl;return{label:"container",direction:o?"rtl":void 0,pointerEvents:r?"none":void 0,position:"relative"}},zJ=function(t){var r=t.children,o=t.innerProps,n=t.isDisabled,a=t.isRtl;return _e("div",Ce({},cr(t,"container",{"--is-disabled":n,"--is-rtl":a}),o),r)},QT=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")})},jJ=function(t){var r=t.children,o=t.innerProps,n=t.isMulti,a=t.hasValue;return _e("div",Ce({},cr(t,"valueContainer",{"value-container":!0,"value-container--is-multi":n,"value-container--has-value":a}),o),r)},KT=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},UJ=function(t){var r=t.children,o=t.innerProps;return _e("div",Ce({},cr(t,"indicatorsContainer",{indicators:!0}),o),r)},kT,$J=["size"],XJ=["innerProps","isRtl","size"];var qJ={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},eP=function(t){var r=t.size,o=zn(t,$J);return _e("svg",Ce({height:r,width:r,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:qJ},o))},xh=function(t){return _e(eP,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"}))},tP=function(t){return _e(eP,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"}))},rP=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}})},oP=rP,YJ=function(t){var r=t.children,o=t.innerProps;return _e("div",Ce({},cr(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),o),r||_e(tP,null))},nP=rP,JJ=function(t){var r=t.children,o=t.innerProps;return _e("div",Ce({},cr(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),o),r||_e(xh,null))},aP=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})},QJ=function(t){var r=t.innerProps;return _e("span",Ce({},r,cr(t,"indicatorSeparator",{"indicator-separator":!0})))},KJ=AT(kT||(kT=TT([`
+ 0%, 80%, 100% { opacity: 0; }
+ 40% { opacity: 1; }
+`]))),iP=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})},gh=function(t){var r=t.delay,o=t.offset;return _e("span",{css:A0({animation:"".concat(KJ," 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"},"","")})},eQ=function(t){var r=t.innerProps,o=t.isRtl,n=t.size,a=n===void 0?4:n,s=zn(t,XJ);return _e("div",Ce({},cr(Re(Re({},s),{},{innerProps:r,isRtl:o,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),r),_e(gh,{delay:0,offset:o}),_e(gh,{delay:160,offset:!0}),_e(gh,{delay:320,offset:!o}))},sP=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}})},tQ=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},cr(t,"control",{control:!0,"control--is-disabled":o,"control--is-focused":n,"control--menu-is-open":u}),s,{"aria-disabled":o||void 0}),r)},rQ=tQ,oQ=["data"],lP=function(t,r){var o=t.theme.spacing;return r?{}:{paddingBottom:o.baseUnit*2,paddingTop:o.baseUnit*2}},nQ=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({},cr(t,"group",{group:!0}),c),_e(s,Ce({},u,{selectProps:m,theme:p,getStyles:n,getClassNames:a,cx:o}),d),_e("div",null,r))},uP=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"})},aQ=function(t){var r=HT(t);r.data;var o=zn(r,oQ);return _e("div",Ce({},cr(t,"groupHeading",{"group-heading":!0}),o))},iQ=nQ,sQ=["innerRef","isDisabled","isHidden","inputClassName"],cP=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)":""},lQ),r?{}:{margin:s.baseUnit/2,paddingBottom:s.baseUnit/2,paddingTop:s.baseUnit/2,color:u.neutral80})},dP={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},lQ={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"},dP)},uQ=function(t){return Re({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},dP)},cQ=function(t){var r=t.cx,o=t.value,n=HT(t),a=n.innerRef,s=n.isDisabled,u=n.isHidden,c=n.inputClassName,d=zn(n,sQ);return _e("div",Ce({},cr(t,"input",{"input-container":!0}),{"data-value":o||""}),_e("input",Ce({className:r({input:!0},c),ref:a,style:uQ(u),disabled:s},d)))},dQ=cQ,fP=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})},pP=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})},mP=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}})},hP=function(t){var r=t.children,o=t.innerProps;return _e("div",o,r)},fQ=hP,pQ=hP;function mQ(e){var t=e.children,r=e.innerProps;return _e("div",Ce({role:"button"},r),t||_e(xh,{size:14}))}var hQ=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({},cr(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":s})),a),selectProps:c},_e(p,{data:n,innerProps:Re({},cr(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},r),_e(m,{data:n,innerProps:Re(Re({},cr(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(r||"option")},u),selectProps:c}))},gQ=hQ,gP=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}})},vQ=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({},cr(t,"option",{option:!0,"option--is-disabled":o,"option--is-focused":n,"option--is-selected":a}),{ref:s,"aria-disabled":o},u),r)},CQ=vQ,vP=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})},wQ=function(t){var r=t.children,o=t.innerProps;return _e("div",Ce({},cr(t,"placeholder",{placeholder:!0}),o),r)},xQ=wQ,CP=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})},yQ=function(t){var r=t.children,o=t.isDisabled,n=t.innerProps;return _e("div",Ce({},cr(t,"singleValue",{"single-value":!0,"single-value--is-disabled":o}),n),r)},bQ=yQ,ol={ClearIndicator:JJ,Control:rQ,DropdownIndicator:YJ,DownChevron:tP,CrossIcon:xh,Group:iQ,GroupHeading:aQ,IndicatorsContainer:UJ,IndicatorSeparator:QJ,Input:dQ,LoadingIndicator:eQ,Menu:BJ,MenuList:NJ,MenuPortal:WJ,LoadingMessage:GJ,NoOptionsMessage:ZJ,MultiValue:gQ,MultiValueContainer:fQ,MultiValueLabel:pQ,MultiValueRemove:mQ,Option:CQ,Placeholder:xQ,SelectContainer:zJ,SingleValue:bQ,ValueContainer:jJ},wP=function(t){return Re(Re({},ol),t.components)};var xP=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function LQ(e,t){return!!(e===t||xP(e)&&xP(t))}function IQ(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(v,b){return v&&v.length?"".concat(v.indexOf(b)+1," of ").concat(v.length):""};if(r==="value"&&u)return"value ".concat(s," focused, ").concat(m(u,o),".");if(r==="menu"&&p){var g=c?" disabled":"",y="".concat(d?" selected":"").concat(g);return"".concat(s).concat(y,", ").concat(m(n,o),".")}return""},onFilter:function(t){var r=t.inputValue,o=t.resultsMessage;return"".concat(o).concat(r?" for search term "+r:"",".")}},MQ=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,g=c.getOptionLabel,y=c.inputValue,x=c.isMulti,v=c.isOptionDisabled,b=c.isSearchable,w=c.menuIsOpen,C=c.options,I=c.screenReaderStatus,_=c.tabSelectsValue,M=c.isLoading,T=c["aria-label"],A=c["aria-live"],H=(0,mt.useMemo)(function(){return Re(Re({},_Q),m||{})},[m]),J=(0,mt.useMemo)(function(){var ae="";if(r&&H.onChange){var Y=r.option,me=r.options,se=r.removedValue,we=r.removedValues,Ke=r.value,xt=function(qe){return Array.isArray(qe)?null:qe},nt=se||Y||xt(Ke),lt=nt?g(nt):"",yt=me||we||void 0,br=yt?yt.map(g):[],bt=Re({isDisabled:nt&&v(nt,u),label:lt,labels:br},r);ae=H.onChange(bt)}return ae},[r,H,v,u,g]),Z=(0,mt.useMemo)(function(){var ae="",Y=o||n,me=!!(o&&u&&u.includes(o));if(Y&&H.onFocus){var se={focused:Y,label:g(Y),isDisabled:v(Y,u),isSelected:me,options:a,context:Y===o?"menu":"value",selectValue:u,isAppleDevice:p};ae=H.onFocus(se)}return ae},[o,n,g,v,H,a,u,p]),Q=(0,mt.useMemo)(function(){var ae="";if(w&&C.length&&!M&&H.onFilter){var Y=I({count:a.length});ae=H.onFilter({inputValue:y,resultsMessage:Y})}return ae},[a,y,w,H,C,I,M]),W=r?.action==="initial-input-focus",ie=(0,mt.useMemo)(function(){var ae="";if(H.guidance){var Y=n?"value":w?"menu":"input";ae=H.guidance({"aria-label":T,context:Y,isDisabled:o&&v(o,u),isMulti:x,isSearchable:b,tabSelectsValue:_,isInitialFocus:W})}return ae},[T,o,n,x,v,b,w,H,u,_,W]),q=_e(mt.Fragment,null,_e("span",{id:"aria-selection"},J),_e("span",{id:"aria-focused"},Z),_e("span",{id:"aria-results"},Q),_e("span",{id:"aria-guidance"},ie));return _e(mt.Fragment,null,_e(bP,{id:d},W&&q),_e(bP,{"aria-live":A,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},s&&!W&&q))},AQ=MQ,Lh=[{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"}],TQ=new RegExp("["+Lh.map(function(e){return e.letters}).join("")+"]","g"),OP={};for(R3=0;R3-1}},OQ=["innerRef"];function HQ(e){var t=e.innerRef,r=zn(e,OQ),o=ZT(r,"onExited","in","enter","exit","appear");return _e("input",Ce({ref:t},o,{css:A0({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 VQ=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function FQ(e){var t=e.isEnabled,r=e.onBottomArrive,o=e.onBottomLeave,n=e.onTopArrive,a=e.onTopLeave,s=(0,mt.useRef)(!1),u=(0,mt.useRef)(!1),c=(0,mt.useRef)(0),d=(0,mt.useRef)(null),p=(0,mt.useCallback)(function(b,w){if(d.current!==null){var C=d.current,I=C.scrollTop,_=C.scrollHeight,M=C.clientHeight,T=d.current,A=w>0,H=_-M-I,J=!1;H>w&&s.current&&(o&&o(b),s.current=!1),A&&u.current&&(a&&a(b),u.current=!1),A&&w>H?(r&&!s.current&&r(b),T.scrollTop=_,J=!0,s.current=!0):!A&&-w>I&&(n&&!u.current&&n(b),T.scrollTop=0,J=!0,u.current=!0),J&&VQ(b)}},[r,o,n,a]),m=(0,mt.useCallback)(function(b){p(b,b.deltaY)},[p]),g=(0,mt.useCallback)(function(b){c.current=b.changedTouches[0].clientY},[]),y=(0,mt.useCallback)(function(b){var w=c.current-b.changedTouches[0].clientY;p(b,w)},[p]),x=(0,mt.useCallback)(function(b){if(b){var w=BT?{passive:!1}:!1;b.addEventListener("wheel",m,w),b.addEventListener("touchstart",g,w),b.addEventListener("touchmove",y,w)}},[y,g,m]),v=(0,mt.useCallback)(function(b){b&&(b.removeEventListener("wheel",m,!1),b.removeEventListener("touchstart",g,!1),b.removeEventListener("touchmove",y,!1))},[y,g,m]);return(0,mt.useEffect)(function(){if(t){var b=d.current;return x(b),function(){v(b)}}},[t,x,v]),function(b){d.current=b}}var IP=["boxSizing","height","overflow","paddingRight","position"],SP={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function RP(e){e.preventDefault()}function _P(e){e.stopPropagation()}function MP(){var e=this.scrollTop,t=this.scrollHeight,r=e+this.offsetHeight;e===0?this.scrollTop=1:r===t&&(this.scrollTop=e-1)}function AP(){return"ontouchstart"in window||navigator.maxTouchPoints}var TP=!!(typeof window<"u"&&window.document&&window.document.createElement),E0=0,Ku={capture:!1,passive:!1};function DQ(e){var t=e.isEnabled,r=e.accountForScrollbars,o=r===void 0?!0:r,n=(0,mt.useRef)({}),a=(0,mt.useRef)(null),s=(0,mt.useCallback)(function(c){if(TP){var d=document.body,p=d&&d.style;if(o&&IP.forEach(function(x){var v=p&&p[x];n.current[x]=v}),o&&E0<1){var m=parseInt(n.current.paddingRight,10)||0,g=document.body?document.body.clientWidth:0,y=window.innerWidth-g+m||0;Object.keys(SP).forEach(function(x){var v=SP[x];p&&(p[x]=v)}),p&&(p.paddingRight="".concat(y,"px"))}d&&AP()&&(d.addEventListener("touchmove",RP,Ku),c&&(c.addEventListener("touchstart",MP,Ku),c.addEventListener("touchmove",_P,Ku))),E0+=1}},[o]),u=(0,mt.useCallback)(function(c){if(TP){var d=document.body,p=d&&d.style;E0=Math.max(E0-1,0),o&&E0<1&&IP.forEach(function(m){var g=n.current[m];p&&(p[m]=g)}),d&&AP()&&(d.removeEventListener("touchmove",RP,Ku),c&&(c.removeEventListener("touchstart",MP,Ku),c.removeEventListener("touchmove",_P,Ku)))}},[o]);return(0,mt.useEffect)(function(){if(t){var c=a.current;return s(c),function(){u(c)}}},[t,s,u]),function(c){a.current=c}}var BQ=function(t){var r=t.target;return r.ownerDocument.activeElement&&r.ownerDocument.activeElement.blur()},NQ={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function ZQ(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=FQ({isEnabled:n,onBottomArrive:a,onBottomLeave:s,onTopArrive:u,onTopLeave:c}),p=DQ({isEnabled:r}),m=function(y){d(y),p(y)};return _e(mt.Fragment,null,r&&_e("div",{onClick:BQ,css:NQ}),t(m))}var GQ={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},WQ=function(t){var r=t.name,o=t.onFocus;return _e("input",{required:!0,name:r,tabIndex:-1,"aria-hidden":"true",onFocus:o,css:GQ,value:"",onChange:function(){}})},zQ=WQ;function Ih(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 jQ(){return Ih(/^iPhone/i)}function VP(){return Ih(/^Mac/i)}function UQ(){return Ih(/^iPad/i)||VP()&&navigator.maxTouchPoints>1}function $Q(){return jQ()||UQ()}function XQ(){return VP()||$Q()}var qQ=function(t){return t.label},YQ=function(t){return t.label},JQ=function(t){return t.value},QQ=function(t){return!!t.isDisabled},KQ={clearIndicator:nP,container:JT,control:sP,dropdownIndicator:oP,group:lP,groupHeading:uP,indicatorsContainer:KT,indicatorSeparator:aP,input:cP,loadingIndicator:iP,loadingMessage:qT,menu:WT,menuList:UT,menuPortal:YT,multiValue:fP,multiValueLabel:pP,multiValueRemove:mP,noOptionsMessage:XT,option:gP,placeholder:vP,singleValue:CP,valueContainer:QT};var eK={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%)"},tK=4,FP=4,rK=38,oK=FP*2,nK={baseUnit:FP,controlHeight:rK,menuGutter:oK},yh={borderRadius:tK,colors:eK,spacing:nK},aK={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:wh(),captureMenuScroll:!wh(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:EQ(),formatGroupLabel:qQ,getOptionLabel:YQ,getOptionValue:JQ,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:QQ,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!FT(),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 PP(e,t,r,o){var n=NP(e,t,r),a=ZP(e,t,r),s=BP(e,t),u=T3(e,t);return{type:"option",data:t,isDisabled:n,isSelected:a,label:s,value:u,index:o}}function A3(e,t){return e.options.map(function(r,o){if("options"in r){var n=r.options.map(function(s,u){return PP(e,s,t,u)}).filter(function(s){return EP(e,s)});return n.length>0?{type:"group",data:r,options:n,index:o}:void 0}var a=PP(e,r,t,o);return EP(e,a)?a:void 0}).filter(NT)}function DP(e){return e.reduce(function(t,r){return r.type==="group"?t.push.apply(t,K5(r.options.map(function(o){return o.data}))):t.push(r.data),t},[])}function kP(e,t){return e.reduce(function(r,o){return o.type==="group"?r.push.apply(r,K5(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 iK(e,t){return DP(A3(e,t))}function EP(e,t){var r=e.inputValue,o=r===void 0?"":r,n=t.data,a=t.isSelected,s=t.label,u=t.value;return(!WP(e)||!a)&&GP(e,{label:s,value:u,data:n},o)}function sK(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 bh=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},BP=function(t,r){return t.getOptionLabel(r)},T3=function(t,r){return t.getOptionValue(r)};function NP(e,t,r){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,r):!1}function ZP(e,t,r){if(r.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,r);var o=T3(e,t);return r.some(function(n){return T3(e,n)===o})}function GP(e,t,r){return e.filterOption?e.filterOption(t,r):!0}var WP=function(t){var r=t.hideSelectedOptions,o=t.isMulti;return r===void 0?o:r},uK=1,Sh=function(e){PA(r,e);var t=OA(r);function r(o){var n;if(MA(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=XQ(),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,g=p.name;d.name=g,n.ariaOnChange(c,d),m(c,d)},n.setValue=function(c,d,p){var m=n.props,g=m.closeMenuOnSelect,y=m.isMulti,x=m.inputValue;n.onInputChange("",{action:"set-value",prevInputValue:x}),g&&(n.setState({inputIsHiddenAfterUpdate:!y}),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,g=d.name,y=n.state.selectValue,x=m&&n.isOptionSelected(c,y),v=n.isOptionDisabled(c,y);if(x){var b=n.getOptionValue(c);n.setValue(y.filter(function(w){return n.getOptionValue(w)!==b}),"deselect-option",c)}else if(!v)m?n.setValue([].concat(K5(y),[c]),"select-option",c):n.setValue(c,"select-option");else{n.ariaOnChange(c,{action:"select-option",option:c,name:g});return}p&&n.blurInput()},n.removeValue=function(c){var d=n.props.isMulti,p=n.state.selectValue,m=n.getOptionValue(c),g=p.filter(function(x){return n.getOptionValue(x)!==m}),y=k0(d,g,g[0]||null);n.onChange(y,{action:"remove-value",removedValue:c}),n.focusInput()},n.clearValue=function(){var c=n.state.selectValue;n.onChange(k0(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),g=k0(c,m,m[0]||null);p&&n.onChange(g,{action:"pop-value",removedValue:p})},n.getFocusedOptionId=function(c){return bh(n.state.focusableOptionsWithIds,c)},n.getFocusableOptionsWithIds=function(){return kP(A3(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;py||g>y}},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 WP(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,g=d.escapeClearsValue,y=d.inputValue,x=d.isClearable,v=d.isDisabled,b=d.menuIsOpen,w=d.onKeyDown,C=d.tabSelectsValue,I=d.openMenuOnFocus,_=n.state,M=_.focusedOption,T=_.focusedValue,A=_.selectValue;if(!v&&!(typeof w=="function"&&(w(c),c.defaultPrevented))){switch(n.blockOptionHover=!0,c.key){case"ArrowLeft":if(!p||y)return;n.focusValue("previous");break;case"ArrowRight":if(!p||y)return;n.focusValue("next");break;case"Delete":case"Backspace":if(y)return;if(T)n.removeValue(T);else{if(!m)return;p?n.popValue():x&&n.clearValue()}break;case"Tab":if(n.isComposing||c.shiftKey||!b||!C||!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:y}),n.onMenuClose()):x&&g&&n.clearValue();break;case" ":if(y)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||++uK),n.state.selectValue=vh(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=bh(a,s[u])}return n}return TA(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&&Ch(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&&(Ch(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(yh):Re(Re({},yh),this.props.theme):yh}},{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,g=m.isMulti,y=m.isRtl,x=m.options,v=this.hasValue();return{clearValue:n,cx:a,getStyles:s,getClassNames:u,getValue:c,hasValue:v,isMulti:g,isRtl:y,options:x,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 NP(this.props,n,a)}},{key:"isOptionSelected",value:function(n,a){return ZP(this.props,n,a)}},{key:"filterOption",value:function(n,a){return GP(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,g=n.required,y=this.getComponents(),x=y.Input,v=this.state,b=v.inputIsHidden,w=v.ariaSelection,C=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":g,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},m&&{"aria-controls":this.getElementId("listbox")}),!s&&{"aria-readonly":!0}),this.hasValue()?w?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return s?wt.createElement(x,Ce({},C,{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},_)):wt.createElement(HQ,Ce({id:I,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:T0,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,g=this.commonProps,y=this.props,x=y.controlShouldRenderValue,v=y.isDisabled,b=y.isMulti,w=y.inputValue,C=y.placeholder,I=this.state,_=I.selectValue,M=I.focusedValue,T=I.isFocused;if(!this.hasValue()||!x)return w?null:wt.createElement(m,Ce({},g,{key:"placeholder",isDisabled:v,isFocused:T,innerProps:{id:this.getElementId("placeholder")}}),C);if(b)return _.map(function(H,J){var Z=H===M,Q="".concat(n.getOptionLabel(H),"-").concat(n.getOptionValue(H));return wt.createElement(s,Ce({},g,{components:{Container:u,Label:c,Remove:d},isFocused:Z,isDisabled:v,key:Q,index:J,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(w)return null;var A=_[0];return wt.createElement(p,Ce({},g,{data:A,isDisabled:v}),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 wt.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 wt.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 wt.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 wt.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,g=a.NoOptionsMessage,y=a.Option,x=this.commonProps,v=this.state.focusedOption,b=this.props,w=b.captureMenuScroll,C=b.inputValue,I=b.isLoading,_=b.loadingMessage,M=b.minMenuHeight,T=b.maxMenuHeight,A=b.menuIsOpen,H=b.menuPlacement,J=b.menuPosition,Z=b.menuPortalTarget,Q=b.menuShouldBlockScroll,W=b.menuShouldScrollIntoView,ie=b.noOptionsMessage,q=b.onMenuScrollToTop,ae=b.onMenuScrollToBottom;if(!A)return null;var Y=function(lt,yt){var br=lt.type,bt=lt.data,xe=lt.isDisabled,qe=lt.isSelected,_t=lt.label,at=lt.value,ut=v===bt,Ye=xe?void 0:function(){return n.onOptionHover(bt)},Jt=xe?void 0:function(){return n.selectOption(bt)},ao="".concat(n.getElementId("option"),"-").concat(yt),$r={id:ao,onClick:Jt,onMouseMove:Ye,onMouseOver:Ye,tabIndex:-1,role:"option","aria-selected":n.isAppleDevice?void 0:qe};return wt.createElement(y,Ce({},x,{innerProps:$r,data:bt,isDisabled:xe,isSelected:qe,key:ao,label:_t,type:br,value:at,isFocused:ut,innerRef:ut?n.getFocusedOptionRef:void 0}),n.formatOptionLabel(lt.data,"menu"))},me;if(this.hasOptions())me=this.getCategorizedOptions().map(function(nt){if(nt.type==="group"){var lt=nt.data,yt=nt.options,br=nt.index,bt="".concat(n.getElementId("group"),"-").concat(br),xe="".concat(bt,"-heading");return wt.createElement(s,Ce({},x,{key:bt,data:lt,options:yt,Heading:u,headingProps:{id:xe,data:nt.data},label:n.formatGroupLabel(nt.data)}),nt.options.map(function(qe){return Y(qe,"".concat(br,"-").concat(qe.index))}))}else if(nt.type==="option")return Y(nt,"".concat(nt.index))});else if(I){var se=_({inputValue:C});if(se===null)return null;me=wt.createElement(m,x,se)}else{var we=ie({inputValue:C});if(we===null)return null;me=wt.createElement(g,x,we)}var Ke={minMenuHeight:M,maxMenuHeight:T,menuPlacement:H,menuPosition:J,menuShouldScrollIntoView:W},xt=wt.createElement(jT,Ce({},x,Ke),function(nt){var lt=nt.ref,yt=nt.placerProps,br=yt.placement,bt=yt.maxHeight;return wt.createElement(c,Ce({},x,Ke,{innerRef:lt,innerProps:{onMouseDown:n.onMenuMouseDown,onMouseMove:n.onMenuMouseMove},isLoading:I,placement:br}),wt.createElement(ZQ,{captureEnabled:w,onTopArrive:q,onBottomArrive:ae,lockEnabled:Q},function(xe){return wt.createElement(d,Ce({},x,{innerRef:function(_t){n.getMenuListRef(_t),xe(_t)},innerProps:{role:"listbox","aria-multiselectable":x.isMulti,id:n.getElementId("listbox")},isLoading:I,maxHeight:bt,focusedOption:v}),me)}))});return Z||J==="fixed"?wt.createElement(p,Ce({},x,{appendTo:Z,controlElement:this.controlRef,menuPlacement:H,menuPosition:J}),xt):xt}},{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 wt.createElement(zQ,{name:d,onFocus:this.onValueInputFocus});if(!(!d||u))if(c)if(s){var g=m.map(function(v){return n.getOptionValue(v)}).join(s);return wt.createElement("input",{name:d,type:"hidden",value:g})}else{var y=m.length>0?m.map(function(v,b){return wt.createElement("input",{key:"i-".concat(b),name:d,type:"hidden",value:n.getOptionValue(v)})}):wt.createElement("input",{name:d,type:"hidden",value:""});return wt.createElement("div",null,y)}else{var x=m[0]?this.getOptionValue(m[0]):"";return wt.createElement("input",{name:d,type:"hidden",value:x})}}},{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 wt.createElement(AQ,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,g=d.isDisabled,y=d.menuIsOpen,x=this.state.isFocused,v=this.commonProps=this.getCommonProps();return wt.createElement(u,Ce({},v,{className:p,innerProps:{id:m,onKeyDown:this.onKeyDown},isDisabled:g,isFocused:x}),this.renderLiveRegion(),wt.createElement(a,Ce({},v,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:g,isFocused:x,menuIsOpen:y}),wt.createElement(c,Ce({},v,{isDisabled:g}),this.renderPlaceholderOrValue(),this.renderInput()),wt.createElement(s,Ce({},v,{isDisabled:g}),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,g=a.instancePrefix,y=n.options,x=n.value,v=n.menuIsOpen,b=n.inputValue,w=n.isMulti,C=vh(x),I={};if(s&&(x!==s.value||y!==s.options||v!==s.menuIsOpen||b!==s.inputValue)){var _=v?iK(n,C):[],M=v?kP(A3(n,C),"".concat(g,"-option")):[],T=u?sK(a,C):null,A=lK(a,_),H=bh(M,A);I={selectValue:C,focusedOption:A,focusedOptionId:H,focusableOptionsWithIds:M,focusedValue:T,clearFocusValueOnUpdate:!1}}var J=c!=null&&n!==s?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},Z=d,Q=p&&m;return p&&!Q&&(Z={value:k0(w,C,C[0]||null),options:C,action:"initial-input-focus"},Q=!m),d?.action==="initial-input-focus"&&(Z=null),Re(Re(Re({},I),J),{},{prevProps:n,ariaSelection:Z,prevWasFocused:Q})}}]),r}(mt.Component);Sh.defaultProps=aK;var Q2e=N(Oa());var cK=(0,Rh.forwardRef)(function(e,t){var r=_A(e);return zP.createElement(Sh,Ce({ref:t},r))}),jP=cK;var Ia=N(U());function _h(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 dK=["color"],UP=(0,Ia.forwardRef)(function(e,t){var r=e.color,o=r===void 0?"currentColor":r,n=_h(e,dK);return(0,Ia.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,Ia.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 fK=["color"],$P=(0,Ia.forwardRef)(function(e,t){var r=e.color,o=r===void 0?"currentColor":r,n=_h(e,fK);return(0,Ia.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,Ia.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 pK=["color"],Mh=(0,Ia.forwardRef)(function(e,t){var r=e.color,o=r===void 0?"currentColor":r,n=_h(e,pK);return(0,Ia.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,Ia.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 mK=(e,t)=>{let{value:r,onChange:o,options:n=[],styles:a=AK,classNames:s=MK,...u}=e,c=no.useId();return no.createElement(jP,{instanceId:c,ref:t,value:r,onChange:o,options:n,unstyled:!0,components:{DropdownIndicator:TK,ClearIndicator:PK,MultiValueRemove:kK,Option:EK,...e.components},styles:a,classNames:s,...u})},O0=no.forwardRef(mK),Ah={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"},hK="text-sm text-muted-foreground",gK="gap-1",vK="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",CK="gap-1",wK="p-1 rounded-md",xK="bg-border",yK="p-1 rounded-md",bK="p-1 mt-1 border bg-popover shadow-md rounded-md text-popover-foreground",LK="py-2 px-1 text-secondary-foreground text-sm font-semibold",P3={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:""},IK="text-accent-foreground p-2 bg-accent border border-dashed border-border rounded-sm",SK="flex items-center justify-center h-4 w-4 opacity-50",RK="text-accent-foreground p-2 bg-accent",_K=e=>({clearIndicator:t=>ee(wK,e?.clearIndicator?.(t)),container:t=>ee(e?.container?.(t)),control:t=>ee(Ah.base,t.isDisabled&&Ah.disabled,t.isFocused&&Ah.focus,e?.control?.(t)),dropdownIndicator:t=>ee(yK,e?.dropdownIndicator?.(t)),group:t=>ee(e?.group?.(t)),groupHeading:t=>ee(LK,e?.groupHeading?.(t)),indicatorsContainer:t=>ee(CK,e?.indicatorsContainer?.(t)),indicatorSeparator:t=>ee(xK,e?.indicatorSeparator?.(t)),input:t=>ee(e?.input?.(t)),loadingIndicator:t=>ee(SK,e?.loadingIndicator?.(t)),loadingMessage:t=>ee(RK,e?.loadingMessage?.(t)),menu:t=>ee(bK,e?.menu?.(t)),menuList:t=>ee(e?.menuList?.(t)),menuPortal:t=>ee(e?.menuPortal?.(t)),multiValue:t=>ee(vK,e?.multiValue?.(t)),multiValueLabel:t=>ee(e?.multiValueLabel?.(t)),multiValueRemove:t=>ee(e?.multiValueRemove?.(t)),noOptionsMessage:t=>ee(IK,e?.noOptionsMessage?.(t)),option:t=>ee(P3.base,t.isFocused&&P3.focus,t.isDisabled&&P3.disabled,t.isSelected&&P3.selected,e?.option?.(t)),placeholder:t=>ee(hK,e?.placeholder?.(t)),singleValue:t=>ee(e?.singleValue?.(t)),valueContainer:t=>ee(gK,e?.valueContainer?.(t))}),MK=_K({}),AK={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"}})},TK=e=>no.createElement(ol.DropdownIndicator,{...e},no.createElement(UP,{className:"h-4 w-4 opacity-50"})),PK=e=>no.createElement(ol.ClearIndicator,{...e},no.createElement(Mh,{className:"h-3.5 w-3.5 opacity-50"})),kK=e=>no.createElement(ol.MultiValueRemove,{...e},no.createElement(Mh,{className:"h-3 w-3 opacity-50"})),EK=e=>no.createElement(ol.Option,{...e},no.createElement("div",{className:"flex items-center justify-between"},no.createElement("div",null,e.data.label),e.isSelected&&no.createElement($P,null)));var k3={Default:{mqtt_topic_pattern:"milight/commands/:device_id/:device_type/:group_id",mqtt_update_topic_pattern:"milight/updates/:device_id/:device_type/:group_id",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:{}},OK=({})=>{let e=oo(),[t,r]=(0,E3.useState)("Custom");(0,E3.useEffect)(()=>{let a=e.getValues();for(let[s,u]of Object.entries(k3))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=k3[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 Yt.createElement("div",{className:"mt-4 flex flex-col gap-4"},Yt.createElement(fn,{control:e.control,name:"topic_fields_preset",render:()=>Yt.createElement(pn,null,Yt.createElement(mn,null,"Preset"),Yt.createElement(Go,null,Yt.createElement(O0,{options:Object.keys(k3).map(a=>({label:a,value:a})),value:{label:t,value:t},onChange:a=>n(a?.value)})),Yt.createElement(Zs,null,'Customize the MQTT topic patterns. Use the "Default" preset for standard configurations.'))}),t!=="Custom"&&Yt.createElement("div",{className:"preview-fields"},Yt.createElement("h4",{className:"text-sm font-medium"},"Preview:"),Yt.createElement("ul",null,Object.entries(k3[t]).map(([a,s])=>Yt.createElement("li",{key:a,className:"mt-2"},Yt.createElement("div",null,Yt.createElement("strong",{className:"text-sm font-medium"},a.replace(/_/g," ").replace(/\b\w/g,u=>u.toUpperCase()),":")),Yt.createElement("div",null,Yt.createElement("code",{className:"bg-muted text-sm rounded"},s.toString())),Yt.createElement("div",{className:"text-sm text-muted-foreground"},At.Settings.shape[a].description))))),t==="Custom"&&Yt.createElement(Vt,{fields:["mqtt_topic_pattern","mqtt_update_topic_pattern","mqtt_state_topic_pattern","mqtt_client_status_topic","simple_mqtt_client_status"]}))},XP=()=>Yt.createElement(xo,null,Yt.createElement(Vt,{title:"MQTT Connection",fields:["mqtt_server","mqtt_username","mqtt_password"],fieldTypes:{mqtt_password:"password"}}),Yt.createElement(Vt,{title:"MQTT Topics",fields:[]},Yt.createElement(OK,null)),Yt.createElement(Vt,{title:"Home Assistant MQTT Discovery",fields:["home_assistant_discovery_prefix"]}),Yt.createElement(Vt,{title:"Advanced",fields:["mqtt_state_rate_limit","mqtt_debounce_delay","mqtt_retain"]}));var O3=N(U());var qP=()=>O3.createElement(xo,null,O3.createElement(Vt,{title:"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"}}),O3.createElement(Vt,{title:"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 H3=N(U());var YP=()=>H3.createElement(xo,null,H3.createElement(Vt,{title:"Security",fields:["admin_username","admin_password"],fieldTypes:{admin_password:"password"}}),H3.createElement(Vt,{title:"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=N(U());var B1=N(U());var HK=Dn("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"}}),Th=B1.forwardRef(({className:e,variant:t,...r},o)=>B1.createElement("div",{ref:o,role:"alert",className:ee(HK({variant:t}),e),...r}));Th.displayName="Alert";var Ph=B1.forwardRef(({className:e,...t},r)=>B1.createElement("h5",{ref:r,className:ee("mb-1 font-medium leading-none tracking-tight",e),...t}));Ph.displayName="AlertTitle";var kh=B1.forwardRef(({className:e,...t},r)=>B1.createElement("div",{ref:r,className:ee("text-sm [&_p]:leading-relaxed",e),...t}));kh.displayName="AlertDescription";var H0=N(U());function VK(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}=va();return ne.createElement("div",{className:"space-y-2 mt-10"},ne.createElement(Zt,{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"))},DK=()=>{let{toast:e}=va(),[t,r]=ne.useState(null),o=a=>{console.log(a.target.files);let s=a.target.files?.[0];r(s||null)};console.log(t);let n=async()=>{if(e({title:"Uploading backup",description:"Please wait while your backup is uploaded.",variant:"default"}),!!t)try{let a=await Hn.postBackup({file:t});a.success?e({title:"Success",description:a.message,variant:"default"}):e({title:"Error uploading backup",description:a.message,variant:"destructive"})}catch(a){e({title:"Error uploading backup",description:a instanceof Error?a.message:"An unknown error occurred",variant:"destructive"})}finally{r(null)}};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(Zt,{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:n},ne.createElement("div",{className:"flex items-center space-x-2"},ne.createElement(Wo,{type:"file",id:"backupFile",onChange:o,value:t?void 0:"",accept:".bin",className:"flex-grow"}),ne.createElement(Zt,{type:"submit",disabled:!t,onClick:n,variant:"secondary"},"Upload Backup")))))},BK=({currentVersion:e,variant:t})=>{let{toast:r}=va(),[o,n]=ne.useState(null),[a,s]=ne.useState(!1),[u,c]=ne.useState(null),d=x=>{let v=x.target.files?.[0];n(v||null)},p=async()=>{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(x=>{r({title:"Error uploading firmware",description:x.message,variant:"destructive"})})},m=async()=>{s(!0);try{let v=await(await fetch("https://api.github.com/repos/sidoh/esp8266_milight_hub/releases/latest")).json();c({version:v.tag_name,url:v.html_url,body:v.body,download_links:v.assets.map(b=>({name:b.name,url:b.browser_download_url})),release_date:v.published_at})}catch{r({title:"Error checking latest version",description:"Failed to fetch the latest version from GitHub.",variant:"destructive"})}finally{s(!1)}},g=ne.useMemo(()=>!e||!u?!1:VK(u.version,e)>0,[e,u]),y=ne.useMemo(()=>!u||!t?null:u.download_links.find(x=>x.name.toLowerCase().includes(t.toLowerCase())),[u,t]);return console.log(t,u),ne.createElement("div",{className:"space-y-4"},ne.createElement(Th,{variant:"destructive"},ne.createElement(d1,{className:"h-4 w-4"}),ne.createElement(Ph,null,"Warning"),ne.createElement(kh,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:p},ne.createElement("div",{className:"flex items-center space-x-2"},ne.createElement(Wo,{type:"file",id:"firmwareFile",onChange:d,value:o?void 0:"",accept:".bin",className:"flex-grow"}),ne.createElement(Zt,{type:"submit",disabled:!o,onClick:p,variant:"secondary"},"Upload Firmware")))),!u&&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(Zt,{onClick:m,disabled:a,variant:"secondary"},a?"Checking...":"Check Latest Version"))),u&&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"}),g&&ne.createElement("p",{className:"text-green-600 font-semibold"},"A new version is available!"),ne.createElement("p",null,ne.createElement("strong",null,"Version:")," ",u.version),ne.createElement("p",null,ne.createElement("strong",null,"Release Date:")," ",new Date(u.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"},u.body),ne.createElement("div",{className:"space-x-2"},ne.createElement(Zt,{asChild:!0,variant:"outline"},ne.createElement("a",{href:u.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub")),y&&ne.createElement(Zt,{asChild:!0,variant:"secondary"},ne.createElement("a",{href:y.url,download:!0},"Download Firmware")))))},NK=({systemInfo:e,isLoading:t})=>t?ne.createElement("div",{className:"space-y-2"},ne.createElement($o,{className:"h-4 w-[200px]"}),ne.createElement($o,{className:"h-4 w-[150px]"}),ne.createElement($o,{className:"h-4 w-[180px]"}),ne.createElement($o,{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," "),JP=()=>{let[e,t]=(0,H0.useState)(null),[r,o]=(0,H0.useState)(!0),{toast:n}=va();return(0,H0.useEffect)(()=>{(async()=>{try{let s=await Hn.getAbout();t(s)}catch(s){console.error("Failed to fetch system info:",s),n({title:"Error fetching system info",description:"Failed to load system information.",variant:"destructive"})}finally{o(!1)}})()},[]),ne.createElement(xo,null,ne.createElement(Vt,{title:"System Information",fields:[]},ne.createElement(NK,{systemInfo:e,isLoading:r})),ne.createElement(Vt,{title:"Firmware",fields:[]},ne.createElement(BK,{currentVersion:e?.version||null,variant:e?.variant||null})),ne.createElement(Vt,{title:"Backups",fields:[]},ne.createElement(DK,null)),ne.createElement(Vt,{title:"Reboot",fields:["auto_restart_period"]},ne.createElement(FK,null)))};var V0=N(U());var QP=()=>V0.createElement(xo,null,V0.createElement(Vt,{title:"Device",fields:["radio_interface_type","rf24_power_level","rf24_channels","rf24_listen_channel"]}),V0.createElement(Vt,{title:"Repeats",fields:["packet_repeats","packet_repeats_per_loop","listen_repeats"]}),V0.createElement(Vt,{title:"Throttling",fields:["packet_repeat_throttle_sensitivity","packet_repeat_throttle_threshold","packet_repeat_minimum"]}));var gr=N(U()),ec=N(U());var Eh={HomeAssistant:["state","brightness","computed_color","mode","color_temp","color_mode"],Custom:[]},ZK=()=>{let e=oo(),[t,r]=(0,ec.useState)("");return(0,ec.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")]),gr.createElement("div",{className:"flex flex-col gap-2 mt-4"},gr.createElement("div",{className:"text-sm font-medium"},"Preview"),gr.createElement("pre",{className:"text-sm text-muted-foreground"},t))},GK=({})=>{let e=oo(),[t,r]=(0,ec.useState)("Custom");(0,ec.useEffect)(()=>{let a=new Set(e.getValues("group_state_fields"));for(let[s,u]of Object.entries(Eh))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",Eh[a],{shouldDirty:!0,shouldValidate:!0,shouldTouch:!0})};return gr.createElement("div",{className:"mt-4 flex flex-col gap-4"},gr.createElement(fn,{control:e.control,name:"group_state_fields_preset",render:()=>gr.createElement(pn,null,gr.createElement(mn,null,"Preset"),gr.createElement(Go,null,gr.createElement(O0,{options:Object.keys(Eh).map(a=>({label:a,value:a})),value:{label:t,value:t},onChange:a=>n(a?.value)})),gr.createElement(Zs,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"&&gr.createElement(fn,{key:"group_state_fields",control:e.control,name:"group_state_fields",render:({field:a})=>gr.createElement(pn,null,gr.createElement(mn,null,"Custom Fields"),gr.createElement(Go,null,gr.createElement(O0,{isMulti:!0,options:Object.entries(At.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))}})))}),gr.createElement(ZK,null))},KP=()=>gr.createElement(xo,null,gr.createElement(Vt,{title:"State Fields",fields:[]},gr.createElement(GK,null)),gr.createElement(Vt,{title:"Miscellaneous",fields:["enable_automatic_mode_switching","default_transition_period","state_flush_interval"]}));var Et=N(U());var WK=[{value:"5",label:"v5"},{value:"6",label:"v6"}],zK=()=>{let{setValue:e,getValues:t}=oo(),[r,o]=Et.useState(()=>t("gateway_configs")||[]),[n,a]=Et.useState(!1),s=()=>{o([...r,[0,0,6]]),a(!0)},u=p=>{o(r.filter((m,g)=>g!==p)),a(!0)},c=(p,m,g)=>{let y=[...r];y[p][m]=g,o(y),a(!0)},d=()=>{e("gateway_configs",r,{shouldValidate:!0,shouldDirty:!0,shouldTouch:!0}),a(!1)};return Et.createElement(xo,null,Et.createElement(Vt,{title:"Gateway Configurations",fields:[]},Et.createElement("div",{className:"grid grid-cols-[3fr_3fr_3fr_1fr] gap-2 mb-2 font-semibold"},Et.createElement("div",null,"Remote ID"),Et.createElement("div",null,"UDP Port"),Et.createElement("div",null,"Protocol"),Et.createElement("div",null,Et.createElement(Zt,{onClick:s,variant:"secondary",size:"icon",className:"rounded-full","aria-label":"Add gateway config"},Et.createElement(gs,{className:"h-4 w-4"})))),r.map((p,m)=>Et.createElement("div",{key:m,className:"grid grid-cols-[3fr_3fr_3fr_1fr] gap-2 mb-2 items-center"},Et.createElement(Wo,{type:"number",value:p[0],onChange:g=>c(m,0,parseInt(g.target.value)),placeholder:"Remote ID"}),Et.createElement(Wo,{type:"number",value:p[1],onChange:g=>c(m,1,parseInt(g.target.value)),placeholder:"UDP Port"}),Et.createElement(ga,{type:"single",value:p[2].toString(),onValueChange:g=>c(m,2,parseInt(g))},WK.map(g=>Et.createElement(jo,{key:g.value,value:g.value},g.label))),Et.createElement("div",{className:"flex justify-center"},Et.createElement(Zt,{onClick:()=>u(m),variant:"ghost",size:"icon",className:"text-red-500 hover:text-red-700 hover:bg-red-100","aria-label":"Remove gateway config"},Et.createElement(bd,{className:"h-4 w-4"}))))),Et.createElement("div",{className:"flex justify-between mt-2"},Et.createElement(Zt,{onClick:d,disabled:!n},"Save Changes")),Et.createElement("div",{className:"text-sm text-muted-foreground mt-4"},Et.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!"))))},ek=()=>Et.createElement(xo,null,Et.createElement(Vt,{title:"Discovery",fields:["discovery_port"]}),Et.createElement(zK,null));var rk=N(tk());var jK=[{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 Oh(){let{settings:e,isLoading:t}=zd(),r=t5({resolver:r5(At.Settings),defaultValues:{},mode:"onBlur"}),o=(0,D0.useCallback)((0,rk.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,D0.useEffect)(()=>{let n=r.watch((a,{name:s})=>{!s||!(s in At.Settings.shape)||o()});return()=>n.unsubscribe()},[r]),(0,D0.useEffect)(()=>{e&&r.reset(e)},[e]),t?Nr.createElement("div",{className:"flex justify-center h-screen space-x-4"},Nr.createElement("div",{className:"w-1/5 h-full max-h-96"},Nr.createElement($o,{className:"w-full h-full"})),Nr.createElement("div",{className:"w-3/5 h-full flex flex-col space-y-4"},Nr.createElement($o,{className:"w-full h-10"}),Nr.createElement($o,{className:"w-full h-10"}),Nr.createElement($o,{className:"w-full h-10"}))):Nr.createElement(e5,{...r},Nr.createElement("form",{onBlur:o,onSubmit:n=>{n.preventDefault(),r.handleSubmit(o)()}},Nr.createElement(yA,{items:jK},Nr.createElement(YP,{navId:"network"}),Nr.createElement(qP,{navId:"hardware"}),Nr.createElement(XP,{navId:"mqtt"}),Nr.createElement(QP,{navId:"radio"}),Nr.createElement(KP,{navId:"state"}),Nr.createElement(ek,{navId:"udp"}),Nr.createElement(JP,{navId:"system"}))))}var N1=N(U());var Io=N(U());var Be=N(U(),1),nk=N(Oa(),1);var ht=N(Tt(),1),Bh="ToastProvider",[Nh,UK,$K]=_1("Toast"),[ak,L9e]=Da("Toast",[$K]),[XK,F3]=ak(Bh),ik=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),g=Be.useRef(!1);return r.trim()||console.error(`Invalid prop \`label\` supplied to \`${Bh}\`. Expected non-empty \`string\`.`),(0,ht.jsx)(Nh.Provider,{scope:t,children:(0,ht.jsx)(XK,{scope:t,label:r,duration:o,swipeDirection:n,swipeThreshold:a,toastCount:d,viewport:u,onViewportChange:c,onToastAdd:Be.useCallback(()=>p(y=>y+1),[]),onToastRemove:Be.useCallback(()=>p(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:m,isClosePausedRef:g,children:s})})};ik.displayName=Bh;var sk="ToastViewport",qK=["F8"],Vh="toast.viewportPause",Fh="toast.viewportResume",lk=Be.forwardRef((e,t)=>{let{__scopeToast:r,hotkey:o=qK,label:n="Notifications ({hotkey})",...a}=e,s=F3(sk,r),u=UK(r),c=Be.useRef(null),d=Be.useRef(null),p=Be.useRef(null),m=Be.useRef(null),g=Ue(t,m,s.onViewportChange),y=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),x=s.toastCount>0;Be.useEffect(()=>{let b=w=>{o.length!==0&&o.every(I=>w[I]||w.code===I)&&m.current?.focus()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[o]),Be.useEffect(()=>{let b=c.current,w=m.current;if(x&&b&&w){let C=()=>{if(!s.isClosePausedRef.current){let T=new CustomEvent(Vh);w.dispatchEvent(T),s.isClosePausedRef.current=!0}},I=()=>{if(s.isClosePausedRef.current){let T=new CustomEvent(Fh);w.dispatchEvent(T),s.isClosePausedRef.current=!1}},_=T=>{!b.contains(T.relatedTarget)&&I()},M=()=>{b.contains(document.activeElement)||I()};return b.addEventListener("focusin",C),b.addEventListener("focusout",_),b.addEventListener("pointermove",C),b.addEventListener("pointerleave",M),window.addEventListener("blur",C),window.addEventListener("focus",I),()=>{b.removeEventListener("focusin",C),b.removeEventListener("focusout",_),b.removeEventListener("pointermove",C),b.removeEventListener("pointerleave",M),window.removeEventListener("blur",C),window.removeEventListener("focus",I)}}},[x,s.isClosePausedRef]);let v=Be.useCallback(({tabbingDirection:b})=>{let C=u().map(I=>{let _=I.ref.current,M=[_,...lee(_)];return b==="forwards"?M:M.reverse()});return(b==="forwards"?C.reverse():C).flat()},[u]);return Be.useEffect(()=>{let b=m.current;if(b){let w=C=>{let I=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!I){let M=document.activeElement,T=C.shiftKey;if(C.target===b&&T){d.current?.focus();return}let J=v({tabbingDirection:T?"backwards":"forwards"}),Z=J.findIndex(Q=>Q===M);Hh(J.slice(Z+1))?C.preventDefault():T?d.current?.focus():p.current?.focus()}};return b.addEventListener("keydown",w),()=>b.removeEventListener("keydown",w)}},[u,v]),(0,ht.jsxs)(dI,{ref:c,role:"region","aria-label":n.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:x?void 0:"none"},children:[x&&(0,ht.jsx)(Dh,{ref:d,onFocusFromOutsideViewport:()=>{let b=v({tabbingDirection:"forwards"});Hh(b)}}),(0,ht.jsx)(Nh.Slot,{scope:r,children:(0,ht.jsx)(be.ol,{tabIndex:-1,...a,ref:g})}),x&&(0,ht.jsx)(Dh,{ref:p,onFocusFromOutsideViewport:()=>{let b=v({tabbingDirection:"backwards"});Hh(b)}})]})});lk.displayName=sk;var uk="ToastFocusProxy",Dh=Be.forwardRef((e,t)=>{let{__scopeToast:r,onFocusFromOutsideViewport:o,...n}=e,a=F3(uk,r);return(0,ht.jsx)(Tu,{"aria-hidden":!0,tabIndex:0,...n,ref:t,style:{position:"fixed"},onFocus:s=>{let u=s.relatedTarget;!a.viewport?.contains(u)&&o()}})});Dh.displayName=uk;var D3="Toast",YK="toast.swipeStart",JK="toast.swipeMove",QK="toast.swipeCancel",KK="toast.swipeEnd",ck=Be.forwardRef((e,t)=>{let{forceMount:r,open:o,defaultOpen:n,onOpenChange:a,...s}=e,[u=!0,c]=Vr({prop:o,defaultProp:n,onChange:a});return(0,ht.jsx)(Vs,{present:r||u,children:(0,ht.jsx)(ree,{open:u,...s,ref:t,onClose:()=>c(!1),onPause:lr(e.onPause),onResume:lr(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)})})})});ck.displayName=D3;var[eee,tee]=ak(D3,{onClose(){}}),ree=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:g,onSwipeEnd:y,...x}=e,v=F3(D3,r),[b,w]=Be.useState(null),C=Ue(t,q=>w(q)),I=Be.useRef(null),_=Be.useRef(null),M=n||v.duration,T=Be.useRef(0),A=Be.useRef(M),H=Be.useRef(0),{onToastAdd:J,onToastRemove:Z}=v,Q=lr(()=>{b?.contains(document.activeElement)&&v.viewport?.focus(),s()}),W=Be.useCallback(q=>{!q||q===1/0||(window.clearTimeout(H.current),T.current=new Date().getTime(),H.current=window.setTimeout(Q,q))},[Q]);Be.useEffect(()=>{let q=v.viewport;if(q){let ae=()=>{W(A.current),d?.()},Y=()=>{let me=new Date().getTime()-T.current;A.current=A.current-me,window.clearTimeout(H.current),c?.()};return q.addEventListener(Vh,Y),q.addEventListener(Fh,ae),()=>{q.removeEventListener(Vh,Y),q.removeEventListener(Fh,ae)}}},[v.viewport,M,c,d,W]),Be.useEffect(()=>{a&&!v.isClosePausedRef.current&&W(M)},[a,M,v.isClosePausedRef,W]),Be.useEffect(()=>(J(),()=>Z()),[J,Z]);let ie=Be.useMemo(()=>b?vk(b):null,[b]);return v.viewport?(0,ht.jsxs)(ht.Fragment,{children:[ie&&(0,ht.jsx)(oee,{__scopeToast:r,role:"status","aria-live":o==="foreground"?"assertive":"polite","aria-atomic":!0,children:ie}),(0,ht.jsx)(eee,{scope:r,onClose:Q,children:nk.createPortal((0,ht.jsx)(Nh.ItemSlot,{scope:r,children:(0,ht.jsx)(cI,{asChild:!0,onEscapeKeyDown:Se(u,()=>{v.isFocusedToastEscapeKeyDownRef.current||Q(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,ht.jsx)(be.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":a?"open":"closed","data-swipe-direction":v.swipeDirection,...x,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Se(e.onKeyDown,q=>{q.key==="Escape"&&(u?.(q.nativeEvent),q.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,Q()))}),onPointerDown:Se(e.onPointerDown,q=>{q.button===0&&(I.current={x:q.clientX,y:q.clientY})}),onPointerMove:Se(e.onPointerMove,q=>{if(!I.current)return;let ae=q.clientX-I.current.x,Y=q.clientY-I.current.y,me=!!_.current,se=["left","right"].includes(v.swipeDirection),we=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,Ke=se?we(0,ae):0,xt=se?0:we(0,Y),nt=q.pointerType==="touch"?10:2,lt={x:Ke,y:xt},yt={originalEvent:q,delta:lt};me?(_.current=lt,V3(JK,m,yt,{discrete:!1})):ok(lt,v.swipeDirection,nt)?(_.current=lt,V3(YK,p,yt,{discrete:!1}),q.target.setPointerCapture(q.pointerId)):(Math.abs(ae)>nt||Math.abs(Y)>nt)&&(I.current=null)}),onPointerUp:Se(e.onPointerUp,q=>{let ae=_.current,Y=q.target;if(Y.hasPointerCapture(q.pointerId)&&Y.releasePointerCapture(q.pointerId),_.current=null,I.current=null,ae){let me=q.currentTarget,se={originalEvent:q,delta:ae};ok(ae,v.swipeDirection,v.swipeThreshold)?V3(KK,y,se,{discrete:!0}):V3(QK,g,se,{discrete:!0}),me.addEventListener("click",we=>we.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),oee=e=>{let{__scopeToast:t,children:r,...o}=e,n=F3(D3,t),[a,s]=Be.useState(!1),[u,c]=Be.useState(!1);return iee(()=>s(!0)),Be.useEffect(()=>{let d=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(d)},[]),u?null:(0,ht.jsx)(Hs,{asChild:!0,children:(0,ht.jsx)(Tu,{...o,children:a&&(0,ht.jsxs)(ht.Fragment,{children:[n.label," ",r]})})})},nee="ToastTitle",dk=Be.forwardRef((e,t)=>{let{__scopeToast:r,...o}=e;return(0,ht.jsx)(be.div,{...o,ref:t})});dk.displayName=nee;var aee="ToastDescription",fk=Be.forwardRef((e,t)=>{let{__scopeToast:r,...o}=e;return(0,ht.jsx)(be.div,{...o,ref:t})});fk.displayName=aee;var pk="ToastAction",mk=Be.forwardRef((e,t)=>{let{altText:r,...o}=e;return r.trim()?(0,ht.jsx)(gk,{altText:r,asChild:!0,children:(0,ht.jsx)(Zh,{...o,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${pk}\`. Expected non-empty \`string\`.`),null)});mk.displayName=pk;var hk="ToastClose",Zh=Be.forwardRef((e,t)=>{let{__scopeToast:r,...o}=e,n=tee(hk,r);return(0,ht.jsx)(gk,{asChild:!0,children:(0,ht.jsx)(be.button,{type:"button",...o,ref:t,onClick:Se(e.onClick,n.onClose)})})});Zh.displayName=hk;var gk=Be.forwardRef((e,t)=>{let{__scopeToast:r,altText:o,...n}=e;return(0,ht.jsx)(be.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":o||void 0,...n,ref:t})});function vk(e){let t=[];return Array.from(e.childNodes).forEach(o=>{if(o.nodeType===o.TEXT_NODE&&o.textContent&&t.push(o.textContent),see(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(...vk(o))}}),t}function V3(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?A9(n,a):n.dispatchEvent(a)}var ok=(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 iee(e=()=>{}){let t=lr(e);rr(()=>{let r=0,o=0;return r=window.requestAnimationFrame(()=>o=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(o)}},[t])}function see(e){return e.nodeType===e.ELEMENT_NODE}function lee(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 Hh(e){let t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Ck=ik,Gh=lk,Wh=ck,zh=dk,jh=fk,Uh=mk,$h=Zh;var wk=Ck,Xh=Io.forwardRef(({className:e,...t},r)=>Io.createElement(Gh,{ref:r,className:ee("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}));Xh.displayName=Gh.displayName;var cee=Dn("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"}}),qh=Io.forwardRef(({className:e,variant:t,...r},o)=>Io.createElement(Wh,{ref:o,className:ee(cee({variant:t}),e),...r}));qh.displayName=Wh.displayName;var dee=Io.forwardRef(({className:e,...t},r)=>Io.createElement(Uh,{ref:r,className:ee("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}));dee.displayName=Uh.displayName;var Yh=Io.forwardRef(({className:e,...t},r)=>Io.createElement($h,{ref:r,className:ee("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},Io.createElement(vi,{className:"h-4 w-4"})));Yh.displayName=$h.displayName;var Jh=Io.forwardRef(({className:e,...t},r)=>Io.createElement(zh,{ref:r,className:ee("text-sm font-semibold",e),...t}));Jh.displayName=zh.displayName;var Qh=Io.forwardRef(({className:e,...t},r)=>Io.createElement(jh,{ref:r,className:ee("text-sm opacity-90",e),...t}));Qh.displayName=jh.displayName;function xk(){let{toasts:e}=va();return N1.createElement(wk,null,e.map(function({id:t,title:r,description:o,action:n,...a}){return N1.createElement(qh,{key:t,...a},N1.createElement("div",{className:"grid gap-1"},r&&N1.createElement(Jh,null,r),o&&N1.createElement(Qh,null,o)),n,N1.createElement(Yh,null))}),N1.createElement(Xh,null))}var We=N(U());var yk=N(U());var fee=Dn("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 B3({className:e,variant:t,...r}){return yk.createElement("div",{className:ee(fee({variant:t}),e),...r})}var pee=e=>e.map(t=>t.toString(16).padStart(2,"0").toUpperCase()).join(" ");function mee(){let{allMessages:e}=q5(),[t,r]=(0,We.useState)(null),o=va(),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(Zt,{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(B3,{variant:"secondary"},"Device ID: ",u.d.di),We.default.createElement(B3,{variant:"secondary"},"Group ID: ",u.d.gi),We.default.createElement(B3,{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(Zt,{variant:"ghost",size:"icon",className:"h-6 w-6 ml-2",onClick:()=>n(u.d.di.toString())},We.default.createElement(Cd,{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"},pee(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(C1,{className:"border-b"},We.default.createElement(w1,null,"Event List")),We.default.createElement(x1,{className:"mt-5"},a())),We.default.createElement("div",{className:"h-full overflow-y-auto"},We.default.createElement(C1,{className:"border-b"},We.default.createElement(w1,null,"Event Details")),We.default.createElement(x1,{className:"mt-5"},t?s(t):We.default.createElement("p",{className:"text-muted-foreground"},"Select an event to view details"))))}function Kh(){return We.default.createElement("div",{className:"container mx-auto p-4"},We.default.createElement(mee,null))}var eg={"/dashboard":wA,"/not-found":xA,"/settings":Oh,"/sniffer":Kh};function Lk(){let[e,t]=(0,So.useState)(null);(0,So.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?eg[e]||eg["/not-found"]:eg["/dashboard"];return So.default.createElement(gA,null,So.default.createElement(NL,null,So.default.createElement(pA,null,So.default.createElement("div",{className:"bg-background text-foreground flex flex-col items-center justify-start"},So.default.createElement("div",{className:"container mx-auto px-4"},So.default.createElement(ZL,null),So.default.createElement("main",{className:"flex flex-col pt-10"},r&&So.default.createElement(r,null)),So.default.createElement(xk,null))))))}var tg=document.getElementById("page");tg?(tg.innerHTML="",(0,bk.createRoot)(tg).render(So.default.createElement(Lk,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/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/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.2/index.html b/web2/dist/versions/1.0.2/index.html
new file mode 100644
index 00000000..dce33970
--- /dev/null
+++ b/web2/dist/versions/1.0.2/index.html
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+MiLight Hub
+
+
+
+
+
+
+
+
diff --git a/web2/inline.js b/web2/inline.js
index 95ed59f1..8a439246 100644
--- a/web2/inline.js
+++ b/web2/inline.js
@@ -23,7 +23,7 @@ const html = `
-
+
diff --git a/web2/lib/settings.tsx b/web2/lib/settings.tsx
index c31384bf..76c53698 100644
--- a/web2/lib/settings.tsx
+++ b/web2/lib/settings.tsx
@@ -8,6 +8,8 @@ interface SettingsContextType {
settings: Settings | null;
isLoading: boolean;
updateSettings: (newSettings: Partial) => void;
+ theme: "light" | "dark";
+ toggleTheme: () => void;
}
const SettingsContext = createContext(null);
@@ -15,21 +17,44 @@ const SettingsContext = createContext(null);
export const SettingsProvider: React.FC<{ children: ReactNode }> = ({ children }) => {
const [settings, setSettings] = useState(null);
const [isLoading, setIsLoading] = useState(true);
+ const [theme, setTheme] = useState<"light" | "dark">("light");
+
useEffect(() => {
api.getSettings().then((fetchedSettings) => {
setSettings(fetchedSettings);
setIsLoading(false);
});
+
+ // Initialize theme from localStorage or system preference
+ const savedTheme = localStorage.getItem("theme");
+ const prefersDarkMode = window.matchMedia("(prefers-color-scheme: dark)").matches;
+ const initialTheme = savedTheme ? savedTheme : (prefersDarkMode ? "dark" : "light");
+
+ setTheme(initialTheme as "light" | "dark");
}, []);
const updateSettings = (newSettings: Partial) => {
const updatedSettings = { ...settings, ...newSettings };
setSettings(updatedSettings);
- api.putSettings(updatedSettings);
+ api.putSettings(updatedSettings);
+ };
+
+ const toggleTheme = () => {
+ const newTheme = theme === "dark" ? "light" : "dark";
+ setTheme(newTheme);
+ localStorage.setItem("theme", newTheme);
};
+ useEffect(() => {
+ if (theme === "dark") {
+ document.body.className = "dark";
+ } else {
+ document.body.className = "";
+ }
+ }, [theme]);
+
return (
-
+
{children}
);
@@ -43,4 +68,3 @@ export const useSettings = () => {
}
return context;
};
-
diff --git a/web2/package-lock.json b/web2/package-lock.json
index e8d843ff..48d49c08 100644
--- a/web2/package-lock.json
+++ b/web2/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "esp8266_milight_hub_ui",
- "version": "1.0.1",
+ "version": "1.0.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "esp8266_milight_hub_ui",
- "version": "1.0.1",
+ "version": "1.0.2",
"license": "ISC",
"dependencies": {
"@headlessui/react": "^2.1.9",
diff --git a/web2/package.json b/web2/package.json
index ca1e6560..5cce97cc 100644
--- a/web2/package.json
+++ b/web2/package.json
@@ -1,6 +1,6 @@
{
"name": "esp8266_milight_hub_ui",
- "version": "1.0.1",
+ "version": "1.0.2",
"description": "",
"main": "index.js",
"scripts": {
diff --git a/web2/src/index.tsx b/web2/src/index.tsx
index b65b7a40..d4277587 100644
--- a/web2/src/index.tsx
+++ b/web2/src/index.tsx
@@ -24,9 +24,6 @@ export default function App() {
);
useEffect(() => {
- // Add dark class to body
- document.body.classList.add("dark");
-
const handleHashChange = () => {
const hash = window.location.hash.slice(1);
setCurrentPage(hash as keyof typeof PAGES);