@riddix/hamh 2.1.0-alpha.481 → 2.1.0-alpha.482

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 UF(e){return typeof e=="number"?`${(e*100).toFix
144
144
  animation: ${dD} 1.4s linear infinite;
145
145
  `:null,Kxe=typeof fD!="string"?Q0`
146
146
  animation: ${fD} 1.4s ease-in-out infinite;
147
- `:null,Yxe=e=>{const{classes:t,variant:n,color:r,disableShrink:i}=e,o={root:["root",n,`color${be(r)}`],svg:["svg"],track:["track"],circle:["circle",`circle${be(n)}`,i&&"circleDisableShrink"]};return nt(o,qxe,t)},Xxe=me("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${be(n.color)}`]]}})(qe(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Gxe||{animation:`${dD} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Nn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),Jxe=me("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),Zxe=me("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${be(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(qe(({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:Kxe||{animation:`${fD} 1.4s ease-in-out infinite`}}]}))),Qxe=me("circle",{name:"MuiCircularProgress",slot:"Track"})(qe(({theme:e})=>({stroke:"currentColor",opacity:(e.vars||e).palette.action.activatedOpacity}))),mr=k.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:d=0,variant:p="indeterminate",...g}=r,y={...r,color:o,disableShrink:s,size:l,thickness:u,value:d,variant:p,enableTrackSlot:a},b=Yxe(y),v={},S={},C={};if(p==="determinate"){const w=2*Math.PI*((Ja-u)/2);v.strokeDasharray=w.toFixed(3),C["aria-valuenow"]=Math.round(d),v.strokeDashoffset=`${((100-d)/100*w).toFixed(3)}px`,S.transform="rotate(-90deg)"}return h.jsx(Xxe,{className:Oe(b.root,i),style:{width:l,height:l,...S,...c},ownerState:y,ref:n,role:"progressbar",...C,...g,children:h.jsxs(Jxe,{className:b.svg,ownerState:y,viewBox:`${Ja/2} ${Ja/2} ${Ja} ${Ja}`,children:[a?h.jsx(Qxe,{className:b.track,ownerState:y,cx:Ja,cy:Ja,r:(Ja-u)/2,fill:"none",strokeWidth:u,"aria-hidden":"true"}):null,h.jsx(Zxe,{className:b.circle,style:v,ownerState:y,cx:Ja,cy:Ja,r:(Ja-u)/2,fill:"none",strokeWidth:u})]})})});function e3e(e){return tt("MuiIconButton",e)}const YF=rt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),t3e=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${be(r)}`,i&&`edge${be(i)}`,`size${be(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return nt(a,e3e,t)},n3e=me(ea,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${be(n.color)}`],n.edge&&t[`edge${be(n.edge)}`],t[`size${be(n.size)}`]]}})(qe(({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}}]})),qe(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(Nn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Nn()).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)}}],[`&.${YF.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${YF.loading}`]:{color:"transparent"}}))),r3e=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"}}]})),Vt=k.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:d,loading:p=null,loadingIndicator:g,...y}=r,b=Vu(d),v=g??h.jsx(mr,{"aria-labelledby":b,color:"inherit",size:16}),S={...r,edge:i,color:a,disabled:l,disableFocusRipple:c,loading:p,loadingIndicator:v,size:u},C=t3e(S);return h.jsxs(n3e,{id:p?b:d,className:Oe(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(r3e,{className:C.loadingIndicator,ownerState:S,children:p&&v})}),o]})}),i3e=Ae(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"})),o3e=Ae(h.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),s3e=Ae(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"})),a3e=Ae(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"})),WJ=Ae(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"})),l3e=e=>{const{variant:t,color:n,severity:r,classes:i}=e,o={root:["root",`color${be(n||r)}`,`${t}${be(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return nt(o,bxe,i)},c3e=me(Vr,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${be(n.color||n.severity)}`]]}})(qe(({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(Nn(["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),[`& .${qF.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(Nn(["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}`,[`& .${qF.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(Nn(["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)}}}))]}})),u3e=me("div",{name:"MuiAlert",slot:"Icon"})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),d3e=me("div",{name:"MuiAlert",slot:"Message"})({padding:"8px 0",minWidth:0,overflow:"auto"}),f3e=me("div",{name:"MuiAlert",slot:"Action"})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),XF={success:h.jsx(i3e,{fontSize:"inherit"}),warning:h.jsx(o3e,{fontSize:"inherit"}),error:h.jsx(s3e,{fontSize:"inherit"}),info:h.jsx(a3e,{fontSize:"inherit"})},Ft=k.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:d,iconMapping:p=XF,onClose:g,role:y="alert",severity:b="success",slotProps:v={},slots:S={},variant:C="standard",...w}=r,E={...r,color:l,severity:b,variant:C,colorSeverity:l||b},A=l3e(E),O={slots:{closeButton:c.CloseButton,closeIcon:c.CloseIcon,...S},slotProps:{...u,...v}},[_,T]=ht("root",{ref:n,shouldForwardComponentProp:!0,className:Oe(A.root,s),elementType:c3e,externalForwardedProps:{...O,...w},ownerState:E,additionalProps:{role:y,elevation:0}}),[I,P]=ht("icon",{className:A.icon,elementType:u3e,externalForwardedProps:O,ownerState:E}),[L,R]=ht("message",{className:A.message,elementType:d3e,externalForwardedProps:O,ownerState:E}),[N,$]=ht("action",{className:A.action,elementType:f3e,externalForwardedProps:O,ownerState:E}),[z,F]=ht("closeButton",{elementType:Vt,externalForwardedProps:O,ownerState:E}),[W,V]=ht("closeIcon",{elementType:WJ,externalForwardedProps:O,ownerState:E});return h.jsxs(_,{...T,children:[d!==!1?h.jsx(I,{...P,children:d||p[b]||XF[b]}):null,h.jsx(L,{...R,children:o}),i!=null?h.jsx(N,{...$,children:i}):null,i==null&&g?h.jsx(N,{...$,children:h.jsx(z,{size:"small","aria-label":a,title:a,color:"inherit",onClick:g,...F,children:h.jsx(W,{fontSize:"small",...V})})}):null]})});function h3e(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=e,s=zd();k.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=Vi((S,C)=>{r?.(S,C)}),l=Vi(S=>{!r||S==null||s.start(S,()=>{a(null,"timeout")})});k.useEffect(()=>(i&&l(t),s.clear),[i,t,l,s]);const c=S=>{r?.(S,"clickaway")},u=s.clear,d=k.useCallback(()=>{t!=null&&l(o??t*.5)},[t,o,l]),p=S=>C=>{const w=S.onBlur;w?.(C),d()},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),d()};return k.useEffect(()=>{if(!n&&i)return window.addEventListener("focus",d),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",d),window.removeEventListener("blur",u)}},[n,i,d,u]),{getRootProps:(S={})=>{const C={...to(e),...to(S)};return{role:"presentation",...S,...C,onBlur:p(C),onFocus:g(C),onMouseEnter:y(C),onMouseLeave:b(C)}},onClickAway:c}}function Of(e){return parseInt(k.version,10)>=19?e?.props?.ref||null:e?.ref||null}function JF(e){return e.substring(2).toLowerCase()}function p3e(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function qJ(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:i,touchEvent:o="onTouchEnd"}=e,s=k.useRef(!1),a=k.useRef(null),l=k.useRef(!1),c=k.useRef(!1);k.useEffect(()=>(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=Lr(Of(t),a),d=Vi(y=>{const b=c.current;c.current=!1;const v=Ii(a.current);if(!l.current||!a.current||"clientX"in y&&p3e(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)),k.useEffect(()=>{if(o!==!1){const y=JF(o),b=Ii(a.current),v=()=>{s.current=!0};return b.addEventListener(y,d),b.addEventListener("touchmove",v),()=>{b.removeEventListener(y,d),b.removeEventListener("touchmove",v)}}},[d,o]),r!==!1&&(g[r]=p(r)),k.useEffect(()=>{if(r!==!1){const y=JF(r),b=Ii(a.current);return b.addEventListener(y,d),()=>{b.removeEventListener(y,d)}}},[d,r]),k.cloneElement(t,g)}const AT=e=>e.scrollTop;function df(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 hD(e){return`scale(${e}, ${e**2})`}const m3e={entering:{opacity:1,transform:hD(1)},entered:{opacity:1,transform:"none"}},cE=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),p2=k.forwardRef(function(t,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:d,onExited:p,onExiting:g,style:y,timeout:b="auto",TransitionComponent:v=Wa,...S}=t,C=zd(),w=k.useRef(),E=co(),A=k.useRef(null),O=Lr(A,Of(o),n),_=z=>F=>{if(z){const W=A.current;F===void 0?z(W):z(W,F)}},T=_(u),I=_((z,F)=>{AT(z);const{duration:W,delay:V,easing:q}=df({style:y,timeout:b,easing:s},{mode:"enter"});let X;b==="auto"?(X=E.transitions.getAutoHeightDuration(z.clientHeight),w.current=X):X=W,z.style.transition=[E.transitions.create("opacity",{duration:X,delay:V}),E.transitions.create("transform",{duration:cE?X:X*.666,delay:V,easing:q})].join(","),l&&l(z,F)}),P=_(c),L=_(g),R=_(z=>{const{duration:F,delay:W,easing:V}=df({style:y,timeout:b,easing:s},{mode:"exit"});let q;b==="auto"?(q=E.transitions.getAutoHeightDuration(z.clientHeight),w.current=q):q=F,z.style.transition=[E.transitions.create("opacity",{duration:q,delay:W}),E.transitions.create("transform",{duration:cE?q:q*.666,delay:cE?W:W||q*.333,easing:V})].join(","),z.style.opacity=0,z.style.transform=hD(.75),d&&d(z)}),N=_(p),$=z=>{b==="auto"&&C.start(w.current||0,z),r&&r(A.current,z)};return h.jsx(v,{appear:i,in:a,nodeRef:A,onEnter:I,onEntered:P,onEntering:T,onExit:R,onExited:N,onExiting:L,addEndListener:$,timeout:b==="auto"?null:b,...S,children:(z,{ownerState:F,...W})=>k.cloneElement(o,{style:{opacity:0,transform:hD(.75),visibility:z==="exited"&&!a?"hidden":void 0,...m3e[z],...y,...o.props.style},ref:O,...W})})});p2&&(p2.muiSupportAuto=!0);function g3e(e){return tt("MuiSnackbarContent",e)}rt("MuiSnackbarContent",["root","message","action"]);const y3e=e=>{const{classes:t}=e;return nt({root:["root"],action:["action"],message:["message"]},g3e,t)},b3e=me(Vr,{name:"MuiSnackbarContent",slot:"Root"})(qe(({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(f2(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:f2(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),v3e=me("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),x3e=me("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),S3e=k.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=y3e(c);return h.jsxs(b3e,{role:a,elevation:6,className:Oe(u.root,o),ownerState:c,ref:n,...l,children:[h.jsx(v3e,{className:u.message,ownerState:c,children:s}),i?h.jsx(x3e,{className:u.action,ownerState:c,children:i}):null]})});function w3e(e){return tt("MuiSnackbar",e)}rt("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const C3e=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${be(n.vertical)}${be(n.horizontal)}`]};return nt(r,w3e,t)},E3e=me("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${be(n.anchorOrigin.vertical)}${be(n.anchorOrigin.horizontal)}`]]}})(qe(({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%)"}}}]}))),Tw=k.forwardRef(function(t,n){const r=ot({props:t,name:"MuiSnackbar"}),i=co(),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:d,ClickAwayListenerProps:p,ContentProps:g,disableWindowBlurListener:y=!1,message:b,onBlur:v,onClose:S,onFocus:C,onMouseEnter:w,onMouseLeave:E,open:A,resumeHideDuration:O,slots:_={},slotProps:T={},TransitionComponent:I,transitionDuration:P=o,TransitionProps:{onEnter:L,onExited:R,...N}={},...$}=r,z={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:y,TransitionComponent:I,transitionDuration:P},F=C3e(z),{getRootProps:W,onClickAway:V}=h3e(z),[q,X]=k.useState(!0),B=ee=>{X(!0),R&&R(ee)},U=(ee,ae)=>{X(!1),L&&L(ee,ae)},Y={slots:{transition:I,..._},slotProps:{content:g,clickAwayListener:p,transition:N,...T}},[H,G]=ht("root",{ref:n,className:[F.root,d],elementType:E3e,getSlotProps:W,externalForwardedProps:{...Y,...$},ownerState:z}),[J,{ownerState:se,...Q}]=ht("clickAwayListener",{elementType:qJ,externalForwardedProps:Y,getSlotProps:ee=>({onClickAway:(...ae)=>{const fe=ae[0];ee.onClickAway?.(...ae),!fe?.defaultMuiPrevented&&V(...ae)}}),ownerState:z}),[ie,ne]=ht("content",{elementType:S3e,shouldForwardComponentProp:!0,externalForwardedProps:Y,additionalProps:{message:b,action:s},ownerState:z}),[Z,re]=ht("transition",{elementType:p2,externalForwardedProps:Y,getSlotProps:ee=>({onEnter:(...ae)=>{ee.onEnter?.(...ae),U(...ae)},onExited:(...ae)=>{ee.onExited?.(...ae),B(...ae)}}),additionalProps:{appear:!0,in:A,timeout:P,direction:a==="top"?"down":"up"},ownerState:z});return!A&&q?null:h.jsx(J,{...Q,..._.clickAwayListener&&{ownerState:se},children:h.jsx(H,{...G,children:h.jsx(Z,{...re,children:u||h.jsx(ie,{...ne})})})})}),GJ=k.createContext({show:()=>{}});let A3e=0;const k3e=e=>{const[t,n]=k.useState([]),r=k.useCallback(o=>{n(s=>[...s,{...o,autoHideDuration:o.autoHideDuration??6e3,notificationId:A3e++}])},[]),i=o=>{n(s=>s.filter(a=>a.notificationId!==o))};return h.jsxs(GJ.Provider,{value:{show:r},children:[e.children,t.map(o=>h.jsx(Tw,{open:!0,autoHideDuration:o.autoHideDuration,onClose:()=>i(o.notificationId),children:h.jsx(Ft,{severity:o.severity,variant:"filled",sx:{minWidth:"300px"},children:o.message})},o.notificationId))]})};function yo(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 D3e=typeof Symbol=="function"&&Symbol.observable||"@@observable",ZF=D3e,uE=()=>Math.random().toString(36).substring(7).split("").join("."),_3e={INIT:`@@redux/INIT${uE()}`,REPLACE:`@@redux/REPLACE${uE()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${uE()}`},hS=_3e;function kT(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 KJ(e,t,n){if(typeof e!="function")throw new Error(yo(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(yo(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(yo(1));return n(KJ)(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(yo(3));return i}function d(v){if(typeof v!="function")throw new Error(yo(4));if(l)throw new Error(yo(5));let S=!0;c();const C=a++;return s.set(C,v),function(){if(S){if(l)throw new Error(yo(6));S=!1,c(),s.delete(C),o=null}}}function p(v){if(!kT(v))throw new Error(yo(7));if(typeof v.type>"u")throw new Error(yo(8));if(typeof v.type!="string")throw new Error(yo(17));if(l)throw new Error(yo(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(yo(10));r=v,p({type:hS.REPLACE})}function y(){const v=d;return{subscribe(S){if(typeof S!="object"||S===null)throw new Error(yo(11));function C(){const E=S;E.next&&E.next(u())}return C(),{unsubscribe:v(C)}},[ZF](){return this}}}return p({type:hS.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:g,[ZF]:y}}function O3e(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:hS.INIT})>"u")throw new Error(yo(12));if(typeof n(void 0,{type:hS.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(yo(13))})}function T3e(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{O3e(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 d=r[u],p=n[d],g=s[d],y=p(g,a);if(typeof y>"u")throw a&&a.type,new Error(yo(14));c[d]=y,l=l||y!==g}return l=l||r.length!==Object.keys(s).length,l?c:s}}function pS(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function M3e(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(yo(15))};const s={getState:i.getState,dispatch:(l,...c)=>o(l,...c)},a=e.map(l=>l(s));return o=pS(...a)(i.dispatch),{...i,dispatch:o}}}function R3e(e){return kT(e)&&"type"in e&&typeof e.type=="string"}var YJ=Symbol.for("immer-nothing"),QF=Symbol.for("immer-draftable"),Xo=Symbol.for("immer-state");function nl(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ys=Object,S0=Ys.getPrototypeOf,mS="constructor",Mw="prototype",pD="configurable",gS="enumerable",c4="writable",m2="value",Ru=e=>!!e&&!!e[Xo];function bl(e){return e?XJ(e)||Iw(e)||!!e[QF]||!!e[mS]?.[QF]||jw(e)||Pw(e):!1}var I3e=Ys[Mw][mS].toString(),eB=new WeakMap;function XJ(e){if(!e||!DT(e))return!1;const t=S0(e);if(t===null||t===Ys[Mw])return!0;const n=Ys.hasOwnProperty.call(t,mS)&&t[mS];if(n===Object)return!0;if(!Am(n))return!1;let r=eB.get(n);return r===void 0&&(r=Function.toString.call(n),eB.set(n,r)),r===I3e}function Rw(e,t,n=!0){Nb(e)===0?(n?Reflect.ownKeys(e):Ys.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Nb(e){const t=e[Xo];return t?t.type_:Iw(e)?1:jw(e)?2:Pw(e)?3:0}var tB=(e,t,n=Nb(e))=>n===2?e.has(t):Ys[Mw].hasOwnProperty.call(e,t),mD=(e,t,n=Nb(e))=>n===2?e.get(t):e[t],yS=(e,t,n,r=Nb(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function j3e(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Iw=Array.isArray,jw=e=>e instanceof Map,Pw=e=>e instanceof Set,DT=e=>typeof e=="object",Am=e=>typeof e=="function",dE=e=>typeof e=="boolean";function P3e(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var mu=e=>e.copy_||e.base_,_T=e=>e.modified_?e.copy_:e.base_;function gD(e,t){if(jw(e))return new Map(e);if(Pw(e))return new Set(e);if(Iw(e))return Array[Mw].slice.call(e);const n=XJ(e);if(t===!0||t==="class_only"&&!n){const r=Ys.getOwnPropertyDescriptors(e);delete r[Xo];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const s=i[o],a=r[s];a[c4]===!1&&(a[c4]=!0,a[pD]=!0),(a.get||a.set)&&(r[s]={[pD]:!0,[c4]:!0,[gS]:a[gS],[m2]:e[s]})}return Ys.create(S0(e),r)}else{const r=S0(e);if(r!==null&&n)return{...e};const i=Ys.create(r);return Ys.assign(i,e)}}function OT(e,t=!1){return $w(e)||Ru(e)||!bl(e)||(Nb(e)>1&&Ys.defineProperties(e,{set:Zx,add:Zx,clear:Zx,delete:Zx}),Ys.freeze(e),t&&Rw(e,(n,r)=>{OT(r,!0)},!1)),e}function $3e(){nl(2)}var Zx={[m2]:$3e};function $w(e){return e===null||!DT(e)?!0:Ys.isFrozen(e)}var bS="MapSet",yD="Patches",nB="ArrayMethods",JJ={};function Wh(e){const t=JJ[e];return t||nl(0,e),t}var rB=e=>!!JJ[e],g2,ZJ=()=>g2,L3e=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:rB(bS)?Wh(bS):void 0,arrayMethodsPlugin_:rB(nB)?Wh(nB):void 0});function iB(e,t){t&&(e.patchPlugin_=Wh(yD),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function bD(e){vD(e),e.drafts_.forEach(N3e),e.drafts_=null}function vD(e){e===g2&&(g2=e.parent_)}var oB=e=>g2=L3e(g2,e);function N3e(e){const t=e[Xo];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function sB(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Xo].modified_&&(bD(t),nl(4)),bl(e)&&(e=aB(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Xo].base_,e,t)}else e=aB(t,n);return F3e(t,e,!0),bD(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==YJ?e:void 0}function aB(e,t){if($w(t))return t;const n=t[Xo];if(!n)return vS(t,e.handledSet_,e);if(!Lw(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);tZ(n,e)}return n.copy_}function F3e(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&OT(t,n)}function QJ(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Lw=(e,t)=>e.scope_===t,B3e=[];function eZ(e,t,n,r){const i=mu(e),o=e.type_;if(r!==void 0&&mD(i,r,o)===t){yS(i,r,n,o);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;Rw(i,(l,c)=>{if(Ru(c)){const u=a.get(c)||[];u.push(l),a.set(c,u)}})}const s=e.draftLocations_.get(t)??B3e;for(const a of s)yS(i,a,n,o)}function z3e(e,t,n){e.callbacks_.push(function(i){const o=t;if(!o||!Lw(o,i))return;i.mapSetPlugin_?.fixSetContents(o);const s=_T(o);eZ(e,o.draft_??o,s,n),tZ(o,i)})}function tZ(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)}QJ(e)}}function H3e(e,t,n){const{scope_:r}=e;if(Ru(n)){const i=n[Xo];Lw(i,r)&&i.callbacks_.push(function(){u4(e);const s=_T(i);eZ(e,n,s,t)})}else bl(n)&&e.callbacks_.push(function(){const o=mu(e);e.type_===3?o.has(n)&&vS(n,r.handledSet_,r):mD(o,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&vS(mD(e.copy_,t,e.type_),r.handledSet_,r)})}function vS(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ru(e)||t.has(e)||!bl(e)||$w(e)||(t.add(e),Rw(e,(r,i)=>{if(Ru(i)){const o=i[Xo];if(Lw(o,n)){const s=_T(o);yS(e,r,s,e.type_),QJ(o)}}else bl(i)&&vS(i,t,n)})),e}function U3e(e,t){const n=Iw(e),r={type_:n?1:0,scope_:t?t.scope_:ZJ(),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=xS;n&&(i=[r],o=y2);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,[a,r]}var xS={get(e,t){if(t===Xo)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=mu(e);if(!tB(i,t,e.type_))return V3e(e,i,t);const o=i[t];if(e.finalized_||!bl(o)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&P3e(t))return o;if(o===fE(e.base_,t)){u4(e);const s=e.type_===1?+t:t,a=SD(e.scope_,o,e,s);return e.copy_[s]=a}return o},has(e,t){return t in mu(e)},ownKeys(e){return Reflect.ownKeys(mu(e))},set(e,t,n){const r=nZ(mu(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=fE(mu(e),t),o=i?.[Xo];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(j3e(n,i)&&(n!==void 0||tB(e.base_,t,e.type_)))return!0;u4(e),xD(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),H3e(e,t,n)),!0},deleteProperty(e,t){return u4(e),fE(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),xD(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=mu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[c4]:!0,[pD]:e.type_!==1||t!=="length",[gS]:r[gS],[m2]:n[t]}},defineProperty(){nl(11)},getPrototypeOf(e){return S0(e.base_)},setPrototypeOf(){nl(12)}},y2={};for(let e in xS){let t=xS[e];y2[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}y2.deleteProperty=function(e,t){return y2.set.call(this,e,t,void 0)};y2.set=function(e,t,n){return xS.set.call(this,e[0],t,n,e[0])};function fE(e,t){const n=e[Xo];return(n?mu(n):e)[t]}function V3e(e,t,n){const r=nZ(t,n);return r?m2 in r?r[m2]:r.get?.call(e.draft_):void 0}function nZ(e,t){if(!(t in e))return;let n=S0(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=S0(n)}}function xD(e){e.modified_||(e.modified_=!0,e.parent_&&xD(e.parent_))}function u4(e){e.copy_||(e.assigned_=new Map,e.copy_=gD(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var W3e=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(Am(t)&&!Am(n)){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}Am(n)||nl(6),r!==void 0&&!Am(r)&&nl(7);let i;if(bl(t)){const o=oB(this),s=SD(o,t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?bD(o):vD(o)}return iB(o,r),sB(i,o)}else if(!t||!DT(t)){if(i=n(t),i===void 0&&(i=t),i===YJ&&(i=void 0),this.autoFreeze_&&OT(i,!0),r){const o=[],s=[];Wh(yD).generateReplacementPatches_(t,i,{patches_:o,inversePatches_:s}),r(o,s)}return i}else nl(1,t)},this.produceWithPatches=(t,n)=>{if(Am(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]},dE(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),dE(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),dE(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){bl(e)||nl(8),Ru(e)&&(e=q3e(e));const t=oB(this),n=SD(t,e,void 0);return n[Xo].isManual_=!0,vD(t),n}finishDraft(e,t){const n=e&&e[Xo];(!n||!n.isManual_)&&nl(9);const{scope_:r}=n;return iB(r,t),sB(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=Wh(yD).applyPatches_;return Ru(e)?r(e,t):this.produce(e,i=>r(i,t))}};function SD(e,t,n,r){const[i,o]=jw(t)?Wh(bS).proxyMap_(t,n):Pw(t)?Wh(bS).proxySet_(t,n):U3e(t,n);return(n?.scope_??ZJ()).drafts_.push(i),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&r!==void 0?z3e(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 q3e(e){return Ru(e)||nl(10,e),rZ(e)}function rZ(e){if(!bl(e)||$w(e))return e;const t=e[Xo];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=gD(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=gD(e,!0);return Rw(n,(i,o)=>{yS(n,i,rZ(o))},r),t&&(t.finalized_=!1),n}var G3e=new W3e,iZ=G3e.produce,SS=Symbol("NOT_FOUND");function K3e(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Y3e(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function X3e(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 lB=e=>Array.isArray(e)?e:[e];function J3e(e){const t=Array.isArray(e[0])?e[0]:e;return X3e(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Z3e(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function Q3e(e){let t;return{get(n){return t&&e(t.key,n)?t.value:SS},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function e5e(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 SS}function i(a,l){r(a)===SS&&(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 t5e=(e,t)=>e===t;function n5e(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 r5e(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=t5e,maxSize:i=1,resultEqualityCheck:o}=n,s=n5e(r);let a=0;const l=i<=1?Q3e(s):e5e(i,s);function c(){let u=l.get(arguments);if(u===SS){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 i5e=class{constructor(e){this.value=e}deref(){return this.value}},o5e=typeof WeakRef<"u"?WeakRef:i5e,s5e=0,cB=1;function Qx(){return{s:s5e,v:void 0,o:null,p:null}}function oZ(e,t={}){let n=Qx();const{resultEqualityCheck:r}=t;let i,o=0;function s(){let a=n;const{length:l}=arguments;for(let d=0,p=l;d<p;d++){const g=arguments[d];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=Qx(),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=Qx(),y.set(g,a)):a=b}}const c=a;let u;if(a.s===cB)u=a.v;else if(u=e.apply(null,arguments),o++,r){const d=i?.deref?.()??i;d!=null&&r(d,u)&&(u=d,o!==0&&o--),i=typeof u=="object"&&u!==null||typeof u=="function"?new o5e(u):u}return c.s=cB,c.v=u,u}return s.clearCache=()=>{n=Qx(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function sZ(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()),K3e(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:d,memoizeOptions:p=[],argsMemoize:g=oZ,argsMemoizeOptions:y=[]}=u,b=lB(p),v=lB(y),S=J3e(i),C=d(function(){return o++,c.apply(null,arguments)},...b),w=g(function(){s++;const A=Z3e(S,arguments);return a=C.apply(null,A),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:d,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var aZ=sZ(oZ),a5e=Object.assign((e,t=aZ)=>{Y3e(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:()=>a5e});function lZ(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var l5e=lZ(),c5e=lZ,u5e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?pS:pS.apply(null,arguments)},d5e=e=>e&&typeof e.match=="function";function Ay(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(wS(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=>R3e(r)&&r.type===e,n}var cZ=class ry extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,ry.prototype)}static get[Symbol.species](){return ry}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new ry(...t[0].concat(this)):new ry(...t.concat(this))}};function uB(e){return bl(e)?iZ(e,()=>{}):e}function f5e(e){return typeof e=="boolean"}var h5e=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let s=new cZ;return n&&(f5e(n)?s.push(l5e):s.push(c5e(n.extraArgument))),s},p5e="RTK_autoBatch",dB=e=>t=>{setTimeout(t,e)},m5e=(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:dB(10):e.type==="callback"?e.queueNotification:dB(e.timeout),c=()=>{s=!1,o&&(o=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const d=()=>i&&u(),p=r.subscribe(d);return a.add(u),()=>{p(),a.delete(u)}},dispatch(u){try{return i=!u?.meta?.[p5e],o=!i,o&&(s||(s=!0,l(c))),r.dispatch(u)}finally{i=!0}}})},g5e=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new cZ(e);return r&&i.push(m5e(typeof r=="object"?r:void 0)),i};function y5e(e){const t=h5e(),{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(kT(n))a=T3e(n);else throw new Error(wS(1));let l;typeof r=="function"?l=r(t):l=t();let c=pS;i&&(c=u5e({trace:!1,...typeof i=="object"&&i}));const u=M3e(...l),d=g5e(u);let p=typeof s=="function"?s(d):d();const g=c(...p);return KJ(a,o,g)}function b5e(e){const t={},n=[];let r;const i={addCase(o,s){const a=typeof o=="string"?o:o.type;if(!a)throw new Error(wS(28));if(a in t)throw new Error(wS(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 v5e(e){return typeof e=="function"}function TT(e,t){let[n,r,i]=b5e(t),o;if(v5e(e))o=()=>uB(e());else{const a=uB(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,d)=>{if(d)if(Ru(u)){const g=d(u,l);return g===void 0?u:g}else{if(bl(u))return iZ(u,p=>d(p,l));{const p=d(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 x5e=(e,t)=>d5e(e)?e.match(t):e(t);function S5e(...e){return t=>e.some(n=>x5e(n,t))}var w5e="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",C5e=(e=21)=>{let t="",n=e;for(;n--;)t+=w5e[Math.random()*64|0];return t},E5e=["name","message","stack","code"],hE=class{constructor(e,t){this.payload=e,this.meta=t}_type},fB=class{constructor(e,t){this.payload=e,this.meta=t}_type},A5e=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of E5e)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},hB="External signal was aborted",k5e=(()=>{function e(t,n,r){const i=Ay(t+"/fulfilled",(l,c,u,d)=>({payload:l,meta:{...d||{},arg:u,requestId:c,requestStatus:"fulfilled"}})),o=Ay(t+"/pending",(l,c,u)=>({payload:void 0,meta:{...u||{},arg:c,requestId:l,requestStatus:"pending"}})),s=Ay(t+"/rejected",(l,c,u,d,p)=>({payload:d,error:(r&&r.serializeError||A5e)(l||"Rejected"),meta:{...p||{},arg:u,requestId:c,rejectedWithValue:!!d,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function a(l,{signal:c}={}){return(u,d,p)=>{const g=r?.idGenerator?r.idGenerator(l):C5e(),y=new AbortController;let b,v;function S(w){v=w,y.abort()}c&&(c.aborted?S(hB):c.addEventListener("abort",()=>S(hB),{once:!0}));const C=(async function(){let w;try{let A=r?.condition?.(l,{getState:d,extra:p});if(_5e(A)&&(A=await A),A===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const O=new Promise((_,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:d,extra:p}))),w=await Promise.race([O,Promise.resolve(n(l,{dispatch:u,getState:d,extra:p,requestId:g,signal:y.signal,abort:S,rejectWithValue:(_,T)=>new hE(_,T),fulfillWithValue:(_,T)=>new fB(_,T)})).then(_=>{if(_ instanceof hE)throw _;return _ instanceof fB?i(_.payload,g,l,_.meta):i(_,g,l)})])}catch(A){w=A instanceof hE?s(null,g,l,A.payload,A.meta):s(A,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(D5e)}})}}return Object.assign(a,{pending:o,rejected:s,fulfilled:i,settled:S5e(s,i),typePrefix:t})}return e.withTypes=()=>e,e})();function D5e(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function _5e(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}function wS(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. `}class O5e extends Error{constructor(t,n,r){super(t),this.status=n,this.body=r,this.name="ApiError"}}async function wr(e){const t=await e.text();try{return JSON.parse(t)}catch{throw new O5e(`Invalid JSON response (HTTP ${e.status}): ${t.slice(0,120)}`,e.status,t)}}async function tr(e,t){if(!e.ok){const n=await e.text().catch(()=>"");let r=t;try{const i=JSON.parse(n);i?.error&&(r=i.error)}catch{n?r=`${t} (HTTP ${e.status}: ${n.slice(0,120)})`:r=`${t} (HTTP ${e.status})`}throw new Error(r)}}async function T5e(){const e=await fetch(`api/matter/bridges?_s=${Date.now()}`);return await tr(e,"Failed to fetch bridges"),wr(e)}async function MT(e){const t=await fetch("api/matter/bridges",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await tr(t,"Failed to create bridge"),wr(t)}async function uZ(e){const t=await fetch(`api/matter/bridges/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await tr(t,"Failed to update bridge"),wr(t)}async function M5e(e){await fetch(`api/matter/bridges/${e}`,{method:"DELETE"})}async function R5e(e){const t=await fetch(`api/matter/bridges/${e}/actions/factory-reset`,{method:"POST"});return await tr(t,"Factory reset failed"),wr(t)}async function dZ(e){const t=await fetch(`api/matter/bridges/${e}/actions/force-sync`,{method:"POST"});return await tr(t,"Force sync failed"),wr(t)}async function I5e(e){const t=await fetch(`api/matter/bridges/${e}/actions/open-commissioning-window`,{method:"POST"});return await tr(t,"Failed to open commissioning window"),wr(t)}async function j5e(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 fZ(){const e=await fetch("api/matter/bridges/actions/start-all",{method:"POST"});return await tr(e,"Failed to start all bridges"),wr(e)}async function hZ(){const e=await fetch("api/matter/bridges/actions/stop-all",{method:"POST"});return await tr(e,"Failed to stop all bridges"),wr(e)}async function pZ(){const e=await fetch("api/matter/bridges/actions/restart-all",{method:"POST"});return await tr(e,"Failed to restart all bridges"),wr(e)}const ng=k5e.withTypes(),Nw=aZ.withTypes(),Io=ng("bridges/load",T5e),mZ=ng("bridges/create",MT),gZ=ng("bridges/delete",M5e),yZ=ng("bridges/update",uZ),bZ=ng("bridges/reset",R5e),vZ=Ay("bridges/setFromWebSocket"),xZ=Ay("bridges/updateFromWebSocket"),Ds=lhe.withTypes(),rg=dhe.withTypes(),SZ=k.createContext({isConnected:!1,error:null});function wZ(){return k.useContext(SZ)}function P5e({children:e}){const t=Ds(),[n,r]=k.useState(!1),[i,o]=k.useState(null),s=k.useRef(null),a=k.useRef(void 0),l=k.useCallback(u=>{switch(u.type){case"bridges_update":t(vZ(u.data));break;case"bridge_update":t(xZ(u.data));break;case"ping":s.current?.send(JSON.stringify({type:"pong"}));break}},[t]),c=k.useCallback(()=>{if(s.current?.readyState===WebSocket.OPEN)return;const u=window.location.protocol==="https:"?"wss:":"ws:",d=document.querySelector("base")?.href||window.location.origin,p=new URL(d),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 k.useEffect(()=>(c(),()=>{a.current&&clearTimeout(a.current),s.current?.close()}),[c]),h.jsx(SZ.Provider,{value:{isConnected:n,error:i},children:e})}const $5e=()=>{const e=Ds();return k.useEffect(()=>{e(Io())},[e]),h.jsx(MX,{})};var sc;(function(e){e.Starting="starting",e.Running="running",e.Stopped="stopped",e.Failed="failed"})(sc||(sc={}));var kr;(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"})(kr||(kr={}));const CZ=[{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:kr.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:kr.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:kr.Domain,value:"sensor"},{type:kr.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:kr.Domain,value:"climate"},{type:kr.Domain,value:"fan"},{type:kr.Domain,value:"cover"},{type:kr.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:kr.Domain,value:"lock"},{type:kr.Domain,value:"alarm_control_panel"},{type:kr.DeviceClass,value:"motion"},{type:kr.DeviceClass,value:"door"},{type:kr.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:kr.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:kr.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:kr.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:kr.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:kr.Domain,value:"automation"},{type:kr.Domain,value:"script"},{type:kr.Domain,value:"scene"}],exclude:[]},featureFlags:{},tags:["automations","scripts","scenes"]}];var pB;(function(e){e[e.locked=1]="locked",e[e.unlocked=2]="unlocked"})(pB||(pB={}));var mB;(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"})(mB||(mB={}));var gB;(function(e){e[e.Forward=0]="Forward",e[e.Reverse=1]="Reverse"})(gB||(gB={}));var yB;(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"})(yB||(yB={}));var bB;(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"})(bB||(bB={}));var vB;(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"})(vB||(vB={}));var wD;(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"})(wD||(wD={}));const EZ=[{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 xB;(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"})(xB||(xB={}));var SB;(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"})(SB||(SB={}));var wB;(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"})(wB||(wB={}));var CB;(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"})(CB||(CB={}));var EB;(function(e){e.closed="closed",e.open="open",e.closing="closing",e.opening="opening"})(EB||(EB={}));var AB;(function(e){e.button="button",e.doorbell="doorbell",e.motion="motion"})(AB||(AB={}));var kB;(function(e){e.FORWARD="forward",e.REVERSE="reverse"})(kB||(kB={}));var DB;(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"})(DB||(DB={}));var _B;(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"})(_B||(_B={}));var OB;(function(e){e.Tv="tv",e.Speaker="speaker",e.Receiver="receiver"})(OB||(OB={}));var TB;(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"})(TB||(TB={}));var MB;(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"})(MB||(MB={}));var RB;(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"})(RB||(RB={}));var IB;(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"})(IB||(IB={}));var jB;(function(e){e.off="off",e.low="low",e.medium="medium",e.high="high",e.turbo="turbo",e.auto="auto",e.max="max"})(jB||(jB={}));var PB;(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"})(PB||(PB={}));var $B;(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"})($B||($B={}));const LB={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",rain_sensor:"Rain Sensor",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"},k1={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},L5e={alarm_control_panel:["mode_select","on_off_plugin_unit"],automation:["on_off_switch"],binary_sensor:["contact_sensor","occupancy_sensor","rain_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 NB;(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"})(NB||(NB={}));const FB={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},N5e={title:"Include or exclude entities",type:"object",properties:{include:{title:"Include",type:"array",items:FB},exclude:{title:"Exclude",type:"array",items:FB},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},F5e={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},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"}},additionalProperties:!1},ky={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:N5e,featureFlags:F5e},required:["name","port","filter"],additionalProperties:!1};({...ky,properties:{...ky.properties},required:[...ky?.required??[]]});const AZ=Ae(h.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),qa=Ae(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"})),ig=Ae(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"})),B5e=rt("MuiBox",["root"]),z5e=Aw(),le=dbe({themeId:_a,defaultTheme:z5e,defaultClassName:B5e.root,generateClassName:yJ.generate});function H5e(e){return tt("MuiButton",e)}const rh=rt("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"]),U5e=k.createContext({}),V5e=k.createContext(void 0),W5e=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}${be(t)}`,`size${be(i)}`,`${o}Size${be(i)}`,`color${be(t)}`,n&&"disableElevation",r&&"fullWidth",s&&`loadingPosition${be(a)}`],startIcon:["icon","startIcon",`iconSize${be(i)}`],endIcon:["icon","endIcon",`iconSize${be(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},u=nt(c,H5e,l);return{...l,...u}},kZ=[{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}}}],q5e=me(ea,{shouldForwardProp:e=>$i(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${be(n.color)}`],t[`size${be(n.size)}`],t[`${n.variant}Size${be(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(qe(({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"},[`&.${rh.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]},[`&.${rh.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${rh.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)",[`&.${rh.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(Nn()).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"},[`&.${rh.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${rh.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}),[`&.${rh.loading}`]:{color:"transparent"}}}]}})),G5e=me("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${be(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}},...kZ]})),K5e=me("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${be(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}},...kZ]})),Y5e=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}}]})),BB=me("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),Ye=k.forwardRef(function(t,n){const r=k.useContext(U5e),i=k.useContext(V5e),o=x0(r,t),s=ot({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:d=!1,disableElevation:p=!1,disableFocusRipple:g=!1,endIcon:y,focusVisibleClassName:b,fullWidth:v=!1,id:S,loading:C=null,loadingIndicator:w,loadingPosition:E="center",size:A="medium",startIcon:O,type:_,variant:T="text",...I}=s,P=Vu(S),L=w??h.jsx(mr,{"aria-labelledby":P,color:"inherit",size:16}),R={...s,color:l,component:c,disabled:d,disableElevation:p,disableFocusRipple:g,fullWidth:v,loading:C,loadingIndicator:L,loadingPosition:E,size:A,type:_,variant:T},N=W5e(R),$=(O||C&&E==="start")&&h.jsx(G5e,{className:N.startIcon,ownerState:R,children:O||h.jsx(BB,{className:N.loadingIconPlaceholder,ownerState:R})}),z=(y||C&&E==="end")&&h.jsx(K5e,{className:N.endIcon,ownerState:R,children:y||h.jsx(BB,{className:N.loadingIconPlaceholder,ownerState:R})}),F=i||"",W=typeof C=="boolean"?h.jsx("span",{className:N.loadingWrapper,style:{display:"contents"},children:C&&h.jsx(Y5e,{className:N.loadingIndicator,ownerState:R,children:L})}):null;return h.jsxs(q5e,{ownerState:R,className:Oe(r.className,N.root,u,F),component:c,disabled:d||C,focusRipple:!g,focusVisibleClassName:Oe(N.focusVisible,b),ref:n,type:_,id:C?P:S,...I,classes:N,children:[$,E!=="end"&&W,a,E==="end"&&W,z]})});function X5e(e){return tt("MuiCard",e)}rt("MuiCard",["root"]);const J5e=e=>{const{classes:t}=e;return nt({root:["root"]},X5e,t)},Z5e=me(Vr,{name:"MuiCard",slot:"Root"})({overflow:"hidden"}),En=k.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCard"}),{className:i,raised:o=!1,...s}=r,a={...r,raised:o},l=J5e(a);return h.jsx(Z5e,{className:Oe(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a,...s})});function Q5e(e){return tt("MuiCardActionArea",e)}const pE=rt("MuiCardActionArea",["root","focusVisible","focusHighlight"]),e4e=e=>{const{classes:t}=e;return nt({root:["root"],focusHighlight:["focusHighlight"]},Q5e,t)},t4e=me(ea,{name:"MuiCardActionArea",slot:"Root"})(qe(({theme:e})=>({display:"block",textAlign:"inherit",borderRadius:"inherit",width:"100%",[`&:hover .${pE.focusHighlight}`]:{opacity:(e.vars||e).palette.action.hoverOpacity,"@media (hover: none)":{opacity:0}},[`&.${pE.focusVisible} .${pE.focusHighlight}`]:{opacity:(e.vars||e).palette.action.focusOpacity}}))),n4e=me("span",{name:"MuiCardActionArea",slot:"FocusHighlight"})(qe(({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})}))),Iu=k.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,d=e4e(u),p={slots:a,slotProps:l},[g,y]=ht("root",{elementType:t4e,externalForwardedProps:{...p,...c},shouldForwardComponentProp:!0,ownerState:u,ref:n,className:Oe(d.root,o),additionalProps:{focusVisibleClassName:Oe(s,d.focusVisible)}}),[b,v]=ht("focusHighlight",{elementType:n4e,externalForwardedProps:p,ownerState:u,className:d.focusHighlight});return h.jsxs(g,{...y,children:[i,h.jsx(b,{...v})]})});function r4e(e){return tt("MuiCardContent",e)}rt("MuiCardContent",["root"]);const i4e=e=>{const{classes:t}=e;return nt({root:["root"]},r4e,t)},o4e=me("div",{name:"MuiCardContent",slot:"Root"})({padding:16,"&:last-child":{paddingBottom:24}}),Vn=k.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCardContent"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=i4e(a);return h.jsx(o4e,{as:o,className:Oe(l.root,i),ownerState:a,ref:n,...s})}),Fw=k.createContext(void 0);function El(){return k.useContext(Fw)}function s4e(e){return tt("PrivateSwitchBase",e)}rt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const a4e=e=>{const{classes:t,checked:n,disabled:r,edge:i}=e,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${be(i)}`],input:["input"]};return nt(o,s4e,t)},l4e=me(ea,{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}}]}),c4e=me("input",{name:"MuiSwitchBase",shouldForwardProp:$i})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),RT=k.forwardRef(function(t,n){const{autoFocus:r,checked:i,checkedIcon:o,defaultChecked:s,disabled:a,disableFocusRipple:l=!1,edge:c=!1,icon:u,id:d,inputProps:p,inputRef:g,name:y,onBlur:b,onChange:v,onFocus:S,readOnly:C,required:w=!1,tabIndex:E,type:A,value:O,slots:_={},slotProps:T={},...I}=t,[P,L]=ul({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),R=El(),N=G=>{S&&S(G),R&&R.onFocus&&R.onFocus(G)},$=G=>{b&&b(G),R&&R.onBlur&&R.onBlur(G)},z=G=>{if(G.nativeEvent.defaultPrevented||C)return;const J=G.target.checked;L(J),v&&v(G,J)};let F=a;R&&typeof F>"u"&&(F=R.disabled);const W=A==="checkbox"||A==="radio",V={...t,checked:P,disabled:F,disableFocusRipple:l,edge:c},q=a4e(V),X={slots:_,slotProps:{input:p,...T}},[B,U]=ht("root",{ref:n,elementType:l4e,className:q.root,shouldForwardComponentProp:!0,externalForwardedProps:{...X,component:"span",...I},getSlotProps:G=>({...G,onFocus:J=>{G.onFocus?.(J),N(J)},onBlur:J=>{G.onBlur?.(J),$(J)}}),ownerState:V,additionalProps:{centerRipple:!0,focusRipple:!l,role:void 0,tabIndex:null}}),[Y,H]=ht("input",{ref:g,elementType:c4e,className:q.input,externalForwardedProps:X,getSlotProps:G=>({...G,onChange:J=>{G.onChange?.(J),z(J)}}),ownerState:V,additionalProps:{autoFocus:r,checked:i,defaultChecked:s,disabled:F,id:W?d:void 0,name:y,readOnly:C,required:w,tabIndex:E,type:A,...A==="checkbox"&&O===void 0?{}:{value:O}}});return h.jsxs(B,{...U,children:[h.jsx(Y,{...H}),P?o:u]})}),u4e=Ae(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"})),d4e=Ae(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"})),f4e=Ae(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 h4e(e){return tt("MuiCheckbox",e)}const mE=rt("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),p4e=e=>{const{classes:t,indeterminate:n,color:r,size:i}=e,o={root:["root",n&&"indeterminate",`color${be(r)}`,`size${be(i)}`]},s=nt(o,h4e,t);return{...t,...s}},m4e=me(RT,{shouldForwardProp:e=>$i(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${be(n.size)}`],n.color!=="default"&&t[`color${be(n.color)}`]]}})(qe(({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(Nn()).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(Nn()).map(([t])=>({props:{color:t},style:{[`&.${mE.checked}, &.${mE.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${mE.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),g4e=h.jsx(d4e,{}),y4e=h.jsx(u4e,{}),b4e=h.jsx(f4e,{}),us=k.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCheckbox"}),{checkedIcon:i=g4e,color:o="primary",icon:s=y4e,indeterminate:a=!1,indeterminateIcon:l=b4e,inputProps:c,size:u="medium",disableRipple:d=!1,className:p,slots:g={},slotProps:y={},...b}=r,v=a?l:s,S=a?l:i,C={...r,disableRipple:d,color:o,indeterminate:a,size:u},w=p4e(C),E=y.input??c,[A,O]=ht("root",{ref:n,elementType:m4e,className:Oe(w.root,p),shouldForwardComponentProp:!0,externalForwardedProps:{slots:g,slotProps:y,...b},ownerState:C,additionalProps:{type:"checkbox",icon:k.cloneElement(v,{fontSize:v.props.fontSize??u}),checkedIcon:k.cloneElement(S,{fontSize:S.props.fontSize??u}),disableRipple:d,slots:g,slotProps:{input:wT(typeof E=="function"?E(C):E,{"data-indeterminate":a})}}});return h.jsx(A,{...O,classes:w})}),v4e=Ae(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 x4e(e){return tt("MuiChip",e)}const On=rt("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"]),S4e=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${be(r)}`,`color${be(i)}`,a&&"clickable",a&&`clickableColor${be(i)}`,s&&"deletable",s&&`deletableColor${be(i)}`,`${l}${be(i)}`],label:["label",`label${be(r)}`],avatar:["avatar",`avatar${be(r)}`,`avatarColor${be(i)}`],icon:["icon",`icon${be(r)}`,`iconColor${be(o)}`],deleteIcon:["deleteIcon",`deleteIcon${be(r)}`,`deleteIconColor${be(i)}`,`deleteIcon${be(l)}Color${be(i)}`]};return nt(c,x4e,t)},w4e=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[{[`& .${On.avatar}`]:t.avatar},{[`& .${On.avatar}`]:t[`avatar${be(a)}`]},{[`& .${On.avatar}`]:t[`avatarColor${be(r)}`]},{[`& .${On.icon}`]:t.icon},{[`& .${On.icon}`]:t[`icon${be(a)}`]},{[`& .${On.icon}`]:t[`iconColor${be(i)}`]},{[`& .${On.deleteIcon}`]:t.deleteIcon},{[`& .${On.deleteIcon}`]:t[`deleteIcon${be(a)}`]},{[`& .${On.deleteIcon}`]:t[`deleteIconColor${be(r)}`]},{[`& .${On.deleteIcon}`]:t[`deleteIcon${be(l)}Color${be(r)}`]},t.root,t[`size${be(a)}`],t[`color${be(r)}`],o&&t.clickable,o&&r!=="default"&&t[`clickableColor${be(r)}`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${be(r)}`],t[l],t[`${l}${be(r)}`]]}})(qe(({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",[`&.${On.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${On.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${On.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${On.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${On.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${On.icon}`]:{marginLeft:5,marginRight:-6},[`& .${On.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,[`& .${On.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${On.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Nn(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${On.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:{[`& .${On.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${On.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${On.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(Nn(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${On.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}`)},[`&.${On.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(Nn(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${On.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]}`,[`&.${On.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${On.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${On.avatar}`]:{marginLeft:4},[`& .${On.avatarSmall}`]:{marginLeft:2},[`& .${On.icon}`]:{marginLeft:4},[`& .${On.iconSmall}`]:{marginLeft:2},[`& .${On.deleteIcon}`]:{marginRight:5},[`& .${On.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Nn()).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)}`,[`&.${On.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${On.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${On.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),C4e=me("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${be(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 zB(e){return e.key==="Backspace"||e.key==="Delete"}const dt=k.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:d,label:p,onClick:g,onDelete:y,onKeyDown:b,onKeyUp:v,size:S="medium",variant:C="filled",tabIndex:w,skipFocusWhenDisabled:E=!1,slots:A={},slotProps:O={},..._}=r,T=k.useRef(null),I=Lr(T,n),P=J=>{J.stopPropagation(),y(J)},L=J=>{J.currentTarget===J.target&&zB(J)&&J.preventDefault(),b&&b(J)},R=J=>{J.currentTarget===J.target&&y&&zB(J)&&y(J),v&&v(J)},N=s!==!1&&g?!0:s,$=N||y?ea:l||"div",z={...r,component:$,disabled:u,size:S,color:a,iconColor:k.isValidElement(d)&&d.props.color||a,onDelete:!!y,clickable:N,variant:C},F=S4e(z),W=$===ea?{component:l||"div",focusVisibleClassName:F.focusVisible,...y&&{disableRipple:!0}}:{};let V=null;y&&(V=c&&k.isValidElement(c)?k.cloneElement(c,{className:Oe(c.props.className,F.deleteIcon),onClick:P}):h.jsx(v4e,{className:F.deleteIcon,onClick:P}));let q=null;i&&k.isValidElement(i)&&(q=k.cloneElement(i,{className:Oe(F.avatar,i.props.className)}));let X=null;d&&k.isValidElement(d)&&(X=k.cloneElement(d,{className:Oe(F.icon,d.props.className)}));const B={slots:A,slotProps:O},[U,Y]=ht("root",{elementType:w4e,externalForwardedProps:{...B,..._},ownerState:z,shouldForwardComponentProp:!0,ref:I,className:Oe(F.root,o),additionalProps:{disabled:N&&u?!0:void 0,tabIndex:E&&u?-1:w,...W},getSlotProps:J=>({...J,onClick:se=>{J.onClick?.(se),g?.(se)},onKeyDown:se=>{J.onKeyDown?.(se),L(se)},onKeyUp:se=>{J.onKeyUp?.(se),R(se)}})}),[H,G]=ht("label",{elementType:C4e,externalForwardedProps:B,ownerState:z,className:F.label});return h.jsxs(U,{as:$,...Y,children:[q||X,h.jsx(H,{...G,children:p}),V]})});function HB(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function CS(e,t=!1){return e&&(HB(e.value)&&e.value!==""||t&&HB(e.defaultValue)&&e.defaultValue!=="")}function E4e(e){return e.startAdornment}function A4e(e){return tt("MuiFormControl",e)}rt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const k4e=e=>{const{classes:t,margin:n,fullWidth:r}=e,i={root:["root",n!=="none"&&`margin${be(n)}`,r&&"fullWidth"]};return nt(i,A4e,t)},D4e=me("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${be(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%"}}]}),ms=k.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:d=!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:d,hiddenLabel:p,margin:g,required:y,size:b,variant:v},w=k4e(C),[E,A]=k.useState(()=>{let z=!1;return i&&k.Children.forEach(i,F=>{if(!Ey(F,["Input","Select"]))return;const W=Ey(F,["Select"])?F.props.input:F;W&&E4e(W.props)&&(z=!0)}),z}),[O,_]=k.useState(()=>{let z=!1;return i&&k.Children.forEach(i,F=>{Ey(F,["Input","Select"])&&(CS(F.props,!0)||CS(F.props.inputProps,!0))&&(z=!0)}),z}),[T,I]=k.useState(!1);l&&T&&I(!1);const P=u!==void 0&&!l?u:T;let L;k.useRef(!1);const R=k.useCallback(()=>{_(!0)},[]),N=k.useCallback(()=>{_(!1)},[]),$=k.useMemo(()=>({adornedStart:E,setAdornedStart:A,color:s,disabled:l,error:c,filled:O,focused:P,fullWidth:d,hiddenLabel:p,size:b,onBlur:()=>{I(!1)},onFocus:()=>{I(!0)},onEmpty:N,onFilled:R,registerEffect:L,required:y,variant:v}),[E,s,l,c,O,P,d,p,L,N,R,y,b,v]);return h.jsx(Fw.Provider,{value:$,children:h.jsx(D4e,{as:a,ownerState:C,className:Oe(w.root,o),ref:n,...S,children:i})})});function _4e(e){return tt("MuiTypography",e)}const UB=rt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),O4e={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},T4e=nxe(),M4e=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=e,a={root:["root",o,e.align!=="inherit"&&`align${be(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return nt(a,_4e,s)},R4e=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${be(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(qe(({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(Nn()).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${be(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}}]}))),VB={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},oe=k.forwardRef(function(t,n){const{color:r,...i}=ot({props:t,name:"MuiTypography"}),o=!O4e[r],s=T4e({...i,...o&&{color:r}}),{align:a="inherit",className:l,component:c,gutterBottom:u=!1,noWrap:d=!1,paragraph:p=!1,variant:g="body1",variantMapping:y=VB,...b}=s,v={...s,align:a,color:r,className:l,component:c,gutterBottom:u,noWrap:d,paragraph:p,variant:g,variantMapping:y},S=c||(p?"p":y[g]||VB[g])||"span",C=M4e(v);return h.jsx(R4e,{as:S,ref:n,className:Oe(C.root,l),...b,ownerState:v,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...b.style}})});function I4e(e){return tt("MuiFormControlLabel",e)}const iy=rt("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]);function Tf({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 j4e=e=>{const{classes:t,disabled:n,labelPlacement:r,error:i,required:o}=e,s={root:["root",n&&"disabled",`labelPlacement${be(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return nt(s,I4e,t)},P4e=me("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${iy.label}`]:t.label},t.root,t[`labelPlacement${be(n.labelPlacement)}`]]}})(qe(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${iy.disabled}`]:{cursor:"default"},[`& .${iy.label}`]:{[`&.${iy.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}}]}))),$4e=me("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(qe(({theme:e})=>({[`&.${iy.error}`]:{color:(e.vars||e).palette.error.main}}))),gs=k.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:d,labelPlacement:p="end",name:g,onChange:y,required:b,slots:v={},slotProps:S={},value:C,...w}=r,E=El(),A=l??a.props.disabled??E?.disabled,O=b??a.props.required,_={disabled:A,required:O};["checked","name","onChange","value","inputRef"].forEach(z=>{typeof a.props[z]>"u"&&typeof r[z]<"u"&&(_[z]=r[z])});const T=Tf({props:r,muiFormControl:E,states:["error"]}),I={...r,disabled:A,labelPlacement:p,required:O,error:T.error},P=j4e(I),L={slots:v,slotProps:{...s,...S}},[R,N]=ht("typography",{elementType:oe,externalForwardedProps:L,ownerState:I});let $=d;return $!=null&&$.type!==oe&&!c&&($=h.jsx(R,{component:"span",...N,className:Oe(P.label,N?.className),children:$})),h.jsxs(P4e,{className:Oe(P.root,o),ownerState:I,ref:n,...w,children:[k.cloneElement(a,_),O?h.jsxs("div",{children:[$,h.jsxs($4e,{ownerState:I,"aria-hidden":!0,className:P.asterisk,children:[" ","*"]})]}):$]})}),lt=yve({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:co});function L4e(e){return tt("MuiLinearProgress",e)}rt("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const CD=4,ED=Df`
147
+ `:null,Yxe=e=>{const{classes:t,variant:n,color:r,disableShrink:i}=e,o={root:["root",n,`color${be(r)}`],svg:["svg"],track:["track"],circle:["circle",`circle${be(n)}`,i&&"circleDisableShrink"]};return nt(o,qxe,t)},Xxe=me("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${be(n.color)}`]]}})(qe(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:Gxe||{animation:`${dD} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Nn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),Jxe=me("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),Zxe=me("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${be(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(qe(({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:Kxe||{animation:`${fD} 1.4s ease-in-out infinite`}}]}))),Qxe=me("circle",{name:"MuiCircularProgress",slot:"Track"})(qe(({theme:e})=>({stroke:"currentColor",opacity:(e.vars||e).palette.action.activatedOpacity}))),mr=k.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:d=0,variant:p="indeterminate",...g}=r,y={...r,color:o,disableShrink:s,size:l,thickness:u,value:d,variant:p,enableTrackSlot:a},b=Yxe(y),v={},S={},C={};if(p==="determinate"){const w=2*Math.PI*((Ja-u)/2);v.strokeDasharray=w.toFixed(3),C["aria-valuenow"]=Math.round(d),v.strokeDashoffset=`${((100-d)/100*w).toFixed(3)}px`,S.transform="rotate(-90deg)"}return h.jsx(Xxe,{className:Oe(b.root,i),style:{width:l,height:l,...S,...c},ownerState:y,ref:n,role:"progressbar",...C,...g,children:h.jsxs(Jxe,{className:b.svg,ownerState:y,viewBox:`${Ja/2} ${Ja/2} ${Ja} ${Ja}`,children:[a?h.jsx(Qxe,{className:b.track,ownerState:y,cx:Ja,cy:Ja,r:(Ja-u)/2,fill:"none",strokeWidth:u,"aria-hidden":"true"}):null,h.jsx(Zxe,{className:b.circle,style:v,ownerState:y,cx:Ja,cy:Ja,r:(Ja-u)/2,fill:"none",strokeWidth:u})]})})});function e3e(e){return tt("MuiIconButton",e)}const YF=rt("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),t3e=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${be(r)}`,i&&`edge${be(i)}`,`size${be(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return nt(a,e3e,t)},n3e=me(ea,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.loading&&t.loading,n.color!=="default"&&t[`color${be(n.color)}`],n.edge&&t[`edge${be(n.edge)}`],t[`size${be(n.size)}`]]}})(qe(({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}}]})),qe(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(Nn()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Nn()).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)}}],[`&.${YF.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${YF.loading}`]:{color:"transparent"}}))),r3e=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"}}]})),Vt=k.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:d,loading:p=null,loadingIndicator:g,...y}=r,b=Vu(d),v=g??h.jsx(mr,{"aria-labelledby":b,color:"inherit",size:16}),S={...r,edge:i,color:a,disabled:l,disableFocusRipple:c,loading:p,loadingIndicator:v,size:u},C=t3e(S);return h.jsxs(n3e,{id:p?b:d,className:Oe(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(r3e,{className:C.loadingIndicator,ownerState:S,children:p&&v})}),o]})}),i3e=Ae(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"})),o3e=Ae(h.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),s3e=Ae(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"})),a3e=Ae(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"})),WJ=Ae(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"})),l3e=e=>{const{variant:t,color:n,severity:r,classes:i}=e,o={root:["root",`color${be(n||r)}`,`${t}${be(n||r)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return nt(o,bxe,i)},c3e=me(Vr,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${be(n.color||n.severity)}`]]}})(qe(({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(Nn(["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),[`& .${qF.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(Nn(["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}`,[`& .${qF.icon}`]:e.vars?{color:e.vars.palette.Alert[`${r}IconColor`]}:{color:e.palette[r].main}}})),...Object.entries(e.palette).filter(Nn(["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)}}}))]}})),u3e=me("div",{name:"MuiAlert",slot:"Icon"})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),d3e=me("div",{name:"MuiAlert",slot:"Message"})({padding:"8px 0",minWidth:0,overflow:"auto"}),f3e=me("div",{name:"MuiAlert",slot:"Action"})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),XF={success:h.jsx(i3e,{fontSize:"inherit"}),warning:h.jsx(o3e,{fontSize:"inherit"}),error:h.jsx(s3e,{fontSize:"inherit"}),info:h.jsx(a3e,{fontSize:"inherit"})},Ft=k.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:d,iconMapping:p=XF,onClose:g,role:y="alert",severity:b="success",slotProps:v={},slots:S={},variant:C="standard",...w}=r,E={...r,color:l,severity:b,variant:C,colorSeverity:l||b},A=l3e(E),O={slots:{closeButton:c.CloseButton,closeIcon:c.CloseIcon,...S},slotProps:{...u,...v}},[_,T]=ht("root",{ref:n,shouldForwardComponentProp:!0,className:Oe(A.root,s),elementType:c3e,externalForwardedProps:{...O,...w},ownerState:E,additionalProps:{role:y,elevation:0}}),[I,P]=ht("icon",{className:A.icon,elementType:u3e,externalForwardedProps:O,ownerState:E}),[L,R]=ht("message",{className:A.message,elementType:d3e,externalForwardedProps:O,ownerState:E}),[N,$]=ht("action",{className:A.action,elementType:f3e,externalForwardedProps:O,ownerState:E}),[z,F]=ht("closeButton",{elementType:Vt,externalForwardedProps:O,ownerState:E}),[W,V]=ht("closeIcon",{elementType:WJ,externalForwardedProps:O,ownerState:E});return h.jsxs(_,{...T,children:[d!==!1?h.jsx(I,{...P,children:d||p[b]||XF[b]}):null,h.jsx(L,{...R,children:o}),i!=null?h.jsx(N,{...$,children:i}):null,i==null&&g?h.jsx(N,{...$,children:h.jsx(z,{size:"small","aria-label":a,title:a,color:"inherit",onClick:g,...F,children:h.jsx(W,{fontSize:"small",...V})})}):null]})});function h3e(e={}){const{autoHideDuration:t=null,disableWindowBlurListener:n=!1,onClose:r,open:i,resumeHideDuration:o}=e,s=zd();k.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=Vi((S,C)=>{r?.(S,C)}),l=Vi(S=>{!r||S==null||s.start(S,()=>{a(null,"timeout")})});k.useEffect(()=>(i&&l(t),s.clear),[i,t,l,s]);const c=S=>{r?.(S,"clickaway")},u=s.clear,d=k.useCallback(()=>{t!=null&&l(o??t*.5)},[t,o,l]),p=S=>C=>{const w=S.onBlur;w?.(C),d()},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),d()};return k.useEffect(()=>{if(!n&&i)return window.addEventListener("focus",d),window.addEventListener("blur",u),()=>{window.removeEventListener("focus",d),window.removeEventListener("blur",u)}},[n,i,d,u]),{getRootProps:(S={})=>{const C={...to(e),...to(S)};return{role:"presentation",...S,...C,onBlur:p(C),onFocus:g(C),onMouseEnter:y(C),onMouseLeave:b(C)}},onClickAway:c}}function Of(e){return parseInt(k.version,10)>=19?e?.props?.ref||null:e?.ref||null}function JF(e){return e.substring(2).toLowerCase()}function p3e(e,t){return t.documentElement.clientWidth<e.clientX||t.documentElement.clientHeight<e.clientY}function qJ(e){const{children:t,disableReactTree:n=!1,mouseEvent:r="onClick",onClickAway:i,touchEvent:o="onTouchEnd"}=e,s=k.useRef(!1),a=k.useRef(null),l=k.useRef(!1),c=k.useRef(!1);k.useEffect(()=>(setTimeout(()=>{l.current=!0},0),()=>{l.current=!1}),[]);const u=Lr(Of(t),a),d=Vi(y=>{const b=c.current;c.current=!1;const v=Ii(a.current);if(!l.current||!a.current||"clientX"in y&&p3e(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)),k.useEffect(()=>{if(o!==!1){const y=JF(o),b=Ii(a.current),v=()=>{s.current=!0};return b.addEventListener(y,d),b.addEventListener("touchmove",v),()=>{b.removeEventListener(y,d),b.removeEventListener("touchmove",v)}}},[d,o]),r!==!1&&(g[r]=p(r)),k.useEffect(()=>{if(r!==!1){const y=JF(r),b=Ii(a.current);return b.addEventListener(y,d),()=>{b.removeEventListener(y,d)}}},[d,r]),k.cloneElement(t,g)}const AT=e=>e.scrollTop;function df(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 hD(e){return`scale(${e}, ${e**2})`}const m3e={entering:{opacity:1,transform:hD(1)},entered:{opacity:1,transform:"none"}},cE=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),p2=k.forwardRef(function(t,n){const{addEndListener:r,appear:i=!0,children:o,easing:s,in:a,onEnter:l,onEntered:c,onEntering:u,onExit:d,onExited:p,onExiting:g,style:y,timeout:b="auto",TransitionComponent:v=Wa,...S}=t,C=zd(),w=k.useRef(),E=co(),A=k.useRef(null),O=Lr(A,Of(o),n),_=z=>F=>{if(z){const W=A.current;F===void 0?z(W):z(W,F)}},T=_(u),I=_((z,F)=>{AT(z);const{duration:W,delay:V,easing:q}=df({style:y,timeout:b,easing:s},{mode:"enter"});let X;b==="auto"?(X=E.transitions.getAutoHeightDuration(z.clientHeight),w.current=X):X=W,z.style.transition=[E.transitions.create("opacity",{duration:X,delay:V}),E.transitions.create("transform",{duration:cE?X:X*.666,delay:V,easing:q})].join(","),l&&l(z,F)}),P=_(c),L=_(g),R=_(z=>{const{duration:F,delay:W,easing:V}=df({style:y,timeout:b,easing:s},{mode:"exit"});let q;b==="auto"?(q=E.transitions.getAutoHeightDuration(z.clientHeight),w.current=q):q=F,z.style.transition=[E.transitions.create("opacity",{duration:q,delay:W}),E.transitions.create("transform",{duration:cE?q:q*.666,delay:cE?W:W||q*.333,easing:V})].join(","),z.style.opacity=0,z.style.transform=hD(.75),d&&d(z)}),N=_(p),$=z=>{b==="auto"&&C.start(w.current||0,z),r&&r(A.current,z)};return h.jsx(v,{appear:i,in:a,nodeRef:A,onEnter:I,onEntered:P,onEntering:T,onExit:R,onExited:N,onExiting:L,addEndListener:$,timeout:b==="auto"?null:b,...S,children:(z,{ownerState:F,...W})=>k.cloneElement(o,{style:{opacity:0,transform:hD(.75),visibility:z==="exited"&&!a?"hidden":void 0,...m3e[z],...y,...o.props.style},ref:O,...W})})});p2&&(p2.muiSupportAuto=!0);function g3e(e){return tt("MuiSnackbarContent",e)}rt("MuiSnackbarContent",["root","message","action"]);const y3e=e=>{const{classes:t}=e;return nt({root:["root"],action:["action"],message:["message"]},g3e,t)},b3e=me(Vr,{name:"MuiSnackbarContent",slot:"Root"})(qe(({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(f2(e.palette.background.default,t)),backgroundColor:e.vars?e.vars.palette.SnackbarContent.bg:f2(e.palette.background.default,t),display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",flexGrow:1,[e.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}}})),v3e=me("div",{name:"MuiSnackbarContent",slot:"Message"})({padding:"8px 0"}),x3e=me("div",{name:"MuiSnackbarContent",slot:"Action"})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),S3e=k.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=y3e(c);return h.jsxs(b3e,{role:a,elevation:6,className:Oe(u.root,o),ownerState:c,ref:n,...l,children:[h.jsx(v3e,{className:u.message,ownerState:c,children:s}),i?h.jsx(x3e,{className:u.action,ownerState:c,children:i}):null]})});function w3e(e){return tt("MuiSnackbar",e)}rt("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const C3e=e=>{const{classes:t,anchorOrigin:n}=e,r={root:["root",`anchorOrigin${be(n.vertical)}${be(n.horizontal)}`]};return nt(r,w3e,t)},E3e=me("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`anchorOrigin${be(n.anchorOrigin.vertical)}${be(n.anchorOrigin.horizontal)}`]]}})(qe(({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%)"}}}]}))),Tw=k.forwardRef(function(t,n){const r=ot({props:t,name:"MuiSnackbar"}),i=co(),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:d,ClickAwayListenerProps:p,ContentProps:g,disableWindowBlurListener:y=!1,message:b,onBlur:v,onClose:S,onFocus:C,onMouseEnter:w,onMouseLeave:E,open:A,resumeHideDuration:O,slots:_={},slotProps:T={},TransitionComponent:I,transitionDuration:P=o,TransitionProps:{onEnter:L,onExited:R,...N}={},...$}=r,z={...r,anchorOrigin:{vertical:a,horizontal:l},autoHideDuration:c,disableWindowBlurListener:y,TransitionComponent:I,transitionDuration:P},F=C3e(z),{getRootProps:W,onClickAway:V}=h3e(z),[q,X]=k.useState(!0),B=ee=>{X(!0),R&&R(ee)},U=(ee,ae)=>{X(!1),L&&L(ee,ae)},Y={slots:{transition:I,..._},slotProps:{content:g,clickAwayListener:p,transition:N,...T}},[H,G]=ht("root",{ref:n,className:[F.root,d],elementType:E3e,getSlotProps:W,externalForwardedProps:{...Y,...$},ownerState:z}),[J,{ownerState:se,...Q}]=ht("clickAwayListener",{elementType:qJ,externalForwardedProps:Y,getSlotProps:ee=>({onClickAway:(...ae)=>{const fe=ae[0];ee.onClickAway?.(...ae),!fe?.defaultMuiPrevented&&V(...ae)}}),ownerState:z}),[ie,ne]=ht("content",{elementType:S3e,shouldForwardComponentProp:!0,externalForwardedProps:Y,additionalProps:{message:b,action:s},ownerState:z}),[Z,re]=ht("transition",{elementType:p2,externalForwardedProps:Y,getSlotProps:ee=>({onEnter:(...ae)=>{ee.onEnter?.(...ae),U(...ae)},onExited:(...ae)=>{ee.onExited?.(...ae),B(...ae)}}),additionalProps:{appear:!0,in:A,timeout:P,direction:a==="top"?"down":"up"},ownerState:z});return!A&&q?null:h.jsx(J,{...Q,..._.clickAwayListener&&{ownerState:se},children:h.jsx(H,{...G,children:h.jsx(Z,{...re,children:u||h.jsx(ie,{...ne})})})})}),GJ=k.createContext({show:()=>{}});let A3e=0;const k3e=e=>{const[t,n]=k.useState([]),r=k.useCallback(o=>{n(s=>[...s,{...o,autoHideDuration:o.autoHideDuration??6e3,notificationId:A3e++}])},[]),i=o=>{n(s=>s.filter(a=>a.notificationId!==o))};return h.jsxs(GJ.Provider,{value:{show:r},children:[e.children,t.map(o=>h.jsx(Tw,{open:!0,autoHideDuration:o.autoHideDuration,onClose:()=>i(o.notificationId),children:h.jsx(Ft,{severity:o.severity,variant:"filled",sx:{minWidth:"300px"},children:o.message})},o.notificationId))]})};function yo(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 D3e=typeof Symbol=="function"&&Symbol.observable||"@@observable",ZF=D3e,uE=()=>Math.random().toString(36).substring(7).split("").join("."),_3e={INIT:`@@redux/INIT${uE()}`,REPLACE:`@@redux/REPLACE${uE()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${uE()}`},hS=_3e;function kT(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 KJ(e,t,n){if(typeof e!="function")throw new Error(yo(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(yo(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(yo(1));return n(KJ)(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(yo(3));return i}function d(v){if(typeof v!="function")throw new Error(yo(4));if(l)throw new Error(yo(5));let S=!0;c();const C=a++;return s.set(C,v),function(){if(S){if(l)throw new Error(yo(6));S=!1,c(),s.delete(C),o=null}}}function p(v){if(!kT(v))throw new Error(yo(7));if(typeof v.type>"u")throw new Error(yo(8));if(typeof v.type!="string")throw new Error(yo(17));if(l)throw new Error(yo(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(yo(10));r=v,p({type:hS.REPLACE})}function y(){const v=d;return{subscribe(S){if(typeof S!="object"||S===null)throw new Error(yo(11));function C(){const E=S;E.next&&E.next(u())}return C(),{unsubscribe:v(C)}},[ZF](){return this}}}return p({type:hS.INIT}),{dispatch:p,subscribe:d,getState:u,replaceReducer:g,[ZF]:y}}function O3e(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:hS.INIT})>"u")throw new Error(yo(12));if(typeof n(void 0,{type:hS.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(yo(13))})}function T3e(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{O3e(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 d=r[u],p=n[d],g=s[d],y=p(g,a);if(typeof y>"u")throw a&&a.type,new Error(yo(14));c[d]=y,l=l||y!==g}return l=l||r.length!==Object.keys(s).length,l?c:s}}function pS(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function M3e(...e){return t=>(n,r)=>{const i=t(n,r);let o=()=>{throw new Error(yo(15))};const s={getState:i.getState,dispatch:(l,...c)=>o(l,...c)},a=e.map(l=>l(s));return o=pS(...a)(i.dispatch),{...i,dispatch:o}}}function R3e(e){return kT(e)&&"type"in e&&typeof e.type=="string"}var YJ=Symbol.for("immer-nothing"),QF=Symbol.for("immer-draftable"),Xo=Symbol.for("immer-state");function nl(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Ys=Object,S0=Ys.getPrototypeOf,mS="constructor",Mw="prototype",pD="configurable",gS="enumerable",c4="writable",m2="value",Ru=e=>!!e&&!!e[Xo];function bl(e){return e?XJ(e)||Iw(e)||!!e[QF]||!!e[mS]?.[QF]||jw(e)||Pw(e):!1}var I3e=Ys[Mw][mS].toString(),eB=new WeakMap;function XJ(e){if(!e||!DT(e))return!1;const t=S0(e);if(t===null||t===Ys[Mw])return!0;const n=Ys.hasOwnProperty.call(t,mS)&&t[mS];if(n===Object)return!0;if(!Am(n))return!1;let r=eB.get(n);return r===void 0&&(r=Function.toString.call(n),eB.set(n,r)),r===I3e}function Rw(e,t,n=!0){Nb(e)===0?(n?Reflect.ownKeys(e):Ys.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Nb(e){const t=e[Xo];return t?t.type_:Iw(e)?1:jw(e)?2:Pw(e)?3:0}var tB=(e,t,n=Nb(e))=>n===2?e.has(t):Ys[Mw].hasOwnProperty.call(e,t),mD=(e,t,n=Nb(e))=>n===2?e.get(t):e[t],yS=(e,t,n,r=Nb(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function j3e(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Iw=Array.isArray,jw=e=>e instanceof Map,Pw=e=>e instanceof Set,DT=e=>typeof e=="object",Am=e=>typeof e=="function",dE=e=>typeof e=="boolean";function P3e(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var mu=e=>e.copy_||e.base_,_T=e=>e.modified_?e.copy_:e.base_;function gD(e,t){if(jw(e))return new Map(e);if(Pw(e))return new Set(e);if(Iw(e))return Array[Mw].slice.call(e);const n=XJ(e);if(t===!0||t==="class_only"&&!n){const r=Ys.getOwnPropertyDescriptors(e);delete r[Xo];let i=Reflect.ownKeys(r);for(let o=0;o<i.length;o++){const s=i[o],a=r[s];a[c4]===!1&&(a[c4]=!0,a[pD]=!0),(a.get||a.set)&&(r[s]={[pD]:!0,[c4]:!0,[gS]:a[gS],[m2]:e[s]})}return Ys.create(S0(e),r)}else{const r=S0(e);if(r!==null&&n)return{...e};const i=Ys.create(r);return Ys.assign(i,e)}}function OT(e,t=!1){return $w(e)||Ru(e)||!bl(e)||(Nb(e)>1&&Ys.defineProperties(e,{set:Zx,add:Zx,clear:Zx,delete:Zx}),Ys.freeze(e),t&&Rw(e,(n,r)=>{OT(r,!0)},!1)),e}function $3e(){nl(2)}var Zx={[m2]:$3e};function $w(e){return e===null||!DT(e)?!0:Ys.isFrozen(e)}var bS="MapSet",yD="Patches",nB="ArrayMethods",JJ={};function Wh(e){const t=JJ[e];return t||nl(0,e),t}var rB=e=>!!JJ[e],g2,ZJ=()=>g2,L3e=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:rB(bS)?Wh(bS):void 0,arrayMethodsPlugin_:rB(nB)?Wh(nB):void 0});function iB(e,t){t&&(e.patchPlugin_=Wh(yD),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function bD(e){vD(e),e.drafts_.forEach(N3e),e.drafts_=null}function vD(e){e===g2&&(g2=e.parent_)}var oB=e=>g2=L3e(g2,e);function N3e(e){const t=e[Xo];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function sB(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Xo].modified_&&(bD(t),nl(4)),bl(e)&&(e=aB(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Xo].base_,e,t)}else e=aB(t,n);return F3e(t,e,!0),bD(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==YJ?e:void 0}function aB(e,t){if($w(t))return t;const n=t[Xo];if(!n)return vS(t,e.handledSet_,e);if(!Lw(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);tZ(n,e)}return n.copy_}function F3e(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&OT(t,n)}function QJ(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Lw=(e,t)=>e.scope_===t,B3e=[];function eZ(e,t,n,r){const i=mu(e),o=e.type_;if(r!==void 0&&mD(i,r,o)===t){yS(i,r,n,o);return}if(!e.draftLocations_){const a=e.draftLocations_=new Map;Rw(i,(l,c)=>{if(Ru(c)){const u=a.get(c)||[];u.push(l),a.set(c,u)}})}const s=e.draftLocations_.get(t)??B3e;for(const a of s)yS(i,a,n,o)}function z3e(e,t,n){e.callbacks_.push(function(i){const o=t;if(!o||!Lw(o,i))return;i.mapSetPlugin_?.fixSetContents(o);const s=_T(o);eZ(e,o.draft_??o,s,n),tZ(o,i)})}function tZ(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)}QJ(e)}}function H3e(e,t,n){const{scope_:r}=e;if(Ru(n)){const i=n[Xo];Lw(i,r)&&i.callbacks_.push(function(){u4(e);const s=_T(i);eZ(e,n,s,t)})}else bl(n)&&e.callbacks_.push(function(){const o=mu(e);e.type_===3?o.has(n)&&vS(n,r.handledSet_,r):mD(o,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&vS(mD(e.copy_,t,e.type_),r.handledSet_,r)})}function vS(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Ru(e)||t.has(e)||!bl(e)||$w(e)||(t.add(e),Rw(e,(r,i)=>{if(Ru(i)){const o=i[Xo];if(Lw(o,n)){const s=_T(o);yS(e,r,s,e.type_),QJ(o)}}else bl(i)&&vS(i,t,n)})),e}function U3e(e,t){const n=Iw(e),r={type_:n?1:0,scope_:t?t.scope_:ZJ(),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=xS;n&&(i=[r],o=y2);const{revoke:s,proxy:a}=Proxy.revocable(i,o);return r.draft_=a,r.revoke_=s,[a,r]}var xS={get(e,t){if(t===Xo)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=mu(e);if(!tB(i,t,e.type_))return V3e(e,i,t);const o=i[t];if(e.finalized_||!bl(o)||r&&e.operationMethod&&n?.isMutatingArrayMethod(e.operationMethod)&&P3e(t))return o;if(o===fE(e.base_,t)){u4(e);const s=e.type_===1?+t:t,a=SD(e.scope_,o,e,s);return e.copy_[s]=a}return o},has(e,t){return t in mu(e)},ownKeys(e){return Reflect.ownKeys(mu(e))},set(e,t,n){const r=nZ(mu(e),t);if(r?.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=fE(mu(e),t),o=i?.[Xo];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(j3e(n,i)&&(n!==void 0||tB(e.base_,t,e.type_)))return!0;u4(e),xD(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),H3e(e,t,n)),!0},deleteProperty(e,t){return u4(e),fE(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),xD(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=mu(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[c4]:!0,[pD]:e.type_!==1||t!=="length",[gS]:r[gS],[m2]:n[t]}},defineProperty(){nl(11)},getPrototypeOf(e){return S0(e.base_)},setPrototypeOf(){nl(12)}},y2={};for(let e in xS){let t=xS[e];y2[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}y2.deleteProperty=function(e,t){return y2.set.call(this,e,t,void 0)};y2.set=function(e,t,n){return xS.set.call(this,e[0],t,n,e[0])};function fE(e,t){const n=e[Xo];return(n?mu(n):e)[t]}function V3e(e,t,n){const r=nZ(t,n);return r?m2 in r?r[m2]:r.get?.call(e.draft_):void 0}function nZ(e,t){if(!(t in e))return;let n=S0(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=S0(n)}}function xD(e){e.modified_||(e.modified_=!0,e.parent_&&xD(e.parent_))}function u4(e){e.copy_||(e.assigned_=new Map,e.copy_=gD(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var W3e=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,r)=>{if(Am(t)&&!Am(n)){const o=n;n=t;const s=this;return function(l=o,...c){return s.produce(l,u=>n.call(this,u,...c))}}Am(n)||nl(6),r!==void 0&&!Am(r)&&nl(7);let i;if(bl(t)){const o=oB(this),s=SD(o,t,void 0);let a=!0;try{i=n(s),a=!1}finally{a?bD(o):vD(o)}return iB(o,r),sB(i,o)}else if(!t||!DT(t)){if(i=n(t),i===void 0&&(i=t),i===YJ&&(i=void 0),this.autoFreeze_&&OT(i,!0),r){const o=[],s=[];Wh(yD).generateReplacementPatches_(t,i,{patches_:o,inversePatches_:s}),r(o,s)}return i}else nl(1,t)},this.produceWithPatches=(t,n)=>{if(Am(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]},dE(e?.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),dE(e?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),dE(e?.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){bl(e)||nl(8),Ru(e)&&(e=q3e(e));const t=oB(this),n=SD(t,e,void 0);return n[Xo].isManual_=!0,vD(t),n}finishDraft(e,t){const n=e&&e[Xo];(!n||!n.isManual_)&&nl(9);const{scope_:r}=n;return iB(r,t),sB(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=Wh(yD).applyPatches_;return Ru(e)?r(e,t):this.produce(e,i=>r(i,t))}};function SD(e,t,n,r){const[i,o]=jw(t)?Wh(bS).proxyMap_(t,n):Pw(t)?Wh(bS).proxySet_(t,n):U3e(t,n);return(n?.scope_??ZJ()).drafts_.push(i),o.callbacks_=n?.callbacks_??[],o.key_=r,n&&r!==void 0?z3e(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 q3e(e){return Ru(e)||nl(10,e),rZ(e)}function rZ(e){if(!bl(e)||$w(e))return e;const t=e[Xo];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=gD(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=gD(e,!0);return Rw(n,(i,o)=>{yS(n,i,rZ(o))},r),t&&(t.finalized_=!1),n}var G3e=new W3e,iZ=G3e.produce,SS=Symbol("NOT_FOUND");function K3e(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function Y3e(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function X3e(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 lB=e=>Array.isArray(e)?e:[e];function J3e(e){const t=Array.isArray(e[0])?e[0]:e;return X3e(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Z3e(e,t){const n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function Q3e(e){let t;return{get(n){return t&&e(t.key,n)?t.value:SS},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function e5e(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 SS}function i(a,l){r(a)===SS&&(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 t5e=(e,t)=>e===t;function n5e(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 r5e(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=t5e,maxSize:i=1,resultEqualityCheck:o}=n,s=n5e(r);let a=0;const l=i<=1?Q3e(s):e5e(i,s);function c(){let u=l.get(arguments);if(u===SS){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 i5e=class{constructor(e){this.value=e}deref(){return this.value}},o5e=typeof WeakRef<"u"?WeakRef:i5e,s5e=0,cB=1;function Qx(){return{s:s5e,v:void 0,o:null,p:null}}function oZ(e,t={}){let n=Qx();const{resultEqualityCheck:r}=t;let i,o=0;function s(){let a=n;const{length:l}=arguments;for(let d=0,p=l;d<p;d++){const g=arguments[d];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=Qx(),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=Qx(),y.set(g,a)):a=b}}const c=a;let u;if(a.s===cB)u=a.v;else if(u=e.apply(null,arguments),o++,r){const d=i?.deref?.()??i;d!=null&&r(d,u)&&(u=d,o!==0&&o--),i=typeof u=="object"&&u!==null||typeof u=="function"?new o5e(u):u}return c.s=cB,c.v=u,u}return s.clearCache=()=>{n=Qx(),s.resetResultsCount()},s.resultsCount=()=>o,s.resetResultsCount=()=>{o=0},s}function sZ(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()),K3e(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const u={...n,...l},{memoize:d,memoizeOptions:p=[],argsMemoize:g=oZ,argsMemoizeOptions:y=[]}=u,b=lB(p),v=lB(y),S=J3e(i),C=d(function(){return o++,c.apply(null,arguments)},...b),w=g(function(){s++;const A=Z3e(S,arguments);return a=C.apply(null,A),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:d,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var aZ=sZ(oZ),a5e=Object.assign((e,t=aZ)=>{Y3e(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:()=>a5e});function lZ(e){return({dispatch:n,getState:r})=>i=>o=>typeof o=="function"?o(n,r,e):i(o)}var l5e=lZ(),c5e=lZ,u5e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?pS:pS.apply(null,arguments)},d5e=e=>e&&typeof e.match=="function";function Ay(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(wS(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=>R3e(r)&&r.type===e,n}var cZ=class ry extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,ry.prototype)}static get[Symbol.species](){return ry}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new ry(...t[0].concat(this)):new ry(...t.concat(this))}};function uB(e){return bl(e)?iZ(e,()=>{}):e}function f5e(e){return typeof e=="boolean"}var h5e=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:o=!0}=t??{};let s=new cZ;return n&&(f5e(n)?s.push(l5e):s.push(c5e(n.extraArgument))),s},p5e="RTK_autoBatch",dB=e=>t=>{setTimeout(t,e)},m5e=(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:dB(10):e.type==="callback"?e.queueNotification:dB(e.timeout),c=()=>{s=!1,o&&(o=!1,a.forEach(u=>u()))};return Object.assign({},r,{subscribe(u){const d=()=>i&&u(),p=r.subscribe(d);return a.add(u),()=>{p(),a.delete(u)}},dispatch(u){try{return i=!u?.meta?.[p5e],o=!i,o&&(s||(s=!0,l(c))),r.dispatch(u)}finally{i=!0}}})},g5e=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new cZ(e);return r&&i.push(m5e(typeof r=="object"?r:void 0)),i};function y5e(e){const t=h5e(),{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(kT(n))a=T3e(n);else throw new Error(wS(1));let l;typeof r=="function"?l=r(t):l=t();let c=pS;i&&(c=u5e({trace:!1,...typeof i=="object"&&i}));const u=M3e(...l),d=g5e(u);let p=typeof s=="function"?s(d):d();const g=c(...p);return KJ(a,o,g)}function b5e(e){const t={},n=[];let r;const i={addCase(o,s){const a=typeof o=="string"?o:o.type;if(!a)throw new Error(wS(28));if(a in t)throw new Error(wS(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 v5e(e){return typeof e=="function"}function TT(e,t){let[n,r,i]=b5e(t),o;if(v5e(e))o=()=>uB(e());else{const a=uB(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,d)=>{if(d)if(Ru(u)){const g=d(u,l);return g===void 0?u:g}else{if(bl(u))return iZ(u,p=>d(p,l));{const p=d(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 x5e=(e,t)=>d5e(e)?e.match(t):e(t);function S5e(...e){return t=>e.some(n=>x5e(n,t))}var w5e="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",C5e=(e=21)=>{let t="",n=e;for(;n--;)t+=w5e[Math.random()*64|0];return t},E5e=["name","message","stack","code"],hE=class{constructor(e,t){this.payload=e,this.meta=t}_type},fB=class{constructor(e,t){this.payload=e,this.meta=t}_type},A5e=e=>{if(typeof e=="object"&&e!==null){const t={};for(const n of E5e)typeof e[n]=="string"&&(t[n]=e[n]);return t}return{message:String(e)}},hB="External signal was aborted",k5e=(()=>{function e(t,n,r){const i=Ay(t+"/fulfilled",(l,c,u,d)=>({payload:l,meta:{...d||{},arg:u,requestId:c,requestStatus:"fulfilled"}})),o=Ay(t+"/pending",(l,c,u)=>({payload:void 0,meta:{...u||{},arg:c,requestId:l,requestStatus:"pending"}})),s=Ay(t+"/rejected",(l,c,u,d,p)=>({payload:d,error:(r&&r.serializeError||A5e)(l||"Rejected"),meta:{...p||{},arg:u,requestId:c,rejectedWithValue:!!d,requestStatus:"rejected",aborted:l?.name==="AbortError",condition:l?.name==="ConditionError"}}));function a(l,{signal:c}={}){return(u,d,p)=>{const g=r?.idGenerator?r.idGenerator(l):C5e(),y=new AbortController;let b,v;function S(w){v=w,y.abort()}c&&(c.aborted?S(hB):c.addEventListener("abort",()=>S(hB),{once:!0}));const C=(async function(){let w;try{let A=r?.condition?.(l,{getState:d,extra:p});if(_5e(A)&&(A=await A),A===!1||y.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const O=new Promise((_,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:d,extra:p}))),w=await Promise.race([O,Promise.resolve(n(l,{dispatch:u,getState:d,extra:p,requestId:g,signal:y.signal,abort:S,rejectWithValue:(_,T)=>new hE(_,T),fulfillWithValue:(_,T)=>new fB(_,T)})).then(_=>{if(_ instanceof hE)throw _;return _ instanceof fB?i(_.payload,g,l,_.meta):i(_,g,l)})])}catch(A){w=A instanceof hE?s(null,g,l,A.payload,A.meta):s(A,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(D5e)}})}}return Object.assign(a,{pending:o,rejected:s,fulfilled:i,settled:S5e(s,i),typePrefix:t})}return e.withTypes=()=>e,e})();function D5e(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}function _5e(e){return e!==null&&typeof e=="object"&&typeof e.then=="function"}function wS(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. `}class O5e extends Error{constructor(t,n,r){super(t),this.status=n,this.body=r,this.name="ApiError"}}async function wr(e){const t=await e.text();try{return JSON.parse(t)}catch{throw new O5e(`Invalid JSON response (HTTP ${e.status}): ${t.slice(0,120)}`,e.status,t)}}async function tr(e,t){if(!e.ok){const n=await e.text().catch(()=>"");let r=t;try{const i=JSON.parse(n);i?.error&&(r=i.error)}catch{n?r=`${t} (HTTP ${e.status}: ${n.slice(0,120)})`:r=`${t} (HTTP ${e.status})`}throw new Error(r)}}async function T5e(){const e=await fetch(`api/matter/bridges?_s=${Date.now()}`);return await tr(e,"Failed to fetch bridges"),wr(e)}async function MT(e){const t=await fetch("api/matter/bridges",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await tr(t,"Failed to create bridge"),wr(t)}async function uZ(e){const t=await fetch(`api/matter/bridges/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await tr(t,"Failed to update bridge"),wr(t)}async function M5e(e){await fetch(`api/matter/bridges/${e}`,{method:"DELETE"})}async function R5e(e){const t=await fetch(`api/matter/bridges/${e}/actions/factory-reset`,{method:"POST"});return await tr(t,"Factory reset failed"),wr(t)}async function dZ(e){const t=await fetch(`api/matter/bridges/${e}/actions/force-sync`,{method:"POST"});return await tr(t,"Force sync failed"),wr(t)}async function I5e(e){const t=await fetch(`api/matter/bridges/${e}/actions/open-commissioning-window`,{method:"POST"});return await tr(t,"Failed to open commissioning window"),wr(t)}async function j5e(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 fZ(){const e=await fetch("api/matter/bridges/actions/start-all",{method:"POST"});return await tr(e,"Failed to start all bridges"),wr(e)}async function hZ(){const e=await fetch("api/matter/bridges/actions/stop-all",{method:"POST"});return await tr(e,"Failed to stop all bridges"),wr(e)}async function pZ(){const e=await fetch("api/matter/bridges/actions/restart-all",{method:"POST"});return await tr(e,"Failed to restart all bridges"),wr(e)}const ng=k5e.withTypes(),Nw=aZ.withTypes(),Io=ng("bridges/load",T5e),mZ=ng("bridges/create",MT),gZ=ng("bridges/delete",M5e),yZ=ng("bridges/update",uZ),bZ=ng("bridges/reset",R5e),vZ=Ay("bridges/setFromWebSocket"),xZ=Ay("bridges/updateFromWebSocket"),Ds=lhe.withTypes(),rg=dhe.withTypes(),SZ=k.createContext({isConnected:!1,error:null});function wZ(){return k.useContext(SZ)}function P5e({children:e}){const t=Ds(),[n,r]=k.useState(!1),[i,o]=k.useState(null),s=k.useRef(null),a=k.useRef(void 0),l=k.useCallback(u=>{switch(u.type){case"bridges_update":t(vZ(u.data));break;case"bridge_update":t(xZ(u.data));break;case"ping":s.current?.send(JSON.stringify({type:"pong"}));break}},[t]),c=k.useCallback(()=>{if(s.current?.readyState===WebSocket.OPEN)return;const u=window.location.protocol==="https:"?"wss:":"ws:",d=document.querySelector("base")?.href||window.location.origin,p=new URL(d),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 k.useEffect(()=>(c(),()=>{a.current&&clearTimeout(a.current),s.current?.close()}),[c]),h.jsx(SZ.Provider,{value:{isConnected:n,error:i},children:e})}const $5e=()=>{const e=Ds();return k.useEffect(()=>{e(Io())},[e]),h.jsx(MX,{})};var sc;(function(e){e.Starting="starting",e.Running="running",e.Stopped="stopped",e.Failed="failed"})(sc||(sc={}));var kr;(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"})(kr||(kr={}));const CZ=[{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:kr.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:kr.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:kr.Domain,value:"sensor"},{type:kr.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:kr.Domain,value:"climate"},{type:kr.Domain,value:"fan"},{type:kr.Domain,value:"cover"},{type:kr.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:kr.Domain,value:"lock"},{type:kr.Domain,value:"alarm_control_panel"},{type:kr.DeviceClass,value:"motion"},{type:kr.DeviceClass,value:"door"},{type:kr.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:kr.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:kr.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:kr.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:kr.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:kr.Domain,value:"automation"},{type:kr.Domain,value:"script"},{type:kr.Domain,value:"scene"}],exclude:[]},featureFlags:{},tags:["automations","scripts","scenes"]}];var pB;(function(e){e[e.locked=1]="locked",e[e.unlocked=2]="unlocked"})(pB||(pB={}));var mB;(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"})(mB||(mB={}));var gB;(function(e){e[e.Forward=0]="Forward",e[e.Reverse=1]="Reverse"})(gB||(gB={}));var yB;(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"})(yB||(yB={}));var bB;(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"})(bB||(bB={}));var vB;(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"})(vB||(vB={}));var wD;(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"})(wD||(wD={}));const EZ=[{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 xB;(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"})(xB||(xB={}));var SB;(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"})(SB||(SB={}));var wB;(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"})(wB||(wB={}));var CB;(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"})(CB||(CB={}));var EB;(function(e){e.closed="closed",e.open="open",e.closing="closing",e.opening="opening"})(EB||(EB={}));var AB;(function(e){e.button="button",e.doorbell="doorbell",e.motion="motion"})(AB||(AB={}));var kB;(function(e){e.FORWARD="forward",e.REVERSE="reverse"})(kB||(kB={}));var DB;(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"})(DB||(DB={}));var _B;(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"})(_B||(_B={}));var OB;(function(e){e.Tv="tv",e.Speaker="speaker",e.Receiver="receiver"})(OB||(OB={}));var TB;(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"})(TB||(TB={}));var MB;(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"})(MB||(MB={}));var RB;(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"})(RB||(RB={}));var IB;(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"})(IB||(IB={}));var jB;(function(e){e.off="off",e.low="low",e.medium="medium",e.high="high",e.turbo="turbo",e.auto="auto",e.max="max"})(jB||(jB={}));var PB;(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"})(PB||(PB={}));var $B;(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"})($B||($B={}));const LB={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",motion_sensor:"Motion Sensor (PIR)",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",rain_sensor:"Rain Sensor",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"},k1={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},L5e={alarm_control_panel:["mode_select","on_off_plugin_unit"],automation:["on_off_switch"],binary_sensor:["contact_sensor","motion_sensor","occupancy_sensor","rain_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 NB;(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"})(NB||(NB={}));const FB={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},N5e={title:"Include or exclude entities",type:"object",properties:{include:{title:"Include",type:"array",items:FB},exclude:{title:"Exclude",type:"array",items:FB},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},F5e={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},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"}},additionalProperties:!1},ky={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:N5e,featureFlags:F5e},required:["name","port","filter"],additionalProperties:!1};({...ky,properties:{...ky.properties},required:[...ky?.required??[]]});const AZ=Ae(h.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"})),qa=Ae(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"})),ig=Ae(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"})),B5e=rt("MuiBox",["root"]),z5e=Aw(),le=dbe({themeId:_a,defaultTheme:z5e,defaultClassName:B5e.root,generateClassName:yJ.generate});function H5e(e){return tt("MuiButton",e)}const rh=rt("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"]),U5e=k.createContext({}),V5e=k.createContext(void 0),W5e=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}${be(t)}`,`size${be(i)}`,`${o}Size${be(i)}`,`color${be(t)}`,n&&"disableElevation",r&&"fullWidth",s&&`loadingPosition${be(a)}`],startIcon:["icon","startIcon",`iconSize${be(i)}`],endIcon:["icon","endIcon",`iconSize${be(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},u=nt(c,H5e,l);return{...l,...u}},kZ=[{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}}}],q5e=me(ea,{shouldForwardProp:e=>$i(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${be(n.color)}`],t[`size${be(n.size)}`],t[`${n.variant}Size${be(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth,n.loading&&t.loading]}})(qe(({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"},[`&.${rh.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]},[`&.${rh.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${rh.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)",[`&.${rh.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(Nn()).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"},[`&.${rh.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${rh.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}),[`&.${rh.loading}`]:{color:"transparent"}}}]}})),G5e=me("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,n.loading&&t.startIconLoadingStart,t[`iconSize${be(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}},...kZ]})),K5e=me("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,n.loading&&t.endIconLoadingEnd,t[`iconSize${be(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}},...kZ]})),Y5e=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}}]})),BB=me("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),Ye=k.forwardRef(function(t,n){const r=k.useContext(U5e),i=k.useContext(V5e),o=x0(r,t),s=ot({props:o,name:"MuiButton"}),{children:a,color:l="primary",component:c="button",className:u,disabled:d=!1,disableElevation:p=!1,disableFocusRipple:g=!1,endIcon:y,focusVisibleClassName:b,fullWidth:v=!1,id:S,loading:C=null,loadingIndicator:w,loadingPosition:E="center",size:A="medium",startIcon:O,type:_,variant:T="text",...I}=s,P=Vu(S),L=w??h.jsx(mr,{"aria-labelledby":P,color:"inherit",size:16}),R={...s,color:l,component:c,disabled:d,disableElevation:p,disableFocusRipple:g,fullWidth:v,loading:C,loadingIndicator:L,loadingPosition:E,size:A,type:_,variant:T},N=W5e(R),$=(O||C&&E==="start")&&h.jsx(G5e,{className:N.startIcon,ownerState:R,children:O||h.jsx(BB,{className:N.loadingIconPlaceholder,ownerState:R})}),z=(y||C&&E==="end")&&h.jsx(K5e,{className:N.endIcon,ownerState:R,children:y||h.jsx(BB,{className:N.loadingIconPlaceholder,ownerState:R})}),F=i||"",W=typeof C=="boolean"?h.jsx("span",{className:N.loadingWrapper,style:{display:"contents"},children:C&&h.jsx(Y5e,{className:N.loadingIndicator,ownerState:R,children:L})}):null;return h.jsxs(q5e,{ownerState:R,className:Oe(r.className,N.root,u,F),component:c,disabled:d||C,focusRipple:!g,focusVisibleClassName:Oe(N.focusVisible,b),ref:n,type:_,id:C?P:S,...I,classes:N,children:[$,E!=="end"&&W,a,E==="end"&&W,z]})});function X5e(e){return tt("MuiCard",e)}rt("MuiCard",["root"]);const J5e=e=>{const{classes:t}=e;return nt({root:["root"]},X5e,t)},Z5e=me(Vr,{name:"MuiCard",slot:"Root"})({overflow:"hidden"}),En=k.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCard"}),{className:i,raised:o=!1,...s}=r,a={...r,raised:o},l=J5e(a);return h.jsx(Z5e,{className:Oe(l.root,i),elevation:o?8:void 0,ref:n,ownerState:a,...s})});function Q5e(e){return tt("MuiCardActionArea",e)}const pE=rt("MuiCardActionArea",["root","focusVisible","focusHighlight"]),e4e=e=>{const{classes:t}=e;return nt({root:["root"],focusHighlight:["focusHighlight"]},Q5e,t)},t4e=me(ea,{name:"MuiCardActionArea",slot:"Root"})(qe(({theme:e})=>({display:"block",textAlign:"inherit",borderRadius:"inherit",width:"100%",[`&:hover .${pE.focusHighlight}`]:{opacity:(e.vars||e).palette.action.hoverOpacity,"@media (hover: none)":{opacity:0}},[`&.${pE.focusVisible} .${pE.focusHighlight}`]:{opacity:(e.vars||e).palette.action.focusOpacity}}))),n4e=me("span",{name:"MuiCardActionArea",slot:"FocusHighlight"})(qe(({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})}))),Iu=k.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,d=e4e(u),p={slots:a,slotProps:l},[g,y]=ht("root",{elementType:t4e,externalForwardedProps:{...p,...c},shouldForwardComponentProp:!0,ownerState:u,ref:n,className:Oe(d.root,o),additionalProps:{focusVisibleClassName:Oe(s,d.focusVisible)}}),[b,v]=ht("focusHighlight",{elementType:n4e,externalForwardedProps:p,ownerState:u,className:d.focusHighlight});return h.jsxs(g,{...y,children:[i,h.jsx(b,{...v})]})});function r4e(e){return tt("MuiCardContent",e)}rt("MuiCardContent",["root"]);const i4e=e=>{const{classes:t}=e;return nt({root:["root"]},r4e,t)},o4e=me("div",{name:"MuiCardContent",slot:"Root"})({padding:16,"&:last-child":{paddingBottom:24}}),Vn=k.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCardContent"}),{className:i,component:o="div",...s}=r,a={...r,component:o},l=i4e(a);return h.jsx(o4e,{as:o,className:Oe(l.root,i),ownerState:a,ref:n,...s})}),Fw=k.createContext(void 0);function El(){return k.useContext(Fw)}function s4e(e){return tt("PrivateSwitchBase",e)}rt("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const a4e=e=>{const{classes:t,checked:n,disabled:r,edge:i}=e,o={root:["root",n&&"checked",r&&"disabled",i&&`edge${be(i)}`],input:["input"]};return nt(o,s4e,t)},l4e=me(ea,{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}}]}),c4e=me("input",{name:"MuiSwitchBase",shouldForwardProp:$i})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),RT=k.forwardRef(function(t,n){const{autoFocus:r,checked:i,checkedIcon:o,defaultChecked:s,disabled:a,disableFocusRipple:l=!1,edge:c=!1,icon:u,id:d,inputProps:p,inputRef:g,name:y,onBlur:b,onChange:v,onFocus:S,readOnly:C,required:w=!1,tabIndex:E,type:A,value:O,slots:_={},slotProps:T={},...I}=t,[P,L]=ul({controlled:i,default:!!s,name:"SwitchBase",state:"checked"}),R=El(),N=G=>{S&&S(G),R&&R.onFocus&&R.onFocus(G)},$=G=>{b&&b(G),R&&R.onBlur&&R.onBlur(G)},z=G=>{if(G.nativeEvent.defaultPrevented||C)return;const J=G.target.checked;L(J),v&&v(G,J)};let F=a;R&&typeof F>"u"&&(F=R.disabled);const W=A==="checkbox"||A==="radio",V={...t,checked:P,disabled:F,disableFocusRipple:l,edge:c},q=a4e(V),X={slots:_,slotProps:{input:p,...T}},[B,U]=ht("root",{ref:n,elementType:l4e,className:q.root,shouldForwardComponentProp:!0,externalForwardedProps:{...X,component:"span",...I},getSlotProps:G=>({...G,onFocus:J=>{G.onFocus?.(J),N(J)},onBlur:J=>{G.onBlur?.(J),$(J)}}),ownerState:V,additionalProps:{centerRipple:!0,focusRipple:!l,role:void 0,tabIndex:null}}),[Y,H]=ht("input",{ref:g,elementType:c4e,className:q.input,externalForwardedProps:X,getSlotProps:G=>({...G,onChange:J=>{G.onChange?.(J),z(J)}}),ownerState:V,additionalProps:{autoFocus:r,checked:i,defaultChecked:s,disabled:F,id:W?d:void 0,name:y,readOnly:C,required:w,tabIndex:E,type:A,...A==="checkbox"&&O===void 0?{}:{value:O}}});return h.jsxs(B,{...U,children:[h.jsx(Y,{...H}),P?o:u]})}),u4e=Ae(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"})),d4e=Ae(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"})),f4e=Ae(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 h4e(e){return tt("MuiCheckbox",e)}const mE=rt("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),p4e=e=>{const{classes:t,indeterminate:n,color:r,size:i}=e,o={root:["root",n&&"indeterminate",`color${be(r)}`,`size${be(i)}`]},s=nt(o,h4e,t);return{...t,...s}},m4e=me(RT,{shouldForwardProp:e=>$i(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.indeterminate&&t.indeterminate,t[`size${be(n.size)}`],n.color!=="default"&&t[`color${be(n.color)}`]]}})(qe(({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(Nn()).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(Nn()).map(([t])=>({props:{color:t},style:{[`&.${mE.checked}, &.${mE.indeterminate}`]:{color:(e.vars||e).palette[t].main},[`&.${mE.disabled}`]:{color:(e.vars||e).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),g4e=h.jsx(d4e,{}),y4e=h.jsx(u4e,{}),b4e=h.jsx(f4e,{}),us=k.forwardRef(function(t,n){const r=ot({props:t,name:"MuiCheckbox"}),{checkedIcon:i=g4e,color:o="primary",icon:s=y4e,indeterminate:a=!1,indeterminateIcon:l=b4e,inputProps:c,size:u="medium",disableRipple:d=!1,className:p,slots:g={},slotProps:y={},...b}=r,v=a?l:s,S=a?l:i,C={...r,disableRipple:d,color:o,indeterminate:a,size:u},w=p4e(C),E=y.input??c,[A,O]=ht("root",{ref:n,elementType:m4e,className:Oe(w.root,p),shouldForwardComponentProp:!0,externalForwardedProps:{slots:g,slotProps:y,...b},ownerState:C,additionalProps:{type:"checkbox",icon:k.cloneElement(v,{fontSize:v.props.fontSize??u}),checkedIcon:k.cloneElement(S,{fontSize:S.props.fontSize??u}),disableRipple:d,slots:g,slotProps:{input:wT(typeof E=="function"?E(C):E,{"data-indeterminate":a})}}});return h.jsx(A,{...O,classes:w})}),v4e=Ae(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 x4e(e){return tt("MuiChip",e)}const On=rt("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"]),S4e=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${be(r)}`,`color${be(i)}`,a&&"clickable",a&&`clickableColor${be(i)}`,s&&"deletable",s&&`deletableColor${be(i)}`,`${l}${be(i)}`],label:["label",`label${be(r)}`],avatar:["avatar",`avatar${be(r)}`,`avatarColor${be(i)}`],icon:["icon",`icon${be(r)}`,`iconColor${be(o)}`],deleteIcon:["deleteIcon",`deleteIcon${be(r)}`,`deleteIconColor${be(i)}`,`deleteIcon${be(l)}Color${be(i)}`]};return nt(c,x4e,t)},w4e=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[{[`& .${On.avatar}`]:t.avatar},{[`& .${On.avatar}`]:t[`avatar${be(a)}`]},{[`& .${On.avatar}`]:t[`avatarColor${be(r)}`]},{[`& .${On.icon}`]:t.icon},{[`& .${On.icon}`]:t[`icon${be(a)}`]},{[`& .${On.icon}`]:t[`iconColor${be(i)}`]},{[`& .${On.deleteIcon}`]:t.deleteIcon},{[`& .${On.deleteIcon}`]:t[`deleteIcon${be(a)}`]},{[`& .${On.deleteIcon}`]:t[`deleteIconColor${be(r)}`]},{[`& .${On.deleteIcon}`]:t[`deleteIcon${be(l)}Color${be(r)}`]},t.root,t[`size${be(a)}`],t[`color${be(r)}`],o&&t.clickable,o&&r!=="default"&&t[`clickableColor${be(r)}`],s&&t.deletable,s&&r!=="default"&&t[`deletableColor${be(r)}`],t[l],t[`${l}${be(r)}`]]}})(qe(({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",[`&.${On.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${On.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${On.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${On.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${On.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${On.icon}`]:{marginLeft:5,marginRight:-6},[`& .${On.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,[`& .${On.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${On.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Nn(["contrastText"])).map(([n])=>({props:{color:n},style:{backgroundColor:(e.vars||e).palette[n].main,color:(e.vars||e).palette[n].contrastText,[`& .${On.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:{[`& .${On.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:n=>n.iconColor===n.color&&n.color!=="default",style:{[`& .${On.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${On.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(Nn(["dark"])).map(([n])=>({props:{color:n,onDelete:!0},style:{[`&.${On.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}`)},[`&.${On.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(Nn(["dark"])).map(([n])=>({props:{color:n,clickable:!0},style:{[`&:hover, &.${On.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]}`,[`&.${On.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${On.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${On.avatar}`]:{marginLeft:4},[`& .${On.avatarSmall}`]:{marginLeft:2},[`& .${On.icon}`]:{marginLeft:4},[`& .${On.iconSmall}`]:{marginLeft:2},[`& .${On.deleteIcon}`]:{marginRight:5},[`& .${On.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Nn()).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)}`,[`&.${On.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${On.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.focusOpacity)},[`& .${On.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[n].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[n].main}}}}))]}})),C4e=me("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${be(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 zB(e){return e.key==="Backspace"||e.key==="Delete"}const dt=k.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:d,label:p,onClick:g,onDelete:y,onKeyDown:b,onKeyUp:v,size:S="medium",variant:C="filled",tabIndex:w,skipFocusWhenDisabled:E=!1,slots:A={},slotProps:O={},..._}=r,T=k.useRef(null),I=Lr(T,n),P=J=>{J.stopPropagation(),y(J)},L=J=>{J.currentTarget===J.target&&zB(J)&&J.preventDefault(),b&&b(J)},R=J=>{J.currentTarget===J.target&&y&&zB(J)&&y(J),v&&v(J)},N=s!==!1&&g?!0:s,$=N||y?ea:l||"div",z={...r,component:$,disabled:u,size:S,color:a,iconColor:k.isValidElement(d)&&d.props.color||a,onDelete:!!y,clickable:N,variant:C},F=S4e(z),W=$===ea?{component:l||"div",focusVisibleClassName:F.focusVisible,...y&&{disableRipple:!0}}:{};let V=null;y&&(V=c&&k.isValidElement(c)?k.cloneElement(c,{className:Oe(c.props.className,F.deleteIcon),onClick:P}):h.jsx(v4e,{className:F.deleteIcon,onClick:P}));let q=null;i&&k.isValidElement(i)&&(q=k.cloneElement(i,{className:Oe(F.avatar,i.props.className)}));let X=null;d&&k.isValidElement(d)&&(X=k.cloneElement(d,{className:Oe(F.icon,d.props.className)}));const B={slots:A,slotProps:O},[U,Y]=ht("root",{elementType:w4e,externalForwardedProps:{...B,..._},ownerState:z,shouldForwardComponentProp:!0,ref:I,className:Oe(F.root,o),additionalProps:{disabled:N&&u?!0:void 0,tabIndex:E&&u?-1:w,...W},getSlotProps:J=>({...J,onClick:se=>{J.onClick?.(se),g?.(se)},onKeyDown:se=>{J.onKeyDown?.(se),L(se)},onKeyUp:se=>{J.onKeyUp?.(se),R(se)}})}),[H,G]=ht("label",{elementType:C4e,externalForwardedProps:B,ownerState:z,className:F.label});return h.jsxs(U,{as:$,...Y,children:[q||X,h.jsx(H,{...G,children:p}),V]})});function HB(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function CS(e,t=!1){return e&&(HB(e.value)&&e.value!==""||t&&HB(e.defaultValue)&&e.defaultValue!=="")}function E4e(e){return e.startAdornment}function A4e(e){return tt("MuiFormControl",e)}rt("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const k4e=e=>{const{classes:t,margin:n,fullWidth:r}=e,i={root:["root",n!=="none"&&`margin${be(n)}`,r&&"fullWidth"]};return nt(i,A4e,t)},D4e=me("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`margin${be(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%"}}]}),ms=k.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:d=!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:d,hiddenLabel:p,margin:g,required:y,size:b,variant:v},w=k4e(C),[E,A]=k.useState(()=>{let z=!1;return i&&k.Children.forEach(i,F=>{if(!Ey(F,["Input","Select"]))return;const W=Ey(F,["Select"])?F.props.input:F;W&&E4e(W.props)&&(z=!0)}),z}),[O,_]=k.useState(()=>{let z=!1;return i&&k.Children.forEach(i,F=>{Ey(F,["Input","Select"])&&(CS(F.props,!0)||CS(F.props.inputProps,!0))&&(z=!0)}),z}),[T,I]=k.useState(!1);l&&T&&I(!1);const P=u!==void 0&&!l?u:T;let L;k.useRef(!1);const R=k.useCallback(()=>{_(!0)},[]),N=k.useCallback(()=>{_(!1)},[]),$=k.useMemo(()=>({adornedStart:E,setAdornedStart:A,color:s,disabled:l,error:c,filled:O,focused:P,fullWidth:d,hiddenLabel:p,size:b,onBlur:()=>{I(!1)},onFocus:()=>{I(!0)},onEmpty:N,onFilled:R,registerEffect:L,required:y,variant:v}),[E,s,l,c,O,P,d,p,L,N,R,y,b,v]);return h.jsx(Fw.Provider,{value:$,children:h.jsx(D4e,{as:a,ownerState:C,className:Oe(w.root,o),ref:n,...S,children:i})})});function _4e(e){return tt("MuiTypography",e)}const UB=rt("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),O4e={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},T4e=nxe(),M4e=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:i,variant:o,classes:s}=e,a={root:["root",o,e.align!=="inherit"&&`align${be(t)}`,n&&"gutterBottom",r&&"noWrap",i&&"paragraph"]};return nt(a,_4e,s)},R4e=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${be(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(qe(({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(Nn()).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${be(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}}]}))),VB={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},oe=k.forwardRef(function(t,n){const{color:r,...i}=ot({props:t,name:"MuiTypography"}),o=!O4e[r],s=T4e({...i,...o&&{color:r}}),{align:a="inherit",className:l,component:c,gutterBottom:u=!1,noWrap:d=!1,paragraph:p=!1,variant:g="body1",variantMapping:y=VB,...b}=s,v={...s,align:a,color:r,className:l,component:c,gutterBottom:u,noWrap:d,paragraph:p,variant:g,variantMapping:y},S=c||(p?"p":y[g]||VB[g])||"span",C=M4e(v);return h.jsx(R4e,{as:S,ref:n,className:Oe(C.root,l),...b,ownerState:v,style:{...a!=="inherit"&&{"--Typography-textAlign":a},...b.style}})});function I4e(e){return tt("MuiFormControlLabel",e)}const iy=rt("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]);function Tf({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 j4e=e=>{const{classes:t,disabled:n,labelPlacement:r,error:i,required:o}=e,s={root:["root",n&&"disabled",`labelPlacement${be(r)}`,i&&"error",o&&"required"],label:["label",n&&"disabled"],asterisk:["asterisk",i&&"error"]};return nt(s,I4e,t)},P4e=me("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${iy.label}`]:t.label},t.root,t[`labelPlacement${be(n.labelPlacement)}`]]}})(qe(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${iy.disabled}`]:{cursor:"default"},[`& .${iy.label}`]:{[`&.${iy.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}}]}))),$4e=me("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(qe(({theme:e})=>({[`&.${iy.error}`]:{color:(e.vars||e).palette.error.main}}))),gs=k.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:d,labelPlacement:p="end",name:g,onChange:y,required:b,slots:v={},slotProps:S={},value:C,...w}=r,E=El(),A=l??a.props.disabled??E?.disabled,O=b??a.props.required,_={disabled:A,required:O};["checked","name","onChange","value","inputRef"].forEach(z=>{typeof a.props[z]>"u"&&typeof r[z]<"u"&&(_[z]=r[z])});const T=Tf({props:r,muiFormControl:E,states:["error"]}),I={...r,disabled:A,labelPlacement:p,required:O,error:T.error},P=j4e(I),L={slots:v,slotProps:{...s,...S}},[R,N]=ht("typography",{elementType:oe,externalForwardedProps:L,ownerState:I});let $=d;return $!=null&&$.type!==oe&&!c&&($=h.jsx(R,{component:"span",...N,className:Oe(P.label,N?.className),children:$})),h.jsxs(P4e,{className:Oe(P.root,o),ownerState:I,ref:n,...w,children:[k.cloneElement(a,_),O?h.jsxs("div",{children:[$,h.jsxs($4e,{ownerState:I,"aria-hidden":!0,className:P.asterisk,children:[" ","*"]})]}):$]})}),lt=yve({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:co});function L4e(e){return tt("MuiLinearProgress",e)}rt("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const CD=4,ED=Df`
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
- `},xht={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 Sht(e){let{announcements:t=xht,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=vht}=e;const{announce:o,announcement:s}=ght(),a=Rv("DndLiveRegion"),[l,c]=k.useState(!1);if(k.useEffect(()=>{c(!0)},[]),yht(k.useMemo(()=>({onDragStart(d){let{active:p}=d;o(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:g}=d;t.onDragMove&&o(t.onDragMove({active:p,over:g}))},onDragOver(d){let{active:p,over:g}=d;o(t.onDragOver({active:p,over:g}))},onDragEnd(d){let{active:p,over:g}=d;o(t.onDragEnd({active:p,over:g}))},onDragCancel(d){let{active:p,over:g}=d;o(t.onDragCancel({active:p,over:g}))}}),[o,t])),!l)return null;const u=Jt.createElement(Jt.Fragment,null,Jt.createElement(pht,{id:r,value:i.draggable}),Jt.createElement(mht,{id:a,announcement:s}));return n?Bd.createPortal(u,n):u}var Ui;(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"})(Ui||(Ui={}));function nw(){}function FY(e,t){return k.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function wht(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return k.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const wl=Object.freeze({x:0,y:0});function iue(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function oue(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Cht(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function BY(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 sue(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function zY(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 Eht=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=zY(t,t.left,t.top),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=iue(zY(l),i);o.push({id:a,data:{droppableContainer:s,value:c}})}}return o.sort(oue)},Aht=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=BY(t),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=BY(l),u=i.reduce((p,g,y)=>p+iue(c[y],g),0),d=Number((u/4).toFixed(4));o.push({id:a,data:{droppableContainer:s,value:d}})}}return o.sort(oue)};function kht(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,d=u/(l+c-u);return Number(d.toFixed(4))}return 0}const Dht=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=kht(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(Cht)};function _ht(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function aue(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:wl}function Oht(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 Tht=Oht(1);function Mht(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 Rht(e,t,n){const r=Mht(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,d=o?e.height/o:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}const Iht={ignoreTransform:!1};function Og(e,t){t===void 0&&(t=Iht);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=Os(e).getComputedStyle(e);c&&(n=Rht(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 HY(e){return Og(e,{ignoreTransform:!0})}function jht(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Pht(e,t){return t===void 0&&(t=Os(e).getComputedStyle(e)),t.position==="fixed"}function $ht(e,t){t===void 0&&(t=Os(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 D8(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(dj(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Tv(i)||tue(i)||n.includes(i))return n;const o=Os(e).getComputedStyle(i);return i!==e&&$ht(i,o)&&n.push(i),Pht(i,o)?n:r(i.parentNode)}return e?r(e):n}function lue(e){const[t]=D8(e,1);return t??null}function Lk(e){return!k8||!e?null:Dg(e)?e:uj(e)?dj(e)||e===_g(e).scrollingElement?window:Tv(e)?e:null:null}function cue(e){return Dg(e)?e.scrollX:e.scrollLeft}function uue(e){return Dg(e)?e.scrollY:e.scrollTop}function HO(e){return{x:cue(e),y:uue(e)}}var no;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(no||(no={}));function due(e){return!k8||!e?!1:e===document.scrollingElement}function fue(e){const t={x:0,y:0},n=due(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 Lht={x:.2,y:.2};function Nht(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=Lht);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=fue(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=no.Backward,y.y=r*Math.abs((t.top+b.height-o)/b.height)):!u&&l>=t.bottom-b.height&&(g.y=no.Forward,y.y=r*Math.abs((t.bottom-b.height-l)/b.height)),!p&&a>=t.right-b.width?(g.x=no.Forward,y.x=r*Math.abs((t.right-b.width-a)/b.width)):!d&&s<=t.left+b.width&&(g.x=no.Backward,y.x=r*Math.abs((t.left+b.width-s)/b.width)),{direction:g,speed:y}}function Fht(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 hue(e){return e.reduce((t,n)=>b0(t,HO(n)),wl)}function Bht(e){return e.reduce((t,n)=>t+cue(n),0)}function zht(e){return e.reduce((t,n)=>t+uue(n),0)}function Hht(e,t){if(t===void 0&&(t=Og),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);lue(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Uht=[["x",["left","right"],Bht],["y",["top","bottom"],zht]];class pj{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=D8(n),i=hue(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of Uht)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 t2{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 Vht(e){const{EventTarget:t}=Os(e);return e instanceof t?e:_g(e)}function Nk(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 xa;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(xa||(xa={}));function UY(e){e.preventDefault()}function Wht(e){e.stopPropagation()}var zn;(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"})(zn||(zn={}));const pue={start:[zn.Space,zn.Enter],cancel:[zn.Esc],end:[zn.Space,zn.Enter,zn.Tab]},qht=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case zn.Right:return{...n,x:n.x+25};case zn.Left:return{...n,x:n.x-25};case zn.Down:return{...n,y:n.y+25};case zn.Up:return{...n,y:n.y-25}}};class mj{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 t2(_g(n)),this.windowListeners=new t2(Os(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xa.Resize,this.handleCancel),this.windowListeners.add(xa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Hht(r),n(wl)}handleKeyDown(t){if(hj(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=pue,coordinateGetter:s=qht,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}:wl;this.referenceCoordinates||(this.referenceCoordinates=u);const d=s(t,{active:n,context:r.current,currentCoordinates:u});if(d){const p=Eb(d,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:E,maxScroll:A,minScroll:O}=fue(b),_=Fht(b),T={x:Math.min(v===zn.Right?_.right-_.width/2:_.right,Math.max(v===zn.Right?_.left:_.left+_.width/2,d.x)),y:Math.min(v===zn.Down?_.bottom-_.height/2:_.bottom,Math.max(v===zn.Down?_.top:_.top+_.height/2,d.y))},I=v===zn.Right&&!C||v===zn.Left&&!w,P=v===zn.Down&&!E||v===zn.Up&&!S;if(I&&T.x!==d.x){const L=b.scrollLeft+p.x,R=v===zn.Right&&L<=A.x||v===zn.Left&&L>=O.x;if(R&&!p.y){b.scrollTo({left:L,behavior:a});return}R?g.x=b.scrollLeft-L:g.x=v===zn.Right?b.scrollLeft-A.x:b.scrollLeft-O.x,g.x&&b.scrollBy({left:-g.x,behavior:a});break}else if(P&&T.y!==d.y){const L=b.scrollTop+p.y,R=v===zn.Down&&L<=A.y||v===zn.Up&&L>=O.y;if(R&&!p.x){b.scrollTo({top:L,behavior:a});return}R?g.y=b.scrollTop-L:g.y=v===zn.Down?b.scrollTop-A.y:b.scrollTop-O.y,g.y&&b.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,b0(Eb(d,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()}}mj.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=pue,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 VY(e){return!!(e&&"distance"in e)}function WY(e){return!!(e&&"delay"in e)}class gj{constructor(t,n,r){var i;r===void 0&&(r=Vht(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=_g(s),this.documentListeners=new t2(this.document),this.listeners=new t2(r),this.windowListeners=new t2(Os(s)),this.initialCoordinates=(i=zO(o))!=null?i:wl,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(xa.Resize,this.handleCancel),this.windowListeners.add(xa.DragStart,UY),this.windowListeners.add(xa.VisibilityChange,this.handleCancel),this.windowListeners.add(xa.ContextMenu,UY),this.documentListeners.add(xa.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(WY(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(VY(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(xa.Click,Wht,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xa.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=zO(t))!=null?n:wl,c=Eb(i,l);if(!r&&a){if(VY(a)){if(a.tolerance!=null&&Nk(c,a.tolerance))return this.handleCancel();if(Nk(c,a.distance))return this.handleStart()}if(WY(a)&&Nk(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===zn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ght={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class yj extends gj{constructor(t){const{event:n}=t,r=_g(n.target);super(t,Ght,r)}}yj.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 Kht={move:{name:"mousemove"},end:{name:"mouseup"}};var UO;(function(e){e[e.RightClick=2]="RightClick"})(UO||(UO={}));class Yht extends gj{constructor(t){super(t,Kht,_g(t.event.target))}}Yht.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===UO.RightClick?!1:(r?.({event:n}),!0)}}];const Fk={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Xht extends gj{constructor(t){super(t,Fk)}static setup(){return window.addEventListener(Fk.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Fk.move.name,t)};function t(){}}}Xht.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 n2;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(n2||(n2={}));var rw;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(rw||(rw={}));function Jht(e){let{acceleration:t,activator:n=n2.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:a=rw.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:p}=e;const g=Qht({delta:d,disabled:!o}),[y,b]=cht(),v=k.useRef({x:0,y:0}),S=k.useRef({x:0,y:0}),C=k.useMemo(()=>{switch(n){case n2.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case n2.DraggableRect:return i}},[n,i,l]),w=k.useRef(null),E=k.useCallback(()=>{const O=w.current;if(!O)return;const _=v.current.x*S.current.x,T=v.current.y*S.current.y;O.scrollBy(_,T)},[]),A=k.useMemo(()=>a===rw.TreeOrder?[...c].reverse():c,[a,c]);k.useEffect(()=>{if(!o||!c.length||!C){b();return}for(const O of A){if(r?.(O)===!1)continue;const _=c.indexOf(O),T=u[_];if(!T)continue;const{direction:I,speed:P}=Nht(O,T,C,t,p);for(const L of["x","y"])g[L][I[L]]||(P[L]=0,I[L]=0);if(P.x>0||P.y>0){b(),w.current=O,y(E,s),v.current=P,S.current=I;return}}v.current={x:0,y:0},S.current={x:0,y:0},b()},[t,E,r,b,o,s,JSON.stringify(C),JSON.stringify(g),y,c,A,u,JSON.stringify(p)])}const Zht={x:{[no.Backward]:!1,[no.Forward]:!1},y:{[no.Backward]:!1,[no.Forward]:!1}};function Qht(e){let{delta:t,disabled:n}=e;const r=BO(t);return Mv(i=>{if(n||!r||!i)return Zht;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[no.Backward]:i.x[no.Backward]||o.x===-1,[no.Forward]:i.x[no.Forward]||o.x===1},y:{[no.Backward]:i.y[no.Backward]||o.y===-1,[no.Forward]:i.y[no.Forward]||o.y===1}}},[n,t,r])}function ept(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Mv(i=>{var o;return t==null?null:(o=r??i)!=null?o:null},[r,t])}function tpt(e,t){return k.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 kb;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(kb||(kb={}));var VO;(function(e){e.Optimized="optimized"})(VO||(VO={}));const qY=new Map;function npt(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,s]=k.useState(null),{frequency:a,measure:l,strategy:c}=i,u=k.useRef(e),d=v(),p=Cb(d),g=k.useCallback(function(S){S===void 0&&(S=[]),!p.current&&s(C=>C===null?S:C.concat(S.filter(w=>!C.includes(w))))},[p]),y=k.useRef(null),b=Mv(S=>{if(d&&!n)return qY;if(!S||S===qY||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 E=w.node.current,A=E?new pj(l(E),E):null;w.rect.current=A,A&&C.set(w.id,A)}return C}return S},[e,o,n,d,l]);return k.useEffect(()=>{u.current=e},[e]),k.useEffect(()=>{d||g()},[n,d]),k.useEffect(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),k.useEffect(()=>{d||typeof a!="number"||y.current!==null||(y.current=setTimeout(()=>{g(),y.current=null},a))},[a,d,g,...r]),{droppableRects:b,measureDroppableContainers:g,measuringScheduled:o!=null};function v(){switch(c){case kb.Always:return!1;case kb.BeforeDragging:return n;default:return!n}}}function mue(e,t){return Mv(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function rpt(e,t){return mue(e,t)}function ipt(e){let{callback:t,disabled:n}=e;const r=fj(t),i=k.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return k.useEffect(()=>()=>i?.disconnect(),[i]),i}function _8(e){let{callback:t,disabled:n}=e;const r=fj(t),i=k.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return k.useEffect(()=>()=>i?.disconnect(),[i]),i}function opt(e){return new pj(Og(e),e)}function GY(e,t,n){t===void 0&&(t=opt);const[r,i]=k.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=ipt({callback(l){if(e)for(const c of l){const{type:u,target:d}=c;if(u==="childList"&&d instanceof HTMLElement&&d.contains(e)){o();break}}}}),a=_8({callback:o});return Mc(()=>{o(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function spt(e){const t=mue(e);return aue(e,t)}const KY=[];function apt(e){const t=k.useRef(e),n=Mv(r=>e?r&&r!==KY&&e&&t.current&&e.parentNode===t.current.parentNode?r:D8(e):KY,[e]);return k.useEffect(()=>{t.current=e},[e]),n}function lpt(e){const[t,n]=k.useState(null),r=k.useRef(e),i=k.useCallback(o=>{const s=Lk(o.target);s&&n(a=>a?(a.set(s,HO(s)),new Map(a)):null)},[]);return k.useEffect(()=>{const o=r.current;if(e!==o){s(o);const a=e.map(l=>{const c=Lk(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,HO(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=Lk(l);c?.removeEventListener("scroll",i)})}},[i,e]),k.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>b0(o,s),wl):hue(e):wl,[e,t])}function YY(e,t){t===void 0&&(t=[]);const n=k.useRef(null);return k.useEffect(()=>{n.current=null},t),k.useEffect(()=>{const r=e!==wl;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Eb(e,n.current):wl}function cpt(e){k.useEffect(()=>{if(!k8)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 upt(e,t){return k.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=s=>{o(s,t)},n},{}),[e,t])}function gue(e){return k.useMemo(()=>e?jht(e):null,[e])}const XY=[];function dpt(e,t){t===void 0&&(t=Og);const[n]=e,r=gue(n?Os(n):null),[i,o]=k.useState(XY);function s(){o(()=>e.length?e.map(l=>due(l)?r:new pj(t(l),l)):XY)}const a=_8({callback:s});return Mc(()=>{a?.disconnect(),s(),e.forEach(l=>a?.observe(l))},[e]),i}function fpt(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Tv(t)?t:e}function hpt(e){let{measure:t}=e;const[n,r]=k.useState(null),i=k.useCallback(c=>{for(const{target:u}of c)if(Tv(u)){r(d=>{const p=t(u);return d?{...d,width:p.width,height:p.height}:p});break}},[t]),o=_8({callback:i}),s=k.useCallback(c=>{const u=fpt(c);o?.disconnect(),u&&o?.observe(u),r(u?t(u):null)},[t,o]),[a,l]=tw(s);return k.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const ppt=[{sensor:yj,options:{}},{sensor:mj,options:{}}],mpt={current:{}},eS={draggable:{measure:HY},droppable:{measure:HY,strategy:kb.WhileDragging,frequency:VO.Optimized},dragOverlay:{measure:Og}};class r2 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 gpt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new r2,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:nw},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:eS,measureDroppableContainers:nw,windowRect:null,measuringScheduled:!1},ypt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:nw,draggableNodes:new Map,over:null,measureDroppableContainers:nw},O8=k.createContext(ypt),yue=k.createContext(gpt);function bpt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new r2}}}function vpt(e,t){switch(t.type){case Ui.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Ui.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 Ui.DragEnd:case Ui.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ui.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new r2(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Ui.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 r2(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case Ui.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new r2(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function xpt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=k.useContext(O8),o=BO(r),s=BO(n?.id);return k.useEffect(()=>{if(!t&&!r&&o&&s!=null){if(!hj(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 d=fht(u);if(d){d.focus();break}}})}},[r,t,i,s,o]),null}function Spt(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function wpt(e){return k.useMemo(()=>({draggable:{...eS.draggable,...e?.draggable},droppable:{...eS.droppable,...e?.droppable},dragOverlay:{...eS.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Cpt(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=k.useRef(!1),{x:s,y:a}=typeof i=="boolean"?{x:i,y:i}:i;Mc(()=>{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),d=aue(u,r);if(s||(d.x=0),a||(d.y=0),o.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=lue(c);p&&p.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}const bue=k.createContext({...wl,scaleX:1,scaleY:1});var Rd;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Rd||(Rd={}));const Ept=k.memo(function(t){var n,r,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:u=ppt,collisionDetection:d=Dht,measuring:p,modifiers:g,...y}=t;const b=k.useReducer(vpt,void 0,bpt),[v,S]=b,[C,w]=bht(),[E,A]=k.useState(Rd.Uninitialized),O=E===Rd.Initialized,{draggable:{active:_,nodes:T,translate:I},droppable:{containers:P}}=v,L=_!=null?T.get(_):null,R=k.useRef({initial:null,translated:null}),N=k.useMemo(()=>{var Ot;return _!=null?{id:_,data:(Ot=L?.data)!=null?Ot:mpt,rect:R}:null},[_,L]),$=k.useRef(null),[z,F]=k.useState(null),[W,V]=k.useState(null),q=Cb(y,Object.values(y)),X=Rv("DndDescribedBy",s),B=k.useMemo(()=>P.getEnabled(),[P]),U=wpt(p),{droppableRects:Y,measureDroppableContainers:H,measuringScheduled:G}=npt(B,{dragging:O,dependencies:[I.x,I.y],config:U.droppable}),J=ept(T,_),se=k.useMemo(()=>W?zO(W):null,[W]),Q=Cr(),ie=rpt(J,U.draggable.measure);Cpt({activeNode:_!=null?T.get(_):null,config:Q.layoutShiftCompensation,initialRect:ie,measure:U.draggable.measure});const ne=GY(J,U.draggable.measure,ie),Z=GY(J?J.parentElement:null),re=k.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ee=P.getNodeFor((n=re.current.over)==null?void 0:n.id),ae=hpt({measure:U.dragOverlay.measure}),fe=(r=ae.nodeRef.current)!=null?r:J,ge=O?(i=ae.rect)!=null?i:ne:null,je=!!(ae.nodeRef.current&&ae.rect),ke=spt(je?null:ne),He=gue(fe?Os(fe):null),Ne=apt(O?ee??J:null),_e=dpt(Ne),Te=Spt(g,{transform:{x:I.x-ke.x,y:I.y-ke.y,scaleX:1,scaleY:1},activatorEvent:W,active:N,activeNodeRect:ne,containerNodeRect:Z,draggingNodeRect:ge,over:re.current.over,overlayNodeRect:ae.rect,scrollableAncestors:Ne,scrollableAncestorRects:_e,windowRect:He}),it=se?b0(se,I):null,Xe=lpt(Ne),ze=YY(Xe),Ie=YY(Xe,[ne]),Ue=b0(Te,ze),et=ge?Tht(ge,Te):null,st=N&&et?d({active:N,collisionRect:et,droppableRects:Y,droppableContainers:B,pointerCoordinates:it}):null,ct=sue(st,"id"),[Ze,zt]=k.useState(null),Ht=je?Te:b0(Te,Ie),Tt=_ht(Ht,(o=Ze?.rect)!=null?o:null,ne),nr=k.useRef(null),un=k.useCallback((Ot,Nt)=>{let{sensor:on,options:Fn}=Nt;if($.current==null)return;const dn=T.get($.current);if(!dn)return;const Ct=Ot.nativeEvent,xn=new on({active:$.current,activeNode:dn,event:Ct,options:Fn,context:re,onAbort(Er){if(!T.get(Er))return;const{onDragAbort:ue}=q.current,pe={id:Er};ue?.(pe),C({type:"onDragAbort",event:pe})},onPending(Er,oi,ue,pe){if(!T.get(Er))return;const{onDragPending:Fe}=q.current,Ve={id:Er,constraint:oi,initialCoordinates:ue,offset:pe};Fe?.(Ve),C({type:"onDragPending",event:Ve})},onStart(Er){const oi=$.current;if(oi==null)return;const ue=T.get(oi);if(!ue)return;const{onDragStart:pe}=q.current,xe={activatorEvent:Ct,active:{id:oi,data:ue.data,rect:R}};Bd.unstable_batchedUpdates(()=>{pe?.(xe),A(Rd.Initializing),S({type:Ui.DragStart,initialCoordinates:Er,active:oi}),C({type:"onDragStart",event:xe}),F(nr.current),V(Ct)})},onMove(Er){S({type:Ui.DragMove,coordinates:Er})},onEnd:ii(Ui.DragEnd),onCancel:ii(Ui.DragCancel)});nr.current=xn;function ii(Er){return async function(){const{active:ue,collisions:pe,over:xe,scrollAdjustedTranslate:Fe}=re.current;let Ve=null;if(ue&&Fe){const{cancelDrop:vt}=q.current;Ve={activatorEvent:Ct,active:ue,collisions:pe,delta:Fe,over:xe},Er===Ui.DragEnd&&typeof vt=="function"&&await Promise.resolve(vt(Ve))&&(Er=Ui.DragCancel)}$.current=null,Bd.unstable_batchedUpdates(()=>{S({type:Er}),A(Rd.Uninitialized),zt(null),F(null),V(null),nr.current=null;const vt=Er===Ui.DragEnd?"onDragEnd":"onDragCancel";if(Ve){const at=q.current[vt];at?.(Ve),C({type:vt,event:Ve})}})}}},[T]),ft=k.useCallback((Ot,Nt)=>(on,Fn)=>{const dn=on.nativeEvent,Ct=T.get(Fn);if($.current!==null||!Ct||dn.dndKit||dn.defaultPrevented)return;const xn={active:Ct};Ot(on,Nt.options,xn)===!0&&(dn.dndKit={capturedBy:Nt.sensor},$.current=Fn,un(on,Nt))},[T,un]),qt=tpt(u,ft);cpt(u),Mc(()=>{ne&&E===Rd.Initializing&&A(Rd.Initialized)},[ne,E]),k.useEffect(()=>{const{onDragMove:Ot}=q.current,{active:Nt,activatorEvent:on,collisions:Fn,over:dn}=re.current;if(!Nt||!on)return;const Ct={active:Nt,activatorEvent:on,collisions:Fn,delta:{x:Ue.x,y:Ue.y},over:dn};Bd.unstable_batchedUpdates(()=>{Ot?.(Ct),C({type:"onDragMove",event:Ct})})},[Ue.x,Ue.y]),k.useEffect(()=>{const{active:Ot,activatorEvent:Nt,collisions:on,droppableContainers:Fn,scrollAdjustedTranslate:dn}=re.current;if(!Ot||$.current==null||!Nt||!dn)return;const{onDragOver:Ct}=q.current,xn=Fn.get(ct),ii=xn&&xn.rect.current?{id:xn.id,rect:xn.rect.current,data:xn.data,disabled:xn.disabled}:null,Er={active:Ot,activatorEvent:Nt,collisions:on,delta:{x:dn.x,y:dn.y},over:ii};Bd.unstable_batchedUpdates(()=>{zt(ii),Ct?.(Er),C({type:"onDragOver",event:Er})})},[ct]),Mc(()=>{re.current={activatorEvent:W,active:N,activeNode:J,collisionRect:et,collisions:st,droppableRects:Y,draggableNodes:T,draggingNode:fe,draggingNodeRect:ge,droppableContainers:P,over:Ze,scrollableAncestors:Ne,scrollAdjustedTranslate:Ue},R.current={initial:ge,translated:et}},[N,J,st,et,T,fe,ge,Y,P,Ze,Ne,Ue]),Jht({...Q,delta:I,draggingRect:et,pointerCoordinates:it,scrollableAncestors:Ne,scrollableAncestorRects:_e});const Rn=k.useMemo(()=>({active:N,activeNode:J,activeNodeRect:ne,activatorEvent:W,collisions:st,containerNodeRect:Z,dragOverlay:ae,draggableNodes:T,droppableContainers:P,droppableRects:Y,over:Ze,measureDroppableContainers:H,scrollableAncestors:Ne,scrollableAncestorRects:_e,measuringConfiguration:U,measuringScheduled:G,windowRect:He}),[N,J,ne,W,st,Z,ae,T,P,Y,Ze,H,Ne,_e,U,G,He]),Zn=k.useMemo(()=>({activatorEvent:W,activators:qt,active:N,activeNodeRect:ne,ariaDescribedById:{draggable:X},dispatch:S,draggableNodes:T,over:Ze,measureDroppableContainers:H}),[W,qt,N,ne,S,X,T,Ze,H]);return Jt.createElement(rue.Provider,{value:w},Jt.createElement(O8.Provider,{value:Zn},Jt.createElement(yue.Provider,{value:Rn},Jt.createElement(bue.Provider,{value:Tt},c)),Jt.createElement(xpt,{disabled:a?.restoreFocus===!1})),Jt.createElement(Sht,{...a,hiddenTextDescribedById:X}));function Cr(){const Ot=z?.autoScrollEnabled===!1,Nt=typeof l=="object"?l.enabled===!1:l===!1,on=O&&!Ot&&!Nt;return typeof l=="object"?{...l,enabled:on}:{enabled:on}}}),Apt=k.createContext(null),JY="button",kpt="Draggable";function Dpt(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=Rv(kpt),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:p}=k.useContext(O8),{role:g=JY,roleDescription:y="draggable",tabIndex:b=0}=i??{},v=l?.id===t,S=k.useContext(v?bue:Apt),[C,w]=tw(),[E,A]=tw(),O=upt(s,t),_=Cb(n);Mc(()=>(d.set(t,{id:t,key:o,node:C,activatorNode:E,data:_}),()=>{const I=d.get(t);I&&I.key===o&&d.delete(t)}),[d,t]);const T=k.useMemo(()=>({role:g,tabIndex:b,"aria-disabled":r,"aria-pressed":v&&g===JY?!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:O,node:C,over:p,setNodeRef:w,setActivatorNodeRef:A,transform:S}}function _pt(){return k.useContext(yue)}const Opt="Droppable",Tpt={timeout:25};function Mpt(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=Rv(Opt),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=k.useContext(O8),u=k.useRef({disabled:n}),d=k.useRef(!1),p=k.useRef(null),g=k.useRef(null),{disabled:y,updateMeasurementsFor:b,timeout:v}={...Tpt,...i},S=Cb(b??r),C=k.useCallback(()=>{if(!d.current){d.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=_8({callback:C,disabled:y||!s}),E=k.useCallback((T,I)=>{w&&(I&&(w.unobserve(I),d.current=!1),T&&w.observe(T))},[w]),[A,O]=tw(E),_=Cb(t);return k.useEffect(()=>{!w||!A.current||(w.disconnect(),d.current=!1,w.observe(A.current))},[A,w]),k.useEffect(()=>(a({type:Ui.RegisterDroppable,element:{id:r,key:o,disabled:n,node:A,rect:p,data:_}}),()=>a({type:Ui.UnregisterDroppable,key:o,id:r})),[r]),k.useEffect(()=>{n!==u.current.disabled&&(a({type:Ui.SetDroppableDisabled,id:r,key:o,disabled:n}),u.current.disabled=n)},[r,o,n,a]),{active:s,rect:p,isOver:l?.id===r,node:A,over:l,setNodeRef:O}}function bj(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Rpt(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Z5(e){return e!==null&&e>=0}function Ipt(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 jpt(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const vue=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=bj(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}},Q5={scaleX:1,scaleY:1},Ppt=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,...Q5}:null}const l=$pt(o,i,n);return i>n&&i<=s?{x:0,y:-a.height-l,...Q5}:i<n&&i>=s?{x:0,y:a.height+l,...Q5}:{x:0,y:0,...Q5}};function $pt(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 xue="Sortable",Sue=Jt.createContext({activeIndex:-1,containerId:xue,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vue,disabled:{draggable:!1,droppable:!1}});function Lpt(e){let{children:t,id:n,items:r,strategy:i=vue,disabled:o=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=_pt(),d=Rv(xue,n),p=a.rect!==null,g=k.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),y=s!=null,b=s?g.indexOf(s.id):-1,v=c?g.indexOf(c.id):-1,S=k.useRef(g),C=!Ipt(g,S.current),w=v!==-1&&b===-1||C,E=jpt(o);Mc(()=>{C&&y&&u(g)},[C,g,y,u]),k.useEffect(()=>{S.current=g},[g]);const A=k.useMemo(()=>({activeIndex:b,containerId:d,disabled:E,disableTransforms:w,items:g,overIndex:v,useDragOverlay:p,sortedRects:Rpt(g,l),strategy:i}),[b,d,E.draggable,E.droppable,w,g,v,l,p,i]);return Jt.createElement(Sue.Provider,{value:A},t)}const Npt=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return bj(n,r,i).indexOf(t)},Fpt=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},Bpt={duration:200,easing:"ease"},wue="transform",zpt=Ab.Transition.toString({property:wue,duration:0,easing:"linear"}),Hpt={roleDescription:"sortable"};function Upt(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,s]=k.useState(null),a=k.useRef(n);return Mc(()=>{if(!t&&n!==a.current&&r.current){const l=i.current;if(l){const c=Og(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]),k.useEffect(()=>{o&&s(null)},[o]),o}function Vpt(e){let{animateLayoutChanges:t=Fpt,attributes:n,disabled:r,data:i,getNewIndex:o=Npt,id:s,strategy:a,resizeObserverConfig:l,transition:c=Bpt}=e;const{items:u,containerId:d,activeIndex:p,disabled:g,disableTransforms:y,sortedRects:b,overIndex:v,useDragOverlay:S,strategy:C}=k.useContext(Sue),w=Wpt(r,g),E=u.indexOf(s),A=k.useMemo(()=>({sortable:{containerId:d,index:E,items:u},...i}),[d,i,E,u]),O=k.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:_,node:T,isOver:I,setNodeRef:P}=Mpt({id:s,data:A,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...l}}),{active:L,activatorEvent:R,activeNodeRect:N,attributes:$,setNodeRef:z,listeners:F,isDragging:W,over:V,setActivatorNodeRef:q,transform:X}=Dpt({id:s,data:A,attributes:{...Hpt,...n},disabled:w.draggable}),B=lht(P,z),U=!!L,Y=U&&!y&&Z5(p)&&Z5(v),H=!S&&W,G=H&&Y?X:null,se=Y?G??(a??C)({rects:b,activeNodeRect:N,activeIndex:p,overIndex:v,index:E}):null,Q=Z5(p)&&Z5(v)?o({id:s,items:u,activeIndex:p,overIndex:v}):E,ie=L?.id,ne=k.useRef({activeId:ie,items:u,newIndex:Q,containerId:d}),Z=u!==ne.current.items,re=t({active:L,containerId:d,isDragging:W,isSorting:U,id:s,index:E,items:u,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:c,wasDragging:ne.current.activeId!=null}),ee=Upt({disabled:!re,index:E,node:T,rect:_});return k.useEffect(()=>{U&&ne.current.newIndex!==Q&&(ne.current.newIndex=Q),d!==ne.current.containerId&&(ne.current.containerId=d),u!==ne.current.items&&(ne.current.items=u)},[U,Q,d,u]),k.useEffect(()=>{if(ie===ne.current.activeId)return;if(ie!=null&&ne.current.activeId==null){ne.current.activeId=ie;return}const fe=setTimeout(()=>{ne.current.activeId=ie},50);return()=>clearTimeout(fe)},[ie]),{active:L,activeIndex:p,attributes:$,data:A,rect:_,index:E,newIndex:Q,items:u,isOver:I,isSorting:U,isDragging:W,listeners:F,node:T,overIndex:v,over:V,setNodeRef:B,setActivatorNodeRef:q,setDroppableNodeRef:P,setDraggableNodeRef:z,transform:ee??se,transition:ae()};function ae(){if(ee||Z&&ne.current.newIndex===E)return zpt;if(!(H&&!hj(R)||!c)&&(U||re))return Ab.Transition.toString({...c,property:wue})}}function Wpt(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 iw(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 qpt=[zn.Down,zn.Right,zn.Up,zn.Left],Gpt=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:s,scrollableAncestors:a}}=t;if(qpt.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=i.get(d.id);if(p)switch(e.code){case zn.Down:r.top<p.top&&l.push(d);break;case zn.Up:r.top>p.top&&l.push(d);break;case zn.Left:r.left>p.left&&l.push(d);break;case zn.Right:r.left<p.left&&l.push(d);break}});const c=Aht({collisionRect:r,droppableRects:i,droppableContainers:l});let u=sue(c,"id");if(u===s?.id&&c.length>1&&(u=c[1].id),u!=null){const d=o.get(n.id),p=o.get(u),g=p?i.get(p.id):null,y=p?.node.current;if(y&&g&&d&&p){const v=D8(y).some((O,_)=>a[_]!==O),S=Cue(d,p),C=Kpt(d,p),w=v||!S?{x:0,y:0}:{x:C?r.width-g.width:0,y:C?r.height-g.height:0},E={x:g.left,y:g.top};return w.x&&w.y?E:Eb(E,w)}}}};function Cue(e,t){return!iw(e)||!iw(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Kpt(e,t){return!iw(e)||!iw(t)||!Cue(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const Ypt=({bridge:e,index:t})=>{const{attributes:n,listeners:r,setNodeRef:i,transform:o,transition:s,isDragging:a}=Vpt({id:e.id}),[l,c]=k.useState(!1);k.useEffect(()=>{aC(e.id).then(c)},[e.id]);const u={transform:Ab.Transform.toString(o),transition:s,opacity:a?.5:1};return h.jsx(En,{ref:i,style:u,variant:"outlined",sx:{cursor:"grab","&:active":{cursor:"grabbing"},bgcolor:a?"action.selected":"background.paper",width:"fit-content"},children:h.jsxs(Vn,{sx:{display:"flex",alignItems:"center",gap:1.5,py:1,"&:last-child":{pb:1}},children:[h.jsx(le,{...n,...r,sx:{display:"flex",alignItems:"center",color:"text.secondary"},children:h.jsx(gke,{})}),h.jsx(dt,{label:t+1,size:"small",color:"primary",sx:{minWidth:32,fontWeight:"bold"}}),l?h.jsx(le,{component:"img",src:C2(e.id),alt:e.name,sx:{width:40,height:40,borderRadius:"50%",objectFit:"cover",boxShadow:2}}):h.jsx(vl,{sx:{bgcolor:CM(e),width:40,height:40,boxShadow:2},children:(()=>{const d=wM(e);return h.jsx(d,{sx:{fontSize:24}})})()}),h.jsxs(le,{sx:{flex:1},children:[h.jsx(oe,{variant:"subtitle1",fontWeight:500,children:e.name}),h.jsxs(oe,{variant:"caption",color:"text.secondary",children:["Port: ",e.port," • Priority: ",e.priority??100]})]})]})})},Xpt=()=>{const{t:e}=Qt(),t=Rc(),{content:n,isLoading:r}=sg(),i=LAe(),[o,s]=k.useState([]),[a,l]=k.useState(!1);k.useEffect(()=>{if(n){const g=[...n].sort((y,b)=>{const v=y.priority??100,S=b.priority??100;return v-S});s(g),l(!1)}},[n]);const c=wht(FY(yj),FY(mj,{coordinateGetter:Gpt})),u=k.useCallback(g=>{const{active:y,over:b}=g;b&&y.id!==b.id&&(s(v=>{const S=v.findIndex(w=>w.id===y.id),C=v.findIndex(w=>w.id===b.id);return bj(v,S,C)}),l(!0))},[]),d=k.useCallback(async()=>{const g=o.map((y,b)=>({id:y.id,priority:(b+1)*10}));try{await i(g),t.show({message:e("startup.saveSuccess"),severity:"success"}),l(!1)}catch(y){t.show({message:y instanceof Error?y.message:e("startup.saveFailed"),severity:"error"})}},[o,i,t,e]),p=k.useMemo(()=>o.map(g=>g.id),[o]);return r?h.jsxs(oe,{children:[e("common.loading"),"..."]}):h.jsxs($t,{spacing:3,children:[h.jsx(Bb,{items:[{name:e("nav.bridges"),to:kt.bridges},{name:e("startup.title"),to:kt.startup}]}),h.jsxs(le,{display:"flex",alignItems:"center",gap:2,children:[h.jsx(ig,{color:"primary",fontSize:"large"}),h.jsxs(le,{children:[h.jsx(oe,{variant:"h5",fontWeight:600,children:e("startup.title")}),h.jsx(oe,{variant:"body2",color:"text.secondary",children:e("startup.description")})]})]}),a&&h.jsx(Ft,{severity:"info",action:h.jsx(Ye,{color:"inherit",size:"small",startIcon:h.jsx(IS,{}),onClick:d,children:e("startup.saveChanges")}),children:e("startup.unsavedChanges")}),h.jsx(Ept,{sensors:c,collisionDetection:Eht,onDragEnd:u,children:h.jsx(Lpt,{items:p,strategy:Ppt,children:h.jsx($t,{spacing:1,children:o.map((g,y)=>h.jsx(Ypt,{bridge:g,index:y},g.id))})})}),o.length===0&&h.jsx(oe,{color:"text.secondary",textAlign:"center",py:4,children:e("startup.noBridges")}),a&&o.length>0&&h.jsx(le,{display:"flex",justifyContent:"flex-end",children:h.jsx(Ye,{variant:"contained",startIcon:h.jsx(IS,{}),onClick:d,children:e("startup.saveOrder")})})]})},Bk="https://riddix.github.io/home-assistant-matter-hub",kt={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",plugins:"/plugins",settings:"/settings",startup:"/startup",githubRepository:"https://github.com/riddix/home-assistant-matter-hub/",documentation:Bk,faq:{multiFabric:`${Bk}/connect-multiple-fabrics`,bridgeConfig:`${Bk}/bridge-configuration`}},Jpt=[{path:"",element:h.jsx($5e,{}),children:[{path:"",element:h.jsx(jDe,{})},{path:kt.bridges,element:h.jsx(_De,{})},{path:kt.createBridge,element:h.jsx(Eot,{})},{path:kt.areaSetup,element:h.jsx(fSe,{})},{path:kt.bridge(":bridgeId"),element:h.jsx(QAe,{})},{path:kt.editBridge(":bridgeId"),element:h.jsx(Aot,{})},{path:kt.devices,element:h.jsx(ZDe,{})},{path:kt.networkMap,element:h.jsx(tht,{})},{path:kt.health,element:h.jsx(jot,{})},{path:kt.labels,element:h.jsx(Not,{})},{path:kt.lockCredentials,element:h.jsx(Vot,{})},{path:kt.plugins,element:h.jsx(nht,{})},{path:kt.settings,element:h.jsx(aht,{})},{path:kt.startup,element:h.jsx(Xpt,{})},{path:"*",element:h.jsx(Wot,{})}]}],Zpt={items:{isInitialized:!1,isLoading:!1}},Qpt=TT(Zpt,e=>{e.addCase(Io.pending,t=>{t.items.isLoading=!0}).addCase(Io.rejected,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=void 0,t.items.error=n.error}).addCase(Io.fulfilled,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=n.payload,t.items.error=void 0}).addCase(mZ.fulfilled,(t,n)=>{t.items.content?.push(n.payload)}).addCase(yZ.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(bZ.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(gZ.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(vZ,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=n.payload,t.items.error=void 0}).addCase(xZ,(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)}})}),emt={byBridge:{}},tmt=TT(emt,e=>{e.addCase(ku.pending,(t,n)=>{t.byBridge[n.meta.arg]=zk(t.byBridge[n.meta.arg],n)}).addCase(ku.rejected,(t,n)=>{t.byBridge[n.meta.arg]=zk(t.byBridge[n.meta.arg],n)}).addCase(ku.fulfilled,(t,n)=>{t.byBridge[n.meta.arg]=zk(t.byBridge[n.meta.arg],n)})}),nmt={isInitialized:!1,isLoading:!1,content:void 0,error:void 0},zk=TT(nmt,e=>{e.addCase(ku.pending,t=>{t.isLoading=!0}).addCase(ku.rejected,(t,n)=>{t.isInitialized=!0,t.isLoading=!1,t.content=void 0,t.error=n.error}).addCase(ku.fulfilled,(t,n)=>{t.isInitialized=!0,t.isLoading=!1,t.content=n.payload,t.error=void 0})}),rmt=y5e({reducer:{bridges:Qpt,devices:tmt}}),vj=tve({createStyledComponent:me("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${be(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),useThemeProps:e=>ot({props:e,name:"MuiContainer"})});function imt(e){return tt("MuiToolbar",e)}rt("MuiToolbar",["root","gutters","regular","dense"]);const omt=e=>{const{classes:t,disableGutters:n,variant:r}=e;return nt({root:["root",!n&&"gutters",r]},imt,t)},smt=me("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(qe(({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}]}))),Eue=k.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=omt(c);return h.jsx(smt,{as:o,className:Oe(u.root,i),ref:n,ownerState:c,...l})});class amt extends k.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(le,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"60vh",gap:2,p:4,children:[h.jsx(VT,{color:"error",sx:{fontSize:64}}),h.jsx(oe,{variant:"h5",fontWeight:600,children:hi.t("errorBoundary.title")}),h.jsx(oe,{variant:"body2",color:"text.secondary",textAlign:"center",maxWidth:480,children:this.state.error?.message??hi.t("errorBoundary.fallbackMessage")}),h.jsx(Ye,{variant:"contained",onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},children:hi.t("errorBoundary.reload")})]}):this.props.children}}function lmt(e){return tt("MuiFab",e)}const ZY=rt("MuiFab",["root","primary","secondary","extended","circular","focusVisible","disabled","colorInherit","sizeSmall","sizeMedium","sizeLarge","info","error","warning","success"]),cmt=e=>{const{color:t,variant:n,classes:r,size:i}=e,o={root:["root",n,`size${be(i)}`,t==="inherit"?"colorInherit":t]},s=nt(o,lmt,r);return{...r,...s}},umt=me(ea,{name:"MuiFab",slot:"Root",shouldForwardProp:e=>$i(e)||e==="classes",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${be(n.size)}`],n.color==="inherit"&&t.colorInherit,t[be(n.size)],t[n.color]]}})(qe(({theme:e})=>({...e.typography.button,minHeight:36,transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,zIndex:(e.vars||e).zIndex.fab,boxShadow:(e.vars||e).shadows[6],"&:active":{boxShadow:(e.vars||e).shadows[12]},color:e.vars?e.vars.palette.grey[900]:e.palette.getContrastText?.(e.palette.grey[300]),backgroundColor:(e.vars||e).palette.grey[300],"&:hover":{backgroundColor:(e.vars||e).palette.grey.A100,"@media (hover: none)":{backgroundColor:(e.vars||e).palette.grey[300]},textDecoration:"none"},[`&.${ZY.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},variants:[{props:{size:"small"},style:{width:40,height:40}},{props:{size:"medium"},style:{width:48,height:48}},{props:{variant:"extended"},style:{borderRadius:48/2,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48}},{props:{variant:"extended",size:"small"},style:{width:"auto",padding:"0 8px",borderRadius:34/2,minWidth:34,height:34}},{props:{variant:"extended",size:"medium"},style:{width:"auto",padding:"0 16px",borderRadius:40/2,minWidth:40,height:40}},{props:{color:"inherit"},style:{color:"inherit"}}]})),qe(({theme:e})=>({variants:[...Object.entries(e.palette).filter(Nn(["dark","contrastText"])).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].contrastText,backgroundColor:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:(e.vars||e).palette[t].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t].main}}}}))]})),qe(({theme:e})=>({[`&.${ZY.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}))),dmt=k.forwardRef(function(t,n){const r=ot({props:t,name:"MuiFab"}),{children:i,className:o,color:s="default",component:a="button",disabled:l=!1,disableFocusRipple:c=!1,focusVisibleClassName:u,size:d="large",variant:p="circular",...g}=r,y={...r,color:s,component:a,disabled:l,disableFocusRipple:c,size:d,variant:p},b=cmt(y);return h.jsx(umt,{className:Oe(b.root,o),component:a,disabled:l,focusRipple:!c,focusVisibleClassName:Oe(b.focusVisible,u),ownerState:y,ref:n,...g,classes:b,children:i})}),fmt=[{code:"en",flag:"🇬🇧",name:"English"},{code:"de",flag:"🇩🇪",name:"Deutsch"},{code:"fr",flag:"🇫🇷",name:"Français"},{code:"es",flag:"🇪🇸",name:"Español"},{code:"it",flag:"🇮🇹",name:"Italiano"},{code:"zh",flag:"🇨🇳",name:"中文"},{code:"th",flag:"🇹🇭",name:"ไทย"},{code:"sv",flag:"🇸🇪",name:"Svenska"}],hmt="hamh-custom-languages";function pmt(){try{const e=localStorage.getItem(hmt);return e?JSON.parse(e).map(n=>({code:n.code,flag:"🌐",name:n.name})):[]}catch{return[]}}const mmt="https://github.com/RiDDiX/home-assistant-matter-hub/issues/new?labels=translation&title=Translation+improvement";function gmt(){const{t:e,i18n:t}=Qt(),[n,r]=k.useState(!1),i=k.useRef(null),o=k.useMemo(()=>[...fmt,...pmt()],[]),s=t.language?.split("-")[0]??"en",a=k.useCallback(()=>{r(u=>!u)},[]),l=k.useCallback(u=>{t.changeLanguage(u),r(!1)},[t]),c=k.useCallback(()=>{r(!1)},[]);return h.jsx(qJ,{onClickAway:c,children:h.jsxs(le,{children:[h.jsx(dmt,{ref:i,size:"small",color:"primary",onClick:a,"aria-label":"Change language",sx:{position:"fixed",bottom:24,right:24,zIndex:1300},children:h.jsx(wke,{})}),h.jsx(Ub,{open:n,anchorEl:i.current,placement:"top-end",transition:!0,sx:{zIndex:1300},children:({TransitionProps:u})=>h.jsx(AS,{...u,timeout:200,children:h.jsxs(Vr,{elevation:8,sx:{mb:1,py:.5,minWidth:160,borderRadius:2,overflow:"hidden"},children:[o.map(d=>h.jsxs(le,{onClick:()=>l(d.code),sx:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1,cursor:"pointer",bgcolor:s===d.code?"action.selected":"transparent","&:hover":{bgcolor:"action.hover"},transition:"background-color 0.15s"},children:[h.jsx(oe,{sx:{fontSize:"1.4rem",lineHeight:1,userSelect:"none"},children:d.flag}),h.jsx(oe,{variant:"body2",fontWeight:s===d.code?600:400,children:d.name})]},d.code)),h.jsx($r,{}),h.jsxs(le,{sx:{display:"flex",alignItems:"flex-start",gap:.75,px:2,py:1},children:[h.jsx(PT,{sx:{fontSize:14,mt:.25,color:"text.secondary"}}),h.jsxs(oe,{variant:"caption",color:"text.secondary",sx:{lineHeight:1.4},children:[e("languageSwitcher.disclaimer")," ",h.jsx(Fb,{href:mmt,target:"_blank",rel:"noopener",sx:{fontSize:"inherit"},children:e("languageSwitcher.contribute")})]})]})]})})})]})})}const ymt="home-assistant-matter-hub",bmt={name:ymt};function Aue(){const e="2.1.0-alpha.481",[t,n]=k.useState(null);k.useEffect(()=>{fetch("api/health").then(i=>i.ok?i.json():null).then(i=>{i?.version&&n(i.version)}).catch(()=>{})},[]);const r=k.useMemo(()=>!t||e==="0.0.0-dev"?!1:e!==t,[t]);return k.useMemo(()=>({name:bmt.name,version:t??e,frontendVersion:e,backendVersion:t,versionMismatch:r}),[t,r])}const vmt=()=>{const{t:e}=Qt(),t=[{name:e("footer.github"),url:kt.githubRepository},{name:e("footer.documentation"),url:kt.documentation}];return h.jsxs(vj,{sx:{mt:16,mb:4},children:[h.jsx($r,{sx:{mt:4,mb:4}}),h.jsx(lt,{container:!0,spacing:2,justifyContent:"center",children:t.map((n,r)=>h.jsx(lt,{size:{xs:12,sm:"auto"},children:h.jsx(Ye,{fullWidth:!0,size:"small",variant:"outlined",component:Fb,href:n.url,target:"_blank",children:n.name})},r.toString()))})]})};function xmt(e){return tt("MuiAppBar",e)}rt("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Smt=e=>{const{color:t,position:n,classes:r}=e,i={root:["root",`color${be(t)}`,`position${be(n)}`]};return nt(i,xmt,r)},QY=(e,t)=>e?`${e.replace(")","")}, ${t})`:t,wmt=me(Vr,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${be(n.position)}`],t[`color${be(n.color)}`]]}})(qe(({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(Nn(["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?QY(e.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:e.vars?QY(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"})}}]}))),Cmt=k.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=Smt(c);return h.jsx(wmt,{square:!0,component:"header",ownerState:c,elevation:4,className:Oe(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});function Emt(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=yl(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 Amt(e){return typeof e=="function"?e():e}function e4(e,t,n){const r=Amt(n),i=Emt(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const kmt=k.forwardRef(function(t,n){const r=co(),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:d=i,in:p,onEnter:g,onEntered:y,onEntering:b,onExit:v,onExited:S,onExiting:C,style:w,timeout:E=o,TransitionComponent:A=Wa,...O}=t,_=k.useRef(null),T=Lr(Of(l),_,n),I=V=>q=>{V&&(q===void 0?V(_.current):V(_.current,q))},P=I((V,q)=>{e4(u,V,c),AT(V),g&&g(V,q)}),L=I((V,q)=>{const X=df({timeout:E,style:w,easing:d},{mode:"enter"});V.style.webkitTransition=r.transitions.create("-webkit-transform",{...X}),V.style.transition=r.transitions.create("transform",{...X}),V.style.webkitTransform="none",V.style.transform="none",b&&b(V,q)}),R=I(y),N=I(C),$=I(V=>{const q=df({timeout:E,style:w,easing:d},{mode:"exit"});V.style.webkitTransition=r.transitions.create("-webkit-transform",q),V.style.transition=r.transitions.create("transform",q),e4(u,V,c),v&&v(V)}),z=I(V=>{V.style.webkitTransition="",V.style.transition="",S&&S(V)}),F=V=>{s&&s(_.current,V)},W=k.useCallback(()=>{_.current&&e4(u,_.current,c)},[u,c]);return k.useEffect(()=>{if(p||u==="down"||u==="right")return;const V=ST(()=>{_.current&&e4(u,_.current,c)}),q=yl(_.current);return q.addEventListener("resize",V),()=>{V.clear(),q.removeEventListener("resize",V)}},[u,p,c]),k.useEffect(()=>{p||W()},[p,W]),h.jsx(A,{nodeRef:_,onEnter:P,onEntered:R,onEntering:L,onExit:$,onExited:z,onExiting:N,addEndListener:F,appear:a,in:p,timeout:E,...O,children:(V,{ownerState:q,...X})=>k.cloneElement(l,{ref:T,style:{visibility:V==="exited"&&!p?"hidden":void 0,...w,...l.props.style},...X})})});function Dmt(e){return tt("MuiDrawer",e)}rt("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const kue=(e,t)=>{const{ownerState:n}=e;return[t.root,(n.variant==="permanent"||n.variant==="persistent")&&t.docked,n.variant==="temporary"&&t.modal]},_mt=e=>{const{classes:t,anchor:n,variant:r}=e,i={root:["root",`anchor${be(n)}`],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${be(n)}`,r!=="temporary"&&`paperAnchorDocked${be(n)}`]};return nt(i,Dmt,t)},Omt=me(GT,{name:"MuiDrawer",slot:"Root",overridesResolver:kue})(qe(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),Tmt=me("div",{shouldForwardProp:$i,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:kue})({flex:"0 0 auto"}),Mmt=me(Vr,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`paperAnchor${be(n.anchor)}`],n.variant!=="temporary"&&t[`paperAnchorDocked${be(n.anchor)}`]]}})(qe(({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}`}}]}))),Due={left:"right",right:"left",top:"down",bottom:"up"};function Rmt(e){return["left","right"].includes(e)}function Imt({direction:e},t){return e==="rtl"&&Rmt(t)?Due[t]:t}const jmt=k.forwardRef(function(t,n){const r=ot({props:t,name:"MuiDrawer"}),i=co(),o=_f(),s={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:l,children:c,className:u,elevation:d=16,hideBackdrop:p=!1,ModalProps:{BackdropProps:g,...y}={},onClose:b,open:v=!1,PaperProps:S={},SlideProps:C,TransitionComponent:w,transitionDuration:E=s,variant:A="temporary",slots:O={},slotProps:_={},...T}=r,I=k.useRef(!1);k.useEffect(()=>{I.current=!0},[]);const P=Imt({direction:o?"rtl":"ltr"},a),R={...r,anchor:a,elevation:d,open:v,variant:A,...T},N=_mt(R),$={slots:{transition:w,...O},slotProps:{paper:S,transition:C,..._,backdrop:wT(_.backdrop||{...l,...g},{transitionDuration:E})}},[z,F]=ht("root",{ref:n,elementType:Omt,className:Oe(N.root,N.modal,u),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...$,...T,...y},additionalProps:{open:v,onClose:b,hideBackdrop:p,slots:{backdrop:$.slots.backdrop},slotProps:{backdrop:$.slotProps.backdrop}}}),[W,V]=ht("paper",{elementType:Mmt,shouldForwardComponentProp:!0,className:Oe(N.paper,S.className),ownerState:R,externalForwardedProps:$,additionalProps:{elevation:A==="temporary"?d:0,square:!0,...A==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[q,X]=ht("docked",{elementType:Tmt,ref:n,className:Oe(N.root,N.docked,u),ownerState:R,externalForwardedProps:$,additionalProps:T}),[B,U]=ht("transition",{elementType:kmt,ownerState:R,externalForwardedProps:$,additionalProps:{in:v,direction:Due[P],timeout:E,appear:I.current}}),Y=h.jsx(W,{...V,children:c});if(A==="permanent")return h.jsx(q,{...X,children:Y});const H=h.jsx(B,{...U,children:Y});return A==="persistent"?h.jsx(q,{...X,children:H}):h.jsx(z,{...F,children:H})}),Pmt=EJ({themeId:_a}),$mt={error:Rf,warn:Bw,info:WT,debug:oC},Lmt=({open:e,onClose:t})=>{const{t:n}=Qt(),r=co(),i=k.useMemo(()=>({error:r.palette.error.main,warn:r.palette.warning.main,info:r.palette.info.main,debug:r.palette.secondary.main}),[r]),[o,s]=k.useState([]),[a,l]=k.useState(!0),[c,u]=k.useState("error,warn,info".split(",")),[d,p]=k.useState(""),[g,y]=k.useState(!0),b=k.useCallback(async()=>{try{const E=new URLSearchParams({level:c.join(","),limit:"500",...d&&{search:d}}),A=await fetch(`api/logs?${E}`);if(A.ok){const O=await A.json();s(O.entries)}}catch(E){console.error("Failed to fetch logs:",E)}finally{l(!1)}},[c,d]);k.useEffect(()=>{e&&b()},[e,b]),k.useEffect(()=>{if(!g||!e)return;const E=setInterval(b,5e3);return()=>clearInterval(E)},[g,e,b]);const v=E=>{u(Array.isArray(E.target.value)?E.target.value:[E.target.value])},S=E=>{p(E.target.value)},C=async()=>{try{await fetch("api/logs",{method:"DELETE"}),s([])}catch(E){console.error("Failed to clear logs:",E)}},w=E=>{const A=$mt[E]||WT;return h.jsx(A,{sx:{fontSize:16,color:i[E]}})};return h.jsxs(Ss,{open:e,onClose:t,maxWidth:"lg",fullWidth:!0,children:[h.jsxs(Cs,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(oC,{}),n("logs.title"),h.jsx(le,{sx:{flexGrow:1}}),h.jsx(Pt,{title:n("logs.autoRefresh"),children:h.jsx(dt,{label:g?"Auto":"Manual",color:g?"success":"default",size:"small",onClick:()=>y(!g),sx:{cursor:"pointer"}})}),h.jsx(Vt,{onClick:t,children:h.jsx(XQ,{})})]}),h.jsxs(ws,{children:[h.jsx($t,{spacing:2,sx:{mb:2},children:h.jsxs($t,{direction:"row",spacing:2,alignItems:"center",children:[h.jsxs(ms,{size:"small",sx:{minWidth:200},children:[h.jsx(fl,{children:n("logs.logLevel")}),h.jsxs(fs,{value:c,label:n("logs.logLevel"),onChange:v,multiple:!0,renderValue:E=>h.jsx(le,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:(Array.isArray(E)?E:[E]).map(A=>h.jsx(dt,{label:A.toUpperCase(),size:"small",sx:{backgroundColor:i[A],color:"white"}},A))}),children:[h.jsx(Un,{value:"error",children:n("logs.error")}),h.jsx(Un,{value:"warn",children:n("logs.warning")}),h.jsx(Un,{value:"info",children:n("logs.info")}),h.jsx(Un,{value:"debug",children:n("logs.debug")})]})]}),h.jsx(sr,{size:"small",placeholder:n("logs.searchPlaceholder"),value:d,onChange:S,sx:{flexGrow:1}}),h.jsx(Ye,{variant:"outlined",onClick:b,children:n("common.refresh")}),h.jsx(Ye,{variant:"outlined",color:"error",onClick:C,children:n("common.delete")})]})}),h.jsx(le,{sx:{height:400,overflow:"auto",backgroundColor:"background.paper",border:1,borderColor:"divider",borderRadius:1,p:1},children:a?h.jsx(le,{sx:{display:"flex",justifyContent:"center",p:4},children:h.jsxs(oe,{children:[n("common.loading"),"..."]})}):o.length===0?h.jsx(le,{sx:{display:"flex",justifyContent:"center",p:4},children:h.jsx(oe,{color:"text.secondary",children:n("logs.noResults")})}):h.jsx($t,{spacing:1,children:o.map((E,A)=>h.jsxs(le,{sx:{p:1,borderRadius:1,backgroundColor:"action.hover",fontFamily:"monospace",fontSize:"0.875rem",wordBreak:"break-all"},children:[h.jsxs(le,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[w(E.level),h.jsx(oe,{variant:"caption",color:"text.secondary",children:new Date(E.timestamp).toLocaleString()}),h.jsx(dt,{label:E.level.toUpperCase(),size:"small",sx:{backgroundColor:i[E.level],color:r.palette.getContrastText(i[E.level]??r.palette.grey[500]),fontSize:"0.7rem",height:20}})]}),h.jsx(oe,{sx:{ml:3},children:E.message}),E.context&&h.jsx(oe,{sx:{ml:3,color:"text.secondary",fontSize:"0.8rem"},children:JSON.stringify(E.context,null,2)})]},`${E.timestamp}-${E.level}-${A}`))})})]}),h.jsx(ia,{children:h.jsx(Ye,{onClick:t,children:n("common.close")})})]})};function eX(){const{t:e}=Qt(),{isConnected:t}=wZ(),[n,r]=k.useState(null),[i,o]=k.useState(!1);k.useEffect(()=>{const b=async()=>{try{const S=await fetch("api/health");if(S.ok){const C=await S.json();r(C),o(!1)}else o(!0)}catch{o(!0)}};b();const v=setInterval(b,3e4);return()=>clearInterval(v)},[]);const s=b=>{const v=Math.floor(b/3600),S=Math.floor(b%3600/60);return v>0?`${v}h ${S}m`:`${S}m`},a=n?.status==="healthy"&&!i,l=n?.services?.bridges,c=l&&l.total>0&&l.running===l.total,u=l&&l.total===0,d=n?h.jsxs(le,{sx:{p:.5},children:[h.jsxs("div",{children:[h.jsxs("strong",{children:[e("health.version"),":"]})," ",n.version??e("status.unknown")]}),h.jsxs("div",{children:[h.jsxs("strong",{children:[e("health.uptime"),":"]})," ",s(n.uptime??0)]}),n.services?.bridges&&h.jsxs("div",{children:[h.jsxs("strong",{children:[e("nav.bridges"),":"]})," ",n.services.bridges.running??0,"/",n.services.bridges.total??0," ",e("common.running").toLowerCase(),(n.services.bridges.stopped??0)>0&&` (${n.services.bridges.stopped} ${e("common.stopped").toLowerCase()})`]}),n.services?.homeAssistant&&h.jsxs("div",{children:[h.jsxs("strong",{children:[e("health.homeAssistant"),":"]})," ",n.services.homeAssistant.connected?e("health.connected"):e("health.disconnected")]}),h.jsxs("div",{children:[h.jsx("strong",{children:"WebSocket:"})," ",e(t?"health.connected":"health.disconnected")]})]}):e("status.loadingHealth"),p=()=>i||!a?h.jsx(Rf,{fontSize:"small"}):c?h.jsx(qa,{fontSize:"small"}):h.jsx(Vw,{fontSize:"small"}),g=()=>i||!a?"error":!c||!t?"warning":"success",y=()=>e(i?"status.error":a?t?u?"status.noBridges":c?"common.online":"common.starting":"common.offline":"status.unhealthy");return h.jsx(Pt,{title:d,arrow:!0,children:h.jsx(dt,{icon:p(),label:y(),color:g(),size:"small",variant:"filled",sx:{borderRadius:1,fontWeight:600,"& .MuiChip-icon":{color:"inherit"}}})})}const Nmt=e=>k.createElement("svg",{viewBox:"0 0 91 89",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",...e},k.createElement("g",{style:{display:"inline"}},k.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"}),k.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"}))),Fmt=e=>{const t=Aue();return h.jsxs(le,{component:Ac,to:kt.dashboard,sx:{display:"flex",alignItems:"center",justifyContent:e.large?"flex-start":"center",flexGrow:1,textDecoration:"none",color:"inherit"},children:[h.jsx(Nmt,{style:{height:"40px"}}),h.jsx(oe,{variant:"inherit",component:"span",sx:{mr:1,ml:1},children:t.name.split("-").map(be).join("-")}),e.large&&h.jsx(oe,{variant:"caption",component:"span",children:t.version})]})},Bmt=()=>{const e=Pmt("(min-width:600px)"),{mode:t,setMode:n}=_w(),[r,i]=k.useState(!1),[o,s]=k.useState(!1),a=Uu(),l=kf(),c=y=>y?y==="/"?l.pathname==="/":l.pathname.startsWith(y):!1,u=()=>{n(t==="dark"?"light":"dark")},{t:d}=Qt(),p=[{label:d("dashboard.title"),icon:h.jsx(mM,{}),to:kt.dashboard},{label:d("nav.bridges"),icon:h.jsx(Iy,{}),to:kt.bridges},{label:d("nav.devices"),icon:h.jsx(ra,{}),to:kt.devices},{label:d("nav.networkMap"),icon:h.jsx(fM,{}),to:kt.networkMap},{label:d("nav.startupOrder"),icon:h.jsx(ig,{}),to:kt.startup},{label:d("nav.lockCredentials"),icon:h.jsx(Au,{}),to:kt.lockCredentials},{label:d("nav.filterReference"),icon:h.jsx(gM,{}),to:kt.labels},{label:"Plugins",icon:h.jsx(Ry,{}),to:kt.plugins},{label:d("nav.settings"),icon:h.jsx(qb,{}),to:kt.settings},{label:d(t==="dark"?"nav.lightMode":"nav.darkMode"),icon:t==="dark"?h.jsx(Eke,{}):h.jsx(hke,{}),onClick:u},{label:d("nav.systemLogs"),icon:h.jsx(oC,{}),onClick:()=>i(!0)},{label:d("nav.health"),icon:h.jsx(YT,{}),to:kt.health}],g=y=>{s(!1),y.onClick?y.onClick():y.to&&a(y.to)};return h.jsxs(le,{children:[h.jsx(Cmt,{sx:{height:"72px"},children:h.jsx(Eue,{sx:{paddingLeft:"0 !important",paddingRight:"0 !important"},children:h.jsxs(vj,{sx:{padding:2,height:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx(Fmt,{large:e}),e?h.jsxs(le,{sx:{display:"flex",alignItems:"center",gap:1},children:[p.map(y=>y.to?h.jsx(Pt,{title:y.label,children:h.jsx(Vt,{component:Ac,to:y.to,sx:{color:"inherit",bgcolor:c(y.to)?"rgba(255,255,255,0.15)":"transparent",borderRadius:1},children:y.icon})},y.label):h.jsx(Pt,{title:y.label,children:h.jsx(Vt,{onClick:y.onClick,sx:{color:"inherit"},children:y.icon})},y.label)),h.jsx(eX,{})]}):h.jsxs(le,{sx:{display:"flex",alignItems:"center",gap:.5},children:[h.jsx(eX,{}),h.jsx(Vt,{onClick:()=>s(!0),sx:{color:"inherit"},children:h.jsx(Ake,{})})]})]})})}),h.jsx(jmt,{anchor:"right",open:o,onClose:()=>s(!1),children:h.jsx(ys,{sx:{width:250},children:p.map(y=>h.jsxs(OSe,{selected:c(y.to),onClick:()=>g(y),children:[h.jsx(ds,{children:y.icon}),h.jsx(Ro,{primary:y.label})]},y.label))})}),h.jsx(Lmt,{open:r,onClose:()=>i(!1)})]})},zmt=()=>{const{versionMismatch:e,frontendVersion:t,backendVersion:n}=Aue(),{isConnected:r}=wZ();return h.jsxs(le,{children:[h.jsx(Bmt,{}),h.jsx(Eue,{}),e&&h.jsxs(Ft,{severity:"warning",variant:"filled",sx:{borderRadius:0},action:h.jsx(Ye,{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(Ft,{severity:"error",variant:"filled",sx:{borderRadius:0},children:"Connection lost — data may be outdated. Reconnecting…"}),h.jsx(vj,{sx:{p:2},children:h.jsx(amt,{children:h.jsx(MX,{})})}),h.jsx(vmt,{}),h.jsx(gmt,{})]})},Hmt=Aw({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 tS=document.getElementsByTagName("base")[0]?.href?.replace(/\/$/,"");tS?.startsWith("http")&&(tS=new URL(tS).pathname);const Umt=Eme([{path:"/",element:h.jsx(zmt,{}),children:Jpt}],{basename:tS});Hfe.createRoot(document.getElementById("root")).render(h.jsx(k.StrictMode,{children:h.jsx(ohe,{store:rmt,children:h.jsxs(fxe,{theme:Hmt,children:[h.jsx(axe,{}),h.jsx(FJ,{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(P5e,{children:h.jsx(k3e,{children:h.jsx($me,{router:Umt})})})]})})}));
499
+ `},xht={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 Sht(e){let{announcements:t=xht,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=vht}=e;const{announce:o,announcement:s}=ght(),a=Rv("DndLiveRegion"),[l,c]=k.useState(!1);if(k.useEffect(()=>{c(!0)},[]),yht(k.useMemo(()=>({onDragStart(d){let{active:p}=d;o(t.onDragStart({active:p}))},onDragMove(d){let{active:p,over:g}=d;t.onDragMove&&o(t.onDragMove({active:p,over:g}))},onDragOver(d){let{active:p,over:g}=d;o(t.onDragOver({active:p,over:g}))},onDragEnd(d){let{active:p,over:g}=d;o(t.onDragEnd({active:p,over:g}))},onDragCancel(d){let{active:p,over:g}=d;o(t.onDragCancel({active:p,over:g}))}}),[o,t])),!l)return null;const u=Jt.createElement(Jt.Fragment,null,Jt.createElement(pht,{id:r,value:i.draggable}),Jt.createElement(mht,{id:a,announcement:s}));return n?Bd.createPortal(u,n):u}var Ui;(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"})(Ui||(Ui={}));function nw(){}function FY(e,t){return k.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function wht(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return k.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const wl=Object.freeze({x:0,y:0});function iue(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function oue(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Cht(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function BY(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 sue(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function zY(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 Eht=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=zY(t,t.left,t.top),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=iue(zY(l),i);o.push({id:a,data:{droppableContainer:s,value:c}})}}return o.sort(oue)},Aht=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=BY(t),o=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const c=BY(l),u=i.reduce((p,g,y)=>p+iue(c[y],g),0),d=Number((u/4).toFixed(4));o.push({id:a,data:{droppableContainer:s,value:d}})}}return o.sort(oue)};function kht(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,d=u/(l+c-u);return Number(d.toFixed(4))}return 0}const Dht=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=kht(a,t);l>0&&i.push({id:s,data:{droppableContainer:o,value:l}})}}return i.sort(Cht)};function _ht(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function aue(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:wl}function Oht(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 Tht=Oht(1);function Mht(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 Rht(e,t,n){const r=Mht(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,d=o?e.height/o:e.height;return{width:u,height:d,top:c,right:l+u,bottom:c+d,left:l}}const Iht={ignoreTransform:!1};function Og(e,t){t===void 0&&(t=Iht);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:u}=Os(e).getComputedStyle(e);c&&(n=Rht(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 HY(e){return Og(e,{ignoreTransform:!0})}function jht(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Pht(e,t){return t===void 0&&(t=Os(e).getComputedStyle(e)),t.position==="fixed"}function $ht(e,t){t===void 0&&(t=Os(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 D8(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(dj(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Tv(i)||tue(i)||n.includes(i))return n;const o=Os(e).getComputedStyle(i);return i!==e&&$ht(i,o)&&n.push(i),Pht(i,o)?n:r(i.parentNode)}return e?r(e):n}function lue(e){const[t]=D8(e,1);return t??null}function Lk(e){return!k8||!e?null:Dg(e)?e:uj(e)?dj(e)||e===_g(e).scrollingElement?window:Tv(e)?e:null:null}function cue(e){return Dg(e)?e.scrollX:e.scrollLeft}function uue(e){return Dg(e)?e.scrollY:e.scrollTop}function HO(e){return{x:cue(e),y:uue(e)}}var no;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(no||(no={}));function due(e){return!k8||!e?!1:e===document.scrollingElement}function fue(e){const t={x:0,y:0},n=due(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 Lht={x:.2,y:.2};function Nht(e,t,n,r,i){let{top:o,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=Lht);const{isTop:c,isBottom:u,isLeft:d,isRight:p}=fue(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=no.Backward,y.y=r*Math.abs((t.top+b.height-o)/b.height)):!u&&l>=t.bottom-b.height&&(g.y=no.Forward,y.y=r*Math.abs((t.bottom-b.height-l)/b.height)),!p&&a>=t.right-b.width?(g.x=no.Forward,y.x=r*Math.abs((t.right-b.width-a)/b.width)):!d&&s<=t.left+b.width&&(g.x=no.Backward,y.x=r*Math.abs((t.left+b.width-s)/b.width)),{direction:g,speed:y}}function Fht(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 hue(e){return e.reduce((t,n)=>b0(t,HO(n)),wl)}function Bht(e){return e.reduce((t,n)=>t+cue(n),0)}function zht(e){return e.reduce((t,n)=>t+uue(n),0)}function Hht(e,t){if(t===void 0&&(t=Og),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);lue(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Uht=[["x",["left","right"],Bht],["y",["top","bottom"],zht]];class pj{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=D8(n),i=hue(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,s,a]of Uht)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 t2{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 Vht(e){const{EventTarget:t}=Os(e);return e instanceof t?e:_g(e)}function Nk(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 xa;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(xa||(xa={}));function UY(e){e.preventDefault()}function Wht(e){e.stopPropagation()}var zn;(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"})(zn||(zn={}));const pue={start:[zn.Space,zn.Enter],cancel:[zn.Esc],end:[zn.Space,zn.Enter,zn.Tab]},qht=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case zn.Right:return{...n,x:n.x+25};case zn.Left:return{...n,x:n.x-25};case zn.Down:return{...n,y:n.y+25};case zn.Up:return{...n,y:n.y-25}}};class mj{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 t2(_g(n)),this.windowListeners=new t2(Os(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(xa.Resize,this.handleCancel),this.windowListeners.add(xa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(xa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Hht(r),n(wl)}handleKeyDown(t){if(hj(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=pue,coordinateGetter:s=qht,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}:wl;this.referenceCoordinates||(this.referenceCoordinates=u);const d=s(t,{active:n,context:r.current,currentCoordinates:u});if(d){const p=Eb(d,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:E,maxScroll:A,minScroll:O}=fue(b),_=Fht(b),T={x:Math.min(v===zn.Right?_.right-_.width/2:_.right,Math.max(v===zn.Right?_.left:_.left+_.width/2,d.x)),y:Math.min(v===zn.Down?_.bottom-_.height/2:_.bottom,Math.max(v===zn.Down?_.top:_.top+_.height/2,d.y))},I=v===zn.Right&&!C||v===zn.Left&&!w,P=v===zn.Down&&!E||v===zn.Up&&!S;if(I&&T.x!==d.x){const L=b.scrollLeft+p.x,R=v===zn.Right&&L<=A.x||v===zn.Left&&L>=O.x;if(R&&!p.y){b.scrollTo({left:L,behavior:a});return}R?g.x=b.scrollLeft-L:g.x=v===zn.Right?b.scrollLeft-A.x:b.scrollLeft-O.x,g.x&&b.scrollBy({left:-g.x,behavior:a});break}else if(P&&T.y!==d.y){const L=b.scrollTop+p.y,R=v===zn.Down&&L<=A.y||v===zn.Up&&L>=O.y;if(R&&!p.x){b.scrollTo({top:L,behavior:a});return}R?g.y=b.scrollTop-L:g.y=v===zn.Down?b.scrollTop-A.y:b.scrollTop-O.y,g.y&&b.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,b0(Eb(d,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()}}mj.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=pue,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 VY(e){return!!(e&&"distance"in e)}function WY(e){return!!(e&&"delay"in e)}class gj{constructor(t,n,r){var i;r===void 0&&(r=Vht(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=_g(s),this.documentListeners=new t2(this.document),this.listeners=new t2(r),this.windowListeners=new t2(Os(s)),this.initialCoordinates=(i=zO(o))!=null?i:wl,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(xa.Resize,this.handleCancel),this.windowListeners.add(xa.DragStart,UY),this.windowListeners.add(xa.VisibilityChange,this.handleCancel),this.windowListeners.add(xa.ContextMenu,UY),this.documentListeners.add(xa.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(WY(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(VY(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(xa.Click,Wht,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(xa.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=zO(t))!=null?n:wl,c=Eb(i,l);if(!r&&a){if(VY(a)){if(a.tolerance!=null&&Nk(c,a.tolerance))return this.handleCancel();if(Nk(c,a.distance))return this.handleStart()}if(WY(a)&&Nk(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===zn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ght={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class yj extends gj{constructor(t){const{event:n}=t,r=_g(n.target);super(t,Ght,r)}}yj.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 Kht={move:{name:"mousemove"},end:{name:"mouseup"}};var UO;(function(e){e[e.RightClick=2]="RightClick"})(UO||(UO={}));class Yht extends gj{constructor(t){super(t,Kht,_g(t.event.target))}}Yht.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===UO.RightClick?!1:(r?.({event:n}),!0)}}];const Fk={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Xht extends gj{constructor(t){super(t,Fk)}static setup(){return window.addEventListener(Fk.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Fk.move.name,t)};function t(){}}}Xht.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 n2;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(n2||(n2={}));var rw;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(rw||(rw={}));function Jht(e){let{acceleration:t,activator:n=n2.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:s=5,order:a=rw.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:u,delta:d,threshold:p}=e;const g=Qht({delta:d,disabled:!o}),[y,b]=cht(),v=k.useRef({x:0,y:0}),S=k.useRef({x:0,y:0}),C=k.useMemo(()=>{switch(n){case n2.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case n2.DraggableRect:return i}},[n,i,l]),w=k.useRef(null),E=k.useCallback(()=>{const O=w.current;if(!O)return;const _=v.current.x*S.current.x,T=v.current.y*S.current.y;O.scrollBy(_,T)},[]),A=k.useMemo(()=>a===rw.TreeOrder?[...c].reverse():c,[a,c]);k.useEffect(()=>{if(!o||!c.length||!C){b();return}for(const O of A){if(r?.(O)===!1)continue;const _=c.indexOf(O),T=u[_];if(!T)continue;const{direction:I,speed:P}=Nht(O,T,C,t,p);for(const L of["x","y"])g[L][I[L]]||(P[L]=0,I[L]=0);if(P.x>0||P.y>0){b(),w.current=O,y(E,s),v.current=P,S.current=I;return}}v.current={x:0,y:0},S.current={x:0,y:0},b()},[t,E,r,b,o,s,JSON.stringify(C),JSON.stringify(g),y,c,A,u,JSON.stringify(p)])}const Zht={x:{[no.Backward]:!1,[no.Forward]:!1},y:{[no.Backward]:!1,[no.Forward]:!1}};function Qht(e){let{delta:t,disabled:n}=e;const r=BO(t);return Mv(i=>{if(n||!r||!i)return Zht;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[no.Backward]:i.x[no.Backward]||o.x===-1,[no.Forward]:i.x[no.Forward]||o.x===1},y:{[no.Backward]:i.y[no.Backward]||o.y===-1,[no.Forward]:i.y[no.Forward]||o.y===1}}},[n,t,r])}function ept(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Mv(i=>{var o;return t==null?null:(o=r??i)!=null?o:null},[r,t])}function tpt(e,t){return k.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 kb;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(kb||(kb={}));var VO;(function(e){e.Optimized="optimized"})(VO||(VO={}));const qY=new Map;function npt(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,s]=k.useState(null),{frequency:a,measure:l,strategy:c}=i,u=k.useRef(e),d=v(),p=Cb(d),g=k.useCallback(function(S){S===void 0&&(S=[]),!p.current&&s(C=>C===null?S:C.concat(S.filter(w=>!C.includes(w))))},[p]),y=k.useRef(null),b=Mv(S=>{if(d&&!n)return qY;if(!S||S===qY||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 E=w.node.current,A=E?new pj(l(E),E):null;w.rect.current=A,A&&C.set(w.id,A)}return C}return S},[e,o,n,d,l]);return k.useEffect(()=>{u.current=e},[e]),k.useEffect(()=>{d||g()},[n,d]),k.useEffect(()=>{o&&o.length>0&&s(null)},[JSON.stringify(o)]),k.useEffect(()=>{d||typeof a!="number"||y.current!==null||(y.current=setTimeout(()=>{g(),y.current=null},a))},[a,d,g,...r]),{droppableRects:b,measureDroppableContainers:g,measuringScheduled:o!=null};function v(){switch(c){case kb.Always:return!1;case kb.BeforeDragging:return n;default:return!n}}}function mue(e,t){return Mv(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function rpt(e,t){return mue(e,t)}function ipt(e){let{callback:t,disabled:n}=e;const r=fj(t),i=k.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return k.useEffect(()=>()=>i?.disconnect(),[i]),i}function _8(e){let{callback:t,disabled:n}=e;const r=fj(t),i=k.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return k.useEffect(()=>()=>i?.disconnect(),[i]),i}function opt(e){return new pj(Og(e),e)}function GY(e,t,n){t===void 0&&(t=opt);const[r,i]=k.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=ipt({callback(l){if(e)for(const c of l){const{type:u,target:d}=c;if(u==="childList"&&d instanceof HTMLElement&&d.contains(e)){o();break}}}}),a=_8({callback:o});return Mc(()=>{o(),e?(a?.observe(e),s?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),s?.disconnect())},[e]),r}function spt(e){const t=mue(e);return aue(e,t)}const KY=[];function apt(e){const t=k.useRef(e),n=Mv(r=>e?r&&r!==KY&&e&&t.current&&e.parentNode===t.current.parentNode?r:D8(e):KY,[e]);return k.useEffect(()=>{t.current=e},[e]),n}function lpt(e){const[t,n]=k.useState(null),r=k.useRef(e),i=k.useCallback(o=>{const s=Lk(o.target);s&&n(a=>a?(a.set(s,HO(s)),new Map(a)):null)},[]);return k.useEffect(()=>{const o=r.current;if(e!==o){s(o);const a=e.map(l=>{const c=Lk(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,HO(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=Lk(l);c?.removeEventListener("scroll",i)})}},[i,e]),k.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,s)=>b0(o,s),wl):hue(e):wl,[e,t])}function YY(e,t){t===void 0&&(t=[]);const n=k.useRef(null);return k.useEffect(()=>{n.current=null},t),k.useEffect(()=>{const r=e!==wl;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Eb(e,n.current):wl}function cpt(e){k.useEffect(()=>{if(!k8)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 upt(e,t){return k.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=s=>{o(s,t)},n},{}),[e,t])}function gue(e){return k.useMemo(()=>e?jht(e):null,[e])}const XY=[];function dpt(e,t){t===void 0&&(t=Og);const[n]=e,r=gue(n?Os(n):null),[i,o]=k.useState(XY);function s(){o(()=>e.length?e.map(l=>due(l)?r:new pj(t(l),l)):XY)}const a=_8({callback:s});return Mc(()=>{a?.disconnect(),s(),e.forEach(l=>a?.observe(l))},[e]),i}function fpt(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Tv(t)?t:e}function hpt(e){let{measure:t}=e;const[n,r]=k.useState(null),i=k.useCallback(c=>{for(const{target:u}of c)if(Tv(u)){r(d=>{const p=t(u);return d?{...d,width:p.width,height:p.height}:p});break}},[t]),o=_8({callback:i}),s=k.useCallback(c=>{const u=fpt(c);o?.disconnect(),u&&o?.observe(u),r(u?t(u):null)},[t,o]),[a,l]=tw(s);return k.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const ppt=[{sensor:yj,options:{}},{sensor:mj,options:{}}],mpt={current:{}},eS={draggable:{measure:HY},droppable:{measure:HY,strategy:kb.WhileDragging,frequency:VO.Optimized},dragOverlay:{measure:Og}};class r2 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 gpt={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new r2,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:nw},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:eS,measureDroppableContainers:nw,windowRect:null,measuringScheduled:!1},ypt={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:nw,draggableNodes:new Map,over:null,measureDroppableContainers:nw},O8=k.createContext(ypt),yue=k.createContext(gpt);function bpt(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new r2}}}function vpt(e,t){switch(t.type){case Ui.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Ui.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 Ui.DragEnd:case Ui.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Ui.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new r2(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Ui.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 r2(e.droppable.containers);return s.set(n,{...o,disabled:i}),{...e,droppable:{...e.droppable,containers:s}}}case Ui.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new r2(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function xpt(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=k.useContext(O8),o=BO(r),s=BO(n?.id);return k.useEffect(()=>{if(!t&&!r&&o&&s!=null){if(!hj(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 d=fht(u);if(d){d.focus();break}}})}},[r,t,i,s,o]),null}function Spt(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,o)=>o({transform:i,...r}),n):n}function wpt(e){return k.useMemo(()=>({draggable:{...eS.draggable,...e?.draggable},droppable:{...eS.droppable,...e?.droppable},dragOverlay:{...eS.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Cpt(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=k.useRef(!1),{x:s,y:a}=typeof i=="boolean"?{x:i,y:i}:i;Mc(()=>{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),d=aue(u,r);if(s||(d.x=0),a||(d.y=0),o.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const p=lue(c);p&&p.scrollBy({top:d.y,left:d.x})}},[t,s,a,r,n])}const bue=k.createContext({...wl,scaleX:1,scaleY:1});var Rd;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Rd||(Rd={}));const Ept=k.memo(function(t){var n,r,i,o;let{id:s,accessibility:a,autoScroll:l=!0,children:c,sensors:u=ppt,collisionDetection:d=Dht,measuring:p,modifiers:g,...y}=t;const b=k.useReducer(vpt,void 0,bpt),[v,S]=b,[C,w]=bht(),[E,A]=k.useState(Rd.Uninitialized),O=E===Rd.Initialized,{draggable:{active:_,nodes:T,translate:I},droppable:{containers:P}}=v,L=_!=null?T.get(_):null,R=k.useRef({initial:null,translated:null}),N=k.useMemo(()=>{var Ot;return _!=null?{id:_,data:(Ot=L?.data)!=null?Ot:mpt,rect:R}:null},[_,L]),$=k.useRef(null),[z,F]=k.useState(null),[W,V]=k.useState(null),q=Cb(y,Object.values(y)),X=Rv("DndDescribedBy",s),B=k.useMemo(()=>P.getEnabled(),[P]),U=wpt(p),{droppableRects:Y,measureDroppableContainers:H,measuringScheduled:G}=npt(B,{dragging:O,dependencies:[I.x,I.y],config:U.droppable}),J=ept(T,_),se=k.useMemo(()=>W?zO(W):null,[W]),Q=Cr(),ie=rpt(J,U.draggable.measure);Cpt({activeNode:_!=null?T.get(_):null,config:Q.layoutShiftCompensation,initialRect:ie,measure:U.draggable.measure});const ne=GY(J,U.draggable.measure,ie),Z=GY(J?J.parentElement:null),re=k.useRef({activatorEvent:null,active:null,activeNode:J,collisionRect:null,collisions:null,droppableRects:Y,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ee=P.getNodeFor((n=re.current.over)==null?void 0:n.id),ae=hpt({measure:U.dragOverlay.measure}),fe=(r=ae.nodeRef.current)!=null?r:J,ge=O?(i=ae.rect)!=null?i:ne:null,je=!!(ae.nodeRef.current&&ae.rect),ke=spt(je?null:ne),He=gue(fe?Os(fe):null),Ne=apt(O?ee??J:null),_e=dpt(Ne),Te=Spt(g,{transform:{x:I.x-ke.x,y:I.y-ke.y,scaleX:1,scaleY:1},activatorEvent:W,active:N,activeNodeRect:ne,containerNodeRect:Z,draggingNodeRect:ge,over:re.current.over,overlayNodeRect:ae.rect,scrollableAncestors:Ne,scrollableAncestorRects:_e,windowRect:He}),it=se?b0(se,I):null,Xe=lpt(Ne),ze=YY(Xe),Ie=YY(Xe,[ne]),Ue=b0(Te,ze),et=ge?Tht(ge,Te):null,st=N&&et?d({active:N,collisionRect:et,droppableRects:Y,droppableContainers:B,pointerCoordinates:it}):null,ct=sue(st,"id"),[Ze,zt]=k.useState(null),Ht=je?Te:b0(Te,Ie),Tt=_ht(Ht,(o=Ze?.rect)!=null?o:null,ne),nr=k.useRef(null),un=k.useCallback((Ot,Nt)=>{let{sensor:on,options:Fn}=Nt;if($.current==null)return;const dn=T.get($.current);if(!dn)return;const Ct=Ot.nativeEvent,xn=new on({active:$.current,activeNode:dn,event:Ct,options:Fn,context:re,onAbort(Er){if(!T.get(Er))return;const{onDragAbort:ue}=q.current,pe={id:Er};ue?.(pe),C({type:"onDragAbort",event:pe})},onPending(Er,oi,ue,pe){if(!T.get(Er))return;const{onDragPending:Fe}=q.current,Ve={id:Er,constraint:oi,initialCoordinates:ue,offset:pe};Fe?.(Ve),C({type:"onDragPending",event:Ve})},onStart(Er){const oi=$.current;if(oi==null)return;const ue=T.get(oi);if(!ue)return;const{onDragStart:pe}=q.current,xe={activatorEvent:Ct,active:{id:oi,data:ue.data,rect:R}};Bd.unstable_batchedUpdates(()=>{pe?.(xe),A(Rd.Initializing),S({type:Ui.DragStart,initialCoordinates:Er,active:oi}),C({type:"onDragStart",event:xe}),F(nr.current),V(Ct)})},onMove(Er){S({type:Ui.DragMove,coordinates:Er})},onEnd:ii(Ui.DragEnd),onCancel:ii(Ui.DragCancel)});nr.current=xn;function ii(Er){return async function(){const{active:ue,collisions:pe,over:xe,scrollAdjustedTranslate:Fe}=re.current;let Ve=null;if(ue&&Fe){const{cancelDrop:vt}=q.current;Ve={activatorEvent:Ct,active:ue,collisions:pe,delta:Fe,over:xe},Er===Ui.DragEnd&&typeof vt=="function"&&await Promise.resolve(vt(Ve))&&(Er=Ui.DragCancel)}$.current=null,Bd.unstable_batchedUpdates(()=>{S({type:Er}),A(Rd.Uninitialized),zt(null),F(null),V(null),nr.current=null;const vt=Er===Ui.DragEnd?"onDragEnd":"onDragCancel";if(Ve){const at=q.current[vt];at?.(Ve),C({type:vt,event:Ve})}})}}},[T]),ft=k.useCallback((Ot,Nt)=>(on,Fn)=>{const dn=on.nativeEvent,Ct=T.get(Fn);if($.current!==null||!Ct||dn.dndKit||dn.defaultPrevented)return;const xn={active:Ct};Ot(on,Nt.options,xn)===!0&&(dn.dndKit={capturedBy:Nt.sensor},$.current=Fn,un(on,Nt))},[T,un]),qt=tpt(u,ft);cpt(u),Mc(()=>{ne&&E===Rd.Initializing&&A(Rd.Initialized)},[ne,E]),k.useEffect(()=>{const{onDragMove:Ot}=q.current,{active:Nt,activatorEvent:on,collisions:Fn,over:dn}=re.current;if(!Nt||!on)return;const Ct={active:Nt,activatorEvent:on,collisions:Fn,delta:{x:Ue.x,y:Ue.y},over:dn};Bd.unstable_batchedUpdates(()=>{Ot?.(Ct),C({type:"onDragMove",event:Ct})})},[Ue.x,Ue.y]),k.useEffect(()=>{const{active:Ot,activatorEvent:Nt,collisions:on,droppableContainers:Fn,scrollAdjustedTranslate:dn}=re.current;if(!Ot||$.current==null||!Nt||!dn)return;const{onDragOver:Ct}=q.current,xn=Fn.get(ct),ii=xn&&xn.rect.current?{id:xn.id,rect:xn.rect.current,data:xn.data,disabled:xn.disabled}:null,Er={active:Ot,activatorEvent:Nt,collisions:on,delta:{x:dn.x,y:dn.y},over:ii};Bd.unstable_batchedUpdates(()=>{zt(ii),Ct?.(Er),C({type:"onDragOver",event:Er})})},[ct]),Mc(()=>{re.current={activatorEvent:W,active:N,activeNode:J,collisionRect:et,collisions:st,droppableRects:Y,draggableNodes:T,draggingNode:fe,draggingNodeRect:ge,droppableContainers:P,over:Ze,scrollableAncestors:Ne,scrollAdjustedTranslate:Ue},R.current={initial:ge,translated:et}},[N,J,st,et,T,fe,ge,Y,P,Ze,Ne,Ue]),Jht({...Q,delta:I,draggingRect:et,pointerCoordinates:it,scrollableAncestors:Ne,scrollableAncestorRects:_e});const Rn=k.useMemo(()=>({active:N,activeNode:J,activeNodeRect:ne,activatorEvent:W,collisions:st,containerNodeRect:Z,dragOverlay:ae,draggableNodes:T,droppableContainers:P,droppableRects:Y,over:Ze,measureDroppableContainers:H,scrollableAncestors:Ne,scrollableAncestorRects:_e,measuringConfiguration:U,measuringScheduled:G,windowRect:He}),[N,J,ne,W,st,Z,ae,T,P,Y,Ze,H,Ne,_e,U,G,He]),Zn=k.useMemo(()=>({activatorEvent:W,activators:qt,active:N,activeNodeRect:ne,ariaDescribedById:{draggable:X},dispatch:S,draggableNodes:T,over:Ze,measureDroppableContainers:H}),[W,qt,N,ne,S,X,T,Ze,H]);return Jt.createElement(rue.Provider,{value:w},Jt.createElement(O8.Provider,{value:Zn},Jt.createElement(yue.Provider,{value:Rn},Jt.createElement(bue.Provider,{value:Tt},c)),Jt.createElement(xpt,{disabled:a?.restoreFocus===!1})),Jt.createElement(Sht,{...a,hiddenTextDescribedById:X}));function Cr(){const Ot=z?.autoScrollEnabled===!1,Nt=typeof l=="object"?l.enabled===!1:l===!1,on=O&&!Ot&&!Nt;return typeof l=="object"?{...l,enabled:on}:{enabled:on}}}),Apt=k.createContext(null),JY="button",kpt="Draggable";function Dpt(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=Rv(kpt),{activators:s,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:u,draggableNodes:d,over:p}=k.useContext(O8),{role:g=JY,roleDescription:y="draggable",tabIndex:b=0}=i??{},v=l?.id===t,S=k.useContext(v?bue:Apt),[C,w]=tw(),[E,A]=tw(),O=upt(s,t),_=Cb(n);Mc(()=>(d.set(t,{id:t,key:o,node:C,activatorNode:E,data:_}),()=>{const I=d.get(t);I&&I.key===o&&d.delete(t)}),[d,t]);const T=k.useMemo(()=>({role:g,tabIndex:b,"aria-disabled":r,"aria-pressed":v&&g===JY?!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:O,node:C,over:p,setNodeRef:w,setActivatorNodeRef:A,transform:S}}function _pt(){return k.useContext(yue)}const Opt="Droppable",Tpt={timeout:25};function Mpt(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=Rv(Opt),{active:s,dispatch:a,over:l,measureDroppableContainers:c}=k.useContext(O8),u=k.useRef({disabled:n}),d=k.useRef(!1),p=k.useRef(null),g=k.useRef(null),{disabled:y,updateMeasurementsFor:b,timeout:v}={...Tpt,...i},S=Cb(b??r),C=k.useCallback(()=>{if(!d.current){d.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=_8({callback:C,disabled:y||!s}),E=k.useCallback((T,I)=>{w&&(I&&(w.unobserve(I),d.current=!1),T&&w.observe(T))},[w]),[A,O]=tw(E),_=Cb(t);return k.useEffect(()=>{!w||!A.current||(w.disconnect(),d.current=!1,w.observe(A.current))},[A,w]),k.useEffect(()=>(a({type:Ui.RegisterDroppable,element:{id:r,key:o,disabled:n,node:A,rect:p,data:_}}),()=>a({type:Ui.UnregisterDroppable,key:o,id:r})),[r]),k.useEffect(()=>{n!==u.current.disabled&&(a({type:Ui.SetDroppableDisabled,id:r,key:o,disabled:n}),u.current.disabled=n)},[r,o,n,a]),{active:s,rect:p,isOver:l?.id===r,node:A,over:l,setNodeRef:O}}function bj(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Rpt(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Z5(e){return e!==null&&e>=0}function Ipt(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 jpt(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const vue=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=bj(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}},Q5={scaleX:1,scaleY:1},Ppt=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,...Q5}:null}const l=$pt(o,i,n);return i>n&&i<=s?{x:0,y:-a.height-l,...Q5}:i<n&&i>=s?{x:0,y:a.height+l,...Q5}:{x:0,y:0,...Q5}};function $pt(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 xue="Sortable",Sue=Jt.createContext({activeIndex:-1,containerId:xue,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vue,disabled:{draggable:!1,droppable:!1}});function Lpt(e){let{children:t,id:n,items:r,strategy:i=vue,disabled:o=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=_pt(),d=Rv(xue,n),p=a.rect!==null,g=k.useMemo(()=>r.map(O=>typeof O=="object"&&"id"in O?O.id:O),[r]),y=s!=null,b=s?g.indexOf(s.id):-1,v=c?g.indexOf(c.id):-1,S=k.useRef(g),C=!Ipt(g,S.current),w=v!==-1&&b===-1||C,E=jpt(o);Mc(()=>{C&&y&&u(g)},[C,g,y,u]),k.useEffect(()=>{S.current=g},[g]);const A=k.useMemo(()=>({activeIndex:b,containerId:d,disabled:E,disableTransforms:w,items:g,overIndex:v,useDragOverlay:p,sortedRects:Rpt(g,l),strategy:i}),[b,d,E.draggable,E.droppable,w,g,v,l,p,i]);return Jt.createElement(Sue.Provider,{value:A},t)}const Npt=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return bj(n,r,i).indexOf(t)},Fpt=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},Bpt={duration:200,easing:"ease"},wue="transform",zpt=Ab.Transition.toString({property:wue,duration:0,easing:"linear"}),Hpt={roleDescription:"sortable"};function Upt(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,s]=k.useState(null),a=k.useRef(n);return Mc(()=>{if(!t&&n!==a.current&&r.current){const l=i.current;if(l){const c=Og(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]),k.useEffect(()=>{o&&s(null)},[o]),o}function Vpt(e){let{animateLayoutChanges:t=Fpt,attributes:n,disabled:r,data:i,getNewIndex:o=Npt,id:s,strategy:a,resizeObserverConfig:l,transition:c=Bpt}=e;const{items:u,containerId:d,activeIndex:p,disabled:g,disableTransforms:y,sortedRects:b,overIndex:v,useDragOverlay:S,strategy:C}=k.useContext(Sue),w=Wpt(r,g),E=u.indexOf(s),A=k.useMemo(()=>({sortable:{containerId:d,index:E,items:u},...i}),[d,i,E,u]),O=k.useMemo(()=>u.slice(u.indexOf(s)),[u,s]),{rect:_,node:T,isOver:I,setNodeRef:P}=Mpt({id:s,data:A,disabled:w.droppable,resizeObserverConfig:{updateMeasurementsFor:O,...l}}),{active:L,activatorEvent:R,activeNodeRect:N,attributes:$,setNodeRef:z,listeners:F,isDragging:W,over:V,setActivatorNodeRef:q,transform:X}=Dpt({id:s,data:A,attributes:{...Hpt,...n},disabled:w.draggable}),B=lht(P,z),U=!!L,Y=U&&!y&&Z5(p)&&Z5(v),H=!S&&W,G=H&&Y?X:null,se=Y?G??(a??C)({rects:b,activeNodeRect:N,activeIndex:p,overIndex:v,index:E}):null,Q=Z5(p)&&Z5(v)?o({id:s,items:u,activeIndex:p,overIndex:v}):E,ie=L?.id,ne=k.useRef({activeId:ie,items:u,newIndex:Q,containerId:d}),Z=u!==ne.current.items,re=t({active:L,containerId:d,isDragging:W,isSorting:U,id:s,index:E,items:u,newIndex:ne.current.newIndex,previousItems:ne.current.items,previousContainerId:ne.current.containerId,transition:c,wasDragging:ne.current.activeId!=null}),ee=Upt({disabled:!re,index:E,node:T,rect:_});return k.useEffect(()=>{U&&ne.current.newIndex!==Q&&(ne.current.newIndex=Q),d!==ne.current.containerId&&(ne.current.containerId=d),u!==ne.current.items&&(ne.current.items=u)},[U,Q,d,u]),k.useEffect(()=>{if(ie===ne.current.activeId)return;if(ie!=null&&ne.current.activeId==null){ne.current.activeId=ie;return}const fe=setTimeout(()=>{ne.current.activeId=ie},50);return()=>clearTimeout(fe)},[ie]),{active:L,activeIndex:p,attributes:$,data:A,rect:_,index:E,newIndex:Q,items:u,isOver:I,isSorting:U,isDragging:W,listeners:F,node:T,overIndex:v,over:V,setNodeRef:B,setActivatorNodeRef:q,setDroppableNodeRef:P,setDraggableNodeRef:z,transform:ee??se,transition:ae()};function ae(){if(ee||Z&&ne.current.newIndex===E)return zpt;if(!(H&&!hj(R)||!c)&&(U||re))return Ab.Transition.toString({...c,property:wue})}}function Wpt(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 iw(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 qpt=[zn.Down,zn.Right,zn.Up,zn.Left],Gpt=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:s,scrollableAncestors:a}}=t;if(qpt.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const p=i.get(d.id);if(p)switch(e.code){case zn.Down:r.top<p.top&&l.push(d);break;case zn.Up:r.top>p.top&&l.push(d);break;case zn.Left:r.left>p.left&&l.push(d);break;case zn.Right:r.left<p.left&&l.push(d);break}});const c=Aht({collisionRect:r,droppableRects:i,droppableContainers:l});let u=sue(c,"id");if(u===s?.id&&c.length>1&&(u=c[1].id),u!=null){const d=o.get(n.id),p=o.get(u),g=p?i.get(p.id):null,y=p?.node.current;if(y&&g&&d&&p){const v=D8(y).some((O,_)=>a[_]!==O),S=Cue(d,p),C=Kpt(d,p),w=v||!S?{x:0,y:0}:{x:C?r.width-g.width:0,y:C?r.height-g.height:0},E={x:g.left,y:g.top};return w.x&&w.y?E:Eb(E,w)}}}};function Cue(e,t){return!iw(e)||!iw(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Kpt(e,t){return!iw(e)||!iw(t)||!Cue(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const Ypt=({bridge:e,index:t})=>{const{attributes:n,listeners:r,setNodeRef:i,transform:o,transition:s,isDragging:a}=Vpt({id:e.id}),[l,c]=k.useState(!1);k.useEffect(()=>{aC(e.id).then(c)},[e.id]);const u={transform:Ab.Transform.toString(o),transition:s,opacity:a?.5:1};return h.jsx(En,{ref:i,style:u,variant:"outlined",sx:{cursor:"grab","&:active":{cursor:"grabbing"},bgcolor:a?"action.selected":"background.paper",width:"fit-content"},children:h.jsxs(Vn,{sx:{display:"flex",alignItems:"center",gap:1.5,py:1,"&:last-child":{pb:1}},children:[h.jsx(le,{...n,...r,sx:{display:"flex",alignItems:"center",color:"text.secondary"},children:h.jsx(gke,{})}),h.jsx(dt,{label:t+1,size:"small",color:"primary",sx:{minWidth:32,fontWeight:"bold"}}),l?h.jsx(le,{component:"img",src:C2(e.id),alt:e.name,sx:{width:40,height:40,borderRadius:"50%",objectFit:"cover",boxShadow:2}}):h.jsx(vl,{sx:{bgcolor:CM(e),width:40,height:40,boxShadow:2},children:(()=>{const d=wM(e);return h.jsx(d,{sx:{fontSize:24}})})()}),h.jsxs(le,{sx:{flex:1},children:[h.jsx(oe,{variant:"subtitle1",fontWeight:500,children:e.name}),h.jsxs(oe,{variant:"caption",color:"text.secondary",children:["Port: ",e.port," • Priority: ",e.priority??100]})]})]})})},Xpt=()=>{const{t:e}=Qt(),t=Rc(),{content:n,isLoading:r}=sg(),i=LAe(),[o,s]=k.useState([]),[a,l]=k.useState(!1);k.useEffect(()=>{if(n){const g=[...n].sort((y,b)=>{const v=y.priority??100,S=b.priority??100;return v-S});s(g),l(!1)}},[n]);const c=wht(FY(yj),FY(mj,{coordinateGetter:Gpt})),u=k.useCallback(g=>{const{active:y,over:b}=g;b&&y.id!==b.id&&(s(v=>{const S=v.findIndex(w=>w.id===y.id),C=v.findIndex(w=>w.id===b.id);return bj(v,S,C)}),l(!0))},[]),d=k.useCallback(async()=>{const g=o.map((y,b)=>({id:y.id,priority:(b+1)*10}));try{await i(g),t.show({message:e("startup.saveSuccess"),severity:"success"}),l(!1)}catch(y){t.show({message:y instanceof Error?y.message:e("startup.saveFailed"),severity:"error"})}},[o,i,t,e]),p=k.useMemo(()=>o.map(g=>g.id),[o]);return r?h.jsxs(oe,{children:[e("common.loading"),"..."]}):h.jsxs($t,{spacing:3,children:[h.jsx(Bb,{items:[{name:e("nav.bridges"),to:kt.bridges},{name:e("startup.title"),to:kt.startup}]}),h.jsxs(le,{display:"flex",alignItems:"center",gap:2,children:[h.jsx(ig,{color:"primary",fontSize:"large"}),h.jsxs(le,{children:[h.jsx(oe,{variant:"h5",fontWeight:600,children:e("startup.title")}),h.jsx(oe,{variant:"body2",color:"text.secondary",children:e("startup.description")})]})]}),a&&h.jsx(Ft,{severity:"info",action:h.jsx(Ye,{color:"inherit",size:"small",startIcon:h.jsx(IS,{}),onClick:d,children:e("startup.saveChanges")}),children:e("startup.unsavedChanges")}),h.jsx(Ept,{sensors:c,collisionDetection:Eht,onDragEnd:u,children:h.jsx(Lpt,{items:p,strategy:Ppt,children:h.jsx($t,{spacing:1,children:o.map((g,y)=>h.jsx(Ypt,{bridge:g,index:y},g.id))})})}),o.length===0&&h.jsx(oe,{color:"text.secondary",textAlign:"center",py:4,children:e("startup.noBridges")}),a&&o.length>0&&h.jsx(le,{display:"flex",justifyContent:"flex-end",children:h.jsx(Ye,{variant:"contained",startIcon:h.jsx(IS,{}),onClick:d,children:e("startup.saveOrder")})})]})},Bk="https://riddix.github.io/home-assistant-matter-hub",kt={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",plugins:"/plugins",settings:"/settings",startup:"/startup",githubRepository:"https://github.com/riddix/home-assistant-matter-hub/",documentation:Bk,faq:{multiFabric:`${Bk}/connect-multiple-fabrics`,bridgeConfig:`${Bk}/bridge-configuration`}},Jpt=[{path:"",element:h.jsx($5e,{}),children:[{path:"",element:h.jsx(jDe,{})},{path:kt.bridges,element:h.jsx(_De,{})},{path:kt.createBridge,element:h.jsx(Eot,{})},{path:kt.areaSetup,element:h.jsx(fSe,{})},{path:kt.bridge(":bridgeId"),element:h.jsx(QAe,{})},{path:kt.editBridge(":bridgeId"),element:h.jsx(Aot,{})},{path:kt.devices,element:h.jsx(ZDe,{})},{path:kt.networkMap,element:h.jsx(tht,{})},{path:kt.health,element:h.jsx(jot,{})},{path:kt.labels,element:h.jsx(Not,{})},{path:kt.lockCredentials,element:h.jsx(Vot,{})},{path:kt.plugins,element:h.jsx(nht,{})},{path:kt.settings,element:h.jsx(aht,{})},{path:kt.startup,element:h.jsx(Xpt,{})},{path:"*",element:h.jsx(Wot,{})}]}],Zpt={items:{isInitialized:!1,isLoading:!1}},Qpt=TT(Zpt,e=>{e.addCase(Io.pending,t=>{t.items.isLoading=!0}).addCase(Io.rejected,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=void 0,t.items.error=n.error}).addCase(Io.fulfilled,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=n.payload,t.items.error=void 0}).addCase(mZ.fulfilled,(t,n)=>{t.items.content?.push(n.payload)}).addCase(yZ.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(bZ.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(gZ.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(vZ,(t,n)=>{t.items.isInitialized=!0,t.items.isLoading=!1,t.items.content=n.payload,t.items.error=void 0}).addCase(xZ,(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)}})}),emt={byBridge:{}},tmt=TT(emt,e=>{e.addCase(ku.pending,(t,n)=>{t.byBridge[n.meta.arg]=zk(t.byBridge[n.meta.arg],n)}).addCase(ku.rejected,(t,n)=>{t.byBridge[n.meta.arg]=zk(t.byBridge[n.meta.arg],n)}).addCase(ku.fulfilled,(t,n)=>{t.byBridge[n.meta.arg]=zk(t.byBridge[n.meta.arg],n)})}),nmt={isInitialized:!1,isLoading:!1,content:void 0,error:void 0},zk=TT(nmt,e=>{e.addCase(ku.pending,t=>{t.isLoading=!0}).addCase(ku.rejected,(t,n)=>{t.isInitialized=!0,t.isLoading=!1,t.content=void 0,t.error=n.error}).addCase(ku.fulfilled,(t,n)=>{t.isInitialized=!0,t.isLoading=!1,t.content=n.payload,t.error=void 0})}),rmt=y5e({reducer:{bridges:Qpt,devices:tmt}}),vj=tve({createStyledComponent:me("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`maxWidth${be(String(n.maxWidth))}`],n.fixed&&t.fixed,n.disableGutters&&t.disableGutters]}}),useThemeProps:e=>ot({props:e,name:"MuiContainer"})});function imt(e){return tt("MuiToolbar",e)}rt("MuiToolbar",["root","gutters","regular","dense"]);const omt=e=>{const{classes:t,disableGutters:n,variant:r}=e;return nt({root:["root",!n&&"gutters",r]},imt,t)},smt=me("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disableGutters&&t.gutters,t[n.variant]]}})(qe(({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}]}))),Eue=k.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=omt(c);return h.jsx(smt,{as:o,className:Oe(u.root,i),ref:n,ownerState:c,...l})});class amt extends k.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(le,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"60vh",gap:2,p:4,children:[h.jsx(VT,{color:"error",sx:{fontSize:64}}),h.jsx(oe,{variant:"h5",fontWeight:600,children:hi.t("errorBoundary.title")}),h.jsx(oe,{variant:"body2",color:"text.secondary",textAlign:"center",maxWidth:480,children:this.state.error?.message??hi.t("errorBoundary.fallbackMessage")}),h.jsx(Ye,{variant:"contained",onClick:()=>{this.setState({hasError:!1,error:null}),window.location.reload()},children:hi.t("errorBoundary.reload")})]}):this.props.children}}function lmt(e){return tt("MuiFab",e)}const ZY=rt("MuiFab",["root","primary","secondary","extended","circular","focusVisible","disabled","colorInherit","sizeSmall","sizeMedium","sizeLarge","info","error","warning","success"]),cmt=e=>{const{color:t,variant:n,classes:r,size:i}=e,o={root:["root",n,`size${be(i)}`,t==="inherit"?"colorInherit":t]},s=nt(o,lmt,r);return{...r,...s}},umt=me(ea,{name:"MuiFab",slot:"Root",shouldForwardProp:e=>$i(e)||e==="classes",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${be(n.size)}`],n.color==="inherit"&&t.colorInherit,t[be(n.size)],t[n.color]]}})(qe(({theme:e})=>({...e.typography.button,minHeight:36,transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),borderRadius:"50%",padding:0,minWidth:0,width:56,height:56,zIndex:(e.vars||e).zIndex.fab,boxShadow:(e.vars||e).shadows[6],"&:active":{boxShadow:(e.vars||e).shadows[12]},color:e.vars?e.vars.palette.grey[900]:e.palette.getContrastText?.(e.palette.grey[300]),backgroundColor:(e.vars||e).palette.grey[300],"&:hover":{backgroundColor:(e.vars||e).palette.grey.A100,"@media (hover: none)":{backgroundColor:(e.vars||e).palette.grey[300]},textDecoration:"none"},[`&.${ZY.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},variants:[{props:{size:"small"},style:{width:40,height:40}},{props:{size:"medium"},style:{width:48,height:48}},{props:{variant:"extended"},style:{borderRadius:48/2,padding:"0 16px",width:"auto",minHeight:"auto",minWidth:48,height:48}},{props:{variant:"extended",size:"small"},style:{width:"auto",padding:"0 8px",borderRadius:34/2,minWidth:34,height:34}},{props:{variant:"extended",size:"medium"},style:{width:"auto",padding:"0 16px",borderRadius:40/2,minWidth:40,height:40}},{props:{color:"inherit"},style:{color:"inherit"}}]})),qe(({theme:e})=>({variants:[...Object.entries(e.palette).filter(Nn(["dark","contrastText"])).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].contrastText,backgroundColor:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:(e.vars||e).palette[t].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t].main}}}}))]})),qe(({theme:e})=>({[`&.${ZY.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}))),dmt=k.forwardRef(function(t,n){const r=ot({props:t,name:"MuiFab"}),{children:i,className:o,color:s="default",component:a="button",disabled:l=!1,disableFocusRipple:c=!1,focusVisibleClassName:u,size:d="large",variant:p="circular",...g}=r,y={...r,color:s,component:a,disabled:l,disableFocusRipple:c,size:d,variant:p},b=cmt(y);return h.jsx(umt,{className:Oe(b.root,o),component:a,disabled:l,focusRipple:!c,focusVisibleClassName:Oe(b.focusVisible,u),ownerState:y,ref:n,...g,classes:b,children:i})}),fmt=[{code:"en",flag:"🇬🇧",name:"English"},{code:"de",flag:"🇩🇪",name:"Deutsch"},{code:"fr",flag:"🇫🇷",name:"Français"},{code:"es",flag:"🇪🇸",name:"Español"},{code:"it",flag:"🇮🇹",name:"Italiano"},{code:"zh",flag:"🇨🇳",name:"中文"},{code:"th",flag:"🇹🇭",name:"ไทย"},{code:"sv",flag:"🇸🇪",name:"Svenska"}],hmt="hamh-custom-languages";function pmt(){try{const e=localStorage.getItem(hmt);return e?JSON.parse(e).map(n=>({code:n.code,flag:"🌐",name:n.name})):[]}catch{return[]}}const mmt="https://github.com/RiDDiX/home-assistant-matter-hub/issues/new?labels=translation&title=Translation+improvement";function gmt(){const{t:e,i18n:t}=Qt(),[n,r]=k.useState(!1),i=k.useRef(null),o=k.useMemo(()=>[...fmt,...pmt()],[]),s=t.language?.split("-")[0]??"en",a=k.useCallback(()=>{r(u=>!u)},[]),l=k.useCallback(u=>{t.changeLanguage(u),r(!1)},[t]),c=k.useCallback(()=>{r(!1)},[]);return h.jsx(qJ,{onClickAway:c,children:h.jsxs(le,{children:[h.jsx(dmt,{ref:i,size:"small",color:"primary",onClick:a,"aria-label":"Change language",sx:{position:"fixed",bottom:24,right:24,zIndex:1300},children:h.jsx(wke,{})}),h.jsx(Ub,{open:n,anchorEl:i.current,placement:"top-end",transition:!0,sx:{zIndex:1300},children:({TransitionProps:u})=>h.jsx(AS,{...u,timeout:200,children:h.jsxs(Vr,{elevation:8,sx:{mb:1,py:.5,minWidth:160,borderRadius:2,overflow:"hidden"},children:[o.map(d=>h.jsxs(le,{onClick:()=>l(d.code),sx:{display:"flex",alignItems:"center",gap:1.5,px:2,py:1,cursor:"pointer",bgcolor:s===d.code?"action.selected":"transparent","&:hover":{bgcolor:"action.hover"},transition:"background-color 0.15s"},children:[h.jsx(oe,{sx:{fontSize:"1.4rem",lineHeight:1,userSelect:"none"},children:d.flag}),h.jsx(oe,{variant:"body2",fontWeight:s===d.code?600:400,children:d.name})]},d.code)),h.jsx($r,{}),h.jsxs(le,{sx:{display:"flex",alignItems:"flex-start",gap:.75,px:2,py:1},children:[h.jsx(PT,{sx:{fontSize:14,mt:.25,color:"text.secondary"}}),h.jsxs(oe,{variant:"caption",color:"text.secondary",sx:{lineHeight:1.4},children:[e("languageSwitcher.disclaimer")," ",h.jsx(Fb,{href:mmt,target:"_blank",rel:"noopener",sx:{fontSize:"inherit"},children:e("languageSwitcher.contribute")})]})]})]})})})]})})}const ymt="home-assistant-matter-hub",bmt={name:ymt};function Aue(){const e="2.1.0-alpha.482",[t,n]=k.useState(null);k.useEffect(()=>{fetch("api/health").then(i=>i.ok?i.json():null).then(i=>{i?.version&&n(i.version)}).catch(()=>{})},[]);const r=k.useMemo(()=>!t||e==="0.0.0-dev"?!1:e!==t,[t]);return k.useMemo(()=>({name:bmt.name,version:t??e,frontendVersion:e,backendVersion:t,versionMismatch:r}),[t,r])}const vmt=()=>{const{t:e}=Qt(),t=[{name:e("footer.github"),url:kt.githubRepository},{name:e("footer.documentation"),url:kt.documentation}];return h.jsxs(vj,{sx:{mt:16,mb:4},children:[h.jsx($r,{sx:{mt:4,mb:4}}),h.jsx(lt,{container:!0,spacing:2,justifyContent:"center",children:t.map((n,r)=>h.jsx(lt,{size:{xs:12,sm:"auto"},children:h.jsx(Ye,{fullWidth:!0,size:"small",variant:"outlined",component:Fb,href:n.url,target:"_blank",children:n.name})},r.toString()))})]})};function xmt(e){return tt("MuiAppBar",e)}rt("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Smt=e=>{const{color:t,position:n,classes:r}=e,i={root:["root",`color${be(t)}`,`position${be(n)}`]};return nt(i,xmt,r)},QY=(e,t)=>e?`${e.replace(")","")}, ${t})`:t,wmt=me(Vr,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`position${be(n.position)}`],t[`color${be(n.color)}`]]}})(qe(({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(Nn(["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?QY(e.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:e.vars?QY(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"})}}]}))),Cmt=k.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=Smt(c);return h.jsx(wmt,{square:!0,component:"header",ownerState:c,elevation:4,className:Oe(u.root,i,a==="fixed"&&"mui-fixed"),ref:n,...l})});function Emt(e,t,n){const r=t.getBoundingClientRect(),i=n&&n.getBoundingClientRect(),o=yl(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 Amt(e){return typeof e=="function"?e():e}function e4(e,t,n){const r=Amt(n),i=Emt(e,t,r);i&&(t.style.webkitTransform=i,t.style.transform=i)}const kmt=k.forwardRef(function(t,n){const r=co(),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:d=i,in:p,onEnter:g,onEntered:y,onEntering:b,onExit:v,onExited:S,onExiting:C,style:w,timeout:E=o,TransitionComponent:A=Wa,...O}=t,_=k.useRef(null),T=Lr(Of(l),_,n),I=V=>q=>{V&&(q===void 0?V(_.current):V(_.current,q))},P=I((V,q)=>{e4(u,V,c),AT(V),g&&g(V,q)}),L=I((V,q)=>{const X=df({timeout:E,style:w,easing:d},{mode:"enter"});V.style.webkitTransition=r.transitions.create("-webkit-transform",{...X}),V.style.transition=r.transitions.create("transform",{...X}),V.style.webkitTransform="none",V.style.transform="none",b&&b(V,q)}),R=I(y),N=I(C),$=I(V=>{const q=df({timeout:E,style:w,easing:d},{mode:"exit"});V.style.webkitTransition=r.transitions.create("-webkit-transform",q),V.style.transition=r.transitions.create("transform",q),e4(u,V,c),v&&v(V)}),z=I(V=>{V.style.webkitTransition="",V.style.transition="",S&&S(V)}),F=V=>{s&&s(_.current,V)},W=k.useCallback(()=>{_.current&&e4(u,_.current,c)},[u,c]);return k.useEffect(()=>{if(p||u==="down"||u==="right")return;const V=ST(()=>{_.current&&e4(u,_.current,c)}),q=yl(_.current);return q.addEventListener("resize",V),()=>{V.clear(),q.removeEventListener("resize",V)}},[u,p,c]),k.useEffect(()=>{p||W()},[p,W]),h.jsx(A,{nodeRef:_,onEnter:P,onEntered:R,onEntering:L,onExit:$,onExited:z,onExiting:N,addEndListener:F,appear:a,in:p,timeout:E,...O,children:(V,{ownerState:q,...X})=>k.cloneElement(l,{ref:T,style:{visibility:V==="exited"&&!p?"hidden":void 0,...w,...l.props.style},...X})})});function Dmt(e){return tt("MuiDrawer",e)}rt("MuiDrawer",["root","docked","paper","anchorLeft","anchorRight","anchorTop","anchorBottom","paperAnchorLeft","paperAnchorRight","paperAnchorTop","paperAnchorBottom","paperAnchorDockedLeft","paperAnchorDockedRight","paperAnchorDockedTop","paperAnchorDockedBottom","modal"]);const kue=(e,t)=>{const{ownerState:n}=e;return[t.root,(n.variant==="permanent"||n.variant==="persistent")&&t.docked,n.variant==="temporary"&&t.modal]},_mt=e=>{const{classes:t,anchor:n,variant:r}=e,i={root:["root",`anchor${be(n)}`],docked:[(r==="permanent"||r==="persistent")&&"docked"],modal:["modal"],paper:["paper",`paperAnchor${be(n)}`,r!=="temporary"&&`paperAnchorDocked${be(n)}`]};return nt(i,Dmt,t)},Omt=me(GT,{name:"MuiDrawer",slot:"Root",overridesResolver:kue})(qe(({theme:e})=>({zIndex:(e.vars||e).zIndex.drawer}))),Tmt=me("div",{shouldForwardProp:$i,name:"MuiDrawer",slot:"Docked",skipVariantsResolver:!1,overridesResolver:kue})({flex:"0 0 auto"}),Mmt=me(Vr,{name:"MuiDrawer",slot:"Paper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.paper,t[`paperAnchor${be(n.anchor)}`],n.variant!=="temporary"&&t[`paperAnchorDocked${be(n.anchor)}`]]}})(qe(({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}`}}]}))),Due={left:"right",right:"left",top:"down",bottom:"up"};function Rmt(e){return["left","right"].includes(e)}function Imt({direction:e},t){return e==="rtl"&&Rmt(t)?Due[t]:t}const jmt=k.forwardRef(function(t,n){const r=ot({props:t,name:"MuiDrawer"}),i=co(),o=_f(),s={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{anchor:a="left",BackdropProps:l,children:c,className:u,elevation:d=16,hideBackdrop:p=!1,ModalProps:{BackdropProps:g,...y}={},onClose:b,open:v=!1,PaperProps:S={},SlideProps:C,TransitionComponent:w,transitionDuration:E=s,variant:A="temporary",slots:O={},slotProps:_={},...T}=r,I=k.useRef(!1);k.useEffect(()=>{I.current=!0},[]);const P=Imt({direction:o?"rtl":"ltr"},a),R={...r,anchor:a,elevation:d,open:v,variant:A,...T},N=_mt(R),$={slots:{transition:w,...O},slotProps:{paper:S,transition:C,..._,backdrop:wT(_.backdrop||{...l,...g},{transitionDuration:E})}},[z,F]=ht("root",{ref:n,elementType:Omt,className:Oe(N.root,N.modal,u),shouldForwardComponentProp:!0,ownerState:R,externalForwardedProps:{...$,...T,...y},additionalProps:{open:v,onClose:b,hideBackdrop:p,slots:{backdrop:$.slots.backdrop},slotProps:{backdrop:$.slotProps.backdrop}}}),[W,V]=ht("paper",{elementType:Mmt,shouldForwardComponentProp:!0,className:Oe(N.paper,S.className),ownerState:R,externalForwardedProps:$,additionalProps:{elevation:A==="temporary"?d:0,square:!0,...A==="temporary"&&{role:"dialog","aria-modal":"true"}}}),[q,X]=ht("docked",{elementType:Tmt,ref:n,className:Oe(N.root,N.docked,u),ownerState:R,externalForwardedProps:$,additionalProps:T}),[B,U]=ht("transition",{elementType:kmt,ownerState:R,externalForwardedProps:$,additionalProps:{in:v,direction:Due[P],timeout:E,appear:I.current}}),Y=h.jsx(W,{...V,children:c});if(A==="permanent")return h.jsx(q,{...X,children:Y});const H=h.jsx(B,{...U,children:Y});return A==="persistent"?h.jsx(q,{...X,children:H}):h.jsx(z,{...F,children:H})}),Pmt=EJ({themeId:_a}),$mt={error:Rf,warn:Bw,info:WT,debug:oC},Lmt=({open:e,onClose:t})=>{const{t:n}=Qt(),r=co(),i=k.useMemo(()=>({error:r.palette.error.main,warn:r.palette.warning.main,info:r.palette.info.main,debug:r.palette.secondary.main}),[r]),[o,s]=k.useState([]),[a,l]=k.useState(!0),[c,u]=k.useState("error,warn,info".split(",")),[d,p]=k.useState(""),[g,y]=k.useState(!0),b=k.useCallback(async()=>{try{const E=new URLSearchParams({level:c.join(","),limit:"500",...d&&{search:d}}),A=await fetch(`api/logs?${E}`);if(A.ok){const O=await A.json();s(O.entries)}}catch(E){console.error("Failed to fetch logs:",E)}finally{l(!1)}},[c,d]);k.useEffect(()=>{e&&b()},[e,b]),k.useEffect(()=>{if(!g||!e)return;const E=setInterval(b,5e3);return()=>clearInterval(E)},[g,e,b]);const v=E=>{u(Array.isArray(E.target.value)?E.target.value:[E.target.value])},S=E=>{p(E.target.value)},C=async()=>{try{await fetch("api/logs",{method:"DELETE"}),s([])}catch(E){console.error("Failed to clear logs:",E)}},w=E=>{const A=$mt[E]||WT;return h.jsx(A,{sx:{fontSize:16,color:i[E]}})};return h.jsxs(Ss,{open:e,onClose:t,maxWidth:"lg",fullWidth:!0,children:[h.jsxs(Cs,{sx:{display:"flex",alignItems:"center",gap:1},children:[h.jsx(oC,{}),n("logs.title"),h.jsx(le,{sx:{flexGrow:1}}),h.jsx(Pt,{title:n("logs.autoRefresh"),children:h.jsx(dt,{label:g?"Auto":"Manual",color:g?"success":"default",size:"small",onClick:()=>y(!g),sx:{cursor:"pointer"}})}),h.jsx(Vt,{onClick:t,children:h.jsx(XQ,{})})]}),h.jsxs(ws,{children:[h.jsx($t,{spacing:2,sx:{mb:2},children:h.jsxs($t,{direction:"row",spacing:2,alignItems:"center",children:[h.jsxs(ms,{size:"small",sx:{minWidth:200},children:[h.jsx(fl,{children:n("logs.logLevel")}),h.jsxs(fs,{value:c,label:n("logs.logLevel"),onChange:v,multiple:!0,renderValue:E=>h.jsx(le,{sx:{display:"flex",flexWrap:"wrap",gap:.5},children:(Array.isArray(E)?E:[E]).map(A=>h.jsx(dt,{label:A.toUpperCase(),size:"small",sx:{backgroundColor:i[A],color:"white"}},A))}),children:[h.jsx(Un,{value:"error",children:n("logs.error")}),h.jsx(Un,{value:"warn",children:n("logs.warning")}),h.jsx(Un,{value:"info",children:n("logs.info")}),h.jsx(Un,{value:"debug",children:n("logs.debug")})]})]}),h.jsx(sr,{size:"small",placeholder:n("logs.searchPlaceholder"),value:d,onChange:S,sx:{flexGrow:1}}),h.jsx(Ye,{variant:"outlined",onClick:b,children:n("common.refresh")}),h.jsx(Ye,{variant:"outlined",color:"error",onClick:C,children:n("common.delete")})]})}),h.jsx(le,{sx:{height:400,overflow:"auto",backgroundColor:"background.paper",border:1,borderColor:"divider",borderRadius:1,p:1},children:a?h.jsx(le,{sx:{display:"flex",justifyContent:"center",p:4},children:h.jsxs(oe,{children:[n("common.loading"),"..."]})}):o.length===0?h.jsx(le,{sx:{display:"flex",justifyContent:"center",p:4},children:h.jsx(oe,{color:"text.secondary",children:n("logs.noResults")})}):h.jsx($t,{spacing:1,children:o.map((E,A)=>h.jsxs(le,{sx:{p:1,borderRadius:1,backgroundColor:"action.hover",fontFamily:"monospace",fontSize:"0.875rem",wordBreak:"break-all"},children:[h.jsxs(le,{sx:{display:"flex",alignItems:"center",gap:1,mb:.5},children:[w(E.level),h.jsx(oe,{variant:"caption",color:"text.secondary",children:new Date(E.timestamp).toLocaleString()}),h.jsx(dt,{label:E.level.toUpperCase(),size:"small",sx:{backgroundColor:i[E.level],color:r.palette.getContrastText(i[E.level]??r.palette.grey[500]),fontSize:"0.7rem",height:20}})]}),h.jsx(oe,{sx:{ml:3},children:E.message}),E.context&&h.jsx(oe,{sx:{ml:3,color:"text.secondary",fontSize:"0.8rem"},children:JSON.stringify(E.context,null,2)})]},`${E.timestamp}-${E.level}-${A}`))})})]}),h.jsx(ia,{children:h.jsx(Ye,{onClick:t,children:n("common.close")})})]})};function eX(){const{t:e}=Qt(),{isConnected:t}=wZ(),[n,r]=k.useState(null),[i,o]=k.useState(!1);k.useEffect(()=>{const b=async()=>{try{const S=await fetch("api/health");if(S.ok){const C=await S.json();r(C),o(!1)}else o(!0)}catch{o(!0)}};b();const v=setInterval(b,3e4);return()=>clearInterval(v)},[]);const s=b=>{const v=Math.floor(b/3600),S=Math.floor(b%3600/60);return v>0?`${v}h ${S}m`:`${S}m`},a=n?.status==="healthy"&&!i,l=n?.services?.bridges,c=l&&l.total>0&&l.running===l.total,u=l&&l.total===0,d=n?h.jsxs(le,{sx:{p:.5},children:[h.jsxs("div",{children:[h.jsxs("strong",{children:[e("health.version"),":"]})," ",n.version??e("status.unknown")]}),h.jsxs("div",{children:[h.jsxs("strong",{children:[e("health.uptime"),":"]})," ",s(n.uptime??0)]}),n.services?.bridges&&h.jsxs("div",{children:[h.jsxs("strong",{children:[e("nav.bridges"),":"]})," ",n.services.bridges.running??0,"/",n.services.bridges.total??0," ",e("common.running").toLowerCase(),(n.services.bridges.stopped??0)>0&&` (${n.services.bridges.stopped} ${e("common.stopped").toLowerCase()})`]}),n.services?.homeAssistant&&h.jsxs("div",{children:[h.jsxs("strong",{children:[e("health.homeAssistant"),":"]})," ",n.services.homeAssistant.connected?e("health.connected"):e("health.disconnected")]}),h.jsxs("div",{children:[h.jsx("strong",{children:"WebSocket:"})," ",e(t?"health.connected":"health.disconnected")]})]}):e("status.loadingHealth"),p=()=>i||!a?h.jsx(Rf,{fontSize:"small"}):c?h.jsx(qa,{fontSize:"small"}):h.jsx(Vw,{fontSize:"small"}),g=()=>i||!a?"error":!c||!t?"warning":"success",y=()=>e(i?"status.error":a?t?u?"status.noBridges":c?"common.online":"common.starting":"common.offline":"status.unhealthy");return h.jsx(Pt,{title:d,arrow:!0,children:h.jsx(dt,{icon:p(),label:y(),color:g(),size:"small",variant:"filled",sx:{borderRadius:1,fontWeight:600,"& .MuiChip-icon":{color:"inherit"}}})})}const Nmt=e=>k.createElement("svg",{viewBox:"0 0 91 89",xmlSpace:"preserve",xmlns:"http://www.w3.org/2000/svg",...e},k.createElement("g",{style:{display:"inline"}},k.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"}),k.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"}))),Fmt=e=>{const t=Aue();return h.jsxs(le,{component:Ac,to:kt.dashboard,sx:{display:"flex",alignItems:"center",justifyContent:e.large?"flex-start":"center",flexGrow:1,textDecoration:"none",color:"inherit"},children:[h.jsx(Nmt,{style:{height:"40px"}}),h.jsx(oe,{variant:"inherit",component:"span",sx:{mr:1,ml:1},children:t.name.split("-").map(be).join("-")}),e.large&&h.jsx(oe,{variant:"caption",component:"span",children:t.version})]})},Bmt=()=>{const e=Pmt("(min-width:600px)"),{mode:t,setMode:n}=_w(),[r,i]=k.useState(!1),[o,s]=k.useState(!1),a=Uu(),l=kf(),c=y=>y?y==="/"?l.pathname==="/":l.pathname.startsWith(y):!1,u=()=>{n(t==="dark"?"light":"dark")},{t:d}=Qt(),p=[{label:d("dashboard.title"),icon:h.jsx(mM,{}),to:kt.dashboard},{label:d("nav.bridges"),icon:h.jsx(Iy,{}),to:kt.bridges},{label:d("nav.devices"),icon:h.jsx(ra,{}),to:kt.devices},{label:d("nav.networkMap"),icon:h.jsx(fM,{}),to:kt.networkMap},{label:d("nav.startupOrder"),icon:h.jsx(ig,{}),to:kt.startup},{label:d("nav.lockCredentials"),icon:h.jsx(Au,{}),to:kt.lockCredentials},{label:d("nav.filterReference"),icon:h.jsx(gM,{}),to:kt.labels},{label:"Plugins",icon:h.jsx(Ry,{}),to:kt.plugins},{label:d("nav.settings"),icon:h.jsx(qb,{}),to:kt.settings},{label:d(t==="dark"?"nav.lightMode":"nav.darkMode"),icon:t==="dark"?h.jsx(Eke,{}):h.jsx(hke,{}),onClick:u},{label:d("nav.systemLogs"),icon:h.jsx(oC,{}),onClick:()=>i(!0)},{label:d("nav.health"),icon:h.jsx(YT,{}),to:kt.health}],g=y=>{s(!1),y.onClick?y.onClick():y.to&&a(y.to)};return h.jsxs(le,{children:[h.jsx(Cmt,{sx:{height:"72px"},children:h.jsx(Eue,{sx:{paddingLeft:"0 !important",paddingRight:"0 !important"},children:h.jsxs(vj,{sx:{padding:2,height:"100%",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[h.jsx(Fmt,{large:e}),e?h.jsxs(le,{sx:{display:"flex",alignItems:"center",gap:1},children:[p.map(y=>y.to?h.jsx(Pt,{title:y.label,children:h.jsx(Vt,{component:Ac,to:y.to,sx:{color:"inherit",bgcolor:c(y.to)?"rgba(255,255,255,0.15)":"transparent",borderRadius:1},children:y.icon})},y.label):h.jsx(Pt,{title:y.label,children:h.jsx(Vt,{onClick:y.onClick,sx:{color:"inherit"},children:y.icon})},y.label)),h.jsx(eX,{})]}):h.jsxs(le,{sx:{display:"flex",alignItems:"center",gap:.5},children:[h.jsx(eX,{}),h.jsx(Vt,{onClick:()=>s(!0),sx:{color:"inherit"},children:h.jsx(Ake,{})})]})]})})}),h.jsx(jmt,{anchor:"right",open:o,onClose:()=>s(!1),children:h.jsx(ys,{sx:{width:250},children:p.map(y=>h.jsxs(OSe,{selected:c(y.to),onClick:()=>g(y),children:[h.jsx(ds,{children:y.icon}),h.jsx(Ro,{primary:y.label})]},y.label))})}),h.jsx(Lmt,{open:r,onClose:()=>i(!1)})]})},zmt=()=>{const{versionMismatch:e,frontendVersion:t,backendVersion:n}=Aue(),{isConnected:r}=wZ();return h.jsxs(le,{children:[h.jsx(Bmt,{}),h.jsx(Eue,{}),e&&h.jsxs(Ft,{severity:"warning",variant:"filled",sx:{borderRadius:0},action:h.jsx(Ye,{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(Ft,{severity:"error",variant:"filled",sx:{borderRadius:0},children:"Connection lost — data may be outdated. Reconnecting…"}),h.jsx(vj,{sx:{p:2},children:h.jsx(amt,{children:h.jsx(MX,{})})}),h.jsx(vmt,{}),h.jsx(gmt,{})]})},Hmt=Aw({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 tS=document.getElementsByTagName("base")[0]?.href?.replace(/\/$/,"");tS?.startsWith("http")&&(tS=new URL(tS).pathname);const Umt=Eme([{path:"/",element:h.jsx(zmt,{}),children:Jpt}],{basename:tS});Hfe.createRoot(document.getElementById("root")).render(h.jsx(k.StrictMode,{children:h.jsx(ohe,{store:rmt,children:h.jsxs(fxe,{theme:Hmt,children:[h.jsx(axe,{}),h.jsx(FJ,{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(P5e,{children:h.jsx(k3e,{children:h.jsx($me,{router:Umt})})})]})})}));