@interopio/home-ui-react 2.1.1 → 2.1.3

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.
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@
5
5
  */Ui=Jl,function(){var t={}.hasOwnProperty;function n(){for(var r="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(r=o(r,e(a)))}return r}function e(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var i="";for(var a in r)t.call(r,a)&&r[a]&&(i=o(i,a));return i}function o(r,i){return i?r?r+" "+i:r+i:r}Ui.exports?(n.default=n,Ui.exports=n):window.classNames=n}();var ee=ql(Jl.exports);function ot({className:t,size:n="16",variant:e="workspace",...o}){const r=ee("icon",n&&[`icon-size-${n}`],t);return s.jsx("span",{className:r,"aria-label":`icon-${e}`,role:"presentation",...o,children:s.jsx("i",{className:`icon-${e}`})})}const Ve=g.forwardRef(({className:t,variant:n="default",icon:e="workspace",size:o="16",tooltip:r,iconSize:i="16",onClick:a,disabled:c,children:l,...u},f)=>{const d=ee("io-btn-icon",n!=="default"&&[`io-btn-icon-${n}`],[`io-btn-icon-size-${o}`],t),p=g.useCallback(h=>{if(!c)return a?a(h):void 0;h.preventDefault()},[a,c]);return s.jsx("button",{className:d,type:"button",ref:f,"aria-label":"icon button","aria-disabled":c,title:r,onClick:p,disabled:c,...u,children:l??(e&&s.jsx(ot,{variant:e,size:i}))})});Ve.displayName="ButtonIcon";const Xh={default:void 0,info:"info",success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function Qh({className:t,variant:n="default",size:e="normal",text:o,close:r=!1,closeButtonOnClick:i,append:a,...c}){const l=ee("io-alert",`io-alert-${n}`,e==="large"&&"io-alert-lg",t),u=Xh[n];return s.jsxs("div",{"data-testid":"io-alert",className:l,role:"alert","aria-label":"alert",...c,children:[u&&s.jsx(ot,{"data-testid":"io-alert-icon",variant:u,className:"icon-severity"}),o&&s.jsx("p",{"data-testid":"io-alert-text",className:"io-text-smaller",children:o}),e==="large"&&a,r&&s.jsx(Ve,{"data-testid":"io-alert-close-button",className:"ms-auto",size:"16",iconSize:"10",icon:"close",onClick:i})]})}function em({className:t,variant:n="default",children:e,...o}){const r=ee("io-badge",n!=="default"&&[`io-badge-${n}`],t);return s.jsx("div",{className:r,...o,children:e})}function sn({className:t,tag:n="h2",size:e="normal",text:o="Title",...r}){const i=n,a=ee(e==="small"&&"io-title-semibold",e==="normal"&&"io-title",e==="large"&&"io-title-large",t);return s.jsx(i,{className:a,...r,children:o})}function Ke({className:t,title:n,titleSize:e="normal",tag:o,hint:r,children:i,...a}){const c=ee("io-block",t),l=n?"block-title":void 0;return s.jsxs("section",{className:c,"aria-label":n?void 0:"Block","aria-labelledby":l,...a,children:[n&&s.jsx(sn,{id:l,tag:o,text:n,size:e}),i,r&&s.jsx("p",{className:"io-text-smaller",children:r})]})}const _n=t=>t.key==="Enter"||t.key===" ",Ye=g.forwardRef(({className:t,variant:n="default",size:e="normal",icon:o,iconSize:r="12",iconRight:i=!1,text:a,onClick:c,disabled:l,children:u,...f},d)=>{const p=ee("io-btn",(n==="primary"||n==="critical"||n==="outline"||n==="link")&&[`io-btn-${n}`],e==="large"&&"io-btn-lg",t),h=g.useCallback(v=>{if(!l)return c?c(v):void 0;v.preventDefault()},[c,l]),m=g.useCallback(v=>{l||_n(v)&&(v.preventDefault(),h(v))},[h,l]);return s.jsxs("button",{className:p,ref:d,type:"button","aria-disabled":l,onClick:h,onKeyDown:m,disabled:l,tabIndex:0,...f,children:[o&&!i&&s.jsx(ot,{variant:o,size:r}),u??a,o&&i&&s.jsx(ot,{variant:o,size:r})]})});Ye.displayName="Button";const mi=g.createContext({}),Xl=g.forwardRef(({icon:t="chevron-down",onClick:n,onKeyDown:e,...o},r)=>{const{handleToggle:i,disabled:a,setTriggerRef:c}=g.useContext(mi),l=g.useCallback(d=>{c==null||c(d),r&&(typeof r=="function"?r(d):r.current=d)},[r,c]),u=g.useCallback(d=>{d.stopPropagation(),n==null||n(d),d.defaultPrevented||(i==null||i())},[n,i]),f=g.useCallback(d=>{e==null||e(d),d.defaultPrevented||_n(d)&&(d.preventDefault(),d.stopPropagation(),i==null||i())},[e,i]);return s.jsx(Ye,{icon:t,iconRight:!0,onClick:u,onKeyDown:f,disabled:a,ref:l,...o})});Xl.displayName="DropdownButton";const Ql=g.forwardRef(({size:t="32",onClick:n,onKeyDown:e,...o},r)=>{const{handleToggle:i,disabled:a,setTriggerRef:c}=g.useContext(mi),l=g.useCallback(d=>{c==null||c(d),r&&(typeof r=="function"?r(d):r.current=d)},[r,c]),u=g.useCallback(d=>{d.stopPropagation(),n==null||n(d),d.defaultPrevented||(i==null||i())},[n,i]),f=g.useCallback(d=>{e==null||e(d),d.defaultPrevented||_n(d)&&(d.preventDefault(),d.stopPropagation(),i==null||i())},[e,i]);return s.jsx(Ve,{size:t,onClick:u,onKeyDown:f,disabled:a,ref:l,...o})});function eu({className:t,...n}){const e=ee("io-dropdown-content",t);return s.jsx("div",{className:e,...n})}Ql.displayName="DropdownButtonIcon";const tu=g.createContext({}),gi=g.forwardRef((t,n)=>{const{className:e,prepend:o,append:r,isSelected:i,onClick:a,description:c,disabled:l=!1,children:u,tooltip:f,...d}=t,{variant:p="default",selected:h,checkIcon:m,handleItemClick:v}=g.useContext(tu),y=i??(h==null?void 0:h.some(w=>w.children===u)),k=p!=="default"&&!!m,S=k||o,b=ee("io-list-item",S&&"io-list-item-left",r&&"io-list-item-right",p!=="default"&&y&&"selected",c&&"io-list-item-description",l&&"io-list-item-disabled",e);return s.jsxs("li",{className:b,ref:n,role:"menuitem","aria-roledescription":"menuitem",tabIndex:0,onClick:w=>{l?w.preventDefault():(v==null||v(w,{children:u}),a==null||a(w))},...d,children:[S&&s.jsxs("div",{className:"io-list-left-column",children:[k&&s.jsx(ot,{variant:m.variant,title:y?m.tooltip:void 0,"data-testid":"list-item-check-icon"}),o]}),s.jsx("span",{className:"io-list-text",title:f,"data-testid":"list-item-title",children:u}),r&&s.jsx("div",{className:"io-list-right-column",children:r}),c&&s.jsx("div",{className:"io-list-text-description",children:c})]})});gi.displayName="ListItem";const hs=g.forwardRef(({className:t,prepend:n,append:e,children:o,tooltip:r,...i},a)=>{const c=ee("io-list-item",n&&"io-list-item-left",e&&"io-list-item-right","io-list-item-title",t);return s.jsxs("li",{className:c,ref:a,...i,children:[n&&s.jsx("div",{className:"io-list-left-column",children:n}),s.jsx("span",{className:"io-list-text",title:r,"data-testid":"list-item-title",children:o}),e&&s.jsx("div",{className:"io-list-right-column",children:e})]})});hs.displayName="ListItemTitle";const ms=g.forwardRef(({className:t,prepend:n,append:e,children:o,tooltip:r,...i},a)=>{const c=ee("io-list-item",n&&"io-list-item-left",e&&"io-list-item-right","io-list-item-section",t);return s.jsxs("li",{className:c,ref:a,...i,children:[n&&s.jsx("div",{className:"io-list-left-column",children:n}),s.jsx("span",{className:"io-list-text",title:r,children:o}),e&&s.jsx("div",{className:"io-list-right-column",children:e})]})});ms.displayName="ListItemSection";const nu=g.forwardRef(({className:t,prepend:n,append:e,children:o,tooltip:r,...i},a)=>{const c=ee("io-list-item-header",t);return s.jsxs("div",{className:c,ref:a,...i,children:[n&&s.jsx("div",{className:"io-list-left-column",children:n}),s.jsx("span",{className:"io-list-text",title:r,children:o}),e&&s.jsx("div",{className:"io-list-right-column",children:e})]})});nu.displayName="ListItemHeader";const ou=g.forwardRef(({className:t,children:n,...e},o)=>{const r=ee("io-list-item","io-list-with-sub-items",t);return s.jsx("li",{className:r,ref:o,...e,children:n})});ou.displayName="ListItemWithSubItems";const ru=g.forwardRef((t,n)=>{const{className:e,variant:o="default",checkIcon:r,children:i,...a}=t,[c,l]=g.useState([]),u=ee("io-list",o!=="default"&&"io-list-selectable",e),f=g.useMemo(()=>{if(r)return typeof r=="object"?r:{variant:r}},[r]),d=g.useCallback((h,m)=>{if(o==="default")return;const v=c.some(y=>{var k,S;return((k=y.children)==null?void 0:k.toString())===((S=m.children)==null?void 0:S.toString())});o==="single"?l([m]):(()=>{const y=v?c.filter(k=>k.children!==m.children):[...c,m];l(y)})()},[c,o]),p=g.useMemo(()=>({variant:o,selected:c,checkIcon:f,handleItemClick:d}),[o,c,f,d]);return s.jsx(tu.Provider,{value:p,children:s.jsx("ul",{className:u,ref:n,...a,children:i})})});ru.displayName="List";const ut=ru;ut.Item=gi,ut.ItemTitle=hs,ut.ItemSection=ms,ut.ItemHeader=nu,ut.ItemWithSubItems=ou;const iu=g.forwardRef((t,n)=>s.jsx(ut,{...t,ref:n}));iu.displayName="DropdownList";const au=g.forwardRef((t,n)=>{const{handleClose:e}=g.useContext(mi),{onClick:o,onKeyDown:r,...i}=t,a=g.useRef(null),c=g.useCallback(l=>{a.current=l,typeof n=="function"?n(l):n&&(n.current=l)},[n]);return s.jsx(gi,{...i,ref:c,onClick:l=>{o==null||o(l),e==null||e()},onKeyDown:l=>{if(r==null||r(l),l.defaultPrevented||!_n(l))return;l.preventDefault(),l.stopPropagation();const u=(typeof n=="function"?null:n==null?void 0:n.current)||a.current;u==null||u.click()}})});au.displayName="DropdownItem";const su=g.forwardRef((t,n)=>s.jsx(hs,{...t,ref:n}));su.displayName="DropdownItemTitle";const cu=g.forwardRef((t,n)=>s.jsx(ms,{...t,ref:n}));function wr({className:t,...n}){const e=ee("io-separator",t);return s.jsx("hr",{className:e,...n})}cu.displayName="DropdownItemSection";const lu=g.forwardRef((t,n)=>s.jsx(wr,{...t}));lu.displayName="DropdownSeparator";function Sa(t,n,e){const o=g.useCallback(r=>{n.some(a=>r.key===a)&&(r.preventDefault(),t())},[t,n]);g.useEffect(()=>{const r=(e==null?void 0:e.current)||document;return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[o,e])}const fe=g.forwardRef(({className:t,variant:n="outline",align:e="down",disabled:o,isOpen:r,onOpenChange:i,children:a,...c},l)=>{const u=g.useRef(null),f=g.useRef(null);g.useImperativeHandle(l,()=>f.current,[]);const{isOpen:d,handleOpen:p,handleClose:h}=((y,k)=>{const[S,b]=g.useState(!1),w=y!==void 0,E=w?y:S,O=g.useCallback(U=>{w||b(U),k==null||k(U)},[w,k]),F=g.useCallback(()=>O(!0),[O]),R=g.useCallback(()=>O(!1),[O]);return{isOpen:E,setOpen:O,handleOpen:F,handleClose:R}})(r,i);((y,k,S=!0)=>{g.useEffect(()=>{if(!S)return;const b=E=>{const O=E.target;O&&y.current&&!y.current.contains(O)&&(E.composedPath&&E.composedPath().some(F=>F===y.current||y.current&&F.nodeType===Node.ELEMENT_NODE&&y.current.contains(F))||k())},w=requestAnimationFrame(()=>{document.addEventListener("mousedown",b,!0)});return()=>{cancelAnimationFrame(w),document.removeEventListener("mousedown",b,!0)}},[y,k,S])})(f,h,d),Sa(()=>{d&&h()},["Escape"],f),Sa(()=>{d||o||u.current!==document.activeElement||p()},["ArrowDown","ArrowUp"],f);const m=g.useMemo(()=>({variant:n,align:e,disabled:o,isOpen:d,handleOpen:p,handleClose:h,handleToggle:d?h:p,setTriggerRef:y=>u.current=y}),[n,e,o,d,p,h]),v=ee("io-dropdown",d&&"io-dropdown-open",n!=="default"&&`io-dropdown-${n}`,t);return s.jsx(mi.Provider,{value:m,children:s.jsx("div",{className:v,ref:f,...c,children:a})})});function Re({className:t,variant:n="default",align:e="left",children:o,...r}){const i=ee("io-btn-group",n!=="default"&&`io-btn-group-${n}`,e==="right"&&"io-btn-group-right",t);return s.jsx("div",{className:i,"data-testid":"button-group",...r,children:o})}function Bt({className:t,draggable:n=!1,children:e,...o}){const r=ee("io-header",n&&["draggable"],t);return s.jsx("header",{className:r,...o,children:e})}function Ho({className:t,children:n,...e}){const o=ee("io-dialog-header",t);return s.jsx(Bt,{"data-testid":"io-dialog-header",className:o,...e,children:n})}function tm({className:t,children:n,...e}){const o=ee("io-dialog-body",t);return s.jsx("div",{"data-testid":"io-dialog-body",className:o,...e,children:n})}function Zn({className:t,children:n,...e}){const o=ee("io-footer",t);return s.jsx("footer",{className:o,...e,children:n})}function jr({className:t,...n}){const e=ee("io-dialog-footer",t);return s.jsx(Zn,{"data-testid":"io-dialog-footer",className:e,...n})}function vi(){return typeof window<"u"}function Dn(t){return uu(t)?(t.nodeName||"").toLowerCase():"#document"}function Ht(t){var n;return(t==null||(n=t.ownerDocument)==null?void 0:n.defaultView)||window}function on(t){var n;return(n=(uu(t)?t.ownerDocument:t.document)||window.document)==null?void 0:n.documentElement}function uu(t){return!!vi()&&(t instanceof Node||t instanceof Ht(t).Node)}function Ze(t){return!!vi()&&(t instanceof Element||t instanceof Ht(t).Element)}function dt(t){return!!vi()&&(t instanceof HTMLElement||t instanceof Ht(t).HTMLElement)}function Ea(t){return!(!vi()||typeof ShadowRoot>"u")&&(t instanceof ShadowRoot||t instanceof Ht(t).ShadowRoot)}fe.Button=Xl,fe.ButtonIcon=Ql,fe.Content=eu,fe.List=iu,fe.Item=au,fe.ItemTitle=su,fe.ItemSection=cu,fe.Separator=lu,Re.Button=Ye,Re.ButtonIcon=Ve,Re.Dropdown=fe,Bt.Title=sn,Bt.ButtonGroup=Re,Bt.Button=Ye,Bt.ButtonIcon=Ve,Bt.Dropdown=fe,Ho.Title=sn,Ho.ButtonGroup=Re,Ho.Button=Ye,Ho.ButtonIcon=Ve,Ho.Dropdown=fe,tm.Content=function({className:t,children:n,...e}){const o=ee("io-dialog-content",t);return s.jsx("div",{className:o,...e,children:n})},Zn.ButtonGroup=Re,Zn.Button=Ye,Zn.ButtonIcon=Ve,Zn.Dropdown=fe,jr.ButtonGroup=Re,jr.Button=Ye,jr.ButtonIcon=Ve,jr.Dropdown=fe;const nm=new Set(["inline","contents"]);function cr(t){const{overflow:n,overflowX:e,overflowY:o,display:r}=Gt(t);return/auto|scroll|overlay|hidden|clip/.test(n+o+e)&&!nm.has(r)}const om=new Set(["table","td","th"]);function rm(t){return om.has(Dn(t))}const im=[":popover-open",":modal"];function Jr(t){return im.some(n=>{try{return t.matches(n)}catch{return!1}})}const am=["transform","translate","scale","rotate","perspective"],sm=["transform","translate","scale","rotate","perspective","filter"],cm=["paint","layout","strict","content"];function ja(t){const n=yi(),e=Ze(t)?Gt(t):t;return am.some(o=>!!e[o]&&e[o]!=="none")||!!e.containerType&&e.containerType!=="normal"||!n&&!!e.backdropFilter&&e.backdropFilter!=="none"||!n&&!!e.filter&&e.filter!=="none"||sm.some(o=>(e.willChange||"").includes(o))||cm.some(o=>(e.contain||"").includes(o))}function yi(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const lm=new Set(["html","body","#document"]);function Pn(t){return lm.has(Dn(t))}function Gt(t){return Ht(t).getComputedStyle(t)}function wi(t){return Ze(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function mn(t){if(Dn(t)==="html")return t;const n=t.assignedSlot||t.parentNode||Ea(t)&&t.host||on(t);return Ea(n)?n.host:n}function du(t){const n=mn(t);return Pn(n)?t.ownerDocument?t.ownerDocument.body:t.body:dt(n)&&cr(n)?n:du(n)}function An(t,n,e){var o;n===void 0&&(n=[]),e===void 0&&(e=!0);const r=du(t),i=r===((o=t.ownerDocument)==null?void 0:o.body),a=Ht(r);if(i){const c=Oa(a);return n.concat(a,a.visualViewport||[],cr(r)?r:[],c&&e?An(c):[])}return n.concat(r,An(r,[],e))}function Oa(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function hn(t){let n=t.activeElement;for(;((e=n)==null||(e=e.shadowRoot)==null?void 0:e.activeElement)!=null;){var e;n=n.shadowRoot.activeElement}return n}function vt(t,n){if(!t||!n)return!1;const e=n.getRootNode==null?void 0:n.getRootNode();if(t.contains(n))return!0;if(e&&Ea(e)){let o=n;for(;o;){if(t===o)return!0;o=o.parentNode||o.host}}return!1}function fu(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function pu(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(n=>{let{brand:e,version:o}=n;return e+"/"+o}).join(" "):navigator.userAgent}function hu(t){return!(t.mozInputSource!==0||!t.isTrusted)||(Na()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType)}function mu(t){return!pu().includes("jsdom/")&&(!Na()&&t.width===0&&t.height===0||Na()&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch")}function gu(){return/apple/i.test(navigator.vendor)}function Na(){const t=/android/i;return t.test(fu())||t.test(pu())}function Xo(t,n){const e=["mouse","pen"];return n||e.push("",void 0),e.includes(t)}function kt(t){return(t==null?void 0:t.ownerDocument)||document}function Vi(t,n){if(n==null)return!1;if("composedPath"in t)return t.composedPath().includes(n);const e=t;return e.target!=null&&n.contains(e.target)}function Cn(t){return"composedPath"in t?t.composedPath()[0]:t.target}function vu(t){return dt(t)&&t.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Nt(t){t.preventDefault(),t.stopPropagation()}function Ia(t){return!!t&&t.getAttribute("role")==="combobox"&&vu(t)}const Xr=Math.min,Jn=Math.max,Qr=Math.round,wo=Math.floor,rn=t=>({x:t,y:t}),um={left:"right",right:"left",bottom:"top",top:"bottom"},dm={start:"end",end:"start"};function gc(t,n,e){return Jn(t,Xr(n,e))}function bi(t,n){return typeof t=="function"?t(n):t}function eo(t){return t.split("-")[0]}function xi(t){return t.split("-")[1]}function yu(t){return t==="x"?"y":"x"}function wu(t){return t==="y"?"height":"width"}const fm=new Set(["top","bottom"]);function On(t){return fm.has(eo(t))?"y":"x"}function bu(t){return yu(On(t))}function Pa(t){return t.replace(/start|end/g,n=>dm[n])}const vc=["left","right"],yc=["right","left"],pm=["top","bottom"],hm=["bottom","top"];function mm(t,n,e,o){const r=xi(t);let i=function(a,c,l){switch(a){case"top":case"bottom":return l?c?yc:vc:c?vc:yc;case"left":case"right":return c?pm:hm;default:return[]}}(eo(t),e==="start",o);return r&&(i=i.map(a=>a+"-"+r),n&&(i=i.concat(i.map(Pa)))),i}function Or(t){return t.replace(/left|right|bottom|top/g,n=>um[n])}function ei(t){const{x:n,y:e,width:o,height:r}=t;return{width:o,height:r,top:e,left:n,right:n+o,bottom:e+r,x:n,y:e}}/*!
6
6
  * tabbable 6.2.0
7
7
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
8
- */var ti=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),xu=typeof Element>"u",jo=xu?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$r=!xu&&Element.prototype.getRootNode?function(t){var n;return t==null||(n=t.getRootNode)===null||n===void 0?void 0:n.call(t)}:function(t){return t==null?void 0:t.ownerDocument},ni=function t(n,e){var o;e===void 0&&(e=!0);var r=n==null||(o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"inert");return r===""||r==="true"||e&&n&&t(n.parentNode)},gm=function t(n,e,o){for(var r=[],i=Array.from(n);i.length;){var a=i.shift();if(!ni(a,!1))if(a.tagName==="SLOT"){var c=a.assignedElements(),l=t(c.length?c:a.children,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:a,candidates:l})}else{jo.call(a,ti)&&o.filter(a)&&(e||!n.includes(a))&&r.push(a);var u=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),f=!ni(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(u&&f){var d=t(u===!0?a.children:u.children,!0,o);o.flatten?r.push.apply(r,d):r.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return r},Cu=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ku=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||function(n){var e,o=n==null||(e=n.getAttribute)===null||e===void 0?void 0:e.call(n,"contenteditable");return o===""||o==="true"}(t))&&!Cu(t)?0:t.tabIndex},vm=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Su=function(t){return t.tagName==="INPUT"},ym=function(t){return function(n){return Su(n)&&n.type==="radio"}(t)&&!function(n){if(!n.name)return!0;var e,o=n.form||$r(n),r=function(a){return o.querySelectorAll('input[type="radio"][name="'+a+'"]')};if(typeof window<"u"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")e=r(window.CSS.escape(n.name));else try{e=r(n.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=function(a,c){for(var l=0;l<a.length;l++)if(a[l].checked&&a[l].form===c)return a[l]}(e,n.form);return!i||i===n}(t)},wc=function(t){var n=t.getBoundingClientRect(),e=n.width,o=n.height;return e===0&&o===0},wm=function(t,n){var e=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var r=jo.call(t,"details>summary:first-of-type")?t.parentElement:t;if(jo.call(r,"details:not([open]) *"))return!0;if(e&&e!=="full"&&e!=="legacy-full"){if(e==="non-zero-area")return wc(t)}else{if(typeof o=="function"){for(var i=t;t;){var a=t.parentElement,c=$r(t);if(a&&!a.shadowRoot&&o(a)===!0)return wc(t);t=t.assignedSlot?t.assignedSlot:a||c===t.ownerDocument?a:c.host}t=i}if(function(l){var u,f,d,p,h=l&&$r(l),m=(u=h)===null||u===void 0?void 0:u.host,v=!1;if(h&&h!==l)for(v=!!((f=m)!==null&&f!==void 0&&(d=f.ownerDocument)!==null&&d!==void 0&&d.contains(m)||l!=null&&(p=l.ownerDocument)!==null&&p!==void 0&&p.contains(l));!v&&m;){var y,k,S;v=!((k=m=(y=h=$r(m))===null||y===void 0?void 0:y.host)===null||k===void 0||(S=k.ownerDocument)===null||S===void 0||!S.contains(m))}return v}(t))return!t.getClientRects().length;if(e!=="legacy-full")return!0}return!1},bm=function(t,n){return!(n.disabled||ni(n)||function(e){return Su(e)&&e.type==="hidden"}(n)||wm(n,t)||function(e){return e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"})}(n)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var o=e.parentElement;o;){if(o.tagName==="FIELDSET"&&o.disabled){for(var r=0;r<o.children.length;r++){var i=o.children.item(r);if(i.tagName==="LEGEND")return!!jo.call(o,"fieldset[disabled] *")||!i.contains(e)}return!0}o=o.parentElement}return!1}(n))},Aa=function(t,n){return!(ym(n)||ku(n)<0||!bm(t,n))},xm=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Cm=function t(n){var e=[],o=[];return n.forEach(function(r,i){var a=!!r.scopeParent,c=a?r.scopeParent:r,l=function(f,d){var p=ku(f);return p<0&&d&&!Cu(f)?0:p}(c,a),u=a?t(r.candidates):c;l===0?a?e.push.apply(e,u):e.push(c):o.push({documentOrder:i,tabIndex:l,item:r,isScope:a,content:u})}),o.sort(vm).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(e)},gs=function(t,n){var e;return e=(n=n||{}).getShadowRoot?gm([t],n.includeContainer,{filter:Aa.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:xm}):function(o,r,i){if(ni(o))return[];var a=Array.prototype.slice.apply(o.querySelectorAll(ti));return r&&jo.call(o,ti)&&a.unshift(o),a.filter(i)}(t,n.includeContainer,Aa.bind(null,n)),Cm(e)};function bc(t,n,e){let{reference:o,floating:r}=t;const i=On(n),a=bu(n),c=wu(a),l=eo(n),u=i==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,p=o[c]/2-r[c]/2;let h;switch(l){case"top":h={x:f,y:o.y-r.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-r.width,y:d};break;default:h={x:o.x,y:o.y}}switch(xi(n)){case"start":h[a]-=p*(e&&u?-1:1);break;case"end":h[a]+=p*(e&&u?-1:1)}return h}async function Eu(t,n){var e;n===void 0&&(n={});const{x:o,y:r,platform:i,rects:a,elements:c,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=bi(n,t),m=function(E){return typeof E!="number"?function(O){return{top:0,right:0,bottom:0,left:0,...O}}(E):{top:E,right:E,bottom:E,left:E}}(h),v=c[p?d==="floating"?"reference":"floating":d],y=ei(await i.getClippingRect({element:(e=await(i.isElement==null?void 0:i.isElement(v)))==null||e?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:l})),k=d==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),b=await(i.isElement==null?void 0:i.isElement(S))&&await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1},w=ei(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:k,offsetParent:S,strategy:l}):k);return{top:(y.top-w.top+m.top)/b.y,bottom:(w.bottom-y.bottom+m.bottom)/b.y,left:(y.left-w.left+m.left)/b.x,right:(w.right-y.right+m.right)/b.x}}const km=new Set(["left","top"]);function ju(t){const n=Gt(t);let e=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=dt(t),i=r?t.offsetWidth:e,a=r?t.offsetHeight:o,c=Qr(e)!==i||Qr(o)!==a;return c&&(e=i,o=a),{width:e,height:o,$:c}}function vs(t){return Ze(t)?t:t.contextElement}function xo(t){const n=vs(t);if(!dt(n))return rn(1);const e=n.getBoundingClientRect(),{width:o,height:r,$:i}=ju(n);let a=(i?Qr(e.width):e.width)/o,c=(i?Qr(e.height):e.height)/r;return a&&Number.isFinite(a)||(a=1),c&&Number.isFinite(c)||(c=1),{x:a,y:c}}const Sm=rn(0);function Ou(t){const n=Ht(t);return yi()&&n.visualViewport?{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}:Sm}function to(t,n,e,o){n===void 0&&(n=!1),e===void 0&&(e=!1);const r=t.getBoundingClientRect(),i=vs(t);let a=rn(1);n&&(o?Ze(o)&&(a=xo(o)):a=xo(t));const c=function(p,h,m){return h===void 0&&(h=!1),!(!m||h&&m!==Ht(p))&&h}(i,e,o)?Ou(i):rn(0);let l=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,f=r.width/a.x,d=r.height/a.y;if(i){const p=Ht(i),h=o&&Ze(o)?Ht(o):o;let m=p,v=Oa(m);for(;v&&o&&h!==m;){const y=xo(v),k=v.getBoundingClientRect(),S=Gt(v),b=k.left+(v.clientLeft+parseFloat(S.paddingLeft))*y.x,w=k.top+(v.clientTop+parseFloat(S.paddingTop))*y.y;l*=y.x,u*=y.y,f*=y.x,d*=y.y,l+=b,u+=w,m=Ht(v),v=Oa(m)}}return ei({width:f,height:d,x:l,y:u})}function ys(t,n){const e=wi(t).scrollLeft;return n?n.left+e:to(on(t)).left+e}function Nu(t,n,e){e===void 0&&(e=!1);const o=t.getBoundingClientRect();return{x:o.left+n.scrollLeft-(e?0:ys(t,o)),y:o.top+n.scrollTop}}const Em=new Set(["absolute","fixed"]);function xc(t,n,e){let o;if(n==="viewport")o=function(r,i){const a=Ht(r),c=on(r),l=a.visualViewport;let u=c.clientWidth,f=c.clientHeight,d=0,p=0;if(l){u=l.width,f=l.height;const h=yi();(!h||h&&i==="fixed")&&(d=l.offsetLeft,p=l.offsetTop)}return{width:u,height:f,x:d,y:p}}(t,e);else if(n==="document")o=function(r){const i=on(r),a=wi(r),c=r.ownerDocument.body,l=Jn(i.scrollWidth,i.clientWidth,c.scrollWidth,c.clientWidth),u=Jn(i.scrollHeight,i.clientHeight,c.scrollHeight,c.clientHeight);let f=-a.scrollLeft+ys(r);const d=-a.scrollTop;return Gt(c).direction==="rtl"&&(f+=Jn(i.clientWidth,c.clientWidth)-l),{width:l,height:u,x:f,y:d}}(on(t));else if(Ze(n))o=function(r,i){const a=to(r,!0,i==="fixed"),c=a.top+r.clientTop,l=a.left+r.clientLeft,u=dt(r)?xo(r):rn(1);return{width:r.clientWidth*u.x,height:r.clientHeight*u.y,x:l*u.x,y:c*u.y}}(n,e);else{const r=Ou(t);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return ei(o)}function Iu(t,n){const e=mn(t);return!(e===n||!Ze(e)||Pn(e))&&(Gt(e).position==="fixed"||Iu(e,n))}function jm(t,n,e){const o=dt(n),r=on(n),i=e==="fixed",a=to(t,!0,i,n);let c={scrollLeft:0,scrollTop:0};const l=rn(0);function u(){l.x=ys(r)}if(o||!o&&!i)if((Dn(n)!=="body"||cr(r))&&(c=wi(n)),o){const d=to(n,!0,i,n);l.x=d.x+n.clientLeft,l.y=d.y+n.clientTop}else r&&u();i&&!o&&r&&u();const f=!r||o||i?rn(0):Nu(r,c);return{x:a.left+c.scrollLeft-l.x-f.x,y:a.top+c.scrollTop-l.y-f.y,width:a.width,height:a.height}}function Gi(t){return Gt(t).position==="static"}function Cc(t,n){if(!dt(t)||Gt(t).position==="fixed")return null;if(n)return n(t);let e=t.offsetParent;return on(t)===e&&(e=e.ownerDocument.body),e}function kc(t,n){const e=Ht(t);if(Jr(t))return e;if(!dt(t)){let r=mn(t);for(;r&&!Pn(r);){if(Ze(r)&&!Gi(r))return r;r=mn(r)}return e}let o=Cc(t,n);for(;o&&rm(o)&&Gi(o);)o=Cc(o,n);return o&&Pn(o)&&Gi(o)&&!ja(o)?e:o||function(r){let i=mn(r);for(;dt(i)&&!Pn(i);){if(ja(i))return i;if(Jr(i))return null;i=mn(i)}return null}(t)||e}const Om={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:n,rect:e,offsetParent:o,strategy:r}=t;const i=r==="fixed",a=on(o),c=!!n&&Jr(n.floating);if(o===a||c&&i)return e;let l={scrollLeft:0,scrollTop:0},u=rn(1);const f=rn(0),d=dt(o);if((d||!d&&!i)&&((Dn(o)!=="body"||cr(a))&&(l=wi(o)),dt(o))){const h=to(o);u=xo(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}const p=!a||d||i?rn(0):Nu(a,l,!0);return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-l.scrollLeft*u.x+f.x+p.x,y:e.y*u.y-l.scrollTop*u.y+f.y+p.y}},getDocumentElement:on,getClippingRect:function(t){let{element:n,boundary:e,rootBoundary:o,strategy:r}=t;const i=[...e==="clippingAncestors"?Jr(n)?[]:function(l,u){const f=u.get(l);if(f)return f;let d=An(l,[],!1).filter(v=>Ze(v)&&Dn(v)!=="body"),p=null;const h=Gt(l).position==="fixed";let m=h?mn(l):l;for(;Ze(m)&&!Pn(m);){const v=Gt(m),y=ja(m);y||v.position!=="fixed"||(p=null),(h?!y&&!p:!y&&v.position==="static"&&p&&Em.has(p.position)||cr(m)&&!y&&Iu(l,m))?d=d.filter(k=>k!==m):p=v,m=mn(m)}return u.set(l,d),d}(n,this._c):[].concat(e),o],a=i[0],c=i.reduce((l,u)=>{const f=xc(n,u,r);return l.top=Jn(f.top,l.top),l.right=Xr(f.right,l.right),l.bottom=Xr(f.bottom,l.bottom),l.left=Jn(f.left,l.left),l},xc(n,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:kc,getElementRects:async function(t){const n=this.getOffsetParent||kc,e=this.getDimensions,o=await e(t.floating);return{reference:jm(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:n,height:e}=ju(t);return{width:n,height:e}},getScale:xo,isElement:Ze,isRTL:function(t){return Gt(t).direction==="rtl"}};function Sc(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function Nm(t,n,e,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=vs(t),f=r||i?[...u?An(u):[],...An(n)]:[];f.forEach(y=>{r&&y.addEventListener("scroll",e,{passive:!0}),i&&y.addEventListener("resize",e)});const d=u&&c?function(y,k){let S,b=null;const w=on(y);function E(){var O;clearTimeout(S),(O=b)==null||O.disconnect(),b=null}return function O(F,R){F===void 0&&(F=!1),R===void 0&&(R=1),E();const U=y.getBoundingClientRect(),{left:K,top:_,width:A,height:me}=U;if(F||k(),!A||!me)return;const de={rootMargin:-wo(_)+"px "+-wo(w.clientWidth-(K+A))+"px "+-wo(w.clientHeight-(_+me))+"px "+-wo(K)+"px",threshold:Jn(0,Xr(1,R))||1};let re=!0;function ye(pe){const xe=pe[0].intersectionRatio;if(xe!==R){if(!re)return O();xe?O(!1,xe):S=setTimeout(()=>{O(!1,1e-7)},1e3)}xe!==1||Sc(U,y.getBoundingClientRect())||O(),re=!1}try{b=new IntersectionObserver(ye,{...de,root:w.ownerDocument})}catch{b=new IntersectionObserver(ye,de)}b.observe(y)}(!0),E}(u,e):null;let p,h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[k]=y;k&&k.target===u&&m&&(m.unobserve(n),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(n)})),e()}),u&&!l&&m.observe(u),m.observe(n));let v=l?to(t):null;return l&&function y(){const k=to(t);v&&!Sc(v,k)&&e(),v=k,p=requestAnimationFrame(y)}(),e(),()=>{var y;f.forEach(k=>{r&&k.removeEventListener("scroll",e),i&&k.removeEventListener("resize",e)}),d==null||d(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const Im=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var e,o;const{x:r,y:i,placement:a,middlewareData:c}=n,l=await async function(u,f){const{placement:d,platform:p,elements:h}=u,m=await(p.isRTL==null?void 0:p.isRTL(h.floating)),v=eo(d),y=xi(d),k=On(d)==="y",S=km.has(v)?-1:1,b=m&&k?-1:1,w=bi(f,u);let{mainAxis:E,crossAxis:O,alignmentAxis:F}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:w.mainAxis||0,crossAxis:w.crossAxis||0,alignmentAxis:w.alignmentAxis};return y&&typeof F=="number"&&(O=y==="end"?-1*F:F),k?{x:O*b,y:E*S}:{x:E*S,y:O*b}}(n,t);return a===((e=c.offset)==null?void 0:e.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:a}}}}},Pm=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:e,y:o,placement:r}=n,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:k,y:S}=y;return{x:k,y:S}}},...l}=bi(t,n),u={x:e,y:o},f=await Eu(n,l),d=On(eo(r)),p=yu(d);let h=u[p],m=u[d];if(i){const y=p==="y"?"bottom":"right";h=gc(h+f[p==="y"?"top":"left"],h,h-f[y])}if(a){const y=d==="y"?"bottom":"right";m=gc(m+f[d==="y"?"top":"left"],m,m-f[y])}const v=c.fn({...n,[p]:h,[d]:m});return{...v,data:{x:v.x-e,y:v.y-o,enabled:{[p]:i,[d]:a}}}}}},Am=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var e,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:c,platform:l,elements:u}=n,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...y}=bi(t,n);if((e=i.arrow)!=null&&e.alignmentOffset)return{};const k=eo(r),S=On(c),b=eo(c)===c,w=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=p||(b||!v?[Or(c)]:function(de){const re=Or(de);return[Pa(de),re,Pa(re)]}(c)),O=m!=="none";!p&&O&&E.push(...mm(c,v,m,w));const F=[c,...E],R=await Eu(n,y),U=[];let K=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&U.push(R[k]),d){const de=function(re,ye,pe){pe===void 0&&(pe=!1);const xe=xi(re),ae=bu(re),B=wu(ae);let X=ae==="x"?xe===(pe?"end":"start")?"right":"left":xe==="start"?"bottom":"top";return ye.reference[B]>ye.floating[B]&&(X=Or(X)),[X,Or(X)]}(r,a,w);U.push(R[de[0]],R[de[1]])}if(K=[...K,{placement:r,overflows:U}],!U.every(de=>de<=0)){var _,A;const de=(((_=i.flip)==null?void 0:_.index)||0)+1,re=F[de];if(re&&(!(d==="alignment"&&S!==On(re))||K.every(pe=>On(pe.placement)!==S||pe.overflows[0]>0)))return{data:{index:de,overflows:K},reset:{placement:re}};let ye=(A=K.filter(pe=>pe.overflows[0]<=0).sort((pe,xe)=>pe.overflows[1]-xe.overflows[1])[0])==null?void 0:A.placement;if(!ye)switch(h){case"bestFit":{var me;const pe=(me=K.filter(xe=>{if(O){const ae=On(xe.placement);return ae===S||ae==="y"}return!0}).map(xe=>[xe.placement,xe.overflows.filter(ae=>ae>0).reduce((ae,B)=>ae+B,0)]).sort((xe,ae)=>xe[1]-ae[1])[0])==null?void 0:me[0];pe&&(ye=pe);break}case"initialPlacement":ye=c}if(r!==ye)return{reset:{placement:ye}}}return{}}}},Tm=(t,n,e)=>{const o=new Map,r={platform:Om,...e},i={...r.platform,_c:o};return(async(a,c,l)=>{const{placement:u="bottom",strategy:f="absolute",middleware:d=[],platform:p}=l,h=d.filter(Boolean),m=await(p.isRTL==null?void 0:p.isRTL(c));let v=await p.getElementRects({reference:a,floating:c,strategy:f}),{x:y,y:k}=bc(v,u,m),S=u,b={},w=0;for(let E=0;E<h.length;E++){const{name:O,fn:F}=h[E],{x:R,y:U,data:K,reset:_}=await F({x:y,y:k,initialPlacement:u,placement:S,strategy:f,middlewareData:b,rects:v,platform:p,elements:{reference:a,floating:c}});y=R??y,k=U??k,b={...b,[O]:{...b[O],...K}},_&&w<=50&&(w++,typeof _=="object"&&(_.placement&&(S=_.placement),_.rects&&(v=_.rects===!0?await p.getElementRects({reference:a,floating:c,strategy:f}):_.rects),{x:y,y:k}=bc(v,S,m)),E=-1)}return{x:y,y:k,placement:S,strategy:f,middlewareData:b}})(t,n,{...r,platform:i})};var zr=typeof document<"u"?g.useLayoutEffect:function(){};function oi(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="function"&&t.toString()===n.toString())return!0;let e,o,r;if(t&&n&&typeof t=="object"){if(Array.isArray(t)){if(e=t.length,e!==n.length)return!1;for(o=e;o--!==0;)if(!oi(t[o],n[o]))return!1;return!0}if(r=Object.keys(t),e=r.length,e!==Object.keys(n).length)return!1;for(o=e;o--!==0;)if(!{}.hasOwnProperty.call(n,r[o]))return!1;for(o=e;o--!==0;){const i=r[o];if((i!=="_owner"||!t.$$typeof)&&!oi(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}function Pu(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ec(t,n){const e=Pu(t);return Math.round(n*e)/e}function Yi(t){const n=D.useRef(t);return zr(()=>{n.current=t}),n}const Dm=(t,n)=>({...Pm(t),options:[t,n]}),Mm=(t,n)=>({...Am(t),options:[t,n]});function Au(t){return D.useMemo(()=>t.every(n=>n==null)?null:n=>{t.forEach(e=>{typeof e=="function"?e(n):e!=null&&(e.current=n)})},t)}const Tu={...D},_m=Tu.useInsertionEffect||(t=>t());function At(t){const n=D.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return _m(()=>{n.current=t}),D.useCallback(function(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return n.current==null?void 0:n.current(...o)},[])}const ws="ArrowUp",or="ArrowDown",kn="ArrowLeft",Sn="ArrowRight";function Nr(t,n,e){return Math.floor(t/n)!==e}function Wo(t,n){return n<0||n>=t.current.length}function Zi(t,n){return xt(t,{disabledIndices:n})}function jc(t,n){return xt(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}function xt(t,n){let{startingIndex:e=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=n===void 0?{}:n;const a=t.current;let c=e;do c+=o?-i:i;while(c>=0&&c<=a.length-1&&Ur(a,c,r));return c}function Lm(t,n,e,o,r){if(t===-1)return-1;const i=e.indexOf(t),a=n[t];switch(r){case"tl":return i;case"tr":return a?i+a.width-1:i;case"bl":return a?i+(a.height-1)*o:i;case"br":return e.lastIndexOf(t)}}function Rm(t,n){return n.flatMap((e,o)=>t.includes(e)?[o]:[])}function Ur(t,n,e){if(e)return e.includes(n);const o=t[n];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}var Je=typeof document<"u"?g.useLayoutEffect:g.useEffect;function Fm(t,n){const e=t.compareDocumentPosition(n);return e&Node.DOCUMENT_POSITION_FOLLOWING||e&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:e&Node.DOCUMENT_POSITION_PRECEDING||e&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Du=D.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Bm(t){const{children:n,elementsRef:e,labelsRef:o}=t,[r,i]=D.useState(()=>new Map),a=D.useCallback(l=>{i(u=>new Map(u).set(l,null))},[]),c=D.useCallback(l=>{i(u=>{const f=new Map(u);return f.delete(l),f})},[]);return Je(()=>{const l=new Map(r);Array.from(l.keys()).sort(Fm).forEach((u,f)=>{l.set(u,f)}),function(u,f){if(u.size!==f.size)return!1;for(const[d,p]of u.entries())if(p!==f.get(d))return!1;return!0}(r,l)||i(l)},[r]),D.createElement(Du.Provider,{value:D.useMemo(()=>({register:a,unregister:c,map:r,elementsRef:e,labelsRef:o}),[a,c,r,e,o])},n)}function Mu(t){t===void 0&&(t={});const{label:n}=t,{register:e,unregister:o,map:r,elementsRef:i,labelsRef:a}=D.useContext(Du),[c,l]=D.useState(null),u=D.useRef(null),f=D.useCallback(d=>{if(u.current=d,c!==null&&(i.current[c]=d,a)){var p;const h=n!==void 0;a.current[c]=h?n:(p=d==null?void 0:d.textContent)!=null?p:null}},[c,i,a,n]);return Je(()=>{const d=u.current;if(d)return e(d),()=>{o(d)}},[e,o]),Je(()=>{const d=u.current?r.get(u.current):null;d!=null&&l(d)},[r]),D.useMemo(()=>({ref:f,index:c??-1}),[c,f])}function ri(){return ri=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},ri.apply(this,arguments)}let Oc=!1,Hm=0;const Nc=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Hm++,Ta=Tu.useId||function(){const[t,n]=D.useState(()=>Oc?Nc():void 0);return Je(()=>{t==null&&n(Nc())},[]),D.useEffect(()=>{Oc=!0},[]),t};let lr;function Ki(){for(var t,n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];const r="Floating UI: "+e.join(" ");var i;(t=lr)!=null&&t.has(r)||((i=lr)==null||i.add(r),console.warn(r))}function _u(){const t=new Map;return{emit(n,e){var o;(o=t.get(n))==null||o.forEach(r=>r(e))},on(n,e){t.set(n,[...t.get(n)||[],e])},off(n,e){var o;t.set(n,((o=t.get(n))==null?void 0:o.filter(r=>r!==e))||[])}}}process.env.NODE_ENV!=="production"&&(lr=new Set);const Lu=D.createContext(null),Ru=D.createContext(null),Nn=()=>{var t;return((t=D.useContext(Lu))==null?void 0:t.id)||null},In=()=>D.useContext(Ru);function Wm(t){const{children:n,id:e}=t,o=Nn();return D.createElement(Lu.Provider,{value:D.useMemo(()=>({id:e,parentId:o}),[e,o])},n)}function $m(t){const{children:n}=t,e=D.useRef([]),o=D.useCallback(a=>{e.current=[...e.current,a]},[]),r=D.useCallback(a=>{e.current=e.current.filter(c=>c!==a)},[]),i=D.useState(()=>_u())[0];return D.createElement(Ru.Provider,{value:D.useMemo(()=>({nodesRef:e,addNode:o,removeNode:r,events:i}),[o,r,i])},n)}function ur(t){return"data-floating-ui-"+t}function Jt(t){const n=g.useRef(t);return Je(()=>{n.current=t}),n}const Ic=ur("safe-polygon");function qi(t,n,e){return e&&!Xo(e)?0:typeof t=="number"?t:t==null?void 0:t[n]}let Pc=0;function xn(t,n){n===void 0&&(n={});const{preventScroll:e=!1,cancelPrevious:o=!0,sync:r=!1}=n;o&&cancelAnimationFrame(Pc);const i=()=>t==null?void 0:t.focus({preventScroll:e});r?i():Pc=requestAnimationFrame(i)}function Xn(t,n){let e=t.filter(r=>{var i;return r.parentId===n&&((i=r.context)==null?void 0:i.open)}),o=e;for(;o.length;)o=t.filter(r=>{var i;return(i=o)==null?void 0:i.some(a=>{var c;return r.parentId===a.id&&((c=r.context)==null?void 0:c.open)})}),e=e.concat(o);return e}let co=new WeakMap,Ir=new WeakSet,Pr={},Ji=0;const Fu=t=>t&&(t.host||Fu(t.parentNode));function zm(t,n,e,o){const r="data-floating-ui-inert",i=o?"inert":e?"aria-hidden":null,a=(c=n,t.map(p=>{if(c.contains(p))return p;const h=Fu(p);return c.contains(h)?h:null}).filter(p=>p!=null));var c;const l=new Set,u=new Set(a),f=[];Pr[r]||(Pr[r]=new WeakMap);const d=Pr[r];return a.forEach(function p(h){!h||l.has(h)||(l.add(h),h.parentNode&&p(h.parentNode))}),function p(h){!h||u.has(h)||[].forEach.call(h.children,m=>{if(Dn(m)!=="script")if(l.has(m))p(m);else{const v=i?m.getAttribute(i):null,y=v!==null&&v!=="false",k=(co.get(m)||0)+1,S=(d.get(m)||0)+1;co.set(m,k),d.set(m,S),f.push(m),k===1&&y&&Ir.add(m),S===1&&m.setAttribute(r,""),!y&&i&&m.setAttribute(i,"true")}})}(n),l.clear(),Ji++,()=>{f.forEach(p=>{const h=(co.get(p)||0)-1,m=(d.get(p)||0)-1;co.set(p,h),d.set(p,m),h||(!Ir.has(p)&&i&&p.removeAttribute(i),Ir.delete(p)),m||p.removeAttribute(r)}),Ji--,Ji||(co=new WeakMap,co=new WeakMap,Ir=new WeakSet,Pr={})}}function Ac(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);const o=kt(t[0]).body;return zm(t.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,n,e)}const ii=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Tc(t,n){const e=gs(t,ii());n==="prev"&&e.reverse();const o=e.indexOf(hn(kt(t)));return e.slice(o+1)[0]}function Dc(t,n){const e=n||t.currentTarget,o=t.relatedTarget;return!o||!vt(e,o)}const bs={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Mc(t){t.key==="Tab"&&(t.target,clearTimeout(void 0))}const _c=D.forwardRef(function(t,n){const[e,o]=D.useState();Je(()=>(gu()&&o("button"),document.addEventListener("keydown",Mc),()=>{document.removeEventListener("keydown",Mc)}),[]);const r={ref:n,tabIndex:0,role:e,"aria-hidden":!e||void 0,[ur("focus-guard")]:"",style:bs};return D.createElement("span",ri({},t,r))}),Um=D.createContext(null),Da="data-floating-ui-focusable";function Bu(t){return t?t.hasAttribute(Da)?t:t.querySelector("["+Da+"]")||t:null}let Bn=[];function Xi(t){Bn=Bn.filter(e=>e.isConnected);let n=t;if(n&&Dn(n)!=="body"){if(!function(e,o){if(o=o||{},!e)throw new Error("No node provided");return jo.call(e,ti)!==!1&&Aa(o,e)}(n,ii())){const e=gs(n,ii())[0];e&&(n=e)}Bn.push(n),Bn.length>20&&(Bn=Bn.slice(-20))}}function Lc(){return Bn.slice().reverse().find(t=>t.isConnected)}const Vm=D.forwardRef(function(t,n){return D.createElement("button",ri({},t,{type:"button",ref:n,tabIndex:-1,style:bs}))});function Gm(t){const{context:n,children:e,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0}=t,{open:p,refs:h,nodeId:m,onOpenChange:v,events:y,dataRef:k,floatingId:S,elements:{domReference:b,floating:w}}=n,E=typeof a=="number"&&a<0,O=Ia(b)&&E,F=typeof HTMLElement>"u"||!("inert"in HTMLElement.prototype)||i,R=Jt(r),U=Jt(a),K=Jt(c),_=In(),A=D.useContext(Um),me=D.useRef(null),de=D.useRef(null),re=D.useRef(!1),ye=D.useRef(!1),pe=D.useRef(-1),xe=A!=null,ae=Bu(w),B=At(function(H){return H===void 0&&(H=ae),H?gs(H,ii()):[]}),X=At(H=>{const P=B(H);return R.current.map(T=>b&&T==="reference"?b:ae&&T==="floating"?ae:P).filter(Boolean).flat()});function Y(H){return!o&&f&&u?D.createElement(Vm,{ref:H==="start"?me:de,onClick:P=>v(!1,P.nativeEvent)},typeof f=="string"?f:"Dismiss"):null}D.useEffect(()=>{if(o||!u)return;function H(T){if(T.key==="Tab"){vt(ae,hn(kt(ae)))&&B().length===0&&!O&&Nt(T);const W=X(),q=Cn(T);R.current[0]==="reference"&&q===b&&(Nt(T),T.shiftKey?xn(W[W.length-1]):xn(W[1])),R.current[1]==="floating"&&q===ae&&T.shiftKey&&(Nt(T),xn(W[0]))}}const P=kt(ae);return P.addEventListener("keydown",H),()=>{P.removeEventListener("keydown",H)}},[o,b,ae,u,R,O,B,X]),D.useEffect(()=>{if(!o&&w)return w.addEventListener("focusin",H),()=>{w.removeEventListener("focusin",H)};function H(P){const T=Cn(P),W=B().indexOf(T);W!==-1&&(pe.current=W)}},[o,w,B]),D.useEffect(()=>{if(!o&&d)return w&&dt(b)?(b.addEventListener("focusout",P),b.addEventListener("pointerdown",H),w.addEventListener("focusout",P),()=>{b.removeEventListener("focusout",P),b.removeEventListener("pointerdown",H),w.removeEventListener("focusout",P)}):void 0;function H(){ye.current=!0,setTimeout(()=>{ye.current=!1})}function P(T){const W=T.relatedTarget;queueMicrotask(()=>{const q=!(vt(b,W)||vt(w,W)||vt(W,w)||vt(A==null?void 0:A.portalNode,W)||W!=null&&W.hasAttribute(ur("focus-guard"))||_&&(Xn(_.nodesRef.current,m).find(Z=>{var ie,oe;return vt((ie=Z.context)==null?void 0:ie.elements.floating,W)||vt((oe=Z.context)==null?void 0:oe.elements.domReference,W)})||function(Z,ie){var oe;let I=[],Ce=(oe=Z.find(ke=>ke.id===ie))==null?void 0:oe.parentId;for(;Ce;){const ke=Z.find(Ae=>Ae.id===Ce);Ce=ke==null?void 0:ke.parentId,ke&&(I=I.concat(ke))}return I}(_.nodesRef.current,m).find(Z=>{var ie,oe;return((ie=Z.context)==null?void 0:ie.elements.floating)===W||((oe=Z.context)==null?void 0:oe.elements.domReference)===W})));if(l&&q&&hn(kt(ae))===kt(ae).body){dt(ae)&&ae.focus();const Z=pe.current,ie=B(),oe=ie[Z]||ie[ie.length-1]||ae;dt(oe)&&oe.focus()}!O&&u||!W||!q||ye.current||W===Lc()||(re.current=!0,v(!1,T,"focus-out"))})}},[o,b,w,ae,u,m,_,A,v,d,l,B,O]),D.useEffect(()=>{var H;if(o)return;const P=Array.from((A==null||(H=A.portalNode)==null?void 0:H.querySelectorAll("["+ur("portal")+"]"))||[]);if(w){const T=[w,...P,me.current,de.current,R.current.includes("reference")||O?b:null].filter(q=>q!=null),W=u||O?Ac(T,F,!F):Ac(T);return()=>{W()}}},[o,b,w,u,R,A,O,F]),Je(()=>{if(o||!dt(ae))return;const H=hn(kt(ae));queueMicrotask(()=>{const P=X(ae),T=U.current,W=(typeof T=="number"?P[T]:T.current)||ae,q=vt(ae,H);E||q||!p||xn(W,{preventScroll:W===ae})})},[o,p,ae,E,X,U]),Je(()=>{if(o||!ae)return;let H=!1;const P=kt(ae),T=hn(P);let W=k.current.openEvent;function q(ie){let{open:oe,reason:I,event:Ce,nested:ke}=ie;oe&&(W=Ce),I==="escape-key"&&h.domReference.current&&Xi(h.domReference.current),I==="hover"&&Ce.type==="mouseleave"&&(re.current=!0),I==="outside-press"&&(ke?(re.current=!1,H=!0):re.current=!(hu(Ce)||mu(Ce)))}Xi(T),y.on("openchange",q);const Z=P.createElement("span");return Z.setAttribute("tabindex","-1"),Z.setAttribute("aria-hidden","true"),Object.assign(Z.style,bs),xe&&b&&b.insertAdjacentElement("afterend",Z),()=>{y.off("openchange",q);const ie=hn(P),oe=vt(w,ie)||_&&Xn(_.nodesRef.current,m).some(Ce=>{var ke;return vt((ke=Ce.context)==null?void 0:ke.elements.floating,ie)});(oe||W&&["click","mousedown"].includes(W.type))&&h.domReference.current&&Xi(h.domReference.current);const I=typeof K.current=="boolean"?Lc()||Z:K.current.current||Z;queueMicrotask(()=>{K.current&&!re.current&&dt(I)&&(I===ie||ie===P.body||oe)&&I.focus({preventScroll:H}),Z.remove()})}},[o,w,ae,K,k,h,y,_,m,xe,b]),D.useEffect(()=>{queueMicrotask(()=>{re.current=!1})},[o]),Je(()=>{if(!o&&A)return A.setFocusManagerState({modal:u,closeOnFocusOut:d,open:p,onOpenChange:v,refs:h}),()=>{A.setFocusManagerState(null)}},[o,A,u,p,v,h,d]),Je(()=>{if(o||!ae||typeof MutationObserver!="function"||E)return;const H=()=>{const T=ae.getAttribute("tabindex"),W=B(),q=hn(kt(w)),Z=W.indexOf(q);Z!==-1&&(pe.current=Z),R.current.includes("floating")||q!==h.domReference.current&&W.length===0?T!=="0"&&ae.setAttribute("tabindex","0"):T!=="-1"&&ae.setAttribute("tabindex","-1")};H();const P=new MutationObserver(H);return P.observe(ae,{childList:!0,subtree:!0,attributes:!0}),()=>{P.disconnect()}},[o,w,ae,h,R,B,E]);const J=!o&&F&&(!u||!O)&&(xe||u);return D.createElement(D.Fragment,null,J&&D.createElement(_c,{"data-type":"inside",ref:A==null?void 0:A.beforeInsideRef,onFocus:H=>{if(u){const T=X();xn(r[0]==="reference"?T[0]:T[T.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(re.current=!1,Dc(H,A.portalNode)){const T=Tc(document.body,"next")||b;T==null||T.focus()}else{var P;(P=A.beforeOutsideRef.current)==null||P.focus()}}}),!O&&Y("start"),e,Y("end"),J&&D.createElement(_c,{"data-type":"inside",ref:A==null?void 0:A.afterInsideRef,onFocus:H=>{if(u)xn(X()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(d&&(re.current=!0),Dc(H,A.portalNode)){const T=Tc(document.body,"prev")||b;T==null||T.focus()}else{var P;(P=A.afterOutsideRef.current)==null||P.focus()}}}))}function Rc(t){return dt(t.target)&&t.target.tagName==="BUTTON"}function Fc(t){return vu(t)}const Ym={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Zm={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Bc=t=>{var n,e;return{escapeKey:typeof t=="boolean"?t:(n=t==null?void 0:t.escapeKey)!=null&&n,outsidePress:typeof t=="boolean"?t:(e=t==null?void 0:t.outsidePress)==null||e}};function Km(t){const{open:n=!1,onOpenChange:e,elements:o}=t,r=Ta(),i=D.useRef({}),[a]=D.useState(()=>_u()),c=Nn()!=null;if(process.env.NODE_ENV!=="production"){const h=o.reference;h&&!Ze(h)&&function(){for(var m,v=arguments.length,y=new Array(v),k=0;k<v;k++)y[k]=arguments[k];const S="Floating UI: "+y.join(" ");var b;(m=lr)!=null&&m.has(S)||((b=lr)==null||b.add(S),console.error(S))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=D.useState(o.reference),f=At((h,m,v)=>{i.current.openEvent=h?m:void 0,a.emit("openchange",{open:h,event:m,reason:v,nested:c}),e==null||e(h,m,v)}),d=D.useMemo(()=>({setPositionReference:u}),[]),p=D.useMemo(()=>({reference:l||o.reference||null,floating:o.floating||null,domReference:o.reference}),[l,o.reference,o.floating]);return D.useMemo(()=>({dataRef:i,open:n,onOpenChange:f,elements:p,events:a,floatingId:r,refs:d}),[n,f,p,a,r,d])}function qm(t){t===void 0&&(t={});const{nodeId:n}=t,e=Km({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||e,r=o.elements,[i,a]=D.useState(null),[c,l]=D.useState(null),u=(r==null?void 0:r.domReference)||i,f=D.useRef(null),d=In();Je(()=>{u&&(f.current=u)},[u]);const p=function(S){S===void 0&&(S={});const{placement:b="bottom",strategy:w="absolute",middleware:E=[],platform:O,elements:{reference:F,floating:R}={},transform:U=!0,whileElementsMounted:K,open:_}=S,[A,me]=D.useState({x:0,y:0,strategy:w,placement:b,middlewareData:{},isPositioned:!1}),[de,re]=D.useState(E);oi(de,E)||re(E);const[ye,pe]=D.useState(null),[xe,ae]=D.useState(null),B=D.useCallback(Pe=>{Pe!==H.current&&(H.current=Pe,pe(Pe))},[]),X=D.useCallback(Pe=>{Pe!==P.current&&(P.current=Pe,ae(Pe))},[]),Y=F||ye,J=R||xe,H=D.useRef(null),P=D.useRef(null),T=D.useRef(A),W=K!=null,q=Yi(K),Z=Yi(O),ie=Yi(_),oe=D.useCallback(()=>{if(!H.current||!P.current)return;const Pe={placement:b,strategy:w,middleware:de};Z.current&&(Pe.platform=Z.current),Tm(H.current,P.current,Pe).then(Te=>{const he={...Te,isPositioned:ie.current!==!1};I.current&&!oi(T.current,he)&&(T.current=he,Kl.flushSync(()=>{me(he)}))})},[de,b,w,Z,ie]);zr(()=>{_===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,me(Pe=>({...Pe,isPositioned:!1})))},[_]);const I=D.useRef(!1);zr(()=>(I.current=!0,()=>{I.current=!1}),[]),zr(()=>{if(Y&&(H.current=Y),J&&(P.current=J),Y&&J){if(q.current)return q.current(Y,J,oe);oe()}},[Y,J,oe,q,W]);const Ce=D.useMemo(()=>({reference:H,floating:P,setReference:B,setFloating:X}),[B,X]),ke=D.useMemo(()=>({reference:Y,floating:J}),[Y,J]),Ae=D.useMemo(()=>{const Pe={position:w,left:0,top:0};if(!ke.floating)return Pe;const Te=Ec(ke.floating,A.x),he=Ec(ke.floating,A.y);return U?{...Pe,transform:"translate("+Te+"px, "+he+"px)",...Pu(ke.floating)>=1.5&&{willChange:"transform"}}:{position:w,left:Te,top:he}},[w,U,ke.floating,A.x,A.y]);return D.useMemo(()=>({...A,update:oe,refs:Ce,elements:ke,floatingStyles:Ae}),[A,oe,Ce,ke,Ae])}({...t,elements:{...r,...c&&{reference:c}}}),h=D.useCallback(S=>{const b=Ze(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;l(b),p.refs.setReference(b)},[p.refs]),m=D.useCallback(S=>{(Ze(S)||S===null)&&(f.current=S,a(S)),(Ze(p.refs.reference.current)||p.refs.reference.current===null||S!==null&&!Ze(S))&&p.refs.setReference(S)},[p.refs]),v=D.useMemo(()=>({...p.refs,setReference:m,setPositionReference:h,domReference:f}),[p.refs,m,h]),y=D.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),k=D.useMemo(()=>({...p,...o,refs:v,elements:y,nodeId:n}),[p,v,y,n,o]);return Je(()=>{o.dataRef.current.floatingContext=k;const S=d==null?void 0:d.nodesRef.current.find(b=>b.id===n);S&&(S.context=k)}),D.useMemo(()=>({...p,context:k,refs:v,elements:y}),[p,v,y,k])}const Hc="active",Wc="selected";function Qi(t,n,e){const o=new Map,r=e==="item";let i=t;if(r&&t){const{[Hc]:a,[Wc]:c,...l}=t;i=l}return{...e==="floating"&&{tabIndex:-1,[Da]:""},...i,...n.map(a=>{const c=a?a[e]:null;return typeof c=="function"?t?c(t):null:c}).concat(t).reduce((a,c)=>(c&&Object.entries(c).forEach(l=>{let[u,f]=l;var d;r&&[Hc,Wc].includes(u)||(u.indexOf("on")===0?(o.has(u)||o.set(u,[]),typeof f=="function"&&((d=o.get(u))==null||d.push(f),a[u]=function(){for(var p,h=arguments.length,m=new Array(h),v=0;v<h;v++)m[v]=arguments[v];return(p=o.get(u))==null?void 0:p.map(y=>y(...m)).find(y=>y!==void 0)})):a[u]=f)}),a),{})}}let $c=!1;function Ci(t,n,e){switch(t){case"vertical":return n;case"horizontal":return e;default:return n||e}}function zc(t,n){return Ci(n,t===ws||t===or,t===kn||t===Sn)}function ea(t,n,e){return Ci(n,t===or,e?t===kn:t===Sn)||t==="Enter"||t===" "||t===""}function Uc(t,n,e){return Ci(n,e?t===Sn:t===kn,t===ws)}function Jm(t,n){const{open:e,onOpenChange:o,elements:r}=t,{listRef:i,activeIndex:a,onNavigate:c=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:f=!1,loop:d=!1,nested:p=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:k=!0,disabledIndices:S,orientation:b="vertical",cols:w=1,scrollItemIntoView:E=!0,virtualItemRef:O,itemSizes:F,dense:R=!1}=n;process.env.NODE_ENV!=="production"&&(f&&(d||Ki("`useListNavigation` looping must be enabled to allow escaping."),m||Ki("`useListNavigation` must be virtual to allow escaping.")),b==="vertical"&&w>1&&Ki("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const U=Jt(Bu(r.floating)),K=Nn(),_=In(),A=At(c),me=Ia(r.domReference),de=D.useRef(v),re=D.useRef(u??-1),ye=D.useRef(null),pe=D.useRef(!0),xe=D.useRef(A),ae=D.useRef(!!r.floating),B=D.useRef(e),X=D.useRef(!1),Y=D.useRef(!1),J=Jt(S),H=Jt(e),P=Jt(E),T=Jt(u),[W,q]=D.useState(),[Z,ie]=D.useState(),oe=At(function(he,C,x){function j(L){m?(q(L.id),_==null||_.events.emit("virtualfocus",L),O&&(O.current=L)):xn(L,{preventScroll:!0,sync:!(!fu().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!gu())&&($c||X.current)})}x===void 0&&(x=!1);const N=he.current[C.current];N&&j(N),requestAnimationFrame(()=>{const L=he.current[C.current]||N;if(!L)return;N||j(L);const ne=P.current;ne&&Ce&&(x||!pe.current)&&(L.scrollIntoView==null||L.scrollIntoView(typeof ne=="boolean"?{block:"nearest",inline:"nearest"}:ne))})});Je(()=>{document.createElement("div").focus({get preventScroll(){return $c=!0,!1}})},[]),Je(()=>{l&&(e&&r.floating?de.current&&u!=null&&(Y.current=!0,re.current=u,A(u)):ae.current&&(re.current=-1,xe.current(null)))},[l,e,r.floating,u,A]),Je(()=>{if(l&&e&&r.floating)if(a==null){if(X.current=!1,T.current!=null)return;if(ae.current&&(re.current=-1,oe(i,re)),(!B.current||!ae.current)&&de.current&&(ye.current!=null||de.current===!0&&ye.current==null)){let he=0;const C=()=>{i.current[0]==null?(he<2&&(he?requestAnimationFrame:queueMicrotask)(C),he++):(re.current=ye.current==null||ea(ye.current,b,h)||p?Zi(i,J.current):jc(i,J.current),ye.current=null,A(re.current))};C()}}else Wo(i,a)||(re.current=a,oe(i,re,Y.current),Y.current=!1)},[l,e,r.floating,a,T,p,i,b,h,A,oe,J]),Je(()=>{var he;if(!l||r.floating||!_||m||!ae.current)return;const C=_.nodesRef.current,x=(he=C.find(L=>L.id===K))==null||(he=he.context)==null?void 0:he.elements.floating,j=hn(kt(r.floating)),N=C.some(L=>L.context&&vt(L.context.elements.floating,j));x&&!N&&pe.current&&x.focus({preventScroll:!0})},[l,r.floating,_,K,m]),Je(()=>{if(l&&_&&m&&!K)return _.events.on("virtualfocus",he),()=>{_.events.off("virtualfocus",he)};function he(C){ie(C.id),O&&(O.current=C)}},[l,_,m,K,O]),Je(()=>{xe.current=A,ae.current=!!r.floating}),Je(()=>{e||(ye.current=null)},[e]),Je(()=>{B.current=e},[e]);const I=a!=null,Ce=D.useMemo(()=>{function he(C){if(!e)return;const x=i.current.indexOf(C);x!==-1&&A(x)}return{onFocus(C){let{currentTarget:x}=C;he(x)},onClick:C=>{let{currentTarget:x}=C;return x.focus({preventScroll:!0})},...y&&{onMouseMove(C){let{currentTarget:x}=C;he(x)},onPointerLeave(C){let{pointerType:x}=C;pe.current&&x!=="touch"&&(re.current=-1,oe(i,re),A(null),m||xn(U.current,{preventScroll:!0}))}}}},[e,U,oe,y,i,A,m]),ke=At(he=>{if(pe.current=!1,X.current=!0,he.which===229||!H.current&&he.currentTarget===U.current)return;if(p&&Uc(he.key,b,h))return Nt(he),o(!1,he.nativeEvent,"list-navigation"),void(dt(r.domReference)&&(m?_==null||_.events.emit("virtualfocus",r.domReference):r.domReference.focus()));const C=re.current,x=Zi(i,S),j=jc(i,S);if(me||(he.key==="Home"&&(Nt(he),re.current=x,A(re.current)),he.key==="End"&&(Nt(he),re.current=j,A(re.current))),w>1){const N=F||Array.from({length:i.current.length},()=>({width:1,height:1})),L=function(V,z,te){const le=[];let ge=0;return V.forEach((se,G)=>{let{width:Se,height:Be}=se;if(Se>z&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+G+" is greater than grid columns");let Oe=!1;for(te&&(ge=0);!Oe;){const je=[];for(let Ee=0;Ee<Se;Ee++)for(let ue=0;ue<Be;ue++)je.push(ge+Ee+ue*z);ge%z+Se<=z&&je.every(Ee=>le[Ee]==null)?(je.forEach(Ee=>{le[Ee]=G}),Oe=!0):ge++}}),[...le]}(N,w,R),ne=L.findIndex(V=>V!=null&&!Ur(i.current,V,S)),ve=L.reduce((V,z,te)=>z==null||Ur(i.current,z,S)?V:te,-1),$=L[function(V,z){let{event:te,orientation:le,loop:ge,rtl:se,cols:G,disabledIndices:Se,minIndex:Be,maxIndex:Oe,prevIndex:je,stopEvent:Ee=!1}=z,ue=je;if(te.key===ws){if(Ee&&Nt(te),je===-1)ue=Oe;else if(ue=xt(V,{startingIndex:ue,amount:G,decrement:!0,disabledIndices:Se}),ge&&(je-G<Be||ue<0)){const we=je%G,De=Oe%G,Ie=Oe-(De-we);ue=De===we?Oe:De>we?Ie:Ie-G}Wo(V,ue)&&(ue=je)}if(te.key===or&&(Ee&&Nt(te),je===-1?ue=Be:(ue=xt(V,{startingIndex:je,amount:G,disabledIndices:Se}),ge&&je+G>Oe&&(ue=xt(V,{startingIndex:je%G-G,amount:G,disabledIndices:Se}))),Wo(V,ue)&&(ue=je)),le==="both"){const we=wo(je/G);te.key===(se?kn:Sn)&&(Ee&&Nt(te),je%G!==G-1?(ue=xt(V,{startingIndex:je,disabledIndices:Se}),ge&&Nr(ue,G,we)&&(ue=xt(V,{startingIndex:je-je%G-1,disabledIndices:Se}))):ge&&(ue=xt(V,{startingIndex:je-je%G-1,disabledIndices:Se})),Nr(ue,G,we)&&(ue=je)),te.key===(se?Sn:kn)&&(Ee&&Nt(te),je%G!==0?(ue=xt(V,{startingIndex:je,decrement:!0,disabledIndices:Se}),ge&&Nr(ue,G,we)&&(ue=xt(V,{startingIndex:je+(G-je%G),decrement:!0,disabledIndices:Se}))):ge&&(ue=xt(V,{startingIndex:je+(G-je%G),decrement:!0,disabledIndices:Se})),Nr(ue,G,we)&&(ue=je));const De=wo(Oe/G)===we;Wo(V,ue)&&(ue=ge&&De?te.key===(se?Sn:kn)?Oe:xt(V,{startingIndex:je-je%G-1,disabledIndices:Se}):je)}return ue}({current:L.map(V=>V!=null?i.current[V]:null)},{event:he,orientation:b,loop:d,rtl:h,cols:w,disabledIndices:Rm([...S||i.current.map((V,z)=>Ur(i.current,z)?z:void 0),void 0],L),minIndex:ne,maxIndex:ve,prevIndex:Lm(re.current>j?x:re.current,N,L,w,he.key===or?"bl":he.key===(h?kn:Sn)?"tr":"tl"),stopEvent:!0})];if($!=null&&(re.current=$,A(re.current)),b==="both")return}if(zc(he.key,b)){if(Nt(he),e&&!m&&hn(he.currentTarget.ownerDocument)===he.currentTarget)return re.current=ea(he.key,b,h)?x:j,void A(re.current);ea(he.key,b,h)?re.current=d?C>=j?f&&C!==i.current.length?-1:x:xt(i,{startingIndex:C,disabledIndices:S}):Math.min(j,xt(i,{startingIndex:C,disabledIndices:S})):re.current=d?C<=x?f&&C!==-1?i.current.length:j:xt(i,{startingIndex:C,decrement:!0,disabledIndices:S}):Math.max(x,xt(i,{startingIndex:C,decrement:!0,disabledIndices:S})),Wo(i,re.current)?A(null):A(re.current)}}),Ae=D.useMemo(()=>m&&e&&I&&{"aria-activedescendant":Z||W},[m,e,I,Z,W]),Pe=D.useMemo(()=>({"aria-orientation":b==="both"?void 0:b,...!Ia(r.domReference)&&Ae,onKeyDown:ke,onPointerMove(){pe.current=!0}}),[Ae,ke,r.domReference,b]),Te=D.useMemo(()=>{function he(C){v==="auto"&&hu(C.nativeEvent)&&(de.current=!0)}return{...Ae,onKeyDown(C){pe.current=!1;const x=C.key.startsWith("Arrow"),j=["Home","End"].includes(C.key),N=x||j,L=function(le,ge,se){return Ci(ge,se?le===kn:le===Sn,le===or)}(C.key,b,h),ne=Uc(C.key,b,h),ve=zc(C.key,b),$=(p?L:ve)||C.key==="Enter"||C.key.trim()==="";if(m&&e){const le=_==null?void 0:_.nodesRef.current.find(se=>se.parentId==null),ge=_&&le?function(se,G){let Se,Be=-1;return function Oe(je,Ee){Ee>Be&&(Se=je,Be=Ee),Xn(se,je).forEach(ue=>{Oe(ue.id,Ee+1)})}(G,0),se.find(Oe=>Oe.id===Se)}(_.nodesRef.current,le.id):null;if(N&&ge&&O){const se=new KeyboardEvent("keydown",{key:C.key,bubbles:!0});if(L||ne){var V,z;const G=((V=ge.context)==null?void 0:V.elements.domReference)===C.currentTarget,Se=ne&&!G?(z=ge.context)==null?void 0:z.elements.domReference:L?i.current.find(Be=>(Be==null?void 0:Be.id)===W):null;Se&&(Nt(C),Se.dispatchEvent(se),ie(void 0))}var te;if((ve||j)&&ge.context&&ge.context.open&&ge.parentId&&C.currentTarget!==ge.context.elements.domReference)return Nt(C),void((te=ge.context.elements.domReference)==null||te.dispatchEvent(se))}return ke(C)}(e||k||!x)&&($&&(ye.current=p&&ve?null:C.key),p?L&&(Nt(C),e?(re.current=Zi(i,J.current),A(re.current)):o(!0,C.nativeEvent,"list-navigation")):ve&&(u!=null&&(re.current=u),Nt(C),!e&&k?o(!0,C.nativeEvent,"list-navigation"):ke(C),e&&A(re.current)))},onFocus(){e&&!m&&A(null)},onPointerDown:function(C){de.current=v,v==="auto"&&mu(C.nativeEvent)&&(de.current=!0)},onMouseDown:he,onClick:he}},[W,Ae,ke,J,v,i,p,A,o,e,k,b,h,u,_,m,O]);return D.useMemo(()=>l?{reference:Te,floating:Pe,item:Ce}:{},[l,Te,Pe,Ce])}const Xm=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Vc(t,n){const[e,o]=t;let r=!1;const i=n.length;for(let a=0,c=i-1;a<i;c=a++){const[l,u]=n[a]||[0,0],[f,d]=n[c]||[0,0];u>=o!=d>=o&&e<=(f-l)*(o-u)/(d-u)+l&&(r=!r)}return r}function Qm(t){t===void 0&&(t={});const{buffer:n=.5,blockPointerEvents:e=!1,requireIntent:o=!0}=t;let r,i=!1,a=null,c=null,l=performance.now();const u=f=>{let{x:d,y:p,placement:h,elements:m,onClose:v,nodeId:y,tree:k}=f;return function(S){function b(){clearTimeout(r),v()}if(clearTimeout(r),!m.domReference||!m.floating||h==null||d==null||p==null)return;const{clientX:w,clientY:E}=S,O=[w,E],F=Cn(S),R=S.type==="mouseleave",U=vt(m.floating,F),K=vt(m.domReference,F),_=m.domReference.getBoundingClientRect(),A=m.floating.getBoundingClientRect(),me=h.split("-")[0],de=d>A.right-A.width/2,re=p>A.bottom-A.height/2,ye=function(H,P){return H[0]>=P.x&&H[0]<=P.x+P.width&&H[1]>=P.y&&H[1]<=P.y+P.height}(O,_),pe=A.width>_.width,xe=A.height>_.height,ae=(pe?_:A).left,B=(pe?_:A).right,X=(xe?_:A).top,Y=(xe?_:A).bottom;if(U&&(i=!0,!R))return;if(K&&(i=!1),K&&!R)return void(i=!0);if(R&&Ze(S.relatedTarget)&&vt(m.floating,S.relatedTarget)||k&&Xn(k.nodesRef.current,y).some(H=>{let{context:P}=H;return P==null?void 0:P.open}))return;if(me==="top"&&p>=_.bottom-1||me==="bottom"&&p<=_.top+1||me==="left"&&d>=_.right-1||me==="right"&&d<=_.left+1)return b();let J=[];switch(me){case"top":J=[[ae,_.top+1],[ae,A.bottom-1],[B,A.bottom-1],[B,_.top+1]];break;case"bottom":J=[[ae,A.top+1],[ae,_.bottom-1],[B,_.bottom-1],[B,A.top+1]];break;case"left":J=[[A.right-1,Y],[A.right-1,X],[_.left+1,X],[_.left+1,Y]];break;case"right":J=[[_.right-1,Y],[_.right-1,X],[A.left+1,X],[A.left+1,Y]]}if(!Vc([w,E],J)){if(i&&!ye)return b();if(!R&&o){const H=function(P,T){const W=performance.now(),q=W-l;if(a===null||c===null||q===0)return a=P,c=T,l=W,null;const Z=P-a,ie=T-c,oe=Math.sqrt(Z*Z+ie*ie);return a=P,c=T,l=W,oe/q}(S.clientX,S.clientY);if(H!==null&&H<.1)return b()}Vc([w,E],function(H){let[P,T]=H;switch(me){case"top":return[[pe?P+n/2:de?P+4*n:P-4*n,T+n+1],[pe?P-n/2:de?P+4*n:P-4*n,T+n+1],[A.left,de||pe?A.bottom-n:A.top],[A.right,de?pe?A.bottom-n:A.top:A.bottom-n]];case"bottom":return[[pe?P+n/2:de?P+4*n:P-4*n,T-n],[pe?P-n/2:de?P+4*n:P-4*n,T-n],[A.left,de||pe?A.top+n:A.bottom],[A.right,de?pe?A.top+n:A.bottom:A.top+n]];case"left":{const W=[P+n+1,xe?T+n/2:re?T+4*n:T-4*n],q=[P+n+1,xe?T-n/2:re?T+4*n:T-4*n];return[[re||xe?A.right-n:A.left,A.top],[re?xe?A.right-n:A.left:A.right-n,A.bottom],W,q]}case"right":return[[P-n,xe?T+n/2:re?T+4*n:T-4*n],[P-n,xe?T-n/2:re?T+4*n:T-4*n],[re||xe?A.left+n:A.right,A.top],[re?xe?A.left+n:A.right:A.left+n,A.bottom]]}}([d,p]))?!i&&o&&(r=window.setTimeout(b,40)):b()}}};return u.__options={blockPointerEvents:e},u}const Ma=g.createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1,setIsOpen:()=>{}}),Hu=g.forwardRef(({className:t,disabled:n,children:e,...o},r)=>{const i=g.useContext(Ma),a=Mu(),c=In(),l=a.index===i.activeIndex,u=ee("io-dropdown-menu-item",n&&"io-dropdown-menu-item-disabled",t);return s.jsx("div",{ref:Au([a.ref,r]),role:"menuitem",className:u,tabIndex:l?0:-1,"aria-disabled":n,...o,...i.getItemProps({onClick(f){var d;if(n)return f.preventDefault(),void f.stopPropagation();(d=o.onClick)==null||d.call(o,f),i.setIsOpen(!1),c==null||c.events.emit("click")},onFocus(f){var d;n||((d=o.onFocus)==null||d.call(o,f),i.setHasFocusInside(!0))}}),children:e})});Hu.displayName="DropdownMenuItem";const _a=g.forwardRef(({className:t,variant:n="default",icon:e,iconRight:o,text:r="",disabled:i,children:a,...c},l)=>{const[u,f]=g.useState(!1),[d,p]=g.useState(!1),[h,m]=g.useState(null),v=g.useRef([]),y=g.useRef([]),k=g.useContext(Ma),S=In(),b=function(){const P=Ta(),T=In(),W=Nn();return Je(()=>{const q={id:P,parentId:W};return T==null||T.addNode(q),()=>{T==null||T.removeNode(q)}},[T,P,W]),P}(),w=Nn(),E=Mu(),O=w!=null,{floatingStyles:F,refs:R,context:U}=qm({nodeId:b,open:u,onOpenChange:f,placement:O?"right-start":"bottom-start",middleware:[(K={mainAxis:O?0:4,alignmentAxis:O?-4:0},{...Im(K),options:[K,_]}),Mm(),Dm()],whileElementsMounted:Nm});var K,_;const A=function(P,T){T===void 0&&(T={});const{open:W,onOpenChange:q,dataRef:Z,events:ie,elements:oe}=P,{enabled:I=!0,delay:Ce=0,handleClose:ke=null,mouseOnly:Ae=!1,restMs:Pe=0,move:Te=!0}=T,he=In(),C=Nn(),x=Jt(ke),j=Jt(Ce),N=Jt(W),L=D.useRef(),ne=D.useRef(-1),ve=D.useRef(),$=D.useRef(-1),V=D.useRef(!0),z=D.useRef(!1),te=D.useRef(()=>{}),le=D.useRef(!1),ge=D.useCallback(()=>{var Ee;const ue=(Ee=Z.current.openEvent)==null?void 0:Ee.type;return(ue==null?void 0:ue.includes("mouse"))&&ue!=="mousedown"},[Z]);D.useEffect(()=>{if(I)return ie.on("openchange",Ee),()=>{ie.off("openchange",Ee)};function Ee(ue){let{open:we}=ue;we||(clearTimeout(ne.current),clearTimeout($.current),V.current=!0,le.current=!1)}},[I,ie]),D.useEffect(()=>{if(!I||!x.current||!W)return;function Ee(we){ge()&&q(!1,we,"hover")}const ue=kt(oe.floating).documentElement;return ue.addEventListener("mouseleave",Ee),()=>{ue.removeEventListener("mouseleave",Ee)}},[oe.floating,W,q,I,x,ge]);const se=D.useCallback(function(Ee,ue,we){ue===void 0&&(ue=!0),we===void 0&&(we="hover");const De=qi(j.current,"close",L.current);De&&!ve.current?(clearTimeout(ne.current),ne.current=window.setTimeout(()=>q(!1,Ee,we),De)):ue&&(clearTimeout(ne.current),q(!1,Ee,we))},[j,q]),G=At(()=>{te.current(),ve.current=void 0}),Se=At(()=>{if(z.current){const Ee=kt(oe.floating).body;Ee.style.pointerEvents="",Ee.removeAttribute(Ic),z.current=!1}}),Be=At(()=>!!Z.current.openEvent&&["click","mousedown"].includes(Z.current.openEvent.type));D.useEffect(()=>{if(I&&Ze(oe.domReference)){var Ee;const Ie=oe.domReference;return W&&Ie.addEventListener("mouseleave",De),(Ee=oe.floating)==null||Ee.addEventListener("mouseleave",De),Te&&Ie.addEventListener("mousemove",ue,{once:!0}),Ie.addEventListener("mouseenter",ue),Ie.addEventListener("mouseleave",we),()=>{var qe;W&&Ie.removeEventListener("mouseleave",De),(qe=oe.floating)==null||qe.removeEventListener("mouseleave",De),Te&&Ie.removeEventListener("mousemove",ue),Ie.removeEventListener("mouseenter",ue),Ie.removeEventListener("mouseleave",we)}}function ue(Ie){if(clearTimeout(ne.current),V.current=!1,Ae&&!Xo(L.current)||Pe>0&&!qi(j.current,"open"))return;const qe=qi(j.current,"open",L.current);qe?ne.current=window.setTimeout(()=>{N.current||q(!0,Ie,"hover")},qe):W||q(!0,Ie,"hover")}function we(Ie){if(Be())return;te.current();const qe=kt(oe.floating);if(clearTimeout($.current),le.current=!1,x.current&&Z.current.floatingContext){W||clearTimeout(ne.current),ve.current=x.current({...Z.current.floatingContext,tree:he,x:Ie.clientX,y:Ie.clientY,onClose(){Se(),G(),Be()||se(Ie,!0,"safe-polygon")}});const qt=ve.current;return qe.addEventListener("mousemove",qt),void(te.current=()=>{qe.removeEventListener("mousemove",qt)})}(L.current!=="touch"||!vt(oe.floating,Ie.relatedTarget))&&se(Ie)}function De(Ie){Be()||Z.current.floatingContext&&(x.current==null||x.current({...Z.current.floatingContext,tree:he,x:Ie.clientX,y:Ie.clientY,onClose(){Se(),G(),Be()||se(Ie)}})(Ie))}},[oe,I,P,Ae,Pe,Te,se,G,Se,q,W,N,he,j,x,Z,Be]),Je(()=>{var Ee;if(I&&W&&(Ee=x.current)!=null&&Ee.__options.blockPointerEvents&&ge()){z.current=!0;const we=oe.floating;if(Ze(oe.domReference)&&we){var ue;const De=kt(oe.floating).body;De.setAttribute(Ic,"");const Ie=oe.domReference,qe=he==null||(ue=he.nodesRef.current.find(qt=>qt.id===C))==null||(ue=ue.context)==null?void 0:ue.elements.floating;return qe&&(qe.style.pointerEvents=""),De.style.pointerEvents="none",Ie.style.pointerEvents="auto",we.style.pointerEvents="auto",()=>{De.style.pointerEvents="",Ie.style.pointerEvents="",we.style.pointerEvents=""}}}},[I,W,C,oe,he,x,ge]),Je(()=>{W||(L.current=void 0,le.current=!1,G(),Se())},[W,G,Se]),D.useEffect(()=>()=>{G(),clearTimeout(ne.current),clearTimeout($.current),Se()},[I,oe.domReference,G,Se]);const Oe=D.useMemo(()=>{function Ee(ue){L.current=ue.pointerType}return{onPointerDown:Ee,onPointerEnter:Ee,onMouseMove(ue){const{nativeEvent:we}=ue;function De(){V.current||N.current||q(!0,we,"hover")}Ae&&!Xo(L.current)||W||Pe===0||le.current&&ue.movementX**2+ue.movementY**2<2||(clearTimeout($.current),L.current==="touch"?De():(le.current=!0,$.current=window.setTimeout(De,Pe)))}}},[Ae,q,W,N,Pe]),je=D.useMemo(()=>({onMouseEnter(){clearTimeout(ne.current)},onMouseLeave(Ee){Be()||se(Ee.nativeEvent,!1)}}),[se,Be]);return D.useMemo(()=>I?{reference:Oe,floating:je}:{},[I,Oe,je])}(U,{enabled:O,delay:{open:75},handleClose:Qm({blockPointerEvents:!0})}),me=function(P,T){T===void 0&&(T={});const{open:W,onOpenChange:q,dataRef:Z,elements:{domReference:ie}}=P,{enabled:oe=!0,event:I="click",toggle:Ce=!0,ignoreMouse:ke=!1,keyboardHandlers:Ae=!0,stickIfOpen:Pe=!0}=T,Te=D.useRef(),he=D.useRef(!1),C=D.useMemo(()=>({onPointerDown(x){Te.current=x.pointerType},onMouseDown(x){const j=Te.current;x.button===0&&I!=="click"&&(Xo(j,!0)&&ke||(!W||!Ce||Z.current.openEvent&&Pe&&Z.current.openEvent.type!=="mousedown"?(x.preventDefault(),q(!0,x.nativeEvent,"click")):q(!1,x.nativeEvent,"click")))},onClick(x){const j=Te.current;I==="mousedown"&&Te.current?Te.current=void 0:Xo(j,!0)&&ke||(!W||!Ce||Z.current.openEvent&&Pe&&Z.current.openEvent.type!=="click"?q(!0,x.nativeEvent,"click"):q(!1,x.nativeEvent,"click"))},onKeyDown(x){Te.current=void 0,x.defaultPrevented||!Ae||Rc(x)||(x.key!==" "||Fc(ie)||(x.preventDefault(),he.current=!0),x.key==="Enter"&&q(!W||!Ce,x.nativeEvent,"click"))},onKeyUp(x){x.defaultPrevented||!Ae||Rc(x)||Fc(ie)||x.key===" "&&he.current&&(he.current=!1,q(!W||!Ce,x.nativeEvent,"click"))}}),[Z,ie,I,ke,Ae,q,W,Pe,Ce]);return D.useMemo(()=>oe?{reference:C}:{},[oe,C])}(U,{event:"mousedown",toggle:!O,ignoreMouse:O}),de=function(P,T){var W;T===void 0&&(T={});const{open:q,floatingId:Z}=P,{enabled:ie=!0,role:oe="dialog"}=T,I=(W=Xm.get(oe))!=null?W:oe,Ce=Ta(),ke=Nn()!=null,Ae=D.useMemo(()=>I==="tooltip"||oe==="label"?{["aria-"+(oe==="label"?"labelledby":"describedby")]:q?Z:void 0}:{"aria-expanded":q?"true":"false","aria-haspopup":I==="alertdialog"?"dialog":I,"aria-controls":q?Z:void 0,...I==="listbox"&&{role:"combobox"},...I==="menu"&&{id:Ce},...I==="menu"&&ke&&{role:"menuitem"},...oe==="select"&&{"aria-autocomplete":"none"},...oe==="combobox"&&{"aria-autocomplete":"list"}},[I,Z,ke,q,Ce,oe]),Pe=D.useMemo(()=>{const he={id:Z,...I&&{role:I}};return I==="tooltip"||oe==="label"?he:{...he,...I==="menu"&&{"aria-labelledby":Ce}}},[I,Z,Ce,oe]),Te=D.useCallback(he=>{let{active:C,selected:x}=he;const j={role:"option",...C&&{id:Z+"-option"}};switch(oe){case"select":return{...j,"aria-selected":C&&x};case"combobox":return{...j,...C&&{"aria-selected":!0}}}return{}},[Z,oe]);return D.useMemo(()=>ie?{reference:Ae,floating:Pe,item:Te}:{},[ie,Ae,Pe,Te])}(U,{role:"menu"}),re=function(P,T){T===void 0&&(T={});const{open:W,onOpenChange:q,elements:Z,dataRef:ie}=P,{enabled:oe=!0,escapeKey:I=!0,outsidePress:Ce=!0,outsidePressEvent:ke="pointerdown",referencePress:Ae=!1,referencePressEvent:Pe="pointerdown",ancestorScroll:Te=!1,bubbles:he,capture:C}=T,x=In(),j=At(typeof Ce=="function"?Ce:()=>!1),N=typeof Ce=="function"?j:Ce,L=D.useRef(!1),ne=D.useRef(!1),{escapeKey:ve,outsidePress:$}=Bc(he),{escapeKey:V,outsidePress:z}=Bc(C),te=D.useRef(!1),le=At(Oe=>{var je;if(!W||!oe||!I||Oe.key!=="Escape"||te.current)return;const Ee=(je=ie.current.floatingContext)==null?void 0:je.nodeId,ue=x?Xn(x.nodesRef.current,Ee):[];if(!ve&&(Oe.stopPropagation(),ue.length>0)){let we=!0;if(ue.forEach(De=>{var Ie;(Ie=De.context)==null||!Ie.open||De.context.dataRef.current.__escapeKeyBubbles||(we=!1)}),!we)return}q(!1,function(we){return"nativeEvent"in we}(Oe)?Oe.nativeEvent:Oe,"escape-key")}),ge=At(Oe=>{var je;const Ee=()=>{var ue;le(Oe),(ue=Cn(Oe))==null||ue.removeEventListener("keydown",Ee)};(je=Cn(Oe))==null||je.addEventListener("keydown",Ee)}),se=At(Oe=>{var je;const Ee=L.current;L.current=!1;const ue=ne.current;if(ne.current=!1,ke==="click"&&ue||Ee||typeof N=="function"&&!N(Oe))return;const we=Cn(Oe),De="["+ur("inert")+"]",Ie=kt(Z.floating).querySelectorAll(De);let qe=Ze(we)?we:null;for(;qe&&!Pn(qe);){const Ut=mn(qe);if(Pn(Ut)||!Ze(Ut))break;qe=Ut}if(Ie.length&&Ze(we)&&!we.matches("html,body")&&!vt(we,Z.floating)&&Array.from(Ie).every(Ut=>!vt(qe,Ut)))return;if(dt(we)&&Be){const Ut=we.clientWidth>0&&we.scrollWidth>we.clientWidth,bn=we.clientHeight>0&&we.scrollHeight>we.clientHeight;let Bo=bn&&Oe.offsetX>we.clientWidth;if(bn&&Gt(we).direction==="rtl"&&(Bo=Oe.offsetX<=we.offsetWidth-we.clientWidth),Bo||Ut&&Oe.offsetY>we.clientHeight)return}const qt=(je=ie.current.floatingContext)==null?void 0:je.nodeId,hc=x&&Xn(x.nodesRef.current,qt).some(Ut=>{var bn;return Vi(Oe,(bn=Ut.context)==null?void 0:bn.elements.floating)});if(Vi(Oe,Z.floating)||Vi(Oe,Z.domReference)||hc)return;const mc=x?Xn(x.nodesRef.current,qt):[];if(mc.length>0){let Ut=!0;if(mc.forEach(bn=>{var Bo;(Bo=bn.context)==null||!Bo.open||bn.context.dataRef.current.__outsidePressBubbles||(Ut=!1)}),!Ut)return}q(!1,Oe,"outside-press")}),G=At(Oe=>{var je;const Ee=()=>{var ue;se(Oe),(ue=Cn(Oe))==null||ue.removeEventListener(ke,Ee)};(je=Cn(Oe))==null||je.addEventListener(ke,Ee)});D.useEffect(()=>{if(!W||!oe)return;ie.current.__escapeKeyBubbles=ve,ie.current.__outsidePressBubbles=$;let Oe=-1;function je(Ie){q(!1,Ie,"ancestor-scroll")}function Ee(){window.clearTimeout(Oe),te.current=!0}function ue(){Oe=window.setTimeout(()=>{te.current=!1},yi()?5:0)}const we=kt(Z.floating);I&&(we.addEventListener("keydown",V?ge:le,V),we.addEventListener("compositionstart",Ee),we.addEventListener("compositionend",ue)),N&&we.addEventListener(ke,z?G:se,z);let De=[];return Te&&(Ze(Z.domReference)&&(De=An(Z.domReference)),Ze(Z.floating)&&(De=De.concat(An(Z.floating))),!Ze(Z.reference)&&Z.reference&&Z.reference.contextElement&&(De=De.concat(An(Z.reference.contextElement)))),De=De.filter(Ie=>{var qe;return Ie!==((qe=we.defaultView)==null?void 0:qe.visualViewport)}),De.forEach(Ie=>{Ie.addEventListener("scroll",je,{passive:!0})}),()=>{I&&(we.removeEventListener("keydown",V?ge:le,V),we.removeEventListener("compositionstart",Ee),we.removeEventListener("compositionend",ue)),N&&we.removeEventListener(ke,z?G:se,z),De.forEach(Ie=>{Ie.removeEventListener("scroll",je)}),window.clearTimeout(Oe)}},[ie,Z,I,N,ke,W,q,Te,oe,ve,$,le,V,ge,se,z,G]),D.useEffect(()=>{L.current=!1},[N,ke]);const Se=D.useMemo(()=>({onKeyDown:le,[Ym[Pe]]:Oe=>{Ae&&q(!1,Oe.nativeEvent,"reference-press")}}),[le,q,Ae,Pe]),Be=D.useMemo(()=>({onKeyDown:le,onMouseDown(){ne.current=!0},onMouseUp(){ne.current=!0},[Zm[ke]]:()=>{L.current=!0}}),[le,ke]);return D.useMemo(()=>oe?{reference:Se,floating:Be}:{},[oe,Se,Be])}(U,{bubbles:!0}),ye=Jm(U,{listRef:v,activeIndex:h,nested:O,onNavigate:m}),{getReferenceProps:pe,getFloatingProps:xe,getItemProps:ae}=function(P){P===void 0&&(P=[]);const T=P.map(I=>I==null?void 0:I.reference),W=P.map(I=>I==null?void 0:I.floating),q=P.map(I=>I==null?void 0:I.item),Z=D.useCallback(I=>Qi(I,P,"reference"),T),ie=D.useCallback(I=>Qi(I,P,"floating"),W),oe=D.useCallback(I=>Qi(I,P,"item"),q);return D.useMemo(()=>({getReferenceProps:Z,getFloatingProps:ie,getItemProps:oe}),[Z,ie,oe])}([A,me,de,re,ye]);g.useEffect(()=>{if(S)return S.events.on("click",P),S.events.on("menuopen",T),()=>{S.events.off("click",P),S.events.off("menuopen",T)};function P(){f(!1)}function T(W){W.nodeId!==b&&W.parentId===w&&f(!1)}},[S,b,w]),g.useEffect(()=>{u&&S&&S.events.emit("menuopen",{parentId:w,nodeId:b})},[S,u,b,w]);const B={activeIndex:h,setActiveIndex:m,getItemProps:ae,setHasFocusInside:p,isOpen:u,setIsOpen:f},X=g.useMemo(()=>B,[h,m,ae,p,u]),Y=ee("io-dropdown-menu-button",O&&"io-dropdown-menu-item",u&&!O&&"active",t),J=Au([R.setReference,E.ref,l]),H=k.activeIndex===E.index?0:-1;return s.jsxs(Wm,{id:b,children:[s.jsx(Ye,{className:Y,ref:J,variant:O?"link":n,tabIndex:O?H:void 0,role:O?"menuitem":void 0,"data-open":u?"":void 0,"data-nested":O?"":void 0,"data-focus-inside":d?"":void 0,text:r,icon:O?"chevron-right":e,iconSize:"10",iconRight:!!O||o,disabled:i,...pe(k.getItemProps({onFocus(P){var T;(T=c.onFocus)==null||T.call(c,P),p(!1),k.setHasFocusInside(!0)},...c}))}),s.jsx(Ma.Provider,{value:X,children:s.jsx(Bm,{elementsRef:v,labelsRef:y,children:u&&s.jsx(Gm,{context:U,modal:!1,initialFocus:O?-1:0,returnFocus:!O,children:s.jsx("div",{ref:R.setFloating,className:"io-dropdown-menu",style:F,...xe(),children:a})})})})]})});_a.displayName="DropdownMenu";const Xt=g.forwardRef(({...t},n)=>Nn()===null?s.jsx($m,{children:s.jsx(_a,{ref:n,...t})}):s.jsx(_a,{ref:n,...t}));function Wu({className:t,variant:n="default",size:e="16",src:o,alt:r,...i}){const a=ee("io-image-icon",n==="grayscale"&&[`io-image-icon-${n}`],e&&[`io-image-icon-${e}`],t);return s.jsx("img",{className:a,style:{width:`${e}px`,filter:n==="grayscale"?"grayscale(100%)":"none"},src:o,alt:r,...i})}function eg({className:t,size:n="large",variant:e="default",align:o="up",text:r,...i}){const a=ee("io-loader",{[`io-loader-${e}`]:e!=="default"},n==="normal"&&"io-loader-md",n==="small"&&"io-loader-sm",o&&[`direction-${o}`],t);return s.jsxs("div",{className:a,role:"status","aria-live":"polite",...i,children:[s.jsx("div",{className:"io-loader-icon"}),r&&s.jsx("div",{className:"io-loader-text",children:r})]})}function En({className:t,children:n,...e}){const o=ee("io-panel-header",t);return s.jsx(Bt,{className:o,...e,children:n})}Xt.displayName="DropdownMenu",Xt.Item=Hu,Xt.Separator=wr,En.Title=sn,En.ButtonGroup=Re,En.Button=Ye,En.ButtonIcon=Ve,En.Dropdown=fe;const Oo=g.forwardRef(({className:t,children:n,...e},o)=>{const r=ee("io-panel-body",t);return s.jsx("div",{className:r,ref:o,"data-testid":"panel-body",...e,children:n})});function go({className:t,...n}){const e=ee("io-panel-footer",t);return s.jsx(Zn,{className:e,...n})}function Ge({className:t,children:n,...e}){const o=ee("io-panel",t);return s.jsx("div",{className:o,"data-testid":"panel",...e,children:n})}function ki({className:t,variant:n="default",children:e,...o}){const r=ee("io-pill",n!=="default"&&[`io-pill-${n}`],t);return s.jsx("div",{className:r,role:"status",...o,children:e})}function tg({className:t,variant:n="active",value:e=0,...o}){const r=ee("io-progress",n,t);let i;return i=e<0?0:e>100?100:e,s.jsx("div",{className:r,role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,...o,children:s.jsx("div",{className:"io-progress-bar",style:{width:`${i}%`}})})}function Si({text:t="Label",...n}){return s.jsx("label",{...n,children:t})}Oo.displayName="PanelBody",go.ButtonGroup=Re,go.Button=Ye,go.ButtonIcon=Ve,go.Dropdown=fe,Ge.Header=En,Ge.Body=Oo,Ge.Footer=go,ki.Icon=ot;const no=g.forwardRef(({id:t="input",className:n,type:e="text",name:o="input",align:r="up",label:i,iconPrepend:a,iconPrependOnClick:c,iconAppend:l,iconAppendOnClick:u,placeholder:f,disabled:d,readOnly:p,errorMessage:h,errorDataTestId:m,...v},y)=>{const k=ee("io-control-input",a&&"io-control-leading-icon",l&&"io-control-trailing-icon",d&&"io-control-disabled",p&&"io-control-readonly",h&&"io-control-error",r&&[`direction-${r}`],n),S=g.useCallback(w=>{d?w.preventDefault():c&&c(w)},[c,d]),b=g.useCallback(w=>{d?w.preventDefault():u&&u(w)},[u,d]);return s.jsxs("div",{className:k,children:[i&&s.jsx(Si,{htmlFor:t,text:i}),a&&s.jsx(ot,{variant:a,onClick:w=>S(w)}),s.jsx("input",{id:t,className:"io-input",ref:y,type:e,name:o,tabIndex:0,placeholder:f??(()=>{switch(e){case"email":return"Enter your email here...";case"number":return"Enter number here...";case"password":return"Enter your password here...";case"tel":return"Enter your phone number here...";case"file":return"Select a file...";default:return"Enter text here..."}})(),"aria-label":i,disabled:d,readOnly:p,...h?{"aria-invalid":!0,"aria-describedby":`${t}-error`}:{},...v}),l&&s.jsx(ot,{variant:l,onClick:w=>b(w)}),h&&s.jsxs("div",{"data-testid":m,id:`${t}-error`,className:"io-input-error",children:[s.jsx(ot,{variant:"close"}),h]})]})});no.displayName="Input";const Ei=g.forwardRef(({id:t="textarea",className:n,name:e="textarea",align:o="up",label:r,rows:i=4,placeholder:a="Enter text here...",disabled:c,readOnly:l,...u},f)=>{const d=ee("io-control-textarea",c&&"io-control-disabled",l&&"io-control-readonly",o&&[`direction-${o}`],n);return s.jsxs("div",{className:d,children:[r&&s.jsx(Si,{htmlFor:t,text:r}),s.jsx("textarea",{id:t,className:"io-textarea",ref:f,name:e,tabIndex:0,placeholder:a,"aria-label":r,disabled:c,readOnly:l,rows:i,...u})]})});Ei.displayName="Textarea";const ji=g.forwardRef(({id:t="checkbox",className:n,name:e="checkbox",align:o="left",label:r,checked:i,disabled:a,...c},l)=>{const u=ee("io-control-checkbox",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsxs("div",{className:u,children:[s.jsx("input",{type:"checkbox",id:t,className:"io-checkbox",ref:l,name:e,tabIndex:a?-1:0,checked:i,disabled:a,"aria-checked":i,...c}),r&&s.jsx(Si,{htmlFor:t,text:r,"data-testid":c["data-testid"]?`${c["data-testid"]}-label`:void 0})]})});ji.displayName="Checkbox";const ng=g.forwardRef(({id:t="radio",className:n,name:e="radio",align:o="left",label:r,checked:i,disabled:a,...c},l)=>{const u=ee("io-control-radio",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsxs("div",{className:u,children:[s.jsx("input",{type:"radio",id:t,className:"io-radio",ref:l,name:e,tabIndex:a?-1:0,checked:i,disabled:a,"aria-checked":i,...c}),r&&s.jsx(Si,{htmlFor:t,text:r})]})});ng.displayName="Radio";const ft=g.forwardRef(({id:t,className:n,name:e="toggle",align:o="left",label:r,checked:i,disabled:a,onKeyDown:c,"data-testid":l="toggle",...u},f)=>{const d=g.useId(),p=t||`toggle-${d}`,h=ee("io-control-toggle",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsx("div",{className:h,children:s.jsxs("label",{className:"io-toggle",htmlFor:p,tabIndex:a?-1:0,onKeyDown:c,"data-testid":`${l}-label`,children:[s.jsx("input",{type:"checkbox",id:p,className:"io-checkbox",ref:f,name:e,checked:i,disabled:a,"aria-checked":i,tabIndex:-1,"data-testid":l,...u}),s.jsx("span",{className:"slider","data-testid":`${l}-slider`}),r]})})});function $u(t,n=500){const[e,o]=g.useState(t);return g.useEffect(()=>{const r=setTimeout(()=>{o(t)},n);return()=>clearTimeout(r)},[t,n]),e}function og(t,n){g.useEffect(()=>{const e=o=>{o.code===t&&n()};return document.addEventListener("keyup",e),()=>document.removeEventListener("keyup",e)},[t,n])}ft.displayName="Toggle";const Oi=()=>window.glue42gd!==void 0||window.iodesktop!==void 0;function We(){return g.useMemo(()=>typeof window=="object"&&Oi(),[])}g.createContext({theme:"dark"});const Gc="io-connect-platform",Un="___platform_prefs___",rg="_launchpad_collapsedSections",ig="_launchpad_favorites",ag="_launchpad_isLayoutsPanelOpen",sg="_launchpad_isCollapsed",La="_launchpad_isPinned",zu="_launchpad_pinnedPosition",Uu="_launchpad_allowDocking",Vu="_launchpad_minimizeToTray",Gu="_launchpad_autoCloseStartingAppsAndWorkspaces",Yu="_launchpad_showTutorialOnStartup",Zu="_layouts_restoreLastSaved",Ku="_layouts_saveCurrentOnExit",qu="_layouts_showUnsavedChangesPrompt",Ju="_layouts_showDeletePrompt",Xu="_downloads_askForEachDownload",cg="_downloads_location",lg="_system_scheduleRestart",ug="_system_scheduleRestartTime",dg="_system_scheduleRestartFrequency",fg="_system_scheduleRestartDay",pg="_system_scheduleShutdown",hg="_system_scheduleShutdownTime",mg="_system_scheduleShutdownFrequency",gg="_system_scheduleShutdownDay",vg={[rg]:[],[ig]:[],[ag]:!1,[sg]:!1,[La]:!1,[zu]:"Left",[Uu]:!0,[Vu]:!1,[Gu]:!0,[Yu]:!0,[Zu]:!0,[Ku]:!0,[qu]:!0,[Ju]:!0,[Xu]:!0,[cg]:"",[lg]:!1,[ug]:"12:00 AM",[dg]:"daily",[fg]:"Monday",[pg]:!1,[hg]:"12:00 AM",[mg]:"daily",[gg]:"Monday"},Vn=t=>typeof t=="string"?t:t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):JSON.stringify(t),xs="warning",yg={success:5e3,warning:1e4};var ht=function(t){return{ok:!0,result:t}},it=function(t){return{ok:!1,error:t}},Yc=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:ht(t(n.result,e.result))},ta=function(t,n){return n.ok===!0?n:it(t(n.error))},Ra=function(){return Ra=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Ra.apply(this,arguments)};function Fa(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!Fa(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!Fa(t[o[e]],n[o[e]]))return!1;return!0}}var Qo=function(t){return Array.isArray(t)},Ar=function(t){return typeof t=="object"&&t!==null&&!Qo(t)},un=function(t,n){return"expected "+t+", got "+function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":e===null?"null":"an object";default:return JSON.stringify(e)}}(n)},$o=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},zo=function(t,n){var e=n.at,o=function(r,i){var a={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&i.indexOf(c)<0&&(a[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(c=Object.getOwnPropertySymbols(r);l<c.length;l++)i.indexOf(c[l])<0&&Object.prototype.propertyIsEnumerable.call(r,c[l])&&(a[c[l]]=r[c[l]])}return a}(n,["at"]);return Ra({at:t+(e||"")},o)},ct=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return ta(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return(r=e.run(o)).ok===!0?Promise.resolve(r.result):Promise.reject(r.error);var r},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(e.run(o))},this.map=function(o){return new t(function(r){return function(i,a){return a.ok===!0?ht(i(a.result)):a}(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?ht(n):it({message:un("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?ht(n):it({message:un("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?ht(n):it({message:un("a boolean",n)})})},t.constant=function(n){return new t(function(e){return Fa(e,n)?ht(n):it({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Ar(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok!==!0)return e[r]===void 0?it({message:"the key '"+r+"' is required but was not present"}):it(zo("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return ht(o)}return Ar(e)?ht(e):it({message:un("an object",e)})})},t.array=function(n){return new t(function(e){return Qo(e)&&n?e.reduce(function(o,r,i){return Yc(function(a,c){return a.concat([c])},o,function(a,c){return ta(function(l){return zo("["+c+"]",l)},n.decode(a))}(r,i))},ht([])):Qo(e)?ht(e):it({message:un("an array",e)})})},t.tuple=function(n){return new t(function(e){if(Qo(e)){if(e.length!==n.length)return it({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(!i.ok)return it(zo("["+r+"]",i.error));o[r]=i.result}return ht(o)}return it({message:un("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return Yc(Object.assign,a,c.decode(i))},ht({}))})},t.anyJson=function(){return new t(function(n){return ht(n)})},t.unknownJson=function(){return new t(function(n){return ht(n)})},t.dict=function(n){return new t(function(e){if(Ar(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok!==!0)return it(zo("."+r,i.error));o[r]=i.result}return ht(o)}return it({message:un("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?ht(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return it({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return ht(function(r,i){return i.ok===!0?i.result:r}(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return it({at:$o(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Ar(r))return it({at:$o(n.slice(0,i+1)),message:un("an object",r)});if(typeof n[i]=="number"&&!Qo(r))return it({at:$o(n.slice(0,i+1)),message:un("an array",r)});r=r[n[i]]}return ta(function(a){return r===void 0?{at:$o(n),message:"path does not exist"}:zo($o(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return ht(n)})},t.fail=function(n){return new t(function(e){return it({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),Qu=ct.string;ct.number;var Pt=ct.boolean,ed=ct.anyJson;ct.unknownJson;var M=ct.constant,td=ct.object,Ba=ct.array;ct.tuple,ct.dict;var Ue=ct.optional,Ni=ct.oneOf;ct.union,ct.intersection,ct.withDefault,ct.valueAt,ct.succeed,ct.fail,ct.lazy;const Zc=["name","title","version","customProperties","icon","caption","type"],wg=["appId","name","type","details","version","title","tooltip","lang","description","categories","icons","screenshots","contactEmail","moreInfo","publisher","customConfig","hostManifests","interop","localizedVersions"];var mt=function(t){return{ok:!0,result:t}},at=function(t){return{ok:!1,error:t}},Kc=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:mt(t(n.result,e.result))},na=function(t,n){return n.ok===!0?n:at(t(n.error))},Ha=function(){return Ha=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Ha.apply(this,arguments)};function Wa(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!Wa(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!Wa(t[o[e]],n[o[e]]))return!1;return!0}}var er=function(t){return Array.isArray(t)},Tr=function(t){return typeof t=="object"&&t!==null&&!er(t)},dn=function(t,n){return"expected "+t+", got "+function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":e===null?"null":"an object";default:return JSON.stringify(e)}}(n)},Uo=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},Vo=function(t,n){var e=n.at,o=function(r,i){var a={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&i.indexOf(c)<0&&(a[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(c=Object.getOwnPropertySymbols(r);l<c.length;l++)i.indexOf(c[l])<0&&Object.prototype.propertyIsEnumerable.call(r,c[l])&&(a[c[l]]=r[c[l]])}return a}(n,["at"]);return Ha({at:t+(e||"")},o)},lt=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return na(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return(r=e.run(o)).ok===!0?Promise.resolve(r.result):Promise.reject(r.error);var r},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(e.run(o))},this.map=function(o){return new t(function(r){return function(i,a){return a.ok===!0?mt(i(a.result)):a}(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?mt(n):at({message:dn("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?mt(n):at({message:dn("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?mt(n):at({message:dn("a boolean",n)})})},t.constant=function(n){return new t(function(e){return Wa(e,n)?mt(n):at({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Tr(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok!==!0)return e[r]===void 0?at({message:"the key '"+r+"' is required but was not present"}):at(Vo("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return mt(o)}return Tr(e)?mt(e):at({message:dn("an object",e)})})},t.array=function(n){return new t(function(e){return er(e)&&n?e.reduce(function(o,r,i){return Kc(function(a,c){return a.concat([c])},o,function(a,c){return na(function(l){return Vo("["+c+"]",l)},n.decode(a))}(r,i))},mt([])):er(e)?mt(e):at({message:dn("an array",e)})})},t.tuple=function(n){return new t(function(e){if(er(e)){if(e.length!==n.length)return at({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(!i.ok)return at(Vo("["+r+"]",i.error));o[r]=i.result}return mt(o)}return at({message:dn("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return Kc(Object.assign,a,c.decode(i))},mt({}))})},t.anyJson=function(){return new t(function(n){return mt(n)})},t.unknownJson=function(){return new t(function(n){return mt(n)})},t.dict=function(n){return new t(function(e){if(Tr(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok!==!0)return at(Vo("."+r,i.error));o[r]=i.result}return mt(o)}return at({message:dn("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?mt(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return at({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return mt(function(r,i){return i.ok===!0?i.result:r}(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return at({at:Uo(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Tr(r))return at({at:Uo(n.slice(0,i+1)),message:dn("an object",r)});if(typeof n[i]=="number"&&!er(r))return at({at:Uo(n.slice(0,i+1)),message:dn("an array",r)});r=r[n[i]]}return na(function(a){return r===void 0?{at:Uo(n),message:"path does not exist"}:Vo(Uo(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return mt(n)})},t.fail=function(n){return new t(function(e){return at({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),dr=lt.string,$a=lt.number,bg=lt.boolean,oo=lt.anyJson;lt.unknownJson;var Go=lt.constant,wt=lt.object,rt=lt.array;lt.tuple;var za=lt.dict,ce=lt.optional,nd=lt.oneOf;lt.union,lt.intersection,lt.withDefault,lt.valueAt,lt.succeed,lt.fail,lt.lazy;const be=dr().where(t=>t.length>0,"Expected a non-empty string"),Ua=$a().where(t=>t>=0,"Expected a non-negative number"),od=wt({name:be,displayName:ce(dr()),contexts:ce(rt(dr())),customConfig:ce(wt())}),xg=nd(Go("web"),Go("native"),Go("citrix"),Go("onlineNative"),Go("other")),rd=wt({url:be}),id=wt({src:be,size:ce(be),type:ce(be)}),ad=wt({src:be,size:ce(be),type:ce(be),label:ce(be)}),Cg=wt({contexts:rt(be),displayName:ce(be),resultType:ce(be),customConfig:ce(oo())}),kg=wt({listensFor:ce(za(Cg)),raises:ce(za(rt(be)))}),Sg=wt({broadcasts:ce(rt(be)),listensFor:ce(rt(be))}),Eg=wt({name:be,description:ce(be),broadcasts:ce(rt(be)),listensFor:ce(rt(be))}),sd=wt({intents:ce(kg),userChannels:ce(Sg),appChannels:ce(rt(Eg))}),jg=wt({url:ce(be),top:ce($a()),left:ce($a()),width:ce(Ua),height:ce(Ua)}),Og=wt({name:ce(be),type:ce(be.where(t=>t==="window","Expected a value of window")),title:ce(be),version:ce(be),customProperties:ce(oo()),icon:ce(dr()),caption:ce(dr()),details:ce(jg),intents:ce(rt(od)),hidden:ce(bg())}),cd=wt({name:be,appId:be,title:ce(be),version:ce(be),manifest:be,manifestType:be,tooltip:ce(be),description:ce(be),contactEmail:ce(be),supportEmail:ce(be),publisher:ce(be),images:ce(rt(wt({url:ce(be)}))),icons:ce(rt(wt({icon:ce(be)}))),customConfig:oo(),intents:ce(rt(od))}),Ng=wt({appId:ce(be),name:ce(be),details:ce(rd),version:ce(be),title:ce(be),tooltip:ce(be),lang:ce(be),description:ce(be),categories:ce(rt(be)),icons:ce(rt(id)),screenshots:ce(rt(ad)),contactEmail:ce(be),supportEmail:ce(be),moreInfo:ce(be),publisher:ce(be),customConfig:ce(rt(oo())),hostManifests:ce(oo()),interop:ce(sd)}),ld=wt({appId:be,name:ce(be),type:xg,details:rd,version:ce(be),title:ce(be),tooltip:ce(be),lang:ce(be),description:ce(be),categories:ce(rt(be)),icons:ce(rt(id)),screenshots:ce(rt(ad)),contactEmail:ce(be),supportEmail:ce(be),moreInfo:ce(be),publisher:ce(be),customConfig:ce(rt(oo())),hostManifests:ce(oo()),interop:ce(sd),localizedVersions:ce(za(Ng))}),Vr=nd(cd,ld),Dr=t=>`${t.kind} at ${t.at}: ${JSON.stringify(t.input)}. Reason - ${t.message}`;class Ig{constructor(){It(this,"fdc3ToDesktopDefinitionType",{web:"window",native:"exe",citrix:"citrix",onlineNative:"clickonce",other:"window"})}toApi(){return{isFdc3Definition:this.isFdc3Definition.bind(this),parseToBrowserBaseAppData:this.parseToBrowserBaseAppData.bind(this),parseToDesktopAppConfig:this.parseToDesktopAppConfig.bind(this)}}isFdc3Definition(n){const e=Vr.run(n);return e.ok?n.appId&&n.details?{isFdc3:!0,version:"2.0"}:n.manifest?{isFdc3:!0,version:"1.2"}:{isFdc3:!1,reason:"The passed definition is not FDC3"}:{isFdc3:!1,reason:Dr(e.error)}}parseToBrowserBaseAppData(n){var f,d;const{isFdc3:e,version:o}=this.isFdc3Definition(n);if(!e)throw new Error("The passed definition is not FDC3");const r=Vr.run(n);if(!r.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Dr(r.error)}`);const i=this.getUserPropertiesFromDefinition(n,o),a={url:this.getUrl(n,o)},c={name:n.appId,type:"window",createOptions:a,userProperties:{...i,intents:o==="1.2"?i.intents:this.getIntentsFromV2AppDefinition(n),details:a},title:n.title,version:n.version,icon:this.getIconFromDefinition(n,o),caption:n.description,fdc3:o==="2.0"?{...n,definitionVersion:"2.0"}:void 0},l=((f=n.hostManifests)==null?void 0:f.ioConnect)||((d=n.hostManifests)==null?void 0:d.Glue42);if(!l)return c;const u=Og.run(l);if(!u.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Dr(u.error)}`);return Object.keys(u.result).length?this.mergeBaseAppDataWithGlueManifest(c,u.result):c}parseToDesktopAppConfig(n){var l,u,f;const{isFdc3:e,version:o}=this.isFdc3Definition(n);if(!e)throw new Error("The passed definition is not FDC3");const r=Vr.run(n);if(!r.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Dr(r.error)}`);if(o==="1.2"){const d=n;return{name:d.appId,type:"window",details:{url:this.getUrl(n,o)},version:d.version,title:d.title,tooltip:d.tooltip,caption:d.description,icon:(l=d.icons)==null?void 0:l[0].icon,intents:d.intents,customProperties:{manifestType:d.manifestType,images:d.images,contactEmail:d.contactEmail,supportEmail:d.supportEmail,publisher:d.publisher,icons:d.icons,customConfig:d.customConfig}}}const i=n,a={name:i.appId,type:this.fdc3ToDesktopDefinitionType[i.type],details:i.details,version:i.version,title:i.title,tooltip:i.tooltip,caption:i.description,icon:this.getIconFromDefinition(i,"2.0"),intents:this.getIntentsFromV2AppDefinition(i),fdc3:{...i,definitionVersion:"2.0"}},c=((u=n.hostManifests)==null?void 0:u.ioConnect)||((f=n.hostManifests)==null?void 0:f.Glue42);if(!c)return a;if(typeof c!="object"||Array.isArray(c))throw new Error(`Invalid '${n.hostManifests.ioConnect?"hostManifests.ioConnect":"hostManifests['Glue42']"}' key`);return this.mergeDesktopConfigWithGlueManifest(a,c)}getUserPropertiesFromDefinition(n,e){return Object.fromEntries(e==="1.2"?Object.entries(n).filter(([o])=>!Zc.includes(o)):Object.entries(n).filter(([o])=>!Zc.includes(o)&&!wg.includes(o)))}getUrl(n,e){var r,i;let o;if(e==="1.2"){const a=JSON.parse(n.manifest);o=((r=a.details)==null?void 0:r.url)||a.url}else o=(i=n.details)==null?void 0:i.url;if(!o||typeof o!="string")throw new Error(`Invalid FDC3 ${e} definition. Provide valid 'url' under '${e==="1.2"?"manifest":"details"}' key`);return o}getIntentsFromV2AppDefinition(n){var o,r;const e=(r=(o=n.interop)==null?void 0:o.intents)==null?void 0:r.listensFor;if(e)return Object.entries(e).map(i=>{const[a,c]=i;return{name:a,...c}})}getIconFromDefinition(n,e){var o,r,i,a;return e==="1.2"?((r=(o=n.icons)==null?void 0:o.find(c=>c.icon))==null?void 0:r.icon)||void 0:((a=(i=n.icons)==null?void 0:i.find(c=>c.src))==null?void 0:a.src)||void 0}mergeBaseAppDataWithGlueManifest(n,e){let o=n;if(e.customProperties&&(o.userProperties={...n.userProperties,...e.customProperties}),e.details){const r={...n.createOptions,...e.details};o.createOptions=r,o.userProperties.details=r}return Array.isArray(e.intents)&&(o.userProperties.intents=(o.userProperties.intents||[]).concat(e.intents)),o={...o,...e},delete o.details,delete o.intents,o}mergeDesktopConfigWithGlueManifest(n,e){const o=Object.assign({},n,e,{details:{...n.details,...e.details}});return Array.isArray(e.intents)&&(o.intents=(n.intents||[]).concat(e.intents)),o}}const Pg={common:{nonEmptyStringDecoder:be,nonNegativeNumberDecoder:Ua},fdc3:{allDefinitionsDecoder:Vr,v1DefinitionDecoder:cd,v2DefinitionDecoder:ld}};var Va;(function(t){t.USER_CANCELLED="User Closed Intents Resolver UI without choosing a handler",t.CALLER_NOT_DEFINED="Caller Id is not defined",t.TIMEOUT_HIT="Timeout hit",t.INTENT_NOT_FOUND="Cannot find Intent",t.HANDLER_NOT_FOUND="Cannot find Intent Handler",t.TARGET_INSTANCE_UNAVAILABLE="Cannot start Target Instance",t.INTENT_DELIVERY_FAILED="Target Instance did not add a listener",t.RESOLVER_UNAVAILABLE="Intents Resolver UI unavailable",t.RESOLVER_TIMEOUT="User did not choose a handler",t.INVALID_RESOLVER_RESPONSE="Intents Resolver UI returned invalid response",t.INTENT_HANDLER_REJECTION="Intent Handler function processing the raised intent threw an error or rejected the promise it returned"})(Va||(Va={}));const Cs=new class{constructor(){It(this,"_fdc3");It(this,"_decoders",Pg);It(this,"_errors",{intents:Va})}get fdc3(){return this._fdc3||(this._fdc3=new Ig().toApi()),this._fdc3}get decoders(){return this._decoders}get errors(){return this._errors}};Cs.fdc3;const Ag=Cs.decoders;Cs.errors;const Kn=Ag.common.nonEmptyStringDecoder,Tg=Ni(M("add"),M("align-bottom"),M("align-bottom-solid"),M("align-left"),M("align-left-bottom"),M("align-left-bottom-solid"),M("align-left-solid"),M("align-left-top"),M("align-left-top-solid"),M("align-right"),M("align-right-bottom"),M("align-right-bottom-solid"),M("align-right-solid"),M("align-right-top"),M("align-right-top-solid"),M("align-top"),M("align-top-solid"),M("always-on-top"),M("always-on-top-on"),M("application"),M("arrow-down-long"),M("arrow-down-to-bracket"),M("arrow-left-long"),M("arrow-right-from-bracket"),M("arrow-right-long"),M("arrow-right"),M("arrow-up"),M("arrow-up-long"),M("ban"),M("bell"),M("bell-solid"),M("bookmark"),M("bullseye-pointer"),M("certificate"),M("check"),M("check-light"),M("check-solid"),M("chevron-down"),M("chevron-left"),M("chevron-right"),M("chevron-up"),M("circle-info"),M("circle-xmark"),M("circle-xmark-full"),M("clock"),M("clock-rotate-left"),M("clone"),M("close"),M("cog"),M("cog-solid"),M("collapse"),M("copy"),M("download"),M("delete-left"),M("dev-tools"),M("ellipsis"),M("ellipsis-vertical"),M("expand"),M("envelope"),M("envelope-open"),M("exclamation-mark"),M("expand"),M("feedback"),M("filter"),M("floppy"),M("floppy-disk-pen"),M("folder"),M("folder-open"),M("globe"),M("group"),M("hidden"),M("home"),M("house"),M("info"),M("keyboard"),M("layout"),M("link"),M("list-ul"),M("lock"),M("logo"),M("minimize"),M("minimize-down"),M("paper-plane-top"),M("paperclip"),M("pause"),M("pen-line"),M("pen-to-square"),M("pin"),M("play"),M("pop-in"),M("pop-in-widget"),M("pop-out"),M("power-off"),M("publish"),M("refresh"),M("resize"),M("restore"),M("rotate-right"),M("search"),M("search-filled"),M("sliders"),M("snooze"),M("spinner"),M("square"),M("square-arrow-down"),M("square-arrow-up"),M("star"),M("star-full"),M("sticky-off"),M("sticky-off-hover"),M("sticky-on"),M("sticky-on-hover"),M("subscribe"),M("system-close"),M("system-maximize"),M("system-minimize"),M("thumbs-down"),M("thumbs-up"),M("trash"),M("trash-can"),M("triangle-exclamation"),M("unlock"),M("unpin"),M("up-to-line"),M("user"),M("user-gear"),M("visible"),M("workspace")),Dg=td({id:Kn,title:Kn,description:Ue(Qu()),icon:Ue(Tg),iconSrc:Ue(Kn),contextMenuActions:Ue(Ba(ed())),type:Kn}),Mg=Ni(M("Left"),M("Right")),qc=Ni(M("daily"),M("weekly")),Jc=Ni(M("Sunday"),M("Monday"),M("Tuesday"),M("Wednesday"),M("Thursday"),M("Friday"),M("Saturday")),Gr=td({customPrefs:Ue(ed()),_launchpad_collapsedSections:Ue(Ba(Kn)),_launchpad_favorites:Ue(Ba(Dg)),_launchpad_isLayoutsPanelOpen:Ue(Pt()),_launchpad_isCollapsed:Ue(Pt()),_launchpad_isPinned:Ue(Pt()),_launchpad_pinnedPosition:Ue(Mg),_launchpad_allowDocking:Ue(Pt()),_launchpad_minimizeToTray:Ue(Pt()),_launchpad_autoCloseStartingAppsAndWorkspaces:Ue(Pt()),_launchpad_showTutorialOnStartup:Ue(Pt()),_layouts_restoreLastSaved:Ue(Pt()),_layouts_saveCurrentOnExit:Ue(Pt()),_layouts_showUnsavedChangesPrompt:Ue(Pt()),_layouts_showDeletePrompt:Ue(Pt()),_downloads_askForEachDownload:Ue(Pt()),_downloads_location:Ue(Qu()),_system_scheduleRestart:Ue(Pt()),_system_scheduleRestartTime:Ue(Kn),_system_scheduleRestartFrequency:Ue(qc),_system_scheduleRestartDay:Ue(Jc),_system_scheduleShutdown:Ue(Pt()),_system_scheduleShutdownTime:Ue(Kn),_system_scheduleShutdownFrequency:Ue(qc),_system_scheduleShutdownDay:Ue(Jc)}),ud=async t=>{const{io:n,variant:e,text:o,error:r}=t,i=Vn(r);try{if(e===xs&&n.logger.warn(i?`${o} ${i}`:o),!("modals"in n)||!n.modals)throw new Error("Modals are not enabled.");const a={text:o,variant:e,ttl:yg[e]};await n.modals.alerts.request(a)}catch(a){console.warn("Failed to request alert. ",{error:a})}},ks=g.createContext(void 0),Ii=({children:t,launchpadMode:n})=>{const[e,o]=g.useState(),[r,i]=g.useState(!1),[a,c]=g.useState(),l=g.useContext(Me.IOConnectContext),u=g.useMemo(()=>({prefs:e,isInitialSetupCompleted:r,initialSetupError:a}),[e,r,a]);return g.useEffect(()=>{if(!l)return;let f=!1;const d=l.contexts.subscribe(Un,p=>{if(f)return;const h=Gr.run(p);if(!h.ok)return void l.logger.warn(`The received data for context ${Un} is with an invalid shape: ${Vn(h.error.message)}`);const m=h.result;o(m),l.prefs.updateFor(Gc,m).catch(v=>{l.logger.warn(`Failed to update platform prefs. Error: ${Vn(v)}`)})});return()=>{f=!0,d.then(p=>{p()})}},[l]),g.useEffect(()=>{l&&(async()=>{var f;try{const d=await l.contexts.get(Un),p=Gr.run(d);if(!p.ok)throw new Error(`The data in context ${Un} is with an invalid shape: ${Vn(p.error.message)}`);const h=p.result;if(Object.keys(h).length>0)return;const m=((f=await l.prefs.get(Gc))==null?void 0:f.data)??{},v=Gr.run(m);if(!v.ok)throw new Error(`The stored platform prefs in io.prefs are with an invalid shape: ${Vn(v.error.message)}`);const y={[La]:n==="pinned"||(m[La]??!1)},k={...vg,...v.result,...y};await l.contexts.set(Un,k)}catch(d){c({message:Vn(d)}),await ud({io:l,variant:xs,text:"Initial platform prefs setup failed.",error:d})}finally{i(!0)}})().catch(console.error)},[l,n]),s.jsx(ks.Provider,{value:u,children:t})};function dd(){const t=g.useContext(ks);if(t===void 0)throw new Error("usePlatformPrefs must be used within a PlatformPrefsProvider");return t}function Wt({prefKey:t}){var d;const n=g.useContext(Me.IOConnectContext),e=g.useContext(ks),o=(d=e==null?void 0:e.prefs)==null?void 0:d[t],r=(e==null?void 0:e.isInitialSetupCompleted)??!1,[i,a]=g.useState(!r),[c,l]=g.useState(),u=g.useRef(0);g.useEffect(()=>{r&&u.current===0&&a(!1)},[r]);const f=g.useCallback(async p=>{if(!n)return;const h=++u.current;a(!0),l(void 0);const m=async y=>{y&&await ud({io:n,variant:xs,text:`Failed to update prefKey "${t}".`,error:y}),h===u.current&&(a(!1),y&&l({message:Vn(y)}))};let v;if(p instanceof Function)try{v=p((await n.contexts.get(Un))[t])}catch(y){return m(y)}else v=p;try{const y=Gr.runWithException({[t]:v});await n.contexts.update(Un,y)}catch(y){return m(y)}await m()},[n,t]);if(e===void 0)throw new Error("usePlatformPref must be used within a PlatformPrefsProvider");return{error:c,isLoading:i,update:f,value:o}}const _g="var(--io-neutrals-0)",oa="var(--io-neutrals-900)";function fd(t){var r;let n,e,o;if(t.startsWith("#")){let i=t.slice(1);i.length===3&&(i=i.split("").map(a=>a+a).join("")),n=parseInt(i.substring(0,2),16),e=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16)}else{if(!t.startsWith("rgb")){const i=document.createElement("canvas").getContext("2d");return i?(i.fillStyle=t,fd(i.fillStyle)):oa}{const i=(r=t.match(/\d+/g))==null?void 0:r.map(Number);if(!i||i.length<3)return oa;[n,e,o]=i}}return(.2126*n+.7152*e+.0722*o)/255>.5?oa:_g}function Lg({className:t,channel:n,...e}){const o=ee("io-channel-selector-badge",t),r=g.useMemo(()=>fd(n.color),[n.color]);return s.jsx("div",{className:o,style:{color:r,backgroundColor:n.color},"data-testid":`channel-selector-badge-${n.color}`,...e,children:s.jsx("span",{className:"io-channel-selector-badge-label","data-testid":"channel-selector-label",children:n.label})})}function Rg(){return s.jsx(ot,{variant:"check","data-testid":"channel-selector-channel-selected"})}function Fg({channel:t,handleChannelRestricted:n,lockedChannelRestriction:e}){const o=(r,i)=>a=>{a.stopPropagation(),_n(a)&&(a.preventDefault(),i||n({...t,[r]:!t[r]}))};return s.jsxs(s.Fragment,{children:[s.jsx("div",{children:t.isSelected&&s.jsx("span",{"data-testid":"channel-selector-channel-selected",children:"Active"})}),s.jsx("div",{role:"button",onClick:r=>r.stopPropagation(),"data-testid":"channel-selector-publish-toggle-container",children:s.jsx(ft,{label:"Publish",checked:t.write,onChange:()=>{n({...t,write:!t.write})},onKeyDown:o("write",!t.isSelected||(e==null?void 0:e.write)),onClick:r=>r.stopPropagation(),disabled:!t.isSelected||(e==null?void 0:e.write)})}),s.jsx("div",{role:"button",onClick:r=>r.stopPropagation(),"data-testid":"channel-selector-subscribe-toggle-container",children:s.jsx(ft,{label:"Subscribe",checked:t.read,onChange:()=>{n({...t,read:!t.read})},onKeyDown:o("read",!t.isSelected||(e==null?void 0:e.read)),disabled:!t.isSelected||(e==null?void 0:e.read)})})]})}const pd=g.createContext({});function Bg({channel:t,isSelected:n,onChannelSelect:e,onChannelRestrict:o,...r}){const{variant:i,selectedChannels:a,lockedChannelRestrictions:c}=g.useContext(pd),l=n||t.isSelected||(a==null?void 0:a.includes(t)),u=c==null?void 0:c.find(h=>h.name===t.name),f=g.useCallback(()=>e==null?void 0:e({...t,isSelected:!l}),[t,e,l]),d=g.useCallback(h=>{const m=h.target;m.closest(".io-toggle")||m.classList.contains("io-toggle")||_n(h)&&(h.preventDefault(),e==null||e({...t,isSelected:!l}))},[t,e,l]),p=g.useCallback(h=>{o==null||o(h)},[o]);return s.jsx(gi,{prepend:s.jsx(Lg,{channel:t}),append:i==="single"||i==="multi"?l&&s.jsx(Rg,{}):s.jsx(Fg,{channel:t,handleChannelRestricted:p,lockedChannelRestriction:u}),isSelected:l,onClick:f,onKeyDown:d,...r,children:t.name},t.name)}function Hg({variant:t,onVariantChange:n,disabled:e=!1}){const o=t==="directionalSingle"||t==="directionalMulti",r=g.useCallback(()=>{n==null||n(!o)},[o,n]),i=g.useCallback(c=>{c.stopPropagation()},[]),a=g.useCallback(c=>{c.stopPropagation(),_n(c)&&(c.preventDefault(),e||r())},[e,r]);return s.jsx(ft,{label:"Directional",align:"right",checked:o,onChange:r,onClick:i,onKeyDown:a,disabled:e,"data-testid":`channel-selector-toggle-${t}`})}const Wg=g.forwardRef(({className:t,variant:n="single",variantToggle:e=!1,channels:o=[],lockedChannelRestrictions:r=[],onVariantChange:i,onChannelSelect:a,onChannelRestrict:c,...l},u)=>{const f=ee("io-channel-selector-panel",(n==="directionalSingle"||n==="directionalMulti")&&"io-channel-selector-panel-directional",t),d=g.useMemo(()=>({variant:n,selectedChannels:o.filter(p=>p.isSelected),lockedChannelRestrictions:r,onVariantChange:i,onChannelSelect:a,onChannelRestrict:c}),[o,n,r,i,a,c]);return s.jsx(pd.Provider,{value:d,children:s.jsx("div",{className:f,ref:u,children:s.jsxs(ut,{...l,children:[s.jsx(ut.ItemTitle,{"data-testid":"channel-selector-title",append:e&&s.jsx(Hg,{variant:n,onVariantChange:i}),children:{single:"Select Channel",directionalSingle:"Select Directional Channel",multi:"Select Channels",directionalMulti:"Select Directional Channels"}[n]}),o==null?void 0:o.map(p=>s.jsx(Bg,{channel:p,isSelected:p.isSelected,onChannelSelect:a,onChannelRestrict:c,"data-testid":`channel-selector-channel-${p.name}`},p.name))]})})})});Wg.displayName="ChannelSelector";const $g=g.forwardRef(({className:t,title:n,ariaLabel:e,onClick:o,onKeyDown:r,children:i,disabled:a=!1,...c},l)=>s.jsx("div",{ref:l,className:ee(t,{disabled:a}),title:n,role:"button",tabIndex:a?-1:0,"aria-label":e,"aria-disabled":a,onClick:u=>{!a&&o&&o(u)},onKeyDown:u=>{!a&&r&&r(u)},...c,children:i}));$g.displayName="ChannelSelectorButtonWrapper";g.createContext({config:{message:""},theme:"dark",setResult:()=>{}});function hd({title:t="Downloads"}){const{ItemSearch:n,HeaderButtons:e}=br();return s.jsxs("div",{className:"io-dm-header",children:[s.jsxs(Bt,{draggable:!0,children:[s.jsx(Bt.Title,{tag:"h1",text:t,size:"large"}),s.jsx(e,{className:"non-draggable"})]}),s.jsx(n,{})]})}const Lt=window.glue42gd,md=g.createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),vn=()=>g.useContext(md);function gd({className:t,placeholder:n="Search",iconPrepend:e="search",iconAppend:o="close",...r}){const i=ee("io-header-search",t),a=g.useRef(null),{searchQuery:c,setSearch:l,itemsCount:u}=vn(),f=c.length>0,d=g.useCallback(()=>{l(""),a.current&&a.current.focus()},[l]);return s.jsxs("div",{className:i,children:[s.jsx(no,{ref:a,value:c,iconPrepend:e,iconAppend:f?o:void 0,iconAppendOnClick:f?d:void 0,placeholder:n,onChange:p=>l(p.target.value),...r}),f&&s.jsx("p",{className:"io-header-search-count",children:`${u} results`})]})}function vd({className:t,...n}){const{MoreButton:e,CloseButton:o}=br();return s.jsxs(Re,{className:t,align:"right",...n,children:[s.jsx(e,{}),s.jsx(o,{})]})}function yd({icon:t="ellipsis-vertical",...n}){const{items:e,clearItems:o,showSettings:r}=vn(),i=e.length===0;return s.jsxs(fe,{variant:"light",...n,children:[s.jsx(fe.ButtonIcon,{icon:t,variant:"circle",size:"32"}),s.jsx(fe.Content,{children:s.jsxs(fe.List,{children:[s.jsx(fe.Item,{onClick:a=>(c=>{i?c.stopPropagation():o()})(a),disabled:i,children:"Clear All"}),s.jsx(fe.Item,{onClick:r,children:"Settings"})]})})]})}const zg={minimizeWindow:async function(t){var n;if(t)try{const e=(n=t.windows)==null?void 0:n.my();await(e==null?void 0:e.minimize())}catch(e){console.error("Failed to minimize window",e)}},closeWindow:async function(t,n){var e;if(t)try{const o=(e=t.windows)==null?void 0:e.my();await(o==null?void 0:o.close(n))}catch(o){console.error("Failed to close window",o)}},restartPlatform:async function(t,n=!0){if(t)try{await t.appManager.restart({autoSave:n,showDialog:!0})}catch(e){console.error("Failed to restart io.Connect Desktop",e)}},shutdownPlatform:async function(t,n=!0){if(t)try{await t.appManager.exit({autoSave:n,showDialog:!0})}catch(e){console.error("Failed to shutdown io.Connect Desktop",e)}}};function wd({icon:t="close",size:n="32",variant:e="circle",onClick:o,...r}){const i=g.useContext(Me.IOConnectContext);return s.jsx(Ve,{icon:t,size:n,variant:e,onClick:a=>{o?o(a):zg.closeWindow(i).catch(c=>{console.error("Failed to close window:",c)})},...r})}function lo(t,n=!1,e=!1,o=!1){const r=t.getDate(),i=["January","February","March","April","May","June","July","August","September","October","November","December"][t.getMonth()],a=t.getFullYear(),c=t.getHours(),l=t.getMinutes();let u="";return u=l<10?`0${l}`:`${l}`,n?n==="Today"?e?"Today":`Today at ${c}:${u}`:n==="Yesterday"?e?"Yesterday":`Yesterday at ${c}:${u}`:`${c}:${u}`:o?e?`${i} ${r}`:`${i} ${r} at ${c}:${u}`:e?`${i} ${r}, ${a}`:`${i} ${r}, ${a} at ${c}:${u}`}function bd(t,n={showTime:!0}){const e=new Date(1e3*t),o=new Date,r=Math.round((o-e)/1e3),i=Math.round(r/60),a=o.toDateString()===e.toDateString(),c=new Date(o.setDate(o.getDate()-1)).toDateString()===e.toDateString(),l=o.getFullYear()===e.getFullYear();return n.showTime?r<5?"Just Now":r<60?`${r} seconds ago`:r<90?"about a minute ago":i<60?`${i} minutes ago`:a?lo(e,"Today",!1,!0):c?lo(e,"Yesterday",!1,!0):l?lo(e,!1,!1,!0):lo(e):a?"Today":c?"Yesterday":l?lo(e,!1,!0,!0):lo(e,!1,!0)}function xd({className:t,...n}){const e=ee("io-dm-body",t),{DownloadListEmpty:o,ItemGroup:r,Item:i}=br(),{items:a,searchQuery:c,setCount:l,sortItems:u}=vn(),f=u(a),d=$u(c),p=g.useMemo(()=>f.filter(v=>v.displayInfo.filename.toLowerCase().includes(d.toLowerCase())||v.displayInfo.url.toLowerCase().includes(d.toLowerCase())),[f,d]),h=g.useMemo(()=>p.map(v=>({...v,displayInfo:{...v.displayInfo,startTime:bd(v.displayInfo.startTime,{showTime:!1})}})),[p]),m=g.useMemo(()=>Object.values(h.reduce((v={},y)=>{var k;return v[y.displayInfo.startTime]=((k=v[y.displayInfo.startTime])==null?void 0:k.concat([]))??[],v[y.displayInfo.startTime].push(y),v},{})),[h]);return g.useEffect(()=>{l(p.length)},[p,l]),s.jsx("div",{className:e,...n,children:m&&m.length!==0?m.map(v=>s.jsx(r,{title:String(v[0].displayInfo.startTime)??null,children:v.map(y=>s.jsx(i,{item:y},y.id))},v[0].id??"")):s.jsx(o,{})})}function Cd({className:t,icon:n="download",text:e="No downloads to display.",...o}){const r=ee("io-dm-no-items",t);return s.jsxs("div",{className:r,...o,children:[s.jsx(ot,{variant:n}),s.jsx("p",{children:e})]})}function kd({className:t,title:n,children:e,...o}){const r=ee("io-dm-item-group",t);return s.jsxs("div",{className:r,...o,children:[n&&s.jsx("p",{children:n}),e]})}function Sd({className:t,item:n,...e}){const{ItemHeader:o,ItemBody:r,ItemFooter:i}=br(),{state:a,url:c,filename:l,receivedBytes:u,totalBytes:f,speed:d,timeRemaining:p}=n.displayInfo;if(!n)return s.jsx(s.Fragment,{});const h=ee("io-dm-item",n.displayInfo.state&&[a],t);return s.jsxs("div",{className:h,...e,children:[s.jsx(o,{itemID:n.id,filename:l,state:a}),s.jsx(r,{state:a,url:c,bytesReceived:u,bytesTotal:f,speed:d,timeRemaining:p}),s.jsx(i,{itemID:n.id,state:a})]})}function Ss({bytesReceived:t=0,bytesTotal:n=0,...e}){const o=g.useCallback(()=>t&&n?Math.round(t/n*100):0,[t,n]);return s.jsx(tg,{value:o(),...e})}function Ed({className:t,itemID:n,filename:e,state:o,cancel:r,remove:i,...a}){const c=ee("io-dm-item-header",t),{cancelItem:l,removeItem:u}=vn(),f=g.useCallback(p=>{r?r(p):l(p)},[r,l]),d=g.useCallback(p=>{i?i(p):u(p)},[i,u]);return s.jsxs("div",{className:c,...a,children:[s.jsx(sn,{text:e,style:{textDecoration:o==="interrupted"||o==="cancelled"?"line-through":"none"}}),s.jsx(Ve,{icon:"close",iconSize:"12",onClick:()=>{o==="progressing"||o==="paused"?f(n):d(n)}})]})}function jd({className:t,state:n,url:e,bytesReceived:o=0,bytesTotal:r=0,speed:i=0,timeRemaining:a=0,...c}){const l=ee("io-dm-item-body",t),u=p=>{const h=["Bytes","KB","MB","GB","TB"];if(p===0)return"0";const m=Math.floor(Math.log(p)/Math.log(1024));return m===0?`${p}${h[m]}`:`${(p/1024**m).toFixed(1)}${h[m]}`};return s.jsxs("div",{className:l,...c,children:[s.jsx("p",{className:"io-text-small",children:e}),(d=n,d==="cancelled"||d==="interrupted"||d==="completed"?null:s.jsx(Ss,{variant:d==="paused"?"paused":"active",bytesReceived:o,bytesTotal:r})),s.jsx("p",{className:"io-text-default-lh16",children:n==="completed"?`${u(o??0)} - Done`:n==="cancelled"||n==="interrupted"?`${u(o??0)}/${u(r??0)} - Failed`:`${u(o??0)}/${u(r??0)} (${f=i,(f?`${(f/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(p=>{const h=Math.floor(p/3600),m=Math.floor(p%3600/60);let v="";return h>0&&(v+=`${h} hour${h>1?"s":""}, `),m>0&&(v+=`${m} min${m>1?"s":""}, `),((p=Math.floor(p%60))>0||v==="")&&(v+=`${p} sec${p!==1?"s":""}`),`${v.trim()} left`})(a)??0}`})]});var f,d}const Ug={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function ra({className:t,variant:n,text:e}){const o=ee("io-dm-item-status",`io-dm-item-status-${n}`,t);return s.jsxs("div",{className:o,children:[n&&s.jsx(ot,{variant:Ug[n],className:"icon-severity",size:"10"}),e&&s.jsx("p",{className:"io-text-smaller",children:e})]})}function Od({className:t,itemID:n,state:e,pauseResume:o,showInFolder:r,cancel:i,...a}){const c=ee("io-dm-item-footer",t),{pauseResumeItem:l,showItemInFolder:u,cancelItem:f}=vn(),d=g.useCallback(m=>{o?o(m):l(m)},[o,l]),p=g.useCallback(m=>{r?r(m):u(m)},[r,u]),h=g.useCallback(m=>{i?i(m):f(m)},[i,f]);return s.jsx("div",{className:c,...a,children:(()=>{switch(e){case"progressing":return s.jsxs(Re,{align:"right",children:[s.jsx(Re.Button,{variant:"primary",text:"Pause",onClick:()=>d(n)}),s.jsx(Re.Button,{variant:"link",text:"Cancel",onClick:()=>h(n)})]});case"paused":return s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Resume",onClick:()=>d(n)})});case"completed":return s.jsxs(s.Fragment,{children:[s.jsx(ra,{variant:"success",text:"Complete"}),s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Show in Folder",onClick:()=>p(n)})})]});case"cancelled":return s.jsx(ra,{variant:"warning",text:"Cancelled"});case"interrupted":return s.jsxs(s.Fragment,{children:[s.jsx(ra,{variant:"critical",text:"Failed"}),s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Retry",onClick:()=>d(n)})})]});default:return null}})()})}function Nd({className:t,title:n="Download Settings",...e}){const o=ee("io-dm-settings-panel",t),{configuration:{downloadFolder:r},hideSettings:i,setDownloadLocation:a,setDownloadLocationWithDialog:c,isDownloadLocationDialogVisible:l,downloadLocationList:u}=vn();return s.jsxs(Ge,{className:o,...e,children:[s.jsxs(Ge.Header,{children:[s.jsx(Ge.Header.Title,{size:"large",text:n,tag:"h1"}),s.jsx(Ge.Header.ButtonGroup,{children:s.jsx(Ve,{variant:"circle",icon:"close",size:"32",onClick:()=>{i()},disabled:l})})]}),s.jsx(Ge.Body,{children:s.jsxs(Re,{children:[s.jsxs(fe,{variant:"light",disabled:l,children:[s.jsx(fe.Button,{children:s.jsx("span",{className:"io-dm-settings-panel-download-location",children:r??u[0]})}),u.length>1&&s.jsx(fe.Content,{children:s.jsx(fe.List,{children:u.map((f,d)=>!f||d===0||d>3?null:s.jsx(fe.Item,{onClick:()=>{a(f)},children:f},f))})})]}),s.jsx(Ye,{className:"io-btn io-dm-settings-panel-download-location-btn",text:"Browse",onClick:()=>{c()},disabled:l})]})})]})}const Id={Header:hd,ItemSearch:gd,HeaderButtons:vd,MoreButton:yd,CloseButton:wd,Body:xd,DownloadListEmpty:Cd,ItemGroup:kd,Item:Sd,ItemProgress:Ss,ItemHeader:Ed,ItemBody:jd,ItemFooter:Od,Settings:Nd},Pd=g.createContext(Id),Ad=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Id,...n}),[n]);return s.jsx(Pd.Provider,{value:e,children:t})});Ad.displayName="ComponentsStore";const br=()=>g.useContext(Pd);function Vg({className:t,...n}){const e=ee("io-dm",t),{Header:o,Body:r,Settings:i}=br(),{isSettingsVisible:a}=vn();return s.jsxs(Ge,{className:e,...n,children:[s.jsx(o,{}),s.jsx(r,{}),a&&s.jsx(i,{})]})}var Gg=Object.freeze({__proto__:null,Body:xd,CloseButton:wd,DownloadListEmpty:Cd,DownloadManager:function({components:t,...n}){return s.jsx(Ad,{components:t,children:s.jsx(Vg,{...n})})},DownloadManagerProvider:({children:t})=>{const{configuration:n,items:e,removeItem:o,pauseResumeItem:r,cancelItem:i,clearItems:a,showItemInFolder:c,isSettingsVisible:l,showSettings:u,hideSettings:f,searchQuery:d,setSearch:p,itemsCount:h,setCount:m,setDownloadLocation:v,setDownloadLocationWithDialog:y,sortItems:k,isDownloadLocationDialogVisible:S,downloadLocationList:b}=function(){const[E,O]=g.useState({}),[F,R]=g.useState([]),[U,K]=g.useState(0),[_,A]=g.useState([]),[me,de]=g.useState(""),[re,ye]=g.useState(!1),[pe,xe]=g.useState(!1),[ae,B]=g.useState({filePaths:[],canceled:!1});g.useEffect(()=>{if(!Lt)return;const Y=Lt.downloads.onUpdate(H=>R(P=>X(P,H))),J=Lt.downloads.onConfigurationChanged(H=>{O(H)});return Lt.downloads.list().then(R).catch(console.error),Lt.downloads.getSavePathList().then(H=>{H.pathList&&A(H.pathList)}).catch(console.error),()=>{Y(),J()}},[]),g.useEffect(()=>{xe(!1)},[ae]);const X=(Y,J)=>{const H=Y.findIndex(T=>T.id===J.id);if(H===-1)return[J,...Y];const P=[...Y];return P[H]=J,P};return{items:F,setCount:Y=>{K(Y)},sortItems:(Y,J=!0)=>Y.sort((H,P)=>J?H.displayInfo.startTime<P.displayInfo.startTime?1:-1:H.displayInfo.startTime>P.displayInfo.startTime?1:-1),setSearch:Y=>{de(Y)},cancelItem:async Y=>{try{await Lt.downloads.cancel(Y)}catch(J){console.error(J)}},removeItem:async Y=>{try{R(J=>J.filter(H=>H.id!==Y)),await Lt.downloads.removeItem(Y)}catch(J){console.error(J)}},clearItems:async()=>{try{R([]),await Lt.downloads.clearDownloadList()}catch(Y){console.error(Y)}},itemsCount:U,searchQuery:me,showSettings:()=>{ye(!0)},hideSettings:()=>{ye(!1)},configuration:E,isSettingsVisible:re,pauseResumeItem:async Y=>{try{await Lt.downloads.pauseResume(Y)}catch(J){console.error(J)}},showItemInFolder:async Y=>{try{await Lt.downloads.showInFolder(Y)}catch(J){console.error(J)}},setDownloadLocation:async Y=>{try{await Lt.downloads.setSavePath(Y),A(J=>{if(J.includes(Y)){const H=J.filter(P=>P!==Y);return[Y,...H]}return[Y,...J]})}catch(J){console.error(J)}},downloadLocationList:_,isDownloadLocationDialogVisible:pe,setDownloadLocationWithDialog:async()=>{xe(!0);try{const Y=await Lt.downloads.showOpenDialog();if(B(Y),!(Y!=null&&Y.filePaths)||Y.filePaths.length===0)return;await Lt.downloads.setSavePath(Y.filePaths[0]),A(J=>{if(J.includes(Y.filePaths[0])){const H=J.filter(P=>P!==Y.filePaths[0]);return[Y.filePaths[0],...H]}return[Y.filePaths[0],...J]})}catch(Y){console.error(Y)}}}}(),w=g.useMemo(()=>({configuration:n,items:e,removeItem:o,pauseResumeItem:r,cancelItem:i,clearItems:a,showItemInFolder:c,isSettingsVisible:l,showSettings:u,hideSettings:f,searchQuery:d,setSearch:p,itemsCount:h,setCount:m,setDownloadLocation:v,setDownloadLocationWithDialog:y,sortItems:k,isDownloadLocationDialogVisible:S,downloadLocationList:b}),[n,e,o,r,i,c,a,l,u,f,d,p,h,m,v,y,k,S,b]);return s.jsx(md.Provider,{value:w,children:t})},Header:hd,HeaderButtons:vd,Item:Sd,ItemBody:jd,ItemFooter:Od,ItemGroup:kd,ItemHeader:Ed,ItemProgress:Ss,ItemSearch:gd,MoreButton:yd,Settings:Nd,useDownloadManagerContext:vn});function Ga(t){if(t&&t.errorHandling&&typeof t.errorHandling!="function"&&t.errorHandling!=="log"&&t.errorHandling!=="silent"&&t.errorHandling!=="throw")throw new Error('Invalid options passed to createRegistry. Prop errorHandling should be ["log" | "silent" | "throw" | (err) => void], but '+typeof t.errorHandling+" was passed");var n=t&&typeof t.errorHandling=="function"&&t.errorHandling,e={};function o(r,i){var a=r instanceof Error?r:new Error(r);if(n)n(a);else{var c='[ERROR] callback-registry: User callback for key "'+i+'" failed: '+a.stack;if(t)switch(t.errorHandling){case"log":return console.error(c);case"silent":return;case"throw":throw new Error(c)}console.error(c)}}return{add:function(r,i,a){var c=e[r];return c||(c=[],e[r]=c),c.push(i),a&&setTimeout(function(){a.forEach(function(l){var u;if(!((u=e[r])===null||u===void 0)&&u.includes(i))try{Array.isArray(l)?i.apply(void 0,l):i.apply(void 0,[l])}catch(f){o(f,r)}})},0),function(){var l=e[r];l&&(l=l.reduce(function(u,f,d){return f===i&&u.length===d||u.push(f),u},[]),l.length===0?delete e[r]:e[r]=l)}},execute:function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var c=e[r];if(!c||c.length===0)return[];var l=[];return c.forEach(function(u){try{var f=u.apply(void 0,i);l.push(f)}catch(d){l.push(void 0),o(d,r)}}),l},clear:function(){e={}},clearKey:function(r){e[r]&&delete e[r]}}}Ga.default=Ga;var Yg=ql(Ga);const Zg=g.createContext({config:{env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"},onThemeChanged:t=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:t=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),Qt=()=>g.useContext(Zg);function Kg({...t}){const{config:n,close:e}=Qt(),{applicationTitle:o}=n;return s.jsxs(Bt,{draggable:!0,...t,children:[s.jsx(Bt.Title,{tag:"h1",text:o?`Feedback Form - ${o}`:"Feedback Form",size:"large"}),s.jsx(Bt.ButtonGroup,{className:"non-draggable",children:s.jsx(Bt.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>e()})})]})}function qg({className:t,handleSubmit:n,...e}){const o=ee("io-panel-body",t),{config:r,submitFeedback:i}=Qt(),{IntroField:a,DescriptionField:c,TechInfoField:l,EnvInfoField:u,FileAttachmentsField:f,CategoryAttachmentsField:d,SettingsField:p,MailListField:h}=Pi(),m=n??i,v=`Your feedback will be submitted to the ${r.buildVersion} team and some additional information will be automatically included to help us examine your issue.`;return s.jsxs("form",{className:o,id:"feedback",onSubmit:y=>m(y),...e,children:[s.jsx(a,{children:s.jsx("p",{children:v})}),s.jsx(p,{}),s.jsx(h,{}),s.jsx(c,{}),s.jsx(l,{readOnly:!0}),s.jsx(u,{readOnly:!0}),r.attachmentsViewMode==="file"?s.jsx(f,{}):s.jsx(d,{})]})}function Jg({...t}){const{FooterButtons:n}=Pi(),{openUrl:e,submitInProgress:o,submitStatus:r,jiraTicketURL:i}=Qt();return s.jsx(Zn,{...t,children:s.jsxs("div",o?{className:"flex ai-center jc-between",children:[s.jsx(Ke,{children:s.jsx("p",{children:r.title})}),s.jsx(eg,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[s.jsxs(Ke,{children:[s.jsx("p",{className:r.type==="error"?"io-text-error":"",children:r.title}),i&&s.jsx("a",{href:i,onClick:a=>{a.preventDefault(),e(i)},children:i})]}),s.jsx(n,{})]})})}function Xg({className:t,...n}){const{CloseButton:e}=Pi(),{close:o}=Qt();return s.jsx(Re,{className:t,...n,children:s.jsx(e,{onClick:()=>o()})})}function Qg({className:t,...n}){const{SubmitButton:e,CancelButton:o,CloseButton:r}=Pi(),{close:i,submitCompleted:a}=Qt();return a?s.jsx(Re,{className:t,...n,children:s.jsx(r,{text:"Close",onClick:()=>i()})}):s.jsxs(Re,{className:t,...n,children:[s.jsx(e,{}),s.jsx(o,{onClick:()=>i()})]})}function e0({text:t="Submit",...n}){return s.jsx(Ye,{form:"feedback",type:"submit",variant:"primary",text:t,...n})}function t0({text:t="Cancel",...n}){return s.jsx(Ye,{variant:"link",text:t,...n})}function n0({...t}){return s.jsx(Ye,{variant:"primary",...t})}function o0({showField:t=!0,className:n,title:e,hint:o,children:r,...i}){return t?s.jsx(Ke,{className:n,title:e,hint:o,...i,children:r}):null}function r0({showField:t=!0,className:n,title:e="Description",hint:o,readOnly:r=!1,disabled:i,...a}){return t?s.jsx(Ke,{className:n,hint:o,title:"",...a,children:s.jsx(Ei,{id:"description",name:"description",label:e,readOnly:r,disabled:i})}):null}function i0({showField:t,className:n,title:e="Technical Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...c}){const{config:l}=Qt(),u=t??l.errorMessage,f=r??l.errorMessage;return u&&f?s.jsx(Ke,{className:n,hint:o,...c,children:s.jsx(Ei,{id:"errorMessage",name:"errorMessage",label:e,value:f,readOnly:i,disabled:a})}):null}function a0({showField:t,className:n,title:e="Environment Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...c}){const{config:l}=Qt(),u=t??l.showEnvironmentInfo,f=r??l.environmentInfo;return u&&f?s.jsx(Ke,{className:n,hint:o,...c,children:s.jsx(Ei,{id:"environmentInfo",name:"environmentInfo",label:e,value:f,readOnly:i,disabled:a})}):null}function s0({showField:t=!0,className:n,title:e="Attachments",hint:o,readOnly:r=!1,disabled:i,attachments:a,selectedCategories:c,...l}){const u=ee("io-block-list-gap",n),{config:f}=Qt(),d=a??f.attachments,p=c??f.selectedCategories,h=g.useCallback(m=>!!p&&p.indexOf(m)!==-1,[p]);return t?!d||d.length<=0?s.jsx(Ke,{title:"Attachments",children:s.jsx("p",{children:"No Attachments"})}):s.jsx(Ke,{className:u,title:e,hint:o,...l,children:s.jsx("div",{className:"file-attachments",children:d.map(m=>s.jsx(ji,{id:m.id,name:m.id,label:m.name,readOnly:r,disabled:i,defaultChecked:h(m.category)},m.id))})}):null}function c0({showField:t=!0,className:n,title:e="Attachments",hint:o,readOnly:r=!1,disabled:i,categories:a,selectedCategories:c,...l}){const{config:u,attachmentCategories:f}=Qt(),d=a??f,p=c??u.selectedCategories,h=g.useCallback(m=>!!p&&p.indexOf(m)!==-1,[p]);return t?!d||d.length<=0?s.jsx("p",{children:"No Attachments"}):s.jsx(Ke,{className:n,title:e,hint:o,...l,children:s.jsx("div",{className:"category-attachments",children:d.map(m=>s.jsx(ft,{id:m,name:m,align:"right",label:m,readOnly:r,disabled:i,defaultChecked:h(m)},m))})}):null}function l0({className:t,title:n,hint:e,showField:o=!0,showJiraTicketField:r,jiraTicketLabel:i="Create Jira Ticket",showSendEmailField:a,sendEmailLabel:c="Send Email",readOnly:l=!1,disabled:u,...f}){const d=ee("io-block-list-gap",t),{config:p,showMailingList:h,setShowMailingList:m}=Qt();if(!o)return null;const v=r??p.createJiraTicket,y=a??p.sendEmail;return s.jsxs(Ke,{className:d,hint:e,title:n,...f,children:[v&&s.jsx(ft,{id:"createJiraTicket",name:"createJiraTicket",label:i,align:"right",readOnly:l,disabled:u,defaultChecked:v}),y&&s.jsx(ft,{onChange:()=>{m(!h)},id:"sendEmail",name:"sendEmail",label:c,align:"right",readOnly:l,disabled:u,defaultChecked:y})]})}function u0({showField:t=!0,className:n,title:e="Email List",hint:o="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:i,disabled:a,...c}){const{config:l,showMailingList:u}=Qt(),f=t??l.sendEmail,d=i??l.allowEditRecipients===!1;return f&&u?s.jsx(Ke,{className:n,hint:o,...c,children:s.jsx(no,{id:"mailingList",name:"mailingList",label:e,placeholder:r,readOnly:d,disabled:a,defaultValue:l.mailingList??""})}):null}const Td={Header:Kg,Body:qg,Footer:Jg,HeaderButtons:Xg,FooterButtons:Qg,SubmitButton:e0,CancelButton:t0,CloseButton:n0,IntroField:o0,DescriptionField:r0,TechInfoField:i0,EnvInfoField:a0,FileAttachmentsField:s0,CategoryAttachmentsField:c0,SettingsField:l0,MailListField:u0},Dd=g.createContext(Td),d0=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Td,...n}),[n]);return s.jsx(Dd.Provider,{value:e,children:t})});function Pi(t){return{...g.useContext(Dd),...t}}d0.displayName="ComponentsStore";function Md({className:t,title:n="General",...e}){const o=ee("io-notifications-settings-panel-general",t),{AllowNotifications:r,AllowNotificationToasts:i,ShowNotificationBadge:a,CloseNotificationOnClick:c,PanelAutoHide:l,HideToastsAfter:u}=ao(),f=We();return s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n,children:[f&&s.jsx(r,{}),f&&s.jsx(i,{}),s.jsx(a,{}),f&&s.jsx(l,{}),f&&s.jsx(c,{}),f&&s.jsx(u,{})]})})}var tt=new class{constructor(){It(this,"subscribed",!1);It(this,"io");It(this,"registry",Yg());It(this,"logger");It(this,"isPanelVisible");It(this,"notifications",[]);It(this,"bulkActionsSupported",!1)}init(t){var r,i,a,c;if(this.subscribed)return;this.subscribed=!0,this.io=t,this.logger=this.io.logger.subLogger("notifications");const n=this.io.appManager.myApplication,e=((i=(r=n==null?void 0:n.userProperties)==null?void 0:r.logger)==null?void 0:i.publishLevel)??"error",o=((c=(a=n==null?void 0:n.userProperties)==null?void 0:a.logger)==null?void 0:c.consoleLevel)??"info";this.logger.publishLevel(e),this.logger.consoleLevel(o),this.logger.info("===== IO Notifications v.0.8.0 ====="),this.getBulkActionsSupport(),this.subscribe()}onPanelVisibilityChanged(t){return this.registry.add("on-panel-visibility-changed",t)}onConfigurationChanged(t){return this.registry.add("on-configuration-changed",t)}onNotificationsChanged(t){return this.registry.add("on-notifications-changed",t)}onCounterChanged(t){return this.registry.add("on-counter-changed",t)}async getNotificationsList(){var n;const t=await((n=this.io)==null?void 0:n.notifications.list());if(!t)throw new Error("io.notifications.list is not supported in this environment.");return t.map(e=>this.attachHandlers(e))}async getConfiguration(){if(this.io)return await this.io.notifications.getConfiguration();throw new Error("io.notifications.getConfiguration is not supported in this environment.")}showPanel(){var t;if(this.isDesktopEnvironment())return(t=this.io)==null?void 0:t.notifications.panel.show()}hidePanel(){var t;if(this.isDesktopEnvironment())return(t=this.io)==null?void 0:t.notifications.panel.hide()}clearAll(){var t,n;return(t=this.logger)==null||t.trace("clearing all notifications"),(n=this.io)==null?void 0:n.notifications.clearAll()}clearAllOld(){var t,n;return(t=this.logger)==null||t.trace("clearing all old notifications"),(n=this.io)==null?void 0:n.notifications.clearOld()}clearMany(t){var n,e,o,r;return typeof((n=this.io)==null?void 0:n.notifications).clearMany=="function"?t.length<1?((e=this.logger)==null||e.trace("no ids provided to clear notifications"),Promise.resolve()):((o=this.logger)==null||o.trace(`clearing notifications with ids ${JSON.stringify(t.join(", "))}`),((r=this.io)==null?void 0:r.notifications).clearMany(t)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}close(t){var n,e;return(n=this.logger)==null||n.trace(`closing notification with id ${t}`),(e=this.io)==null?void 0:e.notifications.clear(t)}snooze(t,n){var e,o;return(e=this.logger)==null||e.trace(`snoozing notification with id ${t} for ${n}ms`),(o=this.io)==null?void 0:o.notifications.snooze(t,n)}snoozeMany(t,n){var e,o,r,i;return typeof((e=this.io)==null?void 0:e.notifications).snoozeMany=="function"?t.length<1?((o=this.logger)==null||o.trace("no ids provided to snooze notifications"),Promise.resolve()):((r=this.logger)==null||r.trace(`snoozing notifications with ids ${JSON.stringify(t.join(", "))} for ${n}ms`),((i=this.io)==null?void 0:i.notifications).snoozeMany(t,n)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}setState(t,n){var e,o;return(e=this.logger)==null||e.trace(`setting state of ${t} to ${n}`),(o=this.io)==null?void 0:o.notifications.setState(t,n)}setStates(t,n){var e,o,r,i;return typeof((e=this.io)==null?void 0:e.notifications).setStates=="function"?t.length<1?((o=this.logger)==null||o.trace(`no ids provided to change state to ${n} for notifications`),Promise.resolve()):((r=this.logger)==null||r.trace(`setting state of ${JSON.stringify(t.join(", "))} to ${n}`),((i=this.io)==null?void 0:i.notifications).setStates(t,n)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}getBulkActionsSupport(){var n,e,o;const t=typeof((n=this.io)==null?void 0:n.notifications).clearMany=="function"&&typeof((e=this.io)==null?void 0:e.notifications).setStates=="function"&&typeof((o=this.io)==null?void 0:o.notifications).snoozeMany=="function";this.bulkActionsSupported=t}setFilter(t){var n,e;return(n=this.logger)==null||n.trace(`setting filter to ${JSON.stringify(t)}`),(e=this.io)==null?void 0:e.notifications.setFilter(t)}configure(t){var n;return(n=this.io)==null?void 0:n.notifications.configure(t)}subscribe(){var t,n,e,o,r,i,a;(t=this.io)==null||t.notifications.onRaised(c=>{var l;(l=this.logger)==null||l.trace(`received event indicating notification raise: ${JSON.stringify(c)}`),this.attachHandlers(c),this.notifications.unshift(c),this.registry.execute("on-notifications-changed",[...this.notifications])}),(n=this.io)==null||n.notifications.onStateChanged(({id:c},l)=>{var u;(u=this.logger)==null||u.trace(`received event for notification state is changed - "${c}" - "${l==null?void 0:l.toString()}"`),this.notifications=this.notifications.map(f=>{var d;return f.id===c?((d=this.logger)==null||d.trace(`${f.id} - the state is changed from "${f.state}" to "${l==null?void 0:l.toString()}"`),Object.assign(f,{state:l})):f}),this.registry.execute("on-notifications-changed",this.notifications)}),(e=this.io)!=null&&e.notifications&&"onDataChanged"in this.io.notifications&&typeof this.io.notifications.onDataChanged=="function"&&((o=this.io)==null||o.notifications.onDataChanged((c,l)=>{var f;const u=c.id;(f=this.logger)==null||f.trace(`received event for notification data is changed - "${u}" - "${JSON.stringify(l)}"`),this.notifications=this.notifications.map(d=>{var p;return d.id===u?((p=this.logger)==null||p.trace(`${d.id} - the data is changed from "${JSON.stringify(d.data)}" to "${JSON.stringify(l)}"`),Object.assign(d,{data:l})):d}),this.registry.execute("on-notifications-changed",this.notifications)})),(r=this.io)==null||r.notifications.onClosed(({id:c})=>{var l;(l=this.logger)==null||l.trace(`received event for notification is closed - "${c}".`),this.notifications=this.notifications.filter(u=>u.id!==c),this.registry.execute("on-notifications-changed",this.notifications)}),(i=this.io)==null||i.notifications.onConfigurationChanged(c=>{var l;(l=this.logger)==null||l.trace(`received event for configuration changed - ${JSON.stringify(c)}.`),this.registry.execute("on-configuration-changed",c)}),this.isDesktopEnvironment()&&((a=this.io)==null||a.notifications.panel.onVisibilityChanged(c=>{var l;(l=this.logger)==null||l.trace(`received event for panel visibility changed to "${c}".`),this.isPanelVisible=c,this.registry.execute("on-panel-visibility-changed",c)}))}isDesktopEnvironment(){return typeof window=="object"&&(!!window.iodesktop||!!window.glue42gd)}attachHandlers(t){var e;return(e=t.actions)==null||e.forEach(o=>{Object.assign(o,{onClick:async r=>{var i,a,c;try{(i=this.logger)==null||i.info(`${t.id}/${o.action} - was clicked.`),await((a=this.io)==null?void 0:a.notifications.click(t.id,o.action,r))}catch(l){(c=this.logger)==null||c.error("Error while clicking on action:",l)}}})}),Object.assign(t,{snooze:async(o=1e4)=>{var r,i;(r=this.logger)==null||r.trace(`${t.id} - request to change the state from ${t.state} to Snoozed with duration ${o}ms`),await((i=this.io)==null?void 0:i.notifications.snooze(t.id,o))},updateState:async o=>{var r,i;return(r=this.logger)==null||r.trace(`${t.id} - request to change the state from ${t.state} to ${o}`),(i=this.io)==null?void 0:i.notifications.setState(t.id,o)},updateData:async o=>{var r,i;(r=this.logger)==null||r.trace(`${t.id} - request to change the data to ${JSON.stringify(o)}`),(i=this.io)!=null&&i.notifications&&"updateData"in this.io.notifications&&typeof this.io.notifications.updateData=="function"?await this.io.notifications.updateData(t.id,o):console.log("'updateData' method is not supported")},onClick:async o=>{var r,i,a;try{(r=this.logger)==null||r.info(`${t.id} - was clicked.`),await((i=this.io)==null?void 0:i.notifications.click(t.id,void 0,o))}catch(c){(a=this.logger)==null||a.error(`Error while clicking on Notification: ${t.id}`,c)}},onShow:()=>{},close:async()=>{var o;return(o=this.logger)==null||o.info(`${t.id} - was closed.`),this.close(t.id)}})}};function Es(t){const n=g.useContext(Me.IOConnectContext),e=n==null?void 0:n.appManager,o=We(),[r,i]=g.useState([]),[a,c]=g.useState(0),l="Platform",u=g.useCallback((p="asc")=>{if(o===null)return[];const h=[...r].sort((m,v)=>{const y=(m.title??m.name).toLowerCase(),k=(v.title??v.name).toLowerCase();return p==="asc"?y.localeCompare(k):k.localeCompare(y)});if(!o){const m=h.findIndex(v=>v.name===l);if(m!==-1){const[v]=h.splice(m,1);h.unshift(v)}}return h},[r,o]),f=g.useMemo(()=>u("asc"),[u]),d=g.useMemo(()=>u("desc"),[u]);return g.useEffect(()=>{if(o===null||o)return;const p={title:"System",name:l,hidden:!1,userProperties:{hidden:!1}};i(h=>h.some(m=>m.name===p.name)?h:[...h,p])},[o]),g.useEffect(()=>{if(!e)return;const p=e.onAppAdded(v=>{i(y=>[...y,{title:v.title,name:v.name,hidden:v.hidden,userProperties:v.userProperties}])}),h=e.onAppRemoved(v=>{i(y=>y.filter(k=>k.name!==v.name))}),m=e.onAppChanged(v=>{i(y=>{const k=y.find(S=>S.name===v.name);return[...y.filter(S=>S.name!==v.name),{title:v.title,name:k==null?void 0:k.name,hidden:k==null?void 0:k.hidden,allowed:k==null?void 0:k.allowed,userProperties:k==null?void 0:k.userProperties}]})});return()=>{p(),h(),m()}},[e]),{apps:g.useMemo(()=>{if(!(t!=null&&t.sourceFilter)||!Array.isArray(r))return r;const{allowed:p=[],blocked:h=[]}=t.sourceFilter,m=p.includes("*"),v=h.includes("*");let y=0;const k=r.map(S=>{const b=m||p.includes(S.name),w=!v&&b;return w&&y++,{...S,allowed:w}});return c(y),k},[t,r]),allowedApps:a,sortedAppsAsc:f,sortedAppsDesc:d,sortAppsAlphabetically:u}}function _d(t,n,e){var r;return{notificationStacks:g.useMemo(()=>{var u,f,d,p;if(!n.toastStacking)return[];const i=(a=n.stackBy)==="application"?"source":a==="severity"?"severity":"source";var a;const c=t.filter(h=>h.state==="Active"),l=new Map;for(const h of c){const m=h[i]??"";if(h.source&&((f=(u=e==null?void 0:e.sourceFilter)==null?void 0:u.muted)!=null&&f.includes(h.source))||(p=(d=e==null?void 0:e.sourceFilter)==null?void 0:d.muted)!=null&&p.includes("*"))continue;l.has(m)||l.set(m,{key:m,items:[]});const v=l.get(m);v&&v.items.unshift(h)}return Array.from(l.values()).filter(h=>h.items.some(m=>m.state==="Active"||m.state==="Stale"))},[t,n.toastStacking,n.stackBy,(r=e==null?void 0:e.sourceFilter)==null?void 0:r.muted])}}function Ld(t){const[n,e]=g.useState([]);return{selectedNotifications:n,selectNotification:(o,r)=>{const i=n;e(r?[...i,o]:i.filter(a=>a!==o))},selectAllNotifications:(o,r)=>{if(r){let i=[];switch(o){case"read":i=t.filter(a=>a.state==="Acknowledged"||a.state==="Seen").map(a=>a.id);break;case"unread":i=t.filter(a=>a.state==="Active"||a.state==="Stale").map(a=>a.id);break;case"snoozed":i=t.filter(a=>a.state==="Snoozed").map(a=>a.id);break;default:i=t.map(a=>a.id)}e(i)}else e([])}}}const Xc=t=>{var n,e;return{enabledNotifications:t.enable,enabledToasts:t.enableToasts,toastStacking:((n=t.toasts)==null?void 0:n.mode)==="stacked",stackBy:(e=t.toasts)==null?void 0:e.stackBy,toastExpiry:t.toastExpiry,showNotificationBadge:t.showNotificationBadge,placement:t.placement,snooze:t.snooze,closeNotificationOnClick:t.closeNotificationOnClick,autoHidePanel:t.autoHidePanel}},Qc=t=>Array.from(t.reduce((n,e)=>n.set(e.id,e),new Map).values());function f0(){const t=g.useContext(Me.IOConnectContext),[n,e]=g.useState({}),[o,r]=g.useState({}),[i,a]=g.useState([]),[c,l]=g.useState(0),[u,f]=g.useState(!0),{apps:d,allowedApps:p}=Es(n),{notificationStacks:h}=_d(i,{toastStacking:o.toastStacking??!1,stackBy:o.stackBy??"source"},{sourceFilter:n.sourceFilter}),{selectedNotifications:m,selectNotification:v,selectAllNotifications:y}=Ld(i);tt.init(t),g.useEffect(()=>{(async()=>{await(async()=>{try{const b=await tt.getConfiguration();e(b),r(w=>({...w,...Xc(b)}))}catch(b){console.error("Error fetching configuration:",b)}})(),await(async()=>{try{const b=await tt.getNotificationsList();a(Qc(b))}catch(b){console.error("Error fetching notifications:",b)}})()})().catch(b=>{console.error("Error in useNotifications fetch:",b)}),k()},[]),g.useEffect(()=>{const b=tt.onNotificationsChanged(O=>{a(Qc(O))}),w=tt.onConfigurationChanged(O=>{const F=Xc(O);e(R=>({...R,...O})),r(R=>({...R,...F}))}),E=tt.onCounterChanged(O=>{l(O)});return()=>{b(),w(),E()}},[]);const k=()=>{f(tt.bulkActionsSupported)},S=async b=>{await tt.setFilter(b)};return{close:b=>tt.close(b),clearAll:()=>tt.clearAll(),settings:o,hidePanel:async()=>{await tt.hidePanel()},showPanel:async()=>{await tt.showPanel()},saveFilter:S,clearAllOld:()=>tt.clearAllOld(),saveSetting:async b=>{const w=((E,O)=>{const F=(K=>({enabledNotifications:_=>({enable:_}),enabledToasts:_=>({enableToasts:_}),toastStacking:_=>{var A;return{toasts:{mode:_?"stacked":"single",stackBy:(A=K.toasts)==null?void 0:A.stackBy}}},stackBy:_=>{var A;return{toasts:{mode:(A=K.toasts)==null?void 0:A.mode,stackBy:_}}},showNotificationBadge:_=>({showNotificationBadge:_}),toastExpiry:_=>({toastExpiry:_}),placement:_=>({placement:_}),snooze:_=>({snooze:_}),closeNotificationOnClick:_=>({closeNotificationOnClick:_}),autoHidePanel:_=>({autoHidePanel:_})}))(O),R=Object.keys(E)[0],U=E[R];return R&&U!==void 0&&F[R]?F[R](U):{}})(b,n);w&&await tt.configure(w)},allApps:d,saveAllFilter:async b=>{"subscribe"in b?await S({allowed:b.subscribe?["*"]:[],blocked:b.subscribe?[]:["*"]}):"mute"in b&&await S({muted:b.mute?["*"]:[]})},configuration:n,notifications:i,notificationStacks:h,notificationsCount:c,allApplications:n.allApplications??0,allowedApplications:p,isBulkActionsSupported:u,selectedNotifications:m,selectNotification:v,selectAllNotifications:y,clearMany:async b=>{await tt.clearMany(b)},snooze:async(b,w)=>{await tt.snooze(b,w)},snoozeMany:async(b,w)=>{await tt.snoozeMany(b,w)},setState:async(b,w)=>{await tt.setState(b,w)},setStates:async(b,w)=>{await tt.setStates(b,w)},setCount:b=>{l(b)},getNotificationsList:async()=>await tt.getNotificationsList()}}const Rd=g.createContext({allApps:[],settings:{},configuration:{},notifications:[],notificationsCount:0,onClose:()=>{},allApplications:0,clearAll:()=>{},showPanel:()=>{},hidePanel:()=>{},saveFilter:()=>{},clearAllOld:()=>{},notificationStacks:[],saveSetting:()=>{},allowedApplications:0,saveAllFilter:()=>{},isBulkActionsSupported:!1,selectedNotifications:[],selectNotification:()=>{},selectAllNotifications:()=>{},clearMany:()=>{},snooze:()=>{},snoozeMany:()=>{},setState:()=>{},setStates:()=>{},setCount:()=>{}}),Ne=()=>g.useContext(Rd);function Fd({label:t="Allow notifications",align:n="right",...e}){const{settings:o,saveSetting:r}=Ne(),i=We(),a=g.useCallback(c=>{r({enabledNotifications:c.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:a,checked:o.enabledNotifications??!1,...e}):null}function Bd({label:t="Allow notification toasts",align:n="right",...e}){const{settings:o,saveSetting:r}=Ne(),i=We(),a=i&&!o.enabledNotifications,c=g.useCallback(l=>{r({enabledToasts:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.enabledToasts??!1,disabled:a,...e}):null}function Hd({label:t="Show notification badge",align:n="right",...e}){const{settings:o,saveSetting:r}=Ne(),i=We()&&!o.enabledNotifications,a=g.useCallback(c=>{r({showNotificationBadge:c.target.checked})},[r]);return s.jsx(ft,{label:t,align:n,onChange:a,checked:o.showNotificationBadge??!1,disabled:i,...e})}function Wd({label:t="Close notification on click",align:n="right",...e}){const{settings:o,saveSetting:r}=Ne(),i=We(),a=i&&!o.enabledNotifications,c=g.useCallback(l=>{r({closeNotificationOnClick:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.closeNotificationOnClick??!1,disabled:a,...e}):null}function $d({label:t="Auto hide panel",align:n="right",...e}){const{settings:o,saveSetting:r}=Ne(),i=We(),a=g.useCallback(c=>{r({autoHidePanel:c.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:a,checked:o.autoHidePanel??!1,...e}):null}const el=(t,n)=>t?`${t} ${n}${t!==1?"s":""}`:"",ai=t=>{const n=Math.floor(t/60),e=t%60,o=el(n,"minute"),r=el(e,"second");return o+(o&&r?" ":"")+r};function zd({className:t,title:n="Hide toasts after",items:e=[15,30,45,60],...o}){const r=ee("flex","jc-between","ai-center",t),{settings:i,saveSetting:a}=Ne(),c=We(),l=c&&!i.enabledNotifications,u=g.useCallback((f=15e3)=>{i.toastExpiry!==f&&a({toastExpiry:1e3*f})},[i.toastExpiry,a]);return c?s.jsxs("div",{className:r,...o,children:[s.jsx("div",{className:"io-text-clipper "+(l?"io-text-disabled":""),children:s.jsx("span",{children:n})}),s.jsxs(fe,{variant:"light",disabled:l,children:[s.jsx(fe.Button,{text:ai((i.toastExpiry??0)/1e3)}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",children:e.map(f=>s.jsx(fe.Item,{onClick:()=>{u(f)},children:ai(f)},f))})})]})]}):null}function Ud({className:t,title:n="Stacking",...e}){const o=ee("io-notifications-settings-panel-stacking",t),{ToastStacking:r,ToastStackBy:i}=ao();return We()?s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n,children:[s.jsx(r,{}),s.jsx(i,{})]})}):null}function Vd({label:t="Allow toast stacking",align:n="right",...e}){const{settings:o,saveSetting:r}=Ne(),i=We(),a=i&&!o.enabledNotifications,c=g.useCallback(l=>{r({toastStacking:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.toastStacking??!1,disabled:a,...e}):null}const Ya={application:"Application",severity:"Priority"},p0=Object.fromEntries(Object.entries(Ya).map(([t,n])=>[n,t]));function Gd({className:t,title:n="Group by",...e}){const o=ee("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=Ne(),a=We(),c=a&&!r.enabledNotifications,l=g.useCallback((f="severity")=>{r.stackBy!==f&&i({stackBy:f.toLowerCase()})},[r.stackBy,i]);if(!a)return null;const u=Object.values(Ya);return s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:ee("io-text-clipper",{"io-text-disabled":c}),children:s.jsx("span",{children:n})}),s.jsxs(fe,{variant:"light",disabled:c,children:[s.jsx(fe.Button,{text:Ya[r.stackBy??"severity"]}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",children:u.map(f=>s.jsx(fe.Item,{onClick:()=>{const d=p0[f];l(d)},children:f},f))})})]})]})}function Yd({className:t,title:n="Placement",...e}){const o=ee("io-notifications-settings-panel-placement",t),{PlacementPanel:r,PlacementToasts:i}=ao();return We()?s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n,children:[s.jsx(r,{}),s.jsx(i,{})]})}):null}const Zd=t=>t.replace(/(^|-)\w/g,n=>n.toUpperCase().replace("-"," "));function Kd({className:t,title:n="Panel position",...e}){var l,u;const o=ee("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=Ne(),a=We(),c=g.useCallback(f=>{var d;f||(f="right"),((d=r.placement)==null?void 0:d.panel)!==f&&i({placement:{...r.placement,panel:f.toLowerCase()}})},[r.placement,i]);return a?s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:"io-text-clipper",children:s.jsx("span",{children:n})}),s.jsxs(fe,{variant:"light",children:[s.jsx(fe.Button,{text:(l=r.placement)!=null&&l.panel?Zd((u=r.placement)==null?void 0:u.panel):"Right"}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",children:["Right","Left"].map(f=>s.jsx(fe.Item,{onClick:()=>{c(f)},children:f},f))})})]})]}):null}function qd({className:t,title:n="Toasts position",...e}){var l,u;const o=ee("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=Ne(),a=We(),c=g.useCallback(f=>{var p;if(f||(f="bottom-right"),((p=r.placement)==null?void 0:p.toasts)===f)return;const d=f.replace(/\s+/g,"-").toLowerCase();i({placement:{...r.placement,toasts:d}})},[r.placement,i]);return a?s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:"io-text-clipper",children:s.jsx("span",{children:n})}),s.jsxs(fe,{variant:"light",children:[s.jsx(fe.Button,{text:(l=r.placement)!=null&&l.toasts?Zd((u=r.placement)==null?void 0:u.toasts):"Bottom Right"}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map(f=>s.jsx(fe.Item,{onClick:()=>{c(f)},children:f},f))})})]})]}):null}function Jd({className:t,title:n="Snooze",...e}){var a;const o=ee("io-notifications-settings-panel-snooze",t),{SnoozeDuration:r}=ao(),{settings:i}=Ne();return We()&&((a=i.snooze)!=null&&a.enabled)?s.jsx("div",{className:o,...e,children:s.jsx(Ke,{title:n,children:s.jsx(r,{})})}):null}function Xd({className:t,title:n="Default duration",items:e=[60,120,180,300],...o}){var f,d;const r=ee("flex","jc-between","ai-center",t),{settings:i,saveSetting:a}=Ne(),c=We(),l=c&&!i.enabledNotifications,u=g.useCallback((p=6e4)=>{var h;i.snooze&&((h=i.snooze)==null?void 0:h.duration)!==p&&a({snooze:{...i.snooze,duration:1e3*p}})},[i.snooze,a]);return c&&((f=i.snooze)!=null&&f.enabled)?s.jsxs("div",{className:r,...o,children:[s.jsx("div",{className:ee("io-text-clipper",{"io-text-disabled":l}),children:s.jsx("span",{children:n})}),s.jsxs(fe,{variant:"light",disabled:l,children:[s.jsx(fe.Button,{text:ai((((d=i.snooze)==null?void 0:d.duration)??0)/1e3)}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",children:e.map(p=>s.jsx(fe.Item,{onClick:()=>{u(p)},children:ai(p)},p))})})]})]}):null}function Qd({className:t,title:n,...e}){const o=ee("io-notifications-settings-panel-subscriptions",t),{SubscribeAll:r,SubscribeApp:i,SubscribeMuteAll:a,SubscribeMuteApp:c}=ao(),{sortAppsAlphabetically:l}=Es(),u=We(),f=l(),d="io-notifications-subscriptions-grid "+(u?"with-three-columns":"with-two-columns");return s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n??(u?"Subscribe & Mute":"Subscribe"),children:[s.jsxs("div",{className:d,children:[s.jsx("p",{className:"io-text-section",children:"Sources"}),s.jsx("p",{className:"io-text-section",children:"Subscribe"}),u&&s.jsx("p",{className:"io-text-section",children:"Mute"})]}),s.jsxs("div",{className:d,children:[s.jsx("p",{children:"All Sources"}),s.jsx(r,{label:""}),u&&s.jsx(a,{label:""})]}),f.map(p=>{var h;return!p||p.hidden||(h=p==null?void 0:p.userProperties)!=null&&h.hidden?null:s.jsxs("div",{className:d,children:[s.jsx("p",{children:p.title??p.name}),s.jsx(i,{app:p,label:""}),u&&s.jsx(c,{app:p,label:""})]},p.name)})]})})}function ef({label:t="All apps",align:n="right",...e}){var l,u,f,d;const{settings:o,configuration:r,saveAllFilter:i}=Ne(),a=We()&&!o.enabledNotifications,c=g.useCallback(p=>{i({subscribe:p.target.checked})},[i]);return s.jsx(ft,{align:n,label:t,onChange:c,checked:(((u=(l=r.sourceFilter)==null?void 0:l.allowed)==null?void 0:u.includes("*"))&&((d=(f=r.sourceFilter)==null?void 0:f.blocked)==null?void 0:d.length)===0)??!1,disabled:a,...e})}function tf({label:t="App",align:n="right",app:e,...o}){var f,d,p,h,m,v;const{allApps:r,settings:i,configuration:a,saveFilter:c}=Ne(),l=We()&&!i.enabledNotifications,u=g.useCallback((y,k)=>{var w,E,O,F,R,U;const S={...a.sourceFilter},b=(w=S.allowed)==null?void 0:w.indexOf("*");typeof b=="number"&&b>-1&&((E=S.allowed)==null||E.splice(b,1),r.forEach(K=>{var _;K.name!==k.name&&((_=S.allowed)==null||_.push(K.name))})),y?(S.allowed=[...new Set([...S.allowed??[],k.name])],S.blocked=(O=S.blocked)==null?void 0:O.filter(K=>K!==k.name)):(S.allowed=(F=S.allowed)==null?void 0:F.filter(K=>K!==k.name),S.blocked=[...new Set([...S.blocked??[],k.name])]),(R=S.allowed)!=null&&R.length&&((U=S.blocked)!=null&&U.includes("*"))&&S.blocked.splice(S.blocked.indexOf("*"),1),c(S)},[r,a.sourceFilter,c]);return s.jsx(ft,{id:e.name,label:t,align:n,onChange:y=>u(y.target.checked,e),checked:(((d=(f=a.sourceFilter)==null?void 0:f.allowed)==null?void 0:d.includes("*"))&&!((h=(p=a.sourceFilter)==null?void 0:p.blocked)!=null&&h.includes(e.name))||((v=(m=a.sourceFilter)==null?void 0:m.allowed)==null?void 0:v.includes(e.name)))??!1,disabled:l,...o})}function nf({label:t="Mute all",align:n="right",...e}){var u,f,d,p;const{settings:o,configuration:r,saveAllFilter:i}=Ne(),a=We(),c=a&&(!o.enabledNotifications||((f=(u=r.sourceFilter)==null?void 0:u.allowed)==null?void 0:f.indexOf("*"))===-1),l=g.useCallback(h=>{i({mute:h.target.checked})},[i]);return a?s.jsx(ft,{align:n,label:t,onChange:l,checked:((p=(d=r.sourceFilter)==null?void 0:d.muted)==null?void 0:p.includes("*"))??!1,disabled:c??!1,...e}):null}function of({label:t="App",align:n="right",app:e,...o}){var d,p,h,m,v,y,k,S,b,w,E,O,F,R,U,K;const{allApps:r,settings:i,configuration:a,saveFilter:c}=Ne(),l=We(),u=l&&(!i.enabledNotifications||((p=(d=a.sourceFilter)==null?void 0:d.blocked)==null?void 0:p.includes("*"))||((m=(h=a.sourceFilter)==null?void 0:h.blocked)==null?void 0:m.includes(e.name))||((y=(v=a.sourceFilter)==null?void 0:v.allowed)==null?void 0:y.length)===0||((S=(k=a.sourceFilter)==null?void 0:k.allowed)==null?void 0:S.indexOf(e.name))===-1&&((w=(b=a.sourceFilter)==null?void 0:b.allowed)==null?void 0:w.indexOf("*"))===-1&&((O=(E=a.sourceFilter)==null?void 0:E.blocked)==null?void 0:O.length)===0),f=g.useCallback((_,A)=>{var re,ye,pe,xe;const me={...a.sourceFilter},de=(re=me==null?void 0:me.muted)==null?void 0:re.indexOf("*");typeof de=="number"&&de>-1&&((ye=me.muted)==null||ye.splice(de,1),r.forEach(ae=>{var B;ae.name===A.name||ae.hidden||((B=me.muted)==null||B.push(ae.name))})),_?(pe=me.muted)==null||pe.push(A.name):me.muted=(xe=me.muted)==null?void 0:xe.filter(ae=>ae!==A.name),c(me)},[r,a.sourceFilter,c]);return!l||e.hidden?null:s.jsx(ft,{id:e.name,label:t,align:n,onChange:_=>f(_.target.checked,e),checked:(((R=(F=a.sourceFilter)==null?void 0:F.muted)==null?void 0:R.includes("*"))||((K=(U=a.sourceFilter)==null?void 0:U.muted)==null?void 0:K.includes(e.name)))??!1,disabled:u??!1,...o})}const rf={Body:t=>{const{General:n,Placement:e,Stacking:o,Snooze:r,Subscriptions:i}=ao();return s.jsxs(Oo,{...t,children:[s.jsx(n,{}),s.jsx(o,{}),s.jsx(e,{}),s.jsx(r,{}),s.jsx(i,{})]})},General:Md,AllowNotifications:Fd,AllowNotificationToasts:Bd,ShowNotificationBadge:Hd,CloseNotificationOnClick:Wd,PanelAutoHide:$d,HideToastsAfter:zd,Stacking:Ud,ToastStacking:Vd,ToastStackBy:Gd,Placement:Yd,PlacementPanel:Kd,PlacementToasts:qd,Snooze:Jd,SnoozeDuration:Xd,Subscriptions:Qd,SubscribeAll:ef,SubscribeApp:tf,SubscribeMuteAll:nf,SubscribeMuteApp:of},af=g.createContext(rf),js=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...rf,...n}),[n]);return s.jsx(af.Provider,{value:e,children:t})});js.displayName="NotificationsSettingsPanelComponentsStoreProvider";const ao=()=>g.useContext(af),h0=({className:t,onClose:n,title:e="Notification Settings",...o})=>{const{Body:r}=ao();return s.jsxs(Ge,{className:ee("io-notifications-settings-panel",t),"data-testid":"notifications-settings-panel",...o,children:[s.jsxs(Ge.Header,{children:[s.jsx(Ge.Header.Title,{size:"large",text:e,tag:"h1"}),s.jsx(Ge.Header.ButtonGroup,{children:s.jsx(Ge.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),s.jsx(r,{})]})},Os=({components:t,...n})=>s.jsx(js,{components:t,children:s.jsx(h0,{...n})});function m0({isOpen:t,onClose:n,container:e}){return t?jn.createPortal(s.jsx(Os,{onClose:n}),e??document.querySelector("#root")??document.body):null}const sf=g.createContext({searchQuery:"",setSearch:()=>{},isPanelVisible:!1,sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),Et=()=>g.useContext(sf);function cf({title:t,onClose:n,onOpenSettings:e,...o}){const{HeaderCaptionTitle:r,HeaderCaptionCount:i,HeaderCaptionButtonSettings:a,HeaderCaptionButtonClose:c,HeaderActions:l,HeaderBulkActions:u,HeaderSearch:f}=ro(),{isBulkActionsSupported:d,notificationsCount:p}=Ne(),{isBulkActionsVisible:h}=Et(),m=We();return s.jsxs(En,{...o,children:[s.jsxs("div",{className:"io-panel-header-caption",children:[s.jsx(r,{title:t}),s.jsx(i,{}),s.jsxs(En.ButtonGroup,{children:[m&&s.jsx(a,{onClick:e}),s.jsx(c,{onClick:n})]})]}),s.jsx(f,{}),d?s.jsxs("div",{className:`io-panel-header-actions-wrapper ${h&&p>0?"io-panel-header-bulk-actions-opened":""} `,children:[s.jsx(l,{}),s.jsx(u,{})]}):s.jsx(l,{})]})}function lf({text:t="Notifications",counter:n,...e}){const{notificationsCount:o}=Ne();return s.jsx(sn,{text:t,size:"large",...e,children:(n??!0)&&s.jsxs("span",{children:["(",o,")"]})})}const uf="newest",g0="oldest",v0="severity",ia=["None","Low","Medium","High","Critical"],tl={key:uf,descending:!0},df=t=>[...t].sort((n,e)=>(e.timestamp||0)-(n.timestamp||0)),ff=t=>[...t].sort((n,e)=>(n.timestamp||0)-(e.timestamp||0)),pf=(t,n)=>{const e=ia[0];return[...t].sort((o,r)=>{const i=ia.indexOf(o.severity||e),a=ia.indexOf(r.severity||e);return(n?-1:1)*(i-a)})},y0={[uf]:df,[g0]:ff,[v0]:pf},w0={severity:"Priority",newest:"Newest",oldest:"Oldest"};function hf({...t}){const[n,e]=g.useState([]),{NotificationsList:o,Notification:r}=ro(),{notifications:i,setCount:a,notificationsCount:c}=Ne(),{sortNotificationsBy:l,viewNotificationsBy:u,searchQuery:f}=Et(),d=g.useRef(null),p=$u(f),h=g.useMemo(()=>((v,y)=>{if(!v)return[];switch(y){case"all":default:return v;case"unread":return v.filter(k=>k.state==="Active"||k.state==="Stale");case"read":return v.filter(k=>k.state==="Acknowledged"||k.state==="Seen");case"snoozed":return v.filter(k=>k.state==="Snoozed")}})(i,u).filter(v=>{var y,k;return v.title.toLowerCase().includes(p.toLowerCase())||((y=v.source)==null?void 0:y.toLowerCase().includes(p.toLowerCase()))||((k=v.body)==null?void 0:k.toLowerCase().includes(p.toLowerCase()))}),[p,i,u]);return g.useEffect(()=>{switch(l){case"newest":e(df(h));break;case"oldest":e(ff(h));break;case"severity":e(pf(h,!0));break;default:e(h)}a(h.length)},[h,l,a]),g.useEffect(()=>{var m;d.current&&((m=d.current)==null||m.scrollTo({top:0,behavior:"smooth"}))},[p,c,l,u]),s.jsx(Oo,{ref:d,...t,children:s.jsx(o,{notifications:n,Notification:r})})}function mf({...t}){const{FooterButtons:n}=ro();return s.jsx(go,{...t,children:s.jsx(n,{})})}function gf({className:t,...n}){const{FooterButtonClearAll:e,FooterButtonClearAllOld:o}=ro(),{notifications:r}=Ne(),[i,a]=g.useState(!1);return g.useEffect(()=>{r.filter(c=>c.state==="Stale"||c.state==="Acknowledged").length>0?a(!0):a(!1)},[r]),s.jsxs(Re,{className:t,align:"right",...n,children:[s.jsx(o,{disabled:!i}),s.jsx(e,{disabled:r.length<=0})]})}function vf({text:t="Clear All",...n}){const{clearAll:e}=Ne();return s.jsx(Ye,{text:t,onClick:()=>{e()},...n})}function yf({text:t="Clear Old",...n}){const{clearAllOld:e}=Ne();return s.jsx(Ye,{text:t,onClick:()=>{e()},...n})}function Ns(t){const n=We(),{onClose:e,settings:o}=Ne(),{isPanelVisible:r}=Et(),{id:i,onClick:a,updateState:c}=t,l=g.useCallback(async()=>{if(!a)return;if(!n){try{await a({close:!0})}catch(p){console.error(p)}return void e(i)}const f=(o==null?void 0:o.toastStacking)??!1;let d;d=r?(o==null?void 0:o.closeNotificationOnClick)??!0:!f&&null;try{d!==null?await a({close:d}):(await a({close:!1}),await c("Acknowledged"))}catch(p){console.error(p)}},[n,i,r,a,e,c,o==null?void 0:o.closeNotificationOnClick,o==null?void 0:o.toastStacking]),u=g.useCallback(async f=>{const d=f.target;d.closest("button")||d.closest("[role='button']")||d.closest("a")||d.closest(".io-dropdown-menu")||await l()},[l]);return{handleClick:l,handleWrapperClick:u}}function wf({className:t,notification:n,onClick:e,...o}){const r=ee("io-notification-header",t),{HeaderCount:i,HeaderBadge:a,HeaderTitle:c,HeaderTimestamp:l,HeaderButtonSnooze:u,HeaderButtonClose:f}=Ai(),{handleWrapperClick:d}=Ns(n);return s.jsxs("div",{className:r,onClick:async p=>{await d(p),e==null||e(p)},...o,children:[s.jsx(a,{notification:n}),s.jsx(i,{notification:n}),s.jsx(c,{notification:n}),s.jsx(l,{notification:n}),s.jsxs(Re,{children:[s.jsx(u,{notification:n}),s.jsx(f,{notification:n})]})]})}function bf({notification:t,...n}){const{settings:e,notificationStacks:o}=Ne(),{isPanelVisible:r}=Et(),{toastStacking:i,stackBy:a}=e,c=a==="application"?"source":a??"source";let l=0;if(i){const u=o.find(f=>f.key===t[c]);l=(u==null?void 0:u.items.length)??0}return r||!i||l<=1?null:s.jsx(ki,{...n,children:l>9?"9+":l})}function xf({className:t,notification:n,...e}){if(!(n!=null&&n.severity)||n.severity==="None")return null;const o=ee("io-notification-header-badge",t);return s.jsx(ki,{className:o,...e,children:n.severity})}function Cf({className:t,state:n,severity:e="None",icon:o,...r}){const i=ee("io-notification-header-icon",t),{isPanelVisible:a}=Et();return s.jsxs("div",{className:i,...r,children:[o&&s.jsx("span",{className:"io-notification-header-icon-image",children:s.jsx("img",{src:o,alt:`io-notification-header-icon-${o}`})}),s.jsx("span",{className:`io-notification-header-icon-badge color-${e.toLowerCase()}`,children:a&&n!=="Acknowledged"&&"New"})]})}function kf({className:t,notification:{appTitle:n},...e}){const o=ee("io-notification-header-title",t);return s.jsx("div",{className:o,...e,children:n})}function Sf({className:t,notification:{timestamp:n,state:e,snooze:o},...r}){const i=ee("io-notification-timestamp",t);return s.jsx("small",o&&e==="Snoozed"?{className:i,...r,children:"Snoozed"}:{className:i,...r,children:bd(n??0)??"Just Now"})}function Ef({notification:{id:t,state:n},...e}){var a,c;const{settings:o,snooze:r}=Ne(),i=g.useCallback(l=>{var u;l.stopPropagation(),r&&r(t,((u=o.snooze)==null?void 0:u.duration)??0)},[t,r,(a=o.snooze)==null?void 0:a.duration]);return r&&n!=="Snoozed"&&((c=o.snooze)!=null&&c.enabled)?s.jsx(Ye,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:i,...e}):null}function jf({notification:{id:t,updateState:n},...e}){const o=We(),{onClose:r}=Ne(),{isPanelVisible:i}=Et(),a=g.useCallback(c=>{c.stopPropagation(),!o||i?r(t):n("Acknowledged").catch(console.error)},[o,t,r,i,n]);return s.jsx(Ve,{icon:"close",iconSize:"10",tabIndex:-1,onClick:a,...e})}function Of({className:t,notification:n,...e}){const o=ee("io-notification-body",t),{BodyIcon:r,BodyTitle:i,BodyDescription:a}=Ai(),{icon:c,title:l,body:u}=n,{handleClick:f}=Ns(n);return s.jsxs("div",{className:o,role:"button",tabIndex:0,onKeyDown:async d=>{_n(d)&&await f()},onClick:f,...e,children:[s.jsx(r,{icon:c}),s.jsxs("div",{className:"io-notification-body-content",children:[s.jsx(i,{text:l}),s.jsx(a,{text:u})]})]})}function Nf({className:t,icon:n,altText:e="notification icon",...o}){if(!n)return null;const r=ee("io-notification-body-icon",t);return s.jsx("div",{className:r,...o,children:s.jsx("img",{src:n,alt:e})})}function If({text:t,...n}){return s.jsx(sn,{text:t,...n})}function Pf({className:t,text:n,...e}){const o=ee("io-notification-body-description",t);return s.jsx("p",{className:o,...e,children:n})}function Af({className:t,notification:n}){const e=ee("io-notification-footer",t),{FooterButton:o}=Ai(),{handleWrapperClick:r}=Ns(n),i=g.useMemo(()=>function(c){const l=[],u={};if(!c)return;c.forEach(d=>{var v;const{displayId:p,displayPath:h}=d,m={...d,children:[]};if(h&&h.length>0){let y;h.forEach((k,S)=>{var b;S===0?y=u[k]:y&&(y=(b=y.children)==null?void 0:b.find(w=>w.displayId===k))}),y&&((v=y.children)==null||v.push(m))}else p?(l.push(m),u[p]=m):l.push(m);p&&(u[p]=m)});const f=d=>{d.forEach(p=>{var h;((h=p.children)==null?void 0:h.length)===0?delete p.children:p.children&&f(p.children)})};return f(l),l}(n.actions),[n.actions]),a=(c,l)=>c.children?s.jsx(Xt,{text:c.title,children:c.children.map(a)},`${c.title}-${l}`):((u,f)=>s.jsx(Xt.Item,{children:s.jsx(o,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:u})},`${u.title}-${f}`))(c,l);return s.jsx("div",{className:e,onClick:r,children:s.jsx(Re,{align:"right",children:i==null?void 0:i.map((c,l)=>c.children?s.jsxs(Re,{variant:"append",children:[s.jsx(o,{notificationAction:c,variant:l===0?"primary":"default"}),s.jsx(Xt,{variant:l===0?"primary":"default",icon:"ellipsis",children:c.children.map(a)})]},`${c.title}-${l}`):s.jsx(o,{notificationAction:c,variant:l===0?"primary":"link"},`${c.title}-${l}`))})})}function Tf({notificationAction:t,...n}){const e=g.useCallback(o=>{o.stopPropagation(),t.onClick({close:!0})},[t]);return s.jsx(Ye,{text:t.title,onClick:e,...n})}const Df={Header:wf,HeaderCount:bf,HeaderBadge:xf,HeaderIcon:Cf,HeaderTitle:kf,HeaderTimestamp:Sf,HeaderButtonSnooze:Ef,HeaderButtonClose:jf,Body:Of,BodyIcon:Nf,BodyTitle:If,BodyDescription:Pf,Footer:Af,FooterButton:Tf},Mf=g.createContext(Df),_f=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Df,...n}),[n]);return s.jsx(Mf.Provider,{value:e,children:t})});function Ai(t){return{...g.useContext(Mf),...t}}function b0({className:t,notification:n,...e}){const{Header:o,Body:r,Footer:i}=Ai(),{severity:a}=n,c=ee("io-notification",`severity-${(a==null?void 0:a.toLowerCase())??"none"}`,n.state!=="Acknowledged"&&"state-new",t);return s.jsxs("div",{className:c,...e,children:[s.jsx(o,{notification:n}),s.jsx(r,{notification:n}),s.jsx(i,{notification:n})]})}function Ti({components:t,notification:n,...e}){return s.jsx(_f,{components:t,children:s.jsx(b0,{notification:n,...e})})}function Lf({className:t,notifications:n,...e}){const[o,r]=g.useState(!1),i=n.length>=3?"large":"normal",a=n.length===2?"small":i,c=n[0].severity,l=ee("io-notification-stack",o&&"io-notification-stack-open",a!=="normal"&&[`io-notification-stack-${a}`],c&&c!=="None"&&[`io-notification-stack-${c.toLowerCase()}`],t),u=g.useCallback(()=>{r(!0)},[]),f=g.useCallback(d=>{d.stopPropagation(),n.forEach(p=>{p.close()})},[n]);return s.jsxs("div",{className:l,onClick:u,...e,children:[o&&a!=="normal"&&s.jsx("div",{className:"io-notification-stack-btn",children:s.jsx(Ye,{icon:"close",onClick:d=>f(d),children:s.jsx("span",{className:"io-btn-text",children:"Clear Stack"})})}),n.map(d=>s.jsx(Ti,{notification:d},d.id))]})}function x0({...t}){const{notificationStacks:n}=Ne();return s.jsx(s.Fragment,{children:n.map(e=>s.jsx(Lf,{notifications:e.items,...t},e.key))})}_f.displayName="ComponentsStoreProvider";const C0=({notification:t,Notification:n,...e})=>{var h;const{configuration:o,isBulkActionsSupported:r,selectedNotifications:i,selectNotification:a}=Ne(),{isPanelVisible:c,isBulkActionsVisible:l}=Et(),u=((h=o.sourceFilter)==null?void 0:h.muted)??[],f=t.source&&u.includes(t.source)||u.includes("*");if(!c&&f)return null;const d=c&&r&&l,p=i.includes(t.id);return d?s.jsxs("div",{className:ee("io-notification-list-bulk-action-item",{selected:p}),children:[s.jsx(ji,{checked:p,onChange:m=>a(t.id,m.target.checked)}),s.jsx(n,{notification:t,...e})]}):s.jsx(n,{notification:t,...e})};function Is({className:t,Notification:n,notifications:e=[],noNotificationText:o="No notifications to display",...r}){const i=ee("io-notification-list",t),{settings:a}=Ne(),{isPanelVisible:c}=Et(),{toastStacking:l}=a,u=l&&!c,f=e.length>0;return s.jsxs("div",{className:i,...r,children:[u&&s.jsx(x0,{}),!u&&(f?e.map(d=>s.jsx(C0,{notification:d,Notification:n,...r},d.id)):s.jsx("div",{className:"flex jc-center mt-8",children:o}))]})}const Rf={Header:cf,HeaderCaptionTitle:lf,HeaderCaptionCount:function({variant:t="primary",...n}){const{notificationsCount:e=0}=Ne();return e===0?null:s.jsx(em,{variant:t,...n,children:e>99?"99+":e})},HeaderCaptionButtonSettings:function({icon:t="cog",size:n="32",variant:e="circle",...o}){return We()?s.jsx(Ve,{icon:t,size:n,variant:e,...o}):null},HeaderCaptionButtonClose:function({icon:t="close",size:n="32",variant:e="circle",onClick:o,...r}){const{hidePanel:i}=Ne(),a=We();return s.jsx(Ve,{icon:t,size:n,variant:e,onClick:c=>{o?o(c):a&&i()},...r})},HeaderActions:function({className:t,...n}){const e=ee("io-panel-header-actions",t),{HeaderActionSort:o,HeaderActionView:r,HeaderActionClear:i,HeaderActionEdit:a}=ro();return s.jsxs("div",{className:e,...n,children:[s.jsxs(Re,{children:[s.jsx(o,{}),s.jsx(r,{})]}),s.jsxs(Re,{children:[s.jsx(i,{}),s.jsx(a,{})]})]})},HeaderActionSort:function({text:t="Sort by",...n}){const{sortNotificationsBy:e,setSortBy:o}=Et(),{onNotificationsSort:r}=(()=>{const{notifications:i}=Ne(),[a,c]=g.useState(tl),{key:l,descending:u}=a,f=g.useMemo(()=>y0[l](i,u),[i,l,u]);return{onNotificationsSort:g.useCallback(p=>{c(h=>({key:p,descending:h.key!==p?tl.descending:!h.descending}))},[]),sortedNotifications:f}})();return s.jsxs(fe,{variant:"light",...n,children:[s.jsxs(fe.Button,{variant:"link",children:[t," ",s.jsx("strong",{children:w0[e].toLowerCase()})]}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Priority"].map(i=>{const a=i==="Priority"?"severity":i.toLowerCase();return s.jsx(fe.Item,{isSelected:e===a,onClick:()=>{o(a),r(a)},children:i},i)})})})]})},HeaderActionView:function({text:t="View",...n}){var a;const{settings:e}=Ne(),{viewNotificationsBy:o,setViewBy:r}=Et(),i=(a=e.snooze)!=null&&a.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return s.jsxs(fe,{variant:"light",...n,children:[s.jsxs(fe.Button,{variant:"link",children:[t," ",s.jsx("strong",{children:o})]}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",checkIcon:"check",children:i.map(c=>s.jsx(fe.Item,{isSelected:o===c.toLowerCase(),onClick:()=>r(c.toLowerCase()),children:c},c))})})]})},HeaderActionClear:function({text:t="Clear All",...n}){const{clearAll:e,notificationsCount:o}=Ne();return s.jsx(Ye,{variant:"link",text:t,onClick:e,disabled:o===0,...n})},HeaderActionEdit:function({tooltip:t="Bulk Edit",...n}){const{isBulkActionsSupported:e,notificationsCount:o}=Ne(),{showBulkActions:r}=Et();return e?s.jsx(Ve,{icon:"pen-to-square",title:t,size:"32",onClick:r,disabled:o===0,...n}):null},HeaderBulkActions:function({className:t,...n}){const e=ee("io-panel-header-bulk-actions",t),{HeaderBulkActionSelect:o,HeaderBulkActionSelectDropdown:r,HeaderBulkActionMarkAsRead:i,HeaderBulkActionMarkAsUnread:a,HeaderBulkActionSnooze:c,HeaderBulkActionClear:l,HeaderBulkActionClose:u}=ro(),{isBulkActionsSupported:f}=Ne();return f?s.jsx("div",{className:e,...n,children:s.jsxs(Re,{children:[s.jsx(o,{}),s.jsx(r,{}),s.jsx(i,{}),s.jsx(a,{}),s.jsx(c,{}),s.jsx(l,{}),s.jsx(u,{})]})}):null},HeaderBulkActionSelect:function({...t}){const{isBulkActionsSupported:n,selectedNotifications:e,selectAllNotifications:o,notificationsCount:r}=Ne();return n?s.jsx(ji,{checked:r===e.length&&r>0,onChange:i=>o("all",i.target.checked),disabled:r===0,...t}):null},HeaderBulkActionSelectDropdown:function({...t}){const{isBulkActionsSupported:n,selectAllNotifications:e,notificationsCount:o}=Ne();return n?s.jsxs(fe,{variant:"light",...t,children:[s.jsx(fe.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:o===0}),s.jsx(eu,{children:s.jsxs(fe.List,{variant:"single",checkIcon:"check",children:[s.jsx(fe.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map(r=>s.jsx(fe.Item,{onClick:()=>e(r.toLowerCase(),!0),children:r},r))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:t="envelope-open",size:n="32",variant:e="circle",tooltip:o="Mark as read",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:c,notificationsCount:l}=Ne(),u=g.useCallback(()=>{c(a,"Seen")},[a,c]);return i?s.jsx(Ve,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionMarkAsUnread:function({icon:t="envelope",size:n="32",variant:e="circle",tooltip:o="Mark as unread",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:c,notificationsCount:l}=Ne(),u=g.useCallback(()=>{c(a,"Active")},[a,c]);return i?s.jsx(Ve,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionSnooze:function({icon:t="snooze",size:n="32",variant:e="circle",tooltip:o="Snooze",...r}){var d,p;const{isBulkActionsSupported:i,selectedNotifications:a,snoozeMany:c,settings:l,notificationsCount:u}=Ne(),f=g.useCallback(()=>{var h;c(a,((h=l.snooze)==null?void 0:h.duration)??0)},[a,c,(d=l.snooze)==null?void 0:d.duration]);return i&&((p=l.snooze)!=null&&p.enabled)?s.jsx(Ve,{icon:t,size:n,variant:e,title:o,onClick:f,disabled:u===0,...r}):null},HeaderBulkActionClear:function({icon:t="trash",size:n="32",variant:e="circle",tooltip:o="Clear",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,clearMany:c,notificationsCount:l}=Ne(),u=g.useCallback(()=>{c(a)},[a,c]);return i?s.jsx(Ve,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionClose:function({text:t="Done",variant:n="primary",...e}){const{isBulkActionsSupported:o,notificationsCount:r}=Ne(),{hideBulkActions:i}=Et();return o?s.jsx(Ye,{variant:n,text:t,onClick:i,disabled:r===0,...e}):null},HeaderSearch:function({className:t,placeholder:n="Search",iconPrepend:e="search",iconAppend:o="close",...r}){const i=ee("io-panel-header-search",t),a=g.useRef(null),{notificationsCount:c}=Ne(),{searchQuery:l,setSearch:u}=Et(),f=l.length>0,d=g.useCallback(()=>{u(""),a.current&&a.current.focus()},[u]);return s.jsxs("div",{className:i,children:[s.jsx(no,{ref:a,value:l,iconPrepend:e,iconAppend:f?o:void 0,iconAppendOnClick:f?d:void 0,placeholder:n,onChange:p=>u(p.target.value),...r}),f&&s.jsx("p",{className:"io-panel-header-search-count",children:`${c} results`})]})},Body:hf,Footer:mf,FooterButtons:gf,FooterButtonClearAll:vf,FooterButtonClearAllOld:yf,Notification:Ti,NotificationsList:Is},Ff=g.createContext(Rf),Bf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Rf,...n}),[n]);return s.jsx(Ff.Provider,{value:e,children:t})});function ro(t){return{...g.useContext(Ff),...t}}function Hf(){var r,i;const t=g.useContext(Me.IOConnectContext),{settings:n}=Ne(),e=We(),o=g.useCallback(async()=>{var l;const a=t.windows.my();if(!t||!a||!e)return;const c=a.placementSettings;await a.place({...c,horizontalAlignment:(l=n.placement)==null?void 0:l.panel})},[t,e,(r=n.placement)==null?void 0:r.panel]);g.useEffect(()=>{var a;t&&((a=n.placement)!=null&&a.panel)&&e&&o().catch(console.error)},[t,e,o,(i=n.placement)==null?void 0:i.panel])}function k0({className:t,onClose:n,title:e="Notifications",...o}){var p,h;const{Header:r,Body:i}=ro(),{settings:a}=Ne(),{isPanelVisible:c}=Et(),[l,u]=g.useState(!1),f=We(),d=ee("io-notifications-panel",((p=a.placement)==null?void 0:p.panel)==="left"&&"io-panel-left",((h=a.placement)==null?void 0:h.panel)==="right"&&"io-panel-right",t);return Hf(),g.useEffect(()=>{c||u(!1)},[c]),s.jsxs(s.Fragment,{children:[s.jsxs(Ge,{className:d,...o,children:[s.jsx(r,{title:e,onClose:n,onOpenSettings:()=>u(!0)}),s.jsx(i,{})]}),f&&c&&s.jsx(m0,{isOpen:l,onClose:()=>u(!1)})]})}Bf.displayName="ComponentsStoreProvider";const Wf={Body:function({className:t,notifications:n,maxToasts:e=1,...o}){const r=ee("io-toasts-body",t),{NotificationsList:i,Notification:a}=Uf(),[c,l]=g.useState([]);return g.useEffect(()=>{const u=e<0?n.length:e,f=n.filter(d=>d.state==="Active").slice(0,u);for(const d of f)d.onShow();l(f)},[n,e]),s.jsx("div",{className:r,...o,children:s.jsx(i,{Notification:a,notifications:c,noNotificationText:""})})},Notification:Ti,NotificationsList:Is},$f=g.createContext(Wf),zf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Wf,...n}),[n]);return s.jsx($f.Provider,{value:e,children:t})});function Uf(t){return{...g.useContext($f),...t}}function Vf(){var o,r;const t=g.useContext(Me.IOConnectContext),{settings:n}=Ne(),e=g.useCallback(async()=>{var c,l;const i=t.windows.my();if(!t||!i)return;const a=i.placementSettings;await i.place({...a,horizontalAlignment:((c=n.placement)==null?void 0:c.toasts)==="top-right"||((l=n.placement)==null?void 0:l.toasts)==="bottom-right"?"right":"left"})},[t,(o=n.placement)==null?void 0:o.toasts]);g.useEffect(()=>{var i;t&&((i=n.placement)!=null&&i.toasts)&&e().catch(console.error)},[t,e,(r=n.placement)==null?void 0:r.toasts])}function S0({className:t,maxToasts:n=10,...e}){var u,f,d,p,h,m,v,y;const{Header:o,Body:r,Footer:i}=Uf(),{notifications:a,settings:c}=Ne(),l=ee("io-toasts",(((u=c.placement)==null?void 0:u.toasts)==="top-left"||((f=c.placement)==null?void 0:f.toasts)==="top-right")&&"io-toasts-top",(((d=c.placement)==null?void 0:d.toasts)==="top-right"||((p=c.placement)==null?void 0:p.toasts)==="bottom-right")&&"io-toasts-right",(((h=c.placement)==null?void 0:h.toasts)==="bottom-left"||((m=c.placement)==null?void 0:m.toasts)==="bottom-right")&&"io-toasts-bottom",(((v=c.placement)==null?void 0:v.toasts)==="top-left"||((y=c.placement)==null?void 0:y.toasts)==="bottom-left")&&"io-toasts-left",t);return Vf(),s.jsxs("div",{className:l,...e,children:[o&&s.jsx(o,{}),s.jsx(r,{notifications:a,maxToasts:n}),i&&s.jsx(i,{})]})}zf.displayName="ComponentsStoreProvider";var Ps=Object.freeze({__proto__:null,Notification:Ti,NotificationBody:Of,NotificationBodyDescription:Pf,NotificationBodyIcon:Nf,NotificationBodyTitle:If,NotificationFooter:Af,NotificationFooterButton:Tf,NotificationHeader:wf,NotificationHeaderBadge:xf,NotificationHeaderButtonClose:jf,NotificationHeaderButtonSnooze:Ef,NotificationHeaderCount:bf,NotificationHeaderIcon:Cf,NotificationHeaderTimestamp:Sf,NotificationHeaderTitle:kf,NotificationStack:Lf,NotificationsList:Is,NotificationsPanelProvider:({children:t})=>{const{searchQuery:n,setSearch:e,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:c,isBulkActionsVisible:l,showBulkActions:u,hideBulkActions:f}=function(){const p=g.useContext(Me.IOConnectContext),[h,m]=g.useState(!1),[v,y]=g.useState("newest"),[k,S]=g.useState("all"),[b,w]=g.useState(""),[E,O]=g.useState(!1),F=We(),{isBulkActionsSupported:R}=Ne();return g.useEffect(()=>{const U=tt.onPanelVisibilityChanged(K=>m(K));return()=>{U()}},[]),g.useEffect(()=>{F!==null&&F&&(async()=>{const U=await p.notifications.panel.isVisible();m(U)})()},[p.notifications.panel,F]),g.useEffect(()=>{h||(O(!1),S("all"))},[h]),{isPanelVisible:h,sortNotificationsBy:v,setSortBy:U=>{y(U)},viewNotificationsBy:k,setViewBy:U=>{S(U)},searchQuery:b,setSearch:U=>{w(U)},isBulkActionsVisible:E,showBulkActions:()=>{R&&O(!0)},hideBulkActions:()=>{R&&O(!1)}}}(),d=g.useMemo(()=>({searchQuery:n,setSearch:e,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:c,isBulkActionsVisible:l,showBulkActions:u,hideBulkActions:f}),[n,e,o,r,i,a,c,l,u,f]);return s.jsx(sf.Provider,{value:d,children:t})},NotificationsProvider:({children:t})=>{const{notifications:n,notificationStacks:e,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:c,allowedApplications:l,clearAll:u,clearAllOld:f,close:d,hidePanel:p,showPanel:h,saveSetting:m,saveFilter:v,saveAllFilter:y,isBulkActionsSupported:k,selectedNotifications:S,selectNotification:b,selectAllNotifications:w,clearMany:E,snooze:O,snoozeMany:F,setState:R,setStates:U,setCount:K}=f0(),_=g.useMemo(()=>({notifications:n,notificationStacks:e,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:c,allowedApplications:l,clearAll:u,clearAllOld:f,onClose:d,hidePanel:p,showPanel:h,saveSetting:m,saveFilter:v,saveAllFilter:y,isBulkActionsSupported:k,selectedNotifications:S,selectNotification:b,selectAllNotifications:w,clearMany:E,snooze:O,snoozeMany:F,setState:R,setStates:U,setCount:K}),[n,e,o,r,i,a,c,l,u,f,d,p,h,m,v,y,k,S,b,w,E,O,F,R,U,K]);return s.jsx(Rd.Provider,{value:_,children:t})},Panel:function({components:t,settings:n,...e}){return s.jsx(js,{components:n,children:s.jsx(Bf,{components:t,children:s.jsx(k0,{...e})})})},PanelBody:hf,PanelFooter:mf,PanelFooterButtonClearAll:vf,PanelFooterButtonClearAllOld:yf,PanelFooterButtons:gf,PanelHeader:cf,PanelHeaderCaptionTitle:lf,SettingsAllowNotificationToasts:Bd,SettingsAllowNotifications:Fd,SettingsCloseNotificationOnClick:Wd,SettingsGeneral:Md,SettingsHideToastsAfter:zd,SettingsPanel:Os,SettingsPanelAutoHide:$d,SettingsPlacement:Yd,SettingsPlacementPanel:Kd,SettingsPlacementToasts:qd,SettingsShowNotificationBadge:Hd,SettingsSnooze:Jd,SettingsSnoozeDuration:Xd,SettingsStacking:Ud,SettingsSubscribeAll:ef,SettingsSubscribeApp:tf,SettingsSubscribeMuteAll:nf,SettingsSubscribeMuteApp:of,SettingsSubscriptions:Qd,SettingsToastStackBy:Gd,SettingsToastStacking:Vd,Toasts:function({components:t,...n}){return s.jsx(zf,{components:t,children:s.jsx(S0,{...n})})},useAddRemoveApps:Es,useHidePanelOnFocusLost:function(t=!0){const n=g.useContext(Me.IOConnectContext),e=We();return g.useEffect(()=>{var r;if(!n||!t||e===null||!e)return;const o=(r=n.windows.my())==null?void 0:r.onFocusChanged(i=>{i.isFocused||n.notifications.panel.hide().catch(a=>{console.error("Error hiding panel:",a)})});return()=>o==null?void 0:o()},[n,e,t]),n},useHidePanelOnKeyUp:function(t="Escape"){const{hidePanel:n}=Ne();og(t,n)},useNotificationStacking:_d,useNotificationsContext:Ne,useNotificationsPanelContext:Et,usePanelWindowPlacement:Hf,useSelectNotifications:Ld,useShowHidePanelWindow:function(t=!0){const n=g.useContext(Me.IOConnectContext),e=n==null?void 0:n.windows.my(),o=We(),{isPanelVisible:r}=Et();return g.useEffect(()=>{n&&e&&o&&(r?e.show().then(()=>{t&&e.focus().catch(i=>{console.error("Error focusing window:",i)})}).catch(i=>console.error("Error showing window:",i)):e.hide().catch(i=>console.error("Error hiding window:",i)))},[n,e,o,r,t]),{myWindow:e}},useToastsWindowPlacement:Vf});const E0=t=>{const{General:n,Layouts:e,Downloads:o,System:r}=_o();return s.jsxs(Oo,{...t,children:[s.jsx(n,{}),s.jsx(e,{}),s.jsx(o,{}),s.jsx(r,{})]})},j0=({title:t="General",...n})=>{const{Theme:e,PinnedPosition:o,MinimizeToTray:r,ShowTutorialOnStartup:i}=_o();return s.jsxs(Ke,{title:t,...n,children:[s.jsx(e,{}),s.jsx(o,{}),s.jsx(r,{}),s.jsx(i,{})]})},nl=(t="dark")=>{switch(t){case"dark":return"Dark";case"light":return"Light";default:return t}},As=({className:t,title:n="Theme",...e})=>{const{currentTheme:o,selectTheme:r}=(()=>{const a=g.useContext(Me.IOConnectContext),[c,l]=g.useState(null),u=g.useCallback(f=>{var d;return(d=a==null?void 0:a.themes)==null?void 0:d.select(f)},[a]);return g.useEffect(()=>{var p,h;if(!a)return;let f=!1;const d=m=>{f||l(m)};return(p=a.themes)==null||p.onChanged(d),(h=a.themes)==null||h.getCurrent().then(d).catch(console.warn),()=>{f=!0}},[a]),{currentTheme:c,selectTheme:u}})(),i=(()=>{const a=g.useContext(Me.IOConnectContext),[c,l]=g.useState([]);return g.useEffect(()=>{var u;a&&((u=a.themes)==null||u.list().then(l).catch(console.warn))},[a]),c})();return s.jsxs("div",{className:ee("flex jc-between ai-center",t),"data-testid":"theme-container",...e,children:[s.jsx("label",{className:"io-text-clipper","data-testid":"theme-label",children:n}),s.jsxs(fe,{variant:"light","data-testid":"theme-dropdown",children:[s.jsx(fe.Button,{text:nl(o==null?void 0:o.name),"data-testid":"theme-dropdown-button"}),s.jsx(fe.Content,{"data-testid":"theme-dropdown-content",children:s.jsx(fe.List,{children:i.map(({name:a})=>s.jsx(fe.Item,{onClick:()=>r(a),"data-testid":`theme-dropdown-item-${a}`,children:nl(a)},a))})})]})]})},O0=({prefKey:t,options:n,disabled:e,...o})=>{const{isLoading:r,value:i="Select option",update:a}=Wt({prefKey:t});return s.jsxs(fe,{variant:"light",disabled:r||e,...o,children:[s.jsx(fe.Button,{children:i}),s.jsx(fe.Content,{children:s.jsx(fe.List,{children:n.map(c=>s.jsx(fe.Item,{onClick:()=>(async l=>{if(l!==i)try{await a(l)}catch(u){console.error("Failed to update platform preference:",u)}})(c),children:c},c))})})]})},N0=({className:t,label:n="Pinned position",...e})=>s.jsx(Ke,{className:ee("io-block-list-gap",t),...e,children:s.jsxs("div",{className:"flex jc-between ai-center",children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsx(O0,{className:t,prefKey:zu,options:["Left","Right"],...e})]})}),yn=({prefKey:t,...n})=>{const{isLoading:e,value:o=!1,update:r}=Wt({prefKey:t});return s.jsx(ft,{checked:o,disabled:e,onChange:i=>r(i.target.checked),...n})},I0=({align:t="right",label:n="Allow docking",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Uu,...e}),P0=({align:t="right",label:n="Minimize to tray",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Vu,...e}),A0=({align:t="right",label:n="Auto-close on starting apps and workspaces",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Gu,disabled:!0,...e}),T0=({align:t="right",label:n="Show tutorial on startup",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Yu,...e}),D0=({title:t="Layouts",...n})=>{const{LayoutsSaveCurrentOnExit:e,LayoutsShowDeletePrompt:o,LayoutsShowUnsavedChangesPrompt:r}=_o();return s.jsxs(Ke,{title:t,...n,children:[s.jsx(e,{}),s.jsx(r,{}),s.jsx(o,{})]})},M0=({align:t="right",label:n="Restore last saved on startup",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Zu,...e}),_0=({align:t="right",label:n="Save current on exit",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Ku,...e}),Ts=({align:t="right",label:n="Show prompt for unsaved changes",...e})=>s.jsx(yn,{align:t,label:n,prefKey:qu,"data-testid":"layouts-show-unsaved-changes-prompt-toggle-button",...e}),Ds=({align:t="right",label:n="Show prompt for deleting",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Ju,"data-testid":"layouts-show-delete-prompt-toggle",...e}),L0=({className:t,title:n="Downloads",...e})=>{const{DownloadsLocation:o}=_o();return s.jsx(Ke,{className:ee("io-block-list-gap",t),title:n,...e,children:s.jsx(o,{})})},R0=({align:t="right",label:n="Ask where to save each file before downloading",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Xu,...e}),F0=({className:t,label:n="Location",...e})=>{const{configuration:{downloadFolder:o},setDownloadLocationWithDialog:r,isDownloadLocationDialogVisible:i,downloadLocationList:a}=vn();return s.jsxs(Ke,{className:ee("io-preferences-download-section",t),...e,children:[s.jsxs("div",{className:"flex jc-between ai-center",children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsx(Ye,{text:"Change",onClick:r,disabled:i})]}),s.jsx("p",{children:o??(a==null?void 0:a[0])??"Not set"})]})},B0=({className:t,title:n="System",...e})=>{const{SystemRestartSection:o,SystemShutdownSection:r}=_o();return s.jsxs(Ke,{className:ee("io-block-list-gap",t),title:n,...e,children:[s.jsx(o,{}),s.jsx(r,{})]})};var aa=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Co={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return typeof console<"u"&&console.warn(t)},getWeek:function(t){var n=new Date(t.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var e=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},fr={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var n=t%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Tt=function(t,n){return n===void 0&&(n=2),("000"+t).slice(-1*n)},Vt=function(t){return t===!0?1:0};function ol(t,n){var e;return function(){var o=this,r=arguments;clearTimeout(e),e=setTimeout(function(){return t.apply(o,r)},n)}}var sa=function(t){return t instanceof Array?t:[t]};function Ot(t,n,e){if(e===!0)return t.classList.add(n);t.classList.remove(n)}function He(t,n,e){var o=window.document.createElement(t);return n=n||"",e=e||"",o.className=n,e!==void 0&&(o.textContent=e),o}function Mr(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Gf(t,n){return n(t)?t:t.parentNode?Gf(t.parentNode,n):void 0}function _r(t,n){var e=He("div","numInputWrapper"),o=He("input","numInput "+t),r=He("span","arrowUp"),i=He("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?o.type="number":(o.type="text",o.pattern="\\d*"),n!==void 0)for(var a in n)o.setAttribute(a,n[a]);return e.appendChild(o),e.appendChild(r),e.appendChild(i),e}function Rt(t){try{return typeof t.composedPath=="function"?t.composedPath()[0]:t.target}catch{return t.target}}var ca=function(){},si=function(t,n,e){return e.months[n?"shorthand":"longhand"][t]},H0={D:ca,F:function(t,n,e){t.setMonth(e.months.longhand.indexOf(n))},G:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},H:function(t,n){t.setHours(parseFloat(n))},J:function(t,n){t.setDate(parseFloat(n))},K:function(t,n,e){t.setHours(t.getHours()%12+12*Vt(new RegExp(e.amPM[1],"i").test(n)))},M:function(t,n,e){t.setMonth(e.months.shorthand.indexOf(n))},S:function(t,n){t.setSeconds(parseFloat(n))},U:function(t,n){return new Date(1e3*parseFloat(n))},W:function(t,n,e){var o=parseInt(n),r=new Date(t.getFullYear(),0,2+7*(o-1),0,0,0,0);return r.setDate(r.getDate()-r.getDay()+e.firstDayOfWeek),r},Y:function(t,n){t.setFullYear(parseFloat(n))},Z:function(t,n){return new Date(n)},d:function(t,n){t.setDate(parseFloat(n))},h:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},i:function(t,n){t.setMinutes(parseFloat(n))},j:function(t,n){t.setDate(parseFloat(n))},l:ca,m:function(t,n){t.setMonth(parseFloat(n)-1)},n:function(t,n){t.setMonth(parseFloat(n)-1)},s:function(t,n){t.setSeconds(parseFloat(n))},u:function(t,n){return new Date(parseFloat(n))},w:ca,y:function(t,n){t.setFullYear(2e3+parseFloat(n))}},Gn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},rr={Z:function(t){return t.toISOString()},D:function(t,n,e){return n.weekdays.shorthand[rr.w(t,n,e)]},F:function(t,n,e){return si(rr.n(t,n,e)-1,!1,n)},G:function(t,n,e){return Tt(rr.h(t,n,e))},H:function(t){return Tt(t.getHours())},J:function(t,n){return n.ordinal!==void 0?t.getDate()+n.ordinal(t.getDate()):t.getDate()},K:function(t,n){return n.amPM[Vt(t.getHours()>11)]},M:function(t,n){return si(t.getMonth(),!0,n)},S:function(t){return Tt(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,n,e){return e.getWeek(t)},Y:function(t){return Tt(t.getFullYear(),4)},d:function(t){return Tt(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return Tt(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,n){return n.weekdays.longhand[t.getDay()]},m:function(t){return Tt(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}},Yf=function(t){var n=t.config,e=n===void 0?Co:n,o=t.l10n,r=o===void 0?fr:o,i=t.isMobile,a=i!==void 0&&i;return function(c,l,u){var f=u||r;return e.formatDate===void 0||a?l.split("").map(function(d,p,h){return rr[d]&&h[p-1]!=="\\"?rr[d](c,f,e):d!=="\\"?d:""}).join(""):e.formatDate(c,l,f)}},Za=function(t){var n=t.config,e=n===void 0?Co:n,o=t.l10n,r=o===void 0?fr:o;return function(i,a,c,l){if(i===0||i){var u,f=l||r,d=i;if(i instanceof Date)u=new Date(i.getTime());else if(typeof i!="string"&&i.toFixed!==void 0)u=new Date(i);else if(typeof i=="string"){var p=a||(e||Co).dateFormat,h=String(i).trim();if(h==="today")u=new Date,c=!0;else if(e&&e.parseDate)u=e.parseDate(i,p);else if(/Z$/.test(h)||/GMT$/.test(h))u=new Date(i);else{for(var m=void 0,v=[],y=0,k=0,S="";y<p.length;y++){var b=p[y],w=b==="\\",E=p[y-1]==="\\"||w;if(Gn[b]&&!E){S+=Gn[b];var O=new RegExp(S).exec(i);O&&(m=!0)&&v[b!=="Y"?"push":"unshift"]({fn:H0[b],val:O[++k]})}else w||(S+=".")}u=e&&e.noCalendar?new Date(new Date().setHours(0,0,0,0)):new Date(new Date().getFullYear(),0,1,0,0,0,0),v.forEach(function(F){var R=F.fn,U=F.val;return u=R(u,U,f)||u}),u=m?u:void 0}}if(u instanceof Date&&!isNaN(u.getTime()))return c===!0&&u.setHours(0,0,0,0),u;e.errorHandler(new Error("Invalid date provided: "+d))}}};function Ft(t,n,e){return e===void 0&&(e=!0),e!==!1?new Date(t.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):t.getTime()-n.getTime()}var la=function(t,n,e){return 3600*t+60*n+e},W0=864e5;function ua(t){var n=t.defaultHour,e=t.defaultMinute,o=t.defaultSeconds;if(t.minDate!==void 0){var r=t.minDate.getHours(),i=t.minDate.getMinutes(),a=t.minDate.getSeconds();n<r&&(n=r),n===r&&e<i&&(e=i),n===r&&e===i&&o<a&&(o=t.minDate.getSeconds())}if(t.maxDate!==void 0){var c=t.maxDate.getHours(),l=t.maxDate.getMinutes();(n=Math.min(n,c))===c&&(e=Math.min(l,e)),n===c&&e===l&&(o=t.maxDate.getSeconds())}return{hours:n,minutes:e,seconds:o}}typeof Object.assign!="function"&&(Object.assign=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];if(!t)throw TypeError("Cannot convert undefined or null to object");for(var o=function(a){a&&Object.keys(a).forEach(function(c){return t[c]=a[c]})},r=0,i=n;r<i.length;r++)o(i[r]);return t});var Ct=function(){return Ct=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Ct.apply(this,arguments)},rl=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var o=Array(t),r=0;for(n=0;n<e;n++)for(var i=arguments[n],a=0,c=i.length;a<c;a++,r++)o[r]=i[a];return o};function $0(t,n){var e={config:Ct(Ct({},Co),nt.defaultConfig),l10n:fr};function o(){var C;return((C=e.calendarContainer)===null||C===void 0?void 0:C.getRootNode()).activeElement||document.activeElement}function r(C){return C.bind(e)}function i(){var C=e.config;C.weekNumbers===!1&&C.showMonths===1||C.noCalendar!==!0&&window.requestAnimationFrame(function(){if(e.calendarContainer!==void 0&&(e.calendarContainer.style.visibility="hidden",e.calendarContainer.style.display="block"),e.daysContainer!==void 0){var x=(e.days.offsetWidth+1)*C.showMonths;e.daysContainer.style.width=x+"px",e.calendarContainer.style.width=x+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function a(C){if(e.selectedDates.length===0){var x=e.config.minDate===void 0||Ft(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),j=ua(e.config);x.setHours(j.hours,j.minutes,j.seconds,x.getMilliseconds()),e.selectedDates=[x],e.latestSelectedDateObj=x}C!==void 0&&C.type!=="blur"&&function(L){L.preventDefault();var ne=L.type==="keydown",ve=Rt(L),$=ve;e.amPM!==void 0&&ve===e.amPM&&(e.amPM.textContent=e.l10n.amPM[Vt(e.amPM.textContent===e.l10n.amPM[0])]);var V=parseFloat($.getAttribute("min")),z=parseFloat($.getAttribute("max")),te=parseFloat($.getAttribute("step")),le=parseInt($.value,10),ge=L.delta||(ne?L.which===38?1:-1:0),se=le+te*ge;if($.value!==void 0&&$.value.length===2){var G=$===e.hourElement,Se=$===e.minuteElement;se<V?(se=z+se+Vt(!G)+(Vt(G)&&Vt(!e.amPM)),Se&&v(void 0,-1,e.hourElement)):se>z&&(se=$===e.hourElement?se-z-Vt(!e.amPM):V,Se&&v(void 0,1,e.hourElement)),e.amPM&&G&&(te===1?se+le===23:Math.abs(se-le)>te)&&(e.amPM.textContent=e.l10n.amPM[Vt(e.amPM.textContent===e.l10n.amPM[0])]),$.value=Tt(se)}}(C);var N=e._input.value;c(),Te(),e._input.value!==N&&e._debouncedChange()}function c(){if(e.hourElement!==void 0&&e.minuteElement!==void 0){var C,x,j=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,N=(parseInt(e.minuteElement.value,10)||0)%60,L=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(C=j,x=e.amPM.textContent,j=C%12+12*Vt(x===e.l10n.amPM[1]));var ne=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Ft(e.latestSelectedDateObj,e.config.minDate,!0)===0,ve=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&Ft(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var $=la(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),V=la(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),z=la(j,N,L);if(z>V&&z<$){var te=function(se){var G=Math.floor(se/3600),Se=(se-3600*G)/60;return[G,Se,se-3600*G-60*Se]}($);j=te[0],N=te[1],L=te[2]}}else{if(ve){var le=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;(j=Math.min(j,le.getHours()))===le.getHours()&&(N=Math.min(N,le.getMinutes())),N===le.getMinutes()&&(L=Math.min(L,le.getSeconds()))}if(ne){var ge=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;(j=Math.max(j,ge.getHours()))===ge.getHours()&&N<ge.getMinutes()&&(N=ge.getMinutes()),N===ge.getMinutes()&&(L=Math.max(L,ge.getSeconds()))}}u(j,N,L)}}function l(C){var x=C||e.latestSelectedDateObj;x&&x instanceof Date&&u(x.getHours(),x.getMinutes(),x.getSeconds())}function u(C,x,j){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(C%24,x,j||0,0),e.hourElement&&e.minuteElement&&!e.isMobile&&(e.hourElement.value=Tt(e.config.time_24hr?C:(12+C)%12+12*Vt(C%12==0)),e.minuteElement.value=Tt(x),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[Vt(C>=12)]),e.secondElement!==void 0&&(e.secondElement.value=Tt(j)))}function f(C){var x=Rt(C),j=parseInt(x.value)+(C.delta||0);(j/1e3>1||C.key==="Enter"&&!/[^\d]/.test(j.toString()))&&de(j)}function d(C,x,j,N){return x instanceof Array?x.forEach(function(L){return d(C,L,j,N)}):C instanceof Array?C.forEach(function(L){return d(L,x,j,N)}):(C.addEventListener(x,j,N),void e._handlers.push({remove:function(){return C.removeEventListener(x,j,N)}}))}function p(){I("onChange")}function h(C,x){var j=C!==void 0?e.parseDate(C):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now),N=e.currentYear,L=e.currentMonth;try{j!==void 0&&(e.currentYear=j.getFullYear(),e.currentMonth=j.getMonth())}catch(ne){ne.message="Invalid date supplied: "+j,e.config.errorHandler(ne)}x&&e.currentYear!==N&&(I("onYearChange"),O()),!x||e.currentYear===N&&e.currentMonth===L||I("onMonthChange"),e.redraw()}function m(C){var x=Rt(C);~x.className.indexOf("arrow")&&v(C,x.classList.contains("arrowUp")?1:-1)}function v(C,x,j){var N=C&&Rt(C),L=j||N&&N.parentNode&&N.parentNode.firstChild,ne=Ce("increment");ne.delta=x,L&&L.dispatchEvent(ne)}function y(C,x,j,N){var L=re(x,!0),ne=He("span",C,x.getDate().toString());return ne.dateObj=x,ne.$i=N,ne.setAttribute("aria-label",e.formatDate(x,e.config.ariaDateFormat)),C.indexOf("hidden")===-1&&Ft(x,e.now)===0&&(e.todayDateElem=ne,ne.classList.add("today"),ne.setAttribute("aria-current","date")),L?(ne.tabIndex=-1,ke(x)&&(ne.classList.add("selected"),e.selectedDateElem=ne,e.config.mode==="range"&&(Ot(ne,"startRange",e.selectedDates[0]&&Ft(x,e.selectedDates[0],!0)===0),Ot(ne,"endRange",e.selectedDates[1]&&Ft(x,e.selectedDates[1],!0)===0),C==="nextMonthDay"&&ne.classList.add("inRange")))):ne.classList.add("flatpickr-disabled"),e.config.mode==="range"&&function(ve){return!(e.config.mode!=="range"||e.selectedDates.length<2)&&Ft(ve,e.selectedDates[0])>=0&&Ft(ve,e.selectedDates[1])<=0}(x)&&!ke(x)&&ne.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&C!=="prevMonthDay"&&N%7==6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(x)+"</span>"),I("onDayCreate",ne),ne}function k(C){C.focus(),e.config.mode==="range"&&ae(C)}function S(C){for(var x=C>0?0:e.config.showMonths-1,j=C>0?e.config.showMonths:-1,N=x;N!=j;N+=C)for(var L=e.daysContainer.children[N],ne=C>0?0:L.children.length-1,ve=C>0?L.children.length:-1,$=ne;$!=ve;$+=C){var V=L.children[$];if(V.className.indexOf("hidden")===-1&&re(V.dateObj))return V}}function b(C,x){var j=o(),N=ye(j||document.body),L=C!==void 0?C:N?j:e.selectedDateElem!==void 0&&ye(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&ye(e.todayDateElem)?e.todayDateElem:S(x>0?1:-1);L===void 0?e._input.focus():N?function(ne,ve){for(var $=ne.className.indexOf("Month")===-1?ne.dateObj.getMonth():e.currentMonth,V=ve>0?e.config.showMonths:-1,z=ve>0?1:-1,te=$-e.currentMonth;te!=V;te+=z)for(var le=e.daysContainer.children[te],ge=$-e.currentMonth===te?ne.$i+ve:ve<0?le.children.length-1:0,se=le.children.length,G=ge;G>=0&&G<se&&G!=(ve>0?se:-1);G+=z){var Se=le.children[G];if(Se.className.indexOf("hidden")===-1&&re(Se.dateObj)&&Math.abs(ne.$i-G)>=Math.abs(ve))return k(Se)}e.changeMonth(z),b(S(z),0)}(L,x):k(L)}function w(C,x){for(var j=(new Date(C,x,1).getDay()-e.l10n.firstDayOfWeek+7)%7,N=e.utils.getDaysInMonth((x-1+12)%12,C),L=e.utils.getDaysInMonth(x,C),ne=window.document.createDocumentFragment(),ve=e.config.showMonths>1,$=ve?"prevMonthDay hidden":"prevMonthDay",V=ve?"nextMonthDay hidden":"nextMonthDay",z=N+1-j,te=0;z<=N;z++,te++)ne.appendChild(y("flatpickr-day "+$,new Date(C,x-1,z),0,te));for(z=1;z<=L;z++,te++)ne.appendChild(y("flatpickr-day",new Date(C,x,z),0,te));for(var le=L+1;le<=42-j&&(e.config.showMonths===1||te%7!=0);le++,te++)ne.appendChild(y("flatpickr-day "+V,new Date(C,x+1,le%L),0,te));var ge=He("div","dayContainer");return ge.appendChild(ne),ge}function E(){if(e.daysContainer!==void 0){Mr(e.daysContainer),e.weekNumbers&&Mr(e.weekNumbers);for(var C=document.createDocumentFragment(),x=0;x<e.config.showMonths;x++){var j=new Date(e.currentYear,e.currentMonth,1);j.setMonth(e.currentMonth+x),C.appendChild(w(j.getFullYear(),j.getMonth()))}e.daysContainer.appendChild(C),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&ae()}}function O(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var C=function(N){return!(e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&N<e.config.minDate.getMonth())&&!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&N>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var x=0;x<12;x++)if(C(x)){var j=He("option","flatpickr-monthDropdown-month");j.value=new Date(e.currentYear,x).getMonth().toString(),j.textContent=si(x,e.config.shorthandCurrentMonth,e.l10n),j.tabIndex=-1,e.currentMonth===x&&(j.selected=!0),e.monthsDropdownContainer.appendChild(j)}}}function F(){var C,x=He("div","flatpickr-month"),j=window.document.createDocumentFragment();e.config.showMonths>1||e.config.monthSelectorType==="static"?C=He("span","cur-month"):(e.monthsDropdownContainer=He("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),d(e.monthsDropdownContainer,"change",function(ve){var $=Rt(ve),V=parseInt($.value,10);e.changeMonth(V-e.currentMonth),I("onMonthChange")}),O(),C=e.monthsDropdownContainer);var N=_r("cur-year",{tabindex:"-1"}),L=N.getElementsByTagName("input")[0];L.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&L.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(L.setAttribute("max",e.config.maxDate.getFullYear().toString()),L.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var ne=He("div","flatpickr-current-month");return ne.appendChild(C),ne.appendChild(N),j.appendChild(ne),x.appendChild(j),{container:x,yearElement:L,monthElement:C}}function R(){Mr(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var C=e.config.showMonths;C--;){var x=F();e.yearElements.push(x.yearElement),e.monthElements.push(x.monthElement),e.monthNav.appendChild(x.container)}e.monthNav.appendChild(e.nextMonthNav)}function U(){e.weekdayContainer?Mr(e.weekdayContainer):e.weekdayContainer=He("div","flatpickr-weekdays");for(var C=e.config.showMonths;C--;){var x=He("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(x)}return K(),e.weekdayContainer}function K(){if(e.weekdayContainer){var C=e.l10n.firstDayOfWeek,x=rl(e.l10n.weekdays.shorthand);C>0&&C<x.length&&(x=rl(x.splice(C,x.length),x.splice(0,C)));for(var j=e.config.showMonths;j--;)e.weekdayContainer.children[j].innerHTML=`
8
+ */var ti=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),xu=typeof Element>"u",jo=xu?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$r=!xu&&Element.prototype.getRootNode?function(t){var n;return t==null||(n=t.getRootNode)===null||n===void 0?void 0:n.call(t)}:function(t){return t==null?void 0:t.ownerDocument},ni=function t(n,e){var o;e===void 0&&(e=!0);var r=n==null||(o=n.getAttribute)===null||o===void 0?void 0:o.call(n,"inert");return r===""||r==="true"||e&&n&&t(n.parentNode)},gm=function t(n,e,o){for(var r=[],i=Array.from(n);i.length;){var a=i.shift();if(!ni(a,!1))if(a.tagName==="SLOT"){var c=a.assignedElements(),l=t(c.length?c:a.children,!0,o);o.flatten?r.push.apply(r,l):r.push({scopeParent:a,candidates:l})}else{jo.call(a,ti)&&o.filter(a)&&(e||!n.includes(a))&&r.push(a);var u=a.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(a),f=!ni(u,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(a));if(u&&f){var d=t(u===!0?a.children:u.children,!0,o);o.flatten?r.push.apply(r,d):r.push({scopeParent:a,candidates:d})}else i.unshift.apply(i,a.children)}}return r},Cu=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ku=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||function(n){var e,o=n==null||(e=n.getAttribute)===null||e===void 0?void 0:e.call(n,"contenteditable");return o===""||o==="true"}(t))&&!Cu(t)?0:t.tabIndex},vm=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Su=function(t){return t.tagName==="INPUT"},ym=function(t){return function(n){return Su(n)&&n.type==="radio"}(t)&&!function(n){if(!n.name)return!0;var e,o=n.form||$r(n),r=function(a){return o.querySelectorAll('input[type="radio"][name="'+a+'"]')};if(typeof window<"u"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")e=r(window.CSS.escape(n.name));else try{e=r(n.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var i=function(a,c){for(var l=0;l<a.length;l++)if(a[l].checked&&a[l].form===c)return a[l]}(e,n.form);return!i||i===n}(t)},wc=function(t){var n=t.getBoundingClientRect(),e=n.width,o=n.height;return e===0&&o===0},wm=function(t,n){var e=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var r=jo.call(t,"details>summary:first-of-type")?t.parentElement:t;if(jo.call(r,"details:not([open]) *"))return!0;if(e&&e!=="full"&&e!=="legacy-full"){if(e==="non-zero-area")return wc(t)}else{if(typeof o=="function"){for(var i=t;t;){var a=t.parentElement,c=$r(t);if(a&&!a.shadowRoot&&o(a)===!0)return wc(t);t=t.assignedSlot?t.assignedSlot:a||c===t.ownerDocument?a:c.host}t=i}if(function(l){var u,f,d,p,h=l&&$r(l),m=(u=h)===null||u===void 0?void 0:u.host,v=!1;if(h&&h!==l)for(v=!!((f=m)!==null&&f!==void 0&&(d=f.ownerDocument)!==null&&d!==void 0&&d.contains(m)||l!=null&&(p=l.ownerDocument)!==null&&p!==void 0&&p.contains(l));!v&&m;){var y,k,S;v=!((k=m=(y=h=$r(m))===null||y===void 0?void 0:y.host)===null||k===void 0||(S=k.ownerDocument)===null||S===void 0||!S.contains(m))}return v}(t))return!t.getClientRects().length;if(e!=="legacy-full")return!0}return!1},bm=function(t,n){return!(n.disabled||ni(n)||function(e){return Su(e)&&e.type==="hidden"}(n)||wm(n,t)||function(e){return e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(o){return o.tagName==="SUMMARY"})}(n)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var o=e.parentElement;o;){if(o.tagName==="FIELDSET"&&o.disabled){for(var r=0;r<o.children.length;r++){var i=o.children.item(r);if(i.tagName==="LEGEND")return!!jo.call(o,"fieldset[disabled] *")||!i.contains(e)}return!0}o=o.parentElement}return!1}(n))},Aa=function(t,n){return!(ym(n)||ku(n)<0||!bm(t,n))},xm=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Cm=function t(n){var e=[],o=[];return n.forEach(function(r,i){var a=!!r.scopeParent,c=a?r.scopeParent:r,l=function(f,d){var p=ku(f);return p<0&&d&&!Cu(f)?0:p}(c,a),u=a?t(r.candidates):c;l===0?a?e.push.apply(e,u):e.push(c):o.push({documentOrder:i,tabIndex:l,item:r,isScope:a,content:u})}),o.sort(vm).reduce(function(r,i){return i.isScope?r.push.apply(r,i.content):r.push(i.content),r},[]).concat(e)},gs=function(t,n){var e;return e=(n=n||{}).getShadowRoot?gm([t],n.includeContainer,{filter:Aa.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:xm}):function(o,r,i){if(ni(o))return[];var a=Array.prototype.slice.apply(o.querySelectorAll(ti));return r&&jo.call(o,ti)&&a.unshift(o),a.filter(i)}(t,n.includeContainer,Aa.bind(null,n)),Cm(e)};function bc(t,n,e){let{reference:o,floating:r}=t;const i=On(n),a=bu(n),c=wu(a),l=eo(n),u=i==="y",f=o.x+o.width/2-r.width/2,d=o.y+o.height/2-r.height/2,p=o[c]/2-r[c]/2;let h;switch(l){case"top":h={x:f,y:o.y-r.height};break;case"bottom":h={x:f,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-r.width,y:d};break;default:h={x:o.x,y:o.y}}switch(xi(n)){case"start":h[a]-=p*(e&&u?-1:1);break;case"end":h[a]+=p*(e&&u?-1:1)}return h}async function Eu(t,n){var e;n===void 0&&(n={});const{x:o,y:r,platform:i,rects:a,elements:c,strategy:l}=t,{boundary:u="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=bi(n,t),m=function(E){return typeof E!="number"?function(O){return{top:0,right:0,bottom:0,left:0,...O}}(E):{top:E,right:E,bottom:E,left:E}}(h),v=c[p?d==="floating"?"reference":"floating":d],y=ei(await i.getClippingRect({element:(e=await(i.isElement==null?void 0:i.isElement(v)))==null||e?v:v.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:f,strategy:l})),k=d==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),b=await(i.isElement==null?void 0:i.isElement(S))&&await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1},w=ei(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:k,offsetParent:S,strategy:l}):k);return{top:(y.top-w.top+m.top)/b.y,bottom:(w.bottom-y.bottom+m.bottom)/b.y,left:(y.left-w.left+m.left)/b.x,right:(w.right-y.right+m.right)/b.x}}const km=new Set(["left","top"]);function ju(t){const n=Gt(t);let e=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=dt(t),i=r?t.offsetWidth:e,a=r?t.offsetHeight:o,c=Qr(e)!==i||Qr(o)!==a;return c&&(e=i,o=a),{width:e,height:o,$:c}}function vs(t){return Ze(t)?t:t.contextElement}function xo(t){const n=vs(t);if(!dt(n))return rn(1);const e=n.getBoundingClientRect(),{width:o,height:r,$:i}=ju(n);let a=(i?Qr(e.width):e.width)/o,c=(i?Qr(e.height):e.height)/r;return a&&Number.isFinite(a)||(a=1),c&&Number.isFinite(c)||(c=1),{x:a,y:c}}const Sm=rn(0);function Ou(t){const n=Ht(t);return yi()&&n.visualViewport?{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}:Sm}function to(t,n,e,o){n===void 0&&(n=!1),e===void 0&&(e=!1);const r=t.getBoundingClientRect(),i=vs(t);let a=rn(1);n&&(o?Ze(o)&&(a=xo(o)):a=xo(t));const c=function(p,h,m){return h===void 0&&(h=!1),!(!m||h&&m!==Ht(p))&&h}(i,e,o)?Ou(i):rn(0);let l=(r.left+c.x)/a.x,u=(r.top+c.y)/a.y,f=r.width/a.x,d=r.height/a.y;if(i){const p=Ht(i),h=o&&Ze(o)?Ht(o):o;let m=p,v=Oa(m);for(;v&&o&&h!==m;){const y=xo(v),k=v.getBoundingClientRect(),S=Gt(v),b=k.left+(v.clientLeft+parseFloat(S.paddingLeft))*y.x,w=k.top+(v.clientTop+parseFloat(S.paddingTop))*y.y;l*=y.x,u*=y.y,f*=y.x,d*=y.y,l+=b,u+=w,m=Ht(v),v=Oa(m)}}return ei({width:f,height:d,x:l,y:u})}function ys(t,n){const e=wi(t).scrollLeft;return n?n.left+e:to(on(t)).left+e}function Nu(t,n,e){e===void 0&&(e=!1);const o=t.getBoundingClientRect();return{x:o.left+n.scrollLeft-(e?0:ys(t,o)),y:o.top+n.scrollTop}}const Em=new Set(["absolute","fixed"]);function xc(t,n,e){let o;if(n==="viewport")o=function(r,i){const a=Ht(r),c=on(r),l=a.visualViewport;let u=c.clientWidth,f=c.clientHeight,d=0,p=0;if(l){u=l.width,f=l.height;const h=yi();(!h||h&&i==="fixed")&&(d=l.offsetLeft,p=l.offsetTop)}return{width:u,height:f,x:d,y:p}}(t,e);else if(n==="document")o=function(r){const i=on(r),a=wi(r),c=r.ownerDocument.body,l=Jn(i.scrollWidth,i.clientWidth,c.scrollWidth,c.clientWidth),u=Jn(i.scrollHeight,i.clientHeight,c.scrollHeight,c.clientHeight);let f=-a.scrollLeft+ys(r);const d=-a.scrollTop;return Gt(c).direction==="rtl"&&(f+=Jn(i.clientWidth,c.clientWidth)-l),{width:l,height:u,x:f,y:d}}(on(t));else if(Ze(n))o=function(r,i){const a=to(r,!0,i==="fixed"),c=a.top+r.clientTop,l=a.left+r.clientLeft,u=dt(r)?xo(r):rn(1);return{width:r.clientWidth*u.x,height:r.clientHeight*u.y,x:l*u.x,y:c*u.y}}(n,e);else{const r=Ou(t);o={x:n.x-r.x,y:n.y-r.y,width:n.width,height:n.height}}return ei(o)}function Iu(t,n){const e=mn(t);return!(e===n||!Ze(e)||Pn(e))&&(Gt(e).position==="fixed"||Iu(e,n))}function jm(t,n,e){const o=dt(n),r=on(n),i=e==="fixed",a=to(t,!0,i,n);let c={scrollLeft:0,scrollTop:0};const l=rn(0);function u(){l.x=ys(r)}if(o||!o&&!i)if((Dn(n)!=="body"||cr(r))&&(c=wi(n)),o){const d=to(n,!0,i,n);l.x=d.x+n.clientLeft,l.y=d.y+n.clientTop}else r&&u();i&&!o&&r&&u();const f=!r||o||i?rn(0):Nu(r,c);return{x:a.left+c.scrollLeft-l.x-f.x,y:a.top+c.scrollTop-l.y-f.y,width:a.width,height:a.height}}function Gi(t){return Gt(t).position==="static"}function Cc(t,n){if(!dt(t)||Gt(t).position==="fixed")return null;if(n)return n(t);let e=t.offsetParent;return on(t)===e&&(e=e.ownerDocument.body),e}function kc(t,n){const e=Ht(t);if(Jr(t))return e;if(!dt(t)){let r=mn(t);for(;r&&!Pn(r);){if(Ze(r)&&!Gi(r))return r;r=mn(r)}return e}let o=Cc(t,n);for(;o&&rm(o)&&Gi(o);)o=Cc(o,n);return o&&Pn(o)&&Gi(o)&&!ja(o)?e:o||function(r){let i=mn(r);for(;dt(i)&&!Pn(i);){if(ja(i))return i;if(Jr(i))return null;i=mn(i)}return null}(t)||e}const Om={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:n,rect:e,offsetParent:o,strategy:r}=t;const i=r==="fixed",a=on(o),c=!!n&&Jr(n.floating);if(o===a||c&&i)return e;let l={scrollLeft:0,scrollTop:0},u=rn(1);const f=rn(0),d=dt(o);if((d||!d&&!i)&&((Dn(o)!=="body"||cr(a))&&(l=wi(o)),dt(o))){const h=to(o);u=xo(o),f.x=h.x+o.clientLeft,f.y=h.y+o.clientTop}const p=!a||d||i?rn(0):Nu(a,l,!0);return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-l.scrollLeft*u.x+f.x+p.x,y:e.y*u.y-l.scrollTop*u.y+f.y+p.y}},getDocumentElement:on,getClippingRect:function(t){let{element:n,boundary:e,rootBoundary:o,strategy:r}=t;const i=[...e==="clippingAncestors"?Jr(n)?[]:function(l,u){const f=u.get(l);if(f)return f;let d=An(l,[],!1).filter(v=>Ze(v)&&Dn(v)!=="body"),p=null;const h=Gt(l).position==="fixed";let m=h?mn(l):l;for(;Ze(m)&&!Pn(m);){const v=Gt(m),y=ja(m);y||v.position!=="fixed"||(p=null),(h?!y&&!p:!y&&v.position==="static"&&p&&Em.has(p.position)||cr(m)&&!y&&Iu(l,m))?d=d.filter(k=>k!==m):p=v,m=mn(m)}return u.set(l,d),d}(n,this._c):[].concat(e),o],a=i[0],c=i.reduce((l,u)=>{const f=xc(n,u,r);return l.top=Jn(f.top,l.top),l.right=Xr(f.right,l.right),l.bottom=Xr(f.bottom,l.bottom),l.left=Jn(f.left,l.left),l},xc(n,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:kc,getElementRects:async function(t){const n=this.getOffsetParent||kc,e=this.getDimensions,o=await e(t.floating);return{reference:jm(t.reference,await n(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:n,height:e}=ju(t);return{width:n,height:e}},getScale:xo,isElement:Ze,isRTL:function(t){return Gt(t).direction==="rtl"}};function Sc(t,n){return t.x===n.x&&t.y===n.y&&t.width===n.width&&t.height===n.height}function Nm(t,n,e,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,u=vs(t),f=r||i?[...u?An(u):[],...An(n)]:[];f.forEach(y=>{r&&y.addEventListener("scroll",e,{passive:!0}),i&&y.addEventListener("resize",e)});const d=u&&c?function(y,k){let S,b=null;const w=on(y);function E(){var O;clearTimeout(S),(O=b)==null||O.disconnect(),b=null}return function O(F,R){F===void 0&&(F=!1),R===void 0&&(R=1),E();const U=y.getBoundingClientRect(),{left:K,top:_,width:A,height:me}=U;if(F||k(),!A||!me)return;const de={rootMargin:-wo(_)+"px "+-wo(w.clientWidth-(K+A))+"px "+-wo(w.clientHeight-(_+me))+"px "+-wo(K)+"px",threshold:Jn(0,Xr(1,R))||1};let re=!0;function ye(pe){const xe=pe[0].intersectionRatio;if(xe!==R){if(!re)return O();xe?O(!1,xe):S=setTimeout(()=>{O(!1,1e-7)},1e3)}xe!==1||Sc(U,y.getBoundingClientRect())||O(),re=!1}try{b=new IntersectionObserver(ye,{...de,root:w.ownerDocument})}catch{b=new IntersectionObserver(ye,de)}b.observe(y)}(!0),E}(u,e):null;let p,h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[k]=y;k&&k.target===u&&m&&(m.unobserve(n),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(n)})),e()}),u&&!l&&m.observe(u),m.observe(n));let v=l?to(t):null;return l&&function y(){const k=to(t);v&&!Sc(v,k)&&e(),v=k,p=requestAnimationFrame(y)}(),e(),()=>{var y;f.forEach(k=>{r&&k.removeEventListener("scroll",e),i&&k.removeEventListener("resize",e)}),d==null||d(),(y=m)==null||y.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const Im=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(n){var e,o;const{x:r,y:i,placement:a,middlewareData:c}=n,l=await async function(u,f){const{placement:d,platform:p,elements:h}=u,m=await(p.isRTL==null?void 0:p.isRTL(h.floating)),v=eo(d),y=xi(d),k=On(d)==="y",S=km.has(v)?-1:1,b=m&&k?-1:1,w=bi(f,u);let{mainAxis:E,crossAxis:O,alignmentAxis:F}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:w.mainAxis||0,crossAxis:w.crossAxis||0,alignmentAxis:w.alignmentAxis};return y&&typeof F=="number"&&(O=y==="end"?-1*F:F),k?{x:O*b,y:E*S}:{x:E*S,y:O*b}}(n,t);return a===((e=c.offset)==null?void 0:e.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:a}}}}},Pm=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(n){const{x:e,y:o,placement:r}=n,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:y=>{let{x:k,y:S}=y;return{x:k,y:S}}},...l}=bi(t,n),u={x:e,y:o},f=await Eu(n,l),d=On(eo(r)),p=yu(d);let h=u[p],m=u[d];if(i){const y=p==="y"?"bottom":"right";h=gc(h+f[p==="y"?"top":"left"],h,h-f[y])}if(a){const y=d==="y"?"bottom":"right";m=gc(m+f[d==="y"?"top":"left"],m,m-f[y])}const v=c.fn({...n,[p]:h,[d]:m});return{...v,data:{x:v.x-e,y:v.y-o,enabled:{[p]:i,[d]:a}}}}}},Am=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(n){var e,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:c,platform:l,elements:u}=n,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...y}=bi(t,n);if((e=i.arrow)!=null&&e.alignmentOffset)return{};const k=eo(r),S=On(c),b=eo(c)===c,w=await(l.isRTL==null?void 0:l.isRTL(u.floating)),E=p||(b||!v?[Or(c)]:function(de){const re=Or(de);return[Pa(de),re,Pa(re)]}(c)),O=m!=="none";!p&&O&&E.push(...mm(c,v,m,w));const F=[c,...E],R=await Eu(n,y),U=[];let K=((o=i.flip)==null?void 0:o.overflows)||[];if(f&&U.push(R[k]),d){const de=function(re,ye,pe){pe===void 0&&(pe=!1);const xe=xi(re),ae=bu(re),B=wu(ae);let X=ae==="x"?xe===(pe?"end":"start")?"right":"left":xe==="start"?"bottom":"top";return ye.reference[B]>ye.floating[B]&&(X=Or(X)),[X,Or(X)]}(r,a,w);U.push(R[de[0]],R[de[1]])}if(K=[...K,{placement:r,overflows:U}],!U.every(de=>de<=0)){var _,A;const de=(((_=i.flip)==null?void 0:_.index)||0)+1,re=F[de];if(re&&(!(d==="alignment"&&S!==On(re))||K.every(pe=>On(pe.placement)!==S||pe.overflows[0]>0)))return{data:{index:de,overflows:K},reset:{placement:re}};let ye=(A=K.filter(pe=>pe.overflows[0]<=0).sort((pe,xe)=>pe.overflows[1]-xe.overflows[1])[0])==null?void 0:A.placement;if(!ye)switch(h){case"bestFit":{var me;const pe=(me=K.filter(xe=>{if(O){const ae=On(xe.placement);return ae===S||ae==="y"}return!0}).map(xe=>[xe.placement,xe.overflows.filter(ae=>ae>0).reduce((ae,B)=>ae+B,0)]).sort((xe,ae)=>xe[1]-ae[1])[0])==null?void 0:me[0];pe&&(ye=pe);break}case"initialPlacement":ye=c}if(r!==ye)return{reset:{placement:ye}}}return{}}}},Tm=(t,n,e)=>{const o=new Map,r={platform:Om,...e},i={...r.platform,_c:o};return(async(a,c,l)=>{const{placement:u="bottom",strategy:f="absolute",middleware:d=[],platform:p}=l,h=d.filter(Boolean),m=await(p.isRTL==null?void 0:p.isRTL(c));let v=await p.getElementRects({reference:a,floating:c,strategy:f}),{x:y,y:k}=bc(v,u,m),S=u,b={},w=0;for(let E=0;E<h.length;E++){const{name:O,fn:F}=h[E],{x:R,y:U,data:K,reset:_}=await F({x:y,y:k,initialPlacement:u,placement:S,strategy:f,middlewareData:b,rects:v,platform:p,elements:{reference:a,floating:c}});y=R??y,k=U??k,b={...b,[O]:{...b[O],...K}},_&&w<=50&&(w++,typeof _=="object"&&(_.placement&&(S=_.placement),_.rects&&(v=_.rects===!0?await p.getElementRects({reference:a,floating:c,strategy:f}):_.rects),{x:y,y:k}=bc(v,S,m)),E=-1)}return{x:y,y:k,placement:S,strategy:f,middlewareData:b}})(t,n,{...r,platform:i})};var zr=typeof document<"u"?g.useLayoutEffect:function(){};function oi(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="function"&&t.toString()===n.toString())return!0;let e,o,r;if(t&&n&&typeof t=="object"){if(Array.isArray(t)){if(e=t.length,e!==n.length)return!1;for(o=e;o--!==0;)if(!oi(t[o],n[o]))return!1;return!0}if(r=Object.keys(t),e=r.length,e!==Object.keys(n).length)return!1;for(o=e;o--!==0;)if(!{}.hasOwnProperty.call(n,r[o]))return!1;for(o=e;o--!==0;){const i=r[o];if((i!=="_owner"||!t.$$typeof)&&!oi(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}function Pu(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ec(t,n){const e=Pu(t);return Math.round(n*e)/e}function Yi(t){const n=D.useRef(t);return zr(()=>{n.current=t}),n}const Dm=(t,n)=>({...Pm(t),options:[t,n]}),Mm=(t,n)=>({...Am(t),options:[t,n]});function Au(t){return D.useMemo(()=>t.every(n=>n==null)?null:n=>{t.forEach(e=>{typeof e=="function"?e(n):e!=null&&(e.current=n)})},t)}const Tu={...D},_m=Tu.useInsertionEffect||(t=>t());function At(t){const n=D.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return _m(()=>{n.current=t}),D.useCallback(function(){for(var e=arguments.length,o=new Array(e),r=0;r<e;r++)o[r]=arguments[r];return n.current==null?void 0:n.current(...o)},[])}const ws="ArrowUp",or="ArrowDown",kn="ArrowLeft",Sn="ArrowRight";function Nr(t,n,e){return Math.floor(t/n)!==e}function Wo(t,n){return n<0||n>=t.current.length}function Zi(t,n){return xt(t,{disabledIndices:n})}function jc(t,n){return xt(t,{decrement:!0,startingIndex:t.current.length,disabledIndices:n})}function xt(t,n){let{startingIndex:e=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=n===void 0?{}:n;const a=t.current;let c=e;do c+=o?-i:i;while(c>=0&&c<=a.length-1&&Ur(a,c,r));return c}function Lm(t,n,e,o,r){if(t===-1)return-1;const i=e.indexOf(t),a=n[t];switch(r){case"tl":return i;case"tr":return a?i+a.width-1:i;case"bl":return a?i+(a.height-1)*o:i;case"br":return e.lastIndexOf(t)}}function Rm(t,n){return n.flatMap((e,o)=>t.includes(e)?[o]:[])}function Ur(t,n,e){if(e)return e.includes(n);const o=t[n];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}var Je=typeof document<"u"?g.useLayoutEffect:g.useEffect;function Fm(t,n){const e=t.compareDocumentPosition(n);return e&Node.DOCUMENT_POSITION_FOLLOWING||e&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:e&Node.DOCUMENT_POSITION_PRECEDING||e&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Du=D.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Bm(t){const{children:n,elementsRef:e,labelsRef:o}=t,[r,i]=D.useState(()=>new Map),a=D.useCallback(l=>{i(u=>new Map(u).set(l,null))},[]),c=D.useCallback(l=>{i(u=>{const f=new Map(u);return f.delete(l),f})},[]);return Je(()=>{const l=new Map(r);Array.from(l.keys()).sort(Fm).forEach((u,f)=>{l.set(u,f)}),function(u,f){if(u.size!==f.size)return!1;for(const[d,p]of u.entries())if(p!==f.get(d))return!1;return!0}(r,l)||i(l)},[r]),D.createElement(Du.Provider,{value:D.useMemo(()=>({register:a,unregister:c,map:r,elementsRef:e,labelsRef:o}),[a,c,r,e,o])},n)}function Mu(t){t===void 0&&(t={});const{label:n}=t,{register:e,unregister:o,map:r,elementsRef:i,labelsRef:a}=D.useContext(Du),[c,l]=D.useState(null),u=D.useRef(null),f=D.useCallback(d=>{if(u.current=d,c!==null&&(i.current[c]=d,a)){var p;const h=n!==void 0;a.current[c]=h?n:(p=d==null?void 0:d.textContent)!=null?p:null}},[c,i,a,n]);return Je(()=>{const d=u.current;if(d)return e(d),()=>{o(d)}},[e,o]),Je(()=>{const d=u.current?r.get(u.current):null;d!=null&&l(d)},[r]),D.useMemo(()=>({ref:f,index:c??-1}),[c,f])}function ri(){return ri=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},ri.apply(this,arguments)}let Oc=!1,Hm=0;const Nc=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Hm++,Ta=Tu.useId||function(){const[t,n]=D.useState(()=>Oc?Nc():void 0);return Je(()=>{t==null&&n(Nc())},[]),D.useEffect(()=>{Oc=!0},[]),t};let lr;function Ki(){for(var t,n=arguments.length,e=new Array(n),o=0;o<n;o++)e[o]=arguments[o];const r="Floating UI: "+e.join(" ");var i;(t=lr)!=null&&t.has(r)||((i=lr)==null||i.add(r),console.warn(r))}function _u(){const t=new Map;return{emit(n,e){var o;(o=t.get(n))==null||o.forEach(r=>r(e))},on(n,e){t.set(n,[...t.get(n)||[],e])},off(n,e){var o;t.set(n,((o=t.get(n))==null?void 0:o.filter(r=>r!==e))||[])}}}process.env.NODE_ENV!=="production"&&(lr=new Set);const Lu=D.createContext(null),Ru=D.createContext(null),Nn=()=>{var t;return((t=D.useContext(Lu))==null?void 0:t.id)||null},In=()=>D.useContext(Ru);function Wm(t){const{children:n,id:e}=t,o=Nn();return D.createElement(Lu.Provider,{value:D.useMemo(()=>({id:e,parentId:o}),[e,o])},n)}function $m(t){const{children:n}=t,e=D.useRef([]),o=D.useCallback(a=>{e.current=[...e.current,a]},[]),r=D.useCallback(a=>{e.current=e.current.filter(c=>c!==a)},[]),i=D.useState(()=>_u())[0];return D.createElement(Ru.Provider,{value:D.useMemo(()=>({nodesRef:e,addNode:o,removeNode:r,events:i}),[o,r,i])},n)}function ur(t){return"data-floating-ui-"+t}function Jt(t){const n=g.useRef(t);return Je(()=>{n.current=t}),n}const Ic=ur("safe-polygon");function qi(t,n,e){return e&&!Xo(e)?0:typeof t=="number"?t:t==null?void 0:t[n]}let Pc=0;function xn(t,n){n===void 0&&(n={});const{preventScroll:e=!1,cancelPrevious:o=!0,sync:r=!1}=n;o&&cancelAnimationFrame(Pc);const i=()=>t==null?void 0:t.focus({preventScroll:e});r?i():Pc=requestAnimationFrame(i)}function Xn(t,n){let e=t.filter(r=>{var i;return r.parentId===n&&((i=r.context)==null?void 0:i.open)}),o=e;for(;o.length;)o=t.filter(r=>{var i;return(i=o)==null?void 0:i.some(a=>{var c;return r.parentId===a.id&&((c=r.context)==null?void 0:c.open)})}),e=e.concat(o);return e}let co=new WeakMap,Ir=new WeakSet,Pr={},Ji=0;const Fu=t=>t&&(t.host||Fu(t.parentNode));function zm(t,n,e,o){const r="data-floating-ui-inert",i=o?"inert":e?"aria-hidden":null,a=(c=n,t.map(p=>{if(c.contains(p))return p;const h=Fu(p);return c.contains(h)?h:null}).filter(p=>p!=null));var c;const l=new Set,u=new Set(a),f=[];Pr[r]||(Pr[r]=new WeakMap);const d=Pr[r];return a.forEach(function p(h){!h||l.has(h)||(l.add(h),h.parentNode&&p(h.parentNode))}),function p(h){!h||u.has(h)||[].forEach.call(h.children,m=>{if(Dn(m)!=="script")if(l.has(m))p(m);else{const v=i?m.getAttribute(i):null,y=v!==null&&v!=="false",k=(co.get(m)||0)+1,S=(d.get(m)||0)+1;co.set(m,k),d.set(m,S),f.push(m),k===1&&y&&Ir.add(m),S===1&&m.setAttribute(r,""),!y&&i&&m.setAttribute(i,"true")}})}(n),l.clear(),Ji++,()=>{f.forEach(p=>{const h=(co.get(p)||0)-1,m=(d.get(p)||0)-1;co.set(p,h),d.set(p,m),h||(!Ir.has(p)&&i&&p.removeAttribute(i),Ir.delete(p)),m||p.removeAttribute(r)}),Ji--,Ji||(co=new WeakMap,co=new WeakMap,Ir=new WeakSet,Pr={})}}function Ac(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);const o=kt(t[0]).body;return zm(t.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,n,e)}const ii=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Tc(t,n){const e=gs(t,ii());n==="prev"&&e.reverse();const o=e.indexOf(hn(kt(t)));return e.slice(o+1)[0]}function Dc(t,n){const e=n||t.currentTarget,o=t.relatedTarget;return!o||!vt(e,o)}const bs={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Mc(t){t.key==="Tab"&&(t.target,clearTimeout(void 0))}const _c=D.forwardRef(function(t,n){const[e,o]=D.useState();Je(()=>(gu()&&o("button"),document.addEventListener("keydown",Mc),()=>{document.removeEventListener("keydown",Mc)}),[]);const r={ref:n,tabIndex:0,role:e,"aria-hidden":!e||void 0,[ur("focus-guard")]:"",style:bs};return D.createElement("span",ri({},t,r))}),Um=D.createContext(null),Da="data-floating-ui-focusable";function Bu(t){return t?t.hasAttribute(Da)?t:t.querySelector("["+Da+"]")||t:null}let Bn=[];function Xi(t){Bn=Bn.filter(e=>e.isConnected);let n=t;if(n&&Dn(n)!=="body"){if(!function(e,o){if(o=o||{},!e)throw new Error("No node provided");return jo.call(e,ti)!==!1&&Aa(o,e)}(n,ii())){const e=gs(n,ii())[0];e&&(n=e)}Bn.push(n),Bn.length>20&&(Bn=Bn.slice(-20))}}function Lc(){return Bn.slice().reverse().find(t=>t.isConnected)}const Vm=D.forwardRef(function(t,n){return D.createElement("button",ri({},t,{type:"button",ref:n,tabIndex:-1,style:bs}))});function Gm(t){const{context:n,children:e,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0}=t,{open:p,refs:h,nodeId:m,onOpenChange:v,events:y,dataRef:k,floatingId:S,elements:{domReference:b,floating:w}}=n,E=typeof a=="number"&&a<0,O=Ia(b)&&E,F=typeof HTMLElement>"u"||!("inert"in HTMLElement.prototype)||i,R=Jt(r),U=Jt(a),K=Jt(c),_=In(),A=D.useContext(Um),me=D.useRef(null),de=D.useRef(null),re=D.useRef(!1),ye=D.useRef(!1),pe=D.useRef(-1),xe=A!=null,ae=Bu(w),B=At(function(H){return H===void 0&&(H=ae),H?gs(H,ii()):[]}),X=At(H=>{const P=B(H);return R.current.map(T=>b&&T==="reference"?b:ae&&T==="floating"?ae:P).filter(Boolean).flat()});function Y(H){return!o&&f&&u?D.createElement(Vm,{ref:H==="start"?me:de,onClick:P=>v(!1,P.nativeEvent)},typeof f=="string"?f:"Dismiss"):null}D.useEffect(()=>{if(o||!u)return;function H(T){if(T.key==="Tab"){vt(ae,hn(kt(ae)))&&B().length===0&&!O&&Nt(T);const W=X(),q=Cn(T);R.current[0]==="reference"&&q===b&&(Nt(T),T.shiftKey?xn(W[W.length-1]):xn(W[1])),R.current[1]==="floating"&&q===ae&&T.shiftKey&&(Nt(T),xn(W[0]))}}const P=kt(ae);return P.addEventListener("keydown",H),()=>{P.removeEventListener("keydown",H)}},[o,b,ae,u,R,O,B,X]),D.useEffect(()=>{if(!o&&w)return w.addEventListener("focusin",H),()=>{w.removeEventListener("focusin",H)};function H(P){const T=Cn(P),W=B().indexOf(T);W!==-1&&(pe.current=W)}},[o,w,B]),D.useEffect(()=>{if(!o&&d)return w&&dt(b)?(b.addEventListener("focusout",P),b.addEventListener("pointerdown",H),w.addEventListener("focusout",P),()=>{b.removeEventListener("focusout",P),b.removeEventListener("pointerdown",H),w.removeEventListener("focusout",P)}):void 0;function H(){ye.current=!0,setTimeout(()=>{ye.current=!1})}function P(T){const W=T.relatedTarget;queueMicrotask(()=>{const q=!(vt(b,W)||vt(w,W)||vt(W,w)||vt(A==null?void 0:A.portalNode,W)||W!=null&&W.hasAttribute(ur("focus-guard"))||_&&(Xn(_.nodesRef.current,m).find(Z=>{var ie,oe;return vt((ie=Z.context)==null?void 0:ie.elements.floating,W)||vt((oe=Z.context)==null?void 0:oe.elements.domReference,W)})||function(Z,ie){var oe;let I=[],Ce=(oe=Z.find(ke=>ke.id===ie))==null?void 0:oe.parentId;for(;Ce;){const ke=Z.find(Ae=>Ae.id===Ce);Ce=ke==null?void 0:ke.parentId,ke&&(I=I.concat(ke))}return I}(_.nodesRef.current,m).find(Z=>{var ie,oe;return((ie=Z.context)==null?void 0:ie.elements.floating)===W||((oe=Z.context)==null?void 0:oe.elements.domReference)===W})));if(l&&q&&hn(kt(ae))===kt(ae).body){dt(ae)&&ae.focus();const Z=pe.current,ie=B(),oe=ie[Z]||ie[ie.length-1]||ae;dt(oe)&&oe.focus()}!O&&u||!W||!q||ye.current||W===Lc()||(re.current=!0,v(!1,T,"focus-out"))})}},[o,b,w,ae,u,m,_,A,v,d,l,B,O]),D.useEffect(()=>{var H;if(o)return;const P=Array.from((A==null||(H=A.portalNode)==null?void 0:H.querySelectorAll("["+ur("portal")+"]"))||[]);if(w){const T=[w,...P,me.current,de.current,R.current.includes("reference")||O?b:null].filter(q=>q!=null),W=u||O?Ac(T,F,!F):Ac(T);return()=>{W()}}},[o,b,w,u,R,A,O,F]),Je(()=>{if(o||!dt(ae))return;const H=hn(kt(ae));queueMicrotask(()=>{const P=X(ae),T=U.current,W=(typeof T=="number"?P[T]:T.current)||ae,q=vt(ae,H);E||q||!p||xn(W,{preventScroll:W===ae})})},[o,p,ae,E,X,U]),Je(()=>{if(o||!ae)return;let H=!1;const P=kt(ae),T=hn(P);let W=k.current.openEvent;function q(ie){let{open:oe,reason:I,event:Ce,nested:ke}=ie;oe&&(W=Ce),I==="escape-key"&&h.domReference.current&&Xi(h.domReference.current),I==="hover"&&Ce.type==="mouseleave"&&(re.current=!0),I==="outside-press"&&(ke?(re.current=!1,H=!0):re.current=!(hu(Ce)||mu(Ce)))}Xi(T),y.on("openchange",q);const Z=P.createElement("span");return Z.setAttribute("tabindex","-1"),Z.setAttribute("aria-hidden","true"),Object.assign(Z.style,bs),xe&&b&&b.insertAdjacentElement("afterend",Z),()=>{y.off("openchange",q);const ie=hn(P),oe=vt(w,ie)||_&&Xn(_.nodesRef.current,m).some(Ce=>{var ke;return vt((ke=Ce.context)==null?void 0:ke.elements.floating,ie)});(oe||W&&["click","mousedown"].includes(W.type))&&h.domReference.current&&Xi(h.domReference.current);const I=typeof K.current=="boolean"?Lc()||Z:K.current.current||Z;queueMicrotask(()=>{K.current&&!re.current&&dt(I)&&(I===ie||ie===P.body||oe)&&I.focus({preventScroll:H}),Z.remove()})}},[o,w,ae,K,k,h,y,_,m,xe,b]),D.useEffect(()=>{queueMicrotask(()=>{re.current=!1})},[o]),Je(()=>{if(!o&&A)return A.setFocusManagerState({modal:u,closeOnFocusOut:d,open:p,onOpenChange:v,refs:h}),()=>{A.setFocusManagerState(null)}},[o,A,u,p,v,h,d]),Je(()=>{if(o||!ae||typeof MutationObserver!="function"||E)return;const H=()=>{const T=ae.getAttribute("tabindex"),W=B(),q=hn(kt(w)),Z=W.indexOf(q);Z!==-1&&(pe.current=Z),R.current.includes("floating")||q!==h.domReference.current&&W.length===0?T!=="0"&&ae.setAttribute("tabindex","0"):T!=="-1"&&ae.setAttribute("tabindex","-1")};H();const P=new MutationObserver(H);return P.observe(ae,{childList:!0,subtree:!0,attributes:!0}),()=>{P.disconnect()}},[o,w,ae,h,R,B,E]);const J=!o&&F&&(!u||!O)&&(xe||u);return D.createElement(D.Fragment,null,J&&D.createElement(_c,{"data-type":"inside",ref:A==null?void 0:A.beforeInsideRef,onFocus:H=>{if(u){const T=X();xn(r[0]==="reference"?T[0]:T[T.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(re.current=!1,Dc(H,A.portalNode)){const T=Tc(document.body,"next")||b;T==null||T.focus()}else{var P;(P=A.beforeOutsideRef.current)==null||P.focus()}}}),!O&&Y("start"),e,Y("end"),J&&D.createElement(_c,{"data-type":"inside",ref:A==null?void 0:A.afterInsideRef,onFocus:H=>{if(u)xn(X()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(d&&(re.current=!0),Dc(H,A.portalNode)){const T=Tc(document.body,"prev")||b;T==null||T.focus()}else{var P;(P=A.afterOutsideRef.current)==null||P.focus()}}}))}function Rc(t){return dt(t.target)&&t.target.tagName==="BUTTON"}function Fc(t){return vu(t)}const Ym={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Zm={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Bc=t=>{var n,e;return{escapeKey:typeof t=="boolean"?t:(n=t==null?void 0:t.escapeKey)!=null&&n,outsidePress:typeof t=="boolean"?t:(e=t==null?void 0:t.outsidePress)==null||e}};function Km(t){const{open:n=!1,onOpenChange:e,elements:o}=t,r=Ta(),i=D.useRef({}),[a]=D.useState(()=>_u()),c=Nn()!=null;if(process.env.NODE_ENV!=="production"){const h=o.reference;h&&!Ze(h)&&function(){for(var m,v=arguments.length,y=new Array(v),k=0;k<v;k++)y[k]=arguments[k];const S="Floating UI: "+y.join(" ");var b;(m=lr)!=null&&m.has(S)||((b=lr)==null||b.add(S),console.error(S))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,u]=D.useState(o.reference),f=At((h,m,v)=>{i.current.openEvent=h?m:void 0,a.emit("openchange",{open:h,event:m,reason:v,nested:c}),e==null||e(h,m,v)}),d=D.useMemo(()=>({setPositionReference:u}),[]),p=D.useMemo(()=>({reference:l||o.reference||null,floating:o.floating||null,domReference:o.reference}),[l,o.reference,o.floating]);return D.useMemo(()=>({dataRef:i,open:n,onOpenChange:f,elements:p,events:a,floatingId:r,refs:d}),[n,f,p,a,r,d])}function qm(t){t===void 0&&(t={});const{nodeId:n}=t,e=Km({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||e,r=o.elements,[i,a]=D.useState(null),[c,l]=D.useState(null),u=(r==null?void 0:r.domReference)||i,f=D.useRef(null),d=In();Je(()=>{u&&(f.current=u)},[u]);const p=function(S){S===void 0&&(S={});const{placement:b="bottom",strategy:w="absolute",middleware:E=[],platform:O,elements:{reference:F,floating:R}={},transform:U=!0,whileElementsMounted:K,open:_}=S,[A,me]=D.useState({x:0,y:0,strategy:w,placement:b,middlewareData:{},isPositioned:!1}),[de,re]=D.useState(E);oi(de,E)||re(E);const[ye,pe]=D.useState(null),[xe,ae]=D.useState(null),B=D.useCallback(Pe=>{Pe!==H.current&&(H.current=Pe,pe(Pe))},[]),X=D.useCallback(Pe=>{Pe!==P.current&&(P.current=Pe,ae(Pe))},[]),Y=F||ye,J=R||xe,H=D.useRef(null),P=D.useRef(null),T=D.useRef(A),W=K!=null,q=Yi(K),Z=Yi(O),ie=Yi(_),oe=D.useCallback(()=>{if(!H.current||!P.current)return;const Pe={placement:b,strategy:w,middleware:de};Z.current&&(Pe.platform=Z.current),Tm(H.current,P.current,Pe).then(Te=>{const he={...Te,isPositioned:ie.current!==!1};I.current&&!oi(T.current,he)&&(T.current=he,Kl.flushSync(()=>{me(he)}))})},[de,b,w,Z,ie]);zr(()=>{_===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,me(Pe=>({...Pe,isPositioned:!1})))},[_]);const I=D.useRef(!1);zr(()=>(I.current=!0,()=>{I.current=!1}),[]),zr(()=>{if(Y&&(H.current=Y),J&&(P.current=J),Y&&J){if(q.current)return q.current(Y,J,oe);oe()}},[Y,J,oe,q,W]);const Ce=D.useMemo(()=>({reference:H,floating:P,setReference:B,setFloating:X}),[B,X]),ke=D.useMemo(()=>({reference:Y,floating:J}),[Y,J]),Ae=D.useMemo(()=>{const Pe={position:w,left:0,top:0};if(!ke.floating)return Pe;const Te=Ec(ke.floating,A.x),he=Ec(ke.floating,A.y);return U?{...Pe,transform:"translate("+Te+"px, "+he+"px)",...Pu(ke.floating)>=1.5&&{willChange:"transform"}}:{position:w,left:Te,top:he}},[w,U,ke.floating,A.x,A.y]);return D.useMemo(()=>({...A,update:oe,refs:Ce,elements:ke,floatingStyles:Ae}),[A,oe,Ce,ke,Ae])}({...t,elements:{...r,...c&&{reference:c}}}),h=D.useCallback(S=>{const b=Ze(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;l(b),p.refs.setReference(b)},[p.refs]),m=D.useCallback(S=>{(Ze(S)||S===null)&&(f.current=S,a(S)),(Ze(p.refs.reference.current)||p.refs.reference.current===null||S!==null&&!Ze(S))&&p.refs.setReference(S)},[p.refs]),v=D.useMemo(()=>({...p.refs,setReference:m,setPositionReference:h,domReference:f}),[p.refs,m,h]),y=D.useMemo(()=>({...p.elements,domReference:u}),[p.elements,u]),k=D.useMemo(()=>({...p,...o,refs:v,elements:y,nodeId:n}),[p,v,y,n,o]);return Je(()=>{o.dataRef.current.floatingContext=k;const S=d==null?void 0:d.nodesRef.current.find(b=>b.id===n);S&&(S.context=k)}),D.useMemo(()=>({...p,context:k,refs:v,elements:y}),[p,v,y,k])}const Hc="active",Wc="selected";function Qi(t,n,e){const o=new Map,r=e==="item";let i=t;if(r&&t){const{[Hc]:a,[Wc]:c,...l}=t;i=l}return{...e==="floating"&&{tabIndex:-1,[Da]:""},...i,...n.map(a=>{const c=a?a[e]:null;return typeof c=="function"?t?c(t):null:c}).concat(t).reduce((a,c)=>(c&&Object.entries(c).forEach(l=>{let[u,f]=l;var d;r&&[Hc,Wc].includes(u)||(u.indexOf("on")===0?(o.has(u)||o.set(u,[]),typeof f=="function"&&((d=o.get(u))==null||d.push(f),a[u]=function(){for(var p,h=arguments.length,m=new Array(h),v=0;v<h;v++)m[v]=arguments[v];return(p=o.get(u))==null?void 0:p.map(y=>y(...m)).find(y=>y!==void 0)})):a[u]=f)}),a),{})}}let $c=!1;function Ci(t,n,e){switch(t){case"vertical":return n;case"horizontal":return e;default:return n||e}}function zc(t,n){return Ci(n,t===ws||t===or,t===kn||t===Sn)}function ea(t,n,e){return Ci(n,t===or,e?t===kn:t===Sn)||t==="Enter"||t===" "||t===""}function Uc(t,n,e){return Ci(n,e?t===Sn:t===kn,t===ws)}function Jm(t,n){const{open:e,onOpenChange:o,elements:r}=t,{listRef:i,activeIndex:a,onNavigate:c=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:f=!1,loop:d=!1,nested:p=!1,rtl:h=!1,virtual:m=!1,focusItemOnOpen:v="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:k=!0,disabledIndices:S,orientation:b="vertical",cols:w=1,scrollItemIntoView:E=!0,virtualItemRef:O,itemSizes:F,dense:R=!1}=n;process.env.NODE_ENV!=="production"&&(f&&(d||Ki("`useListNavigation` looping must be enabled to allow escaping."),m||Ki("`useListNavigation` must be virtual to allow escaping.")),b==="vertical"&&w>1&&Ki("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const U=Jt(Bu(r.floating)),K=Nn(),_=In(),A=At(c),me=Ia(r.domReference),de=D.useRef(v),re=D.useRef(u??-1),ye=D.useRef(null),pe=D.useRef(!0),xe=D.useRef(A),ae=D.useRef(!!r.floating),B=D.useRef(e),X=D.useRef(!1),Y=D.useRef(!1),J=Jt(S),H=Jt(e),P=Jt(E),T=Jt(u),[W,q]=D.useState(),[Z,ie]=D.useState(),oe=At(function(he,C,x){function j(L){m?(q(L.id),_==null||_.events.emit("virtualfocus",L),O&&(O.current=L)):xn(L,{preventScroll:!0,sync:!(!fu().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!gu())&&($c||X.current)})}x===void 0&&(x=!1);const N=he.current[C.current];N&&j(N),requestAnimationFrame(()=>{const L=he.current[C.current]||N;if(!L)return;N||j(L);const ne=P.current;ne&&Ce&&(x||!pe.current)&&(L.scrollIntoView==null||L.scrollIntoView(typeof ne=="boolean"?{block:"nearest",inline:"nearest"}:ne))})});Je(()=>{document.createElement("div").focus({get preventScroll(){return $c=!0,!1}})},[]),Je(()=>{l&&(e&&r.floating?de.current&&u!=null&&(Y.current=!0,re.current=u,A(u)):ae.current&&(re.current=-1,xe.current(null)))},[l,e,r.floating,u,A]),Je(()=>{if(l&&e&&r.floating)if(a==null){if(X.current=!1,T.current!=null)return;if(ae.current&&(re.current=-1,oe(i,re)),(!B.current||!ae.current)&&de.current&&(ye.current!=null||de.current===!0&&ye.current==null)){let he=0;const C=()=>{i.current[0]==null?(he<2&&(he?requestAnimationFrame:queueMicrotask)(C),he++):(re.current=ye.current==null||ea(ye.current,b,h)||p?Zi(i,J.current):jc(i,J.current),ye.current=null,A(re.current))};C()}}else Wo(i,a)||(re.current=a,oe(i,re,Y.current),Y.current=!1)},[l,e,r.floating,a,T,p,i,b,h,A,oe,J]),Je(()=>{var he;if(!l||r.floating||!_||m||!ae.current)return;const C=_.nodesRef.current,x=(he=C.find(L=>L.id===K))==null||(he=he.context)==null?void 0:he.elements.floating,j=hn(kt(r.floating)),N=C.some(L=>L.context&&vt(L.context.elements.floating,j));x&&!N&&pe.current&&x.focus({preventScroll:!0})},[l,r.floating,_,K,m]),Je(()=>{if(l&&_&&m&&!K)return _.events.on("virtualfocus",he),()=>{_.events.off("virtualfocus",he)};function he(C){ie(C.id),O&&(O.current=C)}},[l,_,m,K,O]),Je(()=>{xe.current=A,ae.current=!!r.floating}),Je(()=>{e||(ye.current=null)},[e]),Je(()=>{B.current=e},[e]);const I=a!=null,Ce=D.useMemo(()=>{function he(C){if(!e)return;const x=i.current.indexOf(C);x!==-1&&A(x)}return{onFocus(C){let{currentTarget:x}=C;he(x)},onClick:C=>{let{currentTarget:x}=C;return x.focus({preventScroll:!0})},...y&&{onMouseMove(C){let{currentTarget:x}=C;he(x)},onPointerLeave(C){let{pointerType:x}=C;pe.current&&x!=="touch"&&(re.current=-1,oe(i,re),A(null),m||xn(U.current,{preventScroll:!0}))}}}},[e,U,oe,y,i,A,m]),ke=At(he=>{if(pe.current=!1,X.current=!0,he.which===229||!H.current&&he.currentTarget===U.current)return;if(p&&Uc(he.key,b,h))return Nt(he),o(!1,he.nativeEvent,"list-navigation"),void(dt(r.domReference)&&(m?_==null||_.events.emit("virtualfocus",r.domReference):r.domReference.focus()));const C=re.current,x=Zi(i,S),j=jc(i,S);if(me||(he.key==="Home"&&(Nt(he),re.current=x,A(re.current)),he.key==="End"&&(Nt(he),re.current=j,A(re.current))),w>1){const N=F||Array.from({length:i.current.length},()=>({width:1,height:1})),L=function(V,z,te){const le=[];let ge=0;return V.forEach((se,G)=>{let{width:Se,height:Be}=se;if(Se>z&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+G+" is greater than grid columns");let Oe=!1;for(te&&(ge=0);!Oe;){const je=[];for(let Ee=0;Ee<Se;Ee++)for(let ue=0;ue<Be;ue++)je.push(ge+Ee+ue*z);ge%z+Se<=z&&je.every(Ee=>le[Ee]==null)?(je.forEach(Ee=>{le[Ee]=G}),Oe=!0):ge++}}),[...le]}(N,w,R),ne=L.findIndex(V=>V!=null&&!Ur(i.current,V,S)),ve=L.reduce((V,z,te)=>z==null||Ur(i.current,z,S)?V:te,-1),$=L[function(V,z){let{event:te,orientation:le,loop:ge,rtl:se,cols:G,disabledIndices:Se,minIndex:Be,maxIndex:Oe,prevIndex:je,stopEvent:Ee=!1}=z,ue=je;if(te.key===ws){if(Ee&&Nt(te),je===-1)ue=Oe;else if(ue=xt(V,{startingIndex:ue,amount:G,decrement:!0,disabledIndices:Se}),ge&&(je-G<Be||ue<0)){const we=je%G,De=Oe%G,Ie=Oe-(De-we);ue=De===we?Oe:De>we?Ie:Ie-G}Wo(V,ue)&&(ue=je)}if(te.key===or&&(Ee&&Nt(te),je===-1?ue=Be:(ue=xt(V,{startingIndex:je,amount:G,disabledIndices:Se}),ge&&je+G>Oe&&(ue=xt(V,{startingIndex:je%G-G,amount:G,disabledIndices:Se}))),Wo(V,ue)&&(ue=je)),le==="both"){const we=wo(je/G);te.key===(se?kn:Sn)&&(Ee&&Nt(te),je%G!==G-1?(ue=xt(V,{startingIndex:je,disabledIndices:Se}),ge&&Nr(ue,G,we)&&(ue=xt(V,{startingIndex:je-je%G-1,disabledIndices:Se}))):ge&&(ue=xt(V,{startingIndex:je-je%G-1,disabledIndices:Se})),Nr(ue,G,we)&&(ue=je)),te.key===(se?Sn:kn)&&(Ee&&Nt(te),je%G!==0?(ue=xt(V,{startingIndex:je,decrement:!0,disabledIndices:Se}),ge&&Nr(ue,G,we)&&(ue=xt(V,{startingIndex:je+(G-je%G),decrement:!0,disabledIndices:Se}))):ge&&(ue=xt(V,{startingIndex:je+(G-je%G),decrement:!0,disabledIndices:Se})),Nr(ue,G,we)&&(ue=je));const De=wo(Oe/G)===we;Wo(V,ue)&&(ue=ge&&De?te.key===(se?Sn:kn)?Oe:xt(V,{startingIndex:je-je%G-1,disabledIndices:Se}):je)}return ue}({current:L.map(V=>V!=null?i.current[V]:null)},{event:he,orientation:b,loop:d,rtl:h,cols:w,disabledIndices:Rm([...S||i.current.map((V,z)=>Ur(i.current,z)?z:void 0),void 0],L),minIndex:ne,maxIndex:ve,prevIndex:Lm(re.current>j?x:re.current,N,L,w,he.key===or?"bl":he.key===(h?kn:Sn)?"tr":"tl"),stopEvent:!0})];if($!=null&&(re.current=$,A(re.current)),b==="both")return}if(zc(he.key,b)){if(Nt(he),e&&!m&&hn(he.currentTarget.ownerDocument)===he.currentTarget)return re.current=ea(he.key,b,h)?x:j,void A(re.current);ea(he.key,b,h)?re.current=d?C>=j?f&&C!==i.current.length?-1:x:xt(i,{startingIndex:C,disabledIndices:S}):Math.min(j,xt(i,{startingIndex:C,disabledIndices:S})):re.current=d?C<=x?f&&C!==-1?i.current.length:j:xt(i,{startingIndex:C,decrement:!0,disabledIndices:S}):Math.max(x,xt(i,{startingIndex:C,decrement:!0,disabledIndices:S})),Wo(i,re.current)?A(null):A(re.current)}}),Ae=D.useMemo(()=>m&&e&&I&&{"aria-activedescendant":Z||W},[m,e,I,Z,W]),Pe=D.useMemo(()=>({"aria-orientation":b==="both"?void 0:b,...!Ia(r.domReference)&&Ae,onKeyDown:ke,onPointerMove(){pe.current=!0}}),[Ae,ke,r.domReference,b]),Te=D.useMemo(()=>{function he(C){v==="auto"&&hu(C.nativeEvent)&&(de.current=!0)}return{...Ae,onKeyDown(C){pe.current=!1;const x=C.key.startsWith("Arrow"),j=["Home","End"].includes(C.key),N=x||j,L=function(le,ge,se){return Ci(ge,se?le===kn:le===Sn,le===or)}(C.key,b,h),ne=Uc(C.key,b,h),ve=zc(C.key,b),$=(p?L:ve)||C.key==="Enter"||C.key.trim()==="";if(m&&e){const le=_==null?void 0:_.nodesRef.current.find(se=>se.parentId==null),ge=_&&le?function(se,G){let Se,Be=-1;return function Oe(je,Ee){Ee>Be&&(Se=je,Be=Ee),Xn(se,je).forEach(ue=>{Oe(ue.id,Ee+1)})}(G,0),se.find(Oe=>Oe.id===Se)}(_.nodesRef.current,le.id):null;if(N&&ge&&O){const se=new KeyboardEvent("keydown",{key:C.key,bubbles:!0});if(L||ne){var V,z;const G=((V=ge.context)==null?void 0:V.elements.domReference)===C.currentTarget,Se=ne&&!G?(z=ge.context)==null?void 0:z.elements.domReference:L?i.current.find(Be=>(Be==null?void 0:Be.id)===W):null;Se&&(Nt(C),Se.dispatchEvent(se),ie(void 0))}var te;if((ve||j)&&ge.context&&ge.context.open&&ge.parentId&&C.currentTarget!==ge.context.elements.domReference)return Nt(C),void((te=ge.context.elements.domReference)==null||te.dispatchEvent(se))}return ke(C)}(e||k||!x)&&($&&(ye.current=p&&ve?null:C.key),p?L&&(Nt(C),e?(re.current=Zi(i,J.current),A(re.current)):o(!0,C.nativeEvent,"list-navigation")):ve&&(u!=null&&(re.current=u),Nt(C),!e&&k?o(!0,C.nativeEvent,"list-navigation"):ke(C),e&&A(re.current)))},onFocus(){e&&!m&&A(null)},onPointerDown:function(C){de.current=v,v==="auto"&&mu(C.nativeEvent)&&(de.current=!0)},onMouseDown:he,onClick:he}},[W,Ae,ke,J,v,i,p,A,o,e,k,b,h,u,_,m,O]);return D.useMemo(()=>l?{reference:Te,floating:Pe,item:Ce}:{},[l,Te,Pe,Ce])}const Xm=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Vc(t,n){const[e,o]=t;let r=!1;const i=n.length;for(let a=0,c=i-1;a<i;c=a++){const[l,u]=n[a]||[0,0],[f,d]=n[c]||[0,0];u>=o!=d>=o&&e<=(f-l)*(o-u)/(d-u)+l&&(r=!r)}return r}function Qm(t){t===void 0&&(t={});const{buffer:n=.5,blockPointerEvents:e=!1,requireIntent:o=!0}=t;let r,i=!1,a=null,c=null,l=performance.now();const u=f=>{let{x:d,y:p,placement:h,elements:m,onClose:v,nodeId:y,tree:k}=f;return function(S){function b(){clearTimeout(r),v()}if(clearTimeout(r),!m.domReference||!m.floating||h==null||d==null||p==null)return;const{clientX:w,clientY:E}=S,O=[w,E],F=Cn(S),R=S.type==="mouseleave",U=vt(m.floating,F),K=vt(m.domReference,F),_=m.domReference.getBoundingClientRect(),A=m.floating.getBoundingClientRect(),me=h.split("-")[0],de=d>A.right-A.width/2,re=p>A.bottom-A.height/2,ye=function(H,P){return H[0]>=P.x&&H[0]<=P.x+P.width&&H[1]>=P.y&&H[1]<=P.y+P.height}(O,_),pe=A.width>_.width,xe=A.height>_.height,ae=(pe?_:A).left,B=(pe?_:A).right,X=(xe?_:A).top,Y=(xe?_:A).bottom;if(U&&(i=!0,!R))return;if(K&&(i=!1),K&&!R)return void(i=!0);if(R&&Ze(S.relatedTarget)&&vt(m.floating,S.relatedTarget)||k&&Xn(k.nodesRef.current,y).some(H=>{let{context:P}=H;return P==null?void 0:P.open}))return;if(me==="top"&&p>=_.bottom-1||me==="bottom"&&p<=_.top+1||me==="left"&&d>=_.right-1||me==="right"&&d<=_.left+1)return b();let J=[];switch(me){case"top":J=[[ae,_.top+1],[ae,A.bottom-1],[B,A.bottom-1],[B,_.top+1]];break;case"bottom":J=[[ae,A.top+1],[ae,_.bottom-1],[B,_.bottom-1],[B,A.top+1]];break;case"left":J=[[A.right-1,Y],[A.right-1,X],[_.left+1,X],[_.left+1,Y]];break;case"right":J=[[_.right-1,Y],[_.right-1,X],[A.left+1,X],[A.left+1,Y]]}if(!Vc([w,E],J)){if(i&&!ye)return b();if(!R&&o){const H=function(P,T){const W=performance.now(),q=W-l;if(a===null||c===null||q===0)return a=P,c=T,l=W,null;const Z=P-a,ie=T-c,oe=Math.sqrt(Z*Z+ie*ie);return a=P,c=T,l=W,oe/q}(S.clientX,S.clientY);if(H!==null&&H<.1)return b()}Vc([w,E],function(H){let[P,T]=H;switch(me){case"top":return[[pe?P+n/2:de?P+4*n:P-4*n,T+n+1],[pe?P-n/2:de?P+4*n:P-4*n,T+n+1],[A.left,de||pe?A.bottom-n:A.top],[A.right,de?pe?A.bottom-n:A.top:A.bottom-n]];case"bottom":return[[pe?P+n/2:de?P+4*n:P-4*n,T-n],[pe?P-n/2:de?P+4*n:P-4*n,T-n],[A.left,de||pe?A.top+n:A.bottom],[A.right,de?pe?A.top+n:A.bottom:A.top+n]];case"left":{const W=[P+n+1,xe?T+n/2:re?T+4*n:T-4*n],q=[P+n+1,xe?T-n/2:re?T+4*n:T-4*n];return[[re||xe?A.right-n:A.left,A.top],[re?xe?A.right-n:A.left:A.right-n,A.bottom],W,q]}case"right":return[[P-n,xe?T+n/2:re?T+4*n:T-4*n],[P-n,xe?T-n/2:re?T+4*n:T-4*n],[re||xe?A.left+n:A.right,A.top],[re?xe?A.left+n:A.right:A.left+n,A.bottom]]}}([d,p]))?!i&&o&&(r=window.setTimeout(b,40)):b()}}};return u.__options={blockPointerEvents:e},u}const Ma=g.createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1,setIsOpen:()=>{}}),Hu=g.forwardRef(({className:t,disabled:n,children:e,...o},r)=>{const i=g.useContext(Ma),a=Mu(),c=In(),l=a.index===i.activeIndex,u=ee("io-dropdown-menu-item",n&&"io-dropdown-menu-item-disabled",t);return s.jsx("div",{ref:Au([a.ref,r]),role:"menuitem",className:u,tabIndex:l?0:-1,"aria-disabled":n,...o,...i.getItemProps({onClick(f){var d;if(n)return f.preventDefault(),void f.stopPropagation();(d=o.onClick)==null||d.call(o,f),i.setIsOpen(!1),c==null||c.events.emit("click")},onFocus(f){var d;n||((d=o.onFocus)==null||d.call(o,f),i.setHasFocusInside(!0))}}),children:e})});Hu.displayName="DropdownMenuItem";const _a=g.forwardRef(({className:t,variant:n="default",icon:e,iconRight:o,text:r="",disabled:i,children:a,...c},l)=>{const[u,f]=g.useState(!1),[d,p]=g.useState(!1),[h,m]=g.useState(null),v=g.useRef([]),y=g.useRef([]),k=g.useContext(Ma),S=In(),b=function(){const P=Ta(),T=In(),W=Nn();return Je(()=>{const q={id:P,parentId:W};return T==null||T.addNode(q),()=>{T==null||T.removeNode(q)}},[T,P,W]),P}(),w=Nn(),E=Mu(),O=w!=null,{floatingStyles:F,refs:R,context:U}=qm({nodeId:b,open:u,onOpenChange:f,placement:O?"right-start":"bottom-start",middleware:[(K={mainAxis:O?0:4,alignmentAxis:O?-4:0},{...Im(K),options:[K,_]}),Mm(),Dm()],whileElementsMounted:Nm});var K,_;const A=function(P,T){T===void 0&&(T={});const{open:W,onOpenChange:q,dataRef:Z,events:ie,elements:oe}=P,{enabled:I=!0,delay:Ce=0,handleClose:ke=null,mouseOnly:Ae=!1,restMs:Pe=0,move:Te=!0}=T,he=In(),C=Nn(),x=Jt(ke),j=Jt(Ce),N=Jt(W),L=D.useRef(),ne=D.useRef(-1),ve=D.useRef(),$=D.useRef(-1),V=D.useRef(!0),z=D.useRef(!1),te=D.useRef(()=>{}),le=D.useRef(!1),ge=D.useCallback(()=>{var Ee;const ue=(Ee=Z.current.openEvent)==null?void 0:Ee.type;return(ue==null?void 0:ue.includes("mouse"))&&ue!=="mousedown"},[Z]);D.useEffect(()=>{if(I)return ie.on("openchange",Ee),()=>{ie.off("openchange",Ee)};function Ee(ue){let{open:we}=ue;we||(clearTimeout(ne.current),clearTimeout($.current),V.current=!0,le.current=!1)}},[I,ie]),D.useEffect(()=>{if(!I||!x.current||!W)return;function Ee(we){ge()&&q(!1,we,"hover")}const ue=kt(oe.floating).documentElement;return ue.addEventListener("mouseleave",Ee),()=>{ue.removeEventListener("mouseleave",Ee)}},[oe.floating,W,q,I,x,ge]);const se=D.useCallback(function(Ee,ue,we){ue===void 0&&(ue=!0),we===void 0&&(we="hover");const De=qi(j.current,"close",L.current);De&&!ve.current?(clearTimeout(ne.current),ne.current=window.setTimeout(()=>q(!1,Ee,we),De)):ue&&(clearTimeout(ne.current),q(!1,Ee,we))},[j,q]),G=At(()=>{te.current(),ve.current=void 0}),Se=At(()=>{if(z.current){const Ee=kt(oe.floating).body;Ee.style.pointerEvents="",Ee.removeAttribute(Ic),z.current=!1}}),Be=At(()=>!!Z.current.openEvent&&["click","mousedown"].includes(Z.current.openEvent.type));D.useEffect(()=>{if(I&&Ze(oe.domReference)){var Ee;const Ie=oe.domReference;return W&&Ie.addEventListener("mouseleave",De),(Ee=oe.floating)==null||Ee.addEventListener("mouseleave",De),Te&&Ie.addEventListener("mousemove",ue,{once:!0}),Ie.addEventListener("mouseenter",ue),Ie.addEventListener("mouseleave",we),()=>{var qe;W&&Ie.removeEventListener("mouseleave",De),(qe=oe.floating)==null||qe.removeEventListener("mouseleave",De),Te&&Ie.removeEventListener("mousemove",ue),Ie.removeEventListener("mouseenter",ue),Ie.removeEventListener("mouseleave",we)}}function ue(Ie){if(clearTimeout(ne.current),V.current=!1,Ae&&!Xo(L.current)||Pe>0&&!qi(j.current,"open"))return;const qe=qi(j.current,"open",L.current);qe?ne.current=window.setTimeout(()=>{N.current||q(!0,Ie,"hover")},qe):W||q(!0,Ie,"hover")}function we(Ie){if(Be())return;te.current();const qe=kt(oe.floating);if(clearTimeout($.current),le.current=!1,x.current&&Z.current.floatingContext){W||clearTimeout(ne.current),ve.current=x.current({...Z.current.floatingContext,tree:he,x:Ie.clientX,y:Ie.clientY,onClose(){Se(),G(),Be()||se(Ie,!0,"safe-polygon")}});const qt=ve.current;return qe.addEventListener("mousemove",qt),void(te.current=()=>{qe.removeEventListener("mousemove",qt)})}(L.current!=="touch"||!vt(oe.floating,Ie.relatedTarget))&&se(Ie)}function De(Ie){Be()||Z.current.floatingContext&&(x.current==null||x.current({...Z.current.floatingContext,tree:he,x:Ie.clientX,y:Ie.clientY,onClose(){Se(),G(),Be()||se(Ie)}})(Ie))}},[oe,I,P,Ae,Pe,Te,se,G,Se,q,W,N,he,j,x,Z,Be]),Je(()=>{var Ee;if(I&&W&&(Ee=x.current)!=null&&Ee.__options.blockPointerEvents&&ge()){z.current=!0;const we=oe.floating;if(Ze(oe.domReference)&&we){var ue;const De=kt(oe.floating).body;De.setAttribute(Ic,"");const Ie=oe.domReference,qe=he==null||(ue=he.nodesRef.current.find(qt=>qt.id===C))==null||(ue=ue.context)==null?void 0:ue.elements.floating;return qe&&(qe.style.pointerEvents=""),De.style.pointerEvents="none",Ie.style.pointerEvents="auto",we.style.pointerEvents="auto",()=>{De.style.pointerEvents="",Ie.style.pointerEvents="",we.style.pointerEvents=""}}}},[I,W,C,oe,he,x,ge]),Je(()=>{W||(L.current=void 0,le.current=!1,G(),Se())},[W,G,Se]),D.useEffect(()=>()=>{G(),clearTimeout(ne.current),clearTimeout($.current),Se()},[I,oe.domReference,G,Se]);const Oe=D.useMemo(()=>{function Ee(ue){L.current=ue.pointerType}return{onPointerDown:Ee,onPointerEnter:Ee,onMouseMove(ue){const{nativeEvent:we}=ue;function De(){V.current||N.current||q(!0,we,"hover")}Ae&&!Xo(L.current)||W||Pe===0||le.current&&ue.movementX**2+ue.movementY**2<2||(clearTimeout($.current),L.current==="touch"?De():(le.current=!0,$.current=window.setTimeout(De,Pe)))}}},[Ae,q,W,N,Pe]),je=D.useMemo(()=>({onMouseEnter(){clearTimeout(ne.current)},onMouseLeave(Ee){Be()||se(Ee.nativeEvent,!1)}}),[se,Be]);return D.useMemo(()=>I?{reference:Oe,floating:je}:{},[I,Oe,je])}(U,{enabled:O,delay:{open:75},handleClose:Qm({blockPointerEvents:!0})}),me=function(P,T){T===void 0&&(T={});const{open:W,onOpenChange:q,dataRef:Z,elements:{domReference:ie}}=P,{enabled:oe=!0,event:I="click",toggle:Ce=!0,ignoreMouse:ke=!1,keyboardHandlers:Ae=!0,stickIfOpen:Pe=!0}=T,Te=D.useRef(),he=D.useRef(!1),C=D.useMemo(()=>({onPointerDown(x){Te.current=x.pointerType},onMouseDown(x){const j=Te.current;x.button===0&&I!=="click"&&(Xo(j,!0)&&ke||(!W||!Ce||Z.current.openEvent&&Pe&&Z.current.openEvent.type!=="mousedown"?(x.preventDefault(),q(!0,x.nativeEvent,"click")):q(!1,x.nativeEvent,"click")))},onClick(x){const j=Te.current;I==="mousedown"&&Te.current?Te.current=void 0:Xo(j,!0)&&ke||(!W||!Ce||Z.current.openEvent&&Pe&&Z.current.openEvent.type!=="click"?q(!0,x.nativeEvent,"click"):q(!1,x.nativeEvent,"click"))},onKeyDown(x){Te.current=void 0,x.defaultPrevented||!Ae||Rc(x)||(x.key!==" "||Fc(ie)||(x.preventDefault(),he.current=!0),x.key==="Enter"&&q(!W||!Ce,x.nativeEvent,"click"))},onKeyUp(x){x.defaultPrevented||!Ae||Rc(x)||Fc(ie)||x.key===" "&&he.current&&(he.current=!1,q(!W||!Ce,x.nativeEvent,"click"))}}),[Z,ie,I,ke,Ae,q,W,Pe,Ce]);return D.useMemo(()=>oe?{reference:C}:{},[oe,C])}(U,{event:"mousedown",toggle:!O,ignoreMouse:O}),de=function(P,T){var W;T===void 0&&(T={});const{open:q,floatingId:Z}=P,{enabled:ie=!0,role:oe="dialog"}=T,I=(W=Xm.get(oe))!=null?W:oe,Ce=Ta(),ke=Nn()!=null,Ae=D.useMemo(()=>I==="tooltip"||oe==="label"?{["aria-"+(oe==="label"?"labelledby":"describedby")]:q?Z:void 0}:{"aria-expanded":q?"true":"false","aria-haspopup":I==="alertdialog"?"dialog":I,"aria-controls":q?Z:void 0,...I==="listbox"&&{role:"combobox"},...I==="menu"&&{id:Ce},...I==="menu"&&ke&&{role:"menuitem"},...oe==="select"&&{"aria-autocomplete":"none"},...oe==="combobox"&&{"aria-autocomplete":"list"}},[I,Z,ke,q,Ce,oe]),Pe=D.useMemo(()=>{const he={id:Z,...I&&{role:I}};return I==="tooltip"||oe==="label"?he:{...he,...I==="menu"&&{"aria-labelledby":Ce}}},[I,Z,Ce,oe]),Te=D.useCallback(he=>{let{active:C,selected:x}=he;const j={role:"option",...C&&{id:Z+"-option"}};switch(oe){case"select":return{...j,"aria-selected":C&&x};case"combobox":return{...j,...C&&{"aria-selected":!0}}}return{}},[Z,oe]);return D.useMemo(()=>ie?{reference:Ae,floating:Pe,item:Te}:{},[ie,Ae,Pe,Te])}(U,{role:"menu"}),re=function(P,T){T===void 0&&(T={});const{open:W,onOpenChange:q,elements:Z,dataRef:ie}=P,{enabled:oe=!0,escapeKey:I=!0,outsidePress:Ce=!0,outsidePressEvent:ke="pointerdown",referencePress:Ae=!1,referencePressEvent:Pe="pointerdown",ancestorScroll:Te=!1,bubbles:he,capture:C}=T,x=In(),j=At(typeof Ce=="function"?Ce:()=>!1),N=typeof Ce=="function"?j:Ce,L=D.useRef(!1),ne=D.useRef(!1),{escapeKey:ve,outsidePress:$}=Bc(he),{escapeKey:V,outsidePress:z}=Bc(C),te=D.useRef(!1),le=At(Oe=>{var je;if(!W||!oe||!I||Oe.key!=="Escape"||te.current)return;const Ee=(je=ie.current.floatingContext)==null?void 0:je.nodeId,ue=x?Xn(x.nodesRef.current,Ee):[];if(!ve&&(Oe.stopPropagation(),ue.length>0)){let we=!0;if(ue.forEach(De=>{var Ie;(Ie=De.context)==null||!Ie.open||De.context.dataRef.current.__escapeKeyBubbles||(we=!1)}),!we)return}q(!1,function(we){return"nativeEvent"in we}(Oe)?Oe.nativeEvent:Oe,"escape-key")}),ge=At(Oe=>{var je;const Ee=()=>{var ue;le(Oe),(ue=Cn(Oe))==null||ue.removeEventListener("keydown",Ee)};(je=Cn(Oe))==null||je.addEventListener("keydown",Ee)}),se=At(Oe=>{var je;const Ee=L.current;L.current=!1;const ue=ne.current;if(ne.current=!1,ke==="click"&&ue||Ee||typeof N=="function"&&!N(Oe))return;const we=Cn(Oe),De="["+ur("inert")+"]",Ie=kt(Z.floating).querySelectorAll(De);let qe=Ze(we)?we:null;for(;qe&&!Pn(qe);){const Ut=mn(qe);if(Pn(Ut)||!Ze(Ut))break;qe=Ut}if(Ie.length&&Ze(we)&&!we.matches("html,body")&&!vt(we,Z.floating)&&Array.from(Ie).every(Ut=>!vt(qe,Ut)))return;if(dt(we)&&Be){const Ut=we.clientWidth>0&&we.scrollWidth>we.clientWidth,bn=we.clientHeight>0&&we.scrollHeight>we.clientHeight;let Bo=bn&&Oe.offsetX>we.clientWidth;if(bn&&Gt(we).direction==="rtl"&&(Bo=Oe.offsetX<=we.offsetWidth-we.clientWidth),Bo||Ut&&Oe.offsetY>we.clientHeight)return}const qt=(je=ie.current.floatingContext)==null?void 0:je.nodeId,hc=x&&Xn(x.nodesRef.current,qt).some(Ut=>{var bn;return Vi(Oe,(bn=Ut.context)==null?void 0:bn.elements.floating)});if(Vi(Oe,Z.floating)||Vi(Oe,Z.domReference)||hc)return;const mc=x?Xn(x.nodesRef.current,qt):[];if(mc.length>0){let Ut=!0;if(mc.forEach(bn=>{var Bo;(Bo=bn.context)==null||!Bo.open||bn.context.dataRef.current.__outsidePressBubbles||(Ut=!1)}),!Ut)return}q(!1,Oe,"outside-press")}),G=At(Oe=>{var je;const Ee=()=>{var ue;se(Oe),(ue=Cn(Oe))==null||ue.removeEventListener(ke,Ee)};(je=Cn(Oe))==null||je.addEventListener(ke,Ee)});D.useEffect(()=>{if(!W||!oe)return;ie.current.__escapeKeyBubbles=ve,ie.current.__outsidePressBubbles=$;let Oe=-1;function je(Ie){q(!1,Ie,"ancestor-scroll")}function Ee(){window.clearTimeout(Oe),te.current=!0}function ue(){Oe=window.setTimeout(()=>{te.current=!1},yi()?5:0)}const we=kt(Z.floating);I&&(we.addEventListener("keydown",V?ge:le,V),we.addEventListener("compositionstart",Ee),we.addEventListener("compositionend",ue)),N&&we.addEventListener(ke,z?G:se,z);let De=[];return Te&&(Ze(Z.domReference)&&(De=An(Z.domReference)),Ze(Z.floating)&&(De=De.concat(An(Z.floating))),!Ze(Z.reference)&&Z.reference&&Z.reference.contextElement&&(De=De.concat(An(Z.reference.contextElement)))),De=De.filter(Ie=>{var qe;return Ie!==((qe=we.defaultView)==null?void 0:qe.visualViewport)}),De.forEach(Ie=>{Ie.addEventListener("scroll",je,{passive:!0})}),()=>{I&&(we.removeEventListener("keydown",V?ge:le,V),we.removeEventListener("compositionstart",Ee),we.removeEventListener("compositionend",ue)),N&&we.removeEventListener(ke,z?G:se,z),De.forEach(Ie=>{Ie.removeEventListener("scroll",je)}),window.clearTimeout(Oe)}},[ie,Z,I,N,ke,W,q,Te,oe,ve,$,le,V,ge,se,z,G]),D.useEffect(()=>{L.current=!1},[N,ke]);const Se=D.useMemo(()=>({onKeyDown:le,[Ym[Pe]]:Oe=>{Ae&&q(!1,Oe.nativeEvent,"reference-press")}}),[le,q,Ae,Pe]),Be=D.useMemo(()=>({onKeyDown:le,onMouseDown(){ne.current=!0},onMouseUp(){ne.current=!0},[Zm[ke]]:()=>{L.current=!0}}),[le,ke]);return D.useMemo(()=>oe?{reference:Se,floating:Be}:{},[oe,Se,Be])}(U,{bubbles:!0}),ye=Jm(U,{listRef:v,activeIndex:h,nested:O,onNavigate:m}),{getReferenceProps:pe,getFloatingProps:xe,getItemProps:ae}=function(P){P===void 0&&(P=[]);const T=P.map(I=>I==null?void 0:I.reference),W=P.map(I=>I==null?void 0:I.floating),q=P.map(I=>I==null?void 0:I.item),Z=D.useCallback(I=>Qi(I,P,"reference"),T),ie=D.useCallback(I=>Qi(I,P,"floating"),W),oe=D.useCallback(I=>Qi(I,P,"item"),q);return D.useMemo(()=>({getReferenceProps:Z,getFloatingProps:ie,getItemProps:oe}),[Z,ie,oe])}([A,me,de,re,ye]);g.useEffect(()=>{if(S)return S.events.on("click",P),S.events.on("menuopen",T),()=>{S.events.off("click",P),S.events.off("menuopen",T)};function P(){f(!1)}function T(W){W.nodeId!==b&&W.parentId===w&&f(!1)}},[S,b,w]),g.useEffect(()=>{u&&S&&S.events.emit("menuopen",{parentId:w,nodeId:b})},[S,u,b,w]);const B={activeIndex:h,setActiveIndex:m,getItemProps:ae,setHasFocusInside:p,isOpen:u,setIsOpen:f},X=g.useMemo(()=>B,[h,m,ae,p,u]),Y=ee("io-dropdown-menu-button",O&&"io-dropdown-menu-item",u&&!O&&"active",t),J=Au([R.setReference,E.ref,l]),H=k.activeIndex===E.index?0:-1;return s.jsxs(Wm,{id:b,children:[s.jsx(Ye,{className:Y,ref:J,variant:O?"link":n,tabIndex:O?H:void 0,role:O?"menuitem":void 0,"data-open":u?"":void 0,"data-nested":O?"":void 0,"data-focus-inside":d?"":void 0,text:r,icon:O?"chevron-right":e,iconSize:"10",iconRight:!!O||o,disabled:i,...pe(k.getItemProps({onFocus(P){var T;(T=c.onFocus)==null||T.call(c,P),p(!1),k.setHasFocusInside(!0)},...c}))}),s.jsx(Ma.Provider,{value:X,children:s.jsx(Bm,{elementsRef:v,labelsRef:y,children:u&&s.jsx(Gm,{context:U,modal:!1,initialFocus:O?-1:0,returnFocus:!O,children:s.jsx("div",{ref:R.setFloating,className:"io-dropdown-menu",style:F,...xe(),children:a})})})})]})});_a.displayName="DropdownMenu";const Xt=g.forwardRef(({...t},n)=>Nn()===null?s.jsx($m,{children:s.jsx(_a,{ref:n,...t})}):s.jsx(_a,{ref:n,...t}));function Wu({className:t,variant:n="default",size:e="16",src:o,alt:r,...i}){const a=ee("io-image-icon",n==="grayscale"&&[`io-image-icon-${n}`],e&&[`io-image-icon-${e}`],t);return s.jsx("img",{className:a,style:{width:`${e}px`,filter:n==="grayscale"?"grayscale(100%)":"none"},src:o,alt:r,...i})}function eg({className:t,size:n="large",variant:e="default",align:o="up",text:r,...i}){const a=ee("io-loader",{[`io-loader-${e}`]:e!=="default"},n==="normal"&&"io-loader-md",n==="small"&&"io-loader-sm",o&&[`direction-${o}`],t);return s.jsxs("div",{className:a,role:"status","aria-live":"polite",...i,children:[s.jsx("div",{className:"io-loader-icon"}),r&&s.jsx("div",{className:"io-loader-text",children:r})]})}function En({className:t,children:n,...e}){const o=ee("io-panel-header",t);return s.jsx(Bt,{className:o,...e,children:n})}Xt.displayName="DropdownMenu",Xt.Item=Hu,Xt.Separator=wr,En.Title=sn,En.ButtonGroup=Re,En.Button=Ye,En.ButtonIcon=Ve,En.Dropdown=fe;const Oo=g.forwardRef(({className:t,children:n,...e},o)=>{const r=ee("io-panel-body",t);return s.jsx("div",{className:r,ref:o,"data-testid":"panel-body",...e,children:n})});function go({className:t,...n}){const e=ee("io-panel-footer",t);return s.jsx(Zn,{className:e,...n})}function Ge({className:t,children:n,...e}){const o=ee("io-panel",t);return s.jsx("div",{className:o,"data-testid":"panel",...e,children:n})}function ki({className:t,variant:n="default",children:e,...o}){const r=ee("io-pill",n!=="default"&&[`io-pill-${n}`],t);return s.jsx("div",{className:r,role:"status",...o,children:e})}function tg({className:t,variant:n="active",value:e=0,...o}){const r=ee("io-progress",n,t);let i;return i=e<0?0:e>100?100:e,s.jsx("div",{className:r,role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,...o,children:s.jsx("div",{className:"io-progress-bar",style:{width:`${i}%`}})})}function Si({text:t="Label",...n}){return s.jsx("label",{...n,children:t})}Oo.displayName="PanelBody",go.ButtonGroup=Re,go.Button=Ye,go.ButtonIcon=Ve,go.Dropdown=fe,Ge.Header=En,Ge.Body=Oo,Ge.Footer=go,ki.Icon=ot;const no=g.forwardRef(({id:t="input",className:n,type:e="text",name:o="input",align:r="up",label:i,iconPrepend:a,iconPrependOnClick:c,iconAppend:l,iconAppendOnClick:u,placeholder:f,disabled:d,readOnly:p,errorMessage:h,errorDataTestId:m,...v},y)=>{const k=ee("io-control-input",a&&"io-control-leading-icon",l&&"io-control-trailing-icon",d&&"io-control-disabled",p&&"io-control-readonly",h&&"io-control-error",r&&[`direction-${r}`],n),S=g.useCallback(w=>{d?w.preventDefault():c&&c(w)},[c,d]),b=g.useCallback(w=>{d?w.preventDefault():u&&u(w)},[u,d]);return s.jsxs("div",{className:k,children:[i&&s.jsx(Si,{htmlFor:t,text:i}),a&&s.jsx(ot,{variant:a,onClick:w=>S(w)}),s.jsx("input",{id:t,className:"io-input",ref:y,type:e,name:o,tabIndex:0,placeholder:f??(()=>{switch(e){case"email":return"Enter your email here...";case"number":return"Enter number here...";case"password":return"Enter your password here...";case"tel":return"Enter your phone number here...";case"file":return"Select a file...";default:return"Enter text here..."}})(),"aria-label":i,disabled:d,readOnly:p,...h?{"aria-invalid":!0,"aria-describedby":`${t}-error`}:{},...v}),l&&s.jsx(ot,{variant:l,onClick:w=>b(w)}),h&&s.jsxs("div",{"data-testid":m,id:`${t}-error`,className:"io-input-error",children:[s.jsx(ot,{variant:"close"}),h]})]})});no.displayName="Input";const Ei=g.forwardRef(({id:t="textarea",className:n,name:e="textarea",align:o="up",label:r,rows:i=4,placeholder:a="Enter text here...",disabled:c,readOnly:l,...u},f)=>{const d=ee("io-control-textarea",c&&"io-control-disabled",l&&"io-control-readonly",o&&[`direction-${o}`],n);return s.jsxs("div",{className:d,children:[r&&s.jsx(Si,{htmlFor:t,text:r}),s.jsx("textarea",{id:t,className:"io-textarea",ref:f,name:e,tabIndex:0,placeholder:a,"aria-label":r,disabled:c,readOnly:l,rows:i,...u})]})});Ei.displayName="Textarea";const ji=g.forwardRef(({id:t="checkbox",className:n,name:e="checkbox",align:o="left",label:r,checked:i,disabled:a,...c},l)=>{const u=ee("io-control-checkbox",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsxs("div",{className:u,children:[s.jsx("input",{type:"checkbox",id:t,className:"io-checkbox",ref:l,name:e,tabIndex:a?-1:0,checked:i,disabled:a,"aria-checked":i,...c}),r&&s.jsx(Si,{htmlFor:t,text:r,"data-testid":c["data-testid"]?`${c["data-testid"]}-label`:void 0})]})});ji.displayName="Checkbox";const ng=g.forwardRef(({id:t="radio",className:n,name:e="radio",align:o="left",label:r,checked:i,disabled:a,...c},l)=>{const u=ee("io-control-radio",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsxs("div",{className:u,children:[s.jsx("input",{type:"radio",id:t,className:"io-radio",ref:l,name:e,tabIndex:a?-1:0,checked:i,disabled:a,"aria-checked":i,...c}),r&&s.jsx(Si,{htmlFor:t,text:r})]})});ng.displayName="Radio";const ft=g.forwardRef(({id:t,className:n,name:e="toggle",align:o="left",label:r,checked:i,disabled:a,onKeyDown:c,"data-testid":l="toggle",...u},f)=>{const d=g.useId(),p=t||`toggle-${d}`,h=ee("io-control-toggle",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],n);return s.jsx("div",{className:h,children:s.jsxs("label",{className:"io-toggle",htmlFor:p,tabIndex:a?-1:0,onKeyDown:c,"data-testid":`${l}-label`,children:[s.jsx("input",{type:"checkbox",id:p,className:"io-checkbox",ref:f,name:e,checked:i,disabled:a,"aria-checked":i,tabIndex:-1,"data-testid":l,...u}),s.jsx("span",{className:"slider","data-testid":`${l}-slider`}),r]})})});function $u(t,n=500){const[e,o]=g.useState(t);return g.useEffect(()=>{const r=setTimeout(()=>{o(t)},n);return()=>clearTimeout(r)},[t,n]),e}function og(t,n){g.useEffect(()=>{const e=o=>{o.code===t&&n()};return document.addEventListener("keyup",e),()=>document.removeEventListener("keyup",e)},[t,n])}ft.displayName="Toggle";const Oi=()=>window.glue42gd!==void 0||window.iodesktop!==void 0;function We(){return g.useMemo(()=>typeof window=="object"&&Oi(),[])}g.createContext({theme:"dark"});const Gc="io-connect-platform",Un="___platform_prefs___",rg="_launchpad_collapsedSections",ig="_launchpad_favorites",ag="_launchpad_isLayoutsPanelOpen",sg="_launchpad_isCollapsed",La="_launchpad_isPinned",zu="_launchpad_pinnedPosition",Uu="_launchpad_allowDocking",Vu="_launchpad_minimizeToTray",Gu="_launchpad_autoCloseStartingAppsAndWorkspaces",Yu="_launchpad_showTutorialOnStartup",Zu="_layouts_restoreLastSaved",Ku="_layouts_saveCurrentOnExit",qu="_layouts_showUnsavedChangesPrompt",Ju="_layouts_showDeletePrompt",Xu="_downloads_askForEachDownload",cg="_downloads_location",lg="_system_scheduleRestart",ug="_system_scheduleRestartTime",dg="_system_scheduleRestartFrequency",fg="_system_scheduleRestartDay",pg="_system_scheduleShutdown",hg="_system_scheduleShutdownTime",mg="_system_scheduleShutdownFrequency",gg="_system_scheduleShutdownDay",vg={[rg]:[],[ig]:[],[ag]:!1,[sg]:!1,[La]:!1,[zu]:"Left",[Uu]:!0,[Vu]:!1,[Gu]:!0,[Yu]:!0,[Zu]:!0,[Ku]:!0,[qu]:!0,[Ju]:!0,[Xu]:!0,[cg]:"",[lg]:!1,[ug]:"12:00 AM",[dg]:"daily",[fg]:"Monday",[pg]:!1,[hg]:"12:00 AM",[mg]:"daily",[gg]:"Monday"},Vn=t=>typeof t=="string"?t:t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):JSON.stringify(t),xs="warning",yg={success:5e3,warning:1e4};var ht=function(t){return{ok:!0,result:t}},it=function(t){return{ok:!1,error:t}},Yc=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:ht(t(n.result,e.result))},ta=function(t,n){return n.ok===!0?n:it(t(n.error))},Ra=function(){return Ra=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Ra.apply(this,arguments)};function Fa(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!Fa(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!Fa(t[o[e]],n[o[e]]))return!1;return!0}}var Qo=function(t){return Array.isArray(t)},Ar=function(t){return typeof t=="object"&&t!==null&&!Qo(t)},un=function(t,n){return"expected "+t+", got "+function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":e===null?"null":"an object";default:return JSON.stringify(e)}}(n)},$o=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},zo=function(t,n){var e=n.at,o=function(r,i){var a={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&i.indexOf(c)<0&&(a[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(c=Object.getOwnPropertySymbols(r);l<c.length;l++)i.indexOf(c[l])<0&&Object.prototype.propertyIsEnumerable.call(r,c[l])&&(a[c[l]]=r[c[l]])}return a}(n,["at"]);return Ra({at:t+(e||"")},o)},ct=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return ta(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return(r=e.run(o)).ok===!0?Promise.resolve(r.result):Promise.reject(r.error);var r},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(e.run(o))},this.map=function(o){return new t(function(r){return function(i,a){return a.ok===!0?ht(i(a.result)):a}(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?ht(n):it({message:un("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?ht(n):it({message:un("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?ht(n):it({message:un("a boolean",n)})})},t.constant=function(n){return new t(function(e){return Fa(e,n)?ht(n):it({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Ar(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok!==!0)return e[r]===void 0?it({message:"the key '"+r+"' is required but was not present"}):it(zo("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return ht(o)}return Ar(e)?ht(e):it({message:un("an object",e)})})},t.array=function(n){return new t(function(e){return Qo(e)&&n?e.reduce(function(o,r,i){return Yc(function(a,c){return a.concat([c])},o,function(a,c){return ta(function(l){return zo("["+c+"]",l)},n.decode(a))}(r,i))},ht([])):Qo(e)?ht(e):it({message:un("an array",e)})})},t.tuple=function(n){return new t(function(e){if(Qo(e)){if(e.length!==n.length)return it({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(!i.ok)return it(zo("["+r+"]",i.error));o[r]=i.result}return ht(o)}return it({message:un("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return Yc(Object.assign,a,c.decode(i))},ht({}))})},t.anyJson=function(){return new t(function(n){return ht(n)})},t.unknownJson=function(){return new t(function(n){return ht(n)})},t.dict=function(n){return new t(function(e){if(Ar(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok!==!0)return it(zo("."+r,i.error));o[r]=i.result}return ht(o)}return it({message:un("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?ht(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return it({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return ht(function(r,i){return i.ok===!0?i.result:r}(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return it({at:$o(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Ar(r))return it({at:$o(n.slice(0,i+1)),message:un("an object",r)});if(typeof n[i]=="number"&&!Qo(r))return it({at:$o(n.slice(0,i+1)),message:un("an array",r)});r=r[n[i]]}return ta(function(a){return r===void 0?{at:$o(n),message:"path does not exist"}:zo($o(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return ht(n)})},t.fail=function(n){return new t(function(e){return it({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),Qu=ct.string;ct.number;var Pt=ct.boolean,ed=ct.anyJson;ct.unknownJson;var M=ct.constant,td=ct.object,Ba=ct.array;ct.tuple,ct.dict;var Ue=ct.optional,Ni=ct.oneOf;ct.union,ct.intersection,ct.withDefault,ct.valueAt,ct.succeed,ct.fail,ct.lazy;const Zc=["name","title","version","customProperties","icon","caption","type"],wg=["appId","name","type","details","version","title","tooltip","lang","description","categories","icons","screenshots","contactEmail","moreInfo","publisher","customConfig","hostManifests","interop","localizedVersions"];var mt=function(t){return{ok:!0,result:t}},at=function(t){return{ok:!1,error:t}},Kc=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:mt(t(n.result,e.result))},na=function(t,n){return n.ok===!0?n:at(t(n.error))},Ha=function(){return Ha=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Ha.apply(this,arguments)};function Wa(t,n){if(t===n||t===null&&n===null)return!0;if(typeof t!=typeof n)return!1;if(typeof t=="object"){if(Array.isArray(t)){if(!Array.isArray(n)||t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(!Wa(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!Wa(t[o[e]],n[o[e]]))return!1;return!0}}var er=function(t){return Array.isArray(t)},Tr=function(t){return typeof t=="object"&&t!==null&&!er(t)},dn=function(t,n){return"expected "+t+", got "+function(e){switch(typeof e){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return e instanceof Array?"an array":e===null?"null":"an object";default:return JSON.stringify(e)}}(n)},Uo=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},Vo=function(t,n){var e=n.at,o=function(r,i){var a={};for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&i.indexOf(c)<0&&(a[c]=r[c]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var l=0;for(c=Object.getOwnPropertySymbols(r);l<c.length;l++)i.indexOf(c[l])<0&&Object.prototype.propertyIsEnumerable.call(r,c[l])&&(a[c[l]]=r[c[l]])}return a}(n,["at"]);return Ha({at:t+(e||"")},o)},lt=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return na(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return(r=e.run(o)).ok===!0?Promise.resolve(r.result):Promise.reject(r.error);var r},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(e.run(o))},this.map=function(o){return new t(function(r){return function(i,a){return a.ok===!0?mt(i(a.result)):a}(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},e.decode(r))})},this.where=function(o,r){return e.andThen(function(i){return o(i)?t.succeed(i):t.fail(r)})}}return t.string=function(){return new t(function(n){return typeof n=="string"?mt(n):at({message:dn("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?mt(n):at({message:dn("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?mt(n):at({message:dn("a boolean",n)})})},t.constant=function(n){return new t(function(e){return Wa(e,n)?mt(n):at({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Tr(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok!==!0)return e[r]===void 0?at({message:"the key '"+r+"' is required but was not present"}):at(Vo("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return mt(o)}return Tr(e)?mt(e):at({message:dn("an object",e)})})},t.array=function(n){return new t(function(e){return er(e)&&n?e.reduce(function(o,r,i){return Kc(function(a,c){return a.concat([c])},o,function(a,c){return na(function(l){return Vo("["+c+"]",l)},n.decode(a))}(r,i))},mt([])):er(e)?mt(e):at({message:dn("an array",e)})})},t.tuple=function(n){return new t(function(e){if(er(e)){if(e.length!==n.length)return at({message:"expected a tuple of length "+n.length+", got one of length "+e.length});for(var o=[],r=0;r<n.length;r++){var i=n[r].decode(e[r]);if(!i.ok)return at(Vo("["+r+"]",i.error));o[r]=i.result}return mt(o)}return at({message:dn("a tuple of length "+n.length,e)})})},t.union=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return t.oneOf.apply(t,[n,e].concat(o))},t.intersection=function(n,e){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new t(function(i){return[n,e].concat(o).reduce(function(a,c){return Kc(Object.assign,a,c.decode(i))},mt({}))})},t.anyJson=function(){return new t(function(n){return mt(n)})},t.unknownJson=function(){return new t(function(n){return mt(n)})},t.dict=function(n){return new t(function(e){if(Tr(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok!==!0)return at(Vo("."+r,i.error));o[r]=i.result}return mt(o)}return at({message:dn("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?mt(void 0):n.decode(e)})},t.oneOf=function(){for(var n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];return new t(function(o){for(var r=[],i=0;i<n.length;i++){var a=n[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var c=r.map(function(l){return"at error"+(l.at||"")+": "+l.message}).join('", "');return at({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return mt(function(r,i){return i.ok===!0?i.result:r}(n,e.decode(o)))})},t.valueAt=function(n,e){return new t(function(o){for(var r=o,i=0;i<n.length;i++){if(r===void 0)return at({at:Uo(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Tr(r))return at({at:Uo(n.slice(0,i+1)),message:dn("an object",r)});if(typeof n[i]=="number"&&!er(r))return at({at:Uo(n.slice(0,i+1)),message:dn("an array",r)});r=r[n[i]]}return na(function(a){return r===void 0?{at:Uo(n),message:"path does not exist"}:Vo(Uo(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return mt(n)})},t.fail=function(n){return new t(function(e){return at({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),dr=lt.string,$a=lt.number,bg=lt.boolean,oo=lt.anyJson;lt.unknownJson;var Go=lt.constant,wt=lt.object,rt=lt.array;lt.tuple;var za=lt.dict,ce=lt.optional,nd=lt.oneOf;lt.union,lt.intersection,lt.withDefault,lt.valueAt,lt.succeed,lt.fail,lt.lazy;const be=dr().where(t=>t.length>0,"Expected a non-empty string"),Ua=$a().where(t=>t>=0,"Expected a non-negative number"),od=wt({name:be,displayName:ce(dr()),contexts:ce(rt(dr())),customConfig:ce(wt())}),xg=nd(Go("web"),Go("native"),Go("citrix"),Go("onlineNative"),Go("other")),rd=wt({url:be}),id=wt({src:be,size:ce(be),type:ce(be)}),ad=wt({src:be,size:ce(be),type:ce(be),label:ce(be)}),Cg=wt({contexts:rt(be),displayName:ce(be),resultType:ce(be),customConfig:ce(oo())}),kg=wt({listensFor:ce(za(Cg)),raises:ce(za(rt(be)))}),Sg=wt({broadcasts:ce(rt(be)),listensFor:ce(rt(be))}),Eg=wt({name:be,description:ce(be),broadcasts:ce(rt(be)),listensFor:ce(rt(be))}),sd=wt({intents:ce(kg),userChannels:ce(Sg),appChannels:ce(rt(Eg))}),jg=wt({url:ce(be),top:ce($a()),left:ce($a()),width:ce(Ua),height:ce(Ua)}),Og=wt({name:ce(be),type:ce(be.where(t=>t==="window","Expected a value of window")),title:ce(be),version:ce(be),customProperties:ce(oo()),icon:ce(dr()),caption:ce(dr()),details:ce(jg),intents:ce(rt(od)),hidden:ce(bg())}),cd=wt({name:be,appId:be,title:ce(be),version:ce(be),manifest:be,manifestType:be,tooltip:ce(be),description:ce(be),contactEmail:ce(be),supportEmail:ce(be),publisher:ce(be),images:ce(rt(wt({url:ce(be)}))),icons:ce(rt(wt({icon:ce(be)}))),customConfig:oo(),intents:ce(rt(od))}),Ng=wt({appId:ce(be),name:ce(be),details:ce(rd),version:ce(be),title:ce(be),tooltip:ce(be),lang:ce(be),description:ce(be),categories:ce(rt(be)),icons:ce(rt(id)),screenshots:ce(rt(ad)),contactEmail:ce(be),supportEmail:ce(be),moreInfo:ce(be),publisher:ce(be),customConfig:ce(rt(oo())),hostManifests:ce(oo()),interop:ce(sd)}),ld=wt({appId:be,name:ce(be),type:xg,details:rd,version:ce(be),title:ce(be),tooltip:ce(be),lang:ce(be),description:ce(be),categories:ce(rt(be)),icons:ce(rt(id)),screenshots:ce(rt(ad)),contactEmail:ce(be),supportEmail:ce(be),moreInfo:ce(be),publisher:ce(be),customConfig:ce(rt(oo())),hostManifests:ce(oo()),interop:ce(sd),localizedVersions:ce(za(Ng))}),Vr=nd(cd,ld),Dr=t=>`${t.kind} at ${t.at}: ${JSON.stringify(t.input)}. Reason - ${t.message}`;class Ig{constructor(){It(this,"fdc3ToDesktopDefinitionType",{web:"window",native:"exe",citrix:"citrix",onlineNative:"clickonce",other:"window"})}toApi(){return{isFdc3Definition:this.isFdc3Definition.bind(this),parseToBrowserBaseAppData:this.parseToBrowserBaseAppData.bind(this),parseToDesktopAppConfig:this.parseToDesktopAppConfig.bind(this)}}isFdc3Definition(n){const e=Vr.run(n);return e.ok?n.appId&&n.details?{isFdc3:!0,version:"2.0"}:n.manifest?{isFdc3:!0,version:"1.2"}:{isFdc3:!1,reason:"The passed definition is not FDC3"}:{isFdc3:!1,reason:Dr(e.error)}}parseToBrowserBaseAppData(n){var f,d;const{isFdc3:e,version:o}=this.isFdc3Definition(n);if(!e)throw new Error("The passed definition is not FDC3");const r=Vr.run(n);if(!r.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Dr(r.error)}`);const i=this.getUserPropertiesFromDefinition(n,o),a={url:this.getUrl(n,o)},c={name:n.appId,type:"window",createOptions:a,userProperties:{...i,intents:o==="1.2"?i.intents:this.getIntentsFromV2AppDefinition(n),details:a},title:n.title,version:n.version,icon:this.getIconFromDefinition(n,o),caption:n.description,fdc3:o==="2.0"?{...n,definitionVersion:"2.0"}:void 0},l=((f=n.hostManifests)==null?void 0:f.ioConnect)||((d=n.hostManifests)==null?void 0:d.Glue42);if(!l)return c;const u=Og.run(l);if(!u.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Dr(u.error)}`);return Object.keys(u.result).length?this.mergeBaseAppDataWithGlueManifest(c,u.result):c}parseToDesktopAppConfig(n){var l,u,f;const{isFdc3:e,version:o}=this.isFdc3Definition(n);if(!e)throw new Error("The passed definition is not FDC3");const r=Vr.run(n);if(!r.ok)throw new Error(`Invalid FDC3 ${o} definition. Error: ${Dr(r.error)}`);if(o==="1.2"){const d=n;return{name:d.appId,type:"window",details:{url:this.getUrl(n,o)},version:d.version,title:d.title,tooltip:d.tooltip,caption:d.description,icon:(l=d.icons)==null?void 0:l[0].icon,intents:d.intents,customProperties:{manifestType:d.manifestType,images:d.images,contactEmail:d.contactEmail,supportEmail:d.supportEmail,publisher:d.publisher,icons:d.icons,customConfig:d.customConfig}}}const i=n,a={name:i.appId,type:this.fdc3ToDesktopDefinitionType[i.type],details:i.details,version:i.version,title:i.title,tooltip:i.tooltip,caption:i.description,icon:this.getIconFromDefinition(i,"2.0"),intents:this.getIntentsFromV2AppDefinition(i),fdc3:{...i,definitionVersion:"2.0"}},c=((u=n.hostManifests)==null?void 0:u.ioConnect)||((f=n.hostManifests)==null?void 0:f.Glue42);if(!c)return a;if(typeof c!="object"||Array.isArray(c))throw new Error(`Invalid '${n.hostManifests.ioConnect?"hostManifests.ioConnect":"hostManifests['Glue42']"}' key`);return this.mergeDesktopConfigWithGlueManifest(a,c)}getUserPropertiesFromDefinition(n,e){return Object.fromEntries(e==="1.2"?Object.entries(n).filter(([o])=>!Zc.includes(o)):Object.entries(n).filter(([o])=>!Zc.includes(o)&&!wg.includes(o)))}getUrl(n,e){var r,i;let o;if(e==="1.2"){const a=JSON.parse(n.manifest);o=((r=a.details)==null?void 0:r.url)||a.url}else o=(i=n.details)==null?void 0:i.url;if(!o||typeof o!="string")throw new Error(`Invalid FDC3 ${e} definition. Provide valid 'url' under '${e==="1.2"?"manifest":"details"}' key`);return o}getIntentsFromV2AppDefinition(n){var o,r;const e=(r=(o=n.interop)==null?void 0:o.intents)==null?void 0:r.listensFor;if(e)return Object.entries(e).map(i=>{const[a,c]=i;return{name:a,...c}})}getIconFromDefinition(n,e){var o,r,i,a;return e==="1.2"?((r=(o=n.icons)==null?void 0:o.find(c=>c.icon))==null?void 0:r.icon)||void 0:((a=(i=n.icons)==null?void 0:i.find(c=>c.src))==null?void 0:a.src)||void 0}mergeBaseAppDataWithGlueManifest(n,e){let o=n;if(e.customProperties&&(o.userProperties={...n.userProperties,...e.customProperties}),e.details){const r={...n.createOptions,...e.details};o.createOptions=r,o.userProperties.details=r}return Array.isArray(e.intents)&&(o.userProperties.intents=(o.userProperties.intents||[]).concat(e.intents)),o={...o,...e},delete o.details,delete o.intents,o}mergeDesktopConfigWithGlueManifest(n,e){const o=Object.assign({},n,e,{details:{...n.details,...e.details}});return Array.isArray(e.intents)&&(o.intents=(n.intents||[]).concat(e.intents)),o}}const Pg={common:{nonEmptyStringDecoder:be,nonNegativeNumberDecoder:Ua},fdc3:{allDefinitionsDecoder:Vr,v1DefinitionDecoder:cd,v2DefinitionDecoder:ld}};var Va;(function(t){t.USER_CANCELLED="User Closed Intents Resolver UI without choosing a handler",t.CALLER_NOT_DEFINED="Caller Id is not defined",t.TIMEOUT_HIT="Timeout hit",t.INTENT_NOT_FOUND="Cannot find Intent",t.HANDLER_NOT_FOUND="Cannot find Intent Handler",t.TARGET_INSTANCE_UNAVAILABLE="Cannot start Target Instance",t.INTENT_DELIVERY_FAILED="Target Instance did not add a listener",t.RESOLVER_UNAVAILABLE="Intents Resolver UI unavailable",t.RESOLVER_TIMEOUT="User did not choose a handler",t.INVALID_RESOLVER_RESPONSE="Intents Resolver UI returned invalid response",t.INTENT_HANDLER_REJECTION="Intent Handler function processing the raised intent threw an error or rejected the promise it returned"})(Va||(Va={}));const Cs=new class{constructor(){It(this,"_fdc3");It(this,"_decoders",Pg);It(this,"_errors",{intents:Va})}get fdc3(){return this._fdc3||(this._fdc3=new Ig().toApi()),this._fdc3}get decoders(){return this._decoders}get errors(){return this._errors}};Cs.fdc3;const Ag=Cs.decoders;Cs.errors;const Kn=Ag.common.nonEmptyStringDecoder,Tg=Ni(M("add"),M("align-bottom"),M("align-bottom-solid"),M("align-left"),M("align-left-bottom"),M("align-left-bottom-solid"),M("align-left-solid"),M("align-left-top"),M("align-left-top-solid"),M("align-right"),M("align-right-bottom"),M("align-right-bottom-solid"),M("align-right-solid"),M("align-right-top"),M("align-right-top-solid"),M("align-top"),M("align-top-solid"),M("always-on-top"),M("always-on-top-on"),M("application"),M("arrow-down-long"),M("arrow-down-to-bracket"),M("arrow-left-long"),M("arrow-right-from-bracket"),M("arrow-right-long"),M("arrow-right"),M("arrow-up"),M("arrow-up-long"),M("ban"),M("bell"),M("bell-solid"),M("bookmark"),M("bullseye-pointer"),M("certificate"),M("check"),M("check-light"),M("check-solid"),M("chevron-down"),M("chevron-left"),M("chevron-right"),M("chevron-up"),M("circle-info"),M("circle-xmark"),M("circle-xmark-full"),M("clock"),M("clock-rotate-left"),M("clone"),M("close"),M("cog"),M("cog-solid"),M("collapse"),M("copy"),M("download"),M("delete-left"),M("dev-tools"),M("ellipsis"),M("ellipsis-vertical"),M("expand"),M("envelope"),M("envelope-open"),M("exclamation-mark"),M("expand"),M("feedback"),M("filter"),M("floppy"),M("floppy-disk-pen"),M("folder"),M("folder-open"),M("globe"),M("group"),M("hidden"),M("home"),M("house"),M("info"),M("keyboard"),M("layout"),M("link"),M("list-ul"),M("lock"),M("logo"),M("minimize"),M("minimize-down"),M("paper-plane-top"),M("paperclip"),M("pause"),M("pen-line"),M("pen-to-square"),M("pin"),M("play"),M("pop-in"),M("pop-in-widget"),M("pop-out"),M("power-off"),M("publish"),M("refresh"),M("resize"),M("restore"),M("rotate-right"),M("search"),M("search-filled"),M("sleep"),M("sliders"),M("snooze"),M("spinner"),M("square"),M("square-arrow-down"),M("square-arrow-up"),M("star"),M("star-full"),M("sticky-off"),M("sticky-off-hover"),M("sticky-on"),M("sticky-on-hover"),M("subscribe"),M("system-close"),M("system-maximize"),M("system-minimize"),M("thumbs-down"),M("thumbs-up"),M("trash"),M("trash-can"),M("triangle-exclamation"),M("unlock"),M("unpin"),M("up-to-line"),M("user"),M("user-gear"),M("visible"),M("workspace")),Dg=td({id:Kn,title:Kn,description:Ue(Qu()),icon:Ue(Tg),iconSrc:Ue(Kn),contextMenuActions:Ue(Ba(ed())),type:Kn}),Mg=Ni(M("Left"),M("Right")),qc=Ni(M("daily"),M("weekly")),Jc=Ni(M("Sunday"),M("Monday"),M("Tuesday"),M("Wednesday"),M("Thursday"),M("Friday"),M("Saturday")),Gr=td({customPrefs:Ue(ed()),_launchpad_collapsedSections:Ue(Ba(Kn)),_launchpad_favorites:Ue(Ba(Dg)),_launchpad_isLayoutsPanelOpen:Ue(Pt()),_launchpad_isCollapsed:Ue(Pt()),_launchpad_isPinned:Ue(Pt()),_launchpad_pinnedPosition:Ue(Mg),_launchpad_allowDocking:Ue(Pt()),_launchpad_minimizeToTray:Ue(Pt()),_launchpad_autoCloseStartingAppsAndWorkspaces:Ue(Pt()),_launchpad_showTutorialOnStartup:Ue(Pt()),_layouts_restoreLastSaved:Ue(Pt()),_layouts_saveCurrentOnExit:Ue(Pt()),_layouts_showUnsavedChangesPrompt:Ue(Pt()),_layouts_showDeletePrompt:Ue(Pt()),_downloads_askForEachDownload:Ue(Pt()),_downloads_location:Ue(Qu()),_system_scheduleRestart:Ue(Pt()),_system_scheduleRestartTime:Ue(Kn),_system_scheduleRestartFrequency:Ue(qc),_system_scheduleRestartDay:Ue(Jc),_system_scheduleShutdown:Ue(Pt()),_system_scheduleShutdownTime:Ue(Kn),_system_scheduleShutdownFrequency:Ue(qc),_system_scheduleShutdownDay:Ue(Jc)}),ud=async t=>{const{io:n,variant:e,text:o,error:r}=t,i=Vn(r);try{if(e===xs&&n.logger.warn(i?`${o} ${i}`:o),!("modals"in n)||!n.modals)throw new Error("Modals are not enabled.");const a={text:o,variant:e,ttl:yg[e]};await n.modals.alerts.request(a)}catch(a){console.warn("Failed to request alert. ",{error:a})}},ks=g.createContext(void 0),Ii=({children:t,launchpadMode:n})=>{const[e,o]=g.useState(),[r,i]=g.useState(!1),[a,c]=g.useState(),l=g.useContext(Me.IOConnectContext),u=g.useMemo(()=>({prefs:e,isInitialSetupCompleted:r,initialSetupError:a}),[e,r,a]);return g.useEffect(()=>{if(!l)return;let f=!1;const d=l.contexts.subscribe(Un,p=>{if(f)return;const h=Gr.run(p);if(!h.ok)return void l.logger.warn(`The received data for context ${Un} is with an invalid shape: ${Vn(h.error.message)}`);const m=h.result;o(m),l.prefs.updateFor(Gc,m).catch(v=>{l.logger.warn(`Failed to update platform prefs. Error: ${Vn(v)}`)})});return()=>{f=!0,d.then(p=>{p()})}},[l]),g.useEffect(()=>{l&&(async()=>{var f;try{const d=await l.contexts.get(Un),p=Gr.run(d);if(!p.ok)throw new Error(`The data in context ${Un} is with an invalid shape: ${Vn(p.error.message)}`);const h=p.result;if(Object.keys(h).length>0)return;const m=((f=await l.prefs.get(Gc))==null?void 0:f.data)??{},v=Gr.run(m);if(!v.ok)throw new Error(`The stored platform prefs in io.prefs are with an invalid shape: ${Vn(v.error.message)}`);const y={[La]:n==="pinned"||(m[La]??!1)},k={...vg,...v.result,...y};await l.contexts.set(Un,k)}catch(d){c({message:Vn(d)}),await ud({io:l,variant:xs,text:"Initial platform prefs setup failed.",error:d})}finally{i(!0)}})().catch(console.error)},[l,n]),s.jsx(ks.Provider,{value:u,children:t})};function dd(){const t=g.useContext(ks);if(t===void 0)throw new Error("usePlatformPrefs must be used within a PlatformPrefsProvider");return t}function Wt({prefKey:t}){var d;const n=g.useContext(Me.IOConnectContext),e=g.useContext(ks),o=(d=e==null?void 0:e.prefs)==null?void 0:d[t],r=(e==null?void 0:e.isInitialSetupCompleted)??!1,[i,a]=g.useState(!r),[c,l]=g.useState(),u=g.useRef(0);g.useEffect(()=>{r&&u.current===0&&a(!1)},[r]);const f=g.useCallback(async p=>{if(!n)return;const h=++u.current;a(!0),l(void 0);const m=async y=>{y&&await ud({io:n,variant:xs,text:`Failed to update prefKey "${t}".`,error:y}),h===u.current&&(a(!1),y&&l({message:Vn(y)}))};let v;if(p instanceof Function)try{v=p((await n.contexts.get(Un))[t])}catch(y){return m(y)}else v=p;try{const y=Gr.runWithException({[t]:v});await n.contexts.update(Un,y)}catch(y){return m(y)}await m()},[n,t]);if(e===void 0)throw new Error("usePlatformPref must be used within a PlatformPrefsProvider");return{error:c,isLoading:i,update:f,value:o}}const _g="var(--io-neutrals-0)",oa="var(--io-neutrals-900)";function fd(t){var r;let n,e,o;if(t.startsWith("#")){let i=t.slice(1);i.length===3&&(i=i.split("").map(a=>a+a).join("")),n=parseInt(i.substring(0,2),16),e=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16)}else{if(!t.startsWith("rgb")){const i=document.createElement("canvas").getContext("2d");return i?(i.fillStyle=t,fd(i.fillStyle)):oa}{const i=(r=t.match(/\d+/g))==null?void 0:r.map(Number);if(!i||i.length<3)return oa;[n,e,o]=i}}return(.2126*n+.7152*e+.0722*o)/255>.5?oa:_g}function Lg({className:t,channel:n,...e}){const o=ee("io-channel-selector-badge",t),r=g.useMemo(()=>fd(n.color),[n.color]);return s.jsx("div",{className:o,style:{color:r,backgroundColor:n.color},"data-testid":`channel-selector-badge-${n.color}`,...e,children:s.jsx("span",{className:"io-channel-selector-badge-label","data-testid":"channel-selector-label",children:n.label})})}function Rg(){return s.jsx(ot,{variant:"check","data-testid":"channel-selector-channel-selected"})}function Fg({channel:t,handleChannelRestricted:n,lockedChannelRestriction:e}){const o=(r,i)=>a=>{a.stopPropagation(),_n(a)&&(a.preventDefault(),i||n({...t,[r]:!t[r]}))};return s.jsxs(s.Fragment,{children:[s.jsx("div",{children:t.isSelected&&s.jsx("span",{"data-testid":"channel-selector-channel-selected",children:"Active"})}),s.jsx("div",{role:"button",onClick:r=>r.stopPropagation(),"data-testid":"channel-selector-publish-toggle-container",children:s.jsx(ft,{label:"Publish",checked:t.write,onChange:()=>{n({...t,write:!t.write})},onKeyDown:o("write",!t.isSelected||(e==null?void 0:e.write)),onClick:r=>r.stopPropagation(),disabled:!t.isSelected||(e==null?void 0:e.write)})}),s.jsx("div",{role:"button",onClick:r=>r.stopPropagation(),"data-testid":"channel-selector-subscribe-toggle-container",children:s.jsx(ft,{label:"Subscribe",checked:t.read,onChange:()=>{n({...t,read:!t.read})},onKeyDown:o("read",!t.isSelected||(e==null?void 0:e.read)),disabled:!t.isSelected||(e==null?void 0:e.read)})})]})}const pd=g.createContext({});function Bg({channel:t,isSelected:n,onChannelSelect:e,onChannelRestrict:o,...r}){const{variant:i,selectedChannels:a,lockedChannelRestrictions:c}=g.useContext(pd),l=n||t.isSelected||(a==null?void 0:a.includes(t)),u=c==null?void 0:c.find(h=>h.name===t.name),f=g.useCallback(()=>e==null?void 0:e({...t,isSelected:!l}),[t,e,l]),d=g.useCallback(h=>{const m=h.target;m.closest(".io-toggle")||m.classList.contains("io-toggle")||_n(h)&&(h.preventDefault(),e==null||e({...t,isSelected:!l}))},[t,e,l]),p=g.useCallback(h=>{o==null||o(h)},[o]);return s.jsx(gi,{prepend:s.jsx(Lg,{channel:t}),append:i==="single"||i==="multi"?l&&s.jsx(Rg,{}):s.jsx(Fg,{channel:t,handleChannelRestricted:p,lockedChannelRestriction:u}),isSelected:l,onClick:f,onKeyDown:d,...r,children:t.name},t.name)}function Hg({variant:t,onVariantChange:n,disabled:e=!1}){const o=t==="directionalSingle"||t==="directionalMulti",r=g.useCallback(()=>{n==null||n(!o)},[o,n]),i=g.useCallback(c=>{c.stopPropagation()},[]),a=g.useCallback(c=>{c.stopPropagation(),_n(c)&&(c.preventDefault(),e||r())},[e,r]);return s.jsx(ft,{label:"Directional",align:"right",checked:o,onChange:r,onClick:i,onKeyDown:a,disabled:e,"data-testid":`channel-selector-toggle-${t}`})}const Wg=g.forwardRef(({className:t,variant:n="single",variantToggle:e=!1,channels:o=[],lockedChannelRestrictions:r=[],onVariantChange:i,onChannelSelect:a,onChannelRestrict:c,...l},u)=>{const f=ee("io-channel-selector-panel",(n==="directionalSingle"||n==="directionalMulti")&&"io-channel-selector-panel-directional",t),d=g.useMemo(()=>({variant:n,selectedChannels:o.filter(p=>p.isSelected),lockedChannelRestrictions:r,onVariantChange:i,onChannelSelect:a,onChannelRestrict:c}),[o,n,r,i,a,c]);return s.jsx(pd.Provider,{value:d,children:s.jsx("div",{className:f,ref:u,children:s.jsxs(ut,{...l,children:[s.jsx(ut.ItemTitle,{"data-testid":"channel-selector-title",append:e&&s.jsx(Hg,{variant:n,onVariantChange:i}),children:{single:"Select Channel",directionalSingle:"Select Directional Channel",multi:"Select Channels",directionalMulti:"Select Directional Channels"}[n]}),o==null?void 0:o.map(p=>s.jsx(Bg,{channel:p,isSelected:p.isSelected,onChannelSelect:a,onChannelRestrict:c,"data-testid":`channel-selector-channel-${p.name}`},p.name))]})})})});Wg.displayName="ChannelSelector";const $g=g.forwardRef(({className:t,title:n,ariaLabel:e,onClick:o,onKeyDown:r,children:i,disabled:a=!1,...c},l)=>s.jsx("div",{ref:l,className:ee(t,{disabled:a}),title:n,role:"button",tabIndex:a?-1:0,"aria-label":e,"aria-disabled":a,onClick:u=>{!a&&o&&o(u)},onKeyDown:u=>{!a&&r&&r(u)},...c,children:i}));$g.displayName="ChannelSelectorButtonWrapper";g.createContext({config:{message:""},theme:"dark",setResult:()=>{}});function hd({title:t="Downloads"}){const{ItemSearch:n,HeaderButtons:e}=br();return s.jsxs("div",{className:"io-dm-header",children:[s.jsxs(Bt,{draggable:!0,children:[s.jsx(Bt.Title,{tag:"h1",text:t,size:"large"}),s.jsx(e,{className:"non-draggable"})]}),s.jsx(n,{})]})}const Lt=window.glue42gd,md=g.createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),vn=()=>g.useContext(md);function gd({className:t,placeholder:n="Search",iconPrepend:e="search",iconAppend:o="close",...r}){const i=ee("io-header-search",t),a=g.useRef(null),{searchQuery:c,setSearch:l,itemsCount:u}=vn(),f=c.length>0,d=g.useCallback(()=>{l(""),a.current&&a.current.focus()},[l]);return s.jsxs("div",{className:i,children:[s.jsx(no,{ref:a,value:c,iconPrepend:e,iconAppend:f?o:void 0,iconAppendOnClick:f?d:void 0,placeholder:n,onChange:p=>l(p.target.value),...r}),f&&s.jsx("p",{className:"io-header-search-count",children:`${u} results`})]})}function vd({className:t,...n}){const{MoreButton:e,CloseButton:o}=br();return s.jsxs(Re,{className:t,align:"right",...n,children:[s.jsx(e,{}),s.jsx(o,{})]})}function yd({icon:t="ellipsis-vertical",...n}){const{items:e,clearItems:o,showSettings:r}=vn(),i=e.length===0;return s.jsxs(fe,{variant:"light",...n,children:[s.jsx(fe.ButtonIcon,{icon:t,variant:"circle",size:"32"}),s.jsx(fe.Content,{children:s.jsxs(fe.List,{children:[s.jsx(fe.Item,{onClick:a=>(c=>{i?c.stopPropagation():o()})(a),disabled:i,children:"Clear All"}),s.jsx(fe.Item,{onClick:r,children:"Settings"})]})})]})}const zg={minimizeWindow:async function(t){var n;if(t)try{const e=(n=t.windows)==null?void 0:n.my();await(e==null?void 0:e.minimize())}catch(e){console.error("Failed to minimize window",e)}},closeWindow:async function(t,n){var e;if(t)try{const o=(e=t.windows)==null?void 0:e.my();await(o==null?void 0:o.close(n))}catch(o){console.error("Failed to close window",o)}},restartPlatform:async function(t,n=!0){if(t)try{await t.appManager.restart({autoSave:n,showDialog:!0})}catch(e){console.error("Failed to restart io.Connect Desktop",e)}},shutdownPlatform:async function(t,n=!0){if(t)try{await t.appManager.exit({autoSave:n,showDialog:!0})}catch(e){console.error("Failed to shutdown io.Connect Desktop",e)}}};function wd({icon:t="close",size:n="32",variant:e="circle",onClick:o,...r}){const i=g.useContext(Me.IOConnectContext);return s.jsx(Ve,{icon:t,size:n,variant:e,onClick:a=>{o?o(a):zg.closeWindow(i).catch(c=>{console.error("Failed to close window:",c)})},...r})}function lo(t,n=!1,e=!1,o=!1){const r=t.getDate(),i=["January","February","March","April","May","June","July","August","September","October","November","December"][t.getMonth()],a=t.getFullYear(),c=t.getHours(),l=t.getMinutes();let u="";return u=l<10?`0${l}`:`${l}`,n?n==="Today"?e?"Today":`Today at ${c}:${u}`:n==="Yesterday"?e?"Yesterday":`Yesterday at ${c}:${u}`:`${c}:${u}`:o?e?`${i} ${r}`:`${i} ${r} at ${c}:${u}`:e?`${i} ${r}, ${a}`:`${i} ${r}, ${a} at ${c}:${u}`}function bd(t,n={showTime:!0}){const e=new Date(1e3*t),o=new Date,r=Math.round((o-e)/1e3),i=Math.round(r/60),a=o.toDateString()===e.toDateString(),c=new Date(o.setDate(o.getDate()-1)).toDateString()===e.toDateString(),l=o.getFullYear()===e.getFullYear();return n.showTime?r<5?"Just Now":r<60?`${r} seconds ago`:r<90?"about a minute ago":i<60?`${i} minutes ago`:a?lo(e,"Today",!1,!0):c?lo(e,"Yesterday",!1,!0):l?lo(e,!1,!1,!0):lo(e):a?"Today":c?"Yesterday":l?lo(e,!1,!0,!0):lo(e,!1,!0)}function xd({className:t,...n}){const e=ee("io-dm-body",t),{DownloadListEmpty:o,ItemGroup:r,Item:i}=br(),{items:a,searchQuery:c,setCount:l,sortItems:u}=vn(),f=u(a),d=$u(c),p=g.useMemo(()=>f.filter(v=>v.displayInfo.filename.toLowerCase().includes(d.toLowerCase())||v.displayInfo.url.toLowerCase().includes(d.toLowerCase())),[f,d]),h=g.useMemo(()=>p.map(v=>({...v,displayInfo:{...v.displayInfo,startTime:bd(v.displayInfo.startTime,{showTime:!1})}})),[p]),m=g.useMemo(()=>Object.values(h.reduce((v={},y)=>{var k;return v[y.displayInfo.startTime]=((k=v[y.displayInfo.startTime])==null?void 0:k.concat([]))??[],v[y.displayInfo.startTime].push(y),v},{})),[h]);return g.useEffect(()=>{l(p.length)},[p,l]),s.jsx("div",{className:e,...n,children:m&&m.length!==0?m.map(v=>s.jsx(r,{title:String(v[0].displayInfo.startTime)??null,children:v.map(y=>s.jsx(i,{item:y},y.id))},v[0].id??"")):s.jsx(o,{})})}function Cd({className:t,icon:n="download",text:e="No downloads to display.",...o}){const r=ee("io-dm-no-items",t);return s.jsxs("div",{className:r,...o,children:[s.jsx(ot,{variant:n}),s.jsx("p",{children:e})]})}function kd({className:t,title:n,children:e,...o}){const r=ee("io-dm-item-group",t);return s.jsxs("div",{className:r,...o,children:[n&&s.jsx("p",{children:n}),e]})}function Sd({className:t,item:n,...e}){const{ItemHeader:o,ItemBody:r,ItemFooter:i}=br(),{state:a,url:c,filename:l,receivedBytes:u,totalBytes:f,speed:d,timeRemaining:p}=n.displayInfo;if(!n)return s.jsx(s.Fragment,{});const h=ee("io-dm-item",n.displayInfo.state&&[a],t);return s.jsxs("div",{className:h,...e,children:[s.jsx(o,{itemID:n.id,filename:l,state:a}),s.jsx(r,{state:a,url:c,bytesReceived:u,bytesTotal:f,speed:d,timeRemaining:p}),s.jsx(i,{itemID:n.id,state:a})]})}function Ss({bytesReceived:t=0,bytesTotal:n=0,...e}){const o=g.useCallback(()=>t&&n?Math.round(t/n*100):0,[t,n]);return s.jsx(tg,{value:o(),...e})}function Ed({className:t,itemID:n,filename:e,state:o,cancel:r,remove:i,...a}){const c=ee("io-dm-item-header",t),{cancelItem:l,removeItem:u}=vn(),f=g.useCallback(p=>{r?r(p):l(p)},[r,l]),d=g.useCallback(p=>{i?i(p):u(p)},[i,u]);return s.jsxs("div",{className:c,...a,children:[s.jsx(sn,{text:e,style:{textDecoration:o==="interrupted"||o==="cancelled"?"line-through":"none"}}),s.jsx(Ve,{icon:"close",iconSize:"12",onClick:()=>{o==="progressing"||o==="paused"?f(n):d(n)}})]})}function jd({className:t,state:n,url:e,bytesReceived:o=0,bytesTotal:r=0,speed:i=0,timeRemaining:a=0,...c}){const l=ee("io-dm-item-body",t),u=p=>{const h=["Bytes","KB","MB","GB","TB"];if(p===0)return"0";const m=Math.floor(Math.log(p)/Math.log(1024));return m===0?`${p}${h[m]}`:`${(p/1024**m).toFixed(1)}${h[m]}`};return s.jsxs("div",{className:l,...c,children:[s.jsx("p",{className:"io-text-small",children:e}),(d=n,d==="cancelled"||d==="interrupted"||d==="completed"?null:s.jsx(Ss,{variant:d==="paused"?"paused":"active",bytesReceived:o,bytesTotal:r})),s.jsx("p",{className:"io-text-default-lh16",children:n==="completed"?`${u(o??0)} - Done`:n==="cancelled"||n==="interrupted"?`${u(o??0)}/${u(r??0)} - Failed`:`${u(o??0)}/${u(r??0)} (${f=i,(f?`${(f/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(p=>{const h=Math.floor(p/3600),m=Math.floor(p%3600/60);let v="";return h>0&&(v+=`${h} hour${h>1?"s":""}, `),m>0&&(v+=`${m} min${m>1?"s":""}, `),((p=Math.floor(p%60))>0||v==="")&&(v+=`${p} sec${p!==1?"s":""}`),`${v.trim()} left`})(a)??0}`})]});var f,d}const Ug={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function ra({className:t,variant:n,text:e}){const o=ee("io-dm-item-status",`io-dm-item-status-${n}`,t);return s.jsxs("div",{className:o,children:[n&&s.jsx(ot,{variant:Ug[n],className:"icon-severity",size:"10"}),e&&s.jsx("p",{className:"io-text-smaller",children:e})]})}function Od({className:t,itemID:n,state:e,pauseResume:o,showInFolder:r,cancel:i,...a}){const c=ee("io-dm-item-footer",t),{pauseResumeItem:l,showItemInFolder:u,cancelItem:f}=vn(),d=g.useCallback(m=>{o?o(m):l(m)},[o,l]),p=g.useCallback(m=>{r?r(m):u(m)},[r,u]),h=g.useCallback(m=>{i?i(m):f(m)},[i,f]);return s.jsx("div",{className:c,...a,children:(()=>{switch(e){case"progressing":return s.jsxs(Re,{align:"right",children:[s.jsx(Re.Button,{variant:"primary",text:"Pause",onClick:()=>d(n)}),s.jsx(Re.Button,{variant:"link",text:"Cancel",onClick:()=>h(n)})]});case"paused":return s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Resume",onClick:()=>d(n)})});case"completed":return s.jsxs(s.Fragment,{children:[s.jsx(ra,{variant:"success",text:"Complete"}),s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Show in Folder",onClick:()=>p(n)})})]});case"cancelled":return s.jsx(ra,{variant:"warning",text:"Cancelled"});case"interrupted":return s.jsxs(s.Fragment,{children:[s.jsx(ra,{variant:"critical",text:"Failed"}),s.jsx(Re,{align:"right",children:s.jsx(Re.Button,{variant:"primary",text:"Retry",onClick:()=>d(n)})})]});default:return null}})()})}function Nd({className:t,title:n="Download Settings",...e}){const o=ee("io-dm-settings-panel",t),{configuration:{downloadFolder:r},hideSettings:i,setDownloadLocation:a,setDownloadLocationWithDialog:c,isDownloadLocationDialogVisible:l,downloadLocationList:u}=vn();return s.jsxs(Ge,{className:o,...e,children:[s.jsxs(Ge.Header,{children:[s.jsx(Ge.Header.Title,{size:"large",text:n,tag:"h1"}),s.jsx(Ge.Header.ButtonGroup,{children:s.jsx(Ve,{variant:"circle",icon:"close",size:"32",onClick:()=>{i()},disabled:l})})]}),s.jsx(Ge.Body,{children:s.jsxs(Re,{children:[s.jsxs(fe,{variant:"light",disabled:l,children:[s.jsx(fe.Button,{children:s.jsx("span",{className:"io-dm-settings-panel-download-location",children:r??u[0]})}),u.length>1&&s.jsx(fe.Content,{children:s.jsx(fe.List,{children:u.map((f,d)=>!f||d===0||d>3?null:s.jsx(fe.Item,{onClick:()=>{a(f)},children:f},f))})})]}),s.jsx(Ye,{className:"io-btn io-dm-settings-panel-download-location-btn",text:"Browse",onClick:()=>{c()},disabled:l})]})})]})}const Id={Header:hd,ItemSearch:gd,HeaderButtons:vd,MoreButton:yd,CloseButton:wd,Body:xd,DownloadListEmpty:Cd,ItemGroup:kd,Item:Sd,ItemProgress:Ss,ItemHeader:Ed,ItemBody:jd,ItemFooter:Od,Settings:Nd},Pd=g.createContext(Id),Ad=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Id,...n}),[n]);return s.jsx(Pd.Provider,{value:e,children:t})});Ad.displayName="ComponentsStore";const br=()=>g.useContext(Pd);function Vg({className:t,...n}){const e=ee("io-dm",t),{Header:o,Body:r,Settings:i}=br(),{isSettingsVisible:a}=vn();return s.jsxs(Ge,{className:e,...n,children:[s.jsx(o,{}),s.jsx(r,{}),a&&s.jsx(i,{})]})}var Gg=Object.freeze({__proto__:null,Body:xd,CloseButton:wd,DownloadListEmpty:Cd,DownloadManager:function({components:t,...n}){return s.jsx(Ad,{components:t,children:s.jsx(Vg,{...n})})},DownloadManagerProvider:({children:t})=>{const{configuration:n,items:e,removeItem:o,pauseResumeItem:r,cancelItem:i,clearItems:a,showItemInFolder:c,isSettingsVisible:l,showSettings:u,hideSettings:f,searchQuery:d,setSearch:p,itemsCount:h,setCount:m,setDownloadLocation:v,setDownloadLocationWithDialog:y,sortItems:k,isDownloadLocationDialogVisible:S,downloadLocationList:b}=function(){const[E,O]=g.useState({}),[F,R]=g.useState([]),[U,K]=g.useState(0),[_,A]=g.useState([]),[me,de]=g.useState(""),[re,ye]=g.useState(!1),[pe,xe]=g.useState(!1),[ae,B]=g.useState({filePaths:[],canceled:!1});g.useEffect(()=>{if(!Lt)return;const Y=Lt.downloads.onUpdate(H=>R(P=>X(P,H))),J=Lt.downloads.onConfigurationChanged(H=>{O(H)});return Lt.downloads.list().then(R).catch(console.error),Lt.downloads.getSavePathList().then(H=>{H.pathList&&A(H.pathList)}).catch(console.error),()=>{Y(),J()}},[]),g.useEffect(()=>{xe(!1)},[ae]);const X=(Y,J)=>{const H=Y.findIndex(T=>T.id===J.id);if(H===-1)return[J,...Y];const P=[...Y];return P[H]=J,P};return{items:F,setCount:Y=>{K(Y)},sortItems:(Y,J=!0)=>Y.sort((H,P)=>J?H.displayInfo.startTime<P.displayInfo.startTime?1:-1:H.displayInfo.startTime>P.displayInfo.startTime?1:-1),setSearch:Y=>{de(Y)},cancelItem:async Y=>{try{await Lt.downloads.cancel(Y)}catch(J){console.error(J)}},removeItem:async Y=>{try{R(J=>J.filter(H=>H.id!==Y)),await Lt.downloads.removeItem(Y)}catch(J){console.error(J)}},clearItems:async()=>{try{R([]),await Lt.downloads.clearDownloadList()}catch(Y){console.error(Y)}},itemsCount:U,searchQuery:me,showSettings:()=>{ye(!0)},hideSettings:()=>{ye(!1)},configuration:E,isSettingsVisible:re,pauseResumeItem:async Y=>{try{await Lt.downloads.pauseResume(Y)}catch(J){console.error(J)}},showItemInFolder:async Y=>{try{await Lt.downloads.showInFolder(Y)}catch(J){console.error(J)}},setDownloadLocation:async Y=>{try{await Lt.downloads.setSavePath(Y),A(J=>{if(J.includes(Y)){const H=J.filter(P=>P!==Y);return[Y,...H]}return[Y,...J]})}catch(J){console.error(J)}},downloadLocationList:_,isDownloadLocationDialogVisible:pe,setDownloadLocationWithDialog:async()=>{xe(!0);try{const Y=await Lt.downloads.showOpenDialog();if(B(Y),!(Y!=null&&Y.filePaths)||Y.filePaths.length===0)return;await Lt.downloads.setSavePath(Y.filePaths[0]),A(J=>{if(J.includes(Y.filePaths[0])){const H=J.filter(P=>P!==Y.filePaths[0]);return[Y.filePaths[0],...H]}return[Y.filePaths[0],...J]})}catch(Y){console.error(Y)}}}}(),w=g.useMemo(()=>({configuration:n,items:e,removeItem:o,pauseResumeItem:r,cancelItem:i,clearItems:a,showItemInFolder:c,isSettingsVisible:l,showSettings:u,hideSettings:f,searchQuery:d,setSearch:p,itemsCount:h,setCount:m,setDownloadLocation:v,setDownloadLocationWithDialog:y,sortItems:k,isDownloadLocationDialogVisible:S,downloadLocationList:b}),[n,e,o,r,i,c,a,l,u,f,d,p,h,m,v,y,k,S,b]);return s.jsx(md.Provider,{value:w,children:t})},Header:hd,HeaderButtons:vd,Item:Sd,ItemBody:jd,ItemFooter:Od,ItemGroup:kd,ItemHeader:Ed,ItemProgress:Ss,ItemSearch:gd,MoreButton:yd,Settings:Nd,useDownloadManagerContext:vn});function Ga(t){if(t&&t.errorHandling&&typeof t.errorHandling!="function"&&t.errorHandling!=="log"&&t.errorHandling!=="silent"&&t.errorHandling!=="throw")throw new Error('Invalid options passed to createRegistry. Prop errorHandling should be ["log" | "silent" | "throw" | (err) => void], but '+typeof t.errorHandling+" was passed");var n=t&&typeof t.errorHandling=="function"&&t.errorHandling,e={};function o(r,i){var a=r instanceof Error?r:new Error(r);if(n)n(a);else{var c='[ERROR] callback-registry: User callback for key "'+i+'" failed: '+a.stack;if(t)switch(t.errorHandling){case"log":return console.error(c);case"silent":return;case"throw":throw new Error(c)}console.error(c)}}return{add:function(r,i,a){var c=e[r];return c||(c=[],e[r]=c),c.push(i),a&&setTimeout(function(){a.forEach(function(l){var u;if(!((u=e[r])===null||u===void 0)&&u.includes(i))try{Array.isArray(l)?i.apply(void 0,l):i.apply(void 0,[l])}catch(f){o(f,r)}})},0),function(){var l=e[r];l&&(l=l.reduce(function(u,f,d){return f===i&&u.length===d||u.push(f),u},[]),l.length===0?delete e[r]:e[r]=l)}},execute:function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var c=e[r];if(!c||c.length===0)return[];var l=[];return c.forEach(function(u){try{var f=u.apply(void 0,i);l.push(f)}catch(d){l.push(void 0),o(d,r)}}),l},clear:function(){e={}},clearKey:function(r){e[r]&&delete e[r]}}}Ga.default=Ga;var Yg=ql(Ga);const Zg=g.createContext({config:{env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"},onThemeChanged:t=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:t=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),Qt=()=>g.useContext(Zg);function Kg({...t}){const{config:n,close:e}=Qt(),{applicationTitle:o}=n;return s.jsxs(Bt,{draggable:!0,...t,children:[s.jsx(Bt.Title,{tag:"h1",text:o?`Feedback Form - ${o}`:"Feedback Form",size:"large"}),s.jsx(Bt.ButtonGroup,{className:"non-draggable",children:s.jsx(Bt.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>e()})})]})}function qg({className:t,handleSubmit:n,...e}){const o=ee("io-panel-body",t),{config:r,submitFeedback:i}=Qt(),{IntroField:a,DescriptionField:c,TechInfoField:l,EnvInfoField:u,FileAttachmentsField:f,CategoryAttachmentsField:d,SettingsField:p,MailListField:h}=Pi(),m=n??i,v=`Your feedback will be submitted to the ${r.buildVersion} team and some additional information will be automatically included to help us examine your issue.`;return s.jsxs("form",{className:o,id:"feedback",onSubmit:y=>m(y),...e,children:[s.jsx(a,{children:s.jsx("p",{children:v})}),s.jsx(p,{}),s.jsx(h,{}),s.jsx(c,{}),s.jsx(l,{readOnly:!0}),s.jsx(u,{readOnly:!0}),r.attachmentsViewMode==="file"?s.jsx(f,{}):s.jsx(d,{})]})}function Jg({...t}){const{FooterButtons:n}=Pi(),{openUrl:e,submitInProgress:o,submitStatus:r,jiraTicketURL:i}=Qt();return s.jsx(Zn,{...t,children:s.jsxs("div",o?{className:"flex ai-center jc-between",children:[s.jsx(Ke,{children:s.jsx("p",{children:r.title})}),s.jsx(eg,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[s.jsxs(Ke,{children:[s.jsx("p",{className:r.type==="error"?"io-text-error":"",children:r.title}),i&&s.jsx("a",{href:i,onClick:a=>{a.preventDefault(),e(i)},children:i})]}),s.jsx(n,{})]})})}function Xg({className:t,...n}){const{CloseButton:e}=Pi(),{close:o}=Qt();return s.jsx(Re,{className:t,...n,children:s.jsx(e,{onClick:()=>o()})})}function Qg({className:t,...n}){const{SubmitButton:e,CancelButton:o,CloseButton:r}=Pi(),{close:i,submitCompleted:a}=Qt();return a?s.jsx(Re,{className:t,...n,children:s.jsx(r,{text:"Close",onClick:()=>i()})}):s.jsxs(Re,{className:t,...n,children:[s.jsx(e,{}),s.jsx(o,{onClick:()=>i()})]})}function e0({text:t="Submit",...n}){return s.jsx(Ye,{form:"feedback",type:"submit",variant:"primary",text:t,...n})}function t0({text:t="Cancel",...n}){return s.jsx(Ye,{variant:"link",text:t,...n})}function n0({...t}){return s.jsx(Ye,{variant:"primary",...t})}function o0({showField:t=!0,className:n,title:e,hint:o,children:r,...i}){return t?s.jsx(Ke,{className:n,title:e,hint:o,...i,children:r}):null}function r0({showField:t=!0,className:n,title:e="Description",hint:o,readOnly:r=!1,disabled:i,...a}){return t?s.jsx(Ke,{className:n,hint:o,title:"",...a,children:s.jsx(Ei,{id:"description",name:"description",label:e,readOnly:r,disabled:i})}):null}function i0({showField:t,className:n,title:e="Technical Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...c}){const{config:l}=Qt(),u=t??l.errorMessage,f=r??l.errorMessage;return u&&f?s.jsx(Ke,{className:n,hint:o,...c,children:s.jsx(Ei,{id:"errorMessage",name:"errorMessage",label:e,value:f,readOnly:i,disabled:a})}):null}function a0({showField:t,className:n,title:e="Environment Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...c}){const{config:l}=Qt(),u=t??l.showEnvironmentInfo,f=r??l.environmentInfo;return u&&f?s.jsx(Ke,{className:n,hint:o,...c,children:s.jsx(Ei,{id:"environmentInfo",name:"environmentInfo",label:e,value:f,readOnly:i,disabled:a})}):null}function s0({showField:t=!0,className:n,title:e="Attachments",hint:o,readOnly:r=!1,disabled:i,attachments:a,selectedCategories:c,...l}){const u=ee("io-block-list-gap",n),{config:f}=Qt(),d=a??f.attachments,p=c??f.selectedCategories,h=g.useCallback(m=>!!p&&p.indexOf(m)!==-1,[p]);return t?!d||d.length<=0?s.jsx(Ke,{title:"Attachments",children:s.jsx("p",{children:"No Attachments"})}):s.jsx(Ke,{className:u,title:e,hint:o,...l,children:s.jsx("div",{className:"file-attachments",children:d.map(m=>s.jsx(ji,{id:m.id,name:m.id,label:m.name,readOnly:r,disabled:i,defaultChecked:h(m.category)},m.id))})}):null}function c0({showField:t=!0,className:n,title:e="Attachments",hint:o,readOnly:r=!1,disabled:i,categories:a,selectedCategories:c,...l}){const{config:u,attachmentCategories:f}=Qt(),d=a??f,p=c??u.selectedCategories,h=g.useCallback(m=>!!p&&p.indexOf(m)!==-1,[p]);return t?!d||d.length<=0?s.jsx("p",{children:"No Attachments"}):s.jsx(Ke,{className:n,title:e,hint:o,...l,children:s.jsx("div",{className:"category-attachments",children:d.map(m=>s.jsx(ft,{id:m,name:m,align:"right",label:m,readOnly:r,disabled:i,defaultChecked:h(m)},m))})}):null}function l0({className:t,title:n,hint:e,showField:o=!0,showJiraTicketField:r,jiraTicketLabel:i="Create Jira Ticket",showSendEmailField:a,sendEmailLabel:c="Send Email",readOnly:l=!1,disabled:u,...f}){const d=ee("io-block-list-gap",t),{config:p,showMailingList:h,setShowMailingList:m}=Qt();if(!o)return null;const v=r??p.createJiraTicket,y=a??p.sendEmail;return s.jsxs(Ke,{className:d,hint:e,title:n,...f,children:[v&&s.jsx(ft,{id:"createJiraTicket",name:"createJiraTicket",label:i,align:"right",readOnly:l,disabled:u,defaultChecked:v}),y&&s.jsx(ft,{onChange:()=>{m(!h)},id:"sendEmail",name:"sendEmail",label:c,align:"right",readOnly:l,disabled:u,defaultChecked:y})]})}function u0({showField:t=!0,className:n,title:e="Email List",hint:o="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:i,disabled:a,...c}){const{config:l,showMailingList:u}=Qt(),f=t??l.sendEmail,d=i??l.allowEditRecipients===!1;return f&&u?s.jsx(Ke,{className:n,hint:o,...c,children:s.jsx(no,{id:"mailingList",name:"mailingList",label:e,placeholder:r,readOnly:d,disabled:a,defaultValue:l.mailingList??""})}):null}const Td={Header:Kg,Body:qg,Footer:Jg,HeaderButtons:Xg,FooterButtons:Qg,SubmitButton:e0,CancelButton:t0,CloseButton:n0,IntroField:o0,DescriptionField:r0,TechInfoField:i0,EnvInfoField:a0,FileAttachmentsField:s0,CategoryAttachmentsField:c0,SettingsField:l0,MailListField:u0},Dd=g.createContext(Td),d0=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Td,...n}),[n]);return s.jsx(Dd.Provider,{value:e,children:t})});function Pi(t){return{...g.useContext(Dd),...t}}d0.displayName="ComponentsStore";function Md({className:t,title:n="General",...e}){const o=ee("io-notifications-settings-panel-general",t),{AllowNotifications:r,AllowNotificationToasts:i,ShowNotificationBadge:a,CloseNotificationOnClick:c,PanelAutoHide:l,HideToastsAfter:u}=ao(),f=We();return s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n,children:[f&&s.jsx(r,{}),f&&s.jsx(i,{}),s.jsx(a,{}),f&&s.jsx(l,{}),f&&s.jsx(c,{}),f&&s.jsx(u,{})]})})}var tt=new class{constructor(){It(this,"subscribed",!1);It(this,"io");It(this,"registry",Yg());It(this,"logger");It(this,"isPanelVisible");It(this,"notifications",[]);It(this,"bulkActionsSupported",!1)}init(t){var r,i,a,c;if(this.subscribed)return;this.subscribed=!0,this.io=t,this.logger=this.io.logger.subLogger("notifications");const n=this.io.appManager.myApplication,e=((i=(r=n==null?void 0:n.userProperties)==null?void 0:r.logger)==null?void 0:i.publishLevel)??"error",o=((c=(a=n==null?void 0:n.userProperties)==null?void 0:a.logger)==null?void 0:c.consoleLevel)??"info";this.logger.publishLevel(e),this.logger.consoleLevel(o),this.logger.info("===== IO Notifications v.0.8.1 ====="),this.getBulkActionsSupport(),this.subscribe()}onPanelVisibilityChanged(t){return this.registry.add("on-panel-visibility-changed",t)}onConfigurationChanged(t){return this.registry.add("on-configuration-changed",t)}onNotificationsChanged(t){return this.registry.add("on-notifications-changed",t)}onCounterChanged(t){return this.registry.add("on-counter-changed",t)}async getNotificationsList(){var n;const t=await((n=this.io)==null?void 0:n.notifications.list());if(!t)throw new Error("io.notifications.list is not supported in this environment.");return t.map(e=>this.attachHandlers(e))}async getConfiguration(){if(this.io)return await this.io.notifications.getConfiguration();throw new Error("io.notifications.getConfiguration is not supported in this environment.")}showPanel(){var t;if(this.isDesktopEnvironment())return(t=this.io)==null?void 0:t.notifications.panel.show()}hidePanel(){var t;if(this.isDesktopEnvironment())return(t=this.io)==null?void 0:t.notifications.panel.hide()}clearAll(){var t,n;return(t=this.logger)==null||t.trace("clearing all notifications"),(n=this.io)==null?void 0:n.notifications.clearAll()}clearAllOld(){var t,n;return(t=this.logger)==null||t.trace("clearing all old notifications"),(n=this.io)==null?void 0:n.notifications.clearOld()}clearMany(t){var n,e,o,r;return typeof((n=this.io)==null?void 0:n.notifications).clearMany=="function"?t.length<1?((e=this.logger)==null||e.trace("no ids provided to clear notifications"),Promise.resolve()):((o=this.logger)==null||o.trace(`clearing notifications with ids ${JSON.stringify(t.join(", "))}`),((r=this.io)==null?void 0:r.notifications).clearMany(t)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}close(t){var n,e;return(n=this.logger)==null||n.trace(`closing notification with id ${t}`),(e=this.io)==null?void 0:e.notifications.clear(t)}snooze(t,n){var e,o;return(e=this.logger)==null||e.trace(`snoozing notification with id ${t} for ${n}ms`),(o=this.io)==null?void 0:o.notifications.snooze(t,n)}snoozeMany(t,n){var e,o,r,i;return typeof((e=this.io)==null?void 0:e.notifications).snoozeMany=="function"?t.length<1?((o=this.logger)==null||o.trace("no ids provided to snooze notifications"),Promise.resolve()):((r=this.logger)==null||r.trace(`snoozing notifications with ids ${JSON.stringify(t.join(", "))} for ${n}ms`),((i=this.io)==null?void 0:i.notifications).snoozeMany(t,n)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}setState(t,n){var e,o;return(e=this.logger)==null||e.trace(`setting state of ${t} to ${n}`),(o=this.io)==null?void 0:o.notifications.setState(t,n)}setStates(t,n){var e,o,r,i;return typeof((e=this.io)==null?void 0:e.notifications).setStates=="function"?t.length<1?((o=this.logger)==null||o.trace(`no ids provided to change state to ${n} for notifications`),Promise.resolve()):((r=this.logger)==null||r.trace(`setting state of ${JSON.stringify(t.join(", "))} to ${n}`),((i=this.io)==null?void 0:i.notifications).setStates(t,n)):Promise.reject(new Error("Bulk actions are not supported in this environment"))}getBulkActionsSupport(){var n,e,o;const t=typeof((n=this.io)==null?void 0:n.notifications).clearMany=="function"&&typeof((e=this.io)==null?void 0:e.notifications).setStates=="function"&&typeof((o=this.io)==null?void 0:o.notifications).snoozeMany=="function";this.bulkActionsSupported=t}setFilter(t){var n,e;return(n=this.logger)==null||n.trace(`setting filter to ${JSON.stringify(t)}`),(e=this.io)==null?void 0:e.notifications.setFilter(t)}configure(t){var n;return(n=this.io)==null?void 0:n.notifications.configure(t)}subscribe(){var t,n,e,o,r,i,a;(t=this.io)==null||t.notifications.onRaised(c=>{var l;(l=this.logger)==null||l.trace(`received event indicating notification raise: ${JSON.stringify(c)}`),this.attachHandlers(c),this.notifications.unshift(c),this.registry.execute("on-notifications-changed",[...this.notifications])}),(n=this.io)==null||n.notifications.onStateChanged(({id:c},l)=>{var u;(u=this.logger)==null||u.trace(`received event for notification state is changed - "${c}" - "${l==null?void 0:l.toString()}"`),this.notifications=this.notifications.map(f=>{var d;return f.id===c?((d=this.logger)==null||d.trace(`${f.id} - the state is changed from "${f.state}" to "${l==null?void 0:l.toString()}"`),Object.assign(f,{state:l})):f}),this.registry.execute("on-notifications-changed",this.notifications)}),(e=this.io)!=null&&e.notifications&&"onDataChanged"in this.io.notifications&&typeof this.io.notifications.onDataChanged=="function"&&((o=this.io)==null||o.notifications.onDataChanged((c,l)=>{var f;const u=c.id;(f=this.logger)==null||f.trace(`received event for notification data is changed - "${u}" - "${JSON.stringify(l)}"`),this.notifications=this.notifications.map(d=>{var p;return d.id===u?((p=this.logger)==null||p.trace(`${d.id} - the data is changed from "${JSON.stringify(d.data)}" to "${JSON.stringify(l)}"`),Object.assign(d,{data:l})):d}),this.registry.execute("on-notifications-changed",this.notifications)})),(r=this.io)==null||r.notifications.onClosed(({id:c})=>{var l;(l=this.logger)==null||l.trace(`received event for notification is closed - "${c}".`),this.notifications=this.notifications.filter(u=>u.id!==c),this.registry.execute("on-notifications-changed",this.notifications)}),(i=this.io)==null||i.notifications.onConfigurationChanged(c=>{var l;(l=this.logger)==null||l.trace(`received event for configuration changed - ${JSON.stringify(c)}.`),this.registry.execute("on-configuration-changed",c)}),this.isDesktopEnvironment()&&((a=this.io)==null||a.notifications.panel.onVisibilityChanged(c=>{var l;(l=this.logger)==null||l.trace(`received event for panel visibility changed to "${c}".`),this.isPanelVisible=c,this.registry.execute("on-panel-visibility-changed",c)}))}isDesktopEnvironment(){return typeof window=="object"&&(!!window.iodesktop||!!window.glue42gd)}attachHandlers(t){var e;return(e=t.actions)==null||e.forEach(o=>{Object.assign(o,{onClick:async r=>{var i,a,c;try{(i=this.logger)==null||i.info(`${t.id}/${o.action} - was clicked.`),await((a=this.io)==null?void 0:a.notifications.click(t.id,o.action,r))}catch(l){(c=this.logger)==null||c.error("Error while clicking on action:",l)}}})}),Object.assign(t,{snooze:async(o=1e4)=>{var r,i;(r=this.logger)==null||r.trace(`${t.id} - request to change the state from ${t.state} to Snoozed with duration ${o}ms`),await((i=this.io)==null?void 0:i.notifications.snooze(t.id,o))},updateState:async o=>{var r,i;return(r=this.logger)==null||r.trace(`${t.id} - request to change the state from ${t.state} to ${o}`),(i=this.io)==null?void 0:i.notifications.setState(t.id,o)},updateData:async o=>{var r,i;(r=this.logger)==null||r.trace(`${t.id} - request to change the data to ${JSON.stringify(o)}`),(i=this.io)!=null&&i.notifications&&"updateData"in this.io.notifications&&typeof this.io.notifications.updateData=="function"?await this.io.notifications.updateData(t.id,o):console.log("'updateData' method is not supported")},onClick:async o=>{var r,i,a;try{(r=this.logger)==null||r.info(`${t.id} - was clicked.`),await((i=this.io)==null?void 0:i.notifications.click(t.id,void 0,o))}catch(c){(a=this.logger)==null||a.error(`Error while clicking on Notification: ${t.id}`,c)}},onShow:()=>{},close:async()=>{var o;return(o=this.logger)==null||o.info(`${t.id} - was closed.`),this.close(t.id)}})}};function Es(t){const n=g.useContext(Me.IOConnectContext),e=n==null?void 0:n.appManager,o=We(),[r,i]=g.useState([]),[a,c]=g.useState(0),l="Platform",u=g.useCallback((p="asc")=>{if(o===null)return[];const h=[...r].sort((m,v)=>{const y=(m.title??m.name).toLowerCase(),k=(v.title??v.name).toLowerCase();return p==="asc"?y.localeCompare(k):k.localeCompare(y)});if(!o){const m=h.findIndex(v=>v.name===l);if(m!==-1){const[v]=h.splice(m,1);h.unshift(v)}}return h},[r,o]),f=g.useMemo(()=>u("asc"),[u]),d=g.useMemo(()=>u("desc"),[u]);return g.useEffect(()=>{if(o===null||o)return;const p={title:"System",name:l,hidden:!1,userProperties:{hidden:!1}};i(h=>h.some(m=>m.name===p.name)?h:[...h,p])},[o]),g.useEffect(()=>{if(!e)return;const p=e.onAppAdded(v=>{i(y=>[...y,{title:v.title,name:v.name,hidden:v.hidden,userProperties:v.userProperties}])}),h=e.onAppRemoved(v=>{i(y=>y.filter(k=>k.name!==v.name))}),m=e.onAppChanged(v=>{i(y=>{const k=y.find(S=>S.name===v.name);return[...y.filter(S=>S.name!==v.name),{title:v.title,name:k==null?void 0:k.name,hidden:k==null?void 0:k.hidden,allowed:k==null?void 0:k.allowed,userProperties:k==null?void 0:k.userProperties}]})});return()=>{p(),h(),m()}},[e]),{apps:g.useMemo(()=>{if(!(t!=null&&t.sourceFilter)||!Array.isArray(r))return r;const{allowed:p=[],blocked:h=[]}=t.sourceFilter,m=p.includes("*"),v=h.includes("*");let y=0;const k=r.map(S=>{const b=m||p.includes(S.name),w=!v&&b;return w&&y++,{...S,allowed:w}});return c(y),k},[t,r]),allowedApps:a,sortedAppsAsc:f,sortedAppsDesc:d,sortAppsAlphabetically:u}}function _d(t,n,e){var r;return{notificationStacks:g.useMemo(()=>{var u,f,d,p;if(!n.toastStacking)return[];const i=(a=n.stackBy)==="application"?"source":a==="severity"?"severity":"source";var a;const c=t.filter(h=>h.state==="Active"),l=new Map;for(const h of c){const m=h[i]??"";if(h.source&&((f=(u=e==null?void 0:e.sourceFilter)==null?void 0:u.muted)!=null&&f.includes(h.source))||(p=(d=e==null?void 0:e.sourceFilter)==null?void 0:d.muted)!=null&&p.includes("*"))continue;l.has(m)||l.set(m,{key:m,items:[]});const v=l.get(m);v&&v.items.unshift(h)}return Array.from(l.values()).filter(h=>h.items.some(m=>m.state==="Active"||m.state==="Stale"))},[t,n.toastStacking,n.stackBy,(r=e==null?void 0:e.sourceFilter)==null?void 0:r.muted])}}function Ld(t){const[n,e]=g.useState([]);return{selectedNotifications:n,selectNotification:(o,r)=>{const i=n;e(r?[...i,o]:i.filter(a=>a!==o))},selectAllNotifications:(o,r)=>{if(r){let i=[];switch(o){case"read":i=t.filter(a=>a.state==="Acknowledged"||a.state==="Seen").map(a=>a.id);break;case"unread":i=t.filter(a=>a.state==="Active"||a.state==="Stale").map(a=>a.id);break;case"snoozed":i=t.filter(a=>a.state==="Snoozed").map(a=>a.id);break;default:i=t.map(a=>a.id)}e(i)}else e([])}}}const Xc=t=>{var n,e;return{enabledNotifications:t.enable,enabledToasts:t.enableToasts,toastStacking:((n=t.toasts)==null?void 0:n.mode)==="stacked",stackBy:(e=t.toasts)==null?void 0:e.stackBy,toastExpiry:t.toastExpiry,showNotificationBadge:t.showNotificationBadge,placement:t.placement,snooze:t.snooze,closeNotificationOnClick:t.closeNotificationOnClick,autoHidePanel:t.autoHidePanel}},Qc=t=>Array.from(t.reduce((n,e)=>n.set(e.id,e),new Map).values());function f0(){const t=g.useContext(Me.IOConnectContext),[n,e]=g.useState({}),[o,r]=g.useState({}),[i,a]=g.useState([]),[c,l]=g.useState(0),[u,f]=g.useState(!0),{apps:d,allowedApps:p}=Es(n),{notificationStacks:h}=_d(i,{toastStacking:o.toastStacking??!1,stackBy:o.stackBy??"source"},{sourceFilter:n.sourceFilter}),{selectedNotifications:m,selectNotification:v,selectAllNotifications:y}=Ld(i);tt.init(t),g.useEffect(()=>{(async()=>{await(async()=>{try{const b=await tt.getConfiguration();e(b),r(w=>({...w,...Xc(b)}))}catch(b){console.error("Error fetching configuration:",b)}})(),await(async()=>{try{const b=await tt.getNotificationsList();a(Qc(b))}catch(b){console.error("Error fetching notifications:",b)}})()})().catch(b=>{console.error("Error in useNotifications fetch:",b)}),k()},[]),g.useEffect(()=>{const b=tt.onNotificationsChanged(O=>{a(Qc(O))}),w=tt.onConfigurationChanged(O=>{const F=Xc(O);e(R=>({...R,...O})),r(R=>({...R,...F}))}),E=tt.onCounterChanged(O=>{l(O)});return()=>{b(),w(),E()}},[]);const k=()=>{f(tt.bulkActionsSupported)},S=async b=>{await tt.setFilter(b)};return{close:b=>tt.close(b),clearAll:()=>tt.clearAll(),settings:o,hidePanel:async()=>{await tt.hidePanel()},showPanel:async()=>{await tt.showPanel()},saveFilter:S,clearAllOld:()=>tt.clearAllOld(),saveSetting:async b=>{const w=((E,O)=>{const F=(K=>({enabledNotifications:_=>({enable:_}),enabledToasts:_=>({enableToasts:_}),toastStacking:_=>{var A;return{toasts:{mode:_?"stacked":"single",stackBy:(A=K.toasts)==null?void 0:A.stackBy}}},stackBy:_=>{var A;return{toasts:{mode:(A=K.toasts)==null?void 0:A.mode,stackBy:_}}},showNotificationBadge:_=>({showNotificationBadge:_}),toastExpiry:_=>({toastExpiry:_}),placement:_=>({placement:_}),snooze:_=>({snooze:_}),closeNotificationOnClick:_=>({closeNotificationOnClick:_}),autoHidePanel:_=>({autoHidePanel:_})}))(O),R=Object.keys(E)[0],U=E[R];return R&&U!==void 0&&F[R]?F[R](U):{}})(b,n);w&&await tt.configure(w)},allApps:d,saveAllFilter:async b=>{"subscribe"in b?await S({allowed:b.subscribe?["*"]:[],blocked:b.subscribe?[]:["*"]}):"mute"in b&&await S({muted:b.mute?["*"]:[]})},configuration:n,notifications:i,notificationStacks:h,notificationsCount:c,allApplications:n.allApplications??0,allowedApplications:p,isBulkActionsSupported:u,selectedNotifications:m,selectNotification:v,selectAllNotifications:y,clearMany:async b=>{await tt.clearMany(b)},snooze:async(b,w)=>{await tt.snooze(b,w)},snoozeMany:async(b,w)=>{await tt.snoozeMany(b,w)},setState:async(b,w)=>{await tt.setState(b,w)},setStates:async(b,w)=>{await tt.setStates(b,w)},setCount:b=>{l(b)},getNotificationsList:async()=>await tt.getNotificationsList()}}const Rd=g.createContext({allApps:[],settings:{},configuration:{},notifications:[],notificationsCount:0,onClose:()=>{},allApplications:0,clearAll:()=>{},showPanel:()=>{},hidePanel:()=>{},saveFilter:()=>{},clearAllOld:()=>{},notificationStacks:[],saveSetting:()=>{},allowedApplications:0,saveAllFilter:()=>{},isBulkActionsSupported:!1,selectedNotifications:[],selectNotification:()=>{},selectAllNotifications:()=>{},clearMany:()=>{},snooze:()=>{},snoozeMany:()=>{},setState:()=>{},setStates:()=>{},setCount:()=>{}}),Ne=()=>g.useContext(Rd);function Fd({label:t="Allow notifications",align:n="right",...e}){const{settings:o,saveSetting:r}=Ne(),i=We(),a=g.useCallback(c=>{r({enabledNotifications:c.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:a,checked:o.enabledNotifications??!1,...e}):null}function Bd({label:t="Allow notification toasts",align:n="right",...e}){const{settings:o,saveSetting:r}=Ne(),i=We(),a=i&&!o.enabledNotifications,c=g.useCallback(l=>{r({enabledToasts:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.enabledToasts??!1,disabled:a,...e}):null}function Hd({label:t="Show notification badge",align:n="right",...e}){const{settings:o,saveSetting:r}=Ne(),i=We()&&!o.enabledNotifications,a=g.useCallback(c=>{r({showNotificationBadge:c.target.checked})},[r]);return s.jsx(ft,{label:t,align:n,onChange:a,checked:o.showNotificationBadge??!1,disabled:i,...e})}function Wd({label:t="Close notification on click",align:n="right",...e}){const{settings:o,saveSetting:r}=Ne(),i=We(),a=i&&!o.enabledNotifications,c=g.useCallback(l=>{r({closeNotificationOnClick:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.closeNotificationOnClick??!1,disabled:a,...e}):null}function $d({label:t="Auto hide panel",align:n="right",...e}){const{settings:o,saveSetting:r}=Ne(),i=We(),a=g.useCallback(c=>{r({autoHidePanel:c.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:a,checked:o.autoHidePanel??!1,...e}):null}const el=(t,n)=>t?`${t} ${n}${t!==1?"s":""}`:"",ai=t=>{const n=Math.floor(t/60),e=t%60,o=el(n,"minute"),r=el(e,"second");return o+(o&&r?" ":"")+r};function zd({className:t,title:n="Hide toasts after",items:e=[15,30,45,60],...o}){const r=ee("flex","jc-between","ai-center",t),{settings:i,saveSetting:a}=Ne(),c=We(),l=c&&!i.enabledNotifications,u=g.useCallback((f=15e3)=>{i.toastExpiry!==f&&a({toastExpiry:1e3*f})},[i.toastExpiry,a]);return c?s.jsxs("div",{className:r,...o,children:[s.jsx("div",{className:"io-text-clipper "+(l?"io-text-disabled":""),children:s.jsx("span",{children:n})}),s.jsxs(fe,{variant:"light",disabled:l,children:[s.jsx(fe.Button,{text:ai((i.toastExpiry??0)/1e3)}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",children:e.map(f=>s.jsx(fe.Item,{onClick:()=>{u(f)},children:ai(f)},f))})})]})]}):null}function Ud({className:t,title:n="Stacking",...e}){const o=ee("io-notifications-settings-panel-stacking",t),{ToastStacking:r,ToastStackBy:i}=ao();return We()?s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n,children:[s.jsx(r,{}),s.jsx(i,{})]})}):null}function Vd({label:t="Allow toast stacking",align:n="right",...e}){const{settings:o,saveSetting:r}=Ne(),i=We(),a=i&&!o.enabledNotifications,c=g.useCallback(l=>{r({toastStacking:l.target.checked})},[r]);return i?s.jsx(ft,{label:t,align:n,onChange:c,checked:o.toastStacking??!1,disabled:a,...e}):null}const Ya={application:"Application",severity:"Priority"},p0=Object.fromEntries(Object.entries(Ya).map(([t,n])=>[n,t]));function Gd({className:t,title:n="Group by",...e}){const o=ee("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=Ne(),a=We(),c=a&&!r.enabledNotifications,l=g.useCallback((f="severity")=>{r.stackBy!==f&&i({stackBy:f.toLowerCase()})},[r.stackBy,i]);if(!a)return null;const u=Object.values(Ya);return s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:ee("io-text-clipper",{"io-text-disabled":c}),children:s.jsx("span",{children:n})}),s.jsxs(fe,{variant:"light",disabled:c,children:[s.jsx(fe.Button,{text:Ya[r.stackBy??"severity"]}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",children:u.map(f=>s.jsx(fe.Item,{onClick:()=>{const d=p0[f];l(d)},children:f},f))})})]})]})}function Yd({className:t,title:n="Placement",...e}){const o=ee("io-notifications-settings-panel-placement",t),{PlacementPanel:r,PlacementToasts:i}=ao();return We()?s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n,children:[s.jsx(r,{}),s.jsx(i,{})]})}):null}const Zd=t=>t.replace(/(^|-)\w/g,n=>n.toUpperCase().replace("-"," "));function Kd({className:t,title:n="Panel position",...e}){var l,u;const o=ee("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=Ne(),a=We(),c=g.useCallback(f=>{var d;f||(f="right"),((d=r.placement)==null?void 0:d.panel)!==f&&i({placement:{...r.placement,panel:f.toLowerCase()}})},[r.placement,i]);return a?s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:"io-text-clipper",children:s.jsx("span",{children:n})}),s.jsxs(fe,{variant:"light",children:[s.jsx(fe.Button,{text:(l=r.placement)!=null&&l.panel?Zd((u=r.placement)==null?void 0:u.panel):"Right"}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",children:["Right","Left"].map(f=>s.jsx(fe.Item,{onClick:()=>{c(f)},children:f},f))})})]})]}):null}function qd({className:t,title:n="Toasts position",...e}){var l,u;const o=ee("flex","jc-between","ai-center",t),{settings:r,saveSetting:i}=Ne(),a=We(),c=g.useCallback(f=>{var p;if(f||(f="bottom-right"),((p=r.placement)==null?void 0:p.toasts)===f)return;const d=f.replace(/\s+/g,"-").toLowerCase();i({placement:{...r.placement,toasts:d}})},[r.placement,i]);return a?s.jsxs("div",{className:o,...e,children:[s.jsx("div",{className:"io-text-clipper",children:s.jsx("span",{children:n})}),s.jsxs(fe,{variant:"light",children:[s.jsx(fe.Button,{text:(l=r.placement)!=null&&l.toasts?Zd((u=r.placement)==null?void 0:u.toasts):"Bottom Right"}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map(f=>s.jsx(fe.Item,{onClick:()=>{c(f)},children:f},f))})})]})]}):null}function Jd({className:t,title:n="Snooze",...e}){var a;const o=ee("io-notifications-settings-panel-snooze",t),{SnoozeDuration:r}=ao(),{settings:i}=Ne();return We()&&((a=i.snooze)!=null&&a.enabled)?s.jsx("div",{className:o,...e,children:s.jsx(Ke,{title:n,children:s.jsx(r,{})})}):null}function Xd({className:t,title:n="Default duration",items:e=[60,120,180,300],...o}){var f,d;const r=ee("flex","jc-between","ai-center",t),{settings:i,saveSetting:a}=Ne(),c=We(),l=c&&!i.enabledNotifications,u=g.useCallback((p=6e4)=>{var h;i.snooze&&((h=i.snooze)==null?void 0:h.duration)!==p&&a({snooze:{...i.snooze,duration:1e3*p}})},[i.snooze,a]);return c&&((f=i.snooze)!=null&&f.enabled)?s.jsxs("div",{className:r,...o,children:[s.jsx("div",{className:ee("io-text-clipper",{"io-text-disabled":l}),children:s.jsx("span",{children:n})}),s.jsxs(fe,{variant:"light",disabled:l,children:[s.jsx(fe.Button,{text:ai((((d=i.snooze)==null?void 0:d.duration)??0)/1e3)}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",children:e.map(p=>s.jsx(fe.Item,{onClick:()=>{u(p)},children:ai(p)},p))})})]})]}):null}function Qd({className:t,title:n,...e}){const o=ee("io-notifications-settings-panel-subscriptions",t),{SubscribeAll:r,SubscribeApp:i,SubscribeMuteAll:a,SubscribeMuteApp:c}=ao(),{sortAppsAlphabetically:l}=Es(),u=We(),f=l(),d="io-notifications-subscriptions-grid "+(u?"with-three-columns":"with-two-columns");return s.jsx("div",{className:o,...e,children:s.jsxs(Ke,{title:n??(u?"Subscribe & Mute":"Subscribe"),children:[s.jsxs("div",{className:d,children:[s.jsx("p",{className:"io-text-section",children:"Sources"}),s.jsx("p",{className:"io-text-section",children:"Subscribe"}),u&&s.jsx("p",{className:"io-text-section",children:"Mute"})]}),s.jsxs("div",{className:d,children:[s.jsx("p",{children:"All Sources"}),s.jsx(r,{label:""}),u&&s.jsx(a,{label:""})]}),f.map(p=>{var h;return!p||p.hidden||(h=p==null?void 0:p.userProperties)!=null&&h.hidden?null:s.jsxs("div",{className:d,children:[s.jsx("p",{children:p.title??p.name}),s.jsx(i,{app:p,label:""}),u&&s.jsx(c,{app:p,label:""})]},p.name)})]})})}function ef({label:t="All apps",align:n="right",...e}){var l,u,f,d;const{settings:o,configuration:r,saveAllFilter:i}=Ne(),a=We()&&!o.enabledNotifications,c=g.useCallback(p=>{i({subscribe:p.target.checked})},[i]);return s.jsx(ft,{align:n,label:t,onChange:c,checked:(((u=(l=r.sourceFilter)==null?void 0:l.allowed)==null?void 0:u.includes("*"))&&((d=(f=r.sourceFilter)==null?void 0:f.blocked)==null?void 0:d.length)===0)??!1,disabled:a,...e})}function tf({label:t="App",align:n="right",app:e,...o}){var f,d,p,h,m,v;const{allApps:r,settings:i,configuration:a,saveFilter:c}=Ne(),l=We()&&!i.enabledNotifications,u=g.useCallback((y,k)=>{var w,E,O,F,R,U;const S={...a.sourceFilter},b=(w=S.allowed)==null?void 0:w.indexOf("*");typeof b=="number"&&b>-1&&((E=S.allowed)==null||E.splice(b,1),r.forEach(K=>{var _;K.name!==k.name&&((_=S.allowed)==null||_.push(K.name))})),y?(S.allowed=[...new Set([...S.allowed??[],k.name])],S.blocked=(O=S.blocked)==null?void 0:O.filter(K=>K!==k.name)):(S.allowed=(F=S.allowed)==null?void 0:F.filter(K=>K!==k.name),S.blocked=[...new Set([...S.blocked??[],k.name])]),(R=S.allowed)!=null&&R.length&&((U=S.blocked)!=null&&U.includes("*"))&&S.blocked.splice(S.blocked.indexOf("*"),1),c(S)},[r,a.sourceFilter,c]);return s.jsx(ft,{id:e.name,label:t,align:n,onChange:y=>u(y.target.checked,e),checked:(((d=(f=a.sourceFilter)==null?void 0:f.allowed)==null?void 0:d.includes("*"))&&!((h=(p=a.sourceFilter)==null?void 0:p.blocked)!=null&&h.includes(e.name))||((v=(m=a.sourceFilter)==null?void 0:m.allowed)==null?void 0:v.includes(e.name)))??!1,disabled:l,...o})}function nf({label:t="Mute all",align:n="right",...e}){var u,f,d,p;const{settings:o,configuration:r,saveAllFilter:i}=Ne(),a=We(),c=a&&(!o.enabledNotifications||((f=(u=r.sourceFilter)==null?void 0:u.allowed)==null?void 0:f.indexOf("*"))===-1),l=g.useCallback(h=>{i({mute:h.target.checked})},[i]);return a?s.jsx(ft,{align:n,label:t,onChange:l,checked:((p=(d=r.sourceFilter)==null?void 0:d.muted)==null?void 0:p.includes("*"))??!1,disabled:c??!1,...e}):null}function of({label:t="App",align:n="right",app:e,...o}){var d,p,h,m,v,y,k,S,b,w,E,O,F,R,U,K;const{allApps:r,settings:i,configuration:a,saveFilter:c}=Ne(),l=We(),u=l&&(!i.enabledNotifications||((p=(d=a.sourceFilter)==null?void 0:d.blocked)==null?void 0:p.includes("*"))||((m=(h=a.sourceFilter)==null?void 0:h.blocked)==null?void 0:m.includes(e.name))||((y=(v=a.sourceFilter)==null?void 0:v.allowed)==null?void 0:y.length)===0||((S=(k=a.sourceFilter)==null?void 0:k.allowed)==null?void 0:S.indexOf(e.name))===-1&&((w=(b=a.sourceFilter)==null?void 0:b.allowed)==null?void 0:w.indexOf("*"))===-1&&((O=(E=a.sourceFilter)==null?void 0:E.blocked)==null?void 0:O.length)===0),f=g.useCallback((_,A)=>{var re,ye,pe,xe;const me={...a.sourceFilter},de=(re=me==null?void 0:me.muted)==null?void 0:re.indexOf("*");typeof de=="number"&&de>-1&&((ye=me.muted)==null||ye.splice(de,1),r.forEach(ae=>{var B;ae.name===A.name||ae.hidden||((B=me.muted)==null||B.push(ae.name))})),_?(pe=me.muted)==null||pe.push(A.name):me.muted=(xe=me.muted)==null?void 0:xe.filter(ae=>ae!==A.name),c(me)},[r,a.sourceFilter,c]);return!l||e.hidden?null:s.jsx(ft,{id:e.name,label:t,align:n,onChange:_=>f(_.target.checked,e),checked:(((R=(F=a.sourceFilter)==null?void 0:F.muted)==null?void 0:R.includes("*"))||((K=(U=a.sourceFilter)==null?void 0:U.muted)==null?void 0:K.includes(e.name)))??!1,disabled:u??!1,...o})}const rf={Body:t=>{const{General:n,Placement:e,Stacking:o,Snooze:r,Subscriptions:i}=ao();return s.jsxs(Oo,{...t,children:[s.jsx(n,{}),s.jsx(o,{}),s.jsx(e,{}),s.jsx(r,{}),s.jsx(i,{})]})},General:Md,AllowNotifications:Fd,AllowNotificationToasts:Bd,ShowNotificationBadge:Hd,CloseNotificationOnClick:Wd,PanelAutoHide:$d,HideToastsAfter:zd,Stacking:Ud,ToastStacking:Vd,ToastStackBy:Gd,Placement:Yd,PlacementPanel:Kd,PlacementToasts:qd,Snooze:Jd,SnoozeDuration:Xd,Subscriptions:Qd,SubscribeAll:ef,SubscribeApp:tf,SubscribeMuteAll:nf,SubscribeMuteApp:of},af=g.createContext(rf),js=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...rf,...n}),[n]);return s.jsx(af.Provider,{value:e,children:t})});js.displayName="NotificationsSettingsPanelComponentsStoreProvider";const ao=()=>g.useContext(af),h0=({className:t,onClose:n,title:e="Notification Settings",...o})=>{const{Body:r}=ao();return s.jsxs(Ge,{className:ee("io-notifications-settings-panel",t),"data-testid":"notifications-settings-panel",...o,children:[s.jsxs(Ge.Header,{children:[s.jsx(Ge.Header.Title,{size:"large",text:e,tag:"h1"}),s.jsx(Ge.Header.ButtonGroup,{children:s.jsx(Ge.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),s.jsx(r,{})]})},Os=({components:t,...n})=>s.jsx(js,{components:t,children:s.jsx(h0,{...n})});function m0({isOpen:t,onClose:n,container:e}){return t?jn.createPortal(s.jsx(Os,{onClose:n}),e??document.querySelector("#root")??document.body):null}const sf=g.createContext({searchQuery:"",setSearch:()=>{},isPanelVisible:!1,sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),Et=()=>g.useContext(sf);function cf({title:t,onClose:n,onOpenSettings:e,...o}){const{HeaderCaptionTitle:r,HeaderCaptionCount:i,HeaderCaptionButtonSettings:a,HeaderCaptionButtonClose:c,HeaderActions:l,HeaderBulkActions:u,HeaderSearch:f}=ro(),{isBulkActionsSupported:d,notificationsCount:p}=Ne(),{isBulkActionsVisible:h}=Et(),m=We();return s.jsxs(En,{...o,children:[s.jsxs("div",{className:"io-panel-header-caption",children:[s.jsx(r,{title:t}),s.jsx(i,{}),s.jsxs(En.ButtonGroup,{children:[m&&s.jsx(a,{onClick:e}),s.jsx(c,{onClick:n})]})]}),s.jsx(f,{}),d?s.jsxs("div",{className:`io-panel-header-actions-wrapper ${h&&p>0?"io-panel-header-bulk-actions-opened":""} `,children:[s.jsx(l,{}),s.jsx(u,{})]}):s.jsx(l,{})]})}function lf({text:t="Notifications",counter:n,...e}){const{notificationsCount:o}=Ne();return s.jsx(sn,{text:t,size:"large",...e,children:(n??!0)&&s.jsxs("span",{children:["(",o,")"]})})}const uf="newest",g0="oldest",v0="severity",ia=["None","Low","Medium","High","Critical"],tl={key:uf,descending:!0},df=t=>[...t].sort((n,e)=>(e.timestamp||0)-(n.timestamp||0)),ff=t=>[...t].sort((n,e)=>(n.timestamp||0)-(e.timestamp||0)),pf=(t,n)=>{const e=ia[0];return[...t].sort((o,r)=>{const i=ia.indexOf(o.severity||e),a=ia.indexOf(r.severity||e);return(n?-1:1)*(i-a)})},y0={[uf]:df,[g0]:ff,[v0]:pf},w0={severity:"Priority",newest:"Newest",oldest:"Oldest"};function hf({...t}){const[n,e]=g.useState([]),{NotificationsList:o,Notification:r}=ro(),{notifications:i,setCount:a,notificationsCount:c}=Ne(),{sortNotificationsBy:l,viewNotificationsBy:u,searchQuery:f}=Et(),d=g.useRef(null),p=$u(f),h=g.useMemo(()=>((v,y)=>{if(!v)return[];switch(y){case"all":default:return v;case"unread":return v.filter(k=>k.state==="Active"||k.state==="Stale");case"read":return v.filter(k=>k.state==="Acknowledged"||k.state==="Seen");case"snoozed":return v.filter(k=>k.state==="Snoozed")}})(i,u).filter(v=>{var y,k;return v.title.toLowerCase().includes(p.toLowerCase())||((y=v.source)==null?void 0:y.toLowerCase().includes(p.toLowerCase()))||((k=v.body)==null?void 0:k.toLowerCase().includes(p.toLowerCase()))}),[p,i,u]);return g.useEffect(()=>{switch(l){case"newest":e(df(h));break;case"oldest":e(ff(h));break;case"severity":e(pf(h,!0));break;default:e(h)}a(h.length)},[h,l,a]),g.useEffect(()=>{var m;d.current&&((m=d.current)==null||m.scrollTo({top:0,behavior:"smooth"}))},[p,c,l,u]),s.jsx(Oo,{ref:d,...t,children:s.jsx(o,{notifications:n,Notification:r})})}function mf({...t}){const{FooterButtons:n}=ro();return s.jsx(go,{...t,children:s.jsx(n,{})})}function gf({className:t,...n}){const{FooterButtonClearAll:e,FooterButtonClearAllOld:o}=ro(),{notifications:r}=Ne(),[i,a]=g.useState(!1);return g.useEffect(()=>{r.filter(c=>c.state==="Stale"||c.state==="Acknowledged").length>0?a(!0):a(!1)},[r]),s.jsxs(Re,{className:t,align:"right",...n,children:[s.jsx(o,{disabled:!i}),s.jsx(e,{disabled:r.length<=0})]})}function vf({text:t="Clear All",...n}){const{clearAll:e}=Ne();return s.jsx(Ye,{text:t,onClick:()=>{e()},...n})}function yf({text:t="Clear Old",...n}){const{clearAllOld:e}=Ne();return s.jsx(Ye,{text:t,onClick:()=>{e()},...n})}function Ns(t){const n=We(),{onClose:e,settings:o}=Ne(),{isPanelVisible:r}=Et(),{id:i,onClick:a,updateState:c}=t,l=g.useCallback(async()=>{if(!a)return;if(!n){try{await a({close:!0})}catch(p){console.error(p)}return void e(i)}const f=(o==null?void 0:o.toastStacking)??!1;let d;d=r?(o==null?void 0:o.closeNotificationOnClick)??!0:!f&&null;try{d!==null?await a({close:d}):(await a({close:!1}),await c("Acknowledged"))}catch(p){console.error(p)}},[n,i,r,a,e,c,o==null?void 0:o.closeNotificationOnClick,o==null?void 0:o.toastStacking]),u=g.useCallback(async f=>{const d=f.target;d.closest("button")||d.closest("[role='button']")||d.closest("a")||d.closest(".io-dropdown-menu")||await l()},[l]);return{handleClick:l,handleWrapperClick:u}}function wf({className:t,notification:n,onClick:e,...o}){const r=ee("io-notification-header",t),{HeaderCount:i,HeaderBadge:a,HeaderTitle:c,HeaderTimestamp:l,HeaderButtonSnooze:u,HeaderButtonClose:f}=Ai(),{handleWrapperClick:d}=Ns(n);return s.jsxs("div",{className:r,onClick:async p=>{await d(p),e==null||e(p)},...o,children:[s.jsx(a,{notification:n}),s.jsx(i,{notification:n}),s.jsx(c,{notification:n}),s.jsx(l,{notification:n}),s.jsxs(Re,{children:[s.jsx(u,{notification:n}),s.jsx(f,{notification:n})]})]})}function bf({notification:t,...n}){const{settings:e,notificationStacks:o}=Ne(),{isPanelVisible:r}=Et(),{toastStacking:i,stackBy:a}=e,c=a==="application"?"source":a??"source";let l=0;if(i){const u=o.find(f=>f.key===t[c]);l=(u==null?void 0:u.items.length)??0}return r||!i||l<=1?null:s.jsx(ki,{...n,children:l>9?"9+":l})}function xf({className:t,notification:n,...e}){if(!(n!=null&&n.severity)||n.severity==="None")return null;const o=ee("io-notification-header-badge",t);return s.jsx(ki,{className:o,...e,children:n.severity})}function Cf({className:t,state:n,severity:e="None",icon:o,...r}){const i=ee("io-notification-header-icon",t),{isPanelVisible:a}=Et();return s.jsxs("div",{className:i,...r,children:[o&&s.jsx("span",{className:"io-notification-header-icon-image",children:s.jsx("img",{src:o,alt:`io-notification-header-icon-${o}`})}),s.jsx("span",{className:`io-notification-header-icon-badge color-${e.toLowerCase()}`,children:a&&n!=="Acknowledged"&&"New"})]})}function kf({className:t,notification:{appTitle:n},...e}){const o=ee("io-notification-header-title",t);return s.jsx("div",{className:o,...e,children:n})}function Sf({className:t,notification:{timestamp:n,state:e,snooze:o},...r}){const i=ee("io-notification-timestamp",t);return s.jsx("small",o&&e==="Snoozed"?{className:i,...r,children:"Snoozed"}:{className:i,...r,children:bd(n??0)??"Just Now"})}function Ef({notification:{id:t,state:n},...e}){var a,c;const{settings:o,snooze:r}=Ne(),i=g.useCallback(l=>{var u;l.stopPropagation(),r&&r(t,((u=o.snooze)==null?void 0:u.duration)??0)},[t,r,(a=o.snooze)==null?void 0:a.duration]);return r&&n!=="Snoozed"&&((c=o.snooze)!=null&&c.enabled)?s.jsx(Ye,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:i,...e}):null}function jf({notification:{id:t,updateState:n},...e}){const o=We(),{onClose:r}=Ne(),{isPanelVisible:i}=Et(),a=g.useCallback(c=>{c.stopPropagation(),!o||i?r(t):n("Acknowledged").catch(console.error)},[o,t,r,i,n]);return s.jsx(Ve,{icon:"close",iconSize:"10",tabIndex:-1,onClick:a,...e})}function Of({className:t,notification:n,...e}){const o=ee("io-notification-body",t),{BodyIcon:r,BodyTitle:i,BodyDescription:a}=Ai(),{icon:c,title:l,body:u}=n,{handleClick:f}=Ns(n);return s.jsxs("div",{className:o,role:"button",tabIndex:0,onKeyDown:async d=>{_n(d)&&await f()},onClick:f,...e,children:[s.jsx(r,{icon:c}),s.jsxs("div",{className:"io-notification-body-content",children:[s.jsx(i,{text:l}),s.jsx(a,{text:u})]})]})}function Nf({className:t,icon:n,altText:e="notification icon",...o}){if(!n)return null;const r=ee("io-notification-body-icon",t);return s.jsx("div",{className:r,...o,children:s.jsx("img",{src:n,alt:e})})}function If({text:t,...n}){return s.jsx(sn,{text:t,...n})}function Pf({className:t,text:n,...e}){const o=ee("io-notification-body-description",t);return s.jsx("p",{className:o,...e,children:n})}function Af({className:t,notification:n}){const e=ee("io-notification-footer",t),{FooterButton:o}=Ai(),{handleWrapperClick:r}=Ns(n),i=g.useMemo(()=>function(c){const l=[],u={};if(!c)return;c.forEach(d=>{var v;const{displayId:p,displayPath:h}=d,m={...d,children:[]};if(h&&h.length>0){let y;h.forEach((k,S)=>{var b;S===0?y=u[k]:y&&(y=(b=y.children)==null?void 0:b.find(w=>w.displayId===k))}),y&&((v=y.children)==null||v.push(m))}else p?(l.push(m),u[p]=m):l.push(m);p&&(u[p]=m)});const f=d=>{d.forEach(p=>{var h;((h=p.children)==null?void 0:h.length)===0?delete p.children:p.children&&f(p.children)})};return f(l),l}(n.actions),[n.actions]),a=(c,l)=>c.children?s.jsx(Xt,{text:c.title,children:c.children.map(a)},`${c.title}-${l}`):((u,f)=>s.jsx(Xt.Item,{children:s.jsx(o,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:u})},`${u.title}-${f}`))(c,l);return s.jsx("div",{className:e,onClick:r,children:s.jsx(Re,{align:"right",children:i==null?void 0:i.map((c,l)=>c.children?s.jsxs(Re,{variant:"append",children:[s.jsx(o,{notificationAction:c,variant:l===0?"primary":"default"}),s.jsx(Xt,{variant:l===0?"primary":"default",icon:"ellipsis",children:c.children.map(a)})]},`${c.title}-${l}`):s.jsx(o,{notificationAction:c,variant:l===0?"primary":"link"},`${c.title}-${l}`))})})}function Tf({notificationAction:t,...n}){const e=g.useCallback(o=>{o.stopPropagation(),t.onClick({close:!0})},[t]);return s.jsx(Ye,{text:t.title,onClick:e,...n})}const Df={Header:wf,HeaderCount:bf,HeaderBadge:xf,HeaderIcon:Cf,HeaderTitle:kf,HeaderTimestamp:Sf,HeaderButtonSnooze:Ef,HeaderButtonClose:jf,Body:Of,BodyIcon:Nf,BodyTitle:If,BodyDescription:Pf,Footer:Af,FooterButton:Tf},Mf=g.createContext(Df),_f=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Df,...n}),[n]);return s.jsx(Mf.Provider,{value:e,children:t})});function Ai(t){return{...g.useContext(Mf),...t}}function b0({className:t,notification:n,...e}){const{Header:o,Body:r,Footer:i}=Ai(),{severity:a}=n,c=ee("io-notification",`severity-${(a==null?void 0:a.toLowerCase())??"none"}`,n.state!=="Acknowledged"&&"state-new",t);return s.jsxs("div",{className:c,...e,children:[s.jsx(o,{notification:n}),s.jsx(r,{notification:n}),s.jsx(i,{notification:n})]})}function Ti({components:t,notification:n,...e}){return s.jsx(_f,{components:t,children:s.jsx(b0,{notification:n,...e})})}function Lf({className:t,notifications:n,...e}){const[o,r]=g.useState(!1),i=n.length>=3?"large":"normal",a=n.length===2?"small":i,c=n[0].severity,l=ee("io-notification-stack",o&&"io-notification-stack-open",a!=="normal"&&[`io-notification-stack-${a}`],c&&c!=="None"&&[`io-notification-stack-${c.toLowerCase()}`],t),u=g.useCallback(()=>{r(!0)},[]),f=g.useCallback(d=>{d.stopPropagation(),n.forEach(p=>{p.close()})},[n]);return s.jsxs("div",{className:l,onClick:u,...e,children:[o&&a!=="normal"&&s.jsx("div",{className:"io-notification-stack-btn",children:s.jsx(Ye,{icon:"close",onClick:d=>f(d),children:s.jsx("span",{className:"io-btn-text",children:"Clear Stack"})})}),n.map(d=>s.jsx(Ti,{notification:d},d.id))]})}function x0({...t}){const{notificationStacks:n}=Ne();return s.jsx(s.Fragment,{children:n.map(e=>s.jsx(Lf,{notifications:e.items,...t},e.key))})}_f.displayName="ComponentsStoreProvider";const C0=({notification:t,Notification:n,...e})=>{var h;const{configuration:o,isBulkActionsSupported:r,selectedNotifications:i,selectNotification:a}=Ne(),{isPanelVisible:c,isBulkActionsVisible:l}=Et(),u=((h=o.sourceFilter)==null?void 0:h.muted)??[],f=t.source&&u.includes(t.source)||u.includes("*");if(!c&&f)return null;const d=c&&r&&l,p=i.includes(t.id);return d?s.jsxs("div",{className:ee("io-notification-list-bulk-action-item",{selected:p}),children:[s.jsx(ji,{checked:p,onChange:m=>a(t.id,m.target.checked)}),s.jsx(n,{notification:t,...e})]}):s.jsx(n,{notification:t,...e})};function Is({className:t,Notification:n,notifications:e=[],noNotificationText:o="No notifications to display",...r}){const i=ee("io-notification-list",t),{settings:a}=Ne(),{isPanelVisible:c}=Et(),{toastStacking:l}=a,u=l&&!c,f=e.length>0;return s.jsxs("div",{className:i,...r,children:[u&&s.jsx(x0,{}),!u&&(f?e.map(d=>s.jsx(C0,{notification:d,Notification:n,...r},d.id)):s.jsx("div",{className:"flex jc-center mt-8",children:o}))]})}const Rf={Header:cf,HeaderCaptionTitle:lf,HeaderCaptionCount:function({variant:t="primary",...n}){const{notificationsCount:e=0}=Ne();return e===0?null:s.jsx(em,{variant:t,...n,children:e>99?"99+":e})},HeaderCaptionButtonSettings:function({icon:t="cog",size:n="32",variant:e="circle",...o}){return We()?s.jsx(Ve,{icon:t,size:n,variant:e,...o}):null},HeaderCaptionButtonClose:function({icon:t="close",size:n="32",variant:e="circle",onClick:o,...r}){const{hidePanel:i}=Ne(),a=We();return s.jsx(Ve,{icon:t,size:n,variant:e,onClick:c=>{o?o(c):a&&i()},...r})},HeaderActions:function({className:t,...n}){const e=ee("io-panel-header-actions",t),{HeaderActionSort:o,HeaderActionView:r,HeaderActionClear:i,HeaderActionEdit:a}=ro();return s.jsxs("div",{className:e,...n,children:[s.jsxs(Re,{children:[s.jsx(o,{}),s.jsx(r,{})]}),s.jsxs(Re,{children:[s.jsx(i,{}),s.jsx(a,{})]})]})},HeaderActionSort:function({text:t="Sort by",...n}){const{sortNotificationsBy:e,setSortBy:o}=Et(),{onNotificationsSort:r}=(()=>{const{notifications:i}=Ne(),[a,c]=g.useState(tl),{key:l,descending:u}=a,f=g.useMemo(()=>y0[l](i,u),[i,l,u]);return{onNotificationsSort:g.useCallback(p=>{c(h=>({key:p,descending:h.key!==p?tl.descending:!h.descending}))},[]),sortedNotifications:f}})();return s.jsxs(fe,{variant:"light",...n,children:[s.jsxs(fe.Button,{variant:"link",children:[t," ",s.jsx("strong",{children:w0[e].toLowerCase()})]}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Priority"].map(i=>{const a=i==="Priority"?"severity":i.toLowerCase();return s.jsx(fe.Item,{isSelected:e===a,onClick:()=>{o(a),r(a)},children:i},i)})})})]})},HeaderActionView:function({text:t="View",...n}){var a;const{settings:e}=Ne(),{viewNotificationsBy:o,setViewBy:r}=Et(),i=(a=e.snooze)!=null&&a.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return s.jsxs(fe,{variant:"light",...n,children:[s.jsxs(fe.Button,{variant:"link",children:[t," ",s.jsx("strong",{children:o})]}),s.jsx(fe.Content,{children:s.jsx(fe.List,{variant:"single",checkIcon:"check",children:i.map(c=>s.jsx(fe.Item,{isSelected:o===c.toLowerCase(),onClick:()=>r(c.toLowerCase()),children:c},c))})})]})},HeaderActionClear:function({text:t="Clear All",...n}){const{clearAll:e,notificationsCount:o}=Ne();return s.jsx(Ye,{variant:"link",text:t,onClick:e,disabled:o===0,...n})},HeaderActionEdit:function({tooltip:t="Bulk Edit",...n}){const{isBulkActionsSupported:e,notificationsCount:o}=Ne(),{showBulkActions:r}=Et();return e?s.jsx(Ve,{icon:"pen-to-square",title:t,size:"32",onClick:r,disabled:o===0,...n}):null},HeaderBulkActions:function({className:t,...n}){const e=ee("io-panel-header-bulk-actions",t),{HeaderBulkActionSelect:o,HeaderBulkActionSelectDropdown:r,HeaderBulkActionMarkAsRead:i,HeaderBulkActionMarkAsUnread:a,HeaderBulkActionSnooze:c,HeaderBulkActionClear:l,HeaderBulkActionClose:u}=ro(),{isBulkActionsSupported:f}=Ne();return f?s.jsx("div",{className:e,...n,children:s.jsxs(Re,{children:[s.jsx(o,{}),s.jsx(r,{}),s.jsx(i,{}),s.jsx(a,{}),s.jsx(c,{}),s.jsx(l,{}),s.jsx(u,{})]})}):null},HeaderBulkActionSelect:function({...t}){const{isBulkActionsSupported:n,selectedNotifications:e,selectAllNotifications:o,notificationsCount:r}=Ne();return n?s.jsx(ji,{checked:r===e.length&&r>0,onChange:i=>o("all",i.target.checked),disabled:r===0,...t}):null},HeaderBulkActionSelectDropdown:function({...t}){const{isBulkActionsSupported:n,selectAllNotifications:e,notificationsCount:o}=Ne();return n?s.jsxs(fe,{variant:"light",...t,children:[s.jsx(fe.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:o===0}),s.jsx(eu,{children:s.jsxs(fe.List,{variant:"single",checkIcon:"check",children:[s.jsx(fe.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map(r=>s.jsx(fe.Item,{onClick:()=>e(r.toLowerCase(),!0),children:r},r))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:t="envelope-open",size:n="32",variant:e="circle",tooltip:o="Mark as read",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:c,notificationsCount:l}=Ne(),u=g.useCallback(()=>{c(a,"Seen")},[a,c]);return i?s.jsx(Ve,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionMarkAsUnread:function({icon:t="envelope",size:n="32",variant:e="circle",tooltip:o="Mark as unread",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:c,notificationsCount:l}=Ne(),u=g.useCallback(()=>{c(a,"Active")},[a,c]);return i?s.jsx(Ve,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionSnooze:function({icon:t="snooze",size:n="32",variant:e="circle",tooltip:o="Snooze",...r}){var d,p;const{isBulkActionsSupported:i,selectedNotifications:a,snoozeMany:c,settings:l,notificationsCount:u}=Ne(),f=g.useCallback(()=>{var h;c(a,((h=l.snooze)==null?void 0:h.duration)??0)},[a,c,(d=l.snooze)==null?void 0:d.duration]);return i&&((p=l.snooze)!=null&&p.enabled)?s.jsx(Ve,{icon:t,size:n,variant:e,title:o,onClick:f,disabled:u===0,...r}):null},HeaderBulkActionClear:function({icon:t="trash",size:n="32",variant:e="circle",tooltip:o="Clear",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,clearMany:c,notificationsCount:l}=Ne(),u=g.useCallback(()=>{c(a)},[a,c]);return i?s.jsx(Ve,{icon:t,size:n,variant:e,title:o,onClick:u,disabled:l===0,...r}):null},HeaderBulkActionClose:function({text:t="Done",variant:n="primary",...e}){const{isBulkActionsSupported:o,notificationsCount:r}=Ne(),{hideBulkActions:i}=Et();return o?s.jsx(Ye,{variant:n,text:t,onClick:i,disabled:r===0,...e}):null},HeaderSearch:function({className:t,placeholder:n="Search",iconPrepend:e="search",iconAppend:o="close",...r}){const i=ee("io-panel-header-search",t),a=g.useRef(null),{notificationsCount:c}=Ne(),{searchQuery:l,setSearch:u}=Et(),f=l.length>0,d=g.useCallback(()=>{u(""),a.current&&a.current.focus()},[u]);return s.jsxs("div",{className:i,children:[s.jsx(no,{ref:a,value:l,iconPrepend:e,iconAppend:f?o:void 0,iconAppendOnClick:f?d:void 0,placeholder:n,onChange:p=>u(p.target.value),...r}),f&&s.jsx("p",{className:"io-panel-header-search-count",children:`${c} results`})]})},Body:hf,Footer:mf,FooterButtons:gf,FooterButtonClearAll:vf,FooterButtonClearAllOld:yf,Notification:Ti,NotificationsList:Is},Ff=g.createContext(Rf),Bf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Rf,...n}),[n]);return s.jsx(Ff.Provider,{value:e,children:t})});function ro(t){return{...g.useContext(Ff),...t}}function Hf(){var r,i;const t=g.useContext(Me.IOConnectContext),{settings:n}=Ne(),e=We(),o=g.useCallback(async()=>{var l;const a=t.windows.my();if(!t||!a||!e)return;const c=a.placementSettings;await a.place({...c,horizontalAlignment:(l=n.placement)==null?void 0:l.panel})},[t,e,(r=n.placement)==null?void 0:r.panel]);g.useEffect(()=>{var a;t&&((a=n.placement)!=null&&a.panel)&&e&&o().catch(console.error)},[t,e,o,(i=n.placement)==null?void 0:i.panel])}function k0({className:t,onClose:n,title:e="Notifications",...o}){var p,h;const{Header:r,Body:i}=ro(),{settings:a}=Ne(),{isPanelVisible:c}=Et(),[l,u]=g.useState(!1),f=We(),d=ee("io-notifications-panel",((p=a.placement)==null?void 0:p.panel)==="left"&&"io-panel-left",((h=a.placement)==null?void 0:h.panel)==="right"&&"io-panel-right",t);return Hf(),g.useEffect(()=>{c||u(!1)},[c]),s.jsxs(s.Fragment,{children:[s.jsxs(Ge,{className:d,...o,children:[s.jsx(r,{title:e,onClose:n,onOpenSettings:()=>u(!0)}),s.jsx(i,{})]}),f&&c&&s.jsx(m0,{isOpen:l,onClose:()=>u(!1)})]})}Bf.displayName="ComponentsStoreProvider";const Wf={Body:function({className:t,notifications:n,maxToasts:e=1,...o}){const r=ee("io-toasts-body",t),{NotificationsList:i,Notification:a}=Uf(),[c,l]=g.useState([]);return g.useEffect(()=>{const u=e<0?n.length:e,f=n.filter(d=>d.state==="Active").slice(0,u);for(const d of f)d.onShow();l(f)},[n,e]),s.jsx("div",{className:r,...o,children:s.jsx(i,{Notification:a,notifications:c,noNotificationText:""})})},Notification:Ti,NotificationsList:Is},$f=g.createContext(Wf),zf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Wf,...n}),[n]);return s.jsx($f.Provider,{value:e,children:t})});function Uf(t){return{...g.useContext($f),...t}}function Vf(){var o,r;const t=g.useContext(Me.IOConnectContext),{settings:n}=Ne(),e=g.useCallback(async()=>{var c,l;const i=t.windows.my();if(!t||!i)return;const a=i.placementSettings;await i.place({...a,horizontalAlignment:((c=n.placement)==null?void 0:c.toasts)==="top-right"||((l=n.placement)==null?void 0:l.toasts)==="bottom-right"?"right":"left"})},[t,(o=n.placement)==null?void 0:o.toasts]);g.useEffect(()=>{var i;t&&((i=n.placement)!=null&&i.toasts)&&e().catch(console.error)},[t,e,(r=n.placement)==null?void 0:r.toasts])}function S0({className:t,maxToasts:n=10,...e}){var u,f,d,p,h,m,v,y;const{Header:o,Body:r,Footer:i}=Uf(),{notifications:a,settings:c}=Ne(),l=ee("io-toasts",(((u=c.placement)==null?void 0:u.toasts)==="top-left"||((f=c.placement)==null?void 0:f.toasts)==="top-right")&&"io-toasts-top",(((d=c.placement)==null?void 0:d.toasts)==="top-right"||((p=c.placement)==null?void 0:p.toasts)==="bottom-right")&&"io-toasts-right",(((h=c.placement)==null?void 0:h.toasts)==="bottom-left"||((m=c.placement)==null?void 0:m.toasts)==="bottom-right")&&"io-toasts-bottom",(((v=c.placement)==null?void 0:v.toasts)==="top-left"||((y=c.placement)==null?void 0:y.toasts)==="bottom-left")&&"io-toasts-left",t);return Vf(),s.jsxs("div",{className:l,...e,children:[o&&s.jsx(o,{}),s.jsx(r,{notifications:a,maxToasts:n}),i&&s.jsx(i,{})]})}zf.displayName="ComponentsStoreProvider";var Ps=Object.freeze({__proto__:null,Notification:Ti,NotificationBody:Of,NotificationBodyDescription:Pf,NotificationBodyIcon:Nf,NotificationBodyTitle:If,NotificationFooter:Af,NotificationFooterButton:Tf,NotificationHeader:wf,NotificationHeaderBadge:xf,NotificationHeaderButtonClose:jf,NotificationHeaderButtonSnooze:Ef,NotificationHeaderCount:bf,NotificationHeaderIcon:Cf,NotificationHeaderTimestamp:Sf,NotificationHeaderTitle:kf,NotificationStack:Lf,NotificationsList:Is,NotificationsPanelProvider:({children:t})=>{const{searchQuery:n,setSearch:e,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:c,isBulkActionsVisible:l,showBulkActions:u,hideBulkActions:f}=function(){const p=g.useContext(Me.IOConnectContext),[h,m]=g.useState(!1),[v,y]=g.useState("newest"),[k,S]=g.useState("all"),[b,w]=g.useState(""),[E,O]=g.useState(!1),F=We(),{isBulkActionsSupported:R}=Ne();return g.useEffect(()=>{const U=tt.onPanelVisibilityChanged(K=>m(K));return()=>{U()}},[]),g.useEffect(()=>{F!==null&&F&&(async()=>{const U=await p.notifications.panel.isVisible();m(U)})()},[p.notifications.panel,F]),g.useEffect(()=>{h||(O(!1),S("all"))},[h]),{isPanelVisible:h,sortNotificationsBy:v,setSortBy:U=>{y(U)},viewNotificationsBy:k,setViewBy:U=>{S(U)},searchQuery:b,setSearch:U=>{w(U)},isBulkActionsVisible:E,showBulkActions:()=>{R&&O(!0)},hideBulkActions:()=>{R&&O(!1)}}}(),d=g.useMemo(()=>({searchQuery:n,setSearch:e,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:c,isBulkActionsVisible:l,showBulkActions:u,hideBulkActions:f}),[n,e,o,r,i,a,c,l,u,f]);return s.jsx(sf.Provider,{value:d,children:t})},NotificationsProvider:({children:t})=>{const{notifications:n,notificationStacks:e,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:c,allowedApplications:l,clearAll:u,clearAllOld:f,close:d,hidePanel:p,showPanel:h,saveSetting:m,saveFilter:v,saveAllFilter:y,isBulkActionsSupported:k,selectedNotifications:S,selectNotification:b,selectAllNotifications:w,clearMany:E,snooze:O,snoozeMany:F,setState:R,setStates:U,setCount:K}=f0(),_=g.useMemo(()=>({notifications:n,notificationStacks:e,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:c,allowedApplications:l,clearAll:u,clearAllOld:f,onClose:d,hidePanel:p,showPanel:h,saveSetting:m,saveFilter:v,saveAllFilter:y,isBulkActionsSupported:k,selectedNotifications:S,selectNotification:b,selectAllNotifications:w,clearMany:E,snooze:O,snoozeMany:F,setState:R,setStates:U,setCount:K}),[n,e,o,r,i,a,c,l,u,f,d,p,h,m,v,y,k,S,b,w,E,O,F,R,U,K]);return s.jsx(Rd.Provider,{value:_,children:t})},Panel:function({components:t,settings:n,...e}){return s.jsx(js,{components:n,children:s.jsx(Bf,{components:t,children:s.jsx(k0,{...e})})})},PanelBody:hf,PanelFooter:mf,PanelFooterButtonClearAll:vf,PanelFooterButtonClearAllOld:yf,PanelFooterButtons:gf,PanelHeader:cf,PanelHeaderCaptionTitle:lf,SettingsAllowNotificationToasts:Bd,SettingsAllowNotifications:Fd,SettingsCloseNotificationOnClick:Wd,SettingsGeneral:Md,SettingsHideToastsAfter:zd,SettingsPanel:Os,SettingsPanelAutoHide:$d,SettingsPlacement:Yd,SettingsPlacementPanel:Kd,SettingsPlacementToasts:qd,SettingsShowNotificationBadge:Hd,SettingsSnooze:Jd,SettingsSnoozeDuration:Xd,SettingsStacking:Ud,SettingsSubscribeAll:ef,SettingsSubscribeApp:tf,SettingsSubscribeMuteAll:nf,SettingsSubscribeMuteApp:of,SettingsSubscriptions:Qd,SettingsToastStackBy:Gd,SettingsToastStacking:Vd,Toasts:function({components:t,...n}){return s.jsx(zf,{components:t,children:s.jsx(S0,{...n})})},useAddRemoveApps:Es,useHidePanelOnFocusLost:function(t=!0){const n=g.useContext(Me.IOConnectContext),e=We();return g.useEffect(()=>{var r;if(!n||!t||e===null||!e)return;const o=(r=n.windows.my())==null?void 0:r.onFocusChanged(i=>{i.isFocused||n.notifications.panel.hide().catch(a=>{console.error("Error hiding panel:",a)})});return()=>o==null?void 0:o()},[n,e,t]),n},useHidePanelOnKeyUp:function(t="Escape"){const{hidePanel:n}=Ne();og(t,n)},useNotificationStacking:_d,useNotificationsContext:Ne,useNotificationsPanelContext:Et,usePanelWindowPlacement:Hf,useSelectNotifications:Ld,useShowHidePanelWindow:function(t=!0){const n=g.useContext(Me.IOConnectContext),e=n==null?void 0:n.windows.my(),o=We(),{isPanelVisible:r}=Et();return g.useEffect(()=>{n&&e&&o&&(r?e.show().then(()=>{t&&e.focus().catch(i=>{console.error("Error focusing window:",i)})}).catch(i=>console.error("Error showing window:",i)):e.hide().catch(i=>console.error("Error hiding window:",i)))},[n,e,o,r,t]),{myWindow:e}},useToastsWindowPlacement:Vf});const E0=t=>{const{General:n,Layouts:e,Downloads:o,System:r}=_o();return s.jsxs(Oo,{...t,children:[s.jsx(n,{}),s.jsx(e,{}),s.jsx(o,{}),s.jsx(r,{})]})},j0=({title:t="General",...n})=>{const{Theme:e,PinnedPosition:o,MinimizeToTray:r,ShowTutorialOnStartup:i}=_o();return s.jsxs(Ke,{title:t,...n,children:[s.jsx(e,{}),s.jsx(o,{}),s.jsx(r,{}),s.jsx(i,{})]})},nl=(t="dark")=>{switch(t){case"dark":return"Dark";case"light":return"Light";default:return t}},As=({className:t,title:n="Theme",...e})=>{const{currentTheme:o,selectTheme:r}=(()=>{const a=g.useContext(Me.IOConnectContext),[c,l]=g.useState(null),u=g.useCallback(f=>{var d;return(d=a==null?void 0:a.themes)==null?void 0:d.select(f)},[a]);return g.useEffect(()=>{var p,h;if(!a)return;let f=!1;const d=m=>{f||l(m)};return(p=a.themes)==null||p.onChanged(d),(h=a.themes)==null||h.getCurrent().then(d).catch(console.warn),()=>{f=!0}},[a]),{currentTheme:c,selectTheme:u}})(),i=(()=>{const a=g.useContext(Me.IOConnectContext),[c,l]=g.useState([]);return g.useEffect(()=>{var u;a&&((u=a.themes)==null||u.list().then(l).catch(console.warn))},[a]),c})();return s.jsxs("div",{className:ee("flex jc-between ai-center",t),"data-testid":"theme-container",...e,children:[s.jsx("label",{className:"io-text-clipper","data-testid":"theme-label",children:n}),s.jsxs(fe,{variant:"light","data-testid":"theme-dropdown",children:[s.jsx(fe.Button,{text:nl(o==null?void 0:o.name),"data-testid":"theme-dropdown-button"}),s.jsx(fe.Content,{"data-testid":"theme-dropdown-content",children:s.jsx(fe.List,{children:i.map(({name:a})=>s.jsx(fe.Item,{onClick:()=>r(a),"data-testid":`theme-dropdown-item-${a}`,children:nl(a)},a))})})]})]})},O0=({prefKey:t,options:n,disabled:e,...o})=>{const{isLoading:r,value:i="Select option",update:a}=Wt({prefKey:t});return s.jsxs(fe,{variant:"light",disabled:r||e,...o,children:[s.jsx(fe.Button,{children:i}),s.jsx(fe.Content,{children:s.jsx(fe.List,{children:n.map(c=>s.jsx(fe.Item,{onClick:()=>(async l=>{if(l!==i)try{await a(l)}catch(u){console.error("Failed to update platform preference:",u)}})(c),children:c},c))})})]})},N0=({className:t,label:n="Pinned position",...e})=>s.jsx(Ke,{className:ee("io-block-list-gap",t),...e,children:s.jsxs("div",{className:"flex jc-between ai-center",children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsx(O0,{className:t,prefKey:zu,options:["Left","Right"],...e})]})}),yn=({prefKey:t,...n})=>{const{isLoading:e,value:o=!1,update:r}=Wt({prefKey:t});return s.jsx(ft,{checked:o,disabled:e,onChange:i=>r(i.target.checked),...n})},I0=({align:t="right",label:n="Allow docking",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Uu,...e}),P0=({align:t="right",label:n="Minimize to tray",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Vu,...e}),A0=({align:t="right",label:n="Auto-close on starting apps and workspaces",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Gu,disabled:!0,...e}),T0=({align:t="right",label:n="Show tutorial on startup",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Yu,...e}),D0=({title:t="Layouts",...n})=>{const{LayoutsSaveCurrentOnExit:e,LayoutsShowDeletePrompt:o,LayoutsShowUnsavedChangesPrompt:r}=_o();return s.jsxs(Ke,{title:t,...n,children:[s.jsx(e,{}),s.jsx(r,{}),s.jsx(o,{})]})},M0=({align:t="right",label:n="Restore last saved on startup",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Zu,...e}),_0=({align:t="right",label:n="Save current on exit",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Ku,...e}),Ts=({align:t="right",label:n="Show prompt for unsaved changes",...e})=>s.jsx(yn,{align:t,label:n,prefKey:qu,"data-testid":"layouts-show-unsaved-changes-prompt-toggle-button",...e}),Ds=({align:t="right",label:n="Show prompt for deleting",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Ju,"data-testid":"layouts-show-delete-prompt-toggle",...e}),L0=({className:t,title:n="Downloads",...e})=>{const{DownloadsLocation:o}=_o();return s.jsx(Ke,{className:ee("io-block-list-gap",t),title:n,...e,children:s.jsx(o,{})})},R0=({align:t="right",label:n="Ask where to save each file before downloading",...e})=>s.jsx(yn,{align:t,label:n,prefKey:Xu,...e}),F0=({className:t,label:n="Location",...e})=>{const{configuration:{downloadFolder:o},setDownloadLocationWithDialog:r,isDownloadLocationDialogVisible:i,downloadLocationList:a}=vn();return s.jsxs(Ke,{className:ee("io-preferences-download-section",t),...e,children:[s.jsxs("div",{className:"flex jc-between ai-center",children:[s.jsx("label",{className:"io-text-clipper",children:n}),s.jsx(Ye,{text:"Change",onClick:r,disabled:i})]}),s.jsx("p",{children:o??(a==null?void 0:a[0])??"Not set"})]})},B0=({className:t,title:n="System",...e})=>{const{SystemRestartSection:o,SystemShutdownSection:r}=_o();return s.jsxs(Ke,{className:ee("io-block-list-gap",t),title:n,...e,children:[s.jsx(o,{}),s.jsx(r,{})]})};var aa=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Co={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return typeof console<"u"&&console.warn(t)},getWeek:function(t){var n=new Date(t.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var e=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},fr={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var n=t%100;if(n>3&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Tt=function(t,n){return n===void 0&&(n=2),("000"+t).slice(-1*n)},Vt=function(t){return t===!0?1:0};function ol(t,n){var e;return function(){var o=this,r=arguments;clearTimeout(e),e=setTimeout(function(){return t.apply(o,r)},n)}}var sa=function(t){return t instanceof Array?t:[t]};function Ot(t,n,e){if(e===!0)return t.classList.add(n);t.classList.remove(n)}function He(t,n,e){var o=window.document.createElement(t);return n=n||"",e=e||"",o.className=n,e!==void 0&&(o.textContent=e),o}function Mr(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Gf(t,n){return n(t)?t:t.parentNode?Gf(t.parentNode,n):void 0}function _r(t,n){var e=He("div","numInputWrapper"),o=He("input","numInput "+t),r=He("span","arrowUp"),i=He("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?o.type="number":(o.type="text",o.pattern="\\d*"),n!==void 0)for(var a in n)o.setAttribute(a,n[a]);return e.appendChild(o),e.appendChild(r),e.appendChild(i),e}function Rt(t){try{return typeof t.composedPath=="function"?t.composedPath()[0]:t.target}catch{return t.target}}var ca=function(){},si=function(t,n,e){return e.months[n?"shorthand":"longhand"][t]},H0={D:ca,F:function(t,n,e){t.setMonth(e.months.longhand.indexOf(n))},G:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},H:function(t,n){t.setHours(parseFloat(n))},J:function(t,n){t.setDate(parseFloat(n))},K:function(t,n,e){t.setHours(t.getHours()%12+12*Vt(new RegExp(e.amPM[1],"i").test(n)))},M:function(t,n,e){t.setMonth(e.months.shorthand.indexOf(n))},S:function(t,n){t.setSeconds(parseFloat(n))},U:function(t,n){return new Date(1e3*parseFloat(n))},W:function(t,n,e){var o=parseInt(n),r=new Date(t.getFullYear(),0,2+7*(o-1),0,0,0,0);return r.setDate(r.getDate()-r.getDay()+e.firstDayOfWeek),r},Y:function(t,n){t.setFullYear(parseFloat(n))},Z:function(t,n){return new Date(n)},d:function(t,n){t.setDate(parseFloat(n))},h:function(t,n){t.setHours((t.getHours()>=12?12:0)+parseFloat(n))},i:function(t,n){t.setMinutes(parseFloat(n))},j:function(t,n){t.setDate(parseFloat(n))},l:ca,m:function(t,n){t.setMonth(parseFloat(n)-1)},n:function(t,n){t.setMonth(parseFloat(n)-1)},s:function(t,n){t.setSeconds(parseFloat(n))},u:function(t,n){return new Date(parseFloat(n))},w:ca,y:function(t,n){t.setFullYear(2e3+parseFloat(n))}},Gn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},rr={Z:function(t){return t.toISOString()},D:function(t,n,e){return n.weekdays.shorthand[rr.w(t,n,e)]},F:function(t,n,e){return si(rr.n(t,n,e)-1,!1,n)},G:function(t,n,e){return Tt(rr.h(t,n,e))},H:function(t){return Tt(t.getHours())},J:function(t,n){return n.ordinal!==void 0?t.getDate()+n.ordinal(t.getDate()):t.getDate()},K:function(t,n){return n.amPM[Vt(t.getHours()>11)]},M:function(t,n){return si(t.getMonth(),!0,n)},S:function(t){return Tt(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,n,e){return e.getWeek(t)},Y:function(t){return Tt(t.getFullYear(),4)},d:function(t){return Tt(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return Tt(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,n){return n.weekdays.longhand[t.getDay()]},m:function(t){return Tt(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}},Yf=function(t){var n=t.config,e=n===void 0?Co:n,o=t.l10n,r=o===void 0?fr:o,i=t.isMobile,a=i!==void 0&&i;return function(c,l,u){var f=u||r;return e.formatDate===void 0||a?l.split("").map(function(d,p,h){return rr[d]&&h[p-1]!=="\\"?rr[d](c,f,e):d!=="\\"?d:""}).join(""):e.formatDate(c,l,f)}},Za=function(t){var n=t.config,e=n===void 0?Co:n,o=t.l10n,r=o===void 0?fr:o;return function(i,a,c,l){if(i===0||i){var u,f=l||r,d=i;if(i instanceof Date)u=new Date(i.getTime());else if(typeof i!="string"&&i.toFixed!==void 0)u=new Date(i);else if(typeof i=="string"){var p=a||(e||Co).dateFormat,h=String(i).trim();if(h==="today")u=new Date,c=!0;else if(e&&e.parseDate)u=e.parseDate(i,p);else if(/Z$/.test(h)||/GMT$/.test(h))u=new Date(i);else{for(var m=void 0,v=[],y=0,k=0,S="";y<p.length;y++){var b=p[y],w=b==="\\",E=p[y-1]==="\\"||w;if(Gn[b]&&!E){S+=Gn[b];var O=new RegExp(S).exec(i);O&&(m=!0)&&v[b!=="Y"?"push":"unshift"]({fn:H0[b],val:O[++k]})}else w||(S+=".")}u=e&&e.noCalendar?new Date(new Date().setHours(0,0,0,0)):new Date(new Date().getFullYear(),0,1,0,0,0,0),v.forEach(function(F){var R=F.fn,U=F.val;return u=R(u,U,f)||u}),u=m?u:void 0}}if(u instanceof Date&&!isNaN(u.getTime()))return c===!0&&u.setHours(0,0,0,0),u;e.errorHandler(new Error("Invalid date provided: "+d))}}};function Ft(t,n,e){return e===void 0&&(e=!0),e!==!1?new Date(t.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):t.getTime()-n.getTime()}var la=function(t,n,e){return 3600*t+60*n+e},W0=864e5;function ua(t){var n=t.defaultHour,e=t.defaultMinute,o=t.defaultSeconds;if(t.minDate!==void 0){var r=t.minDate.getHours(),i=t.minDate.getMinutes(),a=t.minDate.getSeconds();n<r&&(n=r),n===r&&e<i&&(e=i),n===r&&e===i&&o<a&&(o=t.minDate.getSeconds())}if(t.maxDate!==void 0){var c=t.maxDate.getHours(),l=t.maxDate.getMinutes();(n=Math.min(n,c))===c&&(e=Math.min(l,e)),n===c&&e===l&&(o=t.maxDate.getSeconds())}return{hours:n,minutes:e,seconds:o}}typeof Object.assign!="function"&&(Object.assign=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];if(!t)throw TypeError("Cannot convert undefined or null to object");for(var o=function(a){a&&Object.keys(a).forEach(function(c){return t[c]=a[c]})},r=0,i=n;r<i.length;r++)o(i[r]);return t});var Ct=function(){return Ct=Object.assign||function(t){for(var n,e=1,o=arguments.length;e<o;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t},Ct.apply(this,arguments)},rl=function(){for(var t=0,n=0,e=arguments.length;n<e;n++)t+=arguments[n].length;var o=Array(t),r=0;for(n=0;n<e;n++)for(var i=arguments[n],a=0,c=i.length;a<c;a++,r++)o[r]=i[a];return o};function $0(t,n){var e={config:Ct(Ct({},Co),nt.defaultConfig),l10n:fr};function o(){var C;return((C=e.calendarContainer)===null||C===void 0?void 0:C.getRootNode()).activeElement||document.activeElement}function r(C){return C.bind(e)}function i(){var C=e.config;C.weekNumbers===!1&&C.showMonths===1||C.noCalendar!==!0&&window.requestAnimationFrame(function(){if(e.calendarContainer!==void 0&&(e.calendarContainer.style.visibility="hidden",e.calendarContainer.style.display="block"),e.daysContainer!==void 0){var x=(e.days.offsetWidth+1)*C.showMonths;e.daysContainer.style.width=x+"px",e.calendarContainer.style.width=x+(e.weekWrapper!==void 0?e.weekWrapper.offsetWidth:0)+"px",e.calendarContainer.style.removeProperty("visibility"),e.calendarContainer.style.removeProperty("display")}})}function a(C){if(e.selectedDates.length===0){var x=e.config.minDate===void 0||Ft(new Date,e.config.minDate)>=0?new Date:new Date(e.config.minDate.getTime()),j=ua(e.config);x.setHours(j.hours,j.minutes,j.seconds,x.getMilliseconds()),e.selectedDates=[x],e.latestSelectedDateObj=x}C!==void 0&&C.type!=="blur"&&function(L){L.preventDefault();var ne=L.type==="keydown",ve=Rt(L),$=ve;e.amPM!==void 0&&ve===e.amPM&&(e.amPM.textContent=e.l10n.amPM[Vt(e.amPM.textContent===e.l10n.amPM[0])]);var V=parseFloat($.getAttribute("min")),z=parseFloat($.getAttribute("max")),te=parseFloat($.getAttribute("step")),le=parseInt($.value,10),ge=L.delta||(ne?L.which===38?1:-1:0),se=le+te*ge;if($.value!==void 0&&$.value.length===2){var G=$===e.hourElement,Se=$===e.minuteElement;se<V?(se=z+se+Vt(!G)+(Vt(G)&&Vt(!e.amPM)),Se&&v(void 0,-1,e.hourElement)):se>z&&(se=$===e.hourElement?se-z-Vt(!e.amPM):V,Se&&v(void 0,1,e.hourElement)),e.amPM&&G&&(te===1?se+le===23:Math.abs(se-le)>te)&&(e.amPM.textContent=e.l10n.amPM[Vt(e.amPM.textContent===e.l10n.amPM[0])]),$.value=Tt(se)}}(C);var N=e._input.value;c(),Te(),e._input.value!==N&&e._debouncedChange()}function c(){if(e.hourElement!==void 0&&e.minuteElement!==void 0){var C,x,j=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,N=(parseInt(e.minuteElement.value,10)||0)%60,L=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(C=j,x=e.amPM.textContent,j=C%12+12*Vt(x===e.l10n.amPM[1]));var ne=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&Ft(e.latestSelectedDateObj,e.config.minDate,!0)===0,ve=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&Ft(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var $=la(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),V=la(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),z=la(j,N,L);if(z>V&&z<$){var te=function(se){var G=Math.floor(se/3600),Se=(se-3600*G)/60;return[G,Se,se-3600*G-60*Se]}($);j=te[0],N=te[1],L=te[2]}}else{if(ve){var le=e.config.maxTime!==void 0?e.config.maxTime:e.config.maxDate;(j=Math.min(j,le.getHours()))===le.getHours()&&(N=Math.min(N,le.getMinutes())),N===le.getMinutes()&&(L=Math.min(L,le.getSeconds()))}if(ne){var ge=e.config.minTime!==void 0?e.config.minTime:e.config.minDate;(j=Math.max(j,ge.getHours()))===ge.getHours()&&N<ge.getMinutes()&&(N=ge.getMinutes()),N===ge.getMinutes()&&(L=Math.max(L,ge.getSeconds()))}}u(j,N,L)}}function l(C){var x=C||e.latestSelectedDateObj;x&&x instanceof Date&&u(x.getHours(),x.getMinutes(),x.getSeconds())}function u(C,x,j){e.latestSelectedDateObj!==void 0&&e.latestSelectedDateObj.setHours(C%24,x,j||0,0),e.hourElement&&e.minuteElement&&!e.isMobile&&(e.hourElement.value=Tt(e.config.time_24hr?C:(12+C)%12+12*Vt(C%12==0)),e.minuteElement.value=Tt(x),e.amPM!==void 0&&(e.amPM.textContent=e.l10n.amPM[Vt(C>=12)]),e.secondElement!==void 0&&(e.secondElement.value=Tt(j)))}function f(C){var x=Rt(C),j=parseInt(x.value)+(C.delta||0);(j/1e3>1||C.key==="Enter"&&!/[^\d]/.test(j.toString()))&&de(j)}function d(C,x,j,N){return x instanceof Array?x.forEach(function(L){return d(C,L,j,N)}):C instanceof Array?C.forEach(function(L){return d(L,x,j,N)}):(C.addEventListener(x,j,N),void e._handlers.push({remove:function(){return C.removeEventListener(x,j,N)}}))}function p(){I("onChange")}function h(C,x){var j=C!==void 0?e.parseDate(C):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate<e.now?e.config.maxDate:e.now),N=e.currentYear,L=e.currentMonth;try{j!==void 0&&(e.currentYear=j.getFullYear(),e.currentMonth=j.getMonth())}catch(ne){ne.message="Invalid date supplied: "+j,e.config.errorHandler(ne)}x&&e.currentYear!==N&&(I("onYearChange"),O()),!x||e.currentYear===N&&e.currentMonth===L||I("onMonthChange"),e.redraw()}function m(C){var x=Rt(C);~x.className.indexOf("arrow")&&v(C,x.classList.contains("arrowUp")?1:-1)}function v(C,x,j){var N=C&&Rt(C),L=j||N&&N.parentNode&&N.parentNode.firstChild,ne=Ce("increment");ne.delta=x,L&&L.dispatchEvent(ne)}function y(C,x,j,N){var L=re(x,!0),ne=He("span",C,x.getDate().toString());return ne.dateObj=x,ne.$i=N,ne.setAttribute("aria-label",e.formatDate(x,e.config.ariaDateFormat)),C.indexOf("hidden")===-1&&Ft(x,e.now)===0&&(e.todayDateElem=ne,ne.classList.add("today"),ne.setAttribute("aria-current","date")),L?(ne.tabIndex=-1,ke(x)&&(ne.classList.add("selected"),e.selectedDateElem=ne,e.config.mode==="range"&&(Ot(ne,"startRange",e.selectedDates[0]&&Ft(x,e.selectedDates[0],!0)===0),Ot(ne,"endRange",e.selectedDates[1]&&Ft(x,e.selectedDates[1],!0)===0),C==="nextMonthDay"&&ne.classList.add("inRange")))):ne.classList.add("flatpickr-disabled"),e.config.mode==="range"&&function(ve){return!(e.config.mode!=="range"||e.selectedDates.length<2)&&Ft(ve,e.selectedDates[0])>=0&&Ft(ve,e.selectedDates[1])<=0}(x)&&!ke(x)&&ne.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&C!=="prevMonthDay"&&N%7==6&&e.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+e.config.getWeek(x)+"</span>"),I("onDayCreate",ne),ne}function k(C){C.focus(),e.config.mode==="range"&&ae(C)}function S(C){for(var x=C>0?0:e.config.showMonths-1,j=C>0?e.config.showMonths:-1,N=x;N!=j;N+=C)for(var L=e.daysContainer.children[N],ne=C>0?0:L.children.length-1,ve=C>0?L.children.length:-1,$=ne;$!=ve;$+=C){var V=L.children[$];if(V.className.indexOf("hidden")===-1&&re(V.dateObj))return V}}function b(C,x){var j=o(),N=ye(j||document.body),L=C!==void 0?C:N?j:e.selectedDateElem!==void 0&&ye(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&ye(e.todayDateElem)?e.todayDateElem:S(x>0?1:-1);L===void 0?e._input.focus():N?function(ne,ve){for(var $=ne.className.indexOf("Month")===-1?ne.dateObj.getMonth():e.currentMonth,V=ve>0?e.config.showMonths:-1,z=ve>0?1:-1,te=$-e.currentMonth;te!=V;te+=z)for(var le=e.daysContainer.children[te],ge=$-e.currentMonth===te?ne.$i+ve:ve<0?le.children.length-1:0,se=le.children.length,G=ge;G>=0&&G<se&&G!=(ve>0?se:-1);G+=z){var Se=le.children[G];if(Se.className.indexOf("hidden")===-1&&re(Se.dateObj)&&Math.abs(ne.$i-G)>=Math.abs(ve))return k(Se)}e.changeMonth(z),b(S(z),0)}(L,x):k(L)}function w(C,x){for(var j=(new Date(C,x,1).getDay()-e.l10n.firstDayOfWeek+7)%7,N=e.utils.getDaysInMonth((x-1+12)%12,C),L=e.utils.getDaysInMonth(x,C),ne=window.document.createDocumentFragment(),ve=e.config.showMonths>1,$=ve?"prevMonthDay hidden":"prevMonthDay",V=ve?"nextMonthDay hidden":"nextMonthDay",z=N+1-j,te=0;z<=N;z++,te++)ne.appendChild(y("flatpickr-day "+$,new Date(C,x-1,z),0,te));for(z=1;z<=L;z++,te++)ne.appendChild(y("flatpickr-day",new Date(C,x,z),0,te));for(var le=L+1;le<=42-j&&(e.config.showMonths===1||te%7!=0);le++,te++)ne.appendChild(y("flatpickr-day "+V,new Date(C,x+1,le%L),0,te));var ge=He("div","dayContainer");return ge.appendChild(ne),ge}function E(){if(e.daysContainer!==void 0){Mr(e.daysContainer),e.weekNumbers&&Mr(e.weekNumbers);for(var C=document.createDocumentFragment(),x=0;x<e.config.showMonths;x++){var j=new Date(e.currentYear,e.currentMonth,1);j.setMonth(e.currentMonth+x),C.appendChild(w(j.getFullYear(),j.getMonth()))}e.daysContainer.appendChild(C),e.days=e.daysContainer.firstChild,e.config.mode==="range"&&e.selectedDates.length===1&&ae()}}function O(){if(!(e.config.showMonths>1||e.config.monthSelectorType!=="dropdown")){var C=function(N){return!(e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&N<e.config.minDate.getMonth())&&!(e.config.maxDate!==void 0&&e.currentYear===e.config.maxDate.getFullYear()&&N>e.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var x=0;x<12;x++)if(C(x)){var j=He("option","flatpickr-monthDropdown-month");j.value=new Date(e.currentYear,x).getMonth().toString(),j.textContent=si(x,e.config.shorthandCurrentMonth,e.l10n),j.tabIndex=-1,e.currentMonth===x&&(j.selected=!0),e.monthsDropdownContainer.appendChild(j)}}}function F(){var C,x=He("div","flatpickr-month"),j=window.document.createDocumentFragment();e.config.showMonths>1||e.config.monthSelectorType==="static"?C=He("span","cur-month"):(e.monthsDropdownContainer=He("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),d(e.monthsDropdownContainer,"change",function(ve){var $=Rt(ve),V=parseInt($.value,10);e.changeMonth(V-e.currentMonth),I("onMonthChange")}),O(),C=e.monthsDropdownContainer);var N=_r("cur-year",{tabindex:"-1"}),L=N.getElementsByTagName("input")[0];L.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&L.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(L.setAttribute("max",e.config.maxDate.getFullYear().toString()),L.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var ne=He("div","flatpickr-current-month");return ne.appendChild(C),ne.appendChild(N),j.appendChild(ne),x.appendChild(j),{container:x,yearElement:L,monthElement:C}}function R(){Mr(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var C=e.config.showMonths;C--;){var x=F();e.yearElements.push(x.yearElement),e.monthElements.push(x.monthElement),e.monthNav.appendChild(x.container)}e.monthNav.appendChild(e.nextMonthNav)}function U(){e.weekdayContainer?Mr(e.weekdayContainer):e.weekdayContainer=He("div","flatpickr-weekdays");for(var C=e.config.showMonths;C--;){var x=He("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(x)}return K(),e.weekdayContainer}function K(){if(e.weekdayContainer){var C=e.l10n.firstDayOfWeek,x=rl(e.l10n.weekdays.shorthand);C>0&&C<x.length&&(x=rl(x.splice(C,x.length),x.splice(0,C)));for(var j=e.config.showMonths;j--;)e.weekdayContainer.children[j].innerHTML=`
9
9
  <span class='flatpickr-weekday'>
10
10
  `+x.join("</span><span class='flatpickr-weekday'>")+`
11
11
  </span>
@@ -32,7 +32,7 @@ Valid keys: `+JSON.stringify(Object.keys(B),null," "));var I=oe(W,ie,H,P,T+"."+
32
32
  Copyright (c) 2018 Jed Watson.
33
33
  Licensed under the MIT License (MIT), see
34
34
  http://jedwatson.github.io/classnames
35
- */(function(t){(function(){var n={}.hasOwnProperty;function e(){for(var i="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(i=r(i,o(c)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return e.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var c in i)n.call(i,c)&&i[c]&&(a=r(a,c));return a}function r(i,a){return a?i?i+" "+a:i+a:i}t.exports?(e.default=e,t.exports=e):window.classNames=e})()})(Ep);var Nv=Ep.exports;const et=_i(Nv);function Xa(t){"@babel/helpers - typeof";return Xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Xa(t)}var Iv;function Li(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Iv;return n?t.split(" ").map(function(e){return n[e]||e}).join(" "):t}function Pv(t,n){var e={};return Object.keys(t).forEach(function(o){n.indexOf(o)===-1&&(e[o]=t[o])}),e}function Av(t,n){for(var e=Array.isArray(n)?n:[n],o=e.length,r,i={};o>0;)o-=1,r=e[o],i[r]=t[r];return i}var Tv=(typeof window>"u"?"undefined":Xa(window))==="object"&&window.Element||function(){};function Dv(t,n,e){if(!(t[n]instanceof Tv))return new Error("Invalid prop `"+n+"` supplied to `"+e+"`. Expected prop to be an instance of Element. Validation failed.")}Q.oneOfType([Q.string,Q.func,Dv,Q.shape({current:Q.any})]);var Rs=Q.oneOfType([Q.func,Q.string,Q.shape({$$typeof:Q.symbol,render:Q.func}),Q.arrayOf(Q.oneOfType([Q.func,Q.string,Q.shape({$$typeof:Q.symbol,render:Q.func})]))]),Mv={Fade:150,Collapse:350,Modal:300,Carousel:600,Offcanvas:300},gl=["in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],Fr={ENTERING:"entering",ENTERED:"entered",EXITING:"exiting",EXITED:"exited"},_v=["className","cssModule","variant","innerRef"];function Qa(){return Qa=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Qa.apply(this,arguments)}function vl(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function Lv(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?vl(Object(e),!0).forEach(function(o){Rv(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):vl(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function Rv(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Fv(t,n){if(t==null)return{};var e=Bv(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function Bv(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var Hv={active:Q.bool,"aria-label":Q.string,onClick:Q.func,variant:Q.oneOf(["white"]),className:Q.string,cssModule:Q.object,innerRef:Q.oneOfType([Q.object,Q.string,Q.func])};function jp(t){var n=t.className;t.cssModule;var e=t.variant,o=t.innerRef,r=Fv(t,_v),i=Li(et(n,"btn-close",e&&"btn-close-".concat(e)));return g.createElement("button",Qa({ref:o,type:"button",className:i},Lv({"aria-label":"close"},r)))}jp.propTypes=Hv;var Wv=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"];function es(){return es=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},es.apply(this,arguments)}function $v(t,n){if(t==null)return{};var e=zv(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function zv(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var Uv={active:Q.bool,"aria-label":Q.string,block:Q.bool,children:Q.node,className:Q.string,cssModule:Q.object,close:Q.bool,color:Q.string,disabled:Q.bool,innerRef:Q.oneOfType([Q.object,Q.func,Q.string]),onClick:Q.func,outline:Q.bool,size:Q.string,tag:Rs};function di(t){var n=g.useCallback(function(S){if(t.disabled){S.preventDefault();return}if(t.onClick)return t.onClick(S)},[t.onClick,t.disabled]),e=t.active,o=t["aria-label"],r=t.block,i=t.className,a=t.close,c=t.cssModule,l=t.color,u=l===void 0?"secondary":l,f=t.outline,d=t.size,p=t.tag,h=p===void 0?"button":p,m=t.innerRef,v=$v(t,Wv);if(a)return g.createElement(jp,v);var y="btn".concat(f?"-outline":"","-").concat(u),k=Li(et(i,"btn",y,d?"btn-".concat(d):!1,r?"d-block w-100":!1,{active:e,disabled:t.disabled}),c);return v.href&&h==="button"&&(h="a"),g.createElement(h,es({type:h==="button"&&v.onClick?"button":void 0},v,{className:k,ref:m,onClick:n,"aria-label":o}))}di.propTypes=Uv;var yl=function(n){return n.reduce(function(e,o){var r=o[0],i=o[1];return e[r]=i,e},{})},wl=typeof window<"u"&&window.document&&window.document.createElement?D.useLayoutEffect:D.useEffect,Mt="top",Zt="bottom",Kt="right",_t="left",Fs="auto",xr=[Mt,Zt,Kt,_t],No="start",hr="end",Vv="clippingParents",Op="viewport",Yo="popper",Gv="reference",bl=xr.reduce(function(t,n){return t.concat([n+"-"+No,n+"-"+hr])},[]),Np=[].concat(xr,[Fs]).reduce(function(t,n){return t.concat([n,n+"-"+No,n+"-"+hr])},[]),Yv="beforeRead",Zv="read",Kv="afterRead",qv="beforeMain",Jv="main",Xv="afterMain",Qv="beforeWrite",e1="write",t1="afterWrite",n1=[Yv,Zv,Kv,qv,Jv,Xv,Qv,e1,t1];function cn(t){return t?(t.nodeName||"").toLowerCase():null}function $t(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function io(t){var n=$t(t).Element;return t instanceof n||t instanceof Element}function Yt(t){var n=$t(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function Bs(t){if(typeof ShadowRoot>"u")return!1;var n=$t(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function o1(t){var n=t.state;Object.keys(n.elements).forEach(function(e){var o=n.styles[e]||{},r=n.attributes[e]||{},i=n.elements[e];!Yt(i)||!cn(i)||(Object.assign(i.style,o),Object.keys(r).forEach(function(a){var c=r[a];c===!1?i.removeAttribute(a):i.setAttribute(a,c===!0?"":c)}))})}function r1(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach(function(o){var r=n.elements[o],i=n.attributes[o]||{},a=Object.keys(n.styles.hasOwnProperty(o)?n.styles[o]:e[o]),c=a.reduce(function(l,u){return l[u]="",l},{});!Yt(r)||!cn(r)||(Object.assign(r.style,c),Object.keys(i).forEach(function(l){r.removeAttribute(l)}))})}}const i1={name:"applyStyles",enabled:!0,phase:"write",fn:o1,effect:r1,requires:["computeStyles"]};function an(t){return t.split("-")[0]}var Qn=Math.max,fi=Math.min,Io=Math.round;function ts(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function Ip(){return!/^((?!chrome|android).)*safari/i.test(ts())}function Po(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);var o=t.getBoundingClientRect(),r=1,i=1;n&&Yt(t)&&(r=t.offsetWidth>0&&Io(o.width)/t.offsetWidth||1,i=t.offsetHeight>0&&Io(o.height)/t.offsetHeight||1);var a=io(t)?$t(t):window,c=a.visualViewport,l=!Ip()&&e,u=(o.left+(l&&c?c.offsetLeft:0))/r,f=(o.top+(l&&c?c.offsetTop:0))/i,d=o.width/r,p=o.height/i;return{width:d,height:p,top:f,right:u+d,bottom:f+p,left:u,x:u,y:f}}function Hs(t){var n=Po(t),e=t.offsetWidth,o=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-o)<=1&&(o=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:o}}function Pp(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&Bs(e)){var o=n;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function gn(t){return $t(t).getComputedStyle(t)}function a1(t){return["table","td","th"].indexOf(cn(t))>=0}function Ln(t){return((io(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ri(t){return cn(t)==="html"?t:t.assignedSlot||t.parentNode||(Bs(t)?t.host:null)||Ln(t)}function xl(t){return!Yt(t)||gn(t).position==="fixed"?null:t.offsetParent}function s1(t){var n=/firefox/i.test(ts()),e=/Trident/i.test(ts());if(e&&Yt(t)){var o=gn(t);if(o.position==="fixed")return null}var r=Ri(t);for(Bs(r)&&(r=r.host);Yt(r)&&["html","body"].indexOf(cn(r))<0;){var i=gn(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||n&&i.willChange==="filter"||n&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function Cr(t){for(var n=$t(t),e=xl(t);e&&a1(e)&&gn(e).position==="static";)e=xl(e);return e&&(cn(e)==="html"||cn(e)==="body"&&gn(e).position==="static")?n:e||s1(t)||n}function Ws(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ar(t,n,e){return Qn(t,fi(n,e))}function c1(t,n,e){var o=ar(t,n,e);return o>e?e:o}function Ap(){return{top:0,right:0,bottom:0,left:0}}function Tp(t){return Object.assign({},Ap(),t)}function Dp(t,n){return n.reduce(function(e,o){return e[o]=t,e},{})}var l1=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,Tp(typeof n!="number"?n:Dp(n,xr))};function u1(t){var n,e=t.state,o=t.name,r=t.options,i=e.elements.arrow,a=e.modifiersData.popperOffsets,c=an(e.placement),l=Ws(c),u=[_t,Kt].indexOf(c)>=0,f=u?"height":"width";if(!(!i||!a)){var d=l1(r.padding,e),p=Hs(i),h=l==="y"?Mt:_t,m=l==="y"?Zt:Kt,v=e.rects.reference[f]+e.rects.reference[l]-a[l]-e.rects.popper[f],y=a[l]-e.rects.reference[l],k=Cr(i),S=k?l==="y"?k.clientHeight||0:k.clientWidth||0:0,b=v/2-y/2,w=d[h],E=S-p[f]-d[m],O=S/2-p[f]/2+b,F=ar(w,O,E),R=l;e.modifiersData[o]=(n={},n[R]=F,n.centerOffset=F-O,n)}}function d1(t){var n=t.state,e=t.options,o=e.element,r=o===void 0?"[data-popper-arrow]":o;r!=null&&(typeof r=="string"&&(r=n.elements.popper.querySelector(r),!r)||Pp(n.elements.popper,r)&&(n.elements.arrow=r))}const f1={name:"arrow",enabled:!0,phase:"main",fn:u1,effect:d1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ao(t){return t.split("-")[1]}var p1={top:"auto",right:"auto",bottom:"auto",left:"auto"};function h1(t,n){var e=t.x,o=t.y,r=n.devicePixelRatio||1;return{x:Io(e*r)/r||0,y:Io(o*r)/r||0}}function Cl(t){var n,e=t.popper,o=t.popperRect,r=t.placement,i=t.variation,a=t.offsets,c=t.position,l=t.gpuAcceleration,u=t.adaptive,f=t.roundOffsets,d=t.isFixed,p=a.x,h=p===void 0?0:p,m=a.y,v=m===void 0?0:m,y=typeof f=="function"?f({x:h,y:v}):{x:h,y:v};h=y.x,v=y.y;var k=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),b=_t,w=Mt,E=window;if(u){var O=Cr(e),F="clientHeight",R="clientWidth";if(O===$t(e)&&(O=Ln(e),gn(O).position!=="static"&&c==="absolute"&&(F="scrollHeight",R="scrollWidth")),O=O,r===Mt||(r===_t||r===Kt)&&i===hr){w=Zt;var U=d&&O===E&&E.visualViewport?E.visualViewport.height:O[F];v-=U-o.height,v*=l?1:-1}if(r===_t||(r===Mt||r===Zt)&&i===hr){b=Kt;var K=d&&O===E&&E.visualViewport?E.visualViewport.width:O[R];h-=K-o.width,h*=l?1:-1}}var _=Object.assign({position:c},u&&p1),A=f===!0?h1({x:h,y:v},$t(e)):{x:h,y:v};if(h=A.x,v=A.y,l){var me;return Object.assign({},_,(me={},me[w]=S?"0":"",me[b]=k?"0":"",me.transform=(E.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",me))}return Object.assign({},_,(n={},n[w]=S?v+"px":"",n[b]=k?h+"px":"",n.transform="",n))}function m1(t){var n=t.state,e=t.options,o=e.gpuAcceleration,r=o===void 0?!0:o,i=e.adaptive,a=i===void 0?!0:i,c=e.roundOffsets,l=c===void 0?!0:c,u={placement:an(n.placement),variation:Ao(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:r,isFixed:n.options.strategy==="fixed"};n.modifiersData.popperOffsets!=null&&(n.styles.popper=Object.assign({},n.styles.popper,Cl(Object.assign({},u,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:l})))),n.modifiersData.arrow!=null&&(n.styles.arrow=Object.assign({},n.styles.arrow,Cl(Object.assign({},u,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})}const g1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:m1,data:{}};var Br={passive:!0};function v1(t){var n=t.state,e=t.instance,o=t.options,r=o.scroll,i=r===void 0?!0:r,a=o.resize,c=a===void 0?!0:a,l=$t(n.elements.popper),u=[].concat(n.scrollParents.reference,n.scrollParents.popper);return i&&u.forEach(function(f){f.addEventListener("scroll",e.update,Br)}),c&&l.addEventListener("resize",e.update,Br),function(){i&&u.forEach(function(f){f.removeEventListener("scroll",e.update,Br)}),c&&l.removeEventListener("resize",e.update,Br)}}const y1={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:v1,data:{}};var w1={left:"right",right:"left",bottom:"top",top:"bottom"};function Yr(t){return t.replace(/left|right|bottom|top/g,function(n){return w1[n]})}var b1={start:"end",end:"start"};function kl(t){return t.replace(/start|end/g,function(n){return b1[n]})}function $s(t){var n=$t(t),e=n.pageXOffset,o=n.pageYOffset;return{scrollLeft:e,scrollTop:o}}function zs(t){return Po(Ln(t)).left+$s(t).scrollLeft}function x1(t,n){var e=$t(t),o=Ln(t),r=e.visualViewport,i=o.clientWidth,a=o.clientHeight,c=0,l=0;if(r){i=r.width,a=r.height;var u=Ip();(u||!u&&n==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:c+zs(t),y:l}}function C1(t){var n,e=Ln(t),o=$s(t),r=(n=t.ownerDocument)==null?void 0:n.body,i=Qn(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Qn(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),c=-o.scrollLeft+zs(t),l=-o.scrollTop;return gn(r||e).direction==="rtl"&&(c+=Qn(e.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:c,y:l}}function Us(t){var n=gn(t),e=n.overflow,o=n.overflowX,r=n.overflowY;return/auto|scroll|overlay|hidden/.test(e+r+o)}function Mp(t){return["html","body","#document"].indexOf(cn(t))>=0?t.ownerDocument.body:Yt(t)&&Us(t)?t:Mp(Ri(t))}function sr(t,n){var e;n===void 0&&(n=[]);var o=Mp(t),r=o===((e=t.ownerDocument)==null?void 0:e.body),i=$t(o),a=r?[i].concat(i.visualViewport||[],Us(o)?o:[]):o,c=n.concat(a);return r?c:c.concat(sr(Ri(a)))}function ns(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function k1(t,n){var e=Po(t,!1,n==="fixed");return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function Sl(t,n,e){return n===Op?ns(x1(t,e)):io(n)?k1(n,e):ns(C1(Ln(t)))}function S1(t){var n=sr(Ri(t)),e=["absolute","fixed"].indexOf(gn(t).position)>=0,o=e&&Yt(t)?Cr(t):t;return io(o)?n.filter(function(r){return io(r)&&Pp(r,o)&&cn(r)!=="body"}):[]}function E1(t,n,e,o){var r=n==="clippingParents"?S1(t):[].concat(n),i=[].concat(r,[e]),a=i[0],c=i.reduce(function(l,u){var f=Sl(t,u,o);return l.top=Qn(f.top,l.top),l.right=fi(f.right,l.right),l.bottom=fi(f.bottom,l.bottom),l.left=Qn(f.left,l.left),l},Sl(t,a,o));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function _p(t){var n=t.reference,e=t.element,o=t.placement,r=o?an(o):null,i=o?Ao(o):null,a=n.x+n.width/2-e.width/2,c=n.y+n.height/2-e.height/2,l;switch(r){case Mt:l={x:a,y:n.y-e.height};break;case Zt:l={x:a,y:n.y+n.height};break;case Kt:l={x:n.x+n.width,y:c};break;case _t:l={x:n.x-e.width,y:c};break;default:l={x:n.x,y:n.y}}var u=r?Ws(r):null;if(u!=null){var f=u==="y"?"height":"width";switch(i){case No:l[u]=l[u]-(n[f]/2-e[f]/2);break;case hr:l[u]=l[u]+(n[f]/2-e[f]/2);break}}return l}function mr(t,n){n===void 0&&(n={});var e=n,o=e.placement,r=o===void 0?t.placement:o,i=e.strategy,a=i===void 0?t.strategy:i,c=e.boundary,l=c===void 0?Vv:c,u=e.rootBoundary,f=u===void 0?Op:u,d=e.elementContext,p=d===void 0?Yo:d,h=e.altBoundary,m=h===void 0?!1:h,v=e.padding,y=v===void 0?0:v,k=Tp(typeof y!="number"?y:Dp(y,xr)),S=p===Yo?Gv:Yo,b=t.rects.popper,w=t.elements[m?S:p],E=E1(io(w)?w:w.contextElement||Ln(t.elements.popper),l,f,a),O=Po(t.elements.reference),F=_p({reference:O,element:b,strategy:"absolute",placement:r}),R=ns(Object.assign({},b,F)),U=p===Yo?R:O,K={top:E.top-U.top+k.top,bottom:U.bottom-E.bottom+k.bottom,left:E.left-U.left+k.left,right:U.right-E.right+k.right},_=t.modifiersData.offset;if(p===Yo&&_){var A=_[r];Object.keys(K).forEach(function(me){var de=[Kt,Zt].indexOf(me)>=0?1:-1,re=[Mt,Zt].indexOf(me)>=0?"y":"x";K[me]+=A[re]*de})}return K}function j1(t,n){n===void 0&&(n={});var e=n,o=e.placement,r=e.boundary,i=e.rootBoundary,a=e.padding,c=e.flipVariations,l=e.allowedAutoPlacements,u=l===void 0?Np:l,f=Ao(o),d=f?c?bl:bl.filter(function(m){return Ao(m)===f}):xr,p=d.filter(function(m){return u.indexOf(m)>=0});p.length===0&&(p=d);var h=p.reduce(function(m,v){return m[v]=mr(t,{placement:v,boundary:r,rootBoundary:i,padding:a})[an(v)],m},{});return Object.keys(h).sort(function(m,v){return h[m]-h[v]})}function O1(t){if(an(t)===Fs)return[];var n=Yr(t);return[kl(t),n,kl(n)]}function N1(t){var n=t.state,e=t.options,o=t.name;if(!n.modifiersData[o]._skip){for(var r=e.mainAxis,i=r===void 0?!0:r,a=e.altAxis,c=a===void 0?!0:a,l=e.fallbackPlacements,u=e.padding,f=e.boundary,d=e.rootBoundary,p=e.altBoundary,h=e.flipVariations,m=h===void 0?!0:h,v=e.allowedAutoPlacements,y=n.options.placement,k=an(y),S=k===y,b=l||(S||!m?[Yr(y)]:O1(y)),w=[y].concat(b).reduce(function(H,P){return H.concat(an(P)===Fs?j1(n,{placement:P,boundary:f,rootBoundary:d,padding:u,flipVariations:m,allowedAutoPlacements:v}):P)},[]),E=n.rects.reference,O=n.rects.popper,F=new Map,R=!0,U=w[0],K=0;K<w.length;K++){var _=w[K],A=an(_),me=Ao(_)===No,de=[Mt,Zt].indexOf(A)>=0,re=de?"width":"height",ye=mr(n,{placement:_,boundary:f,rootBoundary:d,altBoundary:p,padding:u}),pe=de?me?Kt:_t:me?Zt:Mt;E[re]>O[re]&&(pe=Yr(pe));var xe=Yr(pe),ae=[];if(i&&ae.push(ye[A]<=0),c&&ae.push(ye[pe]<=0,ye[xe]<=0),ae.every(function(H){return H})){U=_,R=!1;break}F.set(_,ae)}if(R)for(var B=m?3:1,X=function(P){var T=w.find(function(W){var q=F.get(W);if(q)return q.slice(0,P).every(function(Z){return Z})});if(T)return U=T,"break"},Y=B;Y>0;Y--){var J=X(Y);if(J==="break")break}n.placement!==U&&(n.modifiersData[o]._skip=!0,n.placement=U,n.reset=!0)}}const I1={name:"flip",enabled:!0,phase:"main",fn:N1,requiresIfExists:["offset"],data:{_skip:!1}};function El(t,n,e){return e===void 0&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function jl(t){return[Mt,Kt,Zt,_t].some(function(n){return t[n]>=0})}function P1(t){var n=t.state,e=t.name,o=n.rects.reference,r=n.rects.popper,i=n.modifiersData.preventOverflow,a=mr(n,{elementContext:"reference"}),c=mr(n,{altBoundary:!0}),l=El(a,o),u=El(c,r,i),f=jl(l),d=jl(u);n.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}const A1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:P1};function T1(t,n,e){var o=an(t),r=[_t,Mt].indexOf(o)>=0?-1:1,i=typeof e=="function"?e(Object.assign({},n,{placement:t})):e,a=i[0],c=i[1];return a=a||0,c=(c||0)*r,[_t,Kt].indexOf(o)>=0?{x:c,y:a}:{x:a,y:c}}function D1(t){var n=t.state,e=t.options,o=t.name,r=e.offset,i=r===void 0?[0,0]:r,a=Np.reduce(function(f,d){return f[d]=T1(d,n.rects,i),f},{}),c=a[n.placement],l=c.x,u=c.y;n.modifiersData.popperOffsets!=null&&(n.modifiersData.popperOffsets.x+=l,n.modifiersData.popperOffsets.y+=u),n.modifiersData[o]=a}const M1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:D1};function _1(t){var n=t.state,e=t.name;n.modifiersData[e]=_p({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})}const L1={name:"popperOffsets",enabled:!0,phase:"read",fn:_1,data:{}};function R1(t){return t==="x"?"y":"x"}function F1(t){var n=t.state,e=t.options,o=t.name,r=e.mainAxis,i=r===void 0?!0:r,a=e.altAxis,c=a===void 0?!1:a,l=e.boundary,u=e.rootBoundary,f=e.altBoundary,d=e.padding,p=e.tether,h=p===void 0?!0:p,m=e.tetherOffset,v=m===void 0?0:m,y=mr(n,{boundary:l,rootBoundary:u,padding:d,altBoundary:f}),k=an(n.placement),S=Ao(n.placement),b=!S,w=Ws(k),E=R1(w),O=n.modifiersData.popperOffsets,F=n.rects.reference,R=n.rects.popper,U=typeof v=="function"?v(Object.assign({},n.rects,{placement:n.placement})):v,K=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),_=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,A={x:0,y:0};if(O){if(i){var me,de=w==="y"?Mt:_t,re=w==="y"?Zt:Kt,ye=w==="y"?"height":"width",pe=O[w],xe=pe+y[de],ae=pe-y[re],B=h?-R[ye]/2:0,X=S===No?F[ye]:R[ye],Y=S===No?-R[ye]:-F[ye],J=n.elements.arrow,H=h&&J?Hs(J):{width:0,height:0},P=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:Ap(),T=P[de],W=P[re],q=ar(0,F[ye],H[ye]),Z=b?F[ye]/2-B-q-T-K.mainAxis:X-q-T-K.mainAxis,ie=b?-F[ye]/2+B+q+W+K.mainAxis:Y+q+W+K.mainAxis,oe=n.elements.arrow&&Cr(n.elements.arrow),I=oe?w==="y"?oe.clientTop||0:oe.clientLeft||0:0,Ce=(me=_==null?void 0:_[w])!=null?me:0,ke=pe+Z-Ce-I,Ae=pe+ie-Ce,Pe=ar(h?fi(xe,ke):xe,pe,h?Qn(ae,Ae):ae);O[w]=Pe,A[w]=Pe-pe}if(c){var Te,he=w==="x"?Mt:_t,C=w==="x"?Zt:Kt,x=O[E],j=E==="y"?"height":"width",N=x+y[he],L=x-y[C],ne=[Mt,_t].indexOf(k)!==-1,ve=(Te=_==null?void 0:_[E])!=null?Te:0,$=ne?N:x-F[j]-R[j]-ve+K.altAxis,V=ne?x+F[j]+R[j]-ve-K.altAxis:L,z=h&&ne?c1($,x,V):ar(h?$:N,x,h?V:L);O[E]=z,A[E]=z-x}n.modifiersData[o]=A}}const B1={name:"preventOverflow",enabled:!0,phase:"main",fn:F1,requiresIfExists:["offset"]};function H1(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function W1(t){return t===$t(t)||!Yt(t)?$s(t):H1(t)}function $1(t){var n=t.getBoundingClientRect(),e=Io(n.width)/t.offsetWidth||1,o=Io(n.height)/t.offsetHeight||1;return e!==1||o!==1}function z1(t,n,e){e===void 0&&(e=!1);var o=Yt(n),r=Yt(n)&&$1(n),i=Ln(n),a=Po(t,r,e),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!e)&&((cn(n)!=="body"||Us(i))&&(c=W1(n)),Yt(n)?(l=Po(n,!0),l.x+=n.clientLeft,l.y+=n.clientTop):i&&(l.x=zs(i))),{x:a.left+c.scrollLeft-l.x,y:a.top+c.scrollTop-l.y,width:a.width,height:a.height}}function U1(t){var n=new Map,e=new Set,o=[];t.forEach(function(i){n.set(i.name,i)});function r(i){e.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(c){if(!e.has(c)){var l=n.get(c);l&&r(l)}}),o.push(i)}return t.forEach(function(i){e.has(i.name)||r(i)}),o}function V1(t){var n=U1(t);return n1.reduce(function(e,o){return e.concat(n.filter(function(r){return r.phase===o}))},[])}function G1(t){var n;return function(){return n||(n=new Promise(function(e){Promise.resolve().then(function(){n=void 0,e(t())})})),n}}function Y1(t){var n=t.reduce(function(e,o){var r=e[o.name];return e[o.name]=r?Object.assign({},r,o,{options:Object.assign({},r.options,o.options),data:Object.assign({},r.data,o.data)}):o,e},{});return Object.keys(n).map(function(e){return n[e]})}var Ol={placement:"bottom",modifiers:[],strategy:"absolute"};function Nl(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function Z1(t){t===void 0&&(t={});var n=t,e=n.defaultModifiers,o=e===void 0?[]:e,r=n.defaultOptions,i=r===void 0?Ol:r;return function(c,l,u){u===void 0&&(u=i);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ol,i),modifiersData:{},elements:{reference:c,popper:l},attributes:{},styles:{}},d=[],p=!1,h={state:f,setOptions:function(k){var S=typeof k=="function"?k(f.options):k;v(),f.options=Object.assign({},i,f.options,S),f.scrollParents={reference:io(c)?sr(c):c.contextElement?sr(c.contextElement):[],popper:sr(l)};var b=V1(Y1([].concat(o,f.options.modifiers)));return f.orderedModifiers=b.filter(function(w){return w.enabled}),m(),h.update()},forceUpdate:function(){if(!p){var k=f.elements,S=k.reference,b=k.popper;if(Nl(S,b)){f.rects={reference:z1(S,Cr(b),f.options.strategy==="fixed"),popper:Hs(b)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(K){return f.modifiersData[K.name]=Object.assign({},K.data)});for(var w=0;w<f.orderedModifiers.length;w++){if(f.reset===!0){f.reset=!1,w=-1;continue}var E=f.orderedModifiers[w],O=E.fn,F=E.options,R=F===void 0?{}:F,U=E.name;typeof O=="function"&&(f=O({state:f,options:R,name:U,instance:h})||f)}}}},update:G1(function(){return new Promise(function(y){h.forceUpdate(),y(f)})}),destroy:function(){v(),p=!0}};if(!Nl(c,l))return h;h.setOptions(u).then(function(y){!p&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){f.orderedModifiers.forEach(function(y){var k=y.name,S=y.options,b=S===void 0?{}:S,w=y.effect;if(typeof w=="function"){var E=w({state:f,name:k,instance:h,options:b}),O=function(){};d.push(E||O)}})}function v(){d.forEach(function(y){return y()}),d=[]}return h}}var K1=[y1,L1,g1,i1,M1,I1,B1,f1,A1],q1=Z1({defaultModifiers:K1}),J1=typeof Element<"u",X1=typeof Map=="function",Q1=typeof Set=="function",ey=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Zr(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var e,o,r;if(Array.isArray(t)){if(e=t.length,e!=n.length)return!1;for(o=e;o--!==0;)if(!Zr(t[o],n[o]))return!1;return!0}var i;if(X1&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i=t.entries();!(o=i.next()).done;)if(!n.has(o.value[0]))return!1;for(i=t.entries();!(o=i.next()).done;)if(!Zr(o.value[1],n.get(o.value[0])))return!1;return!0}if(Q1&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i=t.entries();!(o=i.next()).done;)if(!n.has(o.value[0]))return!1;return!0}if(ey&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(e=t.length,e!=n.length)return!1;for(o=e;o--!==0;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof n.valueOf=="function")return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof n.toString=="function")return t.toString()===n.toString();if(r=Object.keys(t),e=r.length,e!==Object.keys(n).length)return!1;for(o=e;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,r[o]))return!1;if(J1&&t instanceof Element)return!1;for(o=e;o--!==0;)if(!((r[o]==="_owner"||r[o]==="__v"||r[o]==="__o")&&t.$$typeof)&&!Zr(t[r[o]],n[r[o]]))return!1;return!0}return t!==t&&n!==n}var ty=function(n,e){try{return Zr(n,e)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}};const ny=_i(ty);var oy=[],ry=function(n,e,o){o===void 0&&(o={});var r=D.useRef(null),i={onFirstUpdate:o.onFirstUpdate,placement:o.placement||"bottom",strategy:o.strategy||"absolute",modifiers:o.modifiers||oy},a=D.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),c=a[0],l=a[1],u=D.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(h){var m=h.state,v=Object.keys(m.elements);Kl.flushSync(function(){l({styles:yl(v.map(function(y){return[y,m.styles[y]||{}]})),attributes:yl(v.map(function(y){return[y,m.attributes[y]]}))})})},requires:["computeStyles"]}},[]),f=D.useMemo(function(){var p={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[u,{name:"applyStyles",enabled:!1}])};return ny(r.current,p)?r.current||p:(r.current=p,p)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,u]),d=D.useRef();return wl(function(){d.current&&d.current.setOptions(f)},[f]),wl(function(){if(!(n==null||e==null)){var p=o.createPopper||q1,h=p(n,e,f);return d.current=h,function(){h.destroy(),d.current=null}}},[n,e,o.createPopper]),{state:d.current?d.current.state:null,styles:c.styles,attributes:c.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}},iy=["className","cssModule","size","vertical","tag"];function os(){return os=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},os.apply(this,arguments)}function Il(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function ay(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?Il(Object(e),!0).forEach(function(o){sy(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Il(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function sy(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function cy(t,n){if(t==null)return{};var e=ly(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function ly(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var uy={"aria-label":Q.string,className:Q.string,cssModule:Q.object,role:Q.string,size:Q.string,tag:Rs,vertical:Q.bool};function Lp(t){var n=t.className,e=t.cssModule,o=t.size,r=t.vertical,i=t.tag,a=i===void 0?"div":i,c=cy(t,iy),l=Li(et(n,o?"btn-group-"+o:!1,r?"btn-group-vertical":"btn-group"),e);return g.createElement(a,os({},ay({role:"group"},c),{className:l}))}Lp.propTypes=uy;function dy(t,n){if(t==null)return{};var e={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(n.indexOf(o)!==-1)continue;e[o]=t[o]}return e}function rs(t,n){return rs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,o){return e.__proto__=o,e},rs(t,n)}function fy(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,rs(t,n)}const Pl={disabled:!1};var py=process.env.NODE_ENV!=="production"?Q.oneOfType([Q.number,Q.shape({enter:Q.number,exit:Q.number,appear:Q.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&Q.oneOfType([Q.string,Q.shape({enter:Q.string,exit:Q.string,active:Q.string}),Q.shape({enter:Q.string,enterDone:Q.string,enterActive:Q.string,exit:Q.string,exitDone:Q.string,exitActive:Q.string})]);const Rp=g.createContext(null);var hy=function(n){return n.scrollTop},tr="unmounted",Hn="exited",Wn="entering",vo="entered",is="exiting",wn=function(t){fy(n,t);function n(o,r){var i;i=t.call(this,o,r)||this;var a=r,c=a&&!a.isMounting?o.enter:o.appear,l;return i.appearStatus=null,o.in?c?(l=Hn,i.appearStatus=Wn):l=vo:o.unmountOnExit||o.mountOnEnter?l=tr:l=Hn,i.state={status:l},i.nextCallback=null,i}n.getDerivedStateFromProps=function(r,i){var a=r.in;return a&&i.status===tr?{status:Hn}:null};var e=n.prototype;return e.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},e.componentDidUpdate=function(r){var i=null;if(r!==this.props){var a=this.state.status;this.props.in?a!==Wn&&a!==vo&&(i=Wn):(a===Wn||a===vo)&&(i=is)}this.updateStatus(!1,i)},e.componentWillUnmount=function(){this.cancelNextCallback()},e.getTimeouts=function(){var r=this.props.timeout,i,a,c;return i=a=c=r,r!=null&&typeof r!="number"&&(i=r.exit,a=r.enter,c=r.appear!==void 0?r.appear:a),{exit:i,enter:a,appear:c}},e.updateStatus=function(r,i){if(r===void 0&&(r=!1),i!==null)if(this.cancelNextCallback(),i===Wn){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:jn.findDOMNode(this);a&&hy(a)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Hn&&this.setState({status:tr})},e.performEnter=function(r){var i=this,a=this.props.enter,c=this.context?this.context.isMounting:r,l=this.props.nodeRef?[c]:[jn.findDOMNode(this),c],u=l[0],f=l[1],d=this.getTimeouts(),p=c?d.appear:d.enter;if(!r&&!a||Pl.disabled){this.safeSetState({status:vo},function(){i.props.onEntered(u)});return}this.props.onEnter(u,f),this.safeSetState({status:Wn},function(){i.props.onEntering(u,f),i.onTransitionEnd(p,function(){i.safeSetState({status:vo},function(){i.props.onEntered(u,f)})})})},e.performExit=function(){var r=this,i=this.props.exit,a=this.getTimeouts(),c=this.props.nodeRef?void 0:jn.findDOMNode(this);if(!i||Pl.disabled){this.safeSetState({status:Hn},function(){r.props.onExited(c)});return}this.props.onExit(c),this.safeSetState({status:is},function(){r.props.onExiting(c),r.onTransitionEnd(a.exit,function(){r.safeSetState({status:Hn},function(){r.props.onExited(c)})})})},e.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},e.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},e.setNextCallback=function(r){var i=this,a=!0;return this.nextCallback=function(c){a&&(a=!1,i.nextCallback=null,r(c))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},e.onTransitionEnd=function(r,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:jn.findDOMNode(this),c=r==null&&!this.props.addEndListener;if(!a||c){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],f=l[1];this.props.addEndListener(u,f)}r!=null&&setTimeout(this.nextCallback,r)},e.render=function(){var r=this.state.status;if(r===tr)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var c=dy(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return g.createElement(Rp.Provider,{value:null},typeof a=="function"?a(r,c):g.cloneElement(g.Children.only(a),c))},n}(g.Component);wn.contextType=Rp;wn.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:Q.shape({current:typeof Element>"u"?Q.any:function(t,n,e,o,r,i){var a=t[n];return Q.instanceOf(a&&"ownerDocument"in a?a.ownerDocument.defaultView.Element:Element)(t,n,e,o,r,i)}}),children:Q.oneOfType([Q.func.isRequired,Q.element.isRequired]).isRequired,in:Q.bool,mountOnEnter:Q.bool,unmountOnExit:Q.bool,appear:Q.bool,enter:Q.bool,exit:Q.bool,timeout:function(n){var e=py;n.addEndListener||(e=e.isRequired);for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return e.apply(void 0,[n].concat(r))},addEndListener:Q.func,onEnter:Q.func,onEntering:Q.func,onEntered:Q.func,onExit:Q.func,onExiting:Q.func,onExited:Q.func}:{};function uo(){}wn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:uo,onEntering:uo,onEntered:uo,onExit:uo,onExiting:uo,onExited:uo};wn.UNMOUNTED=tr;wn.EXITED=Hn;wn.ENTERING=Wn;wn.ENTERED=vo;wn.EXITING=is;const Vs=wn;function as(t){"@babel/helpers - typeof";return as=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},as(t)}var my=["tag","horizontal","isOpen","className","navbar","cssModule","children","innerRef"],fo;function pi(){return pi=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},pi.apply(this,arguments)}function gy(t,n){if(t==null)return{};var e=vy(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function vy(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}function yy(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Al(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function wy(t,n,e){return n&&Al(t.prototype,n),e&&Al(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function by(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&ss(t,n)}function ss(t,n){return ss=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},ss(t,n)}function xy(t){var n=ky();return function(){var o=hi(t),r;if(n){var i=hi(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return Cy(this,r)}}function Cy(t,n){if(n&&(as(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fp(t)}function Fp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ky(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hi(t){return hi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hi(t)}function Tl(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function To(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?Tl(Object(e),!0).forEach(function(o){bo(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Tl(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function bo(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var Sy=To(To({},Vs.propTypes),{},{horizontal:Q.bool,isOpen:Q.bool,children:Q.oneOfType([Q.arrayOf(Q.node),Q.node]),tag:Rs,className:Q.node,navbar:Q.bool,cssModule:Q.object,innerRef:Q.shape({current:Q.object})}),Ey=To(To({},Vs.defaultProps),{},{horizontal:!1,isOpen:!1,appear:!1,enter:!0,exit:!0,tag:"div",timeout:Mv.Collapse}),jy=(fo={},bo(fo,Fr.ENTERING,"collapsing"),bo(fo,Fr.ENTERED,"collapse show"),bo(fo,Fr.EXITING,"collapsing"),bo(fo,Fr.EXITED,"collapse"),fo);function Oy(t){return jy[t]||"collapse"}var Gs=function(t){by(e,t);var n=xy(e);function e(o){var r;return yy(this,e),r=n.call(this,o),r.state={dimension:null},r.nodeRef=o.innerRef||g.createRef(),["onEntering","onEntered","onExit","onExiting","onExited"].forEach(function(i){r[i]=r[i].bind(Fp(r))}),r}return wy(e,[{key:"onEntering",value:function(r,i){var a=this.getNode();this.setState({dimension:this.getDimension(a)}),this.props.onEntering(a,i)}},{key:"onEntered",value:function(r,i){var a=this.getNode();this.setState({dimension:null}),this.props.onEntered(a,i)}},{key:"onExit",value:function(){var r=this.getNode();this.setState({dimension:this.getDimension(r)}),this.props.onExit(r)}},{key:"onExiting",value:function(){var r=this.getNode();this.getDimension(r),this.setState({dimension:0}),this.props.onExiting(r)}},{key:"onExited",value:function(){var r=this.getNode();this.setState({dimension:null}),this.props.onExited(r)}},{key:"getNode",value:function(){return this.nodeRef.current}},{key:"getDimension",value:function(r){return this.props.horizontal?r.scrollWidth:r.scrollHeight}},{key:"render",value:function(){var r=this,i=this.props,a=i.tag,c=i.horizontal,l=i.isOpen,u=i.className,f=i.navbar,d=i.cssModule,p=i.children;i.innerRef;var h=gy(i,my),m=this.state.dimension,v=Av(h,gl),y=Pv(h,gl);return g.createElement(Vs,pi({},v,{in:l,nodeRef:this.nodeRef,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}),function(k){var S=Oy(k),b=Li(et(u,c&&"collapse-horizontal",S,f&&"navbar-collapse"),d),w=m===null?null:bo({},c?"width":"height",m);return g.createElement(a,pi({},y,{style:To(To({},y.style),w),className:b,ref:r.nodeRef}),p)})}}]),e}(g.Component);Gs.propTypes=Sy;Gs.defaultProps=Ey;const Bp=Gs,Ny=t=>{const{className:n,isOpen:e,showCollapseIcon:o,showFolderIcon:r,title:i,...a}=t;return s.jsx(ut.ItemHeader,{className:et("io-base-section-header",n),prepend:r&&s.jsx(ot,{size:"16",variant:e?"folder-open":"folder","data-testid":"base-section-header-folder-icon"}),append:o&&s.jsx(ot,{className:et("collapse-icon",!e&&"collapsed"),size:"10",variant:"expand","data-testid":"base-section-header-collapse-icon"}),tooltip:i,...a,children:i})},Hp=()=>{const[t,n]=g.useState([]),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=l=>{const{name:u,title:f,caption:d,icon:p,userProperties:h}=l;return{id:u,name:u,title:f??u,caption:d,icon:p,userProperties:h}},r=e.appManager.onAppAdded(l=>{if(l.userProperties.hidden||"hidden"in l&&l.hidden)return;const u=o(l);n(f=>[...f,u])}),i=e.appManager.onAppChanged(l=>{if(l.userProperties.hidden||"hidden"in l&&l.hidden)return;const u=o(l);n(f=>[...f.filter(d=>d.id!==u.id),u])}),a=e.appManager.onAppRemoved(l=>{const u=o(l);n(f=>f.filter(d=>d.id!==u.id))}),c=[r,a,i];return()=>c.forEach(l=>l())},[e]),t},Iy=()=>{const[t,n]=g.useState({}),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=e.appManager.onInstanceStarted(a=>{n(c=>{const l=c[a.application.name]??[];return{...c,[a.application.name]:[...l,a.id]}})}),r=e.appManager.onInstanceStopped(a=>{n(c=>({...c,[a.application.name]:c[a.application.name].filter(l=>l!==a.id)}))}),i=[o,r];return()=>i.forEach(a=>a())},[e]),t},Py=t=>{g.useEffect(()=>{var e;if(!((e=window.iobrowser)!=null&&e.platformStarted)||t)return;const n=o=>{o.preventDefault(),o.returnValue=!0};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t])},Ys=()=>{const[t,n]=g.useState(),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{var o;try{const i=!((o=e.windows.my())!=null&&o.name)?Eo.getFrameId():void 0;n(i)}catch(r){console.error("Failed to get the current frame ID ",{error:r})}},[e,Eo.getFrameId,n]),t},Le={SUCCESS:"success",WARNING:"warning"},Ay={success:5*1e3,warning:10*1e3},Fe=async t=>{const{io:n,variant:e,text:o,error:r}=t,i=Ka(r);try{if(e===Le.WARNING&&n.logger.warn(i?`${o} ${i}`:o),!("modals"in n&&n.modals))throw new Error("Modals are not enabled.");const a={text:o,variant:e,ttl:Ay[e]};await n.modals.alerts.request(a)}catch(a){n.logger.warn(`Failed to request alert. ${Ka(a)}`)}},Ty=async t=>{var o;const{io:n,item:e}=t;try{await((o=n.appManager.application(e.id))==null?void 0:o.start())}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to start app "${e.title}" in a new window.`,error:r})}},Dy=async t=>{const{io:n,item:e,frameId:o}=t;if(!n.workspaces)return;const r={type:"workspace",definition:{frame:o?{reuseFrameId:o}:{newFrame:!0}}},i=n.workspaces.getBuilder(r);i.addGroup().addWindow({appName:e.id});try{await i.create()}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to start app "${e.title}" in a new Workspace.`,error:a})}},My={[ci.OPEN_IN_NEW_WINDOW]:Ty,[ci.OPEN_IN_NEW_WORKSPACE]:Dy},Wp=()=>{const t=g.useContext(Me.IOConnectContext),n=Ys();return(e,o)=>{My[o]({io:t,item:e,frameId:n})}},Lo={NO_INPUTS_CONFIRMATION_DIALOG:"noInputsConfirmationDialog",SINGLE_CHECKBOX_DIALOG:"singleCheckboxDialog",SINGLE_TEXT_INPUT_DIALOG:"singleTextInputDialog"},Zs="(.|\\s)*\\S(.|\\s)*",_y=async t=>{var i;const{io:n,layout:e,showDeletePromptPref:o,updateShowDeletePromptPref:r}=t;if("modals"in n&&n.modals&&o){const a="delete",c="do-not-ask-again",{isEnterPressed:l,responseButtonClicked:u,inputs:f}=await n.modals.dialogs.request({templateName:Lo.SINGLE_CHECKBOX_DIALOG,variables:{heading:`Delete Layout "${e.name}"`,text:"Are you sure you want to delete this Layout?",checkbox:{id:c,label:"Don't ask me again"},actionButtons:[{variant:"critical",text:"Delete",id:a},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(((i=f==null?void 0:f.find(h=>h.id===c))==null?void 0:i.checked)&&r(!1),!(l||(u==null?void 0:u.id)===a))return}try{await n.layouts.remove("Global",e.name),e.isDefault&&await n.layouts.clearDefaultGlobal(),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully deleted.`})}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to delete Layout "${e.name}".`,error:a})}},Ly=async t=>{var d;const{io:n,layout:e,setDefaultLayout:o}=t;if(!("modals"in n&&n.modals)){console.error("Cannot rename Layout because io dialogs are not enabled");return}const r="rename",i="new-layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await n.modals.dialogs.request({templateName:Lo.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Rename "${e.name}"`,input:{id:i,initialValue:e.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Zs}},actionButtons:[{variant:"primary",text:"Rename",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(d=l==null?void 0:l.find(p=>p.id===i))==null?void 0:d.value;if(a||(c==null?void 0:c.id)===r){if(u===e.name){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}". The new Layout name must be different from the current one.`});return}try{if((await n.layouts.getAll("Global")).find(m=>m.name===u)){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}" to "${u}". A Layout with name "${u}" already exists.`});return}const h=await n.layouts.get(e.name,"Global");if(!h){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}". The Layout wasn't found.`});return}await n.layouts.rename(h,u),e.isDefault&&await o({name:u}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully renamed to "${u}".`})}catch(p){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}".`,error:p})}}},Ry=async t=>{const{io:n,layout:e}=t;try{await n.layouts.save({name:e.name,type:"Global"}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was saved successfully.`})}catch(o){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${e.name}".`,error:o})}},Fy=async t=>{var d;const{io:n,layout:e,setActiveLayout:o}=t;if(!("modals"in n&&n.modals)){console.error("Cannot save Layout under a new name because io dialogs are not enabled");return}const r="save-as",i="layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await n.modals.dialogs.request({templateName:Lo.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Save Layout "${e.name}" as`,input:{id:i,initialValue:e.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Zs}},actionButtons:[{variant:"primary",text:"Save as",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(d=l==null?void 0:l.find(p=>p.id===i))==null?void 0:d.value;if(a||(c==null?void 0:c.id)===r){if(u===e.name){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout as "${u}". The new Layout must have a unique name.`});return}try{if((await n.layouts.getAll("Global")).find(m=>m.name===u)){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout as "${u}". A Layout with this name already exists.`});return}const h=await n.layouts.get(e.name,"Global");if(!h){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${e.name}". The Layout wasn't found.`});return}await n.layouts.import([{...h,name:u}],"merge"),e.isActive&&o({name:u}),await Fe({io:n,variant:Le.SUCCESS,text:`The Layout was successfully saved as "${u}".`})}catch(p){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${u}".`,error:p})}}},By=async t=>{const{io:n,layout:e,setDefaultLayout:o}=t;try{await o({name:e.name}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully set as the default Layout.`})}catch{await Fe({io:n,variant:Le.WARNING,text:`Failed to set Layout "${e.name}" as the default Layout.`})}},Hy=async t=>{const{io:n,layout:e,closeLaunchpad:o}=t;try{await n.layouts.restore({name:e.name}),o(),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was loaded successfully.`})}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to load Layout "${e.name}".`,error:r})}},Wy={delete:_y,rename:Ly,save:Ry,saveAs:Fy,setAsDefault:By,load:Hy},$y="interopio_home_ui_auth0_validation_error",zy="interopio_home_ui_user",Uy="interopio_home_ui_platform_window",kr="interopio_home_ui_platform_setup",$p="interopio_home_ui_active_layout";var gt=function(t){return{ok:!0,result:t}},st=function(t){return{ok:!1,error:t}},Vy=function(t){return t.ok===!0?Promise.resolve(t.result):Promise.reject(t.error)},Gy=function(t,n){return n.ok===!0?n.result:t},Yy=function(t){if(t.ok===!0)return t.result;throw t.error},Zy=function(t,n){return n.ok===!0?gt(t(n.result)):n},Dl=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:gt(t(n.result,e.result))},ya=function(t,n){return n.ok===!0?n:st(t(n.error))},Ky=function(t,n){return n.ok===!0?t(n.result):n};/*! *****************************************************************************
35
+ */(function(t){(function(){var n={}.hasOwnProperty;function e(){for(var i="",a=0;a<arguments.length;a++){var c=arguments[a];c&&(i=r(i,o(c)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return e.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var c in i)n.call(i,c)&&i[c]&&(a=r(a,c));return a}function r(i,a){return a?i?i+" "+a:i+a:i}t.exports?(e.default=e,t.exports=e):window.classNames=e})()})(Ep);var Nv=Ep.exports;const et=_i(Nv);function Xa(t){"@babel/helpers - typeof";return Xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Xa(t)}var Iv;function Li(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Iv;return n?t.split(" ").map(function(e){return n[e]||e}).join(" "):t}function Pv(t,n){var e={};return Object.keys(t).forEach(function(o){n.indexOf(o)===-1&&(e[o]=t[o])}),e}function Av(t,n){for(var e=Array.isArray(n)?n:[n],o=e.length,r,i={};o>0;)o-=1,r=e[o],i[r]=t[r];return i}var Tv=(typeof window>"u"?"undefined":Xa(window))==="object"&&window.Element||function(){};function Dv(t,n,e){if(!(t[n]instanceof Tv))return new Error("Invalid prop `"+n+"` supplied to `"+e+"`. Expected prop to be an instance of Element. Validation failed.")}Q.oneOfType([Q.string,Q.func,Dv,Q.shape({current:Q.any})]);var Rs=Q.oneOfType([Q.func,Q.string,Q.shape({$$typeof:Q.symbol,render:Q.func}),Q.arrayOf(Q.oneOfType([Q.func,Q.string,Q.shape({$$typeof:Q.symbol,render:Q.func})]))]),Mv={Fade:150,Collapse:350,Modal:300,Carousel:600,Offcanvas:300},gl=["in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],Fr={ENTERING:"entering",ENTERED:"entered",EXITING:"exiting",EXITED:"exited"},_v=["className","cssModule","variant","innerRef"];function Qa(){return Qa=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Qa.apply(this,arguments)}function vl(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function Lv(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?vl(Object(e),!0).forEach(function(o){Rv(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):vl(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function Rv(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function Fv(t,n){if(t==null)return{};var e=Bv(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function Bv(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var Hv={active:Q.bool,"aria-label":Q.string,onClick:Q.func,variant:Q.oneOf(["white"]),className:Q.string,cssModule:Q.object,innerRef:Q.oneOfType([Q.object,Q.string,Q.func])};function jp(t){var n=t.className;t.cssModule;var e=t.variant,o=t.innerRef,r=Fv(t,_v),i=Li(et(n,"btn-close",e&&"btn-close-".concat(e)));return g.createElement("button",Qa({ref:o,type:"button",className:i},Lv({"aria-label":"close"},r)))}jp.propTypes=Hv;var Wv=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"];function es(){return es=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},es.apply(this,arguments)}function $v(t,n){if(t==null)return{};var e=zv(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function zv(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var Uv={active:Q.bool,"aria-label":Q.string,block:Q.bool,children:Q.node,className:Q.string,cssModule:Q.object,close:Q.bool,color:Q.string,disabled:Q.bool,innerRef:Q.oneOfType([Q.object,Q.func,Q.string]),onClick:Q.func,outline:Q.bool,size:Q.string,tag:Rs};function di(t){var n=g.useCallback(function(S){if(t.disabled){S.preventDefault();return}if(t.onClick)return t.onClick(S)},[t.onClick,t.disabled]),e=t.active,o=t["aria-label"],r=t.block,i=t.className,a=t.close,c=t.cssModule,l=t.color,u=l===void 0?"secondary":l,f=t.outline,d=t.size,p=t.tag,h=p===void 0?"button":p,m=t.innerRef,v=$v(t,Wv);if(a)return g.createElement(jp,v);var y="btn".concat(f?"-outline":"","-").concat(u),k=Li(et(i,"btn",y,d?"btn-".concat(d):!1,r?"d-block w-100":!1,{active:e,disabled:t.disabled}),c);return v.href&&h==="button"&&(h="a"),g.createElement(h,es({type:h==="button"&&v.onClick?"button":void 0},v,{className:k,ref:m,onClick:n,"aria-label":o}))}di.propTypes=Uv;var yl=function(n){return n.reduce(function(e,o){var r=o[0],i=o[1];return e[r]=i,e},{})},wl=typeof window<"u"&&window.document&&window.document.createElement?D.useLayoutEffect:D.useEffect,Mt="top",Zt="bottom",Kt="right",_t="left",Fs="auto",xr=[Mt,Zt,Kt,_t],No="start",hr="end",Vv="clippingParents",Op="viewport",Yo="popper",Gv="reference",bl=xr.reduce(function(t,n){return t.concat([n+"-"+No,n+"-"+hr])},[]),Np=[].concat(xr,[Fs]).reduce(function(t,n){return t.concat([n,n+"-"+No,n+"-"+hr])},[]),Yv="beforeRead",Zv="read",Kv="afterRead",qv="beforeMain",Jv="main",Xv="afterMain",Qv="beforeWrite",e1="write",t1="afterWrite",n1=[Yv,Zv,Kv,qv,Jv,Xv,Qv,e1,t1];function cn(t){return t?(t.nodeName||"").toLowerCase():null}function $t(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var n=t.ownerDocument;return n&&n.defaultView||window}return t}function io(t){var n=$t(t).Element;return t instanceof n||t instanceof Element}function Yt(t){var n=$t(t).HTMLElement;return t instanceof n||t instanceof HTMLElement}function Bs(t){if(typeof ShadowRoot>"u")return!1;var n=$t(t).ShadowRoot;return t instanceof n||t instanceof ShadowRoot}function o1(t){var n=t.state;Object.keys(n.elements).forEach(function(e){var o=n.styles[e]||{},r=n.attributes[e]||{},i=n.elements[e];!Yt(i)||!cn(i)||(Object.assign(i.style,o),Object.keys(r).forEach(function(a){var c=r[a];c===!1?i.removeAttribute(a):i.setAttribute(a,c===!0?"":c)}))})}function r1(t){var n=t.state,e={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,e.popper),n.styles=e,n.elements.arrow&&Object.assign(n.elements.arrow.style,e.arrow),function(){Object.keys(n.elements).forEach(function(o){var r=n.elements[o],i=n.attributes[o]||{},a=Object.keys(n.styles.hasOwnProperty(o)?n.styles[o]:e[o]),c=a.reduce(function(l,u){return l[u]="",l},{});!Yt(r)||!cn(r)||(Object.assign(r.style,c),Object.keys(i).forEach(function(l){r.removeAttribute(l)}))})}}const i1={name:"applyStyles",enabled:!0,phase:"write",fn:o1,effect:r1,requires:["computeStyles"]};function an(t){return t.split("-")[0]}var Qn=Math.max,fi=Math.min,Io=Math.round;function ts(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function Ip(){return!/^((?!chrome|android).)*safari/i.test(ts())}function Po(t,n,e){n===void 0&&(n=!1),e===void 0&&(e=!1);var o=t.getBoundingClientRect(),r=1,i=1;n&&Yt(t)&&(r=t.offsetWidth>0&&Io(o.width)/t.offsetWidth||1,i=t.offsetHeight>0&&Io(o.height)/t.offsetHeight||1);var a=io(t)?$t(t):window,c=a.visualViewport,l=!Ip()&&e,u=(o.left+(l&&c?c.offsetLeft:0))/r,f=(o.top+(l&&c?c.offsetTop:0))/i,d=o.width/r,p=o.height/i;return{width:d,height:p,top:f,right:u+d,bottom:f+p,left:u,x:u,y:f}}function Hs(t){var n=Po(t),e=t.offsetWidth,o=t.offsetHeight;return Math.abs(n.width-e)<=1&&(e=n.width),Math.abs(n.height-o)<=1&&(o=n.height),{x:t.offsetLeft,y:t.offsetTop,width:e,height:o}}function Pp(t,n){var e=n.getRootNode&&n.getRootNode();if(t.contains(n))return!0;if(e&&Bs(e)){var o=n;do{if(o&&t.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function gn(t){return $t(t).getComputedStyle(t)}function a1(t){return["table","td","th"].indexOf(cn(t))>=0}function Ln(t){return((io(t)?t.ownerDocument:t.document)||window.document).documentElement}function Ri(t){return cn(t)==="html"?t:t.assignedSlot||t.parentNode||(Bs(t)?t.host:null)||Ln(t)}function xl(t){return!Yt(t)||gn(t).position==="fixed"?null:t.offsetParent}function s1(t){var n=/firefox/i.test(ts()),e=/Trident/i.test(ts());if(e&&Yt(t)){var o=gn(t);if(o.position==="fixed")return null}var r=Ri(t);for(Bs(r)&&(r=r.host);Yt(r)&&["html","body"].indexOf(cn(r))<0;){var i=gn(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||n&&i.willChange==="filter"||n&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function Cr(t){for(var n=$t(t),e=xl(t);e&&a1(e)&&gn(e).position==="static";)e=xl(e);return e&&(cn(e)==="html"||cn(e)==="body"&&gn(e).position==="static")?n:e||s1(t)||n}function Ws(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function ar(t,n,e){return Qn(t,fi(n,e))}function c1(t,n,e){var o=ar(t,n,e);return o>e?e:o}function Ap(){return{top:0,right:0,bottom:0,left:0}}function Tp(t){return Object.assign({},Ap(),t)}function Dp(t,n){return n.reduce(function(e,o){return e[o]=t,e},{})}var l1=function(n,e){return n=typeof n=="function"?n(Object.assign({},e.rects,{placement:e.placement})):n,Tp(typeof n!="number"?n:Dp(n,xr))};function u1(t){var n,e=t.state,o=t.name,r=t.options,i=e.elements.arrow,a=e.modifiersData.popperOffsets,c=an(e.placement),l=Ws(c),u=[_t,Kt].indexOf(c)>=0,f=u?"height":"width";if(!(!i||!a)){var d=l1(r.padding,e),p=Hs(i),h=l==="y"?Mt:_t,m=l==="y"?Zt:Kt,v=e.rects.reference[f]+e.rects.reference[l]-a[l]-e.rects.popper[f],y=a[l]-e.rects.reference[l],k=Cr(i),S=k?l==="y"?k.clientHeight||0:k.clientWidth||0:0,b=v/2-y/2,w=d[h],E=S-p[f]-d[m],O=S/2-p[f]/2+b,F=ar(w,O,E),R=l;e.modifiersData[o]=(n={},n[R]=F,n.centerOffset=F-O,n)}}function d1(t){var n=t.state,e=t.options,o=e.element,r=o===void 0?"[data-popper-arrow]":o;r!=null&&(typeof r=="string"&&(r=n.elements.popper.querySelector(r),!r)||Pp(n.elements.popper,r)&&(n.elements.arrow=r))}const f1={name:"arrow",enabled:!0,phase:"main",fn:u1,effect:d1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ao(t){return t.split("-")[1]}var p1={top:"auto",right:"auto",bottom:"auto",left:"auto"};function h1(t,n){var e=t.x,o=t.y,r=n.devicePixelRatio||1;return{x:Io(e*r)/r||0,y:Io(o*r)/r||0}}function Cl(t){var n,e=t.popper,o=t.popperRect,r=t.placement,i=t.variation,a=t.offsets,c=t.position,l=t.gpuAcceleration,u=t.adaptive,f=t.roundOffsets,d=t.isFixed,p=a.x,h=p===void 0?0:p,m=a.y,v=m===void 0?0:m,y=typeof f=="function"?f({x:h,y:v}):{x:h,y:v};h=y.x,v=y.y;var k=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),b=_t,w=Mt,E=window;if(u){var O=Cr(e),F="clientHeight",R="clientWidth";if(O===$t(e)&&(O=Ln(e),gn(O).position!=="static"&&c==="absolute"&&(F="scrollHeight",R="scrollWidth")),O=O,r===Mt||(r===_t||r===Kt)&&i===hr){w=Zt;var U=d&&O===E&&E.visualViewport?E.visualViewport.height:O[F];v-=U-o.height,v*=l?1:-1}if(r===_t||(r===Mt||r===Zt)&&i===hr){b=Kt;var K=d&&O===E&&E.visualViewport?E.visualViewport.width:O[R];h-=K-o.width,h*=l?1:-1}}var _=Object.assign({position:c},u&&p1),A=f===!0?h1({x:h,y:v},$t(e)):{x:h,y:v};if(h=A.x,v=A.y,l){var me;return Object.assign({},_,(me={},me[w]=S?"0":"",me[b]=k?"0":"",me.transform=(E.devicePixelRatio||1)<=1?"translate("+h+"px, "+v+"px)":"translate3d("+h+"px, "+v+"px, 0)",me))}return Object.assign({},_,(n={},n[w]=S?v+"px":"",n[b]=k?h+"px":"",n.transform="",n))}function m1(t){var n=t.state,e=t.options,o=e.gpuAcceleration,r=o===void 0?!0:o,i=e.adaptive,a=i===void 0?!0:i,c=e.roundOffsets,l=c===void 0?!0:c,u={placement:an(n.placement),variation:Ao(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:r,isFixed:n.options.strategy==="fixed"};n.modifiersData.popperOffsets!=null&&(n.styles.popper=Object.assign({},n.styles.popper,Cl(Object.assign({},u,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:l})))),n.modifiersData.arrow!=null&&(n.styles.arrow=Object.assign({},n.styles.arrow,Cl(Object.assign({},u,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})}const g1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:m1,data:{}};var Br={passive:!0};function v1(t){var n=t.state,e=t.instance,o=t.options,r=o.scroll,i=r===void 0?!0:r,a=o.resize,c=a===void 0?!0:a,l=$t(n.elements.popper),u=[].concat(n.scrollParents.reference,n.scrollParents.popper);return i&&u.forEach(function(f){f.addEventListener("scroll",e.update,Br)}),c&&l.addEventListener("resize",e.update,Br),function(){i&&u.forEach(function(f){f.removeEventListener("scroll",e.update,Br)}),c&&l.removeEventListener("resize",e.update,Br)}}const y1={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:v1,data:{}};var w1={left:"right",right:"left",bottom:"top",top:"bottom"};function Yr(t){return t.replace(/left|right|bottom|top/g,function(n){return w1[n]})}var b1={start:"end",end:"start"};function kl(t){return t.replace(/start|end/g,function(n){return b1[n]})}function $s(t){var n=$t(t),e=n.pageXOffset,o=n.pageYOffset;return{scrollLeft:e,scrollTop:o}}function zs(t){return Po(Ln(t)).left+$s(t).scrollLeft}function x1(t,n){var e=$t(t),o=Ln(t),r=e.visualViewport,i=o.clientWidth,a=o.clientHeight,c=0,l=0;if(r){i=r.width,a=r.height;var u=Ip();(u||!u&&n==="fixed")&&(c=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:c+zs(t),y:l}}function C1(t){var n,e=Ln(t),o=$s(t),r=(n=t.ownerDocument)==null?void 0:n.body,i=Qn(e.scrollWidth,e.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Qn(e.scrollHeight,e.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),c=-o.scrollLeft+zs(t),l=-o.scrollTop;return gn(r||e).direction==="rtl"&&(c+=Qn(e.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:c,y:l}}function Us(t){var n=gn(t),e=n.overflow,o=n.overflowX,r=n.overflowY;return/auto|scroll|overlay|hidden/.test(e+r+o)}function Mp(t){return["html","body","#document"].indexOf(cn(t))>=0?t.ownerDocument.body:Yt(t)&&Us(t)?t:Mp(Ri(t))}function sr(t,n){var e;n===void 0&&(n=[]);var o=Mp(t),r=o===((e=t.ownerDocument)==null?void 0:e.body),i=$t(o),a=r?[i].concat(i.visualViewport||[],Us(o)?o:[]):o,c=n.concat(a);return r?c:c.concat(sr(Ri(a)))}function ns(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function k1(t,n){var e=Po(t,!1,n==="fixed");return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function Sl(t,n,e){return n===Op?ns(x1(t,e)):io(n)?k1(n,e):ns(C1(Ln(t)))}function S1(t){var n=sr(Ri(t)),e=["absolute","fixed"].indexOf(gn(t).position)>=0,o=e&&Yt(t)?Cr(t):t;return io(o)?n.filter(function(r){return io(r)&&Pp(r,o)&&cn(r)!=="body"}):[]}function E1(t,n,e,o){var r=n==="clippingParents"?S1(t):[].concat(n),i=[].concat(r,[e]),a=i[0],c=i.reduce(function(l,u){var f=Sl(t,u,o);return l.top=Qn(f.top,l.top),l.right=fi(f.right,l.right),l.bottom=fi(f.bottom,l.bottom),l.left=Qn(f.left,l.left),l},Sl(t,a,o));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function _p(t){var n=t.reference,e=t.element,o=t.placement,r=o?an(o):null,i=o?Ao(o):null,a=n.x+n.width/2-e.width/2,c=n.y+n.height/2-e.height/2,l;switch(r){case Mt:l={x:a,y:n.y-e.height};break;case Zt:l={x:a,y:n.y+n.height};break;case Kt:l={x:n.x+n.width,y:c};break;case _t:l={x:n.x-e.width,y:c};break;default:l={x:n.x,y:n.y}}var u=r?Ws(r):null;if(u!=null){var f=u==="y"?"height":"width";switch(i){case No:l[u]=l[u]-(n[f]/2-e[f]/2);break;case hr:l[u]=l[u]+(n[f]/2-e[f]/2);break}}return l}function mr(t,n){n===void 0&&(n={});var e=n,o=e.placement,r=o===void 0?t.placement:o,i=e.strategy,a=i===void 0?t.strategy:i,c=e.boundary,l=c===void 0?Vv:c,u=e.rootBoundary,f=u===void 0?Op:u,d=e.elementContext,p=d===void 0?Yo:d,h=e.altBoundary,m=h===void 0?!1:h,v=e.padding,y=v===void 0?0:v,k=Tp(typeof y!="number"?y:Dp(y,xr)),S=p===Yo?Gv:Yo,b=t.rects.popper,w=t.elements[m?S:p],E=E1(io(w)?w:w.contextElement||Ln(t.elements.popper),l,f,a),O=Po(t.elements.reference),F=_p({reference:O,element:b,strategy:"absolute",placement:r}),R=ns(Object.assign({},b,F)),U=p===Yo?R:O,K={top:E.top-U.top+k.top,bottom:U.bottom-E.bottom+k.bottom,left:E.left-U.left+k.left,right:U.right-E.right+k.right},_=t.modifiersData.offset;if(p===Yo&&_){var A=_[r];Object.keys(K).forEach(function(me){var de=[Kt,Zt].indexOf(me)>=0?1:-1,re=[Mt,Zt].indexOf(me)>=0?"y":"x";K[me]+=A[re]*de})}return K}function j1(t,n){n===void 0&&(n={});var e=n,o=e.placement,r=e.boundary,i=e.rootBoundary,a=e.padding,c=e.flipVariations,l=e.allowedAutoPlacements,u=l===void 0?Np:l,f=Ao(o),d=f?c?bl:bl.filter(function(m){return Ao(m)===f}):xr,p=d.filter(function(m){return u.indexOf(m)>=0});p.length===0&&(p=d);var h=p.reduce(function(m,v){return m[v]=mr(t,{placement:v,boundary:r,rootBoundary:i,padding:a})[an(v)],m},{});return Object.keys(h).sort(function(m,v){return h[m]-h[v]})}function O1(t){if(an(t)===Fs)return[];var n=Yr(t);return[kl(t),n,kl(n)]}function N1(t){var n=t.state,e=t.options,o=t.name;if(!n.modifiersData[o]._skip){for(var r=e.mainAxis,i=r===void 0?!0:r,a=e.altAxis,c=a===void 0?!0:a,l=e.fallbackPlacements,u=e.padding,f=e.boundary,d=e.rootBoundary,p=e.altBoundary,h=e.flipVariations,m=h===void 0?!0:h,v=e.allowedAutoPlacements,y=n.options.placement,k=an(y),S=k===y,b=l||(S||!m?[Yr(y)]:O1(y)),w=[y].concat(b).reduce(function(H,P){return H.concat(an(P)===Fs?j1(n,{placement:P,boundary:f,rootBoundary:d,padding:u,flipVariations:m,allowedAutoPlacements:v}):P)},[]),E=n.rects.reference,O=n.rects.popper,F=new Map,R=!0,U=w[0],K=0;K<w.length;K++){var _=w[K],A=an(_),me=Ao(_)===No,de=[Mt,Zt].indexOf(A)>=0,re=de?"width":"height",ye=mr(n,{placement:_,boundary:f,rootBoundary:d,altBoundary:p,padding:u}),pe=de?me?Kt:_t:me?Zt:Mt;E[re]>O[re]&&(pe=Yr(pe));var xe=Yr(pe),ae=[];if(i&&ae.push(ye[A]<=0),c&&ae.push(ye[pe]<=0,ye[xe]<=0),ae.every(function(H){return H})){U=_,R=!1;break}F.set(_,ae)}if(R)for(var B=m?3:1,X=function(P){var T=w.find(function(W){var q=F.get(W);if(q)return q.slice(0,P).every(function(Z){return Z})});if(T)return U=T,"break"},Y=B;Y>0;Y--){var J=X(Y);if(J==="break")break}n.placement!==U&&(n.modifiersData[o]._skip=!0,n.placement=U,n.reset=!0)}}const I1={name:"flip",enabled:!0,phase:"main",fn:N1,requiresIfExists:["offset"],data:{_skip:!1}};function El(t,n,e){return e===void 0&&(e={x:0,y:0}),{top:t.top-n.height-e.y,right:t.right-n.width+e.x,bottom:t.bottom-n.height+e.y,left:t.left-n.width-e.x}}function jl(t){return[Mt,Kt,Zt,_t].some(function(n){return t[n]>=0})}function P1(t){var n=t.state,e=t.name,o=n.rects.reference,r=n.rects.popper,i=n.modifiersData.preventOverflow,a=mr(n,{elementContext:"reference"}),c=mr(n,{altBoundary:!0}),l=El(a,o),u=El(c,r,i),f=jl(l),d=jl(u);n.modifiersData[e]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:d},n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}const A1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:P1};function T1(t,n,e){var o=an(t),r=[_t,Mt].indexOf(o)>=0?-1:1,i=typeof e=="function"?e(Object.assign({},n,{placement:t})):e,a=i[0],c=i[1];return a=a||0,c=(c||0)*r,[_t,Kt].indexOf(o)>=0?{x:c,y:a}:{x:a,y:c}}function D1(t){var n=t.state,e=t.options,o=t.name,r=e.offset,i=r===void 0?[0,0]:r,a=Np.reduce(function(f,d){return f[d]=T1(d,n.rects,i),f},{}),c=a[n.placement],l=c.x,u=c.y;n.modifiersData.popperOffsets!=null&&(n.modifiersData.popperOffsets.x+=l,n.modifiersData.popperOffsets.y+=u),n.modifiersData[o]=a}const M1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:D1};function _1(t){var n=t.state,e=t.name;n.modifiersData[e]=_p({reference:n.rects.reference,element:n.rects.popper,strategy:"absolute",placement:n.placement})}const L1={name:"popperOffsets",enabled:!0,phase:"read",fn:_1,data:{}};function R1(t){return t==="x"?"y":"x"}function F1(t){var n=t.state,e=t.options,o=t.name,r=e.mainAxis,i=r===void 0?!0:r,a=e.altAxis,c=a===void 0?!1:a,l=e.boundary,u=e.rootBoundary,f=e.altBoundary,d=e.padding,p=e.tether,h=p===void 0?!0:p,m=e.tetherOffset,v=m===void 0?0:m,y=mr(n,{boundary:l,rootBoundary:u,padding:d,altBoundary:f}),k=an(n.placement),S=Ao(n.placement),b=!S,w=Ws(k),E=R1(w),O=n.modifiersData.popperOffsets,F=n.rects.reference,R=n.rects.popper,U=typeof v=="function"?v(Object.assign({},n.rects,{placement:n.placement})):v,K=typeof U=="number"?{mainAxis:U,altAxis:U}:Object.assign({mainAxis:0,altAxis:0},U),_=n.modifiersData.offset?n.modifiersData.offset[n.placement]:null,A={x:0,y:0};if(O){if(i){var me,de=w==="y"?Mt:_t,re=w==="y"?Zt:Kt,ye=w==="y"?"height":"width",pe=O[w],xe=pe+y[de],ae=pe-y[re],B=h?-R[ye]/2:0,X=S===No?F[ye]:R[ye],Y=S===No?-R[ye]:-F[ye],J=n.elements.arrow,H=h&&J?Hs(J):{width:0,height:0},P=n.modifiersData["arrow#persistent"]?n.modifiersData["arrow#persistent"].padding:Ap(),T=P[de],W=P[re],q=ar(0,F[ye],H[ye]),Z=b?F[ye]/2-B-q-T-K.mainAxis:X-q-T-K.mainAxis,ie=b?-F[ye]/2+B+q+W+K.mainAxis:Y+q+W+K.mainAxis,oe=n.elements.arrow&&Cr(n.elements.arrow),I=oe?w==="y"?oe.clientTop||0:oe.clientLeft||0:0,Ce=(me=_==null?void 0:_[w])!=null?me:0,ke=pe+Z-Ce-I,Ae=pe+ie-Ce,Pe=ar(h?fi(xe,ke):xe,pe,h?Qn(ae,Ae):ae);O[w]=Pe,A[w]=Pe-pe}if(c){var Te,he=w==="x"?Mt:_t,C=w==="x"?Zt:Kt,x=O[E],j=E==="y"?"height":"width",N=x+y[he],L=x-y[C],ne=[Mt,_t].indexOf(k)!==-1,ve=(Te=_==null?void 0:_[E])!=null?Te:0,$=ne?N:x-F[j]-R[j]-ve+K.altAxis,V=ne?x+F[j]+R[j]-ve-K.altAxis:L,z=h&&ne?c1($,x,V):ar(h?$:N,x,h?V:L);O[E]=z,A[E]=z-x}n.modifiersData[o]=A}}const B1={name:"preventOverflow",enabled:!0,phase:"main",fn:F1,requiresIfExists:["offset"]};function H1(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function W1(t){return t===$t(t)||!Yt(t)?$s(t):H1(t)}function $1(t){var n=t.getBoundingClientRect(),e=Io(n.width)/t.offsetWidth||1,o=Io(n.height)/t.offsetHeight||1;return e!==1||o!==1}function z1(t,n,e){e===void 0&&(e=!1);var o=Yt(n),r=Yt(n)&&$1(n),i=Ln(n),a=Po(t,r,e),c={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(o||!o&&!e)&&((cn(n)!=="body"||Us(i))&&(c=W1(n)),Yt(n)?(l=Po(n,!0),l.x+=n.clientLeft,l.y+=n.clientTop):i&&(l.x=zs(i))),{x:a.left+c.scrollLeft-l.x,y:a.top+c.scrollTop-l.y,width:a.width,height:a.height}}function U1(t){var n=new Map,e=new Set,o=[];t.forEach(function(i){n.set(i.name,i)});function r(i){e.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(c){if(!e.has(c)){var l=n.get(c);l&&r(l)}}),o.push(i)}return t.forEach(function(i){e.has(i.name)||r(i)}),o}function V1(t){var n=U1(t);return n1.reduce(function(e,o){return e.concat(n.filter(function(r){return r.phase===o}))},[])}function G1(t){var n;return function(){return n||(n=new Promise(function(e){Promise.resolve().then(function(){n=void 0,e(t())})})),n}}function Y1(t){var n=t.reduce(function(e,o){var r=e[o.name];return e[o.name]=r?Object.assign({},r,o,{options:Object.assign({},r.options,o.options),data:Object.assign({},r.data,o.data)}):o,e},{});return Object.keys(n).map(function(e){return n[e]})}var Ol={placement:"bottom",modifiers:[],strategy:"absolute"};function Nl(){for(var t=arguments.length,n=new Array(t),e=0;e<t;e++)n[e]=arguments[e];return!n.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function Z1(t){t===void 0&&(t={});var n=t,e=n.defaultModifiers,o=e===void 0?[]:e,r=n.defaultOptions,i=r===void 0?Ol:r;return function(c,l,u){u===void 0&&(u=i);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ol,i),modifiersData:{},elements:{reference:c,popper:l},attributes:{},styles:{}},d=[],p=!1,h={state:f,setOptions:function(k){var S=typeof k=="function"?k(f.options):k;v(),f.options=Object.assign({},i,f.options,S),f.scrollParents={reference:io(c)?sr(c):c.contextElement?sr(c.contextElement):[],popper:sr(l)};var b=V1(Y1([].concat(o,f.options.modifiers)));return f.orderedModifiers=b.filter(function(w){return w.enabled}),m(),h.update()},forceUpdate:function(){if(!p){var k=f.elements,S=k.reference,b=k.popper;if(Nl(S,b)){f.rects={reference:z1(S,Cr(b),f.options.strategy==="fixed"),popper:Hs(b)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(K){return f.modifiersData[K.name]=Object.assign({},K.data)});for(var w=0;w<f.orderedModifiers.length;w++){if(f.reset===!0){f.reset=!1,w=-1;continue}var E=f.orderedModifiers[w],O=E.fn,F=E.options,R=F===void 0?{}:F,U=E.name;typeof O=="function"&&(f=O({state:f,options:R,name:U,instance:h})||f)}}}},update:G1(function(){return new Promise(function(y){h.forceUpdate(),y(f)})}),destroy:function(){v(),p=!0}};if(!Nl(c,l))return h;h.setOptions(u).then(function(y){!p&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){f.orderedModifiers.forEach(function(y){var k=y.name,S=y.options,b=S===void 0?{}:S,w=y.effect;if(typeof w=="function"){var E=w({state:f,name:k,instance:h,options:b}),O=function(){};d.push(E||O)}})}function v(){d.forEach(function(y){return y()}),d=[]}return h}}var K1=[y1,L1,g1,i1,M1,I1,B1,f1,A1],q1=Z1({defaultModifiers:K1}),J1=typeof Element<"u",X1=typeof Map=="function",Q1=typeof Set=="function",ey=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Zr(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var e,o,r;if(Array.isArray(t)){if(e=t.length,e!=n.length)return!1;for(o=e;o--!==0;)if(!Zr(t[o],n[o]))return!1;return!0}var i;if(X1&&t instanceof Map&&n instanceof Map){if(t.size!==n.size)return!1;for(i=t.entries();!(o=i.next()).done;)if(!n.has(o.value[0]))return!1;for(i=t.entries();!(o=i.next()).done;)if(!Zr(o.value[1],n.get(o.value[0])))return!1;return!0}if(Q1&&t instanceof Set&&n instanceof Set){if(t.size!==n.size)return!1;for(i=t.entries();!(o=i.next()).done;)if(!n.has(o.value[0]))return!1;return!0}if(ey&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(n)){if(e=t.length,e!=n.length)return!1;for(o=e;o--!==0;)if(t[o]!==n[o])return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof n.valueOf=="function")return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof n.toString=="function")return t.toString()===n.toString();if(r=Object.keys(t),e=r.length,e!==Object.keys(n).length)return!1;for(o=e;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,r[o]))return!1;if(J1&&t instanceof Element)return!1;for(o=e;o--!==0;)if(!((r[o]==="_owner"||r[o]==="__v"||r[o]==="__o")&&t.$$typeof)&&!Zr(t[r[o]],n[r[o]]))return!1;return!0}return t!==t&&n!==n}var ty=function(n,e){try{return Zr(n,e)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}};const ny=_i(ty);var oy=[],ry=function(n,e,o){o===void 0&&(o={});var r=D.useRef(null),i={onFirstUpdate:o.onFirstUpdate,placement:o.placement||"bottom",strategy:o.strategy||"absolute",modifiers:o.modifiers||oy},a=D.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),c=a[0],l=a[1],u=D.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(h){var m=h.state,v=Object.keys(m.elements);Kl.flushSync(function(){l({styles:yl(v.map(function(y){return[y,m.styles[y]||{}]})),attributes:yl(v.map(function(y){return[y,m.attributes[y]]}))})})},requires:["computeStyles"]}},[]),f=D.useMemo(function(){var p={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[u,{name:"applyStyles",enabled:!1}])};return ny(r.current,p)?r.current||p:(r.current=p,p)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,u]),d=D.useRef();return wl(function(){d.current&&d.current.setOptions(f)},[f]),wl(function(){if(!(n==null||e==null)){var p=o.createPopper||q1,h=p(n,e,f);return d.current=h,function(){h.destroy(),d.current=null}}},[n,e,o.createPopper]),{state:d.current?d.current.state:null,styles:c.styles,attributes:c.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}},iy=["className","cssModule","size","vertical","tag"];function os(){return os=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},os.apply(this,arguments)}function Il(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function ay(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?Il(Object(e),!0).forEach(function(o){sy(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Il(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function sy(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function cy(t,n){if(t==null)return{};var e=ly(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function ly(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}var uy={"aria-label":Q.string,className:Q.string,cssModule:Q.object,role:Q.string,size:Q.string,tag:Rs,vertical:Q.bool};function Lp(t){var n=t.className,e=t.cssModule,o=t.size,r=t.vertical,i=t.tag,a=i===void 0?"div":i,c=cy(t,iy),l=Li(et(n,o?"btn-group-"+o:!1,r?"btn-group-vertical":"btn-group"),e);return g.createElement(a,os({},ay({role:"group"},c),{className:l}))}Lp.propTypes=uy;function dy(t,n){if(t==null)return{};var e={};for(var o in t)if({}.hasOwnProperty.call(t,o)){if(n.indexOf(o)!==-1)continue;e[o]=t[o]}return e}function rs(t,n){return rs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,o){return e.__proto__=o,e},rs(t,n)}function fy(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,rs(t,n)}const Pl={disabled:!1};var py=process.env.NODE_ENV!=="production"?Q.oneOfType([Q.number,Q.shape({enter:Q.number,exit:Q.number,appear:Q.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&Q.oneOfType([Q.string,Q.shape({enter:Q.string,exit:Q.string,active:Q.string}),Q.shape({enter:Q.string,enterDone:Q.string,enterActive:Q.string,exit:Q.string,exitDone:Q.string,exitActive:Q.string})]);const Rp=g.createContext(null);var hy=function(n){return n.scrollTop},tr="unmounted",Hn="exited",Wn="entering",vo="entered",is="exiting",wn=function(t){fy(n,t);function n(o,r){var i;i=t.call(this,o,r)||this;var a=r,c=a&&!a.isMounting?o.enter:o.appear,l;return i.appearStatus=null,o.in?c?(l=Hn,i.appearStatus=Wn):l=vo:o.unmountOnExit||o.mountOnEnter?l=tr:l=Hn,i.state={status:l},i.nextCallback=null,i}n.getDerivedStateFromProps=function(r,i){var a=r.in;return a&&i.status===tr?{status:Hn}:null};var e=n.prototype;return e.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},e.componentDidUpdate=function(r){var i=null;if(r!==this.props){var a=this.state.status;this.props.in?a!==Wn&&a!==vo&&(i=Wn):(a===Wn||a===vo)&&(i=is)}this.updateStatus(!1,i)},e.componentWillUnmount=function(){this.cancelNextCallback()},e.getTimeouts=function(){var r=this.props.timeout,i,a,c;return i=a=c=r,r!=null&&typeof r!="number"&&(i=r.exit,a=r.enter,c=r.appear!==void 0?r.appear:a),{exit:i,enter:a,appear:c}},e.updateStatus=function(r,i){if(r===void 0&&(r=!1),i!==null)if(this.cancelNextCallback(),i===Wn){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:jn.findDOMNode(this);a&&hy(a)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Hn&&this.setState({status:tr})},e.performEnter=function(r){var i=this,a=this.props.enter,c=this.context?this.context.isMounting:r,l=this.props.nodeRef?[c]:[jn.findDOMNode(this),c],u=l[0],f=l[1],d=this.getTimeouts(),p=c?d.appear:d.enter;if(!r&&!a||Pl.disabled){this.safeSetState({status:vo},function(){i.props.onEntered(u)});return}this.props.onEnter(u,f),this.safeSetState({status:Wn},function(){i.props.onEntering(u,f),i.onTransitionEnd(p,function(){i.safeSetState({status:vo},function(){i.props.onEntered(u,f)})})})},e.performExit=function(){var r=this,i=this.props.exit,a=this.getTimeouts(),c=this.props.nodeRef?void 0:jn.findDOMNode(this);if(!i||Pl.disabled){this.safeSetState({status:Hn},function(){r.props.onExited(c)});return}this.props.onExit(c),this.safeSetState({status:is},function(){r.props.onExiting(c),r.onTransitionEnd(a.exit,function(){r.safeSetState({status:Hn},function(){r.props.onExited(c)})})})},e.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},e.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},e.setNextCallback=function(r){var i=this,a=!0;return this.nextCallback=function(c){a&&(a=!1,i.nextCallback=null,r(c))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},e.onTransitionEnd=function(r,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:jn.findDOMNode(this),c=r==null&&!this.props.addEndListener;if(!a||c){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],f=l[1];this.props.addEndListener(u,f)}r!=null&&setTimeout(this.nextCallback,r)},e.render=function(){var r=this.state.status;if(r===tr)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var c=dy(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return g.createElement(Rp.Provider,{value:null},typeof a=="function"?a(r,c):g.cloneElement(g.Children.only(a),c))},n}(g.Component);wn.contextType=Rp;wn.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:Q.shape({current:typeof Element>"u"?Q.any:function(t,n,e,o,r,i){var a=t[n];return Q.instanceOf(a&&"ownerDocument"in a?a.ownerDocument.defaultView.Element:Element)(t,n,e,o,r,i)}}),children:Q.oneOfType([Q.func.isRequired,Q.element.isRequired]).isRequired,in:Q.bool,mountOnEnter:Q.bool,unmountOnExit:Q.bool,appear:Q.bool,enter:Q.bool,exit:Q.bool,timeout:function(n){var e=py;n.addEndListener||(e=e.isRequired);for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return e.apply(void 0,[n].concat(r))},addEndListener:Q.func,onEnter:Q.func,onEntering:Q.func,onEntered:Q.func,onExit:Q.func,onExiting:Q.func,onExited:Q.func}:{};function uo(){}wn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:uo,onEntering:uo,onEntered:uo,onExit:uo,onExiting:uo,onExited:uo};wn.UNMOUNTED=tr;wn.EXITED=Hn;wn.ENTERING=Wn;wn.ENTERED=vo;wn.EXITING=is;const Vs=wn;function as(t){"@babel/helpers - typeof";return as=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},as(t)}var my=["tag","horizontal","isOpen","className","navbar","cssModule","children","innerRef"],fo;function pi(){return pi=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},pi.apply(this,arguments)}function gy(t,n){if(t==null)return{};var e=vy(t,n),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)o=i[r],!(n.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(e[o]=t[o])}return e}function vy(t,n){if(t==null)return{};var e={},o=Object.keys(t),r,i;for(i=0;i<o.length;i++)r=o[i],!(n.indexOf(r)>=0)&&(e[r]=t[r]);return e}function yy(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function Al(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function wy(t,n,e){return n&&Al(t.prototype,n),e&&Al(t,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function by(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&ss(t,n)}function ss(t,n){return ss=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},ss(t,n)}function xy(t){var n=ky();return function(){var o=hi(t),r;if(n){var i=hi(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return Cy(this,r)}}function Cy(t,n){if(n&&(as(n)==="object"||typeof n=="function"))return n;if(n!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Fp(t)}function Fp(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function ky(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function hi(t){return hi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hi(t)}function Tl(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);n&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),e.push.apply(e,o)}return e}function To(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?arguments[n]:{};n%2?Tl(Object(e),!0).forEach(function(o){bo(t,o,e[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):Tl(Object(e)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(e,o))})}return t}function bo(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var Sy=To(To({},Vs.propTypes),{},{horizontal:Q.bool,isOpen:Q.bool,children:Q.oneOfType([Q.arrayOf(Q.node),Q.node]),tag:Rs,className:Q.node,navbar:Q.bool,cssModule:Q.object,innerRef:Q.shape({current:Q.object})}),Ey=To(To({},Vs.defaultProps),{},{horizontal:!1,isOpen:!1,appear:!1,enter:!0,exit:!0,tag:"div",timeout:Mv.Collapse}),jy=(fo={},bo(fo,Fr.ENTERING,"collapsing"),bo(fo,Fr.ENTERED,"collapse show"),bo(fo,Fr.EXITING,"collapsing"),bo(fo,Fr.EXITED,"collapse"),fo);function Oy(t){return jy[t]||"collapse"}var Gs=function(t){by(e,t);var n=xy(e);function e(o){var r;return yy(this,e),r=n.call(this,o),r.state={dimension:null},r.nodeRef=o.innerRef||g.createRef(),["onEntering","onEntered","onExit","onExiting","onExited"].forEach(function(i){r[i]=r[i].bind(Fp(r))}),r}return wy(e,[{key:"onEntering",value:function(r,i){var a=this.getNode();this.setState({dimension:this.getDimension(a)}),this.props.onEntering(a,i)}},{key:"onEntered",value:function(r,i){var a=this.getNode();this.setState({dimension:null}),this.props.onEntered(a,i)}},{key:"onExit",value:function(){var r=this.getNode();this.setState({dimension:this.getDimension(r)}),this.props.onExit(r)}},{key:"onExiting",value:function(){var r=this.getNode();this.getDimension(r),this.setState({dimension:0}),this.props.onExiting(r)}},{key:"onExited",value:function(){var r=this.getNode();this.setState({dimension:null}),this.props.onExited(r)}},{key:"getNode",value:function(){return this.nodeRef.current}},{key:"getDimension",value:function(r){return this.props.horizontal?r.scrollWidth:r.scrollHeight}},{key:"render",value:function(){var r=this,i=this.props,a=i.tag,c=i.horizontal,l=i.isOpen,u=i.className,f=i.navbar,d=i.cssModule,p=i.children;i.innerRef;var h=gy(i,my),m=this.state.dimension,v=Av(h,gl),y=Pv(h,gl);return g.createElement(Vs,pi({},v,{in:l,nodeRef:this.nodeRef,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}),function(k){var S=Oy(k),b=Li(et(u,c&&"collapse-horizontal",S,f&&"navbar-collapse"),d),w=m===null?null:bo({},c?"width":"height",m);return g.createElement(a,pi({},y,{style:To(To({},y.style),w),className:b,ref:r.nodeRef}),p)})}}]),e}(g.Component);Gs.propTypes=Sy;Gs.defaultProps=Ey;const Bp=Gs,Ny=t=>{const{className:n,isOpen:e,showCollapseIcon:o,showFolderIcon:r,title:i,...a}=t;return s.jsx(ut.ItemHeader,{className:et("io-base-section-header",n),prepend:r&&s.jsx(ot,{size:"16",variant:e?"folder-open":"folder","data-testid":"base-section-header-folder-icon"}),append:o&&s.jsx(ot,{className:et("collapse-icon",!e&&"collapsed"),size:"10",variant:"expand","data-testid":"base-section-header-collapse-icon"}),tooltip:i,...a,children:i})},Hp=()=>{const[t,n]=g.useState([]),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=l=>{const{name:u,title:f,caption:d,icon:p,userProperties:h}=l;return{id:u,name:u,title:f??u,caption:d,icon:p,userProperties:h}},r=e.appManager.onAppAdded(l=>{if(l.userProperties.hidden||"hidden"in l&&l.hidden)return;const u=o(l);n(f=>[...f,u])}),i=e.appManager.onAppChanged(l=>{if(l.userProperties.hidden||"hidden"in l&&l.hidden)return;const u=o(l);n(f=>[...f.filter(d=>d.id!==u.id),u])}),a=e.appManager.onAppRemoved(l=>{const u=o(l);n(f=>f.filter(d=>d.id!==u.id))}),c=[r,a,i];return()=>c.forEach(l=>l())},[e]),t},Iy=()=>{const[t,n]=g.useState({}),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=e.appManager.onInstanceStarted(a=>{n(c=>{const l=c[a.application.name]??[];return{...c,[a.application.name]:[...l,a.id]}})}),r=e.appManager.onInstanceStopped(a=>{n(c=>{const l=c[a.application.name];return l?{...c,[a.application.name]:l.filter(u=>u!==a.id)}:c})}),i=[o,r];return()=>i.forEach(a=>a())},[e]),t},Py=t=>{g.useEffect(()=>{var e;if(!((e=window.iobrowser)!=null&&e.platformStarted)||t)return;const n=o=>{o.preventDefault(),o.returnValue=!0};return window.addEventListener("beforeunload",n),()=>window.removeEventListener("beforeunload",n)},[t])},Ys=()=>{const[t,n]=g.useState(),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{var o;try{const i=!((o=e.windows.my())!=null&&o.name)?Eo.getFrameId():void 0;n(i)}catch(r){console.error("Failed to get the current frame ID ",{error:r})}},[e,Eo.getFrameId,n]),t},Le={SUCCESS:"success",WARNING:"warning"},Ay={success:5*1e3,warning:10*1e3},Fe=async t=>{const{io:n,variant:e,text:o,error:r}=t,i=Ka(r);try{if(e===Le.WARNING&&n.logger.warn(i?`${o} ${i}`:o),!("modals"in n&&n.modals))throw new Error("Modals are not enabled.");const a={text:o,variant:e,ttl:Ay[e]};await n.modals.alerts.request(a)}catch(a){n.logger.warn(`Failed to request alert. ${Ka(a)}`)}},Ty=async t=>{var o;const{io:n,item:e}=t;try{await((o=n.appManager.application(e.id))==null?void 0:o.start())}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to start app "${e.title}" in a new window.`,error:r})}},Dy=async t=>{const{io:n,item:e,frameId:o}=t;if(!n.workspaces)return;const r={type:"workspace",definition:{frame:o?{reuseFrameId:o}:{newFrame:!0}}},i=n.workspaces.getBuilder(r);i.addGroup().addWindow({appName:e.id});try{await i.create()}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to start app "${e.title}" in a new Workspace.`,error:a})}},My={[ci.OPEN_IN_NEW_WINDOW]:Ty,[ci.OPEN_IN_NEW_WORKSPACE]:Dy},Wp=()=>{const t=g.useContext(Me.IOConnectContext),n=Ys();return(e,o)=>{My[o]({io:t,item:e,frameId:n})}},Lo={NO_INPUTS_CONFIRMATION_DIALOG:"noInputsConfirmationDialog",SINGLE_CHECKBOX_DIALOG:"singleCheckboxDialog",SINGLE_TEXT_INPUT_DIALOG:"singleTextInputDialog"},Zs="(.|\\s)*\\S(.|\\s)*",_y=async t=>{var i;const{io:n,layout:e,showDeletePromptPref:o,updateShowDeletePromptPref:r}=t;if("modals"in n&&n.modals&&o){const a="delete",c="do-not-ask-again",{isEnterPressed:l,responseButtonClicked:u,inputs:f}=await n.modals.dialogs.request({templateName:Lo.SINGLE_CHECKBOX_DIALOG,variables:{heading:`Delete Layout "${e.name}"`,text:"Are you sure you want to delete this Layout?",checkbox:{id:c,label:"Don't ask me again"},actionButtons:[{variant:"critical",text:"Delete",id:a},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(((i=f==null?void 0:f.find(h=>h.id===c))==null?void 0:i.checked)&&r(!1),!(l||(u==null?void 0:u.id)===a))return}try{await n.layouts.remove("Global",e.name),e.isDefault&&await n.layouts.clearDefaultGlobal(),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully deleted.`})}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to delete Layout "${e.name}".`,error:a})}},Ly=async t=>{var d;const{io:n,layout:e,setDefaultLayout:o}=t;if(!("modals"in n&&n.modals)){console.error("Cannot rename Layout because io dialogs are not enabled");return}const r="rename",i="new-layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await n.modals.dialogs.request({templateName:Lo.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Rename "${e.name}"`,input:{id:i,initialValue:e.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Zs}},actionButtons:[{variant:"primary",text:"Rename",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(d=l==null?void 0:l.find(p=>p.id===i))==null?void 0:d.value;if(a||(c==null?void 0:c.id)===r){if(u===e.name){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}". The new Layout name must be different from the current one.`});return}try{if((await n.layouts.getAll("Global")).find(m=>m.name===u)){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}" to "${u}". A Layout with name "${u}" already exists.`});return}const h=await n.layouts.get(e.name,"Global");if(!h){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}". The Layout wasn't found.`});return}await n.layouts.rename(h,u),e.isDefault&&await o({name:u}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully renamed to "${u}".`})}catch(p){await Fe({io:n,variant:Le.WARNING,text:`Failed to rename Layout "${e.name}".`,error:p})}}},Ry=async t=>{const{io:n,layout:e}=t;try{await n.layouts.save({name:e.name,type:"Global"}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was saved successfully.`})}catch(o){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${e.name}".`,error:o})}},Fy=async t=>{var d;const{io:n,layout:e,setActiveLayout:o}=t;if(!("modals"in n&&n.modals)){console.error("Cannot save Layout under a new name because io dialogs are not enabled");return}const r="save-as",i="layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await n.modals.dialogs.request({templateName:Lo.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Save Layout "${e.name}" as`,input:{id:i,initialValue:e.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Zs}},actionButtons:[{variant:"primary",text:"Save as",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(d=l==null?void 0:l.find(p=>p.id===i))==null?void 0:d.value;if(a||(c==null?void 0:c.id)===r){if(u===e.name){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout as "${u}". The new Layout must have a unique name.`});return}try{if((await n.layouts.getAll("Global")).find(m=>m.name===u)){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout as "${u}". A Layout with this name already exists.`});return}const h=await n.layouts.get(e.name,"Global");if(!h){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${e.name}". The Layout wasn't found.`});return}await n.layouts.import([{...h,name:u}],"merge"),e.isActive&&o({name:u}),await Fe({io:n,variant:Le.SUCCESS,text:`The Layout was successfully saved as "${u}".`})}catch(p){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${u}".`,error:p})}}},By=async t=>{const{io:n,layout:e,setDefaultLayout:o}=t;try{await o({name:e.name}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was successfully set as the default Layout.`})}catch{await Fe({io:n,variant:Le.WARNING,text:`Failed to set Layout "${e.name}" as the default Layout.`})}},Hy=async t=>{const{io:n,layout:e,closeLaunchpad:o}=t;try{await n.layouts.restore({name:e.name}),o(),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${e.name}" was loaded successfully.`})}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to load Layout "${e.name}".`,error:r})}},Wy={delete:_y,rename:Ly,save:Ry,saveAs:Fy,setAsDefault:By,load:Hy},$y="interopio_home_ui_auth0_validation_error",zy="interopio_home_ui_user",Uy="interopio_home_ui_platform_window",kr="interopio_home_ui_platform_setup",$p="interopio_home_ui_active_layout";var gt=function(t){return{ok:!0,result:t}},st=function(t){return{ok:!1,error:t}},Vy=function(t){return t.ok===!0?Promise.resolve(t.result):Promise.reject(t.error)},Gy=function(t,n){return n.ok===!0?n.result:t},Yy=function(t){if(t.ok===!0)return t.result;throw t.error},Zy=function(t,n){return n.ok===!0?gt(t(n.result)):n},Dl=function(t,n,e){return n.ok===!1?n:e.ok===!1?e:gt(t(n.result,e.result))},ya=function(t,n){return n.ok===!0?n:st(t(n.error))},Ky=function(t,n){return n.ok===!0?t(n.result):n};/*! *****************************************************************************
36
36
  Copyright (c) Microsoft Corporation.
37
37
 
38
38
  Permission to use, copy, modify, and/or distribute this software for any