@riddix/hamh 2.1.0-alpha.451 → 2.1.0-alpha.453
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -144,7 +144,7 @@ export default theme;`}function FN(e){return typeof e=="number"?`${(e*100).toFix
|
|
|
144
144
|
animation: ${Dk} 1.4s linear infinite;
|
|
145
145
|
`:null,J1e=typeof Ok!="string"?Fm`
|
|
146
146
|
animation: ${Ok} 1.4s ease-in-out infinite;
|
|
147
|
-
`:null,Q1e=e=>{const{classes:t,variant:n,color:r,disableShrink:i}=e,o={root:["root",n,`color${ye(r)}`],svg:["svg"],track:["track"],circle:["circle",`circle${ye(n)}`,i&&"circleDisableShrink"]};return et(o,X1e,t)},eye=me("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${ye(n.color)}`]]}})(Ge(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Z1e||{animation:`${Dk} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),tye=me("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),nye=me("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${ye(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(Ge(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:J1e||{animation:`${Ok} 1.4s ease-in-out infinite`}}]}))),rye=me("circle",{name:"MuiCircularProgress",slot:"Track"})(Ge(({theme:e})=>({stroke:"currentColor",opacity:(e.vars||e).palette.action.activatedOpacity}))),Cr=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:s=!1,enableTrackSlot:a=!1,size:l=40,style:c,thickness:u=3.6,value:f=0,variant:p="indeterminate",...g}=r,y={...r,color:o,disableShrink:s,size:l,thickness:u,value:f,variant:p,enableTrackSlot:a},b=Q1e(y),v={},S={},C={};if(p==="determinate"){const w=2*Math.PI*(($a-u)/2);v.strokeDasharray=w.toFixed(3),C["aria-valuenow"]=Math.round(f),v.strokeDashoffset=`${((100-f)/100*w).toFixed(3)}px`,S.transform="rotate(-90deg)"}return h.jsx(eye,{className:Te(b.root,i),style:{width:l,height:l,...S,...c},ownerState:y,ref:n,role:"progressbar",...C,...g,children:h.jsxs(tye,{className:b.svg,ownerState:y,viewBox:`${$a/2} ${$a/2} ${$a} ${$a}`,children:[a?h.jsx(rye,{className:b.track,ownerState:y,cx:$a,cy:$a,r:($a-u)/2,fill:"none",strokeWidth:u,"aria-hidden":"true"}):null,h.jsx(nye,{className:b.circle,style:v,ownerState:y,cx:$a,cy:$a,r:($a-u)/2,fill:"none",strokeWidth:u})]})})});function iye(e){return Qe("MuiIconButton",e)}const WN=tt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),oye=e=>{const{classes:t,disabled:n,color:r,edge:i,size:o,loading:s}=e,a={root:["root",s&&"loading",n&&"disabled",r!=="default"&&`color${ye(r)}`,i&&`edge${ye(i)}`,`size${ye(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return et(a,iye,t)},sye=me(va,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${ye(n.color)}`],n.edge&&t[`edge${ye(n.edge)}`],t[`size${ye(n.size)}`]]}})(Ge(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),Ge(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${WN.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${WN.loading}`]:{color:"transparent"}}))),aye=me("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),en=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiIconButton"}),{edge:i=!1,children:o,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium",id:f,loading:p=null,loadingIndicator:g,...y}=r,b=Pu(f),v=g??h.jsx(Cr,{"aria-labelledby":b,color:"inherit",size:16}),S={...r,edge:i,color:a,disabled:l,disableFocusRipple:c,loading:p,loadingIndicator:v,size:u},C=oye(S);return h.jsxs(sye,{id:p?b:f,className:Te(C.root,s),centerRipple:!0,focusRipple:!c,disabled:l||p,ref:n,...y,ownerState:S,children:[typeof p=="boolean"&&h.jsx("span",{className:C.loadingWrapper,style:{display:"contents"},children:h.jsx(aye,{className:C.loadingIndicator,ownerState:S,children:p&&v})}),o]})}),lye=ke(h.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})),cye=ke(h.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),uye=ke(h.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),dye=ke(h.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"})),EX=ke(h.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),fye=e=>{const{variant:t,color:n,severity:r,classes:i}=e,o={root:["root",`color${ye(n||r)}`,`${t}${ye(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return et(o,w1e,i)},hye=me(Ur,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${ye(n.color||n.severity)}`]]}})(Ge(({theme:e})=>{const t=e.palette.mode==="light"?e.darken:e.lighten,n=e.palette.mode==="light"?e.lighten:e.darken;return{...e.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter(Bn(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${r}StandardBg`]:n(e.palette[r].light,.9),[`& .${HN.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(Bn(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),border:`1px solid ${(e.vars||e).palette[r].light}`,[`& .${HN.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(Bn(["dark"])).map(([r])=>({props:{colorSeverity:r,variant:"filled"},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${r}FilledColor`],backgroundColor:e.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:e.palette.mode==="dark"?e.palette[r].dark:e.palette[r].main,color:e.palette.getContrastText(e.palette[r].main)}}}))]}})),pye=me("div",{name:"MuiAlert",slot:"Icon"})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),mye=me("div",{name:"MuiAlert",slot:"Message"})({padding:"8px 0",minWidth:0,overflow:"auto"}),gye=me("div",{name:"MuiAlert",slot:"Action"})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),qN={success:h.jsx(lye,{fontSize:"inherit"}),warning:h.jsx(cye,{fontSize:"inherit"}),error:h.jsx(uye,{fontSize:"inherit"}),info:h.jsx(dye,{fontSize:"inherit"})},Ut=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiAlert"}),{action:i,children:o,className:s,closeText:a="Close",color:l,components:c={},componentsProps:u={},icon:f,iconMapping:p=qN,onClose:g,role:y="alert",severity:b="success",slotProps:v={},slots:S={},variant:C="standard",...w}=r,A={...r,color:l,severity:b,variant:C,colorSeverity:l||b},E=fye(A),D={slots:{closeButton:c.CloseButton,closeIcon:c.CloseIcon,...S},slotProps:{...u,...v}},[O,T]=ut("root",{ref:n,shouldForwardComponentProp:!0,className:Te(E.root,s),elementType:hye,externalForwardedProps:{...D,...w},ownerState:A,additionalProps:{role:y,elevation:0}}),[I,L]=ut("icon",{className:E.icon,elementType:pye,externalForwardedProps:D,ownerState:A}),[$,R]=ut("message",{className:E.message,elementType:mye,externalForwardedProps:D,ownerState:A}),[F,P]=ut("action",{className:E.action,elementType:gye,externalForwardedProps:D,ownerState:A}),[z,N]=ut("closeButton",{elementType:en,externalForwardedProps:D,ownerState:A}),[V,U]=ut("closeIcon",{elementType:EX,externalForwardedProps:D,ownerState:A});return h.jsxs(O,{...T,children:[f!==!1?h.jsx(I,{...L,children:f||p[b]||qN[b]}):null,h.jsx($,{...R,children:o}),i!=null?h.jsx(F,{...P,children:i}):null,i==null&&g?h.jsx(F,{...P,children:h.jsx(z,{size:"small","aria-label":a,title:a,color:"inherit",onClick:g,...N,children:h.jsx(V,{fontSize:"small",...U})})}):null]})});function yye(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=e,s=Id();_.useEffect(()=>{if(!i)return;function S(C){C.defaultPrevented||C.key==="Escape"&&r?.(C,"escapeKeyDown")}return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[i,r]);const a=Ni((S,C)=>{r?.(S,C)}),l=Ni(S=>{!r||S==null||s.start(S,()=>{a(null,"timeout")})});_.useEffect(()=>(i&&l(t),s.clear),[i,t,l,s]);const c=S=>{r?.(S,"clickaway")},u=s.clear,f=_.useCallback(()=>{t!=null&&l(o??t*.5)},[t,o,l]),p=S=>C=>{const w=S.onBlur;w?.(C),f()},g=S=>C=>{const w=S.onFocus;w?.(C),u()},y=S=>C=>{const w=S.onMouseEnter;w?.(C),u()},b=S=>C=>{const w=S.onMouseLeave;w?.(C),f()};return _.useEffect(()=>{if(!n&&i)return window.addEventListener("focus",f),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",u)}},[n,i,f,u]),{getRootProps:(S={})=>{const C={...Xi(e),...Xi(S)};return{role:"presentation",...S,...C,onBlur:p(C),onFocus:g(C),onMouseEnter:y(C),onMouseLeave:b(C)}},onClickAway:c}}function bf(e){return parseInt(_.version,10)>=19?e?.props?.ref||null:e?.ref||null}function GN(e){return e.substring(2).toLowerCase()}function bye(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function vye(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:i,touchEvent:o="onTouchEnd"}=e,s=_.useRef(!1),a=_.useRef(null),l=_.useRef(!1),c=_.useRef(!1);_.useEffect(()=>(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=Mr(bf(t),a),f=Ni(y=>{const b=c.current;c.current=!1;const v=Di(a.current);if(!l.current||!a.current||"clientX"in y&&bye(y,v))return;if(s.current){s.current=!1;return}let S;y.composedPath?S=y.composedPath().includes(a.current):S=!v.documentElement.contains(y.target)||a.current.contains(y.target),!S&&(n||!b)&&i(y)}),p=y=>b=>{c.current=!0;const v=t.props[y];v&&v(b)},g={ref:u};return o!==!1&&(g[o]=p(o)),_.useEffect(()=>{if(o!==!1){const y=GN(o),b=Di(a.current),v=()=>{s.current=!0};return b.addEventListener(y,f),b.addEventListener("touchmove",v),()=>{b.removeEventListener(y,f),b.removeEventListener("touchmove",v)}}},[f,o]),r!==!1&&(g[r]=p(r)),_.useEffect(()=>{if(r!==!1){const y=GN(r),b=Di(a.current);return b.addEventListener(y,f),()=>{b.removeEventListener(y,f)}}},[f,r]),_.cloneElement(t,g)}const UO=e=>e.scrollTop;function Jd(e,t){const{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:i.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:i.transitionDelay}}function Tk(e){return`scale(${e}, ${e**2})`}const xye={entering:{opacity:1,transform:Tk(1)},entered:{opacity:1,transform:"none"}},T7=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Gy=_.forwardRef(function(t,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:p,onExiting:g,style:y,timeout:b="auto",TransitionComponent:v=Ma,...S}=t,C=Id(),w=_.useRef(),A=io(),E=_.useRef(null),D=Mr(E,bf(o),n),O=z=>N=>{if(z){const V=E.current;N===void 0?z(V):z(V,N)}},T=O(u),I=O((z,N)=>{UO(z);const{duration:V,delay:U,easing:K}=Jd({style:y,timeout:b,easing:s},{mode:"enter"});let X;b==="auto"?(X=A.transitions.getAutoHeightDuration(z.clientHeight),w.current=X):X=V,z.style.transition=[A.transitions.create("opacity",{duration:X,delay:U}),A.transitions.create("transform",{duration:T7?X:X*.666,delay:U,easing:K})].join(","),l&&l(z,N)}),L=O(c),$=O(g),R=O(z=>{const{duration:N,delay:V,easing:U}=Jd({style:y,timeout:b,easing:s},{mode:"exit"});let K;b==="auto"?(K=A.transitions.getAutoHeightDuration(z.clientHeight),w.current=K):K=N,z.style.transition=[A.transitions.create("opacity",{duration:K,delay:V}),A.transitions.create("transform",{duration:T7?K:K*.666,delay:T7?V:V||K*.333,easing:U})].join(","),z.style.opacity=0,z.style.transform=Tk(.75),f&&f(z)}),F=O(p),P=z=>{b==="auto"&&C.start(w.current||0,z),r&&r(E.current,z)};return h.jsx(v,{appear:i,in:a,nodeRef:E,onEnter:I,onEntered:L,onEntering:T,onExit:R,onExited:F,onExiting:$,addEndListener:P,timeout:b==="auto"?null:b,...S,children:(z,{ownerState:N,...V})=>_.cloneElement(o,{style:{opacity:0,transform:Tk(.75),visibility:z==="exited"&&!a?"hidden":void 0,...xye[z],...y,...o.props.style},ref:D,...V})})});Gy&&(Gy.muiSupportAuto=!0);function Sye(e){return Qe("MuiSnackbarContent",e)}tt("MuiSnackbarContent",["root","message","action"]);const wye=e=>{const{classes:t}=e;return et({root:["root"],action:["action"],message:["message"]},Sye,t)},Cye=me(Ur,{name:"MuiSnackbarContent",slot:"Root"})(Ge(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(Wy(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:Wy(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),Eye=me("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),Aye=me("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),kye=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiSnackbarContent"}),{action:i,className:o,message:s,role:a="alert",...l}=r,c=r,u=wye(c);return h.jsxs(Cye,{role:a,elevation:6,className:Te(u.root,o),ownerState:c,ref:n,...l,children:[h.jsx(Eye,{className:u.message,ownerState:c,children:s}),i?h.jsx(Aye,{className:u.action,ownerState:c,children:i}):null]})});function _ye(e){return Qe("MuiSnackbar",e)}tt("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const Dye=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${ye(n.vertical)}${ye(n.horizontal)}`]};return et(r,_ye,t)},Oye=me("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${ye(n.anchorOrigin.vertical)}${ye(n.anchorOrigin.horizontal)}`]]}})(Ge(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),VO=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiSnackbar"}),i=io(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:p,ContentProps:g,disableWindowBlurListener:y=!1,message:b,onBlur:v,onClose:S,onFocus:C,onMouseEnter:w,onMouseLeave:A,open:E,resumeHideDuration:D,slots:O={},slotProps:T={},TransitionComponent:I,transitionDuration:L=o,TransitionProps:{onEnter:$,onExited:R,...F}={},...P}=r,z={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:y,TransitionComponent:I,transitionDuration:L},N=Dye(z),{getRootProps:V,onClickAway:U}=yye(z),[K,X]=_.useState(!0),B=ie=>{X(!0),R&&R(ie)},W=(ie,se)=>{X(!1),$&&$(ie,se)},q={slots:{transition:I,...O},slotProps:{content:g,clickAwayListener:p,transition:F,...T}},[H,Y]=ut("root",{ref:n,className:[N.root,f],elementType:Oye,getSlotProps:V,externalForwardedProps:{...q,...P},ownerState:z}),[J,{ownerState:te,...ee}]=ut("clickAwayListener",{elementType:vye,externalForwardedProps:q,getSlotProps:ie=>({onClickAway:(...se)=>{const fe=se[0];ie.onClickAway?.(...se),!fe?.defaultMuiPrevented&&U(...se)}}),ownerState:z}),[ae,ue]=ut("content",{elementType:kye,shouldForwardComponentProp:!0,externalForwardedProps:q,additionalProps:{message:b,action:s},ownerState:z}),[ne,Z]=ut("transition",{elementType:Gy,externalForwardedProps:q,getSlotProps:ie=>({onEnter:(...se)=>{ie.onEnter?.(...se),W(...se)},onExited:(...se)=>{ie.onExited?.(...se),B(...se)}}),additionalProps:{appear:!0,in:E,timeout:L,direction:a==="top"?"down":"up"},ownerState:z});return!E&&K?null:h.jsx(J,{...ee,...O.clickAwayListener&&{ownerState:te},children:h.jsx(H,{...Y,children:h.jsx(ne,{...Z,children:u||h.jsx(ae,{...ue})})})})}),AX=_.createContext({show:()=>{}});let Tye=0;const Mye=e=>{const[t,n]=_.useState([]),r=_.useCallback(o=>{n(s=>[...s,{...o,autoHideDuration:o.autoHideDuration??6e3,notificationId:Tye++}])},[]),i=o=>{n(s=>s.filter(a=>a.notificationId!==o))};return h.jsxs(AX.Provider,{value:{show:r},children:[e.children,t.map(o=>h.jsx(VO,{open:!0,autoHideDuration:o.autoHideDuration,onClose:()=>i(o.notificationId),children:h.jsx(Ut,{severity:o.severity,variant:"filled",sx:{minWidth:"300px"},children:o.message})},o.notificationId))]})};function fo(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Rye=typeof Symbol=="function"&&Symbol.observable||"@@observable",KN=Rye,M7=()=>Math.random().toString(36).substring(7).split("").join("."),Iye={INIT:`@@redux/INIT${M7()}`,REPLACE:`@@redux/REPLACE${M7()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${M7()}`},F4=Iye;function WO(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function kX(e,t,n){if(typeof e!="function")throw new Error(fo(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(fo(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(fo(1));return n(kX)(e,t)}let r=e,i=t,o=new Map,s=o,a=0,l=!1;function c(){s===o&&(s=new Map,o.forEach((v,S)=>{s.set(S,v)}))}function u(){if(l)throw new Error(fo(3));return i}function f(v){if(typeof v!="function")throw new Error(fo(4));if(l)throw new Error(fo(5));let S=!0;c();const C=a++;return s.set(C,v),function(){if(S){if(l)throw new Error(fo(6));S=!1,c(),s.delete(C),o=null}}}function p(v){if(!WO(v))throw new Error(fo(7));if(typeof v.type>"u")throw new Error(fo(8));if(typeof v.type!="string")throw new Error(fo(17));if(l)throw new Error(fo(9));try{l=!0,i=r(i,v)}finally{l=!1}return(o=s).forEach(C=>{C()}),v}function g(v){if(typeof v!="function")throw new Error(fo(10));r=v,p({type:F4.REPLACE})}function y(){const v=f;return{subscribe(S){if(typeof S!="object"||S===null)throw new Error(fo(11));function C(){const A=S;A.next&&A.next(u())}return C(),{unsubscribe:v(C)}},[KN](){return this}}}return p({type:F4.INIT}),{dispatch:p,subscribe:f,getState:u,replaceReducer:g,[KN]:y}}function jye(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:F4.INIT})>"u")throw new Error(fo(12));if(typeof n(void 0,{type:F4.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(fo(13))})}function Pye(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const s=t[o];typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let i;try{jye(n)}catch(o){i=o}return function(s={},a){if(i)throw i;let l=!1;const c={};for(let u=0;u<r.length;u++){const f=r[u],p=n[f],g=s[f],y=p(g,a);if(typeof y>"u")throw a&&a.type,new Error(fo(14));c[f]=y,l=l||y!==g}return l=l||r.length!==Object.keys(s).length,l?c:s}}function B4(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function $ye(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(fo(15))};const s={getState:i.getState,dispatch:(l,...c)=>o(l,...c)},a=e.map(l=>l(s));return o=B4(...a)(i.dispatch),{...i,dispatch:o}}}function Lye(e){return WO(e)&&"type"in e&&typeof e.type=="string"}var _X=Symbol.for("immer-nothing"),YN=Symbol.for("immer-draftable"),Uo=Symbol.for("immer-state");function za(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ps=Object,sm=Ps.getPrototypeOf,z4="constructor",tw="prototype",Mk="configurable",H4="enumerable",N5="writable",Ky="value",Au=e=>!!e&&!!e[Uo];function il(e){return e?DX(e)||rw(e)||!!e[YN]||!!e[z4]?.[YN]||iw(e)||ow(e):!1}var Nye=Ps[tw][z4].toString(),XN=new WeakMap;function DX(e){if(!e||!qO(e))return!1;const t=sm(e);if(t===null||t===Ps[tw])return!0;const n=Ps.hasOwnProperty.call(t,z4)&&t[z4];if(n===Object)return!0;if(!d0(n))return!1;let r=XN.get(n);return r===void 0&&(r=Function.toString.call(n),XN.set(n,r)),r===Nye}function nw(e,t,n=!0){bb(e)===0?(n?Reflect.ownKeys(e):Ps.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function bb(e){const t=e[Uo];return t?t.type_:rw(e)?1:iw(e)?2:ow(e)?3:0}var ZN=(e,t,n=bb(e))=>n===2?e.has(t):Ps[tw].hasOwnProperty.call(e,t),Rk=(e,t,n=bb(e))=>n===2?e.get(t):e[t],U4=(e,t,n,r=bb(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Fye(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var rw=Array.isArray,iw=e=>e instanceof Map,ow=e=>e instanceof Set,qO=e=>typeof e=="object",d0=e=>typeof e=="function",R7=e=>typeof e=="boolean";function Bye(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var lu=e=>e.copy_||e.base_,GO=e=>e.modified_?e.copy_:e.base_;function Ik(e,t){if(iw(e))return new Map(e);if(ow(e))return new Set(e);if(rw(e))return Array[tw].slice.call(e);const n=DX(e);if(t===!0||t==="class_only"&&!n){const r=Ps.getOwnPropertyDescriptors(e);delete r[Uo];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const s=i[o],a=r[s];a[N5]===!1&&(a[N5]=!0,a[Mk]=!0),(a.get||a.set)&&(r[s]={[Mk]:!0,[N5]:!0,[H4]:a[H4],[Ky]:e[s]})}return Ps.create(sm(e),r)}else{const r=sm(e);if(r!==null&&n)return{...e};const i=Ps.create(r);return Ps.assign(i,e)}}function KO(e,t=!1){return sw(e)||Au(e)||!il(e)||(bb(e)>1&&Ps.defineProperties(e,{set:Dx,add:Dx,clear:Dx,delete:Dx}),Ps.freeze(e),t&&nw(e,(n,r)=>{KO(r,!0)},!1)),e}function zye(){za(2)}var Dx={[Ky]:zye};function sw(e){return e===null||!qO(e)?!0:Ps.isFrozen(e)}var V4="MapSet",jk="Patches",JN="ArrayMethods",OX={};function Ih(e){const t=OX[e];return t||za(0,e),t}var QN=e=>!!OX[e],Yy,TX=()=>Yy,Hye=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:QN(V4)?Ih(V4):void 0,arrayMethodsPlugin_:QN(JN)?Ih(JN):void 0});function eF(e,t){t&&(e.patchPlugin_=Ih(jk),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Pk(e){$k(e),e.drafts_.forEach(Uye),e.drafts_=null}function $k(e){e===Yy&&(Yy=e.parent_)}var tF=e=>Yy=Hye(Yy,e);function Uye(e){const t=e[Uo];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function nF(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Uo].modified_&&(Pk(t),za(4)),il(e)&&(e=rF(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Uo].base_,e,t)}else e=rF(t,n);return Vye(t,e,!0),Pk(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==_X?e:void 0}function rF(e,t){if(sw(t))return t;const n=t[Uo];if(!n)return W4(t,e.handledSet_,e);if(!aw(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);IX(n,e)}return n.copy_}function Vye(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&KO(t,n)}function MX(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var aw=(e,t)=>e.scope_===t,Wye=[];function RX(e,t,n,r){const i=lu(e),o=e.type_;if(r!==void 0&&Rk(i,r,o)===t){U4(i,r,n,o);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;nw(i,(l,c)=>{if(Au(c)){const u=a.get(c)||[];u.push(l),a.set(c,u)}})}const s=e.draftLocations_.get(t)??Wye;for(const a of s)U4(i,a,n,o)}function qye(e,t,n){e.callbacks_.push(function(i){const o=t;if(!o||!aw(o,i))return;i.mapSetPlugin_?.fixSetContents(o);const s=GO(o);RX(e,o.draft_??o,s,n),IX(o,i)})}function IX(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const i=r.getPath(e);i&&r.generatePatches_(e,i,t)}MX(e)}}function Gye(e,t,n){const{scope_:r}=e;if(Au(n)){const i=n[Uo];aw(i,r)&&i.callbacks_.push(function(){F5(e);const s=GO(i);RX(e,n,s,t)})}else il(n)&&e.callbacks_.push(function(){const o=lu(e);e.type_===3?o.has(n)&&W4(n,r.handledSet_,r):Rk(o,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&W4(Rk(e.copy_,t,e.type_),r.handledSet_,r)})}function W4(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Au(e)||t.has(e)||!il(e)||sw(e)||(t.add(e),nw(e,(r,i)=>{if(Au(i)){const o=i[Uo];if(aw(o,n)){const s=GO(o);U4(e,r,s,e.type_),MX(o)}}else il(i)&&W4(i,t,n)})),e}function Kye(e,t){const n=rw(e),r={type_:n?1:0,scope_:t?t.scope_:TX(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,o=q4;n&&(i=[r],o=Xy);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,[a,r]}var q4={get(e,t){if(t===Uo)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=lu(e);if(!ZN(i,t,e.type_))return Yye(e,i,t);const o=i[t];if(e.finalized_||!il(o)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Bye(t))return o;if(o===I7(e.base_,t)){F5(e);const s=e.type_===1?+t:t,a=Nk(e.scope_,o,e,s);return e.copy_[s]=a}return o},has(e,t){return t in lu(e)},ownKeys(e){return Reflect.ownKeys(lu(e))},set(e,t,n){const r=jX(lu(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=I7(lu(e),t),o=i?.[Uo];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Fye(n,i)&&(n!==void 0||ZN(e.base_,t,e.type_)))return!0;F5(e),Lk(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Gye(e,t,n)),!0},deleteProperty(e,t){return F5(e),I7(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Lk(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=lu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[N5]:!0,[Mk]:e.type_!==1||t!=="length",[H4]:r[H4],[Ky]:n[t]}},defineProperty(){za(11)},getPrototypeOf(e){return sm(e.base_)},setPrototypeOf(){za(12)}},Xy={};for(let e in q4){let t=q4[e];Xy[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Xy.deleteProperty=function(e,t){return Xy.set.call(this,e,t,void 0)};Xy.set=function(e,t,n){return q4.set.call(this,e[0],t,n,e[0])};function I7(e,t){const n=e[Uo];return(n?lu(n):e)[t]}function Yye(e,t,n){const r=jX(t,n);return r?Ky in r?r[Ky]:r.get?.call(e.draft_):void 0}function jX(e,t){if(!(t in e))return;let n=sm(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=sm(n)}}function Lk(e){e.modified_||(e.modified_=!0,e.parent_&&Lk(e.parent_))}function F5(e){e.copy_||(e.assigned_=new Map,e.copy_=Ik(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Xye=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(d0(t)&&!d0(n)){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}d0(n)||za(6),r!==void 0&&!d0(r)&&za(7);let i;if(il(t)){const o=tF(this),s=Nk(o,t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?Pk(o):$k(o)}return eF(o,r),nF(i,o)}else if(!t||!qO(t)){if(i=n(t),i===void 0&&(i=t),i===_X&&(i=void 0),this.autoFreeze_&&KO(i,!0),r){const o=[],s=[];Ih(jk).generateReplacementPatches_(t,i,{patches_:o,inversePatches_:s}),r(o,s)}return i}else za(1,t)},this.produceWithPatches=(t,n)=>{if(d0(t))return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},R7(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),R7(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),R7(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){il(e)||za(8),Au(e)&&(e=Zye(e));const t=tF(this),n=Nk(t,e,void 0);return n[Uo].isManual_=!0,$k(t),n}finishDraft(e,t){const n=e&&e[Uo];(!n||!n.isManual_)&&za(9);const{scope_:r}=n;return eF(r,t),nF(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Ih(jk).applyPatches_;return Au(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Nk(e,t,n,r){const[i,o]=iw(t)?Ih(V4).proxyMap_(t,n):ow(t)?Ih(V4).proxySet_(t,n):Kye(t,n);return(n?.scope_??TX()).drafts_.push(i),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&r!==void 0?qye(n,o,r):o.callbacks_.push(function(l){l.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:c}=l;o.modified_&&c&&c.generatePatches_(o,[],l)}),i}function Zye(e){return Au(e)||za(10,e),PX(e)}function PX(e){if(!il(e)||sw(e))return e;const t=e[Uo];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ik(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Ik(e,!0);return nw(n,(i,o)=>{U4(n,i,PX(o))},r),t&&(t.finalized_=!1),n}var Jye=new Xye,$X=Jye.produce,G4=Symbol("NOT_FOUND");function Qye(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function e2e(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function t2e(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var iF=e=>Array.isArray(e)?e:[e];function n2e(e){const t=Array.isArray(e[0])?e[0]:e;return t2e(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function r2e(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function i2e(e){let t;return{get(n){return t&&e(t.key,n)?t.value:G4},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function o2e(e,t){let n=[];function r(a){const l=n.findIndex(c=>t(a,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return G4}function i(a,l){r(a)===G4&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var s2e=(e,t)=>e===t;function a2e(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:i}=n;for(let o=0;o<i;o++)if(!e(n[o],r[o]))return!1;return!0}}function l2e(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=s2e,maxSize:i=1,resultEqualityCheck:o}=n,s=a2e(r);let a=0;const l=i<=1?i2e(s):o2e(i,s);function c(){let u=l.get(arguments);if(u===G4){if(u=e.apply(null,arguments),a++,o){const p=l.getEntries().find(g=>o(g.value,u));p&&(u=p.value,a!==0&&a--)}l.put(arguments,u)}return u}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}var c2e=class{constructor(e){this.value=e}deref(){return this.value}},u2e=typeof WeakRef<"u"?WeakRef:c2e,d2e=0,oF=1;function Ox(){return{s:d2e,v:void 0,o:null,p:null}}function LX(e,t={}){let n=Ox();const{resultEqualityCheck:r}=t;let i,o=0;function s(){let a=n;const{length:l}=arguments;for(let f=0,p=l;f<p;f++){const g=arguments[f];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=a.o;y===null&&(a.o=y=new WeakMap);const b=y.get(g);b===void 0?(a=Ox(),y.set(g,a)):a=b}else{let y=a.p;y===null&&(a.p=y=new Map);const b=y.get(g);b===void 0?(a=Ox(),y.set(g,a)):a=b}}const c=a;let u;if(a.s===oF)u=a.v;else if(u=e.apply(null,arguments),o++,r){const f=i?.deref?.()??i;f!=null&&r(f,u)&&(u=f,o!==0&&o--),i=typeof u=="object"&&u!==null||typeof u=="function"?new u2e(u):u}return c.s=oF,c.v=u,u}return s.clearCache=()=>{n=Ox(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function NX(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,s=0,a,l={},c=i.pop();typeof c=="object"&&(l=c,c=i.pop()),Qye(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:f,memoizeOptions:p=[],argsMemoize:g=LX,argsMemoizeOptions:y=[]}=u,b=iF(p),v=iF(y),S=n2e(i),C=f(function(){return o++,c.apply(null,arguments)},...b),w=g(function(){s++;const E=r2e(S,arguments);return a=C.apply(null,E),a},...v);return Object.assign(w,{resultFunc:c,memoizedResultFunc:C,dependencies:S,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>a,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:f,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var FX=NX(LX),f2e=Object.assign((e,t=FX)=>{e2e(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((s,a,l)=>(s[n[l]]=a,s),{}))},{withTypes:()=>f2e});function BX(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var h2e=BX(),p2e=BX,m2e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?B4:B4.apply(null,arguments)},g2e=e=>e&&typeof e.match=="function";function sy(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(K4(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Lye(r)&&r.type===e,n}var zX=class z1 extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,z1.prototype)}static get[Symbol.species](){return z1}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new z1(...t[0].concat(this)):new z1(...t.concat(this))}};function sF(e){return il(e)?$X(e,()=>{}):e}function y2e(e){return typeof e=="boolean"}var b2e=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let s=new zX;return n&&(y2e(n)?s.push(h2e):s.push(p2e(n.extraArgument))),s},v2e="RTK_autoBatch",aF=e=>t=>{setTimeout(t,e)},x2e=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,o=!1,s=!1;const a=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:aF(10):e.type==="callback"?e.queueNotification:aF(e.timeout),c=()=>{s=!1,o&&(o=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const f=()=>i&&u(),p=r.subscribe(f);return a.add(u),()=>{p(),a.delete(u)}},dispatch(u){try{return i=!u?.meta?.[v2e],o=!i,o&&(s||(s=!0,l(c))),r.dispatch(u)}finally{i=!0}}})},S2e=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new zX(e);return r&&i.push(x2e(typeof r=="object"?r:void 0)),i};function w2e(e){const t=b2e(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{};let a;if(typeof n=="function")a=n;else if(WO(n))a=Pye(n);else throw new Error(K4(1));let l;typeof r=="function"?l=r(t):l=t();let c=B4;i&&(c=m2e({trace:!1,...typeof i=="object"&&i}));const u=$ye(...l),f=S2e(u);let p=typeof s=="function"?s(f):f();const g=c(...p);return kX(a,o,g)}function C2e(e){const t={},n=[];let r;const i={addCase(o,s){const a=typeof o=="string"?o:o.type;if(!a)throw new Error(K4(28));if(a in t)throw new Error(K4(29));return t[a]=s,i},addAsyncThunk(o,s){return s.pending&&(t[o.pending.type]=s.pending),s.rejected&&(t[o.rejected.type]=s.rejected),s.fulfilled&&(t[o.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:o.settled,reducer:s.settled}),i},addMatcher(o,s){return n.push({matcher:o,reducer:s}),i},addDefaultCase(o){return r=o,i}};return e(i),[t,n,r]}function E2e(e){return typeof e=="function"}function YO(e,t){let[n,r,i]=C2e(t),o;if(E2e(e))o=()=>sF(e());else{const a=sF(e);o=()=>a}function s(a=o(),l){let c=[n[l.type],...r.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[i]),c.reduce((u,f)=>{if(f)if(Au(u)){const g=f(u,l);return g===void 0?u:g}else{if(il(u))return $X(u,p=>f(p,l));{const p=f(u,l);if(p===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return p}}return u},a)}return s.getInitialState=o,s}var A2e=(e,t)=>g2e(e)?e.match(t):e(t);function k2e(...e){return t=>e.some(n=>A2e(n,t))}var _2e="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",D2e=(e=21)=>{let t="",n=e;for(;n--;)t+=_2e[Math.random()*64|0];return t},O2e=["name","message","stack","code"],j7=class{constructor(e,t){this.payload=e,this.meta=t}_type},lF=class{constructor(e,t){this.payload=e,this.meta=t}_type},T2e=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of O2e)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},cF="External signal was aborted",M2e=(()=>{function e(t,n,r){const i=sy(t+"/fulfilled",(l,c,u,f)=>({payload:l,meta:{...f||{},arg:u,requestId:c,requestStatus:"fulfilled"}})),o=sy(t+"/pending",(l,c,u)=>({payload:void 0,meta:{...u||{},arg:c,requestId:l,requestStatus:"pending"}})),s=sy(t+"/rejected",(l,c,u,f,p)=>({payload:f,error:(r&&r.serializeError||T2e)(l||"Rejected"),meta:{...p||{},arg:u,requestId:c,rejectedWithValue:!!f,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function a(l,{signal:c}={}){return(u,f,p)=>{const g=r?.idGenerator?r.idGenerator(l):D2e(),y=new AbortController;let b,v;function S(w){v=w,y.abort()}c&&(c.aborted?S(cF):c.addEventListener("abort",()=>S(cF),{once:!0}));const C=(async function(){let w;try{let E=r?.condition?.(l,{getState:f,extra:p});if(I2e(E)&&(E=await E),E===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const D=new Promise((O,T)=>{b=()=>{T({name:"AbortError",message:v||"Aborted"})},y.signal.addEventListener("abort",b,{once:!0})});u(o(g,l,r?.getPendingMeta?.({requestId:g,arg:l},{getState:f,extra:p}))),w=await Promise.race([D,Promise.resolve(n(l,{dispatch:u,getState:f,extra:p,requestId:g,signal:y.signal,abort:S,rejectWithValue:(O,T)=>new j7(O,T),fulfillWithValue:(O,T)=>new lF(O,T)})).then(O=>{if(O instanceof j7)throw O;return O instanceof lF?i(O.payload,g,l,O.meta):i(O,g,l)})])}catch(E){w=E instanceof j7?s(null,g,l,E.payload,E.meta):s(E,g,l)}finally{b&&y.signal.removeEventListener("abort",b)}return r&&!r.dispatchConditionRejection&&s.match(w)&&w.meta.condition||u(w),w})();return Object.assign(C,{abort:S,requestId:g,arg:l,unwrap(){return C.then(R2e)}})}}return Object.assign(a,{pending:o,rejected:s,fulfilled:i,settled:k2e(s,i),typePrefix:t})}return e.withTypes=()=>e,e})();function R2e(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function I2e(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}function K4(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}async function j2e(){const e=await fetch(`api/matter/bridges?_s=${Date.now()}`);if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to fetch bridges"}));throw new Error(t.error??`Failed to fetch bridges (${e.status})`)}return await e.json()}async function XO(e){const t=await fetch("api/matter/bridges",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to create bridge"}));throw new Error(n.error??`Failed to create bridge (${t.status})`)}return await t.json()}async function HX(e){const t=await fetch(`api/matter/bridges/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to update bridge"}));throw new Error(n.error??`Failed to update bridge (${t.status})`)}return await t.json()}async function P2e(e){await fetch(`api/matter/bridges/${e}`,{method:"DELETE"})}async function $2e(e){const t=await fetch(`api/matter/bridges/${e}/actions/factory-reset`,{method:"POST"});if(!t.ok){const n=await t.json().catch(()=>({error:"Factory reset failed"}));throw new Error(n.error??`Factory reset failed (${t.status})`)}return await t.json()}async function UX(e){return await fetch(`api/matter/bridges/${e}/actions/force-sync`,{method:"POST"}).then(t=>t.json())}async function L2e(e){const t=await fetch(`api/matter/bridges/${e}/actions/open-commissioning-window`,{method:"POST"});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to open commissioning window"}));throw new Error(n.error??"Failed to open commissioning window")}return t.json()}async function N2e(e){if(!(await fetch("api/matter/bridges/priorities",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:e})})).ok)throw new Error("Failed to update priorities")}async function VX(){return(await fetch("api/matter/bridges/actions/start-all",{method:"POST"})).json()}async function WX(){return(await fetch("api/matter/bridges/actions/stop-all",{method:"POST"})).json()}async function qX(){return(await fetch("api/matter/bridges/actions/restart-all",{method:"POST"})).json()}const Hm=M2e.withTypes(),lw=FX.withTypes(),ko=Hm("bridges/load",j2e),GX=Hm("bridges/create",XO),KX=Hm("bridges/delete",P2e),YX=Hm("bridges/update",HX),XX=Hm("bridges/reset",$2e),ZX=sy("bridges/setFromWebSocket"),JX=sy("bridges/updateFromWebSocket"),fs=Bde.withTypes(),Um=Ude.withTypes(),QX=_.createContext({isConnected:!1,error:null});function eZ(){return _.useContext(QX)}function F2e({children:e}){const t=fs(),[n,r]=_.useState(!1),[i,o]=_.useState(null),s=_.useRef(null),a=_.useRef(void 0),l=_.useCallback(u=>{switch(u.type){case"bridges_update":t(ZX(u.data));break;case"bridge_update":t(JX(u.data));break;case"ping":s.current?.send(JSON.stringify({type:"pong"}));break}},[t]),c=_.useCallback(()=>{if(s.current?.readyState===WebSocket.OPEN)return;const u=window.location.protocol==="https:"?"wss:":"ws:",f=document.querySelector("base")?.href||window.location.origin,p=new URL(f),g=`${u}//${p.host}${p.pathname}api/ws`.replace(/\/+/g,"/").replace(":/","://");try{const y=new WebSocket(g);s.current=y,y.onopen=()=>{r(!0),o(null)},y.onmessage=b=>{try{const v=JSON.parse(b.data);l(v)}catch{console.warn("Invalid WebSocket message")}},y.onclose=()=>{r(!1),s.current=null,a.current=setTimeout(c,3e3)},y.onerror=()=>{o(new Error("WebSocket connection error")),y.close()}}catch(y){o(y instanceof Error?y:new Error("Failed to connect"))}},[l]);return _.useEffect(()=>(c(),()=>{a.current&&clearTimeout(a.current),s.current?.close()}),[c]),h.jsx(QX.Provider,{value:{isConnected:n,error:i},children:e})}const B2e=()=>{const e=fs();return _.useEffect(()=>{e(ko())},[e]),h.jsx(EY,{})};var Zl;(function(e){e.Starting="starting",e.Running="running",e.Stopped="stopped",e.Failed="failed"})(Zl||(Zl={}));var xr;(function(e){e.Pattern="pattern",e.Regex="regex",e.Domain="domain",e.Platform="platform",e.Label="label",e.EntityLabel="entity_label",e.DeviceLabel="device_label",e.Area="area",e.EntityCategory="entity_category",e.DeviceName="device_name",e.ProductName="product_name",e.DeviceClass="device_class"})(xr||(xr={}));const tZ=[{id:"all_lights",name:"All Lights",description:"Expose all light entities. Ideal for controlling lights via Apple Home, Google Home, or Alexa.",icon:"light",filter:{include:[{type:xr.Domain,value:"light"}],exclude:[]},featureFlags:{autoBatteryMapping:!0},tags:["lights","popular"]},{id:"all_switches",name:"All Switches & Plugs",description:"Expose all switch entities including smart plugs. Includes power and energy monitoring.",icon:"switch",filter:{include:[{type:xr.Domain,value:"switch"}],exclude:[]},featureFlags:{},tags:["switches","plugs"]},{id:"sensors_only",name:"All Sensors",description:"Expose temperature, humidity, pressure, and other sensors. Auto-combines related sensors from the same device.",icon:"sensor",filter:{include:[{type:xr.Domain,value:"sensor"},{type:xr.Domain,value:"binary_sensor"}],exclude:[]},featureFlags:{autoBatteryMapping:!0,autoHumidityMapping:!0,autoPressureMapping:!0},tags:["sensors","temperature","humidity"]},{id:"climate_control",name:"Climate & Covers",description:"Expose thermostats, fans, covers, and humidifiers for climate control.",icon:"climate",filter:{include:[{type:xr.Domain,value:"climate"},{type:xr.Domain,value:"fan"},{type:xr.Domain,value:"cover"},{type:xr.Domain,value:"humidifier"}],exclude:[]},featureFlags:{autoBatteryMapping:!0},tags:["climate","thermostat","covers"]},{id:"security",name:"Security & Locks",description:"Expose locks, alarm panels, and security-related binary sensors (motion, door, window).",icon:"lock",filter:{include:[{type:xr.Domain,value:"lock"},{type:xr.Domain,value:"alarm_control_panel"},{type:xr.DeviceClass,value:"motion"},{type:xr.DeviceClass,value:"door"},{type:xr.DeviceClass,value:"window"}],exclude:[],includeMode:"any"},featureFlags:{autoBatteryMapping:!0},tags:["security","locks","alarm"]},{id:"robot_vacuum",name:"Robot Vacuum (Server Mode)",description:"Single vacuum bridge with Server Mode enabled. Required for Apple Home Siri commands and proper Alexa discovery. Add only ONE vacuum to this bridge.",icon:"vacuum",filter:{include:[{type:xr.Domain,value:"vacuum"}],exclude:[]},featureFlags:{serverMode:!0},tags:["vacuum","server-mode","apple-home"]},{id:"media_players",name:"Media Players & Speakers",description:"Expose media players, speakers, and TVs for volume and playback control.",icon:"media_player",filter:{include:[{type:xr.Domain,value:"media_player"}],exclude:[]},featureFlags:{},tags:["media","speakers","tv"]},{id:"google_home_optimized",name:"Google Home Optimized",description:"All devices with Auto Force Sync enabled. Prevents Google Home from showing devices as offline after a few hours.",icon:"default",filter:{include:[{type:xr.Pattern,value:"*"}],exclude:[]},featureFlags:{autoForceSync:!0,autoBatteryMapping:!0,autoHumidityMapping:!0,autoPressureMapping:!0},tags:["google-home","all-devices"]},{id:"alexa_covers",name:"Alexa-Optimized Covers",description:"Covers with Alexa-friendly percentage display. Displayed percentage matches Home Assistant values.",icon:"cover",filter:{include:[{type:xr.Domain,value:"cover"}],exclude:[]},featureFlags:{coverUseHomeAssistantPercentage:!0,autoBatteryMapping:!0},tags:["alexa","covers"]},{id:"automations_scripts",name:"Automations & Scripts",description:"Expose Home Assistant automations, scripts, and scenes as Matter switches.",icon:"remote",filter:{include:[{type:xr.Domain,value:"automation"},{type:xr.Domain,value:"script"},{type:xr.Domain,value:"scene"}],exclude:[]},featureFlags:{},tags:["automations","scripts","scenes"]}];var uF;(function(e){e[e.locked=1]="locked",e[e.unlocked=2]="unlocked"})(uF||(uF={}));var dF;(function(e){e[e.Off=0]="Off",e[e.Low=1]="Low",e[e.Medium=2]="Medium",e[e.High=3]="High",e[e.On=4]="On",e[e.Auto=5]="Auto",e[e.Smart=6]="Smart"})(dF||(dF={}));var fF;(function(e){e[e.Forward=0]="Forward",e[e.Reverse=1]="Reverse"})(fF||(fF={}));var hF;(function(e){e[e.OffLowMedHigh=0]="OffLowMedHigh",e[e.OffLowHigh=1]="OffLowHigh",e[e.OffLowMedHighAuto=2]="OffLowMedHighAuto",e[e.OffLowHighAuto=3]="OffLowHighAuto",e[e.OffHighAuto=4]="OffHighAuto",e[e.OffHigh=5]="OffHigh"})(hF||(hF={}));var pF;(function(e){e[e.Stopped=0]="Stopped",e[e.Running=1]="Running",e[e.Paused=2]="Paused",e[e.Error=3]="Error",e[e.SeekingCharger=64]="SeekingCharger",e[e.Charging=65]="Charging",e[e.Docked=66]="Docked"})(pF||(pF={}));var mF;(function(e){e[e.Off=0]="Off",e[e.Auto=1]="Auto",e[e.Cool=3]="Cool",e[e.Heat=4]="Heat",e[e.EmergencyHeat=5]="EmergencyHeat",e[e.Precooling=6]="Precooling",e[e.FanOnly=7]="FanOnly",e[e.Dry=8]="Dry",e[e.Sleep=9]="Sleep"})(mF||(mF={}));var Fk;(function(e){e.homeAssistantEntity="homeAssistantEntity",e.identify="identify",e.groups="groups",e.scenesManagement="scenesManagement",e.bridgedDeviceBasicInformation="bridgedDeviceBasicInformation",e.airQuality="airQuality",e.booleanState="booleanState",e.carbonDioxideConcentrationMeasurement="carbonDioxideConcentrationMeasurement",e.carbonMonoxideConcentrationMeasurement="carbonMonoxideConcentrationMeasurement",e.colorControl="colorControl",e.doorLock="doorLock",e.electricalEnergyMeasurement="electricalEnergyMeasurement",e.electricalPowerMeasurement="electricalPowerMeasurement",e.flowMeasurement="flowMeasurement",e.levelControl="levelControl",e.fanControl="fanControl",e.illuminanceMeasurement="illuminanceMeasurement",e.nitrogenDioxideConcentrationMeasurement="nitrogenDioxideConcentrationMeasurement",e.occupancySensing="occupancySensing",e.onOff="onOff",e.ozoneConcentrationMeasurement="ozoneConcentrationMeasurement",e.pm1ConcentrationMeasurement="pm1ConcentrationMeasurement",e.pm10ConcentrationMeasurement="pm10ConcentrationMeasurement",e.pm25ConcentrationMeasurement="pm25ConcentrationMeasurement",e.powerSource="powerSource",e.pressureMeasurement="pressureMeasurement",e.relativeHumidityMeasurement="relativeHumidityMeasurement",e.smokeCoAlarm="smokeCoAlarm",e.temperatureMeasurement="temperatureMeasurement",e.thermostat="thermostat",e.thermostatUserInterfaceConfiguration="thermostatUserInterfaceConfiguration",e.totalVolatileOrganicCompoundsConcentrationMeasurement="totalVolatileOrganicCompoundsConcentrationMeasurement",e.valveConfigurationAndControl="valveConfigurationAndControl",e.windowCovering="windowCovering",e.mediaInput="mediaInput",e.rvcCleanMode="rvcCleanMode",e.rvcRunMode="rvcRunMode",e.rvcOperationalState="rvcOperationalState",e.serviceArea="serviceArea",e.switch="switch",e.modeSelect="modeSelect"})(Fk||(Fk={}));const nZ=[{id:"apple_home",name:"Apple Home",description:"Optimized for Apple Home and Siri. Enables composed devices for clean sensor grouping. Covers use standard Matter percentage (inverted from HA).",icon:"default",featureFlags:{autoComposedDevices:!0,autoBatteryMapping:!0,autoHumidityMapping:!0,autoPressureMapping:!0}},{id:"google_home",name:"Google Home",description:"Optimized for Google Home. Enables Auto Force Sync to prevent devices from going offline. Composed devices enabled for proper sensor grouping.",icon:"default",featureFlags:{autoForceSync:!0,autoComposedDevices:!0,autoBatteryMapping:!0,autoHumidityMapping:!0,autoPressureMapping:!0}},{id:"alexa",name:"Amazon Alexa",description:"Optimized for Alexa. Enables Auto Force Sync and Alexa-friendly cover percentages. Battery mapping included for sensor devices.",icon:"default",featureFlags:{autoForceSync:!0,autoBatteryMapping:!0,autoHumidityMapping:!0,autoPressureMapping:!0,coverUseHomeAssistantPercentage:!0}},{id:"multi_controller",name:"Multi-Controller",description:"Balanced settings for use with multiple controllers at once (e.g. Apple Home + Alexa). Force Sync enabled. Standard cover behavior.",icon:"default",featureFlags:{autoForceSync:!0,autoComposedDevices:!0,autoBatteryMapping:!0,autoHumidityMapping:!0,autoPressureMapping:!0}}];var gF;(function(e){e.Battery="battery",e.BatteryCharging="battery_charging",e.CarbonMonoxide="carbon_monoxide",e.Cold="cold",e.Connectivity="connectivity",e.Door="door",e.GarageDoor="garage_door",e.Gas="gas",e.Heat="heat",e.Light="light",e.Lock="lock",e.Moisture="moisture",e.Motion="motion",e.Moving="moving",e.Occupancy="occupancy",e.Opening="opening",e.Plug="plug",e.Power="power",e.Presence="presence",e.Problem="problem",e.Running="running",e.Safety="safety",e.Smoke="smoke",e.Sound="sound",e.Tamper="tamper",e.Update="update",e.Vibration="vibration",e.Window="window"})(gF||(gF={}));var yF;(function(e){e.off="off",e.heat="heat",e.cool="cool",e.heat_cool="heat_cool",e.auto="auto",e.dry="dry",e.fan_only="fan_only"})(yF||(yF={}));var bF;(function(e){e.off="off",e.preheating="preheating",e.heating="heating",e.cooling="cooling",e.drying="drying",e.fan="fan",e.idle="idle",e.defrosting="defrosting"})(bF||(bF={}));var vF;(function(e){e[e.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",e[e.TARGET_TEMPERATURE_RANGE=2]="TARGET_TEMPERATURE_RANGE",e[e.TARGET_HUMIDITY=4]="TARGET_HUMIDITY",e[e.FAN_MODE=8]="FAN_MODE",e[e.PRESET_MODE=16]="PRESET_MODE",e[e.SWING_MODE=32]="SWING_MODE",e[e.AUX_HEAT=64]="AUX_HEAT",e[e.TURN_OFF=128]="TURN_OFF",e[e.TURN_ON=256]="TURN_ON",e[e.SWING_HORIZONTAL_MODE=512]="SWING_HORIZONTAL_MODE"})(vF||(vF={}));var xF;(function(e){e.closed="closed",e.open="open",e.closing="closing",e.opening="opening"})(xF||(xF={}));var SF;(function(e){e.button="button",e.doorbell="doorbell",e.motion="motion"})(SF||(SF={}));var wF;(function(e){e.FORWARD="forward",e.REVERSE="reverse"})(wF||(wF={}));var CF;(function(e){e[e.SET_SPEED=1]="SET_SPEED",e[e.OSCILLATE=2]="OSCILLATE",e[e.DIRECTION=4]="DIRECTION",e[e.PRESET_MODE=8]="PRESET_MODE",e[e.TURN_ON=16]="TURN_ON",e[e.TURN_OFF=32]="TURN_OFF"})(CF||(CF={}));var EF;(function(e){e.UNKNOWN="unknown",e.ONOFF="onoff",e.BRIGHTNESS="brightness",e.COLOR_TEMP="color_temp",e.HS="hs",e.XY="xy",e.RGB="rgb",e.RGBW="rgbw",e.RGBWW="rgbww",e.WHITE="white"})(EF||(EF={}));var AF;(function(e){e.Tv="tv",e.Speaker="speaker",e.Receiver="receiver"})(AF||(AF={}));var kF;(function(e){e[e.PAUSE=1]="PAUSE",e[e.SEEK=2]="SEEK",e[e.VOLUME_SET=4]="VOLUME_SET",e[e.VOLUME_MUTE=8]="VOLUME_MUTE",e[e.PREVIOUS_TRACK=16]="PREVIOUS_TRACK",e[e.NEXT_TRACK=32]="NEXT_TRACK",e[e.TURN_ON=128]="TURN_ON",e[e.TURN_OFF=256]="TURN_OFF",e[e.PLAY_MEDIA=512]="PLAY_MEDIA",e[e.VOLUME_STEP=1024]="VOLUME_STEP",e[e.SELECT_SOURCE=2048]="SELECT_SOURCE",e[e.STOP=4096]="STOP",e[e.CLEAR_PLAYLIST=8192]="CLEAR_PLAYLIST",e[e.PLAY=16384]="PLAY",e[e.SHUFFLE_SET=32768]="SHUFFLE_SET",e[e.SELECT_SOUND_MODE=65536]="SELECT_SOUND_MODE",e[e.BROWSE_MEDIA=131072]="BROWSE_MEDIA",e[e.REPEAT_SET=262144]="REPEAT_SET",e[e.GROUPING=524288]="GROUPING",e[e.MEDIA_ANNOUNCE=1048576]="MEDIA_ANNOUNCE",e[e.MEDIA_ENQUEUE=2097152]="MEDIA_ENQUEUE"})(kF||(kF={}));var _F;(function(e){e.None="None",e.apparent_power="apparent_power",e.aqi="aqi",e.atmospheric_pressure="atmospheric_pressure",e.battery="battery",e.carbon_dioxide="carbon_dioxide",e.carbon_monoxide="carbon_monoxide",e.current="current",e.data_rate="data_rate",e.data_size="data_size",e.date="date",e.distance="distance",e.duration="duration",e.energy="energy",e.energy_storage="energy_storage",e.enum="enum",e.frequency="frequency",e.gas="gas",e.humidity="humidity",e.illuminance="illuminance",e.irradiance="irradiance",e.moisture="moisture",e.monetary="monetary",e.nitrogen_dioxide="nitrogen_dioxide",e.nitrogen_monoxide="nitrogen_monoxide",e.nitrous_oxide="nitrous_oxide",e.ozone="ozone",e.ph="ph",e.pm1="pm1",e.pm25="pm25",e.pm10="pm10",e.power_factor="power_factor",e.power="power",e.precipitation="precipitation",e.precipitation_intensity="precipitation_intensity",e.pressure="pressure",e.reactive_power="reactive_power",e.signal_strength="signal_strength",e.sound_pressure="sound_pressure",e.speed="speed",e.sulphur_dioxide="sulphur_dioxide",e.temperature="temperature",e.timestamp="timestamp",e.volatile_organic_compounds="volatile_organic_compounds",e.volatile_organic_compounds_parts="volatile_organic_compounds_parts",e.voltage="voltage",e.volume="volume",e.volume_flow_rate="volume_flow_rate",e.volume_storage="volume_storage",e.water="water",e.weight="weight",e.wind_speed="wind_speed"})(_F||(_F={}));var DF;(function(e){e.cleaning="cleaning",e.docked="docked",e.returning="returning",e.error="error",e.idle="idle",e.paused="paused",e.segment_cleaning="segment_cleaning",e.zone_cleaning="zone_cleaning",e.spot_cleaning="spot_cleaning",e.mop_cleaning="mop_cleaning"})(DF||(DF={}));var OF;(function(e){e[e.TURN_ON=1]="TURN_ON",e[e.TURN_OFF=2]="TURN_OFF",e[e.PAUSE=4]="PAUSE",e[e.STOP=8]="STOP",e[e.RETURN_HOME=16]="RETURN_HOME",e[e.FAN_SPEED=32]="FAN_SPEED",e[e.BATTERY=64]="BATTERY",e[e.STATUS=128]="STATUS",e[e.SEND_COMMAND=256]="SEND_COMMAND",e[e.LOCATE=512]="LOCATE",e[e.CLEAN_SPOT=1024]="CLEAN_SPOT",e[e.MAP=2048]="MAP",e[e.STATE=4096]="STATE",e[e.START=8192]="START"})(OF||(OF={}));var TF;(function(e){e.off="off",e.low="low",e.medium="medium",e.high="high",e.turbo="turbo",e.auto="auto",e.max="max"})(TF||(TF={}));var MF;(function(e){e.off="off",e.eco="eco",e.electric="electric",e.gas="gas",e.heat_pump="heat_pump",e.high_demand="high_demand",e.performance="performance"})(MF||(MF={}));var RF;(function(e){e[e.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",e[e.OPERATION_MODE=2]="OPERATION_MODE",e[e.AWAY_MODE=4]="AWAY_MODE",e[e.ON_OFF=8]="ON_OFF"})(RF||(RF={}));const IF={air_purifier:"Air Purifier",air_quality_sensor:"Air Quality Sensor",basic_video_player:"Basic Video Player (TV)",battery_storage:"Battery Sensor",carbon_monoxide_sensor:"Carbon Monoxide (CO) Sensor",color_dimmer_switch:"Color Dimmer Switch",color_temperature_light:"Color Temperature Light",contact_sensor:"Contact Sensor",dimmable_light:"Dimmable Light",dimmable_plugin_unit:"Dimmable Plug-in Unit",dimmer_switch:"Dimmer Switch",door_lock:"Door Lock",electrical_sensor:"Electrical Sensor (Power/Energy/Voltage/Current)",extended_color_light:"Extended Color Light",fan:"Fan",flow_sensor:"Flow Sensor",formaldehyde_sensor:"Formaldehyde (HCHO) Sensor",generic_switch:"Generic Switch (Button)",humidifier_dehumidifier:"Humidifier/Dehumidifier",humidity_sensor:"Humidity Sensor",light_sensor:"Light Sensor",mode_select:"Mode Select",nitrogen_dioxide_sensor:"Nitrogen Dioxide (NO₂) Sensor",occupancy_sensor:"Occupancy Sensor",on_off_light:"On/Off Light",on_off_plugin_unit:"On/Off Plug-in Unit",on_off_switch:"On/Off Switch",ozone_sensor:"Ozone (O₃) Sensor",pm1_sensor:"PM1 Sensor",pressure_sensor:"Pressure Sensor",pump:"Pump",radon_sensor:"Radon Sensor",robot_vacuum_cleaner:"Robot Vacuum Cleaner",smoke_co_alarm:"Smoke/CO Alarm",speaker:"Speaker",temperature_sensor:"Temperature Sensor",thermostat:"Thermostat",tvoc_sensor:"TVOC / VOC Index Sensor",water_heater:"Water Heater",water_freeze_detector:"Water Freeze Detector",water_leak_detector:"Water Leak Detector",water_valve:"Water Valve",window_covering:"Window Covering"},d1={Auto:0,Quick:1,Quiet:2,LowNoise:3,LowEnergy:4,Vacation:5,Min:6,Max:7,Night:8,Day:9,DeepClean:16384,Vacuum:16385,Mop:16386,VacuumThenMop:16387},z2e={alarm_control_panel:["mode_select","on_off_plugin_unit"],automation:["on_off_switch"],binary_sensor:["contact_sensor","occupancy_sensor","smoke_co_alarm","water_freeze_detector","water_leak_detector"],button:["generic_switch"],climate:["thermostat"],cover:["window_covering"],event:["generic_switch"],fan:["air_purifier","fan"],humidifier:["humidifier_dehumidifier"],input_boolean:["on_off_plugin_unit","on_off_switch"],input_select:["mode_select"],input_button:["generic_switch"],light:["color_temperature_light","dimmable_light","extended_color_light","on_off_light"],lock:["door_lock"],media_player:["basic_video_player","on_off_switch","speaker"],scene:["on_off_switch"],script:["on_off_switch"],sensor:["air_quality_sensor","battery_storage","carbon_monoxide_sensor","electrical_sensor","formaldehyde_sensor","humidity_sensor","light_sensor","nitrogen_dioxide_sensor","ozone_sensor","pm1_sensor","pressure_sensor","radon_sensor","temperature_sensor","tvoc_sensor"],select:["mode_select"],switch:["on_off_plugin_unit","on_off_switch","pump","water_valve"],vacuum:["robot_vacuum_cleaner"],valve:["water_valve","on_off_plugin_unit"],water_heater:["water_heater","thermostat"]};var jF;(function(e){e.alarm_control_panel="alarm_control_panel",e.automation="automation",e.button="button",e.binary_sensor="binary_sensor",e.climate="climate",e.cover="cover",e.event="event",e.fan="fan",e.humidifier="humidifier",e.input_boolean="input_boolean",e.input_button="input_button",e.input_select="input_select",e.light="light",e.lock="lock",e.media_player="media_player",e.remote="remote",e.scene="scene",e.select="select",e.script="script",e.sensor="sensor",e.switch="switch",e.vacuum="vacuum",e.valve="valve",e.water_heater="water_heater"})(jF||(jF={}));const PF={type:"object",default:{type:"",value:""},properties:{type:{title:"Type",type:"string",oneOf:[{const:"pattern",title:"pattern",description:"Wildcard pattern matching entity IDs. Use * as wildcard. Example: 'light.living_room_*' matches all lights in the living room."},{const:"regex",title:"regex",description:"Full regular expression matching entity IDs. Use ^ and $ for anchors. Example: '^(light|switch)\\.kitchen_.*' matches all kitchen lights and switches."},{const:"domain",title:"domain",description:"Match entities by their domain (the part before the dot). Example: 'light', 'switch', 'sensor'."},{const:"platform",title:"platform",description:"Match entities by their integration/platform. Example: 'hue', 'zwave', 'mqtt'."},{const:"entity_label",title:"entity_label",description:"Matches only entities that have this label assigned directly. Other entities of the same device are NOT included."},{const:"device_label",title:"device_label",description:"Matches ALL entities of a device if the device has this label. Use this to include a complete device with all its entities."},{const:"area",title:"area",description:"Match entities by their area slug. Example: 'living_room', 'bedroom'."},{const:"entity_category",title:"entity_category",description:"Match entities by their category. Example: 'config', 'diagnostic' to exclude configuration entities."},{const:"device_name",title:"device_name",description:"Match entities by their device name. Supports wildcards. Example: '*Philips*' matches all Philips devices."},{const:"product_name",title:"product_name",description:"Match entities by their product/model name. Supports wildcards. Example: 'Hue*Bulb'."},{const:"device_class",title:"device_class",description:"Match entities by their device class attribute. Example: 'temperature', 'motion', 'door', 'window'."}]},value:{title:"Value",description:"For labels, use the display name or the label_id (slug). You can look up both on the Labels page in the sidebar.",type:"string",minLength:1}},required:["type","value"],additionalProperties:!1},H2e={title:"Include or exclude entities",type:"object",properties:{include:{title:"Include",type:"array",items:PF},exclude:{title:"Exclude",type:"array",items:PF},includeMode:{title:"Include Mode",type:"string",description:"How to combine include rules: 'any' matches if ANY rule matches (OR), 'all' matches only if ALL rules match (AND). Default: 'any'",enum:["any","all"],default:"any"}},required:["include","exclude"],additionalProperties:!1},U2e={title:"Feature Flags",type:"object",properties:{coverDoNotInvertPercentage:{title:"Do not invert Percentages for Covers",description:"Do not invert the percentage of covers to match Home Assistant (not Matter compliant)",type:"boolean",default:!1},coverUseHomeAssistantPercentage:{title:"Use Home Assistant Percentage for Covers (Alexa-friendly)",description:"Display cover percentages matching Home Assistant values in Matter controllers like Alexa. This makes the displayed percentage match what you see in Home Assistant, but the semantic meaning differs: in HA, higher percentage = more open; in Alexa, higher percentage is typically interpreted as more closed. Open/Close commands will still work correctly.",type:"boolean",default:!1},coverSwapOpenClose:{title:"Swap Open/Close for Covers",description:"Swap open/close commands and invert position reporting for covers. Enable this if Alexa voice commands are reversed (saying 'close' opens the blinds and vice versa).",type:"boolean",default:!1},includeHiddenEntities:{title:"Include Hidden Entities",description:"Include entities that are marked as hidden in Home Assistant",type:"boolean",default:!1},alexaPreserveBrightnessOnTurnOn:{title:"Alexa: Preserve Brightness on Turn-On (Deprecated)",description:"This workaround is now always active and this setting has no effect. The bridge automatically ignores brightness commands that set lights to 100% immediately after a turn-on command.",type:"boolean",default:!0},serverMode:{title:"Server Mode (for Robot Vacuums)",description:"Expose the device as a standalone Matter device instead of a bridged device. This is required for Apple Home to properly support Siri voice commands for Robot Vacuums. IMPORTANT: Only ONE device should be in this bridge when server mode is enabled.",type:"boolean",default:!1},autoBatteryMapping:{title:"Auto Battery Mapping",description:"Automatically assign battery sensors from the same Home Assistant device to the main entity. When enabled, battery sensors will be merged into their parent devices instead of appearing as separate devices.",type:"boolean",default:!1},autoHumidityMapping:{title:"Auto Humidity Mapping",description:"Automatically combine humidity sensors with temperature sensors from the same Home Assistant device. When enabled, humidity sensors will be merged into temperature sensors to create combined TemperatureHumiditySensor devices.",type:"boolean",default:!0},autoPressureMapping:{title:"Auto Pressure Mapping",description:"Automatically combine pressure sensors with temperature sensors from the same Home Assistant device. When enabled, pressure sensors will be merged into temperature sensors to create combined sensor devices.",type:"boolean",default:!0},autoComposedDevices:{title:"Auto Composed Devices",description:"Master toggle: automatically combine related entities from the same Home Assistant device into single Matter endpoints. Enables battery, humidity, pressure, power, and energy auto-mapping at once. This provides a cleaner device experience in Matter controllers (e.g., a Shelly Plug appears as one device with power monitoring).",type:"boolean",default:!1},autoForceSync:{title:"Auto Force Sync",description:"Periodically compare and push all device states to connected controllers every 90 seconds. Enable this if devices get out of sync after extended periods. Health checks for dead sessions always run regardless of this setting.",type:"boolean",default:!1},vacuumOnOff:{title:"Vacuum: Include OnOff Cluster (Alexa)",description:"Add an OnOff cluster to robot vacuum endpoints. Alexa REQUIRES this (PowerController) to show robotic vacuums in the app. Without it, Alexa commissions the device but never displays it. In Server Mode this is enabled automatically — only check this for bridge mode. WARNING: OnOff is NOT part of the Matter RVC device type specification. Enabling this may break Apple Home (shows 'Updating') and Google Home.",type:"boolean"},vacuumMinimalClusters:{title:"Vacuum: Minimal Clusters (Alexa troubleshooting)",description:"Strip the vacuum endpoint to only the clusters required by the Matter RVC spec. Removes PowerSource (battery) and the default ServiceArea placeholder. Enable this if Alexa commissions the vacuum but the device never appears in the app. Trade-off: battery percentage will not be reported to Matter controllers.",type:"boolean",default:!1}},additionalProperties:!1},ay={type:"object",title:"Bridge Config",properties:{name:{title:"Name",type:"string",minLength:1,maxLength:32},port:{title:"Port",type:"number",minimum:1},icon:{title:"Icon",type:"string",description:"Icon to display for this bridge in the UI",enum:["light","switch","climate","cover","fan","lock","sensor","media_player","vacuum","remote","humidifier","speaker","garage","door","window","motion","battery","power","camera","default"]},countryCode:{title:"Country Code",type:"string",description:"An ISO 3166-1 alpha-2 code to represent the country in which the Node is located. Only needed if the commissioning fails due to missing country code.",minLength:2,maxLength:3},priority:{title:"Startup Priority",type:"number",description:"Startup order priority. Lower values start first. Default is 100.",default:100,minimum:1,maximum:999},filter:H2e,featureFlags:U2e},required:["name","port","filter"],additionalProperties:!1};({...ay,properties:{...ay.properties},required:[...ay?.required??[]]});const rZ=ke(h.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),pl=ke(h.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"})),Vm=ke(h.jsx("path",{d:"M9.19 6.35c-2.04 2.29-3.44 5.58-3.57 5.89L2 10.69l4.05-4.05c.47-.47 1.15-.68 1.81-.55zM11.17 17s3.74-1.55 5.89-3.7c5.4-5.4 4.5-9.62 4.21-10.57-.95-.3-5.17-1.19-10.57 4.21C8.55 9.09 7 12.83 7 12.83zm6.48-2.19c-2.29 2.04-5.58 3.44-5.89 3.57L13.31 22l4.05-4.05c.47-.47.68-1.15.55-1.81zM9 18c0 .83-.34 1.58-.88 2.12C6.94 21.3 2 22 2 22s.7-4.94 1.88-6.12C4.42 15.34 5.17 15 6 15c1.66 0 3 1.34 3 3m4-9c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2"})),V2e=tt("MuiBox",["root"]),W2e=XS(),oe=mme({themeId:fa,defaultTheme:W2e,defaultClassName:V2e.root,generateClassName:XY.generate});function q2e(e){return Qe("MuiButton",e)}const Wf=tt("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),G2e=_.createContext({}),K2e=_.createContext(void 0),Y2e=e=>{const{color:t,disableElevation:n,fullWidth:r,size:i,variant:o,loading:s,loadingPosition:a,classes:l}=e,c={root:["root",s&&"loading",o,`${o}${ye(t)}`,`size${ye(i)}`,`${o}Size${ye(i)}`,`color${ye(t)}`,n&&"disableElevation",r&&"fullWidth",s&&`loadingPosition${ye(a)}`],startIcon:["icon","startIcon",`iconSize${ye(i)}`],endIcon:["icon","endIcon",`iconSize${ye(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},u=et(c,q2e,l);return{...l,...u}},iZ=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],X2e=me(va,{shouldForwardProp:e=>Bi(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${ye(n.color)}`],t[`size${ye(n.size)}`],t[`${n.variant}Size${ye(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(Ge(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${Wf.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${Wf.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Wf.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${Wf.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(Bn()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Wf.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Wf.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${Wf.loading}`]:{color:"transparent"}}}]}})),Z2e=me("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${ye(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...iZ]})),J2e=me("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${ye(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...iZ]})),Q2e=me("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),$F=me("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),lt=_.forwardRef(function(t,n){const r=_.useContext(G2e),i=_.useContext(K2e),o=om(r,t),s=ot({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:p=!1,disableFocusRipple:g=!1,endIcon:y,focusVisibleClassName:b,fullWidth:v=!1,id:S,loading:C=null,loadingIndicator:w,loadingPosition:A="center",size:E="medium",startIcon:D,type:O,variant:T="text",...I}=s,L=Pu(S),$=w??h.jsx(Cr,{"aria-labelledby":L,color:"inherit",size:16}),R={...s,color:l,component:c,disabled:f,disableElevation:p,disableFocusRipple:g,fullWidth:v,loading:C,loadingIndicator:$,loadingPosition:A,size:E,type:O,variant:T},F=Y2e(R),P=(D||C&&A==="start")&&h.jsx(Z2e,{className:F.startIcon,ownerState:R,children:D||h.jsx($F,{className:F.loadingIconPlaceholder,ownerState:R})}),z=(y||C&&A==="end")&&h.jsx(J2e,{className:F.endIcon,ownerState:R,children:y||h.jsx($F,{className:F.loadingIconPlaceholder,ownerState:R})}),N=i||"",V=typeof C=="boolean"?h.jsx("span",{className:F.loadingWrapper,style:{display:"contents"},children:C&&h.jsx(Q2e,{className:F.loadingIndicator,ownerState:R,children:$})}):null;return h.jsxs(X2e,{ownerState:R,className:Te(r.className,F.root,u,N),component:c,disabled:f||C,focusRipple:!g,focusVisibleClassName:Te(F.focusVisible,b),ref:n,type:O,id:C?L:S,...I,classes:F,children:[P,A!=="end"&&V,a,A==="end"&&V,z]})});function ebe(e){return Qe("MuiCard",e)}tt("MuiCard",["root"]);const tbe=e=>{const{classes:t}=e;return et({root:["root"]},ebe,t)},nbe=me(Ur,{name:"MuiCard",slot:"Root"})({overflow:"hidden"}),Pn=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCard"}),{className:i,raised:o=!1,...s}=r,a={...r,raised:o},l=tbe(a);return h.jsx(nbe,{className:Te(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a,...s})});function rbe(e){return Qe("MuiCardActionArea",e)}const P7=tt("MuiCardActionArea",["root","focusVisible","focusHighlight"]),ibe=e=>{const{classes:t}=e;return et({root:["root"],focusHighlight:["focusHighlight"]},rbe,t)},obe=me(va,{name:"MuiCardActionArea",slot:"Root"})(Ge(({theme:e})=>({display:"block",textAlign:"inherit",borderRadius:"inherit",width:"100%",[`&:hover .${P7.focusHighlight}`]:{opacity:(e.vars||e).palette.action.hoverOpacity,"@media (hover: none)":{opacity:0}},[`&.${P7.focusVisible} .${P7.focusHighlight}`]:{opacity:(e.vars||e).palette.action.focusOpacity}}))),sbe=me("span",{name:"MuiCardActionArea",slot:"FocusHighlight"})(Ge(({theme:e})=>({overflow:"hidden",pointerEvents:"none",position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:"inherit",opacity:0,backgroundColor:"currentcolor",transition:e.transitions.create("opacity",{duration:e.transitions.duration.short})}))),ku=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCardActionArea"}),{children:i,className:o,focusVisibleClassName:s,slots:a={},slotProps:l={},...c}=r,u=r,f=ibe(u),p={slots:a,slotProps:l},[g,y]=ut("root",{elementType:obe,externalForwardedProps:{...p,...c},shouldForwardComponentProp:!0,ownerState:u,ref:n,className:Te(f.root,o),additionalProps:{focusVisibleClassName:Te(s,f.focusVisible)}}),[b,v]=ut("focusHighlight",{elementType:sbe,externalForwardedProps:p,ownerState:u,className:f.focusHighlight});return h.jsxs(g,{...y,children:[i,h.jsx(b,{...v})]})});function abe(e){return Qe("MuiCardContent",e)}tt("MuiCardContent",["root"]);const lbe=e=>{const{classes:t}=e;return et({root:["root"]},abe,t)},cbe=me("div",{name:"MuiCardContent",slot:"Root"})({padding:16,"&:last-child":{paddingBottom:24}}),Gn=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCardContent"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=lbe(a);return h.jsx(cbe,{as:o,className:Te(l.root,i),ownerState:a,ref:n,...s})}),cw=_.createContext(void 0);function ml(){return _.useContext(cw)}function ube(e){return Qe("PrivateSwitchBase",e)}tt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const dbe=e=>{const{classes:t,checked:n,disabled:r,edge:i}=e,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${ye(i)}`],input:["input"]};return et(o,ube,t)},fbe=me(va,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),hbe=me("input",{name:"MuiSwitchBase",shouldForwardProp:Bi})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),ZO=_.forwardRef(function(t,n){const{autoFocus:r,checked:i,checkedIcon:o,defaultChecked:s,disabled:a,disableFocusRipple:l=!1,edge:c=!1,icon:u,id:f,inputProps:p,inputRef:g,name:y,onBlur:b,onChange:v,onFocus:S,readOnly:C,required:w=!1,tabIndex:A,type:E,value:D,slots:O={},slotProps:T={},...I}=t,[L,$]=Za({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),R=ml(),F=Y=>{S&&S(Y),R&&R.onFocus&&R.onFocus(Y)},P=Y=>{b&&b(Y),R&&R.onBlur&&R.onBlur(Y)},z=Y=>{if(Y.nativeEvent.defaultPrevented||C)return;const J=Y.target.checked;$(J),v&&v(Y,J)};let N=a;R&&typeof N>"u"&&(N=R.disabled);const V=E==="checkbox"||E==="radio",U={...t,checked:L,disabled:N,disableFocusRipple:l,edge:c},K=dbe(U),X={slots:O,slotProps:{input:p,...T}},[B,W]=ut("root",{ref:n,elementType:fbe,className:K.root,shouldForwardComponentProp:!0,externalForwardedProps:{...X,component:"span",...I},getSlotProps:Y=>({...Y,onFocus:J=>{Y.onFocus?.(J),F(J)},onBlur:J=>{Y.onBlur?.(J),P(J)}}),ownerState:U,additionalProps:{centerRipple:!0,focusRipple:!l,role:void 0,tabIndex:null}}),[q,H]=ut("input",{ref:g,elementType:hbe,className:K.input,externalForwardedProps:X,getSlotProps:Y=>({...Y,onChange:J=>{Y.onChange?.(J),z(J)}}),ownerState:U,additionalProps:{autoFocus:r,checked:i,defaultChecked:s,disabled:N,id:V?f:void 0,name:y,readOnly:C,required:w,tabIndex:A,type:E,...E==="checkbox"&&D===void 0?{}:{value:D}}});return h.jsxs(B,{...W,children:[h.jsx(q,{...H}),L?o:u]})}),pbe=ke(h.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),mbe=ke(h.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),gbe=ke(h.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function ybe(e){return Qe("MuiCheckbox",e)}const $7=tt("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),bbe=e=>{const{classes:t,indeterminate:n,color:r,size:i}=e,o={root:["root",n&&"indeterminate",`color${ye(r)}`,`size${ye(i)}`]},s=et(o,ybe,t);return{...t,...s}},vbe=me(ZO,{shouldForwardProp:e=>Bi(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${ye(n.size)}`],n.color!=="default"&&t[`color${ye(n.color)}`]]}})(Ge(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{[`&.${$7.checked}, &.${$7.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${$7.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),xbe=h.jsx(mbe,{}),Sbe=h.jsx(pbe,{}),wbe=h.jsx(gbe,{}),Wa=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCheckbox"}),{checkedIcon:i=xbe,color:o="primary",icon:s=Sbe,indeterminate:a=!1,indeterminateIcon:l=wbe,inputProps:c,size:u="medium",disableRipple:f=!1,className:p,slots:g={},slotProps:y={},...b}=r,v=a?l:s,S=a?l:i,C={...r,disableRipple:f,color:o,indeterminate:a,size:u},w=bbe(C),A=y.input??c,[E,D]=ut("root",{ref:n,elementType:vbe,className:Te(w.root,p),shouldForwardComponentProp:!0,externalForwardedProps:{slots:g,slotProps:y,...b},ownerState:C,additionalProps:{type:"checkbox",icon:_.cloneElement(v,{fontSize:v.props.fontSize??u}),checkedIcon:_.cloneElement(S,{fontSize:S.props.fontSize??u}),disableRipple:f,slots:g,slotProps:{input:BO(typeof A=="function"?A(C):A,{"data-indeterminate":a})}}});return h.jsx(E,{...D,classes:w})}),Cbe=ke(h.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function Ebe(e){return Qe("MuiChip",e)}const An=tt("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Abe=e=>{const{classes:t,disabled:n,size:r,color:i,iconColor:o,onDelete:s,clickable:a,variant:l}=e,c={root:["root",l,n&&"disabled",`size${ye(r)}`,`color${ye(i)}`,a&&"clickable",a&&`clickableColor${ye(i)}`,s&&"deletable",s&&`deletableColor${ye(i)}`,`${l}${ye(i)}`],label:["label",`label${ye(r)}`],avatar:["avatar",`avatar${ye(r)}`,`avatarColor${ye(i)}`],icon:["icon",`icon${ye(r)}`,`iconColor${ye(o)}`],deleteIcon:["deleteIcon",`deleteIcon${ye(r)}`,`deleteIconColor${ye(i)}`,`deleteIcon${ye(l)}Color${ye(i)}`]};return et(c,Ebe,t)},kbe=me("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:i,clickable:o,onDelete:s,size:a,variant:l}=n;return[{[`& .${An.avatar}`]:t.avatar},{[`& .${An.avatar}`]:t[`avatar${ye(a)}`]},{[`& .${An.avatar}`]:t[`avatarColor${ye(r)}`]},{[`& .${An.icon}`]:t.icon},{[`& .${An.icon}`]:t[`icon${ye(a)}`]},{[`& .${An.icon}`]:t[`iconColor${ye(i)}`]},{[`& .${An.deleteIcon}`]:t.deleteIcon},{[`& .${An.deleteIcon}`]:t[`deleteIcon${ye(a)}`]},{[`& .${An.deleteIcon}`]:t[`deleteIconColor${ye(r)}`]},{[`& .${An.deleteIcon}`]:t[`deleteIcon${ye(l)}Color${ye(r)}`]},t.root,t[`size${ye(a)}`],t[`color${ye(r)}`],o&&t.clickable,o&&r!=="default"&&t[`clickableColor${ye(r)}`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${ye(r)}`],t[l],t[`${l}${ye(r)}`]]}})(Ge(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${An.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${An.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${An.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${An.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${An.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${An.icon}`]:{marginLeft:5,marginRight:-6},[`& .${An.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${An.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${An.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Bn(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${An.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${An.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${An.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${An.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(Bn(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${An.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${An.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(Bn(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${An.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${An.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${An.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${An.avatar}`]:{marginLeft:4},[`& .${An.avatarSmall}`]:{marginLeft:2},[`& .${An.icon}`]:{marginLeft:4},[`& .${An.iconSmall}`]:{marginLeft:2},[`& .${An.deleteIcon}`]:{marginRight:5},[`& .${An.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Bn()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.alpha((e.vars||e).palette[n].main,.7)}`,[`&.${An.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${An.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${An.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),_be=me("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${ye(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function LF(e){return e.key==="Backspace"||e.key==="Delete"}const vt=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiChip"}),{avatar:i,className:o,clickable:s,color:a="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:p,onClick:g,onDelete:y,onKeyDown:b,onKeyUp:v,size:S="medium",variant:C="filled",tabIndex:w,skipFocusWhenDisabled:A=!1,slots:E={},slotProps:D={},...O}=r,T=_.useRef(null),I=Mr(T,n),L=J=>{J.stopPropagation(),y(J)},$=J=>{J.currentTarget===J.target&&LF(J)&&J.preventDefault(),b&&b(J)},R=J=>{J.currentTarget===J.target&&y&&LF(J)&&y(J),v&&v(J)},F=s!==!1&&g?!0:s,P=F||y?va:l||"div",z={...r,component:P,disabled:u,size:S,color:a,iconColor:_.isValidElement(f)&&f.props.color||a,onDelete:!!y,clickable:F,variant:C},N=Abe(z),V=P===va?{component:l||"div",focusVisibleClassName:N.focusVisible,...y&&{disableRipple:!0}}:{};let U=null;y&&(U=c&&_.isValidElement(c)?_.cloneElement(c,{className:Te(c.props.className,N.deleteIcon),onClick:L}):h.jsx(Cbe,{className:N.deleteIcon,onClick:L}));let K=null;i&&_.isValidElement(i)&&(K=_.cloneElement(i,{className:Te(N.avatar,i.props.className)}));let X=null;f&&_.isValidElement(f)&&(X=_.cloneElement(f,{className:Te(N.icon,f.props.className)}));const B={slots:E,slotProps:D},[W,q]=ut("root",{elementType:kbe,externalForwardedProps:{...B,...O},ownerState:z,shouldForwardComponentProp:!0,ref:I,className:Te(N.root,o),additionalProps:{disabled:F&&u?!0:void 0,tabIndex:A&&u?-1:w,...V},getSlotProps:J=>({...J,onClick:te=>{J.onClick?.(te),g?.(te)},onKeyDown:te=>{J.onKeyDown?.(te),$(te)},onKeyUp:te=>{J.onKeyUp?.(te),R(te)}})}),[H,Y]=ut("label",{elementType:_be,externalForwardedProps:B,ownerState:z,className:N.label});return h.jsxs(W,{as:P,...q,children:[K||X,h.jsx(H,{...Y,children:p}),U]})});function NF(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Y4(e,t=!1){return e&&(NF(e.value)&&e.value!==""||t&&NF(e.defaultValue)&&e.defaultValue!=="")}function Dbe(e){return e.startAdornment}function Obe(e){return Qe("MuiFormControl",e)}tt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Tbe=e=>{const{classes:t,margin:n,fullWidth:r}=e,i={root:["root",n!=="none"&&`margin${ye(n)}`,r&&"fullWidth"]};return et(i,Obe,t)},Mbe=me("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${ye(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),ha=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiFormControl"}),{children:i,className:o,color:s="primary",component:a="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:p=!1,margin:g="none",required:y=!1,size:b="medium",variant:v="outlined",...S}=r,C={...r,color:s,component:a,disabled:l,error:c,fullWidth:f,hiddenLabel:p,margin:g,required:y,size:b,variant:v},w=Tbe(C),[A,E]=_.useState(()=>{let z=!1;return i&&_.Children.forEach(i,N=>{if(!oy(N,["Input","Select"]))return;const V=oy(N,["Select"])?N.props.input:N;V&&Dbe(V.props)&&(z=!0)}),z}),[D,O]=_.useState(()=>{let z=!1;return i&&_.Children.forEach(i,N=>{oy(N,["Input","Select"])&&(Y4(N.props,!0)||Y4(N.props.inputProps,!0))&&(z=!0)}),z}),[T,I]=_.useState(!1);l&&T&&I(!1);const L=u!==void 0&&!l?u:T;let $;_.useRef(!1);const R=_.useCallback(()=>{O(!0)},[]),F=_.useCallback(()=>{O(!1)},[]),P=_.useMemo(()=>({adornedStart:A,setAdornedStart:E,color:s,disabled:l,error:c,filled:D,focused:L,fullWidth:f,hiddenLabel:p,size:b,onBlur:()=>{I(!1)},onFocus:()=>{I(!0)},onEmpty:F,onFilled:R,registerEffect:$,required:y,variant:v}),[A,s,l,c,D,L,f,p,$,F,R,y,b,v]);return h.jsx(cw.Provider,{value:P,children:h.jsx(Mbe,{as:a,ownerState:C,className:Te(w.root,o),ref:n,...S,children:i})})});function Rbe(e){return Qe("MuiTypography",e)}const FF=tt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),Ibe={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},jbe=s1e(),Pbe=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=e,a={root:["root",o,e.align!=="inherit"&&`align${ye(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return et(a,Rbe,s)},$be=me("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${ye(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(Ge(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${ye(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),BF={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},re=_.forwardRef(function(t,n){const{color:r,...i}=ot({props:t,name:"MuiTypography"}),o=!Ibe[r],s=jbe({...i,...o&&{color:r}}),{align:a="inherit",className:l,component:c,gutterBottom:u=!1,noWrap:f=!1,paragraph:p=!1,variant:g="body1",variantMapping:y=BF,...b}=s,v={...s,align:a,color:r,className:l,component:c,gutterBottom:u,noWrap:f,paragraph:p,variant:g,variantMapping:y},S=c||(p?"p":y[g]||BF[g])||"span",C=Pbe(v);return h.jsx($be,{as:S,ref:n,className:Te(C.root,l),...b,ownerState:v,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...b.style}})});function Lbe(e){return Qe("MuiFormControlLabel",e)}const H1=tt("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]);function vf({props:e,states:t,muiFormControl:n}){return t.reduce((r,i)=>(r[i]=e[i],n&&typeof e[i]>"u"&&(r[i]=n[i]),r),{})}const Nbe=e=>{const{classes:t,disabled:n,labelPlacement:r,error:i,required:o}=e,s={root:["root",n&&"disabled",`labelPlacement${ye(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return et(s,Lbe,t)},Fbe=me("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${H1.label}`]:t.label},t.root,t[`labelPlacement${ye(n.labelPlacement)}`]]}})(Ge(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${H1.disabled}`]:{cursor:"default"},[`& .${H1.label}`]:{[`&.${H1.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),Bbe=me("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(Ge(({theme:e})=>({[`&.${H1.error}`]:{color:(e.vars||e).palette.error.main}}))),os=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiFormControlLabel"}),{checked:i,className:o,componentsProps:s={},control:a,disabled:l,disableTypography:c,inputRef:u,label:f,labelPlacement:p="end",name:g,onChange:y,required:b,slots:v={},slotProps:S={},value:C,...w}=r,A=ml(),E=l??a.props.disabled??A?.disabled,D=b??a.props.required,O={disabled:E,required:D};["checked","name","onChange","value","inputRef"].forEach(z=>{typeof a.props[z]>"u"&&typeof r[z]<"u"&&(O[z]=r[z])});const T=vf({props:r,muiFormControl:A,states:["error"]}),I={...r,disabled:E,labelPlacement:p,required:D,error:T.error},L=Nbe(I),$={slots:v,slotProps:{...s,...S}},[R,F]=ut("typography",{elementType:re,externalForwardedProps:$,ownerState:I});let P=f;return P!=null&&P.type!==re&&!c&&(P=h.jsx(R,{component:"span",...F,className:Te(L.label,F?.className),children:P})),h.jsxs(Fbe,{className:Te(L.root,o),ownerState:I,ref:n,...w,children:[_.cloneElement(a,O),D?h.jsxs("div",{children:[P,h.jsxs(Bbe,{ownerState:I,"aria-hidden":!0,className:L.asterisk,children:[" ","*"]})]}):P]})}),it=Sge({createStyledComponent:me("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.container&&t.container]}}),componentName:"MuiGrid",useThemeProps:e=>ot({props:e,name:"MuiGrid"}),useTheme:io});function zbe(e){return Qe("MuiLinearProgress",e)}tt("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const Bk=4,zk=gf`
|
|
147
|
+
`:null,Q1e=e=>{const{classes:t,variant:n,color:r,disableShrink:i}=e,o={root:["root",n,`color${ye(r)}`],svg:["svg"],track:["track"],circle:["circle",`circle${ye(n)}`,i&&"circleDisableShrink"]};return et(o,X1e,t)},eye=me("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${ye(n.color)}`]]}})(Ge(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Z1e||{animation:`${Dk} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),tye=me("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),nye=me("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${ye(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(Ge(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:J1e||{animation:`${Ok} 1.4s ease-in-out infinite`}}]}))),rye=me("circle",{name:"MuiCircularProgress",slot:"Track"})(Ge(({theme:e})=>({stroke:"currentColor",opacity:(e.vars||e).palette.action.activatedOpacity}))),Cr=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCircularProgress"}),{className:i,color:o="primary",disableShrink:s=!1,enableTrackSlot:a=!1,size:l=40,style:c,thickness:u=3.6,value:f=0,variant:p="indeterminate",...g}=r,y={...r,color:o,disableShrink:s,size:l,thickness:u,value:f,variant:p,enableTrackSlot:a},b=Q1e(y),v={},S={},C={};if(p==="determinate"){const w=2*Math.PI*(($a-u)/2);v.strokeDasharray=w.toFixed(3),C["aria-valuenow"]=Math.round(f),v.strokeDashoffset=`${((100-f)/100*w).toFixed(3)}px`,S.transform="rotate(-90deg)"}return h.jsx(eye,{className:Te(b.root,i),style:{width:l,height:l,...S,...c},ownerState:y,ref:n,role:"progressbar",...C,...g,children:h.jsxs(tye,{className:b.svg,ownerState:y,viewBox:`${$a/2} ${$a/2} ${$a} ${$a}`,children:[a?h.jsx(rye,{className:b.track,ownerState:y,cx:$a,cy:$a,r:($a-u)/2,fill:"none",strokeWidth:u,"aria-hidden":"true"}):null,h.jsx(nye,{className:b.circle,style:v,ownerState:y,cx:$a,cy:$a,r:($a-u)/2,fill:"none",strokeWidth:u})]})})});function iye(e){return Qe("MuiIconButton",e)}const WN=tt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),oye=e=>{const{classes:t,disabled:n,color:r,edge:i,size:o,loading:s}=e,a={root:["root",s&&"loading",n&&"disabled",r!=="default"&&`color${ye(r)}`,i&&`edge${ye(i)}`,`size${ye(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return et(a,iye,t)},sye=me(va,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${ye(n.color)}`],n.edge&&t[`edge${ye(n.edge)}`],t[`size${ye(n.size)}`]]}})(Ge(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),Ge(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${WN.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${WN.loading}`]:{color:"transparent"}}))),aye=me("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),en=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiIconButton"}),{edge:i=!1,children:o,className:s,color:a="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium",id:f,loading:p=null,loadingIndicator:g,...y}=r,b=Pu(f),v=g??h.jsx(Cr,{"aria-labelledby":b,color:"inherit",size:16}),S={...r,edge:i,color:a,disabled:l,disableFocusRipple:c,loading:p,loadingIndicator:v,size:u},C=oye(S);return h.jsxs(sye,{id:p?b:f,className:Te(C.root,s),centerRipple:!0,focusRipple:!c,disabled:l||p,ref:n,...y,ownerState:S,children:[typeof p=="boolean"&&h.jsx("span",{className:C.loadingWrapper,style:{display:"contents"},children:h.jsx(aye,{className:C.loadingIndicator,ownerState:S,children:p&&v})}),o]})}),lye=ke(h.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})),cye=ke(h.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),uye=ke(h.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),dye=ke(h.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"})),EX=ke(h.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),fye=e=>{const{variant:t,color:n,severity:r,classes:i}=e,o={root:["root",`color${ye(n||r)}`,`${t}${ye(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return et(o,w1e,i)},hye=me(Ur,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${ye(n.color||n.severity)}`]]}})(Ge(({theme:e})=>{const t=e.palette.mode==="light"?e.darken:e.lighten,n=e.palette.mode==="light"?e.lighten:e.darken;return{...e.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter(Bn(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${r}StandardBg`]:n(e.palette[r].light,.9),[`& .${HN.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(Bn(["light"])).map(([r])=>({props:{colorSeverity:r,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${r}Color`]:t(e.palette[r].light,.6),border:`1px solid ${(e.vars||e).palette[r].light}`,[`& .${HN.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(Bn(["dark"])).map(([r])=>({props:{colorSeverity:r,variant:"filled"},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${r}FilledColor`],backgroundColor:e.vars.palette.Alert[`${r}FilledBg`]}:{backgroundColor:e.palette.mode==="dark"?e.palette[r].dark:e.palette[r].main,color:e.palette.getContrastText(e.palette[r].main)}}}))]}})),pye=me("div",{name:"MuiAlert",slot:"Icon"})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),mye=me("div",{name:"MuiAlert",slot:"Message"})({padding:"8px 0",minWidth:0,overflow:"auto"}),gye=me("div",{name:"MuiAlert",slot:"Action"})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),qN={success:h.jsx(lye,{fontSize:"inherit"}),warning:h.jsx(cye,{fontSize:"inherit"}),error:h.jsx(uye,{fontSize:"inherit"}),info:h.jsx(dye,{fontSize:"inherit"})},Ut=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiAlert"}),{action:i,children:o,className:s,closeText:a="Close",color:l,components:c={},componentsProps:u={},icon:f,iconMapping:p=qN,onClose:g,role:y="alert",severity:b="success",slotProps:v={},slots:S={},variant:C="standard",...w}=r,A={...r,color:l,severity:b,variant:C,colorSeverity:l||b},E=fye(A),D={slots:{closeButton:c.CloseButton,closeIcon:c.CloseIcon,...S},slotProps:{...u,...v}},[O,T]=ut("root",{ref:n,shouldForwardComponentProp:!0,className:Te(E.root,s),elementType:hye,externalForwardedProps:{...D,...w},ownerState:A,additionalProps:{role:y,elevation:0}}),[I,L]=ut("icon",{className:E.icon,elementType:pye,externalForwardedProps:D,ownerState:A}),[$,R]=ut("message",{className:E.message,elementType:mye,externalForwardedProps:D,ownerState:A}),[F,P]=ut("action",{className:E.action,elementType:gye,externalForwardedProps:D,ownerState:A}),[z,N]=ut("closeButton",{elementType:en,externalForwardedProps:D,ownerState:A}),[V,U]=ut("closeIcon",{elementType:EX,externalForwardedProps:D,ownerState:A});return h.jsxs(O,{...T,children:[f!==!1?h.jsx(I,{...L,children:f||p[b]||qN[b]}):null,h.jsx($,{...R,children:o}),i!=null?h.jsx(F,{...P,children:i}):null,i==null&&g?h.jsx(F,{...P,children:h.jsx(z,{size:"small","aria-label":a,title:a,color:"inherit",onClick:g,...N,children:h.jsx(V,{fontSize:"small",...U})})}):null]})});function yye(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=e,s=Id();_.useEffect(()=>{if(!i)return;function S(C){C.defaultPrevented||C.key==="Escape"&&r?.(C,"escapeKeyDown")}return document.addEventListener("keydown",S),()=>{document.removeEventListener("keydown",S)}},[i,r]);const a=Ni((S,C)=>{r?.(S,C)}),l=Ni(S=>{!r||S==null||s.start(S,()=>{a(null,"timeout")})});_.useEffect(()=>(i&&l(t),s.clear),[i,t,l,s]);const c=S=>{r?.(S,"clickaway")},u=s.clear,f=_.useCallback(()=>{t!=null&&l(o??t*.5)},[t,o,l]),p=S=>C=>{const w=S.onBlur;w?.(C),f()},g=S=>C=>{const w=S.onFocus;w?.(C),u()},y=S=>C=>{const w=S.onMouseEnter;w?.(C),u()},b=S=>C=>{const w=S.onMouseLeave;w?.(C),f()};return _.useEffect(()=>{if(!n&&i)return window.addEventListener("focus",f),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",u)}},[n,i,f,u]),{getRootProps:(S={})=>{const C={...Xi(e),...Xi(S)};return{role:"presentation",...S,...C,onBlur:p(C),onFocus:g(C),onMouseEnter:y(C),onMouseLeave:b(C)}},onClickAway:c}}function bf(e){return parseInt(_.version,10)>=19?e?.props?.ref||null:e?.ref||null}function GN(e){return e.substring(2).toLowerCase()}function bye(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function vye(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:i,touchEvent:o="onTouchEnd"}=e,s=_.useRef(!1),a=_.useRef(null),l=_.useRef(!1),c=_.useRef(!1);_.useEffect(()=>(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=Mr(bf(t),a),f=Ni(y=>{const b=c.current;c.current=!1;const v=Di(a.current);if(!l.current||!a.current||"clientX"in y&&bye(y,v))return;if(s.current){s.current=!1;return}let S;y.composedPath?S=y.composedPath().includes(a.current):S=!v.documentElement.contains(y.target)||a.current.contains(y.target),!S&&(n||!b)&&i(y)}),p=y=>b=>{c.current=!0;const v=t.props[y];v&&v(b)},g={ref:u};return o!==!1&&(g[o]=p(o)),_.useEffect(()=>{if(o!==!1){const y=GN(o),b=Di(a.current),v=()=>{s.current=!0};return b.addEventListener(y,f),b.addEventListener("touchmove",v),()=>{b.removeEventListener(y,f),b.removeEventListener("touchmove",v)}}},[f,o]),r!==!1&&(g[r]=p(r)),_.useEffect(()=>{if(r!==!1){const y=GN(r),b=Di(a.current);return b.addEventListener(y,f),()=>{b.removeEventListener(y,f)}}},[f,r]),_.cloneElement(t,g)}const UO=e=>e.scrollTop;function Jd(e,t){const{timeout:n,easing:r,style:i={}}=e;return{duration:i.transitionDuration??(typeof n=="number"?n:n[t.mode]||0),easing:i.transitionTimingFunction??(typeof r=="object"?r[t.mode]:r),delay:i.transitionDelay}}function Tk(e){return`scale(${e}, ${e**2})`}const xye={entering:{opacity:1,transform:Tk(1)},entered:{opacity:1,transform:"none"}},T7=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Gy=_.forwardRef(function(t,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:p,onExiting:g,style:y,timeout:b="auto",TransitionComponent:v=Ma,...S}=t,C=Id(),w=_.useRef(),A=io(),E=_.useRef(null),D=Mr(E,bf(o),n),O=z=>N=>{if(z){const V=E.current;N===void 0?z(V):z(V,N)}},T=O(u),I=O((z,N)=>{UO(z);const{duration:V,delay:U,easing:K}=Jd({style:y,timeout:b,easing:s},{mode:"enter"});let X;b==="auto"?(X=A.transitions.getAutoHeightDuration(z.clientHeight),w.current=X):X=V,z.style.transition=[A.transitions.create("opacity",{duration:X,delay:U}),A.transitions.create("transform",{duration:T7?X:X*.666,delay:U,easing:K})].join(","),l&&l(z,N)}),L=O(c),$=O(g),R=O(z=>{const{duration:N,delay:V,easing:U}=Jd({style:y,timeout:b,easing:s},{mode:"exit"});let K;b==="auto"?(K=A.transitions.getAutoHeightDuration(z.clientHeight),w.current=K):K=N,z.style.transition=[A.transitions.create("opacity",{duration:K,delay:V}),A.transitions.create("transform",{duration:T7?K:K*.666,delay:T7?V:V||K*.333,easing:U})].join(","),z.style.opacity=0,z.style.transform=Tk(.75),f&&f(z)}),F=O(p),P=z=>{b==="auto"&&C.start(w.current||0,z),r&&r(E.current,z)};return h.jsx(v,{appear:i,in:a,nodeRef:E,onEnter:I,onEntered:L,onEntering:T,onExit:R,onExited:F,onExiting:$,addEndListener:P,timeout:b==="auto"?null:b,...S,children:(z,{ownerState:N,...V})=>_.cloneElement(o,{style:{opacity:0,transform:Tk(.75),visibility:z==="exited"&&!a?"hidden":void 0,...xye[z],...y,...o.props.style},ref:D,...V})})});Gy&&(Gy.muiSupportAuto=!0);function Sye(e){return Qe("MuiSnackbarContent",e)}tt("MuiSnackbarContent",["root","message","action"]);const wye=e=>{const{classes:t}=e;return et({root:["root"],action:["action"],message:["message"]},Sye,t)},Cye=me(Ur,{name:"MuiSnackbarContent",slot:"Root"})(Ge(({theme:e})=>{const t=e.palette.mode==="light"?.8:.98;return{...e.typography.body2,color:e.vars?e.vars.palette.SnackbarContent.color:e.palette.getContrastText(Wy(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:Wy(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),Eye=me("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),Aye=me("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),kye=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiSnackbarContent"}),{action:i,className:o,message:s,role:a="alert",...l}=r,c=r,u=wye(c);return h.jsxs(Cye,{role:a,elevation:6,className:Te(u.root,o),ownerState:c,ref:n,...l,children:[h.jsx(Eye,{className:u.message,ownerState:c,children:s}),i?h.jsx(Aye,{className:u.action,ownerState:c,children:i}):null]})});function _ye(e){return Qe("MuiSnackbar",e)}tt("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const Dye=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${ye(n.vertical)}${ye(n.horizontal)}`]};return et(r,_ye,t)},Oye=me("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${ye(n.anchorOrigin.vertical)}${ye(n.anchorOrigin.horizontal)}`]]}})(Ge(({theme:e})=>({zIndex:(e.vars||e).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center",variants:[{props:({ownerState:t})=>t.anchorOrigin.vertical==="top",style:{top:8,[e.breakpoints.up("sm")]:{top:24}}},{props:({ownerState:t})=>t.anchorOrigin.vertical!=="top",style:{bottom:8,[e.breakpoints.up("sm")]:{bottom:24}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="left",style:{justifyContent:"flex-start",[e.breakpoints.up("sm")]:{left:24,right:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="right",style:{justifyContent:"flex-end",[e.breakpoints.up("sm")]:{right:24,left:"auto"}}},{props:({ownerState:t})=>t.anchorOrigin.horizontal==="center",style:{[e.breakpoints.up("sm")]:{left:"50%",right:"auto",transform:"translateX(-50%)"}}}]}))),VO=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiSnackbar"}),i=io(),o={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:s,anchorOrigin:{vertical:a,horizontal:l}={vertical:"bottom",horizontal:"left"},autoHideDuration:c=null,children:u,className:f,ClickAwayListenerProps:p,ContentProps:g,disableWindowBlurListener:y=!1,message:b,onBlur:v,onClose:S,onFocus:C,onMouseEnter:w,onMouseLeave:A,open:E,resumeHideDuration:D,slots:O={},slotProps:T={},TransitionComponent:I,transitionDuration:L=o,TransitionProps:{onEnter:$,onExited:R,...F}={},...P}=r,z={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:y,TransitionComponent:I,transitionDuration:L},N=Dye(z),{getRootProps:V,onClickAway:U}=yye(z),[K,X]=_.useState(!0),B=ie=>{X(!0),R&&R(ie)},W=(ie,se)=>{X(!1),$&&$(ie,se)},q={slots:{transition:I,...O},slotProps:{content:g,clickAwayListener:p,transition:F,...T}},[H,Y]=ut("root",{ref:n,className:[N.root,f],elementType:Oye,getSlotProps:V,externalForwardedProps:{...q,...P},ownerState:z}),[J,{ownerState:te,...ee}]=ut("clickAwayListener",{elementType:vye,externalForwardedProps:q,getSlotProps:ie=>({onClickAway:(...se)=>{const fe=se[0];ie.onClickAway?.(...se),!fe?.defaultMuiPrevented&&U(...se)}}),ownerState:z}),[ae,ue]=ut("content",{elementType:kye,shouldForwardComponentProp:!0,externalForwardedProps:q,additionalProps:{message:b,action:s},ownerState:z}),[ne,Z]=ut("transition",{elementType:Gy,externalForwardedProps:q,getSlotProps:ie=>({onEnter:(...se)=>{ie.onEnter?.(...se),W(...se)},onExited:(...se)=>{ie.onExited?.(...se),B(...se)}}),additionalProps:{appear:!0,in:E,timeout:L,direction:a==="top"?"down":"up"},ownerState:z});return!E&&K?null:h.jsx(J,{...ee,...O.clickAwayListener&&{ownerState:te},children:h.jsx(H,{...Y,children:h.jsx(ne,{...Z,children:u||h.jsx(ae,{...ue})})})})}),AX=_.createContext({show:()=>{}});let Tye=0;const Mye=e=>{const[t,n]=_.useState([]),r=_.useCallback(o=>{n(s=>[...s,{...o,autoHideDuration:o.autoHideDuration??6e3,notificationId:Tye++}])},[]),i=o=>{n(s=>s.filter(a=>a.notificationId!==o))};return h.jsxs(AX.Provider,{value:{show:r},children:[e.children,t.map(o=>h.jsx(VO,{open:!0,autoHideDuration:o.autoHideDuration,onClose:()=>i(o.notificationId),children:h.jsx(Ut,{severity:o.severity,variant:"filled",sx:{minWidth:"300px"},children:o.message})},o.notificationId))]})};function fo(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var Rye=typeof Symbol=="function"&&Symbol.observable||"@@observable",KN=Rye,M7=()=>Math.random().toString(36).substring(7).split("").join("."),Iye={INIT:`@@redux/INIT${M7()}`,REPLACE:`@@redux/REPLACE${M7()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${M7()}`},F4=Iye;function WO(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function kX(e,t,n){if(typeof e!="function")throw new Error(fo(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(fo(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(fo(1));return n(kX)(e,t)}let r=e,i=t,o=new Map,s=o,a=0,l=!1;function c(){s===o&&(s=new Map,o.forEach((v,S)=>{s.set(S,v)}))}function u(){if(l)throw new Error(fo(3));return i}function f(v){if(typeof v!="function")throw new Error(fo(4));if(l)throw new Error(fo(5));let S=!0;c();const C=a++;return s.set(C,v),function(){if(S){if(l)throw new Error(fo(6));S=!1,c(),s.delete(C),o=null}}}function p(v){if(!WO(v))throw new Error(fo(7));if(typeof v.type>"u")throw new Error(fo(8));if(typeof v.type!="string")throw new Error(fo(17));if(l)throw new Error(fo(9));try{l=!0,i=r(i,v)}finally{l=!1}return(o=s).forEach(C=>{C()}),v}function g(v){if(typeof v!="function")throw new Error(fo(10));r=v,p({type:F4.REPLACE})}function y(){const v=f;return{subscribe(S){if(typeof S!="object"||S===null)throw new Error(fo(11));function C(){const A=S;A.next&&A.next(u())}return C(),{unsubscribe:v(C)}},[KN](){return this}}}return p({type:F4.INIT}),{dispatch:p,subscribe:f,getState:u,replaceReducer:g,[KN]:y}}function jye(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:F4.INIT})>"u")throw new Error(fo(12));if(typeof n(void 0,{type:F4.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(fo(13))})}function Pye(e){const t=Object.keys(e),n={};for(let o=0;o<t.length;o++){const s=t[o];typeof e[s]=="function"&&(n[s]=e[s])}const r=Object.keys(n);let i;try{jye(n)}catch(o){i=o}return function(s={},a){if(i)throw i;let l=!1;const c={};for(let u=0;u<r.length;u++){const f=r[u],p=n[f],g=s[f],y=p(g,a);if(typeof y>"u")throw a&&a.type,new Error(fo(14));c[f]=y,l=l||y!==g}return l=l||r.length!==Object.keys(s).length,l?c:s}}function B4(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function $ye(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(fo(15))};const s={getState:i.getState,dispatch:(l,...c)=>o(l,...c)},a=e.map(l=>l(s));return o=B4(...a)(i.dispatch),{...i,dispatch:o}}}function Lye(e){return WO(e)&&"type"in e&&typeof e.type=="string"}var _X=Symbol.for("immer-nothing"),YN=Symbol.for("immer-draftable"),Uo=Symbol.for("immer-state");function za(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ps=Object,sm=Ps.getPrototypeOf,z4="constructor",tw="prototype",Mk="configurable",H4="enumerable",N5="writable",Ky="value",Au=e=>!!e&&!!e[Uo];function il(e){return e?DX(e)||rw(e)||!!e[YN]||!!e[z4]?.[YN]||iw(e)||ow(e):!1}var Nye=Ps[tw][z4].toString(),XN=new WeakMap;function DX(e){if(!e||!qO(e))return!1;const t=sm(e);if(t===null||t===Ps[tw])return!0;const n=Ps.hasOwnProperty.call(t,z4)&&t[z4];if(n===Object)return!0;if(!d0(n))return!1;let r=XN.get(n);return r===void 0&&(r=Function.toString.call(n),XN.set(n,r)),r===Nye}function nw(e,t,n=!0){bb(e)===0?(n?Reflect.ownKeys(e):Ps.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function bb(e){const t=e[Uo];return t?t.type_:rw(e)?1:iw(e)?2:ow(e)?3:0}var ZN=(e,t,n=bb(e))=>n===2?e.has(t):Ps[tw].hasOwnProperty.call(e,t),Rk=(e,t,n=bb(e))=>n===2?e.get(t):e[t],U4=(e,t,n,r=bb(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function Fye(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var rw=Array.isArray,iw=e=>e instanceof Map,ow=e=>e instanceof Set,qO=e=>typeof e=="object",d0=e=>typeof e=="function",R7=e=>typeof e=="boolean";function Bye(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var lu=e=>e.copy_||e.base_,GO=e=>e.modified_?e.copy_:e.base_;function Ik(e,t){if(iw(e))return new Map(e);if(ow(e))return new Set(e);if(rw(e))return Array[tw].slice.call(e);const n=DX(e);if(t===!0||t==="class_only"&&!n){const r=Ps.getOwnPropertyDescriptors(e);delete r[Uo];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const s=i[o],a=r[s];a[N5]===!1&&(a[N5]=!0,a[Mk]=!0),(a.get||a.set)&&(r[s]={[Mk]:!0,[N5]:!0,[H4]:a[H4],[Ky]:e[s]})}return Ps.create(sm(e),r)}else{const r=sm(e);if(r!==null&&n)return{...e};const i=Ps.create(r);return Ps.assign(i,e)}}function KO(e,t=!1){return sw(e)||Au(e)||!il(e)||(bb(e)>1&&Ps.defineProperties(e,{set:Dx,add:Dx,clear:Dx,delete:Dx}),Ps.freeze(e),t&&nw(e,(n,r)=>{KO(r,!0)},!1)),e}function zye(){za(2)}var Dx={[Ky]:zye};function sw(e){return e===null||!qO(e)?!0:Ps.isFrozen(e)}var V4="MapSet",jk="Patches",JN="ArrayMethods",OX={};function Ih(e){const t=OX[e];return t||za(0,e),t}var QN=e=>!!OX[e],Yy,TX=()=>Yy,Hye=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:QN(V4)?Ih(V4):void 0,arrayMethodsPlugin_:QN(JN)?Ih(JN):void 0});function eF(e,t){t&&(e.patchPlugin_=Ih(jk),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Pk(e){$k(e),e.drafts_.forEach(Uye),e.drafts_=null}function $k(e){e===Yy&&(Yy=e.parent_)}var tF=e=>Yy=Hye(Yy,e);function Uye(e){const t=e[Uo];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function nF(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Uo].modified_&&(Pk(t),za(4)),il(e)&&(e=rF(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Uo].base_,e,t)}else e=rF(t,n);return Vye(t,e,!0),Pk(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==_X?e:void 0}function rF(e,t){if(sw(t))return t;const n=t[Uo];if(!n)return W4(t,e.handledSet_,e);if(!aw(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);IX(n,e)}return n.copy_}function Vye(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&KO(t,n)}function MX(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var aw=(e,t)=>e.scope_===t,Wye=[];function RX(e,t,n,r){const i=lu(e),o=e.type_;if(r!==void 0&&Rk(i,r,o)===t){U4(i,r,n,o);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;nw(i,(l,c)=>{if(Au(c)){const u=a.get(c)||[];u.push(l),a.set(c,u)}})}const s=e.draftLocations_.get(t)??Wye;for(const a of s)U4(i,a,n,o)}function qye(e,t,n){e.callbacks_.push(function(i){const o=t;if(!o||!aw(o,i))return;i.mapSetPlugin_?.fixSetContents(o);const s=GO(o);RX(e,o.draft_??o,s,n),IX(o,i)})}function IX(e,t){if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(e.assigned_?.size??0)>0)){const{patchPlugin_:r}=t;if(r){const i=r.getPath(e);i&&r.generatePatches_(e,i,t)}MX(e)}}function Gye(e,t,n){const{scope_:r}=e;if(Au(n)){const i=n[Uo];aw(i,r)&&i.callbacks_.push(function(){F5(e);const s=GO(i);RX(e,n,s,t)})}else il(n)&&e.callbacks_.push(function(){const o=lu(e);e.type_===3?o.has(n)&&W4(n,r.handledSet_,r):Rk(o,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&W4(Rk(e.copy_,t,e.type_),r.handledSet_,r)})}function W4(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Au(e)||t.has(e)||!il(e)||sw(e)||(t.add(e),nw(e,(r,i)=>{if(Au(i)){const o=i[Uo];if(aw(o,n)){const s=GO(o);U4(e,r,s,e.type_),MX(o)}}else il(i)&&W4(i,t,n)})),e}function Kye(e,t){const n=rw(e),r={type_:n?1:0,scope_:t?t.scope_:TX(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,o=q4;n&&(i=[r],o=Xy);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,[a,r]}var q4={get(e,t){if(t===Uo)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n?.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=lu(e);if(!ZN(i,t,e.type_))return Yye(e,i,t);const o=i[t];if(e.finalized_||!il(o)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&Bye(t))return o;if(o===I7(e.base_,t)){F5(e);const s=e.type_===1?+t:t,a=Nk(e.scope_,o,e,s);return e.copy_[s]=a}return o},has(e,t){return t in lu(e)},ownKeys(e){return Reflect.ownKeys(lu(e))},set(e,t,n){const r=jX(lu(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=I7(lu(e),t),o=i?.[Uo];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(Fye(n,i)&&(n!==void 0||ZN(e.base_,t,e.type_)))return!0;F5(e),Lk(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),Gye(e,t,n)),!0},deleteProperty(e,t){return F5(e),I7(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Lk(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=lu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[N5]:!0,[Mk]:e.type_!==1||t!=="length",[H4]:r[H4],[Ky]:n[t]}},defineProperty(){za(11)},getPrototypeOf(e){return sm(e.base_)},setPrototypeOf(){za(12)}},Xy={};for(let e in q4){let t=q4[e];Xy[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}Xy.deleteProperty=function(e,t){return Xy.set.call(this,e,t,void 0)};Xy.set=function(e,t,n){return q4.set.call(this,e[0],t,n,e[0])};function I7(e,t){const n=e[Uo];return(n?lu(n):e)[t]}function Yye(e,t,n){const r=jX(t,n);return r?Ky in r?r[Ky]:r.get?.call(e.draft_):void 0}function jX(e,t){if(!(t in e))return;let n=sm(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=sm(n)}}function Lk(e){e.modified_||(e.modified_=!0,e.parent_&&Lk(e.parent_))}function F5(e){e.copy_||(e.assigned_=new Map,e.copy_=Ik(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Xye=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(d0(t)&&!d0(n)){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}d0(n)||za(6),r!==void 0&&!d0(r)&&za(7);let i;if(il(t)){const o=tF(this),s=Nk(o,t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?Pk(o):$k(o)}return eF(o,r),nF(i,o)}else if(!t||!qO(t)){if(i=n(t),i===void 0&&(i=t),i===_X&&(i=void 0),this.autoFreeze_&&KO(i,!0),r){const o=[],s=[];Ih(jk).generateReplacementPatches_(t,i,{patches_:o,inversePatches_:s}),r(o,s)}return i}else za(1,t)},this.produceWithPatches=(t,n)=>{if(d0(t))return(s,...a)=>this.produceWithPatches(s,l=>t(l,...a));let r,i;return[this.produce(t,n,(s,a)=>{r=s,i=a}),r,i]},R7(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),R7(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),R7(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){il(e)||za(8),Au(e)&&(e=Zye(e));const t=tF(this),n=Nk(t,e,void 0);return n[Uo].isManual_=!0,$k(t),n}finishDraft(e,t){const n=e&&e[Uo];(!n||!n.isManual_)&&za(9);const{scope_:r}=n;return eF(r,t),nF(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Ih(jk).applyPatches_;return Au(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Nk(e,t,n,r){const[i,o]=iw(t)?Ih(V4).proxyMap_(t,n):ow(t)?Ih(V4).proxySet_(t,n):Kye(t,n);return(n?.scope_??TX()).drafts_.push(i),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&r!==void 0?qye(n,o,r):o.callbacks_.push(function(l){l.mapSetPlugin_?.fixSetContents(o);const{patchPlugin_:c}=l;o.modified_&&c&&c.generatePatches_(o,[],l)}),i}function Zye(e){return Au(e)||za(10,e),PX(e)}function PX(e){if(!il(e)||sw(e))return e;const t=e[Uo];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Ik(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Ik(e,!0);return nw(n,(i,o)=>{U4(n,i,PX(o))},r),t&&(t.finalized_=!1),n}var Jye=new Xye,$X=Jye.produce,G4=Symbol("NOT_FOUND");function Qye(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function e2e(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function t2e(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var iF=e=>Array.isArray(e)?e:[e];function n2e(e){const t=Array.isArray(e[0])?e[0]:e;return t2e(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function r2e(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function i2e(e){let t;return{get(n){return t&&e(t.key,n)?t.value:G4},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function o2e(e,t){let n=[];function r(a){const l=n.findIndex(c=>t(a,c.key));if(l>-1){const c=n[l];return l>0&&(n.splice(l,1),n.unshift(c)),c.value}return G4}function i(a,l){r(a)===G4&&(n.unshift({key:a,value:l}),n.length>e&&n.pop())}function o(){return n}function s(){n=[]}return{get:r,put:i,getEntries:o,clear:s}}var s2e=(e,t)=>e===t;function a2e(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:i}=n;for(let o=0;o<i;o++)if(!e(n[o],r[o]))return!1;return!0}}function l2e(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=s2e,maxSize:i=1,resultEqualityCheck:o}=n,s=a2e(r);let a=0;const l=i<=1?i2e(s):o2e(i,s);function c(){let u=l.get(arguments);if(u===G4){if(u=e.apply(null,arguments),a++,o){const p=l.getEntries().find(g=>o(g.value,u));p&&(u=p.value,a!==0&&a--)}l.put(arguments,u)}return u}return c.clearCache=()=>{l.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}var c2e=class{constructor(e){this.value=e}deref(){return this.value}},u2e=typeof WeakRef<"u"?WeakRef:c2e,d2e=0,oF=1;function Ox(){return{s:d2e,v:void 0,o:null,p:null}}function LX(e,t={}){let n=Ox();const{resultEqualityCheck:r}=t;let i,o=0;function s(){let a=n;const{length:l}=arguments;for(let f=0,p=l;f<p;f++){const g=arguments[f];if(typeof g=="function"||typeof g=="object"&&g!==null){let y=a.o;y===null&&(a.o=y=new WeakMap);const b=y.get(g);b===void 0?(a=Ox(),y.set(g,a)):a=b}else{let y=a.p;y===null&&(a.p=y=new Map);const b=y.get(g);b===void 0?(a=Ox(),y.set(g,a)):a=b}}const c=a;let u;if(a.s===oF)u=a.v;else if(u=e.apply(null,arguments),o++,r){const f=i?.deref?.()??i;f!=null&&r(f,u)&&(u=f,o!==0&&o--),i=typeof u=="object"&&u!==null||typeof u=="function"?new u2e(u):u}return c.s=oF,c.v=u,u}return s.clearCache=()=>{n=Ox(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function NX(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let o=0,s=0,a,l={},c=i.pop();typeof c=="object"&&(l=c,c=i.pop()),Qye(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:f,memoizeOptions:p=[],argsMemoize:g=LX,argsMemoizeOptions:y=[]}=u,b=iF(p),v=iF(y),S=n2e(i),C=f(function(){return o++,c.apply(null,arguments)},...b),w=g(function(){s++;const E=r2e(S,arguments);return a=C.apply(null,E),a},...v);return Object.assign(w,{resultFunc:c,memoizedResultFunc:C,dependencies:S,dependencyRecomputations:()=>s,resetDependencyRecomputations:()=>{s=0},lastResult:()=>a,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:f,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var FX=NX(LX),f2e=Object.assign((e,t=FX)=>{e2e(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((s,a,l)=>(s[n[l]]=a,s),{}))},{withTypes:()=>f2e});function BX(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var h2e=BX(),p2e=BX,m2e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?B4:B4.apply(null,arguments)},g2e=e=>e&&typeof e.match=="function";function sy(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(K4(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>Lye(r)&&r.type===e,n}var zX=class z1 extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,z1.prototype)}static get[Symbol.species](){return z1}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new z1(...t[0].concat(this)):new z1(...t.concat(this))}};function sF(e){return il(e)?$X(e,()=>{}):e}function y2e(e){return typeof e=="boolean"}var b2e=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let s=new zX;return n&&(y2e(n)?s.push(h2e):s.push(p2e(n.extraArgument))),s},v2e="RTK_autoBatch",aF=e=>t=>{setTimeout(t,e)},x2e=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,o=!1,s=!1;const a=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:aF(10):e.type==="callback"?e.queueNotification:aF(e.timeout),c=()=>{s=!1,o&&(o=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const f=()=>i&&u(),p=r.subscribe(f);return a.add(u),()=>{p(),a.delete(u)}},dispatch(u){try{return i=!u?.meta?.[v2e],o=!i,o&&(s||(s=!0,l(c))),r.dispatch(u)}finally{i=!0}}})},S2e=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new zX(e);return r&&i.push(x2e(typeof r=="object"?r:void 0)),i};function w2e(e){const t=b2e(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:o=void 0,enhancers:s=void 0}=e||{};let a;if(typeof n=="function")a=n;else if(WO(n))a=Pye(n);else throw new Error(K4(1));let l;typeof r=="function"?l=r(t):l=t();let c=B4;i&&(c=m2e({trace:!1,...typeof i=="object"&&i}));const u=$ye(...l),f=S2e(u);let p=typeof s=="function"?s(f):f();const g=c(...p);return kX(a,o,g)}function C2e(e){const t={},n=[];let r;const i={addCase(o,s){const a=typeof o=="string"?o:o.type;if(!a)throw new Error(K4(28));if(a in t)throw new Error(K4(29));return t[a]=s,i},addAsyncThunk(o,s){return s.pending&&(t[o.pending.type]=s.pending),s.rejected&&(t[o.rejected.type]=s.rejected),s.fulfilled&&(t[o.fulfilled.type]=s.fulfilled),s.settled&&n.push({matcher:o.settled,reducer:s.settled}),i},addMatcher(o,s){return n.push({matcher:o,reducer:s}),i},addDefaultCase(o){return r=o,i}};return e(i),[t,n,r]}function E2e(e){return typeof e=="function"}function YO(e,t){let[n,r,i]=C2e(t),o;if(E2e(e))o=()=>sF(e());else{const a=sF(e);o=()=>a}function s(a=o(),l){let c=[n[l.type],...r.filter(({matcher:u})=>u(l)).map(({reducer:u})=>u)];return c.filter(u=>!!u).length===0&&(c=[i]),c.reduce((u,f)=>{if(f)if(Au(u)){const g=f(u,l);return g===void 0?u:g}else{if(il(u))return $X(u,p=>f(p,l));{const p=f(u,l);if(p===void 0){if(u===null)return u;throw Error("A case reducer on a non-draftable value must not return undefined")}return p}}return u},a)}return s.getInitialState=o,s}var A2e=(e,t)=>g2e(e)?e.match(t):e(t);function k2e(...e){return t=>e.some(n=>A2e(n,t))}var _2e="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",D2e=(e=21)=>{let t="",n=e;for(;n--;)t+=_2e[Math.random()*64|0];return t},O2e=["name","message","stack","code"],j7=class{constructor(e,t){this.payload=e,this.meta=t}_type},lF=class{constructor(e,t){this.payload=e,this.meta=t}_type},T2e=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of O2e)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},cF="External signal was aborted",M2e=(()=>{function e(t,n,r){const i=sy(t+"/fulfilled",(l,c,u,f)=>({payload:l,meta:{...f||{},arg:u,requestId:c,requestStatus:"fulfilled"}})),o=sy(t+"/pending",(l,c,u)=>({payload:void 0,meta:{...u||{},arg:c,requestId:l,requestStatus:"pending"}})),s=sy(t+"/rejected",(l,c,u,f,p)=>({payload:f,error:(r&&r.serializeError||T2e)(l||"Rejected"),meta:{...p||{},arg:u,requestId:c,rejectedWithValue:!!f,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function a(l,{signal:c}={}){return(u,f,p)=>{const g=r?.idGenerator?r.idGenerator(l):D2e(),y=new AbortController;let b,v;function S(w){v=w,y.abort()}c&&(c.aborted?S(cF):c.addEventListener("abort",()=>S(cF),{once:!0}));const C=(async function(){let w;try{let E=r?.condition?.(l,{getState:f,extra:p});if(I2e(E)&&(E=await E),E===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const D=new Promise((O,T)=>{b=()=>{T({name:"AbortError",message:v||"Aborted"})},y.signal.addEventListener("abort",b,{once:!0})});u(o(g,l,r?.getPendingMeta?.({requestId:g,arg:l},{getState:f,extra:p}))),w=await Promise.race([D,Promise.resolve(n(l,{dispatch:u,getState:f,extra:p,requestId:g,signal:y.signal,abort:S,rejectWithValue:(O,T)=>new j7(O,T),fulfillWithValue:(O,T)=>new lF(O,T)})).then(O=>{if(O instanceof j7)throw O;return O instanceof lF?i(O.payload,g,l,O.meta):i(O,g,l)})])}catch(E){w=E instanceof j7?s(null,g,l,E.payload,E.meta):s(E,g,l)}finally{b&&y.signal.removeEventListener("abort",b)}return r&&!r.dispatchConditionRejection&&s.match(w)&&w.meta.condition||u(w),w})();return Object.assign(C,{abort:S,requestId:g,arg:l,unwrap(){return C.then(R2e)}})}}return Object.assign(a,{pending:o,rejected:s,fulfilled:i,settled:k2e(s,i),typePrefix:t})}return e.withTypes=()=>e,e})();function R2e(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function I2e(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}function K4(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}async function j2e(){const e=await fetch(`api/matter/bridges?_s=${Date.now()}`);if(!e.ok){const t=await e.json().catch(()=>({error:"Failed to fetch bridges"}));throw new Error(t.error??`Failed to fetch bridges (${e.status})`)}return await e.json()}async function XO(e){const t=await fetch("api/matter/bridges",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to create bridge"}));throw new Error(n.error??`Failed to create bridge (${t.status})`)}return await t.json()}async function HX(e){const t=await fetch(`api/matter/bridges/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to update bridge"}));throw new Error(n.error??`Failed to update bridge (${t.status})`)}return await t.json()}async function P2e(e){await fetch(`api/matter/bridges/${e}`,{method:"DELETE"})}async function $2e(e){const t=await fetch(`api/matter/bridges/${e}/actions/factory-reset`,{method:"POST"});if(!t.ok){const n=await t.json().catch(()=>({error:"Factory reset failed"}));throw new Error(n.error??`Factory reset failed (${t.status})`)}return await t.json()}async function UX(e){return await fetch(`api/matter/bridges/${e}/actions/force-sync`,{method:"POST"}).then(t=>t.json())}async function L2e(e){const t=await fetch(`api/matter/bridges/${e}/actions/open-commissioning-window`,{method:"POST"});if(!t.ok){const n=await t.json().catch(()=>({error:"Failed to open commissioning window"}));throw new Error(n.error??"Failed to open commissioning window")}return t.json()}async function N2e(e){if(!(await fetch("api/matter/bridges/priorities",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:e})})).ok)throw new Error("Failed to update priorities")}async function VX(){return(await fetch("api/matter/bridges/actions/start-all",{method:"POST"})).json()}async function WX(){return(await fetch("api/matter/bridges/actions/stop-all",{method:"POST"})).json()}async function qX(){return(await fetch("api/matter/bridges/actions/restart-all",{method:"POST"})).json()}const Hm=M2e.withTypes(),lw=FX.withTypes(),ko=Hm("bridges/load",j2e),GX=Hm("bridges/create",XO),KX=Hm("bridges/delete",P2e),YX=Hm("bridges/update",HX),XX=Hm("bridges/reset",$2e),ZX=sy("bridges/setFromWebSocket"),JX=sy("bridges/updateFromWebSocket"),fs=Bde.withTypes(),Um=Ude.withTypes(),QX=_.createContext({isConnected:!1,error:null});function eZ(){return _.useContext(QX)}function F2e({children:e}){const t=fs(),[n,r]=_.useState(!1),[i,o]=_.useState(null),s=_.useRef(null),a=_.useRef(void 0),l=_.useCallback(u=>{switch(u.type){case"bridges_update":t(ZX(u.data));break;case"bridge_update":t(JX(u.data));break;case"ping":s.current?.send(JSON.stringify({type:"pong"}));break}},[t]),c=_.useCallback(()=>{if(s.current?.readyState===WebSocket.OPEN)return;const u=window.location.protocol==="https:"?"wss:":"ws:",f=document.querySelector("base")?.href||window.location.origin,p=new URL(f),g=`${u}//${p.host}${p.pathname}api/ws`.replace(/\/+/g,"/").replace(":/","://");try{const y=new WebSocket(g);s.current=y,y.onopen=()=>{r(!0),o(null)},y.onmessage=b=>{try{const v=JSON.parse(b.data);l(v)}catch{console.warn("Invalid WebSocket message")}},y.onclose=()=>{r(!1),s.current=null,a.current=setTimeout(c,3e3)},y.onerror=()=>{o(new Error("WebSocket connection error")),y.close()}}catch(y){o(y instanceof Error?y:new Error("Failed to connect"))}},[l]);return _.useEffect(()=>(c(),()=>{a.current&&clearTimeout(a.current),s.current?.close()}),[c]),h.jsx(QX.Provider,{value:{isConnected:n,error:i},children:e})}const B2e=()=>{const e=fs();return _.useEffect(()=>{e(ko())},[e]),h.jsx(EY,{})};var Zl;(function(e){e.Starting="starting",e.Running="running",e.Stopped="stopped",e.Failed="failed"})(Zl||(Zl={}));var xr;(function(e){e.Pattern="pattern",e.Regex="regex",e.Domain="domain",e.Platform="platform",e.Label="label",e.EntityLabel="entity_label",e.DeviceLabel="device_label",e.Area="area",e.EntityCategory="entity_category",e.DeviceName="device_name",e.ProductName="product_name",e.DeviceClass="device_class"})(xr||(xr={}));const tZ=[{id:"all_lights",name:"All Lights",description:"Expose all light entities. Ideal for controlling lights via Apple Home, Google Home, or Alexa.",icon:"light",filter:{include:[{type:xr.Domain,value:"light"}],exclude:[]},featureFlags:{autoBatteryMapping:!0},tags:["lights","popular"]},{id:"all_switches",name:"All Switches & Plugs",description:"Expose all switch entities including smart plugs. Includes power and energy monitoring.",icon:"switch",filter:{include:[{type:xr.Domain,value:"switch"}],exclude:[]},featureFlags:{},tags:["switches","plugs"]},{id:"sensors_only",name:"All Sensors",description:"Expose temperature, humidity, pressure, and other sensors. Auto-combines related sensors from the same device.",icon:"sensor",filter:{include:[{type:xr.Domain,value:"sensor"},{type:xr.Domain,value:"binary_sensor"}],exclude:[]},featureFlags:{autoBatteryMapping:!0,autoHumidityMapping:!0,autoPressureMapping:!0},tags:["sensors","temperature","humidity"]},{id:"climate_control",name:"Climate & Covers",description:"Expose thermostats, fans, covers, and humidifiers for climate control.",icon:"climate",filter:{include:[{type:xr.Domain,value:"climate"},{type:xr.Domain,value:"fan"},{type:xr.Domain,value:"cover"},{type:xr.Domain,value:"humidifier"}],exclude:[]},featureFlags:{autoBatteryMapping:!0},tags:["climate","thermostat","covers"]},{id:"security",name:"Security & Locks",description:"Expose locks, alarm panels, and security-related binary sensors (motion, door, window).",icon:"lock",filter:{include:[{type:xr.Domain,value:"lock"},{type:xr.Domain,value:"alarm_control_panel"},{type:xr.DeviceClass,value:"motion"},{type:xr.DeviceClass,value:"door"},{type:xr.DeviceClass,value:"window"}],exclude:[],includeMode:"any"},featureFlags:{autoBatteryMapping:!0},tags:["security","locks","alarm"]},{id:"robot_vacuum",name:"Robot Vacuum (Server Mode)",description:"Single vacuum bridge with Server Mode enabled. Required for Apple Home Siri commands and proper Alexa discovery. Add only ONE vacuum to this bridge.",icon:"vacuum",filter:{include:[{type:xr.Domain,value:"vacuum"}],exclude:[]},featureFlags:{serverMode:!0},tags:["vacuum","server-mode","apple-home"]},{id:"media_players",name:"Media Players & Speakers",description:"Expose media players, speakers, and TVs for volume and playback control.",icon:"media_player",filter:{include:[{type:xr.Domain,value:"media_player"}],exclude:[]},featureFlags:{},tags:["media","speakers","tv"]},{id:"google_home_optimized",name:"Google Home Optimized",description:"All devices with Auto Force Sync enabled. Prevents Google Home from showing devices as offline after a few hours.",icon:"default",filter:{include:[{type:xr.Pattern,value:"*"}],exclude:[]},featureFlags:{autoForceSync:!0,autoBatteryMapping:!0,autoHumidityMapping:!0,autoPressureMapping:!0},tags:["google-home","all-devices"]},{id:"alexa_covers",name:"Alexa-Optimized Covers",description:"Covers with Alexa-friendly percentage display. Displayed percentage matches Home Assistant values.",icon:"cover",filter:{include:[{type:xr.Domain,value:"cover"}],exclude:[]},featureFlags:{coverUseHomeAssistantPercentage:!0,autoBatteryMapping:!0},tags:["alexa","covers"]},{id:"automations_scripts",name:"Automations & Scripts",description:"Expose Home Assistant automations, scripts, and scenes as Matter switches.",icon:"remote",filter:{include:[{type:xr.Domain,value:"automation"},{type:xr.Domain,value:"script"},{type:xr.Domain,value:"scene"}],exclude:[]},featureFlags:{},tags:["automations","scripts","scenes"]}];var uF;(function(e){e[e.locked=1]="locked",e[e.unlocked=2]="unlocked"})(uF||(uF={}));var dF;(function(e){e[e.Off=0]="Off",e[e.Low=1]="Low",e[e.Medium=2]="Medium",e[e.High=3]="High",e[e.On=4]="On",e[e.Auto=5]="Auto",e[e.Smart=6]="Smart"})(dF||(dF={}));var fF;(function(e){e[e.Forward=0]="Forward",e[e.Reverse=1]="Reverse"})(fF||(fF={}));var hF;(function(e){e[e.OffLowMedHigh=0]="OffLowMedHigh",e[e.OffLowHigh=1]="OffLowHigh",e[e.OffLowMedHighAuto=2]="OffLowMedHighAuto",e[e.OffLowHighAuto=3]="OffLowHighAuto",e[e.OffHighAuto=4]="OffHighAuto",e[e.OffHigh=5]="OffHigh"})(hF||(hF={}));var pF;(function(e){e[e.Stopped=0]="Stopped",e[e.Running=1]="Running",e[e.Paused=2]="Paused",e[e.Error=3]="Error",e[e.SeekingCharger=64]="SeekingCharger",e[e.Charging=65]="Charging",e[e.Docked=66]="Docked"})(pF||(pF={}));var mF;(function(e){e[e.Off=0]="Off",e[e.Auto=1]="Auto",e[e.Cool=3]="Cool",e[e.Heat=4]="Heat",e[e.EmergencyHeat=5]="EmergencyHeat",e[e.Precooling=6]="Precooling",e[e.FanOnly=7]="FanOnly",e[e.Dry=8]="Dry",e[e.Sleep=9]="Sleep"})(mF||(mF={}));var Fk;(function(e){e.homeAssistantEntity="homeAssistantEntity",e.identify="identify",e.groups="groups",e.scenesManagement="scenesManagement",e.bridgedDeviceBasicInformation="bridgedDeviceBasicInformation",e.airQuality="airQuality",e.booleanState="booleanState",e.carbonDioxideConcentrationMeasurement="carbonDioxideConcentrationMeasurement",e.carbonMonoxideConcentrationMeasurement="carbonMonoxideConcentrationMeasurement",e.colorControl="colorControl",e.doorLock="doorLock",e.electricalEnergyMeasurement="electricalEnergyMeasurement",e.electricalPowerMeasurement="electricalPowerMeasurement",e.flowMeasurement="flowMeasurement",e.levelControl="levelControl",e.fanControl="fanControl",e.illuminanceMeasurement="illuminanceMeasurement",e.nitrogenDioxideConcentrationMeasurement="nitrogenDioxideConcentrationMeasurement",e.occupancySensing="occupancySensing",e.onOff="onOff",e.ozoneConcentrationMeasurement="ozoneConcentrationMeasurement",e.pm1ConcentrationMeasurement="pm1ConcentrationMeasurement",e.pm10ConcentrationMeasurement="pm10ConcentrationMeasurement",e.pm25ConcentrationMeasurement="pm25ConcentrationMeasurement",e.powerSource="powerSource",e.pressureMeasurement="pressureMeasurement",e.relativeHumidityMeasurement="relativeHumidityMeasurement",e.smokeCoAlarm="smokeCoAlarm",e.temperatureMeasurement="temperatureMeasurement",e.thermostat="thermostat",e.thermostatUserInterfaceConfiguration="thermostatUserInterfaceConfiguration",e.totalVolatileOrganicCompoundsConcentrationMeasurement="totalVolatileOrganicCompoundsConcentrationMeasurement",e.valveConfigurationAndControl="valveConfigurationAndControl",e.windowCovering="windowCovering",e.mediaInput="mediaInput",e.rvcCleanMode="rvcCleanMode",e.rvcRunMode="rvcRunMode",e.rvcOperationalState="rvcOperationalState",e.serviceArea="serviceArea",e.switch="switch",e.modeSelect="modeSelect"})(Fk||(Fk={}));const nZ=[{id:"apple_home",name:"Apple Home",description:"Optimized for Apple Home and Siri. Enables composed devices for clean sensor grouping. Covers use standard Matter percentage (inverted from HA).",icon:"default",featureFlags:{autoComposedDevices:!0,autoBatteryMapping:!0,autoHumidityMapping:!0,autoPressureMapping:!0}},{id:"google_home",name:"Google Home",description:"Optimized for Google Home. Enables Auto Force Sync to prevent devices from going offline. Composed devices enabled for proper sensor grouping.",icon:"default",featureFlags:{autoForceSync:!0,autoComposedDevices:!0,autoBatteryMapping:!0,autoHumidityMapping:!0,autoPressureMapping:!0}},{id:"alexa",name:"Amazon Alexa",description:"Optimized for Alexa. Enables Auto Force Sync and Alexa-friendly cover percentages. Battery mapping included for sensor devices.",icon:"default",featureFlags:{autoForceSync:!0,autoBatteryMapping:!0,autoHumidityMapping:!0,autoPressureMapping:!0,coverUseHomeAssistantPercentage:!0}},{id:"multi_controller",name:"Multi-Controller",description:"Balanced settings for use with multiple controllers at once (e.g. Apple Home + Alexa). Force Sync enabled. Standard cover behavior.",icon:"default",featureFlags:{autoForceSync:!0,autoComposedDevices:!0,autoBatteryMapping:!0,autoHumidityMapping:!0,autoPressureMapping:!0}}];var gF;(function(e){e.Battery="battery",e.BatteryCharging="battery_charging",e.CarbonMonoxide="carbon_monoxide",e.Cold="cold",e.Connectivity="connectivity",e.Door="door",e.GarageDoor="garage_door",e.Gas="gas",e.Heat="heat",e.Light="light",e.Lock="lock",e.Moisture="moisture",e.Motion="motion",e.Moving="moving",e.Occupancy="occupancy",e.Opening="opening",e.Plug="plug",e.Power="power",e.Presence="presence",e.Problem="problem",e.Running="running",e.Safety="safety",e.Smoke="smoke",e.Sound="sound",e.Tamper="tamper",e.Update="update",e.Vibration="vibration",e.Window="window"})(gF||(gF={}));var yF;(function(e){e.off="off",e.heat="heat",e.cool="cool",e.heat_cool="heat_cool",e.auto="auto",e.dry="dry",e.fan_only="fan_only"})(yF||(yF={}));var bF;(function(e){e.off="off",e.preheating="preheating",e.heating="heating",e.cooling="cooling",e.drying="drying",e.fan="fan",e.idle="idle",e.defrosting="defrosting"})(bF||(bF={}));var vF;(function(e){e[e.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",e[e.TARGET_TEMPERATURE_RANGE=2]="TARGET_TEMPERATURE_RANGE",e[e.TARGET_HUMIDITY=4]="TARGET_HUMIDITY",e[e.FAN_MODE=8]="FAN_MODE",e[e.PRESET_MODE=16]="PRESET_MODE",e[e.SWING_MODE=32]="SWING_MODE",e[e.AUX_HEAT=64]="AUX_HEAT",e[e.TURN_OFF=128]="TURN_OFF",e[e.TURN_ON=256]="TURN_ON",e[e.SWING_HORIZONTAL_MODE=512]="SWING_HORIZONTAL_MODE"})(vF||(vF={}));var xF;(function(e){e.closed="closed",e.open="open",e.closing="closing",e.opening="opening"})(xF||(xF={}));var SF;(function(e){e.button="button",e.doorbell="doorbell",e.motion="motion"})(SF||(SF={}));var wF;(function(e){e.FORWARD="forward",e.REVERSE="reverse"})(wF||(wF={}));var CF;(function(e){e[e.SET_SPEED=1]="SET_SPEED",e[e.OSCILLATE=2]="OSCILLATE",e[e.DIRECTION=4]="DIRECTION",e[e.PRESET_MODE=8]="PRESET_MODE",e[e.TURN_ON=16]="TURN_ON",e[e.TURN_OFF=32]="TURN_OFF"})(CF||(CF={}));var EF;(function(e){e.UNKNOWN="unknown",e.ONOFF="onoff",e.BRIGHTNESS="brightness",e.COLOR_TEMP="color_temp",e.HS="hs",e.XY="xy",e.RGB="rgb",e.RGBW="rgbw",e.RGBWW="rgbww",e.WHITE="white"})(EF||(EF={}));var AF;(function(e){e.Tv="tv",e.Speaker="speaker",e.Receiver="receiver"})(AF||(AF={}));var kF;(function(e){e[e.PAUSE=1]="PAUSE",e[e.SEEK=2]="SEEK",e[e.VOLUME_SET=4]="VOLUME_SET",e[e.VOLUME_MUTE=8]="VOLUME_MUTE",e[e.PREVIOUS_TRACK=16]="PREVIOUS_TRACK",e[e.NEXT_TRACK=32]="NEXT_TRACK",e[e.TURN_ON=128]="TURN_ON",e[e.TURN_OFF=256]="TURN_OFF",e[e.PLAY_MEDIA=512]="PLAY_MEDIA",e[e.VOLUME_STEP=1024]="VOLUME_STEP",e[e.SELECT_SOURCE=2048]="SELECT_SOURCE",e[e.STOP=4096]="STOP",e[e.CLEAR_PLAYLIST=8192]="CLEAR_PLAYLIST",e[e.PLAY=16384]="PLAY",e[e.SHUFFLE_SET=32768]="SHUFFLE_SET",e[e.SELECT_SOUND_MODE=65536]="SELECT_SOUND_MODE",e[e.BROWSE_MEDIA=131072]="BROWSE_MEDIA",e[e.REPEAT_SET=262144]="REPEAT_SET",e[e.GROUPING=524288]="GROUPING",e[e.MEDIA_ANNOUNCE=1048576]="MEDIA_ANNOUNCE",e[e.MEDIA_ENQUEUE=2097152]="MEDIA_ENQUEUE"})(kF||(kF={}));var _F;(function(e){e.None="None",e.apparent_power="apparent_power",e.aqi="aqi",e.atmospheric_pressure="atmospheric_pressure",e.battery="battery",e.carbon_dioxide="carbon_dioxide",e.carbon_monoxide="carbon_monoxide",e.current="current",e.data_rate="data_rate",e.data_size="data_size",e.date="date",e.distance="distance",e.duration="duration",e.energy="energy",e.energy_storage="energy_storage",e.enum="enum",e.frequency="frequency",e.gas="gas",e.humidity="humidity",e.illuminance="illuminance",e.irradiance="irradiance",e.moisture="moisture",e.monetary="monetary",e.nitrogen_dioxide="nitrogen_dioxide",e.nitrogen_monoxide="nitrogen_monoxide",e.nitrous_oxide="nitrous_oxide",e.ozone="ozone",e.ph="ph",e.pm1="pm1",e.pm25="pm25",e.pm10="pm10",e.power_factor="power_factor",e.power="power",e.precipitation="precipitation",e.precipitation_intensity="precipitation_intensity",e.pressure="pressure",e.reactive_power="reactive_power",e.signal_strength="signal_strength",e.sound_pressure="sound_pressure",e.speed="speed",e.sulphur_dioxide="sulphur_dioxide",e.temperature="temperature",e.timestamp="timestamp",e.volatile_organic_compounds="volatile_organic_compounds",e.volatile_organic_compounds_parts="volatile_organic_compounds_parts",e.voltage="voltage",e.volume="volume",e.volume_flow_rate="volume_flow_rate",e.volume_storage="volume_storage",e.water="water",e.weight="weight",e.wind_speed="wind_speed"})(_F||(_F={}));var DF;(function(e){e.cleaning="cleaning",e.docked="docked",e.returning="returning",e.error="error",e.idle="idle",e.paused="paused",e.segment_cleaning="segment_cleaning",e.zone_cleaning="zone_cleaning",e.spot_cleaning="spot_cleaning",e.mop_cleaning="mop_cleaning"})(DF||(DF={}));var OF;(function(e){e[e.TURN_ON=1]="TURN_ON",e[e.TURN_OFF=2]="TURN_OFF",e[e.PAUSE=4]="PAUSE",e[e.STOP=8]="STOP",e[e.RETURN_HOME=16]="RETURN_HOME",e[e.FAN_SPEED=32]="FAN_SPEED",e[e.BATTERY=64]="BATTERY",e[e.STATUS=128]="STATUS",e[e.SEND_COMMAND=256]="SEND_COMMAND",e[e.LOCATE=512]="LOCATE",e[e.CLEAN_SPOT=1024]="CLEAN_SPOT",e[e.MAP=2048]="MAP",e[e.STATE=4096]="STATE",e[e.START=8192]="START"})(OF||(OF={}));var TF;(function(e){e.off="off",e.low="low",e.medium="medium",e.high="high",e.turbo="turbo",e.auto="auto",e.max="max"})(TF||(TF={}));var MF;(function(e){e.off="off",e.eco="eco",e.electric="electric",e.gas="gas",e.heat_pump="heat_pump",e.high_demand="high_demand",e.performance="performance"})(MF||(MF={}));var RF;(function(e){e[e.TARGET_TEMPERATURE=1]="TARGET_TEMPERATURE",e[e.OPERATION_MODE=2]="OPERATION_MODE",e[e.AWAY_MODE=4]="AWAY_MODE",e[e.ON_OFF=8]="ON_OFF"})(RF||(RF={}));const IF={air_purifier:"Air Purifier",air_quality_sensor:"Air Quality Sensor",basic_video_player:"Basic Video Player (TV)",battery_storage:"Battery Sensor",carbon_monoxide_sensor:"Carbon Monoxide (CO) Sensor",color_dimmer_switch:"Color Dimmer Switch",color_temperature_light:"Color Temperature Light",contact_sensor:"Contact Sensor",dimmable_light:"Dimmable Light",dimmable_plugin_unit:"Dimmable Plug-in Unit",dimmer_switch:"Dimmer Switch",door_lock:"Door Lock",electrical_sensor:"Electrical Sensor (Power/Energy/Voltage/Current)",extended_color_light:"Extended Color Light",fan:"Fan",flow_sensor:"Flow Sensor",formaldehyde_sensor:"Formaldehyde (HCHO) Sensor",generic_switch:"Generic Switch (Button)",humidifier_dehumidifier:"Humidifier/Dehumidifier",humidity_sensor:"Humidity Sensor",light_sensor:"Light Sensor",mode_select:"Mode Select",nitrogen_dioxide_sensor:"Nitrogen Dioxide (NO₂) Sensor",occupancy_sensor:"Occupancy Sensor",on_off_light:"On/Off Light",on_off_plugin_unit:"On/Off Plug-in Unit",on_off_switch:"On/Off Switch",ozone_sensor:"Ozone (O₃) Sensor",pm1_sensor:"PM1 Sensor",pressure_sensor:"Pressure Sensor",pump:"Pump",radon_sensor:"Radon Sensor",robot_vacuum_cleaner:"Robot Vacuum Cleaner",smoke_co_alarm:"Smoke/CO Alarm",speaker:"Speaker",temperature_sensor:"Temperature Sensor",thermostat:"Thermostat",tvoc_sensor:"TVOC / VOC Index Sensor",water_heater:"Water Heater",water_freeze_detector:"Water Freeze Detector",water_leak_detector:"Water Leak Detector",water_valve:"Water Valve",window_covering:"Window Covering"},d1={Auto:0,Quick:1,Quiet:2,LowNoise:3,LowEnergy:4,Vacation:5,Min:6,Max:7,Night:8,Day:9,DeepClean:16384,Vacuum:16385,Mop:16386,VacuumThenMop:16387},z2e={alarm_control_panel:["mode_select","on_off_plugin_unit"],automation:["on_off_switch"],binary_sensor:["contact_sensor","occupancy_sensor","smoke_co_alarm","water_freeze_detector","water_leak_detector"],button:["generic_switch"],climate:["thermostat"],cover:["window_covering"],event:["generic_switch"],fan:["air_purifier","fan"],humidifier:["humidifier_dehumidifier"],input_boolean:["on_off_plugin_unit","on_off_switch"],input_select:["mode_select"],input_button:["generic_switch"],light:["color_temperature_light","dimmable_light","extended_color_light","on_off_light"],lock:["door_lock"],media_player:["basic_video_player","on_off_switch","speaker"],scene:["on_off_switch"],script:["on_off_switch"],sensor:["air_quality_sensor","battery_storage","carbon_monoxide_sensor","electrical_sensor","formaldehyde_sensor","humidity_sensor","light_sensor","nitrogen_dioxide_sensor","ozone_sensor","pm1_sensor","pressure_sensor","radon_sensor","temperature_sensor","tvoc_sensor"],select:["mode_select"],switch:["on_off_plugin_unit","on_off_switch","pump","water_valve"],vacuum:["robot_vacuum_cleaner"],valve:["water_valve","on_off_plugin_unit"],water_heater:["water_heater","thermostat"]};var jF;(function(e){e.alarm_control_panel="alarm_control_panel",e.automation="automation",e.button="button",e.binary_sensor="binary_sensor",e.climate="climate",e.cover="cover",e.event="event",e.fan="fan",e.humidifier="humidifier",e.input_boolean="input_boolean",e.input_button="input_button",e.input_select="input_select",e.light="light",e.lock="lock",e.media_player="media_player",e.remote="remote",e.scene="scene",e.select="select",e.script="script",e.sensor="sensor",e.switch="switch",e.vacuum="vacuum",e.valve="valve",e.water_heater="water_heater"})(jF||(jF={}));const PF={type:"object",default:{type:"",value:""},properties:{type:{title:"Type",type:"string",oneOf:[{const:"pattern",title:"pattern",description:"Wildcard pattern matching entity IDs. Use * as wildcard. Example: 'light.living_room_*' matches all lights in the living room."},{const:"regex",title:"regex",description:"Full regular expression matching entity IDs. Use ^ and $ for anchors. Example: '^(light|switch)\\.kitchen_.*' matches all kitchen lights and switches."},{const:"domain",title:"domain",description:"Match entities by their domain (the part before the dot). Example: 'light', 'switch', 'sensor'."},{const:"platform",title:"platform",description:"Match entities by their integration/platform. Example: 'hue', 'zwave', 'mqtt'."},{const:"label",title:"label (deprecated)",description:"Deprecated: use entity_label or device_label instead. Behaves like entity_label."},{const:"entity_label",title:"entity_label",description:"Matches only entities that have this label assigned directly. Other entities of the same device are NOT included."},{const:"device_label",title:"device_label",description:"Matches ALL entities of a device if the device has this label. Use this to include a complete device with all its entities."},{const:"area",title:"area",description:"Match entities by their area slug. Example: 'living_room', 'bedroom'."},{const:"entity_category",title:"entity_category",description:"Match entities by their category. Example: 'config', 'diagnostic' to exclude configuration entities."},{const:"device_name",title:"device_name",description:"Match entities by their device name. Supports wildcards. Example: '*Philips*' matches all Philips devices."},{const:"product_name",title:"product_name",description:"Match entities by their product/model name. Supports wildcards. Example: 'Hue*Bulb'."},{const:"device_class",title:"device_class",description:"Match entities by their device class attribute. Example: 'temperature', 'motion', 'door', 'window'."}]},value:{title:"Value",description:"For labels, use the display name or the label_id (slug). You can look up both on the Labels page in the sidebar.",type:"string",minLength:1}},required:["type","value"],additionalProperties:!1},H2e={title:"Include or exclude entities",type:"object",properties:{include:{title:"Include",type:"array",items:PF},exclude:{title:"Exclude",type:"array",items:PF},includeMode:{title:"Include Mode",type:"string",description:"How to combine include rules: 'any' matches if ANY rule matches (OR), 'all' matches only if ALL rules match (AND). Default: 'any'",enum:["any","all"],default:"any"}},required:["include","exclude"],additionalProperties:!1},U2e={title:"Feature Flags",type:"object",properties:{coverDoNotInvertPercentage:{title:"Do not invert Percentages for Covers",description:"Do not invert the percentage of covers to match Home Assistant (not Matter compliant)",type:"boolean",default:!1},coverUseHomeAssistantPercentage:{title:"Use Home Assistant Percentage for Covers (Alexa-friendly)",description:"Display cover percentages matching Home Assistant values in Matter controllers like Alexa. This makes the displayed percentage match what you see in Home Assistant, but the semantic meaning differs: in HA, higher percentage = more open; in Alexa, higher percentage is typically interpreted as more closed. Open/Close commands will still work correctly.",type:"boolean",default:!1},coverSwapOpenClose:{title:"Swap Open/Close for Covers",description:"Swap open/close commands and invert position reporting for covers. Enable this if Alexa voice commands are reversed (saying 'close' opens the blinds and vice versa).",type:"boolean",default:!1},includeHiddenEntities:{title:"Include Hidden Entities",description:"Include entities that are marked as hidden in Home Assistant",type:"boolean",default:!1},alexaPreserveBrightnessOnTurnOn:{title:"Alexa: Preserve Brightness on Turn-On (Deprecated)",description:"This workaround is now always active and this setting has no effect. The bridge automatically ignores brightness commands that set lights to 100% immediately after a turn-on command.",type:"boolean",default:!0},serverMode:{title:"Server Mode (for Robot Vacuums)",description:"Expose the device as a standalone Matter device instead of a bridged device. This is required for Apple Home to properly support Siri voice commands for Robot Vacuums. IMPORTANT: Only ONE device should be in this bridge when server mode is enabled.",type:"boolean",default:!1},autoBatteryMapping:{title:"Auto Battery Mapping",description:"Automatically assign battery sensors from the same Home Assistant device to the main entity. When enabled, battery sensors will be merged into their parent devices instead of appearing as separate devices.",type:"boolean",default:!1},autoHumidityMapping:{title:"Auto Humidity Mapping",description:"Automatically combine humidity sensors with temperature sensors from the same Home Assistant device. When enabled, humidity sensors will be merged into temperature sensors to create combined TemperatureHumiditySensor devices.",type:"boolean",default:!0},autoPressureMapping:{title:"Auto Pressure Mapping",description:"Automatically combine pressure sensors with temperature sensors from the same Home Assistant device. When enabled, pressure sensors will be merged into temperature sensors to create combined sensor devices.",type:"boolean",default:!0},autoComposedDevices:{title:"Auto Composed Devices",description:"Master toggle: automatically combine related entities from the same Home Assistant device into single Matter endpoints. Enables battery, humidity, pressure, power, and energy auto-mapping at once. This provides a cleaner device experience in Matter controllers (e.g., a Shelly Plug appears as one device with power monitoring).",type:"boolean",default:!1},autoForceSync:{title:"Auto Force Sync",description:"Periodically compare and push all device states to connected controllers every 90 seconds. Enable this if devices get out of sync after extended periods. Health checks for dead sessions always run regardless of this setting.",type:"boolean",default:!1},vacuumOnOff:{title:"Vacuum: Include OnOff Cluster (Alexa)",description:"Add an OnOff cluster to robot vacuum endpoints. Alexa REQUIRES this (PowerController) to show robotic vacuums in the app. Without it, Alexa commissions the device but never displays it. In Server Mode this is enabled automatically — only check this for bridge mode. WARNING: OnOff is NOT part of the Matter RVC device type specification. Enabling this may break Apple Home (shows 'Updating') and Google Home.",type:"boolean"},vacuumMinimalClusters:{title:"Vacuum: Minimal Clusters (Alexa troubleshooting)",description:"Strip the vacuum endpoint to only the clusters required by the Matter RVC spec. Removes PowerSource (battery) and the default ServiceArea placeholder. Enable this if Alexa commissions the vacuum but the device never appears in the app. Trade-off: battery percentage will not be reported to Matter controllers.",type:"boolean",default:!1}},additionalProperties:!1},ay={type:"object",title:"Bridge Config",properties:{name:{title:"Name",type:"string",minLength:1,maxLength:32},port:{title:"Port",type:"number",minimum:1},icon:{title:"Icon",type:"string",description:"Icon to display for this bridge in the UI",enum:["light","switch","climate","cover","fan","lock","sensor","media_player","vacuum","remote","humidifier","speaker","garage","door","window","motion","battery","power","camera","default"]},countryCode:{title:"Country Code",type:"string",description:"An ISO 3166-1 alpha-2 code to represent the country in which the Node is located. Only needed if the commissioning fails due to missing country code.",minLength:2,maxLength:3},priority:{title:"Startup Priority",type:"number",description:"Startup order priority. Lower values start first. Default is 100.",default:100,minimum:1,maximum:999},filter:H2e,featureFlags:U2e},required:["name","port","filter"],additionalProperties:!1};({...ay,properties:{...ay.properties},required:[...ay?.required??[]]});const rZ=ke(h.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),pl=ke(h.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"})),Vm=ke(h.jsx("path",{d:"M9.19 6.35c-2.04 2.29-3.44 5.58-3.57 5.89L2 10.69l4.05-4.05c.47-.47 1.15-.68 1.81-.55zM11.17 17s3.74-1.55 5.89-3.7c5.4-5.4 4.5-9.62 4.21-10.57-.95-.3-5.17-1.19-10.57 4.21C8.55 9.09 7 12.83 7 12.83zm6.48-2.19c-2.29 2.04-5.58 3.44-5.89 3.57L13.31 22l4.05-4.05c.47-.47.68-1.15.55-1.81zM9 18c0 .83-.34 1.58-.88 2.12C6.94 21.3 2 22 2 22s.7-4.94 1.88-6.12C4.42 15.34 5.17 15 6 15c1.66 0 3 1.34 3 3m4-9c0-1.1.9-2 2-2s2 .9 2 2-.9 2-2 2-2-.9-2-2"})),V2e=tt("MuiBox",["root"]),W2e=XS(),oe=mme({themeId:fa,defaultTheme:W2e,defaultClassName:V2e.root,generateClassName:XY.generate});function q2e(e){return Qe("MuiButton",e)}const Wf=tt("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),G2e=_.createContext({}),K2e=_.createContext(void 0),Y2e=e=>{const{color:t,disableElevation:n,fullWidth:r,size:i,variant:o,loading:s,loadingPosition:a,classes:l}=e,c={root:["root",s&&"loading",o,`${o}${ye(t)}`,`size${ye(i)}`,`${o}Size${ye(i)}`,`color${ye(t)}`,n&&"disableElevation",r&&"fullWidth",s&&`loadingPosition${ye(a)}`],startIcon:["icon","startIcon",`iconSize${ye(i)}`],endIcon:["icon","endIcon",`iconSize${ye(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},u=et(c,q2e,l);return{...l,...u}},iZ=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],X2e=me(va,{shouldForwardProp:e=>Bi(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${ye(n.color)}`],t[`size${ye(n.size)}`],t[`${n.variant}Size${ye(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(Ge(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],n=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${Wf.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${Wf.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Wf.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${Wf.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(Bn()).map(([r])=>({props:{color:r},style:{"--variant-textColor":(e.vars||e).palette[r].main,"--variant-outlinedColor":(e.vars||e).palette[r].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[r].main,.5),"--variant-containedColor":(e.vars||e).palette[r].contrastText,"--variant-containedBg":(e.vars||e).palette[r].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[r].dark,"--variant-textBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[r].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:n,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Wf.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Wf.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${Wf.loading}`]:{color:"transparent"}}}]}})),Z2e=me("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${ye(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...iZ]})),J2e=me("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${ye(n.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...iZ]})),Q2e=me("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),$F=me("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),lt=_.forwardRef(function(t,n){const r=_.useContext(G2e),i=_.useContext(K2e),o=om(r,t),s=ot({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:p=!1,disableFocusRipple:g=!1,endIcon:y,focusVisibleClassName:b,fullWidth:v=!1,id:S,loading:C=null,loadingIndicator:w,loadingPosition:A="center",size:E="medium",startIcon:D,type:O,variant:T="text",...I}=s,L=Pu(S),$=w??h.jsx(Cr,{"aria-labelledby":L,color:"inherit",size:16}),R={...s,color:l,component:c,disabled:f,disableElevation:p,disableFocusRipple:g,fullWidth:v,loading:C,loadingIndicator:$,loadingPosition:A,size:E,type:O,variant:T},F=Y2e(R),P=(D||C&&A==="start")&&h.jsx(Z2e,{className:F.startIcon,ownerState:R,children:D||h.jsx($F,{className:F.loadingIconPlaceholder,ownerState:R})}),z=(y||C&&A==="end")&&h.jsx(J2e,{className:F.endIcon,ownerState:R,children:y||h.jsx($F,{className:F.loadingIconPlaceholder,ownerState:R})}),N=i||"",V=typeof C=="boolean"?h.jsx("span",{className:F.loadingWrapper,style:{display:"contents"},children:C&&h.jsx(Q2e,{className:F.loadingIndicator,ownerState:R,children:$})}):null;return h.jsxs(X2e,{ownerState:R,className:Te(r.className,F.root,u,N),component:c,disabled:f||C,focusRipple:!g,focusVisibleClassName:Te(F.focusVisible,b),ref:n,type:O,id:C?L:S,...I,classes:F,children:[P,A!=="end"&&V,a,A==="end"&&V,z]})});function ebe(e){return Qe("MuiCard",e)}tt("MuiCard",["root"]);const tbe=e=>{const{classes:t}=e;return et({root:["root"]},ebe,t)},nbe=me(Ur,{name:"MuiCard",slot:"Root"})({overflow:"hidden"}),Pn=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCard"}),{className:i,raised:o=!1,...s}=r,a={...r,raised:o},l=tbe(a);return h.jsx(nbe,{className:Te(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a,...s})});function rbe(e){return Qe("MuiCardActionArea",e)}const P7=tt("MuiCardActionArea",["root","focusVisible","focusHighlight"]),ibe=e=>{const{classes:t}=e;return et({root:["root"],focusHighlight:["focusHighlight"]},rbe,t)},obe=me(va,{name:"MuiCardActionArea",slot:"Root"})(Ge(({theme:e})=>({display:"block",textAlign:"inherit",borderRadius:"inherit",width:"100%",[`&:hover .${P7.focusHighlight}`]:{opacity:(e.vars||e).palette.action.hoverOpacity,"@media (hover: none)":{opacity:0}},[`&.${P7.focusVisible} .${P7.focusHighlight}`]:{opacity:(e.vars||e).palette.action.focusOpacity}}))),sbe=me("span",{name:"MuiCardActionArea",slot:"FocusHighlight"})(Ge(({theme:e})=>({overflow:"hidden",pointerEvents:"none",position:"absolute",top:0,right:0,bottom:0,left:0,borderRadius:"inherit",opacity:0,backgroundColor:"currentcolor",transition:e.transitions.create("opacity",{duration:e.transitions.duration.short})}))),ku=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCardActionArea"}),{children:i,className:o,focusVisibleClassName:s,slots:a={},slotProps:l={},...c}=r,u=r,f=ibe(u),p={slots:a,slotProps:l},[g,y]=ut("root",{elementType:obe,externalForwardedProps:{...p,...c},shouldForwardComponentProp:!0,ownerState:u,ref:n,className:Te(f.root,o),additionalProps:{focusVisibleClassName:Te(s,f.focusVisible)}}),[b,v]=ut("focusHighlight",{elementType:sbe,externalForwardedProps:p,ownerState:u,className:f.focusHighlight});return h.jsxs(g,{...y,children:[i,h.jsx(b,{...v})]})});function abe(e){return Qe("MuiCardContent",e)}tt("MuiCardContent",["root"]);const lbe=e=>{const{classes:t}=e;return et({root:["root"]},abe,t)},cbe=me("div",{name:"MuiCardContent",slot:"Root"})({padding:16,"&:last-child":{paddingBottom:24}}),Gn=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCardContent"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=lbe(a);return h.jsx(cbe,{as:o,className:Te(l.root,i),ownerState:a,ref:n,...s})}),cw=_.createContext(void 0);function ml(){return _.useContext(cw)}function ube(e){return Qe("PrivateSwitchBase",e)}tt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const dbe=e=>{const{classes:t,checked:n,disabled:r,edge:i}=e,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${ye(i)}`],input:["input"]};return et(o,ube,t)},fbe=me(va,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),hbe=me("input",{name:"MuiSwitchBase",shouldForwardProp:Bi})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),ZO=_.forwardRef(function(t,n){const{autoFocus:r,checked:i,checkedIcon:o,defaultChecked:s,disabled:a,disableFocusRipple:l=!1,edge:c=!1,icon:u,id:f,inputProps:p,inputRef:g,name:y,onBlur:b,onChange:v,onFocus:S,readOnly:C,required:w=!1,tabIndex:A,type:E,value:D,slots:O={},slotProps:T={},...I}=t,[L,$]=Za({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),R=ml(),F=Y=>{S&&S(Y),R&&R.onFocus&&R.onFocus(Y)},P=Y=>{b&&b(Y),R&&R.onBlur&&R.onBlur(Y)},z=Y=>{if(Y.nativeEvent.defaultPrevented||C)return;const J=Y.target.checked;$(J),v&&v(Y,J)};let N=a;R&&typeof N>"u"&&(N=R.disabled);const V=E==="checkbox"||E==="radio",U={...t,checked:L,disabled:N,disableFocusRipple:l,edge:c},K=dbe(U),X={slots:O,slotProps:{input:p,...T}},[B,W]=ut("root",{ref:n,elementType:fbe,className:K.root,shouldForwardComponentProp:!0,externalForwardedProps:{...X,component:"span",...I},getSlotProps:Y=>({...Y,onFocus:J=>{Y.onFocus?.(J),F(J)},onBlur:J=>{Y.onBlur?.(J),P(J)}}),ownerState:U,additionalProps:{centerRipple:!0,focusRipple:!l,role:void 0,tabIndex:null}}),[q,H]=ut("input",{ref:g,elementType:hbe,className:K.input,externalForwardedProps:X,getSlotProps:Y=>({...Y,onChange:J=>{Y.onChange?.(J),z(J)}}),ownerState:U,additionalProps:{autoFocus:r,checked:i,defaultChecked:s,disabled:N,id:V?f:void 0,name:y,readOnly:C,required:w,tabIndex:A,type:E,...E==="checkbox"&&D===void 0?{}:{value:D}}});return h.jsxs(B,{...W,children:[h.jsx(q,{...H}),L?o:u]})}),pbe=ke(h.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})),mbe=ke(h.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"})),gbe=ke(h.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}));function ybe(e){return Qe("MuiCheckbox",e)}const $7=tt("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),bbe=e=>{const{classes:t,indeterminate:n,color:r,size:i}=e,o={root:["root",n&&"indeterminate",`color${ye(r)}`,`size${ye(i)}`]},s=et(o,ybe,t);return{...t,...s}},vbe=me(ZO,{shouldForwardProp:e=>Bi(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${ye(n.size)}`],n.color!=="default"&&t[`color${ye(n.color)}`]]}})(Ge(({theme:e})=>({color:(e.vars||e).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity)}}},...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t,disableRipple:!1},style:{"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}}})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{[`&.${$7.checked}, &.${$7.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${$7.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),xbe=h.jsx(mbe,{}),Sbe=h.jsx(pbe,{}),wbe=h.jsx(gbe,{}),Wa=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCheckbox"}),{checkedIcon:i=xbe,color:o="primary",icon:s=Sbe,indeterminate:a=!1,indeterminateIcon:l=wbe,inputProps:c,size:u="medium",disableRipple:f=!1,className:p,slots:g={},slotProps:y={},...b}=r,v=a?l:s,S=a?l:i,C={...r,disableRipple:f,color:o,indeterminate:a,size:u},w=bbe(C),A=y.input??c,[E,D]=ut("root",{ref:n,elementType:vbe,className:Te(w.root,p),shouldForwardComponentProp:!0,externalForwardedProps:{slots:g,slotProps:y,...b},ownerState:C,additionalProps:{type:"checkbox",icon:_.cloneElement(v,{fontSize:v.props.fontSize??u}),checkedIcon:_.cloneElement(S,{fontSize:S.props.fontSize??u}),disableRipple:f,slots:g,slotProps:{input:BO(typeof A=="function"?A(C):A,{"data-indeterminate":a})}}});return h.jsx(E,{...D,classes:w})}),Cbe=ke(h.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function Ebe(e){return Qe("MuiChip",e)}const An=tt("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Abe=e=>{const{classes:t,disabled:n,size:r,color:i,iconColor:o,onDelete:s,clickable:a,variant:l}=e,c={root:["root",l,n&&"disabled",`size${ye(r)}`,`color${ye(i)}`,a&&"clickable",a&&`clickableColor${ye(i)}`,s&&"deletable",s&&`deletableColor${ye(i)}`,`${l}${ye(i)}`],label:["label",`label${ye(r)}`],avatar:["avatar",`avatar${ye(r)}`,`avatarColor${ye(i)}`],icon:["icon",`icon${ye(r)}`,`iconColor${ye(o)}`],deleteIcon:["deleteIcon",`deleteIcon${ye(r)}`,`deleteIconColor${ye(i)}`,`deleteIcon${ye(l)}Color${ye(i)}`]};return et(c,Ebe,t)},kbe=me("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:i,clickable:o,onDelete:s,size:a,variant:l}=n;return[{[`& .${An.avatar}`]:t.avatar},{[`& .${An.avatar}`]:t[`avatar${ye(a)}`]},{[`& .${An.avatar}`]:t[`avatarColor${ye(r)}`]},{[`& .${An.icon}`]:t.icon},{[`& .${An.icon}`]:t[`icon${ye(a)}`]},{[`& .${An.icon}`]:t[`iconColor${ye(i)}`]},{[`& .${An.deleteIcon}`]:t.deleteIcon},{[`& .${An.deleteIcon}`]:t[`deleteIcon${ye(a)}`]},{[`& .${An.deleteIcon}`]:t[`deleteIconColor${ye(r)}`]},{[`& .${An.deleteIcon}`]:t[`deleteIcon${ye(l)}Color${ye(r)}`]},t.root,t[`size${ye(a)}`],t[`color${ye(r)}`],o&&t.clickable,o&&r!=="default"&&t[`clickableColor${ye(r)}`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${ye(r)}`],t[l],t[`${l}${ye(r)}`]]}})(Ge(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${An.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${An.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${An.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${An.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${An.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${An.icon}`]:{marginLeft:5,marginRight:-6},[`& .${An.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${An.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${An.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Bn(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${An.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].contrastText}}}})),{props:n=>n.iconColor===n.color,style:{[`& .${An.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${An.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${An.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(Bn(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${An.focusVisible}`]:{background:(e.vars||e).palette[n].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${An.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(Bn(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${An.focusVisible}`]:{backgroundColor:(e.vars||e).palette[n].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${An.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${An.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${An.avatar}`]:{marginLeft:4},[`& .${An.avatarSmall}`]:{marginLeft:2},[`& .${An.icon}`]:{marginLeft:4},[`& .${An.iconSmall}`]:{marginLeft:2},[`& .${An.deleteIcon}`]:{marginRight:5},[`& .${An.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Bn()).map(([n])=>({props:{variant:"outlined",color:n},style:{color:(e.vars||e).palette[n].main,border:`1px solid ${e.alpha((e.vars||e).palette[n].main,.7)}`,[`&.${An.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${An.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${An.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),_be=me("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${ye(r)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function LF(e){return e.key==="Backspace"||e.key==="Delete"}const vt=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiChip"}),{avatar:i,className:o,clickable:s,color:a="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:p,onClick:g,onDelete:y,onKeyDown:b,onKeyUp:v,size:S="medium",variant:C="filled",tabIndex:w,skipFocusWhenDisabled:A=!1,slots:E={},slotProps:D={},...O}=r,T=_.useRef(null),I=Mr(T,n),L=J=>{J.stopPropagation(),y(J)},$=J=>{J.currentTarget===J.target&&LF(J)&&J.preventDefault(),b&&b(J)},R=J=>{J.currentTarget===J.target&&y&&LF(J)&&y(J),v&&v(J)},F=s!==!1&&g?!0:s,P=F||y?va:l||"div",z={...r,component:P,disabled:u,size:S,color:a,iconColor:_.isValidElement(f)&&f.props.color||a,onDelete:!!y,clickable:F,variant:C},N=Abe(z),V=P===va?{component:l||"div",focusVisibleClassName:N.focusVisible,...y&&{disableRipple:!0}}:{};let U=null;y&&(U=c&&_.isValidElement(c)?_.cloneElement(c,{className:Te(c.props.className,N.deleteIcon),onClick:L}):h.jsx(Cbe,{className:N.deleteIcon,onClick:L}));let K=null;i&&_.isValidElement(i)&&(K=_.cloneElement(i,{className:Te(N.avatar,i.props.className)}));let X=null;f&&_.isValidElement(f)&&(X=_.cloneElement(f,{className:Te(N.icon,f.props.className)}));const B={slots:E,slotProps:D},[W,q]=ut("root",{elementType:kbe,externalForwardedProps:{...B,...O},ownerState:z,shouldForwardComponentProp:!0,ref:I,className:Te(N.root,o),additionalProps:{disabled:F&&u?!0:void 0,tabIndex:A&&u?-1:w,...V},getSlotProps:J=>({...J,onClick:te=>{J.onClick?.(te),g?.(te)},onKeyDown:te=>{J.onKeyDown?.(te),$(te)},onKeyUp:te=>{J.onKeyUp?.(te),R(te)}})}),[H,Y]=ut("label",{elementType:_be,externalForwardedProps:B,ownerState:z,className:N.label});return h.jsxs(W,{as:P,...q,children:[K||X,h.jsx(H,{...Y,children:p}),U]})});function NF(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Y4(e,t=!1){return e&&(NF(e.value)&&e.value!==""||t&&NF(e.defaultValue)&&e.defaultValue!=="")}function Dbe(e){return e.startAdornment}function Obe(e){return Qe("MuiFormControl",e)}tt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Tbe=e=>{const{classes:t,margin:n,fullWidth:r}=e,i={root:["root",n!=="none"&&`margin${ye(n)}`,r&&"fullWidth"]};return et(i,Obe,t)},Mbe=me("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${ye(n.margin)}`],n.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),ha=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiFormControl"}),{children:i,className:o,color:s="primary",component:a="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:p=!1,margin:g="none",required:y=!1,size:b="medium",variant:v="outlined",...S}=r,C={...r,color:s,component:a,disabled:l,error:c,fullWidth:f,hiddenLabel:p,margin:g,required:y,size:b,variant:v},w=Tbe(C),[A,E]=_.useState(()=>{let z=!1;return i&&_.Children.forEach(i,N=>{if(!oy(N,["Input","Select"]))return;const V=oy(N,["Select"])?N.props.input:N;V&&Dbe(V.props)&&(z=!0)}),z}),[D,O]=_.useState(()=>{let z=!1;return i&&_.Children.forEach(i,N=>{oy(N,["Input","Select"])&&(Y4(N.props,!0)||Y4(N.props.inputProps,!0))&&(z=!0)}),z}),[T,I]=_.useState(!1);l&&T&&I(!1);const L=u!==void 0&&!l?u:T;let $;_.useRef(!1);const R=_.useCallback(()=>{O(!0)},[]),F=_.useCallback(()=>{O(!1)},[]),P=_.useMemo(()=>({adornedStart:A,setAdornedStart:E,color:s,disabled:l,error:c,filled:D,focused:L,fullWidth:f,hiddenLabel:p,size:b,onBlur:()=>{I(!1)},onFocus:()=>{I(!0)},onEmpty:F,onFilled:R,registerEffect:$,required:y,variant:v}),[A,s,l,c,D,L,f,p,$,F,R,y,b,v]);return h.jsx(cw.Provider,{value:P,children:h.jsx(Mbe,{as:a,ownerState:C,className:Te(w.root,o),ref:n,...S,children:i})})});function Rbe(e){return Qe("MuiTypography",e)}const FF=tt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),Ibe={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},jbe=s1e(),Pbe=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=e,a={root:["root",o,e.align!=="inherit"&&`align${ye(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return et(a,Rbe,s)},$be=me("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${ye(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(Ge(({theme:e})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([t,n])=>t!=="inherit"&&n&&typeof n=="object").map(([t,n])=>({props:{variant:t},style:n})),...Object.entries(e.palette).filter(Bn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette?.text||{}).filter(([,t])=>typeof t=="string").map(([t])=>({props:{color:`text${ye(t)}`},style:{color:(e.vars||e).palette.text[t]}})),{props:({ownerState:t})=>t.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:t})=>t.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:t})=>t.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:t})=>t.paragraph,style:{marginBottom:16}}]}))),BF={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},re=_.forwardRef(function(t,n){const{color:r,...i}=ot({props:t,name:"MuiTypography"}),o=!Ibe[r],s=jbe({...i,...o&&{color:r}}),{align:a="inherit",className:l,component:c,gutterBottom:u=!1,noWrap:f=!1,paragraph:p=!1,variant:g="body1",variantMapping:y=BF,...b}=s,v={...s,align:a,color:r,className:l,component:c,gutterBottom:u,noWrap:f,paragraph:p,variant:g,variantMapping:y},S=c||(p?"p":y[g]||BF[g])||"span",C=Pbe(v);return h.jsx($be,{as:S,ref:n,className:Te(C.root,l),...b,ownerState:v,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...b.style}})});function Lbe(e){return Qe("MuiFormControlLabel",e)}const H1=tt("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]);function vf({props:e,states:t,muiFormControl:n}){return t.reduce((r,i)=>(r[i]=e[i],n&&typeof e[i]>"u"&&(r[i]=n[i]),r),{})}const Nbe=e=>{const{classes:t,disabled:n,labelPlacement:r,error:i,required:o}=e,s={root:["root",n&&"disabled",`labelPlacement${ye(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return et(s,Lbe,t)},Fbe=me("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${H1.label}`]:t.label},t.root,t[`labelPlacement${ye(n.labelPlacement)}`]]}})(Ge(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${H1.disabled}`]:{cursor:"default"},[`& .${H1.label}`]:{[`&.${H1.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),Bbe=me("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(Ge(({theme:e})=>({[`&.${H1.error}`]:{color:(e.vars||e).palette.error.main}}))),os=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiFormControlLabel"}),{checked:i,className:o,componentsProps:s={},control:a,disabled:l,disableTypography:c,inputRef:u,label:f,labelPlacement:p="end",name:g,onChange:y,required:b,slots:v={},slotProps:S={},value:C,...w}=r,A=ml(),E=l??a.props.disabled??A?.disabled,D=b??a.props.required,O={disabled:E,required:D};["checked","name","onChange","value","inputRef"].forEach(z=>{typeof a.props[z]>"u"&&typeof r[z]<"u"&&(O[z]=r[z])});const T=vf({props:r,muiFormControl:A,states:["error"]}),I={...r,disabled:E,labelPlacement:p,required:D,error:T.error},L=Nbe(I),$={slots:v,slotProps:{...s,...S}},[R,F]=ut("typography",{elementType:re,externalForwardedProps:$,ownerState:I});let P=f;return P!=null&&P.type!==re&&!c&&(P=h.jsx(R,{component:"span",...F,className:Te(L.label,F?.className),children:P})),h.jsxs(Fbe,{className:Te(L.root,o),ownerState:I,ref:n,...w,children:[_.cloneElement(a,O),D?h.jsxs("div",{children:[P,h.jsxs(Bbe,{ownerState:I,"aria-hidden":!0,className:L.asterisk,children:[" ","*"]})]}):P]})}),it=Sge({createStyledComponent:me("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.container&&t.container]}}),componentName:"MuiGrid",useThemeProps:e=>ot({props:e,name:"MuiGrid"}),useTheme:io});function zbe(e){return Qe("MuiLinearProgress",e)}tt("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const Bk=4,zk=gf`
|
|
148
148
|
0% {
|
|
149
149
|
left: -35%;
|
|
150
150
|
right: 100%;
|
|
@@ -496,4 +496,4 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
496
496
|
To pick up a draggable item, press the space bar.
|
|
497
497
|
While dragging, use the arrow keys to move the item.
|
|
498
498
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
499
|
-
`},blt={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function vlt(e){let{announcements:t=blt,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=ylt}=e;const{announce:o,announcement:s}=plt(),a=cv("DndLiveRegion"),[l,c]=_.useState(!1);if(_.useEffect(()=>{c(!0)},[]),mlt(_.useMemo(()=>({onDragStart(f){let{active:p}=f;o(t.onDragStart({active:p}))},onDragMove(f){let{active:p,over:g}=f;t.onDragMove&&o(t.onDragMove({active:p,over:g}))},onDragOver(f){let{active:p,over:g}=f;o(t.onDragOver({active:p,over:g}))},onDragEnd(f){let{active:p,over:g}=f;o(t.onDragEnd({active:p,over:g}))},onDragCancel(f){let{active:p,over:g}=f;o(t.onDragCancel({active:p,over:g}))}}),[o,t])),!l)return null;const u=Gt.createElement(Gt.Fragment,null,Gt.createElement(flt,{id:r,value:i.draggable}),Gt.createElement(hlt,{id:a,announcement:s}));return n?Rd.createPortal(u,n):u}var Li;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Li||(Li={}));function DS(){}function IK(e,t){return _.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function xlt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const fl=Object.freeze({x:0,y:0});function $le(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Lle(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Slt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function jK(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Nle(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function PK(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const wlt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=PK(t,t.left,t.top),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=$le(PK(l),i);o.push({id:a,data:{droppableContainer:s,value:c}})}}return o.sort(Lle)},Clt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=jK(t),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=jK(l),u=i.reduce((p,g,y)=>p+$le(c[y],g),0),f=Number((u/4).toFixed(4));o.push({id:a,data:{droppableContainer:s,value:f}})}}return o.sort(Lle)};function Elt(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-r,a=o-n;if(r<i&&n<o){const l=t.width*t.height,c=e.width*e.height,u=s*a,f=u/(l+c-u);return Number(f.toFixed(4))}return 0}const Alt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:s}=o,a=n.get(s);if(a){const l=Elt(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(Slt)};function klt(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Fle(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:fl}function _lt(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const Dlt=_lt(1);function Olt(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Tlt(e,t,n){const r=Olt(t);if(!r)return e;const{scaleX:i,scaleY:o,x:s,y:a}=r,l=e.left-s-(1-i)*parseFloat(n),c=e.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,f=o?e.height/o:e.height;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l}}const Mlt={ignoreTransform:!1};function mg(e,t){t===void 0&&(t=Mlt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=ps(e).getComputedStyle(e);c&&(n=Tlt(n,c,u))}const{top:r,left:i,width:o,height:s,bottom:a,right:l}=n;return{top:r,left:i,width:o,height:s,bottom:a,right:l}}function $K(e){return mg(e,{ignoreTransform:!0})}function Rlt(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Ilt(e,t){return t===void 0&&(t=ps(e).getComputedStyle(e)),t.position==="fixed"}function jlt(e,t){t===void 0&&(t=ps(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function QC(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(DI(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!av(i)||Ile(i)||n.includes(i))return n;const o=ps(e).getComputedStyle(i);return i!==e&&jlt(i,o)&&n.push(i),Ilt(i,o)?n:r(i.parentNode)}return e?r(e):n}function Ble(e){const[t]=QC(e,1);return t??null}function ik(e){return!JC||!e?null:hg(e)?e:_I(e)?DI(e)||e===pg(e).scrollingElement?window:av(e)?e:null:null}function zle(e){return hg(e)?e.scrollX:e.scrollLeft}function Hle(e){return hg(e)?e.scrollY:e.scrollTop}function sO(e){return{x:zle(e),y:Hle(e)}}var Zi;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Zi||(Zi={}));function Ule(e){return!JC||!e?!1:e===document.scrollingElement}function Vle(e){const t={x:0,y:0},n=Ule(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const Plt={x:.2,y:.2};function $lt(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=Plt);const{isTop:c,isBottom:u,isLeft:f,isRight:p}=Vle(e),g={x:0,y:0},y={x:0,y:0},b={height:t.height*i.y,width:t.width*i.x};return!c&&o<=t.top+b.height?(g.y=Zi.Backward,y.y=r*Math.abs((t.top+b.height-o)/b.height)):!u&&l>=t.bottom-b.height&&(g.y=Zi.Forward,y.y=r*Math.abs((t.bottom-b.height-l)/b.height)),!p&&a>=t.right-b.width?(g.x=Zi.Forward,y.x=r*Math.abs((t.right-b.width-a)/b.width)):!f&&s<=t.left+b.width&&(g.x=Zi.Backward,y.x=r*Math.abs((t.left+b.width-s)/b.width)),{direction:g,speed:y}}function Llt(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:s}=window;return{top:0,left:0,right:o,bottom:s,width:o,height:s}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Wle(e){return e.reduce((t,n)=>rm(t,sO(n)),fl)}function Nlt(e){return e.reduce((t,n)=>t+zle(n),0)}function Flt(e){return e.reduce((t,n)=>t+Hle(n),0)}function Blt(e,t){if(t===void 0&&(t=mg),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);Ble(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const zlt=[["x",["left","right"],Nlt],["y",["top","bottom"],Flt]];class MI{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=QC(n),i=Wle(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of zlt)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=i[o]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Py{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Hlt(e){const{EventTarget:t}=ps(e);return e instanceof t?e:pg(e)}function ok(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var na;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(na||(na={}));function LK(e){e.preventDefault()}function Ult(e){e.stopPropagation()}var Nn;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Nn||(Nn={}));const qle={start:[Nn.Space,Nn.Enter],cancel:[Nn.Esc],end:[Nn.Space,Nn.Enter,Nn.Tab]},Vlt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Nn.Right:return{...n,x:n.x+25};case Nn.Left:return{...n,x:n.x-25};case Nn.Down:return{...n,y:n.y+25};case Nn.Up:return{...n,y:n.y-25}}};class RI{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Py(pg(n)),this.windowListeners=new Py(ps(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(na.Resize,this.handleCancel),this.windowListeners.add(na.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(na.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Blt(r),n(fl)}handleKeyDown(t){if(TI(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=qle,coordinateGetter:s=Vlt,scrollBehavior:a="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:fl;this.referenceCoordinates||(this.referenceCoordinates=u);const f=s(t,{active:n,context:r.current,currentCoordinates:u});if(f){const p=ib(f,u),g={x:0,y:0},{scrollableAncestors:y}=r.current;for(const b of y){const v=t.code,{isTop:S,isRight:C,isLeft:w,isBottom:A,maxScroll:E,minScroll:D}=Vle(b),O=Llt(b),T={x:Math.min(v===Nn.Right?O.right-O.width/2:O.right,Math.max(v===Nn.Right?O.left:O.left+O.width/2,f.x)),y:Math.min(v===Nn.Down?O.bottom-O.height/2:O.bottom,Math.max(v===Nn.Down?O.top:O.top+O.height/2,f.y))},I=v===Nn.Right&&!C||v===Nn.Left&&!w,L=v===Nn.Down&&!A||v===Nn.Up&&!S;if(I&&T.x!==f.x){const $=b.scrollLeft+p.x,R=v===Nn.Right&&$<=E.x||v===Nn.Left&&$>=D.x;if(R&&!p.y){b.scrollTo({left:$,behavior:a});return}R?g.x=b.scrollLeft-$:g.x=v===Nn.Right?b.scrollLeft-E.x:b.scrollLeft-D.x,g.x&&b.scrollBy({left:-g.x,behavior:a});break}else if(L&&T.y!==f.y){const $=b.scrollTop+p.y,R=v===Nn.Down&&$<=E.y||v===Nn.Up&&$>=D.y;if(R&&!p.x){b.scrollTo({top:$,behavior:a});return}R?g.y=b.scrollTop-$:g.y=v===Nn.Down?b.scrollTop-E.y:b.scrollTop-D.y,g.y&&b.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,rm(ib(f,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}RI.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=qle,onActivation:i}=t,{active:o}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function NK(e){return!!(e&&"distance"in e)}function FK(e){return!!(e&&"delay"in e)}class II{constructor(t,n,r){var i;r===void 0&&(r=Hlt(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:s}=o;this.props=t,this.events=n,this.document=pg(s),this.documentListeners=new Py(this.document),this.listeners=new Py(r),this.windowListeners=new Py(ps(s)),this.initialCoordinates=(i=oO(o))!=null?i:fl,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(na.Resize,this.handleCancel),this.windowListeners.add(na.DragStart,LK),this.windowListeners.add(na.VisibilityChange,this.handleCancel),this.windowListeners.add(na.ContextMenu,LK),this.documentListeners.add(na.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(FK(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(NK(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(na.Click,Ult,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(na.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:s,options:{activationConstraint:a}}=o;if(!i)return;const l=(n=oO(t))!=null?n:fl,c=ib(i,l);if(!r&&a){if(NK(a)){if(a.tolerance!=null&&ok(c,a.tolerance))return this.handleCancel();if(ok(c,a.distance))return this.handleStart()}if(FK(a)&&ok(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Nn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Wlt={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class jI extends II{constructor(t){const{event:n}=t,r=pg(n.target);super(t,Wlt,r)}}jI.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const qlt={move:{name:"mousemove"},end:{name:"mouseup"}};var aO;(function(e){e[e.RightClick=2]="RightClick"})(aO||(aO={}));class Glt extends II{constructor(t){super(t,qlt,pg(t.event.target))}}Glt.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===aO.RightClick?!1:(r?.({event:n}),!0)}}];const sk={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Klt extends II{constructor(t){super(t,sk)}static setup(){return window.addEventListener(sk.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(sk.move.name,t)};function t(){}}}Klt.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var $y;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})($y||($y={}));var OS;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(OS||(OS={}));function Ylt(e){let{acceleration:t,activator:n=$y.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:a=OS.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:f,threshold:p}=e;const g=Zlt({delta:f,disabled:!o}),[y,b]=alt(),v=_.useRef({x:0,y:0}),S=_.useRef({x:0,y:0}),C=_.useMemo(()=>{switch(n){case $y.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case $y.DraggableRect:return i}},[n,i,l]),w=_.useRef(null),A=_.useCallback(()=>{const D=w.current;if(!D)return;const O=v.current.x*S.current.x,T=v.current.y*S.current.y;D.scrollBy(O,T)},[]),E=_.useMemo(()=>a===OS.TreeOrder?[...c].reverse():c,[a,c]);_.useEffect(()=>{if(!o||!c.length||!C){b();return}for(const D of E){if(r?.(D)===!1)continue;const O=c.indexOf(D),T=u[O];if(!T)continue;const{direction:I,speed:L}=$lt(D,T,C,t,p);for(const $ of["x","y"])g[$][I[$]]||(L[$]=0,I[$]=0);if(L.x>0||L.y>0){b(),w.current=D,y(A,s),v.current=L,S.current=I;return}}v.current={x:0,y:0},S.current={x:0,y:0},b()},[t,A,r,b,o,s,JSON.stringify(C),JSON.stringify(g),y,c,E,u,JSON.stringify(p)])}const Xlt={x:{[Zi.Backward]:!1,[Zi.Forward]:!1},y:{[Zi.Backward]:!1,[Zi.Forward]:!1}};function Zlt(e){let{delta:t,disabled:n}=e;const r=iO(t);return lv(i=>{if(n||!r||!i)return Xlt;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Zi.Backward]:i.x[Zi.Backward]||o.x===-1,[Zi.Forward]:i.x[Zi.Forward]||o.x===1},y:{[Zi.Backward]:i.y[Zi.Backward]||o.y===-1,[Zi.Forward]:i.y[Zi.Forward]||o.y===1}}},[n,t,r])}function Jlt(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return lv(i=>{var o;return t==null?null:(o=r??i)!=null?o:null},[r,t])}function Qlt(e,t){return _.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...o]},[]),[e,t])}var sb;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(sb||(sb={}));var lO;(function(e){e.Optimized="optimized"})(lO||(lO={}));const BK=new Map;function ect(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,s]=_.useState(null),{frequency:a,measure:l,strategy:c}=i,u=_.useRef(e),f=v(),p=rb(f),g=_.useCallback(function(S){S===void 0&&(S=[]),!p.current&&s(C=>C===null?S:C.concat(S.filter(w=>!C.includes(w))))},[p]),y=_.useRef(null),b=lv(S=>{if(f&&!n)return BK;if(!S||S===BK||u.current!==e||o!=null){const C=new Map;for(let w of e){if(!w)continue;if(o&&o.length>0&&!o.includes(w.id)&&w.rect.current){C.set(w.id,w.rect.current);continue}const A=w.node.current,E=A?new MI(l(A),A):null;w.rect.current=E,E&&C.set(w.id,E)}return C}return S},[e,o,n,f,l]);return _.useEffect(()=>{u.current=e},[e]),_.useEffect(()=>{f||g()},[n,f]),_.useEffect(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),_.useEffect(()=>{f||typeof a!="number"||y.current!==null||(y.current=setTimeout(()=>{g(),y.current=null},a))},[a,f,g,...r]),{droppableRects:b,measureDroppableContainers:g,measuringScheduled:o!=null};function v(){switch(c){case sb.Always:return!1;case sb.BeforeDragging:return n;default:return!n}}}function Gle(e,t){return lv(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function tct(e,t){return Gle(e,t)}function nct(e){let{callback:t,disabled:n}=e;const r=OI(t),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return _.useEffect(()=>()=>i?.disconnect(),[i]),i}function e8(e){let{callback:t,disabled:n}=e;const r=OI(t),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return _.useEffect(()=>()=>i?.disconnect(),[i]),i}function rct(e){return new MI(mg(e),e)}function zK(e,t,n){t===void 0&&(t=rct);const[r,i]=_.useState(null);function o(){i(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const s=nct({callback(l){if(e)for(const c of l){const{type:u,target:f}=c;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),a=e8({callback:o});return Ec(()=>{o(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function ict(e){const t=Gle(e);return Fle(e,t)}const HK=[];function oct(e){const t=_.useRef(e),n=lv(r=>e?r&&r!==HK&&e&&t.current&&e.parentNode===t.current.parentNode?r:QC(e):HK,[e]);return _.useEffect(()=>{t.current=e},[e]),n}function sct(e){const[t,n]=_.useState(null),r=_.useRef(e),i=_.useCallback(o=>{const s=ik(o.target);s&&n(a=>a?(a.set(s,sO(s)),new Map(a)):null)},[]);return _.useEffect(()=>{const o=r.current;if(e!==o){s(o);const a=e.map(l=>{const c=ik(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,sO(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(o)};function s(a){a.forEach(l=>{const c=ik(l);c?.removeEventListener("scroll",i)})}},[i,e]),_.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>rm(o,s),fl):Wle(e):fl,[e,t])}function UK(e,t){t===void 0&&(t=[]);const n=_.useRef(null);return _.useEffect(()=>{n.current=null},t),_.useEffect(()=>{const r=e!==fl;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ib(e,n.current):fl}function act(e){_.useEffect(()=>{if(!JC)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function lct(e,t){return _.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=s=>{o(s,t)},n},{}),[e,t])}function Kle(e){return _.useMemo(()=>e?Rlt(e):null,[e])}const VK=[];function cct(e,t){t===void 0&&(t=mg);const[n]=e,r=Kle(n?ps(n):null),[i,o]=_.useState(VK);function s(){o(()=>e.length?e.map(l=>Ule(l)?r:new MI(t(l),l)):VK)}const a=e8({callback:s});return Ec(()=>{a?.disconnect(),s(),e.forEach(l=>a?.observe(l))},[e]),i}function uct(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return av(t)?t:e}function dct(e){let{measure:t}=e;const[n,r]=_.useState(null),i=_.useCallback(c=>{for(const{target:u}of c)if(av(u)){r(f=>{const p=t(u);return f?{...f,width:p.width,height:p.height}:p});break}},[t]),o=e8({callback:i}),s=_.useCallback(c=>{const u=uct(c);o?.disconnect(),u&&o?.observe(u),r(u?t(u):null)},[t,o]),[a,l]=_S(s);return _.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const fct=[{sensor:jI,options:{}},{sensor:RI,options:{}}],hct={current:{}},O4={draggable:{measure:$K},droppable:{measure:$K,strategy:sb.WhileDragging,frequency:lO.Optimized},dragOverlay:{measure:mg}};class Ly extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const pct={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ly,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:DS},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:O4,measureDroppableContainers:DS,windowRect:null,measuringScheduled:!1},mct={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:DS,draggableNodes:new Map,over:null,measureDroppableContainers:DS},t8=_.createContext(mct),Yle=_.createContext(pct);function gct(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ly}}}function yct(e,t){switch(t.type){case Li.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Li.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Li.DragEnd:case Li.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Li.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Ly(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Li.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Ly(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case Li.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new Ly(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function bct(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=_.useContext(t8),o=iO(r),s=iO(n?.id);return _.useEffect(()=>{if(!t&&!r&&o&&s!=null){if(!TI(o)||document.activeElement===o.target)return;const a=i.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const f=ult(u);if(f){f.focus();break}}})}},[r,t,i,s,o]),null}function vct(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function xct(e){return _.useMemo(()=>({draggable:{...O4.draggable,...e?.draggable},droppable:{...O4.droppable,...e?.droppable},dragOverlay:{...O4.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Sct(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=_.useRef(!1),{x:s,y:a}=typeof i=="boolean"?{x:i,y:i}:i;Ec(()=>{if(!s&&!a||!t){o.current=!1;return}if(o.current||!r)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const u=n(c),f=Fle(u,r);if(s||(f.x=0),a||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=Ble(c);p&&p.scrollBy({top:f.y,left:f.x})}},[t,s,a,r,n])}const Xle=_.createContext({...fl,scaleX:1,scaleY:1});var Ed;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ed||(Ed={}));const wct=_.memo(function(t){var n,r,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:u=fct,collisionDetection:f=Alt,measuring:p,modifiers:g,...y}=t;const b=_.useReducer(yct,void 0,gct),[v,S]=b,[C,w]=glt(),[A,E]=_.useState(Ed.Uninitialized),D=A===Ed.Initialized,{draggable:{active:O,nodes:T,translate:I},droppable:{containers:L}}=v,$=O!=null?T.get(O):null,R=_.useRef({initial:null,translated:null}),F=_.useMemo(()=>{var Ot;return O!=null?{id:O,data:(Ot=$?.data)!=null?Ot:hct,rect:R}:null},[O,$]),P=_.useRef(null),[z,N]=_.useState(null),[V,U]=_.useState(null),K=rb(y,Object.values(y)),X=cv("DndDescribedBy",s),B=_.useMemo(()=>L.getEnabled(),[L]),W=xct(p),{droppableRects:q,measureDroppableContainers:H,measuringScheduled:Y}=ect(B,{dragging:D,dependencies:[I.x,I.y],config:W.droppable}),J=Jlt(T,O),te=_.useMemo(()=>V?oO(V):null,[V]),ee=yr(),ae=tct(J,W.draggable.measure);Sct({activeNode:O!=null?T.get(O):null,config:ee.layoutShiftCompensation,initialRect:ae,measure:W.draggable.measure});const ue=zK(J,W.draggable.measure,ae),ne=zK(J?J.parentElement:null),Z=_.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=L.getNodeFor((n=Z.current.over)==null?void 0:n.id),se=dct({measure:W.dragOverlay.measure}),fe=(r=se.nodeRef.current)!=null?r:J,be=D?(i=se.rect)!=null?i:ue:null,De=!!(se.nodeRef.current&&se.rect),Oe=ict(De?null:ue),Ke=Kle(fe?ps(fe):null),xe=oct(D?ie??J:null),Le=cct(xe),Me=vct(g,{transform:{x:I.x-Oe.x,y:I.y-Oe.y,scaleX:1,scaleY:1},activatorEvent:V,active:F,activeNodeRect:ue,containerNodeRect:ne,draggingNodeRect:be,over:Z.current.over,overlayNodeRect:se.rect,scrollableAncestors:xe,scrollableAncestorRects:Le,windowRect:Ke}),pt=te?rm(te,I):null,gt=sct(xe),ze=UK(gt),je=UK(gt,[ue]),He=rm(Me,ze),Je=be?Dlt(be,Me):null,nt=F&&Je?f({active:F,collisionRect:Je,droppableRects:q,droppableContainers:B,pointerCoordinates:pt}):null,st=Nle(nt,"id"),[Xe,Lt]=_.useState(null),Nt=De?Me:rm(Me,je),Tt=klt(Nt,(o=Xe?.rect)!=null?o:null,ue),Jn=_.useRef(null),an=_.useCallback((Ot,Pt)=>{let{sensor:tn,options:$n}=Pt;if(P.current==null)return;const ln=T.get(P.current);if(!ln)return;const Ct=Ot.nativeEvent,yn=new tn({active:P.current,activeNode:ln,event:Ct,options:$n,context:Z,onAbort(br){if(!T.get(br))return;const{onDragAbort:ce}=K.current,pe={id:br};ce?.(pe),C({type:"onDragAbort",event:pe})},onPending(br,ei,ce,pe){if(!T.get(br))return;const{onDragPending:Fe}=K.current,Ue={id:br,constraint:ei,initialCoordinates:ce,offset:pe};Fe?.(Ue),C({type:"onDragPending",event:Ue})},onStart(br){const ei=P.current;if(ei==null)return;const ce=T.get(ei);if(!ce)return;const{onDragStart:pe}=K.current,Se={activatorEvent:Ct,active:{id:ei,data:ce.data,rect:R}};Rd.unstable_batchedUpdates(()=>{pe?.(Se),E(Ed.Initializing),S({type:Li.DragStart,initialCoordinates:br,active:ei}),C({type:"onDragStart",event:Se}),N(Jn.current),U(Ct)})},onMove(br){S({type:Li.DragMove,coordinates:br})},onEnd:Qr(Li.DragEnd),onCancel:Qr(Li.DragCancel)});Jn.current=yn;function Qr(br){return async function(){const{active:ce,collisions:pe,over:Se,scrollAdjustedTranslate:Fe}=Z.current;let Ue=null;if(ce&&Fe){const{cancelDrop:bt}=K.current;Ue={activatorEvent:Ct,active:ce,collisions:pe,delta:Fe,over:Se},br===Li.DragEnd&&typeof bt=="function"&&await Promise.resolve(bt(Ue))&&(br=Li.DragCancel)}P.current=null,Rd.unstable_batchedUpdates(()=>{S({type:br}),E(Ed.Uninitialized),Lt(null),N(null),U(null),Jn.current=null;const bt=br===Li.DragEnd?"onDragEnd":"onDragCancel";if(Ue){const rt=K.current[bt];rt?.(Ue),C({type:bt,event:Ue})}})}}},[T]),ct=_.useCallback((Ot,Pt)=>(tn,$n)=>{const ln=tn.nativeEvent,Ct=T.get($n);if(P.current!==null||!Ct||ln.dndKit||ln.defaultPrevented)return;const yn={active:Ct};Ot(tn,Pt.options,yn)===!0&&(ln.dndKit={capturedBy:Pt.sensor},P.current=$n,an(tn,Pt))},[T,an]),Ht=Qlt(u,ct);act(u),Ec(()=>{ue&&A===Ed.Initializing&&E(Ed.Initialized)},[ue,A]),_.useEffect(()=>{const{onDragMove:Ot}=K.current,{active:Pt,activatorEvent:tn,collisions:$n,over:ln}=Z.current;if(!Pt||!tn)return;const Ct={active:Pt,activatorEvent:tn,collisions:$n,delta:{x:He.x,y:He.y},over:ln};Rd.unstable_batchedUpdates(()=>{Ot?.(Ct),C({type:"onDragMove",event:Ct})})},[He.x,He.y]),_.useEffect(()=>{const{active:Ot,activatorEvent:Pt,collisions:tn,droppableContainers:$n,scrollAdjustedTranslate:ln}=Z.current;if(!Ot||P.current==null||!Pt||!ln)return;const{onDragOver:Ct}=K.current,yn=$n.get(st),Qr=yn&&yn.rect.current?{id:yn.id,rect:yn.rect.current,data:yn.data,disabled:yn.disabled}:null,br={active:Ot,activatorEvent:Pt,collisions:tn,delta:{x:ln.x,y:ln.y},over:Qr};Rd.unstable_batchedUpdates(()=>{Lt(Qr),Ct?.(br),C({type:"onDragOver",event:br})})},[st]),Ec(()=>{Z.current={activatorEvent:V,active:F,activeNode:J,collisionRect:Je,collisions:nt,droppableRects:q,draggableNodes:T,draggingNode:fe,draggingNodeRect:be,droppableContainers:L,over:Xe,scrollableAncestors:xe,scrollAdjustedTranslate:He},R.current={initial:be,translated:Je}},[F,J,nt,Je,T,fe,be,q,L,Xe,xe,He]),Ylt({...ee,delta:I,draggingRect:Je,pointerCoordinates:pt,scrollableAncestors:xe,scrollableAncestorRects:Le});const Dn=_.useMemo(()=>({active:F,activeNode:J,activeNodeRect:ue,activatorEvent:V,collisions:nt,containerNodeRect:ne,dragOverlay:se,draggableNodes:T,droppableContainers:L,droppableRects:q,over:Xe,measureDroppableContainers:H,scrollableAncestors:xe,scrollableAncestorRects:Le,measuringConfiguration:W,measuringScheduled:Y,windowRect:Ke}),[F,J,ue,V,nt,ne,se,T,L,q,Xe,H,xe,Le,W,Y,Ke]),Yn=_.useMemo(()=>({activatorEvent:V,activators:Ht,active:F,activeNodeRect:ue,ariaDescribedById:{draggable:X},dispatch:S,draggableNodes:T,over:Xe,measureDroppableContainers:H}),[V,Ht,F,ue,S,X,T,Xe,H]);return Gt.createElement(Ple.Provider,{value:w},Gt.createElement(t8.Provider,{value:Yn},Gt.createElement(Yle.Provider,{value:Dn},Gt.createElement(Xle.Provider,{value:Tt},c)),Gt.createElement(bct,{disabled:a?.restoreFocus===!1})),Gt.createElement(vlt,{...a,hiddenTextDescribedById:X}));function yr(){const Ot=z?.autoScrollEnabled===!1,Pt=typeof l=="object"?l.enabled===!1:l===!1,tn=D&&!Ot&&!Pt;return typeof l=="object"?{...l,enabled:tn}:{enabled:tn}}}),Cct=_.createContext(null),WK="button",Ect="Draggable";function Act(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=cv(Ect),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:p}=_.useContext(t8),{role:g=WK,roleDescription:y="draggable",tabIndex:b=0}=i??{},v=l?.id===t,S=_.useContext(v?Xle:Cct),[C,w]=_S(),[A,E]=_S(),D=lct(s,t),O=rb(n);Ec(()=>(f.set(t,{id:t,key:o,node:C,activatorNode:A,data:O}),()=>{const I=f.get(t);I&&I.key===o&&f.delete(t)}),[f,t]);const T=_.useMemo(()=>({role:g,tabIndex:b,"aria-disabled":r,"aria-pressed":v&&g===WK?!0:void 0,"aria-roledescription":y,"aria-describedby":u.draggable}),[r,g,b,v,y,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:T,isDragging:v,listeners:r?void 0:D,node:C,over:p,setNodeRef:w,setActivatorNodeRef:E,transform:S}}function kct(){return _.useContext(Yle)}const _ct="Droppable",Dct={timeout:25};function Oct(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=cv(_ct),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=_.useContext(t8),u=_.useRef({disabled:n}),f=_.useRef(!1),p=_.useRef(null),g=_.useRef(null),{disabled:y,updateMeasurementsFor:b,timeout:v}={...Dct,...i},S=rb(b??r),C=_.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{c(Array.isArray(S.current)?S.current:[S.current]),g.current=null},v)},[v]),w=e8({callback:C,disabled:y||!s}),A=_.useCallback((T,I)=>{w&&(I&&(w.unobserve(I),f.current=!1),T&&w.observe(T))},[w]),[E,D]=_S(A),O=rb(t);return _.useEffect(()=>{!w||!E.current||(w.disconnect(),f.current=!1,w.observe(E.current))},[E,w]),_.useEffect(()=>(a({type:Li.RegisterDroppable,element:{id:r,key:o,disabled:n,node:E,rect:p,data:O}}),()=>a({type:Li.UnregisterDroppable,key:o,id:r})),[r]),_.useEffect(()=>{n!==u.current.disabled&&(a({type:Li.SetDroppableDisabled,id:r,key:o,disabled:n}),u.current.disabled=n)},[r,o,n,a]),{active:s,rect:p,isOver:l?.id===r,node:E,over:l,setNodeRef:D}}function PI(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Tct(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function _5(e){return e!==null&&e>=0}function Mct(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Rct(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Zle=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=PI(t,r,n),s=t[i],a=o[i];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},D5={scaleX:1,scaleY:1},Ict=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:o,overIndex:s}=e;const a=(t=o[n])!=null?t:r;if(!a)return null;if(i===n){const c=o[s];return c?{x:0,y:n<s?c.top+c.height-(a.top+a.height):c.top-a.top,...D5}:null}const l=jct(o,i,n);return i>n&&i<=s?{x:0,y:-a.height-l,...D5}:i<n&&i>=s?{x:0,y:a.height+l,...D5}:{x:0,y:0,...D5}};function jct(e,t,n){const r=e[t],i=e[t-1],o=e[t+1];return r?n<t?i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const Jle="Sortable",Qle=Gt.createContext({activeIndex:-1,containerId:Jle,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Zle,disabled:{draggable:!1,droppable:!1}});function Pct(e){let{children:t,id:n,items:r,strategy:i=Zle,disabled:o=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=kct(),f=cv(Jle,n),p=a.rect!==null,g=_.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),y=s!=null,b=s?g.indexOf(s.id):-1,v=c?g.indexOf(c.id):-1,S=_.useRef(g),C=!Mct(g,S.current),w=v!==-1&&b===-1||C,A=Rct(o);Ec(()=>{C&&y&&u(g)},[C,g,y,u]),_.useEffect(()=>{S.current=g},[g]);const E=_.useMemo(()=>({activeIndex:b,containerId:f,disabled:A,disableTransforms:w,items:g,overIndex:v,useDragOverlay:p,sortedRects:Tct(g,l),strategy:i}),[b,f,A.draggable,A.droppable,w,g,v,l,p,i]);return Gt.createElement(Qle.Provider,{value:E},t)}const $ct=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return PI(n,r,i).indexOf(t)},Lct=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!r||a!==o&&i===s?!1:n?!0:s!==i&&t===l},Nct={duration:200,easing:"ease"},ece="transform",Fct=ob.Transition.toString({property:ece,duration:0,easing:"linear"}),Bct={roleDescription:"sortable"};function zct(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,s]=_.useState(null),a=_.useRef(n);return Ec(()=>{if(!t&&n!==a.current&&r.current){const l=i.current;if(l){const c=mg(r.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&s(u)}}n!==a.current&&(a.current=n)},[t,n,r,i]),_.useEffect(()=>{o&&s(null)},[o]),o}function Hct(e){let{animateLayoutChanges:t=Lct,attributes:n,disabled:r,data:i,getNewIndex:o=$ct,id:s,strategy:a,resizeObserverConfig:l,transition:c=Nct}=e;const{items:u,containerId:f,activeIndex:p,disabled:g,disableTransforms:y,sortedRects:b,overIndex:v,useDragOverlay:S,strategy:C}=_.useContext(Qle),w=Uct(r,g),A=u.indexOf(s),E=_.useMemo(()=>({sortable:{containerId:f,index:A,items:u},...i}),[f,i,A,u]),D=_.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:O,node:T,isOver:I,setNodeRef:L}=Oct({id:s,data:E,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...l}}),{active:$,activatorEvent:R,activeNodeRect:F,attributes:P,setNodeRef:z,listeners:N,isDragging:V,over:U,setActivatorNodeRef:K,transform:X}=Act({id:s,data:E,attributes:{...Bct,...n},disabled:w.draggable}),B=slt(L,z),W=!!$,q=W&&!y&&_5(p)&&_5(v),H=!S&&V,Y=H&&q?X:null,te=q?Y??(a??C)({rects:b,activeNodeRect:F,activeIndex:p,overIndex:v,index:A}):null,ee=_5(p)&&_5(v)?o({id:s,items:u,activeIndex:p,overIndex:v}):A,ae=$?.id,ue=_.useRef({activeId:ae,items:u,newIndex:ee,containerId:f}),ne=u!==ue.current.items,Z=t({active:$,containerId:f,isDragging:V,isSorting:W,id:s,index:A,items:u,newIndex:ue.current.newIndex,previousItems:ue.current.items,previousContainerId:ue.current.containerId,transition:c,wasDragging:ue.current.activeId!=null}),ie=zct({disabled:!Z,index:A,node:T,rect:O});return _.useEffect(()=>{W&&ue.current.newIndex!==ee&&(ue.current.newIndex=ee),f!==ue.current.containerId&&(ue.current.containerId=f),u!==ue.current.items&&(ue.current.items=u)},[W,ee,f,u]),_.useEffect(()=>{if(ae===ue.current.activeId)return;if(ae!=null&&ue.current.activeId==null){ue.current.activeId=ae;return}const fe=setTimeout(()=>{ue.current.activeId=ae},50);return()=>clearTimeout(fe)},[ae]),{active:$,activeIndex:p,attributes:P,data:E,rect:O,index:A,newIndex:ee,items:u,isOver:I,isSorting:W,isDragging:V,listeners:N,node:T,overIndex:v,over:U,setNodeRef:B,setActivatorNodeRef:K,setDroppableNodeRef:L,setDraggableNodeRef:z,transform:ie??te,transition:se()};function se(){if(ie||ne&&ue.current.newIndex===A)return Fct;if(!(H&&!TI(R)||!c)&&(W||Z))return ob.Transition.toString({...c,property:ece})}}function Uct(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function TS(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Vct=[Nn.Down,Nn.Right,Nn.Up,Nn.Left],Wct=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:s,scrollableAncestors:a}}=t;if(Vct.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const p=i.get(f.id);if(p)switch(e.code){case Nn.Down:r.top<p.top&&l.push(f);break;case Nn.Up:r.top>p.top&&l.push(f);break;case Nn.Left:r.left>p.left&&l.push(f);break;case Nn.Right:r.left<p.left&&l.push(f);break}});const c=Clt({collisionRect:r,droppableRects:i,droppableContainers:l});let u=Nle(c,"id");if(u===s?.id&&c.length>1&&(u=c[1].id),u!=null){const f=o.get(n.id),p=o.get(u),g=p?i.get(p.id):null,y=p?.node.current;if(y&&g&&f&&p){const v=QC(y).some((D,O)=>a[O]!==D),S=tce(f,p),C=qct(f,p),w=v||!S?{x:0,y:0}:{x:C?r.width-g.width:0,y:C?r.height-g.height:0},A={x:g.left,y:g.top};return w.x&&w.y?A:ib(A,w)}}}};function tce(e,t){return!TS(e)||!TS(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function qct(e,t){return!TS(e)||!TS(t)||!tce(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const Gct=({bridge:e,index:t})=>{const{attributes:n,listeners:r,setNodeRef:i,transform:o,transition:s,isDragging:a}=Hct({id:e.id}),[l,c]=_.useState(!1);_.useEffect(()=>{jw(e.id).then(c)},[e.id]);const u={transform:ob.Transform.toString(o),transition:s,opacity:a?.5:1};return h.jsx(Pn,{ref:i,style:u,variant:"outlined",sx:{cursor:"grab","&:active":{cursor:"grabbing"},bgcolor:a?"action.selected":"background.paper",width:"fit-content"},children:h.jsxs(Gn,{sx:{display:"flex",alignItems:"center",gap:1.5,py:1,"&:last-child":{pb:1}},children:[h.jsx(oe,{...n,...r,sx:{display:"flex",alignItems:"center",color:"text.secondary"},children:h.jsx(x8e,{})}),h.jsx(vt,{label:t+1,size:"small",color:"primary",sx:{minWidth:32,fontWeight:"bold"}}),l?h.jsx(oe,{component:"img",src:r2(e.id),alt:e.name,sx:{width:40,height:40,borderRadius:"50%",objectFit:"cover",boxShadow:2}}):h.jsx(sl,{sx:{bgcolor:FT(e),width:40,height:40,boxShadow:2},children:(()=>{const f=NT(e);return h.jsx(f,{sx:{fontSize:24}})})()}),h.jsxs(oe,{sx:{flex:1},children:[h.jsx(re,{variant:"subtitle1",fontWeight:500,children:e.name}),h.jsxs(re,{variant:"caption",color:"text.secondary",children:["Port: ",e.port," • Priority: ",e.priority??100]})]})]})})},Kct=()=>{const e=Ac(),{content:t,isLoading:n}=qm(),r=BCe(),[i,o]=_.useState([]),[s,a]=_.useState(!1);_.useEffect(()=>{if(t){const p=[...t].sort((g,y)=>{const b=g.priority??100,v=y.priority??100;return b-v});o(p),a(!1)}},[t]);const l=xlt(IK(jI),IK(RI,{coordinateGetter:Wct})),c=_.useCallback(p=>{const{active:g,over:y}=p;y&&g.id!==y.id&&(o(b=>{const v=b.findIndex(C=>C.id===g.id),S=b.findIndex(C=>C.id===y.id);return PI(b,v,S)}),a(!0))},[]),u=_.useCallback(async()=>{const p=i.map((g,y)=>({id:g.id,priority:(y+1)*10}));try{await r(p),e.show({message:"Startup order saved successfully",severity:"success"}),a(!1)}catch(g){e.show({message:g instanceof Error?g.message:"Failed to save startup order",severity:"error"})}},[i,r,e]),f=_.useMemo(()=>i.map(p=>p.id),[i]);return n?h.jsx(re,{children:"Loading..."}):h.jsxs(Bt,{spacing:3,children:[h.jsx(vb,{items:[{name:"Bridges",to:_t.bridges},{name:"Startup Order",to:_t.startup}]}),h.jsxs(oe,{display:"flex",alignItems:"center",gap:2,children:[h.jsx(Vm,{color:"primary",fontSize:"large"}),h.jsxs(oe,{children:[h.jsx(re,{variant:"h5",fontWeight:600,children:"Startup Order"}),h.jsx(re,{variant:"body2",color:"text.secondary",children:"Drag and drop bridges to set the startup order. Lower positions start first."})]})]}),s&&h.jsx(Ut,{severity:"info",action:h.jsx(lt,{color:"inherit",size:"small",startIcon:h.jsx(o6,{}),onClick:u,children:"Save Changes"}),children:"You have unsaved changes to the startup order."}),h.jsx(wct,{sensors:l,collisionDetection:wlt,onDragEnd:c,children:h.jsx(Pct,{items:f,strategy:Ict,children:h.jsx(Bt,{spacing:1,children:i.map((p,g)=>h.jsx(Gct,{bridge:p,index:g},p.id))})})}),i.length===0&&h.jsx(re,{color:"text.secondary",textAlign:"center",py:4,children:"No bridges configured yet."}),s&&i.length>0&&h.jsx(oe,{display:"flex",justifyContent:"flex-end",children:h.jsx(lt,{variant:"contained",startIcon:h.jsx(o6,{}),onClick:u,children:"Save Startup Order"})})]})},ak="https://riddix.github.io/home-assistant-matter-hub",_t={dashboard:"/",bridges:"/bridges",bridge:e=>`/bridges/${e}`,createBridge:"/bridges/create",areaSetup:"/bridges/area-setup",editBridge:e=>`/bridges/${e}/edit`,devices:"/devices",networkMap:"/network-map",health:"/health",labels:"/labels",lockCredentials:"/lock-credentials",settings:"/settings",startup:"/startup",githubRepository:"https://github.com/riddix/home-assistant-matter-hub/",documentation:ak,faq:{multiFabric:`${ak}/connect-multiple-fabrics`,bridgeConfig:`${ak}/bridge-configuration`}},Yct=[{path:"",element:h.jsx(B2e,{}),children:[{path:"",element:h.jsx(P9e,{})},{path:_t.bridges,element:h.jsx(O9e,{})},{path:_t.createBridge,element:h.jsx(Aet,{})},{path:_t.areaSetup,element:h.jsx(gve,{})},{path:_t.bridge(":bridgeId"),element:h.jsx(n8e,{})},{path:_t.editBridge(":bridgeId"),element:h.jsx(ket,{})},{path:_t.devices,element:h.jsx(Q9e,{})},{path:_t.networkMap,element:h.jsx(elt,{})},{path:_t.health,element:h.jsx(Iet,{})},{path:_t.labels,element:h.jsx(Let,{})},{path:_t.lockCredentials,element:h.jsx(Uet,{})},{path:_t.settings,element:h.jsx(olt,{})},{path:_t.startup,element:h.jsx(Kct,{})},{path:"*",element:h.jsx(Vet,{})}]}],Xct={items:{isInitialized:!1,isLoading:!1}},Zct=YO(Xct,e=>{e.addCase(ko.pending,t=>{t.items.isLoading=!0}).addCase(ko.rejected,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=void 0,t.items.error=n.error}).addCase(ko.fulfilled,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=n.payload,t.items.error=void 0}).addCase(GX.fulfilled,(t,n)=>{t.items.content?.push(n.payload)}).addCase(YX.fulfilled,(t,n)=>{const r=t.items.content?.findIndex(i=>i.id===n.payload.id)??-1;r!==-1&&(t.items.content[r]=n.payload)}).addCase(XX.fulfilled,(t,n)=>{const r=t.items.content?.findIndex(i=>i.id===n.payload.id)??-1;r!==-1&&(t.items.content[r]=n.payload)}).addCase(KX.fulfilled,(t,n)=>{if(t.items.content){const r=t.items.content.findIndex(i=>i.id===n.meta.arg);r!==-1&&t.items.content.splice(r,1)}}).addCase(ZX,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=n.payload,t.items.error=void 0}).addCase(JX,(t,n)=>{if(t.items.content){const r=t.items.content.findIndex(i=>i.id===n.payload.id);r!==-1?t.items.content[r]=n.payload:t.items.content.push(n.payload)}})}),Jct={byBridge:{}},Qct=YO(Jct,e=>{e.addCase(vu.pending,(t,n)=>{t.byBridge[n.meta.arg]=lk(t.byBridge[n.meta.arg],n)}).addCase(vu.rejected,(t,n)=>{t.byBridge[n.meta.arg]=lk(t.byBridge[n.meta.arg],n)}).addCase(vu.fulfilled,(t,n)=>{t.byBridge[n.meta.arg]=lk(t.byBridge[n.meta.arg],n)})}),eut={isInitialized:!1,isLoading:!1,content:void 0,error:void 0},lk=YO(eut,e=>{e.addCase(vu.pending,t=>{t.isLoading=!0}).addCase(vu.rejected,(t,n)=>{t.isInitialized=!0,t.isLoading=!1,t.content=void 0,t.error=n.error}).addCase(vu.fulfilled,(t,n)=>{t.isInitialized=!0,t.isLoading=!1,t.content=n.payload,t.error=void 0})}),tut=w2e({reducer:{bridges:Zct,devices:Qct}}),$I=oge({createStyledComponent:me("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${ye(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),useThemeProps:e=>ot({props:e,name:"MuiContainer"})});function nut(e){return Qe("MuiToolbar",e)}tt("MuiToolbar",["root","gutters","regular","dense"]);const rut=e=>{const{classes:t,disableGutters:n,variant:r}=e;return et({root:["root",!n&&"gutters",r]},nut,t)},iut=me("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(Ge(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),nce=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular",...l}=r,c={...r,component:o,disableGutters:s,variant:a},u=rut(c);return h.jsx(iut,{as:o,className:Te(u.root,i),ref:n,ownerState:c,...l})});class out extends _.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("ErrorBoundary caught:",t,n.componentStack)}render(){return this.state.hasError?h.jsxs(oe,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"60vh",gap:2,p:4,children:[h.jsx(aT,{color:"error",sx:{fontSize:64}}),h.jsx(re,{variant:"h5",fontWeight:600,children:"Something went wrong"}),h.jsx(re,{variant:"body2",color:"text.secondary",textAlign:"center",maxWidth:480,children:this.state.error?.message??"An unexpected error occurred."}),h.jsx(lt,{variant:"contained",onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},children:"Reload Page"})]}):this.props.children}}const sut="home-assistant-matter-hub",aut={name:sut};function rce(){const e="2.1.0-alpha.451",[t,n]=_.useState(null);_.useEffect(()=>{fetch("api/health").then(i=>i.ok?i.json():null).then(i=>{i?.version&&n(i.version)}).catch(()=>{})},[]);const r=_.useMemo(()=>!t||e==="0.0.0-dev"?!1:e!==t,[t]);return _.useMemo(()=>({name:aut.name,version:t??e,frontendVersion:e,backendVersion:t,versionMismatch:r}),[t,r])}const lut=[{name:"GitHub",url:_t.githubRepository},{name:"Documentation",url:_t.documentation}],cut=()=>h.jsxs($I,{sx:{mt:16,mb:4},children:[h.jsx(li,{sx:{mt:4,mb:4}}),h.jsx(it,{container:!0,spacing:2,justifyContent:"center",children:lut.map((e,t)=>h.jsx(it,{size:{xs:12,sm:"auto"},children:h.jsx(lt,{fullWidth:!0,size:"small",variant:"outlined",component:uw,href:e.url,target:"_blank",children:e.name})},t.toString()))})]});function uut(e){return Qe("MuiAppBar",e)}tt("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const dut=e=>{const{color:t,position:n,classes:r}=e,i={root:["root",`color${ye(t)}`,`position${ye(n)}`]};return et(i,uut,r)},qK=(e,t)=>e?`${e.replace(")","")}, ${t})`:t,fut=me(Ur,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${ye(n.position)}`],t[`color${ye(n.color)}`]]}})(Ge(({theme:e})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit",color:"var(--AppBar-color)"}},{props:{color:"default"},style:{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[100],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[100]),...e.applyStyles("dark",{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[900],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[900])})}},...Object.entries(e.palette).filter(Bn(["contrastText"])).map(([t])=>({props:{color:t},style:{"--AppBar-background":(e.vars??e).palette[t].main,"--AppBar-color":(e.vars??e).palette[t].contrastText}})),{props:t=>t.enableColorOnDark===!0&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:t=>t.enableColorOnDark===!1&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundColor:e.vars?qK(e.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:e.vars?qK(e.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundImage:"none"})}}]}))),hut=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed",...l}=r,c={...r,color:o,position:a,enableColorOnDark:s},u=dut(c);return h.jsx(fut,{square:!0,component:"header",ownerState:c,elevation:4,className:Te(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});function put(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=rl(t);let s;if(t.fakeTransform)s=t.fakeTransform;else{const c=o.getComputedStyle(t);s=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){const c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}return e==="left"?i?`translateX(${i.right+a-r.left}px)`:`translateX(${o.innerWidth+a-r.left}px)`:e==="right"?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}px)`:e==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function mut(e){return typeof e=="function"?e():e}function O5(e,t,n){const r=mut(n),i=put(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const gut=_.forwardRef(function(t,n){const r=io(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:l,container:c,direction:u="down",easing:f=i,in:p,onEnter:g,onEntered:y,onEntering:b,onExit:v,onExited:S,onExiting:C,style:w,timeout:A=o,TransitionComponent:E=Ma,...D}=t,O=_.useRef(null),T=Mr(bf(l),O,n),I=U=>K=>{U&&(K===void 0?U(O.current):U(O.current,K))},L=I((U,K)=>{O5(u,U,c),UO(U),g&&g(U,K)}),$=I((U,K)=>{const X=Jd({timeout:A,style:w,easing:f},{mode:"enter"});U.style.webkitTransition=r.transitions.create("-webkit-transform",{...X}),U.style.transition=r.transitions.create("transform",{...X}),U.style.webkitTransform="none",U.style.transform="none",b&&b(U,K)}),R=I(y),F=I(C),P=I(U=>{const K=Jd({timeout:A,style:w,easing:f},{mode:"exit"});U.style.webkitTransition=r.transitions.create("-webkit-transform",K),U.style.transition=r.transitions.create("transform",K),O5(u,U,c),v&&v(U)}),z=I(U=>{U.style.webkitTransition="",U.style.transition="",S&&S(U)}),N=U=>{s&&s(O.current,U)},V=_.useCallback(()=>{O.current&&O5(u,O.current,c)},[u,c]);return _.useEffect(()=>{if(p||u==="down"||u==="right")return;const U=FO(()=>{O.current&&O5(u,O.current,c)}),K=rl(O.current);return K.addEventListener("resize",U),()=>{U.clear(),K.removeEventListener("resize",U)}},[u,p,c]),_.useEffect(()=>{p||V()},[p,V]),h.jsx(E,{nodeRef:O,onEnter:L,onEntered:R,onEntering:$,onExit:P,onExited:z,onExiting:F,addEndListener:N,appear:a,in:p,timeout:A,...D,children:(U,{ownerState:K,...X})=>_.cloneElement(l,{ref:T,style:{visibility:U==="exited"&&!p?"hidden":void 0,...w,...l.props.style},...X})})});function yut(e){return Qe("MuiDrawer",e)}tt("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const ice=(e,t)=>{const{ownerState:n}=e;return[t.root,(n.variant==="permanent"||n.variant==="persistent")&&t.docked,n.variant==="temporary"&&t.modal]},but=e=>{const{classes:t,anchor:n,variant:r}=e,i={root:["root",`anchor${ye(n)}`],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${ye(n)}`,r!=="temporary"&&`paperAnchorDocked${ye(n)}`]};return et(i,yut,t)},vut=me(uT,{name:"MuiDrawer",slot:"Root",overridesResolver:ice})(Ge(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),xut=me("div",{shouldForwardProp:Bi,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:ice})({flex:"0 0 auto"}),Sut=me(Ur,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`paperAnchor${ye(n.anchor)}`],n.variant!=="temporary"&&t[`paperAnchorDocked${ye(n.anchor)}`]]}})(Ge(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:t})=>t.anchor==="left"&&t.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="top"&&t.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="right"&&t.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="bottom"&&t.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),oce={left:"right",right:"left",top:"down",bottom:"up"};function wut(e){return["left","right"].includes(e)}function Cut({direction:e},t){return e==="rtl"&&wut(t)?oce[t]:t}const Eut=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiDrawer"}),i=io(),o=yf(),s={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:l,children:c,className:u,elevation:f=16,hideBackdrop:p=!1,ModalProps:{BackdropProps:g,...y}={},onClose:b,open:v=!1,PaperProps:S={},SlideProps:C,TransitionComponent:w,transitionDuration:A=s,variant:E="temporary",slots:D={},slotProps:O={},...T}=r,I=_.useRef(!1);_.useEffect(()=>{I.current=!0},[]);const L=Cut({direction:o?"rtl":"ltr"},a),R={...r,anchor:a,elevation:f,open:v,variant:E,...T},F=but(R),P={slots:{transition:w,...D},slotProps:{paper:S,transition:C,...O,backdrop:BO(O.backdrop||{...l,...g},{transitionDuration:A})}},[z,N]=ut("root",{ref:n,elementType:vut,className:Te(F.root,F.modal,u),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...P,...T,...y},additionalProps:{open:v,onClose:b,hideBackdrop:p,slots:{backdrop:P.slots.backdrop},slotProps:{backdrop:P.slotProps.backdrop}}}),[V,U]=ut("paper",{elementType:Sut,shouldForwardComponentProp:!0,className:Te(F.paper,S.className),ownerState:R,externalForwardedProps:P,additionalProps:{elevation:E==="temporary"?f:0,square:!0,...E==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[K,X]=ut("docked",{elementType:xut,ref:n,className:Te(F.root,F.docked,u),ownerState:R,externalForwardedProps:P,additionalProps:T}),[B,W]=ut("transition",{elementType:gut,ownerState:R,externalForwardedProps:P,additionalProps:{in:v,direction:oce[L],timeout:A,appear:I.current}}),q=h.jsx(V,{...U,children:c});if(E==="permanent")return h.jsx(K,{...X,children:q});const H=h.jsx(B,{...W,children:q});return E==="persistent"?h.jsx(K,{...X,children:H}):h.jsx(z,{...N,children:H})}),Aut=rX({themeId:fa}),kut={error:Sf,warn:dw,info:lT,debug:Mw},_ut=({open:e,onClose:t})=>{const n=io(),r=_.useMemo(()=>({error:n.palette.error.main,warn:n.palette.warning.main,info:n.palette.info.main,debug:n.palette.secondary.main}),[n]),[i,o]=_.useState([]),[s,a]=_.useState(!0),[l,c]=_.useState("error,warn,info".split(",")),[u,f]=_.useState(""),[p,g]=_.useState(!0),y=_.useCallback(async()=>{try{const w=new URLSearchParams({level:l.join(","),limit:"500",...u&&{search:u}}),A=await fetch(`api/logs?${w}`);if(A.ok){const E=await A.json();o(E.entries)}}catch(w){console.error("Failed to fetch logs:",w)}finally{a(!1)}},[l,u]);_.useEffect(()=>{e&&y()},[e,y]),_.useEffect(()=>{if(!p||!e)return;const w=setInterval(y,5e3);return()=>clearInterval(w)},[p,e,y]);const b=w=>{c(Array.isArray(w.target.value)?w.target.value:[w.target.value])},v=w=>{f(w.target.value)},S=async()=>{try{await fetch("api/logs",{method:"DELETE"}),o([])}catch(w){console.error("Failed to clear logs:",w)}},C=w=>{const A=kut[w]||lT;return h.jsx(A,{sx:{fontSize:16,color:r[w]}})};return h.jsxs(al,{open:e,onClose:t,maxWidth:"lg",fullWidth:!0,children:[h.jsxs(cl,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(Mw,{}),"System Logs",h.jsx(oe,{sx:{flexGrow:1}}),h.jsx(Qt,{title:"Auto Refresh",children:h.jsx(vt,{label:p?"Auto":"Manual",color:p?"success":"default",size:"small",onClick:()=>g(!p),sx:{cursor:"pointer"}})}),h.jsx(en,{onClick:t,children:h.jsx(DJ,{})})]}),h.jsxs(ll,{children:[h.jsx(Bt,{spacing:2,sx:{mb:2},children:h.jsxs(Bt,{direction:"row",spacing:2,alignItems:"center",children:[h.jsxs(ha,{size:"small",sx:{minWidth:200},children:[h.jsx(fc,{children:"Log Level"}),h.jsxs(aa,{value:l,label:"Log Level",onChange:b,multiple:!0,renderValue:w=>h.jsx(oe,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:(Array.isArray(w)?w:[w]).map(A=>h.jsx(vt,{label:A.toUpperCase(),size:"small",sx:{backgroundColor:r[A],color:"white"}},A))}),children:[h.jsx(nr,{value:"error",children:"Error"}),h.jsx(nr,{value:"warn",children:"Warning"}),h.jsx(nr,{value:"info",children:"Info"}),h.jsx(nr,{value:"debug",children:"Debug"})]})]}),h.jsx(Nr,{size:"small",placeholder:"Search logs...",value:u,onChange:v,sx:{flexGrow:1}}),h.jsx(lt,{variant:"outlined",onClick:y,children:"Refresh"}),h.jsx(lt,{variant:"outlined",color:"error",onClick:S,children:"Clear"})]})}),h.jsx(oe,{sx:{height:400,overflow:"auto",backgroundColor:"background.paper",border:1,borderColor:"divider",borderRadius:1,p:1},children:s?h.jsx(oe,{sx:{display:"flex",justifyContent:"center",p:4},children:h.jsx(re,{children:"Loading logs..."})}):i.length===0?h.jsx(oe,{sx:{display:"flex",justifyContent:"center",p:4},children:h.jsx(re,{color:"text.secondary",children:"No logs found"})}):h.jsx(Bt,{spacing:1,children:i.map((w,A)=>h.jsxs(oe,{sx:{p:1,borderRadius:1,backgroundColor:"action.hover",fontFamily:"monospace",fontSize:"0.875rem",wordBreak:"break-all"},children:[h.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[C(w.level),h.jsx(re,{variant:"caption",color:"text.secondary",children:new Date(w.timestamp).toLocaleString()}),h.jsx(vt,{label:w.level.toUpperCase(),size:"small",sx:{backgroundColor:r[w.level],color:n.palette.getContrastText(r[w.level]??n.palette.grey[500]),fontSize:"0.7rem",height:20}})]}),h.jsx(re,{sx:{ml:3},children:w.message}),w.context&&h.jsx(re,{sx:{ml:3,color:"text.secondary",fontSize:"0.8rem"},children:JSON.stringify(w.context,null,2)})]},`${w.timestamp}-${w.level}-${A}`))})})]}),h.jsx(vc,{children:h.jsx(lt,{onClick:t,children:"Close"})})]})};function GK(){const{isConnected:e}=eZ(),[t,n]=_.useState(null),[r,i]=_.useState(!1);_.useEffect(()=>{const y=async()=>{try{const v=await fetch("api/health");if(v.ok){const S=await v.json();n(S),i(!1)}else i(!0)}catch{i(!0)}};y();const b=setInterval(y,3e4);return()=>clearInterval(b)},[]);const o=y=>{const b=Math.floor(y/3600),v=Math.floor(y%3600/60);return b>0?`${b}h ${v}m`:`${v}m`},s=t?.status==="healthy"&&!r,a=t?.services?.bridges,l=a&&a.total>0&&a.running===a.total,c=a&&a.total===0,u=t?h.jsxs(oe,{sx:{p:.5},children:[h.jsxs("div",{children:[h.jsx("strong",{children:"Version:"})," ",t.version??"Unknown"]}),h.jsxs("div",{children:[h.jsx("strong",{children:"Uptime:"})," ",o(t.uptime??0)]}),t.services?.bridges&&h.jsxs("div",{children:[h.jsx("strong",{children:"Bridges:"})," ",t.services.bridges.running??0,"/",t.services.bridges.total??0," running",(t.services.bridges.stopped??0)>0&&` (${t.services.bridges.stopped} stopped)`]}),t.services?.homeAssistant&&h.jsxs("div",{children:[h.jsx("strong",{children:"Home Assistant:"})," ",t.services.homeAssistant.connected?"Connected":"Disconnected"]}),h.jsxs("div",{children:[h.jsx("strong",{children:"WebSocket:"})," ",e?"Connected":"Disconnected"]})]}):"Loading health status...",f=()=>r||!s?h.jsx(Sf,{fontSize:"small"}):l?h.jsx(pl,{fontSize:"small"}):h.jsx(gw,{fontSize:"small"}),p=()=>r||!s?"error":!l||!e?"warning":"success",g=()=>r?"Error":s?e?c?"No Bridges":l?"Online":"Starting":"Offline":"Unhealthy";return h.jsx(Qt,{title:u,arrow:!0,children:h.jsx(vt,{icon:f(),label:g(),color:p(),size:"small",variant:"filled",sx:{borderRadius:1,fontWeight:600,"& .MuiChip-icon":{color:"inherit"}}})})}const Dut=e=>_.createElement("svg",{viewBox:"0 0 91 89",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{style:{display:"inline"}},_.createElement("path",{style:{fill:"#18bcf2",fillOpacity:1,strokeWidth:.266194},d:"m 49.149143,1.473171 38.513568,38.536435 c 0,0 1.248354,1.186052 2.207681,3.092371 0.959329,1.906323 1.10864,4.600698 1.10864,4.600698 v 36.786372 c 0,0 -0.01549,1.748506 -1.49842,3.050572 -1.482931,1.302064 -3.333077,1.362947 -3.333077,1.362947 l -81.325658,7.7e-5 c 0,0 -1.7523855,-0.0091 -3.17112,-1.352526 C -0.07808495,85.913164 0.05953025,84.487808 0.05953025,84.487808 V 47.704546 c 0,0 -0.0018381,-2.218618 0.95921785,-4.315832 0.9610554,-2.097209 2.3010618,-3.355005 2.3010618,-3.355005 L 41.545959,1.4719546 c 0,0 1.465224,-1.46837077 3.753488,-1.46837077 2.288268,0 3.849696,1.46958717 3.849696,1.46958717 z"}),_.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,strokeWidth:.175841},d:"m 31.689717,32.051124 c 2.813363,2.331095 6.157331,3.89845 9.721813,4.556421 V 17.180647 l 3.873694,-2.282955 3.870527,2.282955 V 36.60772 c 3.565364,-0.658847 6.910387,-2.226204 9.725159,-4.556417 l 7.032345,4.154609 c -11.437354,11.557779 -29.852321,11.557779 -41.290025,0 z m 8.546732,49.60988 C 44.314996,65.760441 35.09933,49.470196 19.574984,45.139543 v 8.312381 c 3.383916,1.32244 6.386113,3.496288 8.728705,6.320026 L 11.83076,69.485301 v 4.56907 l 3.873697,2.270836 16.469936,-9.713534 c 1.224356,3.48294 1.56683,7.225375 0.996449,10.879778 z M 70.977694,45.139543 c -15.515726,4.34014 -24.72189,20.626696 -20.643519,36.521461 l 7.047658,-4.15742 c -0.569325,-3.654411 -0.2265,-7.3965 0.996449,-10.87979 l 16.457611,9.701233 3.870711,-2.283125 v -4.55677 L 62.233673,59.77195 c 2.342772,-2.822684 5.34497,-4.996533 8.728708,-6.320026 z"}))),Out=e=>{const t=rce();return h.jsxs(oe,{component:yc,to:_t.dashboard,sx:{display:"flex",alignItems:"center",justifyContent:e.large?"flex-start":"center",flexGrow:1,textDecoration:"none",color:"inherit"},children:[h.jsx(Dut,{style:{height:"40px"}}),h.jsx(re,{variant:"inherit",component:"span",sx:{mr:1,ml:1},children:t.name.split("-").map(ye).join("-")}),e.large&&h.jsx(re,{variant:"caption",component:"span",children:t.version})]})},Tut=()=>{const e=Aut("(min-width:600px)"),{mode:t,setMode:n}=QS(),[r,i]=_.useState(!1),[o,s]=_.useState(!1),a=ju(),l=()=>{n(t==="dark"?"light":"dark")},c=[{label:"Dashboard",icon:h.jsx(RT,{}),to:_t.dashboard},{label:"Bridges",icon:h.jsx(hy,{}),to:_t.bridges},{label:"All Devices",icon:h.jsx(Bs,{}),to:_t.devices},{label:"Network Map",icon:h.jsx(OT,{}),to:_t.networkMap},{label:"Startup Order",icon:h.jsx(Vm,{}),to:_t.startup},{label:"Lock Credentials",icon:h.jsx(bu,{}),to:_t.lockCredentials},{label:"Filter Reference",icon:h.jsx(IT,{}),to:_t.labels},{label:"Settings",icon:h.jsx(Eb,{}),to:_t.settings},{label:t==="dark"?"Light Mode":"Dark Mode",icon:t==="dark"?h.jsx(D8e,{}):h.jsx(g8e,{}),onClick:l},{label:"System Logs",icon:h.jsx(Mw,{}),onClick:()=>i(!0)},{label:"Health Dashboard",icon:h.jsx(fT,{}),to:_t.health}],u=f=>{s(!1),f.onClick?f.onClick():f.to&&a(f.to)};return h.jsxs(oe,{children:[h.jsx(hut,{sx:{height:"72px"},children:h.jsx(nce,{sx:{paddingLeft:"0 !important",paddingRight:"0 !important"},children:h.jsxs($I,{sx:{padding:2,height:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx(Out,{large:e}),e?h.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:1},children:[c.map(f=>f.to?h.jsx(Qt,{title:f.label,children:h.jsx(en,{component:yc,to:f.to,sx:{color:"inherit"},children:f.icon})},f.label):h.jsx(Qt,{title:f.label,children:h.jsx(en,{onClick:f.onClick,sx:{color:"inherit"},children:f.icon})},f.label)),h.jsx(GK,{})]}):h.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:.5},children:[h.jsx(GK,{}),h.jsx(en,{onClick:()=>s(!0),sx:{color:"inherit"},children:h.jsx(O8e,{})})]})]})})}),h.jsx(Eut,{anchor:"right",open:o,onClose:()=>s(!1),children:h.jsx(gl,{sx:{width:250},children:c.map(f=>h.jsxs(Ive,{onClick:()=>u(f),children:[h.jsx(qa,{children:f.icon}),h.jsx(sa,{primary:f.label})]},f.label))})}),h.jsx(_ut,{open:r,onClose:()=>i(!1)})]})},Mut=()=>{const{versionMismatch:e,frontendVersion:t,backendVersion:n}=rce(),{isConnected:r}=eZ();return h.jsxs(oe,{children:[h.jsx(Tut,{}),h.jsx(nce,{}),e&&h.jsxs(Ut,{severity:"warning",variant:"filled",sx:{borderRadius:0},action:h.jsx(lt,{color:"inherit",size:"small",onClick:()=>window.location.reload(),children:"Reload"}),children:["Version mismatch: frontend ",t,", backend ",n,". Please reload to get the latest UI."]}),!r&&h.jsx(Ut,{severity:"error",variant:"filled",sx:{borderRadius:0},children:"Connection lost — data may be outdated. Reconnecting…"}),h.jsx($I,{sx:{p:2},children:h.jsx(out,{children:h.jsx(EY,{})})}),h.jsx(cut,{})]})},Rut=XS({colorSchemes:{light:{palette:{primary:{main:"#1976d2",light:"#42a5f5",dark:"#1565c0"},secondary:{main:"#9c27b0",light:"#ba68c8",dark:"#7b1fa2"},background:{default:"#f5f5f5",paper:"#ffffff"}}},dark:{palette:{primary:{main:"#90caf9",light:"#e3f2fd",dark:"#42a5f5"},secondary:{main:"#ce93d8",light:"#f3e5f5",dark:"#ab47bc"},background:{default:"#121212",paper:"#1e1e1e"}}}},typography:{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',h1:{fontSize:"2.5rem",fontWeight:500},h2:{fontSize:"2rem",fontWeight:500},h3:{fontSize:"1.75rem",fontWeight:500},h4:{fontSize:"1.5rem",fontWeight:500},h5:{fontSize:"1.25rem",fontWeight:500},h6:{fontSize:"1rem",fontWeight:500}},shape:{borderRadius:8},components:{MuiCard:{styleOverrides:{root:{transition:"transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out","&:hover":{transform:"translateY(-2px)",boxShadow:"0 4px 20px rgba(0,0,0,0.12)"}}}},MuiButton:{styleOverrides:{root:{textTransform:"none",fontWeight:500}}},MuiChip:{styleOverrides:{root:{fontWeight:500}}},MuiAppBar:{styleOverrides:{root:{backgroundImage:"none"}}}}});let T4=document.getElementsByTagName("base")[0]?.href?.replace(/\/$/,"");T4?.startsWith("http")&&(T4=new URL(T4).pathname);const Iut=npe([{path:"/",element:h.jsx(Mut,{}),children:Yct}],{basename:T4});xde.createRoot(document.getElementById("root")).render(h.jsx(_.StrictMode,{children:h.jsx(Lde,{store:tut,children:h.jsxs(g1e,{theme:Rut,children:[h.jsx(d1e,{}),h.jsx(bX,{styles:{".rjsf-field-array > .MuiFormControl-root > .MuiPaper-root > .MuiBox-root > .MuiGrid-root > .MuiGrid-root:has(> .MuiBox-root > .MuiPaper-root > .MuiBox-root > .rjsf-field)":{overflow:"initial !important",flexGrow:1}}}),h.jsx(F2e,{children:h.jsx(Mye,{children:h.jsx(ppe,{router:Iut})})})]})})}));
|
|
499
|
+
`},blt={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function vlt(e){let{announcements:t=blt,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=ylt}=e;const{announce:o,announcement:s}=plt(),a=cv("DndLiveRegion"),[l,c]=_.useState(!1);if(_.useEffect(()=>{c(!0)},[]),mlt(_.useMemo(()=>({onDragStart(f){let{active:p}=f;o(t.onDragStart({active:p}))},onDragMove(f){let{active:p,over:g}=f;t.onDragMove&&o(t.onDragMove({active:p,over:g}))},onDragOver(f){let{active:p,over:g}=f;o(t.onDragOver({active:p,over:g}))},onDragEnd(f){let{active:p,over:g}=f;o(t.onDragEnd({active:p,over:g}))},onDragCancel(f){let{active:p,over:g}=f;o(t.onDragCancel({active:p,over:g}))}}),[o,t])),!l)return null;const u=Gt.createElement(Gt.Fragment,null,Gt.createElement(flt,{id:r,value:i.draggable}),Gt.createElement(hlt,{id:a,announcement:s}));return n?Rd.createPortal(u,n):u}var Li;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Li||(Li={}));function DS(){}function IK(e,t){return _.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function xlt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return _.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const fl=Object.freeze({x:0,y:0});function $le(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Lle(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Slt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function jK(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Nle(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function PK(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const wlt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=PK(t,t.left,t.top),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=$le(PK(l),i);o.push({id:a,data:{droppableContainer:s,value:c}})}}return o.sort(Lle)},Clt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=jK(t),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=jK(l),u=i.reduce((p,g,y)=>p+$le(c[y],g),0),f=Number((u/4).toFixed(4));o.push({id:a,data:{droppableContainer:s,value:f}})}}return o.sort(Lle)};function Elt(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),s=i-r,a=o-n;if(r<i&&n<o){const l=t.width*t.height,c=e.width*e.height,u=s*a,f=u/(l+c-u);return Number(f.toFixed(4))}return 0}const Alt=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:s}=o,a=n.get(s);if(a){const l=Elt(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(Slt)};function klt(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Fle(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:fl}function _lt(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const Dlt=_lt(1);function Olt(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Tlt(e,t,n){const r=Olt(t);if(!r)return e;const{scaleX:i,scaleY:o,x:s,y:a}=r,l=e.left-s-(1-i)*parseFloat(n),c=e.top-a-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),u=i?e.width/i:e.width,f=o?e.height/o:e.height;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l}}const Mlt={ignoreTransform:!1};function mg(e,t){t===void 0&&(t=Mlt);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=ps(e).getComputedStyle(e);c&&(n=Tlt(n,c,u))}const{top:r,left:i,width:o,height:s,bottom:a,right:l}=n;return{top:r,left:i,width:o,height:s,bottom:a,right:l}}function $K(e){return mg(e,{ignoreTransform:!0})}function Rlt(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Ilt(e,t){return t===void 0&&(t=ps(e).getComputedStyle(e)),t.position==="fixed"}function jlt(e,t){t===void 0&&(t=ps(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function QC(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(DI(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!av(i)||Ile(i)||n.includes(i))return n;const o=ps(e).getComputedStyle(i);return i!==e&&jlt(i,o)&&n.push(i),Ilt(i,o)?n:r(i.parentNode)}return e?r(e):n}function Ble(e){const[t]=QC(e,1);return t??null}function ik(e){return!JC||!e?null:hg(e)?e:_I(e)?DI(e)||e===pg(e).scrollingElement?window:av(e)?e:null:null}function zle(e){return hg(e)?e.scrollX:e.scrollLeft}function Hle(e){return hg(e)?e.scrollY:e.scrollTop}function sO(e){return{x:zle(e),y:Hle(e)}}var Zi;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Zi||(Zi={}));function Ule(e){return!JC||!e?!1:e===document.scrollingElement}function Vle(e){const t={x:0,y:0},n=Ule(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const Plt={x:.2,y:.2};function $lt(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=Plt);const{isTop:c,isBottom:u,isLeft:f,isRight:p}=Vle(e),g={x:0,y:0},y={x:0,y:0},b={height:t.height*i.y,width:t.width*i.x};return!c&&o<=t.top+b.height?(g.y=Zi.Backward,y.y=r*Math.abs((t.top+b.height-o)/b.height)):!u&&l>=t.bottom-b.height&&(g.y=Zi.Forward,y.y=r*Math.abs((t.bottom-b.height-l)/b.height)),!p&&a>=t.right-b.width?(g.x=Zi.Forward,y.x=r*Math.abs((t.right-b.width-a)/b.width)):!f&&s<=t.left+b.width&&(g.x=Zi.Backward,y.x=r*Math.abs((t.left+b.width-s)/b.width)),{direction:g,speed:y}}function Llt(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:s}=window;return{top:0,left:0,right:o,bottom:s,width:o,height:s}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Wle(e){return e.reduce((t,n)=>rm(t,sO(n)),fl)}function Nlt(e){return e.reduce((t,n)=>t+zle(n),0)}function Flt(e){return e.reduce((t,n)=>t+Hle(n),0)}function Blt(e,t){if(t===void 0&&(t=mg),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);Ble(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const zlt=[["x",["left","right"],Nlt],["y",["top","bottom"],Flt]];class MI{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=QC(n),i=Wle(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of zlt)for(const l of s)Object.defineProperty(this,l,{get:()=>{const c=a(r),u=i[o]-c;return this.rect[l]+u},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Py{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Hlt(e){const{EventTarget:t}=ps(e);return e instanceof t?e:pg(e)}function ok(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var na;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(na||(na={}));function LK(e){e.preventDefault()}function Ult(e){e.stopPropagation()}var Nn;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Nn||(Nn={}));const qle={start:[Nn.Space,Nn.Enter],cancel:[Nn.Esc],end:[Nn.Space,Nn.Enter,Nn.Tab]},Vlt=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Nn.Right:return{...n,x:n.x+25};case Nn.Left:return{...n,x:n.x-25};case Nn.Down:return{...n,y:n.y+25};case Nn.Up:return{...n,y:n.y-25}}};class RI{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Py(pg(n)),this.windowListeners=new Py(ps(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(na.Resize,this.handleCancel),this.windowListeners.add(na.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(na.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Blt(r),n(fl)}handleKeyDown(t){if(TI(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=qle,coordinateGetter:s=Vlt,scrollBehavior:a="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,u=c?{x:c.left,y:c.top}:fl;this.referenceCoordinates||(this.referenceCoordinates=u);const f=s(t,{active:n,context:r.current,currentCoordinates:u});if(f){const p=ib(f,u),g={x:0,y:0},{scrollableAncestors:y}=r.current;for(const b of y){const v=t.code,{isTop:S,isRight:C,isLeft:w,isBottom:A,maxScroll:E,minScroll:D}=Vle(b),O=Llt(b),T={x:Math.min(v===Nn.Right?O.right-O.width/2:O.right,Math.max(v===Nn.Right?O.left:O.left+O.width/2,f.x)),y:Math.min(v===Nn.Down?O.bottom-O.height/2:O.bottom,Math.max(v===Nn.Down?O.top:O.top+O.height/2,f.y))},I=v===Nn.Right&&!C||v===Nn.Left&&!w,L=v===Nn.Down&&!A||v===Nn.Up&&!S;if(I&&T.x!==f.x){const $=b.scrollLeft+p.x,R=v===Nn.Right&&$<=E.x||v===Nn.Left&&$>=D.x;if(R&&!p.y){b.scrollTo({left:$,behavior:a});return}R?g.x=b.scrollLeft-$:g.x=v===Nn.Right?b.scrollLeft-E.x:b.scrollLeft-D.x,g.x&&b.scrollBy({left:-g.x,behavior:a});break}else if(L&&T.y!==f.y){const $=b.scrollTop+p.y,R=v===Nn.Down&&$<=E.y||v===Nn.Up&&$>=D.y;if(R&&!p.x){b.scrollTo({top:$,behavior:a});return}R?g.y=b.scrollTop-$:g.y=v===Nn.Down?b.scrollTop-E.y:b.scrollTop-D.y,g.y&&b.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,rm(ib(f,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}RI.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=qle,onActivation:i}=t,{active:o}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function NK(e){return!!(e&&"distance"in e)}function FK(e){return!!(e&&"delay"in e)}class II{constructor(t,n,r){var i;r===void 0&&(r=Hlt(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:s}=o;this.props=t,this.events=n,this.document=pg(s),this.documentListeners=new Py(this.document),this.listeners=new Py(r),this.windowListeners=new Py(ps(s)),this.initialCoordinates=(i=oO(o))!=null?i:fl,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(na.Resize,this.handleCancel),this.windowListeners.add(na.DragStart,LK),this.windowListeners.add(na.VisibilityChange,this.handleCancel),this.windowListeners.add(na.ContextMenu,LK),this.documentListeners.add(na.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(FK(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(NK(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(na.Click,Ult,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(na.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:s,options:{activationConstraint:a}}=o;if(!i)return;const l=(n=oO(t))!=null?n:fl,c=ib(i,l);if(!r&&a){if(NK(a)){if(a.tolerance!=null&&ok(c,a.tolerance))return this.handleCancel();if(ok(c,a.distance))return this.handleStart()}if(FK(a)&&ok(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Nn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Wlt={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class jI extends II{constructor(t){const{event:n}=t,r=pg(n.target);super(t,Wlt,r)}}jI.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const qlt={move:{name:"mousemove"},end:{name:"mouseup"}};var aO;(function(e){e[e.RightClick=2]="RightClick"})(aO||(aO={}));class Glt extends II{constructor(t){super(t,qlt,pg(t.event.target))}}Glt.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===aO.RightClick?!1:(r?.({event:n}),!0)}}];const sk={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Klt extends II{constructor(t){super(t,sk)}static setup(){return window.addEventListener(sk.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(sk.move.name,t)};function t(){}}}Klt.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var $y;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})($y||($y={}));var OS;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(OS||(OS={}));function Ylt(e){let{acceleration:t,activator:n=$y.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:a=OS.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:f,threshold:p}=e;const g=Zlt({delta:f,disabled:!o}),[y,b]=alt(),v=_.useRef({x:0,y:0}),S=_.useRef({x:0,y:0}),C=_.useMemo(()=>{switch(n){case $y.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case $y.DraggableRect:return i}},[n,i,l]),w=_.useRef(null),A=_.useCallback(()=>{const D=w.current;if(!D)return;const O=v.current.x*S.current.x,T=v.current.y*S.current.y;D.scrollBy(O,T)},[]),E=_.useMemo(()=>a===OS.TreeOrder?[...c].reverse():c,[a,c]);_.useEffect(()=>{if(!o||!c.length||!C){b();return}for(const D of E){if(r?.(D)===!1)continue;const O=c.indexOf(D),T=u[O];if(!T)continue;const{direction:I,speed:L}=$lt(D,T,C,t,p);for(const $ of["x","y"])g[$][I[$]]||(L[$]=0,I[$]=0);if(L.x>0||L.y>0){b(),w.current=D,y(A,s),v.current=L,S.current=I;return}}v.current={x:0,y:0},S.current={x:0,y:0},b()},[t,A,r,b,o,s,JSON.stringify(C),JSON.stringify(g),y,c,E,u,JSON.stringify(p)])}const Xlt={x:{[Zi.Backward]:!1,[Zi.Forward]:!1},y:{[Zi.Backward]:!1,[Zi.Forward]:!1}};function Zlt(e){let{delta:t,disabled:n}=e;const r=iO(t);return lv(i=>{if(n||!r||!i)return Xlt;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Zi.Backward]:i.x[Zi.Backward]||o.x===-1,[Zi.Forward]:i.x[Zi.Forward]||o.x===1},y:{[Zi.Backward]:i.y[Zi.Backward]||o.y===-1,[Zi.Forward]:i.y[Zi.Forward]||o.y===1}}},[n,t,r])}function Jlt(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return lv(i=>{var o;return t==null?null:(o=r??i)!=null?o:null},[r,t])}function Qlt(e,t){return _.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...o]},[]),[e,t])}var sb;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(sb||(sb={}));var lO;(function(e){e.Optimized="optimized"})(lO||(lO={}));const BK=new Map;function ect(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,s]=_.useState(null),{frequency:a,measure:l,strategy:c}=i,u=_.useRef(e),f=v(),p=rb(f),g=_.useCallback(function(S){S===void 0&&(S=[]),!p.current&&s(C=>C===null?S:C.concat(S.filter(w=>!C.includes(w))))},[p]),y=_.useRef(null),b=lv(S=>{if(f&&!n)return BK;if(!S||S===BK||u.current!==e||o!=null){const C=new Map;for(let w of e){if(!w)continue;if(o&&o.length>0&&!o.includes(w.id)&&w.rect.current){C.set(w.id,w.rect.current);continue}const A=w.node.current,E=A?new MI(l(A),A):null;w.rect.current=E,E&&C.set(w.id,E)}return C}return S},[e,o,n,f,l]);return _.useEffect(()=>{u.current=e},[e]),_.useEffect(()=>{f||g()},[n,f]),_.useEffect(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),_.useEffect(()=>{f||typeof a!="number"||y.current!==null||(y.current=setTimeout(()=>{g(),y.current=null},a))},[a,f,g,...r]),{droppableRects:b,measureDroppableContainers:g,measuringScheduled:o!=null};function v(){switch(c){case sb.Always:return!1;case sb.BeforeDragging:return n;default:return!n}}}function Gle(e,t){return lv(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function tct(e,t){return Gle(e,t)}function nct(e){let{callback:t,disabled:n}=e;const r=OI(t),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return _.useEffect(()=>()=>i?.disconnect(),[i]),i}function e8(e){let{callback:t,disabled:n}=e;const r=OI(t),i=_.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return _.useEffect(()=>()=>i?.disconnect(),[i]),i}function rct(e){return new MI(mg(e),e)}function zK(e,t,n){t===void 0&&(t=rct);const[r,i]=_.useState(null);function o(){i(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const u=t(e);return JSON.stringify(l)===JSON.stringify(u)?l:u})}const s=nct({callback(l){if(e)for(const c of l){const{type:u,target:f}=c;if(u==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),a=e8({callback:o});return Ec(()=>{o(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function ict(e){const t=Gle(e);return Fle(e,t)}const HK=[];function oct(e){const t=_.useRef(e),n=lv(r=>e?r&&r!==HK&&e&&t.current&&e.parentNode===t.current.parentNode?r:QC(e):HK,[e]);return _.useEffect(()=>{t.current=e},[e]),n}function sct(e){const[t,n]=_.useState(null),r=_.useRef(e),i=_.useCallback(o=>{const s=ik(o.target);s&&n(a=>a?(a.set(s,sO(s)),new Map(a)):null)},[]);return _.useEffect(()=>{const o=r.current;if(e!==o){s(o);const a=e.map(l=>{const c=ik(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,sO(c)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(o)};function s(a){a.forEach(l=>{const c=ik(l);c?.removeEventListener("scroll",i)})}},[i,e]),_.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>rm(o,s),fl):Wle(e):fl,[e,t])}function UK(e,t){t===void 0&&(t=[]);const n=_.useRef(null);return _.useEffect(()=>{n.current=null},t),_.useEffect(()=>{const r=e!==fl;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ib(e,n.current):fl}function act(e){_.useEffect(()=>{if(!JC)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function lct(e,t){return _.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=s=>{o(s,t)},n},{}),[e,t])}function Kle(e){return _.useMemo(()=>e?Rlt(e):null,[e])}const VK=[];function cct(e,t){t===void 0&&(t=mg);const[n]=e,r=Kle(n?ps(n):null),[i,o]=_.useState(VK);function s(){o(()=>e.length?e.map(l=>Ule(l)?r:new MI(t(l),l)):VK)}const a=e8({callback:s});return Ec(()=>{a?.disconnect(),s(),e.forEach(l=>a?.observe(l))},[e]),i}function uct(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return av(t)?t:e}function dct(e){let{measure:t}=e;const[n,r]=_.useState(null),i=_.useCallback(c=>{for(const{target:u}of c)if(av(u)){r(f=>{const p=t(u);return f?{...f,width:p.width,height:p.height}:p});break}},[t]),o=e8({callback:i}),s=_.useCallback(c=>{const u=uct(c);o?.disconnect(),u&&o?.observe(u),r(u?t(u):null)},[t,o]),[a,l]=_S(s);return _.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const fct=[{sensor:jI,options:{}},{sensor:RI,options:{}}],hct={current:{}},O4={draggable:{measure:$K},droppable:{measure:$K,strategy:sb.WhileDragging,frequency:lO.Optimized},dragOverlay:{measure:mg}};class Ly extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const pct={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ly,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:DS},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:O4,measureDroppableContainers:DS,windowRect:null,measuringScheduled:!1},mct={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:DS,draggableNodes:new Map,over:null,measureDroppableContainers:DS},t8=_.createContext(mct),Yle=_.createContext(pct);function gct(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ly}}}function yct(e,t){switch(t.type){case Li.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Li.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Li.DragEnd:case Li.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Li.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new Ly(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Li.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new Ly(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case Li.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new Ly(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function bct(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=_.useContext(t8),o=iO(r),s=iO(n?.id);return _.useEffect(()=>{if(!t&&!r&&o&&s!=null){if(!TI(o)||document.activeElement===o.target)return;const a=i.get(s);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const u of[l.current,c.current]){if(!u)continue;const f=ult(u);if(f){f.focus();break}}})}},[r,t,i,s,o]),null}function vct(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function xct(e){return _.useMemo(()=>({draggable:{...O4.draggable,...e?.draggable},droppable:{...O4.droppable,...e?.droppable},dragOverlay:{...O4.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Sct(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=_.useRef(!1),{x:s,y:a}=typeof i=="boolean"?{x:i,y:i}:i;Ec(()=>{if(!s&&!a||!t){o.current=!1;return}if(o.current||!r)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const u=n(c),f=Fle(u,r);if(s||(f.x=0),a||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const p=Ble(c);p&&p.scrollBy({top:f.y,left:f.x})}},[t,s,a,r,n])}const Xle=_.createContext({...fl,scaleX:1,scaleY:1});var Ed;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ed||(Ed={}));const wct=_.memo(function(t){var n,r,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:u=fct,collisionDetection:f=Alt,measuring:p,modifiers:g,...y}=t;const b=_.useReducer(yct,void 0,gct),[v,S]=b,[C,w]=glt(),[A,E]=_.useState(Ed.Uninitialized),D=A===Ed.Initialized,{draggable:{active:O,nodes:T,translate:I},droppable:{containers:L}}=v,$=O!=null?T.get(O):null,R=_.useRef({initial:null,translated:null}),F=_.useMemo(()=>{var Ot;return O!=null?{id:O,data:(Ot=$?.data)!=null?Ot:hct,rect:R}:null},[O,$]),P=_.useRef(null),[z,N]=_.useState(null),[V,U]=_.useState(null),K=rb(y,Object.values(y)),X=cv("DndDescribedBy",s),B=_.useMemo(()=>L.getEnabled(),[L]),W=xct(p),{droppableRects:q,measureDroppableContainers:H,measuringScheduled:Y}=ect(B,{dragging:D,dependencies:[I.x,I.y],config:W.droppable}),J=Jlt(T,O),te=_.useMemo(()=>V?oO(V):null,[V]),ee=yr(),ae=tct(J,W.draggable.measure);Sct({activeNode:O!=null?T.get(O):null,config:ee.layoutShiftCompensation,initialRect:ae,measure:W.draggable.measure});const ue=zK(J,W.draggable.measure,ae),ne=zK(J?J.parentElement:null),Z=_.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:q,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:L,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=L.getNodeFor((n=Z.current.over)==null?void 0:n.id),se=dct({measure:W.dragOverlay.measure}),fe=(r=se.nodeRef.current)!=null?r:J,be=D?(i=se.rect)!=null?i:ue:null,De=!!(se.nodeRef.current&&se.rect),Oe=ict(De?null:ue),Ke=Kle(fe?ps(fe):null),xe=oct(D?ie??J:null),Le=cct(xe),Me=vct(g,{transform:{x:I.x-Oe.x,y:I.y-Oe.y,scaleX:1,scaleY:1},activatorEvent:V,active:F,activeNodeRect:ue,containerNodeRect:ne,draggingNodeRect:be,over:Z.current.over,overlayNodeRect:se.rect,scrollableAncestors:xe,scrollableAncestorRects:Le,windowRect:Ke}),pt=te?rm(te,I):null,gt=sct(xe),ze=UK(gt),je=UK(gt,[ue]),He=rm(Me,ze),Je=be?Dlt(be,Me):null,nt=F&&Je?f({active:F,collisionRect:Je,droppableRects:q,droppableContainers:B,pointerCoordinates:pt}):null,st=Nle(nt,"id"),[Xe,Lt]=_.useState(null),Nt=De?Me:rm(Me,je),Tt=klt(Nt,(o=Xe?.rect)!=null?o:null,ue),Jn=_.useRef(null),an=_.useCallback((Ot,Pt)=>{let{sensor:tn,options:$n}=Pt;if(P.current==null)return;const ln=T.get(P.current);if(!ln)return;const Ct=Ot.nativeEvent,yn=new tn({active:P.current,activeNode:ln,event:Ct,options:$n,context:Z,onAbort(br){if(!T.get(br))return;const{onDragAbort:ce}=K.current,pe={id:br};ce?.(pe),C({type:"onDragAbort",event:pe})},onPending(br,ei,ce,pe){if(!T.get(br))return;const{onDragPending:Fe}=K.current,Ue={id:br,constraint:ei,initialCoordinates:ce,offset:pe};Fe?.(Ue),C({type:"onDragPending",event:Ue})},onStart(br){const ei=P.current;if(ei==null)return;const ce=T.get(ei);if(!ce)return;const{onDragStart:pe}=K.current,Se={activatorEvent:Ct,active:{id:ei,data:ce.data,rect:R}};Rd.unstable_batchedUpdates(()=>{pe?.(Se),E(Ed.Initializing),S({type:Li.DragStart,initialCoordinates:br,active:ei}),C({type:"onDragStart",event:Se}),N(Jn.current),U(Ct)})},onMove(br){S({type:Li.DragMove,coordinates:br})},onEnd:Qr(Li.DragEnd),onCancel:Qr(Li.DragCancel)});Jn.current=yn;function Qr(br){return async function(){const{active:ce,collisions:pe,over:Se,scrollAdjustedTranslate:Fe}=Z.current;let Ue=null;if(ce&&Fe){const{cancelDrop:bt}=K.current;Ue={activatorEvent:Ct,active:ce,collisions:pe,delta:Fe,over:Se},br===Li.DragEnd&&typeof bt=="function"&&await Promise.resolve(bt(Ue))&&(br=Li.DragCancel)}P.current=null,Rd.unstable_batchedUpdates(()=>{S({type:br}),E(Ed.Uninitialized),Lt(null),N(null),U(null),Jn.current=null;const bt=br===Li.DragEnd?"onDragEnd":"onDragCancel";if(Ue){const rt=K.current[bt];rt?.(Ue),C({type:bt,event:Ue})}})}}},[T]),ct=_.useCallback((Ot,Pt)=>(tn,$n)=>{const ln=tn.nativeEvent,Ct=T.get($n);if(P.current!==null||!Ct||ln.dndKit||ln.defaultPrevented)return;const yn={active:Ct};Ot(tn,Pt.options,yn)===!0&&(ln.dndKit={capturedBy:Pt.sensor},P.current=$n,an(tn,Pt))},[T,an]),Ht=Qlt(u,ct);act(u),Ec(()=>{ue&&A===Ed.Initializing&&E(Ed.Initialized)},[ue,A]),_.useEffect(()=>{const{onDragMove:Ot}=K.current,{active:Pt,activatorEvent:tn,collisions:$n,over:ln}=Z.current;if(!Pt||!tn)return;const Ct={active:Pt,activatorEvent:tn,collisions:$n,delta:{x:He.x,y:He.y},over:ln};Rd.unstable_batchedUpdates(()=>{Ot?.(Ct),C({type:"onDragMove",event:Ct})})},[He.x,He.y]),_.useEffect(()=>{const{active:Ot,activatorEvent:Pt,collisions:tn,droppableContainers:$n,scrollAdjustedTranslate:ln}=Z.current;if(!Ot||P.current==null||!Pt||!ln)return;const{onDragOver:Ct}=K.current,yn=$n.get(st),Qr=yn&&yn.rect.current?{id:yn.id,rect:yn.rect.current,data:yn.data,disabled:yn.disabled}:null,br={active:Ot,activatorEvent:Pt,collisions:tn,delta:{x:ln.x,y:ln.y},over:Qr};Rd.unstable_batchedUpdates(()=>{Lt(Qr),Ct?.(br),C({type:"onDragOver",event:br})})},[st]),Ec(()=>{Z.current={activatorEvent:V,active:F,activeNode:J,collisionRect:Je,collisions:nt,droppableRects:q,draggableNodes:T,draggingNode:fe,draggingNodeRect:be,droppableContainers:L,over:Xe,scrollableAncestors:xe,scrollAdjustedTranslate:He},R.current={initial:be,translated:Je}},[F,J,nt,Je,T,fe,be,q,L,Xe,xe,He]),Ylt({...ee,delta:I,draggingRect:Je,pointerCoordinates:pt,scrollableAncestors:xe,scrollableAncestorRects:Le});const Dn=_.useMemo(()=>({active:F,activeNode:J,activeNodeRect:ue,activatorEvent:V,collisions:nt,containerNodeRect:ne,dragOverlay:se,draggableNodes:T,droppableContainers:L,droppableRects:q,over:Xe,measureDroppableContainers:H,scrollableAncestors:xe,scrollableAncestorRects:Le,measuringConfiguration:W,measuringScheduled:Y,windowRect:Ke}),[F,J,ue,V,nt,ne,se,T,L,q,Xe,H,xe,Le,W,Y,Ke]),Yn=_.useMemo(()=>({activatorEvent:V,activators:Ht,active:F,activeNodeRect:ue,ariaDescribedById:{draggable:X},dispatch:S,draggableNodes:T,over:Xe,measureDroppableContainers:H}),[V,Ht,F,ue,S,X,T,Xe,H]);return Gt.createElement(Ple.Provider,{value:w},Gt.createElement(t8.Provider,{value:Yn},Gt.createElement(Yle.Provider,{value:Dn},Gt.createElement(Xle.Provider,{value:Tt},c)),Gt.createElement(bct,{disabled:a?.restoreFocus===!1})),Gt.createElement(vlt,{...a,hiddenTextDescribedById:X}));function yr(){const Ot=z?.autoScrollEnabled===!1,Pt=typeof l=="object"?l.enabled===!1:l===!1,tn=D&&!Ot&&!Pt;return typeof l=="object"?{...l,enabled:tn}:{enabled:tn}}}),Cct=_.createContext(null),WK="button",Ect="Draggable";function Act(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=cv(Ect),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:f,over:p}=_.useContext(t8),{role:g=WK,roleDescription:y="draggable",tabIndex:b=0}=i??{},v=l?.id===t,S=_.useContext(v?Xle:Cct),[C,w]=_S(),[A,E]=_S(),D=lct(s,t),O=rb(n);Ec(()=>(f.set(t,{id:t,key:o,node:C,activatorNode:A,data:O}),()=>{const I=f.get(t);I&&I.key===o&&f.delete(t)}),[f,t]);const T=_.useMemo(()=>({role:g,tabIndex:b,"aria-disabled":r,"aria-pressed":v&&g===WK?!0:void 0,"aria-roledescription":y,"aria-describedby":u.draggable}),[r,g,b,v,y,u.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:T,isDragging:v,listeners:r?void 0:D,node:C,over:p,setNodeRef:w,setActivatorNodeRef:E,transform:S}}function kct(){return _.useContext(Yle)}const _ct="Droppable",Dct={timeout:25};function Oct(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=cv(_ct),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=_.useContext(t8),u=_.useRef({disabled:n}),f=_.useRef(!1),p=_.useRef(null),g=_.useRef(null),{disabled:y,updateMeasurementsFor:b,timeout:v}={...Dct,...i},S=rb(b??r),C=_.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{c(Array.isArray(S.current)?S.current:[S.current]),g.current=null},v)},[v]),w=e8({callback:C,disabled:y||!s}),A=_.useCallback((T,I)=>{w&&(I&&(w.unobserve(I),f.current=!1),T&&w.observe(T))},[w]),[E,D]=_S(A),O=rb(t);return _.useEffect(()=>{!w||!E.current||(w.disconnect(),f.current=!1,w.observe(E.current))},[E,w]),_.useEffect(()=>(a({type:Li.RegisterDroppable,element:{id:r,key:o,disabled:n,node:E,rect:p,data:O}}),()=>a({type:Li.UnregisterDroppable,key:o,id:r})),[r]),_.useEffect(()=>{n!==u.current.disabled&&(a({type:Li.SetDroppableDisabled,id:r,key:o,disabled:n}),u.current.disabled=n)},[r,o,n,a]),{active:s,rect:p,isOver:l?.id===r,node:E,over:l,setNodeRef:D}}function PI(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Tct(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function _5(e){return e!==null&&e>=0}function Mct(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Rct(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Zle=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=PI(t,r,n),s=t[i],a=o[i];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},D5={scaleX:1,scaleY:1},Ict=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:i,rects:o,overIndex:s}=e;const a=(t=o[n])!=null?t:r;if(!a)return null;if(i===n){const c=o[s];return c?{x:0,y:n<s?c.top+c.height-(a.top+a.height):c.top-a.top,...D5}:null}const l=jct(o,i,n);return i>n&&i<=s?{x:0,y:-a.height-l,...D5}:i<n&&i>=s?{x:0,y:a.height+l,...D5}:{x:0,y:0,...D5}};function jct(e,t,n){const r=e[t],i=e[t-1],o=e[t+1];return r?n<t?i?r.top-(i.top+i.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}const Jle="Sortable",Qle=Gt.createContext({activeIndex:-1,containerId:Jle,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Zle,disabled:{draggable:!1,droppable:!1}});function Pct(e){let{children:t,id:n,items:r,strategy:i=Zle,disabled:o=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=kct(),f=cv(Jle,n),p=a.rect!==null,g=_.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),y=s!=null,b=s?g.indexOf(s.id):-1,v=c?g.indexOf(c.id):-1,S=_.useRef(g),C=!Mct(g,S.current),w=v!==-1&&b===-1||C,A=Rct(o);Ec(()=>{C&&y&&u(g)},[C,g,y,u]),_.useEffect(()=>{S.current=g},[g]);const E=_.useMemo(()=>({activeIndex:b,containerId:f,disabled:A,disableTransforms:w,items:g,overIndex:v,useDragOverlay:p,sortedRects:Tct(g,l),strategy:i}),[b,f,A.draggable,A.droppable,w,g,v,l,p,i]);return Gt.createElement(Qle.Provider,{value:E},t)}const $ct=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return PI(n,r,i).indexOf(t)},Lct=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:s,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!r||a!==o&&i===s?!1:n?!0:s!==i&&t===l},Nct={duration:200,easing:"ease"},ece="transform",Fct=ob.Transition.toString({property:ece,duration:0,easing:"linear"}),Bct={roleDescription:"sortable"};function zct(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,s]=_.useState(null),a=_.useRef(n);return Ec(()=>{if(!t&&n!==a.current&&r.current){const l=i.current;if(l){const c=mg(r.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&s(u)}}n!==a.current&&(a.current=n)},[t,n,r,i]),_.useEffect(()=>{o&&s(null)},[o]),o}function Hct(e){let{animateLayoutChanges:t=Lct,attributes:n,disabled:r,data:i,getNewIndex:o=$ct,id:s,strategy:a,resizeObserverConfig:l,transition:c=Nct}=e;const{items:u,containerId:f,activeIndex:p,disabled:g,disableTransforms:y,sortedRects:b,overIndex:v,useDragOverlay:S,strategy:C}=_.useContext(Qle),w=Uct(r,g),A=u.indexOf(s),E=_.useMemo(()=>({sortable:{containerId:f,index:A,items:u},...i}),[f,i,A,u]),D=_.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:O,node:T,isOver:I,setNodeRef:L}=Oct({id:s,data:E,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...l}}),{active:$,activatorEvent:R,activeNodeRect:F,attributes:P,setNodeRef:z,listeners:N,isDragging:V,over:U,setActivatorNodeRef:K,transform:X}=Act({id:s,data:E,attributes:{...Bct,...n},disabled:w.draggable}),B=slt(L,z),W=!!$,q=W&&!y&&_5(p)&&_5(v),H=!S&&V,Y=H&&q?X:null,te=q?Y??(a??C)({rects:b,activeNodeRect:F,activeIndex:p,overIndex:v,index:A}):null,ee=_5(p)&&_5(v)?o({id:s,items:u,activeIndex:p,overIndex:v}):A,ae=$?.id,ue=_.useRef({activeId:ae,items:u,newIndex:ee,containerId:f}),ne=u!==ue.current.items,Z=t({active:$,containerId:f,isDragging:V,isSorting:W,id:s,index:A,items:u,newIndex:ue.current.newIndex,previousItems:ue.current.items,previousContainerId:ue.current.containerId,transition:c,wasDragging:ue.current.activeId!=null}),ie=zct({disabled:!Z,index:A,node:T,rect:O});return _.useEffect(()=>{W&&ue.current.newIndex!==ee&&(ue.current.newIndex=ee),f!==ue.current.containerId&&(ue.current.containerId=f),u!==ue.current.items&&(ue.current.items=u)},[W,ee,f,u]),_.useEffect(()=>{if(ae===ue.current.activeId)return;if(ae!=null&&ue.current.activeId==null){ue.current.activeId=ae;return}const fe=setTimeout(()=>{ue.current.activeId=ae},50);return()=>clearTimeout(fe)},[ae]),{active:$,activeIndex:p,attributes:P,data:E,rect:O,index:A,newIndex:ee,items:u,isOver:I,isSorting:W,isDragging:V,listeners:N,node:T,overIndex:v,over:U,setNodeRef:B,setActivatorNodeRef:K,setDroppableNodeRef:L,setDraggableNodeRef:z,transform:ie??te,transition:se()};function se(){if(ie||ne&&ue.current.newIndex===A)return Fct;if(!(H&&!TI(R)||!c)&&(W||Z))return ob.Transition.toString({...c,property:ece})}}function Uct(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}function TS(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const Vct=[Nn.Down,Nn.Right,Nn.Up,Nn.Left],Wct=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:s,scrollableAncestors:a}}=t;if(Vct.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const p=i.get(f.id);if(p)switch(e.code){case Nn.Down:r.top<p.top&&l.push(f);break;case Nn.Up:r.top>p.top&&l.push(f);break;case Nn.Left:r.left>p.left&&l.push(f);break;case Nn.Right:r.left<p.left&&l.push(f);break}});const c=Clt({collisionRect:r,droppableRects:i,droppableContainers:l});let u=Nle(c,"id");if(u===s?.id&&c.length>1&&(u=c[1].id),u!=null){const f=o.get(n.id),p=o.get(u),g=p?i.get(p.id):null,y=p?.node.current;if(y&&g&&f&&p){const v=QC(y).some((D,O)=>a[O]!==D),S=tce(f,p),C=qct(f,p),w=v||!S?{x:0,y:0}:{x:C?r.width-g.width:0,y:C?r.height-g.height:0},A={x:g.left,y:g.top};return w.x&&w.y?A:ib(A,w)}}}};function tce(e,t){return!TS(e)||!TS(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function qct(e,t){return!TS(e)||!TS(t)||!tce(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const Gct=({bridge:e,index:t})=>{const{attributes:n,listeners:r,setNodeRef:i,transform:o,transition:s,isDragging:a}=Hct({id:e.id}),[l,c]=_.useState(!1);_.useEffect(()=>{jw(e.id).then(c)},[e.id]);const u={transform:ob.Transform.toString(o),transition:s,opacity:a?.5:1};return h.jsx(Pn,{ref:i,style:u,variant:"outlined",sx:{cursor:"grab","&:active":{cursor:"grabbing"},bgcolor:a?"action.selected":"background.paper",width:"fit-content"},children:h.jsxs(Gn,{sx:{display:"flex",alignItems:"center",gap:1.5,py:1,"&:last-child":{pb:1}},children:[h.jsx(oe,{...n,...r,sx:{display:"flex",alignItems:"center",color:"text.secondary"},children:h.jsx(x8e,{})}),h.jsx(vt,{label:t+1,size:"small",color:"primary",sx:{minWidth:32,fontWeight:"bold"}}),l?h.jsx(oe,{component:"img",src:r2(e.id),alt:e.name,sx:{width:40,height:40,borderRadius:"50%",objectFit:"cover",boxShadow:2}}):h.jsx(sl,{sx:{bgcolor:FT(e),width:40,height:40,boxShadow:2},children:(()=>{const f=NT(e);return h.jsx(f,{sx:{fontSize:24}})})()}),h.jsxs(oe,{sx:{flex:1},children:[h.jsx(re,{variant:"subtitle1",fontWeight:500,children:e.name}),h.jsxs(re,{variant:"caption",color:"text.secondary",children:["Port: ",e.port," • Priority: ",e.priority??100]})]})]})})},Kct=()=>{const e=Ac(),{content:t,isLoading:n}=qm(),r=BCe(),[i,o]=_.useState([]),[s,a]=_.useState(!1);_.useEffect(()=>{if(t){const p=[...t].sort((g,y)=>{const b=g.priority??100,v=y.priority??100;return b-v});o(p),a(!1)}},[t]);const l=xlt(IK(jI),IK(RI,{coordinateGetter:Wct})),c=_.useCallback(p=>{const{active:g,over:y}=p;y&&g.id!==y.id&&(o(b=>{const v=b.findIndex(C=>C.id===g.id),S=b.findIndex(C=>C.id===y.id);return PI(b,v,S)}),a(!0))},[]),u=_.useCallback(async()=>{const p=i.map((g,y)=>({id:g.id,priority:(y+1)*10}));try{await r(p),e.show({message:"Startup order saved successfully",severity:"success"}),a(!1)}catch(g){e.show({message:g instanceof Error?g.message:"Failed to save startup order",severity:"error"})}},[i,r,e]),f=_.useMemo(()=>i.map(p=>p.id),[i]);return n?h.jsx(re,{children:"Loading..."}):h.jsxs(Bt,{spacing:3,children:[h.jsx(vb,{items:[{name:"Bridges",to:_t.bridges},{name:"Startup Order",to:_t.startup}]}),h.jsxs(oe,{display:"flex",alignItems:"center",gap:2,children:[h.jsx(Vm,{color:"primary",fontSize:"large"}),h.jsxs(oe,{children:[h.jsx(re,{variant:"h5",fontWeight:600,children:"Startup Order"}),h.jsx(re,{variant:"body2",color:"text.secondary",children:"Drag and drop bridges to set the startup order. Lower positions start first."})]})]}),s&&h.jsx(Ut,{severity:"info",action:h.jsx(lt,{color:"inherit",size:"small",startIcon:h.jsx(o6,{}),onClick:u,children:"Save Changes"}),children:"You have unsaved changes to the startup order."}),h.jsx(wct,{sensors:l,collisionDetection:wlt,onDragEnd:c,children:h.jsx(Pct,{items:f,strategy:Ict,children:h.jsx(Bt,{spacing:1,children:i.map((p,g)=>h.jsx(Gct,{bridge:p,index:g},p.id))})})}),i.length===0&&h.jsx(re,{color:"text.secondary",textAlign:"center",py:4,children:"No bridges configured yet."}),s&&i.length>0&&h.jsx(oe,{display:"flex",justifyContent:"flex-end",children:h.jsx(lt,{variant:"contained",startIcon:h.jsx(o6,{}),onClick:u,children:"Save Startup Order"})})]})},ak="https://riddix.github.io/home-assistant-matter-hub",_t={dashboard:"/",bridges:"/bridges",bridge:e=>`/bridges/${e}`,createBridge:"/bridges/create",areaSetup:"/bridges/area-setup",editBridge:e=>`/bridges/${e}/edit`,devices:"/devices",networkMap:"/network-map",health:"/health",labels:"/labels",lockCredentials:"/lock-credentials",settings:"/settings",startup:"/startup",githubRepository:"https://github.com/riddix/home-assistant-matter-hub/",documentation:ak,faq:{multiFabric:`${ak}/connect-multiple-fabrics`,bridgeConfig:`${ak}/bridge-configuration`}},Yct=[{path:"",element:h.jsx(B2e,{}),children:[{path:"",element:h.jsx(P9e,{})},{path:_t.bridges,element:h.jsx(O9e,{})},{path:_t.createBridge,element:h.jsx(Aet,{})},{path:_t.areaSetup,element:h.jsx(gve,{})},{path:_t.bridge(":bridgeId"),element:h.jsx(n8e,{})},{path:_t.editBridge(":bridgeId"),element:h.jsx(ket,{})},{path:_t.devices,element:h.jsx(Q9e,{})},{path:_t.networkMap,element:h.jsx(elt,{})},{path:_t.health,element:h.jsx(Iet,{})},{path:_t.labels,element:h.jsx(Let,{})},{path:_t.lockCredentials,element:h.jsx(Uet,{})},{path:_t.settings,element:h.jsx(olt,{})},{path:_t.startup,element:h.jsx(Kct,{})},{path:"*",element:h.jsx(Vet,{})}]}],Xct={items:{isInitialized:!1,isLoading:!1}},Zct=YO(Xct,e=>{e.addCase(ko.pending,t=>{t.items.isLoading=!0}).addCase(ko.rejected,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=void 0,t.items.error=n.error}).addCase(ko.fulfilled,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=n.payload,t.items.error=void 0}).addCase(GX.fulfilled,(t,n)=>{t.items.content?.push(n.payload)}).addCase(YX.fulfilled,(t,n)=>{const r=t.items.content?.findIndex(i=>i.id===n.payload.id)??-1;r!==-1&&(t.items.content[r]=n.payload)}).addCase(XX.fulfilled,(t,n)=>{const r=t.items.content?.findIndex(i=>i.id===n.payload.id)??-1;r!==-1&&(t.items.content[r]=n.payload)}).addCase(KX.fulfilled,(t,n)=>{if(t.items.content){const r=t.items.content.findIndex(i=>i.id===n.meta.arg);r!==-1&&t.items.content.splice(r,1)}}).addCase(ZX,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=n.payload,t.items.error=void 0}).addCase(JX,(t,n)=>{if(t.items.content){const r=t.items.content.findIndex(i=>i.id===n.payload.id);r!==-1?t.items.content[r]=n.payload:t.items.content.push(n.payload)}})}),Jct={byBridge:{}},Qct=YO(Jct,e=>{e.addCase(vu.pending,(t,n)=>{t.byBridge[n.meta.arg]=lk(t.byBridge[n.meta.arg],n)}).addCase(vu.rejected,(t,n)=>{t.byBridge[n.meta.arg]=lk(t.byBridge[n.meta.arg],n)}).addCase(vu.fulfilled,(t,n)=>{t.byBridge[n.meta.arg]=lk(t.byBridge[n.meta.arg],n)})}),eut={isInitialized:!1,isLoading:!1,content:void 0,error:void 0},lk=YO(eut,e=>{e.addCase(vu.pending,t=>{t.isLoading=!0}).addCase(vu.rejected,(t,n)=>{t.isInitialized=!0,t.isLoading=!1,t.content=void 0,t.error=n.error}).addCase(vu.fulfilled,(t,n)=>{t.isInitialized=!0,t.isLoading=!1,t.content=n.payload,t.error=void 0})}),tut=w2e({reducer:{bridges:Zct,devices:Qct}}),$I=oge({createStyledComponent:me("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${ye(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),useThemeProps:e=>ot({props:e,name:"MuiContainer"})});function nut(e){return Qe("MuiToolbar",e)}tt("MuiToolbar",["root","gutters","regular","dense"]);const rut=e=>{const{classes:t,disableGutters:n,variant:r}=e;return et({root:["root",!n&&"gutters",r]},nut,t)},iut=me("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(Ge(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),nce=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiToolbar"}),{className:i,component:o="div",disableGutters:s=!1,variant:a="regular",...l}=r,c={...r,component:o,disableGutters:s,variant:a},u=rut(c);return h.jsx(iut,{as:o,className:Te(u.root,i),ref:n,ownerState:c,...l})});class out extends _.Component{constructor(t){super(t),this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,n){console.error("ErrorBoundary caught:",t,n.componentStack)}render(){return this.state.hasError?h.jsxs(oe,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"60vh",gap:2,p:4,children:[h.jsx(aT,{color:"error",sx:{fontSize:64}}),h.jsx(re,{variant:"h5",fontWeight:600,children:"Something went wrong"}),h.jsx(re,{variant:"body2",color:"text.secondary",textAlign:"center",maxWidth:480,children:this.state.error?.message??"An unexpected error occurred."}),h.jsx(lt,{variant:"contained",onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},children:"Reload Page"})]}):this.props.children}}const sut="home-assistant-matter-hub",aut={name:sut};function rce(){const e="2.1.0-alpha.453",[t,n]=_.useState(null);_.useEffect(()=>{fetch("api/health").then(i=>i.ok?i.json():null).then(i=>{i?.version&&n(i.version)}).catch(()=>{})},[]);const r=_.useMemo(()=>!t||e==="0.0.0-dev"?!1:e!==t,[t]);return _.useMemo(()=>({name:aut.name,version:t??e,frontendVersion:e,backendVersion:t,versionMismatch:r}),[t,r])}const lut=[{name:"GitHub",url:_t.githubRepository},{name:"Documentation",url:_t.documentation}],cut=()=>h.jsxs($I,{sx:{mt:16,mb:4},children:[h.jsx(li,{sx:{mt:4,mb:4}}),h.jsx(it,{container:!0,spacing:2,justifyContent:"center",children:lut.map((e,t)=>h.jsx(it,{size:{xs:12,sm:"auto"},children:h.jsx(lt,{fullWidth:!0,size:"small",variant:"outlined",component:uw,href:e.url,target:"_blank",children:e.name})},t.toString()))})]});function uut(e){return Qe("MuiAppBar",e)}tt("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const dut=e=>{const{color:t,position:n,classes:r}=e,i={root:["root",`color${ye(t)}`,`position${ye(n)}`]};return et(i,uut,r)},qK=(e,t)=>e?`${e.replace(")","")}, ${t})`:t,fut=me(Ur,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${ye(n.position)}`],t[`color${ye(n.color)}`]]}})(Ge(({theme:e})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit",color:"var(--AppBar-color)"}},{props:{color:"default"},style:{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[100],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[100]),...e.applyStyles("dark",{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[900],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[900])})}},...Object.entries(e.palette).filter(Bn(["contrastText"])).map(([t])=>({props:{color:t},style:{"--AppBar-background":(e.vars??e).palette[t].main,"--AppBar-color":(e.vars??e).palette[t].contrastText}})),{props:t=>t.enableColorOnDark===!0&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:t=>t.enableColorOnDark===!1&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundColor:e.vars?qK(e.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:e.vars?qK(e.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundImage:"none"})}}]}))),hut=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiAppBar"}),{className:i,color:o="primary",enableColorOnDark:s=!1,position:a="fixed",...l}=r,c={...r,color:o,position:a,enableColorOnDark:s},u=dut(c);return h.jsx(fut,{square:!0,component:"header",ownerState:c,elevation:4,className:Te(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});function put(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=rl(t);let s;if(t.fakeTransform)s=t.fakeTransform;else{const c=o.getComputedStyle(t);s=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let a=0,l=0;if(s&&s!=="none"&&typeof s=="string"){const c=s.split("(")[1].split(")")[0].split(",");a=parseInt(c[4],10),l=parseInt(c[5],10)}return e==="left"?i?`translateX(${i.right+a-r.left}px)`:`translateX(${o.innerWidth+a-r.left}px)`:e==="right"?i?`translateX(-${r.right-i.left-a}px)`:`translateX(-${r.left+r.width-a}px)`:e==="up"?i?`translateY(${i.bottom+l-r.top}px)`:`translateY(${o.innerHeight+l-r.top}px)`:i?`translateY(-${r.top-i.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function mut(e){return typeof e=="function"?e():e}function O5(e,t,n){const r=mut(n),i=put(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const gut=_.forwardRef(function(t,n){const r=io(),i={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:s,appear:a=!0,children:l,container:c,direction:u="down",easing:f=i,in:p,onEnter:g,onEntered:y,onEntering:b,onExit:v,onExited:S,onExiting:C,style:w,timeout:A=o,TransitionComponent:E=Ma,...D}=t,O=_.useRef(null),T=Mr(bf(l),O,n),I=U=>K=>{U&&(K===void 0?U(O.current):U(O.current,K))},L=I((U,K)=>{O5(u,U,c),UO(U),g&&g(U,K)}),$=I((U,K)=>{const X=Jd({timeout:A,style:w,easing:f},{mode:"enter"});U.style.webkitTransition=r.transitions.create("-webkit-transform",{...X}),U.style.transition=r.transitions.create("transform",{...X}),U.style.webkitTransform="none",U.style.transform="none",b&&b(U,K)}),R=I(y),F=I(C),P=I(U=>{const K=Jd({timeout:A,style:w,easing:f},{mode:"exit"});U.style.webkitTransition=r.transitions.create("-webkit-transform",K),U.style.transition=r.transitions.create("transform",K),O5(u,U,c),v&&v(U)}),z=I(U=>{U.style.webkitTransition="",U.style.transition="",S&&S(U)}),N=U=>{s&&s(O.current,U)},V=_.useCallback(()=>{O.current&&O5(u,O.current,c)},[u,c]);return _.useEffect(()=>{if(p||u==="down"||u==="right")return;const U=FO(()=>{O.current&&O5(u,O.current,c)}),K=rl(O.current);return K.addEventListener("resize",U),()=>{U.clear(),K.removeEventListener("resize",U)}},[u,p,c]),_.useEffect(()=>{p||V()},[p,V]),h.jsx(E,{nodeRef:O,onEnter:L,onEntered:R,onEntering:$,onExit:P,onExited:z,onExiting:F,addEndListener:N,appear:a,in:p,timeout:A,...D,children:(U,{ownerState:K,...X})=>_.cloneElement(l,{ref:T,style:{visibility:U==="exited"&&!p?"hidden":void 0,...w,...l.props.style},...X})})});function yut(e){return Qe("MuiDrawer",e)}tt("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const ice=(e,t)=>{const{ownerState:n}=e;return[t.root,(n.variant==="permanent"||n.variant==="persistent")&&t.docked,n.variant==="temporary"&&t.modal]},but=e=>{const{classes:t,anchor:n,variant:r}=e,i={root:["root",`anchor${ye(n)}`],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${ye(n)}`,r!=="temporary"&&`paperAnchorDocked${ye(n)}`]};return et(i,yut,t)},vut=me(uT,{name:"MuiDrawer",slot:"Root",overridesResolver:ice})(Ge(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),xut=me("div",{shouldForwardProp:Bi,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:ice})({flex:"0 0 auto"}),Sut=me(Ur,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`paperAnchor${ye(n.anchor)}`],n.variant!=="temporary"&&t[`paperAnchorDocked${ye(n.anchor)}`]]}})(Ge(({theme:e})=>({overflowY:"auto",display:"flex",flexDirection:"column",height:"100%",flex:"1 0 auto",zIndex:(e.vars||e).zIndex.drawer,WebkitOverflowScrolling:"touch",position:"fixed",top:0,outline:0,variants:[{props:{anchor:"left"},style:{left:0}},{props:{anchor:"top"},style:{top:0,left:0,right:0,height:"auto",maxHeight:"100%"}},{props:{anchor:"right"},style:{right:0}},{props:{anchor:"bottom"},style:{top:"auto",left:0,bottom:0,right:0,height:"auto",maxHeight:"100%"}},{props:({ownerState:t})=>t.anchor==="left"&&t.variant!=="temporary",style:{borderRight:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="top"&&t.variant!=="temporary",style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="right"&&t.variant!=="temporary",style:{borderLeft:`1px solid ${(e.vars||e).palette.divider}`}},{props:({ownerState:t})=>t.anchor==="bottom"&&t.variant!=="temporary",style:{borderTop:`1px solid ${(e.vars||e).palette.divider}`}}]}))),oce={left:"right",right:"left",top:"down",bottom:"up"};function wut(e){return["left","right"].includes(e)}function Cut({direction:e},t){return e==="rtl"&&wut(t)?oce[t]:t}const Eut=_.forwardRef(function(t,n){const r=ot({props:t,name:"MuiDrawer"}),i=io(),o=yf(),s={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:l,children:c,className:u,elevation:f=16,hideBackdrop:p=!1,ModalProps:{BackdropProps:g,...y}={},onClose:b,open:v=!1,PaperProps:S={},SlideProps:C,TransitionComponent:w,transitionDuration:A=s,variant:E="temporary",slots:D={},slotProps:O={},...T}=r,I=_.useRef(!1);_.useEffect(()=>{I.current=!0},[]);const L=Cut({direction:o?"rtl":"ltr"},a),R={...r,anchor:a,elevation:f,open:v,variant:E,...T},F=but(R),P={slots:{transition:w,...D},slotProps:{paper:S,transition:C,...O,backdrop:BO(O.backdrop||{...l,...g},{transitionDuration:A})}},[z,N]=ut("root",{ref:n,elementType:vut,className:Te(F.root,F.modal,u),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...P,...T,...y},additionalProps:{open:v,onClose:b,hideBackdrop:p,slots:{backdrop:P.slots.backdrop},slotProps:{backdrop:P.slotProps.backdrop}}}),[V,U]=ut("paper",{elementType:Sut,shouldForwardComponentProp:!0,className:Te(F.paper,S.className),ownerState:R,externalForwardedProps:P,additionalProps:{elevation:E==="temporary"?f:0,square:!0,...E==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[K,X]=ut("docked",{elementType:xut,ref:n,className:Te(F.root,F.docked,u),ownerState:R,externalForwardedProps:P,additionalProps:T}),[B,W]=ut("transition",{elementType:gut,ownerState:R,externalForwardedProps:P,additionalProps:{in:v,direction:oce[L],timeout:A,appear:I.current}}),q=h.jsx(V,{...U,children:c});if(E==="permanent")return h.jsx(K,{...X,children:q});const H=h.jsx(B,{...W,children:q});return E==="persistent"?h.jsx(K,{...X,children:H}):h.jsx(z,{...N,children:H})}),Aut=rX({themeId:fa}),kut={error:Sf,warn:dw,info:lT,debug:Mw},_ut=({open:e,onClose:t})=>{const n=io(),r=_.useMemo(()=>({error:n.palette.error.main,warn:n.palette.warning.main,info:n.palette.info.main,debug:n.palette.secondary.main}),[n]),[i,o]=_.useState([]),[s,a]=_.useState(!0),[l,c]=_.useState("error,warn,info".split(",")),[u,f]=_.useState(""),[p,g]=_.useState(!0),y=_.useCallback(async()=>{try{const w=new URLSearchParams({level:l.join(","),limit:"500",...u&&{search:u}}),A=await fetch(`api/logs?${w}`);if(A.ok){const E=await A.json();o(E.entries)}}catch(w){console.error("Failed to fetch logs:",w)}finally{a(!1)}},[l,u]);_.useEffect(()=>{e&&y()},[e,y]),_.useEffect(()=>{if(!p||!e)return;const w=setInterval(y,5e3);return()=>clearInterval(w)},[p,e,y]);const b=w=>{c(Array.isArray(w.target.value)?w.target.value:[w.target.value])},v=w=>{f(w.target.value)},S=async()=>{try{await fetch("api/logs",{method:"DELETE"}),o([])}catch(w){console.error("Failed to clear logs:",w)}},C=w=>{const A=kut[w]||lT;return h.jsx(A,{sx:{fontSize:16,color:r[w]}})};return h.jsxs(al,{open:e,onClose:t,maxWidth:"lg",fullWidth:!0,children:[h.jsxs(cl,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(Mw,{}),"System Logs",h.jsx(oe,{sx:{flexGrow:1}}),h.jsx(Qt,{title:"Auto Refresh",children:h.jsx(vt,{label:p?"Auto":"Manual",color:p?"success":"default",size:"small",onClick:()=>g(!p),sx:{cursor:"pointer"}})}),h.jsx(en,{onClick:t,children:h.jsx(DJ,{})})]}),h.jsxs(ll,{children:[h.jsx(Bt,{spacing:2,sx:{mb:2},children:h.jsxs(Bt,{direction:"row",spacing:2,alignItems:"center",children:[h.jsxs(ha,{size:"small",sx:{minWidth:200},children:[h.jsx(fc,{children:"Log Level"}),h.jsxs(aa,{value:l,label:"Log Level",onChange:b,multiple:!0,renderValue:w=>h.jsx(oe,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:(Array.isArray(w)?w:[w]).map(A=>h.jsx(vt,{label:A.toUpperCase(),size:"small",sx:{backgroundColor:r[A],color:"white"}},A))}),children:[h.jsx(nr,{value:"error",children:"Error"}),h.jsx(nr,{value:"warn",children:"Warning"}),h.jsx(nr,{value:"info",children:"Info"}),h.jsx(nr,{value:"debug",children:"Debug"})]})]}),h.jsx(Nr,{size:"small",placeholder:"Search logs...",value:u,onChange:v,sx:{flexGrow:1}}),h.jsx(lt,{variant:"outlined",onClick:y,children:"Refresh"}),h.jsx(lt,{variant:"outlined",color:"error",onClick:S,children:"Clear"})]})}),h.jsx(oe,{sx:{height:400,overflow:"auto",backgroundColor:"background.paper",border:1,borderColor:"divider",borderRadius:1,p:1},children:s?h.jsx(oe,{sx:{display:"flex",justifyContent:"center",p:4},children:h.jsx(re,{children:"Loading logs..."})}):i.length===0?h.jsx(oe,{sx:{display:"flex",justifyContent:"center",p:4},children:h.jsx(re,{color:"text.secondary",children:"No logs found"})}):h.jsx(Bt,{spacing:1,children:i.map((w,A)=>h.jsxs(oe,{sx:{p:1,borderRadius:1,backgroundColor:"action.hover",fontFamily:"monospace",fontSize:"0.875rem",wordBreak:"break-all"},children:[h.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[C(w.level),h.jsx(re,{variant:"caption",color:"text.secondary",children:new Date(w.timestamp).toLocaleString()}),h.jsx(vt,{label:w.level.toUpperCase(),size:"small",sx:{backgroundColor:r[w.level],color:n.palette.getContrastText(r[w.level]??n.palette.grey[500]),fontSize:"0.7rem",height:20}})]}),h.jsx(re,{sx:{ml:3},children:w.message}),w.context&&h.jsx(re,{sx:{ml:3,color:"text.secondary",fontSize:"0.8rem"},children:JSON.stringify(w.context,null,2)})]},`${w.timestamp}-${w.level}-${A}`))})})]}),h.jsx(vc,{children:h.jsx(lt,{onClick:t,children:"Close"})})]})};function GK(){const{isConnected:e}=eZ(),[t,n]=_.useState(null),[r,i]=_.useState(!1);_.useEffect(()=>{const y=async()=>{try{const v=await fetch("api/health");if(v.ok){const S=await v.json();n(S),i(!1)}else i(!0)}catch{i(!0)}};y();const b=setInterval(y,3e4);return()=>clearInterval(b)},[]);const o=y=>{const b=Math.floor(y/3600),v=Math.floor(y%3600/60);return b>0?`${b}h ${v}m`:`${v}m`},s=t?.status==="healthy"&&!r,a=t?.services?.bridges,l=a&&a.total>0&&a.running===a.total,c=a&&a.total===0,u=t?h.jsxs(oe,{sx:{p:.5},children:[h.jsxs("div",{children:[h.jsx("strong",{children:"Version:"})," ",t.version??"Unknown"]}),h.jsxs("div",{children:[h.jsx("strong",{children:"Uptime:"})," ",o(t.uptime??0)]}),t.services?.bridges&&h.jsxs("div",{children:[h.jsx("strong",{children:"Bridges:"})," ",t.services.bridges.running??0,"/",t.services.bridges.total??0," running",(t.services.bridges.stopped??0)>0&&` (${t.services.bridges.stopped} stopped)`]}),t.services?.homeAssistant&&h.jsxs("div",{children:[h.jsx("strong",{children:"Home Assistant:"})," ",t.services.homeAssistant.connected?"Connected":"Disconnected"]}),h.jsxs("div",{children:[h.jsx("strong",{children:"WebSocket:"})," ",e?"Connected":"Disconnected"]})]}):"Loading health status...",f=()=>r||!s?h.jsx(Sf,{fontSize:"small"}):l?h.jsx(pl,{fontSize:"small"}):h.jsx(gw,{fontSize:"small"}),p=()=>r||!s?"error":!l||!e?"warning":"success",g=()=>r?"Error":s?e?c?"No Bridges":l?"Online":"Starting":"Offline":"Unhealthy";return h.jsx(Qt,{title:u,arrow:!0,children:h.jsx(vt,{icon:f(),label:g(),color:p(),size:"small",variant:"filled",sx:{borderRadius:1,fontWeight:600,"& .MuiChip-icon":{color:"inherit"}}})})}const Dut=e=>_.createElement("svg",{viewBox:"0 0 91 89",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("g",{style:{display:"inline"}},_.createElement("path",{style:{fill:"#18bcf2",fillOpacity:1,strokeWidth:.266194},d:"m 49.149143,1.473171 38.513568,38.536435 c 0,0 1.248354,1.186052 2.207681,3.092371 0.959329,1.906323 1.10864,4.600698 1.10864,4.600698 v 36.786372 c 0,0 -0.01549,1.748506 -1.49842,3.050572 -1.482931,1.302064 -3.333077,1.362947 -3.333077,1.362947 l -81.325658,7.7e-5 c 0,0 -1.7523855,-0.0091 -3.17112,-1.352526 C -0.07808495,85.913164 0.05953025,84.487808 0.05953025,84.487808 V 47.704546 c 0,0 -0.0018381,-2.218618 0.95921785,-4.315832 0.9610554,-2.097209 2.3010618,-3.355005 2.3010618,-3.355005 L 41.545959,1.4719546 c 0,0 1.465224,-1.46837077 3.753488,-1.46837077 2.288268,0 3.849696,1.46958717 3.849696,1.46958717 z"}),_.createElement("path",{style:{fill:"#ffffff",fillOpacity:1,strokeWidth:.175841},d:"m 31.689717,32.051124 c 2.813363,2.331095 6.157331,3.89845 9.721813,4.556421 V 17.180647 l 3.873694,-2.282955 3.870527,2.282955 V 36.60772 c 3.565364,-0.658847 6.910387,-2.226204 9.725159,-4.556417 l 7.032345,4.154609 c -11.437354,11.557779 -29.852321,11.557779 -41.290025,0 z m 8.546732,49.60988 C 44.314996,65.760441 35.09933,49.470196 19.574984,45.139543 v 8.312381 c 3.383916,1.32244 6.386113,3.496288 8.728705,6.320026 L 11.83076,69.485301 v 4.56907 l 3.873697,2.270836 16.469936,-9.713534 c 1.224356,3.48294 1.56683,7.225375 0.996449,10.879778 z M 70.977694,45.139543 c -15.515726,4.34014 -24.72189,20.626696 -20.643519,36.521461 l 7.047658,-4.15742 c -0.569325,-3.654411 -0.2265,-7.3965 0.996449,-10.87979 l 16.457611,9.701233 3.870711,-2.283125 v -4.55677 L 62.233673,59.77195 c 2.342772,-2.822684 5.34497,-4.996533 8.728708,-6.320026 z"}))),Out=e=>{const t=rce();return h.jsxs(oe,{component:yc,to:_t.dashboard,sx:{display:"flex",alignItems:"center",justifyContent:e.large?"flex-start":"center",flexGrow:1,textDecoration:"none",color:"inherit"},children:[h.jsx(Dut,{style:{height:"40px"}}),h.jsx(re,{variant:"inherit",component:"span",sx:{mr:1,ml:1},children:t.name.split("-").map(ye).join("-")}),e.large&&h.jsx(re,{variant:"caption",component:"span",children:t.version})]})},Tut=()=>{const e=Aut("(min-width:600px)"),{mode:t,setMode:n}=QS(),[r,i]=_.useState(!1),[o,s]=_.useState(!1),a=ju(),l=()=>{n(t==="dark"?"light":"dark")},c=[{label:"Dashboard",icon:h.jsx(RT,{}),to:_t.dashboard},{label:"Bridges",icon:h.jsx(hy,{}),to:_t.bridges},{label:"All Devices",icon:h.jsx(Bs,{}),to:_t.devices},{label:"Network Map",icon:h.jsx(OT,{}),to:_t.networkMap},{label:"Startup Order",icon:h.jsx(Vm,{}),to:_t.startup},{label:"Lock Credentials",icon:h.jsx(bu,{}),to:_t.lockCredentials},{label:"Filter Reference",icon:h.jsx(IT,{}),to:_t.labels},{label:"Settings",icon:h.jsx(Eb,{}),to:_t.settings},{label:t==="dark"?"Light Mode":"Dark Mode",icon:t==="dark"?h.jsx(D8e,{}):h.jsx(g8e,{}),onClick:l},{label:"System Logs",icon:h.jsx(Mw,{}),onClick:()=>i(!0)},{label:"Health Dashboard",icon:h.jsx(fT,{}),to:_t.health}],u=f=>{s(!1),f.onClick?f.onClick():f.to&&a(f.to)};return h.jsxs(oe,{children:[h.jsx(hut,{sx:{height:"72px"},children:h.jsx(nce,{sx:{paddingLeft:"0 !important",paddingRight:"0 !important"},children:h.jsxs($I,{sx:{padding:2,height:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx(Out,{large:e}),e?h.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:1},children:[c.map(f=>f.to?h.jsx(Qt,{title:f.label,children:h.jsx(en,{component:yc,to:f.to,sx:{color:"inherit"},children:f.icon})},f.label):h.jsx(Qt,{title:f.label,children:h.jsx(en,{onClick:f.onClick,sx:{color:"inherit"},children:f.icon})},f.label)),h.jsx(GK,{})]}):h.jsxs(oe,{sx:{display:"flex",alignItems:"center",gap:.5},children:[h.jsx(GK,{}),h.jsx(en,{onClick:()=>s(!0),sx:{color:"inherit"},children:h.jsx(O8e,{})})]})]})})}),h.jsx(Eut,{anchor:"right",open:o,onClose:()=>s(!1),children:h.jsx(gl,{sx:{width:250},children:c.map(f=>h.jsxs(Ive,{onClick:()=>u(f),children:[h.jsx(qa,{children:f.icon}),h.jsx(sa,{primary:f.label})]},f.label))})}),h.jsx(_ut,{open:r,onClose:()=>i(!1)})]})},Mut=()=>{const{versionMismatch:e,frontendVersion:t,backendVersion:n}=rce(),{isConnected:r}=eZ();return h.jsxs(oe,{children:[h.jsx(Tut,{}),h.jsx(nce,{}),e&&h.jsxs(Ut,{severity:"warning",variant:"filled",sx:{borderRadius:0},action:h.jsx(lt,{color:"inherit",size:"small",onClick:()=>window.location.reload(),children:"Reload"}),children:["Version mismatch: frontend ",t,", backend ",n,". Please reload to get the latest UI."]}),!r&&h.jsx(Ut,{severity:"error",variant:"filled",sx:{borderRadius:0},children:"Connection lost — data may be outdated. Reconnecting…"}),h.jsx($I,{sx:{p:2},children:h.jsx(out,{children:h.jsx(EY,{})})}),h.jsx(cut,{})]})},Rut=XS({colorSchemes:{light:{palette:{primary:{main:"#1976d2",light:"#42a5f5",dark:"#1565c0"},secondary:{main:"#9c27b0",light:"#ba68c8",dark:"#7b1fa2"},background:{default:"#f5f5f5",paper:"#ffffff"}}},dark:{palette:{primary:{main:"#90caf9",light:"#e3f2fd",dark:"#42a5f5"},secondary:{main:"#ce93d8",light:"#f3e5f5",dark:"#ab47bc"},background:{default:"#121212",paper:"#1e1e1e"}}}},typography:{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif',h1:{fontSize:"2.5rem",fontWeight:500},h2:{fontSize:"2rem",fontWeight:500},h3:{fontSize:"1.75rem",fontWeight:500},h4:{fontSize:"1.5rem",fontWeight:500},h5:{fontSize:"1.25rem",fontWeight:500},h6:{fontSize:"1rem",fontWeight:500}},shape:{borderRadius:8},components:{MuiCard:{styleOverrides:{root:{transition:"transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out","&:hover":{transform:"translateY(-2px)",boxShadow:"0 4px 20px rgba(0,0,0,0.12)"}}}},MuiButton:{styleOverrides:{root:{textTransform:"none",fontWeight:500}}},MuiChip:{styleOverrides:{root:{fontWeight:500}}},MuiAppBar:{styleOverrides:{root:{backgroundImage:"none"}}}}});let T4=document.getElementsByTagName("base")[0]?.href?.replace(/\/$/,"");T4?.startsWith("http")&&(T4=new URL(T4).pathname);const Iut=npe([{path:"/",element:h.jsx(Mut,{}),children:Yct}],{basename:T4});xde.createRoot(document.getElementById("root")).render(h.jsx(_.StrictMode,{children:h.jsx(Lde,{store:tut,children:h.jsxs(g1e,{theme:Rut,children:[h.jsx(d1e,{}),h.jsx(bX,{styles:{".rjsf-field-array > .MuiFormControl-root > .MuiPaper-root > .MuiBox-root > .MuiGrid-root > .MuiGrid-root:has(> .MuiBox-root > .MuiPaper-root > .MuiBox-root > .rjsf-field)":{overflow:"initial !important",flexGrow:1}}}),h.jsx(F2e,{children:h.jsx(Mye,{children:h.jsx(ppe,{router:Iut})})})]})})}));
|