@interopio/home-ui-react 2.1.1-beta.0 → 2.1.2

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
@@ -2,14 +2,14 @@
2
2
  Copyright (c) 2018 Jed Watson.
3
3
  Licensed under the MIT License (MIT), see
4
4
  http://jedwatson.github.io/classnames
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 nt({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(nt,{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(nt,{"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(nt,{variant:o,size:r}),u??a,o&&i&&s.jsx(nt,{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(nt,{variant:m.variant,title:y?m.tooltip:void 0}),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}}/*!
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=nt;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(nt,{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(nt,{variant:l,onClick:w=>b(w)}),h&&s.jsxs("div",{"data-testid":m,id:`${t}-error`,className:"io-input-error",children:[s.jsx(nt,{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})]})});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(nt,{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(nt,{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(nt,{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 et=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-beta.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);et.init(t),g.useEffect(()=>{(async()=>{await(async()=>{try{const b=await et.getConfiguration();e(b),r(w=>({...w,...Xc(b)}))}catch(b){console.error("Error fetching configuration:",b)}})(),await(async()=>{try{const b=await et.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=et.onNotificationsChanged(O=>{a(Qc(O))}),w=et.onConfigurationChanged(O=>{const F=Xc(O);e(R=>({...R,...O})),r(R=>({...R,...F}))}),E=et.onCounterChanged(O=>{l(O)});return()=>{b(),w(),E()}},[]);const k=()=>{f(et.bulkActionsSupported)},S=async b=>{await et.setFilter(b)};return{close:b=>et.close(b),clearAll:()=>et.clearAll(),settings:o,hidePanel:async()=>{await et.hidePanel()},showPanel:async()=>{await et.showPanel()},saveFilter:S,clearAllOld:()=>et.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 et.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 et.clearMany(b)},snooze:async(b,w)=>{await et.snooze(b,w)},snoozeMany:async(b,w)=>{await et.snoozeMany(b,w)},setState:async(b,w)=>{await et.setState(b,w)},setStates:async(b,w)=>{await et.setStates(b,w)},setCount:b=>{l(b)},getNotificationsList:async()=>await et.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=et.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),tt.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>
12
- `}}function _(C,x){x===void 0&&(x=!0);var j=x?C:C-e.currentMonth;j<0&&e._hidePrevMonthArrow===!0||j>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=j,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,I("onYearChange"),O()),E(),I("onMonthChange"),Ae())}function A(C){return e.calendarContainer.contains(C)}function me(C){if(e.isOpen&&!e.config.inline){var x=Rt(C),j=A(x),N=!(x===e.input||x===e.altInput||e.element.contains(x)||C.path&&C.path.indexOf&&(~C.path.indexOf(e.input)||~C.path.indexOf(e.altInput)))&&!j&&!A(C.relatedTarget),L=!e.config.ignoredFocusElements.some(function(ne){return ne.contains(x)});N&&L&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&a(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function de(C){if(!(!C||e.config.minDate&&C<e.config.minDate.getFullYear()||e.config.maxDate&&C>e.config.maxDate.getFullYear())){var x=C,j=e.currentYear!==x;e.currentYear=x||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),j&&(e.redraw(),I("onYearChange"),O())}}function re(C,x){var j;x===void 0&&(x=!0);var N=e.parseDate(C,void 0,x);if(e.config.minDate&&N&&Ft(N,e.config.minDate,x!==void 0?x:!e.minDateHasTime)<0||e.config.maxDate&&N&&Ft(N,e.config.maxDate,x!==void 0?x:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(N===void 0)return!1;for(var L=!!e.config.enable,ne=(j=e.config.enable)!==null&&j!==void 0?j:e.config.disable,ve=0,$=void 0;ve<ne.length;ve++){if(typeof($=ne[ve])=="function"&&$(N)||$ instanceof Date&&N!==void 0&&$.getTime()===N.getTime())return L;if(typeof $=="string"){var V=e.parseDate($,void 0,!0);return V&&V.getTime()===N.getTime()?L:!L}if(typeof $=="object"&&N!==void 0&&$.from&&$.to&&N.getTime()>=$.from.getTime()&&N.getTime()<=$.to.getTime())return L}return!L}function ye(C){return e.daysContainer!==void 0&&C.className.indexOf("hidden")===-1&&C.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(C)}function pe(C){var x=C.target===e._input,j=e._input.value.trimEnd()!==Pe();!x||!j||C.relatedTarget&&A(C.relatedTarget)||e.setDate(e._input.value,!0,C.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function xe(C){var x=Rt(C),j=e.config.wrap?t.contains(x):x===e._input,N=e.config.allowInput,L=e.isOpen&&(!N||!j),ne=e.config.inline&&j&&!N;if(C.keyCode===13&&j){if(N)return e.setDate(e._input.value,!0,x===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),x.blur();e.open()}else if(A(x)||L||ne){var ve=!!e.timeContainer&&e.timeContainer.contains(x);switch(C.keyCode){case 13:ve?(C.preventDefault(),a(),T()):W(C);break;case 27:C.preventDefault(),T();break;case 8:case 46:j&&!e.config.allowInput&&(C.preventDefault(),e.clear());break;case 37:case 39:if(ve||j)e.hourElement&&e.hourElement.focus();else{C.preventDefault();var $=o();if(e.daysContainer!==void 0&&(N===!1||$&&ye($))){var V=C.keyCode===39?1:-1;C.ctrlKey?(C.stopPropagation(),_(V),b(S(1),0)):b(void 0,V)}}break;case 38:case 40:C.preventDefault();var z=C.keyCode===40?1:-1;e.daysContainer&&x.$i!==void 0||x===e.input||x===e.altInput?C.ctrlKey?(C.stopPropagation(),de(e.currentYear-z),b(S(1),0)):ve||b(void 0,7*z):x===e.currentYearElement?de(e.currentYear-z):e.config.enableTime&&(!ve&&e.hourElement&&e.hourElement.focus(),a(C),e._debouncedChange());break;case 9:if(ve){var te=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(se){return se}),le=te.indexOf(x);if(le!==-1){var ge=te[le+(C.shiftKey?-1:1)];C.preventDefault(),(ge||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(x)&&C.shiftKey&&(C.preventDefault(),e._input.focus())}}if(e.amPM!==void 0&&x===e.amPM)switch(C.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],c(),Te();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],c(),Te()}(j||A(x))&&I("onKeyDown",C)}function ae(C,x){if(x===void 0&&(x="flatpickr-day"),e.selectedDates.length===1&&(!C||C.classList.contains(x)&&!C.classList.contains("flatpickr-disabled"))){for(var j=C?C.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),N=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),L=Math.min(j,e.selectedDates[0].getTime()),ne=Math.max(j,e.selectedDates[0].getTime()),ve=!1,$=0,V=0,z=L;z<ne;z+=W0)re(new Date(z),!0)||(ve=ve||z>L&&z<ne,z<N&&(!$||z>$)?$=z:z>N&&(!V||z<V)&&(V=z));Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+x)).forEach(function(te){var le,ge,se,G=te.dateObj.getTime(),Se=$>0&&G<$||V>0&&G>V;if(Se)return te.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(Be){te.classList.remove(Be)});ve&&!Se||(["startRange","inRange","endRange","notAllowed"].forEach(function(Be){te.classList.remove(Be)}),C!==void 0&&(C.classList.add(j<=e.selectedDates[0].getTime()?"startRange":"endRange"),N<j&&G===N?te.classList.add("startRange"):N>j&&G===N&&te.classList.add("endRange"),G>=$&&(V===0||G<=V)&&(ge=N,se=j,(le=G)>Math.min(ge,se)&&le<Math.max(ge,se))&&te.classList.add("inRange")))})}}function B(){!e.isOpen||e.config.static||e.config.inline||H()}function X(C){return function(x){var j=e.config["_"+C+"Date"]=e.parseDate(x,e.config.dateFormat),N=e.config["_"+(C==="min"?"max":"min")+"Date"];j!==void 0&&(e[C==="min"?"minDateHasTime":"maxDateHasTime"]=j.getHours()>0||j.getMinutes()>0||j.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(L){return re(L)}),e.selectedDates.length||C!=="min"||l(j),Te()),e.daysContainer&&(P(),j!==void 0?e.currentYearElement[C]=j.getFullYear().toString():e.currentYearElement.removeAttribute(C),e.currentYearElement.disabled=!!N&&j!==void 0&&N.getFullYear()===j.getFullYear())}}function Y(){return e.config.wrap?t.querySelector("[data-input]"):t}function J(){typeof e.config.locale!="object"&&tt.l10ns[e.config.locale]===void 0&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=Ct(Ct({},tt.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?tt.l10ns[e.config.locale]:void 0),Gn.D="("+e.l10n.weekdays.shorthand.join("|")+")",Gn.l="("+e.l10n.weekdays.longhand.join("|")+")",Gn.M="("+e.l10n.months.shorthand.join("|")+")",Gn.F="("+e.l10n.months.longhand.join("|")+")",Gn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")",Ct(Ct({},n),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr===void 0&&tt.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Yf(e),e.parseDate=Za({config:e.config,l10n:e.l10n})}function H(C){if(typeof e.config.position!="function"){if(e.calendarContainer!==void 0){I("onPreCalendarPosition");var x=C||e._positionElement,j=Array.prototype.reduce.call(e.calendarContainer.children,function(De,Ie){return De+Ie.offsetHeight},0),N=e.calendarContainer.offsetWidth,L=e.config.position.split(" "),ne=L[0],ve=L.length>1?L[1]:null,$=x.getBoundingClientRect(),V=window.innerHeight-$.bottom,z=ne==="above"||ne!=="below"&&V<j&&$.top>j,te=window.pageYOffset+$.top+(z?-j-2:x.offsetHeight+2);if(Ot(e.calendarContainer,"arrowTop",!z),Ot(e.calendarContainer,"arrowBottom",z),!e.config.inline){var le=window.pageXOffset+$.left,ge=!1,se=!1;ve==="center"?(le-=(N-$.width)/2,ge=!0):ve==="right"&&(le-=N-$.width,se=!0),Ot(e.calendarContainer,"arrowLeft",!ge&&!se),Ot(e.calendarContainer,"arrowCenter",ge),Ot(e.calendarContainer,"arrowRight",se);var G=window.document.body.offsetWidth-(window.pageXOffset+$.right),Se=le+N>window.document.body.offsetWidth,Be=G+N>window.document.body.offsetWidth;if(Ot(e.calendarContainer,"rightMost",Se),!e.config.static)if(e.calendarContainer.style.top=te+"px",Se)if(Be){var Oe=function(){for(var De=null,Ie=0;Ie<document.styleSheets.length;Ie++){var qe=document.styleSheets[Ie];if(qe.cssRules){try{qe.cssRules}catch{continue}De=qe;break}}return De??(qt=document.createElement("style"),document.head.appendChild(qt),qt.sheet);var qt}();if(Oe===void 0)return;var je=window.document.body.offsetWidth,Ee=Math.max(0,je/2-N/2),ue=Oe.cssRules.length,we="{left:"+$.left+"px;right:auto;}";Ot(e.calendarContainer,"rightMost",!1),Ot(e.calendarContainer,"centerMost",!0),Oe.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+we,ue),e.calendarContainer.style.left=Ee+"px",e.calendarContainer.style.right="auto"}else e.calendarContainer.style.left="auto",e.calendarContainer.style.right=G+"px";else e.calendarContainer.style.left=le+"px",e.calendarContainer.style.right="auto"}}}else e.config.position(e,C)}function P(){e.config.noCalendar||e.isMobile||(O(),Ae(),E())}function T(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function W(C){C.preventDefault(),C.stopPropagation();var x=Gf(Rt(C),function(z){return z.classList&&z.classList.contains("flatpickr-day")&&!z.classList.contains("flatpickr-disabled")&&!z.classList.contains("notAllowed")});if(x!==void 0){var j=x,N=e.latestSelectedDateObj=new Date(j.dateObj.getTime()),L=(N.getMonth()<e.currentMonth||N.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=j,e.config.mode==="single")e.selectedDates=[N];else if(e.config.mode==="multiple"){var ne=ke(N);ne?e.selectedDates.splice(parseInt(ne),1):e.selectedDates.push(N)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=N,e.selectedDates.push(N),Ft(N,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(z,te){return z.getTime()-te.getTime()}));if(c(),L){var ve=e.currentYear!==N.getFullYear();e.currentYear=N.getFullYear(),e.currentMonth=N.getMonth(),ve&&(I("onYearChange"),O()),I("onMonthChange")}if(Ae(),E(),Te(),L||e.config.mode==="range"||e.config.showMonths!==1?e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus():k(j),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var $=e.config.mode==="single"&&!e.config.enableTime,V=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;($||V)&&T()}p()}}e.parseDate=Za({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=d,e._setHoursFromDate=l,e._positionCalendar=H,e.changeMonth=_,e.changeYear=de,e.clear=function(C,x){if(C===void 0&&(C=!0),x===void 0&&(x=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,x===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var j=ua(e.config);u(j.hours,j.minutes,j.seconds)}e.redraw(),C&&I("onChange")},e.close=function(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),I("onClose")},e.onMouseOver=ae,e._createElement=He,e.createDay=y,e.destroy=function(){e.config!==void 0&&I("onDestroy");for(var C=e._handlers.length;C--;)e._handlers[C].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var x=e.calendarContainer.parentNode;if(x.lastChild&&x.removeChild(x.lastChild),x.parentNode){for(;x.firstChild;)x.parentNode.insertBefore(x.firstChild,x);x.parentNode.removeChild(x)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(j){try{delete e[j]}catch{}})},e.isEnabled=re,e.jumpToDate=h,e.updateValue=Te,e.open=function(C,x){if(x===void 0&&(x=e._positionElement),e.isMobile===!0){if(C){C.preventDefault();var j=Rt(C);j&&j.blur()}return e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),void I("onOpen")}if(!(e._input.disabled||e.config.inline)){var N=e.isOpen;e.isOpen=!0,N||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),I("onOpen"),H(x)),e.config.enableTime===!0&&e.config.noCalendar===!0&&(e.config.allowInput!==!1||C!==void 0&&e.timeContainer.contains(C.relatedTarget)||setTimeout(function(){return e.hourElement.select()},50))}},e.redraw=P,e.set=function(C,x){if(C!==null&&typeof C=="object")for(var j in Object.assign(e.config,C),C)q[j]!==void 0&&q[j].forEach(function(N){return N()});else e.config[C]=x,q[C]!==void 0?q[C].forEach(function(N){return N()}):aa.indexOf(C)>-1&&(e.config[C]=sa(x));e.redraw(),Te(!0)},e.setDate=function(C,x,j){if(x===void 0&&(x=!1),j===void 0&&(j=e.config.dateFormat),C!==0&&!C||C instanceof Array&&C.length===0)return e.clear(x);Z(C,j),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),h(void 0,x),l(),e.selectedDates.length===0&&e.clear(!1),Te(x),x&&I("onChange")},e.toggle=function(C){if(e.isOpen===!0)return e.close();e.open(C)};var q={locale:[J,K],showMonths:[R,i,U],minDate:[h],maxDate:[h],positionElement:[oe],clickOpens:[function(){e.config.clickOpens===!0?(d(e._input,"focus",e.open),d(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Z(C,x){var j=[];if(C instanceof Array)j=C.map(function(N){return e.parseDate(N,x)});else if(C instanceof Date||typeof C=="number")j=[e.parseDate(C,x)];else if(typeof C=="string")switch(e.config.mode){case"single":case"time":j=[e.parseDate(C,x)];break;case"multiple":j=C.split(e.config.conjunction).map(function(N){return e.parseDate(N,x)});break;case"range":j=C.split(e.l10n.rangeSeparator).map(function(N){return e.parseDate(N,x)})}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(C)));e.selectedDates=e.config.allowInvalidPreload?j:j.filter(function(N){return N instanceof Date&&re(N,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(N,L){return N.getTime()-L.getTime()})}function ie(C){return C.slice().map(function(x){return typeof x=="string"||typeof x=="number"||x instanceof Date?e.parseDate(x,void 0,!0):x&&typeof x=="object"&&x.from&&x.to?{from:e.parseDate(x.from,void 0),to:e.parseDate(x.to,void 0)}:x}).filter(function(x){return x})}function oe(){e._positionElement=e.config.positionElement||e._input}function I(C,x){if(e.config!==void 0){var j=e.config[C];if(j!==void 0&&j.length>0)for(var N=0;j[N]&&N<j.length;N++)j[N](e.selectedDates,e.input.value,e,x);C==="onChange"&&(e.input.dispatchEvent(Ce("change")),e.input.dispatchEvent(Ce("input")))}}function Ce(C){var x=document.createEvent("Event");return x.initEvent(C,!0,!0),x}function ke(C){for(var x=0;x<e.selectedDates.length;x++){var j=e.selectedDates[x];if(j instanceof Date&&Ft(j,C)===0)return""+x}return!1}function Ae(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(C,x){var j=new Date(e.currentYear,e.currentMonth,1);j.setMonth(e.currentMonth+x),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[x].textContent=si(j.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=j.getMonth().toString(),C.value=j.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=e.config.maxDate!==void 0&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function Pe(C){var x=C||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(j){return e.formatDate(j,x)}).filter(function(j,N,L){return e.config.mode!=="range"||e.config.enableTime||L.indexOf(j)===N}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function Te(C){C===void 0&&(C=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=Pe(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=Pe(e.config.altFormat)),C!==!1&&I("onValueUpdate")}function he(C){var x=Rt(C),j=e.prevMonthNav.contains(x),N=e.nextMonthNav.contains(x);j||N?_(j?-1:1):e.yearElements.indexOf(x)>=0?x.select():x.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):x.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}return function(){e.element=e.input=t,e.isOpen=!1,function(){var x=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],j=Ct(Ct({},JSON.parse(JSON.stringify(t.dataset||{}))),n),N={};e.config.parseDate=j.parseDate,e.config.formatDate=j.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(le){e.config._enable=ie(le)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(le){e.config._disable=ie(le)}});var L=j.mode==="time";if(!j.dateFormat&&(j.enableTime||L)){var ne=tt.defaultConfig.dateFormat||Co.dateFormat;N.dateFormat=j.noCalendar||L?"H:i"+(j.enableSeconds?":S":""):ne+" H:i"+(j.enableSeconds?":S":"")}if(j.altInput&&(j.enableTime||L)&&!j.altFormat){var ve=tt.defaultConfig.altFormat||Co.altFormat;N.altFormat=j.noCalendar||L?"h:i"+(j.enableSeconds?":S K":" K"):ve+" h:i"+(j.enableSeconds?":S":"")+" K"}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:X("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:X("max")});var $=function(le){return function(ge){e.config[le==="min"?"_minTime":"_maxTime"]=e.parseDate(ge,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:$("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:$("max")}),j.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,N,j);for(var V=0;V<x.length;V++)e.config[x[V]]=e.config[x[V]]===!0||e.config[x[V]]==="true";for(aa.filter(function(le){return e.config[le]!==void 0}).forEach(function(le){e.config[le]=sa(e.config[le]||[]).map(r)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),V=0;V<e.config.plugins.length;V++){var z=e.config.plugins[V](e)||{};for(var te in z)aa.indexOf(te)>-1?e.config[te]=sa(z[te]).map(r).concat(e.config[te]):j[te]===void 0&&(e.config[te]=z[te])}j.altInputClass||(e.config.altInputClass=Y().className+" "+e.config.altInputClass),I("onParseConfig")}(),J(),function(){if(e.input=Y(),!e.input)return void e.config.errorHandler(new Error("Invalid input element specified"));e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=He(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),oe()}(),function(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var x=e.config.defaultDate||(e.input.nodeName!=="INPUT"&&e.input.nodeName!=="TEXTAREA"||!e.input.placeholder||e.input.value!==e.input.placeholder?e.input.value:null);x&&Z(x,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}(),e.utils={getDaysInMonth:function(x,j){return x===void 0&&(x=e.currentMonth),j===void 0&&(j=e.currentYear),x===1&&(j%4==0&&j%100!=0||j%400==0)?29:e.l10n.daysInMonth[x]}},e.isMobile||function(){var x=window.document.createDocumentFragment();if(e.calendarContainer=He("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(x.appendChild((e.monthNav=He("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=He("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=He("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,R(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function($){e.__hidePrevMonthArrow!==$&&(Ot(e.prevMonthNav,"flatpickr-disabled",$),e.__hidePrevMonthArrow=$)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function($){e.__hideNextMonthArrow!==$&&(Ot(e.nextMonthNav,"flatpickr-disabled",$),e.__hideNextMonthArrow=$)}}),e.currentYearElement=e.yearElements[0],Ae(),e.monthNav)),e.innerContainer=He("div","flatpickr-innerContainer"),e.config.weekNumbers){var j=function(){e.calendarContainer.classList.add("hasWeeks");var $=He("div","flatpickr-weekwrapper");$.appendChild(He("span","flatpickr-weekday",e.l10n.weekAbbreviation));var V=He("div","flatpickr-weeks");return $.appendChild(V),{weekWrapper:$,weekNumbers:V}}(),N=j.weekWrapper,L=j.weekNumbers;e.innerContainer.appendChild(N),e.weekNumbers=L,e.weekWrapper=N}e.rContainer=He("div","flatpickr-rContainer"),e.rContainer.appendChild(U()),e.daysContainer||(e.daysContainer=He("div","flatpickr-days"),e.daysContainer.tabIndex=-1),E(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),x.appendChild(e.innerContainer)}e.config.enableTime&&x.appendChild(function(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var $=ua(e.config);e.timeContainer=He("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var V=He("span","flatpickr-time-separator",":"),z=_r("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=z.getElementsByTagName("input")[0];var te=_r("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=te.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?$.hours:function(ge){switch(ge%24){case 0:case 12:return 12;default:return ge%12}}($.hours)),e.minuteElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():$.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(z),e.timeContainer.appendChild(V),e.timeContainer.appendChild(te),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var le=_r("flatpickr-second");e.secondElement=le.getElementsByTagName("input")[0],e.secondElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():$.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(He("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(le)}return e.config.time_24hr||(e.amPM=He("span","flatpickr-am-pm",e.l10n.amPM[Vt((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}()),Ot(e.calendarContainer,"rangeMode",e.config.mode==="range"),Ot(e.calendarContainer,"animate",e.config.animate===!0),Ot(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(x);var ne=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!ne&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var ve=He("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(ve,e.element),ve.appendChild(e.element),e.altInput&&ve.appendChild(e.altInput),ve.appendChild(e.calendarContainer)}e.config.static||e.config.inline||(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}(),function(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(N){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+N+"]"),function(L){return d(L,"click",e[N])})}),e.isMobile)return void function(){var N=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=He("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=N,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=N==="datetime-local"?"Y-m-d\\TH:i:S":N==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}d(e.mobileInput,"change",function(L){e.setDate(Rt(L).value,!1,e.mobileFormatStr),I("onChange"),I("onClose")})}();var x=ol(B,50);if(e._debouncedChange=ol(p,300),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&d(e.daysContainer,"mouseover",function(N){e.config.mode==="range"&&ae(Rt(N))}),d(e._input,"keydown",xe),e.calendarContainer!==void 0&&d(e.calendarContainer,"keydown",xe),e.config.inline||e.config.static||d(window,"resize",x),window.ontouchstart!==void 0?d(window.document,"touchstart",me):d(window.document,"mousedown",me),d(window.document,"focus",me,{capture:!0}),e.config.clickOpens===!0&&(d(e._input,"focus",e.open),d(e._input,"click",e.open)),e.daysContainer!==void 0&&(d(e.monthNav,"click",he),d(e.monthNav,["keyup","increment"],f),d(e.daysContainer,"click",W)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var j=function(N){return Rt(N).select()};d(e.timeContainer,["increment"],a),d(e.timeContainer,"blur",a,{capture:!0}),d(e.timeContainer,"click",m),d([e.hourElement,e.minuteElement],["focus","click"],j),e.secondElement!==void 0&&d(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&d(e.amPM,"click",function(N){a(N)})}e.config.allowInput&&d(e._input,"blur",pe)}(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&l(e.config.noCalendar?e.latestSelectedDateObj:void 0),Te(!1)),i();var C=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&C&&H(),I("onReady")}(),e}function ko(t,n){for(var e=Array.prototype.slice.call(t).filter(function(a){return a instanceof HTMLElement}),o=[],r=0;r<e.length;r++){var i=e[r];try{if(i.getAttribute("data-fp-omit")!==null)continue;i._flatpickr!==void 0&&(i._flatpickr.destroy(),i._flatpickr=void 0),i._flatpickr=$0(i,n||{}),o.push(i._flatpickr)}catch(a){console.error(a)}}return o.length===1?o[0]:o}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return ko(this,t)},HTMLElement.prototype.flatpickr=function(t){return ko([this],t)});var tt=function(t,n){return typeof t=="string"?ko(window.document.querySelectorAll(t),n):t instanceof Node?ko([t],n):ko(t,n)};tt.defaultConfig={},tt.l10ns={en:Ct({},fr),default:Ct({},fr)},tt.localize=function(t){tt.l10ns.default=Ct(Ct({},tt.l10ns.default),t)},tt.setDefaults=function(t){tt.defaultConfig=Ct(Ct({},tt.defaultConfig),t)},tt.parseDate=Za({}),tt.formatDate=Yf({}),tt.compareDates=Ft,typeof jQuery<"u"&&jQuery.fn!==void 0&&(jQuery.fn.flatpickr=function(t){return ko(this,t)}),Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof t=="string"?parseInt(t,10):t))},typeof window<"u"&&(window.flatpickr=tt);const z0=["onCreate","onDestroy"],da=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],U0=t=>{const n=g.useMemo(()=>({...t}),[t]),{defaultValue:e,options:o={},value:r,children:i,render:a,onCreate:c,onDestroy:l}=n,u=g.useMemo(()=>((m,v)=>(da.forEach(y=>{const k=v[y],S=m[y];if(k){S&&!Array.isArray(S)?m[y]=[m[y]]:m[y]||(m[y]=[]);const b=Array.isArray(k)?k:[k];m[y].length===0?m[y]=b:m[y].push(...b)}}),da.forEach(y=>{delete v[y]}),z0.forEach(y=>{delete v[y]}),m))(o,n),[o,n]),f=g.useRef(null),d=g.useRef(void 0);g.useImperativeHandle(t.ref,()=>({get flatpickr(){return d.current}}),[]),g.useEffect(()=>{return u.onClose=u.onClose||(()=>{var v;(v=f.current)!=null&&v.blur&&f.current.blur()}),d.current=(((m=tt)==null?void 0:m.default)||tt)(f.current,u),c==null||c(d.current),()=>{l==null||l(d.current),d.current&&d.current.destroy(),d.current=void 0};var m},[u,c,l]),g.useEffect(()=>{var m;if(d.current){const v=Object.getOwnPropertyNames(u);for(let y=v.length-1;y>=0;y--){const k=v[y];let S=u[k];(S==null?void 0:S.toString())!==((m=d.current.config[k])==null?void 0:m.toString())&&(da.includes(k)&&!Array.isArray(S)&&(S=[S]),d.current.set(k,S))}r!==void 0&&r!==d.current.input.value&&d.current.setDate(r,!1)}},[u,r]);const p=g.useCallback(m=>{f.current=m},[]);if(a)return a({...n,defaultValue:e,value:r},p);const h=g.useCallback(m=>{var v,y;t&&t.onChange&&(Array.isArray(t==null?void 0:t.onChange)?(v=t==null?void 0:t.onChange)==null||v.forEach(()=>[new Date(m.target.value)],(r==null?void 0:r.toString())||""):typeof t.onChange=="function"&&((y=t==null?void 0:t.onChange)==null||y.call(t,[new Date(m.target.value)],(r==null?void 0:r.toString())||"",d.current)))},[t,r]);return o.wrap?s.jsx("div",{className:"flatpickr",ref:p,children:i}):s.jsx("input",{onChange:h,...n,value:r==null?void 0:r.toString(),defaultValue:e,ref:p})},il="T42.GD.Execute",Zf=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Kf=(t,n)=>t in n;function V0({time:t,frequency:n,day:e}){const o=new Date(`01/01/2000 ${t}`),r=o.getMinutes(),i=o.getHours();let a="*";return n==="weekly"&&e&&(a=function(c){const l={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if(!Kf(c,l))throw new Error(`Invalid day: ${c}`);return l[c]}(e).toString()),`${r} ${i} * * ${a}`}function G0(t){const n=g.useContext(Me.IOConnectContext),{value:e,update:o}=Wt({prefKey:Lr(t)}),{value:r,update:i}=Wt({prefKey:Lr(t,"Time")}),{value:a,update:c}=Wt({prefKey:Lr(t,"Frequency")}),{value:l,update:u}=Wt({prefKey:Lr(t,"Day")}),f=g.useCallback(async()=>{try{await n.interop.invoke(il,{command:`cancel-${t}`})}catch(p){console.error(p)}},[n,t]),d=g.useCallback(async()=>{try{const p=V0({time:r??"12:00 AM",frequency:a??"daily",day:a==="weekly"?l:"*"});await n.interop.invoke(il,{command:`schedule-${t}`,args:{cronTime:p,discardUnsavedLayoutChanges:!1}})}catch(p){console.error(`Failed to update cron job for ${t}:`,p)}},[n,t,r,a,l]);return g.useEffect(()=>{n&&e&&d()},[n,e,d]),{enabled:e??!1,time:r??"12:00 AM",frequency:a??"daily",day:l??"Monday",setEnabled:async p=>{p||await f();try{await o(p)}catch(h){console.error("Failed to update enabled state:",h)}},setTime:async p=>{try{await i(p)}catch(h){console.error("Failed to update time:",h)}},setFrequency:async p=>{try{await c(p),p==="daily"&&await u(void 0)}catch(h){console.error("Failed to update frequency:",h)}},setDay:async p=>{var h;if(h=p,Zf.includes(h))try{await u(p)}catch(m){console.error("Failed to update day:",m)}else console.error("Invalid day provided")}}}function Lr(t,n){const e=t==="restart"?"_system_scheduleRestart":"_system_scheduleShutdown";return n?`${e}${n}`:e}function qf({className:t,variant:n,...e}){const o=ee("io-block-list-gap",n,t),{enabled:r,time:i,frequency:a,day:c,setEnabled:l,setTime:u,setFrequency:f,setDay:d}=G0(n);return s.jsxs(Ke,{className:o,...e,children:[s.jsx(ft,{label:`Schedule ${n}`,align:"right",onChange:p=>l(p.target.checked),checked:r}),s.jsxs("div",{className:"scheduler-controls",children:[s.jsxs("div",{className:"io-control-input io-control-leading-icon direction-up",children:[s.jsx(nt,{variant:"clock"}),s.jsx(U0,{className:"io-input",options:{enableTime:!0,noCalendar:!0,dateFormat:"h:i K",defaultDate:i,clickOpens:!0},value:i,onClose:async([p])=>{const h=p.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0});await u(h)}})]}),s.jsxs(Xt,{text:a.charAt(0).toUpperCase()+a.slice(1),icon:"chevron-down",iconRight:!0,children:[s.jsx(Xt.Item,{onClick:()=>f("daily"),children:"Daily"}),s.jsx(Xt.Item,{onClick:()=>f("weekly"),children:"Weekly"})]}),a==="weekly"&&s.jsx(Xt,{text:c,icon:"chevron-down",iconRight:!0,children:Zf.map(p=>s.jsx(Xt.Item,{onClick:()=>d(p),children:p},p))})]})]})}function Y0({className:t,...n}){return s.jsx(qf,{...n,className:t,variant:"restart"})}function Z0({className:t,...n}){return s.jsx(qf,{...n,className:t,variant:"shutdown"})}const Jf={Body:E0,General:j0,Theme:As,PinnedPosition:N0,AllowDocking:I0,MinimizeToTray:P0,AutoClose:A0,ShowTutorialOnStartup:T0,Layouts:D0,LayoutsRestoreLastSaved:M0,LayoutsSaveCurrentOnExit:_0,LayoutsShowUnsavedChangesPrompt:Ts,LayoutsShowDeletePrompt:Ds,Downloads:L0,DownloadsAskForEachDownload:R0,DownloadsLocation:F0,System:B0,SystemRestartSection:Y0,SystemShutdownSection:Z0},Xf=g.createContext(Jf),Qf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Jf,...n}),[n]);return s.jsx(Xf.Provider,{value:e,children:t})});Qf.displayName="PreferencesPanelComponentsStoreProvider";const _o=()=>g.useContext(Xf),ep=({className:t,onClose:n,title:e="Platform Preferences",children:o,...r})=>s.jsxs(Ge,{className:ee("io-preferences-panel",t),"data-testid":"preferences-panel",...r,children:[s.jsxs(Ge.Header,{"data-testid":"preferences-panel-header",children:[s.jsx(Ge.Header.Title,{size:"large",text:e,tag:"h1","data-testid":"preferences-panel-title"}),s.jsx(Ge.Header.ButtonGroup,{children:s.jsx(Ge.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n,"data-testid":"preferences-panel-close-button"})})]}),o]}),K0=({onClose:t,title:n="Platform Preferences",...e})=>{const{Body:o}=_o();return s.jsx(ep,{title:n,onClose:t,...e,children:s.jsx(o,{})})},q0=({components:t,...n})=>s.jsx(Qf,{components:t,children:s.jsx(K0,{...n})}),tp=t=>{const{General:n,Layouts:e}=Di();return s.jsxs(Oo,{...t,children:[s.jsx(n,{}),s.jsx(e,{})]})},np=({title:t="General",...n})=>{const{Theme:e}=Di();return s.jsx(Ke,{title:t,"data-testid":"preferences-panel-general-block",...n,children:s.jsx(e,{})})},op=({title:t="Layouts",...n})=>{const{LayoutsShowDeletePrompt:e}=Di();return s.jsx(Ke,{title:t,"data-testid":"preferences-panel-layouts-block",...n,children:s.jsx(e,{})})},rp={Body:tp,General:np,Theme:As,Layouts:op,LayoutsShowUnsavedChangesPrompt:Ts,LayoutsShowDeletePrompt:Ds},ip=g.createContext(rp),ap=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...rp,...n}),[n]);return s.jsx(ip.Provider,{value:e,children:t})});ap.displayName="PreferencesPanelComponentsStoreProvider";const Di=()=>g.useContext(ip),J0=({onClose:t,title:n="Platform Preferences",...e})=>{const{Body:o}=Di();return s.jsx(ep,{title:n,onClose:t,...e,children:s.jsx(o,{})})};var X0=Object.freeze({__proto__:null,General:np,Layouts:op,LayoutsShowDeletePrompt:Ds,LayoutsShowUnsavedChangesPrompt:Ts,Panel:({components:t,...n})=>s.jsx(ap,{components:t,children:s.jsx(J0,{...n})}),PanelBody:tp,Theme:As});const Q0=({name:t,value:n})=>s.jsxs("div",{className:"io-profile-section-item",children:[s.jsx("div",{className:"io-profile-section-item-name",children:t}),s.jsx("div",{className:"io-profile-section-item-value",children:n})]}),sp=({className:t,items:n,title:e})=>s.jsxs("div",{className:ee("io-profile-section-body",t),children:[e&&s.jsx(sn,{className:"io-profile-section-title",text:e}),n.map(({name:o,value:r})=>s.jsx(Q0,{name:o,value:r},o))]}),Ms=({className:t,items:n,title:e})=>s.jsxs("section",{className:ee("io-profile-section",t),children:[s.jsx(sp,{items:n,title:e}),s.jsx(wr,{className:"mt-8"})]}),cp=({title:t="License",...n})=>s.jsx(Ms,{title:t,...n}),lp=({title:t="Version",...n})=>s.jsx(Ms,{title:t,...n}),up=({title:t="Plugins",...n})=>s.jsx(Ms,{title:t,...n}),dp=({className:t})=>{const n=Oi()?"io.Connect Desktop":"io.Connect Browser";return s.jsxs("div",{className:ee("io-trademark-container",t),children:[s.jsx("h4",{className:"io-trademark-title",children:n}),s.jsxs("p",{className:"io-trademark-text",children:[n,"® is a registered trademark of"," ",s.jsx("a",{href:"https://www.interop.io",rel:"noreferrer",target:"_blank",children:"Interop Inc©"})," ",new Date().getFullYear(),". All rights reserved."]})]})},fp=({avatarInitials:t=Oi()?"CD":"CB",className:n,items:e,onLogout:o,title:r})=>s.jsxs("section",{className:ee("io-profile-section",n),children:[s.jsxs("div",{className:"io-user-details-container",children:[s.jsx("div",{className:"io-user-avatar",children:t}),s.jsx(sp,{className:"mt-12",items:e,title:r})]}),o&&s.jsx(Ye,{className:"io-log-out-button",onClick:o,variant:"primary",icon:"arrow-right-from-bracket",children:"Log out"}),s.jsx(wr,{className:"mt-8"})]}),pp={LicenseSection:cp,ProductsInfoSection:lp,PluginsSection:up,Trademark:dp,UserSection:fp},hp=g.createContext(pp),mp=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...pp,...n}),[n]);return s.jsx(hp.Provider,{value:e,children:t})});mp.displayName="ProfilePanelComponentsStoreProvider";const ev=t=>{const n=new Date(t);return[{day:"numeric"},{month:"short"},{year:"numeric"}].map(e=>n.toLocaleDateString("en",e)).join(" ")},tv=t=>{if(!t)return{items:[]};const n=[...t.email?[{name:"Email",value:t.email}]:[],...t.type?[{name:"User Type",value:t.type}]:[],...t.role?[{name:"User Role",value:t.role}]:[],{name:"User ID",value:t.id}];if(t.firstName||t.lastName){const e=[t.firstName,t.lastName].filter(o=>!!o);return{avatarInitials:e.map(o=>o.charAt(0)).join(""),items:n,title:e.join(" ")}}return t.username?{avatarInitials:t.username.charAt(0),items:n,title:t.username}:t.email?{avatarInitials:t.email.charAt(0),items:n}:{items:n}},nv=t=>{const n=new Date(2023,5,6),e=t.expiration<n.getTime()?1e3:1;return{items:[{name:"Type",value:t.type},{name:"Expiration Date",value:ev(t.expiration*e)}]}},ov=t=>({items:t.map(n=>({name:n.name,value:n.version}))}),rv=t=>{var e;const n={"@interopio/workspaces-ui-react":"Workspaces React Frame","@interopio/workspaces-ui-web-components":"Workspaces Web Components Frame"};return{items:[{name:"io.Connect Browser platform",value:t.platform.apiVersion},{name:"io.Connect Browser client",value:t.client.apiVersion},...t.workspaces?[{name:"Workspaces API",value:t.workspaces.apiVersion}]:[],...(e=t.workspaces)!=null&&e.container&&Kf(t.workspaces.container.type,n)?[{name:n[t.workspaces.container.type],value:t.workspaces.container.version}]:[],...t.home?[{name:"Home UI",value:t.home.version}]:[],...t.search?[{name:"Search API",value:t.search.apiVersion}]:[],...t.modals?[{name:"Modals API",value:t.modals.apiVersion}]:[]]}},iv=()=>{const t=window.glue42gd??window.iodesktop;if(!t)throw new Error("both window.glue42gd and window.iodesktop are not available");const{user:n,env:e}=t,o=[{name:"Environment",value:e.env},{name:"Region",value:e.region}];return n?{avatarInitials:n.charAt(0),items:o,title:n}:{items:o}},av=t=>({items:Object.entries(t??{}).map(([e,o])=>({name:e,value:o}))}),sv=t=>({items:t.map(({product:e,version:o})=>({name:e,value:o}))}),cv=t=>Oi()?(async n=>{const{licInfo:e,productInfo:o}=(await n.interop.invoke("T42.GD.GetInfo")).returned;return{user:iv(),license:av(e),productsInfo:sv(o)}})(t):(async()=>{if(!window.iobrowser)throw new Error("window.iobrowser is not available");const n=await window.iobrowser.system.getProfileData();return{user:tv(n.user),license:nv(n.license),plugins:ov(n.plugins),productsInfo:rv(n.productsInfo)}})(),lv=({className:t,onClose:n,onLogout:e,title:o="Profile",...r})=>{var h;const{LicenseSection:i,ProductsInfoSection:a,PluginsSection:c,Trademark:l,UserSection:u}=g.useContext(hp),f=g.useContext(Me.IOConnectContext),[d,p]=g.useState(null);return g.useEffect(()=>{f&&(async()=>{const m=await cv(f);p(m)})().catch(console.error)},[f]),s.jsxs(Ge,{className:ee("io-profile-panel",t),"data-testid":"profile-panel",...r,children:[s.jsxs(Ge.Header,{children:[s.jsx(Ge.Header.Title,{size:"large",text:o}),s.jsx(Ge.Header.ButtonGroup,{children:s.jsx(Ge.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),s.jsxs(Ge.Body,{children:[d!=null&&d.user.items.length||d!=null&&d.user.title?s.jsx(u,{avatarInitials:d.user.avatarInitials,items:d.user.items,onLogout:e,title:d.user.title}):null,s.jsxs("div",{className:"io-scrollable-profile-sections-container",children:[d!=null&&d.license.items.length?s.jsx(i,{items:d.license.items}):null,d!=null&&d.productsInfo.items.length?s.jsx(a,{items:d.productsInfo.items}):null,(h=d==null?void 0:d.plugins)!=null&&h.items.length?s.jsx(c,{items:d.plugins.items}):null]}),s.jsx(l,{className:"mt-auto"})]})]})},gp=({components:t,...n})=>s.jsx(mp,{components:t,children:s.jsx(lv,{...n})});var uv=Object.freeze({__proto__:null,LicenseSection:cp,Panel:gp,PluginsSection:up,ProductsInfoSection:lp,Trademark:dp,UserSection:fp});const vp=g.createContext(void 0),al=()=>{const t=g.useContext(vp);if(!t)throw new Error("usePanelManagerContext must be used within a PanelManagerContext.Provider");return t},dv=document.querySelector("#root")??document.body,fv={preferences:q0,"notification-settings":Os,profile:gp};var pv=Object.freeze({__proto__:null,ActivePanelRenderer:()=>{const{panel:t,deselectPanel:n}=al();Sa(()=>{t&&n()},["Escape"]);const e=t?fv[t]:null;return e?jn.createPortal(s.jsx("div",{className:"io-panel-overlay",children:s.jsx(e,{onClose:n})}),dv):null},PanelManagerProvider:({children:t})=>{const[n,e]=g.useState(null),o=g.useCallback(a=>{e(a)},[]),r=g.useCallback(()=>{e(null)},[]),i=g.useMemo(()=>({panel:n,selectPanel:o,deselectPanel:r}),[n,o,r]);return s.jsx(vp.Provider,{value:i,children:t})},usePanelManagerContext:al});const hv=X0,ir=t=>"items"in t,bt={APPLICATION:"application",WORKSPACE:"workspace",LAYOUT:"layout",ACTION_BUTTON:"action-button"},Ka=t=>typeof t=="string"?t:t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):JSON.stringify(t),yp=()=>typeof window.glue42gd<"u"||typeof window.glue42alert<"u"||typeof window.glue42dialog<"u"||typeof window.iodesktop<"u",ci={OPEN_IN_NEW_WINDOW:"openInNewWindow",OPEN_IN_NEW_WORKSPACE:"openInNewWorkspace"},wp=yp()?[]:[{name:ci.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out"},{name:ci.OPEN_IN_NEW_WORKSPACE,displayName:"Open in a new Workspace",icon:"pop-out"}],li={OPEN_IN_NEW_WINDOW:"openInNewWindow",DELETE:"delete"},bp=[{name:li.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out",separatorAfter:!0},{name:li.DELETE,displayName:"Delete",icon:"trash-can"}],pr={ASCENDING:"ascending",DESCENDING:"descending",DISABLED:"disabled"},Mi=new Intl.Collator(void 0,{sensitivity:"base"}),xp=(t,n)=>Mi.compare(t.title,n.title),Cp=(t,n)=>Mi.compare(n.title,t.title),_s=t=>{const{items:n,sortOrder:e,ascendingCompare:o,descendingCompare:r}=t;if(e===pr.DISABLED)return n;const i=e===pr.ASCENDING?o:r;return[...n].sort(i)},So={FAVORITES:"favorites-section",WORKSPACES:"workspaces-section",APPLICATIONS:"applications-section"},qa=(t,n,e,o)=>{const{isFolderCollapsible:r}=o,i="/",[a,...c]=e.split(i),l=t.findIndex(f=>ir(f)&&f.title===a),u=l!==-1?t[l]:null;return u?[...t.slice(0,l),{...u,items:c.length>0?qa(u.items,n,c.join(i),o):[...u.items,n]},...t.slice(l+1)]:[...t,{id:a,title:a,items:c.length>0?qa([],n,c.join(i),o):[n],isCollapsible:r}]},ui=t=>{const{title:n,userProperties:e}=t,{folder:o}=e;return o?`${o}/${n}`:n},mv=(t,n)=>Mi.compare(ui(t),ui(n)),gv=(t,n)=>Mi.compare(ui(n),ui(t)),vv=(t,n,e)=>{const{isSectionCollapsible:o,sortOrder:r=pr.ASCENDING}=e,a=_s({items:t,sortOrder:r,ascendingCompare:mv,descendingCompare:gv}).reduce((c,l)=>{var d;const u={id:l.id,title:l.title,description:l.caption,type:bt.APPLICATION,icon:"application",iconSrc:l.icon,openInstances:(d=n[l.name])==null?void 0:d.length,contextMenuActions:wp},f=l.userProperties.folder;return f?qa(c,u,f,e):[...c,u]},[]);return{id:So.APPLICATIONS,title:"Apps",items:a,isCollapsible:o}};var yv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ja={exports:{}},Rr={exports:{}},$e={};/** @license React v16.13.1
12
+ `}}function _(C,x){x===void 0&&(x=!0);var j=x?C:C-e.currentMonth;j<0&&e._hidePrevMonthArrow===!0||j>0&&e._hideNextMonthArrow===!0||(e.currentMonth+=j,(e.currentMonth<0||e.currentMonth>11)&&(e.currentYear+=e.currentMonth>11?1:-1,e.currentMonth=(e.currentMonth+12)%12,I("onYearChange"),O()),E(),I("onMonthChange"),Ae())}function A(C){return e.calendarContainer.contains(C)}function me(C){if(e.isOpen&&!e.config.inline){var x=Rt(C),j=A(x),N=!(x===e.input||x===e.altInput||e.element.contains(x)||C.path&&C.path.indexOf&&(~C.path.indexOf(e.input)||~C.path.indexOf(e.altInput)))&&!j&&!A(C.relatedTarget),L=!e.config.ignoredFocusElements.some(function(ne){return ne.contains(x)});N&&L&&(e.config.allowInput&&e.setDate(e._input.value,!1,e.config.altInput?e.config.altFormat:e.config.dateFormat),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0&&e.input.value!==""&&e.input.value!==void 0&&a(),e.close(),e.config&&e.config.mode==="range"&&e.selectedDates.length===1&&e.clear(!1))}}function de(C){if(!(!C||e.config.minDate&&C<e.config.minDate.getFullYear()||e.config.maxDate&&C>e.config.maxDate.getFullYear())){var x=C,j=e.currentYear!==x;e.currentYear=x||e.currentYear,e.config.maxDate&&e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth=Math.min(e.config.maxDate.getMonth(),e.currentMonth):e.config.minDate&&e.currentYear===e.config.minDate.getFullYear()&&(e.currentMonth=Math.max(e.config.minDate.getMonth(),e.currentMonth)),j&&(e.redraw(),I("onYearChange"),O())}}function re(C,x){var j;x===void 0&&(x=!0);var N=e.parseDate(C,void 0,x);if(e.config.minDate&&N&&Ft(N,e.config.minDate,x!==void 0?x:!e.minDateHasTime)<0||e.config.maxDate&&N&&Ft(N,e.config.maxDate,x!==void 0?x:!e.maxDateHasTime)>0)return!1;if(!e.config.enable&&e.config.disable.length===0)return!0;if(N===void 0)return!1;for(var L=!!e.config.enable,ne=(j=e.config.enable)!==null&&j!==void 0?j:e.config.disable,ve=0,$=void 0;ve<ne.length;ve++){if(typeof($=ne[ve])=="function"&&$(N)||$ instanceof Date&&N!==void 0&&$.getTime()===N.getTime())return L;if(typeof $=="string"){var V=e.parseDate($,void 0,!0);return V&&V.getTime()===N.getTime()?L:!L}if(typeof $=="object"&&N!==void 0&&$.from&&$.to&&N.getTime()>=$.from.getTime()&&N.getTime()<=$.to.getTime())return L}return!L}function ye(C){return e.daysContainer!==void 0&&C.className.indexOf("hidden")===-1&&C.className.indexOf("flatpickr-disabled")===-1&&e.daysContainer.contains(C)}function pe(C){var x=C.target===e._input,j=e._input.value.trimEnd()!==Pe();!x||!j||C.relatedTarget&&A(C.relatedTarget)||e.setDate(e._input.value,!0,C.target===e.altInput?e.config.altFormat:e.config.dateFormat)}function xe(C){var x=Rt(C),j=e.config.wrap?t.contains(x):x===e._input,N=e.config.allowInput,L=e.isOpen&&(!N||!j),ne=e.config.inline&&j&&!N;if(C.keyCode===13&&j){if(N)return e.setDate(e._input.value,!0,x===e.altInput?e.config.altFormat:e.config.dateFormat),e.close(),x.blur();e.open()}else if(A(x)||L||ne){var ve=!!e.timeContainer&&e.timeContainer.contains(x);switch(C.keyCode){case 13:ve?(C.preventDefault(),a(),T()):W(C);break;case 27:C.preventDefault(),T();break;case 8:case 46:j&&!e.config.allowInput&&(C.preventDefault(),e.clear());break;case 37:case 39:if(ve||j)e.hourElement&&e.hourElement.focus();else{C.preventDefault();var $=o();if(e.daysContainer!==void 0&&(N===!1||$&&ye($))){var V=C.keyCode===39?1:-1;C.ctrlKey?(C.stopPropagation(),_(V),b(S(1),0)):b(void 0,V)}}break;case 38:case 40:C.preventDefault();var z=C.keyCode===40?1:-1;e.daysContainer&&x.$i!==void 0||x===e.input||x===e.altInput?C.ctrlKey?(C.stopPropagation(),de(e.currentYear-z),b(S(1),0)):ve||b(void 0,7*z):x===e.currentYearElement?de(e.currentYear-z):e.config.enableTime&&(!ve&&e.hourElement&&e.hourElement.focus(),a(C),e._debouncedChange());break;case 9:if(ve){var te=[e.hourElement,e.minuteElement,e.secondElement,e.amPM].concat(e.pluginElements).filter(function(se){return se}),le=te.indexOf(x);if(le!==-1){var ge=te[le+(C.shiftKey?-1:1)];C.preventDefault(),(ge||e._input).focus()}}else!e.config.noCalendar&&e.daysContainer&&e.daysContainer.contains(x)&&C.shiftKey&&(C.preventDefault(),e._input.focus())}}if(e.amPM!==void 0&&x===e.amPM)switch(C.key){case e.l10n.amPM[0].charAt(0):case e.l10n.amPM[0].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[0],c(),Te();break;case e.l10n.amPM[1].charAt(0):case e.l10n.amPM[1].charAt(0).toLowerCase():e.amPM.textContent=e.l10n.amPM[1],c(),Te()}(j||A(x))&&I("onKeyDown",C)}function ae(C,x){if(x===void 0&&(x="flatpickr-day"),e.selectedDates.length===1&&(!C||C.classList.contains(x)&&!C.classList.contains("flatpickr-disabled"))){for(var j=C?C.dateObj.getTime():e.days.firstElementChild.dateObj.getTime(),N=e.parseDate(e.selectedDates[0],void 0,!0).getTime(),L=Math.min(j,e.selectedDates[0].getTime()),ne=Math.max(j,e.selectedDates[0].getTime()),ve=!1,$=0,V=0,z=L;z<ne;z+=W0)re(new Date(z),!0)||(ve=ve||z>L&&z<ne,z<N&&(!$||z>$)?$=z:z>N&&(!V||z<V)&&(V=z));Array.from(e.rContainer.querySelectorAll("*:nth-child(-n+"+e.config.showMonths+") > ."+x)).forEach(function(te){var le,ge,se,G=te.dateObj.getTime(),Se=$>0&&G<$||V>0&&G>V;if(Se)return te.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(Be){te.classList.remove(Be)});ve&&!Se||(["startRange","inRange","endRange","notAllowed"].forEach(function(Be){te.classList.remove(Be)}),C!==void 0&&(C.classList.add(j<=e.selectedDates[0].getTime()?"startRange":"endRange"),N<j&&G===N?te.classList.add("startRange"):N>j&&G===N&&te.classList.add("endRange"),G>=$&&(V===0||G<=V)&&(ge=N,se=j,(le=G)>Math.min(ge,se)&&le<Math.max(ge,se))&&te.classList.add("inRange")))})}}function B(){!e.isOpen||e.config.static||e.config.inline||H()}function X(C){return function(x){var j=e.config["_"+C+"Date"]=e.parseDate(x,e.config.dateFormat),N=e.config["_"+(C==="min"?"max":"min")+"Date"];j!==void 0&&(e[C==="min"?"minDateHasTime":"maxDateHasTime"]=j.getHours()>0||j.getMinutes()>0||j.getSeconds()>0),e.selectedDates&&(e.selectedDates=e.selectedDates.filter(function(L){return re(L)}),e.selectedDates.length||C!=="min"||l(j),Te()),e.daysContainer&&(P(),j!==void 0?e.currentYearElement[C]=j.getFullYear().toString():e.currentYearElement.removeAttribute(C),e.currentYearElement.disabled=!!N&&j!==void 0&&N.getFullYear()===j.getFullYear())}}function Y(){return e.config.wrap?t.querySelector("[data-input]"):t}function J(){typeof e.config.locale!="object"&&nt.l10ns[e.config.locale]===void 0&&e.config.errorHandler(new Error("flatpickr: invalid locale "+e.config.locale)),e.l10n=Ct(Ct({},nt.l10ns.default),typeof e.config.locale=="object"?e.config.locale:e.config.locale!=="default"?nt.l10ns[e.config.locale]:void 0),Gn.D="("+e.l10n.weekdays.shorthand.join("|")+")",Gn.l="("+e.l10n.weekdays.longhand.join("|")+")",Gn.M="("+e.l10n.months.shorthand.join("|")+")",Gn.F="("+e.l10n.months.longhand.join("|")+")",Gn.K="("+e.l10n.amPM[0]+"|"+e.l10n.amPM[1]+"|"+e.l10n.amPM[0].toLowerCase()+"|"+e.l10n.amPM[1].toLowerCase()+")",Ct(Ct({},n),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr===void 0&&nt.defaultConfig.time_24hr===void 0&&(e.config.time_24hr=e.l10n.time_24hr),e.formatDate=Yf(e),e.parseDate=Za({config:e.config,l10n:e.l10n})}function H(C){if(typeof e.config.position!="function"){if(e.calendarContainer!==void 0){I("onPreCalendarPosition");var x=C||e._positionElement,j=Array.prototype.reduce.call(e.calendarContainer.children,function(De,Ie){return De+Ie.offsetHeight},0),N=e.calendarContainer.offsetWidth,L=e.config.position.split(" "),ne=L[0],ve=L.length>1?L[1]:null,$=x.getBoundingClientRect(),V=window.innerHeight-$.bottom,z=ne==="above"||ne!=="below"&&V<j&&$.top>j,te=window.pageYOffset+$.top+(z?-j-2:x.offsetHeight+2);if(Ot(e.calendarContainer,"arrowTop",!z),Ot(e.calendarContainer,"arrowBottom",z),!e.config.inline){var le=window.pageXOffset+$.left,ge=!1,se=!1;ve==="center"?(le-=(N-$.width)/2,ge=!0):ve==="right"&&(le-=N-$.width,se=!0),Ot(e.calendarContainer,"arrowLeft",!ge&&!se),Ot(e.calendarContainer,"arrowCenter",ge),Ot(e.calendarContainer,"arrowRight",se);var G=window.document.body.offsetWidth-(window.pageXOffset+$.right),Se=le+N>window.document.body.offsetWidth,Be=G+N>window.document.body.offsetWidth;if(Ot(e.calendarContainer,"rightMost",Se),!e.config.static)if(e.calendarContainer.style.top=te+"px",Se)if(Be){var Oe=function(){for(var De=null,Ie=0;Ie<document.styleSheets.length;Ie++){var qe=document.styleSheets[Ie];if(qe.cssRules){try{qe.cssRules}catch{continue}De=qe;break}}return De??(qt=document.createElement("style"),document.head.appendChild(qt),qt.sheet);var qt}();if(Oe===void 0)return;var je=window.document.body.offsetWidth,Ee=Math.max(0,je/2-N/2),ue=Oe.cssRules.length,we="{left:"+$.left+"px;right:auto;}";Ot(e.calendarContainer,"rightMost",!1),Ot(e.calendarContainer,"centerMost",!0),Oe.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+we,ue),e.calendarContainer.style.left=Ee+"px",e.calendarContainer.style.right="auto"}else e.calendarContainer.style.left="auto",e.calendarContainer.style.right=G+"px";else e.calendarContainer.style.left=le+"px",e.calendarContainer.style.right="auto"}}}else e.config.position(e,C)}function P(){e.config.noCalendar||e.isMobile||(O(),Ae(),E())}function T(){e._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(e.close,0):e.close()}function W(C){C.preventDefault(),C.stopPropagation();var x=Gf(Rt(C),function(z){return z.classList&&z.classList.contains("flatpickr-day")&&!z.classList.contains("flatpickr-disabled")&&!z.classList.contains("notAllowed")});if(x!==void 0){var j=x,N=e.latestSelectedDateObj=new Date(j.dateObj.getTime()),L=(N.getMonth()<e.currentMonth||N.getMonth()>e.currentMonth+e.config.showMonths-1)&&e.config.mode!=="range";if(e.selectedDateElem=j,e.config.mode==="single")e.selectedDates=[N];else if(e.config.mode==="multiple"){var ne=ke(N);ne?e.selectedDates.splice(parseInt(ne),1):e.selectedDates.push(N)}else e.config.mode==="range"&&(e.selectedDates.length===2&&e.clear(!1,!1),e.latestSelectedDateObj=N,e.selectedDates.push(N),Ft(N,e.selectedDates[0],!0)!==0&&e.selectedDates.sort(function(z,te){return z.getTime()-te.getTime()}));if(c(),L){var ve=e.currentYear!==N.getFullYear();e.currentYear=N.getFullYear(),e.currentMonth=N.getMonth(),ve&&(I("onYearChange"),O()),I("onMonthChange")}if(Ae(),E(),Te(),L||e.config.mode==="range"||e.config.showMonths!==1?e.selectedDateElem!==void 0&&e.hourElement===void 0&&e.selectedDateElem&&e.selectedDateElem.focus():k(j),e.hourElement!==void 0&&e.hourElement!==void 0&&e.hourElement.focus(),e.config.closeOnSelect){var $=e.config.mode==="single"&&!e.config.enableTime,V=e.config.mode==="range"&&e.selectedDates.length===2&&!e.config.enableTime;($||V)&&T()}p()}}e.parseDate=Za({config:e.config,l10n:e.l10n}),e._handlers=[],e.pluginElements=[],e.loadedPlugins=[],e._bind=d,e._setHoursFromDate=l,e._positionCalendar=H,e.changeMonth=_,e.changeYear=de,e.clear=function(C,x){if(C===void 0&&(C=!0),x===void 0&&(x=!0),e.input.value="",e.altInput!==void 0&&(e.altInput.value=""),e.mobileInput!==void 0&&(e.mobileInput.value=""),e.selectedDates=[],e.latestSelectedDateObj=void 0,x===!0&&(e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth()),e.config.enableTime===!0){var j=ua(e.config);u(j.hours,j.minutes,j.seconds)}e.redraw(),C&&I("onChange")},e.close=function(){e.isOpen=!1,e.isMobile||(e.calendarContainer!==void 0&&e.calendarContainer.classList.remove("open"),e._input!==void 0&&e._input.classList.remove("active")),I("onClose")},e.onMouseOver=ae,e._createElement=He,e.createDay=y,e.destroy=function(){e.config!==void 0&&I("onDestroy");for(var C=e._handlers.length;C--;)e._handlers[C].remove();if(e._handlers=[],e.mobileInput)e.mobileInput.parentNode&&e.mobileInput.parentNode.removeChild(e.mobileInput),e.mobileInput=void 0;else if(e.calendarContainer&&e.calendarContainer.parentNode)if(e.config.static&&e.calendarContainer.parentNode){var x=e.calendarContainer.parentNode;if(x.lastChild&&x.removeChild(x.lastChild),x.parentNode){for(;x.firstChild;)x.parentNode.insertBefore(x.firstChild,x);x.parentNode.removeChild(x)}}else e.calendarContainer.parentNode.removeChild(e.calendarContainer);e.altInput&&(e.input.type="text",e.altInput.parentNode&&e.altInput.parentNode.removeChild(e.altInput),delete e.altInput),e.input&&(e.input.type=e.input._type,e.input.classList.remove("flatpickr-input"),e.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(j){try{delete e[j]}catch{}})},e.isEnabled=re,e.jumpToDate=h,e.updateValue=Te,e.open=function(C,x){if(x===void 0&&(x=e._positionElement),e.isMobile===!0){if(C){C.preventDefault();var j=Rt(C);j&&j.blur()}return e.mobileInput!==void 0&&(e.mobileInput.focus(),e.mobileInput.click()),void I("onOpen")}if(!(e._input.disabled||e.config.inline)){var N=e.isOpen;e.isOpen=!0,N||(e.calendarContainer.classList.add("open"),e._input.classList.add("active"),I("onOpen"),H(x)),e.config.enableTime===!0&&e.config.noCalendar===!0&&(e.config.allowInput!==!1||C!==void 0&&e.timeContainer.contains(C.relatedTarget)||setTimeout(function(){return e.hourElement.select()},50))}},e.redraw=P,e.set=function(C,x){if(C!==null&&typeof C=="object")for(var j in Object.assign(e.config,C),C)q[j]!==void 0&&q[j].forEach(function(N){return N()});else e.config[C]=x,q[C]!==void 0?q[C].forEach(function(N){return N()}):aa.indexOf(C)>-1&&(e.config[C]=sa(x));e.redraw(),Te(!0)},e.setDate=function(C,x,j){if(x===void 0&&(x=!1),j===void 0&&(j=e.config.dateFormat),C!==0&&!C||C instanceof Array&&C.length===0)return e.clear(x);Z(C,j),e.latestSelectedDateObj=e.selectedDates[e.selectedDates.length-1],e.redraw(),h(void 0,x),l(),e.selectedDates.length===0&&e.clear(!1),Te(x),x&&I("onChange")},e.toggle=function(C){if(e.isOpen===!0)return e.close();e.open(C)};var q={locale:[J,K],showMonths:[R,i,U],minDate:[h],maxDate:[h],positionElement:[oe],clickOpens:[function(){e.config.clickOpens===!0?(d(e._input,"focus",e.open),d(e._input,"click",e.open)):(e._input.removeEventListener("focus",e.open),e._input.removeEventListener("click",e.open))}]};function Z(C,x){var j=[];if(C instanceof Array)j=C.map(function(N){return e.parseDate(N,x)});else if(C instanceof Date||typeof C=="number")j=[e.parseDate(C,x)];else if(typeof C=="string")switch(e.config.mode){case"single":case"time":j=[e.parseDate(C,x)];break;case"multiple":j=C.split(e.config.conjunction).map(function(N){return e.parseDate(N,x)});break;case"range":j=C.split(e.l10n.rangeSeparator).map(function(N){return e.parseDate(N,x)})}else e.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(C)));e.selectedDates=e.config.allowInvalidPreload?j:j.filter(function(N){return N instanceof Date&&re(N,!1)}),e.config.mode==="range"&&e.selectedDates.sort(function(N,L){return N.getTime()-L.getTime()})}function ie(C){return C.slice().map(function(x){return typeof x=="string"||typeof x=="number"||x instanceof Date?e.parseDate(x,void 0,!0):x&&typeof x=="object"&&x.from&&x.to?{from:e.parseDate(x.from,void 0),to:e.parseDate(x.to,void 0)}:x}).filter(function(x){return x})}function oe(){e._positionElement=e.config.positionElement||e._input}function I(C,x){if(e.config!==void 0){var j=e.config[C];if(j!==void 0&&j.length>0)for(var N=0;j[N]&&N<j.length;N++)j[N](e.selectedDates,e.input.value,e,x);C==="onChange"&&(e.input.dispatchEvent(Ce("change")),e.input.dispatchEvent(Ce("input")))}}function Ce(C){var x=document.createEvent("Event");return x.initEvent(C,!0,!0),x}function ke(C){for(var x=0;x<e.selectedDates.length;x++){var j=e.selectedDates[x];if(j instanceof Date&&Ft(j,C)===0)return""+x}return!1}function Ae(){e.config.noCalendar||e.isMobile||!e.monthNav||(e.yearElements.forEach(function(C,x){var j=new Date(e.currentYear,e.currentMonth,1);j.setMonth(e.currentMonth+x),e.config.showMonths>1||e.config.monthSelectorType==="static"?e.monthElements[x].textContent=si(j.getMonth(),e.config.shorthandCurrentMonth,e.l10n)+" ":e.monthsDropdownContainer.value=j.getMonth().toString(),C.value=j.getFullYear().toString()}),e._hidePrevMonthArrow=e.config.minDate!==void 0&&(e.currentYear===e.config.minDate.getFullYear()?e.currentMonth<=e.config.minDate.getMonth():e.currentYear<e.config.minDate.getFullYear()),e._hideNextMonthArrow=e.config.maxDate!==void 0&&(e.currentYear===e.config.maxDate.getFullYear()?e.currentMonth+1>e.config.maxDate.getMonth():e.currentYear>e.config.maxDate.getFullYear()))}function Pe(C){var x=C||(e.config.altInput?e.config.altFormat:e.config.dateFormat);return e.selectedDates.map(function(j){return e.formatDate(j,x)}).filter(function(j,N,L){return e.config.mode!=="range"||e.config.enableTime||L.indexOf(j)===N}).join(e.config.mode!=="range"?e.config.conjunction:e.l10n.rangeSeparator)}function Te(C){C===void 0&&(C=!0),e.mobileInput!==void 0&&e.mobileFormatStr&&(e.mobileInput.value=e.latestSelectedDateObj!==void 0?e.formatDate(e.latestSelectedDateObj,e.mobileFormatStr):""),e.input.value=Pe(e.config.dateFormat),e.altInput!==void 0&&(e.altInput.value=Pe(e.config.altFormat)),C!==!1&&I("onValueUpdate")}function he(C){var x=Rt(C),j=e.prevMonthNav.contains(x),N=e.nextMonthNav.contains(x);j||N?_(j?-1:1):e.yearElements.indexOf(x)>=0?x.select():x.classList.contains("arrowUp")?e.changeYear(e.currentYear+1):x.classList.contains("arrowDown")&&e.changeYear(e.currentYear-1)}return function(){e.element=e.input=t,e.isOpen=!1,function(){var x=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],j=Ct(Ct({},JSON.parse(JSON.stringify(t.dataset||{}))),n),N={};e.config.parseDate=j.parseDate,e.config.formatDate=j.formatDate,Object.defineProperty(e.config,"enable",{get:function(){return e.config._enable},set:function(le){e.config._enable=ie(le)}}),Object.defineProperty(e.config,"disable",{get:function(){return e.config._disable},set:function(le){e.config._disable=ie(le)}});var L=j.mode==="time";if(!j.dateFormat&&(j.enableTime||L)){var ne=nt.defaultConfig.dateFormat||Co.dateFormat;N.dateFormat=j.noCalendar||L?"H:i"+(j.enableSeconds?":S":""):ne+" H:i"+(j.enableSeconds?":S":"")}if(j.altInput&&(j.enableTime||L)&&!j.altFormat){var ve=nt.defaultConfig.altFormat||Co.altFormat;N.altFormat=j.noCalendar||L?"h:i"+(j.enableSeconds?":S K":" K"):ve+" h:i"+(j.enableSeconds?":S":"")+" K"}Object.defineProperty(e.config,"minDate",{get:function(){return e.config._minDate},set:X("min")}),Object.defineProperty(e.config,"maxDate",{get:function(){return e.config._maxDate},set:X("max")});var $=function(le){return function(ge){e.config[le==="min"?"_minTime":"_maxTime"]=e.parseDate(ge,"H:i:S")}};Object.defineProperty(e.config,"minTime",{get:function(){return e.config._minTime},set:$("min")}),Object.defineProperty(e.config,"maxTime",{get:function(){return e.config._maxTime},set:$("max")}),j.mode==="time"&&(e.config.noCalendar=!0,e.config.enableTime=!0),Object.assign(e.config,N,j);for(var V=0;V<x.length;V++)e.config[x[V]]=e.config[x[V]]===!0||e.config[x[V]]==="true";for(aa.filter(function(le){return e.config[le]!==void 0}).forEach(function(le){e.config[le]=sa(e.config[le]||[]).map(r)}),e.isMobile=!e.config.disableMobile&&!e.config.inline&&e.config.mode==="single"&&!e.config.disable.length&&!e.config.enable&&!e.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),V=0;V<e.config.plugins.length;V++){var z=e.config.plugins[V](e)||{};for(var te in z)aa.indexOf(te)>-1?e.config[te]=sa(z[te]).map(r).concat(e.config[te]):j[te]===void 0&&(e.config[te]=z[te])}j.altInputClass||(e.config.altInputClass=Y().className+" "+e.config.altInputClass),I("onParseConfig")}(),J(),function(){if(e.input=Y(),!e.input)return void e.config.errorHandler(new Error("Invalid input element specified"));e.input._type=e.input.type,e.input.type="text",e.input.classList.add("flatpickr-input"),e._input=e.input,e.config.altInput&&(e.altInput=He(e.input.nodeName,e.config.altInputClass),e._input=e.altInput,e.altInput.placeholder=e.input.placeholder,e.altInput.disabled=e.input.disabled,e.altInput.required=e.input.required,e.altInput.tabIndex=e.input.tabIndex,e.altInput.type="text",e.input.setAttribute("type","hidden"),!e.config.static&&e.input.parentNode&&e.input.parentNode.insertBefore(e.altInput,e.input.nextSibling)),e.config.allowInput||e._input.setAttribute("readonly","readonly"),oe()}(),function(){e.selectedDates=[],e.now=e.parseDate(e.config.now)||new Date;var x=e.config.defaultDate||(e.input.nodeName!=="INPUT"&&e.input.nodeName!=="TEXTAREA"||!e.input.placeholder||e.input.value!==e.input.placeholder?e.input.value:null);x&&Z(x,e.config.dateFormat),e._initialDate=e.selectedDates.length>0?e.selectedDates[0]:e.config.minDate&&e.config.minDate.getTime()>e.now.getTime()?e.config.minDate:e.config.maxDate&&e.config.maxDate.getTime()<e.now.getTime()?e.config.maxDate:e.now,e.currentYear=e._initialDate.getFullYear(),e.currentMonth=e._initialDate.getMonth(),e.selectedDates.length>0&&(e.latestSelectedDateObj=e.selectedDates[0]),e.config.minTime!==void 0&&(e.config.minTime=e.parseDate(e.config.minTime,"H:i")),e.config.maxTime!==void 0&&(e.config.maxTime=e.parseDate(e.config.maxTime,"H:i")),e.minDateHasTime=!!e.config.minDate&&(e.config.minDate.getHours()>0||e.config.minDate.getMinutes()>0||e.config.minDate.getSeconds()>0),e.maxDateHasTime=!!e.config.maxDate&&(e.config.maxDate.getHours()>0||e.config.maxDate.getMinutes()>0||e.config.maxDate.getSeconds()>0)}(),e.utils={getDaysInMonth:function(x,j){return x===void 0&&(x=e.currentMonth),j===void 0&&(j=e.currentYear),x===1&&(j%4==0&&j%100!=0||j%400==0)?29:e.l10n.daysInMonth[x]}},e.isMobile||function(){var x=window.document.createDocumentFragment();if(e.calendarContainer=He("div","flatpickr-calendar"),e.calendarContainer.tabIndex=-1,!e.config.noCalendar){if(x.appendChild((e.monthNav=He("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=He("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=He("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,R(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function($){e.__hidePrevMonthArrow!==$&&(Ot(e.prevMonthNav,"flatpickr-disabled",$),e.__hidePrevMonthArrow=$)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function($){e.__hideNextMonthArrow!==$&&(Ot(e.nextMonthNav,"flatpickr-disabled",$),e.__hideNextMonthArrow=$)}}),e.currentYearElement=e.yearElements[0],Ae(),e.monthNav)),e.innerContainer=He("div","flatpickr-innerContainer"),e.config.weekNumbers){var j=function(){e.calendarContainer.classList.add("hasWeeks");var $=He("div","flatpickr-weekwrapper");$.appendChild(He("span","flatpickr-weekday",e.l10n.weekAbbreviation));var V=He("div","flatpickr-weeks");return $.appendChild(V),{weekWrapper:$,weekNumbers:V}}(),N=j.weekWrapper,L=j.weekNumbers;e.innerContainer.appendChild(N),e.weekNumbers=L,e.weekWrapper=N}e.rContainer=He("div","flatpickr-rContainer"),e.rContainer.appendChild(U()),e.daysContainer||(e.daysContainer=He("div","flatpickr-days"),e.daysContainer.tabIndex=-1),E(),e.rContainer.appendChild(e.daysContainer),e.innerContainer.appendChild(e.rContainer),x.appendChild(e.innerContainer)}e.config.enableTime&&x.appendChild(function(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var $=ua(e.config);e.timeContainer=He("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var V=He("span","flatpickr-time-separator",":"),z=_r("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=z.getElementsByTagName("input")[0];var te=_r("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=te.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?$.hours:function(ge){switch(ge%24){case 0:case 12:return 12;default:return ge%12}}($.hours)),e.minuteElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():$.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(z),e.timeContainer.appendChild(V),e.timeContainer.appendChild(te),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var le=_r("flatpickr-second");e.secondElement=le.getElementsByTagName("input")[0],e.secondElement.value=Tt(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():$.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(He("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(le)}return e.config.time_24hr||(e.amPM=He("span","flatpickr-am-pm",e.l10n.amPM[Vt((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}()),Ot(e.calendarContainer,"rangeMode",e.config.mode==="range"),Ot(e.calendarContainer,"animate",e.config.animate===!0),Ot(e.calendarContainer,"multiMonth",e.config.showMonths>1),e.calendarContainer.appendChild(x);var ne=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!ne&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var ve=He("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(ve,e.element),ve.appendChild(e.element),e.altInput&&ve.appendChild(e.altInput),ve.appendChild(e.calendarContainer)}e.config.static||e.config.inline||(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}(),function(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(N){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+N+"]"),function(L){return d(L,"click",e[N])})}),e.isMobile)return void function(){var N=e.config.enableTime?e.config.noCalendar?"time":"datetime-local":"date";e.mobileInput=He("input",e.input.className+" flatpickr-mobile"),e.mobileInput.tabIndex=1,e.mobileInput.type=N,e.mobileInput.disabled=e.input.disabled,e.mobileInput.required=e.input.required,e.mobileInput.placeholder=e.input.placeholder,e.mobileFormatStr=N==="datetime-local"?"Y-m-d\\TH:i:S":N==="date"?"Y-m-d":"H:i:S",e.selectedDates.length>0&&(e.mobileInput.defaultValue=e.mobileInput.value=e.formatDate(e.selectedDates[0],e.mobileFormatStr)),e.config.minDate&&(e.mobileInput.min=e.formatDate(e.config.minDate,"Y-m-d")),e.config.maxDate&&(e.mobileInput.max=e.formatDate(e.config.maxDate,"Y-m-d")),e.input.getAttribute("step")&&(e.mobileInput.step=String(e.input.getAttribute("step"))),e.input.type="hidden",e.altInput!==void 0&&(e.altInput.type="hidden");try{e.input.parentNode&&e.input.parentNode.insertBefore(e.mobileInput,e.input.nextSibling)}catch{}d(e.mobileInput,"change",function(L){e.setDate(Rt(L).value,!1,e.mobileFormatStr),I("onChange"),I("onClose")})}();var x=ol(B,50);if(e._debouncedChange=ol(p,300),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&d(e.daysContainer,"mouseover",function(N){e.config.mode==="range"&&ae(Rt(N))}),d(e._input,"keydown",xe),e.calendarContainer!==void 0&&d(e.calendarContainer,"keydown",xe),e.config.inline||e.config.static||d(window,"resize",x),window.ontouchstart!==void 0?d(window.document,"touchstart",me):d(window.document,"mousedown",me),d(window.document,"focus",me,{capture:!0}),e.config.clickOpens===!0&&(d(e._input,"focus",e.open),d(e._input,"click",e.open)),e.daysContainer!==void 0&&(d(e.monthNav,"click",he),d(e.monthNav,["keyup","increment"],f),d(e.daysContainer,"click",W)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var j=function(N){return Rt(N).select()};d(e.timeContainer,["increment"],a),d(e.timeContainer,"blur",a,{capture:!0}),d(e.timeContainer,"click",m),d([e.hourElement,e.minuteElement],["focus","click"],j),e.secondElement!==void 0&&d(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&d(e.amPM,"click",function(N){a(N)})}e.config.allowInput&&d(e._input,"blur",pe)}(),(e.selectedDates.length||e.config.noCalendar)&&(e.config.enableTime&&l(e.config.noCalendar?e.latestSelectedDateObj:void 0),Te(!1)),i();var C=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!e.isMobile&&C&&H(),I("onReady")}(),e}function ko(t,n){for(var e=Array.prototype.slice.call(t).filter(function(a){return a instanceof HTMLElement}),o=[],r=0;r<e.length;r++){var i=e[r];try{if(i.getAttribute("data-fp-omit")!==null)continue;i._flatpickr!==void 0&&(i._flatpickr.destroy(),i._flatpickr=void 0),i._flatpickr=$0(i,n||{}),o.push(i._flatpickr)}catch(a){console.error(a)}}return o.length===1?o[0]:o}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return ko(this,t)},HTMLElement.prototype.flatpickr=function(t){return ko([this],t)});var nt=function(t,n){return typeof t=="string"?ko(window.document.querySelectorAll(t),n):t instanceof Node?ko([t],n):ko(t,n)};nt.defaultConfig={},nt.l10ns={en:Ct({},fr),default:Ct({},fr)},nt.localize=function(t){nt.l10ns.default=Ct(Ct({},nt.l10ns.default),t)},nt.setDefaults=function(t){nt.defaultConfig=Ct(Ct({},nt.defaultConfig),t)},nt.parseDate=Za({}),nt.formatDate=Yf({}),nt.compareDates=Ft,typeof jQuery<"u"&&jQuery.fn!==void 0&&(jQuery.fn.flatpickr=function(t){return ko(this,t)}),Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof t=="string"?parseInt(t,10):t))},typeof window<"u"&&(window.flatpickr=nt);const z0=["onCreate","onDestroy"],da=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],U0=t=>{const n=g.useMemo(()=>({...t}),[t]),{defaultValue:e,options:o={},value:r,children:i,render:a,onCreate:c,onDestroy:l}=n,u=g.useMemo(()=>((m,v)=>(da.forEach(y=>{const k=v[y],S=m[y];if(k){S&&!Array.isArray(S)?m[y]=[m[y]]:m[y]||(m[y]=[]);const b=Array.isArray(k)?k:[k];m[y].length===0?m[y]=b:m[y].push(...b)}}),da.forEach(y=>{delete v[y]}),z0.forEach(y=>{delete v[y]}),m))(o,n),[o,n]),f=g.useRef(null),d=g.useRef(void 0);g.useImperativeHandle(t.ref,()=>({get flatpickr(){return d.current}}),[]),g.useEffect(()=>{return u.onClose=u.onClose||(()=>{var v;(v=f.current)!=null&&v.blur&&f.current.blur()}),d.current=(((m=nt)==null?void 0:m.default)||nt)(f.current,u),c==null||c(d.current),()=>{l==null||l(d.current),d.current&&d.current.destroy(),d.current=void 0};var m},[u,c,l]),g.useEffect(()=>{var m;if(d.current){const v=Object.getOwnPropertyNames(u);for(let y=v.length-1;y>=0;y--){const k=v[y];let S=u[k];(S==null?void 0:S.toString())!==((m=d.current.config[k])==null?void 0:m.toString())&&(da.includes(k)&&!Array.isArray(S)&&(S=[S]),d.current.set(k,S))}r!==void 0&&r!==d.current.input.value&&d.current.setDate(r,!1)}},[u,r]);const p=g.useCallback(m=>{f.current=m},[]);if(a)return a({...n,defaultValue:e,value:r},p);const h=g.useCallback(m=>{var v,y;t&&t.onChange&&(Array.isArray(t==null?void 0:t.onChange)?(v=t==null?void 0:t.onChange)==null||v.forEach(()=>[new Date(m.target.value)],(r==null?void 0:r.toString())||""):typeof t.onChange=="function"&&((y=t==null?void 0:t.onChange)==null||y.call(t,[new Date(m.target.value)],(r==null?void 0:r.toString())||"",d.current)))},[t,r]);return o.wrap?s.jsx("div",{className:"flatpickr",ref:p,children:i}):s.jsx("input",{onChange:h,...n,value:r==null?void 0:r.toString(),defaultValue:e,ref:p})},il="T42.GD.Execute",Zf=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Kf=(t,n)=>t in n;function V0({time:t,frequency:n,day:e}){const o=new Date(`01/01/2000 ${t}`),r=o.getMinutes(),i=o.getHours();let a="*";return n==="weekly"&&e&&(a=function(c){const l={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if(!Kf(c,l))throw new Error(`Invalid day: ${c}`);return l[c]}(e).toString()),`${r} ${i} * * ${a}`}function G0(t){const n=g.useContext(Me.IOConnectContext),{value:e,update:o}=Wt({prefKey:Lr(t)}),{value:r,update:i}=Wt({prefKey:Lr(t,"Time")}),{value:a,update:c}=Wt({prefKey:Lr(t,"Frequency")}),{value:l,update:u}=Wt({prefKey:Lr(t,"Day")}),f=g.useCallback(async()=>{try{await n.interop.invoke(il,{command:`cancel-${t}`})}catch(p){console.error(p)}},[n,t]),d=g.useCallback(async()=>{try{const p=V0({time:r??"12:00 AM",frequency:a??"daily",day:a==="weekly"?l:"*"});await n.interop.invoke(il,{command:`schedule-${t}`,args:{cronTime:p,discardUnsavedLayoutChanges:!1}})}catch(p){console.error(`Failed to update cron job for ${t}:`,p)}},[n,t,r,a,l]);return g.useEffect(()=>{n&&e&&d()},[n,e,d]),{enabled:e??!1,time:r??"12:00 AM",frequency:a??"daily",day:l??"Monday",setEnabled:async p=>{p||await f();try{await o(p)}catch(h){console.error("Failed to update enabled state:",h)}},setTime:async p=>{try{await i(p)}catch(h){console.error("Failed to update time:",h)}},setFrequency:async p=>{try{await c(p),p==="daily"&&await u(void 0)}catch(h){console.error("Failed to update frequency:",h)}},setDay:async p=>{var h;if(h=p,Zf.includes(h))try{await u(p)}catch(m){console.error("Failed to update day:",m)}else console.error("Invalid day provided")}}}function Lr(t,n){const e=t==="restart"?"_system_scheduleRestart":"_system_scheduleShutdown";return n?`${e}${n}`:e}function qf({className:t,variant:n,...e}){const o=ee("io-block-list-gap",n,t),{enabled:r,time:i,frequency:a,day:c,setEnabled:l,setTime:u,setFrequency:f,setDay:d}=G0(n);return s.jsxs(Ke,{className:o,...e,children:[s.jsx(ft,{label:`Schedule ${n}`,align:"right",onChange:p=>l(p.target.checked),checked:r}),s.jsxs("div",{className:"scheduler-controls",children:[s.jsxs("div",{className:"io-control-input io-control-leading-icon direction-up",children:[s.jsx(ot,{variant:"clock"}),s.jsx(U0,{className:"io-input",options:{enableTime:!0,noCalendar:!0,dateFormat:"h:i K",defaultDate:i,clickOpens:!0},value:i,onClose:async([p])=>{const h=p.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!0});await u(h)}})]}),s.jsxs(Xt,{text:a.charAt(0).toUpperCase()+a.slice(1),icon:"chevron-down",iconRight:!0,children:[s.jsx(Xt.Item,{onClick:()=>f("daily"),children:"Daily"}),s.jsx(Xt.Item,{onClick:()=>f("weekly"),children:"Weekly"})]}),a==="weekly"&&s.jsx(Xt,{text:c,icon:"chevron-down",iconRight:!0,children:Zf.map(p=>s.jsx(Xt.Item,{onClick:()=>d(p),children:p},p))})]})]})}function Y0({className:t,...n}){return s.jsx(qf,{...n,className:t,variant:"restart"})}function Z0({className:t,...n}){return s.jsx(qf,{...n,className:t,variant:"shutdown"})}const Jf={Body:E0,General:j0,Theme:As,PinnedPosition:N0,AllowDocking:I0,MinimizeToTray:P0,AutoClose:A0,ShowTutorialOnStartup:T0,Layouts:D0,LayoutsRestoreLastSaved:M0,LayoutsSaveCurrentOnExit:_0,LayoutsShowUnsavedChangesPrompt:Ts,LayoutsShowDeletePrompt:Ds,Downloads:L0,DownloadsAskForEachDownload:R0,DownloadsLocation:F0,System:B0,SystemRestartSection:Y0,SystemShutdownSection:Z0},Xf=g.createContext(Jf),Qf=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...Jf,...n}),[n]);return s.jsx(Xf.Provider,{value:e,children:t})});Qf.displayName="PreferencesPanelComponentsStoreProvider";const _o=()=>g.useContext(Xf),ep=({className:t,onClose:n,title:e="Platform Preferences",children:o,...r})=>s.jsxs(Ge,{className:ee("io-preferences-panel",t),"data-testid":"preferences-panel",...r,children:[s.jsxs(Ge.Header,{"data-testid":"preferences-panel-header",children:[s.jsx(Ge.Header.Title,{size:"large",text:e,tag:"h1","data-testid":"preferences-panel-title"}),s.jsx(Ge.Header.ButtonGroup,{children:s.jsx(Ge.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n,"data-testid":"preferences-panel-close-button"})})]}),o]}),K0=({onClose:t,title:n="Platform Preferences",...e})=>{const{Body:o}=_o();return s.jsx(ep,{title:n,onClose:t,...e,children:s.jsx(o,{})})},q0=({components:t,...n})=>s.jsx(Qf,{components:t,children:s.jsx(K0,{...n})}),tp=t=>{const{General:n,Layouts:e}=Di();return s.jsxs(Oo,{...t,children:[s.jsx(n,{}),s.jsx(e,{})]})},np=({title:t="General",...n})=>{const{Theme:e}=Di();return s.jsx(Ke,{title:t,"data-testid":"preferences-panel-general-block",...n,children:s.jsx(e,{})})},op=({title:t="Layouts",...n})=>{const{LayoutsShowDeletePrompt:e}=Di();return s.jsx(Ke,{title:t,"data-testid":"preferences-panel-layouts-block",...n,children:s.jsx(e,{})})},rp={Body:tp,General:np,Theme:As,Layouts:op,LayoutsShowUnsavedChangesPrompt:Ts,LayoutsShowDeletePrompt:Ds},ip=g.createContext(rp),ap=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...rp,...n}),[n]);return s.jsx(ip.Provider,{value:e,children:t})});ap.displayName="PreferencesPanelComponentsStoreProvider";const Di=()=>g.useContext(ip),J0=({onClose:t,title:n="Platform Preferences",...e})=>{const{Body:o}=Di();return s.jsx(ep,{title:n,onClose:t,...e,children:s.jsx(o,{})})};var X0=Object.freeze({__proto__:null,General:np,Layouts:op,LayoutsShowDeletePrompt:Ds,LayoutsShowUnsavedChangesPrompt:Ts,Panel:({components:t,...n})=>s.jsx(ap,{components:t,children:s.jsx(J0,{...n})}),PanelBody:tp,Theme:As});const Q0=({name:t,value:n})=>s.jsxs("div",{className:"io-profile-section-item",children:[s.jsx("div",{className:"io-profile-section-item-name",children:t}),s.jsx("div",{className:"io-profile-section-item-value",children:n})]}),sp=({className:t,items:n,title:e})=>s.jsxs("div",{className:ee("io-profile-section-body",t),children:[e&&s.jsx(sn,{className:"io-profile-section-title",text:e}),n.map(({name:o,value:r})=>s.jsx(Q0,{name:o,value:r},o))]}),Ms=({className:t,items:n,title:e})=>s.jsxs("section",{className:ee("io-profile-section",t),children:[s.jsx(sp,{items:n,title:e}),s.jsx(wr,{className:"mt-8"})]}),cp=({title:t="License",...n})=>s.jsx(Ms,{title:t,...n}),lp=({title:t="Version",...n})=>s.jsx(Ms,{title:t,...n}),up=({title:t="Plugins",...n})=>s.jsx(Ms,{title:t,...n}),dp=({className:t})=>{const n=Oi()?"io.Connect Desktop":"io.Connect Browser";return s.jsxs("div",{className:ee("io-trademark-container",t),children:[s.jsx("h4",{className:"io-trademark-title",children:n}),s.jsxs("p",{className:"io-trademark-text",children:[n,"® is a registered trademark of"," ",s.jsx("a",{href:"https://www.interop.io",rel:"noreferrer",target:"_blank",children:"Interop Inc©"})," ",new Date().getFullYear(),". All rights reserved."]})]})},fp=({avatarInitials:t=Oi()?"CD":"CB",className:n,items:e,onLogout:o,title:r})=>s.jsxs("section",{className:ee("io-profile-section",n),children:[s.jsxs("div",{className:"io-user-details-container",children:[s.jsx("div",{className:"io-user-avatar",children:t}),s.jsx(sp,{className:"mt-12",items:e,title:r})]}),o&&s.jsx(Ye,{className:"io-log-out-button",onClick:o,variant:"primary",icon:"arrow-right-from-bracket",children:"Log out"}),s.jsx(wr,{className:"mt-8"})]}),pp={LicenseSection:cp,ProductsInfoSection:lp,PluginsSection:up,Trademark:dp,UserSection:fp},hp=g.createContext(pp),mp=g.memo(({children:t,components:n})=>{const e=g.useMemo(()=>({...pp,...n}),[n]);return s.jsx(hp.Provider,{value:e,children:t})});mp.displayName="ProfilePanelComponentsStoreProvider";const ev=t=>{const n=new Date(t);return[{day:"numeric"},{month:"short"},{year:"numeric"}].map(e=>n.toLocaleDateString("en",e)).join(" ")},tv=t=>{if(!t)return{items:[]};const n=[...t.email?[{name:"Email",value:t.email}]:[],...t.type?[{name:"User Type",value:t.type}]:[],...t.role?[{name:"User Role",value:t.role}]:[],{name:"User ID",value:t.id}];if(t.firstName||t.lastName){const e=[t.firstName,t.lastName].filter(o=>!!o);return{avatarInitials:e.map(o=>o.charAt(0)).join(""),items:n,title:e.join(" ")}}return t.username?{avatarInitials:t.username.charAt(0),items:n,title:t.username}:t.email?{avatarInitials:t.email.charAt(0),items:n}:{items:n}},nv=t=>{const n=new Date(2023,5,6),e=t.expiration<n.getTime()?1e3:1;return{items:[{name:"Type",value:t.type},{name:"Expiration Date",value:ev(t.expiration*e)}]}},ov=t=>({items:t.map(n=>({name:n.name,value:n.version}))}),rv=t=>{var e;const n={"@interopio/workspaces-ui-react":"Workspaces React Frame","@interopio/workspaces-ui-web-components":"Workspaces Web Components Frame"};return{items:[{name:"io.Connect Browser platform",value:t.platform.apiVersion},{name:"io.Connect Browser client",value:t.client.apiVersion},...t.workspaces?[{name:"Workspaces API",value:t.workspaces.apiVersion}]:[],...(e=t.workspaces)!=null&&e.container&&Kf(t.workspaces.container.type,n)?[{name:n[t.workspaces.container.type],value:t.workspaces.container.version}]:[],...t.home?[{name:"Home UI",value:t.home.version}]:[],...t.search?[{name:"Search API",value:t.search.apiVersion}]:[],...t.modals?[{name:"Modals API",value:t.modals.apiVersion}]:[]]}},iv=()=>{const t=window.glue42gd??window.iodesktop;if(!t)throw new Error("both window.glue42gd and window.iodesktop are not available");const{user:n,env:e}=t,o=[{name:"Environment",value:e.env},{name:"Region",value:e.region}];return n?{avatarInitials:n.charAt(0),items:o,title:n}:{items:o}},av=t=>({items:Object.entries(t??{}).map(([e,o])=>({name:e,value:o}))}),sv=t=>({items:t.map(({product:e,version:o})=>({name:e,value:o}))}),cv=t=>Oi()?(async n=>{const{licInfo:e,productInfo:o}=(await n.interop.invoke("T42.GD.GetInfo")).returned;return{user:iv(),license:av(e),productsInfo:sv(o)}})(t):(async()=>{if(!window.iobrowser)throw new Error("window.iobrowser is not available");const n=await window.iobrowser.system.getProfileData();return{user:tv(n.user),license:nv(n.license),plugins:ov(n.plugins),productsInfo:rv(n.productsInfo)}})(),lv=({className:t,onClose:n,onLogout:e,title:o="Profile",...r})=>{var h;const{LicenseSection:i,ProductsInfoSection:a,PluginsSection:c,Trademark:l,UserSection:u}=g.useContext(hp),f=g.useContext(Me.IOConnectContext),[d,p]=g.useState(null);return g.useEffect(()=>{f&&(async()=>{const m=await cv(f);p(m)})().catch(console.error)},[f]),s.jsxs(Ge,{className:ee("io-profile-panel",t),"data-testid":"profile-panel",...r,children:[s.jsxs(Ge.Header,{children:[s.jsx(Ge.Header.Title,{size:"large",text:o}),s.jsx(Ge.Header.ButtonGroup,{children:s.jsx(Ge.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:n})})]}),s.jsxs(Ge.Body,{children:[d!=null&&d.user.items.length||d!=null&&d.user.title?s.jsx(u,{avatarInitials:d.user.avatarInitials,items:d.user.items,onLogout:e,title:d.user.title}):null,s.jsxs("div",{className:"io-scrollable-profile-sections-container",children:[d!=null&&d.license.items.length?s.jsx(i,{items:d.license.items}):null,d!=null&&d.productsInfo.items.length?s.jsx(a,{items:d.productsInfo.items}):null,(h=d==null?void 0:d.plugins)!=null&&h.items.length?s.jsx(c,{items:d.plugins.items}):null]}),s.jsx(l,{className:"mt-auto"})]})]})},gp=({components:t,...n})=>s.jsx(mp,{components:t,children:s.jsx(lv,{...n})});var uv=Object.freeze({__proto__:null,LicenseSection:cp,Panel:gp,PluginsSection:up,ProductsInfoSection:lp,Trademark:dp,UserSection:fp});const vp=g.createContext(void 0),al=()=>{const t=g.useContext(vp);if(!t)throw new Error("usePanelManagerContext must be used within a PanelManagerContext.Provider");return t},dv=document.querySelector("#root")??document.body,fv={preferences:q0,"notification-settings":Os,profile:gp};var pv=Object.freeze({__proto__:null,ActivePanelRenderer:()=>{const{panel:t,deselectPanel:n}=al();Sa(()=>{t&&n()},["Escape"]);const e=t?fv[t]:null;return e?jn.createPortal(s.jsx("div",{className:"io-panel-overlay",children:s.jsx(e,{onClose:n})}),dv):null},PanelManagerProvider:({children:t})=>{const[n,e]=g.useState(null),o=g.useCallback(a=>{e(a)},[]),r=g.useCallback(()=>{e(null)},[]),i=g.useMemo(()=>({panel:n,selectPanel:o,deselectPanel:r}),[n,o,r]);return s.jsx(vp.Provider,{value:i,children:t})},usePanelManagerContext:al});const hv=X0,ir=t=>"items"in t,bt={APPLICATION:"application",WORKSPACE:"workspace",LAYOUT:"layout",ACTION_BUTTON:"action-button"},Ka=t=>typeof t=="string"?t:t!=null&&t.message?typeof t.message=="string"?t.message:JSON.stringify(t.message):JSON.stringify(t),yp=()=>typeof window.glue42gd<"u"||typeof window.glue42alert<"u"||typeof window.glue42dialog<"u"||typeof window.iodesktop<"u",ci={OPEN_IN_NEW_WINDOW:"openInNewWindow",OPEN_IN_NEW_WORKSPACE:"openInNewWorkspace"},wp=yp()?[]:[{name:ci.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out"},{name:ci.OPEN_IN_NEW_WORKSPACE,displayName:"Open in a new Workspace",icon:"pop-out"}],li={OPEN_IN_NEW_WINDOW:"openInNewWindow",DELETE:"delete"},bp=[{name:li.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out",separatorAfter:!0},{name:li.DELETE,displayName:"Delete",icon:"trash-can"}],pr={ASCENDING:"ascending",DESCENDING:"descending",DISABLED:"disabled"},Mi=new Intl.Collator(void 0,{sensitivity:"base"}),xp=(t,n)=>Mi.compare(t.title,n.title),Cp=(t,n)=>Mi.compare(n.title,t.title),_s=t=>{const{items:n,sortOrder:e,ascendingCompare:o,descendingCompare:r}=t;if(e===pr.DISABLED)return n;const i=e===pr.ASCENDING?o:r;return[...n].sort(i)},So={FAVORITES:"favorites-section",WORKSPACES:"workspaces-section",APPLICATIONS:"applications-section"},qa=(t,n,e,o)=>{const{isFolderCollapsible:r}=o,i="/",[a,...c]=e.split(i),l=t.findIndex(f=>ir(f)&&f.title===a),u=l!==-1?t[l]:null;return u?[...t.slice(0,l),{...u,items:c.length>0?qa(u.items,n,c.join(i),o):[...u.items,n]},...t.slice(l+1)]:[...t,{id:a,title:a,items:c.length>0?qa([],n,c.join(i),o):[n],isCollapsible:r}]},ui=t=>{const{title:n,userProperties:e}=t,{folder:o}=e;return o?`${o}/${n}`:n},mv=(t,n)=>Mi.compare(ui(t),ui(n)),gv=(t,n)=>Mi.compare(ui(n),ui(t)),vv=(t,n,e)=>{const{isSectionCollapsible:o,sortOrder:r=pr.ASCENDING}=e,a=_s({items:t,sortOrder:r,ascendingCompare:mv,descendingCompare:gv}).reduce((c,l)=>{var d;const u={id:l.id,title:l.title,description:l.caption,type:bt.APPLICATION,icon:"application",iconSrc:l.icon,openInstances:(d=n[l.name])==null?void 0:d.length,contextMenuActions:wp},f=l.userProperties.folder;return f?qa(c,u,f,e):[...c,u]},[]);return{id:So.APPLICATIONS,title:"Apps",items:a,isCollapsible:o}};var yv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ja={exports:{}},Rr={exports:{}},$e={};/** @license React v16.13.1
13
13
  * react-is.production.min.js
14
14
  *
15
15
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -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 ot=_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(ot(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(ot(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(ot(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(ot(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:ot("io-base-section-header",n),prepend:r&&s.jsx(nt,{size:"16",variant:e?"folder-open":"folder","data-testid":"base-section-header-folder-icon"}),append:o&&s.jsx(nt,{className:ot("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=>({...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};/*! *****************************************************************************
36
36
  Copyright (c) Microsoft Corporation.
37
37
 
38
38
  Permission to use, copy, modify, and/or distribute this software for any
@@ -45,7 +45,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
45
45
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
46
46
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
47
47
  PERFORMANCE OF THIS SOFTWARE.
48
- ***************************************************************************** */var cs=function(){return cs=Object.assign||function(n){for(var e,o=1,r=arguments.length;o<r;o++){e=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},cs.apply(this,arguments)};function qy(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]]);return e}function ls(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(!ls(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(var e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!ls(t[o[e]],n[o[e]]))return!1;return!0}}var nr=function(t){return Array.isArray(t)},Hr=function(t){return typeof t=="object"&&t!==null&&!nr(t)},Jy=function(t){switch(typeof t){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return t instanceof Array?"an array":t===null?"null":"an object";default:return JSON.stringify(t)}},fn=function(t,n){return"expected "+t+", got "+Jy(n)},Zo=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},Ko=function(t,n){var e=n.at,o=qy(n,["at"]);return cs({at:t+(e||"")},o)},pt=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return ya(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return Vy(e.run(o))},this.runWithException=function(o){return Yy(e.run(o))},this.map=function(o){return new t(function(r){return Zy(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return Ky(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"?gt(n):st({message:fn("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?gt(n):st({message:fn("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?gt(n):st({message:fn("a boolean",n)})})},t.constant=function(n){return new t(function(e){return ls(e,n)?gt(n):st({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Hr(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok===!0)i.result!==void 0&&(o[r]=i.result);else return e[r]===void 0?st({message:"the key '"+r+"' is required but was not present"}):st(Ko("."+r,i.error))}return gt(o)}else return Hr(e)?gt(e):st({message:fn("an object",e)})})},t.array=function(n){return new t(function(e){if(nr(e)&&n){var o=function(r,i){return ya(function(a){return Ko("["+i+"]",a)},n.decode(r))};return e.reduce(function(r,i,a){return Dl(function(c,l){return c.concat([l])},r,o(i,a))},gt([]))}else return nr(e)?gt(e):st({message:fn("an array",e)})})},t.tuple=function(n){return new t(function(e){if(nr(e)){if(e.length!==n.length)return st({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)o[r]=i.result;else return st(Ko("["+r+"]",i.error))}return gt(o)}else return st({message:fn("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 Dl(Object.assign,a,c.decode(i))},gt({}))})},t.anyJson=function(){return new t(function(n){return gt(n)})},t.unknownJson=function(){return new t(function(n){return gt(n)})},t.dict=function(n){return new t(function(e){if(Hr(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok===!0)o[r]=i.result;else return st(Ko("."+r,i.error))}return gt(o)}else return st({message:fn("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?gt(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 st({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return gt(Gy(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 st({at:Zo(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Hr(r))return st({at:Zo(n.slice(0,i+1)),message:fn("an object",r)});if(typeof n[i]=="number"&&!nr(r))return st({at:Zo(n.slice(0,i+1)),message:fn("an array",r)});r=r[n[i]]}return ya(function(a){return r===void 0?{at:Zo(n),message:"path does not exist"}:Ko(Zo(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return gt(n)})},t.fail=function(n){return new t(function(e){return st({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),Xy=pt.string,Qy=pt.number,Do=pt.boolean,jt=pt.anyJson;pt.unknownJson;var Mn=pt.constant,Xe=pt.object,ew=pt.array;pt.tuple;pt.dict;var _e=pt.optional,gr=pt.oneOf;pt.union;pt.intersection;pt.withDefault;pt.valueAt;pt.succeed;var tw=pt.fail;pt.lazy;const Dt=Xy().where(t=>t.length>0,"Expected a non-empty string"),nw=Qy().where(t=>t>=0,"Expected a non-negative number");Do();const zt=(t,n)=>{const e=typeof t;return e==="function"?jt():tw(`The provided argument as ${n} should be of type function, provided: ${typeof e}`)},zp=Xe({name:Dt}),ow="Welcome",rw=t=>t.components.reduce((e,o)=>{if(o.type==="workspaceFrame"){const r=o.state.workspaces.map(i=>i.config.name);e.push(...r)}return e},[]),Up=t=>t.trim().length>0,iw=(t,n)=>{const[e,o]=g.useState(void 0),[r,i]=ln("sessionStorage",$p,zp),a=g.useRef(!1),c=ec(),l=tc(),u=g.useContext(Me.IOConnectContext),f=g.useCallback(async({name:d})=>{try{await u.layouts.setDefaultGlobal(d)}catch(p){console.error("Failed to set default Layout: ",{error:p})}},[u]);return g.useEffect(()=>{if(u)return u.layouts.onDefaultGlobalChanged(d=>{o(d)})},[u]),g.useEffect(()=>{if(u)return u.layouts.onRestored(d=>{i({name:d.name})})},[u]),g.useEffect(()=>{if(u)return u.layouts.onRemoved(d=>{(d==null?void 0:d.name)===(r==null?void 0:r.name)&&i(null)})},[u,r]),g.useEffect(()=>{if(u)return u.layouts.onRenamed((d,p)=>{(p==null?void 0:p.name)===(r==null?void 0:r.name)&&i({name:d.name})})},[u,r]),g.useEffect(()=>{var p;if(!u||!((p=window.iobrowser)!=null&&p.platformStarted)||a.current)return;(async()=>{var k;a.current=!0;const h=await u.layouts.getDefaultGlobal()??(await u.layouts.getAll("Global")).find(S=>S.name===ow);if(!h||(o({name:h.name}),r))return;if(t(!0),n){await c(h.name),t(!1);return}const m=await((k=u.workspaces)==null?void 0:k.getWorkspace(S=>S.children.length===0)),v=await u.layouts.get(h.name,"Global");if(!v)throw new Error("Default Global Layout not found.");const y=rw(v);Promise.all(y.map((S,b)=>l({id:S,reuseWorkspaceId:b===0?m==null?void 0:m.id:void 0}))),t(!1)})().catch(h=>console.error("Initial Global Layout setup failed. ",Ka(h)))},[u,r,c,l,n]),{defaultLayout:e,activeLayout:r,setDefaultLayout:f,setActiveLayout:i}},Vp=g.createContext(void 0),en=()=>{const t=g.useContext(Vp);if(t===void 0)throw new Error("useLaunchpadAPI must be used within a LaunchpadAPIProvider");return t},aw=({children:t,close:n,isOpen:e,isGlobalLayoutsAvailable:o})=>{const[r,i]=g.useState(!1),{defaultLayout:a,activeLayout:c,setDefaultLayout:l,setActiveLayout:u}=iw(i,o),f=g.useMemo(()=>({close:n,isOpen:e,defaultLayout:a,activeLayout:c,setDefaultLayout:l,setActiveLayout:u,isLayoutOperationBlocked:r,setIsLayoutOperationBlocked:i,isGlobalLayoutsAvailable:o}),[n,e,a,c,l,u,r,o]);return s.jsx(Vp.Provider,{value:f,children:t})},Ro={CUSTOM_PREFS:"customPrefs",COLLAPSED_SECTIONS:"_launchpad_collapsedSections",FAVORITES:"_launchpad_favorites",IS_LAYOUTS_PANEL_OPEN:"_launchpad_isLayoutsPanelOpen",IS_LAUNCHPAD_COLLAPSED:"_launchpad_isCollapsed",IS_LAUNCHPAD_PINNED:"_launchpad_isPinned",LAYOUTS_SHOW_DELETE_PROMPT:"_layouts_showDeletePrompt"},so=()=>{const{value:t,update:n,isLoading:e,error:o}=Wt({prefKey:Ro.IS_LAUNCHPAD_PINNED}),r=g.useCallback(()=>n(i=>!i),[n]);return{error:o,isLaunchpadPinned:t,isLoading:e,toggle:r}},Gp=()=>{const t=g.useContext(Me.IOConnectContext),{setActiveLayout:n,setDefaultLayout:e,close:o}=en(),{isLaunchpadPinned:r}=so(),{value:i,update:a}=Wt({prefKey:Ro.LAYOUTS_SHOW_DELETE_PROMPT}),c=()=>{r||o==null||o()};return g.useCallback(async u=>{const{layout:f,actionName:d}=u;return await Wy[d]({io:t,layout:f,setActiveLayout:n,setDefaultLayout:e,closeLaunchpad:c,showDeletePromptPref:i,updateShowDeletePromptPref:a})},[t,e,n,o,i,a])},Fo=()=>{const{isLayoutOperationBlocked:t,setIsLayoutOperationBlocked:n}=en();return async e=>{if(!t){n(!0);try{await e()}catch(o){console.error("Layout operation failed: ",{error:o})}n(!1)}}},Yp={CREATE_WORKSPACE:"createWorkspace"},sw=async t=>{const{io:n,item:e}=t;if(n.workspaces)try{await n.workspaces.restoreWorkspace(e.id,{newFrame:!0})}catch(o){await Fe({io:n,variant:Le.WARNING,text:`Failed to load Workspace "${e.title}".`,error:o})}},cw=async t=>{const{io:n,item:e,removeFavorite:o}=t;if(n.workspaces){if("modals"in n&&n.modals){const r="delete",{isEnterPressed:i,responseButtonClicked:a}=await n.modals.dialogs.request({templateName:Lo.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:`Delete "${e.title}"`,text:"Are you sure you want to delete this Workspace?",actionButtons:[{variant:"critical",text:"Delete",id:r},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(!(i||(a==null?void 0:a.id)===r))return}try{await n.workspaces.layouts.delete(e.id),await o(e),await Fe({io:n,variant:Le.SUCCESS,text:`"Workspace ${e.title}" was successfully deleted.`})}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to delete Workspace "${e.title}".`,error:r})}}},lw=async t=>{const{io:n}=t;if(n.workspaces)try{await n.workspaces.createWorkspace({children:[],frame:{newFrame:!0}})}catch(e){await Fe({io:n,variant:Le.WARNING,text:"Failed to create a new Workspace.",error:e})}},uw={[li.OPEN_IN_NEW_WINDOW]:sw,[li.DELETE]:cw,[Yp.CREATE_WORKSPACE]:lw};class Zp{constructor(){It(this,"queue",[]);It(this,"isExecutingQueue",!1)}enqueue(n){return new Promise((e,o)=>{this.queue.push({action:n,resolve:e,reject:o}),this.executeQueue()})}async executeQueue(){if(!this.isExecutingQueue){for(this.isExecutingQueue=!0;this.queue.length;){const n=this.queue.shift();if(!n){this.isExecutingQueue=!1;return}try{const e=await n.action();n.resolve(e)}catch(e){n.reject(e)}await this.intervalBreak()}this.isExecutingQueue=!1}}intervalBreak(){return new Promise(n=>setTimeout(n,0))}}const Kp=()=>{const[t,n]=g.useState([]),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!(e!=null&&e.workspaces))return;let o=!1;const r=e.workspaces.layouts.onSaved(({name:a})=>{o||t.find(({id:c})=>c===a)||n(c=>[...c,{id:a,title:a}])}),i=e.workspaces.layouts.onRemoved(({name:a})=>{o||n(c=>c.filter(({title:l})=>l!==a))});return()=>{o=!0,[r,i].forEach(async a=>{try{(await a)()}catch(c){console.error(c)}})}},[e,t]),t},Ml=new Zp,Fi=()=>{const{value:t,update:n,isLoading:e}=Wt({prefKey:Ro.FAVORITES}),o=Hp(),r=Kp(),i=g.useMemo(()=>(t??[]).filter(l=>l.type===bt.APPLICATION?o.some(u=>u.id===l.id):l.type===bt.WORKSPACE?r.some(u=>u.id===l.id):!0),[t,o,r]),a=g.useCallback(({openInstances:l,...u})=>Ml.enqueue(()=>n((f=[])=>{const d=f.find(p=>p.id===u.id&&p.type&&u.type);return d?f.filter(p=>p!==d):[u,...f]})),[n]),c=g.useCallback(l=>Ml.enqueue(()=>n((u=[])=>u.filter(f=>!(f.id===l.id&&f.type===l.type)))),[n]);return{favorites:i,toggleFavorite:a,removeFavorite:c,isLoading:e}},qp=()=>{const t=g.useContext(Me.IOConnectContext),{removeFavorite:n}=Fi();return(e,o)=>{uw[o]({io:t,item:e,removeFavorite:n})}},dw=()=>{const t=g.useContext(Me.IOConnectContext);return async n=>t.interop.methods().every(e=>e.name!==(n==null?void 0:n.method))?console.error("Interop method not found."):await t.interop.invoke(n.method,n.params,n.target).catch(e=>console.error({error:e}))},fw=()=>{const[t,n]=g.useState(!1),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!e)return;let o;return(async()=>{var r;try{o=await((r=e.workspaces)==null?void 0:r.onWorkspaceOpened(()=>n(!0)))}catch(i){console.error(i)}})(),()=>o==null?void 0:o()},[e]),t},Ks=()=>{const{value:t,update:n,isLoading:e,error:o}=Wt({prefKey:Ro.IS_LAUNCHPAD_COLLAPSED});return{error:o,isLaunchpadCollapsed:t,setIsLaunchpadCollapsed:n,isLoading:e}};var us={exports:{}};(function(t,n){(function(e,o){var r="1.0.40",i="",a="?",c="function",l="undefined",u="object",f="string",d="major",p="model",h="name",m="type",v="vendor",y="version",k="architecture",S="console",b="mobile",w="tablet",E="smarttv",O="wearable",F="embedded",R=500,U="Amazon",K="Apple",_="ASUS",A="BlackBerry",me="Browser",de="Chrome",re="Edge",ye="Firefox",pe="Google",xe="Huawei",ae="LG",B="Microsoft",X="Motorola",Y="Opera",J="Samsung",H="Sharp",P="Sony",T="Xiaomi",W="Zebra",q="Facebook",Z="Chromium OS",ie="Mac OS",oe=" Browser",I=function($,V){var z={};for(var te in $)V[te]&&V[te].length%2===0?z[te]=V[te].concat($[te]):z[te]=$[te];return z},Ce=function($){for(var V={},z=0;z<$.length;z++)V[$[z].toUpperCase()]=$[z];return V},ke=function($,V){return typeof $===f?Ae(V).indexOf(Ae($))!==-1:!1},Ae=function($){return $.toLowerCase()},Pe=function($){return typeof $===f?$.replace(/[^\d\.]/g,i).split(".")[0]:o},Te=function($,V){if(typeof $===f)return $=$.replace(/^\s\s*/,i),typeof V===l?$:$.substring(0,R)},he=function($,V){for(var z=0,te,le,ge,se,G,Se;z<V.length&&!G;){var Be=V[z],Oe=V[z+1];for(te=le=0;te<Be.length&&!G&&Be[te];)if(G=Be[te++].exec($),G)for(ge=0;ge<Oe.length;ge++)Se=G[++le],se=Oe[ge],typeof se===u&&se.length>0?se.length===2?typeof se[1]==c?this[se[0]]=se[1].call(this,Se):this[se[0]]=se[1]:se.length===3?typeof se[1]===c&&!(se[1].exec&&se[1].test)?this[se[0]]=Se?se[1].call(this,Se,se[2]):o:this[se[0]]=Se?Se.replace(se[1],se[2]):o:se.length===4&&(this[se[0]]=Se?se[3].call(this,Se.replace(se[1],se[2])):o):this[se]=Se||o;z+=2}},C=function($,V){for(var z in V)if(typeof V[z]===u&&V[z].length>0){for(var te=0;te<V[z].length;te++)if(ke(V[z][te],$))return z===a?o:z}else if(ke(V[z],$))return z===a?o:z;return V.hasOwnProperty("*")?V["*"]:$},x={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},j={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},N={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,y],[/opios[\/ ]+([\w\.]+)/i],[y,[h,Y+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[h,Y+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[h,Y]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[h,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[y,[h,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,y],[/quark(?:pc)?\/([-\w\.]+)/i],[y,[h,"Quark"]],[/\bddg\/([\w\.]+)/i],[y,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[h,"UC"+me]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[h,"Smart Lenovo "+me]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+me],y],[/\bfocus\/([\w\.]+)/i],[y,[h,ye+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[h,Y+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[h,Y+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[h,"MIUI"+oe]],[/fxios\/([\w\.-]+)/i],[y,[h,ye]],[/\bqihoobrowser\/?([\w\.]*)/i],[y,[h,"360"]],[/\b(qq)\/([\w\.]+)/i],[[h,/(.+)/,"$1Browser"],y],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1"+oe],y],[/samsungbrowser\/([\w\.]+)/i],[y,[h,J+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[y,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[h,y],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[h],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[y,h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,q],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[h,de+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,de+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[h,"Android "+me]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[y,C,x]],[/(webkit|khtml)\/([\w\.]+)/i],[h,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],y],[/(wolvic|librewolf)\/([\w\.]+)/i],[h,y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[h,ye+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[h,[y,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[h,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[k,"amd64"]],[/(ia32(?=;))/i],[[k,Ae]],[/((?:i[346]|x)86)[;\)]/i],[[k,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[k,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[k,"armhf"]],[/windows (ce|mobile); ppc;/i],[[k,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[k,/ower/,i,Ae]],[/(sun4\w)[;\)]/i],[[k,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[k,Ae]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[v,J],[m,w]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[p,[v,J],[m,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[v,K],[m,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[v,K],[m,w]],[/(macintosh);/i],[p,[v,K]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[v,H],[m,b]],[/(?:honor)([-\w ]+)[;\)]/i],[p,[v,"Honor"],[m,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[v,xe],[m,w]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[v,xe],[m,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[p,/_/g," "],[v,T],[m,b]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[v,T],[m,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[v,"OPPO"],[m,b]],[/\b(opd2\d{3}a?) bui/i],[p,[v,"OPPO"],[m,w]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[v,"Vivo"],[m,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[v,"Realme"],[m,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[v,X],[m,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[v,X],[m,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[v,ae],[m,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[v,ae],[m,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[v,"Lenovo"],[m,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[v,"Nokia"],[m,b]],[/(pixel c)\b/i],[p,[v,pe],[m,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[v,pe],[m,b]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[v,P],[m,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[v,P],[m,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[v,"OnePlus"],[m,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[v,U],[m,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[v,U],[m,b]],[/(playbook);[-\w\),; ]+(rim)/i],[p,v,[m,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[v,A],[m,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[v,_],[m,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[v,_],[m,b]],[/(nexus 9)/i],[p,[v,"HTC"],[m,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[v,[p,/_/g," "],[m,b]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[p,[v,"TCL"],[m,w]],[/(itel) ((\w+))/i],[[v,Ae],p,[m,C,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[v,"Acer"],[m,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[v,"Meizu"],[m,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[v,"Ulefone"],[m,b]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[v,"Energizer"],[m,b]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[v,"Cat"],[m,b]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[v,"Smartfren"],[m,b]],[/droid.+; (a(?:015|06[35]|142p?))/i],[p,[v,"Nothing"],[m,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[v,p,[m,b]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[v,p,[m,w]],[/(surface duo)/i],[p,[v,B],[m,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[v,"Fairphone"],[m,b]],[/(u304aa)/i],[p,[v,"AT&T"],[m,b]],[/\bsie-(\w*)/i],[p,[v,"Siemens"],[m,b]],[/\b(rct\w+) b/i],[p,[v,"RCA"],[m,w]],[/\b(venue[\d ]{2,7}) b/i],[p,[v,"Dell"],[m,w]],[/\b(q(?:mv|ta)\w+) b/i],[p,[v,"Verizon"],[m,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[v,"Barnes & Noble"],[m,w]],[/\b(tm\d{3}\w+) b/i],[p,[v,"NuVision"],[m,w]],[/\b(k88) b/i],[p,[v,"ZTE"],[m,w]],[/\b(nx\d{3}j) b/i],[p,[v,"ZTE"],[m,b]],[/\b(gen\d{3}) b.+49h/i],[p,[v,"Swiss"],[m,b]],[/\b(zur\d{3}) b/i],[p,[v,"Swiss"],[m,w]],[/\b((zeki)?tb.*\b) b/i],[p,[v,"Zeki"],[m,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[v,"Dragon Touch"],p,[m,w]],[/\b(ns-?\w{0,9}) b/i],[p,[v,"Insignia"],[m,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[v,"NextBook"],[m,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[v,"Voice"],p,[m,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[v,"LvTel"],p,[m,b]],[/\b(ph-1) /i],[p,[v,"Essential"],[m,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[v,"Envizen"],[m,w]],[/\b(trio[-\w\. ]+) b/i],[p,[v,"MachSpeed"],[m,w]],[/\btu_(1491) b/i],[p,[v,"Rotor"],[m,w]],[/(shield[\w ]+) b/i],[p,[v,"Nvidia"],[m,w]],[/(sprint) (\w+)/i],[v,p,[m,b]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[v,B],[m,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[v,W],[m,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[v,W],[m,b]],[/smart-tv.+(samsung)/i],[v,[m,E]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[v,J],[m,E]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[v,ae],[m,E]],[/(apple) ?tv/i],[v,[p,K+" TV"],[m,E]],[/crkey/i],[[p,de+"cast"],[v,pe],[m,E]],[/droid.+aft(\w+)( bui|\))/i],[p,[v,U],[m,E]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[v,H],[m,E]],[/(bravia[\w ]+)( bui|\))/i],[p,[v,P],[m,E]],[/(mitv-\w{5}) bui/i],[p,[v,T],[m,E]],[/Hbbtv.*(technisat) (.*);/i],[v,p,[m,E]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[v,Te],[p,Te],[m,E]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,E]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[v,p,[m,S]],[/droid.+; (shield) bui/i],[p,[v,"Nvidia"],[m,S]],[/(playstation [345portablevi]+)/i],[p,[v,P],[m,S]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[v,B],[m,S]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[p,[v,J],[m,O]],[/((pebble))app/i],[v,p,[m,O]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[v,K],[m,O]],[/droid.+; (glass) \d/i],[p,[v,pe],[m,O]],[/droid.+; (wt63?0{2,3})\)/i],[p,[v,W],[m,O]],[/droid.+; (glass) \d/i],[p,[v,pe],[m,O]],[/(pico) (4|neo3(?: link|pro)?)/i],[v,p,[m,O]],[/; (quest( \d| pro)?)/i],[p,[v,q],[m,O]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[v,[m,F]],[/(aeobc)\b/i],[p,[v,U],[m,F]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[m,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[m,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,b]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[v,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[h,re+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[h,y],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,y],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[h,[y,C,j]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,C,j],[h,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,ie],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,y],[/\(bb(10);/i],[y,[h,A]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[h,ye+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[h,de+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,Z],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,y],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,y]]},L=function($,V){if(typeof $===u&&(V=$,$=o),!(this instanceof L))return new L($,V).getResult();var z=typeof e!==l&&e.navigator?e.navigator:o,te=$||(z&&z.userAgent?z.userAgent:i),le=z&&z.userAgentData?z.userAgentData:o,ge=V?I(N,V):N,se=z&&z.userAgent==te;return this.getBrowser=function(){var G={};return G[h]=o,G[y]=o,he.call(G,te,ge.browser),G[d]=Pe(G[y]),se&&z&&z.brave&&typeof z.brave.isBrave==c&&(G[h]="Brave"),G},this.getCPU=function(){var G={};return G[k]=o,he.call(G,te,ge.cpu),G},this.getDevice=function(){var G={};return G[v]=o,G[p]=o,G[m]=o,he.call(G,te,ge.device),se&&!G[m]&&le&&le.mobile&&(G[m]=b),se&&G[p]=="Macintosh"&&z&&typeof z.standalone!==l&&z.maxTouchPoints&&z.maxTouchPoints>2&&(G[p]="iPad",G[m]=w),G},this.getEngine=function(){var G={};return G[h]=o,G[y]=o,he.call(G,te,ge.engine),G},this.getOS=function(){var G={};return G[h]=o,G[y]=o,he.call(G,te,ge.os),se&&!G[h]&&le&&le.platform&&le.platform!="Unknown"&&(G[h]=le.platform.replace(/chrome os/i,Z).replace(/macos/i,ie)),G},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return te},this.setUA=function(G){return te=typeof G===f&&G.length>R?Te(G,R):G,this},this.setUA(te),this};L.VERSION=r,L.BROWSER=Ce([h,y,d]),L.CPU=Ce([k]),L.DEVICE=Ce([p,v,m,S,b,E,w,O,F]),L.ENGINE=L.OS=Ce([h,y]),t.exports&&(n=t.exports=L),n.UAParser=L;var ne=typeof e!==l&&(e.jQuery||e.Zepto);if(ne&&!ne.ua){var ve=new L;ne.ua=ve.getResult(),ne.ua.get=function(){return ve.getUA()},ne.ua.set=function($){ve.setUA($);var V=ve.getResult();for(var z in V)ne.ua[z]=V[z]}}})(typeof window=="object"?window:yv)})(us,us.exports);var pw=us.exports;const $n=new pw.UAParser,hw=()=>D.useMemo(()=>({os:$n.getOS(),browser:$n.getBrowser(),cpu:$n.getCPU(),device:$n.getDevice(),engine:$n.getEngine(),ua:$n.getUA()}),[]),mw=()=>D.useMemo(()=>$n.getBrowser(),[]),qs=()=>{const{ua:t}=hw();return t.includes("io-connect-desktop")},Jp=()=>{const[t,n]=g.useState([]),[e,o]=g.useState(!1),r=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!r)return;let i=!1;const a=[],c=r.layouts.onAdded(f=>{if(f.type!=="Global"||i)return;o(!0);const{name:d}=f;n(p=>[...p,{name:d}])}),l=r.layouts.onRemoved(f=>{f.type!=="Global"||i||n(d=>d.filter(p=>p.name!==f.name))}),u=r.layouts.onRenamed((f,d)=>{if(f.type!=="Global"||i)return;const{name:p}=f;n(h=>{const m=h.findIndex(v=>v.name===(d==null?void 0:d.name));return m===-1?h:[...h.slice(0,m),{name:p},...h.slice(m+1)]})});return a.push(c,l,u),()=>{i=!0,a.forEach(f=>f())}},[r]),{layouts:t,isInitialized:e}},Xp=()=>{const[t,n]=g.useState([]),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=e.notifications.onRaised(a=>n(c=>[...c,a])),r=e.notifications.onClosed(a=>n(c=>c.filter(l=>l.id!==a.id))),i=e.notifications.onStateChanged(({id:a},c)=>{n(l=>{const u=l.findIndex(f=>f.id===a);return u===-1?l:[...l.slice(0,u),{...l[u],state:c},...l.slice(u+1)]})});return e.notifications.list().then(n).catch(console.error),()=>{o(),r(),i()}},[e]),t},gw=()=>{const[t,n]=g.useState({}),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=e.notifications.onConfigurationChanged(r=>n(r));return()=>{o()}},[e]),t},Js=t=>{const{handler:n,skip:e}=t;g.useEffect(()=>{if(e)return;const o=r=>{var i;((i=document.activeElement)==null?void 0:i.nodeName)==="IFRAME"&&n(r)};return window.addEventListener("blur",o,!0),()=>{window.removeEventListener("blur",o,!0)}},[n,e])},Xs=t=>{const{eventType:n,handler:e,ref:o,skip:r}=t;g.useEffect(()=>{if(r)return;const i=a=>{const c=a.target;(Array.isArray(o)?o.every(u=>u.current&&!u.current.contains(c)):o.current&&!o.current.contains(c))&&e(a)};return document.addEventListener(n,i,!0),()=>{document.removeEventListener(n,i,!0)}},[n,e,o,r])},vw=Xe({name:Dt}),Sr=Xe({isCompleted:Do()}),ln=(t,n,e)=>{const[o,r]=g.useState(()=>{try{const c=window[t].getItem(n);return c?JSON.parse(c):null}catch(c){return console.log(c),null}}),i=`${t}-${n}`;g.useEffect(()=>{const c=l=>{r(l.detail)};return window.addEventListener(i,c),()=>{window.removeEventListener(i,c)}},[i]);const a=g.useCallback(c=>{try{if(!c){window[t].removeItem(n),r(null);return}const l=e.run(c);if(!l.ok){console.warn(`Error validating the value to be stored: ${l.error.message}`);return}const u=l.result;r(u),window[t].setItem(n,JSON.stringify(u)),window.dispatchEvent(new CustomEvent(i,{detail:u}))}catch(l){console.log(l)}},[n,t,i,e]);return[o,a]},Qs=()=>{const[t,n]=ln("sessionStorage",Uy,vw);return{isPlatformWindow:!t||window.name===t.name,setPlatformWindow:n}},Qp=()=>{const[t,n]=g.useState([]);return g.useEffect(()=>{const e=({key:i})=>{n(a=>a.includes(i)?a:a.concat(i))},o=i=>{n(a=>a.filter(c=>c!==i.key))},r=()=>{n([])};return document.addEventListener("keydown",e),document.addEventListener("keyup",o),window.addEventListener("blur",r),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",o),window.removeEventListener("blur",r)}},[]),t.length===1?t[0]:null},ec=()=>{const t=g.useContext(Me.IOConnectContext);return g.useCallback(async(n,e)=>{if(t)try{await t.layouts.restore({name:n}),e==null||e({name:n}),await Fe({io:t,variant:Le.SUCCESS,text:`Layout "${n}" was loaded successfully.`})}catch(o){await Fe({io:t,variant:Le.WARNING,text:`Failed to load Layout "${n}".`,error:o})}},[t])},Bi={CONTROL:"Control",SHIFT:"Shift"},tc=()=>{const t=g.useContext(Me.IOConnectContext),n=Ys();return async({id:e,modifier:o,reuseWorkspaceId:r})=>{var i;try{const a=o===Bi.CONTROL?{newFrame:!0}:{frameId:n,reuseWorkspaceId:r};await((i=t.workspaces)==null?void 0:i.restoreWorkspace(e,a))}catch(a){await Fe({io:t,variant:Le.WARNING,text:`Failed to load Workspace "${e}".`,error:a})}}},yw=t=>{const[n,e]=g.useState([]),[o,r]=g.useState(!0),i=g.useRef(null),a=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{const c=a==null?void 0:a.search;if(!c)return;const l=[],u=[];return(async d=>{r(!0),e([]);const p=await c.query({search:d.trim(),providerLimits:{maxResults:100,maxResultsPerType:5}});if(p===i.current)return;i.current=p;const h=p.onResults(y=>{y.results.forEach(k=>{u.find(b=>b.id===k.id&&b.type.name===k.type.name)||u.push(k)}),r(!1),e([...u])}),m=p.onCompleted(()=>{r(!1)}),v=p.onError(y=>{console.error(`Query failed. Provider: ${y.provider}; Error: ${y.error}`)});l.push(h,m,v)})(t),()=>{l.forEach(d=>d())}},[a,t]),{resultsToRender:n,isLoading:o}},eh=()=>{const t=g.useContext(Me.IOConnectContext),n=async({id:o})=>{var r;await((r=t.appManager.application(o))==null?void 0:r.start())},e=async({id:o,modifier:r})=>{var u,f;const i=await((u=t.workspaces)==null?void 0:u.getWorkspace(d=>d.isSelected===!0)),a=i==null?void 0:i.children[0];if(r===Bi.CONTROL||!i||(a==null?void 0:a.type)==="window"){await((f=t.appManager.application(o))==null?void 0:f.start());return}await((a==null?void 0:a.type)==="group"?a:await(a??i).addGroup()).addWindow({appName:o})};return async o=>{try{await(yp()?n:e)(o)}catch(r){await Fe({io:t,variant:Le.WARNING,text:`Failed to start app "${o.title}".`,error:r})}}},ww=()=>{const[t,n]=g.useState({}),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=[];return(async()=>{var r,i;try{const a=await((r=e.workspaces)==null?void 0:r.onWorkspaceOpened(l=>n(u=>({...u,[l.title]:[...u[l.title]??[],l.id]}))));o.push(a);const c=await((i=e.workspaces)==null?void 0:i.onWorkspaceClosed(({workspaceId:l})=>n(u=>{const f={...u};for(const d in f)if(f[d].includes(l)){f[d]=f[d].filter(p=>p!==l);break}return f})));o.push(c)}catch(a){console.error(a)}})(),()=>o.forEach(r=>r==null?void 0:r())},[e]),t},th=t=>t.key==="Enter"||t.key===" ",Hi=(t,n)=>typeof t>"u"?{}:{tabIndex:0,onClick:t,onKeyDown:e=>{th(e)&&(e.preventDefault(),t==null||t(e)),n==null||n(e)}},nh=({event:t,currentIndex:n,moveFocus:e,min:o,max:r,onClose:i})=>{switch(t.key){case"ArrowUp":{e(Math.max(n-1,o));break}case"ArrowDown":{e(Math.min(n+1,r));break}case"Home":{e(o);break}case"End":{e(r);break}case"Escape":{if(i){i();break}return}default:return}t.stopPropagation(),t.preventDefault()};const bw=g.forwardRef((t,n)=>{const{title:e,actions:o,className:r,onClose:i,onActionItemClick:a,"data-testid":c="context-menu",...l}=t,u=g.useRef({}),[f,d]=g.useState(0),p=h=>{var m;(m=u.current[h])==null||m.focus(),d(h)};return g.useEffect(()=>{var h;(h=u.current[f])==null||h.focus()},[]),s.jsxs(ut,{ref:n,className:ot(r,"context-menu"),onClick:h=>h.stopPropagation(),onKeyDown:h=>nh({event:h,currentIndex:f,min:0,max:o.length-1,moveFocus:p,onClose:i}),"data-testid":c,...l,children:[e&&s.jsx(ut.ItemSection,{children:e}),o.map((h,m)=>{const v=h.displayName||h.name,y=h.iconSrc?s.jsx(Wu,{size:"16",src:h.iconSrc,alt:`${v} icon`}):h.icon&&s.jsx(nt,{size:"16",variant:h.icon});return s.jsxs(g.Fragment,{children:[s.jsx(ut.Item,{ref:k=>u.current[m]=k,prepend:y,disabled:h.disabled,tabIndex:-1,...Hi(k=>a(k,h)),"data-testid":`${c}-item-${h.name}`,children:v}),h.separatorAfter&&s.jsx("li",{className:"context-menu-separator","aria-hidden":!0,"data-testid":`${c}-separator`})]},h.name)})]})});function nc(t){const{title:n,buttonSize:e="16",icon:o="ellipsis-vertical",iconSize:r="12",actions:i,isTabStop:a,onActionItemClick:c,buttonVariant:l,placement:u,offset:f,shouldCloseOnOutsideScroll:d=!1,shouldCloseOnWindowBlur:p=!1,"data-testid":h,contextMenuDataTestId:m}=t,[v,y]=g.useState(!1),[k,S]=g.useState(null),[b,w]=g.useState(null),E=g.useRef(null),O=g.useRef(null),F=g.useMemo(()=>[O,E],[]),R=g.useCallback(()=>y(!1),[]),{styles:U,attributes:K}=ry(k,b,{placement:u,modifiers:[{name:"offset",options:{offset:f}}]});g.useEffect(()=>{E.current=k},[k]),g.useEffect(()=>{O.current=b},[b]),Xs({eventType:"mouseup",handler:R,ref:F,skip:!v}),Js({handler:R,skip:!v}),g.useEffect(()=>{if(!(!p||!v))return window.addEventListener("blur",R),()=>{window.removeEventListener("blur",R)}},[R,v,p]),g.useEffect(()=>{if(!d||!b)return;const me=de=>{if(b.contains(de.target)){de.preventDefault();return}R()};return document.addEventListener("touchmove",me,{passive:!1}),document.addEventListener("wheel",me,{passive:!1}),()=>{document.removeEventListener("touchmove",me),document.removeEventListener("wheel",me)}},[R,b,d]);const _=me=>{me.stopPropagation(),y(de=>!de),b==null||b.focus()},A=(me,de)=>{me.stopPropagation(),c(me,de),R()};return s.jsxs(s.Fragment,{children:[s.jsx(Ve,{ref:S,size:e,icon:o,iconSize:r,variant:l,...Hi(_),tabIndex:a?0:-1,"data-testid":h}),v&&s.jsx(bw,{ref:w,title:n,actions:i,onActionItemClick:A,onClose:()=>{k==null||k.focus(),R()},style:U.popper,"data-testid":m,...K.popper})]})}const xw=t=>{const{isFavoritismEnabled:n=!0,item:e,onClick:o,onKeyDown:r,isFocused:i,liRef:a,...c}=t,{favorites:l,toggleFavorite:u,isLoading:f}=Fi(),{description:d,icon:p="application",iconSrc:h,openInstances:m=0,title:v,tooltip:y,className:k,contextMenuActions:S=[]}=e,b=n&&l.some(F=>F.type===e.type&&F.title===e.title),w=F=>{if(th(F)){o(F),F.preventDefault(),F.stopPropagation();return}r(F)},E=h?s.jsx(Wu,{size:"16",src:h,alt:`${v} icon`,"data-testid":"base-section-item-icon"}):s.jsx(nt,{size:"16",variant:p,"data-testid":"base-section-item-icon"}),O=s.jsxs(s.Fragment,{children:[m!==0&&s.jsx("span",{className:"open-instances io-text-smaller","data-testid":"base-section-item-open-instances",children:m===1?"Opened":`${m} opened`}),(n||S.length>0)&&s.jsxs(Re,{className:"item-actions",children:[n&&s.jsx(Ve,{...Hi(F=>{F.stopPropagation(),u(e)}),tabIndex:i?0:-1,size:"24",iconSize:"12",icon:b?"star-full":"star",disabled:f,"data-testid":"base-section-item-favorite-button"}),S.length>0&&s.jsx(nc,{buttonSize:"24",iconSize:"12",icon:"ellipsis-vertical",title:v,actions:S,onActionItemClick:o,isTabStop:i,placement:"bottom-end",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0,"data-testid":"base-section-item-context-menu-button"})]})]});return s.jsx(ut.Item,{ref:a,tabIndex:i?0:-1,className:ot("io-base-section-item",k),onKeyDown:w,onClick:o,prepend:E,append:O,description:d,tooltip:y??v,"data-testid":`base-section-item-${e.id}`,...c,children:v})},Cw=new Zp,kw=()=>{const{value:t,update:n}=Wt({prefKey:Ro.COLLAPSED_SECTIONS}),e=g.useCallback(o=>Cw.enqueue(()=>n((r=[])=>r.includes(o)?r.filter(a=>a!==o):[...r,o])),[n]);return{collapsedSections:t,toggleSection:e}},oc=t=>{const{config:n,level:e=1,path:o=n.id,onItemClick:r}=t,{isCollapsible:i=!0}=n,a=Qp(),[c,l]=g.useState(0),u=g.useRef({}),{collapsedSections:f,toggleSection:d}=kw(),p=i?!(f!=null&&f.includes(o)):!0,h=n.items.filter(w=>ir(w)),m=n.items.filter(w=>!ir(w)),v=[...h,...m],y=16,k=24,S=w=>{var E,O;(O=(E=u.current[w])==null?void 0:E.querySelector("[tabIndex]"))==null||O.focus(),l(w)},b=async()=>{i&&await d(o)};return s.jsxs(ut.ItemWithSubItems,{className:e===1?"main-section":void 0,"data-testid":`base-section-${n.id}`,children:[s.jsx(Ny,{className:e===1?"io-list-item-title main-section-header":void 0,isOpen:p,onClick:b,showCollapseIcon:i,showFolderIcon:e!==1,style:{paddingLeft:`${y+k*Math.max(0,e-2)}px`},"data-testid":`base-section-header-${n.id}`,title:n.title}),s.jsx(Bp,{isOpen:p,tag:ut,children:v.map((w,E)=>ir(w)?s.jsx(oc,{config:w,level:e+1,onItemClick:r,path:`${o}/${w.id}`},w.id):s.jsx(xw,{style:{paddingLeft:`${y+k*(e-1)}px`},liRef:O=>u.current[E]=O,isFavoritismEnabled:w.type===bt.APPLICATION||w.type===bt.WORKSPACE,item:w,onClick:(O,F)=>r==null?void 0:r(O,{item:w,modifier:a,selectedContextMenuActionName:F==null?void 0:F.name}),onKeyDown:O=>{nh({event:O,moveFocus:S,currentIndex:c,min:0,max:v.length-1})},isFocused:c===E},w.id))})]})},oh=t=>`${t.type}-${t.id}`,Sw=(t,n)=>rh(t)[n],rh=t=>t.reduce((n,e)=>ir(e)?{...n,...rh(e.items)}:{...n,[oh(e)]:e},{}),ih=g.createContext(void 0),Ew=()=>{const t=g.useContext(ih);if(t===void 0)throw new Error("useSection must be used within a SectionProvider");return t},jw=({children:t})=>{const[n,e]=g.useState(null),o=g.useMemo(()=>[n,e],[n]);return s.jsx(ih.Provider,{value:o,children:t})},Wi=({config:t,onItemClick:n})=>{const[e,o]=Ew(),r=en(),{isLaunchpadPinned:i}=so(),a=(c,l)=>{const{item:u,modifier:f,selectedContextMenuActionName:d}=l;o({itemName:oh(u),modifier:f,selectedContextMenuActionName:d})};return g.useEffect(()=>{var d;if(!n||!e)return;const{itemName:c,modifier:l,selectedContextMenuActionName:u}=e,f=Sw(t.items,c);f&&(n({item:f,modifier:l,selectedContextMenuActionName:u}),o(null),!(l===Bi.SHIFT||i)&&((d=r.close)==null||d.call(r)))},[e,t.items,r,n,o,i]),s.jsx(oc,{config:t,onItemClick:a})};function ah(t){const{isFolderCollapsible:n,isSectionCollapsible:e,sortOrder:o}=t,r=Hp(),i=Iy(),a=eh(),c=Wp(),l=g.useMemo(()=>vv(r,i,{isFolderCollapsible:n,isSectionCollapsible:e,sortOrder:o}),[r,i,n,e,o]),u=f=>{const{item:d,modifier:p,selectedContextMenuActionName:h}=f;if(!h)return a({id:d.id,title:d.title,modifier:p});c(d,h)};return s.jsx(Wi,{config:l,onItemClick:u})}const Ow=(t,n)=>{const{isSectionCollapsible:e,sortOrder:o=pr.DISABLED}=n,r=_s({items:t,sortOrder:o,ascendingCompare:xp,descendingCompare:Cp});return{id:So.FAVORITES,title:"Favorites",items:r,isCollapsible:e}},sh=t=>{const{isSectionCollapsible:n,sortOrder:e}=t,{favorites:o}=Fi(),r=g.useMemo(()=>Ow(o,{isSectionCollapsible:n,sortOrder:e}),[o,n,e]);return o.length>0?s.jsx(Wi,{config:r}):null},Nw=t=>{const{active:n,className:e,...o}=t;return s.jsx(Ve,{className:ot("launchpad-button",{active:n},e),"aria-label":"Launchpad",icon:"logo",variant:"circle",size:"32",title:n?"Close Launchpad":"Open Launchpad","data-testid":"launchpad-button",...o})};var Iw=function(n){return Pw(n)&&!Aw(n)};function Pw(t){return!!t&&typeof t=="object"}function Aw(t){var n=Object.prototype.toString.call(t);return n==="[object RegExp]"||n==="[object Date]"||Mw(t)}var Tw=typeof Symbol=="function"&&Symbol.for,Dw=Tw?Symbol.for("react.element"):60103;function Mw(t){return t.$$typeof===Dw}function _w(t){return Array.isArray(t)?[]:{}}function vr(t,n){return n.clone!==!1&&n.isMergeableObject(t)?Mo(_w(t),t,n):t}function Lw(t,n,e){return t.concat(n).map(function(o){return vr(o,e)})}function Rw(t,n){if(!n.customMerge)return Mo;var e=n.customMerge(t);return typeof e=="function"?e:Mo}function Fw(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(n){return Object.propertyIsEnumerable.call(t,n)}):[]}function _l(t){return Object.keys(t).concat(Fw(t))}function ch(t,n){try{return n in t}catch{return!1}}function Bw(t,n){return ch(t,n)&&!(Object.hasOwnProperty.call(t,n)&&Object.propertyIsEnumerable.call(t,n))}function Hw(t,n,e){var o={};return e.isMergeableObject(t)&&_l(t).forEach(function(r){o[r]=vr(t[r],e)}),_l(n).forEach(function(r){Bw(t,r)||(ch(t,r)&&e.isMergeableObject(n[r])?o[r]=Rw(r,e)(t[r],n[r],e):o[r]=vr(n[r],e))}),o}function Mo(t,n,e){e=e||{},e.arrayMerge=e.arrayMerge||Lw,e.isMergeableObject=e.isMergeableObject||Iw,e.cloneUnlessOtherwiseSpecified=vr;var o=Array.isArray(n),r=Array.isArray(t),i=o===r;return i?o?e.arrayMerge(t,n,e):Hw(t,n,e):vr(n,e)}Mo.all=function(n,e){if(!Array.isArray(n))throw new Error("first argument should be an array");return n.reduce(function(o,r){return Mo(o,r,e)},{})};var Ww=Mo,$w=Ww;const zw=_i($w),Uw={header:{showHeader:!0,showSearch:!0},mode:"default"},Tn={WINDOW_MANAGEMENT:"window-management",NOTIFICATIONS:"notifications"},$i="getScreenDetails"in window,lh=g.createContext(void 0),uh=()=>{const t=g.useContext(lh);if(t===void 0)throw new Error("useLaunchpadConfig must be used within an LaunchpadConfigProvider");return t},Vw=({children:t,settings:n,components:e})=>{const o=g.useMemo(()=>({settings:n,components:e}),[n,e]);return s.jsx(lh.Provider,{value:o,children:t})},dh=g.createContext(void 0),fh=()=>{const t=g.useContext(dh);if(t===void 0)throw new Error("useLaunchpadSearch must be used within a LaunchpadSearchProvider");return t},Gw=({children:t})=>{const[n,e]=g.useState(""),o=g.useMemo(()=>({searchTerm:n,setSearchTerm:e}),[n]);return s.jsx(dh.Provider,{value:o,children:t})},ph=({settings:t={},components:n={},isOpen:e=!0,onClose:o,windowManagementPermissionState:r="granted",children:i,className:a,...c})=>{const l=$i&&r==="granted",u=g.useMemo(()=>zw(Uw,t),[t]);return s.jsx(aw,{close:o,isOpen:e,isGlobalLayoutsAvailable:l,children:s.jsx(Vw,{settings:u,components:n,children:s.jsx(Gw,{children:s.jsx("div",{className:ot("launchpad",a),"data-testid":"launchpad",...c,children:i})})})})},Yw=g.forwardRef((t,n)=>{const{onSearch:e,searchTerm:o,onClear:r,className:i}=t,a=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{a!=null&&a.search&&a.search.setDebounceMS(450)},[a]),s.jsx(no,{id:"search-input",className:ot("search-bar",i),ref:n,placeholder:"Find anything",value:o,onChange:e,autoComplete:"off",iconPrepend:"search",iconAppend:o.length?"close":void 0,iconAppendOnClick:r})}),hh=({className:t})=>{const{isLaunchpadPinned:n,isLoading:e,toggle:o}=so();return s.jsx(Ve,{className:t,size:"32",variant:"circle",icon:n?"unpin":"pin",onClick:o,disabled:e})},mh=({className:t})=>{const n=Ys(),{isOpen:e}=en(),{settings:o,components:r}=uh(),{isLaunchpadPinned:i}=so(),{isLaunchpadCollapsed:a,setIsLaunchpadCollapsed:c}=Ks(),{searchTerm:l,setSearchTerm:u}=fh(),f=g.useRef(null),{showSearch:d,showHeader:p}=o.header??{},{BeforeSearch:h,AfterSearch:m}=r.header??{};g.useEffect(()=>{var k;e&&((k=f.current)==null||k.focus())},[e]),g.useEffect(()=>{i&&c(!1)},[c,i]);const v=k=>{const S=k.target.value;Up(S)&&a&&c(!1),u(S)},y=()=>{var k;u(""),(k=f.current)==null||k.focus()};return p?s.jsxs("div",{className:ot("launchpad-header",n||i?void 0:"draggable",t),"data-testid":"launchpad-header",children:[h&&s.jsx(h,{}),d&&s.jsx(Yw,{ref:f,searchTerm:l,onSearch:v,onClear:y,className:n?void 0:"non-draggable"}),m&&s.jsx(m,{}),m===void 0&&(o==null?void 0:o.mode)!=="pinned"&&s.jsx(hh,{className:"ms-auto"})]}):null},Zw=(t,n,e)=>{const{isSectionCollapsible:o,sortOrder:r=pr.ASCENDING}=e,a=_s({items:t,sortOrder:r,ascendingCompare:xp,descendingCompare:Cp}).map(c=>{var l;return{...c,type:bt.WORKSPACE,icon:"workspace",openInstances:(l=n[c.title])==null?void 0:l.length,contextMenuActions:bp}});return{id:So.WORKSPACES,title:"Workspaces",items:[...a,{id:Yp.CREATE_WORKSPACE,icon:"add",title:"Create Workspace",type:bt.ACTION_BUTTON,tooltip:"Create an empty Workspace in a new window",className:"create-workspace-btn"}],isCollapsible:o}},gh=t=>{const{isSectionCollapsible:n,sortOrder:e}=t,o=Kp(),r=ww(),i=tc(),a=qp(),c=g.useMemo(()=>Zw(o,r,{isSectionCollapsible:n,sortOrder:e}),[o,r,n,e]),l=u=>{const{item:f,modifier:d,selectedContextMenuActionName:p}=u;return p?a(f,p):f.type===bt.ACTION_BUTTON?a(f,f.id):i({id:f.id,modifier:d})};return s.jsx(Wi,{config:c,onItemClick:l})},Kw=[{placementId:So.FAVORITES,Component:sh},{placementId:So.WORKSPACES,Component:gh},{placementId:So.APPLICATIONS,Component:ah}],vh=()=>{const{defaultLayout:t,activeLayout:n}=en();return e=>({name:e,isDefault:e===(t==null?void 0:t.name),isActive:e===(n==null?void 0:n.name)})},qw=()=>{const t=Gp(),n=vh(),e=Fo();return async(o,r)=>{const{id:i}=o,a=n(i);await e(()=>t({layout:a,actionName:r}))}},Jw=()=>{const t=Wp(),n=qp(),e=qw();return o=>{if(o===bt.APPLICATION)return t;if(o===bt.WORKSPACE)return n;if(o===bt.LAYOUT)return e}},po={RENAME:"rename",SAVE:"save",SAVE_AS:"saveAs",DELETE:"delete",SET_AS_DEFAULT:"setAsDefault",LOAD:"load"},yh=t=>[{name:po.RENAME,displayName:"Rename",icon:"pen-line"},{name:po.SAVE,displayName:"Save",disabled:!t.isActive,icon:"floppy"},{name:po.SAVE_AS,displayName:"Save as",icon:"floppy-disk-pen",separatorAfter:!0},{name:po.DELETE,displayName:"Delete",icon:"trash-can",separatorAfter:!0},{name:po.SET_AS_DEFAULT,displayName:"Set as Default",disabled:t.isDefault,icon:"user-gear",separatorAfter:!0},{name:po.LOAD,displayName:"Load",icon:"spinner"}],Xw=t=>{const n=vh();return t.reduce((e,o)=>{const{type:r}=o,i=o.id||o.displayName;if(!i)return e;let a=[];if(r.name===bt.APPLICATION)a=wp;else if(r.name===bt.WORKSPACE)a=bp;else if(r.name===bt.LAYOUT){const f=n(i);a=yh(f)}else o.secondaryActions&&(a=o.secondaryActions.map(({name:f,method:d,params:p,target:h})=>({name:f,interopParams:{method:d,params:p,target:h}})));const c={id:i,title:o.displayName||i,description:o.description,type:r.name,iconSrc:o.iconURL,mainAction:o.action,contextMenuActions:a},l=e.findIndex(({title:f})=>r.displayName?f===r.displayName:f===r.name),u=e[l];return u?[...e.slice(0,l),{...u,items:[...u.items,c]},...e.slice(l+1)]:[...e,{id:r.name,title:r.displayName||r.name,items:[c]}]},[])};function Qw(t){const{resultsToRender:n,isLoading:e}=yw(t.searchTerm),{close:o}=en(),r=dw(),i=tc(),a=eh(),c=ec(),l=Jw(),u=Xw(n),f=Fo(),{isLaunchpadPinned:d}=so(),p=(m,v)=>{const y=l(m.type);y==null||y(m,v)},h=async(m,v)=>{var R;const{item:y,modifier:k,selectedContextMenuActionName:S}=v,{type:b,id:w,title:E,mainAction:O}=y,F=S?(R=y.contextMenuActions)==null?void 0:R.find(U=>U.name===S):null;F!=null&&F.interopParams?r(F.interopParams):S?p(y,S):O?r(O):b===bt.APPLICATION?a({id:w,title:E,modifier:k}):b===bt.WORKSPACE?i({id:w,modifier:k}):b===bt.LAYOUT&&f(()=>c(w)),!(k===Bi.SHIFT||d)&&(o==null||o())};return e?s.jsx("p",{className:"search-loading",children:"Loading..."}):n.length===0?s.jsx("p",{className:"search-no-results",children:"No results found. Try searching by app name, workspace title, or keywords."}):s.jsx(ut,{children:u.map((m,v)=>s.jsx(oc,{config:m,onItemClick:h},m.id||v))})}const eb=()=>{const{value:t,update:n,isLoading:e,error:o}=Wt({prefKey:Ro.IS_LAYOUTS_PANEL_OPEN});return{error:o,isLayoutsPanelOpen:t,setIsLayoutsPanelOpen:n,isLoading:e}},tb=({layoutName:t})=>{const n=g.useContext(Me.IOConnectContext),e=Fo(),o=r=>{r.stopPropagation(),e(async()=>{try{await n.layouts.save({name:t,type:"Global"}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${t}" was saved successfully.`})}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${t}".`,error:a})}})};return s.jsx(Ve,{icon:"floppy",size:"24",iconSize:"12",onClick:o,title:"Save Layout"})},nb=({layout:t})=>{const n=Gp(),e=Fo(),o=async(r,i)=>{r.stopPropagation(),await e(()=>n({layout:t,actionName:i.name}))};return s.jsx(nc,{buttonSize:"24",iconSize:"12",title:t.name,icon:"ellipsis-vertical",actions:yh(t),onActionItemClick:o,placement:"top-end",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0})},wh=({layouts:t})=>{const{isLaunchpadPinned:n}=so(),{close:e}=en(),o=ec(),r=Fo(),i=()=>{n||e==null||e()},a=c=>r(()=>o(c.name,i));return s.jsx(ut,{className:"layouts-list",variant:"single",checkIcon:{variant:"check",tooltip:"Active Layout"},children:t.map(c=>s.jsx(ut.Item,{className:"layouts-list-item",onClick:()=>a(c),append:s.jsxs(s.Fragment,{children:[c.isDefault&&s.jsx(ki,{variant:"default",title:"Default Layout",children:"Default"}),s.jsxs(Lp,{children:[c.isActive&&s.jsx(tb,{layoutName:c.name}),s.jsx(nb,{layout:c})]})]}),isSelected:c.isActive,tooltip:c.name,children:c.name},c.name))})},ob=()=>{const{layouts:t}=Jp(),{activeLayout:n,defaultLayout:e}=en(),o=g.useMemo(()=>t.map(r=>({...r,isActive:r.name===(n==null?void 0:n.name),isDefault:r.name===(e==null?void 0:e.name)})),[t,n,e]);return s.jsx(wh,{layouts:o})},rb=()=>{const{defaultLayout:t,activeLayout:n}=en();return n?s.jsx(wh,{layouts:[{...n,isDefault:n.name===(t==null?void 0:t.name),isActive:!0}]}):s.jsx("p",{className:"io-text-small no-active-layout",children:"Choose which Layout to load"})},ib=()=>{const t=g.useContext(Me.IOConnectContext),{setActiveLayout:n}=en(),e=Fo(),o=async()=>{var d;if(!("modals"in t&&t.modals)){console.error("Cannot create Layout because io dialogs are not enabled");return}const r="create",i="layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await t.modals.dialogs.request({templateName:Lo.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:"Create Layout",input:{id:i,initialValue:"Create Layout",validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Zs}},actionButtons:[{variant:"primary",text:"Create",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)try{if((await t.layouts.getAll("Global")).find(h=>h.name===u)){await Fe({io:t,variant:Le.WARNING,text:`Failed to create Layout "${u}". A Layout with this name already exists.`});return}await t.layouts.save({name:u}),n({name:u}),await Fe({io:t,variant:Le.SUCCESS,text:`Layout "${u}" was created successfully.`})}catch(p){await Fe({io:t,variant:Le.WARNING,text:`Failed to create Layout "${u}".`,error:p})}};return s.jsx(Re,{variant:"fullwidth",className:"create-layout-btn-group",children:s.jsx(Ye,{variant:"primary",text:"Create Layout",onClick:()=>e(o)})})};const ab=()=>{const t=g.useRef(null),{layouts:n,isInitialized:e}=Jp(),{isLayoutsPanelOpen:o,setIsLayoutsPanelOpen:r}=eb();g.useEffect(()=>{!e||n.length>0||!o||r(!1)},[n,e,o,r]);const i=g.useCallback(()=>r(a=>!a),[r]);return s.jsxs("footer",{className:"layouts-panel",ref:t,children:[s.jsx(wr,{className:"layouts-panel-separator"}),s.jsxs("div",{className:"layouts-panel-header","aria-label":"Layouts panel","aria-expanded":o,role:"button",...Hi(n.length?i:void 0),children:[s.jsx(sn,{tag:"h2",size:"normal",text:n.length>0?"Layouts":"Start using Layouts"}),n.length>0&&s.jsx(Ve,{className:ot("layouts-panel-toggle-button",{"layouts-panel-toggle-button-rotated":o}),icon:"expand",iconSize:"12",size:"24"})]}),s.jsx(Bp,{isOpen:o,tag:"div",children:s.jsx(ob,{})}),n.length>0&&!o?s.jsx(rb,{}):s.jsx(ib,{})]})},bh=({className:t})=>{const{isLaunchpadCollapsed:n}=Ks(),{isGlobalLayoutsAvailable:e}=en(),{components:o}=uh(),{searchTerm:r}=fh(),{sections:i=Kw}=o;return s.jsxs("div",{className:ot("launchpad-body",n?"collapsed":void 0,t),children:[s.jsx("main",{className:"launchpad-main",children:Up(r)?s.jsx(Qw,{searchTerm:r}):s.jsx(jw,{children:s.jsx(ut,{children:i.map(({Component:a,placementId:c})=>s.jsx(a,{},c))})})}),e&&s.jsx(ab,{})]})};const xh=t=>s.jsxs(ph,{...t,children:[s.jsx(mh,{}),s.jsx(bh,{})]}),Ch=g.createContext(void 0),kh=()=>{const t=g.useContext(Ch);if(t===void 0)throw new Error("useWorkspaceComponentsContext must be used within an WorkspaceComponentsContextProvider");return t},sb=()=>{const t=$i?[Tn.NOTIFICATIONS,Tn.WINDOW_MANAGEMENT]:[Tn.NOTIFICATIONS];return Promise.all(t.map(async n=>{const e=await navigator.permissions.query({name:n});return e.stableName=n,e}))},Sh=g.createContext(void 0),Rn=()=>{const t=g.useContext(Sh);if(t===void 0)throw new Error("useIOConnectHome must be used within an IOConnectHomeProvider");return t},cb=({children:t})=>{const[n,e]=ln("localStorage",kr,Sr),[o,r]=g.useState([]),i=g.useMemo(()=>o.reduce((d,p)=>({...d,[p.stableName]:{state:p.state}}),{}),[o]),a={isLoading:o.length===0,statuses:i},[c,l]=g.useState(!1),u={isLoggingOut:c,setIsLoggingOut:l};g.useEffect(()=>{let d=!1;const p=sb().then(h=>{if(d)return;r(h);const m=[];let v=!1;return h.forEach((y,k)=>{const S=b=>{if(d||!b.target||v)return;const w=b.target;if(w.state==="prompt")return e({isCompleted:!1}),v=!0,window.location.reload();r(O=>[...O.slice(0,k),w,...O.slice(k+1)])};y.addEventListener("change",S),m.push(()=>y.removeEventListener("change",S))}),m}).catch(console.warn);return()=>{d=!0,p.then(h=>{h==null||h.forEach(m=>m())})}},[e]);const f=g.useMemo(()=>({permission:a,login:u}),[a,u]);return s.jsx(Sh.Provider,{value:f,children:t})},lb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,fill:"#3C3E3F",rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),s.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,stroke:"#4B4E4F",strokeMiterlimit:10,rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),s.jsx("path",{fill:"#36A86B",d:"M125.31 100.086c-1.656 0-3-1.41-3-3.149 0-1.74 1.344-3.15 3-3.15 1.657 0 3 1.41 3 3.15s-1.343 3.149-3 3.149Z"}),s.jsx("rect",{width:21.694,height:6.057,fill:"#AAB0B0",rx:3.028,transform:"matrix(1 0 0 -1 132.72 99.844)"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("rect",{width:64,height:64,x:53,y:24,fill:"#36AA6C",rx:32}),s.jsx("path",{fill:"#fff",d:"M84.068 42.02c0-.466.408-.932.932-.932.466 0 .932.466.932.932v.99c4.66.467 8.388 4.428 8.388 9.262v1.748a9.57 9.57 0 0 0 2.796 6.756l.174.175c.466.466.758 1.165.758 1.806a2.61 2.61 0 0 1-2.621 2.621H74.514c-1.456-.058-2.563-1.165-2.563-2.621 0-.7.233-1.34.758-1.806l.116-.175c1.806-1.805 2.854-4.252 2.854-6.757v-1.747a9.3 9.3 0 0 1 8.388-9.261v-.99ZM85 44.816c-4.136 0-7.456 3.379-7.456 7.456v1.748c0 3.028-1.223 5.94-3.378 8.096l-.175.117a.94.94 0 0 0-.175.524c0 .408.291.699.7.699h20.91c.408 0 .758-.291.758-.7 0-.174-.117-.349-.233-.523l-.175-.117a11.502 11.502 0 0 1-3.378-8.155v-1.689c0-4.077-3.32-7.456-7.456-7.456H85Zm-1.806 23.008c.291.758.99 1.224 1.806 1.224.757 0 1.456-.466 1.747-1.224.175-.466.7-.757 1.165-.582a.976.976 0 0 1 .583 1.223A3.717 3.717 0 0 1 85 70.912c-1.631 0-3.029-.99-3.553-2.447a.976.976 0 0 1 .582-1.223c.466-.175.99.116 1.165.582Z"}),s.jsx("path",{fill:"#36A86B",d:"M113.791 86.146c-1.922 0-3.48-1.62-3.48-3.62 0-1.999 1.558-3.62 3.48-3.62s3.481 1.621 3.481 3.62c0 2-1.559 3.62-3.481 3.62Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),ub=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v94H0z",transform:"translate(0 20)"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:113,x:.5,y:20.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#3C3E3F",stroke:"#5D5D5D",strokeMiterlimit:10,d:"M22.338.5h125.324c2.746 0 4.941 2.144 4.941 4.75v76.938c0 2.608-2.195 4.751-4.941 4.751H22.338c-2.746 0-4.94-2.143-4.94-4.75V5.25c0-2.607 2.194-4.751 4.94-4.751Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M116.905 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533ZM127.206 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M137.505 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),s.jsx("circle",{cx:46.208,cy:58.882,r:20.294,fill:"#36AA6C"}),s.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M45.501 53.17a1 1 0 0 1 1.414 0l6.364 6.363a1 1 0 0 1-1.414 1.415l-4.657-4.657v48.23a1 1 0 0 1-2 0v-48.23l-4.657 4.657a1 1 0 0 1-1.414-1.415l6.364-6.364Z",clipRule:"evenodd"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:114,y:20,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:50.521,y1:5.735,y2:95.406,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),db=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeLinejoin:"round",strokeMiterlimit:10,d:"M27.449 103.584a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.495 1.495 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5V88.6h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V66.37h.5V64.35h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V42.12h.5V40.1h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5V19.89h-.5V17.87h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5V40.1h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5V88.6h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M128 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"M143.015 89.758a6.667 6.667 0 0 0 5.823-3.379c1.237-2.082 1.237-4.646 0-6.758-1.207-2.082-3.409-3.38-5.823-3.38a6.742 6.742 0 0 0-5.853 3.38c-1.237 2.112-1.237 4.676 0 6.758 1.207 2.112 3.409 3.38 5.853 3.38Zm0-14.482c2.746 0 5.28 1.479 6.668 3.862 1.388 2.414 1.388 5.34 0 7.724a7.666 7.666 0 0 1-6.668 3.862 7.678 7.678 0 0 1-6.698-3.862c-1.388-2.384-1.388-5.31 0-7.724a7.741 7.741 0 0 1 6.698-3.862Zm.724 2.897a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-1.689 7.723c0 .543.422.966.965.966a.973.973 0 0 0 .966-.966.993.993 0 0 0-.966-.965.972.972 0 0 0-.965.965Zm-.966 0c0-1.056.845-1.93 1.931-1.93.513 0 .996.21 1.328.573l3.228-1.931a.478.478 0 0 1 .664.15c.15.242.06.544-.151.664l-3.228 1.931c.06.181.09.362.09.543 0 1.087-.875 1.931-1.931 1.931a1.906 1.906 0 0 1-1.931-1.93Zm6.034-6.275a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-8.93 2.655c.392 0 .724.332.724.724a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.301-.724.724-.724Zm2.172-2.655a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M12 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"M27.351 76.62a.804.804 0 0 0-.73 0L21.45 78.81c-.322.117-.556.438-.526.789 0 2.746 1.139 7.596 5.697 9.787a.804.804 0 0 0 .73 0c4.558-2.19 5.697-7.04 5.727-9.787a.855.855 0 0 0-.556-.789l-5.17-2.191Zm-1.08-.877a1.816 1.816 0 0 1 1.46 0l5.142 2.192c.643.292 1.14.905 1.14 1.665-.03 2.922-1.228 8.21-6.253 10.635a1.798 1.798 0 0 1-1.548 0c-5.026-2.425-6.223-7.713-6.223-10.635-.03-.76.467-1.373 1.11-1.665l5.171-2.192Z"}),s.jsx("rect",{width:30,height:30,fill:"#5A5C5C",rx:15,transform:"matrix(1 0 0 -1 12 45.46)"}),s.jsx("path",{fill:"#DDD",d:"M18.653 23.886c.132-.184.422-.237.58-.079l16.033 12.657a.394.394 0 0 1 .08.58c-.133.185-.396.212-.58.08L18.732 24.466a.42.42 0 0 1-.08-.58Zm10.416 6.065-1.45-1.16a7.74 7.74 0 0 1 4.746 2.189c.159.184.159.448 0 .606a.447.447 0 0 1-.606 0 6.555 6.555 0 0 0-2.69-1.635Zm-5.01.343a6.346 6.346 0 0 0-1.82 1.292.447.447 0 0 1-.606 0 .414.414 0 0 1 0-.58 7.975 7.975 0 0 1 1.688-1.292l.738.58Zm-.184-4.43-.791-.633a11.395 11.395 0 0 1 3.928-.686c3.218 0 6.17 1.319 8.307 3.428.158.159.158.422 0 .607-.158.158-.422.158-.607 0a10.84 10.84 0 0 0-7.7-3.19c-1.107 0-2.135.157-3.137.474ZM19.84 26.97l.686.528c-.449.343-.844.685-1.24 1.08a.447.447 0 0 1-.606 0c-.159-.184-.159-.447 0-.606.369-.369.765-.685 1.16-1.002Zm5.801 8.702a1.699 1.699 0 0 1-.21-1.687c.263-.554.79-.95 1.397-1.002a1.662 1.662 0 0 1 1.53.712c.369.5.448 1.134.21 1.687-.263.554-.79.95-1.397 1.002a1.662 1.662 0 0 1-1.53-.712Zm2.215-1.002a.868.868 0 0 0-.844-.843.85.85 0 0 0-.843.843c0 .475.369.844.843.844a.85.85 0 0 0 .844-.844Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M128 30c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"m142.001 23.885-.424 1.457c-.091.364-.364.637-.668.789-.243.121-.455.242-.667.364a1.232 1.232 0 0 1-1.032.212l-1.456-.364h-.122a3.276 3.276 0 0 0-.455.668l-.152.212a7.838 7.838 0 0 0-.333.728c0 .03.03.091.06.122l1.062 1.061c.243.273.364.668.334 1.002v.758c.03.334-.091.698-.334.971l-1.062 1.092a.231.231 0 0 0-.06.122c.091.242.212.485.333.728l.122.212c.152.213.303.456.455.668h.152l1.456-.364c.364-.091.759 0 1.032.182.212.151.424.273.667.394.304.152.577.425.668.79l.424 1.456c0 .03.031.06.061.09.304.061.607.061.941.061.303 0 .607 0 .91-.06.03-.03.061-.061.061-.091l.424-1.457c.091-.364.364-.637.668-.789a4.79 4.79 0 0 0 .667-.394c.304-.182.668-.273 1.032-.182l1.456.364h.152c.152-.212.304-.455.455-.668l.122-.212c.121-.243.242-.486.333-.728 0-.03-.03-.091-.06-.122l-1.062-1.092a1.316 1.316 0 0 1-.334-.97c0-.122.03-.244.03-.395 0-.122-.03-.243-.03-.364-.03-.334.091-.729.334-1.002l1.062-1.061c.03-.03.06-.092.06-.122a7.838 7.838 0 0 0-.333-.728l-.122-.212a12.155 12.155 0 0 0-.455-.668h-.152l-1.456.364c-.364.091-.728 0-1.032-.182a4.789 4.789 0 0 0-.667-.394c-.304-.152-.577-.425-.668-.79l-.424-1.456a.233.233 0 0 0-.061-.121 9.146 9.146 0 0 0-.91-.06c-.334 0-.637.03-.941.06a.233.233 0 0 0-.061.121Zm1.002-1.153c.394 0 .758.03 1.153.091.06.03.091.03.151.061.273.152.516.425.607.728l.425 1.457c0 .06.061.151.152.182.273.121.546.273.789.455.091.06.182.09.242.06l1.487-.364c.303-.09.668-.03.941.152l.121.122c.212.242.394.546.576.849l.152.212v.03c.152.304.304.608.425.911.03.06.03.091.03.152.031.334-.091.667-.333.91l-1.062 1.092c-.031.03-.061.122-.061.213 0 .151.03.303.03.455 0 .151-.03.303-.03.455 0 .121.03.212.061.243l1.062 1.092c.242.243.364.576.333.91 0 .03 0 .091-.03.152-.121.303-.273.607-.425.91l-.152.243a5.476 5.476 0 0 1-.606.85c-.031.06-.061.09-.091.12a1.206 1.206 0 0 1-.971.152l-1.457-.364c-.06-.03-.151 0-.242.061-.243.152-.516.303-.789.455-.091.03-.152.121-.152.182l-.425 1.426a1.277 1.277 0 0 1-.607.759c-.06.03-.091.03-.151.06-.395.03-.759.061-1.153.061-.395 0-.789-.03-1.184-.06-.06-.03-.091-.03-.151-.061a1.277 1.277 0 0 1-.607-.759l-.425-1.426c0-.06-.061-.151-.152-.182a4.11 4.11 0 0 1-.789-.455c-.091-.06-.182-.06-.242-.06l-1.457.363c-.333.091-.667.03-.94-.151-.061-.03-.091-.06-.122-.091-.242-.273-.424-.577-.606-.88l-.122-.213-.03-.03a11.98 11.98 0 0 1-.425-.91c0-.06-.03-.091-.03-.152 0-.334.091-.667.334-.91l1.061-1.092c.031-.03.061-.122.061-.243v-.91c0-.091-.03-.182-.061-.213l-1.061-1.092c-.243-.243-.334-.576-.334-.91 0-.061.03-.091.03-.152.121-.303.273-.607.425-.91l.03-.03.122-.213a6.09 6.09 0 0 1 .606-.85.24.24 0 0 1 .122-.12c.273-.183.607-.244.94-.153l1.457.364c.06.03.151 0 .242-.06.243-.152.516-.334.789-.455.091-.03.152-.122.152-.182l.425-1.457c.091-.303.334-.576.607-.728.06-.03.091-.03.151-.06.395-.061.789-.092 1.184-.092Zm-1.699 7.768c0 .637.303 1.183.849 1.486.516.304 1.153.304 1.699 0 .516-.303.85-.85.85-1.486 0-.607-.334-1.153-.85-1.457-.546-.303-1.183-.303-1.699 0-.546.304-.849.85-.849 1.457Zm4.369 0c0 .97-.516 1.85-1.335 2.336a2.781 2.781 0 0 1-2.67 0c-.85-.485-1.335-1.365-1.335-2.336 0-.94.485-1.82 1.335-2.306a2.781 2.781 0 0 1 2.67 0 2.702 2.702 0 0 1 1.335 2.306Z"}),s.jsx("circle",{cx:85,cy:57.277,r:32,fill:"#36AA6C"}),s.jsx("path",{fill:"#fff",d:"M72.313 42.777h9.968v1.812h-9.969c-1.019 0-1.812.85-1.812 1.813v16.312a1.79 1.79 0 0 0 1.813 1.813h25.374c.963 0 1.813-.793 1.813-1.813V46.402c0-.963-.85-1.813-1.813-1.813H87.72v-1.812h9.969c1.982 0 3.624 1.642 3.624 3.625v16.312a3.613 3.613 0 0 1-3.624 3.625H89.19l.623 3.625h3.342c.453 0 .906.453.906.907 0 .51-.453.906-.906.906H76.844a.895.895 0 0 1-.906-.906c0-.454.396-.907.906-.907h3.285l.623-3.625h-8.44c-2.039 0-3.624-1.586-3.624-3.625V46.402a3.614 3.614 0 0 1 3.624-3.625Zm10.251 23.562-.623 3.625h6.061l-.623-3.625h-4.815Zm3.342-22.656v12.348l2.946-3.002c.34-.34.962-.34 1.302 0 .34.34.34.963 0 1.302l-4.531 4.532c-.34.34-.963.34-1.303 0l-4.53-4.532c-.34-.34-.34-.962 0-1.302.339-.34.962-.34 1.302 0l3.002 3.002V43.683c0-.453.396-.906.906-.906.453 0 .906.453.906.906Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),fb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeMiterlimit:10,d:"M27.449 103.138a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.493 1.493 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.022h-.5v-2.02h.5V80.07h-.5V78.05h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V57.84h.5v-2.02h-.5V53.8h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V33.59h.5V31.57h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5V53.8h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.029v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#36AA6C",d:"M114.756 28.708H55.244c-1.427 0-2.584 1.512-2.584 3.377v49.491c0 1.866 1.157 3.378 2.584 3.378h59.512c1.427 0 2.584-1.512 2.584-3.378v-49.49c0-1.866-1.157-3.378-2.584-3.378Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M98.8 37.185a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM104.076 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M109.351 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 18.367H43.32c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H10.803c-.193 0-.41-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.13-.808.317-1.06.186-.254.402-.36.595-.36Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M26.192 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM31.468 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M36.743 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 18.367h32.517c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H126.63c-.193 0-.409-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.131-.808.317-1.06.186-.254.402-.36.595-.36Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M142.019 26.344a1.416 1.416 0 1 0 0-2.832 1.416 1.416 0 0 0 0 2.832ZM147.294 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M152.569 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 63.694H43.32c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H10.803c-.193 0-.41-.106-.595-.359-.186-.253-.317-.626-.317-1.06V65.113c0-.435.13-.808.317-1.061.186-.253.402-.358.595-.358Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M27.192 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM32.468 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M37.743 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 63.694h32.517c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H126.63c-.193 0-.409-.106-.595-.359s-.317-.626-.317-1.06V65.113c0-.435.131-.808.317-1.061.186-.253.402-.358.595-.358Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M143.019 71.672a1.416 1.416 0 1 0 0-2.833 1.416 1.416 0 0 0 0 2.833ZM148.294 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M153.569 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#fff",d:"M49.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),s.jsx("path",{fill:"#fff",d:"M44.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),s.jsx("path",{fill:"#fff",d:"M44.482 40.488h-5.836a.486.486 0 1 1 0-.973h5.836a.486.486 0 1 1 0 .973ZM60.597 40.004l-3.255-3.255a.486.486 0 1 1 .688-.688l3.6 3.6c.19.19.19.497 0 .687l-3.594 3.593a.486.486 0 1 1-.688-.688l3.25-3.249Z"}),s.jsx("path",{fill:"#3BB272",d:"M32.147 36.709a3.375 3.375 0 1 1 0 6.75 3.375 3.375 0 0 1 0-6.75Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 65.808v-5.836a.487.487 0 0 0-.973 0v5.836a.486.486 0 1 0 .973 0Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 70.808v-5.836a.487.487 0 0 0-.973 0v5.837a.486.486 0 1 0 .973 0Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 70.644v5.836a.487.487 0 0 1-.973 0v-5.836a.486.486 0 1 1 .973 0ZM133.578 54.529l-3.255 3.255a.487.487 0 0 1-.688-.688l3.599-3.599c.19-.19.498-.19.688 0l3.593 3.593a.486.486 0 1 1-.688.688l-3.249-3.249Z"}),s.jsx("path",{fill:"#AAB0B0",d:"M130.282 82.98a3.376 3.376 0 1 1 6.752 0 3.376 3.376 0 0 1-6.752 0Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),pb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#DE2122",d:"M79.593 28.399c2.403-4.163 8.411-4.163 10.814 0l29.741 51.512c2.403 4.162-.601 9.366-5.407 9.366H55.259c-4.806 0-7.81-5.204-5.407-9.366l29.74-51.512Z"}),s.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M81.84 42.528h6.321a1 1 0 0 1 .994 1.113l-2.691 23.67a1 1 0 0 1-.994.887h-1.033a1 1 0 0 1-.994-.89l-2.596-23.671a1 1 0 0 1 .994-1.11Zm3.128 30.366a3.547 3.547 0 1 0 0 7.093 3.547 3.547 0 0 0 0-7.093Z",clipRule:"evenodd"}),s.jsx("path",{fill:"#5A5C5C",d:"M115.69 27.082 132.459.185l17.514-.151-25.545 24.389 17.858 23.176-25.076 13.678L131.267 47.6 115.69 27.082Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),hb={edgeNotificationsPermissionTimeout:15e3},Qe={WINDOW_MANAGEMENT:Tn.WINDOW_MANAGEMENT,NOTIFICATIONS:Tn.NOTIFICATIONS,POPUPS:"popups",PWA_INSTALL:"pwa-install"},mb={name:Qe.WINDOW_MANAGEMENT,label:`Allow window management${$i?"":" (not available in your browser)"}`,heading:"Allow Window Management",description:`By granting this permission you will be able to load layouts containing multiple
48
+ ***************************************************************************** */var cs=function(){return cs=Object.assign||function(n){for(var e,o=1,r=arguments.length;o<r;o++){e=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},cs.apply(this,arguments)};function qy(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]]);return e}function ls(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(!ls(t[e],n[e]))return!1;return!0}var o=Object.keys(t);if(o.length!==Object.keys(n).length)return!1;for(var e=0;e<o.length;e++)if(!n.hasOwnProperty(o[e])||!ls(t[o[e]],n[o[e]]))return!1;return!0}}var nr=function(t){return Array.isArray(t)},Hr=function(t){return typeof t=="object"&&t!==null&&!nr(t)},Jy=function(t){switch(typeof t){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return t instanceof Array?"an array":t===null?"null":"an object";default:return JSON.stringify(t)}},fn=function(t,n){return"expected "+t+", got "+Jy(n)},Zo=function(t){return t.map(function(n){return typeof n=="string"?"."+n:"["+n+"]"}).join("")},Ko=function(t,n){var e=n.at,o=qy(n,["at"]);return cs({at:t+(e||"")},o)},pt=function(){function t(n){var e=this;this.decode=n,this.run=function(o){return ya(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},e.decode(o))},this.runPromise=function(o){return Vy(e.run(o))},this.runWithException=function(o){return Yy(e.run(o))},this.map=function(o){return new t(function(r){return Zy(o,e.decode(r))})},this.andThen=function(o){return new t(function(r){return Ky(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"?gt(n):st({message:fn("a string",n)})})},t.number=function(){return new t(function(n){return typeof n=="number"?gt(n):st({message:fn("a number",n)})})},t.boolean=function(){return new t(function(n){return typeof n=="boolean"?gt(n):st({message:fn("a boolean",n)})})},t.constant=function(n){return new t(function(e){return ls(e,n)?gt(n):st({message:"expected "+JSON.stringify(n)+", got "+JSON.stringify(e)})})},t.object=function(n){return new t(function(e){if(Hr(e)&&n){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=n[r].decode(e[r]);if(i.ok===!0)i.result!==void 0&&(o[r]=i.result);else return e[r]===void 0?st({message:"the key '"+r+"' is required but was not present"}):st(Ko("."+r,i.error))}return gt(o)}else return Hr(e)?gt(e):st({message:fn("an object",e)})})},t.array=function(n){return new t(function(e){if(nr(e)&&n){var o=function(r,i){return ya(function(a){return Ko("["+i+"]",a)},n.decode(r))};return e.reduce(function(r,i,a){return Dl(function(c,l){return c.concat([l])},r,o(i,a))},gt([]))}else return nr(e)?gt(e):st({message:fn("an array",e)})})},t.tuple=function(n){return new t(function(e){if(nr(e)){if(e.length!==n.length)return st({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)o[r]=i.result;else return st(Ko("["+r+"]",i.error))}return gt(o)}else return st({message:fn("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 Dl(Object.assign,a,c.decode(i))},gt({}))})},t.anyJson=function(){return new t(function(n){return gt(n)})},t.unknownJson=function(){return new t(function(n){return gt(n)})},t.dict=function(n){return new t(function(e){if(Hr(e)){var o={};for(var r in e)if(e.hasOwnProperty(r)){var i=n.decode(e[r]);if(i.ok===!0)o[r]=i.result;else return st(Ko("."+r,i.error))}return gt(o)}else return st({message:fn("an object",e)})})},t.optional=function(n){return new t(function(e){return e==null?gt(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 st({message:'expected a value matching one of the decoders, got the errors ["'+c+'"]'})})},t.withDefault=function(n,e){return new t(function(o){return gt(Gy(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 st({at:Zo(n.slice(0,i+1)),message:"path does not exist"});if(typeof n[i]=="string"&&!Hr(r))return st({at:Zo(n.slice(0,i+1)),message:fn("an object",r)});if(typeof n[i]=="number"&&!nr(r))return st({at:Zo(n.slice(0,i+1)),message:fn("an array",r)});r=r[n[i]]}return ya(function(a){return r===void 0?{at:Zo(n),message:"path does not exist"}:Ko(Zo(n),a)},e.decode(r))})},t.succeed=function(n){return new t(function(e){return gt(n)})},t.fail=function(n){return new t(function(e){return st({message:n})})},t.lazy=function(n){return new t(function(e){return n().decode(e)})},t}(),Xy=pt.string,Qy=pt.number,Do=pt.boolean,jt=pt.anyJson;pt.unknownJson;var Mn=pt.constant,Xe=pt.object,ew=pt.array;pt.tuple;pt.dict;var _e=pt.optional,gr=pt.oneOf;pt.union;pt.intersection;pt.withDefault;pt.valueAt;pt.succeed;var tw=pt.fail;pt.lazy;const Dt=Xy().where(t=>t.length>0,"Expected a non-empty string"),nw=Qy().where(t=>t>=0,"Expected a non-negative number");Do();const zt=(t,n)=>{const e=typeof t;return e==="function"?jt():tw(`The provided argument as ${n} should be of type function, provided: ${typeof e}`)},zp=Xe({name:Dt}),ow="Welcome",rw=t=>t.components.reduce((e,o)=>{if(o.type==="workspaceFrame"){const r=o.state.workspaces.map(i=>i.config.name);e.push(...r)}return e},[]),Up=t=>t.trim().length>0,iw=(t,n)=>{const[e,o]=g.useState(void 0),[r,i]=ln("sessionStorage",$p,zp),a=g.useRef(!1),c=ec(),l=tc(),u=g.useContext(Me.IOConnectContext),f=g.useCallback(async({name:d})=>{try{await u.layouts.setDefaultGlobal(d)}catch(p){console.error("Failed to set default Layout: ",{error:p})}},[u]);return g.useEffect(()=>{if(u)return u.layouts.onDefaultGlobalChanged(d=>{o(d)})},[u]),g.useEffect(()=>{if(u)return u.layouts.onRestored(d=>{i({name:d.name})})},[u]),g.useEffect(()=>{if(u)return u.layouts.onRemoved(d=>{(d==null?void 0:d.name)===(r==null?void 0:r.name)&&i(null)})},[u,r]),g.useEffect(()=>{if(u)return u.layouts.onRenamed((d,p)=>{(p==null?void 0:p.name)===(r==null?void 0:r.name)&&i({name:d.name})})},[u,r]),g.useEffect(()=>{var p;if(!u||!((p=window.iobrowser)!=null&&p.platformStarted)||a.current)return;(async()=>{var k;a.current=!0;const h=await u.layouts.getDefaultGlobal()??(await u.layouts.getAll("Global")).find(S=>S.name===ow);if(!h||(o({name:h.name}),r))return;if(t(!0),n){await c(h.name),t(!1);return}const m=await((k=u.workspaces)==null?void 0:k.getWorkspace(S=>S.children.length===0)),v=await u.layouts.get(h.name,"Global");if(!v)throw new Error("Default Global Layout not found.");const y=rw(v);Promise.all(y.map((S,b)=>l({id:S,reuseWorkspaceId:b===0?m==null?void 0:m.id:void 0}))),t(!1)})().catch(h=>console.error("Initial Global Layout setup failed. ",Ka(h)))},[u,r,c,l,n]),{defaultLayout:e,activeLayout:r,setDefaultLayout:f,setActiveLayout:i}},Vp=g.createContext(void 0),en=()=>{const t=g.useContext(Vp);if(t===void 0)throw new Error("useLaunchpadAPI must be used within a LaunchpadAPIProvider");return t},aw=({children:t,close:n,isOpen:e,isGlobalLayoutsAvailable:o})=>{const[r,i]=g.useState(!1),{defaultLayout:a,activeLayout:c,setDefaultLayout:l,setActiveLayout:u}=iw(i,o),f=g.useMemo(()=>({close:n,isOpen:e,defaultLayout:a,activeLayout:c,setDefaultLayout:l,setActiveLayout:u,isLayoutOperationBlocked:r,setIsLayoutOperationBlocked:i,isGlobalLayoutsAvailable:o}),[n,e,a,c,l,u,r,o]);return s.jsx(Vp.Provider,{value:f,children:t})},Ro={CUSTOM_PREFS:"customPrefs",COLLAPSED_SECTIONS:"_launchpad_collapsedSections",FAVORITES:"_launchpad_favorites",IS_LAYOUTS_PANEL_OPEN:"_launchpad_isLayoutsPanelOpen",IS_LAUNCHPAD_COLLAPSED:"_launchpad_isCollapsed",IS_LAUNCHPAD_PINNED:"_launchpad_isPinned",LAYOUTS_SHOW_DELETE_PROMPT:"_layouts_showDeletePrompt"},so=()=>{const{value:t,update:n,isLoading:e,error:o}=Wt({prefKey:Ro.IS_LAUNCHPAD_PINNED}),r=g.useCallback(()=>n(i=>!i),[n]);return{error:o,isLaunchpadPinned:t,isLoading:e,toggle:r}},Gp=()=>{const t=g.useContext(Me.IOConnectContext),{setActiveLayout:n,setDefaultLayout:e,close:o}=en(),{isLaunchpadPinned:r}=so(),{value:i,update:a}=Wt({prefKey:Ro.LAYOUTS_SHOW_DELETE_PROMPT}),c=()=>{r||o==null||o()};return g.useCallback(async u=>{const{layout:f,actionName:d}=u;return await Wy[d]({io:t,layout:f,setActiveLayout:n,setDefaultLayout:e,closeLaunchpad:c,showDeletePromptPref:i,updateShowDeletePromptPref:a})},[t,e,n,o,i,a])},Fo=()=>{const{isLayoutOperationBlocked:t,setIsLayoutOperationBlocked:n}=en();return async e=>{if(!t){n(!0);try{await e()}catch(o){console.error("Layout operation failed: ",{error:o})}n(!1)}}},Yp={CREATE_WORKSPACE:"createWorkspace"},sw=async t=>{const{io:n,item:e}=t;if(n.workspaces)try{await n.workspaces.restoreWorkspace(e.id,{newFrame:!0})}catch(o){await Fe({io:n,variant:Le.WARNING,text:`Failed to load Workspace "${e.title}".`,error:o})}},cw=async t=>{const{io:n,item:e,removeFavorite:o}=t;if(n.workspaces){if("modals"in n&&n.modals){const r="delete",{isEnterPressed:i,responseButtonClicked:a}=await n.modals.dialogs.request({templateName:Lo.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:`Delete "${e.title}"`,text:"Are you sure you want to delete this Workspace?",actionButtons:[{variant:"critical",text:"Delete",id:r},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(!(i||(a==null?void 0:a.id)===r))return}try{await n.workspaces.layouts.delete(e.id),await o(e),await Fe({io:n,variant:Le.SUCCESS,text:`"Workspace ${e.title}" was successfully deleted.`})}catch(r){await Fe({io:n,variant:Le.WARNING,text:`Failed to delete Workspace "${e.title}".`,error:r})}}},lw=async t=>{const{io:n}=t;if(n.workspaces)try{await n.workspaces.createWorkspace({children:[],frame:{newFrame:!0}})}catch(e){await Fe({io:n,variant:Le.WARNING,text:"Failed to create a new Workspace.",error:e})}},uw={[li.OPEN_IN_NEW_WINDOW]:sw,[li.DELETE]:cw,[Yp.CREATE_WORKSPACE]:lw};class Zp{constructor(){It(this,"queue",[]);It(this,"isExecutingQueue",!1)}enqueue(n){return new Promise((e,o)=>{this.queue.push({action:n,resolve:e,reject:o}),this.executeQueue()})}async executeQueue(){if(!this.isExecutingQueue){for(this.isExecutingQueue=!0;this.queue.length;){const n=this.queue.shift();if(!n){this.isExecutingQueue=!1;return}try{const e=await n.action();n.resolve(e)}catch(e){n.reject(e)}await this.intervalBreak()}this.isExecutingQueue=!1}}intervalBreak(){return new Promise(n=>setTimeout(n,0))}}const Kp=()=>{const[t,n]=g.useState([]),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!(e!=null&&e.workspaces))return;let o=!1;const r=e.workspaces.layouts.onSaved(({name:a})=>{o||t.find(({id:c})=>c===a)||n(c=>[...c,{id:a,title:a}])}),i=e.workspaces.layouts.onRemoved(({name:a})=>{o||n(c=>c.filter(({title:l})=>l!==a))});return()=>{o=!0,[r,i].forEach(async a=>{try{(await a)()}catch(c){console.error(c)}})}},[e,t]),t},Ml=new Zp,Fi=()=>{const{value:t,update:n,isLoading:e}=Wt({prefKey:Ro.FAVORITES}),o=Hp(),r=Kp(),i=g.useMemo(()=>(t??[]).filter(l=>l.type===bt.APPLICATION?o.some(u=>u.id===l.id):l.type===bt.WORKSPACE?r.some(u=>u.id===l.id):!0),[t,o,r]),a=g.useCallback(({openInstances:l,...u})=>Ml.enqueue(()=>n((f=[])=>{const d=f.find(p=>p.id===u.id&&p.type&&u.type);return d?f.filter(p=>p!==d):[u,...f]})),[n]),c=g.useCallback(l=>Ml.enqueue(()=>n((u=[])=>u.filter(f=>!(f.id===l.id&&f.type===l.type)))),[n]);return{favorites:i,toggleFavorite:a,removeFavorite:c,isLoading:e}},qp=()=>{const t=g.useContext(Me.IOConnectContext),{removeFavorite:n}=Fi();return(e,o)=>{uw[o]({io:t,item:e,removeFavorite:n})}},dw=()=>{const t=g.useContext(Me.IOConnectContext);return async n=>t.interop.methods().every(e=>e.name!==(n==null?void 0:n.method))?console.error("Interop method not found."):await t.interop.invoke(n.method,n.params,n.target).catch(e=>console.error({error:e}))},fw=()=>{const[t,n]=g.useState(!1),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!e)return;let o;return(async()=>{var r;try{o=await((r=e.workspaces)==null?void 0:r.onWorkspaceOpened(()=>n(!0)))}catch(i){console.error(i)}})(),()=>o==null?void 0:o()},[e]),t},Ks=()=>{const{value:t,update:n,isLoading:e,error:o}=Wt({prefKey:Ro.IS_LAUNCHPAD_COLLAPSED});return{error:o,isLaunchpadCollapsed:t,setIsLaunchpadCollapsed:n,isLoading:e}};var us={exports:{}};(function(t,n){(function(e,o){var r="1.0.40",i="",a="?",c="function",l="undefined",u="object",f="string",d="major",p="model",h="name",m="type",v="vendor",y="version",k="architecture",S="console",b="mobile",w="tablet",E="smarttv",O="wearable",F="embedded",R=500,U="Amazon",K="Apple",_="ASUS",A="BlackBerry",me="Browser",de="Chrome",re="Edge",ye="Firefox",pe="Google",xe="Huawei",ae="LG",B="Microsoft",X="Motorola",Y="Opera",J="Samsung",H="Sharp",P="Sony",T="Xiaomi",W="Zebra",q="Facebook",Z="Chromium OS",ie="Mac OS",oe=" Browser",I=function($,V){var z={};for(var te in $)V[te]&&V[te].length%2===0?z[te]=V[te].concat($[te]):z[te]=$[te];return z},Ce=function($){for(var V={},z=0;z<$.length;z++)V[$[z].toUpperCase()]=$[z];return V},ke=function($,V){return typeof $===f?Ae(V).indexOf(Ae($))!==-1:!1},Ae=function($){return $.toLowerCase()},Pe=function($){return typeof $===f?$.replace(/[^\d\.]/g,i).split(".")[0]:o},Te=function($,V){if(typeof $===f)return $=$.replace(/^\s\s*/,i),typeof V===l?$:$.substring(0,R)},he=function($,V){for(var z=0,te,le,ge,se,G,Se;z<V.length&&!G;){var Be=V[z],Oe=V[z+1];for(te=le=0;te<Be.length&&!G&&Be[te];)if(G=Be[te++].exec($),G)for(ge=0;ge<Oe.length;ge++)Se=G[++le],se=Oe[ge],typeof se===u&&se.length>0?se.length===2?typeof se[1]==c?this[se[0]]=se[1].call(this,Se):this[se[0]]=se[1]:se.length===3?typeof se[1]===c&&!(se[1].exec&&se[1].test)?this[se[0]]=Se?se[1].call(this,Se,se[2]):o:this[se[0]]=Se?Se.replace(se[1],se[2]):o:se.length===4&&(this[se[0]]=Se?se[3].call(this,Se.replace(se[1],se[2])):o):this[se]=Se||o;z+=2}},C=function($,V){for(var z in V)if(typeof V[z]===u&&V[z].length>0){for(var te=0;te<V[z].length;te++)if(ke(V[z][te],$))return z===a?o:z}else if(ke(V[z],$))return z===a?o:z;return V.hasOwnProperty("*")?V["*"]:$},x={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},j={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},N={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[h,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,y],[/opios[\/ ]+([\w\.]+)/i],[y,[h,Y+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[h,Y+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[h,Y]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[h,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[y,[h,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[h,y],[/quark(?:pc)?\/([-\w\.]+)/i],[y,[h,"Quark"]],[/\bddg\/([\w\.]+)/i],[y,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[h,"UC"+me]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[h,"Smart Lenovo "+me]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure "+me],y],[/\bfocus\/([\w\.]+)/i],[y,[h,ye+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[h,Y+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[h,Y+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[h,"MIUI"+oe]],[/fxios\/([\w\.-]+)/i],[y,[h,ye]],[/\bqihoobrowser\/?([\w\.]*)/i],[y,[h,"360"]],[/\b(qq)\/([\w\.]+)/i],[[h,/(.+)/,"$1Browser"],y],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1"+oe],y],[/samsungbrowser\/([\w\.]+)/i],[y,[h,J+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[y,[h,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[h,y],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[h],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[y,h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,q],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[h,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[h,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[h,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[h,de+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,de+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[h,"Android "+me]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[h,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[y,C,x]],[/(webkit|khtml)\/([\w\.]+)/i],[h,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],y],[/(wolvic|librewolf)\/([\w\.]+)/i],[h,y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[h,ye+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[h,[y,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[h,[y,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[k,"amd64"]],[/(ia32(?=;))/i],[[k,Ae]],[/((?:i[346]|x)86)[;\)]/i],[[k,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[k,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[k,"armhf"]],[/windows (ce|mobile); ppc;/i],[[k,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[k,/ower/,i,Ae]],[/(sun4\w)[;\)]/i],[[k,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[k,Ae]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[v,J],[m,w]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[p,[v,J],[m,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[v,K],[m,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[v,K],[m,w]],[/(macintosh);/i],[p,[v,K]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[v,H],[m,b]],[/(?:honor)([-\w ]+)[;\)]/i],[p,[v,"Honor"],[m,b]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[v,xe],[m,w]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[v,xe],[m,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[p,/_/g," "],[v,T],[m,b]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[v,T],[m,w]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[v,"OPPO"],[m,b]],[/\b(opd2\d{3}a?) bui/i],[p,[v,"OPPO"],[m,w]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[v,"Vivo"],[m,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[v,"Realme"],[m,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[p,[v,X],[m,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[v,X],[m,w]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[v,ae],[m,w]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[v,ae],[m,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[v,"Lenovo"],[m,w]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[v,"Nokia"],[m,b]],[/(pixel c)\b/i],[p,[v,pe],[m,w]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[v,pe],[m,b]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[v,P],[m,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[v,P],[m,w]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[v,"OnePlus"],[m,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[v,U],[m,w]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[v,U],[m,b]],[/(playbook);[-\w\),; ]+(rim)/i],[p,v,[m,w]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[v,A],[m,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[v,_],[m,w]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[v,_],[m,b]],[/(nexus 9)/i],[p,[v,"HTC"],[m,w]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[v,[p,/_/g," "],[m,b]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[p,[v,"TCL"],[m,w]],[/(itel) ((\w+))/i],[[v,Ae],p,[m,C,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[v,"Acer"],[m,w]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[v,"Meizu"],[m,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[v,"Ulefone"],[m,b]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[v,"Energizer"],[m,b]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[v,"Cat"],[m,b]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[v,"Smartfren"],[m,b]],[/droid.+; (a(?:015|06[35]|142p?))/i],[p,[v,"Nothing"],[m,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[v,p,[m,b]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[v,p,[m,w]],[/(surface duo)/i],[p,[v,B],[m,w]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[v,"Fairphone"],[m,b]],[/(u304aa)/i],[p,[v,"AT&T"],[m,b]],[/\bsie-(\w*)/i],[p,[v,"Siemens"],[m,b]],[/\b(rct\w+) b/i],[p,[v,"RCA"],[m,w]],[/\b(venue[\d ]{2,7}) b/i],[p,[v,"Dell"],[m,w]],[/\b(q(?:mv|ta)\w+) b/i],[p,[v,"Verizon"],[m,w]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[v,"Barnes & Noble"],[m,w]],[/\b(tm\d{3}\w+) b/i],[p,[v,"NuVision"],[m,w]],[/\b(k88) b/i],[p,[v,"ZTE"],[m,w]],[/\b(nx\d{3}j) b/i],[p,[v,"ZTE"],[m,b]],[/\b(gen\d{3}) b.+49h/i],[p,[v,"Swiss"],[m,b]],[/\b(zur\d{3}) b/i],[p,[v,"Swiss"],[m,w]],[/\b((zeki)?tb.*\b) b/i],[p,[v,"Zeki"],[m,w]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[v,"Dragon Touch"],p,[m,w]],[/\b(ns-?\w{0,9}) b/i],[p,[v,"Insignia"],[m,w]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[v,"NextBook"],[m,w]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[v,"Voice"],p,[m,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[v,"LvTel"],p,[m,b]],[/\b(ph-1) /i],[p,[v,"Essential"],[m,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[v,"Envizen"],[m,w]],[/\b(trio[-\w\. ]+) b/i],[p,[v,"MachSpeed"],[m,w]],[/\btu_(1491) b/i],[p,[v,"Rotor"],[m,w]],[/(shield[\w ]+) b/i],[p,[v,"Nvidia"],[m,w]],[/(sprint) (\w+)/i],[v,p,[m,b]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[v,B],[m,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[v,W],[m,w]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[v,W],[m,b]],[/smart-tv.+(samsung)/i],[v,[m,E]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[v,J],[m,E]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[v,ae],[m,E]],[/(apple) ?tv/i],[v,[p,K+" TV"],[m,E]],[/crkey/i],[[p,de+"cast"],[v,pe],[m,E]],[/droid.+aft(\w+)( bui|\))/i],[p,[v,U],[m,E]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[v,H],[m,E]],[/(bravia[\w ]+)( bui|\))/i],[p,[v,P],[m,E]],[/(mitv-\w{5}) bui/i],[p,[v,T],[m,E]],[/Hbbtv.*(technisat) (.*);/i],[v,p,[m,E]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[v,Te],[p,Te],[m,E]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,E]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[v,p,[m,S]],[/droid.+; (shield) bui/i],[p,[v,"Nvidia"],[m,S]],[/(playstation [345portablevi]+)/i],[p,[v,P],[m,S]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[v,B],[m,S]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[p,[v,J],[m,O]],[/((pebble))app/i],[v,p,[m,O]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[v,K],[m,O]],[/droid.+; (glass) \d/i],[p,[v,pe],[m,O]],[/droid.+; (wt63?0{2,3})\)/i],[p,[v,W],[m,O]],[/droid.+; (glass) \d/i],[p,[v,pe],[m,O]],[/(pico) (4|neo3(?: link|pro)?)/i],[v,p,[m,O]],[/; (quest( \d| pro)?)/i],[p,[v,q],[m,O]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[v,[m,F]],[/(aeobc)\b/i],[p,[v,U],[m,F]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[m,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[m,w]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,w]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,b]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[v,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[h,re+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[h,y],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,y],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,h]],os:[[/microsoft (windows) (vista|xp)/i],[h,y],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[h,[y,C,j]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,C,j],[h,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[h,ie],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,h],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[h,y],[/\(bb(10);/i],[y,[h,A]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[y,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[h,ye+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[h,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[h,de+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,Z],y],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[h,y],[/(sunos) ?([\w\.\d]*)/i],[[h,"Solaris"],y],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,y]]},L=function($,V){if(typeof $===u&&(V=$,$=o),!(this instanceof L))return new L($,V).getResult();var z=typeof e!==l&&e.navigator?e.navigator:o,te=$||(z&&z.userAgent?z.userAgent:i),le=z&&z.userAgentData?z.userAgentData:o,ge=V?I(N,V):N,se=z&&z.userAgent==te;return this.getBrowser=function(){var G={};return G[h]=o,G[y]=o,he.call(G,te,ge.browser),G[d]=Pe(G[y]),se&&z&&z.brave&&typeof z.brave.isBrave==c&&(G[h]="Brave"),G},this.getCPU=function(){var G={};return G[k]=o,he.call(G,te,ge.cpu),G},this.getDevice=function(){var G={};return G[v]=o,G[p]=o,G[m]=o,he.call(G,te,ge.device),se&&!G[m]&&le&&le.mobile&&(G[m]=b),se&&G[p]=="Macintosh"&&z&&typeof z.standalone!==l&&z.maxTouchPoints&&z.maxTouchPoints>2&&(G[p]="iPad",G[m]=w),G},this.getEngine=function(){var G={};return G[h]=o,G[y]=o,he.call(G,te,ge.engine),G},this.getOS=function(){var G={};return G[h]=o,G[y]=o,he.call(G,te,ge.os),se&&!G[h]&&le&&le.platform&&le.platform!="Unknown"&&(G[h]=le.platform.replace(/chrome os/i,Z).replace(/macos/i,ie)),G},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return te},this.setUA=function(G){return te=typeof G===f&&G.length>R?Te(G,R):G,this},this.setUA(te),this};L.VERSION=r,L.BROWSER=Ce([h,y,d]),L.CPU=Ce([k]),L.DEVICE=Ce([p,v,m,S,b,E,w,O,F]),L.ENGINE=L.OS=Ce([h,y]),t.exports&&(n=t.exports=L),n.UAParser=L;var ne=typeof e!==l&&(e.jQuery||e.Zepto);if(ne&&!ne.ua){var ve=new L;ne.ua=ve.getResult(),ne.ua.get=function(){return ve.getUA()},ne.ua.set=function($){ve.setUA($);var V=ve.getResult();for(var z in V)ne.ua[z]=V[z]}}})(typeof window=="object"?window:yv)})(us,us.exports);var pw=us.exports;const $n=new pw.UAParser,hw=()=>D.useMemo(()=>({os:$n.getOS(),browser:$n.getBrowser(),cpu:$n.getCPU(),device:$n.getDevice(),engine:$n.getEngine(),ua:$n.getUA()}),[]),mw=()=>D.useMemo(()=>$n.getBrowser(),[]),qs=()=>{const{ua:t}=hw();return t.includes("io-connect-desktop")},Jp=()=>{const[t,n]=g.useState([]),[e,o]=g.useState(!1),r=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!r)return;let i=!1;const a=[],c=r.layouts.onAdded(f=>{if(f.type!=="Global"||i)return;o(!0);const{name:d}=f;n(p=>[...p,{name:d}])}),l=r.layouts.onRemoved(f=>{f.type!=="Global"||i||n(d=>d.filter(p=>p.name!==f.name))}),u=r.layouts.onRenamed((f,d)=>{if(f.type!=="Global"||i)return;const{name:p}=f;n(h=>{const m=h.findIndex(v=>v.name===(d==null?void 0:d.name));return m===-1?h:[...h.slice(0,m),{name:p},...h.slice(m+1)]})});return a.push(c,l,u),()=>{i=!0,a.forEach(f=>f())}},[r]),{layouts:t,isInitialized:e}},Xp=()=>{const[t,n]=g.useState([]),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=e.notifications.onRaised(a=>n(c=>[...c,a])),r=e.notifications.onClosed(a=>n(c=>c.filter(l=>l.id!==a.id))),i=e.notifications.onStateChanged(({id:a},c)=>{n(l=>{const u=l.findIndex(f=>f.id===a);return u===-1?l:[...l.slice(0,u),{...l[u],state:c},...l.slice(u+1)]})});return e.notifications.list().then(n).catch(console.error),()=>{o(),r(),i()}},[e]),t},gw=()=>{const[t,n]=g.useState({}),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=e.notifications.onConfigurationChanged(r=>n(r));return()=>{o()}},[e]),t},Js=t=>{const{handler:n,skip:e}=t;g.useEffect(()=>{if(e)return;const o=r=>{var i;((i=document.activeElement)==null?void 0:i.nodeName)==="IFRAME"&&n(r)};return window.addEventListener("blur",o,!0),()=>{window.removeEventListener("blur",o,!0)}},[n,e])},Xs=t=>{const{eventType:n,handler:e,ref:o,skip:r}=t;g.useEffect(()=>{if(r)return;const i=a=>{const c=a.target;(Array.isArray(o)?o.every(u=>u.current&&!u.current.contains(c)):o.current&&!o.current.contains(c))&&e(a)};return document.addEventListener(n,i,!0),()=>{document.removeEventListener(n,i,!0)}},[n,e,o,r])},vw=Xe({name:Dt}),Sr=Xe({isCompleted:Do()}),ln=(t,n,e)=>{const[o,r]=g.useState(()=>{try{const c=window[t].getItem(n);return c?JSON.parse(c):null}catch(c){return console.log(c),null}}),i=`${t}-${n}`;g.useEffect(()=>{const c=l=>{r(l.detail)};return window.addEventListener(i,c),()=>{window.removeEventListener(i,c)}},[i]);const a=g.useCallback(c=>{try{if(!c){window[t].removeItem(n),r(null);return}const l=e.run(c);if(!l.ok){console.warn(`Error validating the value to be stored: ${l.error.message}`);return}const u=l.result;r(u),window[t].setItem(n,JSON.stringify(u)),window.dispatchEvent(new CustomEvent(i,{detail:u}))}catch(l){console.log(l)}},[n,t,i,e]);return[o,a]},Qs=()=>{const[t,n]=ln("sessionStorage",Uy,vw);return{isPlatformWindow:!t||window.name===t.name,setPlatformWindow:n}},Qp=()=>{const[t,n]=g.useState([]);return g.useEffect(()=>{const e=({key:i})=>{n(a=>a.includes(i)?a:a.concat(i))},o=i=>{n(a=>a.filter(c=>c!==i.key))},r=()=>{n([])};return document.addEventListener("keydown",e),document.addEventListener("keyup",o),window.addEventListener("blur",r),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",o),window.removeEventListener("blur",r)}},[]),t.length===1?t[0]:null},ec=()=>{const t=g.useContext(Me.IOConnectContext);return g.useCallback(async(n,e)=>{if(t)try{await t.layouts.restore({name:n}),e==null||e({name:n}),await Fe({io:t,variant:Le.SUCCESS,text:`Layout "${n}" was loaded successfully.`})}catch(o){await Fe({io:t,variant:Le.WARNING,text:`Failed to load Layout "${n}".`,error:o})}},[t])},Bi={CONTROL:"Control",SHIFT:"Shift"},tc=()=>{const t=g.useContext(Me.IOConnectContext),n=Ys();return async({id:e,modifier:o,reuseWorkspaceId:r})=>{var i;try{const a=o===Bi.CONTROL?{newFrame:!0}:{frameId:n,reuseWorkspaceId:r};await((i=t.workspaces)==null?void 0:i.restoreWorkspace(e,a))}catch(a){await Fe({io:t,variant:Le.WARNING,text:`Failed to load Workspace "${e}".`,error:a})}}},yw=t=>{const[n,e]=g.useState([]),[o,r]=g.useState(!0),i=g.useRef(null),a=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{const c=a==null?void 0:a.search;if(!c)return;const l=[],u=[];return(async d=>{r(!0),e([]);const p=await c.query({search:d.trim(),providerLimits:{maxResults:100,maxResultsPerType:5}});if(p===i.current)return;i.current=p;const h=p.onResults(y=>{y.results.forEach(k=>{u.find(b=>b.id===k.id&&b.type.name===k.type.name)||u.push(k)}),r(!1),e([...u])}),m=p.onCompleted(()=>{r(!1)}),v=p.onError(y=>{console.error(`Query failed. Provider: ${y.provider}; Error: ${y.error}`)});l.push(h,m,v)})(t),()=>{l.forEach(d=>d())}},[a,t]),{resultsToRender:n,isLoading:o}},eh=()=>{const t=g.useContext(Me.IOConnectContext),n=async({id:o})=>{var r;await((r=t.appManager.application(o))==null?void 0:r.start())},e=async({id:o,modifier:r})=>{var u,f;const i=await((u=t.workspaces)==null?void 0:u.getWorkspace(d=>d.isSelected===!0)),a=i==null?void 0:i.children[0];if(r===Bi.CONTROL||!i||(a==null?void 0:a.type)==="window"){await((f=t.appManager.application(o))==null?void 0:f.start());return}await((a==null?void 0:a.type)==="group"?a:await(a??i).addGroup()).addWindow({appName:o})};return async o=>{try{await(yp()?n:e)(o)}catch(r){await Fe({io:t,variant:Le.WARNING,text:`Failed to start app "${o.title}".`,error:r})}}},ww=()=>{const[t,n]=g.useState({}),e=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{if(!e)return;const o=[];return(async()=>{var r,i;try{const a=await((r=e.workspaces)==null?void 0:r.onWorkspaceOpened(l=>n(u=>({...u,[l.title]:[...u[l.title]??[],l.id]}))));o.push(a);const c=await((i=e.workspaces)==null?void 0:i.onWorkspaceClosed(({workspaceId:l})=>n(u=>{const f={...u};for(const d in f)if(f[d].includes(l)){f[d]=f[d].filter(p=>p!==l);break}return f})));o.push(c)}catch(a){console.error(a)}})(),()=>o.forEach(r=>r==null?void 0:r())},[e]),t},th=t=>t.key==="Enter"||t.key===" ",Hi=(t,n)=>typeof t>"u"?{}:{tabIndex:0,onClick:t,onKeyDown:e=>{th(e)&&(e.preventDefault(),t==null||t(e)),n==null||n(e)}},nh=({event:t,currentIndex:n,moveFocus:e,min:o,max:r,onClose:i})=>{switch(t.key){case"ArrowUp":{e(Math.max(n-1,o));break}case"ArrowDown":{e(Math.min(n+1,r));break}case"Home":{e(o);break}case"End":{e(r);break}case"Escape":{if(i){i();break}return}default:return}t.stopPropagation(),t.preventDefault()};const bw=g.forwardRef((t,n)=>{const{title:e,actions:o,className:r,onClose:i,onActionItemClick:a,"data-testid":c="context-menu",...l}=t,u=g.useRef({}),[f,d]=g.useState(0),p=h=>{var m;(m=u.current[h])==null||m.focus(),d(h)};return g.useEffect(()=>{var h;(h=u.current[f])==null||h.focus()},[]),s.jsxs(ut,{ref:n,className:et(r,"context-menu"),onClick:h=>h.stopPropagation(),onKeyDown:h=>nh({event:h,currentIndex:f,min:0,max:o.length-1,moveFocus:p,onClose:i}),"data-testid":c,...l,children:[e&&s.jsx(ut.ItemSection,{children:e}),o.map((h,m)=>{const v=h.displayName||h.name,y=h.iconSrc?s.jsx(Wu,{size:"16",src:h.iconSrc,alt:`${v} icon`}):h.icon&&s.jsx(ot,{size:"16",variant:h.icon});return s.jsxs(g.Fragment,{children:[s.jsx(ut.Item,{ref:k=>u.current[m]=k,prepend:y,disabled:h.disabled,tabIndex:-1,...Hi(k=>a(k,h)),"data-testid":`${c}-item-${h.name}`,children:v}),h.separatorAfter&&s.jsx("li",{className:"context-menu-separator","aria-hidden":!0,"data-testid":`${c}-separator`})]},h.name)})]})});function nc(t){const{title:n,buttonSize:e="16",icon:o="ellipsis-vertical",iconSize:r="12",actions:i,isTabStop:a,onActionItemClick:c,buttonVariant:l,placement:u,offset:f,shouldCloseOnOutsideScroll:d=!1,shouldCloseOnWindowBlur:p=!1,"data-testid":h,contextMenuDataTestId:m}=t,[v,y]=g.useState(!1),[k,S]=g.useState(null),[b,w]=g.useState(null),E=g.useRef(null),O=g.useRef(null),F=g.useMemo(()=>[O,E],[]),R=g.useCallback(()=>y(!1),[]),{styles:U,attributes:K}=ry(k,b,{placement:u,modifiers:[{name:"offset",options:{offset:f}}]});g.useEffect(()=>{E.current=k},[k]),g.useEffect(()=>{O.current=b},[b]),Xs({eventType:"mouseup",handler:R,ref:F,skip:!v}),Js({handler:R,skip:!v}),g.useEffect(()=>{if(!(!p||!v))return window.addEventListener("blur",R),()=>{window.removeEventListener("blur",R)}},[R,v,p]),g.useEffect(()=>{if(!d||!b)return;const me=de=>{if(b.contains(de.target)){de.preventDefault();return}R()};return document.addEventListener("touchmove",me,{passive:!1}),document.addEventListener("wheel",me,{passive:!1}),()=>{document.removeEventListener("touchmove",me),document.removeEventListener("wheel",me)}},[R,b,d]);const _=me=>{me.stopPropagation(),y(de=>!de),b==null||b.focus()},A=(me,de)=>{me.stopPropagation(),c(me,de),R()};return s.jsxs(s.Fragment,{children:[s.jsx(Ve,{ref:S,size:e,icon:o,iconSize:r,variant:l,...Hi(_),tabIndex:a?0:-1,"data-testid":h}),v&&s.jsx(bw,{ref:w,title:n,actions:i,onActionItemClick:A,onClose:()=>{k==null||k.focus(),R()},style:U.popper,"data-testid":m,...K.popper})]})}const xw=t=>{const{isFavoritismEnabled:n=!0,item:e,onClick:o,onKeyDown:r,isFocused:i,liRef:a,...c}=t,{favorites:l,toggleFavorite:u,isLoading:f}=Fi(),{description:d,icon:p="application",iconSrc:h,openInstances:m=0,title:v,tooltip:y,className:k,contextMenuActions:S=[]}=e,b=n&&l.some(F=>F.type===e.type&&F.title===e.title),w=F=>{if(th(F)){o(F),F.preventDefault(),F.stopPropagation();return}r(F)},E=h?s.jsx(Wu,{size:"16",src:h,alt:`${v} icon`,"data-testid":"base-section-item-icon"}):s.jsx(ot,{size:"16",variant:p,"data-testid":"base-section-item-icon"}),O=s.jsxs(s.Fragment,{children:[m!==0&&s.jsx("span",{className:"open-instances io-text-smaller","data-testid":"base-section-item-open-instances",children:m===1?"Opened":`${m} opened`}),(n||S.length>0)&&s.jsxs(Re,{className:"item-actions",children:[n&&s.jsx(Ve,{...Hi(F=>{F.stopPropagation(),u(e)}),tabIndex:i?0:-1,size:"24",iconSize:"12",icon:b?"star-full":"star",disabled:f,"data-testid":"base-section-item-favorite-button"}),S.length>0&&s.jsx(nc,{buttonSize:"24",iconSize:"12",icon:"ellipsis-vertical",title:v,actions:S,onActionItemClick:o,isTabStop:i,placement:"bottom-end",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0,"data-testid":"base-section-item-context-menu-button"})]})]});return s.jsx(ut.Item,{ref:a,tabIndex:i?0:-1,className:et("io-base-section-item",k),onKeyDown:w,onClick:o,prepend:E,append:O,description:d,tooltip:y??v,"data-testid":`base-section-item-${e.id}`,...c,children:v})},Cw=new Zp,kw=()=>{const{value:t,update:n}=Wt({prefKey:Ro.COLLAPSED_SECTIONS}),e=g.useCallback(o=>Cw.enqueue(()=>n((r=[])=>r.includes(o)?r.filter(a=>a!==o):[...r,o])),[n]);return{collapsedSections:t,toggleSection:e}},oc=t=>{const{config:n,level:e=1,path:o=n.id,onItemClick:r}=t,{isCollapsible:i=!0}=n,a=Qp(),[c,l]=g.useState(0),u=g.useRef({}),{collapsedSections:f,toggleSection:d}=kw(),p=i?!(f!=null&&f.includes(o)):!0,h=n.items.filter(w=>ir(w)),m=n.items.filter(w=>!ir(w)),v=[...h,...m],y=16,k=24,S=w=>{var E,O;(O=(E=u.current[w])==null?void 0:E.querySelector("[tabIndex]"))==null||O.focus(),l(w)},b=async()=>{i&&await d(o)};return s.jsxs(ut.ItemWithSubItems,{className:e===1?"main-section":void 0,"data-testid":`base-section-${n.id}`,children:[s.jsx(Ny,{className:e===1?"io-list-item-title main-section-header":void 0,isOpen:p,onClick:b,showCollapseIcon:i,showFolderIcon:e!==1,style:{paddingLeft:`${y+k*Math.max(0,e-2)}px`},"data-testid":`base-section-header-${n.id}`,title:n.title}),s.jsx(Bp,{isOpen:p,tag:ut,children:v.map((w,E)=>ir(w)?s.jsx(oc,{config:w,level:e+1,onItemClick:r,path:`${o}/${w.id}`},w.id):s.jsx(xw,{style:{paddingLeft:`${y+k*(e-1)}px`},liRef:O=>u.current[E]=O,isFavoritismEnabled:w.type===bt.APPLICATION||w.type===bt.WORKSPACE,item:w,onClick:(O,F)=>r==null?void 0:r(O,{item:w,modifier:a,selectedContextMenuActionName:F==null?void 0:F.name}),onKeyDown:O=>{nh({event:O,moveFocus:S,currentIndex:c,min:0,max:v.length-1})},isFocused:c===E},w.id))})]})},oh=t=>`${t.type}-${t.id}`,Sw=(t,n)=>rh(t)[n],rh=t=>t.reduce((n,e)=>ir(e)?{...n,...rh(e.items)}:{...n,[oh(e)]:e},{}),ih=g.createContext(void 0),Ew=()=>{const t=g.useContext(ih);if(t===void 0)throw new Error("useSection must be used within a SectionProvider");return t},jw=({children:t})=>{const[n,e]=g.useState(null),o=g.useMemo(()=>[n,e],[n]);return s.jsx(ih.Provider,{value:o,children:t})},Wi=({config:t,onItemClick:n})=>{const[e,o]=Ew(),r=en(),{isLaunchpadPinned:i}=so(),a=(c,l)=>{const{item:u,modifier:f,selectedContextMenuActionName:d}=l;o({itemName:oh(u),modifier:f,selectedContextMenuActionName:d})};return g.useEffect(()=>{var d;if(!n||!e)return;const{itemName:c,modifier:l,selectedContextMenuActionName:u}=e,f=Sw(t.items,c);f&&(n({item:f,modifier:l,selectedContextMenuActionName:u}),o(null),!(l===Bi.SHIFT||i)&&((d=r.close)==null||d.call(r)))},[e,t.items,r,n,o,i]),s.jsx(oc,{config:t,onItemClick:a})};function ah(t){const{isFolderCollapsible:n,isSectionCollapsible:e,sortOrder:o}=t,r=Hp(),i=Iy(),a=eh(),c=Wp(),l=g.useMemo(()=>vv(r,i,{isFolderCollapsible:n,isSectionCollapsible:e,sortOrder:o}),[r,i,n,e,o]),u=f=>{const{item:d,modifier:p,selectedContextMenuActionName:h}=f;if(!h)return a({id:d.id,title:d.title,modifier:p});c(d,h)};return s.jsx(Wi,{config:l,onItemClick:u})}const Ow=(t,n)=>{const{isSectionCollapsible:e,sortOrder:o=pr.DISABLED}=n,r=_s({items:t,sortOrder:o,ascendingCompare:xp,descendingCompare:Cp});return{id:So.FAVORITES,title:"Favorites",items:r,isCollapsible:e}},sh=t=>{const{isSectionCollapsible:n,sortOrder:e}=t,{favorites:o}=Fi(),r=g.useMemo(()=>Ow(o,{isSectionCollapsible:n,sortOrder:e}),[o,n,e]);return o.length>0?s.jsx(Wi,{config:r}):null},Nw=t=>{const{active:n,className:e,...o}=t;return s.jsx(Ve,{className:et("launchpad-button",{active:n},e),"aria-label":"Launchpad",icon:"logo",variant:"circle",size:"32",title:n?"Close Launchpad":"Open Launchpad","data-testid":"launchpad-button",...o})};var Iw=function(n){return Pw(n)&&!Aw(n)};function Pw(t){return!!t&&typeof t=="object"}function Aw(t){var n=Object.prototype.toString.call(t);return n==="[object RegExp]"||n==="[object Date]"||Mw(t)}var Tw=typeof Symbol=="function"&&Symbol.for,Dw=Tw?Symbol.for("react.element"):60103;function Mw(t){return t.$$typeof===Dw}function _w(t){return Array.isArray(t)?[]:{}}function vr(t,n){return n.clone!==!1&&n.isMergeableObject(t)?Mo(_w(t),t,n):t}function Lw(t,n,e){return t.concat(n).map(function(o){return vr(o,e)})}function Rw(t,n){if(!n.customMerge)return Mo;var e=n.customMerge(t);return typeof e=="function"?e:Mo}function Fw(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(n){return Object.propertyIsEnumerable.call(t,n)}):[]}function _l(t){return Object.keys(t).concat(Fw(t))}function ch(t,n){try{return n in t}catch{return!1}}function Bw(t,n){return ch(t,n)&&!(Object.hasOwnProperty.call(t,n)&&Object.propertyIsEnumerable.call(t,n))}function Hw(t,n,e){var o={};return e.isMergeableObject(t)&&_l(t).forEach(function(r){o[r]=vr(t[r],e)}),_l(n).forEach(function(r){Bw(t,r)||(ch(t,r)&&e.isMergeableObject(n[r])?o[r]=Rw(r,e)(t[r],n[r],e):o[r]=vr(n[r],e))}),o}function Mo(t,n,e){e=e||{},e.arrayMerge=e.arrayMerge||Lw,e.isMergeableObject=e.isMergeableObject||Iw,e.cloneUnlessOtherwiseSpecified=vr;var o=Array.isArray(n),r=Array.isArray(t),i=o===r;return i?o?e.arrayMerge(t,n,e):Hw(t,n,e):vr(n,e)}Mo.all=function(n,e){if(!Array.isArray(n))throw new Error("first argument should be an array");return n.reduce(function(o,r){return Mo(o,r,e)},{})};var Ww=Mo,$w=Ww;const zw=_i($w),Uw={header:{showHeader:!0,showSearch:!0},mode:"default"},Tn={WINDOW_MANAGEMENT:"window-management",NOTIFICATIONS:"notifications"},$i="getScreenDetails"in window,lh=g.createContext(void 0),uh=()=>{const t=g.useContext(lh);if(t===void 0)throw new Error("useLaunchpadConfig must be used within an LaunchpadConfigProvider");return t},Vw=({children:t,settings:n,components:e})=>{const o=g.useMemo(()=>({settings:n,components:e}),[n,e]);return s.jsx(lh.Provider,{value:o,children:t})},dh=g.createContext(void 0),fh=()=>{const t=g.useContext(dh);if(t===void 0)throw new Error("useLaunchpadSearch must be used within a LaunchpadSearchProvider");return t},Gw=({children:t})=>{const[n,e]=g.useState(""),o=g.useMemo(()=>({searchTerm:n,setSearchTerm:e}),[n]);return s.jsx(dh.Provider,{value:o,children:t})},ph=({settings:t={},components:n={},isOpen:e=!0,onClose:o,windowManagementPermissionState:r="granted",children:i,className:a,...c})=>{const l=$i&&r==="granted",u=g.useMemo(()=>zw(Uw,t),[t]);return s.jsx(aw,{close:o,isOpen:e,isGlobalLayoutsAvailable:l,children:s.jsx(Vw,{settings:u,components:n,children:s.jsx(Gw,{children:s.jsx("div",{className:et("launchpad",a),"data-testid":"launchpad",...c,children:i})})})})},Yw=g.forwardRef((t,n)=>{const{onSearch:e,searchTerm:o,onClear:r,className:i}=t,a=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{a!=null&&a.search&&a.search.setDebounceMS(450)},[a]),s.jsx(no,{id:"search-input",className:et("search-bar",i),ref:n,placeholder:"Find anything",value:o,onChange:e,autoComplete:"off",iconPrepend:"search",iconAppend:o.length?"close":void 0,iconAppendOnClick:r})}),hh=({className:t})=>{const{isLaunchpadPinned:n,isLoading:e,toggle:o}=so();return s.jsx(Ve,{className:t,size:"32",variant:"circle",icon:n?"unpin":"pin",onClick:o,disabled:e})},mh=({className:t})=>{const n=Ys(),{isOpen:e}=en(),{settings:o,components:r}=uh(),{isLaunchpadPinned:i}=so(),{isLaunchpadCollapsed:a,setIsLaunchpadCollapsed:c}=Ks(),{searchTerm:l,setSearchTerm:u}=fh(),f=g.useRef(null),{showSearch:d,showHeader:p}=o.header??{},{BeforeSearch:h,AfterSearch:m}=r.header??{};g.useEffect(()=>{var k;e&&((k=f.current)==null||k.focus())},[e]),g.useEffect(()=>{i&&c(!1)},[c,i]);const v=k=>{const S=k.target.value;Up(S)&&a&&c(!1),u(S)},y=()=>{var k;u(""),(k=f.current)==null||k.focus()};return p?s.jsxs("div",{className:et("launchpad-header",n||i?void 0:"draggable",t),"data-testid":"launchpad-header",children:[h&&s.jsx(h,{}),d&&s.jsx(Yw,{ref:f,searchTerm:l,onSearch:v,onClear:y,className:n?void 0:"non-draggable"}),m&&s.jsx(m,{}),m===void 0&&(o==null?void 0:o.mode)!=="pinned"&&s.jsx(hh,{className:"ms-auto"})]}):null},Zw=(t,n,e)=>{const{isSectionCollapsible:o,sortOrder:r=pr.ASCENDING}=e,a=_s({items:t,sortOrder:r,ascendingCompare:xp,descendingCompare:Cp}).map(c=>{var l;return{...c,type:bt.WORKSPACE,icon:"workspace",openInstances:(l=n[c.title])==null?void 0:l.length,contextMenuActions:bp}});return{id:So.WORKSPACES,title:"Workspaces",items:[...a,{id:Yp.CREATE_WORKSPACE,icon:"add",title:"Create Workspace",type:bt.ACTION_BUTTON,tooltip:"Create an empty Workspace in a new window",className:"create-workspace-btn"}],isCollapsible:o}},gh=t=>{const{isSectionCollapsible:n,sortOrder:e}=t,o=Kp(),r=ww(),i=tc(),a=qp(),c=g.useMemo(()=>Zw(o,r,{isSectionCollapsible:n,sortOrder:e}),[o,r,n,e]),l=u=>{const{item:f,modifier:d,selectedContextMenuActionName:p}=u;return p?a(f,p):f.type===bt.ACTION_BUTTON?a(f,f.id):i({id:f.id,modifier:d})};return s.jsx(Wi,{config:c,onItemClick:l})},Kw=[{placementId:So.FAVORITES,Component:sh},{placementId:So.WORKSPACES,Component:gh},{placementId:So.APPLICATIONS,Component:ah}],vh=()=>{const{defaultLayout:t,activeLayout:n}=en();return e=>({name:e,isDefault:e===(t==null?void 0:t.name),isActive:e===(n==null?void 0:n.name)})},qw=()=>{const t=Gp(),n=vh(),e=Fo();return async(o,r)=>{const{id:i}=o,a=n(i);await e(()=>t({layout:a,actionName:r}))}},Jw=()=>{const t=Wp(),n=qp(),e=qw();return o=>{if(o===bt.APPLICATION)return t;if(o===bt.WORKSPACE)return n;if(o===bt.LAYOUT)return e}},po={RENAME:"rename",SAVE:"save",SAVE_AS:"saveAs",DELETE:"delete",SET_AS_DEFAULT:"setAsDefault",LOAD:"load"},yh=t=>[{name:po.RENAME,displayName:"Rename",icon:"pen-line"},{name:po.SAVE,displayName:"Save",disabled:!t.isActive,icon:"floppy"},{name:po.SAVE_AS,displayName:"Save as",icon:"floppy-disk-pen",separatorAfter:!0},{name:po.DELETE,displayName:"Delete",icon:"trash-can",separatorAfter:!0},{name:po.SET_AS_DEFAULT,displayName:"Set as Default",disabled:t.isDefault,icon:"user-gear",separatorAfter:!0},{name:po.LOAD,displayName:"Load",icon:"spinner"}],Xw=t=>{const n=vh();return t.reduce((e,o)=>{const{type:r}=o,i=o.id||o.displayName;if(!i)return e;let a=[];if(r.name===bt.APPLICATION)a=wp;else if(r.name===bt.WORKSPACE)a=bp;else if(r.name===bt.LAYOUT){const f=n(i);a=yh(f)}else o.secondaryActions&&(a=o.secondaryActions.map(({name:f,method:d,params:p,target:h})=>({name:f,interopParams:{method:d,params:p,target:h}})));const c={id:i,title:o.displayName||i,description:o.description,type:r.name,iconSrc:o.iconURL,mainAction:o.action,contextMenuActions:a},l=e.findIndex(({title:f})=>r.displayName?f===r.displayName:f===r.name),u=e[l];return u?[...e.slice(0,l),{...u,items:[...u.items,c]},...e.slice(l+1)]:[...e,{id:r.name,title:r.displayName||r.name,items:[c]}]},[])};function Qw(t){const{resultsToRender:n,isLoading:e}=yw(t.searchTerm),{close:o}=en(),r=dw(),i=tc(),a=eh(),c=ec(),l=Jw(),u=Xw(n),f=Fo(),{isLaunchpadPinned:d}=so(),p=(m,v)=>{const y=l(m.type);y==null||y(m,v)},h=async(m,v)=>{var R;const{item:y,modifier:k,selectedContextMenuActionName:S}=v,{type:b,id:w,title:E,mainAction:O}=y,F=S?(R=y.contextMenuActions)==null?void 0:R.find(U=>U.name===S):null;F!=null&&F.interopParams?r(F.interopParams):S?p(y,S):O?r(O):b===bt.APPLICATION?a({id:w,title:E,modifier:k}):b===bt.WORKSPACE?i({id:w,modifier:k}):b===bt.LAYOUT&&f(()=>c(w)),!(k===Bi.SHIFT||d)&&(o==null||o())};return e?s.jsx("p",{className:"search-loading",children:"Loading..."}):n.length===0?s.jsx("p",{className:"search-no-results",children:"No results found. Try searching by app name, workspace title, or keywords."}):s.jsx(ut,{children:u.map((m,v)=>s.jsx(oc,{config:m,onItemClick:h},m.id||v))})}const eb=()=>{const{value:t,update:n,isLoading:e,error:o}=Wt({prefKey:Ro.IS_LAYOUTS_PANEL_OPEN});return{error:o,isLayoutsPanelOpen:t,setIsLayoutsPanelOpen:n,isLoading:e}},tb=({layoutName:t})=>{const n=g.useContext(Me.IOConnectContext),e=Fo(),o=r=>{r.stopPropagation(),e(async()=>{try{await n.layouts.save({name:t,type:"Global"}),await Fe({io:n,variant:Le.SUCCESS,text:`Layout "${t}" was saved successfully.`})}catch(a){await Fe({io:n,variant:Le.WARNING,text:`Failed to save Layout "${t}".`,error:a})}})};return s.jsx(Ve,{icon:"floppy",size:"24",iconSize:"12",onClick:o,title:"Save Layout","data-testid":"save-layout-button"})},nb=({layout:t})=>{const n=Gp(),e=Fo(),o=async(r,i)=>{r.stopPropagation(),await e(()=>n({layout:t,actionName:i.name}))};return s.jsx(nc,{buttonSize:"24",iconSize:"12",title:t.name,icon:"ellipsis-vertical",actions:yh(t),onActionItemClick:o,placement:"top-end",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0,"data-testid":"layout-context-menu-button",contextMenuDataTestId:"layout-context-menu"})},wh=({layouts:t,className:n,...e})=>{const{isLaunchpadPinned:o}=so(),{close:r}=en(),i=ec(),a=Fo(),c=()=>{o||r==null||r()},l=u=>a(()=>i(u.name,c));return s.jsx(ut,{className:et("layouts-list",n),variant:"single",checkIcon:{variant:"check",tooltip:"Active Layout"},...e,children:t.map(u=>s.jsx(ut.Item,{className:"layouts-list-item",onClick:()=>l(u),append:s.jsxs(s.Fragment,{children:[u.isDefault&&s.jsx(ki,{variant:"default",title:"Default Layout","data-testid":"default-layout-pill",children:"Default"}),s.jsxs(Lp,{children:[u.isActive&&s.jsx(tb,{layoutName:u.name}),s.jsx(nb,{layout:u})]})]}),isSelected:u.isActive,tooltip:u.name,"data-testid":`layout-item-${u.name}`,children:u.name},u.name))})},ob=()=>{const{layouts:t}=Jp(),{activeLayout:n,defaultLayout:e}=en(),o=g.useMemo(()=>t.map(r=>({...r,isActive:r.name===(n==null?void 0:n.name),isDefault:r.name===(e==null?void 0:e.name)})),[t,n,e]);return s.jsx(wh,{layouts:o,"data-testid":"all-layouts"})},rb=()=>{const{defaultLayout:t,activeLayout:n}=en();return n?s.jsx(wh,{layouts:[{...n,isDefault:n.name===(t==null?void 0:t.name),isActive:!0}],"data-testid":"active-layout"}):s.jsx("p",{className:"io-text-small no-active-layout","data-testid":"choose-layout-message",children:"Choose which Layout to load"})},ib=()=>{const t=g.useContext(Me.IOConnectContext),{setActiveLayout:n}=en(),e=Fo(),o=async()=>{var d;if(!("modals"in t&&t.modals)){console.error("Cannot create Layout because io dialogs are not enabled");return}const r="create",i="layout-name",{isEnterPressed:a,responseButtonClicked:c,inputs:l}=await t.modals.dialogs.request({templateName:Lo.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:"Create Layout",input:{id:i,initialValue:"Create Layout",validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Zs}},actionButtons:[{variant:"primary",text:"Create",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)try{if((await t.layouts.getAll("Global")).find(h=>h.name===u)){await Fe({io:t,variant:Le.WARNING,text:`Failed to create Layout "${u}". A Layout with this name already exists.`});return}await t.layouts.save({name:u}),n({name:u}),await Fe({io:t,variant:Le.SUCCESS,text:`Layout "${u}" was created successfully.`})}catch(p){await Fe({io:t,variant:Le.WARNING,text:`Failed to create Layout "${u}".`,error:p})}};return s.jsx(Re,{variant:"fullwidth",className:"create-layout-btn-group",children:s.jsx(Ye,{variant:"primary",text:"Create Layout",onClick:()=>e(o),"data-testid":"create-layout-button"})})};const ab=()=>{const t=g.useRef(null),{layouts:n,isInitialized:e}=Jp(),{isLayoutsPanelOpen:o,setIsLayoutsPanelOpen:r}=eb();g.useEffect(()=>{!e||n.length>0||!o||r(!1)},[n,e,o,r]);const i=g.useCallback(()=>r(a=>!a),[r]);return s.jsxs("footer",{className:"layouts-panel",ref:t,"data-testid":"layouts-panel",children:[s.jsx(wr,{className:"layouts-panel-separator"}),s.jsxs("div",{className:"layouts-panel-header","aria-label":"Layouts panel","aria-expanded":o,role:"button","data-testid":"layouts-panel-header",...Hi(n.length?i:void 0),children:[s.jsx(sn,{tag:"h2",size:"normal",text:n.length>0?"Layouts":"Start using Layouts"}),n.length>0&&s.jsx(Ve,{className:et("layouts-panel-toggle-button",{"layouts-panel-toggle-button-rotated":o}),icon:"expand",iconSize:"12",size:"24","data-testid":"layouts-panel-toggle-button"})]}),s.jsx(Bp,{isOpen:o,tag:"div",children:s.jsx(ob,{})}),n.length>0&&!o?s.jsx(rb,{}):s.jsx(ib,{})]})},bh=({className:t})=>{const{isLaunchpadCollapsed:n}=Ks(),{isGlobalLayoutsAvailable:e}=en(),{components:o}=uh(),{searchTerm:r}=fh(),{sections:i=Kw}=o;return s.jsxs("div",{className:et("launchpad-body",n?"collapsed":void 0,t),children:[s.jsx("main",{className:"launchpad-main",children:Up(r)?s.jsx(Qw,{searchTerm:r}):s.jsx(jw,{children:s.jsx(ut,{children:i.map(({Component:a,placementId:c})=>s.jsx(a,{},c))})})}),e&&s.jsx(ab,{})]})};const xh=t=>s.jsxs(ph,{...t,children:[s.jsx(mh,{}),s.jsx(bh,{})]}),Ch=g.createContext(void 0),kh=()=>{const t=g.useContext(Ch);if(t===void 0)throw new Error("useWorkspaceComponentsContext must be used within an WorkspaceComponentsContextProvider");return t},sb=()=>{const t=$i?[Tn.NOTIFICATIONS,Tn.WINDOW_MANAGEMENT]:[Tn.NOTIFICATIONS];return Promise.all(t.map(async n=>{const e=await navigator.permissions.query({name:n});return e.stableName=n,e}))},Sh=g.createContext(void 0),Rn=()=>{const t=g.useContext(Sh);if(t===void 0)throw new Error("useIOConnectHome must be used within an IOConnectHomeProvider");return t},cb=({children:t})=>{const[n,e]=ln("localStorage",kr,Sr),[o,r]=g.useState([]),i=g.useMemo(()=>o.reduce((d,p)=>({...d,[p.stableName]:{state:p.state}}),{}),[o]),a={isLoading:o.length===0,statuses:i},[c,l]=g.useState(!1),u={isLoggingOut:c,setIsLoggingOut:l};g.useEffect(()=>{let d=!1;const p=sb().then(h=>{if(d)return;r(h);const m=[];let v=!1;return h.forEach((y,k)=>{const S=b=>{if(d||!b.target||v)return;const w=b.target;if(w.state==="prompt")return e({isCompleted:!1}),v=!0,window.location.reload();r(O=>[...O.slice(0,k),w,...O.slice(k+1)])};y.addEventListener("change",S),m.push(()=>y.removeEventListener("change",S))}),m}).catch(console.warn);return()=>{d=!0,p.then(h=>{h==null||h.forEach(m=>m())})}},[e]);const f=g.useMemo(()=>({permission:a,login:u}),[a,u]);return s.jsx(Sh.Provider,{value:f,children:t})},lb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,fill:"#3C3E3F",rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),s.jsx("rect",{width:42.821,height:15,x:.5,y:-.5,stroke:"#4B4E4F",strokeMiterlimit:10,rx:7.5,transform:"matrix(1 0 0 -1 117 103.85)"}),s.jsx("path",{fill:"#36A86B",d:"M125.31 100.086c-1.656 0-3-1.41-3-3.149 0-1.74 1.344-3.15 3-3.15 1.657 0 3 1.41 3 3.15s-1.343 3.149-3 3.149Z"}),s.jsx("rect",{width:21.694,height:6.057,fill:"#AAB0B0",rx:3.028,transform:"matrix(1 0 0 -1 132.72 99.844)"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("rect",{width:64,height:64,x:53,y:24,fill:"#36AA6C",rx:32}),s.jsx("path",{fill:"#fff",d:"M84.068 42.02c0-.466.408-.932.932-.932.466 0 .932.466.932.932v.99c4.66.467 8.388 4.428 8.388 9.262v1.748a9.57 9.57 0 0 0 2.796 6.756l.174.175c.466.466.758 1.165.758 1.806a2.61 2.61 0 0 1-2.621 2.621H74.514c-1.456-.058-2.563-1.165-2.563-2.621 0-.7.233-1.34.758-1.806l.116-.175c1.806-1.805 2.854-4.252 2.854-6.757v-1.747a9.3 9.3 0 0 1 8.388-9.261v-.99ZM85 44.816c-4.136 0-7.456 3.379-7.456 7.456v1.748c0 3.028-1.223 5.94-3.378 8.096l-.175.117a.94.94 0 0 0-.175.524c0 .408.291.699.7.699h20.91c.408 0 .758-.291.758-.7 0-.174-.117-.349-.233-.523l-.175-.117a11.502 11.502 0 0 1-3.378-8.155v-1.689c0-4.077-3.32-7.456-7.456-7.456H85Zm-1.806 23.008c.291.758.99 1.224 1.806 1.224.757 0 1.456-.466 1.747-1.224.175-.466.7-.757 1.165-.582a.976.976 0 0 1 .583 1.223A3.717 3.717 0 0 1 85 70.912c-1.631 0-3.029-.99-3.553-2.447a.976.976 0 0 1 .582-1.223c.466-.175.99.116 1.165.582Z"}),s.jsx("path",{fill:"#36A86B",d:"M113.791 86.146c-1.922 0-3.48-1.62-3.48-3.62 0-1.999 1.558-3.62 3.48-3.62s3.481 1.621 3.481 3.62c0 2-1.559 3.62-3.481 3.62Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),ub=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v94H0z",transform:"translate(0 20)"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:113,x:.5,y:20.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#3C3E3F",stroke:"#5D5D5D",strokeMiterlimit:10,d:"M22.338.5h125.324c2.746 0 4.941 2.144 4.941 4.75v76.938c0 2.608-2.195 4.751-4.941 4.751H22.338c-2.746 0-4.94-2.143-4.94-4.75V5.25c0-2.607 2.194-4.751 4.94-4.751Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M116.905 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533ZM127.206 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M137.505 16.552a2.766 2.766 0 1 0 0-5.533 2.766 2.766 0 0 0 0 5.533Z"}),s.jsx("circle",{cx:46.208,cy:58.882,r:20.294,fill:"#36AA6C"}),s.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M45.501 53.17a1 1 0 0 1 1.414 0l6.364 6.363a1 1 0 0 1-1.414 1.415l-4.657-4.657v48.23a1 1 0 0 1-2 0v-48.23l-4.657 4.657a1 1 0 0 1-1.414-1.415l6.364-6.364Z",clipRule:"evenodd"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:114,y:20,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:50.521,y1:5.735,y2:95.406,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),db=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeLinejoin:"round",strokeMiterlimit:10,d:"M27.449 103.584a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.495 1.495 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5V88.6h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V66.37h.5V64.35h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V42.12h.5V40.1h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5V19.89h-.5V17.87h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5V40.1h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5V88.6h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M128 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"M143.015 89.758a6.667 6.667 0 0 0 5.823-3.379c1.237-2.082 1.237-4.646 0-6.758-1.207-2.082-3.409-3.38-5.823-3.38a6.742 6.742 0 0 0-5.853 3.38c-1.237 2.112-1.237 4.676 0 6.758 1.207 2.112 3.409 3.38 5.853 3.38Zm0-14.482c2.746 0 5.28 1.479 6.668 3.862 1.388 2.414 1.388 5.34 0 7.724a7.666 7.666 0 0 1-6.668 3.862 7.678 7.678 0 0 1-6.698-3.862c-1.388-2.384-1.388-5.31 0-7.724a7.741 7.741 0 0 1 6.698-3.862Zm.724 2.897a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-1.689 7.723c0 .543.422.966.965.966a.973.973 0 0 0 .966-.966.993.993 0 0 0-.966-.965.972.972 0 0 0-.965.965Zm-.966 0c0-1.056.845-1.93 1.931-1.93.513 0 .996.21 1.328.573l3.228-1.931a.478.478 0 0 1 .664.15c.15.242.06.544-.151.664l-3.228 1.931c.06.181.09.362.09.543 0 1.087-.875 1.931-1.931 1.931a1.906 1.906 0 0 1-1.931-1.93Zm6.034-6.275a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Zm-8.93 2.655c.392 0 .724.332.724.724a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.301-.724.724-.724Zm2.172-2.655a.715.715 0 0 1-.724.724.697.697 0 0 1-.724-.724c0-.392.302-.724.724-.724.392 0 .724.332.724.724Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M12 83c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"M27.351 76.62a.804.804 0 0 0-.73 0L21.45 78.81c-.322.117-.556.438-.526.789 0 2.746 1.139 7.596 5.697 9.787a.804.804 0 0 0 .73 0c4.558-2.19 5.697-7.04 5.727-9.787a.855.855 0 0 0-.556-.789l-5.17-2.191Zm-1.08-.877a1.816 1.816 0 0 1 1.46 0l5.142 2.192c.643.292 1.14.905 1.14 1.665-.03 2.922-1.228 8.21-6.253 10.635a1.798 1.798 0 0 1-1.548 0c-5.026-2.425-6.223-7.713-6.223-10.635-.03-.76.467-1.373 1.11-1.665l5.171-2.192Z"}),s.jsx("rect",{width:30,height:30,fill:"#5A5C5C",rx:15,transform:"matrix(1 0 0 -1 12 45.46)"}),s.jsx("path",{fill:"#DDD",d:"M18.653 23.886c.132-.184.422-.237.58-.079l16.033 12.657a.394.394 0 0 1 .08.58c-.133.185-.396.212-.58.08L18.732 24.466a.42.42 0 0 1-.08-.58Zm10.416 6.065-1.45-1.16a7.74 7.74 0 0 1 4.746 2.189c.159.184.159.448 0 .606a.447.447 0 0 1-.606 0 6.555 6.555 0 0 0-2.69-1.635Zm-5.01.343a6.346 6.346 0 0 0-1.82 1.292.447.447 0 0 1-.606 0 .414.414 0 0 1 0-.58 7.975 7.975 0 0 1 1.688-1.292l.738.58Zm-.184-4.43-.791-.633a11.395 11.395 0 0 1 3.928-.686c3.218 0 6.17 1.319 8.307 3.428.158.159.158.422 0 .607-.158.158-.422.158-.607 0a10.84 10.84 0 0 0-7.7-3.19c-1.107 0-2.135.157-3.137.474ZM19.84 26.97l.686.528c-.449.343-.844.685-1.24 1.08a.447.447 0 0 1-.606 0c-.159-.184-.159-.447 0-.606.369-.369.765-.685 1.16-1.002Zm5.801 8.702a1.699 1.699 0 0 1-.21-1.687c.263-.554.79-.95 1.397-1.002a1.662 1.662 0 0 1 1.53.712c.369.5.448 1.134.21 1.687-.263.554-.79.95-1.397 1.002a1.662 1.662 0 0 1-1.53-.712Zm2.215-1.002a.868.868 0 0 0-.844-.843.85.85 0 0 0-.843.843c0 .475.369.844.843.844a.85.85 0 0 0 .844-.844Z"}),s.jsx("path",{fill:"#5A5C5C",d:"M128 30c0 8.284 6.716 15 15 15 8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15-8.284 0-15 6.716-15 15Z"}),s.jsx("path",{fill:"#DDD",d:"m142.001 23.885-.424 1.457c-.091.364-.364.637-.668.789-.243.121-.455.242-.667.364a1.232 1.232 0 0 1-1.032.212l-1.456-.364h-.122a3.276 3.276 0 0 0-.455.668l-.152.212a7.838 7.838 0 0 0-.333.728c0 .03.03.091.06.122l1.062 1.061c.243.273.364.668.334 1.002v.758c.03.334-.091.698-.334.971l-1.062 1.092a.231.231 0 0 0-.06.122c.091.242.212.485.333.728l.122.212c.152.213.303.456.455.668h.152l1.456-.364c.364-.091.759 0 1.032.182.212.151.424.273.667.394.304.152.577.425.668.79l.424 1.456c0 .03.031.06.061.09.304.061.607.061.941.061.303 0 .607 0 .91-.06.03-.03.061-.061.061-.091l.424-1.457c.091-.364.364-.637.668-.789a4.79 4.79 0 0 0 .667-.394c.304-.182.668-.273 1.032-.182l1.456.364h.152c.152-.212.304-.455.455-.668l.122-.212c.121-.243.242-.486.333-.728 0-.03-.03-.091-.06-.122l-1.062-1.092a1.316 1.316 0 0 1-.334-.97c0-.122.03-.244.03-.395 0-.122-.03-.243-.03-.364-.03-.334.091-.729.334-1.002l1.062-1.061c.03-.03.06-.092.06-.122a7.838 7.838 0 0 0-.333-.728l-.122-.212a12.155 12.155 0 0 0-.455-.668h-.152l-1.456.364c-.364.091-.728 0-1.032-.182a4.789 4.789 0 0 0-.667-.394c-.304-.152-.577-.425-.668-.79l-.424-1.456a.233.233 0 0 0-.061-.121 9.146 9.146 0 0 0-.91-.06c-.334 0-.637.03-.941.06a.233.233 0 0 0-.061.121Zm1.002-1.153c.394 0 .758.03 1.153.091.06.03.091.03.151.061.273.152.516.425.607.728l.425 1.457c0 .06.061.151.152.182.273.121.546.273.789.455.091.06.182.09.242.06l1.487-.364c.303-.09.668-.03.941.152l.121.122c.212.242.394.546.576.849l.152.212v.03c.152.304.304.608.425.911.03.06.03.091.03.152.031.334-.091.667-.333.91l-1.062 1.092c-.031.03-.061.122-.061.213 0 .151.03.303.03.455 0 .151-.03.303-.03.455 0 .121.03.212.061.243l1.062 1.092c.242.243.364.576.333.91 0 .03 0 .091-.03.152-.121.303-.273.607-.425.91l-.152.243a5.476 5.476 0 0 1-.606.85c-.031.06-.061.09-.091.12a1.206 1.206 0 0 1-.971.152l-1.457-.364c-.06-.03-.151 0-.242.061-.243.152-.516.303-.789.455-.091.03-.152.121-.152.182l-.425 1.426a1.277 1.277 0 0 1-.607.759c-.06.03-.091.03-.151.06-.395.03-.759.061-1.153.061-.395 0-.789-.03-1.184-.06-.06-.03-.091-.03-.151-.061a1.277 1.277 0 0 1-.607-.759l-.425-1.426c0-.06-.061-.151-.152-.182a4.11 4.11 0 0 1-.789-.455c-.091-.06-.182-.06-.242-.06l-1.457.363c-.333.091-.667.03-.94-.151-.061-.03-.091-.06-.122-.091-.242-.273-.424-.577-.606-.88l-.122-.213-.03-.03a11.98 11.98 0 0 1-.425-.91c0-.06-.03-.091-.03-.152 0-.334.091-.667.334-.91l1.061-1.092c.031-.03.061-.122.061-.243v-.91c0-.091-.03-.182-.061-.213l-1.061-1.092c-.243-.243-.334-.576-.334-.91 0-.061.03-.091.03-.152.121-.303.273-.607.425-.91l.03-.03.122-.213a6.09 6.09 0 0 1 .606-.85.24.24 0 0 1 .122-.12c.273-.183.607-.244.94-.153l1.457.364c.06.03.151 0 .242-.06.243-.152.516-.334.789-.455.091-.03.152-.122.152-.182l.425-1.457c.091-.303.334-.576.607-.728.06-.03.091-.03.151-.06.395-.061.789-.092 1.184-.092Zm-1.699 7.768c0 .637.303 1.183.849 1.486.516.304 1.153.304 1.699 0 .516-.303.85-.85.85-1.486 0-.607-.334-1.153-.85-1.457-.546-.303-1.183-.303-1.699 0-.546.304-.849.85-.849 1.457Zm4.369 0c0 .97-.516 1.85-1.335 2.336a2.781 2.781 0 0 1-2.67 0c-.85-.485-1.335-1.365-1.335-2.336 0-.94.485-1.82 1.335-2.306a2.781 2.781 0 0 1 2.67 0 2.702 2.702 0 0 1 1.335 2.306Z"}),s.jsx("circle",{cx:85,cy:57.277,r:32,fill:"#36AA6C"}),s.jsx("path",{fill:"#fff",d:"M72.313 42.777h9.968v1.812h-9.969c-1.019 0-1.812.85-1.812 1.813v16.312a1.79 1.79 0 0 0 1.813 1.813h25.374c.963 0 1.813-.793 1.813-1.813V46.402c0-.963-.85-1.813-1.813-1.813H87.72v-1.812h9.969c1.982 0 3.624 1.642 3.624 3.625v16.312a3.613 3.613 0 0 1-3.624 3.625H89.19l.623 3.625h3.342c.453 0 .906.453.906.907 0 .51-.453.906-.906.906H76.844a.895.895 0 0 1-.906-.906c0-.454.396-.907.906-.907h3.285l.623-3.625h-8.44c-2.039 0-3.624-1.586-3.624-3.625V46.402a3.614 3.614 0 0 1 3.624-3.625Zm10.251 23.562-.623 3.625h6.061l-.623-3.625h-4.815Zm3.342-22.656v12.348l2.946-3.002c.34-.34.962-.34 1.302 0 .34.34.34.963 0 1.302l-4.531 4.532c-.34.34-.963.34-1.303 0l-4.53-4.532c-.34-.34-.34-.962 0-1.302.339-.34.962-.34 1.302 0l3.002 3.002V43.683c0-.453.396-.906.906-.906.453 0 .906.453.906.906Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),fb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("path",{stroke:"#5D5D5D",strokeDasharray:"2 2",strokeMiterlimit:10,d:"M27.449 103.138a2.008 2.008 0 0 1-1.083-1.083l.462-.191a1.493 1.493 0 0 1-.114-.574v-1.011h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.022h-.5v-2.02h.5V80.07h-.5V78.05h.5v-2.021h-.5v-2.02h.5v-2.022h-.5v-2.02h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5V57.84h.5v-2.02h-.5V53.8h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.022h.5v-2.02h-.5V33.59h.5V31.57h-.5v-2.021h.5v-2.02h-.5v-2.022h.5v-2.02h-.5v-2.021h.5v-2.021h-.5v-2.021h.5v-2.021h-.5v-2.02h.5v-1.011c0-.205.04-.398.114-.574l-.462-.192c.203-.489.594-.88 1.083-1.083l.191.462c.176-.073.37-.113.574-.113h1.014v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.028v-.5h2.028v.5h2.029v-.5h2.028v.5h2.028v-.5h2.028v.5h1.014c.204 0 .398.04.574.113l.191-.462c.489.203.88.594 1.083 1.083l-.462.192c.073.176.114.37.114.574v1.01h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5v2.022h.5v2.02h-.5v2.021h.5v2.021h-.5v2.021h.5v2.02h-.5v2.022h.5v2.02h-.5V53.8h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v2.021h.5v2.021h-.5v2.02h.5v2.022h-.5v2.02h.5v2.021h-.5v1.011c0 .204-.041.398-.114.574l.462.191a2.01 2.01 0 0 1-1.083 1.083l-.191-.462c-.176.073-.37.114-.574.114h-1.014v.5h-2.028v-.5h-2.028v.5h-2.029v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H90.07v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H79.93v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H69.79v-.5H67.76v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H59.65v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5h-2.028v-.5H47.48v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-2.028v.5H37.34v-.5h-2.029v.5h-2.028v-.5h-2.028v.5h-2.028v-.5h-1.014c-.204 0-.398-.041-.574-.114l-.191.462Z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#36AA6C",d:"M114.756 28.708H55.244c-1.427 0-2.584 1.512-2.584 3.377v49.491c0 1.866 1.157 3.378 2.584 3.378h59.512c1.427 0 2.584-1.512 2.584-3.378v-49.49c0-1.866-1.157-3.378-2.584-3.378Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M98.8 37.185a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM104.076 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M109.351 37.185a1.417 1.417 0 1 0 0-2.834 1.417 1.417 0 0 0 0 2.834Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 18.367H43.32c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H10.803c-.193 0-.41-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.13-.808.317-1.06.186-.254.402-.36.595-.36Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M26.192 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM31.468 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M36.743 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 18.367h32.517c.192 0 .409.105.595.358s.316.627.316 1.061v28.126c0 .434-.13.808-.316 1.06-.186.254-.403.36-.595.36H126.63c-.193 0-.409-.106-.595-.36-.186-.252-.317-.626-.317-1.06V19.786c0-.434.131-.808.317-1.06.186-.254.402-.36.595-.36Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M142.019 26.344a1.416 1.416 0 1 0 0-2.832 1.416 1.416 0 0 0 0 2.832ZM147.294 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M152.569 26.344a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M10.804 63.694H43.32c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H10.803c-.193 0-.41-.106-.595-.359-.186-.253-.317-.626-.317-1.06V65.113c0-.435.13-.808.317-1.061.186-.253.402-.358.595-.358Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M27.192 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833ZM32.468 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M37.743 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#3C3E3F",stroke:"#4B4E4F",strokeMiterlimit:10,d:"M126.63 63.694h32.517c.192 0 .409.106.595.359s.316.626.316 1.061v28.125c0 .435-.13.808-.316 1.061-.186.254-.403.359-.595.359H126.63c-.193 0-.409-.106-.595-.359s-.317-.626-.317-1.06V65.113c0-.435.131-.808.317-1.061.186-.253.402-.358.595-.358Z"}),s.jsx("path",{fill:"#fff",fillOpacity:.3,d:"M143.019 71.672a1.416 1.416 0 1 0 0-2.833 1.416 1.416 0 0 0 0 2.833ZM148.294 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#F0F6FE",d:"M153.569 71.672a1.417 1.417 0 1 0 0-2.833 1.417 1.417 0 0 0 0 2.833Z"}),s.jsx("path",{fill:"#fff",d:"M49.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),s.jsx("path",{fill:"#fff",d:"M44.318 40.488h5.836a.486.486 0 1 0 0-.973h-5.836a.486.486 0 1 0 0 .973Z"}),s.jsx("path",{fill:"#fff",d:"M44.482 40.488h-5.836a.486.486 0 1 1 0-.973h5.836a.486.486 0 1 1 0 .973ZM60.597 40.004l-3.255-3.255a.486.486 0 1 1 .688-.688l3.6 3.6c.19.19.19.497 0 .687l-3.594 3.593a.486.486 0 1 1-.688-.688l3.25-3.249Z"}),s.jsx("path",{fill:"#3BB272",d:"M32.147 36.709a3.375 3.375 0 1 1 0 6.75 3.375 3.375 0 0 1 0-6.75Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 65.808v-5.836a.487.487 0 0 0-.973 0v5.836a.486.486 0 1 0 .973 0Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 70.808v-5.836a.487.487 0 0 0-.973 0v5.837a.486.486 0 1 0 .973 0Z"}),s.jsx("path",{fill:"#fff",d:"M134.062 70.644v5.836a.487.487 0 0 1-.973 0v-5.836a.486.486 0 1 1 .973 0ZM133.578 54.529l-3.255 3.255a.487.487 0 0 1-.688-.688l3.599-3.599c.19-.19.498-.19.688 0l3.593 3.593a.486.486 0 1 1-.688.688l-3.249-3.249Z"}),s.jsx("path",{fill:"#AAB0B0",d:"M130.282 82.98a3.376 3.376 0 1 1 6.752 0 3.376 3.376 0 0 1-6.752 0Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),pb=t=>s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...t,children:[s.jsxs("g",{clipPath:"url(#a)",children:[s.jsxs("g",{clipPath:"url(#b)",children:[s.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),s.jsx("mask",{id:"d",fill:"#fff",children:s.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),s.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),s.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),s.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),s.jsx("path",{fill:"#DE2122",d:"M79.593 28.399c2.403-4.163 8.411-4.163 10.814 0l29.741 51.512c2.403 4.162-.601 9.366-5.407 9.366H55.259c-4.806 0-7.81-5.204-5.407-9.366l29.74-51.512Z"}),s.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M81.84 42.528h6.321a1 1 0 0 1 .994 1.113l-2.691 23.67a1 1 0 0 1-.994.887h-1.033a1 1 0 0 1-.994-.89l-2.596-23.671a1 1 0 0 1 .994-1.11Zm3.128 30.366a3.547 3.547 0 1 0 0 7.093 3.547 3.547 0 0 0 0-7.093Z",clipRule:"evenodd"}),s.jsx("path",{fill:"#5A5C5C",d:"M115.69 27.082 132.459.185l17.514-.151-25.545 24.389 17.858 23.176-25.076 13.678L131.267 47.6 115.69 27.082Z"})]}),s.jsxs("defs",{children:[s.jsx("clipPath",{id:"a",children:s.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),s.jsx("clipPath",{id:"b",children:s.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),s.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[s.jsx("stop",{stopColor:"#313131"}),s.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),hb={edgeNotificationsPermissionTimeout:15e3},Qe={WINDOW_MANAGEMENT:Tn.WINDOW_MANAGEMENT,NOTIFICATIONS:Tn.NOTIFICATIONS,POPUPS:"popups",PWA_INSTALL:"pwa-install"},mb={name:Qe.WINDOW_MANAGEMENT,label:`Allow window management${$i?"":" (not available in your browser)"}`,heading:"Allow Window Management",description:`By granting this permission you will be able to load layouts containing multiple
49
49
  windows and share context data between opened windows.`,instructions:{initial:"Click “Allow” when the browser prompt appears.",additional:`It seems that you closed the permission prompt.
50
50
  Click the "Open permissions prompt" button again and grant the Window Management
51
51
  permission to allow the platform to function properly.`},Image:fb,actionBtnText:"Open permission prompt"},gb={name:Qe.NOTIFICATIONS,label:"Allow browser notifications",heading:"Allow Browser Notifications",description:`By granting this permission you will be able to receive platform notifications in the notification center of your
@@ -54,8 +54,8 @@ PERFORMANCE OF THIS SOFTWARE.
54
54
  in the address bar and allow notifications for this site.`},Image:lb,actionBtnText:"Open permission prompt"},vb={name:Qe.POPUPS,label:"Allow pop-ups",heading:"Allow Pop-ups",description:"By granting this permission you will be able to eject apps from Workspaces and save them as part of a Layout.",instructions:{initial:`Click the "Test Pop-Up Settings" button. It should open two pop-ups in order to test the
55
55
  browser pop-up settings.`,additional:`It seems that pop-ups are disabled in your browser.
56
56
  To allow pop-ups, go to your browser settings or click the "Pop-up blocked" icon
57
- in the address bar and allow pop-ups for this site.`},Image:ub,actionBtnText:"Test pop-up settings"},yb={name:Qe.PWA_INSTALL,label:"Install as a PWA",heading:"Install as a PWA (optional)",description:"By installing the platform as a Progressive Web App you will get a similar experience as with native desktop apps.",instructions:{initial:"If your browser supports Progressive Web Apps, you can now install the platform as a PWA."},Image:db,actionBtnText:"Continue to the platform"},Kr=[mb,gb,vb,yb],Wr={isCompleted:!1,state:"prompt"},wb={[Qe.WINDOW_MANAGEMENT]:Wr,[Qe.NOTIFICATIONS]:Wr,[Qe.POPUPS]:Wr,[Qe.PWA_INSTALL]:Wr},bb=({isOpen:t,onClose:n})=>{var a;const{launchpadComponents:e,launchpadSettings:o}=kh(),{permission:r}=Rn(),i=(a=r.statuses[Qe.WINDOW_MANAGEMENT])==null?void 0:a.state;return s.jsx(xh,{components:e,isOpen:t,onClose:n,settings:o,windowManagementPermissionState:i})};const Eh=g.forwardRef((t,n)=>{const{className:e,isOpen:o,onClose:r,Panel:i,pinned:a=!1,position:c="left"}=t;return o&&!i&&console.error('Invalid use of PanelWrapper component. Please provide Panel component when "isOpen" is "true".'),s.jsx("div",{className:ot(e,"panel-wrapper",c,{open:o,pinned:a}),ref:n,children:i&&s.jsx(i,{isOpen:o,onClose:r})})}),rc=t=>{const{Button:n,Panel:e,panelWrapperClassName:o,pinned:r=!1,position:i="left",tag:a="div",onClose:c}=t,[l,u]=g.useState(!1),f=g.useRef(null),d=g.useCallback(async()=>{u(!1),await(c==null?void 0:c())},[c]),p=()=>{if(l){d();return}u(!0)},h=!l||r;return Xs({eventType:"mouseup",handler:d,ref:f,skip:h}),Js({handler:d,skip:h}),s.jsxs(a,{ref:f,children:[s.jsx(n,{active:l,onClick:p}),s.jsx(Eh,{className:o,isOpen:l,onClose:d,Panel:e,pinned:r,position:i})]})};const jh=({Button:t=Nw})=>{const{isLaunchpadPinned:n}=so();return s.jsx(rc,{Button:t,Panel:bb,panelWrapperClassName:"launchpad-panel-wrapper",pinned:n})};var ds=function(t,n){return ds=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])},ds(t,n)};function xb(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");ds(t,n);function e(){this.constructor=t}t.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}var yt=function(){return yt=Object.assign||function(n){for(var e,o=1,r=arguments.length;o<r;o++){e=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},yt.apply(this,arguments)};function Cb(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]]);return e}function ho(t,n,e,o){function r(i){return i instanceof e?i:new e(function(a){a(i)})}return new(e||(e=Promise))(function(i,a){function c(f){try{u(o.next(f))}catch(d){a(d)}}function l(f){try{u(o.throw(f))}catch(d){a(d)}}function u(f){f.done?i(f.value):r(f.value).then(c,l)}u((o=o.apply(t,n||[])).next())})}function mo(t,n){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(u){return function(f){return l([u,f])}}function l(u){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(e=0)),e;)try{if(o=1,r&&(i=u[0]&2?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,r=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1],i=u;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(u);break}i[2]&&e.ops.pop(),e.trys.pop();continue}u=n.call(t,e)}catch(f){u=[6,f],r=0}finally{o=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function kb(t,n,e){if(e||arguments.length===2)for(var o=0,r=n.length,i;o<r;o++)(i||!(o in n))&&(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))}function tn(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]])}return e}var Yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ic(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ac(t,n){return t(n={exports:{}},n.exports),n.exports}var zn=ac(function(t,n){Object.defineProperty(n,"__esModule",{value:!0});var e=function(){function o(){var r=this;this.locked=new Map,this.addToLocked=function(i,a){var c=r.locked.get(i);c===void 0?a===void 0?r.locked.set(i,[]):r.locked.set(i,[a]):a!==void 0&&(c.unshift(a),r.locked.set(i,c))},this.isLocked=function(i){return r.locked.has(i)},this.lock=function(i){return new Promise(function(a,c){r.isLocked(i)?r.addToLocked(i,a):(r.addToLocked(i),a())})},this.unlock=function(i){var a=r.locked.get(i);if(a!==void 0&&a.length!==0){var c=a.pop();r.locked.set(i,a),c!==void 0&&setTimeout(c,0)}else r.locked.delete(i)}}return o.getInstance=function(){return o.instance===void 0&&(o.instance=new o),o.instance},o}();n.default=function(){return e.getInstance()}});ic(zn);var Sb=ic(ac(function(t,n){var e=Yn&&Yn.__awaiter||function(f,d,p,h){return new(p||(p=Promise))(function(m,v){function y(b){try{S(h.next(b))}catch(w){v(w)}}function k(b){try{S(h.throw(b))}catch(w){v(w)}}function S(b){b.done?m(b.value):new p(function(w){w(b.value)}).then(y,k)}S((h=h.apply(f,d||[])).next())})},o=Yn&&Yn.__generator||function(f,d){var p,h,m,v,y={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return v={next:k(0),throw:k(1),return:k(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function k(S){return function(b){return function(w){if(p)throw new TypeError("Generator is already executing.");for(;y;)try{if(p=1,h&&(m=2&w[0]?h.return:w[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,w[1])).done)return m;switch(h=0,m&&(w=[2&w[0],m.value]),w[0]){case 0:case 1:m=w;break;case 4:return y.label++,{value:w[1],done:!1};case 5:y.label++,h=w[1],w=[0];continue;case 7:w=y.ops.pop(),y.trys.pop();continue;default:if(m=y.trys,!((m=m.length>0&&m[m.length-1])||w[0]!==6&&w[0]!==2)){y=0;continue}if(w[0]===3&&(!m||w[1]>m[0]&&w[1]<m[3])){y.label=w[1];break}if(w[0]===6&&y.label<m[1]){y.label=m[1],m=w;break}if(m&&y.label<m[2]){y.label=m[2],y.ops.push(w);break}m[2]&&y.ops.pop(),y.trys.pop();continue}w=d.call(f,y)}catch(E){w=[6,E],h=0}finally{p=m=0}if(5&w[0])throw w[1];return{value:w[0]?w[1]:void 0,done:!0}}([S,b])}}},r=Yn;Object.defineProperty(n,"__esModule",{value:!0});var i="browser-tabs-lock-key",a={key:function(f){return e(r,void 0,void 0,function(){return o(this,function(d){throw new Error("Unsupported")})})},getItem:function(f){return e(r,void 0,void 0,function(){return o(this,function(d){throw new Error("Unsupported")})})},clear:function(){return e(r,void 0,void 0,function(){return o(this,function(f){return[2,window.localStorage.clear()]})})},removeItem:function(f){return e(r,void 0,void 0,function(){return o(this,function(d){throw new Error("Unsupported")})})},setItem:function(f,d){return e(r,void 0,void 0,function(){return o(this,function(p){throw new Error("Unsupported")})})},keySync:function(f){return window.localStorage.key(f)},getItemSync:function(f){return window.localStorage.getItem(f)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(f){return window.localStorage.removeItem(f)},setItemSync:function(f,d){return window.localStorage.setItem(f,d)}};function c(f){return new Promise(function(d){return setTimeout(d,f)})}function l(f){for(var d="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",p="",h=0;h<f;h++)p+=d[Math.floor(Math.random()*d.length)];return p}var u=function(){function f(d){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=d,f.waiters===void 0&&(f.waiters=[])}return f.prototype.acquireLock=function(d,p){return p===void 0&&(p=5e3),e(this,void 0,void 0,function(){var h,m,v,y,k,S,b;return o(this,function(w){switch(w.label){case 0:h=Date.now()+l(4),m=Date.now()+p,v=i+"-"+d,y=this.storageHandler===void 0?a:this.storageHandler,w.label=1;case 1:return Date.now()<m?[4,c(30)]:[3,8];case 2:return w.sent(),y.getItemSync(v)!==null?[3,5]:(k=this.id+"-"+d+"-"+h,[4,c(Math.floor(25*Math.random()))]);case 3:return w.sent(),y.setItemSync(v,JSON.stringify({id:this.id,iat:h,timeoutKey:k,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,c(30)];case 4:return w.sent(),(S=y.getItemSync(v))!==null&&(b=JSON.parse(S)).id===this.id&&b.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(v,h),[2,!0]):[3,7];case 5:return f.lockCorrector(this.storageHandler===void 0?a:this.storageHandler),[4,this.waitForSomethingToChange(m)];case 6:w.sent(),w.label=7;case 7:return h=Date.now()+l(4),[3,1];case 8:return[2,!1]}})})},f.prototype.refreshLockWhileAcquired=function(d,p){return e(this,void 0,void 0,function(){var h=this;return o(this,function(m){return setTimeout(function(){return e(h,void 0,void 0,function(){var v,y,k;return o(this,function(S){switch(S.label){case 0:return[4,zn.default().lock(p)];case 1:return S.sent(),this.acquiredIatSet.has(p)?(v=this.storageHandler===void 0?a:this.storageHandler,(y=v.getItemSync(d))===null?(zn.default().unlock(p),[2]):((k=JSON.parse(y)).timeRefreshed=Date.now(),v.setItemSync(d,JSON.stringify(k)),zn.default().unlock(p),this.refreshLockWhileAcquired(d,p),[2])):(zn.default().unlock(p),[2])}})})},1e3),[2]})})},f.prototype.waitForSomethingToChange=function(d){return e(this,void 0,void 0,function(){return o(this,function(p){switch(p.label){case 0:return[4,new Promise(function(h){var m=!1,v=Date.now(),y=!1;function k(){if(y||(window.removeEventListener("storage",k),f.removeFromWaiting(k),clearTimeout(S),y=!0),!m){m=!0;var b=50-(Date.now()-v);b>0?setTimeout(h,b):h(null)}}window.addEventListener("storage",k),f.addToWaiting(k);var S=setTimeout(k,Math.max(0,d-Date.now()))})];case 1:return p.sent(),[2]}})})},f.addToWaiting=function(d){this.removeFromWaiting(d),f.waiters!==void 0&&f.waiters.push(d)},f.removeFromWaiting=function(d){f.waiters!==void 0&&(f.waiters=f.waiters.filter(function(p){return p!==d}))},f.notifyWaiters=function(){f.waiters!==void 0&&f.waiters.slice().forEach(function(d){return d()})},f.prototype.releaseLock=function(d){return e(this,void 0,void 0,function(){return o(this,function(p){switch(p.label){case 0:return[4,this.releaseLock__private__(d)];case 1:return[2,p.sent()]}})})},f.prototype.releaseLock__private__=function(d){return e(this,void 0,void 0,function(){var p,h,m,v;return o(this,function(y){switch(y.label){case 0:return p=this.storageHandler===void 0?a:this.storageHandler,h=i+"-"+d,(m=p.getItemSync(h))===null?[2]:(v=JSON.parse(m)).id!==this.id?[3,2]:[4,zn.default().lock(v.iat)];case 1:y.sent(),this.acquiredIatSet.delete(v.iat),p.removeItemSync(h),zn.default().unlock(v.iat),f.notifyWaiters(),y.label=2;case 2:return[2]}})})},f.lockCorrector=function(d){for(var p=Date.now()-5e3,h=d,m=[],v=0;;){var y=h.keySync(v);if(y===null)break;m.push(y),v++}for(var k=!1,S=0;S<m.length;S++){var b=m[S];if(b.includes(i)){var w=h.getItemSync(b);if(w!==null){var E=JSON.parse(w);(E.timeRefreshed===void 0&&E.timeAcquired<p||E.timeRefreshed!==void 0&&E.timeRefreshed<p)&&(h.removeItemSync(b),k=!0)}}}k&&f.notifyWaiters()},f.waiters=void 0,f}();n.default=u}));const Eb={timeoutInSeconds:60},Oh={name:"auth0-spa-js",version:"2.3.0"},Nh=()=>Date.now();class St extends Error{constructor(n,e){super(e),this.error=n,this.error_description=e,Object.setPrototypeOf(this,St.prototype)}static fromPayload({error:n,error_description:e}){return new St(n,e)}}class sc extends St{constructor(n,e,o,r=null){super(n,e),this.state=o,this.appState=r,Object.setPrototypeOf(this,sc.prototype)}}class yr extends St{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,yr.prototype)}}class cc extends yr{constructor(n){super(),this.popup=n,Object.setPrototypeOf(this,cc.prototype)}}class lc extends St{constructor(n){super("cancelled","Popup closed"),this.popup=n,Object.setPrototypeOf(this,lc.prototype)}}class uc extends St{constructor(n,e,o){super(n,e),this.mfa_token=o,Object.setPrototypeOf(this,uc.prototype)}}class zi extends St{constructor(n,e){super("missing_refresh_token",`Missing Refresh Token (audience: '${Ll(n,["default"])}', scope: '${Ll(e)}')`),this.audience=n,this.scope=e,Object.setPrototypeOf(this,zi.prototype)}}function Ll(t,n=[]){return t&&!n.includes(t)?t:""}const qr=()=>window.crypto,wa=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let n="";return Array.from(qr().getRandomValues(new Uint8Array(43))).forEach(e=>n+=t[e%t.length]),n},Rl=t=>btoa(t),fs=t=>{var{clientId:n}=t,e=tn(t,["clientId"]);return new URLSearchParams((o=>Object.keys(o).filter(r=>o[r]!==void 0).reduce((r,i)=>Object.assign(Object.assign({},r),{[i]:o[i]}),{}))(Object.assign({client_id:n},e))).toString()},Fl=t=>(n=>decodeURIComponent(atob(n).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),jb=async(t,n)=>{const e=await fetch(t,n);return{ok:e.ok,json:await e.json()}},Ob=async(t,n,e)=>{const o=new AbortController;let r;return n.signal=o.signal,Promise.race([jb(t,n),new Promise((i,a)=>{r=setTimeout(()=>{o.abort(),a(new Error("Timeout when executing 'fetch'"))},e)})]).finally(()=>{clearTimeout(r)})},Nb=async(t,n,e,o,r,i,a)=>{return c={auth:{audience:n,scope:e},timeout:r,fetchUrl:t,fetchOptions:o,useFormData:a},l=i,new Promise(function(u,f){const d=new MessageChannel;d.port1.onmessage=function(p){p.data.error?f(new Error(p.data.error)):u(p.data),d.port1.close()},l.postMessage(c,[d.port2])});var c,l},Ib=async(t,n,e,o,r,i,a=1e4)=>r?Nb(t,n,e,o,a,r,i):Ob(t,o,a);async function Pb(t,n){var{baseUrl:e,timeout:o,audience:r,scope:i,auth0Client:a,useFormData:c}=t,l=tn(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const u=l.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",f=Object.assign(Object.assign(Object.assign({},l),u&&r&&{audience:r}),u&&i&&{scope:i}),d=c?fs(f):JSON.stringify(f);return await async function(p,h,m,v,y,k,S){let b,w=null;for(let K=0;K<3;K++)try{b=await Ib(p,m,v,y,k,S,h),w=null;break}catch(_){w=_}if(w)throw w;const E=b.json,{error:O,error_description:F}=E,R=tn(E,["error","error_description"]),{ok:U}=b;if(!U){const K=F||`HTTP error. Unable to fetch ${p}`;throw O==="mfa_required"?new uc(O,K,R.mfa_token):O==="missing_refresh_token"?new zi(m,v):new St(O||"request_error",K)}return R}(`${e}/oauth/token`,o,r||"default",i,{method:"POST",body:d,headers:{"Content-Type":c?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(a||Oh))}},n,c)}const qo=(...t)=>{return(n=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(n))).join(" ");var n};class nn{constructor(n,e="@@auth0spajs@@",o){this.prefix=e,this.suffix=o,this.clientId=n.clientId,this.scope=n.scope,this.audience=n.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(n){const[e,o,r,i]=n.split("::");return new nn({clientId:o,scope:i,audience:r},e)}static fromCacheEntry(n){const{scope:e,audience:o,client_id:r}=n;return new nn({scope:e,audience:o,clientId:r})}}class Ab{set(n,e){localStorage.setItem(n,JSON.stringify(e))}get(n){const e=window.localStorage.getItem(n);if(e)try{return JSON.parse(e)}catch{return}}remove(n){localStorage.removeItem(n)}allKeys(){return Object.keys(window.localStorage).filter(n=>n.startsWith("@@auth0spajs@@"))}}class Ih{constructor(){this.enclosedCache=function(){let n={};return{set(e,o){n[e]=o},get(e){const o=n[e];if(o)return o},remove(e){delete n[e]},allKeys:()=>Object.keys(n)}}()}}class Tb{constructor(n,e,o){this.cache=n,this.keyManifest=e,this.nowProvider=o||Nh}async setIdToken(n,e,o){var r;const i=this.getIdTokenCacheKey(n);await this.cache.set(i,{id_token:e,decodedToken:o}),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(i))}async getIdToken(n){const e=await this.cache.get(this.getIdTokenCacheKey(n.clientId));if(!e&&n.scope&&n.audience){const o=await this.get(n);return!o||!o.id_token||!o.decodedToken?void 0:{id_token:o.id_token,decodedToken:o.decodedToken}}if(e)return{id_token:e.id_token,decodedToken:e.decodedToken}}async get(n,e=0){var o;let r=await this.cache.get(n.toKey());if(!r){const c=await this.getCacheKeys();if(!c)return;const l=this.matchExistingCacheKey(n,c);l&&(r=await this.cache.get(l))}if(!r)return;const i=await this.nowProvider(),a=Math.floor(i/1e3);return r.expiresAt-e<a?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},await this.cache.set(n.toKey(),r),r.body):(await this.cache.remove(n.toKey()),void await((o=this.keyManifest)===null||o===void 0?void 0:o.remove(n.toKey()))):r.body}async set(n){var e;const o=new nn({clientId:n.client_id,scope:n.scope,audience:n.audience}),r=await this.wrapCacheEntry(n);await this.cache.set(o.toKey(),r),await((e=this.keyManifest)===null||e===void 0?void 0:e.add(o.toKey()))}async clear(n){var e;const o=await this.getCacheKeys();o&&(await o.filter(r=>!n||r.includes(n)).reduce(async(r,i)=>{await r,await this.cache.remove(i)},Promise.resolve()),await((e=this.keyManifest)===null||e===void 0?void 0:e.clear()))}async wrapCacheEntry(n){const e=await this.nowProvider();return{body:n,expiresAt:Math.floor(e/1e3)+n.expires_in}}async getCacheKeys(){var n;return this.keyManifest?(n=await this.keyManifest.get())===null||n===void 0?void 0:n.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(n){return new nn({clientId:n},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(n,e){return e.filter(o=>{var r;const i=nn.fromKey(o),a=new Set(i.scope&&i.scope.split(" ")),c=((r=n.scope)===null||r===void 0?void 0:r.split(" "))||[],l=i.scope&&c.reduce((u,f)=>u&&a.has(f),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===n.clientId&&i.audience===n.audience&&l})[0]}}class Db{constructor(n,e,o){this.storage=n,this.clientId=e,this.cookieDomain=o,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(n){this.storage.save(this.storageKey,n,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Jo=t=>typeof t=="number",Mb=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],_b=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const n=(i=>{const a=i.split("."),[c,l,u]=a;if(a.length!==3||!c||!l||!u)throw new Error("ID token could not be decoded");const f=JSON.parse(Fl(l)),d={__raw:i},p={};return Object.keys(f).forEach(h=>{d[h]=f[h],Mb.includes(h)||(p[h]=f[h])}),{encoded:{header:c,payload:l,signature:u},header:JSON.parse(Fl(c)),claims:d,user:p}})(t.id_token);if(!n.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(n.claims.iss!==t.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${t.iss}", found "${n.claims.iss}"`);if(!n.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(n.header.alg!=="RS256")throw new Error(`Signature algorithm of "${n.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!n.claims.aud||typeof n.claims.aud!="string"&&!Array.isArray(n.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(n.claims.aud)){if(!n.claims.aud.includes(t.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but was not one of "${n.claims.aud.join(", ")}"`);if(n.claims.aud.length>1){if(!n.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(n.claims.azp!==t.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${t.aud}", found "${n.claims.azp}"`)}}else if(n.claims.aud!==t.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but found "${n.claims.aud}"`);if(t.nonce){if(!n.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(n.claims.nonce!==t.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${n.claims.nonce}"`)}if(t.max_age&&!Jo(n.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(n.claims.exp==null||!Jo(n.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Jo(n.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const e=t.leeway||60,o=new Date(t.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(n.claims.exp+e),o>r)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${o}) is after expiration time (${r})`);if(n.claims.nbf!=null&&Jo(n.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(n.claims.nbf-e),o<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${o}) is before ${i}`)}if(n.claims.auth_time!=null&&Jo(n.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(n.claims.auth_time)+t.max_age+e),o>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${o}) is after last auth at ${i}`)}if(t.organization){const i=t.organization.trim();if(i.startsWith("org_")){const a=i;if(!n.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(a!==n.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${a}", found "${n.claims.org_id}"`)}else{const a=i.toLowerCase();if(!n.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(a!==n.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${a}", found "${n.claims.org_name}"`)}}return n};var qn=ac(function(t,n){var e=Yn&&Yn.__assign||function(){return e=Object.assign||function(l){for(var u,f=1,d=arguments.length;f<d;f++)for(var p in u=arguments[f])Object.prototype.hasOwnProperty.call(u,p)&&(l[p]=u[p]);return l},e.apply(this,arguments)};function o(l,u){if(!u)return"";var f="; "+l;return u===!0?f:f+"="+u}function r(l,u,f){return encodeURIComponent(l).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(u).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(d){if(typeof d.expires=="number"){var p=new Date;p.setMilliseconds(p.getMilliseconds()+864e5*d.expires),d.expires=p}return o("Expires",d.expires?d.expires.toUTCString():"")+o("Domain",d.domain)+o("Path",d.path)+o("Secure",d.secure)+o("SameSite",d.sameSite)}(f)}function i(l){for(var u={},f=l?l.split("; "):[],d=/(%[\dA-F]{2})+/gi,p=0;p<f.length;p++){var h=f[p].split("="),m=h.slice(1).join("=");m.charAt(0)==='"'&&(m=m.slice(1,-1));try{u[h[0].replace(d,decodeURIComponent)]=m.replace(d,decodeURIComponent)}catch{}}return u}function a(){return i(document.cookie)}function c(l,u,f){document.cookie=r(l,u,e({path:"/"},f))}n.__esModule=!0,n.encode=r,n.parse=i,n.getAll=a,n.get=function(l){return a()[l]},n.set=c,n.remove=function(l,u){c(l,"",e(e({},u),{expires:-1}))}});ic(qn),qn.encode,qn.parse,qn.getAll;var Lb=qn.get,Ph=qn.set,Ah=qn.remove;const yo={get(t){const n=Lb(t);if(n!==void 0)return JSON.parse(n)},save(t,n,e){let o={};window.location.protocol==="https:"&&(o={secure:!0,sameSite:"none"}),e!=null&&e.daysUntilExpire&&(o.expires=e.daysUntilExpire),e!=null&&e.cookieDomain&&(o.domain=e.cookieDomain),Ph(t,JSON.stringify(n),o)},remove(t,n){let e={};n!=null&&n.cookieDomain&&(e.domain=n.cookieDomain),Ah(t,e)}},Rb={get(t){return yo.get(t)||yo.get(`_legacy_${t}`)},save(t,n,e){let o={};window.location.protocol==="https:"&&(o={secure:!0}),e!=null&&e.daysUntilExpire&&(o.expires=e.daysUntilExpire),e!=null&&e.cookieDomain&&(o.domain=e.cookieDomain),Ph(`_legacy_${t}`,JSON.stringify(n),o),yo.save(t,n,e)},remove(t,n){let e={};n!=null&&n.cookieDomain&&(e.domain=n.cookieDomain),Ah(t,e),yo.remove(t,n),yo.remove(`_legacy_${t}`,n)}},Fb={get(t){if(typeof sessionStorage>"u")return;const n=sessionStorage.getItem(t);return n!=null?JSON.parse(n):void 0},save(t,n){sessionStorage.setItem(t,JSON.stringify(n))},remove(t){sessionStorage.removeItem(t)}};function Bb(t,n,e){var o=n===void 0?null:n,r=function(l,u){var f=atob(l);if(u){for(var d=new Uint8Array(f.length),p=0,h=f.length;p<h;++p)d[p]=f.charCodeAt(p);return String.fromCharCode.apply(null,new Uint16Array(d.buffer))}return f}(t,e!==void 0&&e),i=r.indexOf(`
57
+ in the address bar and allow pop-ups for this site.`},Image:ub,actionBtnText:"Test pop-up settings"},yb={name:Qe.PWA_INSTALL,label:"Install as a PWA",heading:"Install as a PWA (optional)",description:"By installing the platform as a Progressive Web App you will get a similar experience as with native desktop apps.",instructions:{initial:"If your browser supports Progressive Web Apps, you can now install the platform as a PWA."},Image:db,actionBtnText:"Continue to the platform"},Kr=[mb,gb,vb,yb],Wr={isCompleted:!1,state:"prompt"},wb={[Qe.WINDOW_MANAGEMENT]:Wr,[Qe.NOTIFICATIONS]:Wr,[Qe.POPUPS]:Wr,[Qe.PWA_INSTALL]:Wr},bb=({isOpen:t,onClose:n})=>{var a;const{launchpadComponents:e,launchpadSettings:o}=kh(),{permission:r}=Rn(),i=(a=r.statuses[Qe.WINDOW_MANAGEMENT])==null?void 0:a.state;return s.jsx(xh,{components:e,isOpen:t,onClose:n,settings:o,windowManagementPermissionState:i})};const Eh=g.forwardRef((t,n)=>{const{className:e,isOpen:o,onClose:r,Panel:i,pinned:a=!1,position:c="left"}=t;return o&&!i&&console.error('Invalid use of PanelWrapper component. Please provide Panel component when "isOpen" is "true".'),s.jsx("div",{className:et(e,"panel-wrapper",c,{open:o,pinned:a}),ref:n,children:i&&s.jsx(i,{isOpen:o,onClose:r})})}),rc=t=>{const{Button:n,Panel:e,panelWrapperClassName:o,pinned:r=!1,position:i="left",tag:a="div",onClose:c}=t,[l,u]=g.useState(!1),f=g.useRef(null),d=g.useCallback(async()=>{u(!1),await(c==null?void 0:c())},[c]),p=()=>{if(l){d();return}u(!0)},h=!l||r;return Xs({eventType:"mouseup",handler:d,ref:f,skip:h}),Js({handler:d,skip:h}),s.jsxs(a,{ref:f,children:[s.jsx(n,{active:l,onClick:p}),s.jsx(Eh,{className:o,isOpen:l,onClose:d,Panel:e,pinned:r,position:i})]})};const jh=({Button:t=Nw})=>{const{isLaunchpadPinned:n}=so();return s.jsx(rc,{Button:t,Panel:bb,panelWrapperClassName:"launchpad-panel-wrapper",pinned:n})};var ds=function(t,n){return ds=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])},ds(t,n)};function xb(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");ds(t,n);function e(){this.constructor=t}t.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}var yt=function(){return yt=Object.assign||function(n){for(var e,o=1,r=arguments.length;o<r;o++){e=arguments[o];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}return n},yt.apply(this,arguments)};function Cb(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]]);return e}function ho(t,n,e,o){function r(i){return i instanceof e?i:new e(function(a){a(i)})}return new(e||(e=Promise))(function(i,a){function c(f){try{u(o.next(f))}catch(d){a(d)}}function l(f){try{u(o.throw(f))}catch(d){a(d)}}function u(f){f.done?i(f.value):r(f.value).then(c,l)}u((o=o.apply(t,n||[])).next())})}function mo(t,n){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},o,r,i,a=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return a.next=c(0),a.throw=c(1),a.return=c(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function c(u){return function(f){return l([u,f])}}function l(u){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(e=0)),e;)try{if(o=1,r&&(i=u[0]&2?r.return:u[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,u[1])).done)return i;switch(r=0,i&&(u=[u[0]&2,i.value]),u[0]){case 0:case 1:i=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,r=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(i=e.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1],i=u;break}if(i&&e.label<i[2]){e.label=i[2],e.ops.push(u);break}i[2]&&e.ops.pop(),e.trys.pop();continue}u=n.call(t,e)}catch(f){u=[6,f],r=0}finally{o=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function kb(t,n,e){if(e||arguments.length===2)for(var o=0,r=n.length,i;o<r;o++)(i||!(o in n))&&(i||(i=Array.prototype.slice.call(n,0,o)),i[o]=n[o]);return t.concat(i||Array.prototype.slice.call(n))}function tn(t,n){var e={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&n.indexOf(o)<0&&(e[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)n.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(e[o[r]]=t[o[r]])}return e}var Yn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ic(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ac(t,n){return t(n={exports:{}},n.exports),n.exports}var zn=ac(function(t,n){Object.defineProperty(n,"__esModule",{value:!0});var e=function(){function o(){var r=this;this.locked=new Map,this.addToLocked=function(i,a){var c=r.locked.get(i);c===void 0?a===void 0?r.locked.set(i,[]):r.locked.set(i,[a]):a!==void 0&&(c.unshift(a),r.locked.set(i,c))},this.isLocked=function(i){return r.locked.has(i)},this.lock=function(i){return new Promise(function(a,c){r.isLocked(i)?r.addToLocked(i,a):(r.addToLocked(i),a())})},this.unlock=function(i){var a=r.locked.get(i);if(a!==void 0&&a.length!==0){var c=a.pop();r.locked.set(i,a),c!==void 0&&setTimeout(c,0)}else r.locked.delete(i)}}return o.getInstance=function(){return o.instance===void 0&&(o.instance=new o),o.instance},o}();n.default=function(){return e.getInstance()}});ic(zn);var Sb=ic(ac(function(t,n){var e=Yn&&Yn.__awaiter||function(f,d,p,h){return new(p||(p=Promise))(function(m,v){function y(b){try{S(h.next(b))}catch(w){v(w)}}function k(b){try{S(h.throw(b))}catch(w){v(w)}}function S(b){b.done?m(b.value):new p(function(w){w(b.value)}).then(y,k)}S((h=h.apply(f,d||[])).next())})},o=Yn&&Yn.__generator||function(f,d){var p,h,m,v,y={label:0,sent:function(){if(1&m[0])throw m[1];return m[1]},trys:[],ops:[]};return v={next:k(0),throw:k(1),return:k(2)},typeof Symbol=="function"&&(v[Symbol.iterator]=function(){return this}),v;function k(S){return function(b){return function(w){if(p)throw new TypeError("Generator is already executing.");for(;y;)try{if(p=1,h&&(m=2&w[0]?h.return:w[0]?h.throw||((m=h.return)&&m.call(h),0):h.next)&&!(m=m.call(h,w[1])).done)return m;switch(h=0,m&&(w=[2&w[0],m.value]),w[0]){case 0:case 1:m=w;break;case 4:return y.label++,{value:w[1],done:!1};case 5:y.label++,h=w[1],w=[0];continue;case 7:w=y.ops.pop(),y.trys.pop();continue;default:if(m=y.trys,!((m=m.length>0&&m[m.length-1])||w[0]!==6&&w[0]!==2)){y=0;continue}if(w[0]===3&&(!m||w[1]>m[0]&&w[1]<m[3])){y.label=w[1];break}if(w[0]===6&&y.label<m[1]){y.label=m[1],m=w;break}if(m&&y.label<m[2]){y.label=m[2],y.ops.push(w);break}m[2]&&y.ops.pop(),y.trys.pop();continue}w=d.call(f,y)}catch(E){w=[6,E],h=0}finally{p=m=0}if(5&w[0])throw w[1];return{value:w[0]?w[1]:void 0,done:!0}}([S,b])}}},r=Yn;Object.defineProperty(n,"__esModule",{value:!0});var i="browser-tabs-lock-key",a={key:function(f){return e(r,void 0,void 0,function(){return o(this,function(d){throw new Error("Unsupported")})})},getItem:function(f){return e(r,void 0,void 0,function(){return o(this,function(d){throw new Error("Unsupported")})})},clear:function(){return e(r,void 0,void 0,function(){return o(this,function(f){return[2,window.localStorage.clear()]})})},removeItem:function(f){return e(r,void 0,void 0,function(){return o(this,function(d){throw new Error("Unsupported")})})},setItem:function(f,d){return e(r,void 0,void 0,function(){return o(this,function(p){throw new Error("Unsupported")})})},keySync:function(f){return window.localStorage.key(f)},getItemSync:function(f){return window.localStorage.getItem(f)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(f){return window.localStorage.removeItem(f)},setItemSync:function(f,d){return window.localStorage.setItem(f,d)}};function c(f){return new Promise(function(d){return setTimeout(d,f)})}function l(f){for(var d="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",p="",h=0;h<f;h++)p+=d[Math.floor(Math.random()*d.length)];return p}var u=function(){function f(d){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+l(15),this.acquireLock=this.acquireLock.bind(this),this.releaseLock=this.releaseLock.bind(this),this.releaseLock__private__=this.releaseLock__private__.bind(this),this.waitForSomethingToChange=this.waitForSomethingToChange.bind(this),this.refreshLockWhileAcquired=this.refreshLockWhileAcquired.bind(this),this.storageHandler=d,f.waiters===void 0&&(f.waiters=[])}return f.prototype.acquireLock=function(d,p){return p===void 0&&(p=5e3),e(this,void 0,void 0,function(){var h,m,v,y,k,S,b;return o(this,function(w){switch(w.label){case 0:h=Date.now()+l(4),m=Date.now()+p,v=i+"-"+d,y=this.storageHandler===void 0?a:this.storageHandler,w.label=1;case 1:return Date.now()<m?[4,c(30)]:[3,8];case 2:return w.sent(),y.getItemSync(v)!==null?[3,5]:(k=this.id+"-"+d+"-"+h,[4,c(Math.floor(25*Math.random()))]);case 3:return w.sent(),y.setItemSync(v,JSON.stringify({id:this.id,iat:h,timeoutKey:k,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,c(30)];case 4:return w.sent(),(S=y.getItemSync(v))!==null&&(b=JSON.parse(S)).id===this.id&&b.iat===h?(this.acquiredIatSet.add(h),this.refreshLockWhileAcquired(v,h),[2,!0]):[3,7];case 5:return f.lockCorrector(this.storageHandler===void 0?a:this.storageHandler),[4,this.waitForSomethingToChange(m)];case 6:w.sent(),w.label=7;case 7:return h=Date.now()+l(4),[3,1];case 8:return[2,!1]}})})},f.prototype.refreshLockWhileAcquired=function(d,p){return e(this,void 0,void 0,function(){var h=this;return o(this,function(m){return setTimeout(function(){return e(h,void 0,void 0,function(){var v,y,k;return o(this,function(S){switch(S.label){case 0:return[4,zn.default().lock(p)];case 1:return S.sent(),this.acquiredIatSet.has(p)?(v=this.storageHandler===void 0?a:this.storageHandler,(y=v.getItemSync(d))===null?(zn.default().unlock(p),[2]):((k=JSON.parse(y)).timeRefreshed=Date.now(),v.setItemSync(d,JSON.stringify(k)),zn.default().unlock(p),this.refreshLockWhileAcquired(d,p),[2])):(zn.default().unlock(p),[2])}})})},1e3),[2]})})},f.prototype.waitForSomethingToChange=function(d){return e(this,void 0,void 0,function(){return o(this,function(p){switch(p.label){case 0:return[4,new Promise(function(h){var m=!1,v=Date.now(),y=!1;function k(){if(y||(window.removeEventListener("storage",k),f.removeFromWaiting(k),clearTimeout(S),y=!0),!m){m=!0;var b=50-(Date.now()-v);b>0?setTimeout(h,b):h(null)}}window.addEventListener("storage",k),f.addToWaiting(k);var S=setTimeout(k,Math.max(0,d-Date.now()))})];case 1:return p.sent(),[2]}})})},f.addToWaiting=function(d){this.removeFromWaiting(d),f.waiters!==void 0&&f.waiters.push(d)},f.removeFromWaiting=function(d){f.waiters!==void 0&&(f.waiters=f.waiters.filter(function(p){return p!==d}))},f.notifyWaiters=function(){f.waiters!==void 0&&f.waiters.slice().forEach(function(d){return d()})},f.prototype.releaseLock=function(d){return e(this,void 0,void 0,function(){return o(this,function(p){switch(p.label){case 0:return[4,this.releaseLock__private__(d)];case 1:return[2,p.sent()]}})})},f.prototype.releaseLock__private__=function(d){return e(this,void 0,void 0,function(){var p,h,m,v;return o(this,function(y){switch(y.label){case 0:return p=this.storageHandler===void 0?a:this.storageHandler,h=i+"-"+d,(m=p.getItemSync(h))===null?[2]:(v=JSON.parse(m)).id!==this.id?[3,2]:[4,zn.default().lock(v.iat)];case 1:y.sent(),this.acquiredIatSet.delete(v.iat),p.removeItemSync(h),zn.default().unlock(v.iat),f.notifyWaiters(),y.label=2;case 2:return[2]}})})},f.lockCorrector=function(d){for(var p=Date.now()-5e3,h=d,m=[],v=0;;){var y=h.keySync(v);if(y===null)break;m.push(y),v++}for(var k=!1,S=0;S<m.length;S++){var b=m[S];if(b.includes(i)){var w=h.getItemSync(b);if(w!==null){var E=JSON.parse(w);(E.timeRefreshed===void 0&&E.timeAcquired<p||E.timeRefreshed!==void 0&&E.timeRefreshed<p)&&(h.removeItemSync(b),k=!0)}}}k&&f.notifyWaiters()},f.waiters=void 0,f}();n.default=u}));const Eb={timeoutInSeconds:60},Oh={name:"auth0-spa-js",version:"2.3.0"},Nh=()=>Date.now();class St extends Error{constructor(n,e){super(e),this.error=n,this.error_description=e,Object.setPrototypeOf(this,St.prototype)}static fromPayload({error:n,error_description:e}){return new St(n,e)}}class sc extends St{constructor(n,e,o,r=null){super(n,e),this.state=o,this.appState=r,Object.setPrototypeOf(this,sc.prototype)}}class yr extends St{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,yr.prototype)}}class cc extends yr{constructor(n){super(),this.popup=n,Object.setPrototypeOf(this,cc.prototype)}}class lc extends St{constructor(n){super("cancelled","Popup closed"),this.popup=n,Object.setPrototypeOf(this,lc.prototype)}}class uc extends St{constructor(n,e,o){super(n,e),this.mfa_token=o,Object.setPrototypeOf(this,uc.prototype)}}class zi extends St{constructor(n,e){super("missing_refresh_token",`Missing Refresh Token (audience: '${Ll(n,["default"])}', scope: '${Ll(e)}')`),this.audience=n,this.scope=e,Object.setPrototypeOf(this,zi.prototype)}}function Ll(t,n=[]){return t&&!n.includes(t)?t:""}const qr=()=>window.crypto,wa=()=>{const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let n="";return Array.from(qr().getRandomValues(new Uint8Array(43))).forEach(e=>n+=t[e%t.length]),n},Rl=t=>btoa(t),fs=t=>{var{clientId:n}=t,e=tn(t,["clientId"]);return new URLSearchParams((o=>Object.keys(o).filter(r=>o[r]!==void 0).reduce((r,i)=>Object.assign(Object.assign({},r),{[i]:o[i]}),{}))(Object.assign({client_id:n},e))).toString()},Fl=t=>(n=>decodeURIComponent(atob(n).split("").map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")))(t.replace(/_/g,"/").replace(/-/g,"+")),jb=async(t,n)=>{const e=await fetch(t,n);return{ok:e.ok,json:await e.json()}},Ob=async(t,n,e)=>{const o=new AbortController;let r;return n.signal=o.signal,Promise.race([jb(t,n),new Promise((i,a)=>{r=setTimeout(()=>{o.abort(),a(new Error("Timeout when executing 'fetch'"))},e)})]).finally(()=>{clearTimeout(r)})},Nb=async(t,n,e,o,r,i,a)=>{return c={auth:{audience:n,scope:e},timeout:r,fetchUrl:t,fetchOptions:o,useFormData:a},l=i,new Promise(function(u,f){const d=new MessageChannel;d.port1.onmessage=function(p){p.data.error?f(new Error(p.data.error)):u(p.data),d.port1.close()},l.postMessage(c,[d.port2])});var c,l},Ib=async(t,n,e,o,r,i,a=1e4)=>r?Nb(t,n,e,o,a,r,i):Ob(t,o,a);async function Pb(t,n){var{baseUrl:e,timeout:o,audience:r,scope:i,auth0Client:a,useFormData:c}=t,l=tn(t,["baseUrl","timeout","audience","scope","auth0Client","useFormData"]);const u=l.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",f=Object.assign(Object.assign(Object.assign({},l),u&&r&&{audience:r}),u&&i&&{scope:i}),d=c?fs(f):JSON.stringify(f);return await async function(p,h,m,v,y,k,S){let b,w=null;for(let K=0;K<3;K++)try{b=await Ib(p,m,v,y,k,S,h),w=null;break}catch(_){w=_}if(w)throw w;const E=b.json,{error:O,error_description:F}=E,R=tn(E,["error","error_description"]),{ok:U}=b;if(!U){const K=F||`HTTP error. Unable to fetch ${p}`;throw O==="mfa_required"?new uc(O,K,R.mfa_token):O==="missing_refresh_token"?new zi(m,v):new St(O||"request_error",K)}return R}(`${e}/oauth/token`,o,r||"default",i,{method:"POST",body:d,headers:{"Content-Type":c?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(a||Oh))}},n,c)}const qo=(...t)=>{return(n=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(n))).join(" ");var n};class nn{constructor(n,e="@@auth0spajs@@",o){this.prefix=e,this.suffix=o,this.clientId=n.clientId,this.scope=n.scope,this.audience=n.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(n){const[e,o,r,i]=n.split("::");return new nn({clientId:o,scope:i,audience:r},e)}static fromCacheEntry(n){const{scope:e,audience:o,client_id:r}=n;return new nn({scope:e,audience:o,clientId:r})}}class Ab{set(n,e){localStorage.setItem(n,JSON.stringify(e))}get(n){const e=window.localStorage.getItem(n);if(e)try{return JSON.parse(e)}catch{return}}remove(n){localStorage.removeItem(n)}allKeys(){return Object.keys(window.localStorage).filter(n=>n.startsWith("@@auth0spajs@@"))}}class Ih{constructor(){this.enclosedCache=function(){let n={};return{set(e,o){n[e]=o},get(e){const o=n[e];if(o)return o},remove(e){delete n[e]},allKeys:()=>Object.keys(n)}}()}}class Tb{constructor(n,e,o){this.cache=n,this.keyManifest=e,this.nowProvider=o||Nh}async setIdToken(n,e,o){var r;const i=this.getIdTokenCacheKey(n);await this.cache.set(i,{id_token:e,decodedToken:o}),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(i))}async getIdToken(n){const e=await this.cache.get(this.getIdTokenCacheKey(n.clientId));if(!e&&n.scope&&n.audience){const o=await this.get(n);return!o||!o.id_token||!o.decodedToken?void 0:{id_token:o.id_token,decodedToken:o.decodedToken}}if(e)return{id_token:e.id_token,decodedToken:e.decodedToken}}async get(n,e=0){var o;let r=await this.cache.get(n.toKey());if(!r){const c=await this.getCacheKeys();if(!c)return;const l=this.matchExistingCacheKey(n,c);l&&(r=await this.cache.get(l))}if(!r)return;const i=await this.nowProvider(),a=Math.floor(i/1e3);return r.expiresAt-e<a?r.body.refresh_token?(r.body={refresh_token:r.body.refresh_token},await this.cache.set(n.toKey(),r),r.body):(await this.cache.remove(n.toKey()),void await((o=this.keyManifest)===null||o===void 0?void 0:o.remove(n.toKey()))):r.body}async set(n){var e;const o=new nn({clientId:n.client_id,scope:n.scope,audience:n.audience}),r=await this.wrapCacheEntry(n);await this.cache.set(o.toKey(),r),await((e=this.keyManifest)===null||e===void 0?void 0:e.add(o.toKey()))}async clear(n){var e;const o=await this.getCacheKeys();o&&(await o.filter(r=>!n||r.includes(n)).reduce(async(r,i)=>{await r,await this.cache.remove(i)},Promise.resolve()),await((e=this.keyManifest)===null||e===void 0?void 0:e.clear()))}async wrapCacheEntry(n){const e=await this.nowProvider();return{body:n,expiresAt:Math.floor(e/1e3)+n.expires_in}}async getCacheKeys(){var n;return this.keyManifest?(n=await this.keyManifest.get())===null||n===void 0?void 0:n.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(n){return new nn({clientId:n},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(n,e){return e.filter(o=>{var r;const i=nn.fromKey(o),a=new Set(i.scope&&i.scope.split(" ")),c=((r=n.scope)===null||r===void 0?void 0:r.split(" "))||[],l=i.scope&&c.reduce((u,f)=>u&&a.has(f),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===n.clientId&&i.audience===n.audience&&l})[0]}}class Db{constructor(n,e,o){this.storage=n,this.clientId=e,this.cookieDomain=o,this.storageKey=`a0.spajs.txs.${this.clientId}`}create(n){this.storage.save(this.storageKey,n,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Jo=t=>typeof t=="number",Mb=["iss","aud","exp","nbf","iat","jti","azp","nonce","auth_time","at_hash","c_hash","acr","amr","sub_jwk","cnf","sip_from_tag","sip_date","sip_callid","sip_cseq_num","sip_via_branch","orig","dest","mky","events","toe","txn","rph","sid","vot","vtm"],_b=t=>{if(!t.id_token)throw new Error("ID token is required but missing");const n=(i=>{const a=i.split("."),[c,l,u]=a;if(a.length!==3||!c||!l||!u)throw new Error("ID token could not be decoded");const f=JSON.parse(Fl(l)),d={__raw:i},p={};return Object.keys(f).forEach(h=>{d[h]=f[h],Mb.includes(h)||(p[h]=f[h])}),{encoded:{header:c,payload:l,signature:u},header:JSON.parse(Fl(c)),claims:d,user:p}})(t.id_token);if(!n.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(n.claims.iss!==t.iss)throw new Error(`Issuer (iss) claim mismatch in the ID token; expected "${t.iss}", found "${n.claims.iss}"`);if(!n.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(n.header.alg!=="RS256")throw new Error(`Signature algorithm of "${n.header.alg}" is not supported. Expected the ID token to be signed with "RS256".`);if(!n.claims.aud||typeof n.claims.aud!="string"&&!Array.isArray(n.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(n.claims.aud)){if(!n.claims.aud.includes(t.aud))throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but was not one of "${n.claims.aud.join(", ")}"`);if(n.claims.aud.length>1){if(!n.claims.azp)throw new Error("Authorized Party (azp) claim must be a string present in the ID token when Audience (aud) claim has multiple values");if(n.claims.azp!==t.aud)throw new Error(`Authorized Party (azp) claim mismatch in the ID token; expected "${t.aud}", found "${n.claims.azp}"`)}}else if(n.claims.aud!==t.aud)throw new Error(`Audience (aud) claim mismatch in the ID token; expected "${t.aud}" but found "${n.claims.aud}"`);if(t.nonce){if(!n.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(n.claims.nonce!==t.nonce)throw new Error(`Nonce (nonce) claim mismatch in the ID token; expected "${t.nonce}", found "${n.claims.nonce}"`)}if(t.max_age&&!Jo(n.claims.auth_time))throw new Error("Authentication Time (auth_time) claim must be a number present in the ID token when Max Age (max_age) is specified");if(n.claims.exp==null||!Jo(n.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Jo(n.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const e=t.leeway||60,o=new Date(t.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(n.claims.exp+e),o>r)throw new Error(`Expiration Time (exp) claim error in the ID token; current time (${o}) is after expiration time (${r})`);if(n.claims.nbf!=null&&Jo(n.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(n.claims.nbf-e),o<i)throw new Error(`Not Before time (nbf) claim in the ID token indicates that this token can't be used just yet. Current time (${o}) is before ${i}`)}if(n.claims.auth_time!=null&&Jo(n.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(n.claims.auth_time)+t.max_age+e),o>i)throw new Error(`Authentication Time (auth_time) claim in the ID token indicates that too much time has passed since the last end-user authentication. Current time (${o}) is after last auth at ${i}`)}if(t.organization){const i=t.organization.trim();if(i.startsWith("org_")){const a=i;if(!n.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(a!==n.claims.org_id)throw new Error(`Organization ID (org_id) claim mismatch in the ID token; expected "${a}", found "${n.claims.org_id}"`)}else{const a=i.toLowerCase();if(!n.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(a!==n.claims.org_name)throw new Error(`Organization Name (org_name) claim mismatch in the ID token; expected "${a}", found "${n.claims.org_name}"`)}}return n};var qn=ac(function(t,n){var e=Yn&&Yn.__assign||function(){return e=Object.assign||function(l){for(var u,f=1,d=arguments.length;f<d;f++)for(var p in u=arguments[f])Object.prototype.hasOwnProperty.call(u,p)&&(l[p]=u[p]);return l},e.apply(this,arguments)};function o(l,u){if(!u)return"";var f="; "+l;return u===!0?f:f+"="+u}function r(l,u,f){return encodeURIComponent(l).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(u).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(d){if(typeof d.expires=="number"){var p=new Date;p.setMilliseconds(p.getMilliseconds()+864e5*d.expires),d.expires=p}return o("Expires",d.expires?d.expires.toUTCString():"")+o("Domain",d.domain)+o("Path",d.path)+o("Secure",d.secure)+o("SameSite",d.sameSite)}(f)}function i(l){for(var u={},f=l?l.split("; "):[],d=/(%[\dA-F]{2})+/gi,p=0;p<f.length;p++){var h=f[p].split("="),m=h.slice(1).join("=");m.charAt(0)==='"'&&(m=m.slice(1,-1));try{u[h[0].replace(d,decodeURIComponent)]=m.replace(d,decodeURIComponent)}catch{}}return u}function a(){return i(document.cookie)}function c(l,u,f){document.cookie=r(l,u,e({path:"/"},f))}n.__esModule=!0,n.encode=r,n.parse=i,n.getAll=a,n.get=function(l){return a()[l]},n.set=c,n.remove=function(l,u){c(l,"",e(e({},u),{expires:-1}))}});ic(qn),qn.encode,qn.parse,qn.getAll;var Lb=qn.get,Ph=qn.set,Ah=qn.remove;const yo={get(t){const n=Lb(t);if(n!==void 0)return JSON.parse(n)},save(t,n,e){let o={};window.location.protocol==="https:"&&(o={secure:!0,sameSite:"none"}),e!=null&&e.daysUntilExpire&&(o.expires=e.daysUntilExpire),e!=null&&e.cookieDomain&&(o.domain=e.cookieDomain),Ph(t,JSON.stringify(n),o)},remove(t,n){let e={};n!=null&&n.cookieDomain&&(e.domain=n.cookieDomain),Ah(t,e)}},Rb={get(t){return yo.get(t)||yo.get(`_legacy_${t}`)},save(t,n,e){let o={};window.location.protocol==="https:"&&(o={secure:!0}),e!=null&&e.daysUntilExpire&&(o.expires=e.daysUntilExpire),e!=null&&e.cookieDomain&&(o.domain=e.cookieDomain),Ph(`_legacy_${t}`,JSON.stringify(n),o),yo.save(t,n,e)},remove(t,n){let e={};n!=null&&n.cookieDomain&&(e.domain=n.cookieDomain),Ah(t,e),yo.remove(t,n),yo.remove(`_legacy_${t}`,n)}},Fb={get(t){if(typeof sessionStorage>"u")return;const n=sessionStorage.getItem(t);return n!=null?JSON.parse(n):void 0},save(t,n){sessionStorage.setItem(t,JSON.stringify(n))},remove(t){sessionStorage.removeItem(t)}};function Bb(t,n,e){var o=n===void 0?null:n,r=function(l,u){var f=atob(l);if(u){for(var d=new Uint8Array(f.length),p=0,h=f.length;p<h;++p)d[p]=f.charCodeAt(p);return String.fromCharCode.apply(null,new Uint16Array(d.buffer))}return f}(t,e!==void 0&&e),i=r.indexOf(`
58
58
  `,10)+1,a=r.substring(i)+(o?"//# sourceMappingURL="+o:""),c=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(c)}var Bl,Hl,Wl,ba,Hb=(Bl="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHtlcnJvcjp0LGVycm9yX2Rlc2NyaXB0aW9uOnJ9KXtyZXR1cm4gbmV3IGUodCxyKX19Y2xhc3MgdCBleHRlbmRzIGV7Y29uc3RydWN0b3IoZSxzKXtzdXBlcigibWlzc2luZ19yZWZyZXNoX3Rva2VuIixgTWlzc2luZyBSZWZyZXNoIFRva2VuIChhdWRpZW5jZTogJyR7cihlLFsiZGVmYXVsdCJdKX0nLCBzY29wZTogJyR7cihzKX0nKWApLHRoaXMuYXVkaWVuY2U9ZSx0aGlzLnNjb3BlPXMsT2JqZWN0LnNldFByb3RvdHlwZU9mKHRoaXMsdC5wcm90b3R5cGUpfX1mdW5jdGlvbiByKGUsdD1bXSl7cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+YCR7ZX18JHt0fWA7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jKHtkYXRhOnt0aW1lb3V0OmUsYXV0aDpyLGZldGNoVXJsOmksZmV0Y2hPcHRpb25zOmMsdXNlRm9ybURhdGE6YX0scG9ydHM6W3BdfSk9PntsZXQgZjtjb25zdHthdWRpZW5jZTp1LHNjb3BlOmx9PXJ8fHt9O3RyeXtjb25zdCByPWE/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKCgoZSx0KT0+e3JbdF09ZX0pKSxyfSkoYy5ib2R5KTpKU09OLnBhcnNlKGMuYm9keSk7aWYoIXIucmVmcmVzaF90b2tlbiYmInJlZnJlc2hfdG9rZW4iPT09ci5ncmFudF90eXBlKXtjb25zdCBlPSgoZSx0KT0+b1tuKGUsdCldKSh1LGwpO2lmKCFlKXRocm93IG5ldyB0KHUsbCk7Yy5ib2R5PWE/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30scikse3JlZnJlc2hfdG9rZW46ZX0pKX1sZXQgaCxnOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihoPW5ldyBBYm9ydENvbnRyb2xsZXIsYy5zaWduYWw9aC5zaWduYWwpO3RyeXtnPWF3YWl0IFByb21pc2UucmFjZShbKGQ9ZSxuZXcgUHJvbWlzZSgoZT0+c2V0VGltZW91dChlLGQpKSkpLGZldGNoKGksT2JqZWN0LmFzc2lnbih7fSxjKSldKX1jYXRjaChlKXtyZXR1cm4gdm9pZCBwLnBvc3RNZXNzYWdlKHtlcnJvcjplLm1lc3NhZ2V9KX1pZighZylyZXR1cm4gaCYmaC5hYm9ydCgpLHZvaWQgcC5wb3N0TWVzc2FnZSh7ZXJyb3I6IlRpbWVvdXQgd2hlbiBleGVjdXRpbmcgJ2ZldGNoJyJ9KTtmPWF3YWl0IGcuanNvbigpLGYucmVmcmVzaF90b2tlbj8oKChlLHQscik9PntvW24odCxyKV09ZX0pKGYucmVmcmVzaF90b2tlbix1LGwpLGRlbGV0ZSBmLnJlZnJlc2hfdG9rZW4pOigoZSx0KT0+e2RlbGV0ZSBvW24oZSx0KV19KSh1LGwpLHAucG9zdE1lc3NhZ2Uoe29rOmcub2ssanNvbjpmfSl9Y2F0Y2goZSl7cC5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9fSl9dmFyIGR9KSl9KCk7Cgo=",Hl=null,Wl=!1,function(t){return ba=ba||Bb(Bl,Hl,Wl),new Worker(ba,t)});const xa={};class Wb{constructor(n,e){this.cache=n,this.clientId=e,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(n){var e;const o=new Set(((e=await this.cache.get(this.manifestKey))===null||e===void 0?void 0:e.keys)||[]);o.add(n),await this.cache.set(this.manifestKey,{keys:[...o]})}async remove(n){const e=await this.cache.get(this.manifestKey);if(e){const o=new Set(e.keys);return o.delete(n),o.size>0?await this.cache.set(this.manifestKey,{keys:[...o]}):await this.cache.remove(this.manifestKey)}}get(){return this.cache.get(this.manifestKey)}clear(){return this.cache.remove(this.manifestKey)}createManifestKeyFrom(n){return`@@auth0spajs@@::${n}`}}const $b={memory:()=>new Ih().enclosedCache,localstorage:()=>new Ab},$l=t=>$b[t],zl=t=>{const{openUrl:n,onRedirect:e}=t,o=tn(t,["openUrl","onRedirect"]);return Object.assign(Object.assign({},o),{openUrl:n===!1||n?n:e})},Ca=new Sb;class zb{constructor(n){let e,o;if(this.userCache=new Ih().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{await Ca.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),n),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),n.authorizationParams)}),typeof window<"u"&&(()=>{if(!qr())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(qr().subtle===void 0)throw new Error(`
59
59
  auth0-spa-js must run on a secure origin. See https://github.com/auth0/auth0-spa-js/blob/main/FAQ.md#why-do-i-get-auth0-spa-js-must-run-on-a-secure-origin for more information.
60
- `)})(),n.cache&&n.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),n.cache)o=n.cache;else{if(e=n.cacheLocation||"memory",!$l(e))throw new Error(`Invalid cache location "${e}"`);o=$l(e)()}this.httpTimeoutMs=n.httpTimeoutInSeconds?1e3*n.httpTimeoutInSeconds:1e4,this.cookieStorage=n.legacySameSiteCookie===!1?yo:Rb,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(a=>`auth0.${a}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=n.sessionCheckExpiryDays||1;const r=n.useCookiesForTransactions?this.cookieStorage:Fb;var i;this.scope=qo("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Db(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Nh,this.cacheManager=new Tb(o,o.allKeys?void 0:new Wb(o,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((a,c)=>a?a.startsWith("https://")?a:`https://${a}/`:`${c}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&e==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Hb)}_url(n){const e=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Oh)));return`${this.domainUrl}${n}&auth0Client=${e}`}_authorizeUrl(n){return this._url(`/authorize?${fs(n)}`)}async _verifyIdToken(n,e,o){const r=await this.nowProvider();return _b({iss:this.tokenIssuer,aud:this.options.clientId,id_token:n,nonce:e,organization:o,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:r});var i}_processOrgHint(n){n?this.cookieStorage.save(this.orgHintCookieName,n,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(n,e,o){const r=Rl(wa()),i=Rl(wa()),a=wa(),c=(f=>{const d=new Uint8Array(f);return(p=>{const h={"+":"-","/":"_","=":""};return p.replace(/[+/=]/g,m=>h[m])})(window.btoa(String.fromCharCode(...Array.from(d))))})(await(async f=>await qr().subtle.digest({name:"SHA-256"},new TextEncoder().encode(f)))(a)),l=((f,d,p,h,m,v,y,k)=>Object.assign(Object.assign(Object.assign({client_id:f.clientId},f.authorizationParams),p),{scope:qo(d,p.scope),response_type:"code",response_mode:k||"query",state:h,nonce:m,redirect_uri:y||f.authorizationParams.redirect_uri,code_challenge:v,code_challenge_method:"S256"}))(this.options,this.scope,n,r,i,c,n.redirect_uri||this.options.authorizationParams.redirect_uri||o,e==null?void 0:e.response_mode),u=this._authorizeUrl(l);return{nonce:i,code_verifier:a,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:r,url:u}}async loginWithPopup(n,e){var o;if(n=n||{},!(e=e||{}).popup&&(e.popup=(c=>{const l=window.screenX+(window.innerWidth-400)/2,u=window.screenY+(window.innerHeight-600)/2;return window.open(c,"auth0:authorize:popup",`left=${l},top=${u},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!e.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const r=await this._prepareAuthorizeUrl(n.authorizationParams||{},{response_mode:"web_message"},window.location.origin);e.popup.location.href=r.url;const i=await(c=>new Promise((l,u)=>{let f;const d=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(d),clearTimeout(p),window.removeEventListener("message",f,!1),u(new lc(c.popup)))},1e3),p=setTimeout(()=>{clearInterval(d),u(new cc(c.popup)),window.removeEventListener("message",f,!1)},1e3*(c.timeoutInSeconds||60));f=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(p),clearInterval(d),window.removeEventListener("message",f,!1),c.popup.close(),h.data.response.error)return u(St.fromPayload(h.data.response));l(h.data.response)}},window.addEventListener("message",f)}))(Object.assign(Object.assign({},e),{timeoutInSeconds:e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==i.state)throw new St("state_mismatch","Invalid state");const a=((o=n.authorizationParams)===null||o===void 0?void 0:o.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:a})}async getUser(){var n;const e=await this._getIdTokenFromCache();return(n=e==null?void 0:e.decodedToken)===null||n===void 0?void 0:n.user}async getIdTokenClaims(){var n;const e=await this._getIdTokenFromCache();return(n=e==null?void 0:e.decodedToken)===null||n===void 0?void 0:n.claims}async loginWithRedirect(n={}){var e;const o=zl(n),{openUrl:r,fragment:i,appState:a}=o,c=tn(o,["openUrl","fragment","appState"]),l=((e=c.authorizationParams)===null||e===void 0?void 0:e.organization)||this.options.authorizationParams.organization,u=await this._prepareAuthorizeUrl(c.authorizationParams||{}),{url:f}=u,d=tn(u,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:a}),l&&{organization:l}));const p=i?`${f}#${i}`:f;r?await r(p):window.location.assign(p)}async handleRedirectCallback(n=window.location.href){const e=n.split("?").slice(1);if(e.length===0)throw new Error("There are no query params available for parsing.");const{state:o,code:r,error:i,error_description:a}=(d=>{d.indexOf("#")>-1&&(d=d.substring(0,d.indexOf("#")));const p=new URLSearchParams(d);return{state:p.get("state"),code:p.get("code")||void 0,error:p.get("error")||void 0,error_description:p.get("error_description")||void 0}})(e.join("")),c=this.transactionManager.get();if(!c)throw new St("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new sc(i,a||i,o,c.appState);if(!c.code_verifier||c.state&&c.state!==o)throw new St("state_mismatch","Invalid state");const l=c.organization,u=c.nonce,f=c.redirect_uri;return await this._requestToken(Object.assign({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:r},f?{redirect_uri:f}:{}),{nonceIn:u,organization:l}),{appState:c.appState}}async checkSession(n){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(n)}catch{}}async getTokenSilently(n={}){var e;const o=Object.assign(Object.assign({cacheMode:"on"},n),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),n.authorizationParams),{scope:qo(this.scope,(e=n.authorizationParams)===null||e===void 0?void 0:e.scope)})}),r=await((i,a)=>{let c=xa[a];return c||(c=i().finally(()=>{delete xa[a],c=null}),xa[a]=c),c})(()=>this._getTokenSilently(o),`${this.options.clientId}::${o.authorizationParams.audience}::${o.authorizationParams.scope}`);return n.detailedResponse?r:r==null?void 0:r.access_token}async _getTokenSilently(n){const{cacheMode:e}=n,o=tn(n,["cacheMode"]);if(e!=="off"){const r=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(r)return r}if(e!=="cache-only"){if(!await(async(r,i=3)=>{for(let a=0;a<i;a++)if(await r())return!0;return!1})(()=>Ca.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new yr;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),e!=="off"){const u=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(u)return u}const r=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(o):await this._getTokenFromIFrame(o),{id_token:i,access_token:a,oauthTokenScope:c,expires_in:l}=r;return Object.assign(Object.assign({id_token:i,access_token:a},c?{scope:c}:null),{expires_in:l})}finally{await Ca.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(n={},e={}){var o;const r=Object.assign(Object.assign({},n),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),n.authorizationParams),{scope:qo(this.scope,(o=n.authorizationParams)===null||o===void 0?void 0:o.scope)})});return e=Object.assign(Object.assign({},Eb),e),await this.loginWithPopup(r,e),(await this.cacheManager.get(new nn({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(n){n.clientId!==null?n.clientId=n.clientId||this.options.clientId:delete n.clientId;const e=n.logoutParams||{},{federated:o}=e,r=tn(e,["federated"]),i=o?"&federated":"";return this._url(`/v2/logout?${fs(Object.assign({clientId:n.clientId},r))}`)+i}async logout(n={}){const e=zl(n),{openUrl:o}=e,r=tn(e,["openUrl"]);n.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(n.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(r);o?await o(i):o!==!1&&window.location.assign(i)}async _getTokenFromIFrame(n){const e=Object.assign(Object.assign({},n.authorizationParams),{prompt:"none"}),o=this.cookieStorage.get(this.orgHintCookieName);o&&!e.organization&&(e.organization=o);const{url:r,state:i,nonce:a,code_verifier:c,redirect_uri:l,scope:u,audience:f}=await this._prepareAuthorizeUrl(e,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new St("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const d=n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let p;try{p=new URL(this.domainUrl).origin}catch{p=this.domainUrl}const h=await((v,y,k=60)=>new Promise((S,b)=>{const w=window.document.createElement("iframe");w.setAttribute("width","0"),w.setAttribute("height","0"),w.style.display="none";const E=()=>{window.document.body.contains(w)&&(window.document.body.removeChild(w),window.removeEventListener("message",O,!1))};let O;const F=setTimeout(()=>{b(new yr),E()},1e3*k);O=function(R){if(R.origin!=y||!R.data||R.data.type!=="authorization_response")return;const U=R.source;U&&U.close(),R.data.response.error?b(St.fromPayload(R.data.response)):S(R.data.response),clearTimeout(F),window.removeEventListener("message",O,!1),setTimeout(E,2e3)},window.addEventListener("message",O,!1),window.document.body.appendChild(w),w.setAttribute("src",v)}))(r,p,d);if(i!==h.state)throw new St("state_mismatch","Invalid state");const m=await this._requestToken(Object.assign(Object.assign({},n.authorizationParams),{code_verifier:c,code:h.code,grant_type:"authorization_code",redirect_uri:l,timeout:n.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:a,organization:e.organization});return Object.assign(Object.assign({},m),{scope:u,oauthTokenScope:m.scope,audience:f})}catch(d){throw d.error==="login_required"&&this.logout({openUrl:!1}),d}}async _getTokenUsingRefreshToken(n){const e=await this.cacheManager.get(new nn({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(e&&e.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(n);throw new zi(n.authorizationParams.audience||"default",n.authorizationParams.scope)}const o=n.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r=typeof n.timeoutInSeconds=="number"?1e3*n.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},n.authorizationParams),{grant_type:"refresh_token",refresh_token:e&&e.refresh_token,redirect_uri:o}),r&&{timeout:r}));return Object.assign(Object.assign({},i),{scope:n.authorizationParams.scope,oauthTokenScope:i.scope,audience:n.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(n);throw i}}async _saveEntryInCache(n){const{id_token:e,decodedToken:o}=n,r=tn(n,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:e,decodedToken:o}),await this.cacheManager.setIdToken(this.options.clientId,n.id_token,n.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const n=this.options.authorizationParams.audience||"default",e=await this.cacheManager.getIdToken(new nn({clientId:this.options.clientId,audience:n,scope:this.scope})),o=this.userCache.get("@@user@@");return e&&e.id_token===(o==null?void 0:o.id_token)?o:(this.userCache.set("@@user@@",e),e)}async _getEntryFromCache({scope:n,audience:e,clientId:o}){const r=await this.cacheManager.get(new nn({scope:n,audience:e,clientId:o}),60);if(r&&r.access_token){const{access_token:i,oauthTokenScope:a,expires_in:c}=r,l=await this._getIdTokenFromCache();return l&&Object.assign(Object.assign({id_token:l.id_token,access_token:i},a?{scope:a}:null),{expires_in:c})}}async _requestToken(n,e){const{nonceIn:o,organization:r}=e||{},i=await Pb(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},n),this.worker),a=await this._verifyIdToken(i.id_token,o,r);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:a,scope:n.scope,audience:n.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(r||a.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:a})}async exchangeToken(n){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:n.subject_token,subject_token_type:n.subject_token_type,scope:qo(n.scope,this.scope),audience:n.audience||this.options.authorizationParams.audience})}}var Th={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},pn=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},Ub=yt(yt({},Th),{buildAuthorizeUrl:pn,buildLogoutUrl:pn,getAccessTokenSilently:pn,getAccessTokenWithPopup:pn,getIdTokenClaims:pn,loginWithRedirect:pn,loginWithPopup:pn,logout:pn,handleRedirectCallback:pn}),Dh=g.createContext(Ub),Ul=function(t){xb(n,t);function n(e,o){var r=t.call(this,o??e)||this;return r.error=e,r.error_description=o,Object.setPrototypeOf(r,n.prototype),r}return n}(Error),Vb=/[?&]code=[^&]+/,Gb=/[?&]state=[^&]+/,Yb=/[?&]error=[^&]+/,Zb=function(t){return t===void 0&&(t=window.location.search),(Vb.test(t)||Yb.test(t))&&Gb.test(t)},Mh=function(t){return function(n){return n instanceof Error?n:n!==null&&typeof n=="object"&&"error"in n&&typeof n.error=="string"?"error_description"in n&&typeof n.error_description=="string"?new Ul(n.error,n.error_description):new Ul(n.error):new Error(t)}},Vl=Mh("Login failed"),ka=Mh("Get access token failed"),_h=function(t){var n,e;t!=null&&t.redirectUri&&(console.warn("Using `redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),t.authorizationParams=(n=t.authorizationParams)!==null&&n!==void 0?n:{},t.authorizationParams.redirect_uri=t.redirectUri,delete t.redirectUri),!((e=t==null?void 0:t.authorizationParams)===null||e===void 0)&&e.redirectUri&&(console.warn("Using `authorizationParams.redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `authorizationParams.redirectUri` will be removed in a future version"),t.authorizationParams.redirect_uri=t.authorizationParams.redirectUri,delete t.authorizationParams.redirectUri)},Kb=function(t,n){switch(n.type){case"LOGIN_POPUP_STARTED":return yt(yt({},t),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return yt(yt({},t),{isAuthenticated:!!n.user,user:n.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return t.user===n.user?t:yt(yt({},t),{isAuthenticated:!!n.user,user:n.user});case"LOGOUT":return yt(yt({},t),{isAuthenticated:!1,user:void 0});case"ERROR":return yt(yt({},t),{isLoading:!1,error:n.error})}},qb=function(t){return _h(t),yt(yt({},t),{auth0Client:{name:"auth0-react",version:"2.4.0"}})},Jb=function(t){var n;window.history.replaceState({},document.title,(n=t==null?void 0:t.returnTo)!==null&&n!==void 0?n:window.location.pathname)},Xb=function(t){var n=t.children,e=t.skipRedirectCallback,o=t.onRedirectCallback,r=o===void 0?Jb:o,i=t.context,a=i===void 0?Dh:i,c=Cb(t,["children","skipRedirectCallback","onRedirectCallback","context"]),l=g.useState(function(){return new zb(qb(c))})[0],u=g.useReducer(Kb,Th),f=u[0],d=u[1],p=g.useRef(!1),h=g.useCallback(function(O){return d({type:"ERROR",error:O}),O},[]);g.useEffect(function(){p.current||(p.current=!0,function(){return ho(void 0,void 0,void 0,function(){var O,F,R;return mo(this,function(U){switch(U.label){case 0:return U.trys.push([0,7,,8]),O=void 0,Zb()&&!e?[4,l.handleRedirectCallback()]:[3,3];case 1:return F=U.sent().appState,[4,l.getUser()];case 2:return O=U.sent(),r(F,O),[3,6];case 3:return[4,l.checkSession()];case 4:return U.sent(),[4,l.getUser()];case 5:O=U.sent(),U.label=6;case 6:return d({type:"INITIALISED",user:O}),[3,8];case 7:return R=U.sent(),h(Vl(R)),[3,8];case 8:return[2]}})})}())},[l,r,e,h]);var m=g.useCallback(function(O){return _h(O),l.loginWithRedirect(O)},[l]),v=g.useCallback(function(O,F){return ho(void 0,void 0,void 0,function(){var R,U;return mo(this,function(K){switch(K.label){case 0:d({type:"LOGIN_POPUP_STARTED"}),K.label=1;case 1:return K.trys.push([1,3,,4]),[4,l.loginWithPopup(O,F)];case 2:return K.sent(),[3,4];case 3:return R=K.sent(),h(Vl(R)),[2];case 4:return[4,l.getUser()];case 5:return U=K.sent(),d({type:"LOGIN_POPUP_COMPLETE",user:U}),[2]}})})},[l,h]),y=g.useCallback(function(){for(var O=[],F=0;F<arguments.length;F++)O[F]=arguments[F];return ho(void 0,kb([],O,!0),void 0,function(R){return R===void 0&&(R={}),mo(this,function(U){switch(U.label){case 0:return[4,l.logout(R)];case 1:return U.sent(),(R.openUrl||R.openUrl===!1)&&d({type:"LOGOUT"}),[2]}})})},[l]),k=g.useCallback(function(O){return ho(void 0,void 0,void 0,function(){var F,R,U,K;return mo(this,function(_){switch(_.label){case 0:return _.trys.push([0,2,3,5]),[4,l.getTokenSilently(O)];case 1:return F=_.sent(),[3,5];case 2:throw R=_.sent(),ka(R);case 3:return U=d,K={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return U.apply(void 0,[(K.user=_.sent(),K)]),[7];case 5:return[2,F]}})})},[l]),S=g.useCallback(function(O,F){return ho(void 0,void 0,void 0,function(){var R,U,K,_;return mo(this,function(A){switch(A.label){case 0:return A.trys.push([0,2,3,5]),[4,l.getTokenWithPopup(O,F)];case 1:return R=A.sent(),[3,5];case 2:throw U=A.sent(),ka(U);case 3:return K=d,_={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return K.apply(void 0,[(_.user=A.sent(),_)]),[7];case 5:return[2,R]}})})},[l]),b=g.useCallback(function(){return l.getIdTokenClaims()},[l]),w=g.useCallback(function(O){return ho(void 0,void 0,void 0,function(){var F,R,U;return mo(this,function(K){switch(K.label){case 0:return K.trys.push([0,2,3,5]),[4,l.handleRedirectCallback(O)];case 1:return[2,K.sent()];case 2:throw F=K.sent(),ka(F);case 3:return R=d,U={type:"HANDLE_REDIRECT_COMPLETE"},[4,l.getUser()];case 4:return R.apply(void 0,[(U.user=K.sent(),U)]),[7];case 5:return[2]}})})},[l]),E=g.useMemo(function(){return yt(yt({},f),{getAccessTokenSilently:k,getAccessTokenWithPopup:S,getIdTokenClaims:b,loginWithRedirect:m,loginWithPopup:v,logout:y,handleRedirectCallback:w})},[f,k,S,b,m,v,y,w]);return g.createElement(a.Provider,{value:E},n)},Lh=function(t){return t===void 0&&(t=Dh),g.useContext(t)};const Rh=({className:t,children:n,Logo:e})=>s.jsxs("div",{className:ot("info-page-container",t),children:[s.jsx(e,{className:"info-page-logo"}),s.jsx("div",{className:"info-page-wrapper",children:n})]}),Qb={value:"data:image/svg+xml,%3Csvg width='5041' height='1232' viewBox='0 0 5041 1232' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_879_362)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M548.6 178H439.6C368.7 178 310 199.5 269.3 244.5C228.6 289.3 206.7 356 206.7 444.3C206.7 532.6 228.6 599.5 269.3 644.2C310.2 689.2 368.7 710.7 439.6 710.7H548.6C619 710.7 677.6 689.2 718.6 644.2C759.5 599.4 781.6 532.6 781.6 444.2C781.6 355.8 759.5 289 718.6 244.2C677.7 199.3 619 177.7 548.6 177.7V178ZM449.5 293.8H538.9C582.2 293.8 611.9 305.2 631.1 328.3C650.5 351.8 660.5 389.2 660.5 444.4C660.5 499.6 650.5 536.7 631.1 560C612 583 582.2 594.1 538.9 594.1H449.5C405.6 594.1 375.9 583 356.9 560C337.6 536.8 327.7 499.7 327.7 444.5C327.7 389.3 337.4 351.9 356.8 328.4C375.9 305.2 405.6 293.8 449.5 293.8Z' fill='white'/%3E%3Cpath d='M0.700195 189.8C0.700195 183.1 6.10017 177.7 12.8002 177.7H108.6C115.3 177.7 120.7 183.1 120.7 189.8V698.6C120.7 705.3 115.3 710.7 108.6 710.7H12.8002C6.10017 710.7 0.700195 705.3 0.700195 698.6V189.8Z' fill='white'/%3E%3Cpath d='M0.700195 11.9002C0.700195 5.7002 5.70018 0.700195 11.9002 0.700195H109.6C115.7 0.700195 120.7 5.7002 120.7 11.9002V109.5C120.7 115.7 115.7 120.7 109.5 120.7H11.9002C5.70018 120.7 0.700195 115.7 0.700195 109.5V11.9002Z' fill='%23007BE5'/%3E%3Cpath d='M827.7 601.9C827.7 595.7 832.7 590.7 838.9 590.7H936.6C942.8 590.7 947.8 595.7 947.8 601.9V699.5C947.8 705.7 942.8 710.7 936.6 710.7H838.9C832.7 710.7 827.7 705.7 827.7 699.5V601.9Z' fill='%23007BE5'/%3E%3Cpath d='M4363.9 293.2C4320.2 293.2 4290.6 304.6 4271.6 327.8C4252.3 351.4 4242.5 388.8 4242.5 444C4242.5 499.2 4252.3 536.4 4271.5 559.7C4290.5 582.6 4320 593.8 4363.8 593.8H4614.7C4622.4 593.8 4628.7 600.1 4628.7 607.8V696.7C4628.7 704.4 4622.4 710.7 4614.7 710.7H4354.1C4283.3 710.7 4224.9 689.1 4184.1 644.1C4143.5 599.3 4121.6 532.4 4121.6 444C4121.6 355.6 4143.5 288.7 4184.1 243.9C4224.8 199 4283.3 177.3 4354.1 177.3H4614.7C4622.4 177.3 4628.7 183.6 4628.7 191.3V279.3C4628.7 287 4622.4 293.3 4614.7 293.3H4363.9V293.2Z' fill='white'/%3E%3Cpath d='M1302.6 165.3C1240.1 165.3 1197 180.9 1169.3 213.3C1141.3 246 1127.4 297.6 1127.4 372.9C1127.4 447.7 1141.1 499 1169 531.6C1196.6 563.9 1239.7 579.5 1302.7 579.5H1552.5C1560.2 579.5 1566.5 585.8 1566.5 593.5V697.1C1566.5 704.8 1560.2 711.1 1552.5 711.1H1302.7C1204.7 711.1 1127.5 683.4 1075 626.4C1022.4 569.7 995.7 484.8 995.7 372.9C995.7 260.5 1022.7 175.4 1075.2 118.4C1127.9 61.3001 1205 33.6001 1302.6 33.6001H1552.4C1560.1 33.6001 1566.4 39.9001 1566.4 47.6001V151.2C1566.4 158.9 1560.1 165.2 1552.4 165.2H1302.6V165.3Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1953.6 177.7H1844.8C1774 177.7 1715.6 199.3 1674.8 244.3C1634.2 289.1 1612.3 356 1612.3 444.4C1612.3 532.8 1634.2 599.7 1674.8 644.5C1715.5 689.4 1774 711.1 1844.8 711.1H1953.6C2023.9 711.1 2082.4 689.5 2123.2 644.5C2163.9 599.7 2186 532.8 2186 444.3C2186 355.8 2163.9 289 2123.2 244.1C2082.3 199.3 2023.9 177.7 1953.6 177.7ZM1854.6 293.7H1943.8C1987 293.7 2016.6 305.1 2035.8 328.3C2055.2 351.9 2065.2 389.3 2065.2 444.5C2065.2 499.7 2055.2 536.8 2035.8 560.2C2016.7 583.2 1987.1 594.3 1943.8 594.3H1854.6C1810.8 594.3 1781.3 583.1 1762.3 560.2C1743 536.9 1733.3 499.8 1733.3 444.5C1733.3 389.3 1743.1 351.9 1762.4 328.3C1781.3 305 1810.9 293.7 1854.6 293.7Z' fill='white'/%3E%3Cpath d='M2679.7 411.6C2679.7 372.5 2668.5 343.5 2645.4 324C2622.1 304.3 2585.3 293.2 2531.9 293.2H2378.4C2375.5 293.2 2374.9 293.9 2374.8 294C2374.5 294.4 2373.6 295.8 2373.6 299.8V696.7C2373.6 704.4 2367.3 710.7 2359.6 710.7H2267.7C2260 710.7 2253.7 704.4 2253.7 696.7V265.6C2253.7 234.7 2258.8 212 2272.6 197.2C2286.5 182.2 2307.5 177.3 2334.2 177.3H2531.8C2620.7 177.3 2688 198.4 2733.3 238.9C2778.7 279.5 2800.5 338.6 2800.5 411.7V696.7C2800.5 704.4 2794.2 710.7 2786.5 710.7H2693.7C2686 710.7 2679.7 704.4 2679.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M3304.7 411.6C3304.7 372.5 3293.5 343.5 3270.4 324C3247.1 304.3 3210.3 293.2 3156.9 293.2H3003.4C3000.5 293.2 2999.9 293.9 2999.8 294C2999.5 294.4 2998.6 295.8 2998.6 299.8V696.7C2998.6 704.4 2992.3 710.7 2984.6 710.7H2892.7C2885 710.7 2878.7 704.4 2878.7 696.7V265.6C2878.7 234.7 2883.8 212 2897.6 197.2C2911.5 182.2 2932.5 177.3 2959.2 177.3H3156.8C3245.7 177.3 3313 198.4 3358.3 238.9C3403.7 279.5 3425.5 338.6 3425.5 411.7V696.7C3425.5 704.4 3419.2 710.7 3411.5 710.7H3318.7C3311 710.7 3304.7 704.4 3304.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M4906.1 292.2C4898.4 292.2 4892.1 298.5 4892.1 306.2V529.2C4892.1 557.5 4897.2 574.3 4906.4 584.1C4915.4 593.8 4930 598.6 4953.7 598.6H5019.2C5026.9 598.6 5033.2 604.9 5033.2 612.6V695.7C5033.2 703.4 5026.9 709.7 5019.2 709.7H4932.1C4877.9 709.7 4836.8 698.8 4809.7 668.6C4782.8 638.6 4771.3 591.5 4771.3 523.4V306.2C4771.3 298.5 4765 292.2 4757.3 292.2H4714.7C4707 292.2 4700.7 285.9 4700.7 278.2V190.2C4700.7 182.5 4707 176.2 4714.7 176.2H4757.3C4765 176.2 4771.3 169.9 4771.3 162.2V67.7002C4771.3 60.0002 4777.6 53.7002 4785.3 53.7002H4878.2C4885.9 53.7002 4892.2 60.0002 4892.2 67.7002V162.2C4892.2 169.9 4898.5 176.2 4906.2 176.2H5021.3C5029 176.2 5035.3 182.5 5035.3 190.2V278.2C5035.3 285.9 5029 292.2 5021.3 292.2H4906.1Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4024.4 607.2C4024.4 599.5 4018.1 593.2 4010.4 593.2H3699.9C3672.9 593.2 3655.3 586 3644.6 575.2C3633.8 564.4 3628.6 548.8 3628.6 529.7V514.5C3628.6 506.8 3634.9 500.5 3642.6 500.5H3866.6C3931.2 500.5 3977.4 486.9 4007.5 459.6C4037.7 432.2 4050.1 392.3 4050.1 343.5C4050.1 292.2 4036.8 250.1 4006.4 220.9C3976.1 191.7 3930.1 176.8 3867.7 176.8H3700.1C3633.9 176.8 3586.5 195.4 3555.6 227.8C3524.8 260.1 3511.8 305 3511.8 355.3V531.7C3511.8 582 3524.9 626.9 3555.6 659.2C3586.5 691.6 3633.9 710.2 3700.1 710.2H4010.6C4018.3 710.2 4024.6 703.9 4024.6 696.2V607.2H4024.4ZM3863.5 403.1H3642.5C3634.8 403.1 3628.5 396.8 3628.5 389.1V356.2C3628.5 337.6 3633.7 321.9 3644.6 311C3655.4 300.1 3672.9 292.7 3699.9 292.7H3866.5C3890.7 292.7 3906.9 298.8 3916.9 308.2C3926.9 317.5 3932 331.3 3932 349.4C3932 367.1 3927.3 380 3917.4 388.6C3907.4 397.4 3890.5 403.1 3863.5 403.1Z' fill='white'/%3E%3Cpath d='M2918.9 872.3C3001.9 872.3 3036.9 909.9 3036.9 966.3C3036.9 1012.2 3013.9 1036.8 2973.2 1047.2C3014.4 1058.2 3037.9 1083.7 3037.9 1129.7C3037.9 1186.1 3003.5 1224.7 2920.5 1224.7H2755.6C2741.5 1224.7 2734.2 1217.9 2734.2 1203.8V893.2C2734.2 879.1 2741.5 872.3 2755.6 872.3H2918.9ZM2765.4 1033.1H2918.9C2976.8 1033.1 3005 1014.8 3005 970.5C3005 929.8 2979.4 903.7 2919.4 903.7H2771.2C2767.5 903.7 2765.5 905.3 2765.5 909.4V1033.1H2765.4ZM2765.4 1187.6C2765.4 1191.8 2767.5 1193.3 2771.1 1193.3H2921C2979.5 1193.3 3006.1 1168.2 3006.1 1125.4C3006.1 1081 2976.9 1060.2 2921 1060.2H2765.5V1187.6H2765.4Z' fill='white'/%3E%3Cpath d='M3294 956.9V985.6H3182.8C3148.9 985.6 3135.3 1000.7 3135.3 1033.6V1224.6H3106.1V1029.9C3106.1 979.8 3125.4 956.8 3176.6 956.8H3294V956.9Z' fill='white'/%3E%3Cpath d='M3489.1 956.9C3562.2 956.9 3608.6 1001.3 3608.6 1091C3608.6 1181.3 3562.1 1224.6 3489.1 1224.6H3431.2C3357.6 1224.6 3311.7 1181.3 3311.7 1091C3311.7 1001.2 3357.6 956.9 3431.2 956.9H3489.1ZM3433.3 985.6C3374.3 985.6 3340.9 1019 3340.9 1091C3340.9 1163.5 3374.3 1196.4 3433.3 1196.4H3487.1C3546.1 1196.4 3579.5 1163.5 3579.5 1091C3579.5 1019 3546.1 985.6 3487.1 985.6H3433.3Z' fill='white'/%3E%3Cpath d='M3674.4 956.9L3706.8 1176.6C3709.4 1195.4 3716.2 1204.3 3737.1 1204.3C3758.5 1204.3 3767.4 1195.4 3771.5 1180.3L3821.6 995.5C3829.4 966.8 3849.3 951.7 3884.2 951.7C3919.1 951.7 3937.4 966.8 3945.3 995.5L3994.9 1180.3C3999.1 1195.4 4007.9 1204.3 4029.3 1204.3C4050.2 1204.3 4056.4 1195.4 4059.6 1176.6L4093.5 956.9H4125.3L4089.3 1179.8C4084.6 1210.6 4069.5 1231 4028.2 1231C3992.7 1231 3975 1216.4 3966.6 1185.1L3917 1000.9C3912.8 985.2 3900.8 978.5 3883.6 978.5C3865.9 978.5 3854.9 985.3 3850.7 1000.9L3799.6 1185.1C3790.7 1216.4 3773.5 1231 3737.5 1231C3695.2 1231 3682.2 1210.1 3677.5 1179.8L3643.1 956.9H3674.4Z' fill='white'/%3E%3Cpath d='M4417.6 956.9V985.6H4260C4219.8 985.6 4203.6 1003.3 4203.6 1032.1C4203.6 1057.2 4216.1 1077.5 4263.6 1077.5H4338.8C4410.8 1077.5 4428.6 1110.9 4428.6 1149.5C4428.6 1194.9 4404.6 1224.7 4344 1224.7H4178V1196.5H4344C4384.2 1196.5 4399.8 1178.2 4399.8 1149.5C4399.8 1124.4 4387.8 1103.6 4339.8 1103.6H4264.6C4193.1 1103.6 4174.8 1069.2 4174.8 1030C4174.8 985.1 4198.8 956.9 4259.4 956.9H4417.6Z' fill='white'/%3E%3Cpath d='M4685.4 956.9C4749.1 956.9 4775.7 986.6 4775.7 1036.8C4775.7 1084.8 4751.2 1111.4 4684.9 1111.4H4526.2V1135.9C4526.2 1170.3 4545 1196.4 4593.5 1196.4H4762.1V1224.6H4593.5C4524.6 1224.6 4497.5 1187.5 4497.5 1136.4V1045.1C4497.5 995 4524.6 956.9 4593.5 956.9H4685.4ZM4526.2 1087.4H4684.3C4729.7 1087.4 4746.9 1069.7 4746.9 1037.8C4746.9 1005.4 4728.6 985.6 4685.3 985.6H4593.4C4544.9 985.6 4526.1 1011.2 4526.1 1045.6V1087.4H4526.2Z' fill='white'/%3E%3Cpath d='M5040.3 956.9V985.6H4929.1C4895.2 985.6 4881.6 1000.7 4881.6 1033.6V1224.6H4852.4V1029.9C4852.4 979.8 4871.7 956.8 4922.9 956.8H5040.3V956.9Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_879_362'%3E%3Crect width='5041' height='1231' fill='white' transform='translate(0 0.700195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A"},e2={loginPageLogo:Qb},t2="200px",Er=({logoSrc:t=e2.loginPageLogo.value,width:n=t2,className:e="logo"})=>s.jsx("img",{width:n,src:t,className:e,alt:"Login logo"}),Fh=()=>s.jsx("span",{className:"spinner"});const Fn=({Logo:t=Er,text:n="Loading..."})=>s.jsx("div",{className:"system-loader-background",children:s.jsxs("div",{className:"system-loader-container flex flex-column ai-center",children:[s.jsx(t,{}),s.jsx("h1",{className:"system-loader-text io-title",children:n}),s.jsx(Fh,{})]})});const Bh=({children:t,description:n,heading:e,Image:o,title:r,className:i})=>s.jsxs("div",{className:ot("info-card",i),children:[r&&s.jsx("h1",{className:"info-card-title io-title-large",children:r}),o&&s.jsx("div",{className:"info-card-image",children:s.jsx(o,{})}),e&&s.jsx("h3",{className:"info-card-heading io-title",children:e}),s.jsx("p",{className:"info-card-description io-text-default-lh16",children:n}),t]}),n2=({activeStepName:t,showWarnIcon:n,stepsStatuses:e})=>s.jsx("ul",{className:"setup-flow-list io-text-default-lh16",children:Kr.map(({name:o,label:r},i)=>{const a=o===t,c=e[o].state,l=n&&a?s.jsx(nt,{variant:"exclamation-mark",size:"12"}):s.jsxs("span",{children:[i+1,"."]});return s.jsx("li",{className:ot(a&&"active"),children:s.jsxs("div",{className:"setup-flow-list-item",children:[s.jsxs("div",{className:"setup-flow-list-item-icon-wrapper",children:[c==="prompt"&&l,c==="granted"&&s.jsx(nt,{variant:"check-solid",size:"12"}),c==="denied"&&s.jsx(nt,{variant:"close",size:"12"})]}),r]})},o)})}),o2=({edgeNotificationsPermissionTimeout:t,isNotificationsPermissionPromptOpen:n})=>{const{name:e}=mw(),[o,r]=g.useState(!1);return g.useEffect(()=>{if(!n||e!=="Edge")return;const i=setTimeout(()=>r(!0),t);return()=>clearTimeout(i)},[e,t,n]),g.useEffect(()=>{n&&!o||r(!1)},[n,o,r]),{hasEdgeNotificationsPermissionError:o}},r2=(t,n)=>{const{type:e,payload:o}=n;switch(e){case"completed":return{...t,[o.stepName]:{...t[o.stepName],isCompleted:!0}};case"skipped":return{...t,[o.stepName]:{isCompleted:!0,state:"denied"}};case"stateUpdated":{if(!o.state)throw Error('"stateUpdated" action invoked without state in payload');return{...t,[o.stepName]:{isCompleted:o.stepName===Qe.POPUPS?o.state==="granted":o.state!=="prompt",state:o.state}}}default:throw Error("Unknown action: "+e)}},i2=t=>{const{handleDeferredStep:n,handleOperationComplete:e}=t;window.getScreenDetails().catch(async()=>{const{state:o}=await navigator.permissions.query({name:Tn.WINDOW_MANAGEMENT});o==="prompt"&&n()}).finally(e)},a2=t=>{const{handleDeferredStep:n,handleOperationComplete:e}=t;Notification.requestPermission().then(async()=>{const{state:o}=await navigator.permissions.query({name:Tn.NOTIFICATIONS});o==="prompt"&&n()}).finally(e)},s2=t=>{const{handleDeferredStep:n,handleOperationComplete:e,dispatchAction:o}=t,r="about:blank",i="popup,width=1,height=1,top=9999,left=9999",a=window.open(r,void 0,i),c=window.open(r,void 0,i);a==null||a.close(),c==null||c.close();const l=!(a&&c);l&&n(),o({type:"stateUpdated",payload:{stepName:Qe.POPUPS,state:l?"denied":"granted"}}),e()},c2=t=>{const{dispatchAction:n}=t;n({type:"completed",payload:{stepName:Qe.PWA_INSTALL}})},l2={[Qe.WINDOW_MANAGEMENT]:i2,[Qe.NOTIFICATIONS]:a2,[Qe.POPUPS]:s2,[Qe.PWA_INSTALL]:c2},u2=({settings:t})=>{const{permission:n}=Rn(),[e,o]=ln("localStorage",kr,Sr),[r,i]=g.useReducer(r2,wb),[a,c]=g.useState(!1),[l,u]=g.useState(!1),f=Kr.find(y=>!r[y.name].isCompleted);if(!f)throw new Error("All setup steps are completed. The SetupSteps component should not be used in such case.");const d=f.name,p=Kr[Kr.length-1].name,{hasEdgeNotificationsPermissionError:h}=o2({edgeNotificationsPermissionTimeout:t.edgeNotificationsPermissionTimeout,isNotificationsPermissionPromptOpen:l&&d===Tn.NOTIFICATIONS}),m=()=>{c(!1),u(!0),l2[d]({handleDeferredStep:()=>c(!0),handleOperationComplete:()=>u(!1),dispatchAction:y=>i(y)}),d===p&&o({isCompleted:!0})},v=()=>{c(!1),i({type:"skipped",payload:{stepName:d}})};return g.useEffect(()=>{h&&(u(!1),c(!0))},[h]),g.useEffect(()=>{var y,k;c(!1),i({type:"stateUpdated",payload:{stepName:Qe.WINDOW_MANAGEMENT,state:$i?(y=n.statuses[Qe.WINDOW_MANAGEMENT])==null?void 0:y.state:"denied"}}),i({type:"stateUpdated",payload:{stepName:Qe.NOTIFICATIONS,state:(k=n.statuses[Qe.NOTIFICATIONS])==null?void 0:k.state}})},[n.statuses]),s.jsxs(Bh,{description:f.description,heading:f.heading,Image:f.Image,title:"Platform Setup",children:[s.jsx(n2,{activeStepName:d,showWarnIcon:a&&d!==Qe.POPUPS,stepsStatuses:r}),s.jsx("p",{className:"io-text-default-lh16",children:a?f.instructions.additional:f.instructions.initial}),s.jsxs(Re,{children:[s.jsx(di,{className:"io-btn io-btn-lg io-btn-primary setup-flow-btn",disabled:l,onClick:m,children:f.actionBtnText}),d!==p&&d!==Qe.WINDOW_MANAGEMENT&&s.jsx(di,{className:"io-btn io-btn-lg io-btn-outline setup-flow-btn",disabled:l,onClick:v,children:"Skip"})]}),l&&s.jsx(Fh,{})]})};const dc=({components:{Logo:t=Er,Loader:n=Fn}={},settings:e={}})=>{const{permission:o}=Rn();return o.isLoading?s.jsx(n,{text:"Checking browser permissions..."}):s.jsx(Rh,{Logo:t,children:s.jsx(u2,{settings:{...hb,...e}})})};const fc=({errorMessage:t})=>{const n="https://support.interop.io",e=s.jsxs(s.Fragment,{children:["It seems that the following error prevents io.Connect Browser",s.jsx("br",{}),"from operating properly:",s.jsxs("span",{className:"browser-start-failed-error",children:["“",t,"”"]}),s.jsxs("span",{className:"help-center-info",children:["For further assistance, visit our"," ",s.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:"help center"}),"."]}),s.jsx("span",{className:"thank-you",children:"Thank you for your cooperation."})]});return s.jsx(Rh,{Logo:Er,children:s.jsx(Bh,{className:"io-init-error-card",heading:"Oops! io.Connect Browser couldn't start...",description:e,Image:pb,children:s.jsx(di,{className:"io-btn io-btn-lg io-btn-primary",onClick:()=>window.open(n,"_blank","noopener,noreferrer"),children:"Visit the interop.io Help Center"})})})},Hh=()=>s.jsxs(s.Fragment,{children:[s.jsx(sn,{tag:"h1",className:"login-title",text:"Making Your Work Flow",size:"large"}),s.jsxs("p",{className:"io-text-default-lh16 login-description",children:["Integrate apps, simplify user experiences and accelerate",s.jsx("br",{}),"digital transformation."]})]}),Wh=({Logo:t,children:n,className:e})=>s.jsx("div",{className:"login-page-background",children:s.jsxs("div",{className:ot(e,"login-form-container flex flex-column ai-center"),children:[s.jsx(t,{}),n]})}),d2=({onLogin:t,isLoading:n,validationError:e,components:{Logo:o=Er,Heading:r=Hh,Loader:i=Fn}={}})=>n?s.jsx(i,{text:"Verifying credentials..."}):s.jsxs(Wh,{Logo:o,children:[s.jsx(r,{}),s.jsx(Ye,{className:"auth0-login-btn",onClick:t,size:"large",variant:"primary",children:"Log In"}),e&&s.jsx(Qh,{variant:"critical",text:e.message})]}),Gl=(t,n)=>{const e=n.value,o=e.trim().length>3;return{value:e,isValid:o}},f2=({onLogin:t,setIsLoading:n,loginError:e,setLoginError:o,userInputName:r="email"})=>{const[i,a]=g.useReducer(Gl,{value:"",isValid:!1}),[c,l]=g.useReducer(Gl,{value:"",isValid:!1}),[u,f]=g.useState(!1),[d,p]=g.useState(!1),{isValid:h}=i,{isValid:m}=c,v=h&&m,y=E=>a({value:E.target.value}),k=E=>l({value:E.target.value}),S=()=>{h||f(!0)},b=()=>{m||p(!0)},w=async E=>{if(E.preventDefault(),!!v){n(!0);try{await t(i.value,c.value)}catch(O){o(O)}n(!1)}};return s.jsxs("form",{className:"simple-login-form",onSubmit:w,children:[s.jsx(no,{id:"user",errorMessage:u?`The ${r} is too short`:void 0,autoFocus:!0,autoComplete:"off",type:"text",placeholder:`Enter your ${r}`,value:i.value,onChange:y,onBlur:S,onFocus:()=>f(!1)}),s.jsx(no,{id:"password",errorMessage:d?"The password is too short":void 0,autoComplete:"off",type:"password",placeholder:"Enter your password",value:c.value,onChange:k,onBlur:b,onFocus:()=>p(!1)}),s.jsx(Ye,{type:"submit",size:"large",variant:"primary",children:"Log In"}),e&&s.jsxs("div",{className:"login-error-feedback",children:[s.jsx(nt,{className:"error-icon",variant:"close",size:"12"}),e.message]})]})};const p2=({onLogin:t,userInputName:n,components:{Logo:e=Er,Heading:o=Hh,Loader:r=Fn}={}})=>{const[i,a]=g.useState(!1),[c,l]=g.useState(null);return i?s.jsx(r,{text:"Verifying credentials..."}):s.jsxs(Wh,{Logo:e,children:[s.jsx(o,{}),s.jsx(f2,{onLogin:t,setIsLoading:a,loginError:c,setLoginError:l,userInputName:n})]})};function h2(t,n){const[e,o]=g.useState(!0),r=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{let i;return(async()=>{if(!r.workspaces)return;let a;try{a=await r.workspaces.getWorkspaceById(t)}catch(l){console.warn(l);return}const c=a.getAllGroups().find(l=>l.id===n);c&&(i=await c.onLockConfigurationChanged(({showAddWindowButton:l})=>{l!==void 0&&o(l)}),o(!!c.showAddWindowButton))})(),()=>i==null?void 0:i()},[t,n,r.workspaces]),e}const m2=({groupId:t,workspaceId:n})=>{const e=h2(n,t),o=g.useCallback(r=>{Eo.showAddApplicationPopup({bounds:r,groupId:t,workspaceId:n})},[t,n]);return e&&s.jsx(Eo.AddWindowButton,{title:"Add App",visible:e,showPopup:o})},g2=t=>s.jsx(Eo.GroupHeaderButtons,{...t,addWindow:{visible:!1,showPopup:t.addWindow.showPopup}}),v2=()=>null;const $h=({className:t,components:n,onClose:e,title:o})=>{const{NotificationsProvider:r,NotificationsPanelProvider:i,SettingsPanel:a}=Ps;return s.jsx(r,{children:s.jsx(i,{children:s.jsx(a,{className:t,components:n,onClose:e,title:o})})})};const zh=hv.Panel;const Uh=({className:t,components:n,onClose:e,title:o})=>{const r=g.useContext(Me.IOConnectContext),{onLogout:i}=kh(),[a,c]=ln("sessionStorage",$p,zp),{login:{setIsLoggingOut:l}}=Rn(),u=g.useCallback(async()=>{var f;if("modals"in r&&r.modals){const d="log-out",{isEnterPressed:p,responseButtonClicked:h}=await r.modals.dialogs.request({templateName:Lo.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:"Logging out of io.Connect Browser",text:"This will terminate your session.",actionButtons:[{variant:"primary",text:"Log out",id:d,autofocus:!0},{variant:"outline",text:"Cancel",id:"cancel"}]}});if(!(p||(h==null?void 0:h.id)===d))return}jn.flushSync(()=>l(!0));try{i==null||i()}catch(d){console.error(d)}c(null),await((f=r.webPlatform)==null?void 0:f.system.shutdown()),window.location.reload()},[r,i]);return s.jsx(uv.Panel,{className:t,components:n,onClose:e,onLogout:u,title:o})},y2=[{name:"platformPreferences",displayName:"Platform Preferences",icon:"cog",onClick:t=>t(zh)},{name:"notificationSettings",displayName:"Notification Settings",icon:"bell",onClick:t=>t($h),separatorAfter:!0},{name:"profile",displayName:"Profile",icon:"user",onClick:t=>t(Uh)}],w2=t=>({onClose:n})=>s.jsx(t,{className:"system-menu-panel",onClose:n});const Vh=({actions:t,panelWrapperClassName:n})=>{const[e,o]=g.useState(),r=g.useRef(null),i=Qp(),a=g.useCallback(()=>o(void 0),[]),c=!!e;g.useEffect(()=>{!c||i!=="Escape"||a()},[c,i]);const l=g.useCallback((u,f)=>{const d=t.find(({name:h})=>h===f.name);if(!d){console.error(`Action named ${f.name} is not part of the provided list of actions: ${JSON.stringify(t)}!`);return}const p=h=>{const m=w2(h);o(()=>m)};d.onClick(p)},[t]);return Xs({eventType:"mouseup",handler:a,ref:r,skip:!c}),Js({handler:a,skip:!c}),s.jsxs(s.Fragment,{children:[s.jsx(nc,{buttonSize:"32",iconSize:"16",actions:t,onActionItemClick:l,icon:"ellipsis-vertical",buttonVariant:"circle",placement:"bottom-end",offset:[0,8],"data-testid":"system-menu-button",contextMenuDataTestId:"system-menu"}),s.jsx(Eh,{className:ot("system-menu-panel-wrapper",n),isOpen:c,onClose:a,Panel:e,position:"right",ref:r})]})},b2=()=>s.jsx("li",{className:"default-header-system-menu",children:s.jsx(Vh,{actions:y2})}),x2=()=>{const{showNotificationBadge:t}=gw(),n=Xp(),o=g.useMemo(()=>n.filter(({state:r})=>r==="Active"||r==="Stale"),[n]).length;return o>0&&t?s.jsx("div",{className:"io-badge io-badge-primary notifications-badge",children:o<100?o:"99+"}):null};const Gh=t=>{const{className:n,active:e,...o}=t;return s.jsxs("div",{className:ot(n,"notifications-panel-button"),...o,children:[s.jsx(Ve,{icon:"bell",size:"32",iconSize:"16",variant:"circle"}),s.jsx(x2,{})]})},Yh=({className:t,components:n,onClose:e,settings:o,title:r})=>{const{NotificationsProvider:i,NotificationsPanelProvider:a,Panel:c}=Ps;return s.jsx(i,{children:s.jsx(a,{children:s.jsx(c,{className:t,components:n,onClose:e,settings:o,title:r})})})},Zh=({Button:t=Gh,Panel:n=Yh,position:e="right",...o})=>{const r=Xp(),i=g.useContext(Me.IOConnectContext),a=g.useCallback(async()=>{await Promise.all(r.map(({id:c})=>i.notifications.setState(c,"Seen")))},[r]);return s.jsx(rc,{Button:t,Panel:n,position:e,onClose:a,...o})};const C2=()=>s.jsxs(s.Fragment,{children:[s.jsx(Zh,{tag:"li"}),s.jsx(b2,{})]}),pc=({onLogout:t,workspaces:n,launchpad:e,Loader:o=Fn,isBeforeunloadDialogEnabled:r})=>{var v,y,k,S;const{LogoComponent:i,SystemButtonsComponent:a}=((v=n==null?void 0:n.components)==null?void 0:v.header)??{},{setPlatformWindow:c}=Qs(),{isInitialSetupCompleted:l}=dd(),u=(y=window.iobrowser)==null?void 0:y.platformStarted,f=i??(u?jh:v2),d=a??(u?C2:void 0),p=fw(),{login:{isLoggingOut:h}}=Rn();Py(r===!1||h),g.useEffect(()=>{u&&c({name:window.name})},[u,c]);const m=g.useMemo(()=>({onLogout:t,launchpadSettings:e==null?void 0:e.settings,launchpadComponents:e==null?void 0:e.components}),[t,e==null?void 0:e.settings,e==null?void 0:e.components]);return s.jsxs(Ch.Provider,{value:m,children:[(!p||!l)&&s.jsx(o,{text:"Loading io.Connect Home..."}),s.jsx(Eo,{components:{...n==null?void 0:n.components,header:{...(k=n==null?void 0:n.components)==null?void 0:k.header,LogoComponent:f,SystemButtonsComponent:d},groupHeader:{AfterTabsComponent:m2,ButtonsComponent:g2,...(S=n==null?void 0:n.components)==null?void 0:S.groupHeader}}})]})},k2=Xe({id:Dt,username:_e(Dt),email:_e(Dt),firstName:_e(Dt),lastName:_e(Dt),token:_e(Dt),password:_e(Dt)}),S2=({config:t})=>{var k,S,b,w;const{setupFlow:n,login:e,workspaces:o,launchpad:r,getIOConnectConfig:i}=t,[a,c]=ln("localStorage",zy,k2),[l]=ln("localStorage",kr,Sr),[u,f]=g.useState(null),{login:{isLoggingOut:d}}=Rn(),p=qs(),h=((k=t.components)==null?void 0:k.SystemLoader)??Fn,m=((S=t.components)==null?void 0:S.IOInitErrorScreen)??fc,v=g.useCallback(async(E,O)=>{const F=await e.onLogin(E,O);c(F)},[e,c]),y=g.useCallback(()=>{var E;(E=e.onLogout)==null||E.call(e),c(null)},[e.onLogout,c]);return d?s.jsx(h,{text:"Logging out..."}):a?!(l!=null&&l.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&!p?s.jsx(dc,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:h}}):u&&!u.message.includes("has already been started")?s.jsx(m,{errorMessage:u.message}):s.jsx(Me.IOConnectProvider,{settings:i({type:"simple",user:a}),onInitError:f,fallback:s.jsx(h,{text:"Initializing the platform..."}),children:s.jsx(Ii,{launchpadMode:(b=r==null?void 0:r.settings)==null?void 0:b.mode,children:s.jsx(pc,{workspaces:o,launchpad:r,onLogout:y,isBeforeunloadDialogEnabled:(w=t.settings)==null?void 0:w.isBeforeunloadDialogEnabled,Loader:h})})}):s.jsx(p2,{onLogin:v,userInputName:e.userInputName,components:{...e.components,Loader:h}})},E2=Xe({message:Dt}),j2=t=>{const n=Lh(),[e,o]=g.useState(void 0),[r,i]=ln("sessionStorage",$y,E2),a=g.useMemo(()=>n.user?(t==null?void 0:t(n.user))??{ok:!0}:null,[n.user,t]),c=(a==null?void 0:a.ok)===!1,l=n.isLoading||n.isAuthenticated&&!e,u=c||l,f=g.useMemo(()=>{var d;return a!=null&&a.ok&&((d=n.user)!=null&&d.email)&&e?{username:n.user.name,id:n.user.email,token:e}:null},[n.user,e,a==null?void 0:a.ok]);return g.useEffect(()=>{n.isAuthenticated&&n.getAccessTokenSilently().then(o).catch(console.warn)},[n]),g.useEffect(()=>{if(a){if(a.ok){i(null);return}i({message:a.message}),n.logout()}},[n,i,a]),{isLoading:u,validationError:r,user:f}},ps={POPUP:"popup",REDIRECT:"redirect"},O2=({config:t})=>{var b,w,E,O;const n=Lh(),{setupFlow:e,login:o,launchpad:r,workspaces:i,getIOConnectConfig:a}=t,{isLoading:c,validationError:l,user:u}=j2(o.validateUser),d=(o.loginType??ps.REDIRECT)===ps.REDIRECT?n.loginWithRedirect:n.loginWithPopup,[p]=ln("localStorage",kr,Sr),[h,m]=g.useState(null),{login:{isLoggingOut:v}}=Rn(),y=qs(),k=((b=t.components)==null?void 0:b.SystemLoader)??Fn,S=((w=t.components)==null?void 0:w.IOInitErrorScreen)??fc;return v?s.jsx(k,{text:"Logging out..."}):u?!(p!=null&&p.isCompleted)&&(e==null?void 0:e.enabled)!==!1&&!y?s.jsx(dc,{settings:e==null?void 0:e.settings,components:{...e==null?void 0:e.components,Loader:k}}):h&&!h.message.includes("has already been started")?s.jsx(S,{errorMessage:h.message}):s.jsx(Me.IOConnectProvider,{settings:a({type:"auth0",user:{...n.user,id:u.id,token:u.token}}),onInitError:m,fallback:s.jsx(k,{text:"Initializing the platform..."}),children:s.jsx(Ii,{launchpadMode:(E=r==null?void 0:r.settings)==null?void 0:E.mode,children:s.jsx(pc,{workspaces:i,launchpad:r,onLogout:n.logout,isBeforeunloadDialogEnabled:(O=t.settings)==null?void 0:O.isBeforeunloadDialogEnabled,Loader:k})})}):s.jsx(d2,{onLogin:d,isLoading:c,validationError:l,components:{...o.components,Loader:k}})},Yl=({config:t})=>{var v,y,k,S;const{setupFlow:n,launchpad:e,workspaces:o,getIOConnectConfig:r}=t,{onLogout:i,user:a}=t.login??{},{isPlatformWindow:c}=Qs(),[l]=ln("localStorage",kr,Sr),[u,f]=g.useState(null),{login:{isLoggingOut:d}}=Rn(),p=qs(),h=((v=t.components)==null?void 0:v.SystemLoader)??Fn,m=((y=t.components)==null?void 0:y.IOInitErrorScreen)??fc;return d?s.jsx(h,{text:"Logging out..."}):!(l!=null&&l.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&c&&!p?s.jsx(dc,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:h}}):u&&!u.message.includes("has already been started")?s.jsx(m,{errorMessage:u.message}):s.jsx(Me.IOConnectProvider,{settings:r({type:"custom",user:a}),onInitError:f,fallback:s.jsx(h,{text:"Initializing the platform..."}),children:s.jsx(Ii,{launchpadMode:(k=e==null?void 0:e.settings)==null?void 0:k.mode,children:s.jsx(pc,{workspaces:o,launchpad:e,onLogout:i,isBeforeunloadDialogEnabled:(S=t.settings)==null?void 0:S.isBeforeunloadDialogEnabled,Loader:h})})})},Kh=Xe({Logo:_e(jt().andThen(t=>zt(t,"Logo"))),Heading:_e(jt().andThen(t=>zt(t,"Heading")))}),N2=gr(...Object.values(ps).map(t=>Mn(t))),I2=Xe({type:Mn("auth0"),validateUser:_e(jt().andThen(t=>zt(t,"validateUser"))),loginType:_e(N2),providerOptions:jt(),components:_e(Kh)}),P2=Xe({type:Mn("simple"),onLogin:jt().andThen(t=>zt(t,"onLogin")),onLogout:_e(jt().andThen(t=>zt(t,"onLogout"))),userInputName:_e(Dt),components:_e(Kh)}),A2=Xe({id:Dt,username:Dt}),T2=Xe({type:Mn("custom"),onLogout:jt().andThen(t=>zt(t,"onLogout")),user:A2}),D2=gr(I2,P2,T2),M2=Xe({edgeNotificationsPermissionTimeout:_e(nw)}),_2=Xe({Logo:_e(jt().andThen(t=>zt(t,"Logo")))}),L2=Xe({enabled:_e(Do()),components:_e(_2),settings:_e(M2)}),R2=Xe({components:_e(jt())}),F2=Xe({BeforeSearch:gr(Mn(null),_e(jt().andThen(t=>zt(t,"BeforeSearch")))),AfterSearch:gr(Mn(null),_e(jt().andThen(t=>zt(t,"AfterSearch"))))}),B2=Xe({Component:jt().andThen(t=>zt(t,"Component")),placementId:Dt}),H2=Xe({header:_e(F2),sections:_e(ew(B2))}),W2=Xe({showHeader:_e(Do()),showSearch:_e(Do())}),$2=Xe({header:_e(W2),mode:_e(gr(Mn("pinned"),Mn("default")))}),z2=Xe({components:_e(H2),settings:_e($2)}),U2=Xe({SystemLoader:_e(jt().andThen(t=>zt(t,"SystemLoader"))),IOInitErrorScreen:_e(jt().andThen(t=>zt(t,"IOInitErrorScreen")))}),V2=Xe({isBeforeunloadDialogEnabled:_e(Do())}),G2=Xe({getIOConnectConfig:jt().andThen(t=>zt(t,"getIOConnectConfig")),login:_e(D2),setupFlow:_e(L2),workspaces:_e(R2),launchpad:_e(z2),components:_e(U2),settings:_e(V2)}),Y2=({config:t})=>{var i;const n=g.useMemo(()=>G2.runWithException(t),[t]),e=n.login,{isPlatformWindow:o}=Qs();if(!e||!o){const{login:a,...c}=n;return s.jsx(Yl,{config:c})}if(e.type==="custom")return s.jsx(Yl,{config:n});if(e.type==="simple")return s.jsx(S2,{config:n});const{providerOptions:r}=e;return s.jsx(Xb,{...r,authorizationParams:{...r.authorizationParams,redirect_uri:((i=r.authorizationParams)==null?void 0:i.redirect_uri)??window.location.origin},children:s.jsx(O2,{config:n})})};const Z2=({config:t})=>s.jsx(cb,{children:s.jsx(Y2,{config:t})});exports.ApplicationsSection=ah;exports.FavoritesSection=sh;exports.IOActivePanelRenderer=pv;exports.IOConnectHome=Z2;exports.IODownloadManager=Gg;exports.IONotifications=Ps;exports.Launchpad=xh;exports.LaunchpadAccess=jh;exports.LaunchpadBody=bh;exports.LaunchpadContentsContainer=ph;exports.LaunchpadHeader=mh;exports.LaunchpadPinButton=hh;exports.NotificationSettingsPanel=$h;exports.NotificationsPanel=Yh;exports.NotificationsPanelButton=Gh;exports.NotificationsPanelWithToggleButton=Zh;exports.PanelWithToggleButton=rc;exports.PlatformPrefsProvider=Ii;exports.PreferencesPanel=zh;exports.ProfilePanel=Uh;exports.Section=Wi;exports.SystemLoader=Fn;exports.SystemMenu=Vh;exports.WorkspacesSection=gh;exports.useFavorites=Fi;exports.useIsLaunchpadCollapsed=Ks;exports.usePlatformPref=Wt;exports.usePlatformPrefs=dd;
60
+ `)})(),n.cache&&n.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),n.cache)o=n.cache;else{if(e=n.cacheLocation||"memory",!$l(e))throw new Error(`Invalid cache location "${e}"`);o=$l(e)()}this.httpTimeoutMs=n.httpTimeoutInSeconds?1e3*n.httpTimeoutInSeconds:1e4,this.cookieStorage=n.legacySameSiteCookie===!1?yo:Rb,this.orgHintCookieName=`auth0.${this.options.clientId}.organization_hint`,this.isAuthenticatedCookieName=(a=>`auth0.${a}.is.authenticated`)(this.options.clientId),this.sessionCheckExpiryDays=n.sessionCheckExpiryDays||1;const r=n.useCookiesForTransactions?this.cookieStorage:Fb;var i;this.scope=qo("openid",this.options.authorizationParams.scope,this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new Db(r,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Nh,this.cacheManager=new Tb(o,o.allKeys?void 0:new Wb(o,this.options.clientId),this.nowProvider),this.domainUrl=(i=this.options.domain,/^https?:\/\//.test(i)?i:`https://${i}`),this.tokenIssuer=((a,c)=>a?a.startsWith("https://")?a:`https://${a}/`:`${c}/`)(this.options.issuer,this.domainUrl),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&e==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new Hb)}_url(n){const e=encodeURIComponent(btoa(JSON.stringify(this.options.auth0Client||Oh)));return`${this.domainUrl}${n}&auth0Client=${e}`}_authorizeUrl(n){return this._url(`/authorize?${fs(n)}`)}async _verifyIdToken(n,e,o){const r=await this.nowProvider();return _b({iss:this.tokenIssuer,aud:this.options.clientId,id_token:n,nonce:e,organization:o,leeway:this.options.leeway,max_age:(i=this.options.authorizationParams.max_age,typeof i!="string"?i:parseInt(i,10)||void 0),now:r});var i}_processOrgHint(n){n?this.cookieStorage.save(this.orgHintCookieName,n,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(n,e,o){const r=Rl(wa()),i=Rl(wa()),a=wa(),c=(f=>{const d=new Uint8Array(f);return(p=>{const h={"+":"-","/":"_","=":""};return p.replace(/[+/=]/g,m=>h[m])})(window.btoa(String.fromCharCode(...Array.from(d))))})(await(async f=>await qr().subtle.digest({name:"SHA-256"},new TextEncoder().encode(f)))(a)),l=((f,d,p,h,m,v,y,k)=>Object.assign(Object.assign(Object.assign({client_id:f.clientId},f.authorizationParams),p),{scope:qo(d,p.scope),response_type:"code",response_mode:k||"query",state:h,nonce:m,redirect_uri:y||f.authorizationParams.redirect_uri,code_challenge:v,code_challenge_method:"S256"}))(this.options,this.scope,n,r,i,c,n.redirect_uri||this.options.authorizationParams.redirect_uri||o,e==null?void 0:e.response_mode),u=this._authorizeUrl(l);return{nonce:i,code_verifier:a,scope:l.scope,audience:l.audience||"default",redirect_uri:l.redirect_uri,state:r,url:u}}async loginWithPopup(n,e){var o;if(n=n||{},!(e=e||{}).popup&&(e.popup=(c=>{const l=window.screenX+(window.innerWidth-400)/2,u=window.screenY+(window.innerHeight-600)/2;return window.open(c,"auth0:authorize:popup",`left=${l},top=${u},width=400,height=600,resizable,scrollbars=yes,status=1`)})(""),!e.popup))throw new Error("Unable to open a popup for loginWithPopup - window.open returned `null`");const r=await this._prepareAuthorizeUrl(n.authorizationParams||{},{response_mode:"web_message"},window.location.origin);e.popup.location.href=r.url;const i=await(c=>new Promise((l,u)=>{let f;const d=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(d),clearTimeout(p),window.removeEventListener("message",f,!1),u(new lc(c.popup)))},1e3),p=setTimeout(()=>{clearInterval(d),u(new cc(c.popup)),window.removeEventListener("message",f,!1)},1e3*(c.timeoutInSeconds||60));f=function(h){if(h.data&&h.data.type==="authorization_response"){if(clearTimeout(p),clearInterval(d),window.removeEventListener("message",f,!1),c.popup.close(),h.data.response.error)return u(St.fromPayload(h.data.response));l(h.data.response)}},window.addEventListener("message",f)}))(Object.assign(Object.assign({},e),{timeoutInSeconds:e.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==i.state)throw new St("state_mismatch","Invalid state");const a=((o=n.authorizationParams)===null||o===void 0?void 0:o.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:r.audience,scope:r.scope,code_verifier:r.code_verifier,grant_type:"authorization_code",code:i.code,redirect_uri:r.redirect_uri},{nonceIn:r.nonce,organization:a})}async getUser(){var n;const e=await this._getIdTokenFromCache();return(n=e==null?void 0:e.decodedToken)===null||n===void 0?void 0:n.user}async getIdTokenClaims(){var n;const e=await this._getIdTokenFromCache();return(n=e==null?void 0:e.decodedToken)===null||n===void 0?void 0:n.claims}async loginWithRedirect(n={}){var e;const o=zl(n),{openUrl:r,fragment:i,appState:a}=o,c=tn(o,["openUrl","fragment","appState"]),l=((e=c.authorizationParams)===null||e===void 0?void 0:e.organization)||this.options.authorizationParams.organization,u=await this._prepareAuthorizeUrl(c.authorizationParams||{}),{url:f}=u,d=tn(u,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:a}),l&&{organization:l}));const p=i?`${f}#${i}`:f;r?await r(p):window.location.assign(p)}async handleRedirectCallback(n=window.location.href){const e=n.split("?").slice(1);if(e.length===0)throw new Error("There are no query params available for parsing.");const{state:o,code:r,error:i,error_description:a}=(d=>{d.indexOf("#")>-1&&(d=d.substring(0,d.indexOf("#")));const p=new URLSearchParams(d);return{state:p.get("state"),code:p.get("code")||void 0,error:p.get("error")||void 0,error_description:p.get("error_description")||void 0}})(e.join("")),c=this.transactionManager.get();if(!c)throw new St("missing_transaction","Invalid state");if(this.transactionManager.remove(),i)throw new sc(i,a||i,o,c.appState);if(!c.code_verifier||c.state&&c.state!==o)throw new St("state_mismatch","Invalid state");const l=c.organization,u=c.nonce,f=c.redirect_uri;return await this._requestToken(Object.assign({audience:c.audience,scope:c.scope,code_verifier:c.code_verifier,grant_type:"authorization_code",code:r},f?{redirect_uri:f}:{}),{nonceIn:u,organization:l}),{appState:c.appState}}async checkSession(n){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get("auth0.is.authenticated"))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove("auth0.is.authenticated")}try{await this.getTokenSilently(n)}catch{}}async getTokenSilently(n={}){var e;const o=Object.assign(Object.assign({cacheMode:"on"},n),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),n.authorizationParams),{scope:qo(this.scope,(e=n.authorizationParams)===null||e===void 0?void 0:e.scope)})}),r=await((i,a)=>{let c=xa[a];return c||(c=i().finally(()=>{delete xa[a],c=null}),xa[a]=c),c})(()=>this._getTokenSilently(o),`${this.options.clientId}::${o.authorizationParams.audience}::${o.authorizationParams.scope}`);return n.detailedResponse?r:r==null?void 0:r.access_token}async _getTokenSilently(n){const{cacheMode:e}=n,o=tn(n,["cacheMode"]);if(e!=="off"){const r=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(r)return r}if(e!=="cache-only"){if(!await(async(r,i=3)=>{for(let a=0;a<i;a++)if(await r())return!0;return!1})(()=>Ca.acquireLock("auth0.lock.getTokenSilently",5e3),10))throw new yr;try{if(window.addEventListener("pagehide",this._releaseLockOnPageHide),e!=="off"){const u=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(u)return u}const r=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(o):await this._getTokenFromIFrame(o),{id_token:i,access_token:a,oauthTokenScope:c,expires_in:l}=r;return Object.assign(Object.assign({id_token:i,access_token:a},c?{scope:c}:null),{expires_in:l})}finally{await Ca.releaseLock("auth0.lock.getTokenSilently"),window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}}async getTokenWithPopup(n={},e={}){var o;const r=Object.assign(Object.assign({},n),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),n.authorizationParams),{scope:qo(this.scope,(o=n.authorizationParams)===null||o===void 0?void 0:o.scope)})});return e=Object.assign(Object.assign({},Eb),e),await this.loginWithPopup(r,e),(await this.cacheManager.get(new nn({scope:r.authorizationParams.scope,audience:r.authorizationParams.audience||"default",clientId:this.options.clientId}))).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(n){n.clientId!==null?n.clientId=n.clientId||this.options.clientId:delete n.clientId;const e=n.logoutParams||{},{federated:o}=e,r=tn(e,["federated"]),i=o?"&federated":"";return this._url(`/v2/logout?${fs(Object.assign({clientId:n.clientId},r))}`)+i}async logout(n={}){const e=zl(n),{openUrl:o}=e,r=tn(e,["openUrl"]);n.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(n.clientId||this.options.clientId),this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(this.isAuthenticatedCookieName,{cookieDomain:this.options.cookieDomain}),this.userCache.remove("@@user@@");const i=this._buildLogoutUrl(r);o?await o(i):o!==!1&&window.location.assign(i)}async _getTokenFromIFrame(n){const e=Object.assign(Object.assign({},n.authorizationParams),{prompt:"none"}),o=this.cookieStorage.get(this.orgHintCookieName);o&&!e.organization&&(e.organization=o);const{url:r,state:i,nonce:a,code_verifier:c,redirect_uri:l,scope:u,audience:f}=await this._prepareAuthorizeUrl(e,{response_mode:"web_message"},window.location.origin);try{if(window.crossOriginIsolated)throw new St("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const d=n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let p;try{p=new URL(this.domainUrl).origin}catch{p=this.domainUrl}const h=await((v,y,k=60)=>new Promise((S,b)=>{const w=window.document.createElement("iframe");w.setAttribute("width","0"),w.setAttribute("height","0"),w.style.display="none";const E=()=>{window.document.body.contains(w)&&(window.document.body.removeChild(w),window.removeEventListener("message",O,!1))};let O;const F=setTimeout(()=>{b(new yr),E()},1e3*k);O=function(R){if(R.origin!=y||!R.data||R.data.type!=="authorization_response")return;const U=R.source;U&&U.close(),R.data.response.error?b(St.fromPayload(R.data.response)):S(R.data.response),clearTimeout(F),window.removeEventListener("message",O,!1),setTimeout(E,2e3)},window.addEventListener("message",O,!1),window.document.body.appendChild(w),w.setAttribute("src",v)}))(r,p,d);if(i!==h.state)throw new St("state_mismatch","Invalid state");const m=await this._requestToken(Object.assign(Object.assign({},n.authorizationParams),{code_verifier:c,code:h.code,grant_type:"authorization_code",redirect_uri:l,timeout:n.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:a,organization:e.organization});return Object.assign(Object.assign({},m),{scope:u,oauthTokenScope:m.scope,audience:f})}catch(d){throw d.error==="login_required"&&this.logout({openUrl:!1}),d}}async _getTokenUsingRefreshToken(n){const e=await this.cacheManager.get(new nn({scope:n.authorizationParams.scope,audience:n.authorizationParams.audience||"default",clientId:this.options.clientId}));if(!(e&&e.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(n);throw new zi(n.authorizationParams.audience||"default",n.authorizationParams.scope)}const o=n.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,r=typeof n.timeoutInSeconds=="number"?1e3*n.timeoutInSeconds:null;try{const i=await this._requestToken(Object.assign(Object.assign(Object.assign({},n.authorizationParams),{grant_type:"refresh_token",refresh_token:e&&e.refresh_token,redirect_uri:o}),r&&{timeout:r}));return Object.assign(Object.assign({},i),{scope:n.authorizationParams.scope,oauthTokenScope:i.scope,audience:n.authorizationParams.audience||"default"})}catch(i){if((i.message.indexOf("Missing Refresh Token")>-1||i.message&&i.message.indexOf("invalid refresh token")>-1)&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(n);throw i}}async _saveEntryInCache(n){const{id_token:e,decodedToken:o}=n,r=tn(n,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:e,decodedToken:o}),await this.cacheManager.setIdToken(this.options.clientId,n.id_token,n.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const n=this.options.authorizationParams.audience||"default",e=await this.cacheManager.getIdToken(new nn({clientId:this.options.clientId,audience:n,scope:this.scope})),o=this.userCache.get("@@user@@");return e&&e.id_token===(o==null?void 0:o.id_token)?o:(this.userCache.set("@@user@@",e),e)}async _getEntryFromCache({scope:n,audience:e,clientId:o}){const r=await this.cacheManager.get(new nn({scope:n,audience:e,clientId:o}),60);if(r&&r.access_token){const{access_token:i,oauthTokenScope:a,expires_in:c}=r,l=await this._getIdTokenFromCache();return l&&Object.assign(Object.assign({id_token:l.id_token,access_token:i},a?{scope:a}:null),{expires_in:c})}}async _requestToken(n,e){const{nonceIn:o,organization:r}=e||{},i=await Pb(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs},n),this.worker),a=await this._verifyIdToken(i.id_token,o,r);return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},i),{decodedToken:a,scope:n.scope,audience:n.audience||"default"}),i.scope?{oauthTokenScope:i.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(r||a.claims.org_id),Object.assign(Object.assign({},i),{decodedToken:a})}async exchangeToken(n){return this._requestToken({grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:n.subject_token,subject_token_type:n.subject_token_type,scope:qo(n.scope,this.scope),audience:n.audience||this.options.authorizationParams.audience})}}var Th={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},pn=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},Ub=yt(yt({},Th),{buildAuthorizeUrl:pn,buildLogoutUrl:pn,getAccessTokenSilently:pn,getAccessTokenWithPopup:pn,getIdTokenClaims:pn,loginWithRedirect:pn,loginWithPopup:pn,logout:pn,handleRedirectCallback:pn}),Dh=g.createContext(Ub),Ul=function(t){xb(n,t);function n(e,o){var r=t.call(this,o??e)||this;return r.error=e,r.error_description=o,Object.setPrototypeOf(r,n.prototype),r}return n}(Error),Vb=/[?&]code=[^&]+/,Gb=/[?&]state=[^&]+/,Yb=/[?&]error=[^&]+/,Zb=function(t){return t===void 0&&(t=window.location.search),(Vb.test(t)||Yb.test(t))&&Gb.test(t)},Mh=function(t){return function(n){return n instanceof Error?n:n!==null&&typeof n=="object"&&"error"in n&&typeof n.error=="string"?"error_description"in n&&typeof n.error_description=="string"?new Ul(n.error,n.error_description):new Ul(n.error):new Error(t)}},Vl=Mh("Login failed"),ka=Mh("Get access token failed"),_h=function(t){var n,e;t!=null&&t.redirectUri&&(console.warn("Using `redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `redirectUri` will be no longer supported in a future version"),t.authorizationParams=(n=t.authorizationParams)!==null&&n!==void 0?n:{},t.authorizationParams.redirect_uri=t.redirectUri,delete t.redirectUri),!((e=t==null?void 0:t.authorizationParams)===null||e===void 0)&&e.redirectUri&&(console.warn("Using `authorizationParams.redirectUri` has been deprecated, please use `authorizationParams.redirect_uri` instead as `authorizationParams.redirectUri` will be removed in a future version"),t.authorizationParams.redirect_uri=t.authorizationParams.redirectUri,delete t.authorizationParams.redirectUri)},Kb=function(t,n){switch(n.type){case"LOGIN_POPUP_STARTED":return yt(yt({},t),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return yt(yt({},t),{isAuthenticated:!!n.user,user:n.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return t.user===n.user?t:yt(yt({},t),{isAuthenticated:!!n.user,user:n.user});case"LOGOUT":return yt(yt({},t),{isAuthenticated:!1,user:void 0});case"ERROR":return yt(yt({},t),{isLoading:!1,error:n.error})}},qb=function(t){return _h(t),yt(yt({},t),{auth0Client:{name:"auth0-react",version:"2.4.0"}})},Jb=function(t){var n;window.history.replaceState({},document.title,(n=t==null?void 0:t.returnTo)!==null&&n!==void 0?n:window.location.pathname)},Xb=function(t){var n=t.children,e=t.skipRedirectCallback,o=t.onRedirectCallback,r=o===void 0?Jb:o,i=t.context,a=i===void 0?Dh:i,c=Cb(t,["children","skipRedirectCallback","onRedirectCallback","context"]),l=g.useState(function(){return new zb(qb(c))})[0],u=g.useReducer(Kb,Th),f=u[0],d=u[1],p=g.useRef(!1),h=g.useCallback(function(O){return d({type:"ERROR",error:O}),O},[]);g.useEffect(function(){p.current||(p.current=!0,function(){return ho(void 0,void 0,void 0,function(){var O,F,R;return mo(this,function(U){switch(U.label){case 0:return U.trys.push([0,7,,8]),O=void 0,Zb()&&!e?[4,l.handleRedirectCallback()]:[3,3];case 1:return F=U.sent().appState,[4,l.getUser()];case 2:return O=U.sent(),r(F,O),[3,6];case 3:return[4,l.checkSession()];case 4:return U.sent(),[4,l.getUser()];case 5:O=U.sent(),U.label=6;case 6:return d({type:"INITIALISED",user:O}),[3,8];case 7:return R=U.sent(),h(Vl(R)),[3,8];case 8:return[2]}})})}())},[l,r,e,h]);var m=g.useCallback(function(O){return _h(O),l.loginWithRedirect(O)},[l]),v=g.useCallback(function(O,F){return ho(void 0,void 0,void 0,function(){var R,U;return mo(this,function(K){switch(K.label){case 0:d({type:"LOGIN_POPUP_STARTED"}),K.label=1;case 1:return K.trys.push([1,3,,4]),[4,l.loginWithPopup(O,F)];case 2:return K.sent(),[3,4];case 3:return R=K.sent(),h(Vl(R)),[2];case 4:return[4,l.getUser()];case 5:return U=K.sent(),d({type:"LOGIN_POPUP_COMPLETE",user:U}),[2]}})})},[l,h]),y=g.useCallback(function(){for(var O=[],F=0;F<arguments.length;F++)O[F]=arguments[F];return ho(void 0,kb([],O,!0),void 0,function(R){return R===void 0&&(R={}),mo(this,function(U){switch(U.label){case 0:return[4,l.logout(R)];case 1:return U.sent(),(R.openUrl||R.openUrl===!1)&&d({type:"LOGOUT"}),[2]}})})},[l]),k=g.useCallback(function(O){return ho(void 0,void 0,void 0,function(){var F,R,U,K;return mo(this,function(_){switch(_.label){case 0:return _.trys.push([0,2,3,5]),[4,l.getTokenSilently(O)];case 1:return F=_.sent(),[3,5];case 2:throw R=_.sent(),ka(R);case 3:return U=d,K={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return U.apply(void 0,[(K.user=_.sent(),K)]),[7];case 5:return[2,F]}})})},[l]),S=g.useCallback(function(O,F){return ho(void 0,void 0,void 0,function(){var R,U,K,_;return mo(this,function(A){switch(A.label){case 0:return A.trys.push([0,2,3,5]),[4,l.getTokenWithPopup(O,F)];case 1:return R=A.sent(),[3,5];case 2:throw U=A.sent(),ka(U);case 3:return K=d,_={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,l.getUser()];case 4:return K.apply(void 0,[(_.user=A.sent(),_)]),[7];case 5:return[2,R]}})})},[l]),b=g.useCallback(function(){return l.getIdTokenClaims()},[l]),w=g.useCallback(function(O){return ho(void 0,void 0,void 0,function(){var F,R,U;return mo(this,function(K){switch(K.label){case 0:return K.trys.push([0,2,3,5]),[4,l.handleRedirectCallback(O)];case 1:return[2,K.sent()];case 2:throw F=K.sent(),ka(F);case 3:return R=d,U={type:"HANDLE_REDIRECT_COMPLETE"},[4,l.getUser()];case 4:return R.apply(void 0,[(U.user=K.sent(),U)]),[7];case 5:return[2]}})})},[l]),E=g.useMemo(function(){return yt(yt({},f),{getAccessTokenSilently:k,getAccessTokenWithPopup:S,getIdTokenClaims:b,loginWithRedirect:m,loginWithPopup:v,logout:y,handleRedirectCallback:w})},[f,k,S,b,m,v,y,w]);return g.createElement(a.Provider,{value:E},n)},Lh=function(t){return t===void 0&&(t=Dh),g.useContext(t)};const Rh=({className:t,children:n,Logo:e})=>s.jsxs("div",{className:et("info-page-container",t),children:[s.jsx(e,{className:"info-page-logo"}),s.jsx("div",{className:"info-page-wrapper",children:n})]}),Qb={value:"data:image/svg+xml,%3Csvg width='5041' height='1232' viewBox='0 0 5041 1232' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_879_362)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M548.6 178H439.6C368.7 178 310 199.5 269.3 244.5C228.6 289.3 206.7 356 206.7 444.3C206.7 532.6 228.6 599.5 269.3 644.2C310.2 689.2 368.7 710.7 439.6 710.7H548.6C619 710.7 677.6 689.2 718.6 644.2C759.5 599.4 781.6 532.6 781.6 444.2C781.6 355.8 759.5 289 718.6 244.2C677.7 199.3 619 177.7 548.6 177.7V178ZM449.5 293.8H538.9C582.2 293.8 611.9 305.2 631.1 328.3C650.5 351.8 660.5 389.2 660.5 444.4C660.5 499.6 650.5 536.7 631.1 560C612 583 582.2 594.1 538.9 594.1H449.5C405.6 594.1 375.9 583 356.9 560C337.6 536.8 327.7 499.7 327.7 444.5C327.7 389.3 337.4 351.9 356.8 328.4C375.9 305.2 405.6 293.8 449.5 293.8Z' fill='white'/%3E%3Cpath d='M0.700195 189.8C0.700195 183.1 6.10017 177.7 12.8002 177.7H108.6C115.3 177.7 120.7 183.1 120.7 189.8V698.6C120.7 705.3 115.3 710.7 108.6 710.7H12.8002C6.10017 710.7 0.700195 705.3 0.700195 698.6V189.8Z' fill='white'/%3E%3Cpath d='M0.700195 11.9002C0.700195 5.7002 5.70018 0.700195 11.9002 0.700195H109.6C115.7 0.700195 120.7 5.7002 120.7 11.9002V109.5C120.7 115.7 115.7 120.7 109.5 120.7H11.9002C5.70018 120.7 0.700195 115.7 0.700195 109.5V11.9002Z' fill='%23007BE5'/%3E%3Cpath d='M827.7 601.9C827.7 595.7 832.7 590.7 838.9 590.7H936.6C942.8 590.7 947.8 595.7 947.8 601.9V699.5C947.8 705.7 942.8 710.7 936.6 710.7H838.9C832.7 710.7 827.7 705.7 827.7 699.5V601.9Z' fill='%23007BE5'/%3E%3Cpath d='M4363.9 293.2C4320.2 293.2 4290.6 304.6 4271.6 327.8C4252.3 351.4 4242.5 388.8 4242.5 444C4242.5 499.2 4252.3 536.4 4271.5 559.7C4290.5 582.6 4320 593.8 4363.8 593.8H4614.7C4622.4 593.8 4628.7 600.1 4628.7 607.8V696.7C4628.7 704.4 4622.4 710.7 4614.7 710.7H4354.1C4283.3 710.7 4224.9 689.1 4184.1 644.1C4143.5 599.3 4121.6 532.4 4121.6 444C4121.6 355.6 4143.5 288.7 4184.1 243.9C4224.8 199 4283.3 177.3 4354.1 177.3H4614.7C4622.4 177.3 4628.7 183.6 4628.7 191.3V279.3C4628.7 287 4622.4 293.3 4614.7 293.3H4363.9V293.2Z' fill='white'/%3E%3Cpath d='M1302.6 165.3C1240.1 165.3 1197 180.9 1169.3 213.3C1141.3 246 1127.4 297.6 1127.4 372.9C1127.4 447.7 1141.1 499 1169 531.6C1196.6 563.9 1239.7 579.5 1302.7 579.5H1552.5C1560.2 579.5 1566.5 585.8 1566.5 593.5V697.1C1566.5 704.8 1560.2 711.1 1552.5 711.1H1302.7C1204.7 711.1 1127.5 683.4 1075 626.4C1022.4 569.7 995.7 484.8 995.7 372.9C995.7 260.5 1022.7 175.4 1075.2 118.4C1127.9 61.3001 1205 33.6001 1302.6 33.6001H1552.4C1560.1 33.6001 1566.4 39.9001 1566.4 47.6001V151.2C1566.4 158.9 1560.1 165.2 1552.4 165.2H1302.6V165.3Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M1953.6 177.7H1844.8C1774 177.7 1715.6 199.3 1674.8 244.3C1634.2 289.1 1612.3 356 1612.3 444.4C1612.3 532.8 1634.2 599.7 1674.8 644.5C1715.5 689.4 1774 711.1 1844.8 711.1H1953.6C2023.9 711.1 2082.4 689.5 2123.2 644.5C2163.9 599.7 2186 532.8 2186 444.3C2186 355.8 2163.9 289 2123.2 244.1C2082.3 199.3 2023.9 177.7 1953.6 177.7ZM1854.6 293.7H1943.8C1987 293.7 2016.6 305.1 2035.8 328.3C2055.2 351.9 2065.2 389.3 2065.2 444.5C2065.2 499.7 2055.2 536.8 2035.8 560.2C2016.7 583.2 1987.1 594.3 1943.8 594.3H1854.6C1810.8 594.3 1781.3 583.1 1762.3 560.2C1743 536.9 1733.3 499.8 1733.3 444.5C1733.3 389.3 1743.1 351.9 1762.4 328.3C1781.3 305 1810.9 293.7 1854.6 293.7Z' fill='white'/%3E%3Cpath d='M2679.7 411.6C2679.7 372.5 2668.5 343.5 2645.4 324C2622.1 304.3 2585.3 293.2 2531.9 293.2H2378.4C2375.5 293.2 2374.9 293.9 2374.8 294C2374.5 294.4 2373.6 295.8 2373.6 299.8V696.7C2373.6 704.4 2367.3 710.7 2359.6 710.7H2267.7C2260 710.7 2253.7 704.4 2253.7 696.7V265.6C2253.7 234.7 2258.8 212 2272.6 197.2C2286.5 182.2 2307.5 177.3 2334.2 177.3H2531.8C2620.7 177.3 2688 198.4 2733.3 238.9C2778.7 279.5 2800.5 338.6 2800.5 411.7V696.7C2800.5 704.4 2794.2 710.7 2786.5 710.7H2693.7C2686 710.7 2679.7 704.4 2679.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M3304.7 411.6C3304.7 372.5 3293.5 343.5 3270.4 324C3247.1 304.3 3210.3 293.2 3156.9 293.2H3003.4C3000.5 293.2 2999.9 293.9 2999.8 294C2999.5 294.4 2998.6 295.8 2998.6 299.8V696.7C2998.6 704.4 2992.3 710.7 2984.6 710.7H2892.7C2885 710.7 2878.7 704.4 2878.7 696.7V265.6C2878.7 234.7 2883.8 212 2897.6 197.2C2911.5 182.2 2932.5 177.3 2959.2 177.3H3156.8C3245.7 177.3 3313 198.4 3358.3 238.9C3403.7 279.5 3425.5 338.6 3425.5 411.7V696.7C3425.5 704.4 3419.2 710.7 3411.5 710.7H3318.7C3311 710.7 3304.7 704.4 3304.7 696.7V411.6Z' fill='white'/%3E%3Cpath d='M4906.1 292.2C4898.4 292.2 4892.1 298.5 4892.1 306.2V529.2C4892.1 557.5 4897.2 574.3 4906.4 584.1C4915.4 593.8 4930 598.6 4953.7 598.6H5019.2C5026.9 598.6 5033.2 604.9 5033.2 612.6V695.7C5033.2 703.4 5026.9 709.7 5019.2 709.7H4932.1C4877.9 709.7 4836.8 698.8 4809.7 668.6C4782.8 638.6 4771.3 591.5 4771.3 523.4V306.2C4771.3 298.5 4765 292.2 4757.3 292.2H4714.7C4707 292.2 4700.7 285.9 4700.7 278.2V190.2C4700.7 182.5 4707 176.2 4714.7 176.2H4757.3C4765 176.2 4771.3 169.9 4771.3 162.2V67.7002C4771.3 60.0002 4777.6 53.7002 4785.3 53.7002H4878.2C4885.9 53.7002 4892.2 60.0002 4892.2 67.7002V162.2C4892.2 169.9 4898.5 176.2 4906.2 176.2H5021.3C5029 176.2 5035.3 182.5 5035.3 190.2V278.2C5035.3 285.9 5029 292.2 5021.3 292.2H4906.1Z' fill='white'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M4024.4 607.2C4024.4 599.5 4018.1 593.2 4010.4 593.2H3699.9C3672.9 593.2 3655.3 586 3644.6 575.2C3633.8 564.4 3628.6 548.8 3628.6 529.7V514.5C3628.6 506.8 3634.9 500.5 3642.6 500.5H3866.6C3931.2 500.5 3977.4 486.9 4007.5 459.6C4037.7 432.2 4050.1 392.3 4050.1 343.5C4050.1 292.2 4036.8 250.1 4006.4 220.9C3976.1 191.7 3930.1 176.8 3867.7 176.8H3700.1C3633.9 176.8 3586.5 195.4 3555.6 227.8C3524.8 260.1 3511.8 305 3511.8 355.3V531.7C3511.8 582 3524.9 626.9 3555.6 659.2C3586.5 691.6 3633.9 710.2 3700.1 710.2H4010.6C4018.3 710.2 4024.6 703.9 4024.6 696.2V607.2H4024.4ZM3863.5 403.1H3642.5C3634.8 403.1 3628.5 396.8 3628.5 389.1V356.2C3628.5 337.6 3633.7 321.9 3644.6 311C3655.4 300.1 3672.9 292.7 3699.9 292.7H3866.5C3890.7 292.7 3906.9 298.8 3916.9 308.2C3926.9 317.5 3932 331.3 3932 349.4C3932 367.1 3927.3 380 3917.4 388.6C3907.4 397.4 3890.5 403.1 3863.5 403.1Z' fill='white'/%3E%3Cpath d='M2918.9 872.3C3001.9 872.3 3036.9 909.9 3036.9 966.3C3036.9 1012.2 3013.9 1036.8 2973.2 1047.2C3014.4 1058.2 3037.9 1083.7 3037.9 1129.7C3037.9 1186.1 3003.5 1224.7 2920.5 1224.7H2755.6C2741.5 1224.7 2734.2 1217.9 2734.2 1203.8V893.2C2734.2 879.1 2741.5 872.3 2755.6 872.3H2918.9ZM2765.4 1033.1H2918.9C2976.8 1033.1 3005 1014.8 3005 970.5C3005 929.8 2979.4 903.7 2919.4 903.7H2771.2C2767.5 903.7 2765.5 905.3 2765.5 909.4V1033.1H2765.4ZM2765.4 1187.6C2765.4 1191.8 2767.5 1193.3 2771.1 1193.3H2921C2979.5 1193.3 3006.1 1168.2 3006.1 1125.4C3006.1 1081 2976.9 1060.2 2921 1060.2H2765.5V1187.6H2765.4Z' fill='white'/%3E%3Cpath d='M3294 956.9V985.6H3182.8C3148.9 985.6 3135.3 1000.7 3135.3 1033.6V1224.6H3106.1V1029.9C3106.1 979.8 3125.4 956.8 3176.6 956.8H3294V956.9Z' fill='white'/%3E%3Cpath d='M3489.1 956.9C3562.2 956.9 3608.6 1001.3 3608.6 1091C3608.6 1181.3 3562.1 1224.6 3489.1 1224.6H3431.2C3357.6 1224.6 3311.7 1181.3 3311.7 1091C3311.7 1001.2 3357.6 956.9 3431.2 956.9H3489.1ZM3433.3 985.6C3374.3 985.6 3340.9 1019 3340.9 1091C3340.9 1163.5 3374.3 1196.4 3433.3 1196.4H3487.1C3546.1 1196.4 3579.5 1163.5 3579.5 1091C3579.5 1019 3546.1 985.6 3487.1 985.6H3433.3Z' fill='white'/%3E%3Cpath d='M3674.4 956.9L3706.8 1176.6C3709.4 1195.4 3716.2 1204.3 3737.1 1204.3C3758.5 1204.3 3767.4 1195.4 3771.5 1180.3L3821.6 995.5C3829.4 966.8 3849.3 951.7 3884.2 951.7C3919.1 951.7 3937.4 966.8 3945.3 995.5L3994.9 1180.3C3999.1 1195.4 4007.9 1204.3 4029.3 1204.3C4050.2 1204.3 4056.4 1195.4 4059.6 1176.6L4093.5 956.9H4125.3L4089.3 1179.8C4084.6 1210.6 4069.5 1231 4028.2 1231C3992.7 1231 3975 1216.4 3966.6 1185.1L3917 1000.9C3912.8 985.2 3900.8 978.5 3883.6 978.5C3865.9 978.5 3854.9 985.3 3850.7 1000.9L3799.6 1185.1C3790.7 1216.4 3773.5 1231 3737.5 1231C3695.2 1231 3682.2 1210.1 3677.5 1179.8L3643.1 956.9H3674.4Z' fill='white'/%3E%3Cpath d='M4417.6 956.9V985.6H4260C4219.8 985.6 4203.6 1003.3 4203.6 1032.1C4203.6 1057.2 4216.1 1077.5 4263.6 1077.5H4338.8C4410.8 1077.5 4428.6 1110.9 4428.6 1149.5C4428.6 1194.9 4404.6 1224.7 4344 1224.7H4178V1196.5H4344C4384.2 1196.5 4399.8 1178.2 4399.8 1149.5C4399.8 1124.4 4387.8 1103.6 4339.8 1103.6H4264.6C4193.1 1103.6 4174.8 1069.2 4174.8 1030C4174.8 985.1 4198.8 956.9 4259.4 956.9H4417.6Z' fill='white'/%3E%3Cpath d='M4685.4 956.9C4749.1 956.9 4775.7 986.6 4775.7 1036.8C4775.7 1084.8 4751.2 1111.4 4684.9 1111.4H4526.2V1135.9C4526.2 1170.3 4545 1196.4 4593.5 1196.4H4762.1V1224.6H4593.5C4524.6 1224.6 4497.5 1187.5 4497.5 1136.4V1045.1C4497.5 995 4524.6 956.9 4593.5 956.9H4685.4ZM4526.2 1087.4H4684.3C4729.7 1087.4 4746.9 1069.7 4746.9 1037.8C4746.9 1005.4 4728.6 985.6 4685.3 985.6H4593.4C4544.9 985.6 4526.1 1011.2 4526.1 1045.6V1087.4H4526.2Z' fill='white'/%3E%3Cpath d='M5040.3 956.9V985.6H4929.1C4895.2 985.6 4881.6 1000.7 4881.6 1033.6V1224.6H4852.4V1029.9C4852.4 979.8 4871.7 956.8 4922.9 956.8H5040.3V956.9Z' fill='white'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_879_362'%3E%3Crect width='5041' height='1231' fill='white' transform='translate(0 0.700195)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A"},e2={loginPageLogo:Qb},t2="200px",Er=({logoSrc:t=e2.loginPageLogo.value,width:n=t2,className:e="logo"})=>s.jsx("img",{width:n,src:t,className:e,alt:"Login logo"}),Fh=()=>s.jsx("span",{className:"spinner"});const Fn=({Logo:t=Er,text:n="Loading..."})=>s.jsx("div",{className:"system-loader-background",children:s.jsxs("div",{className:"system-loader-container flex flex-column ai-center",children:[s.jsx(t,{}),s.jsx("h1",{className:"system-loader-text io-title",children:n}),s.jsx(Fh,{})]})});const Bh=({children:t,description:n,heading:e,Image:o,title:r,className:i})=>s.jsxs("div",{className:et("info-card",i),children:[r&&s.jsx("h1",{className:"info-card-title io-title-large",children:r}),o&&s.jsx("div",{className:"info-card-image",children:s.jsx(o,{})}),e&&s.jsx("h3",{className:"info-card-heading io-title",children:e}),s.jsx("p",{className:"info-card-description io-text-default-lh16",children:n}),t]}),n2=({activeStepName:t,showWarnIcon:n,stepsStatuses:e})=>s.jsx("ul",{className:"setup-flow-list io-text-default-lh16",children:Kr.map(({name:o,label:r},i)=>{const a=o===t,c=e[o].state,l=n&&a?s.jsx(ot,{variant:"exclamation-mark",size:"12"}):s.jsxs("span",{children:[i+1,"."]});return s.jsx("li",{className:et(a&&"active"),children:s.jsxs("div",{className:"setup-flow-list-item",children:[s.jsxs("div",{className:"setup-flow-list-item-icon-wrapper",children:[c==="prompt"&&l,c==="granted"&&s.jsx(ot,{variant:"check-solid",size:"12"}),c==="denied"&&s.jsx(ot,{variant:"close",size:"12"})]}),r]})},o)})}),o2=({edgeNotificationsPermissionTimeout:t,isNotificationsPermissionPromptOpen:n})=>{const{name:e}=mw(),[o,r]=g.useState(!1);return g.useEffect(()=>{if(!n||e!=="Edge")return;const i=setTimeout(()=>r(!0),t);return()=>clearTimeout(i)},[e,t,n]),g.useEffect(()=>{n&&!o||r(!1)},[n,o,r]),{hasEdgeNotificationsPermissionError:o}},r2=(t,n)=>{const{type:e,payload:o}=n;switch(e){case"completed":return{...t,[o.stepName]:{...t[o.stepName],isCompleted:!0}};case"skipped":return{...t,[o.stepName]:{isCompleted:!0,state:"denied"}};case"stateUpdated":{if(!o.state)throw Error('"stateUpdated" action invoked without state in payload');return{...t,[o.stepName]:{isCompleted:o.stepName===Qe.POPUPS?o.state==="granted":o.state!=="prompt",state:o.state}}}default:throw Error("Unknown action: "+e)}},i2=t=>{const{handleDeferredStep:n,handleOperationComplete:e}=t;window.getScreenDetails().catch(async()=>{const{state:o}=await navigator.permissions.query({name:Tn.WINDOW_MANAGEMENT});o==="prompt"&&n()}).finally(e)},a2=t=>{const{handleDeferredStep:n,handleOperationComplete:e}=t;Notification.requestPermission().then(async()=>{const{state:o}=await navigator.permissions.query({name:Tn.NOTIFICATIONS});o==="prompt"&&n()}).finally(e)},s2=t=>{const{handleDeferredStep:n,handleOperationComplete:e,dispatchAction:o}=t,r="about:blank",i="popup,width=1,height=1,top=9999,left=9999",a=window.open(r,void 0,i),c=window.open(r,void 0,i);a==null||a.close(),c==null||c.close();const l=!(a&&c);l&&n(),o({type:"stateUpdated",payload:{stepName:Qe.POPUPS,state:l?"denied":"granted"}}),e()},c2=t=>{const{dispatchAction:n}=t;n({type:"completed",payload:{stepName:Qe.PWA_INSTALL}})},l2={[Qe.WINDOW_MANAGEMENT]:i2,[Qe.NOTIFICATIONS]:a2,[Qe.POPUPS]:s2,[Qe.PWA_INSTALL]:c2},u2=({settings:t})=>{const{permission:n}=Rn(),[e,o]=ln("localStorage",kr,Sr),[r,i]=g.useReducer(r2,wb),[a,c]=g.useState(!1),[l,u]=g.useState(!1),f=Kr.find(y=>!r[y.name].isCompleted);if(!f)throw new Error("All setup steps are completed. The SetupSteps component should not be used in such case.");const d=f.name,p=Kr[Kr.length-1].name,{hasEdgeNotificationsPermissionError:h}=o2({edgeNotificationsPermissionTimeout:t.edgeNotificationsPermissionTimeout,isNotificationsPermissionPromptOpen:l&&d===Tn.NOTIFICATIONS}),m=()=>{c(!1),u(!0),l2[d]({handleDeferredStep:()=>c(!0),handleOperationComplete:()=>u(!1),dispatchAction:y=>i(y)}),d===p&&o({isCompleted:!0})},v=()=>{c(!1),i({type:"skipped",payload:{stepName:d}})};return g.useEffect(()=>{h&&(u(!1),c(!0))},[h]),g.useEffect(()=>{var y,k;c(!1),i({type:"stateUpdated",payload:{stepName:Qe.WINDOW_MANAGEMENT,state:$i?(y=n.statuses[Qe.WINDOW_MANAGEMENT])==null?void 0:y.state:"denied"}}),i({type:"stateUpdated",payload:{stepName:Qe.NOTIFICATIONS,state:(k=n.statuses[Qe.NOTIFICATIONS])==null?void 0:k.state}})},[n.statuses]),s.jsxs(Bh,{description:f.description,heading:f.heading,Image:f.Image,title:"Platform Setup",children:[s.jsx(n2,{activeStepName:d,showWarnIcon:a&&d!==Qe.POPUPS,stepsStatuses:r}),s.jsx("p",{className:"io-text-default-lh16",children:a?f.instructions.additional:f.instructions.initial}),s.jsxs(Re,{children:[s.jsx(di,{className:"io-btn io-btn-lg io-btn-primary setup-flow-btn",disabled:l,onClick:m,children:f.actionBtnText}),d!==p&&d!==Qe.WINDOW_MANAGEMENT&&s.jsx(di,{className:"io-btn io-btn-lg io-btn-outline setup-flow-btn",disabled:l,onClick:v,children:"Skip"})]}),l&&s.jsx(Fh,{})]})};const dc=({components:{Logo:t=Er,Loader:n=Fn}={},settings:e={}})=>{const{permission:o}=Rn();return o.isLoading?s.jsx(n,{text:"Checking browser permissions..."}):s.jsx(Rh,{Logo:t,children:s.jsx(u2,{settings:{...hb,...e}})})};const fc=({errorMessage:t})=>{const n="https://support.interop.io",e=s.jsxs(s.Fragment,{children:["It seems that the following error prevents io.Connect Browser",s.jsx("br",{}),"from operating properly:",s.jsxs("span",{className:"browser-start-failed-error",children:["“",t,"”"]}),s.jsxs("span",{className:"help-center-info",children:["For further assistance, visit our"," ",s.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:"help center"}),"."]}),s.jsx("span",{className:"thank-you",children:"Thank you for your cooperation."})]});return s.jsx(Rh,{Logo:Er,children:s.jsx(Bh,{className:"io-init-error-card",heading:"Oops! io.Connect Browser couldn't start...",description:e,Image:pb,children:s.jsx(di,{className:"io-btn io-btn-lg io-btn-primary",onClick:()=>window.open(n,"_blank","noopener,noreferrer"),children:"Visit the interop.io Help Center"})})})},Hh=()=>s.jsxs(s.Fragment,{children:[s.jsx(sn,{tag:"h1",className:"login-title",text:"Making Your Work Flow",size:"large"}),s.jsxs("p",{className:"io-text-default-lh16 login-description",children:["Integrate apps, simplify user experiences and accelerate",s.jsx("br",{}),"digital transformation."]})]}),Wh=({Logo:t,children:n,className:e})=>s.jsx("div",{className:"login-page-background",children:s.jsxs("div",{className:et(e,"login-form-container flex flex-column ai-center"),children:[s.jsx(t,{}),n]})}),d2=({onLogin:t,isLoading:n,validationError:e,components:{Logo:o=Er,Heading:r=Hh,Loader:i=Fn}={}})=>n?s.jsx(i,{text:"Verifying credentials..."}):s.jsxs(Wh,{Logo:o,children:[s.jsx(r,{}),s.jsx(Ye,{className:"auth0-login-btn",onClick:t,size:"large",variant:"primary",children:"Log In"}),e&&s.jsx(Qh,{variant:"critical",text:e.message})]}),Gl=(t,n)=>{const e=n.value,o=e.trim().length>3;return{value:e,isValid:o}},f2=({onLogin:t,setIsLoading:n,loginError:e,setLoginError:o,userInputName:r="email"})=>{const[i,a]=g.useReducer(Gl,{value:"",isValid:!1}),[c,l]=g.useReducer(Gl,{value:"",isValid:!1}),[u,f]=g.useState(!1),[d,p]=g.useState(!1),{isValid:h}=i,{isValid:m}=c,v=h&&m,y=E=>a({value:E.target.value}),k=E=>l({value:E.target.value}),S=()=>{h||f(!0)},b=()=>{m||p(!0)},w=async E=>{if(E.preventDefault(),!!v){n(!0);try{await t(i.value,c.value)}catch(O){o(O)}n(!1)}};return s.jsxs("form",{className:"simple-login-form",onSubmit:w,children:[s.jsx(no,{id:"user",errorMessage:u?`The ${r} is too short`:void 0,autoFocus:!0,autoComplete:"off",type:"text",placeholder:`Enter your ${r}`,value:i.value,onChange:y,onBlur:S,onFocus:()=>f(!1)}),s.jsx(no,{id:"password",errorMessage:d?"The password is too short":void 0,autoComplete:"off",type:"password",placeholder:"Enter your password",value:c.value,onChange:k,onBlur:b,onFocus:()=>p(!1)}),s.jsx(Ye,{type:"submit",size:"large",variant:"primary",children:"Log In"}),e&&s.jsxs("div",{className:"login-error-feedback",children:[s.jsx(ot,{className:"error-icon",variant:"close",size:"12"}),e.message]})]})};const p2=({onLogin:t,userInputName:n,components:{Logo:e=Er,Heading:o=Hh,Loader:r=Fn}={}})=>{const[i,a]=g.useState(!1),[c,l]=g.useState(null);return i?s.jsx(r,{text:"Verifying credentials..."}):s.jsxs(Wh,{Logo:e,children:[s.jsx(o,{}),s.jsx(f2,{onLogin:t,setIsLoading:a,loginError:c,setLoginError:l,userInputName:n})]})};function h2(t,n){const[e,o]=g.useState(!0),r=g.useContext(Me.IOConnectContext);return g.useEffect(()=>{let i;return(async()=>{if(!r.workspaces)return;let a;try{a=await r.workspaces.getWorkspaceById(t)}catch(l){console.warn(l);return}const c=a.getAllGroups().find(l=>l.id===n);c&&(i=await c.onLockConfigurationChanged(({showAddWindowButton:l})=>{l!==void 0&&o(l)}),o(!!c.showAddWindowButton))})(),()=>i==null?void 0:i()},[t,n,r.workspaces]),e}const m2=({groupId:t,workspaceId:n})=>{const e=h2(n,t),o=g.useCallback(r=>{Eo.showAddApplicationPopup({bounds:r,groupId:t,workspaceId:n})},[t,n]);return e&&s.jsx(Eo.AddWindowButton,{title:"Add App",visible:e,showPopup:o})},g2=t=>s.jsx(Eo.GroupHeaderButtons,{...t,addWindow:{visible:!1,showPopup:t.addWindow.showPopup}}),v2=()=>null;const $h=({className:t,components:n,onClose:e,title:o})=>{const{NotificationsProvider:r,NotificationsPanelProvider:i,SettingsPanel:a}=Ps;return s.jsx(r,{children:s.jsx(i,{children:s.jsx(a,{className:t,components:n,onClose:e,title:o})})})};const zh=hv.Panel;const Uh=({className:t,components:n,onClose:e,title:o})=>{const r=g.useContext(Me.IOConnectContext),{onLogout:i}=kh(),[a,c]=ln("sessionStorage",$p,zp),{login:{setIsLoggingOut:l}}=Rn(),u=g.useCallback(async()=>{var f;if("modals"in r&&r.modals){const d="log-out",{isEnterPressed:p,responseButtonClicked:h}=await r.modals.dialogs.request({templateName:Lo.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:"Logging out of io.Connect Browser",text:"This will terminate your session.",actionButtons:[{variant:"primary",text:"Log out",id:d,autofocus:!0},{variant:"outline",text:"Cancel",id:"cancel"}]}});if(!(p||(h==null?void 0:h.id)===d))return}jn.flushSync(()=>l(!0));try{i==null||i()}catch(d){console.error(d)}c(null),await((f=r.webPlatform)==null?void 0:f.system.shutdown()),window.location.reload()},[r,i]);return s.jsx(uv.Panel,{className:t,components:n,onClose:e,onLogout:u,title:o})},y2=[{name:"platformPreferences",displayName:"Platform Preferences",icon:"cog",onClick:t=>t(zh)},{name:"notificationSettings",displayName:"Notification Settings",icon:"bell",onClick:t=>t($h),separatorAfter:!0},{name:"profile",displayName:"Profile",icon:"user",onClick:t=>t(Uh)}],w2=t=>({onClose:n})=>s.jsx(t,{className:"system-menu-panel",onClose:n});const Vh=({actions:t,panelWrapperClassName:n})=>{const[e,o]=g.useState(),r=g.useRef(null),i=Qp(),a=g.useCallback(()=>o(void 0),[]),c=!!e;g.useEffect(()=>{!c||i!=="Escape"||a()},[c,i]);const l=g.useCallback((u,f)=>{const d=t.find(({name:h})=>h===f.name);if(!d){console.error(`Action named ${f.name} is not part of the provided list of actions: ${JSON.stringify(t)}!`);return}const p=h=>{const m=w2(h);o(()=>m)};d.onClick(p)},[t]);return Xs({eventType:"mouseup",handler:a,ref:r,skip:!c}),Js({handler:a,skip:!c}),s.jsxs(s.Fragment,{children:[s.jsx(nc,{buttonSize:"32",iconSize:"16",actions:t,onActionItemClick:l,icon:"ellipsis-vertical",buttonVariant:"circle",placement:"bottom-end",offset:[0,8],"data-testid":"system-menu-button",contextMenuDataTestId:"system-menu"}),s.jsx(Eh,{className:et("system-menu-panel-wrapper",n),isOpen:c,onClose:a,Panel:e,position:"right",ref:r})]})},b2=()=>s.jsx("li",{className:"default-header-system-menu",children:s.jsx(Vh,{actions:y2})}),x2=()=>{const{showNotificationBadge:t}=gw(),n=Xp(),o=g.useMemo(()=>n.filter(({state:r})=>r==="Active"||r==="Stale"),[n]).length;return o>0&&t?s.jsx("div",{className:"io-badge io-badge-primary notifications-badge",children:o<100?o:"99+"}):null};const Gh=t=>{const{className:n,active:e,...o}=t;return s.jsxs("div",{className:et(n,"notifications-panel-button"),...o,children:[s.jsx(Ve,{icon:"bell",size:"32",iconSize:"16",variant:"circle"}),s.jsx(x2,{})]})},Yh=({className:t,components:n,onClose:e,settings:o,title:r})=>{const{NotificationsProvider:i,NotificationsPanelProvider:a,Panel:c}=Ps;return s.jsx(i,{children:s.jsx(a,{children:s.jsx(c,{className:t,components:n,onClose:e,settings:o,title:r})})})},Zh=({Button:t=Gh,Panel:n=Yh,position:e="right",...o})=>{const r=Xp(),i=g.useContext(Me.IOConnectContext),a=g.useCallback(async()=>{await Promise.all(r.map(({id:c})=>i.notifications.setState(c,"Seen")))},[r]);return s.jsx(rc,{Button:t,Panel:n,position:e,onClose:a,...o})};const C2=()=>s.jsxs(s.Fragment,{children:[s.jsx(Zh,{tag:"li"}),s.jsx(b2,{})]}),pc=({onLogout:t,workspaces:n,launchpad:e,Loader:o=Fn,isBeforeunloadDialogEnabled:r})=>{var v,y,k,S;const{LogoComponent:i,SystemButtonsComponent:a}=((v=n==null?void 0:n.components)==null?void 0:v.header)??{},{setPlatformWindow:c}=Qs(),{isInitialSetupCompleted:l}=dd(),u=(y=window.iobrowser)==null?void 0:y.platformStarted,f=i??(u?jh:v2),d=a??(u?C2:void 0),p=fw(),{login:{isLoggingOut:h}}=Rn();Py(r===!1||h),g.useEffect(()=>{u&&c({name:window.name})},[u,c]);const m=g.useMemo(()=>({onLogout:t,launchpadSettings:e==null?void 0:e.settings,launchpadComponents:e==null?void 0:e.components}),[t,e==null?void 0:e.settings,e==null?void 0:e.components]);return s.jsxs(Ch.Provider,{value:m,children:[(!p||!l)&&s.jsx(o,{text:"Loading io.Connect Home..."}),s.jsx(Eo,{components:{...n==null?void 0:n.components,header:{...(k=n==null?void 0:n.components)==null?void 0:k.header,LogoComponent:f,SystemButtonsComponent:d},groupHeader:{AfterTabsComponent:m2,ButtonsComponent:g2,...(S=n==null?void 0:n.components)==null?void 0:S.groupHeader}}})]})},k2=Xe({id:Dt,username:_e(Dt),email:_e(Dt),firstName:_e(Dt),lastName:_e(Dt),token:_e(Dt),password:_e(Dt)}),S2=({config:t})=>{var k,S,b,w;const{setupFlow:n,login:e,workspaces:o,launchpad:r,getIOConnectConfig:i}=t,[a,c]=ln("localStorage",zy,k2),[l]=ln("localStorage",kr,Sr),[u,f]=g.useState(null),{login:{isLoggingOut:d}}=Rn(),p=qs(),h=((k=t.components)==null?void 0:k.SystemLoader)??Fn,m=((S=t.components)==null?void 0:S.IOInitErrorScreen)??fc,v=g.useCallback(async(E,O)=>{const F=await e.onLogin(E,O);c(F)},[e,c]),y=g.useCallback(()=>{var E;(E=e.onLogout)==null||E.call(e),c(null)},[e.onLogout,c]);return d?s.jsx(h,{text:"Logging out..."}):a?!(l!=null&&l.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&!p?s.jsx(dc,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:h}}):u&&!u.message.includes("has already been started")?s.jsx(m,{errorMessage:u.message}):s.jsx(Me.IOConnectProvider,{settings:i({type:"simple",user:a}),onInitError:f,fallback:s.jsx(h,{text:"Initializing the platform..."}),children:s.jsx(Ii,{launchpadMode:(b=r==null?void 0:r.settings)==null?void 0:b.mode,children:s.jsx(pc,{workspaces:o,launchpad:r,onLogout:y,isBeforeunloadDialogEnabled:(w=t.settings)==null?void 0:w.isBeforeunloadDialogEnabled,Loader:h})})}):s.jsx(p2,{onLogin:v,userInputName:e.userInputName,components:{...e.components,Loader:h}})},E2=Xe({message:Dt}),j2=t=>{const n=Lh(),[e,o]=g.useState(void 0),[r,i]=ln("sessionStorage",$y,E2),a=g.useMemo(()=>n.user?(t==null?void 0:t(n.user))??{ok:!0}:null,[n.user,t]),c=(a==null?void 0:a.ok)===!1,l=n.isLoading||n.isAuthenticated&&!e,u=c||l,f=g.useMemo(()=>{var d;return a!=null&&a.ok&&((d=n.user)!=null&&d.email)&&e?{username:n.user.name,id:n.user.email,token:e}:null},[n.user,e,a==null?void 0:a.ok]);return g.useEffect(()=>{n.isAuthenticated&&n.getAccessTokenSilently().then(o).catch(console.warn)},[n]),g.useEffect(()=>{if(a){if(a.ok){i(null);return}i({message:a.message}),n.logout()}},[n,i,a]),{isLoading:u,validationError:r,user:f}},ps={POPUP:"popup",REDIRECT:"redirect"},O2=({config:t})=>{var b,w,E,O;const n=Lh(),{setupFlow:e,login:o,launchpad:r,workspaces:i,getIOConnectConfig:a}=t,{isLoading:c,validationError:l,user:u}=j2(o.validateUser),d=(o.loginType??ps.REDIRECT)===ps.REDIRECT?n.loginWithRedirect:n.loginWithPopup,[p]=ln("localStorage",kr,Sr),[h,m]=g.useState(null),{login:{isLoggingOut:v}}=Rn(),y=qs(),k=((b=t.components)==null?void 0:b.SystemLoader)??Fn,S=((w=t.components)==null?void 0:w.IOInitErrorScreen)??fc;return v?s.jsx(k,{text:"Logging out..."}):u?!(p!=null&&p.isCompleted)&&(e==null?void 0:e.enabled)!==!1&&!y?s.jsx(dc,{settings:e==null?void 0:e.settings,components:{...e==null?void 0:e.components,Loader:k}}):h&&!h.message.includes("has already been started")?s.jsx(S,{errorMessage:h.message}):s.jsx(Me.IOConnectProvider,{settings:a({type:"auth0",user:{...n.user,id:u.id,token:u.token}}),onInitError:m,fallback:s.jsx(k,{text:"Initializing the platform..."}),children:s.jsx(Ii,{launchpadMode:(E=r==null?void 0:r.settings)==null?void 0:E.mode,children:s.jsx(pc,{workspaces:i,launchpad:r,onLogout:n.logout,isBeforeunloadDialogEnabled:(O=t.settings)==null?void 0:O.isBeforeunloadDialogEnabled,Loader:k})})}):s.jsx(d2,{onLogin:d,isLoading:c,validationError:l,components:{...o.components,Loader:k}})},Yl=({config:t})=>{var v,y,k,S;const{setupFlow:n,launchpad:e,workspaces:o,getIOConnectConfig:r}=t,{onLogout:i,user:a}=t.login??{},{isPlatformWindow:c}=Qs(),[l]=ln("localStorage",kr,Sr),[u,f]=g.useState(null),{login:{isLoggingOut:d}}=Rn(),p=qs(),h=((v=t.components)==null?void 0:v.SystemLoader)??Fn,m=((y=t.components)==null?void 0:y.IOInitErrorScreen)??fc;return d?s.jsx(h,{text:"Logging out..."}):!(l!=null&&l.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&c&&!p?s.jsx(dc,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:h}}):u&&!u.message.includes("has already been started")?s.jsx(m,{errorMessage:u.message}):s.jsx(Me.IOConnectProvider,{settings:r({type:"custom",user:a}),onInitError:f,fallback:s.jsx(h,{text:"Initializing the platform..."}),children:s.jsx(Ii,{launchpadMode:(k=e==null?void 0:e.settings)==null?void 0:k.mode,children:s.jsx(pc,{workspaces:o,launchpad:e,onLogout:i,isBeforeunloadDialogEnabled:(S=t.settings)==null?void 0:S.isBeforeunloadDialogEnabled,Loader:h})})})},Kh=Xe({Logo:_e(jt().andThen(t=>zt(t,"Logo"))),Heading:_e(jt().andThen(t=>zt(t,"Heading")))}),N2=gr(...Object.values(ps).map(t=>Mn(t))),I2=Xe({type:Mn("auth0"),validateUser:_e(jt().andThen(t=>zt(t,"validateUser"))),loginType:_e(N2),providerOptions:jt(),components:_e(Kh)}),P2=Xe({type:Mn("simple"),onLogin:jt().andThen(t=>zt(t,"onLogin")),onLogout:_e(jt().andThen(t=>zt(t,"onLogout"))),userInputName:_e(Dt),components:_e(Kh)}),A2=Xe({id:Dt,username:Dt}),T2=Xe({type:Mn("custom"),onLogout:jt().andThen(t=>zt(t,"onLogout")),user:A2}),D2=gr(I2,P2,T2),M2=Xe({edgeNotificationsPermissionTimeout:_e(nw)}),_2=Xe({Logo:_e(jt().andThen(t=>zt(t,"Logo")))}),L2=Xe({enabled:_e(Do()),components:_e(_2),settings:_e(M2)}),R2=Xe({components:_e(jt())}),F2=Xe({BeforeSearch:gr(Mn(null),_e(jt().andThen(t=>zt(t,"BeforeSearch")))),AfterSearch:gr(Mn(null),_e(jt().andThen(t=>zt(t,"AfterSearch"))))}),B2=Xe({Component:jt().andThen(t=>zt(t,"Component")),placementId:Dt}),H2=Xe({header:_e(F2),sections:_e(ew(B2))}),W2=Xe({showHeader:_e(Do()),showSearch:_e(Do())}),$2=Xe({header:_e(W2),mode:_e(gr(Mn("pinned"),Mn("default")))}),z2=Xe({components:_e(H2),settings:_e($2)}),U2=Xe({SystemLoader:_e(jt().andThen(t=>zt(t,"SystemLoader"))),IOInitErrorScreen:_e(jt().andThen(t=>zt(t,"IOInitErrorScreen")))}),V2=Xe({isBeforeunloadDialogEnabled:_e(Do())}),G2=Xe({getIOConnectConfig:jt().andThen(t=>zt(t,"getIOConnectConfig")),login:_e(D2),setupFlow:_e(L2),workspaces:_e(R2),launchpad:_e(z2),components:_e(U2),settings:_e(V2)}),Y2=({config:t})=>{var i;const n=g.useMemo(()=>G2.runWithException(t),[t]),e=n.login,{isPlatformWindow:o}=Qs();if(!e||!o){const{login:a,...c}=n;return s.jsx(Yl,{config:c})}if(e.type==="custom")return s.jsx(Yl,{config:n});if(e.type==="simple")return s.jsx(S2,{config:n});const{providerOptions:r}=e;return s.jsx(Xb,{...r,authorizationParams:{...r.authorizationParams,redirect_uri:((i=r.authorizationParams)==null?void 0:i.redirect_uri)??window.location.origin},children:s.jsx(O2,{config:n})})};const Z2=({config:t})=>s.jsx(cb,{children:s.jsx(Y2,{config:t})});exports.ApplicationsSection=ah;exports.FavoritesSection=sh;exports.IOActivePanelRenderer=pv;exports.IOConnectHome=Z2;exports.IODownloadManager=Gg;exports.IONotifications=Ps;exports.Launchpad=xh;exports.LaunchpadAccess=jh;exports.LaunchpadBody=bh;exports.LaunchpadContentsContainer=ph;exports.LaunchpadHeader=mh;exports.LaunchpadPinButton=hh;exports.NotificationSettingsPanel=$h;exports.NotificationsPanel=Yh;exports.NotificationsPanelButton=Gh;exports.NotificationsPanelWithToggleButton=Zh;exports.PanelWithToggleButton=rc;exports.PlatformPrefsProvider=Ii;exports.PreferencesPanel=zh;exports.ProfilePanel=Uh;exports.Section=Wi;exports.SystemLoader=Fn;exports.SystemMenu=Vh;exports.WorkspacesSection=gh;exports.useFavorites=Fi;exports.useIsLaunchpadCollapsed=Ks;exports.usePlatformPref=Wt;exports.usePlatformPrefs=dd;
61
61
  //# sourceMappingURL=index.js.map