@interopio/home-ui-react 4.2.8-next.0 → 4.3.0
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.css +1 -1
- package/dist/index.d.ts +12 -11
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7661 -7424
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var zb=Object.defineProperty;var Ub=(e,t,n)=>t in e?zb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Cn=(e,t,n)=>(Ub(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),v=require("react"),$o=require("react-dom"),Te=require("@interopio/react-hooks"),xi=require("@interopio/workspaces-ui-react");function Hm(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const V=Hm(v),Bm=Hm($o);function Wm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yl,Fm={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/Zc=am,function(){var e={}.hasOwnProperty;function t(){for(var r="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(r=o(r,n(a)))}return r}function n(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.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)e.call(r,a)&&r[a]&&(i=o(i,a));return i}function o(r,i){return i?r?r+" "+i:r+i:r}Zc.exports?(t.default=t,Zc.exports=t):window.classNames=t}();var oe=im(am.exports);function kt({className:e,size:t="16",variant:n="workspace",...o}){const r=oe("icon",t&&[`icon-size-${t}`],e);return u.jsx("span",{className:r,"aria-label":`icon-${n}`,role:"presentation",...o,children:u.jsx("i",{className:`icon-${n}`})})}const Ue=v.forwardRef(({className:e,variant:t="default",icon:n="workspace",size:o="16",tooltip:r,iconSize:i="16",onClick:a,disabled:s,children:c,...l},d)=>{const f=oe("io-btn-icon",t!=="default"&&[`io-btn-icon-${t}`],[`io-btn-icon-size-${o}`],e),h=v.useCallback(p=>{if(!s)return a?a(p):void 0;p.preventDefault()},[a,s]);return u.jsx("button",{className:f,type:"button",ref:d,"aria-label":"icon button","aria-disabled":s,title:r,onClick:h,disabled:s,...l,children:c??(n&&u.jsx(kt,{variant:n,size:i}))})});Ue.displayName="ButtonIcon";const sb={default:void 0,info:"info",success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function cb({className:e,variant:t="default",size:n="normal",text:o,close:r=!1,closeButtonOnClick:i,append:a,...s}){const c=oe("io-alert",`io-alert-${t}`,n==="large"&&"io-alert-lg",e),l=sb[t];return u.jsxs("div",{"data-testid":"io-alert",className:c,role:"alert","aria-label":"alert",...s,children:[l&&u.jsx(kt,{"data-testid":"io-alert-icon",variant:l,className:"icon-severity"}),o&&u.jsx("p",{"data-testid":"io-alert-text",className:"io-text-smaller",children:o}),n==="large"&&a,r&&u.jsx(Ue,{"data-testid":"io-alert-close-button",className:"ms-auto",size:"16",iconSize:"10",icon:"close",onClick:i})]})}function lb({className:e,variant:t="default",children:n,...o}){const r=oe("io-badge",t!=="default"&&[`io-badge-${t}`],e);return u.jsx("div",{className:r,...o,children:n})}function zn({className:e,tag:t="h2",size:n="normal",text:o="Title",...r}){const i=t,a=oe(n==="small"&&"io-title-semibold",n==="normal"&&"io-title",n==="large"&&"io-title-large",e);return u.jsx(i,{className:a,...r,children:o})}function et({className:e,title:t,titleSize:n="normal",tag:o,hint:r,children:i,...a}){const s=oe("io-block",e),c=t?"block-title":void 0;return u.jsxs("section",{className:s,"aria-label":t?void 0:"Block","aria-labelledby":c,...a,children:[t&&u.jsx(zn,{id:c,tag:o,text:t,size:n}),i,r&&u.jsx("p",{className:"io-text-smaller",children:r})]})}const Go=e=>e.key==="Enter"||e.key===" ",Qe=v.forwardRef(({className:e,variant:t="default",size:n="normal",icon:o,iconSize:r="12",iconRight:i=!1,text:a,onClick:s,disabled:c,children:l,...d},f)=>{const h=oe("io-btn",(t==="primary"||t==="critical"||t==="outline"||t==="link")&&[`io-btn-${t}`],n==="large"&&"io-btn-lg",e),p=v.useCallback(g=>{if(!c)return s?s(g):void 0;g.preventDefault()},[s,c]),m=v.useCallback(g=>{c||Go(g)&&(g.preventDefault(),p(g))},[p,c]);return u.jsxs("button",{className:h,ref:f,type:"button","aria-disabled":c,onClick:p,onKeyDown:m,disabled:c,tabIndex:0,...d,children:[o&&!i&&u.jsx(kt,{variant:o,size:r}),l??a,o&&i&&u.jsx(kt,{variant:o,size:r})]})});Qe.displayName="Button";const ec=v.createContext({}),sm=v.forwardRef(({icon:e="chevron-down",onClick:t,onKeyDown:n,...o},r)=>{const{handleToggle:i,disabled:a,setTriggerRef:s}=v.useContext(ec),c=v.useCallback(f=>{s==null||s(f),r&&(typeof r=="function"?r(f):r.current=f)},[r,s]),l=v.useCallback(f=>{f.stopPropagation(),t==null||t(f),f.defaultPrevented||(i==null||i())},[t,i]),d=v.useCallback(f=>{n==null||n(f),f.defaultPrevented||Go(f)&&(f.preventDefault(),f.stopPropagation(),i==null||i())},[n,i]);return u.jsx(Qe,{icon:e,iconRight:!0,onClick:l,onKeyDown:d,disabled:a,ref:c,...o})});sm.displayName="DropdownButton";const cm=v.forwardRef(({size:e="32",onClick:t,onKeyDown:n,...o},r)=>{const{handleToggle:i,disabled:a,setTriggerRef:s}=v.useContext(ec),c=v.useCallback(f=>{s==null||s(f),r&&(typeof r=="function"?r(f):r.current=f)},[r,s]),l=v.useCallback(f=>{f.stopPropagation(),t==null||t(f),f.defaultPrevented||(i==null||i())},[t,i]),d=v.useCallback(f=>{n==null||n(f),f.defaultPrevented||Go(f)&&(f.preventDefault(),f.stopPropagation(),i==null||i())},[n,i]);return u.jsx(Ue,{size:e,onClick:l,onKeyDown:d,disabled:a,ref:c,...o})});function lm({className:e,...t}){const n=oe("io-dropdown-content",e);return u.jsx("div",{className:n,...t})}cm.displayName="DropdownButtonIcon";const um=v.createContext({}),tc=v.forwardRef((e,t)=>{const{className:n,prepend:o,append:r,isSelected:i,onClick:a,description:s,disabled:c=!1,children:l,tooltip:d,...f}=e,{variant:h="default",selected:p,checkIcon:m,handleItemClick:g}=v.useContext(um),y=i??(p==null?void 0:p.some(S=>S.children===l)),w=h!=="default"&&!!m,k=w||o,b=oe("io-list-item",k&&"io-list-item-left",r&&"io-list-item-right",h!=="default"&&y&&"selected",s&&"io-list-item-description",c&&"io-list-item-disabled",n);return u.jsxs("li",{className:b,ref:t,role:"menuitem","aria-roledescription":"menuitem",tabIndex:0,onClick:S=>{c?S.preventDefault():(g==null||g(S,{children:l}),a==null||a(S))},...f,children:[k&&u.jsxs("div",{className:"io-list-left-column",children:[w&&u.jsx(kt,{variant:m.variant,title:y?m.tooltip:void 0,"data-testid":"list-item-check-icon"}),o]}),u.jsx("span",{className:"io-list-text",title:d,"data-testid":"list-item-title",children:l}),r&&u.jsx("div",{className:"io-list-right-column",children:r}),s&&u.jsx("div",{className:"io-list-text-description",children:s})]})});tc.displayName="ListItem";const dm=v.forwardRef(({className:e,prepend:t,append:n,children:o,tooltip:r,...i},a)=>{const s=oe("io-list-item-header",e);return u.jsxs("div",{className:s,ref:a,...i,children:[t&&u.jsx("div",{className:"io-list-left-column",children:t}),u.jsx("span",{className:"io-list-text",title:r,children:o}),n&&u.jsx("div",{className:"io-list-right-column",children:n})]})});dm.displayName="ListItemHeader";const ad=v.forwardRef(({className:e,prepend:t,append:n,children:o,tooltip:r,...i},a)=>{const s=oe("io-list-item",t&&"io-list-item-left",n&&"io-list-item-right","io-list-item-title",e);return u.jsxs("li",{className:s,ref:a,...i,children:[t&&u.jsx("div",{className:"io-list-left-column",children:t}),u.jsx("span",{className:"io-list-text",title:r,"data-testid":"list-item-title",children:o}),n&&u.jsx("div",{className:"io-list-right-column",children:n})]})});ad.displayName="ListItemTitle";const fm=v.forwardRef(({className:e,children:t,...n},o)=>{const r=oe("io-list-item","io-list-with-sub-items",e);return u.jsx("li",{className:r,ref:o,...n,children:t})});fm.displayName="ListItemWithSubItems";const sd=v.forwardRef(({className:e,prepend:t,append:n,children:o,tooltip:r,...i},a)=>{const s=oe("io-list-item",t&&"io-list-item-left",n&&"io-list-item-right","io-list-item-section",e);return u.jsxs("li",{className:s,ref:a,...i,children:[t&&u.jsx("div",{className:"io-list-left-column",children:t}),u.jsx("span",{className:"io-list-text",title:r,children:o}),n&&u.jsx("div",{className:"io-list-right-column",children:n})]})});function bi({className:e,...t}){const n=oe("io-separator",e);return u.jsx("hr",{className:n,...t})}sd.displayName="ListItemSection";const hm=e=>u.jsx(bi,{...e});hm.displayName="ListItemSeparator";const pm=v.forwardRef((e,t)=>{const{className:n,variant:o="default",checkIcon:r,children:i,...a}=e,[s,c]=v.useState([]),l=oe("io-list",o!=="default"&&"io-list-selectable",n),d=v.useMemo(()=>{if(r)return typeof r=="object"?r:{variant:r}},[r]),f=v.useCallback((p,m)=>{if(o==="default")return;const g=s.some(y=>{var w,k;return((w=y.children)==null?void 0:w.toString())===((k=m.children)==null?void 0:k.toString())});o==="single"?c([m]):(()=>{const y=g?s.filter(w=>w.children!==m.children):[...s,m];c(y)})()},[s,o]),h=v.useMemo(()=>({variant:o,selected:s,checkIcon:d,handleItemClick:f}),[o,s,d,f]);return u.jsx(um.Provider,{value:h,children:u.jsx("ul",{className:l,ref:t,...a,children:i})})});pm.displayName="List";const gt=pm;gt.Item=tc,gt.ItemTitle=ad,gt.ItemSection=sd,gt.ItemHeader=dm,gt.ItemWithSubItems=fm,gt.ItemSeparator=hm;const mm=v.forwardRef((e,t)=>u.jsx(gt,{...e,ref:t}));mm.displayName="DropdownList";const gm=v.forwardRef((e,t)=>{const{handleClose:n}=v.useContext(ec),{onClick:o,onKeyDown:r,...i}=e,a=v.useRef(null),s=v.useCallback(c=>{a.current=c,typeof t=="function"?t(c):t&&(t.current=c)},[t]);return u.jsx(tc,{...i,ref:s,onClick:c=>{o==null||o(c),n==null||n()},onKeyDown:c=>{if(r==null||r(c),c.defaultPrevented||!Go(c))return;c.preventDefault(),c.stopPropagation();const l=(typeof t=="function"?null:t==null?void 0:t.current)||a.current;l==null||l.click()}})});gm.displayName="DropdownItem";const vm=v.forwardRef((e,t)=>u.jsx(ad,{...e,ref:t}));vm.displayName="DropdownItemTitle";const ym=v.forwardRef((e,t)=>u.jsx(sd,{...e,ref:t}));ym.displayName="DropdownItemSection";const wm=v.forwardRef((e,t)=>u.jsx(bi,{...e}));wm.displayName="DropdownSeparator";function Gl(e,t,n){const o=v.useCallback(r=>{t.some(a=>r.key===a)&&(r.preventDefault(),e())},[e,t]);v.useEffect(()=>{const r=(n==null?void 0:n.current)||document;return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[o,n])}const fe=v.forwardRef(({className:e,variant:t="outline",align:n="down",disabled:o,isOpen:r,onOpenChange:i,children:a,...s},c)=>{const l=v.useRef(null),d=v.useRef(null);v.useImperativeHandle(c,()=>d.current,[]);const{isOpen:f,handleOpen:h,handleClose:p}=((y,w)=>{const[k,b]=v.useState(!1),S=y!==void 0,x=S?y:k,C=v.useCallback(M=>{S||b(M),w==null||w(M)},[S,w]),T=v.useCallback(()=>C(!0),[C]),L=v.useCallback(()=>C(!1),[C]);return{isOpen:x,setOpen:C,handleOpen:T,handleClose:L}})(r,i);((y,w,k=!0)=>{v.useEffect(()=>{if(!k)return;const b=x=>{const C=x.target;C&&y.current&&!y.current.contains(C)&&(x.composedPath&&x.composedPath().some(T=>T===y.current||y.current&&T.nodeType===Node.ELEMENT_NODE&&y.current.contains(T))||w())},S=requestAnimationFrame(()=>{document.addEventListener("mousedown",b,!0)});return()=>{cancelAnimationFrame(S),document.removeEventListener("mousedown",b,!0)}},[y,w,k])})(d,p,f),Gl(()=>{f&&p()},["Escape"],d),Gl(()=>{f||o||l.current!==document.activeElement||h()},["ArrowDown","ArrowUp"],d);const m=v.useMemo(()=>({variant:t,align:n,disabled:o,isOpen:f,handleOpen:h,handleClose:p,handleToggle:f?p:h,setTriggerRef:y=>l.current=y}),[t,n,o,f,h,p]),g=oe("io-dropdown",f&&"io-dropdown-open",t!=="default"&&`io-dropdown-${t}`,e);return u.jsx(ec.Provider,{value:m,children:u.jsx("div",{className:g,ref:d,...s,children:a})})});function We({className:e,variant:t="default",align:n="left",children:o,...r}){const i=oe("io-btn-group",t!=="default"&&`io-btn-group-${t}`,n==="right"&&"io-btn-group-right",e);return u.jsx("div",{className:i,"data-testid":"button-group",...r,children:o})}function nn({className:e,draggable:t=!1,children:n,...o}){const r=oe("io-header",t&&["draggable"],e);return u.jsx("header",{className:r,...o,children:n})}function ji({className:e,children:t,...n}){const o=oe("io-dialog-header",e);return u.jsx(nn,{"data-testid":"io-dialog-header",className:o,...n,children:t})}function ub({className:e,children:t,...n}){const o=oe("io-dialog-body",e);return u.jsx("div",{"data-testid":"io-dialog-body",className:o,...n,children:t})}function mr({className:e,children:t,...n}){const o=oe("io-footer",e);return u.jsx("footer",{className:o,...n,children:t})}function Ra({className:e,...t}){const n=oe("io-dialog-footer",e);return u.jsx(mr,{"data-testid":"io-dialog-footer",className:n,...t})}function nc(){return typeof window<"u"}function zo(e){return bm(e)?(e.nodeName||"").toLowerCase():"#document"}function an(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wn(e){var t;return(t=(bm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function bm(e){return!!nc()&&(e instanceof Node||e instanceof an(e).Node)}function nt(e){return!!nc()&&(e instanceof Element||e instanceof an(e).Element)}function St(e){return!!nc()&&(e instanceof HTMLElement||e instanceof an(e).HTMLElement)}function ql(e){return!(!nc()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof an(e).ShadowRoot)}fe.Button=sm,fe.ButtonIcon=cm,fe.Content=lm,fe.List=mm,fe.Item=gm,fe.ItemTitle=vm,fe.ItemSection=ym,fe.Separator=wm,We.Button=Qe,We.ButtonIcon=Ue,We.Dropdown=fe,nn.Title=zn,nn.ButtonGroup=We,nn.Button=Qe,nn.ButtonIcon=Ue,nn.Dropdown=fe,ji.Title=zn,ji.ButtonGroup=We,ji.Button=Qe,ji.ButtonIcon=Ue,ji.Dropdown=fe,ub.Content=function({className:e,children:t,...n}){const o=oe("io-dialog-content",e);return u.jsx("div",{className:o,...n,children:t})},mr.ButtonGroup=We,mr.Button=Qe,mr.ButtonIcon=Ue,mr.Dropdown=fe,Ra.ButtonGroup=We,Ra.Button=Qe,Ra.ButtonIcon=Ue,Ra.Dropdown=fe;const db=new Set(["inline","contents"]);function na(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=pn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!db.has(r)}const fb=new Set(["table","td","th"]);function hb(e){return fb.has(zo(e))}const pb=[":popover-open",":modal"];function bs(e){return pb.some(t=>{try{return e.matches(t)}catch{return!1}})}const mb=["transform","translate","scale","rotate","perspective"],gb=["transform","translate","scale","rotate","perspective","filter"],vb=["paint","layout","strict","content"];function Jl(e){const t=oc(),n=nt(e)?pn(e):e;return mb.some(o=>!!n[o]&&n[o]!=="none")||!!n.containerType&&n.containerType!=="normal"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||gb.some(o=>(n.willChange||"").includes(o))||vb.some(o=>(n.contain||"").includes(o))}function oc(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const yb=new Set(["html","body","#document"]);function Do(e){return yb.has(zo(e))}function pn(e){return an(e).getComputedStyle(e)}function rc(e){return nt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function io(e){if(zo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ql(e)&&e.host||Wn(e);return ql(t)?t.host:t}function xm(e){const t=io(e);return Do(t)?e.ownerDocument?e.ownerDocument.body:e.body:St(t)&&na(t)?t:xm(t)}function Mo(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=xm(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),a=an(r);if(i){const s=Zl(a);return t.concat(a,a.visualViewport||[],na(r)?r:[],s&&n?Mo(s):[])}return t.concat(r,Mo(r,[],n))}function Zl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oo(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Ot(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ql(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Sm(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function km(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function Cm(e){return!(e.mozInputSource!==0||!e.isTrusted)||(Yl()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType)}function Em(e){return!km().includes("jsdom/")&&(!Yl()&&e.width===0&&e.height===0||Yl()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch")}function Am(){return/apple/i.test(navigator.vendor)}function Yl(){const e=/android/i;return e.test(Sm())||e.test(km())}function Fi(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Ht(e){return(e==null?void 0:e.ownerDocument)||document}function Yc(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function ko(e){return"composedPath"in e?e.composedPath()[0]:e.target}function _m(e){return St(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function zt(e){e.preventDefault(),e.stopPropagation()}function Xl(e){return!!e&&e.getAttribute("role")==="combobox"&&_m(e)}const xs=Math.min,vr=Math.max,Ss=Math.round,Kr=Math.floor,Fn=e=>({x:e,y:e}),wb={left:"right",right:"left",bottom:"top",top:"bottom"},bb={start:"end",end:"start"};function $f(e,t,n){return vr(e,xs(t,n))}function ic(e,t){return typeof e=="function"?e(t):e}function Sr(e){return e.split("-")[0]}function ac(e){return e.split("-")[1]}function jm(e){return e==="x"?"y":"x"}function Om(e){return e==="y"?"height":"width"}const xb=new Set(["top","bottom"]);function Oo(e){return xb.has(Sr(e))?"y":"x"}function Pm(e){return jm(Oo(e))}function Ql(e){return e.replace(/start|end/g,t=>bb[t])}const Hf=["left","right"],Wf=["right","left"],Sb=["top","bottom"],kb=["bottom","top"];function Cb(e,t,n,o){const r=ac(e);let i=function(a,s,c){switch(a){case"top":case"bottom":return c?s?Wf:Hf:s?Hf:Wf;case"left":case"right":return s?Sb:kb;default:return[]}}(Sr(e),n==="start",o);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(Ql)))),i}function La(e){return e.replace(/left|right|bottom|top/g,t=>wb[t])}function ks(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}/*!
|
|
5
|
+
*/yl=Fm,function(){var e={}.hasOwnProperty;function t(){for(var r="",i=0;i<arguments.length;i++){var a=arguments[i];a&&(r=o(r,n(a)))}return r}function n(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.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)e.call(r,a)&&r[a]&&(i=o(i,a));return i}function o(r,i){return i?r?r+" "+i:r+i:r}yl.exports?(t.default=t,yl.exports=t):window.classNames=t}();var re=Wm(Fm.exports);function xt({className:e,size:t="16",variant:n="workspace",...o}){const r=re("icon",t&&[`icon-size-${t}`],e);return l.jsx("span",{className:r,"aria-label":`icon-${n}`,role:"presentation",...o,children:l.jsx("i",{className:`icon-${n}`})})}const Ue=v.forwardRef(({className:e,variant:t="default",icon:n="workspace",size:o="16",tooltip:r,iconSize:i="16",onClick:a,disabled:s,children:c,...u},d)=>{const f=re("io-btn-icon",t!=="default"&&[`io-btn-icon-${t}`],[`io-btn-icon-size-${o}`],e),h=v.useCallback(p=>{if(!s)return a?a(p):void 0;p.preventDefault()},[a,s]);return l.jsx("button",{className:f,type:"button",ref:d,"aria-label":"icon button","aria-disabled":s,title:r,onClick:h,disabled:s,...u,children:c??(n&&l.jsx(xt,{variant:n,size:i}))})});Ue.displayName="ButtonIcon";const Kb={default:void 0,info:"info",success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function Vb({className:e,variant:t="default",size:n="normal",text:o,close:r=!1,closeButtonOnClick:i,append:a,...s}){const c=re("io-alert",`io-alert-${t}`,n==="large"&&"io-alert-lg",e),u=Kb[t];return l.jsxs("div",{"data-testid":"io-alert",className:c,role:"alert","aria-label":"alert",...s,children:[u&&l.jsx(xt,{"data-testid":"io-alert-icon",variant:u,className:"icon-severity"}),o&&l.jsx("p",{"data-testid":"io-alert-text",className:"io-text-smaller",children:o}),n==="large"&&a,r&&l.jsx(Ue,{"data-testid":"io-alert-close-button",className:"ms-auto",size:"16",iconSize:"10",icon:"close",onClick:i})]})}function Gb({className:e,variant:t="default",children:n,...o}){const r=re("io-badge",t!=="default"&&[`io-badge-${t}`],e);return l.jsx("div",{className:r,...o,children:n})}function qn({className:e,tag:t="h2",size:n="normal",text:o="Title",...r}){const i=t,a=re(n==="small"&&"io-title-semibold",n==="normal"&&"io-title",n==="large"&&"io-title-large",e);return l.jsx(i,{className:a,...r,children:o})}function Xe({className:e,title:t,titleSize:n="normal",tag:o,hint:r,children:i,...a}){const s=re("io-block",e),c=t?"block-title":void 0;return l.jsxs("section",{className:s,"aria-label":t?void 0:"Block","aria-labelledby":c,...a,children:[t&&l.jsx(qn,{id:c,tag:o,text:t,size:n}),i,r&&l.jsx("p",{className:"io-text-smaller",children:r})]})}const vo=e=>e.key==="Enter"||e.key===" ",et=v.forwardRef(({className:e,variant:t="default",size:n="normal",icon:o,iconSize:r="12",iconRight:i=!1,text:a,onClick:s,disabled:c,children:u,...d},f)=>{const h=re("io-btn",(t==="primary"||t==="critical"||t==="outline"||t==="link")&&[`io-btn-${t}`],n==="large"&&"io-btn-lg",e),p=v.useCallback(g=>{if(!c)return s?s(g):void 0;g.preventDefault()},[s,c]),m=v.useCallback(g=>{c||vo(g)&&(g.preventDefault(),p(g))},[p,c]);return l.jsxs("button",{className:h,ref:f,type:"button","aria-disabled":c,onClick:p,onKeyDown:m,disabled:c,tabIndex:0,...d,children:[o&&!i&&l.jsx(xt,{variant:o,size:r}),u??a,o&&i&&l.jsx(xt,{variant:o,size:r})]})});et.displayName="Button";const kc=v.createContext({}),zm=v.forwardRef(({icon:e="chevron-down",onClick:t,onKeyDown:n,...o},r)=>{const{handleToggle:i,disabled:a,setTriggerRef:s}=v.useContext(kc),c=v.useCallback(f=>{s==null||s(f),r&&(typeof r=="function"?r(f):r.current=f)},[r,s]),u=v.useCallback(f=>{f.stopPropagation(),t==null||t(f),f.defaultPrevented||(i==null||i())},[t,i]),d=v.useCallback(f=>{n==null||n(f),f.defaultPrevented||vo(f)&&(f.preventDefault(),f.stopPropagation(),i==null||i())},[n,i]);return l.jsx(et,{icon:e,iconRight:!0,onClick:u,onKeyDown:d,disabled:a,ref:c,...o})});zm.displayName="DropdownButton";const Um=v.forwardRef(({size:e="32",onClick:t,onKeyDown:n,...o},r)=>{const{handleToggle:i,disabled:a,setTriggerRef:s}=v.useContext(kc),c=v.useCallback(f=>{s==null||s(f),r&&(typeof r=="function"?r(f):r.current=f)},[r,s]),u=v.useCallback(f=>{f.stopPropagation(),t==null||t(f),f.defaultPrevented||(i==null||i())},[t,i]),d=v.useCallback(f=>{n==null||n(f),f.defaultPrevented||vo(f)&&(f.preventDefault(),f.stopPropagation(),i==null||i())},[n,i]);return l.jsx(Ue,{size:e,onClick:u,onKeyDown:d,disabled:a,ref:c,...o})});function Km({className:e,...t}){const n=re("io-dropdown-content",e);return l.jsx("div",{className:n,...t})}Um.displayName="DropdownButtonIcon";const Vm=v.createContext({}),Cc=v.forwardRef((e,t)=>{const{className:n,prepend:o,append:r,isSelected:i,onClick:a,description:s,disabled:c=!1,children:u,tooltip:d,...f}=e,{variant:h="default",selected:p,checkIcon:m,handleItemClick:g}=v.useContext(Vm),y=i??(p==null?void 0:p.some(k=>k.children===u)),w=h!=="default"&&!!m,S=w||o,b=re("io-list-item",S&&"io-list-item-left",r&&"io-list-item-right",h!=="default"&&y&&"selected",s&&"io-list-item-description",c&&"io-list-item-disabled",n);return l.jsxs("li",{className:b,ref:t,role:"menuitem","aria-roledescription":"menuitem",tabIndex:0,onClick:k=>{c?k.preventDefault():(g==null||g(k,{children:u}),a==null||a(k))},...f,children:[S&&l.jsxs("div",{className:"io-list-left-column",children:[w&&l.jsx(xt,{variant:m.variant,title:y?m.tooltip:void 0,"data-testid":"list-item-check-icon"}),o]}),l.jsx("span",{className:"io-list-text",title:d,"data-testid":"list-item-title",children:u}),r&&l.jsx("div",{className:"io-list-right-column",children:r}),s&&l.jsx("div",{className:"io-list-text-description",children:s})]})});Cc.displayName="ListItem";const Gm=v.forwardRef(({className:e,prepend:t,append:n,children:o,tooltip:r,...i},a)=>{const s=re("io-list-item-header",e);return l.jsxs("div",{className:s,ref:a,...i,children:[t&&l.jsx("div",{className:"io-list-left-column",children:t}),l.jsx("span",{className:"io-list-text",title:r,children:o}),n&&l.jsx("div",{className:"io-list-right-column",children:n})]})});Gm.displayName="ListItemHeader";const _d=v.forwardRef(({className:e,prepend:t,append:n,children:o,tooltip:r,...i},a)=>{const s=re("io-list-item",t&&"io-list-item-left",n&&"io-list-item-right","io-list-item-title",e);return l.jsxs("li",{className:s,ref:a,...i,children:[t&&l.jsx("div",{className:"io-list-left-column",children:t}),l.jsx("span",{className:"io-list-text",title:r,"data-testid":"list-item-title",children:o}),n&&l.jsx("div",{className:"io-list-right-column",children:n})]})});_d.displayName="ListItemTitle";const qm=v.forwardRef(({className:e,children:t,...n},o)=>{const r=re("io-list-item","io-list-with-sub-items",e);return l.jsx("li",{className:r,ref:o,...n,children:t})});qm.displayName="ListItemWithSubItems";const Td=v.forwardRef(({className:e,prepend:t,append:n,children:o,tooltip:r,...i},a)=>{const s=re("io-list-item",t&&"io-list-item-left",n&&"io-list-item-right","io-list-item-section",e);return l.jsxs("li",{className:s,ref:a,...i,children:[t&&l.jsx("div",{className:"io-list-left-column",children:t}),l.jsx("span",{className:"io-list-text",title:r,children:o}),n&&l.jsx("div",{className:"io-list-right-column",children:n})]})});function Di({className:e,...t}){const n=re("io-separator",e);return l.jsx("hr",{className:n,...t})}Td.displayName="ListItemSection";const Jm=e=>l.jsx(Di,{...e});Jm.displayName="ListItemSeparator";const Zm=v.forwardRef((e,t)=>{const{className:n,variant:o="default",checkIcon:r,children:i,...a}=e,[s,c]=v.useState([]),u=re("io-list",o!=="default"&&"io-list-selectable",n),d=v.useMemo(()=>{if(r)return typeof r=="object"?r:{variant:r}},[r]),f=v.useCallback((p,m)=>{if(o==="default")return;const g=s.some(y=>{var w,S;return((w=y.children)==null?void 0:w.toString())===((S=m.children)==null?void 0:S.toString())});o==="single"?c([m]):(()=>{const y=g?s.filter(w=>w.children!==m.children):[...s,m];c(y)})()},[s,o]),h=v.useMemo(()=>({variant:o,selected:s,checkIcon:d,handleItemClick:f}),[o,s,d,f]);return l.jsx(Vm.Provider,{value:h,children:l.jsx("ul",{className:u,ref:t,...a,children:i})})});Zm.displayName="List";const gt=Zm;gt.Item=Cc,gt.ItemTitle=_d,gt.ItemSection=Td,gt.ItemHeader=Gm,gt.ItemWithSubItems=qm,gt.ItemSeparator=Jm;const Ym=v.forwardRef((e,t)=>l.jsx(gt,{...e,ref:t}));Ym.displayName="DropdownList";const Xm=v.forwardRef((e,t)=>{const{handleClose:n}=v.useContext(kc),{onClick:o,onKeyDown:r,...i}=e,a=v.useRef(null),s=v.useCallback(c=>{a.current=c,typeof t=="function"?t(c):t&&(t.current=c)},[t]);return l.jsx(Cc,{...i,ref:s,onClick:c=>{o==null||o(c),n==null||n()},onKeyDown:c=>{if(r==null||r(c),c.defaultPrevented||!vo(c))return;c.preventDefault(),c.stopPropagation();const u=(typeof t=="function"?null:t==null?void 0:t.current)||a.current;u==null||u.click()}})});Xm.displayName="DropdownItem";const Qm=v.forwardRef((e,t)=>l.jsx(_d,{...e,ref:t}));Qm.displayName="DropdownItemTitle";const eg=v.forwardRef((e,t)=>l.jsx(Td,{...e,ref:t}));eg.displayName="DropdownItemSection";const tg=v.forwardRef((e,t)=>l.jsx(Di,{...e}));tg.displayName="DropdownSeparator";function yu(e,t,n){const o=v.useCallback(r=>{t.some(a=>r.key===a)&&(r.preventDefault(),e())},[e,t]);v.useEffect(()=>{const r=(n==null?void 0:n.current)||document;return r.addEventListener("keydown",o),()=>{r.removeEventListener("keydown",o)}},[o,n])}const pe=v.forwardRef(({className:e,variant:t="outline",align:n="down",disabled:o,isOpen:r,onOpenChange:i,children:a,...s},c)=>{const u=v.useRef(null),d=v.useRef(null);v.useImperativeHandle(c,()=>d.current,[]);const{isOpen:f,handleOpen:h,handleClose:p}=((y,w)=>{const[S,b]=v.useState(!1),k=y!==void 0,x=k?y:S,C=v.useCallback(M=>{k||b(M),w==null||w(M)},[k,w]),I=v.useCallback(()=>C(!0),[C]),R=v.useCallback(()=>C(!1),[C]);return{isOpen:x,setOpen:C,handleOpen:I,handleClose:R}})(r,i);((y,w,S=!0)=>{v.useEffect(()=>{if(!S)return;const b=x=>{const C=x.target;C&&y.current&&!y.current.contains(C)&&(x.composedPath&&x.composedPath().some(I=>I===y.current||y.current&&I.nodeType===Node.ELEMENT_NODE&&y.current.contains(I))||w())},k=requestAnimationFrame(()=>{document.addEventListener("mousedown",b,!0)});return()=>{cancelAnimationFrame(k),document.removeEventListener("mousedown",b,!0)}},[y,w,S])})(d,p,f),yu(()=>{f&&p()},["Escape"],d),yu(()=>{f||o||u.current!==document.activeElement||h()},["ArrowDown","ArrowUp"],d);const m=v.useMemo(()=>({variant:t,align:n,disabled:o,isOpen:f,handleOpen:h,handleClose:p,handleToggle:f?p:h,setTriggerRef:y=>u.current=y}),[t,n,o,f,h,p]),g=re("io-dropdown",f&&"io-dropdown-open",t!=="default"&&`io-dropdown-${t}`,e);return l.jsx(kc.Provider,{value:m,children:l.jsx("div",{className:g,ref:d,...s,children:a})})});function De({className:e,variant:t="default",align:n="left",children:o,...r}){const i=re("io-btn-group",t!=="default"&&`io-btn-group-${t}`,n==="right"&&"io-btn-group-right",e);return l.jsx("div",{className:i,"data-testid":"button-group",...r,children:o})}function sn({className:e,draggable:t=!1,children:n,...o}){const r=re("io-header",t&&["draggable"],e);return l.jsx("header",{className:r,...o,children:n})}function yr({className:e,children:t,...n}){const o=re("io-dialog-header",e);return l.jsx(sn,{"data-testid":"io-dialog-header",className:o,...n,children:t})}function fh({className:e,children:t,...n}){const o=re("io-dialog-body",e);return l.jsx("div",{"data-testid":"io-dialog-body",className:o,...n,children:t})}function Ar({className:e,children:t,...n}){const o=re("io-footer",e);return l.jsx("footer",{className:o,...n,children:t})}function Ki({className:e,...t}){const n=re("io-dialog-footer",e);return l.jsx(Ar,{"data-testid":"io-dialog-footer",className:n,...t})}function hi({className:e,variant:t="default",title:n="Dialog Title",isOpen:o=!1,draggable:r=!1,closeFn:i,children:a,...s}){const c=v.useRef(null),u=re("io-dialog",t==="centered"&&"io-dialog-center",e);return v.useLayoutEffect(()=>{const d=c==null?void 0:c.current;d&&(o?d.showModal():typeof d.close=="function"&&d.close())},[o]),l.jsxs("dialog",{"data-testid":"io-dialog",className:u,ref:c,"data-modal":!0,onClose:()=>{o&&i&&i()},onClick:d=>{o&&i&&d.target.nodeName==="DIALOG"&&i()},onKeyDown:d=>{const f=d.target instanceof HTMLDialogElement&&d.target.nodeName==="DIALOG";o&&i&&d.key===" "&&f&&i()},...s,children:[l.jsxs(yr,{draggable:r,children:[l.jsx("h3",{"data-testid":"io-dialog-title",children:n}),l.jsx(De,{children:l.jsx(Ue,{className:"non-draggable","data-testid":"io-dialog-close-button",size:"24",icon:"close",iconSize:"12",onClick:i,tabIndex:-1})})]}),a]})}function Ec(){return typeof window<"u"}function Qo(e){return ng(e)?(e.nodeName||"").toLowerCase():"#document"}function un(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Kn(e){var t;return(t=(ng(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ng(e){return!!Ec()&&(e instanceof Node||e instanceof un(e).Node)}function st(e){return!!Ec()&&(e instanceof Element||e instanceof un(e).Element)}function Pt(e){return!!Ec()&&(e instanceof HTMLElement||e instanceof un(e).HTMLElement)}function wu(e){return!(!Ec()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof un(e).ShadowRoot)}function ya(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=yn(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&r!=="inline"&&r!=="contents"}function qb(e){return/^(table|td|th)$/.test(Qo(e))}function Fs(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}pe.Button=zm,pe.ButtonIcon=Um,pe.Content=Km,pe.List=Ym,pe.Item=Xm,pe.ItemTitle=Qm,pe.ItemSection=eg,pe.Separator=tg,De.Button=et,De.ButtonIcon=Ue,De.Dropdown=pe,sn.Title=qn,sn.ButtonGroup=De,sn.Button=et,sn.ButtonIcon=Ue,sn.Dropdown=pe,yr.Title=qn,yr.ButtonGroup=De,yr.Button=et,yr.ButtonIcon=Ue,yr.Dropdown=pe,fh.Content=function({className:e,children:t,...n}){const o=re("io-dialog-content",e);return l.jsx("div",{className:o,...n,children:t})},Ar.ButtonGroup=De,Ar.Button=et,Ar.ButtonIcon=Ue,Ar.Dropdown=pe,Ki.ButtonGroup=De,Ki.Button=et,Ki.ButtonIcon=Ue,Ki.Dropdown=pe,hi.Header=yr,hi.Body=fh,hi.Footer=Ki;const Jb=/transform|translate|scale|rotate|perspective|filter/,Zb=/paint|layout|strict|content/,ur=e=>!!e&&e!=="none";let wl;function bu(e){const t=st(e)?yn(e):e;return ur(t.transform)||ur(t.translate)||ur(t.scale)||ur(t.rotate)||ur(t.perspective)||!jc()&&(ur(t.backdropFilter)||ur(t.filter))||Jb.test(t.willChange||"")||Zb.test(t.contain||"")}function jc(){return wl==null&&(wl=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),wl}function Ko(e){return/^(html|body|#document)$/.test(Qo(e))}function yn(e){return un(e).getComputedStyle(e)}function Ac(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function uo(e){if(Qo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wu(e)&&e.host||Kn(e);return wu(t)?t.host:t}function og(e){const t=uo(e);return Ko(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pt(t)&&ya(t)?t:og(t)}function Vo(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=og(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),a=un(r);if(i){const s=xu(a);return t.concat(a,a.visualViewport||[],ya(r)?r:[],s&&n?Vo(s):[])}return t.concat(r,Vo(r,[],n))}function xu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function co(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function At(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&wu(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function rg(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function ig(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function ag(e){return!(e.mozInputSource!==0||!e.isTrusted)||(Su()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType)}function sg(e){return!ig().includes("jsdom/")&&(!Su()&&e.width===0&&e.height===0||Su()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch")}function cg(){return/apple/i.test(navigator.vendor)}function Su(){const e=/android/i;return e.test(rg())||e.test(ig())}function oa(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Mt(e){return(e==null?void 0:e.ownerDocument)||document}function bl(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function No(e){return"composedPath"in e?e.composedPath()[0]:e.target}function lg(e){return Pt(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function zt(e){e.preventDefault(),e.stopPropagation()}function ku(e){return!!e&&e.getAttribute("role")==="combobox"&&lg(e)}const zs=Math.min,Pr=Math.max,Us=Math.round,ri=Math.floor,Vn=e=>({x:e,y:e}),Yb={left:"right",right:"left",bottom:"top",top:"bottom"};function hh(e,t,n){return Pr(e,zs(t,n))}function Oc(e,t){return typeof e=="function"?e(t):e}function Lr(e){return e.split("-")[0]}function Pc(e){return e.split("-")[1]}function ug(e){return e==="x"?"y":"x"}function dg(e){return e==="y"?"height":"width"}function Ho(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function fg(e){return ug(Ho(e))}function Cu(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ph=["left","right"],mh=["right","left"],Xb=["top","bottom"],Qb=["bottom","top"];function ex(e,t,n,o){const r=Pc(e);let i=function(a,s,c){switch(a){case"top":case"bottom":return c?s?mh:ph:s?ph:mh;case"left":case"right":return s?Xb:Qb;default:return[]}}(Lr(e),n==="start",o);return r&&(i=i.map(a=>a+"-"+r),t&&(i=i.concat(i.map(Cu)))),i}function Qa(e){const t=Lr(e);return Yb[t]+e.slice(t.length)}function Ks(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}/*!
|
|
6
6
|
* tabbable 6.4.0
|
|
7
7
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
8
|
-
*/var Cs=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),Nm=typeof Element>"u",si=Nm?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,as=!Nm&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Es=function(e,t){var n;t===void 0&&(t=!0);var o=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"inert");return o===""||o==="true"||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):Es(e.parentNode))},eu=function(e,t,n){for(var o=[],r=Array.from(e);r.length;){var i=r.shift();if(!Es(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),s=a.length?a:i.children,c=eu(s,!0,n);n.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{si.call(i,Cs)&&n.filter(i)&&(t||!e.includes(i))&&o.push(i);var l=i.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(i),d=!Es(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(l&&d){var f=eu(l===!0?i.children:l.children,!0,n);n.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else r.unshift.apply(r,i.children)}}return o},Im=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Tm=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"}(e))&&!Im(e)?0:e.tabIndex},Eb=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Rm=function(e){return e.tagName==="INPUT"},Ab=function(e){return function(t){return Rm(t)&&t.type==="radio"}(e)&&!function(t){if(!t.name)return!0;var n,o=t.form||as(t),r=function(a){return o.querySelectorAll('input[type="radio"][name="'+a+'"]')};if(typeof window<"u"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")n=r(window.CSS.escape(t.name));else try{n=r(t.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,s){for(var c=0;c<a.length;c++)if(a[c].checked&&a[c].form===s)return a[c]}(n,t.form);return!i||i===t}(e)},Ff=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return n===0&&o===0},_b=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if(n==="full-native"&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility==="hidden")return!0;var r=si.call(e,"details>summary:first-of-type")?e.parentElement:e;if(si.call(r,"details:not([open]) *"))return!0;if(n&&n!=="full"&&n!=="full-native"&&n!=="legacy-full"){if(n==="non-zero-area")return Ff(e)}else{if(typeof o=="function"){for(var i=e;e;){var a=e.parentElement,s=as(e);if(a&&!a.shadowRoot&&o(a)===!0)return Ff(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(c){var l,d,f,h,p=c&&as(c),m=(l=p)===null||l===void 0?void 0:l.host,g=!1;if(p&&p!==c)for(g=!!((d=m)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(m)||c!=null&&(h=c.ownerDocument)!==null&&h!==void 0&&h.contains(c));!g&&m;){var y,w,k;g=!((w=m=(y=p=as(m))===null||y===void 0?void 0:y.host)===null||w===void 0||(k=w.ownerDocument)===null||k===void 0||!k.contains(m))}return g}(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}return!1},jb=function(e,t){return!(t.disabled||function(n){return Rm(n)&&n.type==="hidden"}(t)||_b(t,e)||function(n){return n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"})}(t)||function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var o=n.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!!si.call(o,"fieldset[disabled] *")||!i.contains(n)}return!0}o=o.parentElement}return!1}(t))},tu=function(e,t){return!(Ab(t)||Tm(t)<0||!jb(e,t))},Ob=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Lm=function(e){var t=[],n=[];return e.forEach(function(o,r){var i=!!o.scopeParent,a=i?o.scopeParent:o,s=function(l,d){var f=Tm(l);return f<0&&d&&!Im(l)?0:f}(a,i),c=i?Lm(o.candidates):a;s===0?i?t.push.apply(t,c):t.push(a):n.push({documentOrder:r,tabIndex:s,item:o,isScope:i,content:c})}),n.sort(Eb).reduce(function(o,r){return r.isScope?o.push.apply(o,r.content):o.push(r.content),o},[]).concat(t)},cd=function(e,t){var n;return n=(t=t||{}).getShadowRoot?eu([e],t.includeContainer,{filter:tu.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ob}):function(o,r,i){if(Es(o))return[];var a=Array.prototype.slice.apply(o.querySelectorAll(Cs));return r&&si.call(o,Cs)&&a.unshift(o),a.filter(i)}(e,t.includeContainer,tu.bind(null,t)),Lm(n)};function Bf(e,t,n){let{reference:o,floating:r}=e;const i=Oo(t),a=Pm(t),s=Om(a),c=Sr(t),l=i==="y",d=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,h=o[s]/2-r[s]/2;let p;switch(c){case"top":p={x:d,y:o.y-r.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(ac(t)){case"start":p[a]-=h*(n&&l?-1:1);break;case"end":p[a]+=h*(n&&l?-1:1)}return p}async function Pb(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=ic(t,e),m=function(x){return typeof x!="number"?function(C){return{top:0,right:0,bottom:0,left:0,...C}}(x):{top:x,right:x,bottom:x,left:x}}(p),g=s[h?f==="floating"?"reference":"floating":f],y=ks(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:d,strategy:c})),w=f==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,k=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),b=await(i.isElement==null?void 0:i.isElement(k))&&await(i.getScale==null?void 0:i.getScale(k))||{x:1,y:1},S=ks(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:k,strategy:c}):w);return{top:(y.top-S.top+m.top)/b.y,bottom:(S.bottom-y.bottom+m.bottom)/b.y,left:(y.left-S.left+m.left)/b.x,right:(S.right-y.right+m.right)/b.x}}const Nb=new Set(["left","top"]);function Dm(e){const t=pn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=St(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,s=Ss(n)!==i||Ss(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function ld(e){return nt(e)?e:e.contextElement}function ei(e){const t=ld(e);if(!St(t))return Fn(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Dm(t);let a=(i?Ss(n.width):n.width)/o,s=(i?Ss(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const Ib=Fn(0);function Mm(e){const t=an(e);return oc()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ib}function kr(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=ld(e);let a=Fn(1);t&&(o?nt(o)&&(a=ei(o)):a=ei(e));const s=function(h,p,m){return p===void 0&&(p=!1),!(!m||p&&m!==an(h))&&p}(i,n,o)?Mm(i):Fn(0);let c=(r.left+s.x)/a.x,l=(r.top+s.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(i){const h=an(i),p=o&&nt(o)?an(o):o;let m=h,g=Zl(m);for(;g&&o&&p!==m;){const y=ei(g),w=g.getBoundingClientRect(),k=pn(g),b=w.left+(g.clientLeft+parseFloat(k.paddingLeft))*y.x,S=w.top+(g.clientTop+parseFloat(k.paddingTop))*y.y;c*=y.x,l*=y.y,d*=y.x,f*=y.y,c+=b,l+=S,m=an(g),g=Zl(m)}}return ks({width:d,height:f,x:c,y:l})}function As(e,t){const n=rc(e).scrollLeft;return t?t.left+n:kr(Wn(e)).left+n}function $m(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-As(e,n),y:n.top+t.scrollTop}}const Tb=new Set(["absolute","fixed"]);function zf(e,t,n){let o;if(t==="viewport")o=function(r,i){const a=an(r),s=Wn(r),c=a.visualViewport;let l=s.clientWidth,d=s.clientHeight,f=0,h=0;if(c){l=c.width,d=c.height;const m=oc();(!m||m&&i==="fixed")&&(f=c.offsetLeft,h=c.offsetTop)}const p=As(s);if(p<=0){const m=s.ownerDocument,g=m.body,y=getComputedStyle(g),w=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,k=Math.abs(s.clientWidth-g.clientWidth-w);k<=25&&(l-=k)}else p<=25&&(l+=p);return{width:l,height:d,x:f,y:h}}(e,n);else if(t==="document")o=function(r){const i=Wn(r),a=rc(r),s=r.ownerDocument.body,c=vr(i.scrollWidth,i.clientWidth,s.scrollWidth,s.clientWidth),l=vr(i.scrollHeight,i.clientHeight,s.scrollHeight,s.clientHeight);let d=-a.scrollLeft+As(r);const f=-a.scrollTop;return pn(s).direction==="rtl"&&(d+=vr(i.clientWidth,s.clientWidth)-c),{width:c,height:l,x:d,y:f}}(Wn(e));else if(nt(t))o=function(r,i){const a=kr(r,!0,i==="fixed"),s=a.top+r.clientTop,c=a.left+r.clientLeft,l=St(r)?ei(r):Fn(1);return{width:r.clientWidth*l.x,height:r.clientHeight*l.y,x:c*l.x,y:s*l.y}}(t,n);else{const r=Mm(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ks(o)}function Hm(e,t){const n=io(e);return!(n===t||!nt(n)||Do(n))&&(pn(n).position==="fixed"||Hm(n,t))}function Rb(e,t,n){const o=St(t),r=Wn(t),i=n==="fixed",a=kr(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Fn(0);function l(){c.x=As(r)}if(o||!o&&!i)if((zo(t)!=="body"||na(r))&&(s=rc(t)),o){const f=kr(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else r&&l();i&&!o&&r&&l();const d=!r||o||i?Fn(0):$m(r,s);return{x:a.left+s.scrollLeft-c.x-d.x,y:a.top+s.scrollTop-c.y-d.y,width:a.width,height:a.height}}function Xc(e){return pn(e).position==="static"}function Uf(e,t){if(!St(e)||pn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Wn(e)===n&&(n=n.ownerDocument.body),n}function Kf(e,t){const n=an(e);if(bs(e))return n;if(!St(e)){let r=io(e);for(;r&&!Do(r);){if(nt(r)&&!Xc(r))return r;r=io(r)}return n}let o=Uf(e,t);for(;o&&hb(o)&&Xc(o);)o=Uf(o,t);return o&&Do(o)&&Xc(o)&&!Jl(o)?n:o||function(r){let i=io(r);for(;St(i)&&!Do(i);){if(Jl(i))return i;if(bs(i))return null;i=io(i)}return null}(e)||n}const Lb={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",a=Wn(o),s=!!t&&bs(t.floating);if(o===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=Fn(1);const d=Fn(0),f=St(o);if((f||!f&&!i)&&((zo(o)!=="body"||na(a))&&(c=rc(o)),St(o))){const p=kr(o);l=ei(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const h=!a||f||i?Fn(0):$m(a,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+d.x+h.x,y:n.y*l.y-c.scrollTop*l.y+d.y+h.y}},getDocumentElement:Wn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?bs(t)?[]:function(c,l){const d=l.get(c);if(d)return d;let f=Mo(c,[],!1).filter(g=>nt(g)&&zo(g)!=="body"),h=null;const p=pn(c).position==="fixed";let m=p?io(c):c;for(;nt(m)&&!Do(m);){const g=pn(m),y=Jl(m);y||g.position!=="fixed"||(h=null),(p?!y&&!h:!y&&g.position==="static"&&h&&Tb.has(h.position)||na(m)&&!y&&Hm(c,m))?f=f.filter(w=>w!==m):h=g,m=io(m)}return l.set(c,f),f}(t,this._c):[].concat(n),o],a=i[0],s=i.reduce((c,l)=>{const d=zf(t,l,r);return c.top=vr(d.top,c.top),c.right=xs(d.right,c.right),c.bottom=xs(d.bottom,c.bottom),c.left=vr(d.left,c.left),c},zf(t,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Kf,getElementRects:async function(e){const t=this.getOffsetParent||Kf,n=this.getDimensions,o=await n(e.floating);return{reference:Rb(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Dm(e);return{width:t,height:n}},getScale:ei,isElement:nt,isRTL:function(e){return pn(e).direction==="rtl"}};function Vf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Db(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=ld(e),d=r||i?[...l?Mo(l):[],...Mo(t)]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=l&&s?function(y,w){let k,b=null;const S=Wn(y);function x(){var C;clearTimeout(k),(C=b)==null||C.disconnect(),b=null}return function C(T,L){T===void 0&&(T=!1),L===void 0&&(L=1),x();const M=y.getBoundingClientRect(),{left:j,top:N,width:O,height:Y}=M;if(T||w(),!O||!Y)return;const z={rootMargin:-Kr(N)+"px "+-Kr(S.clientWidth-(j+O))+"px "+-Kr(S.clientHeight-(N+Y))+"px "+-Kr(j)+"px",threshold:vr(0,xs(1,L))||1};let R=!0;function $(H){const K=H[0].intersectionRatio;if(K!==L){if(!R)return C();K?C(!1,K):k=setTimeout(()=>{C(!1,1e-7)},1e3)}K!==1||Vf(M,y.getBoundingClientRect())||C(),R=!1}try{b=new IntersectionObserver($,{...z,root:S.ownerDocument})}catch{b=new IntersectionObserver($,z)}b.observe(y)}(!0),x}(l,n):null;let h,p=-1,m=null;a&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===l&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var k;(k=m)==null||k.observe(t)})),n()}),l&&!c&&m.observe(l),m.observe(t));let g=c?kr(e):null;return c&&function y(){const w=kr(e);g&&!Vf(g,w)&&n(),g=w,h=requestAnimationFrame(y)}(),n(),()=>{var y;d.forEach(w=>{r&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(h)}}const Mb=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:s}=t,c=await async function(l,d){const{placement:f,platform:h,elements:p}=l,m=await(h.isRTL==null?void 0:h.isRTL(p.floating)),g=Sr(f),y=ac(f),w=Oo(f)==="y",k=Nb.has(g)?-1:1,b=m&&w?-1:1,S=ic(d,l);let{mainAxis:x,crossAxis:C,alignmentAxis:T}=typeof S=="number"?{mainAxis:S,crossAxis:0,alignmentAxis:null}:{mainAxis:S.mainAxis||0,crossAxis:S.crossAxis||0,alignmentAxis:S.alignmentAxis};return y&&typeof T=="number"&&(C=y==="end"?-1*T:T),w?{x:C*b,y:x*k}:{x:x*k,y:C*b}}(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:a}}}}},$b=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x:k,y:b}=w;return{x:k,y:b}}},...l}=ic(e,t),d={x:n,y:o},f=await i.detectOverflow(t,l),h=Oo(Sr(r)),p=jm(h);let m=d[p],g=d[h];if(a){const w=p==="y"?"bottom":"right";m=$f(m+f[p==="y"?"top":"left"],m,m-f[w])}if(s){const w=h==="y"?"bottom":"right";g=$f(g+f[h==="y"?"top":"left"],g,g-f[w])}const y=c.fn({...t,[p]:m,[h]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[p]:a,[h]:s}}}}}},Hb=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=ic(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Sr(r),k=Oo(s),b=Sr(s)===s,S=await(c.isRTL==null?void 0:c.isRTL(l.floating)),x=h||(b||!g?[La(s)]:function(z){const R=La(z);return[Ql(z),R,Ql(R)]}(s)),C=m!=="none";!h&&C&&x.push(...Cb(s,g,m,S));const T=[s,...x],L=await c.detectOverflow(t,y),M=[];let j=((o=i.flip)==null?void 0:o.overflows)||[];if(d&&M.push(L[w]),f){const z=function(R,$,H){H===void 0&&(H=!1);const K=ac(R),B=Pm(R),D=Om(B);let V=B==="x"?K===(H?"end":"start")?"right":"left":K==="start"?"bottom":"top";return $.reference[D]>$.floating[D]&&(V=La(V)),[V,La(V)]}(r,a,S);M.push(L[z[0]],L[z[1]])}if(j=[...j,{placement:r,overflows:M}],!M.every(z=>z<=0)){var N,O;const z=(((N=i.flip)==null?void 0:N.index)||0)+1,R=T[z];if(R&&(!(f==="alignment"&&k!==Oo(R))||j.every(H=>Oo(H.placement)!==k||H.overflows[0]>0)))return{data:{index:z,overflows:j},reset:{placement:R}};let $=(O=j.filter(H=>H.overflows[0]<=0).sort((H,K)=>H.overflows[1]-K.overflows[1])[0])==null?void 0:O.placement;if(!$)switch(p){case"bestFit":{var Y;const H=(Y=j.filter(K=>{if(C){const B=Oo(K.placement);return B===k||B==="y"}return!0}).map(K=>[K.placement,K.overflows.filter(B=>B>0).reduce((B,D)=>B+D,0)]).sort((K,B)=>K[1]-B[1])[0])==null?void 0:Y[0];H&&($=H);break}case"initialPlacement":$=s}if(r!==$)return{reset:{placement:$}}}return{}}}},Wb=(e,t,n)=>{const o=new Map,r={platform:Lb,...n},i={...r.platform,_c:o};return(async(a,s,c)=>{const{placement:l="bottom",strategy:d="absolute",middleware:f=[],platform:h}=c,p=f.filter(Boolean),m=await(h.isRTL==null?void 0:h.isRTL(s));let g=await h.getElementRects({reference:a,floating:s,strategy:d}),{x:y,y:w}=Bf(g,l,m),k=l,b={},S=0;for(let C=0;C<p.length;C++){var x;const{name:T,fn:L}=p[C],{x:M,y:j,data:N,reset:O}=await L({x:y,y:w,initialPlacement:l,placement:k,strategy:d,middlewareData:b,rects:g,platform:{...h,detectOverflow:(x=h.detectOverflow)!=null?x:Pb},elements:{reference:a,floating:s}});y=M??y,w=j??w,b={...b,[T]:{...b[T],...N}},O&&S<=50&&(S++,typeof O=="object"&&(O.placement&&(k=O.placement),O.rects&&(g=O.rects===!0?await h.getElementRects({reference:a,floating:s,strategy:d}):O.rects),{x:y,y:w}=Bf(g,k,m)),C=-1)}return{x:y,y:w,placement:k,strategy:d,middlewareData:b}})(e,t,{...r,platform:i})};var ss=typeof document<"u"?v.useLayoutEffect:function(){};function _s(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!_s(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if((i!=="_owner"||!e.$$typeof)&&!_s(e[i],t[i]))return!1}return!0}return e!=e&&t!=t}function Wm(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gf(e,t){const n=Wm(e);return Math.round(t*n)/n}function Qc(e){const t=U.useRef(e);return ss(()=>{t.current=e}),t}const Fb=(e,t)=>({...$b(e),options:[e,t]}),Bb=(e,t)=>({...Hb(e),options:[e,t]});function Fm(e){return U.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const Bm={...U},zb=Bm.useInsertionEffect||(e=>e());function Vt(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return zb(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}const ud="ArrowUp",Gi="ArrowDown",Co="ArrowLeft",Eo="ArrowRight";function Da(e,t,n){return Math.floor(e/t)!==n}function Oi(e,t){return t<0||t>=e.current.length}function el(e,t){return $t(e,{disabledIndices:t})}function qf(e,t){return $t(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function $t(e,t){let{startingIndex:n=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=t===void 0?{}:t;const a=e.current;let s=n;do s+=o?-i:i;while(s>=0&&s<=a.length-1&&cs(a,s,r));return s}function Ub(e,t,n,o,r){if(e===-1)return-1;const i=n.indexOf(e),a=t[e];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 n.lastIndexOf(e)}}function Kb(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function cs(e,t,n){if(n)return n.includes(t);const o=e[t];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}var st=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Vb(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const zm=U.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function Gb(e){const{children:t,elementsRef:n,labelsRef:o}=e,[r,i]=U.useState(()=>new Map),a=U.useCallback(c=>{i(l=>new Map(l).set(c,null))},[]),s=U.useCallback(c=>{i(l=>{const d=new Map(l);return d.delete(c),d})},[]);return st(()=>{const c=new Map(r);Array.from(c.keys()).sort(Vb).forEach((l,d)=>{c.set(l,d)}),function(l,d){if(l.size!==d.size)return!1;for(const[f,h]of l.entries())if(h!==d.get(f))return!1;return!0}(r,c)||i(c)},[r]),U.createElement(zm.Provider,{value:U.useMemo(()=>({register:a,unregister:s,map:r,elementsRef:n,labelsRef:o}),[a,s,r,n,o])},t)}function Um(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:o,map:r,elementsRef:i,labelsRef:a}=U.useContext(zm),[s,c]=U.useState(null),l=U.useRef(null),d=U.useCallback(f=>{if(l.current=f,s!==null&&(i.current[s]=f,a)){var h;const p=t!==void 0;a.current[s]=p?t:(h=f==null?void 0:f.textContent)!=null?h:null}},[s,i,a,t]);return st(()=>{const f=l.current;if(f)return n(f),()=>{o(f)}},[n,o]),st(()=>{const f=l.current?r.get(l.current):null;f!=null&&c(f)},[r]),U.useMemo(()=>({ref:d,index:s??-1}),[s,d])}function js(){return js=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},js.apply(this,arguments)}let Jf=!1,qb=0;const Zf=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+qb++,nu=Bm.useId||function(){const[e,t]=U.useState(()=>Jf?Zf():void 0);return st(()=>{e==null&&t(Zf())},[]),U.useEffect(()=>{Jf=!0},[]),e};let oa;function tl(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");var i;(e=oa)!=null&&e.has(r)||((i=oa)==null||i.add(r),console.warn(r))}function Km(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,((o=e.get(t))==null?void 0:o.filter(r=>r!==n))||[])}}}process.env.NODE_ENV!=="production"&&(oa=new Set);const Vm=U.createContext(null),Gm=U.createContext(null),Po=()=>{var e;return((e=U.useContext(Vm))==null?void 0:e.id)||null},No=()=>U.useContext(Gm);function Jb(e){const{children:t,id:n}=e,o=Po();return U.createElement(Vm.Provider,{value:U.useMemo(()=>({id:n,parentId:o}),[n,o])},t)}function Zb(e){const{children:t}=e,n=U.useRef([]),o=U.useCallback(a=>{n.current=[...n.current,a]},[]),r=U.useCallback(a=>{n.current=n.current.filter(s=>s!==a)},[]),i=U.useState(()=>Km())[0];return U.createElement(Gm.Provider,{value:U.useMemo(()=>({nodesRef:n,addNode:o,removeNode:r,events:i}),[o,r,i])},t)}function ra(e){return"data-floating-ui-"+e}function An(e){const t=v.useRef(e);return st(()=>{t.current=e}),t}const Yf=ra("safe-polygon");function nl(e,t,n){return n&&!Fi(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}let Xf=0;function xo(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Xf);const i=()=>e==null?void 0:e.focus({preventScroll:n});r?i():Xf=requestAnimationFrame(i)}function yr(e,t){let n=e.filter(r=>{var i;return r.parentId===t&&((i=r.context)==null?void 0:i.open)}),o=n;for(;o.length;)o=e.filter(r=>{var i;return(i=o)==null?void 0:i.some(a=>{var s;return r.parentId===a.id&&((s=r.context)==null?void 0:s.open)})}),n=n.concat(o);return n}let Rr=new WeakMap,Ma=new WeakSet,$a={},ol=0;const qm=e=>e&&(e.host||qm(e.parentNode));function Yb(e,t,n,o){const r="data-floating-ui-inert",i=o?"inert":n?"aria-hidden":null,a=((f,h)=>h.map(p=>{if(f.contains(p))return p;const m=qm(p);return f.contains(m)?m:null}).filter(p=>p!=null))(t,e),s=new Set,c=new Set(a),l=[];$a[r]||($a[r]=new WeakMap);const d=$a[r];return a.forEach(function f(h){!h||s.has(h)||(s.add(h),h.parentNode&&f(h.parentNode))}),function f(h){!h||c.has(h)||[].forEach.call(h.children,p=>{if(zo(p)!=="script")if(s.has(p))f(p);else{const m=i?p.getAttribute(i):null,g=m!==null&&m!=="false",y=(Rr.get(p)||0)+1,w=(d.get(p)||0)+1;Rr.set(p,y),d.set(p,w),l.push(p),y===1&&g&&Ma.add(p),w===1&&p.setAttribute(r,""),!g&&i&&p.setAttribute(i,"true")}})}(t),s.clear(),ol++,()=>{l.forEach(f=>{const h=(Rr.get(f)||0)-1,p=(d.get(f)||0)-1;Rr.set(f,h),d.set(f,p),h||(!Ma.has(f)&&i&&f.removeAttribute(i),Ma.delete(f)),p||f.removeAttribute(r)}),ol--,ol||(Rr=new WeakMap,Rr=new WeakMap,Ma=new WeakSet,$a={})}}function Qf(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=Ht(e[0]).body;return Yb(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Os=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function eh(e,t){const n=cd(e,Os());t==="prev"&&n.reverse();const o=n.indexOf(oo(Ht(e)));return n.slice(o+1)[0]}function th(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!Ot(n,o)}const dd={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 nh(e){e.key==="Tab"&&(e.target,clearTimeout(void 0))}const oh=U.forwardRef(function(e,t){const[n,o]=U.useState();st(()=>(Am()&&o("button"),document.addEventListener("keydown",nh),()=>{document.removeEventListener("keydown",nh)}),[]);const r={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[ra("focus-guard")]:"",style:dd};return U.createElement("span",js({},e,r))}),Xb=U.createContext(null),ou="data-floating-ui-focusable";function Jm(e){return e?e.hasAttribute(ou)?e:e.querySelector("["+ou+"]")||e:null}let sr=[];function rl(e){sr=sr.filter(n=>n.isConnected);let t=e;if(t&&zo(t)!=="body"){if(!function(n,o){if(o=o||{},!n)throw new Error("No node provided");return si.call(n,Cs)!==!1&&tu(o,n)}(t,Os())){const n=cd(t,Os())[0];n&&(t=n)}sr.push(t),sr.length>20&&(sr=sr.slice(-20))}}function rh(){return sr.slice().reverse().find(e=>e.isConnected)}const Qb=U.forwardRef(function(e,t){return U.createElement("button",js({},e,{type:"button",ref:t,tabIndex:-1,style:dd}))});function ex(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:p,nodeId:m,onOpenChange:g,events:y,dataRef:w,floatingId:k,elements:{domReference:b,floating:S}}=t,x=typeof a=="number"&&a<0,C=Xl(b)&&x,T=typeof HTMLElement>"u"||!("inert"in HTMLElement.prototype)||i,L=An(r),M=An(a),j=An(s),N=No(),O=U.useContext(Xb),Y=U.useRef(null),z=U.useRef(null),R=U.useRef(!1),$=U.useRef(!1),H=U.useRef(-1),K=O!=null,B=Jm(S),D=Vt(function(I){return I===void 0&&(I=B),I?cd(I,Os()):[]}),V=Vt(I=>{const E=D(I);return L.current.map(A=>b&&A==="reference"?b:B&&A==="floating"?B:E).filter(Boolean).flat()});function G(I){return!o&&d&&l?U.createElement(Qb,{ref:I==="start"?Y:z,onClick:E=>g(!1,E.nativeEvent)},typeof d=="string"?d:"Dismiss"):null}U.useEffect(()=>{if(o||!l)return;function I(A){if(A.key==="Tab"){Ot(B,oo(Ht(B)))&&D().length===0&&!C&&zt(A);const _=V(),W=ko(A);L.current[0]==="reference"&&W===b&&(zt(A),A.shiftKey?xo(_[_.length-1]):xo(_[1])),L.current[1]==="floating"&&W===B&&A.shiftKey&&(zt(A),xo(_[0]))}}const E=Ht(B);return E.addEventListener("keydown",I),()=>{E.removeEventListener("keydown",I)}},[o,b,B,l,L,C,D,V]),U.useEffect(()=>{if(!o&&S)return S.addEventListener("focusin",I),()=>{S.removeEventListener("focusin",I)};function I(E){const A=ko(E),_=D().indexOf(A);_!==-1&&(H.current=_)}},[o,S,D]),U.useEffect(()=>{if(!o&&f)return S&&St(b)?(b.addEventListener("focusout",E),b.addEventListener("pointerdown",I),S.addEventListener("focusout",E),()=>{b.removeEventListener("focusout",E),b.removeEventListener("pointerdown",I),S.removeEventListener("focusout",E)}):void 0;function I(){$.current=!0,setTimeout(()=>{$.current=!1})}function E(A){const _=A.relatedTarget;queueMicrotask(()=>{const W=!(Ot(b,_)||Ot(S,_)||Ot(_,S)||Ot(O==null?void 0:O.portalNode,_)||_!=null&&_.hasAttribute(ra("focus-guard"))||N&&(yr(N.nodesRef.current,m).find(F=>{var X,q;return Ot((X=F.context)==null?void 0:X.elements.floating,_)||Ot((q=F.context)==null?void 0:q.elements.domReference,_)})||function(F,X){var q;let P=[],ce=(q=F.find(le=>le.id===X))==null?void 0:q.parentId;for(;ce;){const le=F.find(ve=>ve.id===ce);ce=le==null?void 0:le.parentId,le&&(P=P.concat(le))}return P}(N.nodesRef.current,m).find(F=>{var X,q;return((X=F.context)==null?void 0:X.elements.floating)===_||((q=F.context)==null?void 0:q.elements.domReference)===_})));if(c&&W&&oo(Ht(B))===Ht(B).body){St(B)&&B.focus();const F=H.current,X=D(),q=X[F]||X[X.length-1]||B;St(q)&&q.focus()}!C&&l||!_||!W||$.current||_===rh()||(R.current=!0,g(!1,A,"focus-out"))})}},[o,b,S,B,l,m,N,O,g,f,c,D,C]),U.useEffect(()=>{var I;if(o)return;const E=Array.from((O==null||(I=O.portalNode)==null?void 0:I.querySelectorAll("["+ra("portal")+"]"))||[]);if(S){const A=[S,...E,Y.current,z.current,L.current.includes("reference")||C?b:null].filter(W=>W!=null),_=l||C?Qf(A,T,!T):Qf(A);return()=>{_()}}},[o,b,S,l,L,O,C,T]),st(()=>{if(o||!St(B))return;const I=oo(Ht(B));queueMicrotask(()=>{const E=V(B),A=M.current,_=(typeof A=="number"?E[A]:A.current)||B,W=Ot(B,I);x||W||!h||xo(_,{preventScroll:_===B})})},[o,h,B,x,V,M]),st(()=>{if(o||!B)return;let I=!1;const E=Ht(B),A=oo(E);let _=w.current.openEvent;function W(X){let{open:q,reason:P,event:ce,nested:le}=X;q&&(_=ce),P==="escape-key"&&p.domReference.current&&rl(p.domReference.current),P==="hover"&&ce.type==="mouseleave"&&(R.current=!0),P==="outside-press"&&(le?(R.current=!1,I=!0):R.current=!(Cm(ce)||Em(ce)))}rl(A),y.on("openchange",W);const F=E.createElement("span");return F.setAttribute("tabindex","-1"),F.setAttribute("aria-hidden","true"),Object.assign(F.style,dd),K&&b&&b.insertAdjacentElement("afterend",F),()=>{y.off("openchange",W);const X=oo(E),q=Ot(S,X)||N&&yr(N.nodesRef.current,m).some(ce=>{var le;return Ot((le=ce.context)==null?void 0:le.elements.floating,X)});(q||_&&["click","mousedown"].includes(_.type))&&p.domReference.current&&rl(p.domReference.current);const P=typeof j.current=="boolean"?rh()||F:j.current.current||F;queueMicrotask(()=>{j.current&&!R.current&&St(P)&&(P===X||X===E.body||q)&&P.focus({preventScroll:I}),F.remove()})}},[o,S,B,j,w,p,y,N,m,K,b]),U.useEffect(()=>{queueMicrotask(()=>{R.current=!1})},[o]),st(()=>{if(!o&&O)return O.setFocusManagerState({modal:l,closeOnFocusOut:f,open:h,onOpenChange:g,refs:p}),()=>{O.setFocusManagerState(null)}},[o,O,l,h,g,p,f]),st(()=>{if(o||!B||typeof MutationObserver!="function"||x)return;const I=()=>{const A=B.getAttribute("tabindex"),_=D(),W=oo(Ht(S)),F=_.indexOf(W);F!==-1&&(H.current=F),L.current.includes("floating")||W!==p.domReference.current&&_.length===0?A!=="0"&&B.setAttribute("tabindex","0"):A!=="-1"&&B.setAttribute("tabindex","-1")};I();const E=new MutationObserver(I);return E.observe(B,{childList:!0,subtree:!0,attributes:!0}),()=>{E.disconnect()}},[o,S,B,p,L,D,x]);const Z=!o&&T&&(!l||!C)&&(K||l);return U.createElement(U.Fragment,null,Z&&U.createElement(oh,{"data-type":"inside",ref:O==null?void 0:O.beforeInsideRef,onFocus:I=>{if(l){const A=V();xo(r[0]==="reference"?A[0]:A[A.length-1])}else if(O!=null&&O.preserveTabOrder&&O.portalNode)if(R.current=!1,th(I,O.portalNode)){const A=eh(document.body,"next")||b;A==null||A.focus()}else{var E;(E=O.beforeOutsideRef.current)==null||E.focus()}}}),!C&&G("start"),n,G("end"),Z&&U.createElement(oh,{"data-type":"inside",ref:O==null?void 0:O.afterInsideRef,onFocus:I=>{if(l)xo(V()[0]);else if(O!=null&&O.preserveTabOrder&&O.portalNode)if(f&&(R.current=!0),th(I,O.portalNode)){const A=eh(document.body,"prev")||b;A==null||A.focus()}else{var E;(E=O.afterOutsideRef.current)==null||E.focus()}}}))}function ih(e){return St(e.target)&&e.target.tagName==="BUTTON"}function ah(e){return _m(e)}const tx={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},nx={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},sh=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null&&t,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)==null||n}};function ox(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=nu(),i=U.useRef({}),[a]=U.useState(()=>Km()),s=Po()!=null;if(process.env.NODE_ENV!=="production"){const p=o.reference;p&&!nt(p)&&function(){for(var m,g=arguments.length,y=new Array(g),w=0;w<g;w++)y[w]=arguments[w];const k="Floating UI: "+y.join(" ");var b;(m=oa)!=null&&m.has(k)||((b=oa)==null||b.add(k),console.error(k))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,l]=U.useState(o.reference),d=Vt((p,m,g)=>{i.current.openEvent=p?m:void 0,a.emit("openchange",{open:p,event:m,reason:g,nested:s}),n==null||n(p,m,g)}),f=U.useMemo(()=>({setPositionReference:l}),[]),h=U.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return U.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:h,events:a,floatingId:r,refs:f}),[t,d,h,a,r,f])}function rx(e){e===void 0&&(e={});const{nodeId:t}=e,n=ox({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[i,a]=U.useState(null),[s,c]=U.useState(null),l=(r==null?void 0:r.domReference)||i,d=U.useRef(null),f=No();st(()=>{l&&(d.current=l)},[l]);const h=function(k){k===void 0&&(k={});const{placement:b="bottom",strategy:S="absolute",middleware:x=[],platform:C,elements:{reference:T,floating:L}={},transform:M=!0,whileElementsMounted:j,open:N}=k,[O,Y]=U.useState({x:0,y:0,strategy:S,placement:b,middlewareData:{},isPositioned:!1}),[z,R]=U.useState(x);_s(z,x)||R(x);const[$,H]=U.useState(null),[K,B]=U.useState(null),D=U.useCallback(be=>{be!==I.current&&(I.current=be,H(be))},[]),V=U.useCallback(be=>{be!==E.current&&(E.current=be,B(be))},[]),G=T||$,Z=L||K,I=U.useRef(null),E=U.useRef(null),A=U.useRef(O),_=j!=null,W=Qc(j),F=Qc(C),X=Qc(N),q=U.useCallback(()=>{if(!I.current||!E.current)return;const be={placement:b,strategy:S,middleware:z};F.current&&(be.platform=F.current),Wb(I.current,E.current,be).then(ke=>{const te={...ke,isPositioned:X.current!==!1};P.current&&!_s(A.current,te)&&(A.current=te,rm.flushSync(()=>{Y(te)}))})},[z,b,S,F,X]);ss(()=>{N===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,Y(be=>({...be,isPositioned:!1})))},[N]);const P=U.useRef(!1);ss(()=>(P.current=!0,()=>{P.current=!1}),[]),ss(()=>{if(G&&(I.current=G),Z&&(E.current=Z),G&&Z){if(W.current)return W.current(G,Z,q);q()}},[G,Z,q,W,_]);const ce=U.useMemo(()=>({reference:I,floating:E,setReference:D,setFloating:V}),[D,V]),le=U.useMemo(()=>({reference:G,floating:Z}),[G,Z]),ve=U.useMemo(()=>{const be={position:S,left:0,top:0};if(!le.floating)return be;const ke=Gf(le.floating,O.x),te=Gf(le.floating,O.y);return M?{...be,transform:"translate("+ke+"px, "+te+"px)",...Wm(le.floating)>=1.5&&{willChange:"transform"}}:{position:S,left:ke,top:te}},[S,M,le.floating,O.x,O.y]);return U.useMemo(()=>({...O,update:q,refs:ce,elements:le,floatingStyles:ve}),[O,q,ce,le,ve])}({...e,elements:{...r,...s&&{reference:s}}}),p=U.useCallback(k=>{const b=nt(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;c(b),h.refs.setReference(b)},[h.refs]),m=U.useCallback(k=>{(nt(k)||k===null)&&(d.current=k,a(k)),(nt(h.refs.reference.current)||h.refs.reference.current===null||k!==null&&!nt(k))&&h.refs.setReference(k)},[h.refs]),g=U.useMemo(()=>({...h.refs,setReference:m,setPositionReference:p,domReference:d}),[h.refs,m,p]),y=U.useMemo(()=>({...h.elements,domReference:l}),[h.elements,l]),w=U.useMemo(()=>({...h,...o,refs:g,elements:y,nodeId:t}),[h,g,y,t,o]);return st(()=>{o.dataRef.current.floatingContext=w;const k=f==null?void 0:f.nodesRef.current.find(b=>b.id===t);k&&(k.context=w)}),U.useMemo(()=>({...h,context:w,refs:g,elements:y}),[h,g,y,w])}const ch="active",lh="selected";function il(e,t,n){const o=new Map,r=n==="item";let i=e;if(r&&e){const{[ch]:a,[lh]:s,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1,[ou]:""},...i,...t.map(a=>{const s=a?a[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((a,s)=>(s&&Object.entries(s).forEach(c=>{let[l,d]=c;var f;r&&[ch,lh].includes(l)||(l.indexOf("on")===0?(o.has(l)||o.set(l,[]),typeof d=="function"&&((f=o.get(l))==null||f.push(d),a[l]=function(){for(var h,p=arguments.length,m=new Array(p),g=0;g<p;g++)m[g]=arguments[g];return(h=o.get(l))==null?void 0:h.map(y=>y(...m)).find(y=>y!==void 0)})):a[l]=d)}),a),{})}}let uh=!1;function sc(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function dh(e,t){return sc(t,e===ud||e===Gi,e===Co||e===Eo)}function al(e,t,n){return sc(t,e===Gi,n?e===Co:e===Eo)||e==="Enter"||e===" "||e===""}function fh(e,t,n){return sc(t,n?e===Eo:e===Co,e===ud)}function ix(e,t){const{open:n,onOpenChange:o,elements:r}=e,{listRef:i,activeIndex:a,onNavigate:s=()=>{},enabled:c=!0,selectedIndex:l=null,allowEscape:d=!1,loop:f=!1,nested:h=!1,rtl:p=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:k,orientation:b="vertical",cols:S=1,scrollItemIntoView:x=!0,virtualItemRef:C,itemSizes:T,dense:L=!1}=t;process.env.NODE_ENV!=="production"&&(d&&(f||tl("`useListNavigation` looping must be enabled to allow escaping."),m||tl("`useListNavigation` must be virtual to allow escaping.")),b==="vertical"&&S>1&&tl("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const M=An(Jm(r.floating)),j=Po(),N=No(),O=Vt(s),Y=Xl(r.domReference),z=U.useRef(g),R=U.useRef(l??-1),$=U.useRef(null),H=U.useRef(!0),K=U.useRef(O),B=U.useRef(!!r.floating),D=U.useRef(n),V=U.useRef(!1),G=U.useRef(!1),Z=An(k),I=An(n),E=An(x),A=An(l),[_,W]=U.useState(),[F,X]=U.useState(),q=Vt(function(te,ne,Q){function xe(ue){m?(W(ue.id),N==null||N.events.emit("virtualfocus",ue),C&&(C.current=ue)):xo(ue,{preventScroll:!0,sync:!(!Sm().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!Am())&&(uh||V.current)})}Q===void 0&&(Q=!1);const Pe=te.current[ne.current];Pe&&xe(Pe),requestAnimationFrame(()=>{const ue=te.current[ne.current]||Pe;if(!ue)return;Pe||xe(ue);const Ne=E.current;Ne&&ce&&(Q||!H.current)&&(ue.scrollIntoView==null||ue.scrollIntoView(typeof Ne=="boolean"?{block:"nearest",inline:"nearest"}:Ne))})});st(()=>{document.createElement("div").focus({get preventScroll(){return uh=!0,!1}})},[]),st(()=>{c&&(n&&r.floating?z.current&&l!=null&&(G.current=!0,R.current=l,O(l)):B.current&&(R.current=-1,K.current(null)))},[c,n,r.floating,l,O]),st(()=>{if(c&&n&&r.floating)if(a==null){if(V.current=!1,A.current!=null)return;if(B.current&&(R.current=-1,q(i,R)),(!D.current||!B.current)&&z.current&&($.current!=null||z.current===!0&&$.current==null)){let te=0;const ne=()=>{i.current[0]==null?(te<2&&(te?requestAnimationFrame:queueMicrotask)(ne),te++):(R.current=$.current==null||al($.current,b,p)||h?el(i,Z.current):qf(i,Z.current),$.current=null,O(R.current))};ne()}}else Oi(i,a)||(R.current=a,q(i,R,G.current),G.current=!1)},[c,n,r.floating,a,A,h,i,b,p,O,q,Z]),st(()=>{var te;if(!c||r.floating||!N||m||!B.current)return;const ne=N.nodesRef.current,Q=(te=ne.find(ue=>ue.id===j))==null||(te=te.context)==null?void 0:te.elements.floating,xe=oo(Ht(r.floating)),Pe=ne.some(ue=>ue.context&&Ot(ue.context.elements.floating,xe));Q&&!Pe&&H.current&&Q.focus({preventScroll:!0})},[c,r.floating,N,j,m]),st(()=>{if(c&&N&&m&&!j)return N.events.on("virtualfocus",te),()=>{N.events.off("virtualfocus",te)};function te(ne){X(ne.id),C&&(C.current=ne)}},[c,N,m,j,C]),st(()=>{K.current=O,B.current=!!r.floating}),st(()=>{n||($.current=null)},[n]),st(()=>{D.current=n},[n]);const P=a!=null,ce=U.useMemo(()=>{function te(ne){if(!n)return;const Q=i.current.indexOf(ne);Q!==-1&&O(Q)}return{onFocus(ne){let{currentTarget:Q}=ne;te(Q)},onClick:ne=>{let{currentTarget:Q}=ne;return Q.focus({preventScroll:!0})},...y&&{onMouseMove(ne){let{currentTarget:Q}=ne;te(Q)},onPointerLeave(ne){let{pointerType:Q}=ne;H.current&&Q!=="touch"&&(R.current=-1,q(i,R),O(null),m||xo(M.current,{preventScroll:!0}))}}}},[n,M,q,y,i,O,m]),le=Vt(te=>{if(H.current=!1,V.current=!0,te.which===229||!I.current&&te.currentTarget===M.current)return;if(h&&fh(te.key,b,p))return zt(te),o(!1,te.nativeEvent,"list-navigation"),void(St(r.domReference)&&(m?N==null||N.events.emit("virtualfocus",r.domReference):r.domReference.focus()));const ne=R.current,Q=el(i,k),xe=qf(i,k);if(Y||(te.key==="Home"&&(zt(te),R.current=Q,O(R.current)),te.key==="End"&&(zt(te),R.current=xe,O(R.current))),S>1){const Pe=T||Array.from({length:i.current.length},()=>({width:1,height:1})),ue=function(Ae,Oe,Me){const Le=[];let he=0;return Ae.forEach((ge,ie)=>{let{width:ye,height:$e}=ge;if(ye>Oe&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+ie+" is greater than grid columns");let we=!1;for(Me&&(he=0);!we;){const ae=[];for(let ee=0;ee<ye;ee++)for(let se=0;se<$e;se++)ae.push(he+ee+se*Oe);he%Oe+ye<=Oe&&ae.every(ee=>Le[ee]==null)?(ae.forEach(ee=>{Le[ee]=ie}),we=!0):he++}}),[...Le]}(Pe,S,L),Ne=ue.findIndex(Ae=>Ae!=null&&!cs(i.current,Ae,k)),Je=ue.reduce((Ae,Oe,Me)=>Oe==null||cs(i.current,Oe,k)?Ae:Me,-1),ot=ue[function(Ae,Oe){let{event:Me,orientation:Le,loop:he,rtl:ge,cols:ie,disabledIndices:ye,minIndex:$e,maxIndex:we,prevIndex:ae,stopEvent:ee=!1}=Oe,se=ae;if(Me.key===ud){if(ee&&zt(Me),ae===-1)se=we;else if(se=$t(Ae,{startingIndex:se,amount:ie,decrement:!0,disabledIndices:ye}),he&&(ae-ie<$e||se<0)){const me=ae%ie,Te=we%ie,Ee=we-(Te-me);se=Te===me?we:Te>me?Ee:Ee-ie}Oi(Ae,se)&&(se=ae)}if(Me.key===Gi&&(ee&&zt(Me),ae===-1?se=$e:(se=$t(Ae,{startingIndex:ae,amount:ie,disabledIndices:ye}),he&&ae+ie>we&&(se=$t(Ae,{startingIndex:ae%ie-ie,amount:ie,disabledIndices:ye}))),Oi(Ae,se)&&(se=ae)),Le==="both"){const me=Kr(ae/ie);Me.key===(ge?Co:Eo)&&(ee&&zt(Me),ae%ie!==ie-1?(se=$t(Ae,{startingIndex:ae,disabledIndices:ye}),he&&Da(se,ie,me)&&(se=$t(Ae,{startingIndex:ae-ae%ie-1,disabledIndices:ye}))):he&&(se=$t(Ae,{startingIndex:ae-ae%ie-1,disabledIndices:ye})),Da(se,ie,me)&&(se=ae)),Me.key===(ge?Eo:Co)&&(ee&&zt(Me),ae%ie!==0?(se=$t(Ae,{startingIndex:ae,decrement:!0,disabledIndices:ye}),he&&Da(se,ie,me)&&(se=$t(Ae,{startingIndex:ae+(ie-ae%ie),decrement:!0,disabledIndices:ye}))):he&&(se=$t(Ae,{startingIndex:ae+(ie-ae%ie),decrement:!0,disabledIndices:ye})),Da(se,ie,me)&&(se=ae));const Te=Kr(we/ie)===me;Oi(Ae,se)&&(se=he&&Te?Me.key===(ge?Eo:Co)?we:$t(Ae,{startingIndex:ae-ae%ie-1,disabledIndices:ye}):ae)}return se}({current:ue.map(Ae=>Ae!=null?i.current[Ae]:null)},{event:te,orientation:b,loop:f,rtl:p,cols:S,disabledIndices:Kb([...k||i.current.map((Ae,Oe)=>cs(i.current,Oe)?Oe:void 0),void 0],ue),minIndex:Ne,maxIndex:Je,prevIndex:Ub(R.current>xe?Q:R.current,Pe,ue,S,te.key===Gi?"bl":te.key===(p?Co:Eo)?"tr":"tl"),stopEvent:!0})];if(ot!=null&&(R.current=ot,O(R.current)),b==="both")return}if(dh(te.key,b)){if(zt(te),n&&!m&&oo(te.currentTarget.ownerDocument)===te.currentTarget)return R.current=al(te.key,b,p)?Q:xe,void O(R.current);al(te.key,b,p)?R.current=f?ne>=xe?d&&ne!==i.current.length?-1:Q:$t(i,{startingIndex:ne,disabledIndices:k}):Math.min(xe,$t(i,{startingIndex:ne,disabledIndices:k})):R.current=f?ne<=Q?d&&ne!==-1?i.current.length:xe:$t(i,{startingIndex:ne,decrement:!0,disabledIndices:k}):Math.max(Q,$t(i,{startingIndex:ne,decrement:!0,disabledIndices:k})),Oi(i,R.current)?O(null):O(R.current)}}),ve=U.useMemo(()=>m&&n&&P&&{"aria-activedescendant":F||_},[m,n,P,F,_]),be=U.useMemo(()=>({"aria-orientation":b==="both"?void 0:b,...!Xl(r.domReference)&&ve,onKeyDown:le,onPointerMove(){H.current=!0}}),[ve,le,r.domReference,b]),ke=U.useMemo(()=>{function te(ne){g==="auto"&&Cm(ne.nativeEvent)&&(z.current=!0)}return{...ve,onKeyDown(ne){H.current=!1;const Q=ne.key.startsWith("Arrow"),xe=["Home","End"].includes(ne.key),Pe=Q||xe,ue=function(Le,he,ge){return sc(he,ge?Le===Co:Le===Eo,Le===Gi)}(ne.key,b,p),Ne=fh(ne.key,b,p),Je=dh(ne.key,b),ot=(h?ue:Je)||ne.key==="Enter"||ne.key.trim()==="";if(m&&n){const Le=N==null?void 0:N.nodesRef.current.find(ge=>ge.parentId==null),he=N&&Le?function(ge,ie){let ye,$e=-1;return function we(ae,ee){ee>$e&&(ye=ae,$e=ee),yr(ge,ae).forEach(se=>{we(se.id,ee+1)})}(ie,0),ge.find(we=>we.id===ye)}(N.nodesRef.current,Le.id):null;if(Pe&&he&&C){const ge=new KeyboardEvent("keydown",{key:ne.key,bubbles:!0});if(ue||Ne){var Ae,Oe;const ie=((Ae=he.context)==null?void 0:Ae.elements.domReference)===ne.currentTarget,ye=Ne&&!ie?(Oe=he.context)==null?void 0:Oe.elements.domReference:ue?i.current.find($e=>($e==null?void 0:$e.id)===_):null;ye&&(zt(ne),ye.dispatchEvent(ge),X(void 0))}var Me;if((Je||xe)&&he.context&&he.context.open&&he.parentId&&ne.currentTarget!==he.context.elements.domReference)return zt(ne),void((Me=he.context.elements.domReference)==null||Me.dispatchEvent(ge))}return le(ne)}(n||w||!Q)&&(ot&&($.current=h&&Je?null:ne.key),h?ue&&(zt(ne),n?(R.current=el(i,Z.current),O(R.current)):o(!0,ne.nativeEvent,"list-navigation")):Je&&(l!=null&&(R.current=l),zt(ne),!n&&w?o(!0,ne.nativeEvent,"list-navigation"):le(ne),n&&O(R.current)))},onFocus(){n&&!m&&O(null)},onPointerDown:function(ne){z.current=g,g==="auto"&&Em(ne.nativeEvent)&&(z.current=!0)},onMouseDown:te,onClick:te}},[_,ve,le,Z,g,i,h,O,o,n,w,b,p,l,N,m,C]);return U.useMemo(()=>c?{reference:ke,floating:be,item:ce}:{},[c,ke,be,ce])}const ax=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function hh(e,t){const[n,o]=e;let r=!1;const i=t.length;for(let a=0,s=i-1;a<i;s=a++){const[c,l]=t[a]||[0,0],[d,f]=t[s]||[0,0];l>=o!=f>=o&&n<=(d-c)*(o-l)/(f-l)+c&&(r=!r)}return r}function sx(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e;let r,i=!1,a=null,s=null,c=performance.now();const l=d=>{let{x:f,y:h,placement:p,elements:m,onClose:g,nodeId:y,tree:w}=d;return function(k){function b(){clearTimeout(r),g()}if(clearTimeout(r),!m.domReference||!m.floating||p==null||f==null||h==null)return;const{clientX:S,clientY:x}=k,C=[S,x],T=ko(k),L=k.type==="mouseleave",M=Ot(m.floating,T),j=Ot(m.domReference,T),N=m.domReference.getBoundingClientRect(),O=m.floating.getBoundingClientRect(),Y=p.split("-")[0],z=f>O.right-O.width/2,R=h>O.bottom-O.height/2,$=function(I,E){return I[0]>=E.x&&I[0]<=E.x+E.width&&I[1]>=E.y&&I[1]<=E.y+E.height}(C,N),H=O.width>N.width,K=O.height>N.height,B=(H?N:O).left,D=(H?N:O).right,V=(K?N:O).top,G=(K?N:O).bottom;if(M&&(i=!0,!L))return;if(j&&(i=!1),j&&!L)return void(i=!0);if(L&&nt(k.relatedTarget)&&Ot(m.floating,k.relatedTarget)||w&&yr(w.nodesRef.current,y).some(I=>{let{context:E}=I;return E==null?void 0:E.open}))return;if(Y==="top"&&h>=N.bottom-1||Y==="bottom"&&h<=N.top+1||Y==="left"&&f>=N.right-1||Y==="right"&&f<=N.left+1)return b();let Z=[];switch(Y){case"top":Z=[[B,N.top+1],[B,O.bottom-1],[D,O.bottom-1],[D,N.top+1]];break;case"bottom":Z=[[B,O.top+1],[B,N.bottom-1],[D,N.bottom-1],[D,O.top+1]];break;case"left":Z=[[O.right-1,G],[O.right-1,V],[N.left+1,V],[N.left+1,G]];break;case"right":Z=[[N.right-1,G],[N.right-1,V],[O.left+1,V],[O.left+1,G]]}if(!hh([S,x],Z)){if(i&&!$)return b();if(!L&&o){const I=function(E,A){const _=performance.now(),W=_-c;if(a===null||s===null||W===0)return a=E,s=A,c=_,null;const F=E-a,X=A-s,q=Math.sqrt(F*F+X*X);return a=E,s=A,c=_,q/W}(k.clientX,k.clientY);if(I!==null&&I<.1)return b()}hh([S,x],function(I){let[E,A]=I;switch(Y){case"top":return[[H?E+t/2:z?E+4*t:E-4*t,A+t+1],[H?E-t/2:z?E+4*t:E-4*t,A+t+1],[O.left,z||H?O.bottom-t:O.top],[O.right,z?H?O.bottom-t:O.top:O.bottom-t]];case"bottom":return[[H?E+t/2:z?E+4*t:E-4*t,A-t],[H?E-t/2:z?E+4*t:E-4*t,A-t],[O.left,z||H?O.top+t:O.bottom],[O.right,z?H?O.top+t:O.bottom:O.top+t]];case"left":{const _=[E+t+1,K?A+t/2:R?A+4*t:A-4*t],W=[E+t+1,K?A-t/2:R?A+4*t:A-4*t];return[[R||K?O.right-t:O.left,O.top],[R?K?O.right-t:O.left:O.right-t,O.bottom],_,W]}case"right":return[[E-t,K?A+t/2:R?A+4*t:A-4*t],[E-t,K?A-t/2:R?A+4*t:A-4*t],[R||K?O.left+t:O.right,O.top],[R?K?O.left+t:O.right:O.left+t,O.bottom]]}}([f,h]))?!i&&o&&(r=window.setTimeout(b,40)):b()}}};return l.__options={blockPointerEvents:n},l}const ru=v.createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1,setIsOpen:()=>{}}),Zm=v.forwardRef(({className:e,disabled:t,children:n,...o},r)=>{const i=v.useContext(ru),a=Um(),s=No(),c=a.index===i.activeIndex,l=oe("io-dropdown-menu-item",t&&"io-dropdown-menu-item-disabled",e);return u.jsx("div",{ref:Fm([a.ref,r]),role:"menuitem",className:l,tabIndex:c?0:-1,"aria-disabled":t,...o,...i.getItemProps({onClick(d){var f;if(t)return d.preventDefault(),void d.stopPropagation();(f=o.onClick)==null||f.call(o,d),i.setIsOpen(!1),s==null||s.events.emit("click")},onFocus(d){var f;t||((f=o.onFocus)==null||f.call(o,d),i.setHasFocusInside(!0))}}),children:n})});Zm.displayName="DropdownMenuItem";const iu=v.forwardRef(({className:e,variant:t="default",icon:n,iconRight:o,text:r="",disabled:i,children:a,...s},c)=>{const[l,d]=v.useState(!1),[f,h]=v.useState(!1),[p,m]=v.useState(null),g=v.useRef([]),y=v.useRef([]),w=v.useContext(ru),k=No(),b=function(){const E=nu(),A=No(),_=Po();return st(()=>{const W={id:E,parentId:_};return A==null||A.addNode(W),()=>{A==null||A.removeNode(W)}},[A,E,_]),E}(),S=Po(),x=Um(),C=S!=null,{floatingStyles:T,refs:L,context:M}=rx({nodeId:b,open:l,onOpenChange:d,placement:C?"right-start":"bottom-start",middleware:[(j={mainAxis:C?0:4,alignmentAxis:C?-4:0},{...Mb(j),options:[j,N]}),Bb(),Fb()],whileElementsMounted:Db});var j,N;const O=function(E,A){A===void 0&&(A={});const{open:_,onOpenChange:W,dataRef:F,events:X,elements:q}=E,{enabled:P=!0,delay:ce=0,handleClose:le=null,mouseOnly:ve=!1,restMs:be=0,move:ke=!0}=A,te=No(),ne=Po(),Q=An(le),xe=An(ce),Pe=An(_),ue=U.useRef(),Ne=U.useRef(-1),Je=U.useRef(),ot=U.useRef(-1),Ae=U.useRef(!0),Oe=U.useRef(!1),Me=U.useRef(()=>{}),Le=U.useRef(!1),he=U.useCallback(()=>{var ee;const se=(ee=F.current.openEvent)==null?void 0:ee.type;return(se==null?void 0:se.includes("mouse"))&&se!=="mousedown"},[F]);U.useEffect(()=>{if(P)return X.on("openchange",ee),()=>{X.off("openchange",ee)};function ee(se){let{open:me}=se;me||(clearTimeout(Ne.current),clearTimeout(ot.current),Ae.current=!0,Le.current=!1)}},[P,X]),U.useEffect(()=>{if(!P||!Q.current||!_)return;function ee(me){he()&&W(!1,me,"hover")}const se=Ht(q.floating).documentElement;return se.addEventListener("mouseleave",ee),()=>{se.removeEventListener("mouseleave",ee)}},[q.floating,_,W,P,Q,he]);const ge=U.useCallback(function(ee,se,me){se===void 0&&(se=!0),me===void 0&&(me="hover");const Te=nl(xe.current,"close",ue.current);Te&&!Je.current?(clearTimeout(Ne.current),Ne.current=window.setTimeout(()=>W(!1,ee,me),Te)):se&&(clearTimeout(Ne.current),W(!1,ee,me))},[xe,W]),ie=Vt(()=>{Me.current(),Je.current=void 0}),ye=Vt(()=>{if(Oe.current){const ee=Ht(q.floating).body;ee.style.pointerEvents="",ee.removeAttribute(Yf),Oe.current=!1}}),$e=Vt(()=>!!F.current.openEvent&&["click","mousedown"].includes(F.current.openEvent.type));U.useEffect(()=>{if(P&&nt(q.domReference)){var ee;const Ee=q.domReference;return _&&Ee.addEventListener("mouseleave",Te),(ee=q.floating)==null||ee.addEventListener("mouseleave",Te),ke&&Ee.addEventListener("mousemove",se,{once:!0}),Ee.addEventListener("mouseenter",se),Ee.addEventListener("mouseleave",me),()=>{var rt;_&&Ee.removeEventListener("mouseleave",Te),(rt=q.floating)==null||rt.removeEventListener("mouseleave",Te),ke&&Ee.removeEventListener("mousemove",se),Ee.removeEventListener("mouseenter",se),Ee.removeEventListener("mouseleave",me)}}function se(Ee){if(clearTimeout(Ne.current),Ae.current=!1,ve&&!Fi(ue.current)||be>0&&!nl(xe.current,"open"))return;const rt=nl(xe.current,"open",ue.current);rt?Ne.current=window.setTimeout(()=>{Pe.current||W(!0,Ee,"hover")},rt):_||W(!0,Ee,"hover")}function me(Ee){if($e())return;Me.current();const rt=Ht(q.floating);if(clearTimeout(ot.current),Le.current=!1,Q.current&&F.current.floatingContext){_||clearTimeout(Ne.current),Je.current=Q.current({...F.current.floatingContext,tree:te,x:Ee.clientX,y:Ee.clientY,onClose(){ye(),ie(),$e()||ge(Ee,!0,"safe-polygon")}});const Qt=Je.current;return rt.addEventListener("mousemove",Qt),void(Me.current=()=>{rt.removeEventListener("mousemove",Qt)})}(ue.current!=="touch"||!Ot(q.floating,Ee.relatedTarget))&&ge(Ee)}function Te(Ee){$e()||F.current.floatingContext&&(Q.current==null||Q.current({...F.current.floatingContext,tree:te,x:Ee.clientX,y:Ee.clientY,onClose(){ye(),ie(),$e()||ge(Ee)}})(Ee))}},[q,P,E,ve,be,ke,ge,ie,ye,W,_,Pe,te,xe,Q,F,$e]),st(()=>{var ee;if(P&&_&&(ee=Q.current)!=null&&ee.__options.blockPointerEvents&&he()){Oe.current=!0;const me=q.floating;if(nt(q.domReference)&&me){var se;const Te=Ht(q.floating).body;Te.setAttribute(Yf,"");const Ee=q.domReference,rt=te==null||(se=te.nodesRef.current.find(Qt=>Qt.id===ne))==null||(se=se.context)==null?void 0:se.elements.floating;return rt&&(rt.style.pointerEvents=""),Te.style.pointerEvents="none",Ee.style.pointerEvents="auto",me.style.pointerEvents="auto",()=>{Te.style.pointerEvents="",Ee.style.pointerEvents="",me.style.pointerEvents=""}}}},[P,_,ne,q,te,Q,he]),st(()=>{_||(ue.current=void 0,Le.current=!1,ie(),ye())},[_,ie,ye]),U.useEffect(()=>()=>{ie(),clearTimeout(Ne.current),clearTimeout(ot.current),ye()},[P,q.domReference,ie,ye]);const we=U.useMemo(()=>{function ee(se){ue.current=se.pointerType}return{onPointerDown:ee,onPointerEnter:ee,onMouseMove(se){const{nativeEvent:me}=se;function Te(){Ae.current||Pe.current||W(!0,me,"hover")}ve&&!Fi(ue.current)||_||be===0||Le.current&&se.movementX**2+se.movementY**2<2||(clearTimeout(ot.current),ue.current==="touch"?Te():(Le.current=!0,ot.current=window.setTimeout(Te,be)))}}},[ve,W,_,Pe,be]),ae=U.useMemo(()=>({onMouseEnter(){clearTimeout(Ne.current)},onMouseLeave(ee){$e()||ge(ee.nativeEvent,!1)}}),[ge,$e]);return U.useMemo(()=>P?{reference:we,floating:ae}:{},[P,we,ae])}(M,{enabled:C,delay:{open:75},handleClose:sx({blockPointerEvents:!0})}),Y=function(E,A){A===void 0&&(A={});const{open:_,onOpenChange:W,dataRef:F,elements:{domReference:X}}=E,{enabled:q=!0,event:P="click",toggle:ce=!0,ignoreMouse:le=!1,keyboardHandlers:ve=!0,stickIfOpen:be=!0}=A,ke=U.useRef(),te=U.useRef(!1),ne=U.useMemo(()=>({onPointerDown(Q){ke.current=Q.pointerType},onMouseDown(Q){const xe=ke.current;Q.button===0&&P!=="click"&&(Fi(xe,!0)&&le||(!_||!ce||F.current.openEvent&&be&&F.current.openEvent.type!=="mousedown"?(Q.preventDefault(),W(!0,Q.nativeEvent,"click")):W(!1,Q.nativeEvent,"click")))},onClick(Q){const xe=ke.current;P==="mousedown"&&ke.current?ke.current=void 0:Fi(xe,!0)&&le||(!_||!ce||F.current.openEvent&&be&&F.current.openEvent.type!=="click"?W(!0,Q.nativeEvent,"click"):W(!1,Q.nativeEvent,"click"))},onKeyDown(Q){ke.current=void 0,Q.defaultPrevented||!ve||ih(Q)||(Q.key!==" "||ah(X)||(Q.preventDefault(),te.current=!0),Q.key==="Enter"&&W(!_||!ce,Q.nativeEvent,"click"))},onKeyUp(Q){Q.defaultPrevented||!ve||ih(Q)||ah(X)||Q.key===" "&&te.current&&(te.current=!1,W(!_||!ce,Q.nativeEvent,"click"))}}),[F,X,P,le,ve,W,_,be,ce]);return U.useMemo(()=>q?{reference:ne}:{},[q,ne])}(M,{event:"mousedown",toggle:!C,ignoreMouse:C}),z=function(E,A){var _;A===void 0&&(A={});const{open:W,floatingId:F}=E,{enabled:X=!0,role:q="dialog"}=A,P=(_=ax.get(q))!=null?_:q,ce=nu(),le=Po()!=null,ve=U.useMemo(()=>P==="tooltip"||q==="label"?{["aria-"+(q==="label"?"labelledby":"describedby")]:W?F:void 0}:{"aria-expanded":W?"true":"false","aria-haspopup":P==="alertdialog"?"dialog":P,"aria-controls":W?F:void 0,...P==="listbox"&&{role:"combobox"},...P==="menu"&&{id:ce},...P==="menu"&&le&&{role:"menuitem"},...q==="select"&&{"aria-autocomplete":"none"},...q==="combobox"&&{"aria-autocomplete":"list"}},[P,F,le,W,ce,q]),be=U.useMemo(()=>{const te={id:F,...P&&{role:P}};return P==="tooltip"||q==="label"?te:{...te,...P==="menu"&&{"aria-labelledby":ce}}},[P,F,ce,q]),ke=U.useCallback(te=>{let{active:ne,selected:Q}=te;const xe={role:"option",...ne&&{id:F+"-option"}};switch(q){case"select":return{...xe,"aria-selected":ne&&Q};case"combobox":return{...xe,...ne&&{"aria-selected":!0}}}return{}},[F,q]);return U.useMemo(()=>X?{reference:ve,floating:be,item:ke}:{},[X,ve,be,ke])}(M,{role:"menu"}),R=function(E,A){A===void 0&&(A={});const{open:_,onOpenChange:W,elements:F,dataRef:X}=E,{enabled:q=!0,escapeKey:P=!0,outsidePress:ce=!0,outsidePressEvent:le="pointerdown",referencePress:ve=!1,referencePressEvent:be="pointerdown",ancestorScroll:ke=!1,bubbles:te,capture:ne}=A,Q=No(),xe=Vt(typeof ce=="function"?ce:()=>!1),Pe=typeof ce=="function"?xe:ce,ue=U.useRef(!1),Ne=U.useRef(!1),{escapeKey:Je,outsidePress:ot}=sh(te),{escapeKey:Ae,outsidePress:Oe}=sh(ne),Me=U.useRef(!1),Le=Vt(we=>{var ae;if(!_||!q||!P||we.key!=="Escape"||Me.current)return;const ee=(ae=X.current.floatingContext)==null?void 0:ae.nodeId,se=Q?yr(Q.nodesRef.current,ee):[];if(!Je&&(we.stopPropagation(),se.length>0)){let me=!0;if(se.forEach(Te=>{var Ee;(Ee=Te.context)==null||!Ee.open||Te.context.dataRef.current.__escapeKeyBubbles||(me=!1)}),!me)return}W(!1,function(me){return"nativeEvent"in me}(we)?we.nativeEvent:we,"escape-key")}),he=Vt(we=>{var ae;const ee=()=>{var se;Le(we),(se=ko(we))==null||se.removeEventListener("keydown",ee)};(ae=ko(we))==null||ae.addEventListener("keydown",ee)}),ge=Vt(we=>{var ae;const ee=ue.current;ue.current=!1;const se=Ne.current;if(Ne.current=!1,le==="click"&&se||ee||typeof Pe=="function"&&!Pe(we))return;const me=ko(we),Te="["+ra("inert")+"]",Ee=Ht(F.floating).querySelectorAll(Te);let rt=nt(me)?me:null;for(;rt&&!Do(rt);){const Dt=io(rt);if(Do(Dt)||!nt(Dt))break;rt=Dt}if(Ee.length&&nt(me)&&!me.matches("html,body")&&!Ot(me,F.floating)&&Array.from(Ee).every(Dt=>!Ot(rt,Dt)))return;if(St(me)&&$e){const Dt=me.clientWidth>0&&me.scrollWidth>me.clientWidth,Mt=me.clientHeight>0&&me.scrollHeight>me.clientHeight;let Yn=Mt&&we.offsetX>me.clientWidth;if(Mt&&pn(me).direction==="rtl"&&(Yn=we.offsetX<=me.offsetWidth-me.clientWidth),Yn||Dt&&we.offsetY>me.clientHeight)return}const Qt=(ae=X.current.floatingContext)==null?void 0:ae.nodeId,_i=Q&&yr(Q.nodesRef.current,Qt).some(Dt=>{var Mt;return Yc(we,(Mt=Dt.context)==null?void 0:Mt.elements.floating)});if(Yc(we,F.floating)||Yc(we,F.domReference)||_i)return;const Qo=Q?yr(Q.nodesRef.current,Qt):[];if(Qo.length>0){let Dt=!0;if(Qo.forEach(Mt=>{var Yn;(Yn=Mt.context)==null||!Yn.open||Mt.context.dataRef.current.__outsidePressBubbles||(Dt=!1)}),!Dt)return}W(!1,we,"outside-press")}),ie=Vt(we=>{var ae;const ee=()=>{var se;ge(we),(se=ko(we))==null||se.removeEventListener(le,ee)};(ae=ko(we))==null||ae.addEventListener(le,ee)});U.useEffect(()=>{if(!_||!q)return;X.current.__escapeKeyBubbles=Je,X.current.__outsidePressBubbles=ot;let we=-1;function ae(Ee){W(!1,Ee,"ancestor-scroll")}function ee(){window.clearTimeout(we),Me.current=!0}function se(){we=window.setTimeout(()=>{Me.current=!1},oc()?5:0)}const me=Ht(F.floating);P&&(me.addEventListener("keydown",Ae?he:Le,Ae),me.addEventListener("compositionstart",ee),me.addEventListener("compositionend",se)),Pe&&me.addEventListener(le,Oe?ie:ge,Oe);let Te=[];return ke&&(nt(F.domReference)&&(Te=Mo(F.domReference)),nt(F.floating)&&(Te=Te.concat(Mo(F.floating))),!nt(F.reference)&&F.reference&&F.reference.contextElement&&(Te=Te.concat(Mo(F.reference.contextElement)))),Te=Te.filter(Ee=>{var rt;return Ee!==((rt=me.defaultView)==null?void 0:rt.visualViewport)}),Te.forEach(Ee=>{Ee.addEventListener("scroll",ae,{passive:!0})}),()=>{P&&(me.removeEventListener("keydown",Ae?he:Le,Ae),me.removeEventListener("compositionstart",ee),me.removeEventListener("compositionend",se)),Pe&&me.removeEventListener(le,Oe?ie:ge,Oe),Te.forEach(Ee=>{Ee.removeEventListener("scroll",ae)}),window.clearTimeout(we)}},[X,F,P,Pe,le,_,W,ke,q,Je,ot,Le,Ae,he,ge,Oe,ie]),U.useEffect(()=>{ue.current=!1},[Pe,le]);const ye=U.useMemo(()=>({onKeyDown:Le,[tx[be]]:we=>{ve&&W(!1,we.nativeEvent,"reference-press")}}),[Le,W,ve,be]),$e=U.useMemo(()=>({onKeyDown:Le,onMouseDown(){Ne.current=!0},onMouseUp(){Ne.current=!0},[nx[le]]:()=>{ue.current=!0}}),[Le,le]);return U.useMemo(()=>q?{reference:ye,floating:$e}:{},[q,ye,$e])}(M,{bubbles:!0}),$=ix(M,{listRef:g,activeIndex:p,nested:C,onNavigate:m}),{getReferenceProps:H,getFloatingProps:K,getItemProps:B}=function(E){E===void 0&&(E=[]);const A=E.map(P=>P==null?void 0:P.reference),_=E.map(P=>P==null?void 0:P.floating),W=E.map(P=>P==null?void 0:P.item),F=U.useCallback(P=>il(P,E,"reference"),A),X=U.useCallback(P=>il(P,E,"floating"),_),q=U.useCallback(P=>il(P,E,"item"),W);return U.useMemo(()=>({getReferenceProps:F,getFloatingProps:X,getItemProps:q}),[F,X,q])}([O,Y,z,R,$]);v.useEffect(()=>{if(k)return k.events.on("click",E),k.events.on("menuopen",A),()=>{k.events.off("click",E),k.events.off("menuopen",A)};function E(){d(!1)}function A(_){_.nodeId!==b&&_.parentId===S&&d(!1)}},[k,b,S]),v.useEffect(()=>{l&&k&&k.events.emit("menuopen",{parentId:S,nodeId:b})},[k,l,b,S]);const D={activeIndex:p,setActiveIndex:m,getItemProps:B,setHasFocusInside:h,isOpen:l,setIsOpen:d},V=v.useMemo(()=>D,[p,m,B,h,l]),G=oe("io-dropdown-menu-button",C&&"io-dropdown-menu-item",l&&!C&&"active",e),Z=Fm([L.setReference,x.ref,c]),I=w.activeIndex===x.index?0:-1;return u.jsxs(Jb,{id:b,children:[u.jsx(Qe,{className:G,ref:Z,variant:C?"link":t,tabIndex:C?I:void 0,role:C?"menuitem":void 0,"data-open":l?"":void 0,"data-nested":C?"":void 0,"data-focus-inside":f?"":void 0,text:r,icon:C?"chevron-right":n,iconSize:"10",iconRight:!!C||o,disabled:i,...H(w.getItemProps({onFocus(E){var A;(A=s.onFocus)==null||A.call(s,E),h(!1),w.setHasFocusInside(!0)},...s}))}),u.jsx(ru.Provider,{value:V,children:u.jsx(Gb,{elementsRef:g,labelsRef:y,children:l&&u.jsx(ex,{context:M,modal:!1,initialFocus:C?-1:0,returnFocus:!C,children:u.jsx("div",{ref:L.setFloating,className:"io-dropdown-menu",style:T,...K(),children:a})})})})]})});iu.displayName="DropdownMenu";const _n=v.forwardRef(({...e},t)=>Po()===null?u.jsx(Zb,{children:u.jsx(iu,{ref:t,...e})}):u.jsx(iu,{ref:t,...e}));function fd({className:e,variant:t="default",size:n="16",src:o,alt:r,...i}){const a=oe("io-image-icon",t==="grayscale"&&[`io-image-icon-${t}`],n&&[`io-image-icon-${n}`],e);return u.jsx("img",{className:a,style:{width:`${n}px`,filter:t==="grayscale"?"grayscale(100%)":"none"},src:o,alt:r,...i})}function cx({className:e,size:t="large",variant:n="default",align:o="up",text:r,...i}){const a=oe("io-loader",{[`io-loader-${n}`]:n!=="default"},t==="normal"&&"io-loader-md",t==="small"&&"io-loader-sm",o&&[`direction-${o}`],e);return u.jsxs("div",{className:a,role:"status","aria-live":"polite",...i,children:[u.jsx("div",{className:"io-loader-icon"}),r&&u.jsx("div",{className:"io-loader-text",children:r})]})}function Ao({className:e,children:t,...n}){const o=oe("io-panel-header",e);return u.jsx(nn,{className:o,...n,children:t})}_n.displayName="DropdownMenu",_n.Item=Zm,_n.Separator=bi,Ao.Title=zn,Ao.ButtonGroup=We,Ao.Button=Qe,Ao.ButtonIcon=Ue,Ao.Dropdown=fe;const ci=v.forwardRef(({className:e,children:t,...n},o)=>{const r=oe("io-panel-body",e);return u.jsx("div",{className:r,ref:o,"data-testid":"panel-body",...n,children:t})});function Br({className:e,...t}){const n=oe("io-panel-footer",e);return u.jsx(mr,{className:n,...t})}function Xe({className:e,children:t,...n}){const o=oe("io-panel",e);return u.jsx("div",{className:o,"data-testid":"panel",...n,children:t})}function cc({className:e,variant:t="default",children:n,...o}){const r=oe("io-pill",t!=="default"&&[`io-pill-${t}`],e);return u.jsx("div",{className:r,role:"status",...o,children:n})}function lx({className:e,variant:t="active",value:n=0,...o}){const r=oe("io-progress",t,e);let i;return i=n<0?0:n>100?100:n,u.jsx("div",{className:r,role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,...o,children:u.jsx("div",{className:"io-progress-bar",style:{width:`${i}%`}})})}/*!
|
|
8
|
+
*/var Vs=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),hg=typeof Element>"u",Si=hg?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Os=!hg&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Gs=function(e,t){var n;t===void 0&&(t=!0);var o=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"inert");return o===""||o==="true"||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):Gs(e.parentNode))},Eu=function(e,t,n){for(var o=[],r=Array.from(e);r.length;){var i=r.shift();if(!Gs(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),s=a.length?a:i.children,c=Eu(s,!0,n);n.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{Si.call(i,Vs)&&n.filter(i)&&(t||!e.includes(i))&&o.push(i);var u=i.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(i),d=!Gs(u,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(u&&d){var f=Eu(u===!0?i.children:u.children,!0,n);n.flatten?o.push.apply(o,f):o.push({scopeParent:i,candidates:f})}else r.unshift.apply(r,i.children)}}return o},pg=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},mg=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"}(e))&&!pg(e)?0:e.tabIndex},tx=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},gg=function(e){return e.tagName==="INPUT"},nx=function(e){return function(t){return gg(t)&&t.type==="radio"}(e)&&!function(t){if(!t.name)return!0;var n,o=t.form||Os(t),r=function(a){return o.querySelectorAll('input[type="radio"][name="'+a+'"]')};if(typeof window<"u"&&window.CSS!==void 0&&typeof window.CSS.escape=="function")n=r(window.CSS.escape(t.name));else try{n=r(t.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,s){for(var c=0;c<a.length;c++)if(a[c].checked&&a[c].form===s)return a[c]}(n,t.form);return!i||i===t}(e)},gh=function(e){var t=e.getBoundingClientRect(),n=t.width,o=t.height;return n===0&&o===0},ox=function(e,t){var n=t.displayCheck,o=t.getShadowRoot;if(n==="full-native"&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility==="hidden")return!0;var r=Si.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Si.call(r,"details:not([open]) *"))return!0;if(n&&n!=="full"&&n!=="full-native"&&n!=="legacy-full"){if(n==="non-zero-area")return gh(e)}else{if(typeof o=="function"){for(var i=e;e;){var a=e.parentElement,s=Os(e);if(a&&!a.shadowRoot&&o(a)===!0)return gh(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host}e=i}if(function(c){var u,d,f,h,p=c&&Os(c),m=(u=p)===null||u===void 0?void 0:u.host,g=!1;if(p&&p!==c)for(g=!!((d=m)!==null&&d!==void 0&&(f=d.ownerDocument)!==null&&f!==void 0&&f.contains(m)||c!=null&&(h=c.ownerDocument)!==null&&h!==void 0&&h.contains(c));!g&&m;){var y,w,S;g=!((w=m=(y=p=Os(m))===null||y===void 0?void 0:y.host)===null||w===void 0||(S=w.ownerDocument)===null||S===void 0||!S.contains(m))}return g}(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}return!1},rx=function(e,t){return!(t.disabled||function(n){return gg(n)&&n.type==="hidden"}(t)||ox(t,e)||function(n){return n.tagName==="DETAILS"&&Array.prototype.slice.apply(n.children).some(function(o){return o.tagName==="SUMMARY"})}(t)||function(n){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(n.tagName))for(var o=n.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!!Si.call(o,"fieldset[disabled] *")||!i.contains(n)}return!0}o=o.parentElement}return!1}(t))},ju=function(e,t){return!(nx(t)||mg(t)<0||!rx(e,t))},ix=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},vg=function(e){var t=[],n=[];return e.forEach(function(o,r){var i=!!o.scopeParent,a=i?o.scopeParent:o,s=function(u,d){var f=mg(u);return f<0&&d&&!pg(u)?0:f}(a,i),c=i?vg(o.candidates):a;s===0?i?t.push.apply(t,c):t.push(a):n.push({documentOrder:r,tabIndex:s,item:o,isScope:i,content:c})}),n.sort(tx).reduce(function(o,r){return r.isScope?o.push.apply(o,r.content):o.push(r.content),o},[]).concat(t)},Nd=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Eu([e],t.includeContainer,{filter:ju.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ix}):function(o,r,i){if(Gs(o))return[];var a=Array.prototype.slice.apply(o.querySelectorAll(Vs));return r&&Si.call(o,Vs)&&a.unshift(o),a.filter(i)}(e,t.includeContainer,ju.bind(null,t)),vg(n)};function vh(e,t,n){let{reference:o,floating:r}=e;const i=Ho(t),a=fg(t),s=dg(a),c=Lr(t),u=i==="y",d=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,h=o[s]/2-r[s]/2;let p;switch(c){case"top":p={x:d,y:o.y-r.height};break;case"bottom":p={x:d,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(Pc(t)){case"start":p[a]-=h*(n&&u?-1:1);break;case"end":p[a]+=h*(n&&u?-1:1)}return p}async function ax(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:a,elements:s,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:p=0}=Oc(t,e),m=function(x){return typeof x!="number"?function(C){return{top:0,right:0,bottom:0,left:0,...C}}(x):{top:x,right:x,bottom:x,left:x}}(p),g=s[h?f==="floating"?"reference":"floating":f],y=Ks(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(g)))==null||n?g:g.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),b=await(i.isElement==null?void 0:i.isElement(S))&&await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1},k=Ks(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:S,strategy:c}):w);return{top:(y.top-k.top+m.top)/b.y,bottom:(k.bottom-y.bottom+m.bottom)/b.y,left:(y.left-k.left+m.left)/b.x,right:(k.right-y.right+m.right)/b.x}}const sx=new Set(["left","top"]);function yg(e){const t=yn(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Pt(e),i=r?e.offsetWidth:n,a=r?e.offsetHeight:o,s=Us(n)!==i||Us(o)!==a;return s&&(n=i,o=a),{width:n,height:o,$:s}}function Id(e){return st(e)?e:e.contextElement}function pi(e){const t=Id(e);if(!Pt(t))return Vn(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=yg(t);let a=(i?Us(n.width):n.width)/o,s=(i?Us(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const cx=Vn(0);function wg(e){const t=un(e);return jc()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:cx}function Dr(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=Id(e);let a=Vn(1);t&&(o?st(o)&&(a=pi(o)):a=pi(e));const s=function(h,p,m){return p===void 0&&(p=!1),!(!m||p&&m!==un(h))&&p}(i,n,o)?wg(i):Vn(0);let c=(r.left+s.x)/a.x,u=(r.top+s.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(i){const h=un(i),p=o&&st(o)?un(o):o;let m=h,g=xu(m);for(;g&&o&&p!==m;){const y=pi(g),w=g.getBoundingClientRect(),S=yn(g),b=w.left+(g.clientLeft+parseFloat(S.paddingLeft))*y.x,k=w.top+(g.clientTop+parseFloat(S.paddingTop))*y.y;c*=y.x,u*=y.y,d*=y.x,f*=y.y,c+=b,u+=k,m=un(g),g=xu(m)}}return Ks({width:d,height:f,x:c,y:u})}function qs(e,t){const n=Ac(e).scrollLeft;return t?t.left+n:Dr(Kn(e)).left+n}function bg(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qs(e,n),y:n.top+t.scrollTop}}function yh(e,t,n){let o;if(t==="viewport")o=function(r,i){const a=un(r),s=Kn(r),c=a.visualViewport;let u=s.clientWidth,d=s.clientHeight,f=0,h=0;if(c){u=c.width,d=c.height;const m=jc();(!m||m&&i==="fixed")&&(f=c.offsetLeft,h=c.offsetTop)}const p=qs(s);if(p<=0){const m=s.ownerDocument,g=m.body,y=getComputedStyle(g),w=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(s.clientWidth-g.clientWidth-w);S<=25&&(u-=S)}else p<=25&&(u+=p);return{width:u,height:d,x:f,y:h}}(e,n);else if(t==="document")o=function(r){const i=Kn(r),a=Ac(r),s=r.ownerDocument.body,c=Pr(i.scrollWidth,i.clientWidth,s.scrollWidth,s.clientWidth),u=Pr(i.scrollHeight,i.clientHeight,s.scrollHeight,s.clientHeight);let d=-a.scrollLeft+qs(r);const f=-a.scrollTop;return yn(s).direction==="rtl"&&(d+=Pr(i.clientWidth,s.clientWidth)-c),{width:c,height:u,x:d,y:f}}(Kn(e));else if(st(t))o=function(r,i){const a=Dr(r,!0,i==="fixed"),s=a.top+r.clientTop,c=a.left+r.clientLeft,u=Pt(r)?pi(r):Vn(1);return{width:r.clientWidth*u.x,height:r.clientHeight*u.y,x:c*u.x,y:s*u.y}}(t,n);else{const r=wg(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ks(o)}function xg(e,t){const n=uo(e);return!(n===t||!st(n)||Ko(n))&&(yn(n).position==="fixed"||xg(n,t))}function lx(e,t,n){const o=Pt(t),r=Kn(t),i=n==="fixed",a=Dr(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=Vn(0);function u(){c.x=qs(r)}if(o||!o&&!i)if((Qo(t)!=="body"||ya(r))&&(s=Ac(t)),o){const f=Dr(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else r&&u();i&&!o&&r&&u();const d=!r||o||i?Vn(0):bg(r,s);return{x:a.left+s.scrollLeft-c.x-d.x,y:a.top+s.scrollTop-c.y-d.y,width:a.width,height:a.height}}function xl(e){return yn(e).position==="static"}function wh(e,t){if(!Pt(e)||yn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Kn(e)===n&&(n=n.ownerDocument.body),n}function bh(e,t){const n=un(e);if(Fs(e))return n;if(!Pt(e)){let r=uo(e);for(;r&&!Ko(r);){if(st(r)&&!xl(r))return r;r=uo(r)}return n}let o=wh(e,t);for(;o&&qb(o)&&xl(o);)o=wh(o,t);return o&&Ko(o)&&xl(o)&&!bu(o)?n:o||function(r){let i=uo(r);for(;Pt(i)&&!Ko(i);){if(bu(i))return i;if(Fs(i))return null;i=uo(i)}return null}(e)||n}const ux={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",a=Kn(o),s=!!t&&Fs(t.floating);if(o===a||s&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Vn(1);const d=Vn(0),f=Pt(o);if((f||!f&&!i)&&((Qo(o)!=="body"||ya(a))&&(c=Ac(o)),f)){const p=Dr(o);u=pi(o),d.x=p.x+o.clientLeft,d.y=p.y+o.clientTop}const h=!a||f||i?Vn(0):bg(a,c);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x+h.x,y:n.y*u.y-c.scrollTop*u.y+d.y+h.y}},getDocumentElement:Kn,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Fs(t)?[]:function(f,h){const p=h.get(f);if(p)return p;let m=Vo(f,[],!1).filter(S=>st(S)&&Qo(S)!=="body"),g=null;const y=yn(f).position==="fixed";let w=y?uo(f):f;for(;st(w)&&!Ko(w);){const S=yn(w),b=bu(w);b||S.position!=="fixed"||(g=null),(y?!b&&!g:!b&&S.position==="static"&&g&&(g.position==="absolute"||g.position==="fixed")||ya(w)&&!b&&xg(f,w))?m=m.filter(k=>k!==w):g=S,w=uo(w)}return h.set(f,m),m}(t,this._c):[].concat(n),o],a=yh(t,i[0],r);let s=a.top,c=a.right,u=a.bottom,d=a.left;for(let f=1;f<i.length;f++){const h=yh(t,i[f],r);s=Pr(h.top,s),c=zs(h.right,c),u=zs(h.bottom,u),d=Pr(h.left,d)}return{width:c-d,height:u-s,x:d,y:s}},getOffsetParent:bh,getElementRects:async function(e){const t=this.getOffsetParent||bh,n=this.getDimensions,o=await n(e.floating);return{reference:lx(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=yg(e);return{width:t,height:n}},getScale:pi,isElement:st,isRTL:function(e){return yn(e).direction==="rtl"}};function xh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dx(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,u=Id(e),d=r||i?[...u?Vo(u):[],...t?Vo(t):[]]:[];d.forEach(y=>{r&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=u&&s?function(y,w){let S,b=null;const k=Kn(y);function x(){var C;clearTimeout(S),(C=b)==null||C.disconnect(),b=null}return function C(I,R){I===void 0&&(I=!1),R===void 0&&(R=1),x();const M=y.getBoundingClientRect(),{left:_,top:T,width:P,height:X}=M;if(I||w(),!P||!X)return;const te={rootMargin:-ri(T)+"px "+-ri(k.clientWidth-(_+P))+"px "+-ri(k.clientHeight-(T+X))+"px "+-ri(_)+"px",threshold:Pr(0,zs(1,R))||1};let W=!0;function J(L){const G=L[0].intersectionRatio;if(G!==R){if(!W)return C();G?C(!1,G):S=setTimeout(()=>{C(!1,1e-7)},1e3)}G!==1||xh(M,y.getBoundingClientRect())||C(),W=!1}try{b=new IntersectionObserver(J,{...te,root:k.ownerDocument})}catch{b=new IntersectionObserver(J,te)}b.observe(y)}(!0),x}(u,n):null;let h,p=-1,m=null;a&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=m)==null||S.observe(t)})),n()}),u&&!c&&m.observe(u),t&&m.observe(t));let g=c?Dr(e):null;return c&&function y(){const w=Dr(e);g&&!xh(g,w)&&n(),g=w,h=requestAnimationFrame(y)}(),n(),()=>{var y;d.forEach(w=>{r&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(h)}}const fx=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:a,middlewareData:s}=t,c=await async function(u,d){const{placement:f,platform:h,elements:p}=u,m=await(h.isRTL==null?void 0:h.isRTL(p.floating)),g=Lr(f),y=Pc(f),w=Ho(f)==="y",S=sx.has(g)?-1:1,b=m&&w?-1:1,k=Oc(d,u);let{mainAxis:x,crossAxis:C,alignmentAxis:I}=typeof k=="number"?{mainAxis:k,crossAxis:0,alignmentAxis:null}:{mainAxis:k.mainAxis||0,crossAxis:k.crossAxis||0,alignmentAxis:k.alignmentAxis};return y&&typeof I=="number"&&(C=y==="end"?-1*I:I),w?{x:C*b,y:x*S}:{x:x*S,y:C*b}}(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:a}}}}},hx=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:a=!0,crossAxis:s=!1,limiter:c={fn:w=>{let{x:S,y:b}=w;return{x:S,y:b}}},...u}=Oc(e,t),d={x:n,y:o},f=await i.detectOverflow(t,u),h=Ho(Lr(r)),p=ug(h);let m=d[p],g=d[h];if(a){const w=p==="y"?"bottom":"right";m=hh(m+f[p==="y"?"top":"left"],m,m-f[w])}if(s){const w=h==="y"?"bottom":"right";g=hh(g+f[h==="y"?"top":"left"],g,g-f[w])}const y=c.fn({...t,[p]:m,[h]:g});return{...y,data:{x:y.x-n,y:y.y-o,enabled:{[p]:a,[h]:s}}}}}},px=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=Oc(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=Lr(r),S=Ho(s),b=Lr(s)===s,k=await(c.isRTL==null?void 0:c.isRTL(u.floating)),x=h||(b||!g?[Qa(s)]:function(te){const W=Qa(te);return[Cu(te),W,Cu(W)]}(s)),C=m!=="none";!h&&C&&x.push(...ex(s,g,m,k));const I=[s,...x],R=await c.detectOverflow(t,y),M=[];let _=((o=i.flip)==null?void 0:o.overflows)||[];if(d&&M.push(R[w]),f){const te=function(W,J,L){L===void 0&&(L=!1);const G=Pc(W),F=fg(W),N=dg(F);let $=F==="x"?G===(L?"end":"start")?"right":"left":G==="start"?"bottom":"top";return J.reference[N]>J.floating[N]&&($=Qa($)),[$,Qa($)]}(r,a,k);M.push(R[te[0]],R[te[1]])}if(_=[..._,{placement:r,overflows:M}],!M.every(te=>te<=0)){var T,P;const te=(((T=i.flip)==null?void 0:T.index)||0)+1,W=I[te];if(W&&(!(f==="alignment"&&S!==Ho(W))||_.every(L=>Ho(L.placement)!==S||L.overflows[0]>0)))return{data:{index:te,overflows:_},reset:{placement:W}};let J=(P=_.filter(L=>L.overflows[0]<=0).sort((L,G)=>L.overflows[1]-G.overflows[1])[0])==null?void 0:P.placement;if(!J)switch(p){case"bestFit":{var X;const L=(X=_.filter(G=>{if(C){const F=Ho(G.placement);return F===S||F==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(F=>F>0).reduce((F,N)=>F+N,0)]).sort((G,F)=>G[1]-F[1])[0])==null?void 0:X[0];L&&(J=L);break}case"initialPlacement":J=s}if(r!==J)return{reset:{placement:J}}}return{}}}},mx=(e,t,n)=>{const o=new Map,r={platform:ux,...n},i={...r.platform,_c:o};return(async(a,s,c)=>{const{placement:u="bottom",strategy:d="absolute",middleware:f=[],platform:h}=c,p=h.detectOverflow?h:{...h,detectOverflow:ax},m=await(h.isRTL==null?void 0:h.isRTL(s));let g=await h.getElementRects({reference:a,floating:s,strategy:d}),{x:y,y:w}=vh(g,u,m),S=u,b=0;const k={};for(let x=0;x<f.length;x++){const C=f[x];if(!C)continue;const{name:I,fn:R}=C,{x:M,y:_,data:T,reset:P}=await R({x:y,y:w,initialPlacement:u,placement:S,strategy:d,middlewareData:k,rects:g,platform:p,elements:{reference:a,floating:s}});y=M??y,w=_??w,k[I]={...k[I],...T},P&&b<50&&(b++,typeof P=="object"&&(P.placement&&(S=P.placement),P.rects&&(g=P.rects===!0?await h.getElementRects({reference:a,floating:s,strategy:d}):P.rects),{x:y,y:w}=vh(g,S,m)),x=-1)}return{x:y,y:w,placement:S,strategy:d,middlewareData:k}})(e,t,{...r,platform:i})};var Ps=typeof document<"u"?v.useLayoutEffect:function(){};function Js(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Js(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if((i!=="_owner"||!e.$$typeof)&&!Js(e[i],t[i]))return!1}return!0}return e!=e&&t!=t}function Sg(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Sh(e,t){const n=Sg(e);return Math.round(t*n)/n}function Sl(e){const t=V.useRef(e);return Ps(()=>{t.current=e}),t}const gx=(e,t)=>{const n=fx(e);return{name:n.name,fn:n.fn,options:[e,t]}},vx=(e,t)=>{const n=hx(e);return{name:n.name,fn:n.fn,options:[e,t]}},yx=(e,t)=>{const n=px(e);return{name:n.name,fn:n.fn,options:[e,t]}};function kg(e){return V.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const Cg={...V},wx=Cg.useInsertionEffect||(e=>e());function Gt(e){const t=V.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return wx(()=>{t.current=e}),V.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}const Rd="ArrowUp",la="ArrowDown",Io="ArrowLeft",Ro="ArrowRight";function es(e,t,n){return Math.floor(e/t)!==n}function Vi(e,t){return t<0||t>=e.current.length}function kl(e,t){return Dt(e,{disabledIndices:t})}function kh(e,t){return Dt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Dt(e,t){let{startingIndex:n=-1,decrement:o=!1,disabledIndices:r,amount:i=1}=t===void 0?{}:t;const a=e.current;let s=n;do s+=o?-i:i;while(s>=0&&s<=a.length-1&&_s(a,s,r));return s}function bx(e,t,n,o,r){if(e===-1)return-1;const i=n.indexOf(e),a=t[e];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 n.lastIndexOf(e)}}function xx(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function _s(e,t,n){if(n)return n.includes(t);const o=e[t];return o==null||o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"}var lt=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Sx(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Eg=V.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function kx(e){const{children:t,elementsRef:n,labelsRef:o}=e,[r,i]=V.useState(()=>new Map),a=V.useCallback(c=>{i(u=>new Map(u).set(c,null))},[]),s=V.useCallback(c=>{i(u=>{const d=new Map(u);return d.delete(c),d})},[]);return lt(()=>{const c=new Map(r);Array.from(c.keys()).sort(Sx).forEach((u,d)=>{c.set(u,d)}),function(u,d){if(u.size!==d.size)return!1;for(const[f,h]of u.entries())if(h!==d.get(f))return!1;return!0}(r,c)||i(c)},[r]),V.createElement(Eg.Provider,{value:V.useMemo(()=>({register:a,unregister:s,map:r,elementsRef:n,labelsRef:o}),[a,s,r,n,o])},t)}function jg(e){e===void 0&&(e={});const{label:t}=e,{register:n,unregister:o,map:r,elementsRef:i,labelsRef:a}=V.useContext(Eg),[s,c]=V.useState(null),u=V.useRef(null),d=V.useCallback(f=>{if(u.current=f,s!==null&&(i.current[s]=f,a)){var h;const p=t!==void 0;a.current[s]=p?t:(h=f==null?void 0:f.textContent)!=null?h:null}},[s,i,a,t]);return lt(()=>{const f=u.current;if(f)return n(f),()=>{o(f)}},[n,o]),lt(()=>{const f=u.current?r.get(u.current):null;f!=null&&c(f)},[r]),V.useMemo(()=>({ref:d,index:s??-1}),[s,d])}function Zs(){return Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Zs.apply(this,arguments)}let Ch=!1,Cx=0;const Eh=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Cx++,Au=Cg.useId||function(){const[e,t]=V.useState(()=>Ch?Eh():void 0);return lt(()=>{e==null&&t(Eh())},[]),V.useEffect(()=>{Ch=!0},[]),e};let wa;function Cl(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");var i;(e=wa)!=null&&e.has(r)||((i=wa)==null||i.add(r),console.warn(r))}function Ag(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,((o=e.get(t))==null?void 0:o.filter(r=>r!==n))||[])}}}process.env.NODE_ENV!=="production"&&(wa=new Set);const Og=V.createContext(null),Pg=V.createContext(null),Bo=()=>{var e;return((e=V.useContext(Og))==null?void 0:e.id)||null},Wo=()=>V.useContext(Pg);function Ex(e){const{children:t,id:n}=e,o=Bo();return V.createElement(Og.Provider,{value:V.useMemo(()=>({id:n,parentId:o}),[n,o])},t)}function jx(e){const{children:t}=e,n=V.useRef([]),o=V.useCallback(a=>{n.current=[...n.current,a]},[]),r=V.useCallback(a=>{n.current=n.current.filter(s=>s!==a)},[]),i=V.useState(()=>Ag())[0];return V.createElement(Pg.Provider,{value:V.useMemo(()=>({nodesRef:n,addNode:o,removeNode:r,events:i}),[o,r,i])},t)}function ba(e){return"data-floating-ui-"+e}function Tn(e){const t=v.useRef(e);return lt(()=>{t.current=e}),t}const jh=ba("safe-polygon");function El(e,t,n){return n&&!oa(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}let Ah=0;function To(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Ah);const i=()=>e==null?void 0:e.focus({preventScroll:n});r?i():Ah=requestAnimationFrame(i)}function _r(e,t){let n=e.filter(r=>{var i;return r.parentId===t&&((i=r.context)==null?void 0:i.open)}),o=n;for(;o.length;)o=e.filter(r=>{var i;return(i=o)==null?void 0:i.some(a=>{var s;return r.parentId===a.id&&((s=r.context)==null?void 0:s.open)})}),n=n.concat(o);return n}let Kr=new WeakMap,ts=new WeakSet,ns={},jl=0;const _g=e=>e&&(e.host||_g(e.parentNode));function Ax(e,t,n,o){const r="data-floating-ui-inert",i=o?"inert":n?"aria-hidden":null,a=((f,h)=>h.map(p=>{if(f.contains(p))return p;const m=_g(p);return f.contains(m)?m:null}).filter(p=>p!=null))(t,e),s=new Set,c=new Set(a),u=[];ns[r]||(ns[r]=new WeakMap);const d=ns[r];return a.forEach(function f(h){!h||s.has(h)||(s.add(h),h.parentNode&&f(h.parentNode))}),function f(h){!h||c.has(h)||[].forEach.call(h.children,p=>{if(Qo(p)!=="script")if(s.has(p))f(p);else{const m=i?p.getAttribute(i):null,g=m!==null&&m!=="false",y=(Kr.get(p)||0)+1,w=(d.get(p)||0)+1;Kr.set(p,y),d.set(p,w),u.push(p),y===1&&g&&ts.add(p),w===1&&p.setAttribute(r,""),!g&&i&&p.setAttribute(i,"true")}})}(t),s.clear(),jl++,()=>{u.forEach(f=>{const h=(Kr.get(f)||0)-1,p=(d.get(f)||0)-1;Kr.set(f,h),d.set(f,p),h||(!ts.has(f)&&i&&f.removeAttribute(i),ts.delete(f)),p||f.removeAttribute(r)}),jl--,jl||(Kr=new WeakMap,Kr=new WeakMap,ts=new WeakSet,ns={})}}function Oh(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=Mt(e[0]).body;return Ax(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Ys=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ph(e,t){const n=Nd(e,Ys());t==="prev"&&n.reverse();const o=n.indexOf(co(Mt(e)));return n.slice(o+1)[0]}function _h(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!At(n,o)}const Ld={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 Th(e){e.key==="Tab"&&(e.target,clearTimeout(void 0))}const Nh=V.forwardRef(function(e,t){const[n,o]=V.useState();lt(()=>(cg()&&o("button"),document.addEventListener("keydown",Th),()=>{document.removeEventListener("keydown",Th)}),[]);const r={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[ba("focus-guard")]:"",style:Ld};return V.createElement("span",Zs({},e,r))}),Ox=V.createContext(null),Ou="data-floating-ui-focusable";function Tg(e){return e?e.hasAttribute(Ou)?e:e.querySelector("["+Ou+"]")||e:null}let wr=[];function Al(e){wr=wr.filter(n=>n.isConnected);let t=e;if(t&&Qo(t)!=="body"){if(!function(n,o){if(o=o||{},!n)throw new Error("No node provided");return Si.call(n,Vs)!==!1&&ju(o,n)}(t,Ys())){const n=Nd(t,Ys())[0];n&&(t=n)}wr.push(t),wr.length>20&&(wr=wr.slice(-20))}}function Ih(){return wr.slice().reverse().find(e=>e.isConnected)}const Px=V.forwardRef(function(e,t){return V.createElement("button",Zs({},e,{type:"button",ref:t,tabIndex:-1,style:Ld}))});function _x(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:i=!0,initialFocus:a=0,returnFocus:s=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:p,nodeId:m,onOpenChange:g,events:y,dataRef:w,floatingId:S,elements:{domReference:b,floating:k}}=t,x=typeof a=="number"&&a<0,C=ku(b)&&x,I=typeof HTMLElement>"u"||!("inert"in HTMLElement.prototype)||i,R=Tn(r),M=Tn(a),_=Tn(s),T=Wo(),P=V.useContext(Ox),X=V.useRef(null),te=V.useRef(null),W=V.useRef(!1),J=V.useRef(!1),L=V.useRef(-1),G=P!=null,F=Tg(k),N=Gt(function(E){return E===void 0&&(E=F),E?Nd(E,Ys()):[]}),$=Gt(E=>{const j=N(E);return R.current.map(A=>b&&A==="reference"?b:F&&A==="floating"?F:j).filter(Boolean).flat()});function H(E){return!o&&d&&u?V.createElement(Px,{ref:E==="start"?X:te,onClick:j=>g(!1,j.nativeEvent)},typeof d=="string"?d:"Dismiss"):null}V.useEffect(()=>{if(o||!u)return;function E(A){if(A.key==="Tab"){At(F,co(Mt(F)))&&N().length===0&&!C&&zt(A);const O=$(),q=No(A);R.current[0]==="reference"&&q===b&&(zt(A),A.shiftKey?To(O[O.length-1]):To(O[1])),R.current[1]==="floating"&&q===F&&A.shiftKey&&(zt(A),To(O[0]))}}const j=Mt(F);return j.addEventListener("keydown",E),()=>{j.removeEventListener("keydown",E)}},[o,b,F,u,R,C,N,$]),V.useEffect(()=>{if(!o&&k)return k.addEventListener("focusin",E),()=>{k.removeEventListener("focusin",E)};function E(j){const A=No(j),O=N().indexOf(A);O!==-1&&(L.current=O)}},[o,k,N]),V.useEffect(()=>{if(!o&&f)return k&&Pt(b)?(b.addEventListener("focusout",j),b.addEventListener("pointerdown",E),k.addEventListener("focusout",j),()=>{b.removeEventListener("focusout",j),b.removeEventListener("pointerdown",E),k.removeEventListener("focusout",j)}):void 0;function E(){J.current=!0,setTimeout(()=>{J.current=!1})}function j(A){const O=A.relatedTarget;queueMicrotask(()=>{const q=!(At(b,O)||At(k,O)||At(O,k)||At(P==null?void 0:P.portalNode,O)||O!=null&&O.hasAttribute(ba("focus-guard"))||T&&(_r(T.nodesRef.current,m).find(z=>{var U,Q;return At((U=z.context)==null?void 0:U.elements.floating,O)||At((Q=z.context)==null?void 0:Q.elements.domReference,O)})||function(z,U){var Q;let D=[],le=(Q=z.find(ue=>ue.id===U))==null?void 0:Q.parentId;for(;le;){const ue=z.find(ve=>ve.id===le);le=ue==null?void 0:ue.parentId,ue&&(D=D.concat(ue))}return D}(T.nodesRef.current,m).find(z=>{var U,Q;return((U=z.context)==null?void 0:U.elements.floating)===O||((Q=z.context)==null?void 0:Q.elements.domReference)===O})));if(c&&q&&co(Mt(F))===Mt(F).body){Pt(F)&&F.focus();const z=L.current,U=N(),Q=U[z]||U[U.length-1]||F;Pt(Q)&&Q.focus()}!C&&u||!O||!q||J.current||O===Ih()||(W.current=!0,g(!1,A,"focus-out"))})}},[o,b,k,F,u,m,T,P,g,f,c,N,C]),V.useEffect(()=>{var E;if(o)return;const j=Array.from((P==null||(E=P.portalNode)==null?void 0:E.querySelectorAll("["+ba("portal")+"]"))||[]);if(k){const A=[k,...j,X.current,te.current,R.current.includes("reference")||C?b:null].filter(q=>q!=null),O=u||C?Oh(A,I,!I):Oh(A);return()=>{O()}}},[o,b,k,u,R,P,C,I]),lt(()=>{if(o||!Pt(F))return;const E=co(Mt(F));queueMicrotask(()=>{const j=$(F),A=M.current,O=(typeof A=="number"?j[A]:A.current)||F,q=At(F,E);x||q||!h||To(O,{preventScroll:O===F})})},[o,h,F,x,$,M]),lt(()=>{if(o||!F)return;let E=!1;const j=Mt(F),A=co(j);let O=w.current.openEvent;function q(U){let{open:Q,reason:D,event:le,nested:ue}=U;Q&&(O=le),D==="escape-key"&&p.domReference.current&&Al(p.domReference.current),D==="hover"&&le.type==="mouseleave"&&(W.current=!0),D==="outside-press"&&(ue?(W.current=!1,E=!0):W.current=!(ag(le)||sg(le)))}Al(A),y.on("openchange",q);const z=j.createElement("span");return z.setAttribute("tabindex","-1"),z.setAttribute("aria-hidden","true"),Object.assign(z.style,Ld),G&&b&&b.insertAdjacentElement("afterend",z),()=>{y.off("openchange",q);const U=co(j),Q=At(k,U)||T&&_r(T.nodesRef.current,m).some(le=>{var ue;return At((ue=le.context)==null?void 0:ue.elements.floating,U)});(Q||O&&["click","mousedown"].includes(O.type))&&p.domReference.current&&Al(p.domReference.current);const D=typeof _.current=="boolean"?Ih()||z:_.current.current||z;queueMicrotask(()=>{_.current&&!W.current&&Pt(D)&&(D===U||U===j.body||Q)&&D.focus({preventScroll:E}),z.remove()})}},[o,k,F,_,w,p,y,T,m,G,b]),V.useEffect(()=>{queueMicrotask(()=>{W.current=!1})},[o]),lt(()=>{if(!o&&P)return P.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:g,refs:p}),()=>{P.setFocusManagerState(null)}},[o,P,u,h,g,p,f]),lt(()=>{if(o||!F||typeof MutationObserver!="function"||x)return;const E=()=>{const A=F.getAttribute("tabindex"),O=N(),q=co(Mt(k)),z=O.indexOf(q);z!==-1&&(L.current=z),R.current.includes("floating")||q!==p.domReference.current&&O.length===0?A!=="0"&&F.setAttribute("tabindex","0"):A!=="-1"&&F.setAttribute("tabindex","-1")};E();const j=new MutationObserver(E);return j.observe(F,{childList:!0,subtree:!0,attributes:!0}),()=>{j.disconnect()}},[o,k,F,p,R,N,x]);const B=!o&&I&&(!u||!C)&&(G||u);return V.createElement(V.Fragment,null,B&&V.createElement(Nh,{"data-type":"inside",ref:P==null?void 0:P.beforeInsideRef,onFocus:E=>{if(u){const A=$();To(r[0]==="reference"?A[0]:A[A.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(W.current=!1,_h(E,P.portalNode)){const A=Ph(document.body,"next")||b;A==null||A.focus()}else{var j;(j=P.beforeOutsideRef.current)==null||j.focus()}}}),!C&&H("start"),n,H("end"),B&&V.createElement(Nh,{"data-type":"inside",ref:P==null?void 0:P.afterInsideRef,onFocus:E=>{if(u)To($()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode)if(f&&(W.current=!0),_h(E,P.portalNode)){const A=Ph(document.body,"prev")||b;A==null||A.focus()}else{var j;(j=P.afterOutsideRef.current)==null||j.focus()}}}))}function Rh(e){return Pt(e.target)&&e.target.tagName==="BUTTON"}function Lh(e){return lg(e)}const Tx={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Nx={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Dh=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null&&t,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)==null||n}};function Ix(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=Au(),i=V.useRef({}),[a]=V.useState(()=>Ag()),s=Bo()!=null;if(process.env.NODE_ENV!=="production"){const p=o.reference;p&&!st(p)&&function(){for(var m,g=arguments.length,y=new Array(g),w=0;w<g;w++)y[w]=arguments[w];const S="Floating UI: "+y.join(" ");var b;(m=wa)!=null&&m.has(S)||((b=wa)==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[c,u]=V.useState(o.reference),d=Gt((p,m,g)=>{i.current.openEvent=p?m:void 0,a.emit("openchange",{open:p,event:m,reason:g,nested:s}),n==null||n(p,m,g)}),f=V.useMemo(()=>({setPositionReference:u}),[]),h=V.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return V.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:h,events:a,floatingId:r,refs:f}),[t,d,h,a,r,f])}function Rx(e){e===void 0&&(e={});const{nodeId:t}=e,n=Ix({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[i,a]=V.useState(null),[s,c]=V.useState(null),u=(r==null?void 0:r.domReference)||i,d=V.useRef(null),f=Wo();lt(()=>{u&&(d.current=u)},[u]);const h=function(S){S===void 0&&(S={});const{placement:b="bottom",strategy:k="absolute",middleware:x=[],platform:C,elements:{reference:I,floating:R}={},transform:M=!0,whileElementsMounted:_,open:T}=S,[P,X]=V.useState({x:0,y:0,strategy:k,placement:b,middlewareData:{},isPositioned:!1}),[te,W]=V.useState(x);Js(te,x)||W(x);const[J,L]=V.useState(null),[G,F]=V.useState(null),N=V.useCallback(we=>{we!==E.current&&(E.current=we,L(we))},[]),$=V.useCallback(we=>{we!==j.current&&(j.current=we,F(we))},[]),H=I||J,B=R||G,E=V.useRef(null),j=V.useRef(null),A=V.useRef(P),O=_!=null,q=Sl(_),z=Sl(C),U=Sl(T),Q=V.useCallback(()=>{if(!E.current||!j.current)return;const we={placement:b,strategy:k,middleware:te};z.current&&(we.platform=z.current),mx(E.current,j.current,we).then(Ae=>{const Z={...Ae,isPositioned:U.current!==!1};D.current&&!Js(A.current,Z)&&(A.current=Z,Bm.flushSync(()=>{X(Z)}))})},[te,b,k,z,U]);Ps(()=>{T===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,X(we=>({...we,isPositioned:!1})))},[T]);const D=V.useRef(!1);Ps(()=>(D.current=!0,()=>{D.current=!1}),[]),Ps(()=>{if(H&&(E.current=H),B&&(j.current=B),H&&B){if(q.current)return q.current(H,B,Q);Q()}},[H,B,Q,q,O]);const le=V.useMemo(()=>({reference:E,floating:j,setReference:N,setFloating:$}),[N,$]),ue=V.useMemo(()=>({reference:H,floating:B}),[H,B]),ve=V.useMemo(()=>{const we={position:k,left:0,top:0};if(!ue.floating)return we;const Ae=Sh(ue.floating,P.x),Z=Sh(ue.floating,P.y);return M?{...we,transform:"translate("+Ae+"px, "+Z+"px)",...Sg(ue.floating)>=1.5&&{willChange:"transform"}}:{position:k,left:Ae,top:Z}},[k,M,ue.floating,P.x,P.y]);return V.useMemo(()=>({...P,update:Q,refs:le,elements:ue,floatingStyles:ve}),[P,Q,le,ue,ve])}({...e,elements:{...r,...s&&{reference:s}}}),p=V.useCallback(S=>{const b=st(S)?{getBoundingClientRect:()=>S.getBoundingClientRect(),contextElement:S}:S;c(b),h.refs.setReference(b)},[h.refs]),m=V.useCallback(S=>{(st(S)||S===null)&&(d.current=S,a(S)),(st(h.refs.reference.current)||h.refs.reference.current===null||S!==null&&!st(S))&&h.refs.setReference(S)},[h.refs]),g=V.useMemo(()=>({...h.refs,setReference:m,setPositionReference:p,domReference:d}),[h.refs,m,p]),y=V.useMemo(()=>({...h.elements,domReference:u}),[h.elements,u]),w=V.useMemo(()=>({...h,...o,refs:g,elements:y,nodeId:t}),[h,g,y,t,o]);return lt(()=>{o.dataRef.current.floatingContext=w;const S=f==null?void 0:f.nodesRef.current.find(b=>b.id===t);S&&(S.context=w)}),V.useMemo(()=>({...h,context:w,refs:g,elements:y}),[h,g,y,w])}const Mh="active",$h="selected";function Ol(e,t,n){const o=new Map,r=n==="item";let i=e;if(r&&e){const{[Mh]:a,[$h]:s,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1,[Ou]:""},...i,...t.map(a=>{const s=a?a[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((a,s)=>(s&&Object.entries(s).forEach(c=>{let[u,d]=c;var f;r&&[Mh,$h].includes(u)||(u.indexOf("on")===0?(o.has(u)||o.set(u,[]),typeof d=="function"&&((f=o.get(u))==null||f.push(d),a[u]=function(){for(var h,p=arguments.length,m=new Array(p),g=0;g<p;g++)m[g]=arguments[g];return(h=o.get(u))==null?void 0:h.map(y=>y(...m)).find(y=>y!==void 0)})):a[u]=d)}),a),{})}}let Hh=!1;function _c(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Bh(e,t){return _c(t,e===Rd||e===la,e===Io||e===Ro)}function Pl(e,t,n){return _c(t,e===la,n?e===Io:e===Ro)||e==="Enter"||e===" "||e===""}function Wh(e,t,n){return _c(t,n?e===Ro:e===Io,e===Rd)}function Lx(e,t){const{open:n,onOpenChange:o,elements:r}=e,{listRef:i,activeIndex:a,onNavigate:s=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:h=!1,rtl:p=!1,virtual:m=!1,focusItemOnOpen:g="auto",focusItemOnHover:y=!0,openOnArrowKeyDown:w=!0,disabledIndices:S,orientation:b="vertical",cols:k=1,scrollItemIntoView:x=!0,virtualItemRef:C,itemSizes:I,dense:R=!1}=t;process.env.NODE_ENV!=="production"&&(d&&(f||Cl("`useListNavigation` looping must be enabled to allow escaping."),m||Cl("`useListNavigation` must be virtual to allow escaping.")),b==="vertical"&&k>1&&Cl("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const M=Tn(Tg(r.floating)),_=Bo(),T=Wo(),P=Gt(s),X=ku(r.domReference),te=V.useRef(g),W=V.useRef(u??-1),J=V.useRef(null),L=V.useRef(!0),G=V.useRef(P),F=V.useRef(!!r.floating),N=V.useRef(n),$=V.useRef(!1),H=V.useRef(!1),B=Tn(S),E=Tn(n),j=Tn(x),A=Tn(u),[O,q]=V.useState(),[z,U]=V.useState(),Q=Gt(function(Z,oe,ce){function Se(fe){m?(q(fe.id),T==null||T.events.emit("virtualfocus",fe),C&&(C.current=fe)):To(fe,{preventScroll:!0,sync:!(!rg().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!cg())&&(Hh||$.current)})}ce===void 0&&(ce=!1);const Oe=Z.current[oe.current];Oe&&Se(Oe),requestAnimationFrame(()=>{const fe=Z.current[oe.current]||Oe;if(!fe)return;Oe||Se(fe);const Re=j.current;Re&&le&&(ce||!L.current)&&(fe.scrollIntoView==null||fe.scrollIntoView(typeof Re=="boolean"?{block:"nearest",inline:"nearest"}:Re))})});lt(()=>{document.createElement("div").focus({get preventScroll(){return Hh=!0,!1}})},[]),lt(()=>{c&&(n&&r.floating?te.current&&u!=null&&(H.current=!0,W.current=u,P(u)):F.current&&(W.current=-1,G.current(null)))},[c,n,r.floating,u,P]),lt(()=>{if(c&&n&&r.floating)if(a==null){if($.current=!1,A.current!=null)return;if(F.current&&(W.current=-1,Q(i,W)),(!N.current||!F.current)&&te.current&&(J.current!=null||te.current===!0&&J.current==null)){let Z=0;const oe=()=>{i.current[0]==null?(Z<2&&(Z?requestAnimationFrame:queueMicrotask)(oe),Z++):(W.current=J.current==null||Pl(J.current,b,p)||h?kl(i,B.current):kh(i,B.current),J.current=null,P(W.current))};oe()}}else Vi(i,a)||(W.current=a,Q(i,W,H.current),H.current=!1)},[c,n,r.floating,a,A,h,i,b,p,P,Q,B]),lt(()=>{var Z;if(!c||r.floating||!T||m||!F.current)return;const oe=T.nodesRef.current,ce=(Z=oe.find(fe=>fe.id===_))==null||(Z=Z.context)==null?void 0:Z.elements.floating,Se=co(Mt(r.floating)),Oe=oe.some(fe=>fe.context&&At(fe.context.elements.floating,Se));ce&&!Oe&&L.current&&ce.focus({preventScroll:!0})},[c,r.floating,T,_,m]),lt(()=>{if(c&&T&&m&&!_)return T.events.on("virtualfocus",Z),()=>{T.events.off("virtualfocus",Z)};function Z(oe){U(oe.id),C&&(C.current=oe)}},[c,T,m,_,C]),lt(()=>{G.current=P,F.current=!!r.floating}),lt(()=>{n||(J.current=null)},[n]),lt(()=>{N.current=n},[n]);const D=a!=null,le=V.useMemo(()=>{function Z(oe){if(!n)return;const ce=i.current.indexOf(oe);ce!==-1&&P(ce)}return{onFocus(oe){let{currentTarget:ce}=oe;Z(ce)},onClick:oe=>{let{currentTarget:ce}=oe;return ce.focus({preventScroll:!0})},...y&&{onMouseMove(oe){let{currentTarget:ce}=oe;Z(ce)},onPointerLeave(oe){let{pointerType:ce}=oe;L.current&&ce!=="touch"&&(W.current=-1,Q(i,W),P(null),m||To(M.current,{preventScroll:!0}))}}}},[n,M,Q,y,i,P,m]),ue=Gt(Z=>{if(L.current=!1,$.current=!0,Z.which===229||!E.current&&Z.currentTarget===M.current)return;if(h&&Wh(Z.key,b,p))return zt(Z),o(!1,Z.nativeEvent,"list-navigation"),void(Pt(r.domReference)&&(m?T==null||T.events.emit("virtualfocus",r.domReference):r.domReference.focus()));const oe=W.current,ce=kl(i,S),Se=kh(i,S);if(X||(Z.key==="Home"&&(zt(Z),W.current=ce,P(W.current)),Z.key==="End"&&(zt(Z),W.current=Se,P(W.current))),k>1){const Oe=I||Array.from({length:i.current.length},()=>({width:1,height:1})),fe=function(Pe,Ce,Le){const Me=[];let he=0;return Pe.forEach((ye,ae)=>{let{width:se,height:Ne}=ye;if(se>Ce&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+ae+" is greater than grid columns");let ge=!1;for(Le&&(he=0);!ge;){const ee=[];for(let Y=0;Y<se;Y++)for(let de=0;de<Ne;de++)ee.push(he+Y+de*Ce);he%Ce+se<=Ce&&ee.every(Y=>Me[Y]==null)?(ee.forEach(Y=>{Me[Y]=ae}),ge=!0):he++}}),[...Me]}(Oe,k,R),Re=fe.findIndex(Pe=>Pe!=null&&!_s(i.current,Pe,S)),Je=fe.reduce((Pe,Ce,Le)=>Ce==null||_s(i.current,Ce,S)?Pe:Le,-1),ot=fe[function(Pe,Ce){let{event:Le,orientation:Me,loop:he,rtl:ye,cols:ae,disabledIndices:se,minIndex:Ne,maxIndex:ge,prevIndex:ee,stopEvent:Y=!1}=Ce,de=ee;if(Le.key===Rd){if(Y&&zt(Le),ee===-1)de=ge;else if(de=Dt(Pe,{startingIndex:de,amount:ae,decrement:!0,disabledIndices:se}),he&&(ee-ae<Ne||de<0)){const be=ee%ae,We=ge%ae,_t=ge-(We-be);de=We===be?ge:We>be?_t:_t-ae}Vi(Pe,de)&&(de=ee)}if(Le.key===la&&(Y&&zt(Le),ee===-1?de=Ne:(de=Dt(Pe,{startingIndex:ee,amount:ae,disabledIndices:se}),he&&ee+ae>ge&&(de=Dt(Pe,{startingIndex:ee%ae-ae,amount:ae,disabledIndices:se}))),Vi(Pe,de)&&(de=ee)),Me==="both"){const be=ri(ee/ae);Le.key===(ye?Io:Ro)&&(Y&&zt(Le),ee%ae!==ae-1?(de=Dt(Pe,{startingIndex:ee,disabledIndices:se}),he&&es(de,ae,be)&&(de=Dt(Pe,{startingIndex:ee-ee%ae-1,disabledIndices:se}))):he&&(de=Dt(Pe,{startingIndex:ee-ee%ae-1,disabledIndices:se})),es(de,ae,be)&&(de=ee)),Le.key===(ye?Ro:Io)&&(Y&&zt(Le),ee%ae!==0?(de=Dt(Pe,{startingIndex:ee,decrement:!0,disabledIndices:se}),he&&es(de,ae,be)&&(de=Dt(Pe,{startingIndex:ee+(ae-ee%ae),decrement:!0,disabledIndices:se}))):he&&(de=Dt(Pe,{startingIndex:ee+(ae-ee%ae),decrement:!0,disabledIndices:se})),es(de,ae,be)&&(de=ee));const We=ri(ge/ae)===be;Vi(Pe,de)&&(de=he&&We?Le.key===(ye?Ro:Io)?ge:Dt(Pe,{startingIndex:ee-ee%ae-1,disabledIndices:se}):ee)}return de}({current:fe.map(Pe=>Pe!=null?i.current[Pe]:null)},{event:Z,orientation:b,loop:f,rtl:p,cols:k,disabledIndices:xx([...S||i.current.map((Pe,Ce)=>_s(i.current,Ce)?Ce:void 0),void 0],fe),minIndex:Re,maxIndex:Je,prevIndex:bx(W.current>Se?ce:W.current,Oe,fe,k,Z.key===la?"bl":Z.key===(p?Io:Ro)?"tr":"tl"),stopEvent:!0})];if(ot!=null&&(W.current=ot,P(W.current)),b==="both")return}if(Bh(Z.key,b)){if(zt(Z),n&&!m&&co(Z.currentTarget.ownerDocument)===Z.currentTarget)return W.current=Pl(Z.key,b,p)?ce:Se,void P(W.current);Pl(Z.key,b,p)?W.current=f?oe>=Se?d&&oe!==i.current.length?-1:ce:Dt(i,{startingIndex:oe,disabledIndices:S}):Math.min(Se,Dt(i,{startingIndex:oe,disabledIndices:S})):W.current=f?oe<=ce?d&&oe!==-1?i.current.length:Se:Dt(i,{startingIndex:oe,decrement:!0,disabledIndices:S}):Math.max(ce,Dt(i,{startingIndex:oe,decrement:!0,disabledIndices:S})),Vi(i,W.current)?P(null):P(W.current)}}),ve=V.useMemo(()=>m&&n&&D&&{"aria-activedescendant":z||O},[m,n,D,z,O]),we=V.useMemo(()=>({"aria-orientation":b==="both"?void 0:b,...!ku(r.domReference)&&ve,onKeyDown:ue,onPointerMove(){L.current=!0}}),[ve,ue,r.domReference,b]),Ae=V.useMemo(()=>{function Z(oe){g==="auto"&&ag(oe.nativeEvent)&&(te.current=!0)}return{...ve,onKeyDown(oe){L.current=!1;const ce=oe.key.startsWith("Arrow"),Se=["Home","End"].includes(oe.key),Oe=ce||Se,fe=function(Me,he,ye){return _c(he,ye?Me===Io:Me===Ro,Me===la)}(oe.key,b,p),Re=Wh(oe.key,b,p),Je=Bh(oe.key,b),ot=(h?fe:Je)||oe.key==="Enter"||oe.key.trim()==="";if(m&&n){const Me=T==null?void 0:T.nodesRef.current.find(ye=>ye.parentId==null),he=T&&Me?function(ye,ae){let se,Ne=-1;return function ge(ee,Y){Y>Ne&&(se=ee,Ne=Y),_r(ye,ee).forEach(de=>{ge(de.id,Y+1)})}(ae,0),ye.find(ge=>ge.id===se)}(T.nodesRef.current,Me.id):null;if(Oe&&he&&C){const ye=new KeyboardEvent("keydown",{key:oe.key,bubbles:!0});if(fe||Re){var Pe,Ce;const ae=((Pe=he.context)==null?void 0:Pe.elements.domReference)===oe.currentTarget,se=Re&&!ae?(Ce=he.context)==null?void 0:Ce.elements.domReference:fe?i.current.find(Ne=>(Ne==null?void 0:Ne.id)===O):null;se&&(zt(oe),se.dispatchEvent(ye),U(void 0))}var Le;if((Je||Se)&&he.context&&he.context.open&&he.parentId&&oe.currentTarget!==he.context.elements.domReference)return zt(oe),void((Le=he.context.elements.domReference)==null||Le.dispatchEvent(ye))}return ue(oe)}(n||w||!ce)&&(ot&&(J.current=h&&Je?null:oe.key),h?fe&&(zt(oe),n?(W.current=kl(i,B.current),P(W.current)):o(!0,oe.nativeEvent,"list-navigation")):Je&&(u!=null&&(W.current=u),zt(oe),!n&&w?o(!0,oe.nativeEvent,"list-navigation"):ue(oe),n&&P(W.current)))},onFocus(){n&&!m&&P(null)},onPointerDown:function(oe){te.current=g,g==="auto"&&sg(oe.nativeEvent)&&(te.current=!0)},onMouseDown:Z,onClick:Z}},[O,ve,ue,B,g,i,h,P,o,n,w,b,p,u,T,m,C]);return V.useMemo(()=>c?{reference:Ae,floating:we,item:le}:{},[c,Ae,we,le])}const Dx=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Fh(e,t){const[n,o]=e;let r=!1;const i=t.length;for(let a=0,s=i-1;a<i;s=a++){const[c,u]=t[a]||[0,0],[d,f]=t[s]||[0,0];u>=o!=f>=o&&n<=(d-c)*(o-u)/(f-u)+c&&(r=!r)}return r}function Mx(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e;let r,i=!1,a=null,s=null,c=performance.now();const u=d=>{let{x:f,y:h,placement:p,elements:m,onClose:g,nodeId:y,tree:w}=d;return function(S){function b(){clearTimeout(r),g()}if(clearTimeout(r),!m.domReference||!m.floating||p==null||f==null||h==null)return;const{clientX:k,clientY:x}=S,C=[k,x],I=No(S),R=S.type==="mouseleave",M=At(m.floating,I),_=At(m.domReference,I),T=m.domReference.getBoundingClientRect(),P=m.floating.getBoundingClientRect(),X=p.split("-")[0],te=f>P.right-P.width/2,W=h>P.bottom-P.height/2,J=function(E,j){return E[0]>=j.x&&E[0]<=j.x+j.width&&E[1]>=j.y&&E[1]<=j.y+j.height}(C,T),L=P.width>T.width,G=P.height>T.height,F=(L?T:P).left,N=(L?T:P).right,$=(G?T:P).top,H=(G?T:P).bottom;if(M&&(i=!0,!R))return;if(_&&(i=!1),_&&!R)return void(i=!0);if(R&&st(S.relatedTarget)&&At(m.floating,S.relatedTarget)||w&&_r(w.nodesRef.current,y).some(E=>{let{context:j}=E;return j==null?void 0:j.open}))return;if(X==="top"&&h>=T.bottom-1||X==="bottom"&&h<=T.top+1||X==="left"&&f>=T.right-1||X==="right"&&f<=T.left+1)return b();let B=[];switch(X){case"top":B=[[F,T.top+1],[F,P.bottom-1],[N,P.bottom-1],[N,T.top+1]];break;case"bottom":B=[[F,P.top+1],[F,T.bottom-1],[N,T.bottom-1],[N,P.top+1]];break;case"left":B=[[P.right-1,H],[P.right-1,$],[T.left+1,$],[T.left+1,H]];break;case"right":B=[[T.right-1,H],[T.right-1,$],[P.left+1,$],[P.left+1,H]]}if(!Fh([k,x],B)){if(i&&!J)return b();if(!R&&o){const E=function(j,A){const O=performance.now(),q=O-c;if(a===null||s===null||q===0)return a=j,s=A,c=O,null;const z=j-a,U=A-s,Q=Math.sqrt(z*z+U*U);return a=j,s=A,c=O,Q/q}(S.clientX,S.clientY);if(E!==null&&E<.1)return b()}Fh([k,x],function(E){let[j,A]=E;switch(X){case"top":return[[L?j+t/2:te?j+4*t:j-4*t,A+t+1],[L?j-t/2:te?j+4*t:j-4*t,A+t+1],[P.left,te||L?P.bottom-t:P.top],[P.right,te?L?P.bottom-t:P.top:P.bottom-t]];case"bottom":return[[L?j+t/2:te?j+4*t:j-4*t,A-t],[L?j-t/2:te?j+4*t:j-4*t,A-t],[P.left,te||L?P.top+t:P.bottom],[P.right,te?L?P.top+t:P.bottom:P.top+t]];case"left":{const O=[j+t+1,G?A+t/2:W?A+4*t:A-4*t],q=[j+t+1,G?A-t/2:W?A+4*t:A-4*t];return[[W||G?P.right-t:P.left,P.top],[W?G?P.right-t:P.left:P.right-t,P.bottom],O,q]}case"right":return[[j-t,G?A+t/2:W?A+4*t:A-4*t],[j-t,G?A-t/2:W?A+4*t:A-4*t],[W||G?P.left+t:P.right,P.top],[W?G?P.left+t:P.right:P.left+t,P.bottom]]}}([f,h]))?!i&&o&&(r=window.setTimeout(b,40)):b()}}};return u.__options={blockPointerEvents:n},u}const Pu=v.createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1,setIsOpen:()=>{}}),Ng=v.forwardRef(({className:e,disabled:t,children:n,...o},r)=>{const i=v.useContext(Pu),a=jg(),s=Wo(),c=a.index===i.activeIndex,u=re("io-dropdown-menu-item",t&&"io-dropdown-menu-item-disabled",e);return l.jsx("div",{ref:kg([a.ref,r]),role:"menuitem",className:u,tabIndex:c?0:-1,"aria-disabled":t,...o,...i.getItemProps({onClick(d){var f;if(t)return d.preventDefault(),void d.stopPropagation();(f=o.onClick)==null||f.call(o,d),i.setIsOpen(!1),s==null||s.events.emit("click")},onFocus(d){var f;t||((f=o.onFocus)==null||f.call(o,d),i.setHasFocusInside(!0))}}),children:n})});Ng.displayName="DropdownMenuItem";const _u=v.forwardRef(({className:e,variant:t="default",icon:n,iconRight:o,text:r="",disabled:i,children:a,...s},c)=>{const[u,d]=v.useState(!1),[f,h]=v.useState(!1),[p,m]=v.useState(null),g=v.useRef([]),y=v.useRef([]),w=v.useContext(Pu),S=Wo(),b=function(){const B=Au(),E=Wo(),j=Bo();return lt(()=>{const A={id:B,parentId:j};return E==null||E.addNode(A),()=>{E==null||E.removeNode(A)}},[E,B,j]),B}(),k=Bo(),x=jg(),C=k!=null,{floatingStyles:I,refs:R,context:M}=Rx({nodeId:b,open:u,onOpenChange:d,placement:C?"right-start":"bottom-start",middleware:[gx({mainAxis:C?0:4,alignmentAxis:C?-4:0}),yx(),vx()],whileElementsMounted:dx}),_=function(B,E){E===void 0&&(E={});const{open:j,onOpenChange:A,dataRef:O,events:q,elements:z}=B,{enabled:U=!0,delay:Q=0,handleClose:D=null,mouseOnly:le=!1,restMs:ue=0,move:ve=!0}=E,we=Wo(),Ae=Bo(),Z=Tn(D),oe=Tn(Q),ce=Tn(j),Se=V.useRef(),Oe=V.useRef(-1),fe=V.useRef(),Re=V.useRef(-1),Je=V.useRef(!0),ot=V.useRef(!1),Pe=V.useRef(()=>{}),Ce=V.useRef(!1),Le=V.useCallback(()=>{var ge;const ee=(ge=O.current.openEvent)==null?void 0:ge.type;return(ee==null?void 0:ee.includes("mouse"))&&ee!=="mousedown"},[O]);V.useEffect(()=>{if(U)return q.on("openchange",ge),()=>{q.off("openchange",ge)};function ge(ee){let{open:Y}=ee;Y||(clearTimeout(Oe.current),clearTimeout(Re.current),Je.current=!0,Ce.current=!1)}},[U,q]),V.useEffect(()=>{if(!U||!Z.current||!j)return;function ge(Y){Le()&&A(!1,Y,"hover")}const ee=Mt(z.floating).documentElement;return ee.addEventListener("mouseleave",ge),()=>{ee.removeEventListener("mouseleave",ge)}},[z.floating,j,A,U,Z,Le]);const Me=V.useCallback(function(ge,ee,Y){ee===void 0&&(ee=!0),Y===void 0&&(Y="hover");const de=El(oe.current,"close",Se.current);de&&!fe.current?(clearTimeout(Oe.current),Oe.current=window.setTimeout(()=>A(!1,ge,Y),de)):ee&&(clearTimeout(Oe.current),A(!1,ge,Y))},[oe,A]),he=Gt(()=>{Pe.current(),fe.current=void 0}),ye=Gt(()=>{if(ot.current){const ge=Mt(z.floating).body;ge.style.pointerEvents="",ge.removeAttribute(jh),ot.current=!1}}),ae=Gt(()=>!!O.current.openEvent&&["click","mousedown"].includes(O.current.openEvent.type));V.useEffect(()=>{if(U&&st(z.domReference)){var ge;const be=z.domReference;return j&&be.addEventListener("mouseleave",de),(ge=z.floating)==null||ge.addEventListener("mouseleave",de),ve&&be.addEventListener("mousemove",ee,{once:!0}),be.addEventListener("mouseenter",ee),be.addEventListener("mouseleave",Y),()=>{var We;j&&be.removeEventListener("mouseleave",de),(We=z.floating)==null||We.removeEventListener("mouseleave",de),ve&&be.removeEventListener("mousemove",ee),be.removeEventListener("mouseenter",ee),be.removeEventListener("mouseleave",Y)}}function ee(be){if(clearTimeout(Oe.current),Je.current=!1,le&&!oa(Se.current)||ue>0&&!El(oe.current,"open"))return;const We=El(oe.current,"open",Se.current);We?Oe.current=window.setTimeout(()=>{ce.current||A(!0,be,"hover")},We):j||A(!0,be,"hover")}function Y(be){if(ae())return;Pe.current();const We=Mt(z.floating);if(clearTimeout(Re.current),Ce.current=!1,Z.current&&O.current.floatingContext){j||clearTimeout(Oe.current),fe.current=Z.current({...O.current.floatingContext,tree:we,x:be.clientX,y:be.clientY,onClose(){ye(),he(),ae()||Me(be,!0,"safe-polygon")}});const _t=fe.current;return We.addEventListener("mousemove",_t),void(Pe.current=()=>{We.removeEventListener("mousemove",_t)})}(Se.current!=="touch"||!At(z.floating,be.relatedTarget))&&Me(be)}function de(be){ae()||O.current.floatingContext&&(Z.current==null||Z.current({...O.current.floatingContext,tree:we,x:be.clientX,y:be.clientY,onClose(){ye(),he(),ae()||Me(be)}})(be))}},[z,U,B,le,ue,ve,Me,he,ye,A,j,ce,we,oe,Z,O,ae]),lt(()=>{var ge;if(U&&j&&(ge=Z.current)!=null&&ge.__options.blockPointerEvents&&Le()){ot.current=!0;const Y=z.floating;if(st(z.domReference)&&Y){var ee;const de=Mt(z.floating).body;de.setAttribute(jh,"");const be=z.domReference,We=we==null||(ee=we.nodesRef.current.find(_t=>_t.id===Ae))==null||(ee=ee.context)==null?void 0:ee.elements.floating;return We&&(We.style.pointerEvents=""),de.style.pointerEvents="none",be.style.pointerEvents="auto",Y.style.pointerEvents="auto",()=>{de.style.pointerEvents="",be.style.pointerEvents="",Y.style.pointerEvents=""}}}},[U,j,Ae,z,we,Z,Le]),lt(()=>{j||(Se.current=void 0,Ce.current=!1,he(),ye())},[j,he,ye]),V.useEffect(()=>()=>{he(),clearTimeout(Oe.current),clearTimeout(Re.current),ye()},[U,z.domReference,he,ye]);const se=V.useMemo(()=>{function ge(ee){Se.current=ee.pointerType}return{onPointerDown:ge,onPointerEnter:ge,onMouseMove(ee){const{nativeEvent:Y}=ee;function de(){Je.current||ce.current||A(!0,Y,"hover")}le&&!oa(Se.current)||j||ue===0||Ce.current&&ee.movementX**2+ee.movementY**2<2||(clearTimeout(Re.current),Se.current==="touch"?de():(Ce.current=!0,Re.current=window.setTimeout(de,ue)))}}},[le,A,j,ce,ue]),Ne=V.useMemo(()=>({onMouseEnter(){clearTimeout(Oe.current)},onMouseLeave(ge){ae()||Me(ge.nativeEvent,!1)}}),[Me,ae]);return V.useMemo(()=>U?{reference:se,floating:Ne}:{},[U,se,Ne])}(M,{enabled:C,delay:{open:75},handleClose:Mx({blockPointerEvents:!0})}),T=function(B,E){E===void 0&&(E={});const{open:j,onOpenChange:A,dataRef:O,elements:{domReference:q}}=B,{enabled:z=!0,event:U="click",toggle:Q=!0,ignoreMouse:D=!1,keyboardHandlers:le=!0,stickIfOpen:ue=!0}=E,ve=V.useRef(),we=V.useRef(!1),Ae=V.useMemo(()=>({onPointerDown(Z){ve.current=Z.pointerType},onMouseDown(Z){const oe=ve.current;Z.button===0&&U!=="click"&&(oa(oe,!0)&&D||(!j||!Q||O.current.openEvent&&ue&&O.current.openEvent.type!=="mousedown"?(Z.preventDefault(),A(!0,Z.nativeEvent,"click")):A(!1,Z.nativeEvent,"click")))},onClick(Z){const oe=ve.current;U==="mousedown"&&ve.current?ve.current=void 0:oa(oe,!0)&&D||(!j||!Q||O.current.openEvent&&ue&&O.current.openEvent.type!=="click"?A(!0,Z.nativeEvent,"click"):A(!1,Z.nativeEvent,"click"))},onKeyDown(Z){ve.current=void 0,Z.defaultPrevented||!le||Rh(Z)||(Z.key!==" "||Lh(q)||(Z.preventDefault(),we.current=!0),Z.key==="Enter"&&A(!j||!Q,Z.nativeEvent,"click"))},onKeyUp(Z){Z.defaultPrevented||!le||Rh(Z)||Lh(q)||Z.key===" "&&we.current&&(we.current=!1,A(!j||!Q,Z.nativeEvent,"click"))}}),[O,q,U,D,le,A,j,ue,Q]);return V.useMemo(()=>z?{reference:Ae}:{},[z,Ae])}(M,{event:"mousedown",toggle:!C,ignoreMouse:C}),P=function(B,E){var j;E===void 0&&(E={});const{open:A,floatingId:O}=B,{enabled:q=!0,role:z="dialog"}=E,U=(j=Dx.get(z))!=null?j:z,Q=Au(),D=Bo()!=null,le=V.useMemo(()=>U==="tooltip"||z==="label"?{["aria-"+(z==="label"?"labelledby":"describedby")]:A?O:void 0}:{"aria-expanded":A?"true":"false","aria-haspopup":U==="alertdialog"?"dialog":U,"aria-controls":A?O:void 0,...U==="listbox"&&{role:"combobox"},...U==="menu"&&{id:Q},...U==="menu"&&D&&{role:"menuitem"},...z==="select"&&{"aria-autocomplete":"none"},...z==="combobox"&&{"aria-autocomplete":"list"}},[U,O,D,A,Q,z]),ue=V.useMemo(()=>{const we={id:O,...U&&{role:U}};return U==="tooltip"||z==="label"?we:{...we,...U==="menu"&&{"aria-labelledby":Q}}},[U,O,Q,z]),ve=V.useCallback(we=>{let{active:Ae,selected:Z}=we;const oe={role:"option",...Ae&&{id:O+"-option"}};switch(z){case"select":return{...oe,"aria-selected":Ae&&Z};case"combobox":return{...oe,...Ae&&{"aria-selected":!0}}}return{}},[O,z]);return V.useMemo(()=>q?{reference:le,floating:ue,item:ve}:{},[q,le,ue,ve])}(M,{role:"menu"}),X=function(B,E){E===void 0&&(E={});const{open:j,onOpenChange:A,elements:O,dataRef:q}=B,{enabled:z=!0,escapeKey:U=!0,outsidePress:Q=!0,outsidePressEvent:D="pointerdown",referencePress:le=!1,referencePressEvent:ue="pointerdown",ancestorScroll:ve=!1,bubbles:we,capture:Ae}=E,Z=Wo(),oe=Gt(typeof Q=="function"?Q:()=>!1),ce=typeof Q=="function"?oe:Q,Se=V.useRef(!1),Oe=V.useRef(!1),{escapeKey:fe,outsidePress:Re}=Dh(we),{escapeKey:Je,outsidePress:ot}=Dh(Ae),Pe=V.useRef(!1),Ce=Gt(se=>{var Ne;if(!j||!z||!U||se.key!=="Escape"||Pe.current)return;const ge=(Ne=q.current.floatingContext)==null?void 0:Ne.nodeId,ee=Z?_r(Z.nodesRef.current,ge):[];if(!fe&&(se.stopPropagation(),ee.length>0)){let Y=!0;if(ee.forEach(de=>{var be;(be=de.context)==null||!be.open||de.context.dataRef.current.__escapeKeyBubbles||(Y=!1)}),!Y)return}A(!1,function(Y){return"nativeEvent"in Y}(se)?se.nativeEvent:se,"escape-key")}),Le=Gt(se=>{var Ne;const ge=()=>{var ee;Ce(se),(ee=No(se))==null||ee.removeEventListener("keydown",ge)};(Ne=No(se))==null||Ne.addEventListener("keydown",ge)}),Me=Gt(se=>{var Ne;const ge=Se.current;Se.current=!1;const ee=Oe.current;if(Oe.current=!1,D==="click"&&ee||ge||typeof ce=="function"&&!ce(se))return;const Y=No(se),de="["+ba("inert")+"]",be=Mt(O.floating).querySelectorAll(de);let We=st(Y)?Y:null;for(;We&&!Ko(We);){const Lt=uo(We);if(Ko(Lt)||!st(Lt))break;We=Lt}if(be.length&&st(Y)&&!Y.matches("html,body")&&!At(Y,O.floating)&&Array.from(be).every(Lt=>!At(We,Lt)))return;if(Pt(Y)&&ae){const Lt=Y.clientWidth>0&&Y.scrollWidth>Y.clientWidth,nn=Y.clientHeight>0&&Y.scrollHeight>Y.clientHeight;let no=nn&&se.offsetX>Y.clientWidth;if(nn&&yn(Y).direction==="rtl"&&(no=se.offsetX<=Y.offsetWidth-Y.clientWidth),no||Lt&&se.offsetY>Y.clientHeight)return}const _t=(Ne=q.current.floatingContext)==null?void 0:Ne.nodeId,Ui=Z&&_r(Z.nodesRef.current,_t).some(Lt=>{var nn;return bl(se,(nn=Lt.context)==null?void 0:nn.elements.floating)});if(bl(se,O.floating)||bl(se,O.domReference)||Ui)return;const So=Z?_r(Z.nodesRef.current,_t):[];if(So.length>0){let Lt=!0;if(So.forEach(nn=>{var no;(no=nn.context)==null||!no.open||nn.context.dataRef.current.__outsidePressBubbles||(Lt=!1)}),!Lt)return}A(!1,se,"outside-press")}),he=Gt(se=>{var Ne;const ge=()=>{var ee;Me(se),(ee=No(se))==null||ee.removeEventListener(D,ge)};(Ne=No(se))==null||Ne.addEventListener(D,ge)});V.useEffect(()=>{if(!j||!z)return;q.current.__escapeKeyBubbles=fe,q.current.__outsidePressBubbles=Re;let se=-1;function Ne(be){A(!1,be,"ancestor-scroll")}function ge(){window.clearTimeout(se),Pe.current=!0}function ee(){se=window.setTimeout(()=>{Pe.current=!1},jc()?5:0)}const Y=Mt(O.floating);U&&(Y.addEventListener("keydown",Je?Le:Ce,Je),Y.addEventListener("compositionstart",ge),Y.addEventListener("compositionend",ee)),ce&&Y.addEventListener(D,ot?he:Me,ot);let de=[];return ve&&(st(O.domReference)&&(de=Vo(O.domReference)),st(O.floating)&&(de=de.concat(Vo(O.floating))),!st(O.reference)&&O.reference&&O.reference.contextElement&&(de=de.concat(Vo(O.reference.contextElement)))),de=de.filter(be=>{var We;return be!==((We=Y.defaultView)==null?void 0:We.visualViewport)}),de.forEach(be=>{be.addEventListener("scroll",Ne,{passive:!0})}),()=>{U&&(Y.removeEventListener("keydown",Je?Le:Ce,Je),Y.removeEventListener("compositionstart",ge),Y.removeEventListener("compositionend",ee)),ce&&Y.removeEventListener(D,ot?he:Me,ot),de.forEach(be=>{be.removeEventListener("scroll",Ne)}),window.clearTimeout(se)}},[q,O,U,ce,D,j,A,ve,z,fe,Re,Ce,Je,Le,Me,ot,he]),V.useEffect(()=>{Se.current=!1},[ce,D]);const ye=V.useMemo(()=>({onKeyDown:Ce,[Tx[ue]]:se=>{le&&A(!1,se.nativeEvent,"reference-press")}}),[Ce,A,le,ue]),ae=V.useMemo(()=>({onKeyDown:Ce,onMouseDown(){Oe.current=!0},onMouseUp(){Oe.current=!0},[Nx[D]]:()=>{Se.current=!0}}),[Ce,D]);return V.useMemo(()=>z?{reference:ye,floating:ae}:{},[z,ye,ae])}(M,{bubbles:!0}),te=Lx(M,{listRef:g,activeIndex:p,nested:C,onNavigate:m}),{getReferenceProps:W,getFloatingProps:J,getItemProps:L}=function(B){B===void 0&&(B=[]);const E=B.map(U=>U==null?void 0:U.reference),j=B.map(U=>U==null?void 0:U.floating),A=B.map(U=>U==null?void 0:U.item),O=V.useCallback(U=>Ol(U,B,"reference"),E),q=V.useCallback(U=>Ol(U,B,"floating"),j),z=V.useCallback(U=>Ol(U,B,"item"),A);return V.useMemo(()=>({getReferenceProps:O,getFloatingProps:q,getItemProps:z}),[O,q,z])}([_,T,P,X,te]);v.useEffect(()=>{if(S)return S.events.on("click",B),S.events.on("menuopen",E),()=>{S.events.off("click",B),S.events.off("menuopen",E)};function B(){d(!1)}function E(j){j.nodeId!==b&&j.parentId===k&&d(!1)}},[S,b,k]),v.useEffect(()=>{u&&S&&S.events.emit("menuopen",{parentId:k,nodeId:b})},[S,u,b,k]);const G={activeIndex:p,setActiveIndex:m,getItemProps:L,setHasFocusInside:h,isOpen:u,setIsOpen:d},F=v.useMemo(()=>G,[p,m,L,h,u]),N=re("io-dropdown-menu-button",C&&"io-dropdown-menu-item",u&&!C&&"active",e),$=kg([R.setReference,x.ref,c]),H=w.activeIndex===x.index?0:-1;return l.jsxs(Ex,{id:b,children:[l.jsx(et,{className:N,ref:$,variant:C?"link":t,tabIndex:C?H:void 0,role:C?"menuitem":void 0,"data-open":u?"":void 0,"data-nested":C?"":void 0,"data-focus-inside":f?"":void 0,text:r,icon:C?"chevron-right":n,iconSize:"10",iconRight:!!C||o,disabled:i,...W(w.getItemProps({onFocus(B){var E;(E=s.onFocus)==null||E.call(s,B),h(!1),w.setHasFocusInside(!0)},...s}))}),l.jsx(Pu.Provider,{value:F,children:l.jsx(kx,{elementsRef:g,labelsRef:y,children:u&&l.jsx(_x,{context:M,modal:!1,initialFocus:C?-1:0,returnFocus:!C,children:l.jsx("div",{ref:R.setFloating,className:"io-dropdown-menu",style:I,...J(),children:a})})})})]})});_u.displayName="DropdownMenu";const Nn=v.forwardRef(({...e},t)=>Bo()===null?l.jsx(jx,{children:l.jsx(_u,{ref:t,...e})}):l.jsx(_u,{ref:t,...e}));function Dd({className:e,variant:t="default",size:n="16",src:o,alt:r,...i}){const a=re("io-image-icon",t==="grayscale"&&[`io-image-icon-${t}`],n&&[`io-image-icon-${n}`],e);return l.jsx("img",{className:a,style:{width:`${n}px`,filter:t==="grayscale"?"grayscale(100%)":"none"},src:o,alt:r,...i})}function $x({className:e,size:t="large",variant:n="default",align:o="up",text:r,...i}){const a=re("io-loader",{[`io-loader-${n}`]:n!=="default"},t==="normal"&&"io-loader-md",t==="small"&&"io-loader-sm",o&&[`direction-${o}`],e);return l.jsxs("div",{className:a,role:"status","aria-live":"polite",...i,children:[l.jsx("div",{className:"io-loader-icon"}),r&&l.jsx("div",{className:"io-loader-text",children:r})]})}function Lo({className:e,children:t,...n}){const o=re("io-panel-header",e);return l.jsx(sn,{className:o,...n,children:t})}Nn.displayName="DropdownMenu",Nn.Item=Ng,Nn.Separator=Di,Lo.Title=qn,Lo.ButtonGroup=De,Lo.Button=et,Lo.ButtonIcon=Ue,Lo.Dropdown=pe;const ki=v.forwardRef(({className:e,children:t,...n},o)=>{const r=re("io-panel-body",e);return l.jsx("div",{className:r,ref:o,"data-testid":"panel-body",...n,children:t})});function ei({className:e,...t}){const n=re("io-panel-footer",e);return l.jsx(Ar,{className:n,...t})}function nt({className:e,children:t,...n}){const o=re("io-panel",e);return l.jsx("div",{className:o,"data-testid":"panel",...n,children:t})}function Tc({className:e,variant:t="default",children:n,...o}){const r=re("io-pill",t!=="default"&&[`io-pill-${t}`],e);return l.jsx("div",{className:r,role:"status",...o,children:n})}function Hx({className:e,variant:t="active",value:n=0,...o}){const r=re("io-progress",t,e);let i;return i=n<0?0:n>100?100:n,l.jsx("div",{className:r,role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,...o,children:l.jsx("div",{className:"io-progress-bar",style:{width:`${i}%`}})})}/*!
|
|
9
9
|
* OverlayScrollbars
|
|
10
10
|
* Version: 2.14.0
|
|
11
11
|
*
|
|
@@ -13,30 +13,30 @@
|
|
|
13
13
|
* https://github.com/KingSora
|
|
14
14
|
*
|
|
15
15
|
* Released under the MIT license.
|
|
16
|
-
*/ci.displayName="PanelBody",Br.ButtonGroup=We,Br.Button=Qe,Br.ButtonIcon=Ue,Br.Dropdown=fe,Xe.Header=Ao,Xe.Body=ci,Xe.Footer=Br,cc.Icon=kt;const tn=(e,t)=>{const{o:n,i:o,u:r}=e;let i,a=n;const s=(c,l)=>{const d=a,f=c,h=l||(o?!o(d,f):d!==f);return(h||r)&&(a=f,i=d),[a,h,i]};return[t?c=>s(t(a,i),c):s,c=>[a,!!c,i]]},Zt=typeof window<"u"&&typeof HTMLElement<"u"&&window.document?window:{},Ym=Math.max,ux=Math.min,au=Math.round,Io=Math.abs,ph=Math.sign,Xm=Zt.cancelAnimationFrame,hd=Zt.requestAnimationFrame,pd=Zt.setTimeout,Qm=Zt.clearTimeout,lc=e=>Zt[e]!==void 0?Zt[e]:void 0,dx=lc("MutationObserver"),mh=lc("IntersectionObserver"),Vr=lc("ResizeObserver"),Bi=lc("ScrollTimeline"),md=e=>e===void 0,uc=e=>e===null,$o=e=>typeof e=="number",xi=e=>typeof e=="string",dc=e=>typeof e=="boolean",Nn=e=>typeof e=="function",gn=e=>Array.isArray(e),Ps=e=>typeof e=="object"&&!gn(e)&&!uc(e),gd=e=>{const t=!!e&&e.length,n=$o(t)&&t>-1&&t%1==0;return!!(gn(e)||!Nn(e)&&n)&&(!(t>0&&Ps(e))||t-1 in e)},ia=e=>!!e&&e.constructor===Object,Ns=e=>e instanceof HTMLElement,fc=e=>e instanceof Element;function Ye(e,t){if(gd(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Ye(Object.keys(e),n=>t(e[n],n,e));return e}const eg=(e,t)=>e.indexOf(t)>=0,li=(e,t)=>e.concat(t),ct=(e,t,n)=>(!xi(t)&&gd(t)?Array.prototype.push.apply(e,t):e.push(t),e),qo=e=>Array.from(e||[]),vd=e=>gn(e)?e:!xi(e)&&gd(e)?qo(e):[e],Is=e=>!!e&&!e.length,Ts=e=>qo(new Set(e)),cn=(e,t,n)=>{Ye(e,o=>!o||o.apply(void 0,t||[])),n||(e.length=0)},tg="paddingTop",ng="paddingRight",og="paddingLeft",rg="paddingBottom",ig="marginLeft",ag="marginRight",sg="marginBottom",yd="overflowX",wd="overflowY",hc="width",pc="height",ro="visible",jn="hidden",ui="scroll",mc=(e,t,n,o)=>{if(e&&t){let r=!0;return Ye(n,i=>{e[i]!==t[i]&&(r=!1)}),r}return!1},cg=(e,t)=>mc(e,t,["w","h"]),ls=(e,t)=>mc(e,t,["x","y"]),fx=(e,t)=>mc(e,t,["t","r","b","l"]),_e=(e,...t)=>e.bind(0,...t),Gr=e=>{let t;const n=e?pd:hd,o=e?Qm:Xm;return[r=>{o(t),t=n(()=>r(),Nn(e)?e():e)},()=>o(t)]},gh=e=>{const t=Nn(e)?e():e;if($o(t)){const n=t?pd:hd,o=t?Qm:Xm;return r=>{const i=n(()=>r(),t);return()=>{o(i)}}}return t&&t._},lg=(e,t)=>{const{p:n,v:o,S:r,m:i}=t||{};let a,s,c,l;const d=function(m){s&&s(),a&&a(),l=s=a=c=void 0,e.apply(this,m)},f=m=>i&&c?i(c,m):m,h=()=>{s&&c&&d(f(c)||c)},p=function(){const m=qo(arguments),g=gh(n);if(g){const y=typeof r=="function"?r():r,w=gh(o),k=f(m)||m,b=d.bind(0,k);s&&s(),y&&!l?(b(),l=!0,s=g(()=>l=void 0)):(s=g(b),w&&!a&&(a=w(h))),c=k}else d(m)};return p.O=h,p},ug=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),qt=e=>e?Object.keys(e):[],ze=(e,t,n,o,r,i,a)=>{const s=[t,n,o,r,i,a];return typeof e=="object"&&!uc(e)||Nn(e)||(e={}),Ye(s,c=>{Ye(c,(l,d)=>{const f=c[d];if(e===f)return!0;const h=gn(f);if(f&&ia(f)){const p=e[d];let m=p;h&&!gn(p)?m=[]:h||ia(p)||(m={}),e[d]=ze(m,f)}else e[d]=h?f.slice():f})}),e},dg=(e,t)=>Ye(ze({},e),(n,o,r)=>{n===void 0?delete r[o]:n&&ia(n)&&(r[o]=dg(n))}),bd=e=>!qt(e).length,aa=()=>{},fg=(e,t,n)=>Ym(e,ux(t,n)),wr=e=>Ts((gn(e)?e:(e||"").split(" ")).filter(t=>t)),xd=(e,t)=>e&&e.getAttribute(t),vh=(e,t)=>e&&e.hasAttribute(t),to=(e,t,n)=>{Ye(wr(t),o=>{e&&e.setAttribute(o,String(n||""))})},Mn=(e,t)=>{Ye(wr(t),n=>e&&e.removeAttribute(n))},gc=(e,t)=>{const n=wr(xd(e,t)),o=_e(to,e,t),r=(i,a)=>{const s=new Set(n);return Ye(wr(i),c=>{s[a](c)}),qo(s).join(" ")};return{C:i=>o(r(i,"delete")),$:i=>o(r(i,"add")),H:i=>{const a=wr(i);return a.reduce((s,c)=>s&&n.includes(c),a.length>0)}}},hg=(e,t,n)=>(gc(e,t).C(n),_e(Sd,e,t,n)),Sd=(e,t,n)=>(gc(e,t).$(n),_e(hg,e,t,n)),Rs=(e,t,n,o)=>(o?Sd:hg)(e,t,n),kd=(e,t,n)=>gc(e,t).H(n),pg=e=>gc(e,"class"),mg=(e,t)=>{pg(e).C(t)},Cd=(e,t)=>(pg(e).$(t),_e(mg,e,t)),yh=(e,t)=>{const n=t?fc(t)&&t:document;return n?qo(n.querySelectorAll(e)):[]},su=(e,t)=>fc(e)&&e.matches(t),gg=e=>su(e,"body"),cu=e=>e?qo(e.childNodes):[],sa=e=>e&&e.parentElement,qr=(e,t)=>fc(e)&&e.closest(t),lu=e=>document.activeElement,hx=(e,t,n)=>{const o=qr(e,t),r=e&&((a,s)=>{const c=s?fc(s)&&s:document;return c&&c.querySelector(a)})(n,o),i=qr(r,t)===o;return!(!o||!r)&&(o===e||r===e||i&&qr(qr(e,n),t)!==o)},di=e=>{Ye(vd(e),t=>{const n=sa(t);t&&n&&n.removeChild(t)})},Jt=(e,t)=>_e(di,e&&t&&Ye(vd(t),n=>{n&&e.appendChild(n)}));let vg;const ti=e=>{const t=document.createElement("div");return to(t,"class",e),t},yg=e=>{const t=ti(),n=vg,o=e.trim();return t.innerHTML=n?n.createHTML(o):o,Ye(cu(t),r=>di(r))},wh=(e,t)=>e.getPropertyValue(t)||e[t]||"",wg=e=>{const t=e||0;return isFinite(t)?t:0},Ha=e=>wg(parseFloat(e||"")),uu=e=>Math.round(1e4*e)/1e4,bg=e=>`${uu(wg(e))}px`;function ca(e,t){e&&t&&Ye(t,(n,o)=>{try{const r=e.style,i=uc(n)||dc(n)?"":$o(n)?bg(n):n;o.indexOf("--")===0?r.setProperty(o,i):r[o]=i}catch{}})}function Un(e,t,n){const o=xi(t);let r=o?"":{};if(e){const i=Zt.getComputedStyle(e,n)||e.style;r=o?wh(i,t):qo(t).reduce((a,s)=>(a[s]=wh(i,s),a),r)}return r}const bh=(e,t,n)=>{const o=t?`${t}-`:"",r=n?`-${n}`:"",i=`${o}top${r}`,a=`${o}right${r}`,s=`${o}bottom${r}`,c=`${o}left${r}`,l=Un(e,[i,a,s,c]);return{t:Ha(l[i]),r:Ha(l[a]),b:Ha(l[s]),l:Ha(l[c])}},sl=(e,t)=>"translate"+(Ps(e)?`(${e.x},${e.y})`:`${t?"X":"Y"}(${e})`),px={w:0,h:0},vc=(e,t)=>t?{w:t[`${e}Width`],h:t[`${e}Height`]}:px,mx=e=>vc("inner",e||Zt),ni=_e(vc,"offset"),xg=_e(vc,"client"),Ls=_e(vc,"scroll"),Ed=e=>{const t=parseFloat(Un(e,hc))||0,n=parseFloat(Un(e,pc))||0;return{w:t-au(t),h:n-au(n)}},cl=e=>e.getBoundingClientRect(),du=e=>!(!e||!e[pc]&&!e[hc]),Sg=(e,t)=>{const n=du(e);return!du(t)&&n},xh=(e,t,n,o)=>{Ye(wr(t),r=>{e&&e.removeEventListener(r,n,o)})},tt=(e,t,n,o)=>{var r;const i=(r=o&&o.I)==null||r,a=o&&o.A||!1,s=o&&o.T||!1,c={passive:i,capture:a};return _e(cn,wr(t).map(l=>{const d=s?f=>{xh(e,l,d,a),n&&n(f)}:n;return e&&e.addEventListener(l,d,c),_e(xh,e,l,d,a)}))},kg=e=>e.stopPropagation(),fu=e=>e.preventDefault(),Cg=e=>kg(e)||fu(e),Hn=(e,t)=>{const{x:n,y:o}=$o(t)?{x:t,y:t}:t||{};$o(n)&&(e.scrollLeft=n),$o(o)&&(e.scrollTop=o)},on=e=>({x:e.scrollLeft,y:e.scrollTop}),gx=(e,t)=>{const{D:n,M:o}=e,{w:r,h:i}=t,a=(f,h,p)=>{let m=ph(f)*p,g=ph(h)*p;if(m===g){const y=Io(f),w=Io(h);g=y>w?0:g,m=y<w?0:m}return m=m===g?0:m,[m+0,g+0]},[s,c]=a(n.x,o.x,r),[l,d]=a(n.y,o.y,i);return{D:{x:s,y:l},M:{x:c,y:d}}},ll=({D:e,M:t})=>{const n=(o,r)=>o===0&&o<=r;return{x:n(e.x,t.x),y:n(e.y,t.y)}},Sh=({D:e,M:t},n)=>{const o=(r,i,a)=>fg(0,1,(r-a)/(r-i)||0);return{x:o(e.x,t.x,n.x),y:o(e.y,t.y,n.y)}},hu=e=>{e&&e.focus&&e.focus({preventScroll:!0,focusVisible:!1})},kh=(e,t)=>{Ye(vd(t),e)},pu=e=>{const t=new Map,n=(r,i)=>{if(r){const a=t.get(r);kh(s=>{a&&a[s?"delete":"clear"](s)},i)}else t.forEach(a=>{a.clear()}),t.clear()},o=(r,i)=>{if(xi(r)){const c=t.get(r)||new Set;return t.set(r,c),kh(l=>{Nn(l)&&c.add(l)},i),_e(n,r,i)}dc(i)&&i&&n();const a=qt(r),s=[];return Ye(a,c=>{const l=r[c];l&&ct(s,o(c,l))}),_e(cn,s)};return o(e||{}),[o,n,(r,i)=>{Ye(qo(t.get(r)),a=>{i&&!Is(i)?a.apply(0,i):a()})}]},Eg={},Ag={},_g=(e,t,n)=>qt(e).map(o=>{const{static:r,instance:i}=e[o],[a,s,c]=n||[],l=n?i:r;if(l){const d=n?l(a,s,t):l(t);return(c||Ag)[o]=d}}),Si=e=>Ag[e],ki="data-overlayscrollbars",us="os-environment",Wa=`${us}-scrollbar-hidden`,ul=`${ki}-initialize`,ds="noClipping",Ch=`${ki}-body`,Ho=ki,no=`${ki}-viewport`,vx=yd,yx=wd,jg="measuring",Og="scrollbarHidden",mu=`${ki}-padding`,Eh=`${ki}-content`,Ad="os-size-observer",wx=`${Ad}-appear`,bx=`${Ad}-listener`,dn="os-scrollbar",xx=`${dn}-rtl`,Sx=`${dn}-horizontal`,kx=`${dn}-vertical`,Pg=`${dn}-track`,_d=`${dn}-handle`,Cx=`${dn}-visible`,Ex=`${dn}-cornerless`,Ah=`${dn}-interaction`,_h=`${dn}-unusable`,gu=`${dn}-auto-hide`,jh=`${gu}-hidden`,Oh=`${dn}-wheel`,Ax=`${Pg}-interactive`,_x=`${_d}-interactive`,Jr=e=>e.indexOf(ro)===0,vu=(e,t)=>{if(e==="auto")return t?ui:jn;const n=e||jn;return[jn,ui,ro].includes(n)?n:jn},jx=(e,t)=>{const{overflowX:n,overflowY:o}=Un(e,[yd,wd]);return{x:vu(n,t.x),y:vu(o,t.y)}},jd="__osScrollbarsHidingPlugin",Ph=e=>JSON.stringify(e,(t,n)=>{if(Nn(n))throw 0;return n}),Nh=(e,t)=>e?`${t}`.split(".").reduce((n,o)=>n&&ug(n,o)?n[o]:void 0,e):void 0,Ng=[33,99],Ig=[222,666,!0],Ox={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:{mutation:[0,33],resize:null,event:Ng,env:Ig},attributes:null,ignoreMutation:null,flowDirectionStyles:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},Tg=(e,t)=>{const n={};return Ye(li(qt(t),qt(e)),o=>{const r=e[o],i=t[o];if(Ps(r)&&Ps(i))ze(n[o]={},Tg(r,i)),bd(n[o])&&delete n[o];else if(ug(t,o)&&i!==r){let a=!0;if(gn(r)||gn(i))try{Ph(r)===Ph(i)&&(a=!1)}catch{}a&&(n[o]=i)}}),n},Ih=(e,t,n)=>o=>[Nh(e,o),n||Nh(t,o)!==void 0];let Rg,dl;const Px=()=>{const e=(w,k,b)=>{Jt(document.body,w),Jt(document.body,w);const S=xg(w),x=ni(w),C=Ed(k);return b&&di(w),{x:x.h-S.h+C.h,y:x.w-S.w+C.w}},t=yg(`<div class="${us}"><div></div><style>${`.${us}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${us} div{width:200%;height:200%;margin:10px 0}.${Wa}{scrollbar-width:none!important}.${Wa}::-webkit-scrollbar,.${Wa}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`}</style></div>`)[0],n=t.firstChild,o=t.lastChild,r=Rg;r&&(o.nonce=r);const[i,,a]=pu(),[s,c]=tn({o:e(t,n),i:ls},_e(e,t,n,!0)),[l]=c(),d=(w=>{let k=!1;const b=Cd(w,Wa);try{k=Un(w,"scrollbar-width")==="none"||Un(w,"display","::-webkit-scrollbar")==="none"}catch{}return b(),k})(t),f={x:l.x===0,y:l.y===0},h={elements:{host:null,padding:!d,viewport:w=>d&&gg(w)&&w,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},p=ze({},Ox),m=_e(ze,{},p),g=_e(ze,{},h),y={P:l,k:f,U:d,J:!!Bi,G:_e(i,"r"),K:g,Z:w=>ze(h,w)&&g(),tt:m,nt:w=>ze(p,w)&&m(),ot:ze({},h),st:ze({},p)};if(Mn(t,"style"),di(t),tt(Zt,"resize",()=>{a("r",[])}),Nn(Zt.matchMedia)&&!d&&(!f.x||!f.y)){const w=k=>{const b=Zt.matchMedia(`(resolution: ${Zt.devicePixelRatio}dppx)`);tt(b,"change",()=>{k(),w(k)},{T:!0})};w(()=>{const[k,b]=s();ze(y.P,k),a("r",[b])})}return y},Kn=()=>(dl||(dl=Px()),dl),Th=(e,t,n,o)=>{let r=!1;const{et:i,ct:a,rt:s,it:c,lt:l,ut:d}=o||{},[f,h]=((w,k,b)=>{let S=!1;const x=!!b&&new WeakMap,C=T=>{if(x&&b){const L=b.map(M=>{const[j,N]=M||[];return[N&&j?(T||yh)(j,w):[],N]});Ye(L,M=>Ye(M[0],j=>{const N=M[1],O=x.get(j)||[];if(w.contains(j)&&N){const Y=tt(j,N,z=>{S?(Y(),x.delete(j)):k(z)});x.set(j,ct(O,Y))}else cn(O),x.delete(j)}))}};return C(),[()=>{S=!0},C]})(e,()=>r&&n(!0),s),p=a||[],m=li(i||[],p),g=(w,k)=>{if(!Is(k)){const b=l||aa,S=d||aa,x=[],C=[];let T=!1,L=!1;if(Ye(k,M=>{const{attributeName:j,target:N,type:O,oldValue:Y,addedNodes:z,removedNodes:R}=M,$=O==="attributes",H=O==="childList",K=e===N,B=$&&j,D=B&&xd(N,j||""),V=xi(D)?D:null,G=B&&Y!==V,Z=eg(p,j)&&G;if(t&&(H||!K)){const I=$&&G,E=I&&c&&su(N,c),A=(E?!b(N,j,Y,V):!$||I)&&!S(M,!!E,e,o);Ye(z,_=>ct(x,_)),Ye(R,_=>ct(x,_)),L=L||A}!t&&K&&G&&!b(N,j,Y,V)&&(ct(C,j),T=T||Z)}),h(M=>Ts(x).reduce((j,N)=>(ct(j,yh(M,N)),su(N,M)?ct(j,N):j),[])),t)return!w&&L&&n(!1),[!1];if(!Is(C)||T){const M=[Ts(C),T];return w||n.apply(0,M),M}}},y=new dx(_e(g,!1));return[()=>(y.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:m,subtree:t,childList:t,characterData:t}),r=!0,()=>{r&&(f(),y.disconnect(),r=!1)}),()=>{if(r)return g(!0,y.takeRecords())}]};let er=null;const Lg=(e,t,n)=>{const{ft:o}=n||{},r=Si("__osSizeObserverPlugin"),[i]=tn({o:!1,u:!0});return()=>{const a=[],s=yg(`<div class="${Ad}"><div class="${bx}"></div></div>`)[0],c=s.firstChild,l=d=>{let f=!1,h=!1;if(gn(d)&&!Is(d)){const p=d[0],[m,,g]=i(p.contentRect),y=du(m);h=Sg(m,g),f=!h&&!y}else h=d===!0;f||t({_t:!0,ft:h})};if(Vr){if(!dc(er)){const p=new Vr(aa);p.observe(e,{get box(){er=!0}}),er=er||!1,p.disconnect()}const d=lg(l,{p:0,v:0}),f=p=>d(p),h=new Vr(f);if(h.observe(er?e:c),ct(a,[()=>{h.disconnect()},!er&&Jt(e,s)]),er){const p=new Vr(f);p.observe(e,{box:"border-box"}),ct(a,()=>p.disconnect())}}else{if(!r)return aa;{const[d,f]=r(c,l,o);ct(a,li([Cd(s,wx),tt(s,"animationstart",d),Jt(e,s)],f))}}return _e(cn,a)}},Nx=(e,t)=>{let n;const o=ti("os-trinsic-observer"),[r]=tn({o:!1}),i=(s,c)=>{if(s){const l=r((f=>f.h===0||f.isIntersecting||f.intersectionRatio>0)(s)),[,d]=l;return d&&!c&&t(l)&&[l]}},a=(s,c)=>i(c.pop(),s);return[()=>{const s=[];if(mh)n=new mh(_e(a,!1),{root:e}),n.observe(o),ct(s,()=>{n.disconnect()});else{const c=()=>{const l=ni(o);i(l)};ct(s,Lg(o,c)()),c()}return _e(cn,ct(s,Jt(e,o)))},()=>n&&a(!0,n.takeRecords())]},Ix=(e,t,n,o)=>{let r,i,a,s,c,l,d,f;const h=`[${Ho}]`,p=`[${no}]`,m=["id","class","style","open","wrap","cols","rows"],{dt:g,vt:y,L:w,gt:k,ht:b,V:S,bt:x,wt:C,yt:T,St:L}=e,M=A=>Un(A,"direction")==="rtl",j={Ot:!1,B:M(g)},N=Kn(),O=Si(jd),[Y]=tn({i:cg,o:{w:0,h:0}},()=>{const A=O&&O.R(e,t,j,N,n).Y,_=!(x&&S)&&kd(y,Ho,ds),W=!S&&C("arrange"),F=W&&on(k),X=F&&L(),q=T(jg,_),P=W&&A&&A(),ce=Ls(w),le=Ed(w);return P&&P(),Hn(k,F),X&&X(),_&&q(),{w:ce.w+le.w,h:ce.h+le.h}}),z=(()=>{let A,_,W;const F=lg(o,{p:()=>A,v:()=>_,S:()=>W,m(q,P){const[ce]=q,[le]=P;return[li(qt(ce),qt(le)).reduce((ve,be)=>(ve[be]=ce[be]||le[be],ve),{})]}}),X=(q,P)=>{if(gn(P)){const[ce,le,ve]=P;A=ce,_=le,W=ve}else $o(P)?(A=P,_=!1,W=!1):(A=!1,_=!1,W=!1);F(q)};return X.O=F.O,X})(),R=A=>{const _=M(g);ze(A,{Ct:f!==_}),ze(j,{B:_}),f=_},$=(A,_)=>{const[W,F]=A,X={$t:F};return ze(j,{Ot:W}),_||o(X),X},H=({_t:A,ft:_})=>{const W=_?o:z,F={_t:A||_,ft:_};R(F),W(F,i)},K=(A,_)=>{const[,W]=Y(),F={xt:W};return R(F),W&&!_&&z(F,A?a:r),F},B=(A,_,W)=>{const F={Ht:_};return R(F),_&&!W&&z(F,r),F},[D,V]=b?Nx(y,$):[],G=!S&&Lg(y,H,{ft:!0}),[Z,I]=Th(y,!1,B,{ct:m,et:m}),E=S&&Vr&&new Vr(A=>{const _=A[A.length-1].contentRect;H({_t:!0,ft:Sg(_,d)}),d=_});return[()=>{E&&E.observe(y);const A=G&&G(),_=D&&D(),W=Z(),F=N.G(X=>{const[,q]=Y();z({Et:X,xt:q,_t:x},s)});return()=>{E&&E.disconnect(),A&&A(),_&&_(),l&&l(),W(),F()}},({zt:A,It:_,At:W})=>{const F={},[X]=A("update.ignoreMutation"),[q,P]=A("update.attributes"),[ce,le]=A("update.elementEvents"),[ve,be]=A("update.debounce"),ke=_||W;if(le||P){c&&c(),l&&l();const[te,ne]=Th(b||w,!0,K,{et:li(m,q||[]),rt:ce,it:h,ut:(Q,xe)=>{const{target:Pe,attributeName:ue}=Q;return!(xe||!ue||S)&&hx(Pe,h,p)||!!qr(Pe,`.${dn}`)||!!(Ne=>Nn(X)&&X(Ne))(Q)}});l=te(),c=ne}if(be&&(z.O(),gn(ve)||$o(ve)?(r=ve,i=!1,a=Ng,s=Ig):ia(ve)?(r=ve.mutation,i=ve.resize,a=ve.event,s=ve.env):(r=!1,i=!1,a=!1,s=!1)),ke){const te=I(),ne=V&&V(),Q=c&&c();te&&ze(F,B(te[0],te[1],ke)),ne&&ze(F,$(ne[0],ke)),Q&&ze(F,K(Q[0],ke))}return R(F),F},j]},Dg=(e,t)=>Nn(t)?t.apply(0,e):t,Tx=(e,t,n,o)=>{const r=md(o)?n:o;return Dg(e,r)||t.apply(0,e)},Mg=(e,t,n,o)=>{const r=md(o)?n:o,i=Dg(e,r);return!!i&&(Ns(i)?i:t.apply(0,e))},Rx=(e,t,n,o)=>{const r="--os-viewport-percent",i="--os-scroll-percent",a="--os-scroll-direction",{K:s}=Kn(),{scrollbars:c}=s(),{slot:l}=c,{dt:d,vt:f,L:h,Tt:p,gt:m,bt:g,V:y}=t,{scrollbars:w}=p?{}:e,{slot:k}=w||{},b=[],S=[],x=[],C=Mg([d,f,h],()=>y&&g?d:f,l,k),T=R=>{if(Bi){let $=null,H=[];const K=new Bi({source:m,axis:R}),B=()=>{$&&$.cancel(),$=null};return{kt:V=>{const{Dt:G}=n,Z=ll(G)[R],I=R==="x",E=[sl(0,I),sl(`calc(-100% + 100cq${I?"w":"h"})`,I)],A=Z?E:E.reverse();return H[0]===A[0]&&H[1]===A[1]||(H=A,B(),$=V.Mt.animate({clear:["left"],transform:A},{timeline:K})),B}}}},L={x:T("x"),y:T("y")},M=(R,$,H)=>{const K=H?Cd:mg;Ye(R,B=>{K(B.Lt,$)})},j=(R,$)=>{Ye(R,H=>{const[K,B]=$(H);ca(K,B)})},N=(R,$,H)=>{const K=dc(H),B=!K||!H;(!K||H)&&M(S,R,$),B&&M(x,R,$)},O=R=>{const $=R?"x":"y",H=ti(`${dn} ${R?Sx:kx}`),K=ti(Pg),B=ti(_d),D={Lt:H,Ut:K,Mt:B},V=L[$];return ct(R?S:x,D),ct(b,[Jt(H,K),Jt(K,B),_e(di,H),V&&V.kt(D),o(D,N,R)]),D},Y=_e(O,!0),z=_e(O,!1);return Y(),z(),[{Pt:()=>{const R=(()=>{const{Rt:H,Vt:K}=n,B=(D,V)=>fg(0,1,D/(D+V)||0);return{x:B(K.x,H.x),y:B(K.y,H.y)}})(),$=H=>K=>[K.Lt,{[r]:uu(H)+""}];j(S,$(R.x)),j(x,$(R.y))},Nt:()=>{if(!Bi){const{Dt:R}=n,$=Sh(R,on(m)),H=K=>B=>[B.Lt,{[i]:uu(K)+""}];j(S,H($.x)),j(x,H($.y))}},qt:()=>{const{Dt:R}=n,$=ll(R),H=K=>B=>[B.Lt,{[a]:K?"0":"1"}];j(S,H($.x)),j(x,H($.y)),Bi&&(S.forEach(L.x.kt),x.forEach(L.y.kt))},Bt:()=>{if(y&&!g){const{Rt:R,Dt:$}=n,H=ll($),K=Sh($,on(m)),B=D=>{const{Lt:V}=D,G=sa(V)===h&&V,Z=(I,E,A)=>{const _=E*I;return bg(A?_:-_)};return[G,G&&{transform:sl({x:Z(K.x,R.x,H.x),y:Z(K.y,R.y,H.y)})}]};j(S,B),j(x,B)}},Ft:N,jt:{Xt:S,Yt:Y,Wt:_e(j,S)},Jt:{Xt:x,Yt:z,Wt:_e(j,x)}},()=>(Jt(C,S[0].Lt),Jt(C,x[0].Lt),_e(cn,b))]},Lx=(e,t,n,o)=>(r,i,a)=>{const{vt:s,L:c,V:l,gt:d,Gt:f,St:h}=t,{Lt:p,Ut:m,Mt:g}=r,[y,w]=Gr(333),[k,b]=Gr(444),S=C=>{Nn(d.scrollBy)&&d.scrollBy({behavior:"smooth",left:C.x,top:C.y})};let x=!0;return _e(cn,[tt(g,"pointermove pointerleave",o),tt(p,"pointerenter",()=>{i(Ah,!0)}),tt(p,"pointerleave pointercancel",()=>{i(Ah,!1)}),!l&&tt(p,"mousedown",()=>{const C=lu();(vh(C,no)||vh(C,Ho)||C===document.body)&&pd(_e(hu,c),25)}),tt(p,"wheel",C=>{const{deltaX:T,deltaY:L,deltaMode:M}=C;x&&M===0&&sa(p)===s&&S({x:T,y:L}),x=!1,i(Oh,!0),y(()=>{x=!0,i(Oh)}),fu(C)},{I:!1,A:!0}),tt(p,"pointerdown",()=>{const C=tt(f,"click",L=>{T(),Cg(L)},{T:!0,A:!0,I:!1}),T=tt(f,"pointerup pointercancel",()=>{T(),setTimeout(C,150)},{A:!0,I:!0})},{A:!0,I:!0}),(()=>{const C="pointerup pointercancel lostpointercapture",T="client"+(a?"X":"Y"),L=a?hc:pc,M=a?"left":"top",j=a?"w":"h",N=a?"x":"y",O=(z,R)=>$=>{const{Rt:H}=n,K=ni(m)[j]-ni(g)[j],B=R*$/K*H[N];Hn(d,{[N]:z+B})},Y=[];return tt(m,"pointerdown",z=>{const R=qr(z.target,`.${_d}`)===g,$=R?g:m,H=e.scrollbars,K=H[R?"dragScroll":"clickScroll"],{button:B,isPrimary:D,pointerType:V}=z,{pointers:G}=H;if(B===0&&D&&K&&(G||[]).includes(V)){cn(Y),b();const Z=!R&&(z.shiftKey||K==="instant"),I=_e(cl,g),E=_e(cl,m),A=(Q,xe)=>(Q||I())[M]-(xe||E())[M],_=au(cl(d)[L])/ni(d)[j]||1,W=O(on(d)[N],1/_),F=z[T],X=I(),q=E(),P=X[L],ce=A(X,q)+P/2,le=F-q[M],ve=R?0:le-ce,be=Q=>{cn(ne),$.releasePointerCapture(Q.pointerId)},ke=R||Z,te=h(),ne=[tt(f,C,be),tt(f,"selectstart",Q=>fu(Q),{I:!1}),tt(m,C,be),ke&&tt(m,"pointermove",Q=>W(ve+(Q[T]-F))),ke&&(()=>{const Q=on(d);te();const xe=on(d),Pe={x:xe.x-Q.x,y:xe.y-Q.y};(Io(Pe.x)>3||Io(Pe.y)>3)&&(h(),Hn(d,Q),S(Pe),k(te))})];if($.setPointerCapture(z.pointerId),Z)W(ve);else if(!R){const Q=Si("__osClickScrollPlugin");if(Q){const xe=Q(W,ve,P,Pe=>{Pe?te():ct(ne,te)});ct(ne,xe),ct(Y,_e(xe,!0))}}}})})(),w,b])},Dx=e=>{const t=Kn(),{K:n,U:o}=t,{elements:r}=n(),{padding:i,viewport:a,content:s}=r,c=Ns(e),l=c?{}:e,{elements:d}=l,{padding:f,viewport:h,content:p}=d||{},m=c?e:l.target,g=gg(m),y=m.ownerDocument,w=y.documentElement,k=()=>y.defaultView||Zt,b=_e(Tx,[m]),S=_e(Mg,[m]),x=_e(ti,""),C=_e(b,x,a),T=_e(S,x,s),L=C(h),M=L===m,j=M&&g,N=!M&&T(p),O=!M&&L===N,Y=j?w:L,z=j?Y:m,R=!M&&S(x,i,f),$=!O&&N,H=[$,Y,R,z].map(q=>Ns(q)&&!sa(q)&&q),K=q=>q&&eg(H,q),B=!K(Y)&&(q=>{const P=ni(q),ce=Ls(q),le=Un(q,yd),ve=Un(q,wd);return ce.w-P.w>0&&!Jr(le)||ce.h-P.h>0&&!Jr(ve)})(Y)?Y:m,D=j?w:Y,V={dt:m,vt:z,L:Y,rn:R,ht:$,gt:D,Kt:j?y:Y,ln:g?w:B,Gt:y,bt:g,Tt:c,V:M,an:k,wt:q=>kd(Y,no,q),yt:(q,P)=>Rs(Y,no,q,P),St:()=>Rs(D,no,"scrolling",!0)},{dt:G,vt:Z,rn:I,L:E,ht:A}=V,_=[()=>{Mn(Z,[Ho,ul]),Mn(G,ul),g&&Mn(w,[ul,Ho])}];let W=cu([A,E,I,Z,G].find(q=>q&&!K(q)));const F=j?G:A||E,X=_e(cn,_);return[V,()=>{const q=k(),P=lu(),ce=te=>{Jt(sa(te),cu(te)),di(te)},le=te=>tt(te,"focusin focusout focus blur",Cg,{A:!0,I:!1}),ve="tabindex",be=xd(E,ve),ke=le(P);return to(Z,Ho,M?"":"host"),to(I,mu,""),to(E,no,""),to(A,Eh,""),M||(to(E,ve,be||"-1"),g&&to(w,Ch,"")),Jt(F,W),Jt(Z,I),Jt(I||Z,!M&&E),Jt(E,A),ct(_,[ke,()=>{const te=lu(),ne=K(E),Q=ne&&te===E?G:te,xe=le(Q);Mn(I,mu),Mn(A,Eh),Mn(E,no),g&&Mn(w,Ch),be?to(E,ve,be):Mn(E,ve),K(A)&&ce(A),ne&&ce(E),K(I)&&ce(I),hu(Q),xe()}]),o&&!M&&(Sd(E,no,Og),ct(_,_e(Mn,E,no))),hu(!M&&g&&P===G&&q.top===q?E:P),ke(),W=0,X},X]},Mx=({ht:e})=>({Qt:t,un:n,At:o})=>{const{$t:r}=t||{},{Ot:i}=n;e&&(r||o)&&ca(e,{[pc]:i&&"100%"})},$x=({vt:e,rn:t,L:n,V:o},r)=>{const[i,a]=tn({i:fx,o:bh()},_e(bh,e,"padding",""));return({zt:s,Qt:c,un:l,At:d})=>{let[f,h]=a(d);const{U:p}=Kn(),{_t:m,xt:g,Ct:y}=c||{},{B:w}=l,[k,b]=s("paddingAbsolute");(m||h||d||g)&&([f,h]=i(d));const S=!o&&(b||y||h);if(S){const x=!k||!t&&!p,C=f.r+f.l,T=f.t+f.b,L={[ag]:x&&!w?-C:0,[sg]:x?-T:0,[ig]:x&&w?-C:0,top:x?-f.t:0,right:x?w?-f.r:"auto":0,left:x?w?"auto":-f.l:0,[hc]:x&&`calc(100% + ${C}px)`},M={[tg]:x?f.t:0,[ng]:x?f.r:0,[rg]:x?f.b:0,[og]:x?f.l:0};ca(t||n,L),ca(n,M),ze(r,{rn:f,fn:!x,F:t?M:ze({},L,M)})}return{_n:S}}},Hx=(e,t)=>{const n=Kn(),{vt:o,rn:r,L:i,V:a,Kt:s,gt:c,bt:l,yt:d,an:f}=e,{U:h}=n,p=l&&a,m=_e(Ym,0),g={display:()=>!1,direction:I=>I!=="ltr",flexDirection:I=>I.endsWith("-reverse"),writingMode:I=>I!=="horizontal-tb"},y=qt(g),w={i:cg,o:{w:0,h:0}},k={i:ls,o:{}},b=I=>{d(jg,!p&&I)},S=()=>Un(i,y),x=(I,E)=>{const A=!qt(I).length,_=!E&&y.some(te=>{const ne=I[te];return xi(ne)&&g[te](ne)});if(A&&!_||!(te=>!!te&&(ne=>!!(ne.offsetWidth||ne.offsetHeight||ne.getClientRects().length))(te))(i))return{D:{x:0,y:0},M:{x:1,y:1}};b(!0);const W=on(c),F=tt(s,ui,te=>{const ne=on(c);te.isTrusted&&ne.x===W.x&&ne.y===W.y&&kg(te)},{A:!0,T:!0}),X=d("noContent",!0);Hn(c,{x:0,y:0}),X();const q=on(c),P=Ls(c);Hn(c,{x:P.w,y:P.h});const ce=on(c),le={x:ce.x-q.x,y:ce.y-q.y};Hn(c,{x:-P.w,y:-P.h});const ve=on(c),be={x:ve.x-q.x,y:ve.y-q.y},ke={x:Io(le.x)>=Io(be.x)?ce.x:ve.x,y:Io(le.y)>=Io(be.y)?ce.y:ve.y};return Hn(c,W),hd(()=>F()),{D:q,M:ke}},C=(I,E)=>{const A=Zt.devicePixelRatio%1!=0?1:0,_={w:m(I.w-E.w),h:m(I.h-E.h)};return{w:_.w>A?_.w:0,h:_.h>A?_.h:0}},T=(I,E)=>{const A=(_,W,F,X)=>{const q=_===ro?jn:(le=>le.replace(`${ro}-`,""))(_),P=Jr(_),ce=Jr(F);return!W&&!X?jn:P&&ce?ro:P?W&&X?q:W?ro:jn:W?q:ce&&X?ro:jn};return{x:A(E.x,I.x,E.y,I.y),y:A(E.y,I.y,E.x,I.x)}},L=I=>{const E=_=>[ro,jn,ui].map(W=>Z(vu(W),_)),A=E(!0).concat(E()).join(" ");d(A),d(qt(I).map(_=>Z(I[_],_==="x")).join(" "),!0)},[M,j]=tn(w,_e(Ed,i)),[N,O]=tn(w,_e(Ls,i)),[Y,z]=tn(w),[R]=tn(k),[$,H]=tn(w),[K]=tn(k),[B]=tn({i:(I,E)=>mc(I,E,Ts(li(qt(I),qt(E)))),o:{}}),[D,V]=tn({i:(I,E)=>ls(I.D,E.D)&&ls(I.M,E.M),o:{D:{x:0,y:0},M:{x:0,y:0}}}),G=Si(jd),Z=(I,E)=>`${E?vx:yx}${(A=>{const _=String(A||"");return _?_[0].toUpperCase()+_.slice(1):""})(I)}`;return({zt:I,Qt:E,un:A,At:_},{_n:W})=>{const{_t:F,Ht:X,xt:q,Ct:P,ft:ce,Et:le}=E||{},ve=G&&G.R(e,t,A,n,I),{X:be,Y:ke,W:te}=ve||{},[ne,Q]=((Tr,po)=>{const{k:Ln}=po,[mo,go]=Tr("showNativeOverlaidScrollbars");return[mo&&Ln.x&&Ln.y,go]})(I,n),[xe,Pe]=I("overflow"),ue=Jr(xe.x),Ne=Jr(xe.y),Je=F||W||q||P||le||Q;let ot=j(_),Ae=O(_),Oe=z(_),Me=H(_);if(Q&&h&&d(Og,!ne),Je){kd(o,Ho,ds)&&b(!0);const Tr=ke&&ke(),[po]=ot=M(_),[Ln]=Ae=N(_),mo=xg(i),go=p&&mx(f()),Gc={w:m(Ln.w+po.w),h:m(Ln.h+po.h)},Ta={w:m((go?go.w:mo.w+m(mo.w-Ln.w))+po.w),h:m((go?go.h:mo.h+m(mo.h-Ln.h))+po.h)};Tr&&Tr(),Me=$(Ta),Oe=Y(C(Gc,Ta),_)}const[Le,he]=Me,[ge,ie]=Oe,[ye,$e]=Ae,[we,ae]=ot,[ee,se]=R({x:ge.w>0,y:ge.h>0}),me=ue&&Ne&&(ee.x||ee.y)||ue&&ee.x&&!ee.y||Ne&&ee.y&&!ee.x,Te=W||P||le||ae||$e||he||ie||Pe||Q||Je||X&&p,[Ee]=I("update.flowDirectionStyles"),[rt,Qt]=B(Ee?Ee(i):S(),_),_i=P||ce||Qt||se||_,[Qo,Dt]=_i?D(x(rt,!!Ee),_):V();let Mt=T(ee,xe);b(!1),Te&&(L(Mt),Mt=jx(i,ee),te&&be&&(be(Mt,ye,we),ca(i,te(Mt))));const[Yn,Vc]=K(Mt);return Rs(o,Ho,ds,me),Rs(r,mu,ds,me),ze(t,{cn:Yn,Vt:{x:Le.w,y:Le.h},Rt:{x:ge.w,y:ge.h},j:ee,Dt:gx(Qo,ge)}),{sn:Vc,tn:he,nn:ie,en:Dt||ie}}},Wx=e=>{const[t,n,o]=Dx(e),r={rn:{t:0,r:0,b:0,l:0},fn:!1,F:{[ag]:0,[sg]:0,[ig]:0,[tg]:0,[ng]:0,[rg]:0,[og]:0},Vt:{x:0,y:0},Rt:{x:0,y:0},cn:{x:jn,y:jn},j:{x:!1,y:!1},Dt:{D:{x:0,y:0},M:{x:0,y:0}}},{dt:i,gt:a,V:s,St:c}=t,{U:l,k:d}=Kn(),f=!l&&(d.x||d.y),h=[Mx(t),$x(t,r),Hx(t,r)];return[n,p=>{const m={},g=f&&on(a),y=g&&c();return Ye(h,w=>{ze(m,w(p,m)||{})}),Hn(a,g),y&&y(),s||Hn(i,0),m},r,t,o]},Fx=(e,t,n,o,r)=>{let i=!1;const a=Ih(t,{}),[s,c,l,d,f]=Wx(e),[h,p,m]=Ix(d,l,a,S=>{b({},S)}),[g,y,,w]=((S,x,C,T,L,M)=>{let j,N,O,Y,z,R=aa,$=0;const H=["mouse","pen"],K=ue=>H.includes(ue.pointerType),[B,D]=Gr(),[V,G]=Gr(100),[Z,I]=Gr(100),[E,A]=Gr(()=>$),[_,W]=Rx(S,L,T,Lx(x,L,T,ue=>K(ue)&&te())),{vt:F,Kt:X,bt:q}=L,{Ft:P,Pt:ce,Nt:le,qt:ve,Bt:be}=_,ke=(ue,Ne)=>{if(A(),ue)P(jh);else{const Je=_e(P,jh,!0);$>0&&!Ne?E(Je):Je()}},te=()=>{(O?j:Y)||(ke(!0),V(()=>{ke(!1)}))},ne=ue=>{P(gu,ue,!0),P(gu,ue,!1)},Q=ue=>{K(ue)&&(j=O,O&&ke(!0))},xe=[A,G,I,D,()=>R(),tt(F,"pointerover",Q,{T:!0}),tt(F,"pointerenter",Q),tt(F,"pointerleave",ue=>{K(ue)&&(j=!1,O&&ke(!1))}),tt(F,"pointermove",ue=>{K(ue)&&N&&te()}),tt(X,"scroll",ue=>{B(()=>{le(),te()}),M(ue),be()})],Pe=Si(jd);return[()=>_e(cn,ct(xe,W())),({zt:ue,At:Ne,Qt:Je,Zt:ot})=>{const{tn:Ae,nn:Oe,sn:Me,en:Le}=ot||{},{Ct:he,ft:ge}=Je||{},{B:ie}=C,{k:ye,U:$e}=Kn(),{cn:we,j:ae}=T,[ee,se]=ue("showNativeOverlaidScrollbars"),[me,Te]=ue("scrollbars.theme"),[Ee,rt]=ue("scrollbars.visibility"),[Qt,_i]=ue("scrollbars.autoHide"),[Qo,Dt]=ue("scrollbars.autoHideSuspend"),[Mt]=ue("scrollbars.autoHideDelay"),[Yn,Vc]=ue("scrollbars.dragScroll"),[Tr,po]=ue("scrollbars.clickScroll"),[Ln,mo]=ue("overflow"),go=ge&&!Ne,Gc=ae.x||ae.y,Ta=Ae||Oe||Le||he||Ne,tb=Me||rt||mo,nb=ee&&ye.x&&ye.y,Lf=!$e&&!Pe,ob=nb||Lf,Df=(qc,Jc,rb)=>{const Mf=qc.includes(ui)&&(Ee===ro||Ee==="auto"&&Jc===ui);return P(Cx,Mf,rb),Mf};if($=Mt,go&&(Qo&&Gc?(ne(!1),R(),Z(()=>{R=tt(X,"scroll",_e(ne,!0),{T:!0})})):ne(!0)),(se||Lf)&&P("os-theme-none",ob),Te&&(P(z),P(me,!0),z=me),Dt&&!Qo&&ne(!0),_i&&(N=Qt==="move",O=Qt==="leave",Y=Qt==="never",ke(Y,!0)),Vc&&P(_x,Yn),po&&P(Ax,!!Tr),tb){const qc=Df(Ln.x,we.x,!0),Jc=Df(Ln.y,we.y,!1);P(Ex,!(qc&&Jc))}Ta&&(le(),ce(),be(),Le&&ve(),P(_h,!ae.x,!0),P(_h,!ae.y,!1),P(xx,ie&&!q))},{},_]})(e,t,m,l,d,r),k=S=>qt(S).some(x=>!!S[x]),b=(S,x)=>{if(n())return!1;const{dn:C,At:T,It:L,pn:M}=S,j=C||{},N=!!T||!i,O={zt:Ih(t,j,N),dn:j,At:N};if(M)return y(O),!1;const Y=x||p(ze({},O,{It:L})),z=c(ze({},O,{un:m,Qt:Y}));y(ze({},O,{Qt:Y,Zt:z}));const R=k(Y),$=k(z),H=R||$||!bd(j)||N;return i=!0,H&&o(S,{Qt:Y,Zt:z}),H};return[()=>{const{ln:S,gt:x,St:C}=d,T=on(S),L=[h(),s(),g()],M=C();return Hn(x,T),M(),_e(cn,L)},b,()=>({vn:m,gn:l}),{hn:d,bn:w},f]},yu=new WeakMap,$g=e=>yu.get(e),kn=(e,t,n)=>{const{tt:o}=Kn(),r=Ns(e),i=r?e:e.target,a=$g(i);if(t&&!a){let s=!1;const c=[],l={},d=j=>{const N=dg(j),O=Si("__osOptionsValidationPlugin");return O?O(N,!0):N},f=ze({},o(),d(t)),[h,p,m]=pu(),[g,y,w]=pu(n),k=(j,N)=>{w(j,N),m(j,N)},[b,S,x,C,T]=Fx(e,f,()=>s,({dn:j,At:N},{Qt:O,Zt:Y})=>{const{_t:z,Ct:R,$t:$,xt:H,Ht:K,ft:B}=O,{tn:D,nn:V,sn:G,en:Z}=Y;k("updated",[M,{updateHints:{sizeChanged:!!z,directionChanged:!!R,heightIntrinsicChanged:!!$,overflowEdgeChanged:!!D,overflowAmountChanged:!!V,overflowStyleChanged:!!G,scrollCoordinatesChanged:!!Z,contentMutation:!!H,hostMutation:!!K,appear:!!B},changedOptions:j||{},force:!!N}])},j=>k("scroll",[M,j])),L=j=>{(N=>{yu.delete(N)})(i),cn(c),s=!0,k("destroyed",[M,j]),p(),y()},M={options(j,N){if(j){const O=N?o():{},Y=Tg(f,ze(O,d(j)));bd(Y)||(ze(f,Y),S({dn:Y}))}return ze({},f)},on:g,off:(j,N)=>{j&&N&&y(j,N)},state(){const{vn:j,gn:N}=x(),{B:O}=j,{Vt:Y,Rt:z,cn:R,j:$,rn:H,fn:K,Dt:B}=N;return ze({},{overflowEdge:Y,overflowAmount:z,overflowStyle:R,hasOverflow:$,scrollCoordinates:{start:B.D,end:B.M},padding:H,paddingAbsolute:K,directionRTL:O,destroyed:s})},elements(){const{dt:j,vt:N,rn:O,L:Y,ht:z,gt:R,Kt:$}=C.hn,{jt:H,Jt:K}=C.bn,B=V=>{const{Mt:G,Ut:Z,Lt:I}=V;return{scrollbar:I,track:Z,handle:G}},D=V=>{const{Xt:G,Yt:Z}=V,I=B(G[0]);return ze({},I,{clone:()=>{const E=B(Z());return S({pn:!0}),E}})};return ze({},{target:j,host:N,padding:O||Y,viewport:Y,content:z||Y,scrollOffsetElement:R,scrollEventElement:$,scrollbarHorizontal:D(H),scrollbarVertical:D(K)})},update:j=>S({At:j,It:!0}),destroy:_e(L,!1),plugin:j=>l[qt(j)[0]]};return ct(c,[T]),((j,N)=>{yu.set(j,N)})(i,M),_g(Eg,kn,[M,h,l]),((j,N)=>{const{nativeScrollbarsOverlaid:O,body:Y}=N||{},{k:z,U:R,K:$}=Kn(),{nativeScrollbarsOverlaid:H,body:K}=$().cancel,B=O??H,D=md(Y)?K:Y,V=(z.x||z.y)&&B,G=j&&(uc(D)?!R:D);return!!V||!!G})(C.hn.bt,!r&&e.cancel)?(L(!0),M):(ct(c,b()),k("initialized",[M]),M.update(),M)}return a};kn.plugin=e=>{const t=gn(e),n=t?e:[e],o=n.map(r=>_g(r,kn)[0]);return(r=>{Ye(r,i=>Ye(i,(a,s)=>{Eg[s]=i[s]}))})(n),t?o:o[0]},kn.valid=e=>{const t=e&&e.elements,n=Nn(t)&&t();return ia(n)&&!!$g(n.target)},kn.env=()=>{const{P:e,k:t,U:n,J:o,ot:r,st:i,K:a,Z:s,tt:c,nt:l}=Kn();return ze({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,scrollTimeline:o,staticDefaultInitialization:r,staticDefaultOptions:i,getDefaultInitialization:a,setDefaultInitialization:s,getDefaultOptions:c,setDefaultOptions:l})},kn.nonce=e=>{Rg=e},kn.trustedTypePolicy=e=>{vg=e};const Bx=()=>{if(typeof window>"u"){const l=()=>{};return[l,l]}let e,t;const n=window,o=typeof n.requestIdleCallback=="function",r=n.requestAnimationFrame,i=n.cancelAnimationFrame,a=o?n.requestIdleCallback:r,s=o?n.cancelIdleCallback:i,c=()=>{s(e),i(t)};return[(l,d)=>{c(),e=a(o?()=>{c(),t=r(l)}:l,typeof d=="object"?d:{timeout:2233})},c]},Hg=e=>{const{options:t,events:n,defer:o}=e||{},[r,i]=v.useMemo(Bx,[]),a=v.useRef(null),s=v.useRef(o),c=v.useRef(t),l=v.useRef(n);return v.useEffect(()=>{s.current=o},[o]),v.useEffect(()=>{const{current:d}=a;c.current=t,kn.valid(d)&&d.options(t||{},!0)},[t]),v.useEffect(()=>{const{current:d}=a;l.current=n,kn.valid(d)&&d.on(n||{},!0)},[n]),v.useEffect(()=>()=>{var d;i(),(d=a.current)==null||d.destroy()},[]),v.useMemo(()=>[d=>{const f=a.current;if(kn.valid(f))return;const h=s.current,p=c.current||{},m=l.current||{},g=()=>a.current=kn(d,p,m);h?r(g,h):g()},()=>a.current],[])};v.forwardRef((e,t)=>{const{element:n="div",options:o,events:r,defer:i,children:a,...s}=e,c=n,l=v.useRef(null),d=v.useRef(null),[f,h]=Hg({options:o,events:r,defer:i});return v.useEffect(()=>{const{current:p}=l,{current:m}=d;if(p)return f(n==="body"?{target:p,cancel:{body:null}}:{target:p,elements:{viewport:m,content:m}}),()=>{var g;return(g=h())==null?void 0:g.destroy()}},[f,n]),v.useImperativeHandle(t,()=>({osInstance:h,getElement:()=>l.current}),[]),v.createElement(c,{"data-overlayscrollbars-initialize":"",ref:l,...s},n==="body"?a:v.createElement("div",{"data-overlayscrollbars-contents":"",ref:d},a))});const Jo=v.forwardRef((e,t)=>{const{children:n,element:o="div",elementProps:r,wrapperClassName:i}=e,a=v.useRef(null),s=v.useRef(null),[c,l]=Hg({options:{scrollbars:{autoHide:"leave",autoHideDelay:0}},defer:!0}),d=v.useCallback(f=>{s.current=f,typeof t=="function"?t(f):t!==null&&(t.current=f)},[t]);return v.useEffect(()=>{if(s.current&&a.current)return c({target:a.current,elements:{viewport:s.current,content:s.current}}),()=>{var f;return(f=l())==null?void 0:f.destroy()}},[c,l]),u.jsx("div",{"data-overlayscrollbars-initialize":"",ref:a,className:oe("io-overlay-scrollbars-container",i),children:u.jsx(o,{"data-overlayscrollbars-contents":"",ref:d,...r,children:n})})});function yc({text:e="Label",...t}){return u.jsx("label",{...t,children:e})}var zx=v[typeof document<"u"&&document.createElement!==void 0?"useLayoutEffect":"useEffect"],Wg=0,Ux=()=>Wg++,Rh=0;function Kx(e,t){t===void 0&&(t="🅰");var[n,o]=v.useState(Rh?Ux:void 0);return zx(()=>{n===void 0&&o(Wg++),Rh=1},[]),e||(n===void 0?n:t+n)}function va(){return(typeof v.useId=="function"?v.useId:Kx)()??""}const Cr=v.forwardRef(({id:e,className:t,type:n="text",name:o="input",align:r="up",label:i,iconPrepend:a,iconPrependOnClick:s,iconAppend:c,iconAppendOnClick:l,placeholder:d,disabled:f,readOnly:h,errorMessage:p,errorDataTestId:m,...g},y)=>{const w=va(),k=e||`input-${w}`,b=oe("io-control-input",a&&"io-control-leading-icon",c&&"io-control-trailing-icon",f&&"io-control-disabled",h&&"io-control-readonly",p&&"io-control-error",r&&[`direction-${r}`],t),S=v.useCallback(C=>{f?C.preventDefault():s&&s(C)},[s,f]),x=v.useCallback(C=>{f?C.preventDefault():l&&l(C)},[l,f]);return u.jsxs("div",{className:b,children:[i&&u.jsx(yc,{htmlFor:k,text:i}),a&&u.jsx(kt,{variant:a,onClick:C=>S(C)}),u.jsx("input",{id:k,className:"io-input",ref:y,type:n,name:o,tabIndex:0,placeholder:d??(()=>{switch(n){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:f,readOnly:h,...p?{"aria-invalid":!0,"aria-describedby":`${k}-error`}:{},...g}),c&&u.jsx(kt,{variant:c,onClick:C=>x(C)}),p&&u.jsxs("div",{"data-testid":m,id:`${k}-error`,className:"io-input-error",children:[u.jsx(kt,{variant:"close"}),p]})]})});Cr.displayName="Input";const wc=v.forwardRef(({id:e,className:t,name:n="textarea",align:o="up",label:r,rows:i=4,placeholder:a="Enter text here...",disabled:s,readOnly:c,...l},d)=>{const f=va(),h=e||`textarea-${f}`,p=oe("io-control-textarea",s&&"io-control-disabled",c&&"io-control-readonly",o&&[`direction-${o}`],t);return u.jsxs("div",{className:p,children:[r&&u.jsx(yc,{htmlFor:h,text:r}),u.jsx("textarea",{id:h,className:"io-textarea",ref:d,name:n,tabIndex:0,placeholder:a,"aria-label":r,disabled:s,readOnly:c,rows:i,...l})]})});wc.displayName="Textarea";const bc=v.forwardRef(({id:e,className:t,name:n="checkbox",align:o="left",label:r,checked:i,disabled:a,...s},c)=>{const l=va(),d=e||`checkbox-${l}`,f=oe("io-control-checkbox",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],t);return u.jsxs("div",{className:f,children:[u.jsx("input",{type:"checkbox",id:d,className:"io-checkbox",ref:c,name:n,tabIndex:a?-1:0,checked:i,disabled:a,"aria-checked":i,...s}),r&&u.jsx(yc,{htmlFor:d,text:r,"data-testid":s["data-testid"]?`${s["data-testid"]}-label`:void 0})]})});bc.displayName="Checkbox";const Vx=v.forwardRef(({id:e,className:t,name:n="radio",align:o="left",label:r,checked:i,disabled:a,...s},c)=>{const l=va(),d=e||`radio-${l}`,f=oe("io-control-radio",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],t);return u.jsxs("div",{className:f,children:[u.jsx("input",{type:"radio",id:d,className:"io-radio",ref:c,name:n,tabIndex:a?-1:0,checked:i,disabled:a,"aria-checked":i,...s}),r&&u.jsx(yc,{htmlFor:d,text:r})]})});Vx.displayName="Radio";const Gx=()=>{const e=v.useContext(Ie.IOConnectContext),[t,n]=v.useState(null),o=v.useCallback(r=>{var i;return(i=e==null?void 0:e.themes)==null?void 0:i.select(r)},[e]);return v.useEffect(()=>{var a,s;if(!e)return;let r=!1;const i=c=>{r||n(c)};return(a=e.themes)==null||a.onChanged(i),(s=e.themes)==null||s.getCurrent().then(i).catch(console.warn),()=>{r=!0}},[e]),{currentTheme:t,selectTheme:o}},qx=()=>{const e=v.useContext(Ie.IOConnectContext),[t,n]=v.useState([]);return v.useEffect(()=>{var o;e&&((o=e.themes)==null||o.list().then(n).catch(console.warn))},[e]),t},Ct=v.forwardRef(({id:e,className:t,name:n="toggle",align:o="left",label:r,checked:i,disabled:a,onKeyDown:s,"data-testid":c="toggle",...l},d)=>{const f=va(),h=e||`toggle-${f}`,p=oe("io-control-toggle",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],t);return u.jsx("div",{className:p,children:u.jsxs("label",{className:"io-toggle",htmlFor:h,tabIndex:a?-1:0,onKeyDown:s,"data-testid":`${c}-label`,children:[u.jsx("input",{type:"checkbox",id:h,className:"io-checkbox",ref:d,name:n,checked:i,disabled:a,"aria-checked":i,tabIndex:-1,"data-testid":c,...l}),u.jsx("span",{className:"slider","data-testid":`${c}-slider`}),r]})})});function Fg(e,t=500){const[n,o]=v.useState(e);return v.useEffect(()=>{const r=setTimeout(()=>{o(e)},t);return()=>clearTimeout(r)},[e,t]),n}function Jx(e,t){v.useEffect(()=>{const n=o=>{o.code===e&&t()};return document.addEventListener("keyup",n),()=>document.removeEventListener("keyup",n)},[e,t])}Ct.displayName="Toggle";const xc=()=>window.glue42gd!==void 0||window.glue42alert!==void 0||window.glue42dialog!==void 0||window.iodesktop!==void 0;function Ke(){return v.useMemo(()=>typeof window=="object"&&xc(),[])}function Fa(e){return{name:e.name,title:e.title,hidden:e.isHidden,userProperties:e.customProperties}}function Ba(e){return{name:e.name,title:e.title,hidden:e.hidden,userProperties:e.userProperties}}const To={getMyApplication:async function(e){var t,n;if(e)try{const o=e.apps;if(o){const i=(t=o.my)==null?void 0:t.appName;if(!i)return;const a=await o.registry.get({name:i});return a?Fa(a):void 0}const r=(n=e.appManager)==null?void 0:n.myApplication;return r?Ba(r):void 0}catch(o){return void console.error("Failed to get my application",o)}},getApplications:async function(e){var t,n;if(!e)return[];try{const o=(t=e.apps)==null?void 0:t.registry;return o?(await o.getMany()??[]).map(a=>Fa(a)):(((n=e.appManager)==null?void 0:n.applications())??[]).map(i=>Ba(i))}catch(o){console.error("Failed to get applications",o)}return[]},startApplication:async function(e,t,n){var o,r;if(e)try{const i=e.apps;if(i){await((o=i.registry)==null?void 0:o.get({name:t}))||console.error(`Application "${t}" not found in registry`);const s=i.instances;return s?void await s.start({name:t,...n}):void console.error("io.apps.instances API is not available")}const a=(r=e.appManager)==null?void 0:r.application(t);if(!a)return void console.error(`Application "${t}" not found`);await a.start(n)}catch(i){return void console.error(`Failed to start application "${t}"`,i)}},stopApplication:async function(e,t,n){if(e)try{const o=e.apps;if(o){const i=o.instances;return i?void await i.stop({id:t.id,force:n==null?void 0:n.force,reason:n==null?void 0:n.reason,timeout:n==null?void 0:n.timeout}):void console.error("io.apps.instances API is not available")}const r=e.appManager.instances().find(i=>i.id===t.id);if(!r)return void console.error(`Instance "${t.id}" not found`);await r.stop()}catch(o){return void console.error(`Failed to stop application instance "${t.id}"`,o)}},onAppAdded:async function(e,t){var n,o;if(e)try{const r=(n=e.apps)==null?void 0:n.registry;return r?await r.onAdded(({app:a})=>{const s=Fa(a);t(s)}):(o=e.appManager)==null?void 0:o.onAppAdded(a=>{const s=Ba(a);t(s)})}catch(r){return void console.error("Failed to subscribe to app added events",r)}},onAppRemoved:async function(e,t){var n,o;if(e)try{const r=(n=e.apps)==null?void 0:n.registry;return r?await r.onRemoved(({appName:a})=>{t({name:a})}):(o=e.appManager)==null?void 0:o.onAppRemoved(a=>{t({name:a.name})})}catch(r){return void console.error("Failed to subscribe to app removed events",r)}},onAppChanged:async function(e,t){var n,o;if(e)try{const r=(n=e.apps)==null?void 0:n.registry;return r?await r.onUpdated(a=>{const s=Fa(a.app);t(s)}):(o=e.appManager)==null?void 0:o.onAppChanged(a=>{const s=Ba(a);t(s)})}catch(r){return void console.error("Failed to subscribe to app changed events",r)}},restartPlatform:async function(e,t=!0){var o,r;if(!e)return;const n={autoSave:t,showDialog:!0};try{if((o=e.platform)!=null&&o.restart)return void await e.platform.restart(n);await((r=e.appManager)==null?void 0:r.restart(n))}catch(i){console.error("Failed to restart platform",i)}},shutdownPlatform:async function(e,t=!0){var o,r;if(!e)return;const n={autoSave:t,showDialog:!0};try{if((o=e.platform)!=null&&o.shutdown)return void await e.platform.shutdown(n);await((r=e.appManager)==null?void 0:r.exit(n))}catch(i){console.error("Failed to shutdown platform",i)}}},Zx={minimizeWindow:async function(e){var t;if(e)try{const n=(t=e.windows)==null?void 0:t.my();await(n==null?void 0:n.minimize())}catch(n){console.error("Failed to minimize window",n)}},closeWindow:async function(e,t){var n;if(e)try{const o=(n=e.windows)==null?void 0:n.my();await(o==null?void 0:o.close(t))}catch(o){console.error("Failed to close window",o)}},restartPlatform:To.restartPlatform,shutdownPlatform:To.shutdownPlatform};v.createContext({theme:"dark"});const Lh="io-connect-platform",fr="___platform_prefs___",Yx="_launchpad_collapsedSections",Xx="_launchpad_favorites",Qx="_launchpad_recent",e2="_launchpad_isLayoutsPanelOpen",t2="_launchpad_isCollapsed",wu="_launchpad_isPinned",bu="_launchpad_isDocked",Bg="_launchpad_minimizeToTray",zg="_launchpad_autoCloseStartingAppsAndWorkspaces",Ug="_launchpad_pinnedPosition",Kg="_launchpad_allowDocking",Vg="_launchpad_dockedAlwaysOnTop",Gg="_launchpad_dockedClaimsSpace",ya="_launchpad_showExtendedArea",qg="_launchpad_hideLabelsInExtendedArea",Jg="_launchpad_showFavoritesInExtendedArea",Zg="_launchpad_hideFavoritesSection",Yg="_launchpad_showRecentAppsInExtendedArea",Xg="_layouts_restoreLastSaved",Qg="_layouts_saveCurrentOnExit",ev="_layouts_showUnsavedChangesPrompt",tv="_layouts_showDeletePrompt",nv="_downloads_askForEachDownload",n2="_downloads_location",o2="_system_scheduleRestart",r2="_system_scheduleRestartTime",i2="_system_scheduleRestartFrequency",a2="_system_scheduleRestartDay",s2="_system_scheduleShutdown",c2="_system_scheduleShutdownTime",l2="_system_scheduleShutdownFrequency",u2="_system_scheduleShutdownDay",d2={[Yx]:[],[Xx]:[],[Qx]:[],[e2]:!1,[t2]:!1,[wu]:!1,[bu]:!1,[Bg]:!1,[zg]:!0,[Ug]:"Left",[Kg]:!0,[Vg]:!1,[Gg]:!1,[ya]:!0,[qg]:!0,[Jg]:!0,[Zg]:!1,[Yg]:!0,[Xg]:!0,[Qg]:!0,[ev]:!0,[tv]:!0,[nv]:!0,[n2]:"",[o2]:!1,[r2]:"12:00 AM",[i2]:"daily",[a2]:"Monday",[s2]:!1,[c2]:"12:00 AM",[l2]:"daily",[u2]:"Monday"},hr=e=>typeof e=="string"?e:e!=null&&e.message?typeof e.message=="string"?e.message:JSON.stringify(e.message):JSON.stringify(e),Od="warning",f2={success:5e3,warning:1e4};var At=function(e){return{ok:!0,result:e}},yt=function(e){return{ok:!1,error:e}},Dh=function(e,t,n){return t.ok===!1?t:n.ok===!1?n:At(e(t.result,n.result))},fl=function(e,t){return t.ok===!0?t:yt(e(t.error))},xu=function(){return xu=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},xu.apply(this,arguments)};function Su(e,t){if(e===t||e===null&&t===null)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="object"){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Su(e[n],t[n]))return!1;return!0}var o=Object.keys(e);if(o.length!==Object.keys(t).length)return!1;for(n=0;n<o.length;n++)if(!t.hasOwnProperty(o[n])||!Su(e[o[n]],t[o[n]]))return!1;return!0}}var zi=function(e){return Array.isArray(e)},za=function(e){return typeof e=="object"&&e!==null&&!zi(e)},Xn=function(e,t){return"expected "+e+", got "+function(n){switch(typeof n){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return n instanceof Array?"an array":n===null?"null":"an object";default:return JSON.stringify(n)}}(t)},Pi=function(e){return e.map(function(t){return typeof t=="string"?"."+t:"["+t+"]"}).join("")},Ni=function(e,t){var n=t.at,o=function(r,i){var a={};for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&i.indexOf(s)<0&&(a[s]=r[s]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var c=0;for(s=Object.getOwnPropertySymbols(r);c<s.length;c++)i.indexOf(s[c])<0&&Object.prototype.propertyIsEnumerable.call(r,s[c])&&(a[s[c]]=r[s[c]])}return a}(t,["at"]);return xu({at:e+(n||"")},o)},xt=function(){function e(t){var n=this;this.decode=t,this.run=function(o){return fl(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},n.decode(o))},this.runPromise=function(o){return function(r){return r.ok===!0?Promise.resolve(r.result):Promise.reject(r.error)}(n.run(o))},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(n.run(o))},this.map=function(o){return new e(function(r){return function(i,a){return a.ok===!0?At(i(a.result)):a}(o,n.decode(r))})},this.andThen=function(o){return new e(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},n.decode(r))})},this.where=function(o,r){return n.andThen(function(i){return o(i)?e.succeed(i):e.fail(r)})}}return e.string=function(){return new e(function(t){return typeof t=="string"?At(t):yt({message:Xn("a string",t)})})},e.number=function(){return new e(function(t){return typeof t=="number"?At(t):yt({message:Xn("a number",t)})})},e.boolean=function(){return new e(function(t){return typeof t=="boolean"?At(t):yt({message:Xn("a boolean",t)})})},e.constant=function(t){return new e(function(n){return Su(n,t)?At(t):yt({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(n)})})},e.object=function(t){return new e(function(n){if(za(n)&&t){var o={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r].decode(n[r]);if(i.ok!==!0)return n[r]===void 0?yt({message:"the key '"+r+"' is required but was not present"}):yt(Ni("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return At(o)}return za(n)?At(n):yt({message:Xn("an object",n)})})},e.array=function(t){return new e(function(n){return zi(n)&&t?n.reduce(function(o,r,i){return Dh(function(a,s){return a.concat([s])},o,function(a,s){return fl(function(c){return Ni("["+s+"]",c)},t.decode(a))}(r,i))},At([])):zi(n)?At(n):yt({message:Xn("an array",n)})})},e.tuple=function(t){return new e(function(n){if(zi(n)){if(n.length!==t.length)return yt({message:"expected a tuple of length "+t.length+", got one of length "+n.length});for(var o=[],r=0;r<t.length;r++){var i=t[r].decode(n[r]);if(!i.ok)return yt(Ni("["+r+"]",i.error));o[r]=i.result}return At(o)}return yt({message:Xn("a tuple of length "+t.length,n)})})},e.union=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return e.oneOf.apply(e,[t,n].concat(o))},e.intersection=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new e(function(i){return[t,n].concat(o).reduce(function(a,s){return Dh(Object.assign,a,s.decode(i))},At({}))})},e.anyJson=function(){return new e(function(t){return At(t)})},e.unknownJson=function(){return new e(function(t){return At(t)})},e.dict=function(t){return new e(function(n){if(za(n)){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=t.decode(n[r]);if(i.ok!==!0)return yt(Ni("."+r,i.error));o[r]=i.result}return At(o)}return yt({message:Xn("an object",n)})})},e.optional=function(t){return new e(function(n){return n==null?At(void 0):t.decode(n)})},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(function(o){for(var r=[],i=0;i<t.length;i++){var a=t[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var s=r.map(function(c){return"at error"+(c.at||"")+": "+c.message}).join('", "');return yt({message:'expected a value matching one of the decoders, got the errors ["'+s+'"]'})})},e.withDefault=function(t,n){return new e(function(o){return At(function(r,i){return i.ok===!0?i.result:r}(t,n.decode(o)))})},e.valueAt=function(t,n){return new e(function(o){for(var r=o,i=0;i<t.length;i++){if(r===void 0)return yt({at:Pi(t.slice(0,i+1)),message:"path does not exist"});if(typeof t[i]=="string"&&!za(r))return yt({at:Pi(t.slice(0,i+1)),message:Xn("an object",r)});if(typeof t[i]=="number"&&!zi(r))return yt({at:Pi(t.slice(0,i+1)),message:Xn("an array",r)});r=r[t[i]]}return fl(function(a){return r===void 0?{at:Pi(t),message:"path does not exist"}:Ni(Pi(t),a)},n.decode(r))})},e.succeed=function(t){return new e(function(n){return At(t)})},e.fail=function(t){return new e(function(n){return yt({message:t})})},e.lazy=function(t){return new e(function(n){return t().decode(n)})},e}(),Pd=xt.string;xt.number;var ft=xt.boolean,ov=xt.anyJson;xt.unknownJson;var J=xt.constant,Nd=xt.object,fs=xt.array;xt.tuple,xt.dict;var De=xt.optional,Sc=xt.oneOf;xt.union,xt.intersection,xt.withDefault,xt.valueAt,xt.succeed,xt.fail,xt.lazy;const ao=Pd().where(e=>e.length>0,"Expected a non-empty string"),h2=Sc(J("add"),J("align-bottom"),J("align-bottom-solid"),J("align-left"),J("align-left-bottom"),J("align-left-bottom-solid"),J("align-left-solid"),J("align-left-top"),J("align-left-top-solid"),J("align-right"),J("align-right-bottom"),J("align-right-bottom-solid"),J("align-right-solid"),J("align-right-top"),J("align-right-top-solid"),J("align-top"),J("align-top-solid"),J("always-on-top"),J("always-on-top-on"),J("application"),J("arrow-down-long"),J("arrow-down-to-bracket"),J("arrow-left-long"),J("arrow-right-from-bracket"),J("arrow-right-long"),J("arrow-right"),J("arrow-up"),J("arrow-up-long"),J("ban"),J("bell"),J("bell-solid"),J("bookmark"),J("bullseye-pointer"),J("certificate"),J("check"),J("check-light"),J("check-solid"),J("chevron-down"),J("chevron-left"),J("chevron-right"),J("chevron-up"),J("circle-info"),J("circle-xmark"),J("circle-xmark-full"),J("clock"),J("clock-rotate-left"),J("clone"),J("close"),J("cog"),J("cog-solid"),J("collapse"),J("copy"),J("download"),J("delete-left"),J("dev-tools"),J("ellipsis"),J("ellipsis-vertical"),J("expand"),J("envelope"),J("envelope-open"),J("exclamation-mark"),J("expand"),J("feedback"),J("filter"),J("floppy"),J("floppy-disk-pen"),J("folder"),J("folder-open"),J("globe"),J("group"),J("hidden"),J("home"),J("house"),J("info"),J("keyboard"),J("layout"),J("link"),J("list-ul"),J("lock"),J("logo"),J("minimize"),J("minimize-down"),J("paper-plane-top"),J("paperclip"),J("pause"),J("pen-line"),J("pen-to-square"),J("pin"),J("play"),J("pop-in"),J("pop-in-widget"),J("pop-out"),J("power-off"),J("publish"),J("refresh"),J("resize"),J("restore"),J("rotate-right"),J("search"),J("search-filled"),J("sleep"),J("sliders"),J("snooze"),J("spinner"),J("square"),J("square-arrow-down"),J("square-arrow-up"),J("star"),J("star-full"),J("sticky-off"),J("sticky-off-hover"),J("sticky-on"),J("sticky-on-hover"),J("subscribe"),J("system-close"),J("system-maximize"),J("system-minimize"),J("thumbs-down"),J("thumbs-up"),J("trash"),J("trash-can"),J("triangle-exclamation"),J("unlock"),J("unpin"),J("up-to-line"),J("user"),J("user-gear"),J("visible"),J("workspace")),p2=Nd({id:ao,title:ao,description:De(Pd()),icon:De(h2),iconSrc:De(ao),contextMenuActions:De(fs(ov())),type:ao}),m2=Nd({name:ao,type:ao}),g2=Sc(J("Left"),J("Right")),Mh=Sc(J("daily"),J("weekly")),$h=Sc(J("Sunday"),J("Monday"),J("Tuesday"),J("Wednesday"),J("Thursday"),J("Friday"),J("Saturday")),hs=Nd({customPrefs:De(ov()),_launchpad_collapsedSections:De(fs(ao)),_launchpad_favorites:De(fs(p2)),_launchpad_recent:De(fs(m2)),_launchpad_isLayoutsPanelOpen:De(ft()),_launchpad_isCollapsed:De(ft()),_launchpad_isPinned:De(ft()),_launchpad_isDocked:De(ft()),_launchpad_minimizeToTray:De(ft()),_launchpad_autoCloseStartingAppsAndWorkspaces:De(ft()),_launchpad_pinnedPosition:De(g2),_launchpad_allowDocking:De(ft()),_launchpad_dockedAlwaysOnTop:De(ft()),_launchpad_dockedClaimsSpace:De(ft()),_launchpad_showExtendedArea:De(ft()),_launchpad_hideLabelsInExtendedArea:De(ft()),_launchpad_showFavoritesInExtendedArea:De(ft()),_launchpad_hideFavoritesSection:De(ft()),_launchpad_showRecentAppsInExtendedArea:De(ft()),_layouts_restoreLastSaved:De(ft()),_layouts_saveCurrentOnExit:De(ft()),_layouts_showUnsavedChangesPrompt:De(ft()),_layouts_showDeletePrompt:De(ft()),_downloads_askForEachDownload:De(ft()),_downloads_location:De(Pd()),_system_scheduleRestart:De(ft()),_system_scheduleRestartTime:De(ao),_system_scheduleRestartFrequency:De(Mh),_system_scheduleRestartDay:De($h),_system_scheduleShutdown:De(ft()),_system_scheduleShutdownTime:De(ao),_system_scheduleShutdownFrequency:De(Mh),_system_scheduleShutdownDay:De($h)}),rv=async e=>{const{io:t,variant:n,text:o,error:r}=e,i=hr(r);try{if(n===Od&&t.logger.warn(i?`${o} ${i}`:o),!("modals"in t)||!t.modals)throw new Error("Modals are not enabled.");const a={text:o,variant:n,ttl:f2[n]};await t.modals.alerts.request(a)}catch(a){console.warn("Failed to request alert. ",{error:a})}},Id=v.createContext(void 0),kc=({children:e,launchpadMode:t})=>{const[n,o]=v.useState(),[r,i]=v.useState(!1),[a,s]=v.useState(),c=v.useContext(Ie.IOConnectContext),l=v.useMemo(()=>({prefs:n,isInitialSetupCompleted:r,initialSetupError:a}),[n,r,a]);return v.useEffect(()=>{if(!c)return;let d=!1;const f=c.contexts.subscribe(fr,h=>{if(d)return;const p=hs.run(h);if(!p.ok)return void c.logger.warn(`The received data for context ${fr} is with an invalid shape: ${hr(p.error.message)}`);const m=p.result;o(m),c.prefs.updateFor(Lh,m).catch(g=>{c.logger.warn(`Failed to update platform prefs. Error: ${hr(g)}`)})});return()=>{d=!0,f.then(h=>{h()})}},[c]),v.useEffect(()=>{c&&(async()=>{var d;try{const f=await c.contexts.get(fr),h=hs.run(f);if(!h.ok)throw new Error(`The data in context ${fr} is with an invalid shape: ${hr(h.error.message)}`);const p=h.result;if(Object.keys(p).length>0)return;const m=((d=await c.prefs.get(Lh))==null?void 0:d.data)??{},g=hs.run(m);if(!g.ok)throw new Error(`The stored platform prefs in io.prefs are with an invalid shape: ${hr(g.error.message)}`);const y={[wu]:t==="pinned"||(m[wu]??!1),[bu]:t==="docked"||(m[bu]??!1)},w={...d2,...g.result,...y};await c.contexts.set(fr,w)}catch(f){s({message:hr(f)}),await rv({io:c,variant:Od,text:"Initial platform prefs setup failed.",error:f})}finally{i(!0)}})().catch(console.error)},[c,t]),u.jsx(Id.Provider,{value:l,children:e})};function iv(){const e=v.useContext(Id);if(e===void 0)throw new Error("usePlatformPrefs must be used within a PlatformPrefsProvider");return e}function Tt({prefKey:e}){var f;const t=v.useContext(Ie.IOConnectContext),n=v.useContext(Id),o=(f=n==null?void 0:n.prefs)==null?void 0:f[e],r=(n==null?void 0:n.isInitialSetupCompleted)??!1,[i,a]=v.useState(!r),[s,c]=v.useState(),l=v.useRef(0);v.useEffect(()=>{r&&l.current===0&&a(!1)},[r]);const d=v.useCallback(async h=>{if(!t)return;const p=++l.current;a(!0),c(void 0);const m=async y=>{y&&await rv({io:t,variant:Od,text:`Failed to update prefKey "${e}".`,error:y}),p===l.current&&(a(!1),y&&c({message:hr(y)}))};let g;if(h instanceof Function)try{g=h((await t.contexts.get(fr))[e])}catch(y){return m(y)}else g=h;try{const y=hs.runWithException({[e]:g});await t.contexts.update(fr,y)}catch(y){return m(y)}await m()},[t,e]);if(n===void 0)throw new Error("usePlatformPref must be used within a PlatformPrefsProvider");return{error:s,isLoading:i,update:d,value:o}}const v2="var(--io-neutrals-0)",hl="var(--io-neutrals-900)";function av(e){var r;let t,n,o;if(e.startsWith("#")){let i=e.slice(1);i.length===3&&(i=i.split("").map(a=>a+a).join("")),t=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16)}else{if(!e.startsWith("rgb")){const i=document.createElement("canvas").getContext("2d");return i?(i.fillStyle=e,av(i.fillStyle)):hl}{const i=(r=e.match(/\d+/g))==null?void 0:r.map(Number);if(!i||i.length<3)return hl;[t,n,o]=i}}return(.2126*t+.7152*n+.0722*o)/255>.5?hl:v2}function y2({className:e,channel:t,...n}){const o=oe("io-channel-badge",e),r=v.useMemo(()=>av(t.color),[t.color]);return u.jsx("div",{className:o,style:{color:r,backgroundColor:t.color},"data-testid":`channel-selector-badge-${t.color}`,...n,children:u.jsx("span",{className:"io-channel-selector-badge-label","data-testid":"channel-selector-label",children:t.label})})}function w2(){return u.jsx(kt,{variant:"check","data-testid":"channel-selector-channel-selected"})}function b2({channel:e,handleChannelRestricted:t,lockedChannelRestriction:n}){const o=(r,i)=>a=>{a.stopPropagation(),Go(a)&&(a.preventDefault(),i||t({...e,[r]:!e[r]}))};return u.jsxs(u.Fragment,{children:[u.jsx("div",{children:e.isSelected&&u.jsx("span",{"data-testid":"channel-selector-channel-selected",children:"Active"})}),u.jsx("div",{role:"button",onClick:r=>r.stopPropagation(),"data-testid":"channel-selector-publish-toggle-container",children:u.jsx(Ct,{label:"Publish",checked:e.write,onChange:()=>{t({...e,write:!e.write})},onKeyDown:o("write",!e.isSelected||(n==null?void 0:n.write)),onClick:r=>r.stopPropagation(),disabled:!e.isSelected||(n==null?void 0:n.write)})}),u.jsx("div",{role:"button",onClick:r=>r.stopPropagation(),"data-testid":"channel-selector-subscribe-toggle-container",children:u.jsx(Ct,{label:"Subscribe",checked:e.read,onChange:()=>{t({...e,read:!e.read})},onKeyDown:o("read",!e.isSelected||(n==null?void 0:n.read)),disabled:!e.isSelected||(n==null?void 0:n.read)})})]})}const sv=v.createContext({});function x2({channel:e,isSelected:t,onChannelSelect:n,onChannelRestrict:o,...r}){const{variant:i,selectedChannels:a,lockedChannelRestrictions:s}=v.useContext(sv),c=t||e.isSelected||(a==null?void 0:a.includes(e)),l=s==null?void 0:s.find(p=>p.name===e.name),d=v.useCallback(()=>n==null?void 0:n({...e,isSelected:!c}),[e,n,c]),f=v.useCallback(p=>{const m=p.target;m.closest(".io-toggle")||m.classList.contains("io-toggle")||Go(p)&&(p.preventDefault(),n==null||n({...e,isSelected:!c}))},[e,n,c]),h=v.useCallback(p=>{o==null||o(p)},[o]);return u.jsx(tc,{prepend:u.jsx(y2,{channel:e}),append:i==="single"||i==="multi"?c&&u.jsx(w2,{}):u.jsx(b2,{channel:e,handleChannelRestricted:h,lockedChannelRestriction:l}),isSelected:c,onClick:d,onKeyDown:f,...r,children:e.name},e.name)}function S2({variant:e,onVariantChange:t,disabled:n=!1}){const o=e==="directionalSingle"||e==="directionalMulti",r=v.useCallback(()=>{t==null||t(!o)},[o,t]),i=v.useCallback(s=>{s.stopPropagation()},[]),a=v.useCallback(s=>{s.stopPropagation(),Go(s)&&(s.preventDefault(),n||r())},[n,r]);return u.jsx(Ct,{label:"Directional",align:"right",checked:o,onChange:r,onClick:i,onKeyDown:a,disabled:n,"data-testid":`channel-selector-toggle-${e}`})}const k2=v.forwardRef(({className:e,variant:t="single",variantToggle:n=!1,channels:o=[],lockedChannelRestrictions:r=[],onVariantChange:i,onChannelSelect:a,onChannelRestrict:s,...c},l)=>{const d=oe("io-list-channels","io-channel-selector-panel",(t==="directionalSingle"||t==="directionalMulti")&&"io-list-channels-directional io-channel-selector-panel-directional",e),f=v.useMemo(()=>({variant:t,selectedChannels:o.filter(h=>h.isSelected),lockedChannelRestrictions:r,onVariantChange:i,onChannelSelect:a,onChannelRestrict:s}),[o,t,r,i,a,s]);return u.jsx(sv.Provider,{value:f,children:u.jsx("div",{className:d,ref:l,children:u.jsxs(gt,{...c,children:[u.jsx(gt.ItemTitle,{"data-testid":"channel-selector-title",append:n&&u.jsx(S2,{variant:t,onVariantChange:i}),children:{single:"Select Channel",directionalSingle:"Select Directional Channel",multi:"Select Channels",directionalMulti:"Select Directional Channels"}[t]}),o==null?void 0:o.map(h=>u.jsx(x2,{channel:h,isSelected:h.isSelected,onChannelSelect:a,onChannelRestrict:s,"data-testid":`channel-selector-channel-${h.name}`},h.name))]})})})});k2.displayName="ChannelSelector";const C2=v.forwardRef(({className:e,title:t,ariaLabel:n,onClick:o,onKeyDown:r,children:i,disabled:a=!1,...s},c)=>u.jsx("div",{ref:c,className:oe(e,{disabled:a}),title:t,role:"button",tabIndex:a?-1:0,"aria-label":n,"aria-disabled":a,onClick:l=>{!a&&o&&o(l)},onKeyDown:l=>{!a&&r&&r(l)},...s,children:i}));C2.displayName="ChannelSelectorButtonWrapper";v.createContext({config:{message:""},theme:"dark",setResult:()=>{}});function cv({title:e="Downloads"}){const{ItemSearch:t,HeaderButtons:n}=wa();return u.jsxs("div",{className:"io-dm-header",children:[u.jsxs(nn,{draggable:!0,children:[u.jsx(nn.Title,{tag:"h1",text:e,size:"large"}),u.jsx(n,{className:"non-draggable"})]}),u.jsx(t,{})]})}const en=window.glue42gd,lv=v.createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),lo=()=>v.useContext(lv);function uv({className:e,placeholder:t="Search",iconPrepend:n="search",iconAppend:o="close",...r}){const i=oe("io-header-search",e),a=v.useRef(null),{searchQuery:s,setSearch:c,itemsCount:l}=lo(),d=s.length>0,f=v.useCallback(()=>{c(""),a.current&&a.current.focus()},[c]);return u.jsxs("div",{className:i,children:[u.jsx(Cr,{ref:a,value:s,iconPrepend:n,iconAppend:d?o:void 0,iconAppendOnClick:d?f:void 0,placeholder:t,onChange:h=>c(h.target.value),...r}),d&&u.jsx("p",{className:"io-header-search-count",children:`${l} results`})]})}function dv({className:e,...t}){const{MoreButton:n,CloseButton:o,ExternalButton:r}=wa();return u.jsxs(We,{className:e,align:"right",...t,children:[u.jsx(n,{}),u.jsx(r,{}),u.jsx(o,{})]})}function fv({icon:e="ellipsis-vertical",...t}){const{items:n,clearItems:o,showSettings:r}=lo(),i=n.length===0;return u.jsxs(fe,{variant:"light",...t,children:[u.jsx(fe.ButtonIcon,{icon:e,variant:"circle",size:"32"}),u.jsx(fe.Content,{children:u.jsxs(fe.List,{children:[u.jsx(fe.Item,{onClick:a=>(s=>{i?s.stopPropagation():o()})(a),disabled:i,children:"Clear All"}),u.jsx(fe.Item,{onClick:r,children:"Settings"})]})})]})}function hv({className:e,icon:t="pop-out",...n}){const o=v.useContext(Ie.IOConnectContext),r=v.useCallback(()=>{To.startApplication(o,"io-connect-download-manager").catch(i=>{console.error("Failed to open Download Manager",i)})},[o]);return u.jsx(Ue,{className:oe("io-dm-compact-mode-only",e),icon:t,variant:"circle",size:"32",onClick:r,...n})}function pv({icon:e="close",size:t="32",variant:n="circle",onClick:o,...r}){const i=v.useContext(Ie.IOConnectContext);return u.jsx(Ue,{icon:e,size:t,variant:n,onClick:a=>{o?o(a):Zx.closeWindow(i).catch(s=>{console.error("Failed to close window:",s)})},...r})}function Lr(e,t=!1,n=!1,o=!1){const r=e.getDate(),i=["January","February","March","April","May","June","July","August","September","October","November","December"][e.getMonth()],a=e.getFullYear(),s=e.getHours(),c=e.getMinutes();let l="";return l=c<10?`0${c}`:`${c}`,t?t==="Today"?n?"Today":`Today at ${s}:${l}`:t==="Yesterday"?n?"Yesterday":`Yesterday at ${s}:${l}`:`${s}:${l}`:o?n?`${i} ${r}`:`${i} ${r} at ${s}:${l}`:n?`${i} ${r}, ${a}`:`${i} ${r}, ${a} at ${s}:${l}`}function mv(e,t={showTime:!0}){const n=new Date(1e3*e),o=new Date,r=Math.round((o-n)/1e3),i=Math.round(r/60),a=o.toDateString()===n.toDateString(),s=new Date(o.setDate(o.getDate()-1)).toDateString()===n.toDateString(),c=o.getFullYear()===n.getFullYear();return t.showTime?r<5?"Just Now":r<60?`${r} seconds ago`:r<90?"about a minute ago":i<60?`${i} minutes ago`:a?Lr(n,"Today",!1,!0):s?Lr(n,"Yesterday",!1,!0):c?Lr(n,!1,!1,!0):Lr(n):a?"Today":s?"Yesterday":c?Lr(n,!1,!0,!0):Lr(n,!1,!0)}function gv({className:e,...t}){const n=oe("io-dm-body","io-panel-body",e),{DownloadListEmpty:o,ItemGroup:r,Item:i}=wa(),{items:a,searchQuery:s,setCount:c,sortItems:l}=lo(),d=l(a),f=Fg(s),h=v.useMemo(()=>d.filter(g=>g.displayInfo.filename.toLowerCase().includes(f.toLowerCase())||g.displayInfo.url.toLowerCase().includes(f.toLowerCase())),[d,f]),p=v.useMemo(()=>h.map(g=>({...g,displayInfo:{...g.displayInfo,startTime:mv(g.displayInfo.startTime,{showTime:!1})}})),[h]),m=v.useMemo(()=>Object.values(p.reduce((g={},y)=>{var w;return g[y.displayInfo.startTime]=((w=g[y.displayInfo.startTime])==null?void 0:w.concat([]))??[],g[y.displayInfo.startTime].push(y),g},{})),[p]);return v.useEffect(()=>{c(h.length)},[h,c]),u.jsx(Jo,{elementProps:{className:n,...t},children:m&&m.length!==0?m.map(g=>u.jsx(r,{title:String(g[0].displayInfo.startTime)??null,children:g.map(y=>u.jsx(i,{item:y},y.id))},g[0].id??"")):u.jsx(o,{})})}function vv({className:e,icon:t="download",text:n="No downloads to display.",...o}){const r=oe("io-dm-no-items",e);return u.jsxs("div",{className:r,...o,children:[u.jsx(kt,{variant:t}),u.jsx("p",{children:n})]})}function yv({className:e,title:t,children:n,...o}){const r=oe("io-dm-item-group",e);return u.jsxs("div",{className:r,...o,children:[t&&u.jsx("p",{className:"io-dm-items-group-title",children:t}),n]})}function wv({className:e,item:t,...n}){const{ItemHeader:o,ItemBody:r,ItemFooter:i}=wa(),{state:a,url:s,filename:c,receivedBytes:l,totalBytes:d,speed:f,timeRemaining:h}=t.displayInfo;if(!t)return u.jsx(u.Fragment,{});const p=oe("io-dm-item",t.displayInfo.state&&[a],e);return u.jsxs("div",{className:p,...n,children:[u.jsx(o,{itemID:t.id,filename:c,state:a}),u.jsx(r,{state:a,url:s,bytesReceived:l,bytesTotal:d,speed:f,timeRemaining:h}),u.jsx(i,{itemID:t.id,state:a})]})}function Td({bytesReceived:e=0,bytesTotal:t=0,...n}){const o=v.useCallback(()=>e&&t?Math.round(e/t*100):0,[e,t]);return u.jsx(lx,{value:o(),...n})}function bv({className:e,itemID:t,filename:n,state:o,pauseResume:r,showInFolder:i,cancel:a,remove:s,...c}){const l=oe("io-dm-item-header",e),{pauseResumeItem:d,showItemInFolder:f,cancelItem:h,removeItem:p}=lo(),m=o==="progressing"||o==="paused",g=o==="interrupted"||o==="cancelled",y=m?"Cancel Download":"Remove Download",w=a??h,k=s??p,b=function(x,C,T,L){return x==="paused"||x==="progressing"?{statusIcon:x==="paused"?"play":"pause",onStatusActionClick:()=>T(C)}:x==="completed"?{statusIcon:"folder",onStatusActionClick:()=>L(C)}:null}(o,t,r??d,i??f),S=v.useCallback(()=>{m?w(t):k(t)},[m,w,t,k]);return u.jsxs("div",{className:l,...c,children:[u.jsx(zn,{text:n,style:{textDecoration:g?"line-through":"none"}}),u.jsxs(We,{children:[b&&u.jsx(Ue,{icon:b.statusIcon,iconSize:"12",onClick:b.onStatusActionClick,className:"io-dm-compact-mode-only"}),u.jsx(Ue,{icon:"close",iconSize:"12",title:y,onClick:S})]})]})}function xv({className:e,state:t,url:n,bytesReceived:o=0,bytesTotal:r=0,speed:i=0,timeRemaining:a=0,...s}){const c=oe("io-dm-item-body",e),l=h=>{const p=["Bytes","KB","MB","GB","TB"];if(h===0)return"0";const m=Math.floor(Math.log(h)/Math.log(1024));return m===0?`${h}${p[m]}`:`${(h/1024**m).toFixed(1)}${p[m]}`};return u.jsxs("div",{className:c,...s,children:[u.jsx("p",{className:"io-text-small",children:n}),(f=t,f==="cancelled"||f==="interrupted"||f==="completed"?null:u.jsx(Td,{variant:f==="paused"?"paused":"active",bytesReceived:o,bytesTotal:r})),u.jsx("p",{className:"io-text-default-lh16",children:t==="completed"?`${l(o??0)} - Done`:t==="cancelled"||t==="interrupted"?`${l(o??0)}/${l(r??0)} - Failed`:`${l(o??0)}/${l(r??0)} (${d=i,(d?`${(d/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(h=>{const p=Math.floor(h/3600),m=Math.floor(h%3600/60);let g="";return p>0&&(g+=`${p} hour${p>1?"s":""}, `),m>0&&(g+=`${m} min${m>1?"s":""}, `),((h=Math.floor(h%60))>0||g==="")&&(g+=`${h} sec${h===1?"":"s"}`),`${g.trim()} left`})(a)??0}`})]});var d,f}const E2={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function pl({className:e,variant:t,text:n}){const o=oe("io-dm-item-status",`io-dm-item-status-${t}`,e);return u.jsxs("div",{className:o,children:[t&&u.jsx(kt,{variant:E2[t],className:"icon-severity",size:"10"}),n&&u.jsx("p",{className:"io-text-smaller",children:n})]})}function Sv({className:e,itemID:t,state:n,pauseResume:o,showInFolder:r,cancel:i,...a}){const s=oe("io-dm-item-footer",e),{pauseResumeItem:c,showItemInFolder:l,cancelItem:d}=lo(),f=v.useCallback(m=>{o?o(m):c(m)},[o,c]),h=v.useCallback(m=>{r?r(m):l(m)},[r,l]),p=v.useCallback(m=>{i?i(m):d(m)},[i,d]);return u.jsx("div",{className:s,...a,children:(()=>{switch(n){case"progressing":return u.jsxs(We,{align:"right",children:[u.jsx(We.Button,{variant:"primary",text:"Pause",onClick:()=>f(t)}),u.jsx(We.Button,{variant:"link",text:"Cancel",onClick:()=>p(t)})]});case"paused":return u.jsx(We,{align:"right",children:u.jsx(We.Button,{variant:"primary",text:"Resume",onClick:()=>f(t)})});case"completed":return u.jsxs(u.Fragment,{children:[u.jsx(pl,{variant:"success",text:"Complete"}),u.jsx(We,{align:"right",children:u.jsx(We.Button,{variant:"primary",text:"Show in Folder",onClick:()=>h(t)})})]});case"cancelled":return u.jsx(pl,{variant:"warning",text:"Cancelled"});case"interrupted":return u.jsxs(u.Fragment,{children:[u.jsx(pl,{variant:"critical",text:"Failed"}),u.jsx(We,{align:"right",children:u.jsx(We.Button,{variant:"primary",text:"Retry",onClick:()=>f(t)})})]});default:return null}})()})}function kv({className:e,title:t="Download Settings",...n}){const o=oe("io-dm-settings-panel",e),{configuration:{downloadFolder:r},hideSettings:i,setDownloadLocation:a,setDownloadLocationWithDialog:s,isDownloadLocationDialogVisible:c,downloadLocationList:l}=lo();return u.jsxs(Xe,{className:o,...n,children:[u.jsxs(Xe.Header,{children:[u.jsx(Xe.Header.Title,{size:"large",text:t,tag:"h1"}),u.jsx(Xe.Header.ButtonGroup,{children:u.jsx(Ue,{className:"non-draggable",variant:"circle",icon:"close",size:"32",onClick:()=>{i()},disabled:c})})]}),u.jsx(Xe.Body,{children:u.jsxs(We,{children:[u.jsxs(fe,{variant:"light",disabled:c,children:[u.jsx(fe.Button,{children:u.jsx("span",{className:"io-dm-settings-panel-download-location",children:r??l[0]})}),l.length>1&&u.jsx(fe.Content,{children:u.jsx(fe.List,{children:l.map((d,f)=>!d||f===0||f>3?null:u.jsx(fe.Item,{onClick:()=>{a(d)},children:d},d))})})]}),u.jsx(Qe,{className:"io-btn io-dm-settings-panel-download-location-btn",text:"Browse",onClick:()=>{s()},disabled:c})]})})]})}const Cv={Header:cv,ItemSearch:uv,HeaderButtons:dv,MoreButton:fv,ExternalButton:hv,CloseButton:pv,Body:gv,DownloadListEmpty:vv,ItemGroup:yv,Item:wv,ItemProgress:Td,ItemHeader:bv,ItemBody:xv,ItemFooter:Sv,Settings:kv},Ev=v.createContext(Cv),Av=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...Cv,...t}),[t]);return u.jsx(Ev.Provider,{value:n,children:e})});Av.displayName="ComponentsStore";const wa=()=>v.useContext(Ev);function A2({className:e,...t}){const n=oe("io-dm",e),{Header:o,Body:r,Settings:i}=wa(),{isSettingsVisible:a}=lo();return u.jsxs(Xe,{className:n,...t,children:[u.jsx(o,{}),u.jsx(r,{}),a&&u.jsx(i,{})]})}var _2=Object.freeze({__proto__:null,Body:gv,CloseButton:pv,DownloadListEmpty:vv,DownloadManager:function({components:e,...t}){return u.jsx(Av,{components:e,children:u.jsx(A2,{...t})})},DownloadManagerProvider:({children:e})=>{const{configuration:t,items:n,removeItem:o,pauseResumeItem:r,cancelItem:i,clearItems:a,showItemInFolder:s,isSettingsVisible:c,showSettings:l,hideSettings:d,searchQuery:f,setSearch:h,itemsCount:p,setCount:m,setDownloadLocation:g,setDownloadLocationWithDialog:y,sortItems:w,isDownloadLocationDialogVisible:k,downloadLocationList:b}=function(){const[x,C]=v.useState({}),[T,L]=v.useState([]),[M,j]=v.useState(0),[N,O]=v.useState([]),[Y,z]=v.useState(""),[R,$]=v.useState(!1),[H,K]=v.useState(!1),[B,D]=v.useState({filePaths:[],canceled:!1});v.useEffect(()=>{if(!en)return;const G=en.downloads.onUpdate(I=>L(E=>V(E,I))),Z=en.downloads.onConfigurationChanged(I=>{C(I)});return en.downloads.list().then(L).catch(console.error),en.downloads.getSavePathList().then(I=>{I.pathList&&O(I.pathList)}).catch(console.error),()=>{G(),Z()}},[]),v.useEffect(()=>{K(!1)},[B]);const V=(G,Z)=>{const I=G.findIndex(A=>A.id===Z.id);if(I===-1)return[Z,...G];const E=[...G];return E[I]=Z,E};return{items:T,setCount:G=>{j(G)},sortItems:(G,Z=!0)=>G.sort((I,E)=>Z?I.displayInfo.startTime<E.displayInfo.startTime?1:-1:I.displayInfo.startTime>E.displayInfo.startTime?1:-1),setSearch:G=>{z(G)},cancelItem:async G=>{try{await en.downloads.cancel(G)}catch(Z){console.error(Z)}},removeItem:async G=>{try{L(Z=>Z.filter(I=>I.id!==G)),await en.downloads.removeItem(G)}catch(Z){console.error(Z)}},clearItems:async()=>{try{L([]),await en.downloads.clearDownloadList()}catch(G){console.error(G)}},itemsCount:M,searchQuery:Y,showSettings:()=>{$(!0)},hideSettings:()=>{$(!1)},configuration:x,isSettingsVisible:R,pauseResumeItem:async G=>{try{await en.downloads.pauseResume(G)}catch(Z){console.error(Z)}},showItemInFolder:async G=>{try{await en.downloads.showInFolder(G)}catch(Z){console.error(Z)}},setDownloadLocation:async G=>{try{await en.downloads.setSavePath(G),O(Z=>{if(Z.includes(G)){const I=Z.filter(E=>E!==G);return[G,...I]}return[G,...Z]})}catch(Z){console.error(Z)}},downloadLocationList:N,isDownloadLocationDialogVisible:H,setDownloadLocationWithDialog:async()=>{K(!0);try{const G=await en.downloads.showOpenDialog();if(D(G),!(G!=null&&G.filePaths)||G.filePaths.length===0)return;await en.downloads.setSavePath(G.filePaths[0]),O(Z=>{if(Z.includes(G.filePaths[0])){const I=Z.filter(E=>E!==G.filePaths[0]);return[G.filePaths[0],...I]}return[G.filePaths[0],...Z]})}catch(G){console.error(G)}}}}(),S=v.useMemo(()=>({configuration:t,items:n,removeItem:o,pauseResumeItem:r,cancelItem:i,clearItems:a,showItemInFolder:s,isSettingsVisible:c,showSettings:l,hideSettings:d,searchQuery:f,setSearch:h,itemsCount:p,setCount:m,setDownloadLocation:g,setDownloadLocationWithDialog:y,sortItems:w,isDownloadLocationDialogVisible:k,downloadLocationList:b}),[t,n,o,r,i,s,a,c,l,d,f,h,p,m,g,y,w,k,b]);return u.jsx(lv.Provider,{value:S,children:e})},ExternalButton:hv,Header:cv,HeaderButtons:dv,Item:wv,ItemBody:xv,ItemFooter:Sv,ItemGroup:yv,ItemHeader:bv,ItemProgress:Td,ItemSearch:uv,MoreButton:fv,Settings:kv,useDownloadManagerContext:lo});function ku(e){if(e&&e.errorHandling&&typeof e.errorHandling!="function"&&e.errorHandling!=="log"&&e.errorHandling!=="silent"&&e.errorHandling!=="throw")throw new Error('Invalid options passed to createRegistry. Prop errorHandling should be ["log" | "silent" | "throw" | (err) => void], but '+typeof e.errorHandling+" was passed");var t=e&&typeof e.errorHandling=="function"&&e.errorHandling,n={};function o(r,i){var a=r instanceof Error?r:new Error(r);if(t)t(a);else{var s='[ERROR] callback-registry: User callback for key "'+i+'" failed: '+a.stack;if(e)switch(e.errorHandling){case"log":return console.error(s);case"silent":return;case"throw":throw new Error(s)}console.error(s)}}return{add:function(r,i,a){var s=n[r];return s||(s=[],n[r]=s),s.push(i),a&&setTimeout(function(){a.forEach(function(c){var l;if(!((l=n[r])===null||l===void 0)&&l.includes(i))try{Array.isArray(c)?i.apply(void 0,c):i.apply(void 0,[c])}catch(d){o(d,r)}})},0),function(){var c=n[r];c&&(c=c.reduce(function(l,d,f){return d===i&&l.length===f||l.push(d),l},[]),c.length===0?delete n[r]:n[r]=c)}},execute:function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var s=n[r];if(!s||s.length===0)return[];var c=[];return s.forEach(function(l){try{var d=l.apply(void 0,i);c.push(d)}catch(f){c.push(void 0),o(f,r)}}),c},clear:function(){n={}},clearKey:function(r){n[r]&&delete n[r]}}}ku.default=ku;var j2=im(ku);const O2={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"},P2=v.createContext({config:O2,onThemeChanged:()=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:()=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),In=()=>v.useContext(P2);function N2({...e}){const{config:t,close:n}=In(),{applicationTitle:o}=t;return u.jsxs(nn,{draggable:!0,...e,children:[u.jsx(nn.Title,{tag:"h1",text:o?`Feedback Form - ${o}`:"Feedback Form",size:"large"}),u.jsx(nn.ButtonGroup,{className:"non-draggable",children:u.jsx(nn.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>n()})})]})}function I2({className:e,handleSubmit:t,...n}){const o=oe("io-panel-body",e),{config:r,submitFeedback:i}=In(),{IntroField:a,DescriptionField:s,TechInfoField:c,EnvInfoField:l,FileAttachmentsField:d,CategoryAttachmentsField:f,MailListField:h}=Cc(),p=t??i,m=`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 u.jsxs("form",{className:o,id:"feedback",onSubmit:p,...n,children:[u.jsx(a,{children:u.jsx("p",{children:m})}),u.jsx(h,{}),u.jsx(s,{}),u.jsx(c,{readOnly:!0}),u.jsx(l,{readOnly:!0}),r.attachmentsViewMode==="file"?u.jsx(d,{}):u.jsx(f,{})]})}function T2({...e}){const{FooterButtons:t}=Cc(),{openUrl:n,submitInProgress:o,submitStatus:r,jiraTicketURL:i}=In();return u.jsx(mr,{...e,children:u.jsxs("div",o?{className:"flex ai-center jc-between",children:[u.jsx(et,{children:u.jsx("p",{children:r.title})}),u.jsx(cx,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[u.jsxs(et,{children:[u.jsx("p",{className:r.type==="error"?"io-text-error":"",children:r.title}),i&&u.jsx("a",{href:i,onClick:a=>{a.preventDefault(),n(i)},children:i})]}),u.jsx(t,{})]})})}function R2({className:e,...t}){const{CloseButton:n}=Cc(),{close:o}=In(),r=oe("non-draggable",e);return u.jsx(We,{className:r,...t,children:u.jsx(n,{onClick:()=>o()})})}function L2({className:e,...t}){const{SubmitButton:n,CancelButton:o,CloseButton:r}=Cc(),{close:i,submitCompleted:a}=In();return a?u.jsx(We,{className:e,...t,children:u.jsx(r,{text:"Close",onClick:()=>i()})}):u.jsxs(We,{className:e,...t,children:[u.jsx(n,{}),u.jsx(o,{onClick:()=>i()})]})}function D2({text:e="Submit",...t}){return u.jsx(Qe,{form:"feedback",type:"submit",variant:"primary",text:e,...t})}function M2({text:e="Cancel",...t}){return u.jsx(Qe,{variant:"link",text:e,...t})}function $2({...e}){return u.jsx(Qe,{variant:"primary",...e})}function H2({showField:e=!0,className:t,title:n,hint:o,children:r,...i}){return e?u.jsx(et,{className:t,title:n,hint:o,...i,children:r}):null}function W2({showField:e=!0,className:t,title:n="Description",hint:o,readOnly:r=!1,disabled:i,...a}){return e?u.jsx(et,{className:t,hint:o,title:"",...a,children:u.jsx(wc,{id:"description",name:"description",label:n,readOnly:r,disabled:i})}):null}function F2({showField:e,className:t,title:n="Technical Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...s}){const{config:c}=In(),l=e??c.errorMessage,d=r??c.errorMessage;return l&&d?u.jsx(et,{className:t,hint:o,...s,children:u.jsx(wc,{id:"errorMessage",name:"errorMessage",label:n,value:d,readOnly:i,disabled:a})}):null}function B2({showField:e,className:t,title:n="Environment Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...s}){const{config:c}=In(),l=e??c.showEnvironmentInfo,d=r??c.environmentInfo;return l&&d?u.jsx(et,{className:t,hint:o,...s,children:u.jsx(wc,{id:"environmentInfo",name:"environmentInfo",label:n,value:d,readOnly:i,disabled:a})}):null}function z2({showField:e=!0,className:t,title:n="Attachments",hint:o,readOnly:r=!1,disabled:i,attachments:a,selectedCategories:s,...c}){const l=oe("io-block-list-gap",t),{config:d}=In(),f=a??d.attachments,h=s??d.selectedCategories,p=v.useCallback(m=>!!h&&h.indexOf(m)!==-1,[h]);return e?!f||f.length<=0?u.jsx(et,{title:"Attachments",children:u.jsx("p",{children:"No Attachments"})}):u.jsx(et,{className:l,title:n,hint:o,...c,children:u.jsx("div",{className:"file-attachments",children:f.map(m=>u.jsx(bc,{id:m.id,name:m.id,label:m.name,readOnly:r,disabled:i,defaultChecked:p(m.category)},m.id))})}):null}function U2({showField:e=!0,className:t,title:n="Attachments",hint:o,readOnly:r=!1,disabled:i,categories:a,selectedCategories:s,...c}){const{config:l,attachmentCategories:d}=In(),f=a??d,h=s??l.selectedCategories,p=v.useCallback(m=>!!h&&h.indexOf(m)!==-1,[h]);return e?!f||f.length<=0?u.jsx("p",{children:"No Attachments"}):u.jsx(et,{className:t,title:n,hint:o,...c,children:u.jsx("div",{className:"category-attachments",children:f.map(m=>u.jsx(Ct,{id:m,name:m,align:"right",label:m,readOnly:r,disabled:i,defaultChecked:p(m)},m))})}):null}function K2({className:e,title:t,hint:n,showField:o=!0,showJiraTicketField:r,jiraTicketLabel:i="Create Jira Ticket",showSendEmailField:a,sendEmailLabel:s="Send Email",readOnly:c=!1,disabled:l,...d}){const f=oe("io-block-list-gap",e),{config:h,showMailingList:p,setShowMailingList:m}=In();if(!o)return null;const g=r??h.createJiraTicket,y=a??h.sendEmail;return u.jsxs(et,{className:f,hint:n,title:t,...d,children:[g&&u.jsx(Ct,{id:"createJiraTicket",name:"createJiraTicket",label:i,align:"right",readOnly:c,disabled:l,defaultChecked:g}),y&&u.jsx(Ct,{onChange:()=>{m(!p)},id:"sendEmail",name:"sendEmail",label:s,align:"right",readOnly:c,disabled:l,defaultChecked:y})]})}function V2({showField:e=!0,className:t,title:n="Email List",hint:o="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:i,disabled:a,...s}){const{config:c,showMailingList:l}=In(),d=e??c.sendEmail,f=i??c.allowEditRecipients===!1;return d&&l?u.jsx(et,{className:t,hint:o,...s,children:u.jsx(Cr,{id:"mailingList",name:"mailingList",label:n,placeholder:r,readOnly:f,disabled:a,defaultValue:c.mailingList??""})}):null}const _v={Header:N2,Body:I2,Footer:T2,HeaderButtons:R2,FooterButtons:L2,SubmitButton:D2,CancelButton:M2,CloseButton:$2,IntroField:H2,DescriptionField:W2,TechInfoField:F2,EnvInfoField:B2,FileAttachmentsField:z2,CategoryAttachmentsField:U2,SettingsField:K2,MailListField:V2},jv=v.createContext(_v),G2=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({..._v,...t}),[t]);return u.jsx(jv.Provider,{value:n,children:e})});function Cc(e){return{...v.useContext(jv),...e}}G2.displayName="ComponentsStore";function Ov({className:e,title:t="General",...n}){const o=oe("io-notifications-settings-panel-general",e),{AllowNotifications:r,AllowNotificationToasts:i,ShowNotificationBadge:a,CloseNotificationOnClick:s,PanelAutoHide:c,HideToastsAfter:l}=jr(),d=Ke();return u.jsx("div",{className:o,...n,children:u.jsxs(et,{title:t,children:[d&&u.jsx(r,{}),d&&u.jsx(i,{}),u.jsx(a,{}),d&&u.jsx(c,{}),d&&u.jsx(s,{}),d&&u.jsx(l,{})]})})}var ht=new class{constructor(){bn(this,"subscribed",!1);bn(this,"io");bn(this,"registry",j2());bn(this,"logger");bn(this,"isPanelVisible");bn(this,"notifications",[]);bn(this,"bulkActionsSupported",!1);bn(this,"initPromise")}init(e){return this.initPromise!==void 0||(this.initPromise=(async()=>{var t;if(!this.subscribed){this.subscribed=!0,this.io=e,this.logger=this.io.logger.subLogger("notifications");try{await this.initializeLogger()}catch(n){console.error("Failed to initialize logger with app configuration",n)}this.getBulkActionsSupport();try{await this.subscribe()}catch(n){throw(t=this.logger)==null||t.error("Error during subscription:",n),n}}})()),this.initPromise}async initializeLogger(){var o,r,i,a,s,c;const e=await To.getMyApplication(this.io),t=((r=(o=e==null?void 0:e.userProperties)==null?void 0:o.logger)==null?void 0:r.publishLevel)??"error",n=((a=(i=e==null?void 0:e.userProperties)==null?void 0:i.logger)==null?void 0:a.consoleLevel)??"info";(s=this.logger)==null||s.publishLevel(t),(c=this.logger)==null||c.consoleLevel(n)}onPanelVisibilityChanged(e){return this.registry.add("on-panel-visibility-changed",e)}onConfigurationChanged(e){return this.registry.add("on-configuration-changed",e)}onNotificationsChanged(e){return this.registry.add("on-notifications-changed",e)}onCounterChanged(e){return this.registry.add("on-counter-changed",e)}async getNotificationsList(){var t;const e=await((t=this.io)==null?void 0:t.notifications.list());if(!e)throw new Error("io.notifications.list is not supported in this environment.");return e.map(n=>this.attachHandlers(n))}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 e;if(this.isDesktopEnvironment())return(e=this.io)==null?void 0:e.notifications.panel.show()}hidePanel(){var e;if(this.isDesktopEnvironment())return(e=this.io)==null?void 0:e.notifications.panel.hide()}clearAll(){var e,t;return(e=this.logger)==null||e.trace("clearing all notifications"),(t=this.io)==null?void 0:t.notifications.clearAll()}clearAllOld(){var e,t;return(e=this.logger)==null||e.trace("clearing all old notifications"),(t=this.io)==null?void 0:t.notifications.clearOld()}clearMany(e){var n,o,r,i;const t=(n=this.io)==null?void 0:n.notifications;return this.isBulkActionSupported("clearMany")?e.length<1?((o=this.logger)==null||o.trace("no ids provided to clear notifications"),Promise.resolve()):((r=this.logger)==null||r.trace(`clearing notifications with ids ${JSON.stringify(e.join(", "))}`),((i=t.clearMany)==null?void 0:i.call(t,e))??Promise.resolve()):Promise.reject(new Error("Bulk actions are not supported in this environment"))}close(e){var t,n;return(t=this.logger)==null||t.trace(`closing notification with id ${e}`),(n=this.io)==null?void 0:n.notifications.clear(e)}snooze(e,t){var n,o;return(n=this.logger)==null||n.trace(`snoozing notification with id ${e} for ${t}ms`),(o=this.io)==null?void 0:o.notifications.snooze(e,t)}snoozeMany(e,t){var o,r,i,a;const n=(o=this.io)==null?void 0:o.notifications;return this.isBulkActionSupported("snoozeMany")?e.length<1?((r=this.logger)==null||r.trace("no ids provided to snooze notifications"),Promise.resolve()):((i=this.logger)==null||i.trace(`snoozing notifications with ids ${JSON.stringify(e.join(", "))} for ${t}ms`),((a=n.snoozeMany)==null?void 0:a.call(n,e,t))??Promise.resolve()):Promise.reject(new Error("Bulk actions are not supported in this environment"))}setState(e,t){var n,o;return(n=this.logger)==null||n.trace(`setting state of ${e} to ${t}`),(o=this.io)==null?void 0:o.notifications.setState(e,t)}setStates(e,t){var o,r,i,a;const n=(o=this.io)==null?void 0:o.notifications;return this.isBulkActionSupported("setStates")?e.length<1?((r=this.logger)==null||r.trace(`no ids provided to change state to ${t} for notifications`),Promise.resolve()):((i=this.logger)==null||i.trace(`setting state of ${JSON.stringify(e.join(", "))} to ${t}`),((a=n.setStates)==null?void 0:a.call(n,e,t))??Promise.resolve()):Promise.reject(new Error("Bulk actions are not supported in this environment"))}getBulkActionsSupport(){this.bulkActionsSupported=this.isBulkActionSupported("clearMany")&&this.isBulkActionSupported("setStates")&&this.isBulkActionSupported("snoozeMany")}setFilter(e){var t,n;return(t=this.logger)==null||t.trace(`setting filter to ${JSON.stringify(e)}`),(n=this.io)==null?void 0:n.notifications.setFilter(e)}configure(e){var t;return(t=this.io)==null?void 0:t.notifications.configure(e)}async resyncNotifications(){var e,t;try{const n=await this.getNotificationsList();this.notifications=n,this.registry.execute("on-notifications-changed",[...this.notifications]),(e=this.logger)==null||e.trace(`resynced notifications array with ${this.notifications.length} notifications`)}catch(n){(t=this.logger)==null||t.error("Error resyncing notifications list:",n)}}async subscribe(){var t,n,o,r,i,a,s,c,l;(t=this.io)==null||t.notifications.onRaised(d=>{var f;(f=this.logger)==null||f.trace(`received event indicating notification raise: ${JSON.stringify(d)}`),this.attachHandlers(d),this.notifications.unshift(d),this.registry.execute("on-notifications-changed",[...this.notifications])}),(n=this.io)==null||n.notifications.onStateChanged(({id:d},f)=>{var h;(h=this.logger)==null||h.trace(`received event for notification state is changed - "${d}" - "${f==null?void 0:f.toString()}"`),this.notifications=this.notifications.map(p=>{var m;return p.id===d?((m=this.logger)==null||m.trace(`${p.id} - the state is changed from "${p.state}" to "${f==null?void 0:f.toString()}"`),{...p,state:f}):p}),this.registry.execute("on-notifications-changed",this.notifications)});const e=(o=this.io)==null?void 0:o.notifications;e!=null&&e.onDataChanged&&e.onDataChanged((d,f)=>{var p;const h=d.id;(p=this.logger)==null||p.trace(`received event for notification data is changed - "${h}" - "${JSON.stringify(f)}"`),this.notifications=this.notifications.map(m=>{var g;return m.id===h?((g=this.logger)==null||g.trace(`${m.id} - the data is changed from "${JSON.stringify(m.data)}" to "${JSON.stringify(f)}"`),{...m,data:f}):m}),this.registry.execute("on-notifications-changed",this.notifications)}),(r=this.io)==null||r.notifications.onClosed(({id:d})=>{var f;(f=this.logger)==null||f.trace(`received event for notification is closed - "${d}".`),this.notifications=this.notifications.filter(h=>h.id!==d),this.registry.execute("on-notifications-changed",this.notifications)});try{const d=await this.getNotificationsList(),f=new Set(d.map(p=>p.id)),h=this.notifications.filter(p=>!f.has(p.id));this.notifications=[...h,...d],(i=this.logger)==null||i.trace(`initialized with ${d.length} fetched + ${h.length} from events = ${this.notifications.length} total`)}catch(d){(a=this.logger)==null||a.error("Error fetching initial notifications list:",d),(s=this.logger)==null||s.trace(`continuing with ${this.notifications.length} notifications from events`)}(c=this.io)==null||c.notifications.onConfigurationChanged(d=>{var f;(f=this.logger)==null||f.trace(`received event for configuration changed - ${JSON.stringify(d)}.`),this.registry.execute("on-configuration-changed",d)}),this.isDesktopEnvironment()&&((l=this.io)==null||l.notifications.panel.onVisibilityChanged(d=>{var f;(f=this.logger)==null||f.trace(`received event for panel visibility changed to "${d}".`),this.isPanelVisible=d,d&&this.resyncNotifications().catch(h=>{var p;(p=this.logger)==null||p.error("Error resyncing notifications on panel visibility:",h)}),this.registry.execute("on-panel-visibility-changed",d)}))}isDesktopEnvironment(){return typeof globalThis.window=="object"&&(!!globalThis.window.iodesktop||!!globalThis.window.glue42gd)}isBulkActionSupported(e){var n;const t=(n=this.io)==null?void 0:n.notifications;return typeof(t==null?void 0:t[e])=="function"}attachHandlers(e){var n;return(n=e.actions)==null||n.forEach(o=>{Object.assign(o,{onClick:async r=>{var i,a,s;try{(i=this.logger)==null||i.info(`${e.id}/${o.action} - was clicked.`),await((a=this.io)==null?void 0:a.notifications.click(e.id,o.action,r))}catch(c){(s=this.logger)==null||s.error("Error while clicking on action:",c)}}})}),Object.assign(e,{snooze:async(o=1e4)=>{var r,i;(r=this.logger)==null||r.trace(`${e.id} - request to change the state from ${e.state} to Snoozed with duration ${o}ms`),await((i=this.io)==null?void 0:i.notifications.snooze(e.id,o))},updateState:async o=>{var r,i;return(r=this.logger)==null||r.trace(`${e.id} - request to change the state from ${e.state} to ${o}`),(i=this.io)==null?void 0:i.notifications.setState(e.id,o)},updateData:async o=>{var i,a,s;(i=this.logger)==null||i.trace(`${e.id} - request to change the data to ${JSON.stringify(o)}`);const r=(a=this.io)==null?void 0:a.notifications;r!=null&&r.updateData?await r.updateData(e.id,o):(s=this.logger)==null||s.warn("'updateData' method is not supported")},onClick:async o=>{var r,i,a;try{(r=this.logger)==null||r.info(`${e.id} - was clicked.`),await((i=this.io)==null?void 0:i.notifications.click(e.id,void 0,o))}catch(s){(a=this.logger)==null||a.error(`Error while clicking on Notification: ${e.id}`,s)}},onShow:()=>{},close:async()=>{var o;return(o=this.logger)==null||o.info(`${e.id} - was closed.`),this.close(e.id)}})}};function Rd(e){const t=v.useContext(Ie.IOConnectContext),n=Ke(),[o,r]=v.useState([]),[i,a]=v.useState(0),s="Platform",c=v.useCallback((f="asc")=>{if(n===null)return[];const h=[...o].sort((p,m)=>{const g=(p.title??p.name).toLowerCase(),y=(m.title??m.name).toLowerCase();return f==="asc"?g.localeCompare(y):y.localeCompare(g)});if(!n){const p=h.findIndex(m=>m.name===s);if(p!==-1){const[m]=h.splice(p,1);h.unshift(m)}}return h},[o,n]),l=v.useMemo(()=>c("asc"),[c]),d=v.useMemo(()=>c("desc"),[c]);return v.useEffect(()=>{if(n===null||n)return;const f={title:"System",name:s,hidden:!1,userProperties:{hidden:!1}};r(h=>h.some(p=>p.name===f.name)?h:[...h,f])},[n]),v.useEffect(()=>{if(!t)return;let f,h,p,m=!1;const g=k=>{r(b=>[...b.filter(S=>S.name!==k.name),{title:k.title??k.name,name:k.name,hidden:k.hidden,userProperties:k.userProperties}])},y=k=>{r(b=>b.filter(S=>S.name!==k.name))},w=k=>{r(b=>b.find(S=>S.name===k.name)?b.map(S=>S.name===k.name?{...S,title:k.title??S.title,hidden:k.hidden??S.hidden,userProperties:k.userProperties??S.userProperties}:S):b)};return(async()=>{const k=await To.getApplications(t);if(m)return;r(C=>{const T=new Map;return C.forEach(L=>T.set(L.name,L)),k.forEach(L=>{T.set(L.name,{title:L.title??L.name,name:L.name,hidden:L.hidden,userProperties:L.userProperties})}),Array.from(T.values())});const[b,S,x]=await Promise.all([To.onAppAdded(t,g),To.onAppRemoved(t,y),To.onAppChanged(t,w)]);if(m)return b==null||b(),S==null||S(),void(x==null?void 0:x());f=b,h=S,p=x})().catch(k=>{console.error("Failed to initialize apps",k)}),()=>{m=!0,f==null||f(),h==null||h(),p==null||p()}},[t]),{apps:v.useMemo(()=>{if(!(e!=null&&e.sourceFilter)||!Array.isArray(o))return o;const{allowed:f=[],blocked:h=[]}=e.sourceFilter,p=f.includes("*"),m=h.includes("*");let g=0;const y=o.map(w=>{const k=p||f.includes(w.name),b=!m&&k;return b&&g++,{...w,allowed:b}});return a(g),y},[e,o]),allowedApps:i,sortedAppsAsc:l,sortedAppsDesc:d,sortAppsAlphabetically:c}}function Pv(e,t,n){var r;return{notificationStacks:v.useMemo(()=>{var l,d,f,h;if(!t.toastStacking)return[];const i=(a=t.stackBy)==="application"?"source":a==="severity"?"severity":"source";var a;const s=e.filter(p=>p.state==="Active"),c=new Map;for(const p of s){const m=p[i]??"";if(p.source&&((d=(l=n==null?void 0:n.sourceFilter)==null?void 0:l.muted)!=null&&d.includes(p.source))||(h=(f=n==null?void 0:n.sourceFilter)==null?void 0:f.muted)!=null&&h.includes("*"))continue;c.has(m)||c.set(m,{key:m,items:[]});const g=c.get(m);g&&g.items.unshift(p)}return Array.from(c.values()).filter(p=>p.items.some(m=>m.state==="Active"||m.state==="Stale"))},[e,t.toastStacking,t.stackBy,(r=n==null?void 0:n.sourceFilter)==null?void 0:r.muted])}}function Nv(e){const[t,n]=v.useState([]);return{selectedNotifications:t,selectNotification:(o,r)=>{const i=t;n(r?[...i,o]:i.filter(a=>a!==o))},selectAllNotifications:(o,r)=>{if(r){let i=[];switch(o){case"read":i=e.filter(a=>a.state==="Acknowledged"||a.state==="Seen").map(a=>a.id);break;case"unread":i=e.filter(a=>a.state==="Active"||a.state==="Stale").map(a=>a.id);break;case"snoozed":i=e.filter(a=>a.state==="Snoozed").map(a=>a.id);break;default:i=e.map(a=>a.id)}n(i)}else n([])}}}const Hh=e=>{var t,n;return{enabledNotifications:e.enable,enabledToasts:e.enableToasts,toastStacking:((t=e.toasts)==null?void 0:t.mode)==="stacked",stackBy:(n=e.toasts)==null?void 0:n.stackBy,toastExpiry:e.toastExpiry,showNotificationBadge:e.showNotificationBadge,placement:e.placement,snooze:e.snooze,closeNotificationOnClick:e.closeNotificationOnClick,autoHidePanel:e.autoHidePanel}},Wh=e=>Array.from(e.reduce((t,n)=>t.set(n.id,n),new Map).values());function q2(){const e=v.useContext(Ie.IOConnectContext),[t,n]=v.useState({}),[o,r]=v.useState({}),[i,a]=v.useState([]),[s,c]=v.useState(0),[l,d]=v.useState(!0),{apps:f,allowedApps:h}=Rd(t),{notificationStacks:p}=Pv(i,{toastStacking:o.toastStacking??!1,stackBy:o.stackBy??"source"},{sourceFilter:t.sourceFilter}),{selectedNotifications:m,selectNotification:g,selectAllNotifications:y}=Nv(i);v.useEffect(()=>{(async()=>{await ht.init(e),await(async()=>{try{const b=await ht.getConfiguration();n(b),r(S=>({...S,...Hh(b)}))}catch(b){console.error("Error fetching configuration:",b)}})(),await(async()=>{try{const b=await ht.getNotificationsList();a(Wh(b))}catch(b){console.error("Error fetching notifications:",b)}})()})().catch(b=>{console.error("Error in useNotifications fetch:",b)}),w()},[e]),v.useEffect(()=>{const b=ht.onNotificationsChanged(C=>{a(Wh(C))}),S=ht.onConfigurationChanged(C=>{const T=Hh(C);n(L=>({...L,...C})),r(L=>({...L,...T}))}),x=ht.onCounterChanged(C=>{c(C)});return()=>{b(),S(),x()}},[]);const w=()=>{d(ht.bulkActionsSupported)},k=async b=>{await ht.setFilter(b)};return{close:b=>ht.close(b),clearAll:()=>ht.clearAll(),settings:o,hidePanel:async()=>{await ht.hidePanel()},showPanel:async()=>{await ht.showPanel()},saveFilter:k,clearAllOld:()=>ht.clearAllOld(),saveSetting:async b=>{const S=((x,C)=>{const T=(j=>({enabledNotifications:N=>({enable:N}),enabledToasts:N=>({enableToasts:N}),toastStacking:N=>{var O;return{toasts:{mode:N?"stacked":"single",stackBy:(O=j.toasts)==null?void 0:O.stackBy}}},stackBy:N=>{var O;return{toasts:{mode:(O=j.toasts)==null?void 0:O.mode,stackBy:N}}},showNotificationBadge:N=>({showNotificationBadge:N}),toastExpiry:N=>({toastExpiry:N}),placement:N=>({placement:N}),snooze:N=>({snooze:N}),closeNotificationOnClick:N=>({closeNotificationOnClick:N}),autoHidePanel:N=>({autoHidePanel:N})}))(C),L=Object.keys(x)[0],M=x[L];return L&&M!==void 0&&T[L]?T[L](M):{}})(b,t);S&&await ht.configure(S)},allApps:f,saveAllFilter:async b=>{"subscribe"in b?await k({allowed:b.subscribe?["*"]:[],blocked:b.subscribe?[]:["*"]}):"mute"in b&&await k({muted:b.mute?["*"]:[]})},configuration:t,notifications:i,notificationStacks:p,notificationsCount:s,allApplications:t.allApplications??0,allowedApplications:h,isBulkActionsSupported:l,selectedNotifications:m,selectNotification:g,selectAllNotifications:y,clearMany:async b=>{await ht.clearMany(b)},snooze:async(b,S)=>{await ht.snooze(b,S)},snoozeMany:async(b,S)=>{await ht.snoozeMany(b,S)},setState:async(b,S)=>{await ht.setState(b,S)},setStates:async(b,S)=>{await ht.setStates(b,S)},setCount:b=>{c(b)},getNotificationsList:async()=>await ht.getNotificationsList()}}const Iv=v.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:()=>{}}),Ce=()=>v.useContext(Iv);function Tv({label:e="Allow notifications",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ke(),a=v.useCallback(s=>{r({enabledNotifications:s.target.checked})},[r]);return i?u.jsx(Ct,{label:e,align:t,onChange:a,checked:o.enabledNotifications??!1,...n}):null}function Rv({label:e="Allow notification toasts",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ke(),a=i&&!o.enabledNotifications,s=v.useCallback(c=>{r({enabledToasts:c.target.checked})},[r]);return i?u.jsx(Ct,{label:e,align:t,onChange:s,checked:o.enabledToasts??!1,disabled:a,...n}):null}function Lv({label:e="Show notification badge",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ke()&&!o.enabledNotifications,a=v.useCallback(s=>{r({showNotificationBadge:s.target.checked})},[r]);return u.jsx(Ct,{label:e,align:t,onChange:a,checked:o.showNotificationBadge??!1,disabled:i,...n})}function Dv({label:e="Close notification on click",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ke(),a=i&&!o.enabledNotifications,s=v.useCallback(c=>{r({closeNotificationOnClick:c.target.checked})},[r]);return i?u.jsx(Ct,{label:e,align:t,onChange:s,checked:o.closeNotificationOnClick??!1,disabled:a,...n}):null}function Mv({label:e="Auto hide panel",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ke(),a=v.useCallback(s=>{r({autoHidePanel:s.target.checked})},[r]);return i?u.jsx(Ct,{label:e,align:t,onChange:a,checked:o.autoHidePanel??!1,...n}):null}const Fh=(e,t)=>e?`${e} ${t}${e!==1?"s":""}`:"",Ds=e=>{const t=Math.floor(e/60),n=e%60,o=Fh(t,"minute"),r=Fh(n,"second");return o+(o&&r?" ":"")+r};function $v({className:e,title:t="Hide toasts after",items:n=[15,30,45,60],...o}){const r=oe("flex","jc-between","ai-center",e),{settings:i,saveSetting:a}=Ce(),s=Ke(),c=s&&!i.enabledNotifications,l=v.useCallback((d=15e3)=>{i.toastExpiry!==d&&a({toastExpiry:1e3*d})},[i.toastExpiry,a]);return s?u.jsxs("div",{className:r,...o,children:[u.jsx("div",{className:"io-text-clipper "+(c?"io-text-disabled":""),children:u.jsx("span",{children:t})}),u.jsxs(fe,{variant:"light",disabled:c,children:[u.jsx(fe.Button,{text:Ds((i.toastExpiry??0)/1e3)}),u.jsx(fe.Content,{children:u.jsx(fe.List,{variant:"single",children:n.map(d=>u.jsx(fe.Item,{onClick:()=>{l(d)},children:Ds(d)},d))})})]})]}):null}function Hv({className:e,title:t="Stacking",...n}){const o=oe("io-notifications-settings-panel-stacking",e),{ToastStacking:r,ToastStackBy:i}=jr();return Ke()?u.jsx("div",{className:o,...n,children:u.jsxs(et,{title:t,children:[u.jsx(r,{}),u.jsx(i,{})]})}):null}function Wv({label:e="Allow toast stacking",align:t="right",...n}){const{settings:o,saveSetting:r}=Ce(),i=Ke(),a=i&&!o.enabledNotifications,s=v.useCallback(c=>{r({toastStacking:c.target.checked})},[r]);return i?u.jsx(Ct,{label:e,align:t,onChange:s,checked:o.toastStacking??!1,disabled:a,...n}):null}const Cu={application:"Application",severity:"Priority"},J2=Object.fromEntries(Object.entries(Cu).map(([e,t])=>[t,e]));function Fv({className:e,title:t="Group by",...n}){const o=oe("flex","jc-between","ai-center",e),{settings:r,saveSetting:i}=Ce(),a=Ke(),s=a&&!r.enabledNotifications,c=v.useCallback((d="severity")=>{r.stackBy!==d&&i({stackBy:d.toLowerCase()})},[r.stackBy,i]);if(!a)return null;const l=Object.values(Cu);return u.jsxs("div",{className:o,...n,children:[u.jsx("div",{className:oe("io-text-clipper",{"io-text-disabled":s}),children:u.jsx("span",{children:t})}),u.jsxs(fe,{variant:"light",disabled:s,children:[u.jsx(fe.Button,{text:Cu[r.stackBy??"severity"]}),u.jsx(fe.Content,{children:u.jsx(fe.List,{variant:"single",children:l.map(d=>u.jsx(fe.Item,{onClick:()=>{const f=J2[d];c(f)},children:d},d))})})]})]})}function Bv({className:e,title:t="Placement",...n}){const o=oe("io-notifications-settings-panel-placement",e),{PlacementPanel:r,PlacementToasts:i}=jr();return Ke()?u.jsx("div",{className:o,...n,children:u.jsxs(et,{title:t,children:[u.jsx(r,{}),u.jsx(i,{})]})}):null}const zv=e=>e.replace(/(^|-)\w/g,t=>t.toUpperCase().replace("-"," "));function Uv({className:e,title:t="Panel position",...n}){var c,l;const o=oe("flex","jc-between","ai-center",e),{settings:r,saveSetting:i}=Ce(),a=Ke(),s=v.useCallback(d=>{var f;d||(d="right"),((f=r.placement)==null?void 0:f.panel)!==d&&i({placement:{...r.placement,panel:d.toLowerCase()}})},[r.placement,i]);return a?u.jsxs("div",{className:o,...n,children:[u.jsx("div",{className:"io-text-clipper",children:u.jsx("span",{children:t})}),u.jsxs(fe,{variant:"light",children:[u.jsx(fe.Button,{text:(c=r.placement)!=null&&c.panel?zv((l=r.placement)==null?void 0:l.panel):"Right"}),u.jsx(fe.Content,{children:u.jsx(fe.List,{variant:"single",children:["Right","Left"].map(d=>u.jsx(fe.Item,{onClick:()=>{s(d)},children:d},d))})})]})]}):null}function Kv({className:e,title:t="Toasts position",...n}){var c,l;const o=oe("flex","jc-between","ai-center",e),{settings:r,saveSetting:i}=Ce(),a=Ke(),s=v.useCallback(d=>{var h;if(d||(d="bottom-right"),((h=r.placement)==null?void 0:h.toasts)===d)return;const f=d.replace(/\s+/g,"-").toLowerCase();i({placement:{...r.placement,toasts:f}})},[r.placement,i]);return a?u.jsxs("div",{className:o,...n,children:[u.jsx("div",{className:"io-text-clipper",children:u.jsx("span",{children:t})}),u.jsxs(fe,{variant:"light",children:[u.jsx(fe.Button,{text:(c=r.placement)!=null&&c.toasts?zv((l=r.placement)==null?void 0:l.toasts):"Bottom Right"}),u.jsx(fe.Content,{children:u.jsx(fe.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map(d=>u.jsx(fe.Item,{onClick:()=>{s(d)},children:d},d))})})]})]}):null}function Vv({className:e,title:t="Snooze",...n}){var a;const o=oe("io-notifications-settings-panel-snooze",e),{SnoozeDuration:r}=jr(),{settings:i}=Ce();return Ke()&&((a=i.snooze)!=null&&a.enabled)?u.jsx("div",{className:o,...n,children:u.jsx(et,{title:t,children:u.jsx(r,{})})}):null}function Gv({className:e,title:t="Default duration",items:n=[60,120,180,300],...o}){var d,f;const r=oe("flex","jc-between","ai-center",e),{settings:i,saveSetting:a}=Ce(),s=Ke(),c=s&&!i.enabledNotifications,l=v.useCallback((h=6e4)=>{var p;i.snooze&&((p=i.snooze)==null?void 0:p.duration)!==h&&a({snooze:{...i.snooze,duration:1e3*h}})},[i.snooze,a]);return s&&((d=i.snooze)!=null&&d.enabled)?u.jsxs("div",{className:r,...o,children:[u.jsx("div",{className:oe("io-text-clipper",{"io-text-disabled":c}),children:u.jsx("span",{children:t})}),u.jsxs(fe,{variant:"light",disabled:c,children:[u.jsx(fe.Button,{text:Ds((((f=i.snooze)==null?void 0:f.duration)??0)/1e3)}),u.jsx(fe.Content,{children:u.jsx(fe.List,{variant:"single",children:n.map(h=>u.jsx(fe.Item,{onClick:()=>{l(h)},children:Ds(h)},h))})})]})]}):null}function qv({className:e,title:t,...n}){const o=oe("io-notifications-settings-panel-subscriptions",e),{SubscribeAll:r,SubscribeApp:i,SubscribeMuteAll:a,SubscribeMuteApp:s}=jr(),{sortAppsAlphabetically:c}=Rd(),l=Ke(),d=c(),f="io-notifications-subscriptions-grid "+(l?"with-three-columns":"with-two-columns");return u.jsx("div",{className:o,...n,children:u.jsxs(et,{title:t??(l?"Subscribe & Mute":"Subscribe"),children:[u.jsxs("div",{className:f,children:[u.jsx("p",{className:"io-text-section",children:"Sources"}),u.jsx("p",{className:"io-text-section",children:"Subscribe"}),l&&u.jsx("p",{className:"io-text-section",children:"Mute"})]}),u.jsxs("div",{className:f,children:[u.jsx("p",{children:"All Sources"}),u.jsx(r,{label:""}),l&&u.jsx(a,{label:""})]}),d.map(h=>{var p;return!h||h.hidden||(p=h==null?void 0:h.userProperties)!=null&&p.hidden?null:u.jsxs("div",{className:f,children:[u.jsx("p",{children:h.title??h.name}),u.jsx(i,{app:h,label:""}),l&&u.jsx(s,{app:h,label:""})]},h.name)})]})})}function Jv({label:e="All apps",align:t="right",...n}){var c,l,d,f;const{settings:o,configuration:r,saveAllFilter:i}=Ce(),a=Ke()&&!o.enabledNotifications,s=v.useCallback(h=>{i({subscribe:h.target.checked})},[i]);return u.jsx(Ct,{align:t,label:e,onChange:s,checked:(((l=(c=r.sourceFilter)==null?void 0:c.allowed)==null?void 0:l.includes("*"))&&((f=(d=r.sourceFilter)==null?void 0:d.blocked)==null?void 0:f.length)===0)??!1,disabled:a,...n})}function Zv({label:e="App",align:t="right",app:n,...o}){var d,f,h,p,m,g;const{allApps:r,settings:i,configuration:a,saveFilter:s}=Ce(),c=Ke()&&!i.enabledNotifications,l=v.useCallback((y,w)=>{var S,x,C,T,L,M;const k={...a.sourceFilter},b=(S=k.allowed)==null?void 0:S.indexOf("*");typeof b=="number"&&b>-1&&((x=k.allowed)==null||x.splice(b,1),r.forEach(j=>{var N;j.name!==w.name&&((N=k.allowed)==null||N.push(j.name))})),y?(k.allowed=[...new Set([...k.allowed??[],w.name])],k.blocked=(C=k.blocked)==null?void 0:C.filter(j=>j!==w.name)):(k.allowed=(T=k.allowed)==null?void 0:T.filter(j=>j!==w.name),k.blocked=[...new Set([...k.blocked??[],w.name])]),(L=k.allowed)!=null&&L.length&&((M=k.blocked)!=null&&M.includes("*"))&&k.blocked.splice(k.blocked.indexOf("*"),1),s(k)},[r,a.sourceFilter,s]);return u.jsx(Ct,{id:`subscribe-${n.name}`,label:e,align:t,onChange:y=>l(y.target.checked,n),checked:(((f=(d=a.sourceFilter)==null?void 0:d.allowed)==null?void 0:f.includes("*"))&&!((p=(h=a.sourceFilter)==null?void 0:h.blocked)!=null&&p.includes(n.name))||((g=(m=a.sourceFilter)==null?void 0:m.allowed)==null?void 0:g.includes(n.name)))??!1,disabled:c,...o})}function Yv({label:e="Mute all",align:t="right",...n}){var l,d,f,h;const{settings:o,configuration:r,saveAllFilter:i}=Ce(),a=Ke(),s=a&&(!o.enabledNotifications||((d=(l=r.sourceFilter)==null?void 0:l.allowed)==null?void 0:d.indexOf("*"))===-1),c=v.useCallback(p=>{i({mute:p.target.checked})},[i]);return a?u.jsx(Ct,{align:t,label:e,onChange:c,checked:((h=(f=r.sourceFilter)==null?void 0:f.muted)==null?void 0:h.includes("*"))??!1,disabled:s??!1,...n}):null}function Xv({label:e="App",align:t="right",app:n,...o}){var f,h,p,m,g,y,w,k,b,S,x,C,T,L,M,j;const{allApps:r,settings:i,configuration:a,saveFilter:s}=Ce(),c=Ke(),l=c&&(!i.enabledNotifications||((h=(f=a.sourceFilter)==null?void 0:f.blocked)==null?void 0:h.includes("*"))||((m=(p=a.sourceFilter)==null?void 0:p.blocked)==null?void 0:m.includes(n.name))||((y=(g=a.sourceFilter)==null?void 0:g.allowed)==null?void 0:y.length)===0||((k=(w=a.sourceFilter)==null?void 0:w.allowed)==null?void 0:k.indexOf(n.name))===-1&&((S=(b=a.sourceFilter)==null?void 0:b.allowed)==null?void 0:S.indexOf("*"))===-1&&((C=(x=a.sourceFilter)==null?void 0:x.blocked)==null?void 0:C.length)===0),d=v.useCallback((N,O)=>{var R,$,H,K;const Y={...a.sourceFilter},z=(R=Y==null?void 0:Y.muted)==null?void 0:R.indexOf("*");typeof z=="number"&&z>-1&&(($=Y.muted)==null||$.splice(z,1),r.forEach(B=>{var D;B.name===O.name||B.hidden||((D=Y.muted)==null||D.push(B.name))})),N?(H=Y.muted)==null||H.push(O.name):Y.muted=(K=Y.muted)==null?void 0:K.filter(B=>B!==O.name),s(Y)},[r,a.sourceFilter,s]);return!c||n.hidden?null:u.jsx(Ct,{id:`mute-${n.name}`,label:e,align:t,onChange:N=>d(N.target.checked,n),checked:(((L=(T=a.sourceFilter)==null?void 0:T.muted)==null?void 0:L.includes("*"))||((j=(M=a.sourceFilter)==null?void 0:M.muted)==null?void 0:j.includes(n.name)))??!1,disabled:l??!1,...o})}const Qv={Body:e=>{const{General:t,Placement:n,Stacking:o,Snooze:r,Subscriptions:i}=jr();return u.jsxs(Jo,{element:ci,elementProps:e,children:[u.jsx(t,{}),u.jsx(o,{}),u.jsx(n,{}),u.jsx(r,{}),u.jsx(i,{})]})},General:Ov,AllowNotifications:Tv,AllowNotificationToasts:Rv,ShowNotificationBadge:Lv,CloseNotificationOnClick:Dv,PanelAutoHide:Mv,HideToastsAfter:$v,Stacking:Hv,ToastStacking:Wv,ToastStackBy:Fv,Placement:Bv,PlacementPanel:Uv,PlacementToasts:Kv,Snooze:Vv,SnoozeDuration:Gv,Subscriptions:qv,SubscribeAll:Jv,SubscribeApp:Zv,SubscribeMuteAll:Yv,SubscribeMuteApp:Xv},e0=v.createContext(Qv),Ld=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...Qv,...t}),[t]);return u.jsx(e0.Provider,{value:n,children:e})});Ld.displayName="NotificationsSettingsPanelComponentsStoreProvider";const jr=()=>v.useContext(e0),Z2=({className:e,onClose:t,title:n="Notification Settings",...o})=>{const{Body:r}=jr();return u.jsxs(Xe,{className:oe("io-notifications-settings-panel",e),"data-testid":"notifications-settings-panel",...o,children:[u.jsxs(Xe.Header,{children:[u.jsx(Xe.Header.Title,{size:"large",text:n,tag:"h1"}),u.jsx(Xe.Header.ButtonGroup,{children:u.jsx(Xe.Header.ButtonIcon,{className:"non-draggable",variant:"circle",icon:"close",size:"32",onClick:t})})]}),u.jsx(r,{})]})},Dd=({components:e,...t})=>u.jsx(Ld,{components:e,children:u.jsx(Z2,{...t})});function Y2({isOpen:e,onClose:t,container:n}){return e?jo.createPortal(u.jsx(Dd,{onClose:t}),n??document.querySelector("#root")??document.body):null}const t0=v.createContext({searchQuery:"",setSearch:()=>{},isPanelVisible:!1,sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),Wt=()=>v.useContext(t0);function n0({title:e,onOpenSettings:t,onClose:n,...o}){const{HeaderCaptionTitle:r,HeaderCaptionCount:i,HeaderCaptionButtonSettings:a,HeaderCaptionButtonClose:s,HeaderActions:c,HeaderBulkActions:l,HeaderSearch:d}=Er(),{isBulkActionsSupported:f,notificationsCount:h}=Ce(),{isBulkActionsVisible:p}=Wt(),m=Ke();return u.jsxs(Ao,{...o,children:[u.jsxs("div",{className:"io-panel-header-caption",children:[u.jsx(r,{title:e}),u.jsx(i,{}),u.jsxs(Ao.ButtonGroup,{children:[m&&u.jsx(a,{onClick:t}),u.jsx(s,{onClick:n})]})]}),u.jsx(d,{}),f?u.jsxs("div",{className:`io-panel-header-actions-wrapper ${p&&h>0?"io-panel-header-bulk-actions-opened":""} `,children:[u.jsx(c,{}),u.jsx(l,{})]}):u.jsx(c,{})]})}function o0({text:e="Notifications",counter:t,...n}){const{notificationsCount:o}=Ce();return u.jsx(zn,{text:e,size:"large",...n,children:(t??!0)&&u.jsxs("span",{children:["(",o,")"]})})}const r0="newest",X2="oldest",Q2="severity",ml=["None","Low","Medium","High","Critical"],Bh={key:r0,descending:!0},i0=e=>[...e].sort((t,n)=>(n.timestamp||0)-(t.timestamp||0)),a0=e=>[...e].sort((t,n)=>(t.timestamp||0)-(n.timestamp||0)),s0=(e,t)=>{const n=ml[0];return[...e].sort((o,r)=>{const i=ml.indexOf(o.severity||n),a=ml.indexOf(r.severity||n);return(t?-1:1)*(i-a)})},eS={[r0]:i0,[X2]:a0,[Q2]:s0},tS={severity:"Priority",newest:"Newest",oldest:"Oldest"};function c0({...e}){const[t,n]=v.useState([]),{NotificationsList:o,Notification:r}=Er(),{notifications:i,setCount:a,notificationsCount:s}=Ce(),{sortNotificationsBy:c,viewNotificationsBy:l,searchQuery:d}=Wt(),f=v.useRef(null),h=Fg(d),p=v.useMemo(()=>((g,y)=>{if(!g)return[];switch(y){case"all":default:return g;case"unread":return g.filter(w=>w.state==="Active"||w.state==="Stale");case"read":return g.filter(w=>w.state==="Acknowledged"||w.state==="Seen");case"snoozed":return g.filter(w=>w.state==="Snoozed")}})(i,l).filter(g=>{var y,w;return g.title.toLowerCase().includes(h.toLowerCase())||((y=g.source)==null?void 0:y.toLowerCase().includes(h.toLowerCase()))||((w=g.body)==null?void 0:w.toLowerCase().includes(h.toLowerCase()))}),[h,i,l]);return v.useEffect(()=>{switch(c){case"newest":n(i0(p));break;case"oldest":n(a0(p));break;case"severity":n(s0(p,!0));break;default:n(p)}a(p.length)},[p,c,a]),v.useEffect(()=>{var m;f.current&&((m=f.current)==null||m.scrollTo({top:0,behavior:"smooth"}))},[h,s,c,l]),u.jsx(Jo,{ref:f,element:ci,elementProps:e,children:u.jsx(o,{notifications:t,Notification:r})})}function l0({...e}){const{FooterButtons:t}=Er();return u.jsx(Br,{...e,children:u.jsx(t,{})})}function u0({className:e,...t}){const{FooterButtonClearAll:n,FooterButtonClearAllOld:o}=Er(),{notifications:r}=Ce(),[i,a]=v.useState(!1);return v.useEffect(()=>{r.filter(s=>s.state==="Stale"||s.state==="Acknowledged").length>0?a(!0):a(!1)},[r]),u.jsxs(We,{className:e,align:"right",...t,children:[u.jsx(o,{disabled:!i}),u.jsx(n,{disabled:r.length<=0})]})}function d0({text:e="Clear All",...t}){const{clearAll:n}=Ce();return u.jsx(Qe,{text:e,onClick:()=>{n()},...t})}function f0({text:e="Clear Old",...t}){const{clearAllOld:n}=Ce();return u.jsx(Qe,{text:e,onClick:()=>{n()},...t})}function Md(e){const t=Ke(),{onClose:n,settings:o}=Ce(),{isPanelVisible:r}=Wt(),{id:i,onClick:a,updateState:s}=e,c=v.useCallback(async()=>{if(!a)return;if(!t){try{await a({close:!0})}catch(h){console.error(h)}return void n(i)}const d=(o==null?void 0:o.toastStacking)??!1;let f;f=r?(o==null?void 0:o.closeNotificationOnClick)??!0:!d&&null;try{f!==null?await a({close:f}):(await a({close:!1}),await s("Acknowledged"))}catch(h){console.error(h)}},[t,i,r,a,n,s,o==null?void 0:o.closeNotificationOnClick,o==null?void 0:o.toastStacking]),l=v.useCallback(async d=>{const f=d.target;f.closest("button")||f.closest("[role='button']")||f.closest("a")||f.closest(".io-dropdown-menu")||await c()},[c]);return{handleClick:c,handleWrapperClick:l}}function h0({className:e,notification:t,onClick:n,...o}){const r=oe("io-notification-header",e),{HeaderCount:i,HeaderBadge:a,HeaderTitle:s,HeaderTimestamp:c,HeaderButtonSnooze:l,HeaderButtonClose:d}=Ec(),{handleWrapperClick:f}=Md(t);return u.jsxs("div",{className:r,onClick:async h=>{await f(h),n==null||n(h)},...o,children:[u.jsx(a,{notification:t}),u.jsx(i,{notification:t}),u.jsx(s,{notification:t}),u.jsx(c,{notification:t}),u.jsxs(We,{children:[u.jsx(l,{notification:t}),u.jsx(d,{notification:t})]})]})}function p0({notification:e,...t}){const{settings:n,notificationStacks:o}=Ce(),{isPanelVisible:r}=Wt(),{toastStacking:i,stackBy:a}=n,s=a==="application"?"source":a??"source";let c=0;if(i){const l=o.find(d=>d.key===e[s]);c=(l==null?void 0:l.items.length)??0}return r||!i||c<=1?null:u.jsx(cc,{...t,children:c>9?"9+":c})}function m0({className:e,notification:t,...n}){if(!(t!=null&&t.severity)||t.severity==="None")return null;const o=oe("io-notification-header-badge",e);return u.jsx(cc,{className:o,...n,children:t.severity})}function g0({className:e,state:t,severity:n="None",icon:o,...r}){const i=oe("io-notification-header-icon",e),{isPanelVisible:a}=Wt();return u.jsxs("div",{className:i,...r,children:[o&&u.jsx("span",{className:"io-notification-header-icon-image",children:u.jsx("img",{src:o,alt:`io-notification-header-icon-${o}`})}),u.jsx("span",{className:`io-notification-header-icon-badge color-${n.toLowerCase()}`,children:a&&t!=="Acknowledged"&&"New"})]})}function v0({className:e,notification:{appTitle:t},...n}){const o=oe("io-notification-header-title",e);return u.jsx("div",{className:o,...n,children:t})}function y0({className:e,notification:{timestamp:t,state:n,snooze:o},...r}){const i=oe("io-notification-timestamp",e);return u.jsx("small",o&&n==="Snoozed"?{className:i,...r,children:"Snoozed"}:{className:i,...r,children:mv(t??0)??"Just Now"})}function w0({notification:{id:e,state:t},...n}){var a,s;const{settings:o,snooze:r}=Ce(),i=v.useCallback(c=>{var l;c.stopPropagation(),r&&r(e,((l=o.snooze)==null?void 0:l.duration)??0)},[e,r,(a=o.snooze)==null?void 0:a.duration]);return r&&t!=="Snoozed"&&((s=o.snooze)!=null&&s.enabled)?u.jsx(Qe,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:i,...n}):null}function b0({notification:{id:e,updateState:t},...n}){const o=Ke(),{onClose:r}=Ce(),{isPanelVisible:i}=Wt(),a=v.useCallback(s=>{s.stopPropagation(),!o||i?r(e):t("Acknowledged").catch(console.error)},[o,e,r,i,t]);return u.jsx(Ue,{icon:"close",iconSize:"10",tabIndex:-1,onClick:a,...n})}function x0({className:e,notification:t,...n}){const o=oe("io-notification-body",e),{BodyIcon:r,BodyTitle:i,BodyDescription:a}=Ec(),{icon:s,title:c,body:l}=t,{handleClick:d}=Md(t);return u.jsxs("div",{className:o,role:"button",tabIndex:0,onKeyDown:async f=>{Go(f)&&await d()},onClick:d,...n,children:[u.jsx(r,{icon:s}),u.jsxs("div",{className:"io-notification-body-content",children:[u.jsx(i,{text:c}),u.jsx(a,{text:l})]})]})}function S0({className:e,icon:t,altText:n="notification icon",...o}){if(!t)return null;const r=oe("io-notification-body-icon",e);return u.jsx("div",{className:r,...o,children:u.jsx("img",{src:t,alt:n})})}function k0({text:e,...t}){return u.jsx(zn,{text:e,...t})}function C0({className:e,text:t,...n}){const o=oe("io-notification-body-description",e);return u.jsx("p",{className:o,...n,children:t})}function E0({className:e,notification:t}){const n=oe("io-notification-footer",e),{FooterButton:o}=Ec(),{handleWrapperClick:r}=Md(t),i=v.useMemo(()=>function(s){const c=[],l={};if(!s)return;s.forEach(f=>{var g;const{displayId:h,displayPath:p}=f,m={...f,children:[]};if(p&&p.length>0){let y;p.forEach((w,k)=>{var b;k===0?y=l[w]:y&&(y=(b=y.children)==null?void 0:b.find(S=>S.displayId===w))}),y&&((g=y.children)==null||g.push(m))}else h?(c.push(m),l[h]=m):c.push(m);h&&(l[h]=m)});const d=f=>{f.forEach(h=>{var p;((p=h.children)==null?void 0:p.length)===0?delete h.children:h.children&&d(h.children)})};return d(c),c}(t.actions),[t.actions]),a=(s,c)=>s.children?u.jsx(_n,{text:s.title,children:s.children.map(a)},`${s.title}-${c}`):((l,d)=>u.jsx(_n.Item,{children:u.jsx(o,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:l})},`${l.title}-${d}`))(s,c);return u.jsx("div",{className:n,onClick:r,children:u.jsx(We,{align:"right",children:i==null?void 0:i.map((s,c)=>s.children?u.jsxs(We,{variant:"append",children:[u.jsx(o,{notificationAction:s,variant:c===0?"primary":"default"}),u.jsx(_n,{variant:c===0?"primary":"default",icon:"ellipsis",children:s.children.map(a)})]},`${s.title}-${c}`):u.jsx(o,{notificationAction:s,variant:c===0?"primary":"link"},`${s.title}-${c}`))})})}function A0({notificationAction:e,...t}){const n=v.useCallback(o=>{o.stopPropagation(),e.onClick({close:!0})},[e]);return u.jsx(Qe,{text:e.title,onClick:n,...t})}const _0={Header:h0,HeaderCount:p0,HeaderBadge:m0,HeaderIcon:g0,HeaderTitle:v0,HeaderTimestamp:y0,HeaderButtonSnooze:w0,HeaderButtonClose:b0,Body:x0,BodyIcon:S0,BodyTitle:k0,BodyDescription:C0,Footer:E0,FooterButton:A0},j0=v.createContext(_0),O0=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({..._0,...t}),[t]);return u.jsx(j0.Provider,{value:n,children:e})});function Ec(e){return{...v.useContext(j0),...e}}function nS({className:e,notification:t,...n}){const{Header:o,Body:r,Footer:i}=Ec(),{severity:a}=t,s=oe("io-notification",`severity-${(a==null?void 0:a.toLowerCase())??"none"}`,t.state!=="Acknowledged"&&"state-new",e);return u.jsxs("div",{className:s,...n,children:[u.jsx(o,{notification:t}),u.jsx(r,{notification:t}),u.jsx(i,{notification:t})]})}function Ac({components:e,notification:t,...n}){return u.jsx(O0,{components:e,children:u.jsx(nS,{notification:t,...n})})}function P0({className:e,notifications:t,...n}){const[o,r]=v.useState(!1),i=t.length>=3?"large":"normal",a=t.length===2?"small":i,s=t[0].severity,c=oe("io-notification-stack",o&&"io-notification-stack-open",a!=="normal"&&[`io-notification-stack-${a}`],s&&s!=="None"&&[`io-notification-stack-${s.toLowerCase()}`],e),l=v.useCallback(()=>{r(!0)},[]),d=v.useCallback(f=>{f.stopPropagation(),t.forEach(h=>{h.close()})},[t]);return u.jsxs("div",{className:c,onClick:l,...n,children:[o&&a!=="normal"&&u.jsx("div",{className:"io-notification-stack-btn",children:u.jsx(Qe,{icon:"close",onClick:f=>d(f),children:u.jsx("span",{className:"io-btn-text",children:"Clear Stack"})})}),t.map(f=>u.jsx(Ac,{notification:f},f.id))]})}function oS({...e}){const{notificationStacks:t}=Ce();return u.jsx(u.Fragment,{children:t.map(n=>u.jsx(P0,{notifications:n.items,...e},n.key))})}O0.displayName="ComponentsStoreProvider";const rS=({notification:e,Notification:t,...n})=>{var p;const{configuration:o,isBulkActionsSupported:r,selectedNotifications:i,selectNotification:a}=Ce(),{isPanelVisible:s,isBulkActionsVisible:c}=Wt(),l=((p=o.sourceFilter)==null?void 0:p.muted)??[],d=e.source&&l.includes(e.source)||l.includes("*");if(!s&&d)return null;const f=s&&r&&c,h=i.includes(e.id);return f?u.jsxs("div",{className:oe("io-notification-list-bulk-action-item",{selected:h}),children:[u.jsx(bc,{checked:h,onChange:m=>a(e.id,m.target.checked)}),u.jsx(t,{notification:e,...n})]}):u.jsx(t,{notification:e,...n})};function $d({className:e,Notification:t,notifications:n=[],noNotificationText:o="No notifications to display",...r}){const i=oe("io-notification-list",e),{settings:a}=Ce(),{isPanelVisible:s}=Wt(),{toastStacking:c}=a,l=c&&!s,d=n.length>0;return u.jsxs("div",{className:i,...r,children:[l&&u.jsx(oS,{}),!l&&(d?n.map(f=>u.jsx(rS,{notification:f,Notification:t,...r},f.id)):u.jsx("div",{className:"io-notification-list-no-notifications",children:o}))]})}const N0={Header:n0,HeaderCaptionTitle:o0,HeaderCaptionCount:function({variant:e="primary",...t}){const{notificationsCount:n=0}=Ce();return n===0?null:u.jsx(lb,{variant:e,...t,children:n>99?"99+":n})},HeaderCaptionButtonSettings:function({icon:e="cog",size:t="32",variant:n="circle",...o}){return Ke()?u.jsx(Ue,{icon:e,size:t,variant:n,...o}):null},HeaderCaptionButtonClose:function({icon:e="close",size:t="32",variant:n="circle",onClick:o,...r}){const{hidePanel:i}=Ce(),a=Ke();return u.jsx(Ue,{icon:e,size:t,variant:n,onClick:s=>{o?o(s):a&&i()},...r})},HeaderActions:function({className:e,...t}){const n=oe("io-panel-header-actions",e),{HeaderActionSort:o,HeaderActionView:r,HeaderActionClear:i,HeaderActionEdit:a}=Er();return u.jsxs("div",{className:n,...t,children:[u.jsxs(We,{children:[u.jsx(o,{}),u.jsx(r,{})]}),u.jsxs(We,{children:[u.jsx(i,{}),u.jsx(a,{})]})]})},HeaderActionSort:function({text:e="Sort by",...t}){const{sortNotificationsBy:n,setSortBy:o}=Wt(),{onNotificationsSort:r}=(()=>{const{notifications:i}=Ce(),[a,s]=v.useState(Bh),{key:c,descending:l}=a,d=v.useMemo(()=>eS[c](i,l),[i,c,l]);return{onNotificationsSort:v.useCallback(h=>{s(p=>({key:h,descending:p.key!==h?Bh.descending:!p.descending}))},[]),sortedNotifications:d}})();return u.jsxs(fe,{variant:"light",...t,children:[u.jsxs(fe.Button,{variant:"link",children:[e," ",u.jsx("strong",{children:tS[n].toLowerCase()})]}),u.jsx(fe.Content,{children:u.jsx(fe.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Priority"].map(i=>{const a=i==="Priority"?"severity":i.toLowerCase();return u.jsx(fe.Item,{isSelected:n===a,onClick:()=>{o(a),r(a)},children:i},i)})})})]})},HeaderActionView:function({text:e="View",...t}){var a;const{settings:n}=Ce(),{viewNotificationsBy:o,setViewBy:r}=Wt(),i=(a=n.snooze)!=null&&a.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return u.jsxs(fe,{variant:"light",...t,children:[u.jsxs(fe.Button,{variant:"link",children:[e," ",u.jsx("strong",{children:o})]}),u.jsx(fe.Content,{children:u.jsx(fe.List,{variant:"single",checkIcon:"check",children:i.map(s=>u.jsx(fe.Item,{isSelected:o===s.toLowerCase(),onClick:()=>r(s.toLowerCase()),children:s},s))})})]})},HeaderActionClear:function({text:e="Clear All",...t}){const{clearAll:n,notificationsCount:o}=Ce();return u.jsx(Qe,{variant:"link",text:e,onClick:n,disabled:o===0,...t})},HeaderActionEdit:function({tooltip:e="Bulk Edit",...t}){const{isBulkActionsSupported:n,notificationsCount:o}=Ce(),{showBulkActions:r}=Wt();return n?u.jsx(Ue,{icon:"pen-to-square",title:e,size:"32",onClick:r,disabled:o===0,...t}):null},HeaderBulkActions:function({className:e,...t}){const n=oe("io-panel-header-bulk-actions",e),{HeaderBulkActionSelect:o,HeaderBulkActionSelectDropdown:r,HeaderBulkActionMarkAsRead:i,HeaderBulkActionMarkAsUnread:a,HeaderBulkActionSnooze:s,HeaderBulkActionClear:c,HeaderBulkActionClose:l}=Er(),{isBulkActionsSupported:d}=Ce();return d?u.jsx("div",{className:n,...t,children:u.jsxs(We,{children:[u.jsx(o,{}),u.jsx(r,{}),u.jsx(i,{}),u.jsx(a,{}),u.jsx(s,{}),u.jsx(c,{}),u.jsx(l,{})]})}):null},HeaderBulkActionSelect:function({...e}){const{isBulkActionsSupported:t,selectedNotifications:n,selectAllNotifications:o,notificationsCount:r}=Ce();return t?u.jsx(bc,{checked:r===n.length&&r>0,onChange:i=>o("all",i.target.checked),disabled:r===0,...e}):null},HeaderBulkActionSelectDropdown:function({...e}){const{isBulkActionsSupported:t,selectAllNotifications:n,notificationsCount:o}=Ce();return t?u.jsxs(fe,{variant:"light",...e,children:[u.jsx(fe.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:o===0}),u.jsx(lm,{children:u.jsxs(fe.List,{variant:"single",checkIcon:"check",children:[u.jsx(fe.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map(r=>u.jsx(fe.Item,{onClick:()=>n(r.toLowerCase(),!0),children:r},r))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:e="envelope-open",size:t="32",variant:n="circle",tooltip:o="Mark as read",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:s,notificationsCount:c}=Ce(),l=v.useCallback(()=>{s(a,"Seen")},[a,s]);return i?u.jsx(Ue,{icon:e,size:t,variant:n,title:o,onClick:l,disabled:c===0,...r}):null},HeaderBulkActionMarkAsUnread:function({icon:e="envelope",size:t="32",variant:n="circle",tooltip:o="Mark as unread",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:s,notificationsCount:c}=Ce(),l=v.useCallback(()=>{s(a,"Active")},[a,s]);return i?u.jsx(Ue,{icon:e,size:t,variant:n,title:o,onClick:l,disabled:c===0,...r}):null},HeaderBulkActionSnooze:function({icon:e="snooze",size:t="32",variant:n="circle",tooltip:o="Snooze",...r}){var f,h;const{isBulkActionsSupported:i,selectedNotifications:a,snoozeMany:s,settings:c,notificationsCount:l}=Ce(),d=v.useCallback(()=>{var p;s(a,((p=c.snooze)==null?void 0:p.duration)??0)},[a,s,(f=c.snooze)==null?void 0:f.duration]);return i&&((h=c.snooze)!=null&&h.enabled)?u.jsx(Ue,{icon:e,size:t,variant:n,title:o,onClick:d,disabled:l===0,...r}):null},HeaderBulkActionClear:function({icon:e="trash",size:t="32",variant:n="circle",tooltip:o="Clear",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,clearMany:s,notificationsCount:c}=Ce(),l=v.useCallback(()=>{s(a)},[a,s]);return i?u.jsx(Ue,{icon:e,size:t,variant:n,title:o,onClick:l,disabled:c===0,...r}):null},HeaderBulkActionClose:function({text:e="Done",variant:t="primary",...n}){const{isBulkActionsSupported:o,notificationsCount:r}=Ce(),{hideBulkActions:i}=Wt();return o?u.jsx(Qe,{variant:t,text:e,onClick:i,disabled:r===0,...n}):null},HeaderSearch:function({className:e,placeholder:t="Search",iconPrepend:n="search",iconAppend:o="close",...r}){const i=oe("io-panel-header-search",e),a=v.useRef(null),{notificationsCount:s}=Ce(),{searchQuery:c,setSearch:l}=Wt(),d=c.length>0,f=v.useCallback(()=>{l(""),a.current&&a.current.focus()},[l]);return u.jsxs("div",{className:i,children:[u.jsx(Cr,{ref:a,value:c,iconPrepend:n,iconAppend:d?o:void 0,iconAppendOnClick:d?f:void 0,placeholder:t,onChange:h=>l(h.target.value),...r}),d&&u.jsx("p",{className:"io-panel-header-search-count",children:`${s} results`})]})},Body:c0,Footer:l0,FooterButtons:u0,FooterButtonClearAll:d0,FooterButtonClearAllOld:f0,Notification:Ac,NotificationsList:$d},I0=v.createContext(N0),T0=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...N0,...t}),[t]);return u.jsx(I0.Provider,{value:n,children:e})});function Er(e){return{...v.useContext(I0),...e}}T0.displayName="ComponentsStoreProvider";function R0(){var r,i;const e=v.useContext(Ie.IOConnectContext),{settings:t}=Ce(),n=Ke(),o=v.useCallback(async()=>{var c,l,d;const a=e.windows.my();if(!e||!a||!n)return;const s=a.placementSettings;await a.place({...s,snapped:!0,top:12,left:((c=t.placement)==null?void 0:c.panel)==="left"?12:void 0,right:((l=t.placement)==null?void 0:l.panel)==="right"?12:void 0,bottom:12,width:400,horizontalAlignment:(d=t.placement)==null?void 0:d.panel})},[e,n,(r=t.placement)==null?void 0:r.panel]);v.useEffect(()=>{var a;e&&((a=t.placement)!=null&&a.panel)&&n&&o().catch(console.error)},[e,n,o,(i=t.placement)==null?void 0:i.panel])}function iS({className:e,onClose:t,title:n="Notifications",...o}){var h,p;const{Header:r,Body:i}=Er(),{settings:a}=Ce(),{isPanelVisible:s}=Wt(),[c,l]=v.useState(!1),d=Ke(),f=oe("io-notifications-panel",((h=a.placement)==null?void 0:h.panel)==="left"&&"io-panel-left",((p=a.placement)==null?void 0:p.panel)==="right"&&"io-panel-right",e);return R0(),v.useEffect(()=>{s||l(!1)},[s]),u.jsxs(u.Fragment,{children:[u.jsxs(Xe,{className:f,...o,children:[u.jsx(r,{title:n,onClose:t,onOpenSettings:()=>l(!0)}),u.jsx(i,{})]}),d&&s&&u.jsx(Y2,{isOpen:c,onClose:()=>l(!1)})]})}const L0=({className:e,notifications:t,maxToasts:n=1,...o})=>{const r=oe("io-toasts-body",e),{NotificationsList:i,Notification:a}=H0(),[s,c]=v.useState([]);return v.useEffect(()=>{const l=n<0?t.length:n,d=t.filter(f=>f.state==="Active").slice(0,l);for(const f of d)f.onShow();c(d)},[t,n]),u.jsx("div",{className:r,...o,children:u.jsx(i,{Notification:a,notifications:s,noNotificationText:""})})};L0.displayName="Body";const D0={Body:L0,Notification:Ac,NotificationsList:$d},M0=v.createContext(D0),$0=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...D0,...t}),[t]);return u.jsx(M0.Provider,{value:n,children:e})});function H0(e){return{...v.useContext(M0),...e}}$0.displayName="ComponentsStoreProvider";function W0(){var r;const e=v.useContext(Ie.IOConnectContext),{settings:t}=Ce(),n=(r=t.placement)==null?void 0:r.toasts,o=v.useCallback(async()=>{const i=e.windows.my();if(!e||!i)return;const a=i.placementSettings;await i.place({...a,snapped:!0,left:n==="top-left"||n==="bottom-left"?12:void 0,right:n==="top-right"||n==="bottom-right"?12:void 0,width:400,verticalAlignment:n==="top-left"||n==="top-right"?"top":"bottom",horizontalAlignment:n==="top-right"||n==="bottom-right"?"right":"left"})},[e,n]);v.useEffect(()=>{e&&n&&o().catch(console.error)},[e,o,n])}function aS({className:e,maxToasts:t=10,...n}){var h;const{Header:o,Body:r,Footer:i}=H0(),{notifications:a,settings:s}=Ce(),c=v.useRef(null),l=function(p){const m=v.useContext(Ie.IOConnectContext),g=v.useRef(null),y=v.useRef(0),[w,k]=v.useState(!1),b=v.useCallback(async S=>{if(!m)return;const x=m.windows.my();if(!x)return;let C=1080;try{C=(await m.displays.getPrimary()).workArea.height}catch(L){console.warn("Could not get primary display, using fallback height:",L)}const T=Math.min(Math.max(S,92),C);if(k(S>=C),!(Math.abs(T-y.current)<5)){y.current=T;try{const L=x.placementSettings;await x.place({...L,height:T})}catch(L){console.error("Error updating toasts window height:",L)}}},[m]);return v.useEffect(()=>{if(!p.current||!m)return;const S=p.current,x=new ResizeObserver(C=>{const T=C.at(-1);if(!T)return;const{height:L}=T.contentRect,M=getComputedStyle(S),j=Number.parseInt(M.paddingTop,10),N=Number.parseInt(M.paddingBottom,10),O=(Number.isNaN(j)?0:j)+L+(Number.isNaN(N)?0:N);g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(O).catch(console.error)},100)});return x.observe(S),()=>{x.disconnect(),g.current&&clearTimeout(g.current)}},[m,b]),w}(c),d=(h=s.placement)==null?void 0:h.toasts,f=oe("io-toasts",(d==="top-left"||d==="top-right")&&"io-toasts-top",(d==="top-right"||d==="bottom-right")&&"io-toasts-right",(d==="bottom-left"||d==="bottom-right")&&"io-toasts-bottom",(d==="top-left"||d==="bottom-left")&&"io-toasts-left",l&&"io-toasts-max-height",e);return W0(),u.jsxs("div",{className:f,...n,children:[o&&u.jsx(o,{}),u.jsx("div",{ref:c,children:u.jsx(r,{notifications:a,maxToasts:t})}),i&&u.jsx(i,{})]})}var Hd=Object.freeze({__proto__:null,Notification:Ac,NotificationBody:x0,NotificationBodyDescription:C0,NotificationBodyIcon:S0,NotificationBodyTitle:k0,NotificationFooter:E0,NotificationFooterButton:A0,NotificationHeader:h0,NotificationHeaderBadge:m0,NotificationHeaderButtonClose:b0,NotificationHeaderButtonSnooze:w0,NotificationHeaderCount:p0,NotificationHeaderIcon:g0,NotificationHeaderTimestamp:y0,NotificationHeaderTitle:v0,NotificationStack:P0,NotificationsList:$d,NotificationsPanelProvider:({children:e})=>{const{searchQuery:t,setSearch:n,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:s,isBulkActionsVisible:c,showBulkActions:l,hideBulkActions:d}=function(){const h=v.useContext(Ie.IOConnectContext),[p,m]=v.useState(!1),[g,y]=v.useState("newest"),[w,k]=v.useState("all"),[b,S]=v.useState(""),[x,C]=v.useState(!1),T=Ke(),{isBulkActionsSupported:L}=Ce();return v.useEffect(()=>{const M=ht.onPanelVisibilityChanged(j=>m(j));return()=>{M()}},[]),v.useEffect(()=>{T!==null&&T&&(async()=>{const M=await h.notifications.panel.isVisible();m(M)})()},[h.notifications.panel,T]),v.useEffect(()=>{p||(C(!1),k("all"))},[p]),{isPanelVisible:p,sortNotificationsBy:g,setSortBy:M=>{y(M)},viewNotificationsBy:w,setViewBy:M=>{k(M)},searchQuery:b,setSearch:M=>{S(M)},isBulkActionsVisible:x,showBulkActions:()=>{L&&C(!0)},hideBulkActions:()=>{L&&C(!1)}}}(),f=v.useMemo(()=>({searchQuery:t,setSearch:n,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:s,isBulkActionsVisible:c,showBulkActions:l,hideBulkActions:d}),[t,n,o,r,i,a,s,c,l,d]);return u.jsx(t0.Provider,{value:f,children:e})},NotificationsProvider:({children:e})=>{const{notifications:t,notificationStacks:n,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:s,allowedApplications:c,clearAll:l,clearAllOld:d,close:f,hidePanel:h,showPanel:p,saveSetting:m,saveFilter:g,saveAllFilter:y,isBulkActionsSupported:w,selectedNotifications:k,selectNotification:b,selectAllNotifications:S,clearMany:x,snooze:C,snoozeMany:T,setState:L,setStates:M,setCount:j}=q2(),N=v.useMemo(()=>({notifications:t,notificationStacks:n,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:s,allowedApplications:c,clearAll:l,clearAllOld:d,onClose:f,hidePanel:h,showPanel:p,saveSetting:m,saveFilter:g,saveAllFilter:y,isBulkActionsSupported:w,selectedNotifications:k,selectNotification:b,selectAllNotifications:S,clearMany:x,snooze:C,snoozeMany:T,setState:L,setStates:M,setCount:j}),[t,n,o,r,i,a,s,c,l,d,f,h,p,m,g,y,w,k,b,S,x,C,T,L,M,j]);return u.jsx(Iv.Provider,{value:N,children:e})},Panel:function({components:e,settings:t,...n}){return u.jsx(Ld,{components:t,children:u.jsx(T0,{components:e,children:u.jsx(iS,{...n})})})},PanelBody:c0,PanelFooter:l0,PanelFooterButtonClearAll:d0,PanelFooterButtonClearAllOld:f0,PanelFooterButtons:u0,PanelHeader:n0,PanelHeaderCaptionTitle:o0,SettingsAllowNotificationToasts:Rv,SettingsAllowNotifications:Tv,SettingsCloseNotificationOnClick:Dv,SettingsGeneral:Ov,SettingsHideToastsAfter:$v,SettingsPanel:Dd,SettingsPanelAutoHide:Mv,SettingsPlacement:Bv,SettingsPlacementPanel:Uv,SettingsPlacementToasts:Kv,SettingsShowNotificationBadge:Lv,SettingsSnooze:Vv,SettingsSnoozeDuration:Gv,SettingsStacking:Hv,SettingsSubscribeAll:Jv,SettingsSubscribeApp:Zv,SettingsSubscribeMuteAll:Yv,SettingsSubscribeMuteApp:Xv,SettingsSubscriptions:qv,SettingsToastStackBy:Fv,SettingsToastStacking:Wv,Toasts:function({components:e,...t}){return u.jsx($0,{components:e,children:u.jsx(aS,{...t})})},useAddRemoveApps:Rd,useHidePanelOnFocusLost:function(e=!0){const t=v.useContext(Ie.IOConnectContext),n=Ke();return v.useEffect(()=>{var r;if(!t||!e||n===null||!n)return;const o=(r=t.windows.my())==null?void 0:r.onFocusChanged(i=>{i.isFocused||t.notifications.panel.hide().catch(a=>{console.error("Error hiding panel:",a)})});return()=>o==null?void 0:o()},[t,n,e]),t},useHidePanelOnKeyUp:function(e="Escape"){const{hidePanel:t}=Ce();Jx(e,t)},useNotificationStacking:Pv,useNotificationsContext:Ce,useNotificationsPanelContext:Wt,usePanelWindowPlacement:R0,useSelectNotifications:Nv,useShowHidePanelWindow:function(e=!0){const t=v.useContext(Ie.IOConnectContext),n=t==null?void 0:t.windows.my(),o=Ke(),{isPanelVisible:r}=Wt();return v.useEffect(()=>{t&&n&&o&&(r?n.show().then(()=>{e&&n.focus().catch(i=>{console.error("Error focusing window:",i)})}).catch(i=>console.error("Error showing window:",i)):n.hide().catch(i=>console.error("Error hiding window:",i)))},[t,n,o,r,e]),{myWindow:n}},useToastsWindowPlacement:W0});const F0=e=>{const{General:t,Launchpad:n,Layouts:o,Downloads:r,System:i}=Or();return u.jsxs(Jo,{element:ci,elementProps:e,children:[u.jsx(t,{}),u.jsx(n,{}),u.jsx(o,{}),u.jsx(r,{}),u.jsx(i,{})]})},B0=({title:e="General",...t})=>{const{Theme:n}=Or();return u.jsx(et,{title:e,...t,children:u.jsx(n,{})})},_c=({className:e,title:t="Theme",...n})=>{const{currentTheme:o,selectTheme:r}=Gx(),i=qx();return u.jsxs("div",{className:oe("flex jc-between ai-center",e),"data-testid":"theme-container",...n,children:[u.jsx("label",{className:"io-text-clipper","data-testid":"theme-label",children:t}),u.jsxs(fe,{variant:"light","data-testid":"theme-dropdown",children:[u.jsx(fe.Button,{text:(o==null?void 0:o.displayName)??"Dark","data-testid":"theme-dropdown-button"}),u.jsx(fe.Content,{"data-testid":"theme-dropdown-content",children:u.jsx(fe.List,{children:i.map(({displayName:a,name:s})=>u.jsx(fe.Item,{onClick:()=>r(s),"data-testid":`theme-dropdown-item-${s}`,children:a},s))})})]})]})},Kt=({prefKey:e,...t})=>{const{isLoading:n,value:o=!1,update:r}=Tt({prefKey:e});return u.jsx(Ct,{checked:o,disabled:n,onChange:i=>r(i.target.checked),...t})},z0=({align:e="right",label:t="Minimize to tray",...n})=>u.jsx(Kt,{align:e,label:t,prefKey:Bg,...n}),sS=({prefKey:e,options:t,disabled:n,...o})=>{const{isLoading:r,value:i="Select option",update:a}=Tt({prefKey:e});return u.jsxs(fe,{variant:"light",disabled:r||n,...o,children:[u.jsx(fe.Button,{children:i}),u.jsx(fe.Content,{children:u.jsx(fe.List,{children:t.map(s=>u.jsx(fe.Item,{onClick:()=>(async c=>{if(c!==i)try{await a(c)}catch(l){console.error("Failed to update platform preference:",l)}})(s),children:s},s))})})]})},U0=({className:e,label:t="Pinned position",...n})=>u.jsx(et,{className:oe("io-block-list-gap",e),...n,children:u.jsxs("div",{className:"flex jc-between ai-center",children:[u.jsx("label",{className:"io-text-clipper",children:t}),u.jsx(sS,{className:e,prefKey:Ug,options:["Left","Right"],...n})]})}),K0=({align:e="right",label:t="Allow docking to the top",...n})=>u.jsx(Kt,{align:e,label:t,prefKey:Kg,...n}),V0=({align:e="right",label:t="Docked Launchpad is always on top",...n})=>u.jsx(Kt,{align:e,label:t,prefKey:Vg,...n}),G0=({align:e="right",label:t="Docked Launchpad claims the occupied space",...n})=>u.jsx(Kt,{align:e,label:t,prefKey:Gg,...n}),q0=({align:e="right",label:t="Show the extended Launchpad area",...n})=>u.jsx(Kt,{align:e,label:t,prefKey:ya,...n}),J0=({align:e="right",label:t="Hide labels in extended Launchpad area",...n})=>{const{value:o}=Tt({prefKey:ya});return u.jsx(Kt,{align:e,label:t,prefKey:qg,disabled:!o,...n})},Z0=({align:e="right",label:t='Show "Favorites" in extended area',...n})=>{const{value:o}=Tt({prefKey:ya});return u.jsx(Kt,{align:e,label:t,prefKey:Jg,disabled:!o,...n})},Y0=({align:e="right",label:t='Show "Recent" in extended area',...n})=>{const{value:o}=Tt({prefKey:ya});return u.jsx(Kt,{align:e,label:t,prefKey:Yg,disabled:!o,...n})},X0=({align:e="right",label:t='Hide "Favorites" in expanded Launchpad',...n})=>u.jsx(Kt,{align:e,label:t,prefKey:Zg,...n}),Q0=({title:e="Layouts",...t})=>{const{LayoutsSaveCurrentOnExit:n,LayoutsShowDeletePrompt:o,LayoutsShowUnsavedChangesPrompt:r}=Or();return u.jsxs(et,{title:e,...t,children:[u.jsx(n,{}),u.jsx(r,{}),u.jsx(o,{})]})},ey=({align:e="right",label:t="Save current on exit",...n})=>u.jsx(Kt,{align:e,label:t,prefKey:Qg,...n}),jc=({align:e="right",label:t="Show prompt for unsaved changes",...n})=>u.jsx(Kt,{align:e,label:t,prefKey:ev,"data-testid":"layouts-show-unsaved-changes-prompt-toggle-button",...n}),Oc=({align:e="right",label:t="Show prompt for deleting",...n})=>u.jsx(Kt,{align:e,label:t,prefKey:tv,"data-testid":"layouts-show-delete-prompt-toggle",...n}),ty=({title:e="Downloads",...t})=>{const{DownloadsLocation:n}=Or();return u.jsx(et,{title:e,...t,children:u.jsx(n,{})})},ny=({className:e,label:t="Location",...n})=>{const{configuration:{downloadFolder:o},setDownloadLocationWithDialog:r,isDownloadLocationDialogVisible:i,downloadLocationList:a}=lo();return u.jsxs(et,{className:oe("io-preferences-download-section",e),...n,children:[u.jsxs("div",{className:"flex jc-between ai-center",children:[u.jsx("label",{className:"io-text-clipper",children:t}),u.jsx(Qe,{text:"Change",onClick:r,disabled:i})]}),u.jsx("p",{children:o??(a==null?void 0:a[0])??"Not set"})]})},oy=({align:e="right",label:t="Ask where to save each file before downloading",...n})=>u.jsx(Kt,{align:e,label:t,prefKey:nv,...n}),ry=({title:e="System",...t})=>{const{SystemRestartSection:n,SystemShutdownSection:o}=Or();return u.jsxs(et,{title:e,...t,children:[u.jsx(n,{}),u.jsx(o,{})]})},zh="T42.GD.Execute",iy=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ay=(e,t)=>e in t;function cS({time:e,frequency:t,day:n}){const[o,r]=e.split(":"),i=Number.parseInt(o,10),a=Number.parseInt(r,10);let s="*";return t==="weekly"&&n&&(s=function(c){const l={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if(!ay(c,l))throw new Error(`Invalid day: ${c}`);return l[c]}(n).toString()),`${a} ${i} * * ${s}`}function lS(e){const t=v.useContext(Ie.IOConnectContext),{value:n,update:o}=Tt({prefKey:Ua(e)}),{value:r,update:i}=Tt({prefKey:Ua(e,"Time")}),{value:a,update:s}=Tt({prefKey:Ua(e,"Frequency")}),{value:c,update:l}=Tt({prefKey:Ua(e,"Day")}),d=v.useCallback(async()=>{try{await t.interop.invoke(zh,{command:`cancel-${e}`})}catch(h){console.error(h)}},[t,e]),f=v.useCallback(async()=>{try{const h=cS({time:r??"12:00",frequency:a??"daily",day:a==="weekly"?c:"*"});await t.interop.invoke(zh,{command:`schedule-${e}`,args:{cronTime:h,discardUnsavedLayoutChanges:!1}})}catch(h){console.error(`Failed to update cron job for ${e}:`,h)}},[t,e,r,a,c]);return v.useEffect(()=>{t&&n&&f()},[t,n,r,a,c,f]),{enabled:n??!1,time:r??"12:00",frequency:a??"daily",day:c??"Monday",setEnabled:async h=>{h||await d();try{await o(h)}catch(p){console.error("Failed to update enabled state:",p)}},setTime:async h=>{try{await i(h)}catch(p){console.error("Failed to update time:",p)}},setFrequency:async h=>{try{await s(h),h==="daily"&&await l(void 0)}catch(p){console.error("Failed to update frequency:",p)}},setDay:async h=>{var p;if(p=h,iy.includes(p))try{await l(h)}catch(m){console.error("Failed to update day:",m)}else console.error("Invalid day provided")}}}function Ua(e,t){const n=e==="restart"?"_system_scheduleRestart":"_system_scheduleShutdown";return t?`${n}${t}`:n}function sy({className:e,variant:t,...n}){const o=oe("io-block-list-gap",t,e),{enabled:r,time:i,frequency:a,day:s,setEnabled:c,setTime:l,setFrequency:d,setDay:f}=lS(t);return u.jsxs(et,{className:o,...n,children:[u.jsx(Ct,{label:`Schedule ${t}`,align:"right",onChange:h=>c(h.target.checked),checked:r}),u.jsxs("div",{className:"scheduler-controls",children:[u.jsx("div",{className:"io-control-input io-control-leading-icon direction-up",children:u.jsx("input",{type:"time",className:"io-input",value:i,onChange:h=>l(h.target.value)})}),u.jsxs(_n,{text:a.charAt(0).toUpperCase()+a.slice(1),icon:"chevron-down",iconRight:!0,children:[u.jsx(_n.Item,{onClick:()=>d("daily"),children:"Daily"}),u.jsx(_n.Item,{onClick:()=>d("weekly"),children:"Weekly"})]}),a==="weekly"&&u.jsx(_n,{text:s,icon:"chevron-down",iconRight:!0,children:iy.map(h=>u.jsx(_n.Item,{onClick:()=>f(h),children:h},h))})]})]})}function cy({className:e,...t}){return u.jsx(sy,{...t,className:e,variant:"restart"})}function ly({className:e,...t}){return u.jsx(sy,{...t,className:e,variant:"shutdown"})}const uy={Body:F0,General:B0,Theme:_c,Launchpad:({title:e="Launchpad",...t})=>{const{MinimizeToTray:n,PinnedPosition:o,AllowDocking:r,DockedAlwaysOnTop:i,DockedClaimsSpace:a,ShowExtendedArea:s,HideLabelsInExtendedArea:c,ShowFavoritesInExtendedArea:l,ShowRecentAppsInExtendedArea:d,HideFavoritesFromLaunchpad:f}=Or();return u.jsxs(et,{title:e,...t,children:[u.jsx(n,{}),u.jsx(o,{}),u.jsx(r,{}),u.jsx(i,{}),u.jsx(a,{}),u.jsx(s,{}),u.jsx(c,{}),u.jsx(l,{}),u.jsx(d,{}),u.jsx(f,{})]})},MinimizeToTray:z0,PinnedPosition:U0,AllowDocking:K0,DockedAlwaysOnTop:V0,DockedClaimsSpace:G0,ShowExtendedArea:q0,HideLabelsInExtendedArea:J0,ShowFavoritesInExtendedArea:Z0,ShowRecentAppsInExtendedArea:Y0,HideFavoritesFromLaunchpad:X0,Layouts:Q0,LayoutsSaveCurrentOnExit:ey,LayoutsShowUnsavedChangesPrompt:jc,LayoutsShowDeletePrompt:Oc,Downloads:ty,DownloadsLocation:ny,DownloadsAskForEachDownload:oy,System:ry,SystemRestartSection:cy,SystemShutdownSection:ly},dy=v.createContext(uy),fy=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...uy,...t}),[t]);return u.jsx(dy.Provider,{value:n,children:e})});fy.displayName="PreferencesPanelComponentsStoreProvider";const Or=()=>v.useContext(dy),hy=({className:e,onClose:t,title:n="Platform Preferences",children:o,...r})=>u.jsxs(Xe,{className:oe("io-preferences-panel",e),"data-testid":"preferences-panel",...r,children:[u.jsxs(Xe.Header,{"data-testid":"preferences-panel-header",children:[u.jsx(Xe.Header.Title,{size:"large",text:n,tag:"h1","data-testid":"preferences-panel-title"}),u.jsx(Xe.Header.ButtonGroup,{children:u.jsx(Xe.Header.ButtonIcon,{className:"non-draggable",variant:"circle",icon:"close",size:"32",onClick:t,"data-testid":"preferences-panel-close-button"})})]}),o]}),uS=({onClose:e,title:t="Platform Preferences",...n})=>{const{Body:o}=Or();return u.jsx(hy,{title:t,onClose:e,...n,children:u.jsx(o,{})})},py=({components:e,...t})=>u.jsx(fy,{components:e,children:u.jsx(uS,{...t})});var dS=Object.freeze({__proto__:null,AllowDocking:K0,AutoClose:({align:e="right",label:t="Auto-close on starting apps and workspaces",...n})=>u.jsx(Kt,{align:e,label:t,prefKey:zg,disabled:!0,...n}),DockedAlwaysOnTop:V0,DockedClaimsSpace:G0,Downloads:ty,DownloadsAskForEachDownload:oy,DownloadsLocation:ny,General:B0,HideFavoritesFromLaunchpad:X0,HideLabelsInExtendedArea:J0,Layouts:Q0,LayoutsRestoreLastSaved:({align:e="right",label:t="Restore last saved on startup",...n})=>u.jsx(Kt,{align:e,label:t,prefKey:Xg,...n}),LayoutsSaveCurrentOnExit:ey,LayoutsShowDeletePrompt:Oc,LayoutsShowUnsavedChangesPrompt:jc,MinimizeToTray:z0,Panel:py,PanelBody:F0,PinnedPosition:U0,ShowExtendedArea:q0,ShowFavoritesInExtendedArea:Z0,ShowRecentAppsInExtendedArea:Y0,System:ry,SystemRestartSection:cy,SystemShutdownSection:ly,Theme:_c});const my=e=>{const{General:t,Layouts:n}=Pc();return u.jsxs(Jo,{element:ci,elementProps:e,children:[u.jsx(t,{}),u.jsx(n,{})]})},gy=({title:e="General",...t})=>{const{Theme:n}=Pc();return u.jsx(et,{title:e,"data-testid":"preferences-panel-general-block",...t,children:u.jsx(n,{})})},vy=({title:e="Layouts",...t})=>{const{LayoutsShowDeletePrompt:n}=Pc();return u.jsx(et,{title:e,"data-testid":"preferences-panel-layouts-block",...t,children:u.jsx(n,{})})},yy={Body:my,General:gy,Theme:_c,Layouts:vy,LayoutsShowUnsavedChangesPrompt:jc,LayoutsShowDeletePrompt:Oc},wy=v.createContext(yy),by=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...yy,...t}),[t]);return u.jsx(wy.Provider,{value:n,children:e})});by.displayName="PreferencesPanelComponentsStoreProvider";const Pc=()=>v.useContext(wy),fS=({onClose:e,title:t="Platform Preferences",...n})=>{const{Body:o}=Pc();return u.jsx(hy,{title:t,onClose:e,...n,children:u.jsx(o,{})})};var hS=Object.freeze({__proto__:null,General:gy,Layouts:vy,LayoutsShowDeletePrompt:Oc,LayoutsShowUnsavedChangesPrompt:jc,Panel:({components:e,...t})=>u.jsx(by,{components:e,children:u.jsx(fS,{...t})}),PanelBody:my,Theme:_c});const pS=({name:e,value:t})=>u.jsxs("div",{className:"io-profile-section-item",children:[u.jsx("div",{className:"io-profile-section-item-name",children:e}),u.jsx("div",{className:"io-profile-section-item-value",children:t})]}),xy=({className:e,items:t,title:n})=>u.jsxs("div",{className:oe("io-profile-section-body",e),children:[n&&u.jsx(zn,{className:"io-profile-section-title",text:n}),t.map(({name:o,value:r})=>u.jsx(pS,{name:o,value:r},o))]}),Wd=({className:e,items:t,title:n})=>u.jsxs("section",{className:oe("io-profile-section",e),children:[u.jsx(xy,{items:t,title:n}),u.jsx(bi,{className:"mt-8"})]}),Sy=({title:e="License",...t})=>u.jsx(Wd,{title:e,...t}),ky=({title:e="Version",...t})=>u.jsx(Wd,{title:e,...t}),Cy=({title:e="Plugins",...t})=>u.jsx(Wd,{title:e,...t}),Ey=({className:e})=>{const t=xc()?"io.Connect Desktop":"io.Connect Browser";return u.jsxs("div",{className:oe("io-trademark-container",e),children:[u.jsx("h4",{className:"io-trademark-title",children:t}),u.jsxs("p",{className:"io-trademark-text",children:[t,"® is a registered trademark of"," ",u.jsx("a",{href:"https://www.interop.io",rel:"noreferrer",target:"_blank",children:"Interop Inc©"})," ",new Date().getFullYear(),". All rights reserved."]})]})},Ay=({avatarInitials:e=xc()?"CD":"CB",className:t,items:n,onLogout:o,title:r})=>u.jsxs("section",{className:oe("io-profile-section",t),children:[u.jsxs("div",{className:"io-user-details-container",children:[u.jsx("div",{className:"io-user-avatar",children:e}),u.jsx(xy,{className:"mt-12",items:n,title:r})]}),o&&u.jsx(Qe,{className:"io-log-out-button",onClick:o,variant:"primary",icon:"arrow-right-from-bracket",children:"Log out"}),u.jsx(bi,{className:"mt-8"})]}),_y={LicenseSection:Sy,ProductsInfoSection:ky,PluginsSection:Cy,Trademark:Ey,UserSection:Ay},jy=v.createContext(_y),Oy=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({..._y,...t}),[t]);return u.jsx(jy.Provider,{value:n,children:e})});Oy.displayName="ProfilePanelComponentsStoreProvider";const mS=e=>{const t=new Date(e);return[{day:"numeric"},{month:"short"},{year:"numeric"}].map(n=>t.toLocaleDateString("en",n)).join(" ")},gS=e=>{if(!e)return{items:[]};const t=[...e.email?[{name:"Email",value:e.email}]:[],...e.type?[{name:"User Type",value:e.type}]:[],...e.role?[{name:"User Role",value:e.role}]:[],{name:"User ID",value:e.id}];if(e.firstName||e.lastName){const n=[e.firstName,e.lastName].filter(o=>!!o);return{avatarInitials:n.map(o=>o.charAt(0)).join(""),items:t,title:n.join(" ")}}return e.username?{avatarInitials:e.username.charAt(0),items:t,title:e.username}:e.email?{avatarInitials:e.email.charAt(0),items:t}:{items:t}},vS=e=>{const t=new Date(2023,5,6),n=e.expiration<t.getTime()?1e3:1;return{items:[{name:"Type",value:e.type},{name:"Expiration Date",value:mS(e.expiration*n)}]}},yS=e=>({items:e.map(t=>({name:t.name,value:t.version}))}),wS=e=>{var n;const t={"@interopio/workspaces-ui-react":"Workspaces React Frame","@interopio/workspaces-ui-web-components":"Workspaces Web Components Frame"};return{items:[{name:"io.Connect Browser platform",value:e.platform.apiVersion},{name:"io.Connect Browser client",value:e.client.apiVersion},...e.workspaces?[{name:"Workspaces API",value:e.workspaces.apiVersion}]:[],...(n=e.workspaces)!=null&&n.container&&ay(e.workspaces.container.type,t)?[{name:t[e.workspaces.container.type],value:e.workspaces.container.version}]:[],...e.home?[{name:"Home UI",value:e.home.version}]:[],...e.search?[{name:"Search API",value:e.search.apiVersion}]:[],...e.modals?[{name:"Modals API",value:e.modals.apiVersion}]:[]]}},bS=()=>{const e=window.glue42gd??window.iodesktop;if(!e)throw new Error("both window.glue42gd and window.iodesktop are not available");const{user:t,env:n}=e,o=[{name:"Environment",value:n.env},{name:"Region",value:n.region}];return t?{avatarInitials:t.charAt(0),items:o,title:t}:{items:o}},xS=e=>({items:Object.entries(e??{}).map(([n,o])=>({name:n,value:o}))}),SS=(e=[])=>({items:e.map(({product:t,version:n})=>({name:t,value:n}))}),kS=e=>xc()?(async t=>{const{licInfo:n,productInfo:o}=(await t.interop.invoke("T42.GD.GetInfo")).returned;return{user:bS(),license:xS(n),productsInfo:SS(o)}})(e):(async()=>{if(!window.iobrowser)throw new Error("window.iobrowser is not available");const t=await window.iobrowser.system.getProfileData();return{user:gS(t.user),license:vS(t.license),plugins:yS(t.plugins),productsInfo:wS(t.productsInfo)}})(),CS=({className:e,onClose:t,onLogout:n,title:o="Profile",...r})=>{var p;const{LicenseSection:i,ProductsInfoSection:a,PluginsSection:s,Trademark:c,UserSection:l}=v.useContext(jy),d=v.useContext(Ie.IOConnectContext),[f,h]=v.useState(null);return v.useEffect(()=>{d&&(async()=>{const m=await kS(d);h(m)})().catch(console.error)},[d]),u.jsxs(Xe,{className:oe("io-profile-panel",e),"data-testid":"profile-panel",...r,children:[u.jsxs(Xe.Header,{children:[u.jsx(Xe.Header.Title,{size:"large",text:o}),u.jsx(Xe.Header.ButtonGroup,{children:u.jsx(Xe.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:t})})]}),u.jsxs(Jo,{element:Xe.Body,children:[f!=null&&f.user.items.length||f!=null&&f.user.title?u.jsx(l,{avatarInitials:f.user.avatarInitials,items:f.user.items,onLogout:n,title:f.user.title}):null,u.jsxs("div",{className:"io-profile-sections-container",children:[f!=null&&f.license.items.length?u.jsx(i,{items:f.license.items}):null,f!=null&&f.productsInfo.items.length?u.jsx(a,{items:f.productsInfo.items}):null,(p=f==null?void 0:f.plugins)!=null&&p.items.length?u.jsx(s,{items:f.plugins.items}):null]}),u.jsx(c,{className:"mt-auto"})]})]})},Py=({components:e,...t})=>u.jsx(Oy,{components:e,children:u.jsx(CS,{...t})});var Ny=Object.freeze({__proto__:null,LicenseSection:Sy,Panel:Py,PluginsSection:Cy,ProductsInfoSection:ky,Trademark:Ey,UserSection:Ay});const Iy=v.createContext(void 0),Uh=()=>{const e=v.useContext(Iy);if(!e)throw new Error("usePanelManagerContext must be used within a PanelManagerContext.Provider");return e},ES=document.querySelector("#root")??document.body,AS={preferences:py,"notification-settings":Dd,profile:Py};var _S=Object.freeze({__proto__:null,ActivePanelRenderer:()=>{const{panel:e,deselectPanel:t}=Uh();Gl(()=>{e&&t()},["Escape"]);const n=e?AS[e]:null;return n?jo.createPortal(u.jsx("div",{className:"io-panel-overlay",children:u.jsx(n,{onClose:t})}),ES):null},PanelManagerProvider:({children:e})=>{const[t,n]=v.useState(null),o=v.useCallback(a=>{n(a)},[]),r=v.useCallback(()=>{n(null)},[]),i=v.useMemo(()=>({panel:t,selectPanel:o,deselectPanel:r}),[t,o,r]);return u.jsx(Iy.Provider,{value:i,children:e})},usePanelManagerContext:Uh});const jS=dS,OS=hS,qi=e=>"items"in e,Rt={APPLICATION:"application",WORKSPACE:"workspace",LAYOUT:"layout",ACTION_BUTTON:"action-button"},Eu=e=>typeof e=="string"?e:e!=null&&e.message?typeof e.message=="string"?e.message:JSON.stringify(e.message):JSON.stringify(e),Ty=()=>typeof window.glue42gd<"u"||typeof window.glue42alert<"u"||typeof window.glue42dialog<"u"||typeof window.iodesktop<"u",Ms={OPEN_IN_NEW_WINDOW:"openInNewWindow",OPEN_IN_NEW_WORKSPACE:"openInNewWorkspace"},Ry=Ty()?[]:[{name:Ms.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out"},{name:Ms.OPEN_IN_NEW_WORKSPACE,displayName:"Open in a new Workspace",icon:"pop-out"}],$s={OPEN_IN_NEW_WINDOW:"openInNewWindow",DELETE:"delete"},Ly=[{name:$s.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out",separatorAfter:!0},{name:$s.DELETE,displayName:"Delete",icon:"trash-can"}],la={ASCENDING:"ascending",DESCENDING:"descending",DISABLED:"disabled"},Nc=new Intl.Collator(void 0,{sensitivity:"base"}),Dy=(e,t)=>Nc.compare(e.title,t.title),My=(e,t)=>Nc.compare(t.title,e.title),Fd=e=>{const{items:t,sortOrder:n,ascendingCompare:o,descendingCompare:r}=e;if(n===la.DISABLED)return t;const i=n===la.ASCENDING?o:r;return[...t].sort(i)},oi={FAVORITES:"favorites-section",WORKSPACES:"workspaces-section",APPLICATIONS:"applications-section"},Au=e=>{var m;const{items:t,newItem:n,settings:o,path:r,accumulatedPath:i=""}=e,{isFolderCollapsible:a}=o,s="/",[c,...l]=r.split(s),d=i?`${i}/${c}`:c,f=t.findIndex(g=>qi(g)&&g.title===c),h=f!==-1?t[f]:null;if(!h){const g=l.length>0?Au({items:[],newItem:n,settings:o,path:l.join(s),accumulatedPath:d}):[n];return[...t,{id:c,title:c,items:g,isCollapsible:a,getIcon:(m=o.folderIconGetters)==null?void 0:m[d]}]}const p=l.length>0?Au({items:h.items,newItem:n,settings:o,path:l.join(s),accumulatedPath:d}):[...h.items,n];return[...t.slice(0,f),{...h,items:p},...t.slice(f+1)]},Hs=e=>{const{title:t,userProperties:n}=e,{folder:o}=n;return o?`${o}/${t}`:t},PS=(e,t)=>Nc.compare(Hs(e),Hs(t)),NS=(e,t)=>Nc.compare(Hs(t),Hs(e)),IS=(e,t,n)=>{const{isSectionCollapsible:o,sortOrder:r=la.ASCENDING}=n,a=Fd({items:e,sortOrder:r,ascendingCompare:PS,descendingCompare:NS}).reduce((s,c)=>{var f;const l={id:c.id,title:c.title,description:c.caption,type:Rt.APPLICATION,icon:"application",iconSrc:c.icon,openInstances:(f=t[c.name])==null?void 0:f.length,contextMenuActions:Ry},d=c.userProperties.folder;return d?Au({items:s,newItem:l,settings:n,path:d}):[...s,l]},[]);return{id:oi.APPLICATIONS,title:"Apps",items:a,isCollapsible:o}};var TS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ic(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _u={exports:{}},Ka={exports:{}},Ve={};/** @license React v16.13.1
|
|
16
|
+
*/ki.displayName="PanelBody",ei.ButtonGroup=De,ei.Button=et,ei.ButtonIcon=Ue,ei.Dropdown=pe,nt.Header=Lo,nt.Body=ki,nt.Footer=ei,Tc.Icon=xt;const an=(e,t)=>{const{o:n,i:o,u:r}=e;let i,a=n;const s=(c,u)=>{const d=a,f=c,h=u||(o?!o(d,f):d!==f);return(h||r)&&(a=f,i=d),[a,h,i]};return[t?c=>s(t(a,i),c):s,c=>[a,!!c,i]]},Yt=typeof window<"u"&&typeof HTMLElement<"u"&&window.document?window:{},Ig=Math.max,Bx=Math.min,Tu=Math.round,Fo=Math.abs,zh=Math.sign,Rg=Yt.cancelAnimationFrame,Md=Yt.requestAnimationFrame,$d=Yt.setTimeout,Lg=Yt.clearTimeout,Nc=e=>Yt[e]!==void 0?Yt[e]:void 0,Wx=Nc("MutationObserver"),Uh=Nc("IntersectionObserver"),ii=Nc("ResizeObserver"),ra=Nc("ScrollTimeline"),Hd=e=>e===void 0,Ic=e=>e===null,Go=e=>typeof e=="number",Mi=e=>typeof e=="string",Rc=e=>typeof e=="boolean",Dn=e=>typeof e=="function",bn=e=>Array.isArray(e),Xs=e=>typeof e=="object"&&!bn(e)&&!Ic(e),Bd=e=>{const t=!!e&&e.length,n=Go(t)&&t>-1&&t%1==0;return!!(bn(e)||!Dn(e)&&n)&&(!(t>0&&Xs(e))||t-1 in e)},xa=e=>!!e&&e.constructor===Object,Qs=e=>e instanceof HTMLElement,Lc=e=>e instanceof Element;function Ye(e,t){if(Bd(e))for(let n=0;n<e.length&&t(e[n],n,e)!==!1;n++);else e&&Ye(Object.keys(e),n=>t(e[n],n,e));return e}const Dg=(e,t)=>e.indexOf(t)>=0,Ci=(e,t)=>e.concat(t),ut=(e,t,n)=>(!Mi(t)&&Bd(t)?Array.prototype.push.apply(e,t):e.push(t),e),rr=e=>Array.from(e||[]),Wd=e=>bn(e)?e:!Mi(e)&&Bd(e)?rr(e):[e],ec=e=>!!e&&!e.length,tc=e=>rr(new Set(e)),fn=(e,t,n)=>{Ye(e,o=>!o||o.apply(void 0,t||[])),n||(e.length=0)},Mg="paddingTop",$g="paddingRight",Hg="paddingLeft",Bg="paddingBottom",Wg="marginLeft",Fg="marginRight",zg="marginBottom",Fd="overflowX",zd="overflowY",Dc="width",Mc="height",lo="visible",In="hidden",Ei="scroll",$c=(e,t,n,o)=>{if(e&&t){let r=!0;return Ye(n,i=>{e[i]!==t[i]&&(r=!1)}),r}return!1},Ug=(e,t)=>$c(e,t,["w","h"]),Ts=(e,t)=>$c(e,t,["x","y"]),Fx=(e,t)=>$c(e,t,["t","r","b","l"]),je=(e,...t)=>e.bind(0,...t),ai=e=>{let t;const n=e?$d:Md,o=e?Lg:Rg;return[r=>{o(t),t=n(()=>r(),Dn(e)?e():e)},()=>o(t)]},Kh=e=>{const t=Dn(e)?e():e;if(Go(t)){const n=t?$d:Md,o=t?Lg:Rg;return r=>{const i=n(()=>r(),t);return()=>{o(i)}}}return t&&t._},Kg=(e,t)=>{const{p:n,v:o,S:r,m:i}=t||{};let a,s,c,u;const d=function(m){s&&s(),a&&a(),u=s=a=c=void 0,e.apply(this,m)},f=m=>i&&c?i(c,m):m,h=()=>{s&&c&&d(f(c)||c)},p=function(){const m=rr(arguments),g=Kh(n);if(g){const y=typeof r=="function"?r():r,w=Kh(o),S=f(m)||m,b=d.bind(0,S);s&&s(),y&&!u?(b(),u=!0,s=g(()=>u=void 0)):(s=g(b),w&&!a&&(a=w(h))),c=S}else d(m)};return p.O=h,p},Vg=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Jt=e=>e?Object.keys(e):[],ze=(e,t,n,o,r,i,a)=>{const s=[t,n,o,r,i,a];return typeof e=="object"&&!Ic(e)||Dn(e)||(e={}),Ye(s,c=>{Ye(c,(u,d)=>{const f=c[d];if(e===f)return!0;const h=bn(f);if(f&&xa(f)){const p=e[d];let m=p;h&&!bn(p)?m=[]:h||xa(p)||(m={}),e[d]=ze(m,f)}else e[d]=h?f.slice():f})}),e},Gg=(e,t)=>Ye(ze({},e),(n,o,r)=>{n===void 0?delete r[o]:n&&xa(n)&&(r[o]=Gg(n))}),Ud=e=>!Jt(e).length,Sa=()=>{},qg=(e,t,n)=>Ig(e,Bx(t,n)),Tr=e=>tc((bn(e)?e:(e||"").split(" ")).filter(t=>t)),Kd=(e,t)=>e&&e.getAttribute(t),Vh=(e,t)=>e&&e.hasAttribute(t),ao=(e,t,n)=>{Ye(Tr(t),o=>{e&&e.setAttribute(o,String(n||""))})},Wn=(e,t)=>{Ye(Tr(t),n=>e&&e.removeAttribute(n))},Hc=(e,t)=>{const n=Tr(Kd(e,t)),o=je(ao,e,t),r=(i,a)=>{const s=new Set(n);return Ye(Tr(i),c=>{s[a](c)}),rr(s).join(" ")};return{C:i=>o(r(i,"delete")),$:i=>o(r(i,"add")),H:i=>{const a=Tr(i);return a.reduce((s,c)=>s&&n.includes(c),a.length>0)}}},Jg=(e,t,n)=>(Hc(e,t).C(n),je(Vd,e,t,n)),Vd=(e,t,n)=>(Hc(e,t).$(n),je(Jg,e,t,n)),nc=(e,t,n,o)=>(o?Vd:Jg)(e,t,n),Gd=(e,t,n)=>Hc(e,t).H(n),Zg=e=>Hc(e,"class"),Yg=(e,t)=>{Zg(e).C(t)},qd=(e,t)=>(Zg(e).$(t),je(Yg,e,t)),Gh=(e,t)=>{const n=t?Lc(t)&&t:document;return n?rr(n.querySelectorAll(e)):[]},Nu=(e,t)=>Lc(e)&&e.matches(t),Xg=e=>Nu(e,"body"),Iu=e=>e?rr(e.childNodes):[],ka=e=>e&&e.parentElement,si=(e,t)=>Lc(e)&&e.closest(t),Ru=e=>document.activeElement,zx=(e,t,n)=>{const o=si(e,t),r=e&&((a,s)=>{const c=s?Lc(s)&&s:document;return c&&c.querySelector(a)})(n,o),i=si(r,t)===o;return!(!o||!r)&&(o===e||r===e||i&&si(si(e,n),t)!==o)},ji=e=>{Ye(Wd(e),t=>{const n=ka(t);t&&n&&n.removeChild(t)})},Zt=(e,t)=>je(ji,e&&t&&Ye(Wd(t),n=>{n&&e.appendChild(n)}));let Qg;const mi=e=>{const t=document.createElement("div");return ao(t,"class",e),t},ev=e=>{const t=mi(),n=Qg,o=e.trim();return t.innerHTML=n?n.createHTML(o):o,Ye(Iu(t),r=>ji(r))},qh=(e,t)=>e.getPropertyValue(t)||e[t]||"",tv=e=>{const t=e||0;return isFinite(t)?t:0},os=e=>tv(parseFloat(e||"")),Lu=e=>Math.round(1e4*e)/1e4,nv=e=>`${Lu(tv(e))}px`;function Ca(e,t){e&&t&&Ye(t,(n,o)=>{try{const r=e.style,i=Ic(n)||Rc(n)?"":Go(n)?nv(n):n;o.indexOf("--")===0?r.setProperty(o,i):r[o]=i}catch{}})}function Jn(e,t,n){const o=Mi(t);let r=o?"":{};if(e){const i=Yt.getComputedStyle(e,n)||e.style;r=o?qh(i,t):rr(t).reduce((a,s)=>(a[s]=qh(i,s),a),r)}return r}const Jh=(e,t,n)=>{const o=t?`${t}-`:"",r=n?`-${n}`:"",i=`${o}top${r}`,a=`${o}right${r}`,s=`${o}bottom${r}`,c=`${o}left${r}`,u=Jn(e,[i,a,s,c]);return{t:os(u[i]),r:os(u[a]),b:os(u[s]),l:os(u[c])}},_l=(e,t)=>"translate"+(Xs(e)?`(${e.x},${e.y})`:`${t?"X":"Y"}(${e})`),Ux={w:0,h:0},Bc=(e,t)=>t?{w:t[`${e}Width`],h:t[`${e}Height`]}:Ux,Kx=e=>Bc("inner",e||Yt),gi=je(Bc,"offset"),ov=je(Bc,"client"),oc=je(Bc,"scroll"),Jd=e=>{const t=parseFloat(Jn(e,Dc))||0,n=parseFloat(Jn(e,Mc))||0;return{w:t-Tu(t),h:n-Tu(n)}},Tl=e=>e.getBoundingClientRect(),Du=e=>!(!e||!e[Mc]&&!e[Dc]),rv=(e,t)=>{const n=Du(e);return!Du(t)&&n},Zh=(e,t,n,o)=>{Ye(Tr(t),r=>{e&&e.removeEventListener(r,n,o)})},at=(e,t,n,o)=>{var r;const i=(r=o&&o.I)==null||r,a=o&&o.A||!1,s=o&&o.T||!1,c={passive:i,capture:a};return je(fn,Tr(t).map(u=>{const d=s?f=>{Zh(e,u,d,a),n&&n(f)}:n;return e&&e.addEventListener(u,d,c),je(Zh,e,u,d,a)}))},iv=e=>e.stopPropagation(),Mu=e=>e.preventDefault(),av=e=>iv(e)||Mu(e),Un=(e,t)=>{const{x:n,y:o}=Go(t)?{x:t,y:t}:t||{};Go(n)&&(e.scrollLeft=n),Go(o)&&(e.scrollTop=o)},cn=e=>({x:e.scrollLeft,y:e.scrollTop}),Vx=(e,t)=>{const{D:n,M:o}=e,{w:r,h:i}=t,a=(f,h,p)=>{let m=zh(f)*p,g=zh(h)*p;if(m===g){const y=Fo(f),w=Fo(h);g=y>w?0:g,m=y<w?0:m}return m=m===g?0:m,[m+0,g+0]},[s,c]=a(n.x,o.x,r),[u,d]=a(n.y,o.y,i);return{D:{x:s,y:u},M:{x:c,y:d}}},Nl=({D:e,M:t})=>{const n=(o,r)=>o===0&&o<=r;return{x:n(e.x,t.x),y:n(e.y,t.y)}},Yh=({D:e,M:t},n)=>{const o=(r,i,a)=>qg(0,1,(r-a)/(r-i)||0);return{x:o(e.x,t.x,n.x),y:o(e.y,t.y,n.y)}},$u=e=>{e&&e.focus&&e.focus({preventScroll:!0,focusVisible:!1})},Xh=(e,t)=>{Ye(Wd(t),e)},Hu=e=>{const t=new Map,n=(r,i)=>{if(r){const a=t.get(r);Xh(s=>{a&&a[s?"delete":"clear"](s)},i)}else t.forEach(a=>{a.clear()}),t.clear()},o=(r,i)=>{if(Mi(r)){const c=t.get(r)||new Set;return t.set(r,c),Xh(u=>{Dn(u)&&c.add(u)},i),je(n,r,i)}Rc(i)&&i&&n();const a=Jt(r),s=[];return Ye(a,c=>{const u=r[c];u&&ut(s,o(c,u))}),je(fn,s)};return o(e||{}),[o,n,(r,i)=>{Ye(rr(t.get(r)),a=>{i&&!ec(i)?a.apply(0,i):a()})}]},sv={},cv={},lv=(e,t,n)=>Jt(e).map(o=>{const{static:r,instance:i}=e[o],[a,s,c]=n||[],u=n?i:r;if(u){const d=n?u(a,s,t):u(t);return(c||cv)[o]=d}}),$i=e=>cv[e],Hi="data-overlayscrollbars",Ns="os-environment",rs=`${Ns}-scrollbar-hidden`,Il=`${Hi}-initialize`,Is="noClipping",Qh=`${Hi}-body`,qo=Hi,so=`${Hi}-viewport`,Gx=Fd,qx=zd,uv="measuring",dv="scrollbarHidden",Bu=`${Hi}-padding`,ep=`${Hi}-content`,Zd="os-size-observer",Jx=`${Zd}-appear`,Zx=`${Zd}-listener`,mn="os-scrollbar",Yx=`${mn}-rtl`,Xx=`${mn}-horizontal`,Qx=`${mn}-vertical`,fv=`${mn}-track`,Yd=`${mn}-handle`,e2=`${mn}-visible`,t2=`${mn}-cornerless`,tp=`${mn}-interaction`,np=`${mn}-unusable`,Wu=`${mn}-auto-hide`,op=`${Wu}-hidden`,rp=`${mn}-wheel`,n2=`${fv}-interactive`,o2=`${Yd}-interactive`,ci=e=>e.indexOf(lo)===0,Fu=(e,t)=>{if(e==="auto")return t?Ei:In;const n=e||In;return[In,Ei,lo].includes(n)?n:In},r2=(e,t)=>{const{overflowX:n,overflowY:o}=Jn(e,[Fd,zd]);return{x:Fu(n,t.x),y:Fu(o,t.y)}},Xd="__osScrollbarsHidingPlugin",ip=e=>JSON.stringify(e,(t,n)=>{if(Dn(n))throw 0;return n}),ap=(e,t)=>e?`${t}`.split(".").reduce((n,o)=>n&&Vg(n,o)?n[o]:void 0,e):void 0,hv=[33,99],pv=[222,666,!0],i2={paddingAbsolute:!1,showNativeOverlaidScrollbars:!1,update:{elementEvents:[["img","load"]],debounce:{mutation:[0,33],resize:null,event:hv,env:pv},attributes:null,ignoreMutation:null,flowDirectionStyles:null},overflow:{x:"scroll",y:"scroll"},scrollbars:{theme:"os-theme-dark",visibility:"auto",autoHide:"never",autoHideDelay:1300,autoHideSuspend:!1,dragScroll:!0,clickScroll:!1,pointers:["mouse","touch","pen"]}},mv=(e,t)=>{const n={};return Ye(Ci(Jt(t),Jt(e)),o=>{const r=e[o],i=t[o];if(Xs(r)&&Xs(i))ze(n[o]={},mv(r,i)),Ud(n[o])&&delete n[o];else if(Vg(t,o)&&i!==r){let a=!0;if(bn(r)||bn(i))try{ip(r)===ip(i)&&(a=!1)}catch{}a&&(n[o]=i)}}),n},sp=(e,t,n)=>o=>[ap(e,o),n||ap(t,o)!==void 0];let gv,Rl;const a2=()=>{const e=(w,S,b)=>{Zt(document.body,w),Zt(document.body,w);const k=ov(w),x=gi(w),C=Jd(S);return b&&ji(w),{x:x.h-k.h+C.h,y:x.w-k.w+C.w}},t=ev(`<div class="${Ns}"><div></div><style>${`.${Ns}{scroll-behavior:auto!important;position:fixed;opacity:0;visibility:hidden;overflow:scroll;height:200px;width:200px;z-index:-1}.${Ns} div{width:200%;height:200%;margin:10px 0}.${rs}{scrollbar-width:none!important}.${rs}::-webkit-scrollbar,.${rs}::-webkit-scrollbar-corner{appearance:none!important;display:none!important;width:0!important;height:0!important}`}</style></div>`)[0],n=t.firstChild,o=t.lastChild,r=gv;r&&(o.nonce=r);const[i,,a]=Hu(),[s,c]=an({o:e(t,n),i:Ts},je(e,t,n,!0)),[u]=c(),d=(w=>{let S=!1;const b=qd(w,rs);try{S=Jn(w,"scrollbar-width")==="none"||Jn(w,"display","::-webkit-scrollbar")==="none"}catch{}return b(),S})(t),f={x:u.x===0,y:u.y===0},h={elements:{host:null,padding:!d,viewport:w=>d&&Xg(w)&&w,content:!1},scrollbars:{slot:!0},cancel:{nativeScrollbarsOverlaid:!1,body:null}},p=ze({},i2),m=je(ze,{},p),g=je(ze,{},h),y={P:u,k:f,U:d,J:!!ra,G:je(i,"r"),K:g,Z:w=>ze(h,w)&&g(),tt:m,nt:w=>ze(p,w)&&m(),ot:ze({},h),st:ze({},p)};if(Wn(t,"style"),ji(t),at(Yt,"resize",()=>{a("r",[])}),Dn(Yt.matchMedia)&&!d&&(!f.x||!f.y)){const w=S=>{const b=Yt.matchMedia(`(resolution: ${Yt.devicePixelRatio}dppx)`);at(b,"change",()=>{S(),w(S)},{T:!0})};w(()=>{const[S,b]=s();ze(y.P,S),a("r",[b])})}return y},Zn=()=>(Rl||(Rl=a2()),Rl),cp=(e,t,n,o)=>{let r=!1;const{et:i,ct:a,rt:s,it:c,lt:u,ut:d}=o||{},[f,h]=((w,S,b)=>{let k=!1;const x=!!b&&new WeakMap,C=I=>{if(x&&b){const R=b.map(M=>{const[_,T]=M||[];return[T&&_?(I||Gh)(_,w):[],T]});Ye(R,M=>Ye(M[0],_=>{const T=M[1],P=x.get(_)||[];if(w.contains(_)&&T){const X=at(_,T,te=>{k?(X(),x.delete(_)):S(te)});x.set(_,ut(P,X))}else fn(P),x.delete(_)}))}};return C(),[()=>{k=!0},C]})(e,()=>r&&n(!0),s),p=a||[],m=Ci(i||[],p),g=(w,S)=>{if(!ec(S)){const b=u||Sa,k=d||Sa,x=[],C=[];let I=!1,R=!1;if(Ye(S,M=>{const{attributeName:_,target:T,type:P,oldValue:X,addedNodes:te,removedNodes:W}=M,J=P==="attributes",L=P==="childList",G=e===T,F=J&&_,N=F&&Kd(T,_||""),$=Mi(N)?N:null,H=F&&X!==$,B=Dg(p,_)&&H;if(t&&(L||!G)){const E=J&&H,j=E&&c&&Nu(T,c),A=(j?!b(T,_,X,$):!J||E)&&!k(M,!!j,e,o);Ye(te,O=>ut(x,O)),Ye(W,O=>ut(x,O)),R=R||A}!t&&G&&H&&!b(T,_,X,$)&&(ut(C,_),I=I||B)}),h(M=>tc(x).reduce((_,T)=>(ut(_,Gh(M,T)),Nu(T,M)?ut(_,T):_),[])),t)return!w&&R&&n(!1),[!1];if(!ec(C)||I){const M=[tc(C),I];return w||n.apply(0,M),M}}},y=new Wx(je(g,!1));return[()=>(y.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:m,subtree:t,childList:t,characterData:t}),r=!0,()=>{r&&(f(),y.disconnect(),r=!1)}),()=>{if(r)return g(!0,y.takeRecords())}]};let dr=null;const vv=(e,t,n)=>{const{ft:o}=n||{},r=$i("__osSizeObserverPlugin"),[i]=an({o:!1,u:!0});return()=>{const a=[],s=ev(`<div class="${Zd}"><div class="${Zx}"></div></div>`)[0],c=s.firstChild,u=d=>{let f=!1,h=!1;if(bn(d)&&!ec(d)){const p=d[0],[m,,g]=i(p.contentRect),y=Du(m);h=rv(m,g),f=!h&&!y}else h=d===!0;f||t({_t:!0,ft:h})};if(ii){if(!Rc(dr)){const p=new ii(Sa);p.observe(e,{get box(){dr=!0}}),dr=dr||!1,p.disconnect()}const d=Kg(u,{p:0,v:0}),f=p=>d(p),h=new ii(f);if(h.observe(dr?e:c),ut(a,[()=>{h.disconnect()},!dr&&Zt(e,s)]),dr){const p=new ii(f);p.observe(e,{box:"border-box"}),ut(a,()=>p.disconnect())}}else{if(!r)return Sa;{const[d,f]=r(c,u,o);ut(a,Ci([qd(s,Jx),at(s,"animationstart",d),Zt(e,s)],f))}}return je(fn,a)}},s2=(e,t)=>{let n;const o=mi("os-trinsic-observer"),[r]=an({o:!1}),i=(s,c)=>{if(s){const u=r((f=>f.h===0||f.isIntersecting||f.intersectionRatio>0)(s)),[,d]=u;return d&&!c&&t(u)&&[u]}},a=(s,c)=>i(c.pop(),s);return[()=>{const s=[];if(Uh)n=new Uh(je(a,!1),{root:e}),n.observe(o),ut(s,()=>{n.disconnect()});else{const c=()=>{const u=gi(o);i(u)};ut(s,vv(o,c)()),c()}return je(fn,ut(s,Zt(e,o)))},()=>n&&a(!0,n.takeRecords())]},c2=(e,t,n,o)=>{let r,i,a,s,c,u,d,f;const h=`[${qo}]`,p=`[${so}]`,m=["id","class","style","open","wrap","cols","rows"],{dt:g,vt:y,L:w,gt:S,ht:b,V:k,bt:x,wt:C,yt:I,St:R}=e,M=A=>Jn(A,"direction")==="rtl",_={Ot:!1,B:M(g)},T=Zn(),P=$i(Xd),[X]=an({i:Ug,o:{w:0,h:0}},()=>{const A=P&&P.R(e,t,_,T,n).Y,O=!(x&&k)&&Gd(y,qo,Is),q=!k&&C("arrange"),z=q&&cn(S),U=z&&R(),Q=I(uv,O),D=q&&A&&A(),le=oc(w),ue=Jd(w);return D&&D(),Un(S,z),U&&U(),O&&Q(),{w:le.w+ue.w,h:le.h+ue.h}}),te=(()=>{let A,O,q;const z=Kg(o,{p:()=>A,v:()=>O,S:()=>q,m(Q,D){const[le]=Q,[ue]=D;return[Ci(Jt(le),Jt(ue)).reduce((ve,we)=>(ve[we]=le[we]||ue[we],ve),{})]}}),U=(Q,D)=>{if(bn(D)){const[le,ue,ve]=D;A=le,O=ue,q=ve}else Go(D)?(A=D,O=!1,q=!1):(A=!1,O=!1,q=!1);z(Q)};return U.O=z.O,U})(),W=A=>{const O=M(g);ze(A,{Ct:f!==O}),ze(_,{B:O}),f=O},J=(A,O)=>{const[q,z]=A,U={$t:z};return ze(_,{Ot:q}),O||o(U),U},L=({_t:A,ft:O})=>{const q=O?o:te,z={_t:A||O,ft:O};W(z),q(z,i)},G=(A,O)=>{const[,q]=X(),z={xt:q};return W(z),q&&!O&&te(z,A?a:r),z},F=(A,O,q)=>{const z={Ht:O};return W(z),O&&!q&&te(z,r),z},[N,$]=b?s2(y,J):[],H=!k&&vv(y,L,{ft:!0}),[B,E]=cp(y,!1,F,{ct:m,et:m}),j=k&&ii&&new ii(A=>{const O=A[A.length-1].contentRect;L({_t:!0,ft:rv(O,d)}),d=O});return[()=>{j&&j.observe(y);const A=H&&H(),O=N&&N(),q=B(),z=T.G(U=>{const[,Q]=X();te({Et:U,xt:Q,_t:x},s)});return()=>{j&&j.disconnect(),A&&A(),O&&O(),u&&u(),q(),z()}},({zt:A,It:O,At:q})=>{const z={},[U]=A("update.ignoreMutation"),[Q,D]=A("update.attributes"),[le,ue]=A("update.elementEvents"),[ve,we]=A("update.debounce"),Ae=O||q;if(ue||D){c&&c(),u&&u();const[Z,oe]=cp(b||w,!0,G,{et:Ci(m,Q||[]),rt:le,it:h,ut:(ce,Se)=>{const{target:Oe,attributeName:fe}=ce;return!(Se||!fe||k)&&zx(Oe,h,p)||!!si(Oe,`.${mn}`)||!!(Re=>Dn(U)&&U(Re))(ce)}});u=Z(),c=oe}if(we&&(te.O(),bn(ve)||Go(ve)?(r=ve,i=!1,a=hv,s=pv):xa(ve)?(r=ve.mutation,i=ve.resize,a=ve.event,s=ve.env):(r=!1,i=!1,a=!1,s=!1)),Ae){const Z=E(),oe=$&&$(),ce=c&&c();Z&&ze(z,F(Z[0],Z[1],Ae)),oe&&ze(z,J(oe[0],Ae)),ce&&ze(z,G(ce[0],Ae))}return W(z),z},_]},yv=(e,t)=>Dn(t)?t.apply(0,e):t,l2=(e,t,n,o)=>{const r=Hd(o)?n:o;return yv(e,r)||t.apply(0,e)},wv=(e,t,n,o)=>{const r=Hd(o)?n:o,i=yv(e,r);return!!i&&(Qs(i)?i:t.apply(0,e))},u2=(e,t,n,o)=>{const r="--os-viewport-percent",i="--os-scroll-percent",a="--os-scroll-direction",{K:s}=Zn(),{scrollbars:c}=s(),{slot:u}=c,{dt:d,vt:f,L:h,Tt:p,gt:m,bt:g,V:y}=t,{scrollbars:w}=p?{}:e,{slot:S}=w||{},b=[],k=[],x=[],C=wv([d,f,h],()=>y&&g?d:f,u,S),I=W=>{if(ra){let J=null,L=[];const G=new ra({source:m,axis:W}),F=()=>{J&&J.cancel(),J=null};return{kt:$=>{const{Dt:H}=n,B=Nl(H)[W],E=W==="x",j=[_l(0,E),_l(`calc(-100% + 100cq${E?"w":"h"})`,E)],A=B?j:j.reverse();return L[0]===A[0]&&L[1]===A[1]||(L=A,F(),J=$.Mt.animate({clear:["left"],transform:A},{timeline:G})),F}}}},R={x:I("x"),y:I("y")},M=(W,J,L)=>{const G=L?qd:Yg;Ye(W,F=>{G(F.Lt,J)})},_=(W,J)=>{Ye(W,L=>{const[G,F]=J(L);Ca(G,F)})},T=(W,J,L)=>{const G=Rc(L),F=!G||!L;(!G||L)&&M(k,W,J),F&&M(x,W,J)},P=W=>{const J=W?"x":"y",L=mi(`${mn} ${W?Xx:Qx}`),G=mi(fv),F=mi(Yd),N={Lt:L,Ut:G,Mt:F},$=R[J];return ut(W?k:x,N),ut(b,[Zt(L,G),Zt(G,F),je(ji,L),$&&$.kt(N),o(N,T,W)]),N},X=je(P,!0),te=je(P,!1);return X(),te(),[{Pt:()=>{const W=(()=>{const{Rt:L,Vt:G}=n,F=(N,$)=>qg(0,1,N/(N+$)||0);return{x:F(G.x,L.x),y:F(G.y,L.y)}})(),J=L=>G=>[G.Lt,{[r]:Lu(L)+""}];_(k,J(W.x)),_(x,J(W.y))},Nt:()=>{if(!ra){const{Dt:W}=n,J=Yh(W,cn(m)),L=G=>F=>[F.Lt,{[i]:Lu(G)+""}];_(k,L(J.x)),_(x,L(J.y))}},qt:()=>{const{Dt:W}=n,J=Nl(W),L=G=>F=>[F.Lt,{[a]:G?"0":"1"}];_(k,L(J.x)),_(x,L(J.y)),ra&&(k.forEach(R.x.kt),x.forEach(R.y.kt))},Bt:()=>{if(y&&!g){const{Rt:W,Dt:J}=n,L=Nl(J),G=Yh(J,cn(m)),F=N=>{const{Lt:$}=N,H=ka($)===h&&$,B=(E,j,A)=>{const O=j*E;return nv(A?O:-O)};return[H,H&&{transform:_l({x:B(G.x,W.x,L.x),y:B(G.y,W.y,L.y)})}]};_(k,F),_(x,F)}},Ft:T,jt:{Xt:k,Yt:X,Wt:je(_,k)},Jt:{Xt:x,Yt:te,Wt:je(_,x)}},()=>(Zt(C,k[0].Lt),Zt(C,x[0].Lt),je(fn,b))]},d2=(e,t,n,o)=>(r,i,a)=>{const{vt:s,L:c,V:u,gt:d,Gt:f,St:h}=t,{Lt:p,Ut:m,Mt:g}=r,[y,w]=ai(333),[S,b]=ai(444),k=C=>{Dn(d.scrollBy)&&d.scrollBy({behavior:"smooth",left:C.x,top:C.y})};let x=!0;return je(fn,[at(g,"pointermove pointerleave",o),at(p,"pointerenter",()=>{i(tp,!0)}),at(p,"pointerleave pointercancel",()=>{i(tp,!1)}),!u&&at(p,"mousedown",()=>{const C=Ru();(Vh(C,so)||Vh(C,qo)||C===document.body)&&$d(je($u,c),25)}),at(p,"wheel",C=>{const{deltaX:I,deltaY:R,deltaMode:M}=C;x&&M===0&&ka(p)===s&&k({x:I,y:R}),x=!1,i(rp,!0),y(()=>{x=!0,i(rp)}),Mu(C)},{I:!1,A:!0}),at(p,"pointerdown",()=>{const C=at(f,"click",R=>{I(),av(R)},{T:!0,A:!0,I:!1}),I=at(f,"pointerup pointercancel",()=>{I(),setTimeout(C,150)},{A:!0,I:!0})},{A:!0,I:!0}),(()=>{const C="pointerup pointercancel lostpointercapture",I="client"+(a?"X":"Y"),R=a?Dc:Mc,M=a?"left":"top",_=a?"w":"h",T=a?"x":"y",P=(te,W)=>J=>{const{Rt:L}=n,G=gi(m)[_]-gi(g)[_],F=W*J/G*L[T];Un(d,{[T]:te+F})},X=[];return at(m,"pointerdown",te=>{const W=si(te.target,`.${Yd}`)===g,J=W?g:m,L=e.scrollbars,G=L[W?"dragScroll":"clickScroll"],{button:F,isPrimary:N,pointerType:$}=te,{pointers:H}=L;if(F===0&&N&&G&&(H||[]).includes($)){fn(X),b();const B=!W&&(te.shiftKey||G==="instant"),E=je(Tl,g),j=je(Tl,m),A=(ce,Se)=>(ce||E())[M]-(Se||j())[M],O=Tu(Tl(d)[R])/gi(d)[_]||1,q=P(cn(d)[T],1/O),z=te[I],U=E(),Q=j(),D=U[R],le=A(U,Q)+D/2,ue=z-Q[M],ve=W?0:ue-le,we=ce=>{fn(oe),J.releasePointerCapture(ce.pointerId)},Ae=W||B,Z=h(),oe=[at(f,C,we),at(f,"selectstart",ce=>Mu(ce),{I:!1}),at(m,C,we),Ae&&at(m,"pointermove",ce=>q(ve+(ce[I]-z))),Ae&&(()=>{const ce=cn(d);Z();const Se=cn(d),Oe={x:Se.x-ce.x,y:Se.y-ce.y};(Fo(Oe.x)>3||Fo(Oe.y)>3)&&(h(),Un(d,ce),k(Oe),S(Z))})];if(J.setPointerCapture(te.pointerId),B)q(ve);else if(!W){const ce=$i("__osClickScrollPlugin");if(ce){const Se=ce(q,ve,D,Oe=>{Oe?Z():ut(oe,Z)});ut(oe,Se),ut(X,je(Se,!0))}}}})})(),w,b])},f2=e=>{const t=Zn(),{K:n,U:o}=t,{elements:r}=n(),{padding:i,viewport:a,content:s}=r,c=Qs(e),u=c?{}:e,{elements:d}=u,{padding:f,viewport:h,content:p}=d||{},m=c?e:u.target,g=Xg(m),y=m.ownerDocument,w=y.documentElement,S=()=>y.defaultView||Yt,b=je(l2,[m]),k=je(wv,[m]),x=je(mi,""),C=je(b,x,a),I=je(k,x,s),R=C(h),M=R===m,_=M&&g,T=!M&&I(p),P=!M&&R===T,X=_?w:R,te=_?X:m,W=!M&&k(x,i,f),J=!P&&T,L=[J,X,W,te].map(Q=>Qs(Q)&&!ka(Q)&&Q),G=Q=>Q&&Dg(L,Q),F=!G(X)&&(Q=>{const D=gi(Q),le=oc(Q),ue=Jn(Q,Fd),ve=Jn(Q,zd);return le.w-D.w>0&&!ci(ue)||le.h-D.h>0&&!ci(ve)})(X)?X:m,N=_?w:X,$={dt:m,vt:te,L:X,rn:W,ht:J,gt:N,Kt:_?y:X,ln:g?w:F,Gt:y,bt:g,Tt:c,V:M,an:S,wt:Q=>Gd(X,so,Q),yt:(Q,D)=>nc(X,so,Q,D),St:()=>nc(N,so,"scrolling",!0)},{dt:H,vt:B,rn:E,L:j,ht:A}=$,O=[()=>{Wn(B,[qo,Il]),Wn(H,Il),g&&Wn(w,[Il,qo])}];let q=Iu([A,j,E,B,H].find(Q=>Q&&!G(Q)));const z=_?H:A||j,U=je(fn,O);return[$,()=>{const Q=S(),D=Ru(),le=Z=>{Zt(ka(Z),Iu(Z)),ji(Z)},ue=Z=>at(Z,"focusin focusout focus blur",av,{A:!0,I:!1}),ve="tabindex",we=Kd(j,ve),Ae=ue(D);return ao(B,qo,M?"":"host"),ao(E,Bu,""),ao(j,so,""),ao(A,ep,""),M||(ao(j,ve,we||"-1"),g&&ao(w,Qh,"")),Zt(z,q),Zt(B,E),Zt(E||B,!M&&j),Zt(j,A),ut(O,[Ae,()=>{const Z=Ru(),oe=G(j),ce=oe&&Z===j?H:Z,Se=ue(ce);Wn(E,Bu),Wn(A,ep),Wn(j,so),g&&Wn(w,Qh),we?ao(j,ve,we):Wn(j,ve),G(A)&&le(A),oe&&le(j),G(E)&&le(E),$u(ce),Se()}]),o&&!M&&(Vd(j,so,dv),ut(O,je(Wn,j,so))),$u(!M&&g&&D===H&&Q.top===Q?j:D),Ae(),q=0,U},U]},h2=({ht:e})=>({Qt:t,un:n,At:o})=>{const{$t:r}=t||{},{Ot:i}=n;e&&(r||o)&&Ca(e,{[Mc]:i&&"100%"})},p2=({vt:e,rn:t,L:n,V:o},r)=>{const[i,a]=an({i:Fx,o:Jh()},je(Jh,e,"padding",""));return({zt:s,Qt:c,un:u,At:d})=>{let[f,h]=a(d);const{U:p}=Zn(),{_t:m,xt:g,Ct:y}=c||{},{B:w}=u,[S,b]=s("paddingAbsolute");(m||h||d||g)&&([f,h]=i(d));const k=!o&&(b||y||h);if(k){const x=!S||!t&&!p,C=f.r+f.l,I=f.t+f.b,R={[Fg]:x&&!w?-C:0,[zg]:x?-I:0,[Wg]:x&&w?-C:0,top:x?-f.t:0,right:x?w?-f.r:"auto":0,left:x?w?"auto":-f.l:0,[Dc]:x&&`calc(100% + ${C}px)`},M={[Mg]:x?f.t:0,[$g]:x?f.r:0,[Bg]:x?f.b:0,[Hg]:x?f.l:0};Ca(t||n,R),Ca(n,M),ze(r,{rn:f,fn:!x,F:t?M:ze({},R,M)})}return{_n:k}}},m2=(e,t)=>{const n=Zn(),{vt:o,rn:r,L:i,V:a,Kt:s,gt:c,bt:u,yt:d,an:f}=e,{U:h}=n,p=u&&a,m=je(Ig,0),g={display:()=>!1,direction:E=>E!=="ltr",flexDirection:E=>E.endsWith("-reverse"),writingMode:E=>E!=="horizontal-tb"},y=Jt(g),w={i:Ug,o:{w:0,h:0}},S={i:Ts,o:{}},b=E=>{d(uv,!p&&E)},k=()=>Jn(i,y),x=(E,j)=>{const A=!Jt(E).length,O=!j&&y.some(Z=>{const oe=E[Z];return Mi(oe)&&g[Z](oe)});if(A&&!O||!(Z=>!!Z&&(oe=>!!(oe.offsetWidth||oe.offsetHeight||oe.getClientRects().length))(Z))(i))return{D:{x:0,y:0},M:{x:1,y:1}};b(!0);const q=cn(c),z=at(s,Ei,Z=>{const oe=cn(c);Z.isTrusted&&oe.x===q.x&&oe.y===q.y&&iv(Z)},{A:!0,T:!0}),U=d("noContent",!0);Un(c,{x:0,y:0}),U();const Q=cn(c),D=oc(c);Un(c,{x:D.w,y:D.h});const le=cn(c),ue={x:le.x-Q.x,y:le.y-Q.y};Un(c,{x:-D.w,y:-D.h});const ve=cn(c),we={x:ve.x-Q.x,y:ve.y-Q.y},Ae={x:Fo(ue.x)>=Fo(we.x)?le.x:ve.x,y:Fo(ue.y)>=Fo(we.y)?le.y:ve.y};return Un(c,q),Md(()=>z()),{D:Q,M:Ae}},C=(E,j)=>{const A=Yt.devicePixelRatio%1!=0?1:0,O={w:m(E.w-j.w),h:m(E.h-j.h)};return{w:O.w>A?O.w:0,h:O.h>A?O.h:0}},I=(E,j)=>{const A=(O,q,z,U)=>{const Q=O===lo?In:(ue=>ue.replace(`${lo}-`,""))(O),D=ci(O),le=ci(z);return!q&&!U?In:D&&le?lo:D?q&&U?Q:q?lo:In:q?Q:le&&U?lo:In};return{x:A(j.x,E.x,j.y,E.y),y:A(j.y,E.y,j.x,E.x)}},R=E=>{const j=O=>[lo,In,Ei].map(q=>B(Fu(q),O)),A=j(!0).concat(j()).join(" ");d(A),d(Jt(E).map(O=>B(E[O],O==="x")).join(" "),!0)},[M,_]=an(w,je(Jd,i)),[T,P]=an(w,je(oc,i)),[X,te]=an(w),[W]=an(S),[J,L]=an(w),[G]=an(S),[F]=an({i:(E,j)=>$c(E,j,tc(Ci(Jt(E),Jt(j)))),o:{}}),[N,$]=an({i:(E,j)=>Ts(E.D,j.D)&&Ts(E.M,j.M),o:{D:{x:0,y:0},M:{x:0,y:0}}}),H=$i(Xd),B=(E,j)=>`${j?Gx:qx}${(A=>{const O=String(A||"");return O?O[0].toUpperCase()+O.slice(1):""})(E)}`;return({zt:E,Qt:j,un:A,At:O},{_n:q})=>{const{_t:z,Ht:U,xt:Q,Ct:D,ft:le,Et:ue}=j||{},ve=H&&H.R(e,t,A,n,E),{X:we,Y:Ae,W:Z}=ve||{},[oe,ce]=((Ur,ko)=>{const{k:Bn}=ko,[Co,Eo]=Ur("showNativeOverlaidScrollbars");return[Co&&Bn.x&&Bn.y,Eo]})(E,n),[Se,Oe]=E("overflow"),fe=ci(Se.x),Re=ci(Se.y),Je=z||q||Q||D||ue||ce;let ot=_(O),Pe=P(O),Ce=te(O),Le=L(O);if(ce&&h&&d(dv,!oe),Je){Gd(o,qo,Is)&&b(!0);const Ur=Ae&&Ae(),[ko]=ot=M(O),[Bn]=Pe=T(O),Co=ov(i),Eo=p&&Kx(f()),ml={w:m(Bn.w+ko.w),h:m(Bn.h+ko.h)},Xa={w:m((Eo?Eo.w:Co.w+m(Co.w-Bn.w))+ko.w),h:m((Eo?Eo.h:Co.h+m(Co.h-Bn.h))+ko.h)};Ur&&Ur(),Le=J(Xa),Ce=X(C(ml,Xa),O)}const[Me,he]=Le,[ye,ae]=Ce,[se,Ne]=Pe,[ge,ee]=ot,[Y,de]=W({x:ye.w>0,y:ye.h>0}),be=fe&&Re&&(Y.x||Y.y)||fe&&Y.x&&!Y.y||Re&&Y.y&&!Y.x,We=q||D||ue||ee||Ne||he||ae||Oe||ce||Je||U&&p,[_t]=E("update.flowDirectionStyles"),[Ui,So]=F(_t?_t(i):k(),O),Lt=D||le||So||de||O,[nn,no]=Lt?N(x(Ui,!!_t),O):$();let lr=I(Y,Se);b(!1),We&&(R(lr),lr=r2(i,Y),Z&&we&&(we(lr,se,ge),Ca(i,Z(lr))));const[hl,pl]=G(lr);return nc(o,qo,Is,be),nc(r,Bu,Is,be),ze(t,{cn:hl,Vt:{x:Me.w,y:Me.h},Rt:{x:ye.w,y:ye.h},j:Y,Dt:Vx(nn,ye)}),{sn:pl,tn:he,nn:ae,en:no||ae}}},g2=e=>{const[t,n,o]=f2(e),r={rn:{t:0,r:0,b:0,l:0},fn:!1,F:{[Fg]:0,[zg]:0,[Wg]:0,[Mg]:0,[$g]:0,[Bg]:0,[Hg]:0},Vt:{x:0,y:0},Rt:{x:0,y:0},cn:{x:In,y:In},j:{x:!1,y:!1},Dt:{D:{x:0,y:0},M:{x:0,y:0}}},{dt:i,gt:a,V:s,St:c}=t,{U:u,k:d}=Zn(),f=!u&&(d.x||d.y),h=[h2(t),p2(t,r),m2(t,r)];return[n,p=>{const m={},g=f&&cn(a),y=g&&c();return Ye(h,w=>{ze(m,w(p,m)||{})}),Un(a,g),y&&y(),s||Un(i,0),m},r,t,o]},v2=(e,t,n,o,r)=>{let i=!1;const a=sp(t,{}),[s,c,u,d,f]=g2(e),[h,p,m]=c2(d,u,a,k=>{b({},k)}),[g,y,,w]=((k,x,C,I,R,M)=>{let _,T,P,X,te,W=Sa,J=0;const L=["mouse","pen"],G=fe=>L.includes(fe.pointerType),[F,N]=ai(),[$,H]=ai(100),[B,E]=ai(100),[j,A]=ai(()=>J),[O,q]=u2(k,R,I,d2(x,R,I,fe=>G(fe)&&Z())),{vt:z,Kt:U,bt:Q}=R,{Ft:D,Pt:le,Nt:ue,qt:ve,Bt:we}=O,Ae=(fe,Re)=>{if(A(),fe)D(op);else{const Je=je(D,op,!0);J>0&&!Re?j(Je):Je()}},Z=()=>{(P?_:X)||(Ae(!0),$(()=>{Ae(!1)}))},oe=fe=>{D(Wu,fe,!0),D(Wu,fe,!1)},ce=fe=>{G(fe)&&(_=P,P&&Ae(!0))},Se=[A,H,E,N,()=>W(),at(z,"pointerover",ce,{T:!0}),at(z,"pointerenter",ce),at(z,"pointerleave",fe=>{G(fe)&&(_=!1,P&&Ae(!1))}),at(z,"pointermove",fe=>{G(fe)&&T&&Z()}),at(U,"scroll",fe=>{F(()=>{ue(),Z()}),M(fe),we()})],Oe=$i(Xd);return[()=>je(fn,ut(Se,q())),({zt:fe,At:Re,Qt:Je,Zt:ot})=>{const{tn:Pe,nn:Ce,sn:Le,en:Me}=ot||{},{Ct:he,ft:ye}=Je||{},{B:ae}=C,{k:se,U:Ne}=Zn(),{cn:ge,j:ee}=I,[Y,de]=fe("showNativeOverlaidScrollbars"),[be,We]=fe("scrollbars.theme"),[_t,Ui]=fe("scrollbars.visibility"),[So,Lt]=fe("scrollbars.autoHide"),[nn,no]=fe("scrollbars.autoHideSuspend"),[lr]=fe("scrollbars.autoHideDelay"),[hl,pl]=fe("scrollbars.dragScroll"),[Ur,ko]=fe("scrollbars.clickScroll"),[Bn,Co]=fe("overflow"),Eo=ye&&!Re,ml=ee.x||ee.y,Xa=Pe||Ce||Me||he||Re,Hb=Le||Ui||Co,Bb=Y&&se.x&&se.y,lh=!Ne&&!Oe,Wb=Bb||lh,uh=(gl,vl,Fb)=>{const dh=gl.includes(Ei)&&(_t===lo||_t==="auto"&&vl===Ei);return D(e2,dh,Fb),dh};if(J=lr,Eo&&(nn&&ml?(oe(!1),W(),B(()=>{W=at(U,"scroll",je(oe,!0),{T:!0})})):oe(!0)),(de||lh)&&D("os-theme-none",Wb),We&&(D(te),D(be,!0),te=be),no&&!nn&&oe(!0),Lt&&(T=So==="move",P=So==="leave",X=So==="never",Ae(X,!0)),pl&&D(o2,hl),ko&&D(n2,!!Ur),Hb){const gl=uh(Bn.x,ge.x,!0),vl=uh(Bn.y,ge.y,!1);D(t2,!(gl&&vl))}Xa&&(ue(),le(),we(),Me&&ve(),D(np,!ee.x,!0),D(np,!ee.y,!1),D(Yx,ae&&!Q))},{},O]})(e,t,m,u,d,r),S=k=>Jt(k).some(x=>!!k[x]),b=(k,x)=>{if(n())return!1;const{dn:C,At:I,It:R,pn:M}=k,_=C||{},T=!!I||!i,P={zt:sp(t,_,T),dn:_,At:T};if(M)return y(P),!1;const X=x||p(ze({},P,{It:R})),te=c(ze({},P,{un:m,Qt:X}));y(ze({},P,{Qt:X,Zt:te}));const W=S(X),J=S(te),L=W||J||!Ud(_)||T;return i=!0,L&&o(k,{Qt:X,Zt:te}),L};return[()=>{const{ln:k,gt:x,St:C}=d,I=cn(k),R=[h(),s(),g()],M=C();return Un(x,I),M(),je(fn,R)},b,()=>({vn:m,gn:u}),{hn:d,bn:w},f]},zu=new WeakMap,bv=e=>zu.get(e),On=(e,t,n)=>{const{tt:o}=Zn(),r=Qs(e),i=r?e:e.target,a=bv(i);if(t&&!a){let s=!1;const c=[],u={},d=_=>{const T=Gg(_),P=$i("__osOptionsValidationPlugin");return P?P(T,!0):T},f=ze({},o(),d(t)),[h,p,m]=Hu(),[g,y,w]=Hu(n),S=(_,T)=>{w(_,T),m(_,T)},[b,k,x,C,I]=v2(e,f,()=>s,({dn:_,At:T},{Qt:P,Zt:X})=>{const{_t:te,Ct:W,$t:J,xt:L,Ht:G,ft:F}=P,{tn:N,nn:$,sn:H,en:B}=X;S("updated",[M,{updateHints:{sizeChanged:!!te,directionChanged:!!W,heightIntrinsicChanged:!!J,overflowEdgeChanged:!!N,overflowAmountChanged:!!$,overflowStyleChanged:!!H,scrollCoordinatesChanged:!!B,contentMutation:!!L,hostMutation:!!G,appear:!!F},changedOptions:_||{},force:!!T}])},_=>S("scroll",[M,_])),R=_=>{(T=>{zu.delete(T)})(i),fn(c),s=!0,S("destroyed",[M,_]),p(),y()},M={options(_,T){if(_){const P=T?o():{},X=mv(f,ze(P,d(_)));Ud(X)||(ze(f,X),k({dn:X}))}return ze({},f)},on:g,off:(_,T)=>{_&&T&&y(_,T)},state(){const{vn:_,gn:T}=x(),{B:P}=_,{Vt:X,Rt:te,cn:W,j:J,rn:L,fn:G,Dt:F}=T;return ze({},{overflowEdge:X,overflowAmount:te,overflowStyle:W,hasOverflow:J,scrollCoordinates:{start:F.D,end:F.M},padding:L,paddingAbsolute:G,directionRTL:P,destroyed:s})},elements(){const{dt:_,vt:T,rn:P,L:X,ht:te,gt:W,Kt:J}=C.hn,{jt:L,Jt:G}=C.bn,F=$=>{const{Mt:H,Ut:B,Lt:E}=$;return{scrollbar:E,track:B,handle:H}},N=$=>{const{Xt:H,Yt:B}=$,E=F(H[0]);return ze({},E,{clone:()=>{const j=F(B());return k({pn:!0}),j}})};return ze({},{target:_,host:T,padding:P||X,viewport:X,content:te||X,scrollOffsetElement:W,scrollEventElement:J,scrollbarHorizontal:N(L),scrollbarVertical:N(G)})},update:_=>k({At:_,It:!0}),destroy:je(R,!1),plugin:_=>u[Jt(_)[0]]};return ut(c,[I]),((_,T)=>{zu.set(_,T)})(i,M),lv(sv,On,[M,h,u]),((_,T)=>{const{nativeScrollbarsOverlaid:P,body:X}=T||{},{k:te,U:W,K:J}=Zn(),{nativeScrollbarsOverlaid:L,body:G}=J().cancel,F=P??L,N=Hd(X)?G:X,$=(te.x||te.y)&&F,H=_&&(Ic(N)?!W:N);return!!$||!!H})(C.hn.bt,!r&&e.cancel)?(R(!0),M):(ut(c,b()),S("initialized",[M]),M.update(),M)}return a};On.plugin=e=>{const t=bn(e),n=t?e:[e],o=n.map(r=>lv(r,On)[0]);return(r=>{Ye(r,i=>Ye(i,(a,s)=>{sv[s]=i[s]}))})(n),t?o:o[0]},On.valid=e=>{const t=e&&e.elements,n=Dn(t)&&t();return xa(n)&&!!bv(n.target)},On.env=()=>{const{P:e,k:t,U:n,J:o,ot:r,st:i,K:a,Z:s,tt:c,nt:u}=Zn();return ze({},{scrollbarsSize:e,scrollbarsOverlaid:t,scrollbarsHiding:n,scrollTimeline:o,staticDefaultInitialization:r,staticDefaultOptions:i,getDefaultInitialization:a,setDefaultInitialization:s,getDefaultOptions:c,setDefaultOptions:u})},On.nonce=e=>{gv=e},On.trustedTypePolicy=e=>{Qg=e};const y2=()=>{if(typeof window>"u"){const u=()=>{};return[u,u]}let e,t;const n=window,o=typeof n.requestIdleCallback=="function",r=n.requestAnimationFrame,i=n.cancelAnimationFrame,a=o?n.requestIdleCallback:r,s=o?n.cancelIdleCallback:i,c=()=>{s(e),i(t)};return[(u,d)=>{c(),e=a(o?()=>{c(),t=r(u)}:u,typeof d=="object"?d:{timeout:2233})},c]},xv=e=>{const{options:t,events:n,defer:o}=e||{},[r,i]=v.useMemo(y2,[]),a=v.useRef(null),s=v.useRef(o),c=v.useRef(t),u=v.useRef(n);return v.useEffect(()=>{s.current=o},[o]),v.useEffect(()=>{const{current:d}=a;c.current=t,On.valid(d)&&d.options(t||{},!0)},[t]),v.useEffect(()=>{const{current:d}=a;u.current=n,On.valid(d)&&d.on(n||{},!0)},[n]),v.useEffect(()=>()=>{var d;i(),(d=a.current)==null||d.destroy()},[]),v.useMemo(()=>[d=>{const f=a.current;if(On.valid(f))return;const h=s.current,p=c.current||{},m=u.current||{},g=()=>a.current=On(d,p,m);h?r(g,h):g()},()=>a.current],[])};v.forwardRef((e,t)=>{const{element:n="div",options:o,events:r,defer:i,children:a,...s}=e,c=n,u=v.useRef(null),d=v.useRef(null),[f,h]=xv({options:o,events:r,defer:i});return v.useEffect(()=>{const{current:p}=u,{current:m}=d;if(p)return f(n==="body"?{target:p,cancel:{body:null}}:{target:p,elements:{viewport:m,content:m}}),()=>{var g;return(g=h())==null?void 0:g.destroy()}},[f,n]),v.useImperativeHandle(t,()=>({osInstance:h,getElement:()=>u.current}),[]),v.createElement(c,{"data-overlayscrollbars-initialize":"",ref:u,...s},n==="body"?a:v.createElement("div",{"data-overlayscrollbars-contents":"",ref:d},a))});const ir=v.forwardRef((e,t)=>{const{children:n,element:o="div",elementProps:r,wrapperClassName:i}=e,a=v.useRef(null),s=v.useRef(null),[c,u]=xv({options:{scrollbars:{autoHide:"leave",autoHideDelay:0}},defer:!0}),d=v.useCallback(f=>{s.current=f,typeof t=="function"?t(f):t!==null&&(t.current=f)},[t]);return v.useEffect(()=>{if(s.current&&a.current)return c({target:a.current,elements:{viewport:s.current,content:s.current}}),()=>{var f;return(f=u())==null?void 0:f.destroy()}},[c,u]),l.jsx("div",{"data-overlayscrollbars-initialize":"",ref:a,className:re("io-overlay-scrollbars-container",i),children:l.jsx(o,{"data-overlayscrollbars-contents":"",ref:d,...r,children:n})})});function Wc({text:e="Label",...t}){return l.jsx("label",{...t,children:e})}var w2=v[typeof document<"u"&&document.createElement!==void 0?"useLayoutEffect":"useEffect"],Sv=0,b2=()=>Sv++,lp=0;function x2(e,t){t===void 0&&(t="🅰");var[n,o]=v.useState(lp?b2:void 0);return w2(()=>{n===void 0&&o(Sv++),lp=1},[]),e||(n===void 0?n:t+n)}function Ra(){return(typeof v.useId=="function"?v.useId:x2)()??""}const er=v.forwardRef(({id:e,className:t,type:n="text",name:o="input",align:r="up",label:i,iconPrepend:a,iconPrependOnClick:s,iconAppend:c,iconAppendOnClick:u,placeholder:d,disabled:f,readOnly:h,errorMessage:p,errorDataTestId:m,...g},y)=>{const w=Ra(),S=e||`input-${w}`,b=re("io-control-input",a&&"io-control-leading-icon",c&&"io-control-trailing-icon",f&&"io-control-disabled",h&&"io-control-readonly",p&&"io-control-error",r&&[`direction-${r}`],t),k=v.useCallback(C=>{f?C.preventDefault():s&&s(C)},[s,f]),x=v.useCallback(C=>{f?C.preventDefault():u&&u(C)},[u,f]);return l.jsxs("div",{className:b,children:[i&&l.jsx(Wc,{htmlFor:S,text:i}),a&&l.jsx(xt,{variant:a,onClick:C=>k(C)}),l.jsx("input",{id:S,className:"io-input",ref:y,type:n,name:o,tabIndex:0,placeholder:d??(()=>{switch(n){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:f,readOnly:h,...p?{"aria-invalid":!0,"aria-describedby":`${S}-error`}:{},...g}),c&&l.jsx(xt,{variant:c,onClick:C=>x(C)}),p&&l.jsxs("div",{"data-testid":m,id:`${S}-error`,className:"io-input-error",children:[l.jsx(xt,{variant:"close"}),p]})]})});er.displayName="Input";const Fc=v.forwardRef(({id:e,className:t,name:n="textarea",align:o="up",label:r,rows:i=4,placeholder:a="Enter text here...",disabled:s,readOnly:c,...u},d)=>{const f=Ra(),h=e||`textarea-${f}`,p=re("io-control-textarea",s&&"io-control-disabled",c&&"io-control-readonly",o&&[`direction-${o}`],t);return l.jsxs("div",{className:p,children:[r&&l.jsx(Wc,{htmlFor:h,text:r}),l.jsx("textarea",{id:h,className:"io-textarea",ref:d,name:n,tabIndex:0,placeholder:a,"aria-label":r,disabled:s,readOnly:c,rows:i,...u})]})});Fc.displayName="Textarea";const La=v.forwardRef(({id:e,className:t,name:n="checkbox",align:o="left",label:r,checked:i,disabled:a,...s},c)=>{const u=Ra(),d=e||`checkbox-${u}`,f=re("io-control-checkbox",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],t);return l.jsxs("div",{className:f,children:[l.jsx("input",{type:"checkbox",id:d,className:"io-checkbox",ref:c,name:n,tabIndex:a?-1:0,checked:i,disabled:a,"aria-checked":i,...s}),r&&l.jsx(Wc,{htmlFor:d,text:r,"data-testid":s["data-testid"]?`${s["data-testid"]}-label`:void 0})]})});La.displayName="Checkbox";const S2=v.forwardRef(({id:e,className:t,name:n="radio",align:o="left",label:r,checked:i,disabled:a,...s},c)=>{const u=Ra(),d=e||`radio-${u}`,f=re("io-control-radio",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],t);return l.jsxs("div",{className:f,children:[l.jsx("input",{type:"radio",id:d,className:"io-radio",ref:c,name:n,tabIndex:a?-1:0,checked:i,disabled:a,"aria-checked":i,...s}),r&&l.jsx(Wc,{htmlFor:d,text:r})]})});S2.displayName="Radio";const k2=()=>{const e=v.useContext(Te.IOConnectContext),[t,n]=v.useState(null),o=v.useCallback(r=>{var i;return(i=e==null?void 0:e.themes)==null?void 0:i.select(r)},[e]);return v.useEffect(()=>{var a,s;if(!e)return;let r=!1;const i=c=>{r||n(c)};return(a=e.themes)==null||a.onChanged(i),(s=e.themes)==null||s.getCurrent().then(i).catch(console.warn),()=>{r=!0}},[e]),{currentTheme:t,selectTheme:o}};function kv(e,t=500){const[n,o]=v.useState(e);return v.useEffect(()=>{const r=setTimeout(()=>{o(e)},t);return()=>clearTimeout(r)},[e,t]),n}const Da=()=>window.glue42gd!==void 0||window.glue42alert!==void 0||window.glue42dialog!==void 0||window.iodesktop!==void 0;function Ke(){return v.useMemo(()=>typeof window=="object"&&Da(),[])}function C2(e,t){v.useEffect(()=>{const n=o=>{o.code===e&&t()};return document.addEventListener("keyup",n),()=>document.removeEventListener("keyup",n)},[e,t])}const E2=()=>{const e=v.useContext(Te.IOConnectContext),[t,n]=v.useState([]);return v.useEffect(()=>{var o;e&&((o=e.themes)==null||o.list().then(n).catch(console.warn))},[e]),t},St=v.forwardRef(({id:e,className:t,name:n="toggle",align:o="left",label:r,checked:i,disabled:a,onKeyDown:s,"data-testid":c="toggle",...u},d)=>{const f=Ra(),h=e||`toggle-${f}`,p=re("io-control-toggle",i&&"io-control-checked",a&&"io-control-disabled",o&&[`direction-${o}`],t);return l.jsx("div",{className:p,children:l.jsxs("label",{className:"io-toggle",htmlFor:h,tabIndex:a?-1:0,onKeyDown:s,"data-testid":`${c}-label`,children:[l.jsx("input",{type:"checkbox",id:h,className:"io-checkbox",ref:d,name:n,checked:i,disabled:a,"aria-checked":i,tabIndex:-1,"data-testid":c,...u}),l.jsx("span",{className:"slider","data-testid":`${c}-slider`}),r]})})});function is(e){return{name:e.name,title:e.title,hidden:e.isHidden,userProperties:e.customProperties}}function as(e){return{name:e.name,title:e.title,hidden:e.hidden,userProperties:e.userProperties}}St.displayName="Toggle";const zo={getMyApplication:async function(e){var t,n;if(e)try{const o=e.apps;if(o){const i=(t=o.my)==null?void 0:t.appName;if(!i)return;const a=await o.registry.get({name:i});return a?is(a):void 0}const r=(n=e.appManager)==null?void 0:n.myApplication;return r?as(r):void 0}catch(o){return void console.error("Failed to get my application",o)}},getApplications:async function(e){var t,n;if(!e)return[];try{const o=(t=e.apps)==null?void 0:t.registry;return o?(await o.getMany()??[]).map(a=>is(a)):(((n=e.appManager)==null?void 0:n.applications())??[]).map(i=>as(i))}catch(o){console.error("Failed to get applications",o)}return[]},startApplication:async function(e,t,n){var o,r;if(e)try{const i=e.apps;if(i){await((o=i.registry)==null?void 0:o.get({name:t}))||console.error(`Application "${t}" not found in registry`);const s=i.instances;return s?void await s.start({name:t,...n}):void console.error("io.apps.instances API is not available")}const a=(r=e.appManager)==null?void 0:r.application(t);if(!a)return void console.error(`Application "${t}" not found`);await a.start(n)}catch(i){return void console.error(`Failed to start application "${t}"`,i)}},stopApplication:async function(e,t,n){if(e)try{const o=e.apps;if(o){const i=o.instances;return i?void await i.stop({id:t.id,force:n==null?void 0:n.force,reason:n==null?void 0:n.reason,timeout:n==null?void 0:n.timeout}):void console.error("io.apps.instances API is not available")}const r=e.appManager.instances().find(i=>i.id===t.id);if(!r)return void console.error(`Instance "${t.id}" not found`);await r.stop()}catch(o){return void console.error(`Failed to stop application instance "${t.id}"`,o)}},onAppAdded:async function(e,t){var n,o;if(e)try{const r=(n=e.apps)==null?void 0:n.registry;return r?await r.onAdded(({app:a})=>{const s=is(a);t(s)}):(o=e.appManager)==null?void 0:o.onAppAdded(a=>{const s=as(a);t(s)})}catch(r){return void console.error("Failed to subscribe to app added events",r)}},onAppRemoved:async function(e,t){var n,o;if(e)try{const r=(n=e.apps)==null?void 0:n.registry;return r?await r.onRemoved(({appName:a})=>{t({name:a})}):(o=e.appManager)==null?void 0:o.onAppRemoved(a=>{t({name:a.name})})}catch(r){return void console.error("Failed to subscribe to app removed events",r)}},onAppChanged:async function(e,t){var n,o;if(e)try{const r=(n=e.apps)==null?void 0:n.registry;return r?await r.onUpdated(a=>{const s=is(a.app);t(s)}):(o=e.appManager)==null?void 0:o.onAppChanged(a=>{const s=as(a);t(s)})}catch(r){return void console.error("Failed to subscribe to app changed events",r)}},restartPlatform:async function(e,t=!0){var o,r;if(!e)return;const n={autoSave:t,showDialog:!0};try{if((o=e.platform)!=null&&o.restart)return void await e.platform.restart(n);await((r=e.appManager)==null?void 0:r.restart(n))}catch(i){console.error("Failed to restart platform",i)}},shutdownPlatform:async function(e,t=!0){var o,r;if(!e)return;const n={autoSave:t,showDialog:!0};try{if((o=e.platform)!=null&&o.shutdown)return void await e.platform.shutdown(n);await((r=e.appManager)==null?void 0:r.exit(n))}catch(i){console.error("Failed to shutdown platform",i)}}},j2={minimizeWindow:async function(e){var t;if(e)try{const n=(t=e.windows)==null?void 0:t.my();await(n==null?void 0:n.minimize())}catch(n){console.error("Failed to minimize window",n)}},closeWindow:async function(e,t){var n;if(e)try{const o=(n=e.windows)==null?void 0:n.my();await(o==null?void 0:o.close(t))}catch(o){console.error("Failed to close window",o)}},restartPlatform:zo.restartPlatform,shutdownPlatform:zo.shutdownPlatform};v.createContext({theme:"dark"});const up="io-connect-platform",Cr="___platform_prefs___",A2="_launchpad_collapsedSections",O2="_launchpad_favorites",P2="_launchpad_recent",_2="_launchpad_isLayoutsPanelOpen",T2="_launchpad_isCollapsed",Uu="_launchpad_isPinned",Ku="_launchpad_isDocked",Cv="_launchpad_minimizeToTray",Ev="_launchpad_autoCloseStartingAppsAndWorkspaces",jv="_launchpad_pinnedPosition",Av="_launchpad_allowDocking",Ov="_launchpad_dockedAlwaysOnTop",Pv="_launchpad_dockedClaimsSpace",Ma="_launchpad_showExtendedArea",_v="_launchpad_hideLabelsInExtendedArea",Tv="_launchpad_showFavoritesInExtendedArea",Nv="_launchpad_hideFavoritesSection",Iv="_launchpad_showRecentAppsInExtendedArea",Rv="_layouts_restoreLastSaved",Lv="_layouts_saveCurrentOnExit",Dv="_layouts_showUnsavedChangesPrompt",Mv="_layouts_showDeletePrompt",$v="_downloads_askForEachDownload",N2="_downloads_location",I2="_system_scheduleRestart",R2="_system_scheduleRestartTime",L2="_system_scheduleRestartFrequency",D2="_system_scheduleRestartDay",M2="_system_scheduleShutdown",$2="_system_scheduleShutdownTime",H2="_system_scheduleShutdownFrequency",B2="_system_scheduleShutdownDay",W2={[A2]:[],[O2]:[],[P2]:[],[_2]:!1,[T2]:!1,[Uu]:!1,[Ku]:!1,[Cv]:!1,[Ev]:!0,[jv]:"Left",[Av]:!0,[Ov]:!1,[Pv]:!1,[Ma]:!0,[_v]:!0,[Tv]:!0,[Nv]:!1,[Iv]:!0,[Rv]:!0,[Lv]:!0,[Dv]:!0,[Mv]:!0,[$v]:!0,[N2]:"",[I2]:!1,[R2]:"12:00 AM",[L2]:"daily",[D2]:"Monday",[M2]:!1,[$2]:"12:00 AM",[H2]:"daily",[B2]:"Monday"},Er=e=>typeof e=="string"?e:e!=null&&e.message?typeof e.message=="string"?e.message:JSON.stringify(e.message):JSON.stringify(e),Qd="warning",F2={success:5e3,warning:1e4};var Ct=function(e){return{ok:!0,result:e}},yt=function(e){return{ok:!1,error:e}},dp=function(e,t,n){return t.ok===!1?t:n.ok===!1?n:Ct(e(t.result,n.result))},Ll=function(e,t){return t.ok===!0?t:yt(e(t.error))},Vu=function(){return Vu=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},Vu.apply(this,arguments)};function Gu(e,t){if(e===t||e===null&&t===null)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="object"){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Gu(e[n],t[n]))return!1;return!0}var o=Object.keys(e);if(o.length!==Object.keys(t).length)return!1;for(n=0;n<o.length;n++)if(!t.hasOwnProperty(o[n])||!Gu(e[o[n]],t[o[n]]))return!1;return!0}}var ia=function(e){return Array.isArray(e)},ss=function(e){return typeof e=="object"&&e!==null&&!ia(e)},oo=function(e,t){return"expected "+e+", got "+function(n){switch(typeof n){case"string":return"a string";case"number":return"a number";case"boolean":return"a boolean";case"undefined":return"undefined";case"object":return n instanceof Array?"an array":n===null?"null":"an object";default:return JSON.stringify(n)}}(t)},Gi=function(e){return e.map(function(t){return typeof t=="string"?"."+t:"["+t+"]"}).join("")},qi=function(e,t){var n=t.at,o=function(r,i){var a={};for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&i.indexOf(s)<0&&(a[s]=r[s]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function"){var c=0;for(s=Object.getOwnPropertySymbols(r);c<s.length;c++)i.indexOf(s[c])<0&&Object.prototype.propertyIsEnumerable.call(r,s[c])&&(a[s[c]]=r[s[c]])}return a}(t,["at"]);return Vu({at:e+(n||"")},o)},bt=function(){function e(t){var n=this;this.decode=t,this.run=function(o){return Ll(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},n.decode(o))},this.runPromise=function(o){return function(r){return r.ok===!0?Promise.resolve(r.result):Promise.reject(r.error)}(n.run(o))},this.runWithException=function(o){return function(r){if(r.ok===!0)return r.result;throw r.error}(n.run(o))},this.map=function(o){return new e(function(r){return function(i,a){return a.ok===!0?Ct(i(a.result)):a}(o,n.decode(r))})},this.andThen=function(o){return new e(function(r){return function(i,a){return a.ok===!0?i(a.result):a}(function(i){return o(i).decode(r)},n.decode(r))})},this.where=function(o,r){return n.andThen(function(i){return o(i)?e.succeed(i):e.fail(r)})}}return e.string=function(){return new e(function(t){return typeof t=="string"?Ct(t):yt({message:oo("a string",t)})})},e.number=function(){return new e(function(t){return typeof t=="number"?Ct(t):yt({message:oo("a number",t)})})},e.boolean=function(){return new e(function(t){return typeof t=="boolean"?Ct(t):yt({message:oo("a boolean",t)})})},e.constant=function(t){return new e(function(n){return Gu(n,t)?Ct(t):yt({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(n)})})},e.object=function(t){return new e(function(n){if(ss(n)&&t){var o={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r].decode(n[r]);if(i.ok!==!0)return n[r]===void 0?yt({message:"the key '"+r+"' is required but was not present"}):yt(qi("."+r,i.error));i.result!==void 0&&(o[r]=i.result)}return Ct(o)}return ss(n)?Ct(n):yt({message:oo("an object",n)})})},e.array=function(t){return new e(function(n){return ia(n)&&t?n.reduce(function(o,r,i){return dp(function(a,s){return a.concat([s])},o,function(a,s){return Ll(function(c){return qi("["+s+"]",c)},t.decode(a))}(r,i))},Ct([])):ia(n)?Ct(n):yt({message:oo("an array",n)})})},e.tuple=function(t){return new e(function(n){if(ia(n)){if(n.length!==t.length)return yt({message:"expected a tuple of length "+t.length+", got one of length "+n.length});for(var o=[],r=0;r<t.length;r++){var i=t[r].decode(n[r]);if(!i.ok)return yt(qi("["+r+"]",i.error));o[r]=i.result}return Ct(o)}return yt({message:oo("a tuple of length "+t.length,n)})})},e.union=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return e.oneOf.apply(e,[t,n].concat(o))},e.intersection=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new e(function(i){return[t,n].concat(o).reduce(function(a,s){return dp(Object.assign,a,s.decode(i))},Ct({}))})},e.anyJson=function(){return new e(function(t){return Ct(t)})},e.unknownJson=function(){return new e(function(t){return Ct(t)})},e.dict=function(t){return new e(function(n){if(ss(n)){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=t.decode(n[r]);if(i.ok!==!0)return yt(qi("."+r,i.error));o[r]=i.result}return Ct(o)}return yt({message:oo("an object",n)})})},e.optional=function(t){return new e(function(n){return n==null?Ct(void 0):t.decode(n)})},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(function(o){for(var r=[],i=0;i<t.length;i++){var a=t[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var s=r.map(function(c){return"at error"+(c.at||"")+": "+c.message}).join('", "');return yt({message:'expected a value matching one of the decoders, got the errors ["'+s+'"]'})})},e.withDefault=function(t,n){return new e(function(o){return Ct(function(r,i){return i.ok===!0?i.result:r}(t,n.decode(o)))})},e.valueAt=function(t,n){return new e(function(o){for(var r=o,i=0;i<t.length;i++){if(r===void 0)return yt({at:Gi(t.slice(0,i+1)),message:"path does not exist"});if(typeof t[i]=="string"&&!ss(r))return yt({at:Gi(t.slice(0,i+1)),message:oo("an object",r)});if(typeof t[i]=="number"&&!ia(r))return yt({at:Gi(t.slice(0,i+1)),message:oo("an array",r)});r=r[t[i]]}return Ll(function(a){return r===void 0?{at:Gi(t),message:"path does not exist"}:qi(Gi(t),a)},n.decode(r))})},e.succeed=function(t){return new e(function(n){return Ct(t)})},e.fail=function(t){return new e(function(n){return yt({message:t})})},e.lazy=function(t){return new e(function(n){return t().decode(n)})},e}(),$t=bt.string,z2=bt.number,ct=bt.boolean,rc=bt.anyJson;bt.unknownJson;var K=bt.constant,en=bt.object,Jo=bt.array;bt.tuple,bt.dict;var Ee=bt.optional,$a=bt.oneOf;bt.union,bt.intersection,bt.withDefault,bt.valueAt,bt.succeed;var U2=bt.fail;bt.lazy;const fo=$t().where(e=>e.length>0,"Expected a non-empty string"),K2=$a(K("add"),K("align-bottom"),K("align-bottom-solid"),K("align-left"),K("align-left-bottom"),K("align-left-bottom-solid"),K("align-left-solid"),K("align-left-top"),K("align-left-top-solid"),K("align-right"),K("align-right-bottom"),K("align-right-bottom-solid"),K("align-right-solid"),K("align-right-top"),K("align-right-top-solid"),K("align-top"),K("align-top-solid"),K("always-on-top"),K("always-on-top-on"),K("application"),K("arrow-down-long"),K("arrow-down-to-bracket"),K("arrow-left-long"),K("arrow-right-from-bracket"),K("arrow-right-long"),K("arrow-right"),K("arrow-up"),K("arrow-up-long"),K("ban"),K("bell"),K("bell-solid"),K("bookmark"),K("bullseye-pointer"),K("certificate"),K("check"),K("check-light"),K("check-solid"),K("chevron-down"),K("chevron-left"),K("chevron-right"),K("chevron-up"),K("circle-info"),K("circle-xmark"),K("circle-xmark-full"),K("clock"),K("clock-rotate-left"),K("clone"),K("close"),K("cog"),K("cog-solid"),K("collapse"),K("copy"),K("download"),K("delete-left"),K("dev-tools"),K("ellipsis"),K("ellipsis-vertical"),K("expand"),K("envelope"),K("envelope-open"),K("exclamation-mark"),K("expand"),K("feedback"),K("filter"),K("floppy"),K("floppy-disk-pen"),K("folder"),K("folder-open"),K("globe"),K("group"),K("hidden"),K("home"),K("house"),K("info"),K("keyboard"),K("layout"),K("link"),K("list-ul"),K("lock"),K("logo"),K("minimize"),K("minimize-down"),K("paper-plane-top"),K("paperclip"),K("pause"),K("pen-line"),K("pen-to-square"),K("pin"),K("play"),K("pop-in"),K("pop-in-widget"),K("pop-out"),K("power-off"),K("publish"),K("refresh"),K("resize"),K("restore"),K("rotate-right"),K("search"),K("search-filled"),K("sleep"),K("sliders"),K("snooze"),K("spinner"),K("square"),K("square-arrow-down"),K("square-arrow-up"),K("star"),K("star-full"),K("sticky-off"),K("sticky-off-hover"),K("sticky-on"),K("sticky-on-hover"),K("subscribe"),K("system-close"),K("system-maximize"),K("system-minimize"),K("thumbs-down"),K("thumbs-up"),K("trash"),K("trash-can"),K("triangle-exclamation"),K("unlock"),K("unpin"),K("up-to-line"),K("user"),K("user-gear"),K("visible"),K("workspace")),V2=en({id:fo,title:fo,description:Ee($t()),icon:Ee(K2),iconSrc:Ee(fo),contextMenuActions:Ee(Jo(rc())),type:fo}),G2=en({name:fo,type:fo}),q2=$a(K("Left"),K("Right")),fp=$a(K("daily"),K("weekly")),hp=$a(K("Sunday"),K("Monday"),K("Tuesday"),K("Wednesday"),K("Thursday"),K("Friday"),K("Saturday")),Rs=en({customPrefs:Ee(rc()),_launchpad_collapsedSections:Ee(Jo(fo)),_launchpad_favorites:Ee(Jo(V2)),_launchpad_recent:Ee(Jo(G2)),_launchpad_isLayoutsPanelOpen:Ee(ct()),_launchpad_isCollapsed:Ee(ct()),_launchpad_isPinned:Ee(ct()),_launchpad_isDocked:Ee(ct()),_launchpad_minimizeToTray:Ee(ct()),_launchpad_autoCloseStartingAppsAndWorkspaces:Ee(ct()),_launchpad_pinnedPosition:Ee(q2),_launchpad_allowDocking:Ee(ct()),_launchpad_dockedAlwaysOnTop:Ee(ct()),_launchpad_dockedClaimsSpace:Ee(ct()),_launchpad_showExtendedArea:Ee(ct()),_launchpad_hideLabelsInExtendedArea:Ee(ct()),_launchpad_showFavoritesInExtendedArea:Ee(ct()),_launchpad_hideFavoritesSection:Ee(ct()),_launchpad_showRecentAppsInExtendedArea:Ee(ct()),_layouts_restoreLastSaved:Ee(ct()),_layouts_saveCurrentOnExit:Ee(ct()),_layouts_showUnsavedChangesPrompt:Ee(ct()),_layouts_showDeletePrompt:Ee(ct()),_downloads_askForEachDownload:Ee(ct()),_downloads_location:Ee($t()),_system_scheduleRestart:Ee(ct()),_system_scheduleRestartTime:Ee(fo),_system_scheduleRestartFrequency:Ee(fp),_system_scheduleRestartDay:Ee(hp),_system_scheduleShutdown:Ee(ct()),_system_scheduleShutdownTime:Ee(fo),_system_scheduleShutdownFrequency:Ee(fp),_system_scheduleShutdownDay:Ee(hp)}),Hv=async e=>{const{io:t,variant:n,text:o,error:r}=e,i=Er(r);try{if(n===Qd&&t.logger.warn(i?`${o} ${i}`:o),!("modals"in t)||!t.modals)throw new Error("Modals are not enabled.");const a={text:o,variant:n,ttl:F2[n]};await t.modals.alerts.request(a)}catch(a){console.warn("Failed to request alert. ",{error:a})}},ef=v.createContext(void 0),zc=({children:e,launchpadMode:t})=>{const[n,o]=v.useState(),[r,i]=v.useState(!1),[a,s]=v.useState(),c=v.useContext(Te.IOConnectContext),u=v.useMemo(()=>({prefs:n,isInitialSetupCompleted:r,initialSetupError:a}),[n,r,a]);return v.useEffect(()=>{if(!c)return;let d=!1;const f=c.contexts.subscribe(Cr,h=>{if(d)return;const p=Rs.run(h);if(!p.ok)return void c.logger.warn(`The received data for context ${Cr} is with an invalid shape: ${Er(p.error.message)}`);const m=p.result;o(m),c.prefs.updateFor(up,m).catch(g=>{c.logger.warn(`Failed to update platform prefs. Error: ${Er(g)}`)})});return()=>{d=!0,f.then(h=>{h()})}},[c]),v.useEffect(()=>{c&&(async()=>{var d;try{const f=await c.contexts.get(Cr),h=Rs.run(f);if(!h.ok)throw new Error(`The data in context ${Cr} is with an invalid shape: ${Er(h.error.message)}`);const p=h.result;if(Object.keys(p).length>0)return;const m=((d=await c.prefs.get(up))==null?void 0:d.data)??{},g=Rs.run(m);if(!g.ok)throw new Error(`The stored platform prefs in io.prefs are with an invalid shape: ${Er(g.error.message)}`);const y={[Uu]:t==="pinned"||(m[Uu]??!1),[Ku]:t==="docked"||(m[Ku]??!1)},w={...W2,...g.result,...y};await c.contexts.set(Cr,w)}catch(f){s({message:Er(f)}),await Hv({io:c,variant:Qd,text:"Initial platform prefs setup failed.",error:f})}finally{i(!0)}})().catch(console.error)},[c,t]),l.jsx(ef.Provider,{value:u,children:e})};function Bv(){const e=v.useContext(ef);if(e===void 0)throw new Error("usePlatformPrefs must be used within a PlatformPrefsProvider");return e}function Nt({prefKey:e}){var f;const t=v.useContext(Te.IOConnectContext),n=v.useContext(ef),o=(f=n==null?void 0:n.prefs)==null?void 0:f[e],r=(n==null?void 0:n.isInitialSetupCompleted)??!1,[i,a]=v.useState(!r),[s,c]=v.useState(),u=v.useRef(0);v.useEffect(()=>{r&&u.current===0&&a(!1)},[r]);const d=v.useCallback(async h=>{if(!t)return;const p=++u.current;a(!0),c(void 0);const m=async y=>{y&&await Hv({io:t,variant:Qd,text:`Failed to update prefKey "${e}".`,error:y}),p===u.current&&(a(!1),y&&c({message:Er(y)}))};let g;if(h instanceof Function)try{g=h((await t.contexts.get(Cr))[e])}catch(y){return m(y)}else g=h;try{const y=Rs.runWithException({[e]:g});await t.contexts.update(Cr,y)}catch(y){return m(y)}await m()},[t,e]);if(n===void 0)throw new Error("usePlatformPref must be used within a PlatformPrefsProvider");return{error:s,isLoading:i,update:d,value:o}}const Wv=v.createContext(void 0),pp=()=>{const e=v.useContext(Wv);if(!e)throw new Error("usePanelManagerContext must be used within a PanelManagerContext.Provider");return e},Fv=e=>{const{General:t,Launchpad:n,Docking:o,ExtendedArea:r,Layouts:i,Downloads:a,System:s}=po();return l.jsxs(ir,{element:ki,elementProps:e,children:[l.jsx(t,{}),l.jsx(n,{}),l.jsx(o,{}),l.jsx(r,{}),l.jsx(i,{}),l.jsx(a,{}),l.jsx(s,{})]})},zv=({title:e="General",...t})=>{const{Theme:n}=po();return l.jsx(Xe,{title:e,...t,children:l.jsx(n,{})})},Uc=({className:e,title:t="Theme",...n})=>{const{currentTheme:o,selectTheme:r}=k2(),i=E2();return l.jsxs("div",{className:re("flex jc-between ai-center",e),"data-testid":"theme-container",...n,children:[l.jsx("label",{className:"io-text-clipper","data-testid":"theme-label",children:t}),l.jsxs(pe,{variant:"light","data-testid":"theme-dropdown",children:[l.jsx(pe.Button,{text:(o==null?void 0:o.displayName)??"Dark","data-testid":"theme-dropdown-button"}),l.jsx(pe.Content,{"data-testid":"theme-dropdown-content",children:l.jsx(pe.List,{children:i.map(({displayName:a,name:s})=>l.jsx(pe.Item,{onClick:()=>r(s),"data-testid":`theme-dropdown-item-${s}`,children:a},s))})})]})]})},Kt=({prefKey:e,...t})=>{const{isLoading:n,value:o=!1,update:r}=Nt({prefKey:e});return l.jsx(St,{checked:o,disabled:n,onChange:i=>r(i.target.checked),...t})},Uv=({align:e="right",label:t="Minimize to tray",...n})=>l.jsx(Kt,{align:e,label:t,prefKey:Cv,...n}),J2=({prefKey:e,options:t,disabled:n,...o})=>{const{isLoading:r,value:i="Select option",update:a}=Nt({prefKey:e});return l.jsxs(pe,{variant:"light",disabled:r||n,...o,children:[l.jsx(pe.Button,{children:i}),l.jsx(pe.Content,{children:l.jsx(pe.List,{children:t.map(s=>l.jsx(pe.Item,{onClick:()=>(async c=>{if(c!==i)try{await a(c)}catch(u){console.error("Failed to update platform preference:",u)}})(s),children:s},s))})})]})},Kv=({className:e,label:t="Pinned position",...n})=>l.jsx(Xe,{className:re("io-block-list-gap",e),...n,children:l.jsxs("div",{className:"flex jc-between ai-center",children:[l.jsx("label",{className:"io-text-clipper",children:t}),l.jsx(J2,{className:e,prefKey:jv,options:["Left","Right"],...n})]})}),Vv=({align:e="right",label:t='Hide "Favorites"',...n})=>l.jsx(Kt,{align:e,label:t,prefKey:Nv,...n}),Gv=({align:e="right",label:t="Allow docking to top",...n})=>l.jsx(Kt,{align:e,label:t,prefKey:Av,...n}),qv=({align:e="right",label:t="Always on top",...n})=>l.jsx(Kt,{align:e,label:t,prefKey:Ov,...n}),Jv=({align:e="right",label:t="Claim occupied space",...n})=>l.jsx(Kt,{align:e,label:t,prefKey:Pv,...n}),Zv=({align:e="right",label:t="Show the extended Launchpad area",...n})=>l.jsx(Kt,{align:e,label:t,prefKey:Ma,...n}),Yv=({align:e="right",label:t="Hide labels",...n})=>{const{value:o}=Nt({prefKey:Ma});return l.jsx(Kt,{align:e,label:t,prefKey:_v,disabled:!o,...n})},Xv=({align:e="right",label:t='Show "Favorites"',...n})=>{const{value:o}=Nt({prefKey:Ma});return l.jsx(Kt,{align:e,label:t,prefKey:Tv,disabled:!o,...n})},Qv=({align:e="right",label:t='Show "Recent"',...n})=>{const{value:o}=Nt({prefKey:Ma});return l.jsx(Kt,{align:e,label:t,prefKey:Iv,disabled:!o,...n})},e0=({title:e="Layouts",...t})=>{const{LayoutsSaveCurrentOnExit:n,LayoutsShowDeletePrompt:o,LayoutsShowUnsavedChangesPrompt:r}=po();return l.jsxs(Xe,{title:e,...t,children:[l.jsx(n,{}),l.jsx(r,{}),l.jsx(o,{})]})},t0=({align:e="right",label:t="Save current on exit",...n})=>l.jsx(Kt,{align:e,label:t,prefKey:Lv,...n}),Kc=({align:e="right",label:t="Show prompt for unsaved changes",...n})=>l.jsx(Kt,{align:e,label:t,prefKey:Dv,"data-testid":"layouts-show-unsaved-changes-prompt-toggle-button",...n}),Vc=({align:e="right",label:t="Show prompt for deleting",...n})=>l.jsx(Kt,{align:e,label:t,prefKey:Mv,"data-testid":"layouts-show-delete-prompt-toggle",...n}),n0=({title:e="Downloads",...t})=>{const{DownloadsLocation:n}=po();return l.jsx(Xe,{title:e,...t,children:l.jsx(n,{})})};function o0({title:e="Downloads"}){const{ItemSearch:t,HeaderButtons:n}=Ha();return l.jsxs("div",{className:"io-dm-header",children:[l.jsxs(sn,{draggable:!0,children:[l.jsx(sn.Title,{tag:"h1",text:e,size:"large"}),l.jsx(n,{className:"non-draggable"})]}),l.jsx(t,{})]})}const on=window.glue42gd,r0=v.createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),yo=()=>v.useContext(r0);function i0({className:e,placeholder:t="Search",iconPrepend:n="search",iconAppend:o="close",...r}){const i=re("io-header-search",e),a=v.useRef(null),{searchQuery:s,setSearch:c,itemsCount:u}=yo(),d=s.length>0,f=v.useCallback(()=>{c(""),a.current&&a.current.focus()},[c]);return l.jsxs("div",{className:i,children:[l.jsx(er,{ref:a,value:s,iconPrepend:n,iconAppend:d?o:void 0,iconAppendOnClick:d?f:void 0,placeholder:t,onChange:h=>c(h.target.value),...r}),d&&l.jsx("p",{className:"io-header-search-count",children:`${u} results`})]})}function a0({className:e,...t}){const{MoreButton:n,CloseButton:o,ExternalButton:r}=Ha();return l.jsxs(De,{className:e,align:"right",...t,children:[l.jsx(n,{}),l.jsx(r,{}),l.jsx(o,{})]})}function s0({icon:e="ellipsis-vertical",...t}){const{items:n,clearItems:o,showSettings:r}=yo(),i=n.length===0;return l.jsxs(pe,{variant:"light",...t,children:[l.jsx(pe.ButtonIcon,{icon:e,variant:"circle",size:"32"}),l.jsx(pe.Content,{children:l.jsxs(pe.List,{children:[l.jsx(pe.Item,{onClick:a=>(s=>{i?s.stopPropagation():o()})(a),disabled:i,children:"Clear All"}),l.jsx(pe.Item,{onClick:r,children:"Settings"})]})})]})}function c0({className:e,icon:t="pop-out",...n}){const o=v.useContext(Te.IOConnectContext),r=v.useCallback(()=>{zo.startApplication(o,"io-connect-download-manager").catch(i=>{console.error("Failed to open Download Manager",i)})},[o]);return l.jsx(Ue,{className:re("io-dm-compact-mode-only",e),icon:t,variant:"circle",size:"32",onClick:r,...n})}function l0({icon:e="close",size:t="32",variant:n="circle",onClick:o,...r}){const i=v.useContext(Te.IOConnectContext);return l.jsx(Ue,{icon:e,size:t,variant:n,onClick:a=>{o?o(a):j2.closeWindow(i).catch(s=>{console.error("Failed to close window:",s)})},...r})}function Vr(e,t=!1,n=!1,o=!1){const r=e.getDate(),i=["January","February","March","April","May","June","July","August","September","October","November","December"][e.getMonth()],a=e.getFullYear(),s=e.getHours(),c=e.getMinutes();let u="";return u=c<10?`0${c}`:`${c}`,t?t==="Today"?n?"Today":`Today at ${s}:${u}`:t==="Yesterday"?n?"Yesterday":`Yesterday at ${s}:${u}`:`${s}:${u}`:o?n?`${i} ${r}`:`${i} ${r} at ${s}:${u}`:n?`${i} ${r}, ${a}`:`${i} ${r}, ${a} at ${s}:${u}`}function u0(e,t={showTime:!0}){const n=new Date(1e3*e),o=new Date,r=Math.round((o-n)/1e3),i=Math.round(r/60),a=o.toDateString()===n.toDateString(),s=new Date(o.setDate(o.getDate()-1)).toDateString()===n.toDateString(),c=o.getFullYear()===n.getFullYear();return t.showTime?r<5?"Just Now":r<60?`${r} seconds ago`:r<90?"about a minute ago":i<60?`${i} minutes ago`:a?Vr(n,"Today",!1,!0):s?Vr(n,"Yesterday",!1,!0):c?Vr(n,!1,!1,!0):Vr(n):a?"Today":s?"Yesterday":c?Vr(n,!1,!0,!0):Vr(n,!1,!0)}function d0({className:e,...t}){const n=re("io-dm-body","io-panel-body",e),{DownloadListEmpty:o,ItemGroup:r,Item:i}=Ha(),{items:a,searchQuery:s,setCount:c,sortItems:u}=yo(),d=u(a),f=kv(s),h=v.useMemo(()=>d.filter(g=>g.displayInfo.filename.toLowerCase().includes(f.toLowerCase())||g.displayInfo.url.toLowerCase().includes(f.toLowerCase())),[d,f]),p=v.useMemo(()=>h.map(g=>({...g,displayInfo:{...g.displayInfo,startTime:u0(g.displayInfo.startTime,{showTime:!1})}})),[h]),m=v.useMemo(()=>Object.values(p.reduce((g={},y)=>{var w;return g[y.displayInfo.startTime]=((w=g[y.displayInfo.startTime])==null?void 0:w.concat([]))??[],g[y.displayInfo.startTime].push(y),g},{})),[p]);return v.useEffect(()=>{c(h.length)},[h,c]),l.jsx(ir,{elementProps:{className:n,...t},children:m&&m.length!==0?m.map(g=>l.jsx(r,{title:String(g[0].displayInfo.startTime)??null,children:g.map(y=>l.jsx(i,{item:y},y.id))},g[0].id??"")):l.jsx(o,{})})}function f0({className:e,icon:t="download",text:n="No downloads to display.",...o}){const r=re("io-dm-no-items",e);return l.jsxs("div",{className:r,...o,children:[l.jsx(xt,{variant:t}),l.jsx("p",{children:n})]})}function h0({className:e,title:t,children:n,...o}){const r=re("io-dm-item-group",e);return l.jsxs("div",{className:r,...o,children:[t&&l.jsx("p",{className:"io-dm-items-group-title",children:t}),n]})}function p0({className:e,item:t,...n}){const{ItemHeader:o,ItemBody:r,ItemFooter:i}=Ha(),{state:a,url:s,filename:c,receivedBytes:u,totalBytes:d,speed:f,timeRemaining:h}=t.displayInfo;if(!t)return l.jsx(l.Fragment,{});const p=re("io-dm-item",t.displayInfo.state&&[a],e);return l.jsxs("div",{className:p,...n,children:[l.jsx(o,{itemID:t.id,filename:c,state:a}),l.jsx(r,{state:a,url:s,bytesReceived:u,bytesTotal:d,speed:f,timeRemaining:h}),l.jsx(i,{itemID:t.id,state:a})]})}function tf({bytesReceived:e=0,bytesTotal:t=0,...n}){const o=v.useCallback(()=>e&&t?Math.round(e/t*100):0,[e,t]);return l.jsx(Hx,{value:o(),...n})}function m0({className:e,itemID:t,filename:n,state:o,pauseResume:r,showInFolder:i,cancel:a,remove:s,...c}){const u=re("io-dm-item-header",e),{pauseResumeItem:d,showItemInFolder:f,cancelItem:h,removeItem:p}=yo(),m=o==="progressing"||o==="paused",g=o==="interrupted"||o==="cancelled",y=m?"Cancel Download":"Remove Download",w=a??h,S=s??p,b=function(x,C,I,R){return x==="paused"||x==="progressing"?{statusIcon:x==="paused"?"play":"pause",onStatusActionClick:()=>I(C)}:x==="completed"?{statusIcon:"folder",onStatusActionClick:()=>R(C)}:null}(o,t,r??d,i??f),k=v.useCallback(()=>{m?w(t):S(t)},[m,w,t,S]);return l.jsxs("div",{className:u,...c,children:[l.jsx(qn,{text:n,style:{textDecoration:g?"line-through":"none"}}),l.jsxs(De,{children:[b&&l.jsx(Ue,{icon:b.statusIcon,iconSize:"12",onClick:b.onStatusActionClick,className:"io-dm-compact-mode-only"}),l.jsx(Ue,{icon:"close",iconSize:"12",title:y,onClick:k})]})]})}function g0({className:e,state:t,url:n,bytesReceived:o=0,bytesTotal:r=0,speed:i=0,timeRemaining:a=0,...s}){const c=re("io-dm-item-body",e),u=h=>{const p=["Bytes","KB","MB","GB","TB"];if(h===0)return"0";const m=Math.floor(Math.log(h)/Math.log(1024));return m===0?`${h}${p[m]}`:`${(h/1024**m).toFixed(1)}${p[m]}`};return l.jsxs("div",{className:c,...s,children:[l.jsx("p",{className:"io-text-small",children:n}),(f=t,f==="cancelled"||f==="interrupted"||f==="completed"?null:l.jsx(tf,{variant:f==="paused"?"paused":"active",bytesReceived:o,bytesTotal:r})),l.jsx("p",{className:"io-text-default-lh16",children:t==="completed"?`${u(o??0)} - Done`:t==="cancelled"||t==="interrupted"?`${u(o??0)}/${u(r??0)} - Failed`:`${u(o??0)}/${u(r??0)} (${d=i,(d?`${(d/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(h=>{const p=Math.floor(h/3600),m=Math.floor(h%3600/60);let g="";return p>0&&(g+=`${p} hour${p>1?"s":""}, `),m>0&&(g+=`${m} min${m>1?"s":""}, `),((h=Math.floor(h%60))>0||g==="")&&(g+=`${h} sec${h===1?"":"s"}`),`${g.trim()} left`})(a)??0}`})]});var d,f}const Z2={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function Dl({className:e,variant:t,text:n}){const o=re("io-dm-item-status",`io-dm-item-status-${t}`,e);return l.jsxs("div",{className:o,children:[t&&l.jsx(xt,{variant:Z2[t],className:"icon-severity",size:"10"}),n&&l.jsx("p",{className:"io-text-smaller",children:n})]})}function v0({className:e,itemID:t,state:n,pauseResume:o,showInFolder:r,cancel:i,...a}){const s=re("io-dm-item-footer",e),{pauseResumeItem:c,showItemInFolder:u,cancelItem:d}=yo(),f=v.useCallback(m=>{o?o(m):c(m)},[o,c]),h=v.useCallback(m=>{r?r(m):u(m)},[r,u]),p=v.useCallback(m=>{i?i(m):d(m)},[i,d]);return l.jsx("div",{className:s,...a,children:(()=>{switch(n){case"progressing":return l.jsxs(De,{align:"right",children:[l.jsx(De.Button,{variant:"primary",text:"Pause",onClick:()=>f(t)}),l.jsx(De.Button,{variant:"link",text:"Cancel",onClick:()=>p(t)})]});case"paused":return l.jsx(De,{align:"right",children:l.jsx(De.Button,{variant:"primary",text:"Resume",onClick:()=>f(t)})});case"completed":return l.jsxs(l.Fragment,{children:[l.jsx(Dl,{variant:"success",text:"Complete"}),l.jsx(De,{align:"right",children:l.jsx(De.Button,{variant:"primary",text:"Show in Folder",onClick:()=>h(t)})})]});case"cancelled":return l.jsx(Dl,{variant:"warning",text:"Cancelled"});case"interrupted":return l.jsxs(l.Fragment,{children:[l.jsx(Dl,{variant:"critical",text:"Failed"}),l.jsx(De,{align:"right",children:l.jsx(De.Button,{variant:"primary",text:"Retry",onClick:()=>f(t)})})]});default:return null}})()})}function y0({className:e,title:t="Download Settings",...n}){const o=re("io-dm-settings-panel",e),{configuration:{downloadFolder:r},hideSettings:i,setDownloadLocation:a,setDownloadLocationWithDialog:s,isDownloadLocationDialogVisible:c,downloadLocationList:u}=yo();return l.jsxs(nt,{className:o,...n,children:[l.jsxs(nt.Header,{children:[l.jsx(nt.Header.Title,{size:"large",text:t,tag:"h1"}),l.jsx(nt.Header.ButtonGroup,{children:l.jsx(Ue,{className:"non-draggable",variant:"circle",icon:"close",size:"32",onClick:()=>{i()},disabled:c})})]}),l.jsx(nt.Body,{children:l.jsxs(De,{children:[l.jsxs(pe,{variant:"light",disabled:c,children:[l.jsx(pe.Button,{children:l.jsx("span",{className:"io-dm-settings-panel-download-location",children:r??u[0]})}),u.length>1&&l.jsx(pe.Content,{children:l.jsx(pe.List,{children:u.map((d,f)=>!d||f===0||f>3?null:l.jsx(pe.Item,{onClick:()=>{a(d)},children:d},d))})})]}),l.jsx(et,{className:"io-btn io-dm-settings-panel-download-location-btn",text:"Browse",onClick:()=>{s()},disabled:c})]})})]})}const w0={Header:o0,ItemSearch:i0,HeaderButtons:a0,MoreButton:s0,ExternalButton:c0,CloseButton:l0,Body:d0,DownloadListEmpty:f0,ItemGroup:h0,Item:p0,ItemProgress:tf,ItemHeader:m0,ItemBody:g0,ItemFooter:v0,Settings:y0},b0=v.createContext(w0),x0=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...w0,...t}),[t]);return l.jsx(b0.Provider,{value:n,children:e})});x0.displayName="ComponentsStore";const Ha=()=>v.useContext(b0);function Y2({className:e,...t}){const n=re("io-dm",e),{Header:o,Body:r,Settings:i}=Ha(),{isSettingsVisible:a}=yo();return l.jsxs(nt,{className:n,...t,children:[l.jsx(o,{}),l.jsx(r,{}),a&&l.jsx(i,{})]})}var X2=Object.freeze({__proto__:null,Body:d0,CloseButton:l0,DownloadListEmpty:f0,DownloadManager:function({components:e,...t}){return l.jsx(x0,{components:e,children:l.jsx(Y2,{...t})})},DownloadManagerProvider:({children:e})=>{const{configuration:t,items:n,removeItem:o,pauseResumeItem:r,cancelItem:i,clearItems:a,showItemInFolder:s,isSettingsVisible:c,showSettings:u,hideSettings:d,searchQuery:f,setSearch:h,itemsCount:p,setCount:m,setDownloadLocation:g,setDownloadLocationWithDialog:y,sortItems:w,isDownloadLocationDialogVisible:S,downloadLocationList:b}=function(){const[x,C]=v.useState({}),[I,R]=v.useState([]),[M,_]=v.useState(0),[T,P]=v.useState([]),[X,te]=v.useState(""),[W,J]=v.useState(!1),[L,G]=v.useState(!1),[F,N]=v.useState({filePaths:[],canceled:!1});v.useEffect(()=>{if(!on)return;const H=on.downloads.onUpdate(E=>R(j=>$(j,E))),B=on.downloads.onConfigurationChanged(E=>{C(E)});return on.downloads.list().then(R).catch(console.error),on.downloads.getSavePathList().then(E=>{E.pathList&&P(E.pathList)}).catch(console.error),()=>{H(),B()}},[]),v.useEffect(()=>{G(!1)},[F]);const $=(H,B)=>{const E=H.findIndex(A=>A.id===B.id);if(E===-1)return[B,...H];const j=[...H];return j[E]=B,j};return{items:I,setCount:H=>{_(H)},sortItems:(H,B=!0)=>H.sort((E,j)=>B?E.displayInfo.startTime<j.displayInfo.startTime?1:-1:E.displayInfo.startTime>j.displayInfo.startTime?1:-1),setSearch:H=>{te(H)},cancelItem:async H=>{try{await on.downloads.cancel(H)}catch(B){console.error(B)}},removeItem:async H=>{try{R(B=>B.filter(E=>E.id!==H)),await on.downloads.removeItem(H)}catch(B){console.error(B)}},clearItems:async()=>{try{R([]),await on.downloads.clearDownloadList()}catch(H){console.error(H)}},itemsCount:M,searchQuery:X,showSettings:()=>{J(!0)},hideSettings:()=>{J(!1)},configuration:x,isSettingsVisible:W,pauseResumeItem:async H=>{try{await on.downloads.pauseResume(H)}catch(B){console.error(B)}},showItemInFolder:async H=>{try{await on.downloads.showInFolder(H)}catch(B){console.error(B)}},setDownloadLocation:async H=>{try{await on.downloads.setSavePath(H),P(B=>{if(B.includes(H)){const E=B.filter(j=>j!==H);return[H,...E]}return[H,...B]})}catch(B){console.error(B)}},downloadLocationList:T,isDownloadLocationDialogVisible:L,setDownloadLocationWithDialog:async()=>{G(!0);try{const H=await on.downloads.showOpenDialog();if(N(H),!(H!=null&&H.filePaths)||H.filePaths.length===0)return;await on.downloads.setSavePath(H.filePaths[0]),P(B=>{if(B.includes(H.filePaths[0])){const E=B.filter(j=>j!==H.filePaths[0]);return[H.filePaths[0],...E]}return[H.filePaths[0],...B]})}catch(H){console.error(H)}}}}(),k=v.useMemo(()=>({configuration:t,items:n,removeItem:o,pauseResumeItem:r,cancelItem:i,clearItems:a,showItemInFolder:s,isSettingsVisible:c,showSettings:u,hideSettings:d,searchQuery:f,setSearch:h,itemsCount:p,setCount:m,setDownloadLocation:g,setDownloadLocationWithDialog:y,sortItems:w,isDownloadLocationDialogVisible:S,downloadLocationList:b}),[t,n,o,r,i,s,a,c,u,d,f,h,p,m,g,y,w,S,b]);return l.jsx(r0.Provider,{value:k,children:e})},ExternalButton:c0,Header:o0,HeaderButtons:a0,Item:p0,ItemBody:g0,ItemFooter:v0,ItemGroup:h0,ItemHeader:m0,ItemProgress:tf,ItemSearch:i0,MoreButton:s0,Settings:y0,useDownloadManagerContext:yo});const S0=({className:e,label:t="Location",...n})=>{const{configuration:{downloadFolder:o},setDownloadLocationWithDialog:r,isDownloadLocationDialogVisible:i,downloadLocationList:a}=yo();return l.jsxs(Xe,{className:re("io-preferences-download-section",e),...n,children:[l.jsxs("div",{className:"flex jc-between ai-center",children:[l.jsx("label",{className:"io-text-clipper",children:t}),l.jsx(et,{text:"Change",onClick:r,disabled:i})]}),l.jsx("p",{children:o??(a==null?void 0:a[0])??"Not set"})]})},k0=({align:e="right",label:t="Ask where to save each file before downloading",...n})=>l.jsx(Kt,{align:e,label:t,prefKey:$v,...n}),C0=({title:e="System",...t})=>{const{SystemRestartSection:n,SystemShutdownSection:o}=po();return l.jsxs(Xe,{title:e,...t,children:[l.jsx(n,{}),l.jsx(o,{})]})},mp="T42.GD.Execute",E0=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],j0=(e,t)=>e in t;function Q2({time:e,frequency:t,day:n}){const[o,r]=e.split(":"),i=Number.parseInt(o,10),a=Number.parseInt(r,10);let s="*";return t==="weekly"&&n&&(s=function(c){const u={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6};if(!j0(c,u))throw new Error(`Invalid day: ${c}`);return u[c]}(n).toString()),`${a} ${i} * * ${s}`}function eS(e){const t=v.useContext(Te.IOConnectContext),{value:n,update:o}=Nt({prefKey:cs(e)}),{value:r,update:i}=Nt({prefKey:cs(e,"Time")}),{value:a,update:s}=Nt({prefKey:cs(e,"Frequency")}),{value:c,update:u}=Nt({prefKey:cs(e,"Day")}),d=v.useCallback(async()=>{try{await t.interop.invoke(mp,{command:`cancel-${e}`})}catch(h){console.error(h)}},[t,e]),f=v.useCallback(async()=>{try{const h=Q2({time:r??"12:00",frequency:a??"daily",day:a==="weekly"?c:"*"});await t.interop.invoke(mp,{command:`schedule-${e}`,args:{cronTime:h,discardUnsavedLayoutChanges:!1}})}catch(h){console.error(`Failed to update cron job for ${e}:`,h)}},[t,e,r,a,c]);return v.useEffect(()=>{t&&n&&f()},[t,n,r,a,c,f]),{enabled:n??!1,time:r??"12:00",frequency:a??"daily",day:c??"Monday",setEnabled:async h=>{h||await d();try{await o(h)}catch(p){console.error("Failed to update enabled state:",p)}},setTime:async h=>{try{await i(h)}catch(p){console.error("Failed to update time:",p)}},setFrequency:async h=>{try{await s(h),h==="daily"&&await u(void 0)}catch(p){console.error("Failed to update frequency:",p)}},setDay:async h=>{var p;if(p=h,E0.includes(p))try{await u(h)}catch(m){console.error("Failed to update day:",m)}else console.error("Invalid day provided")}}}function cs(e,t){const n=e==="restart"?"_system_scheduleRestart":"_system_scheduleShutdown";return t?`${n}${t}`:n}function A0({className:e,variant:t,...n}){const o=re("io-block-list-gap",t,e),{enabled:r,time:i,frequency:a,day:s,setEnabled:c,setTime:u,setFrequency:d,setDay:f}=eS(t);return l.jsxs(Xe,{className:o,...n,children:[l.jsx(St,{label:`Schedule ${t}`,align:"right",onChange:h=>c(h.target.checked),checked:r}),l.jsxs("div",{className:"scheduler-controls",children:[l.jsx("div",{className:"io-control-input io-control-leading-icon direction-up",children:l.jsx("input",{type:"time",className:"io-input",value:i,onChange:h=>u(h.target.value)})}),l.jsxs(Nn,{text:a.charAt(0).toUpperCase()+a.slice(1),icon:"chevron-down",iconRight:!0,children:[l.jsx(Nn.Item,{onClick:()=>d("daily"),children:"Daily"}),l.jsx(Nn.Item,{onClick:()=>d("weekly"),children:"Weekly"})]}),a==="weekly"&&l.jsx(Nn,{text:s,icon:"chevron-down",iconRight:!0,children:E0.map(h=>l.jsx(Nn.Item,{onClick:()=>f(h),children:h},h))})]})]})}function O0({className:e,...t}){return l.jsx(A0,{...t,className:e,variant:"restart"})}function P0({className:e,...t}){return l.jsx(A0,{...t,className:e,variant:"shutdown"})}const _0={Body:Fv,General:zv,Theme:Uc,Launchpad:({title:e="Launchpad",...t})=>{const{MinimizeToTray:n,PinnedPosition:o,HideFavoritesFromLaunchpad:r}=po();return l.jsxs(Xe,{title:e,...t,children:[l.jsx(n,{}),l.jsx(o,{}),l.jsx(r,{})]})},MinimizeToTray:Uv,PinnedPosition:Kv,HideFavoritesFromLaunchpad:Vv,Docking:({title:e="Docking",...t})=>{const{AllowDocking:n,DockedAlwaysOnTop:o,DockedClaimsSpace:r}=po();return l.jsxs(Xe,{title:e,...t,children:[l.jsx(n,{}),l.jsx(o,{}),l.jsx(r,{})]})},AllowDocking:Gv,DockedAlwaysOnTop:qv,DockedClaimsSpace:Jv,ExtendedArea:({title:e="Extended Area",...t})=>{const{ShowExtendedArea:n,HideLabelsInExtendedArea:o,ShowFavoritesInExtendedArea:r,ShowRecentAppsInExtendedArea:i}=po();return l.jsxs(Xe,{title:e,...t,children:[l.jsx(n,{}),l.jsx(o,{}),l.jsx(r,{}),l.jsx(i,{})]})},ShowExtendedArea:Zv,HideLabelsInExtendedArea:Yv,ShowFavoritesInExtendedArea:Xv,ShowRecentAppsInExtendedArea:Qv,Layouts:e0,LayoutsSaveCurrentOnExit:t0,LayoutsShowUnsavedChangesPrompt:Kc,LayoutsShowDeletePrompt:Vc,Downloads:n0,DownloadsLocation:S0,DownloadsAskForEachDownload:k0,System:C0,SystemRestartSection:O0,SystemShutdownSection:P0},T0=v.createContext(_0),N0=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({..._0,...t}),[t]);return l.jsx(T0.Provider,{value:n,children:e})});N0.displayName="PreferencesPanelComponentsStoreProvider";const po=()=>v.useContext(T0),I0=({className:e,onClose:t,title:n="Platform Preferences",children:o,...r})=>l.jsxs(nt,{className:re("io-preferences-panel",e),"data-testid":"preferences-panel",...r,children:[l.jsxs(nt.Header,{"data-testid":"preferences-panel-header",children:[l.jsx(nt.Header.Title,{size:"large",text:n,tag:"h1","data-testid":"preferences-panel-title"}),l.jsx(nt.Header.ButtonGroup,{children:l.jsx(nt.Header.ButtonIcon,{className:"non-draggable",variant:"circle",icon:"close",size:"32",onClick:t,"data-testid":"preferences-panel-close-button"})})]}),o]}),tS=({onClose:e,title:t="Platform Preferences",...n})=>{const{Body:o}=po();return l.jsx(I0,{title:t,onClose:e,...n,children:l.jsx(o,{})})},R0=({components:e,...t})=>l.jsx(N0,{components:e,children:l.jsx(tS,{...t})});function L0({className:e,title:t="General",...n}){const o=re("io-notifications-settings-panel-general",e),{AllowNotifications:r,AllowNotificationToasts:i,ShowNotificationBadge:a,CloseNotificationOnClick:s,PanelAutoHide:c,HideToastsAfter:u}=Br(),d=Ke();return l.jsx("div",{className:o,...n,children:l.jsxs(Xe,{title:t,children:[d&&l.jsx(r,{}),d&&l.jsx(i,{}),l.jsx(a,{}),d&&l.jsx(c,{}),d&&l.jsx(s,{}),d&&l.jsx(u,{})]})})}function qu(e){if(e&&e.errorHandling&&typeof e.errorHandling!="function"&&e.errorHandling!=="log"&&e.errorHandling!=="silent"&&e.errorHandling!=="throw")throw new Error('Invalid options passed to createRegistry. Prop errorHandling should be ["log" | "silent" | "throw" | (err) => void], but '+typeof e.errorHandling+" was passed");var t=e&&typeof e.errorHandling=="function"&&e.errorHandling,n={};function o(r,i){var a=r instanceof Error?r:new Error(r);if(t)t(a);else{var s='[ERROR] callback-registry: User callback for key "'+i+'" failed: '+a.stack;if(e)switch(e.errorHandling){case"log":return console.error(s);case"silent":return;case"throw":throw new Error(s)}console.error(s)}}return{add:function(r,i,a){var s=n[r];return s||(s=[],n[r]=s),s.push(i),a&&setTimeout(function(){a.forEach(function(c){var u;if(!((u=n[r])===null||u===void 0)&&u.includes(i))try{Array.isArray(c)?i.apply(void 0,c):i.apply(void 0,[c])}catch(d){o(d,r)}})},0),function(){var c=n[r];c&&(c=c.reduce(function(u,d,f){return d===i&&u.length===f||u.push(d),u},[]),c.length===0?delete n[r]:n[r]=c)}},execute:function(r){for(var i=[],a=1;a<arguments.length;a++)i[a-1]=arguments[a];var s=n[r];if(!s||s.length===0)return[];var c=[];return s.forEach(function(u){try{var d=u.apply(void 0,i);c.push(d)}catch(f){c.push(void 0),o(f,r)}}),c},clear:function(){n={}},clearKey:function(r){n[r]&&delete n[r]}}}qu.default=qu;var nS=Wm(qu),mt=new class{constructor(){Cn(this,"subscribed",!1);Cn(this,"io");Cn(this,"registry",nS());Cn(this,"logger");Cn(this,"isPanelVisible");Cn(this,"notifications",[]);Cn(this,"bulkActionsSupported",!1);Cn(this,"initPromise")}init(e){return this.initPromise!==void 0||(this.initPromise=(async()=>{var t;if(!this.subscribed){this.subscribed=!0,this.io=e,this.logger=this.io.logger.subLogger("notifications");try{await this.initializeLogger()}catch(n){console.error("Failed to initialize logger with app configuration",n)}this.getBulkActionsSupport();try{await this.subscribe()}catch(n){throw(t=this.logger)==null||t.error("Error during subscription:",n),n}}})()),this.initPromise}async initializeLogger(){var o,r,i,a,s,c;const e=await zo.getMyApplication(this.io),t=((r=(o=e==null?void 0:e.userProperties)==null?void 0:o.logger)==null?void 0:r.publishLevel)??"error",n=((a=(i=e==null?void 0:e.userProperties)==null?void 0:i.logger)==null?void 0:a.consoleLevel)??"info";(s=this.logger)==null||s.publishLevel(t),(c=this.logger)==null||c.consoleLevel(n)}onPanelVisibilityChanged(e){return this.registry.add("on-panel-visibility-changed",e)}onConfigurationChanged(e){return this.registry.add("on-configuration-changed",e)}onNotificationsChanged(e){return this.registry.add("on-notifications-changed",e)}onCounterChanged(e){return this.registry.add("on-counter-changed",e)}async getNotificationsList(){var t;const e=await((t=this.io)==null?void 0:t.notifications.list());if(!e)throw new Error("io.notifications.list is not supported in this environment.");return e.map(n=>this.attachHandlers(n))}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 e;if(this.isDesktopEnvironment())return(e=this.io)==null?void 0:e.notifications.panel.show()}hidePanel(){var e;if(this.isDesktopEnvironment())return(e=this.io)==null?void 0:e.notifications.panel.hide()}clearAll(){var e,t;return(e=this.logger)==null||e.trace("clearing all notifications"),(t=this.io)==null?void 0:t.notifications.clearAll()}clearAllOld(){var e,t;return(e=this.logger)==null||e.trace("clearing all old notifications"),(t=this.io)==null?void 0:t.notifications.clearOld()}clearMany(e){var n,o,r,i;const t=(n=this.io)==null?void 0:n.notifications;return this.isBulkActionSupported("clearMany")?e.length<1?((o=this.logger)==null||o.trace("no ids provided to clear notifications"),Promise.resolve()):((r=this.logger)==null||r.trace(`clearing notifications with ids ${JSON.stringify(e.join(", "))}`),((i=t.clearMany)==null?void 0:i.call(t,e))??Promise.resolve()):Promise.reject(new Error("Bulk actions are not supported in this environment"))}close(e){var t,n;return(t=this.logger)==null||t.trace(`closing notification with id ${e}`),(n=this.io)==null?void 0:n.notifications.clear(e)}snooze(e,t){var n,o;return(n=this.logger)==null||n.trace(`snoozing notification with id ${e} for ${t}ms`),(o=this.io)==null?void 0:o.notifications.snooze(e,t)}snoozeMany(e,t){var o,r,i,a;const n=(o=this.io)==null?void 0:o.notifications;return this.isBulkActionSupported("snoozeMany")?e.length<1?((r=this.logger)==null||r.trace("no ids provided to snooze notifications"),Promise.resolve()):((i=this.logger)==null||i.trace(`snoozing notifications with ids ${JSON.stringify(e.join(", "))} for ${t}ms`),((a=n.snoozeMany)==null?void 0:a.call(n,e,t))??Promise.resolve()):Promise.reject(new Error("Bulk actions are not supported in this environment"))}setState(e,t){var n,o;return(n=this.logger)==null||n.trace(`setting state of ${e} to ${t}`),(o=this.io)==null?void 0:o.notifications.setState(e,t)}setStates(e,t){var o,r,i,a;const n=(o=this.io)==null?void 0:o.notifications;return this.isBulkActionSupported("setStates")?e.length<1?((r=this.logger)==null||r.trace(`no ids provided to change state to ${t} for notifications`),Promise.resolve()):((i=this.logger)==null||i.trace(`setting state of ${JSON.stringify(e.join(", "))} to ${t}`),((a=n.setStates)==null?void 0:a.call(n,e,t))??Promise.resolve()):Promise.reject(new Error("Bulk actions are not supported in this environment"))}getBulkActionsSupport(){this.bulkActionsSupported=this.isBulkActionSupported("clearMany")&&this.isBulkActionSupported("setStates")&&this.isBulkActionSupported("snoozeMany")}setFilter(e){var t,n;return(t=this.logger)==null||t.trace(`setting filter to ${JSON.stringify(e)}`),(n=this.io)==null?void 0:n.notifications.setFilter(e)}configure(e){var t;return(t=this.io)==null?void 0:t.notifications.configure(e)}async resyncNotifications(){var e,t;try{const n=await this.getNotificationsList();this.notifications=n,this.registry.execute("on-notifications-changed",[...this.notifications]),(e=this.logger)==null||e.trace(`resynced notifications array with ${this.notifications.length} notifications`)}catch(n){(t=this.logger)==null||t.error("Error resyncing notifications list:",n)}}async subscribe(){var t,n,o,r,i,a,s,c,u;(t=this.io)==null||t.notifications.onRaised(d=>{var f;(f=this.logger)==null||f.trace(`received event indicating notification raise: ${JSON.stringify(d)}`),this.attachHandlers(d),this.notifications.unshift(d),this.registry.execute("on-notifications-changed",[...this.notifications])}),(n=this.io)==null||n.notifications.onStateChanged(({id:d},f)=>{var h;(h=this.logger)==null||h.trace(`received event for notification state is changed - "${d}" - "${f==null?void 0:f.toString()}"`),this.notifications=this.notifications.map(p=>{var m;return p.id===d?((m=this.logger)==null||m.trace(`${p.id} - the state is changed from "${p.state}" to "${f==null?void 0:f.toString()}"`),{...p,state:f}):p}),this.registry.execute("on-notifications-changed",this.notifications)});const e=(o=this.io)==null?void 0:o.notifications;e!=null&&e.onDataChanged&&e.onDataChanged((d,f)=>{var p;const h=d.id;(p=this.logger)==null||p.trace(`received event for notification data is changed - "${h}" - "${JSON.stringify(f)}"`),this.notifications=this.notifications.map(m=>{var g;return m.id===h?((g=this.logger)==null||g.trace(`${m.id} - the data is changed from "${JSON.stringify(m.data)}" to "${JSON.stringify(f)}"`),{...m,data:f}):m}),this.registry.execute("on-notifications-changed",this.notifications)}),(r=this.io)==null||r.notifications.onClosed(({id:d})=>{var f;(f=this.logger)==null||f.trace(`received event for notification is closed - "${d}".`),this.notifications=this.notifications.filter(h=>h.id!==d),this.registry.execute("on-notifications-changed",this.notifications)});try{const d=await this.getNotificationsList(),f=new Set(d.map(p=>p.id)),h=this.notifications.filter(p=>!f.has(p.id));this.notifications=[...h,...d],(i=this.logger)==null||i.trace(`initialized with ${d.length} fetched + ${h.length} from events = ${this.notifications.length} total`)}catch(d){(a=this.logger)==null||a.error("Error fetching initial notifications list:",d),(s=this.logger)==null||s.trace(`continuing with ${this.notifications.length} notifications from events`)}(c=this.io)==null||c.notifications.onConfigurationChanged(d=>{var f;(f=this.logger)==null||f.trace(`received event for configuration changed - ${JSON.stringify(d)}.`),this.registry.execute("on-configuration-changed",d)}),this.isDesktopEnvironment()&&((u=this.io)==null||u.notifications.panel.onVisibilityChanged(d=>{var f;(f=this.logger)==null||f.trace(`received event for panel visibility changed to "${d}".`),this.isPanelVisible=d,d&&this.resyncNotifications().catch(h=>{var p;(p=this.logger)==null||p.error("Error resyncing notifications on panel visibility:",h)}),this.registry.execute("on-panel-visibility-changed",d)}))}isDesktopEnvironment(){return typeof globalThis.window=="object"&&(!!globalThis.window.iodesktop||!!globalThis.window.glue42gd)}isBulkActionSupported(e){var n;const t=(n=this.io)==null?void 0:n.notifications;return typeof(t==null?void 0:t[e])=="function"}attachHandlers(e){var n;return(n=e.actions)==null||n.forEach(o=>{Object.assign(o,{onClick:async r=>{var i,a,s;try{(i=this.logger)==null||i.info(`${e.id}/${o.action} - was clicked.`),await((a=this.io)==null?void 0:a.notifications.click(e.id,o.action,r))}catch(c){(s=this.logger)==null||s.error("Error while clicking on action:",c)}}})}),Object.assign(e,{snooze:async(o=1e4)=>{var r,i;(r=this.logger)==null||r.trace(`${e.id} - request to change the state from ${e.state} to Snoozed with duration ${o}ms`),await((i=this.io)==null?void 0:i.notifications.snooze(e.id,o))},updateState:async o=>{var r,i;return(r=this.logger)==null||r.trace(`${e.id} - request to change the state from ${e.state} to ${o}`),(i=this.io)==null?void 0:i.notifications.setState(e.id,o)},updateData:async o=>{var i,a,s;(i=this.logger)==null||i.trace(`${e.id} - request to change the data to ${JSON.stringify(o)}`);const r=(a=this.io)==null?void 0:a.notifications;r!=null&&r.updateData?await r.updateData(e.id,o):(s=this.logger)==null||s.warn("'updateData' method is not supported")},onClick:async o=>{var r,i,a;try{(r=this.logger)==null||r.info(`${e.id} - was clicked.`),await((i=this.io)==null?void 0:i.notifications.click(e.id,void 0,o))}catch(s){(a=this.logger)==null||a.error(`Error while clicking on Notification: ${e.id}`,s)}},onShow:()=>{},close:async()=>{var o;return(o=this.logger)==null||o.info(`${e.id} - was closed.`),this.close(e.id)}})}};function nf(e){const t=v.useContext(Te.IOConnectContext),n=Ke(),[o,r]=v.useState([]),[i,a]=v.useState(0),s="Platform",c=v.useCallback((f="asc")=>{if(n===null)return[];const h=[...o].sort((p,m)=>{const g=(p.title??p.name).toLowerCase(),y=(m.title??m.name).toLowerCase();return f==="asc"?g.localeCompare(y):y.localeCompare(g)});if(!n){const p=h.findIndex(m=>m.name===s);if(p!==-1){const[m]=h.splice(p,1);h.unshift(m)}}return h},[o,n]),u=v.useMemo(()=>c("asc"),[c]),d=v.useMemo(()=>c("desc"),[c]);return v.useEffect(()=>{if(n===null||n)return;const f={title:"System",name:s,hidden:!1,userProperties:{hidden:!1}};r(h=>h.some(p=>p.name===f.name)?h:[...h,f])},[n]),v.useEffect(()=>{if(!t)return;let f,h,p,m=!1;const g=S=>{r(b=>[...b.filter(k=>k.name!==S.name),{title:S.title??S.name,name:S.name,hidden:S.hidden,userProperties:S.userProperties}])},y=S=>{r(b=>b.filter(k=>k.name!==S.name))},w=S=>{r(b=>b.find(k=>k.name===S.name)?b.map(k=>k.name===S.name?{...k,title:S.title??k.title,hidden:S.hidden??k.hidden,userProperties:S.userProperties??k.userProperties}:k):b)};return(async()=>{const S=await zo.getApplications(t);if(m)return;r(C=>{const I=new Map;return C.forEach(R=>I.set(R.name,R)),S.forEach(R=>{I.set(R.name,{title:R.title??R.name,name:R.name,hidden:R.hidden,userProperties:R.userProperties})}),Array.from(I.values())});const[b,k,x]=await Promise.all([zo.onAppAdded(t,g),zo.onAppRemoved(t,y),zo.onAppChanged(t,w)]);if(m)return b==null||b(),k==null||k(),void(x==null?void 0:x());f=b,h=k,p=x})().catch(S=>{console.error("Failed to initialize apps",S)}),()=>{m=!0,f==null||f(),h==null||h(),p==null||p()}},[t]),{apps:v.useMemo(()=>{if(!(e!=null&&e.sourceFilter)||!Array.isArray(o))return o;const{allowed:f=[],blocked:h=[]}=e.sourceFilter,p=f.includes("*"),m=h.includes("*");let g=0;const y=o.map(w=>{const S=p||f.includes(w.name),b=!m&&S;return b&&g++,{...w,allowed:b}});return a(g),y},[e,o]),allowedApps:i,sortedAppsAsc:u,sortedAppsDesc:d,sortAppsAlphabetically:c}}function D0(e,t,n){var r;return{notificationStacks:v.useMemo(()=>{var u,d,f,h;if(!t.toastStacking)return[];const i=(a=t.stackBy)==="application"?"source":a==="severity"?"severity":"source";var a;const s=e.filter(p=>p.state==="Active"),c=new Map;for(const p of s){const m=p[i]??"";if(p.source&&((d=(u=n==null?void 0:n.sourceFilter)==null?void 0:u.muted)!=null&&d.includes(p.source))||(h=(f=n==null?void 0:n.sourceFilter)==null?void 0:f.muted)!=null&&h.includes("*"))continue;c.has(m)||c.set(m,{key:m,items:[]});const g=c.get(m);g&&g.items.unshift(p)}return Array.from(c.values()).filter(p=>p.items.some(m=>m.state==="Active"||m.state==="Stale"))},[e,t.toastStacking,t.stackBy,(r=n==null?void 0:n.sourceFilter)==null?void 0:r.muted])}}function M0(e){const[t,n]=v.useState([]);return{selectedNotifications:t,selectNotification:(o,r)=>{const i=t;n(r?[...i,o]:i.filter(a=>a!==o))},selectAllNotifications:(o,r)=>{if(r){let i=[];switch(o){case"read":i=e.filter(a=>a.state==="Acknowledged"||a.state==="Seen").map(a=>a.id);break;case"unread":i=e.filter(a=>a.state==="Active"||a.state==="Stale").map(a=>a.id);break;case"snoozed":i=e.filter(a=>a.state==="Snoozed").map(a=>a.id);break;default:i=e.map(a=>a.id)}n(i)}else n([])}}}const gp=e=>{var t,n;return{enabledNotifications:e.enable,enabledToasts:e.enableToasts,toastStacking:((t=e.toasts)==null?void 0:t.mode)==="stacked",stackBy:(n=e.toasts)==null?void 0:n.stackBy,toastExpiry:e.toastExpiry,showNotificationBadge:e.showNotificationBadge,placement:e.placement,snooze:e.snooze,closeNotificationOnClick:e.closeNotificationOnClick,autoHidePanel:e.autoHidePanel}},vp=e=>Array.from(e.reduce((t,n)=>t.set(n.id,n),new Map).values());function oS(){const e=v.useContext(Te.IOConnectContext),[t,n]=v.useState({}),[o,r]=v.useState({}),[i,a]=v.useState([]),[s,c]=v.useState(0),[u,d]=v.useState(!0),{apps:f,allowedApps:h}=nf(t),{notificationStacks:p}=D0(i,{toastStacking:o.toastStacking??!1,stackBy:o.stackBy??"source"},{sourceFilter:t.sourceFilter}),{selectedNotifications:m,selectNotification:g,selectAllNotifications:y}=M0(i);v.useEffect(()=>{(async()=>{await mt.init(e),await(async()=>{try{const b=await mt.getConfiguration();n(b),r(k=>({...k,...gp(b)}))}catch(b){console.error("Error fetching configuration:",b)}})(),await(async()=>{try{const b=await mt.getNotificationsList();a(vp(b))}catch(b){console.error("Error fetching notifications:",b)}})()})().catch(b=>{console.error("Error in useNotifications fetch:",b)}),w()},[e]),v.useEffect(()=>{const b=mt.onNotificationsChanged(C=>{a(vp(C))}),k=mt.onConfigurationChanged(C=>{const I=gp(C);n(R=>({...R,...C})),r(R=>({...R,...I}))}),x=mt.onCounterChanged(C=>{c(C)});return()=>{b(),k(),x()}},[]);const w=()=>{d(mt.bulkActionsSupported)},S=async b=>{await mt.setFilter(b)};return{close:b=>mt.close(b),clearAll:()=>mt.clearAll(),settings:o,hidePanel:async()=>{await mt.hidePanel()},showPanel:async()=>{await mt.showPanel()},saveFilter:S,clearAllOld:()=>mt.clearAllOld(),saveSetting:async b=>{const k=((x,C)=>{const I=(_=>({enabledNotifications:T=>({enable:T}),enabledToasts:T=>({enableToasts:T}),toastStacking:T=>{var P;return{toasts:{mode:T?"stacked":"single",stackBy:(P=_.toasts)==null?void 0:P.stackBy}}},stackBy:T=>{var P;return{toasts:{mode:(P=_.toasts)==null?void 0:P.mode,stackBy:T}}},showNotificationBadge:T=>({showNotificationBadge:T}),toastExpiry:T=>({toastExpiry:T}),placement:T=>({placement:T}),snooze:T=>({snooze:T}),closeNotificationOnClick:T=>({closeNotificationOnClick:T}),autoHidePanel:T=>({autoHidePanel:T})}))(C),R=Object.keys(x)[0],M=x[R];return R&&M!==void 0&&I[R]?I[R](M):{}})(b,t);k&&await mt.configure(k)},allApps:f,saveAllFilter:async b=>{"subscribe"in b?await S({allowed:b.subscribe?["*"]:[],blocked:b.subscribe?[]:["*"]}):"mute"in b&&await S({muted:b.mute?["*"]:[]})},configuration:t,notifications:i,notificationStacks:p,notificationsCount:s,allApplications:t.allApplications??0,allowedApplications:h,isBulkActionsSupported:u,selectedNotifications:m,selectNotification:g,selectAllNotifications:y,clearMany:async b=>{await mt.clearMany(b)},snooze:async(b,k)=>{await mt.snooze(b,k)},snoozeMany:async(b,k)=>{await mt.snoozeMany(b,k)},setState:async(b,k)=>{await mt.setState(b,k)},setStates:async(b,k)=>{await mt.setStates(b,k)},setCount:b=>{c(b)},getNotificationsList:async()=>await mt.getNotificationsList()}}const $0=v.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:()=>{}}),ke=()=>v.useContext($0);function H0({label:e="Allow notifications",align:t="right",...n}){const{settings:o,saveSetting:r}=ke(),i=Ke(),a=v.useCallback(s=>{r({enabledNotifications:s.target.checked})},[r]);return i?l.jsx(St,{label:e,align:t,onChange:a,checked:o.enabledNotifications??!1,...n}):null}function B0({label:e="Allow notification toasts",align:t="right",...n}){const{settings:o,saveSetting:r}=ke(),i=Ke(),a=i&&!o.enabledNotifications,s=v.useCallback(c=>{r({enabledToasts:c.target.checked})},[r]);return i?l.jsx(St,{label:e,align:t,onChange:s,checked:o.enabledToasts??!1,disabled:a,...n}):null}function W0({label:e="Show notification badge",align:t="right",...n}){const{settings:o,saveSetting:r}=ke(),i=Ke()&&!o.enabledNotifications,a=v.useCallback(s=>{r({showNotificationBadge:s.target.checked})},[r]);return l.jsx(St,{label:e,align:t,onChange:a,checked:o.showNotificationBadge??!1,disabled:i,...n})}function F0({label:e="Close notification on click",align:t="right",...n}){const{settings:o,saveSetting:r}=ke(),i=Ke(),a=i&&!o.enabledNotifications,s=v.useCallback(c=>{r({closeNotificationOnClick:c.target.checked})},[r]);return i?l.jsx(St,{label:e,align:t,onChange:s,checked:o.closeNotificationOnClick??!1,disabled:a,...n}):null}function z0({label:e="Auto hide panel",align:t="right",...n}){const{settings:o,saveSetting:r}=ke(),i=Ke(),a=v.useCallback(s=>{r({autoHidePanel:s.target.checked})},[r]);return i?l.jsx(St,{label:e,align:t,onChange:a,checked:o.autoHidePanel??!1,...n}):null}const yp=(e,t)=>e?`${e} ${t}${e!==1?"s":""}`:"",ic=e=>{const t=Math.floor(e/60),n=e%60,o=yp(t,"minute"),r=yp(n,"second");return o+(o&&r?" ":"")+r};function U0({className:e,title:t="Hide toasts after",items:n=[15,30,45,60],...o}){const r=re("flex","jc-between","ai-center",e),{settings:i,saveSetting:a}=ke(),s=Ke(),c=s&&!i.enabledNotifications,u=v.useCallback((d=15e3)=>{i.toastExpiry!==d&&a({toastExpiry:1e3*d})},[i.toastExpiry,a]);return s?l.jsxs("div",{className:r,...o,children:[l.jsx("div",{className:"io-text-clipper "+(c?"io-text-disabled":""),children:l.jsx("span",{children:t})}),l.jsxs(pe,{variant:"light",disabled:c,children:[l.jsx(pe.Button,{text:ic((i.toastExpiry??0)/1e3)}),l.jsx(pe.Content,{children:l.jsx(pe.List,{variant:"single",children:n.map(d=>l.jsx(pe.Item,{onClick:()=>{u(d)},children:ic(d)},d))})})]})]}):null}function K0({className:e,title:t="Stacking",...n}){const o=re("io-notifications-settings-panel-stacking",e),{ToastStacking:r,ToastStackBy:i}=Br();return Ke()?l.jsx("div",{className:o,...n,children:l.jsxs(Xe,{title:t,children:[l.jsx(r,{}),l.jsx(i,{})]})}):null}function V0({label:e="Allow toast stacking",align:t="right",...n}){const{settings:o,saveSetting:r}=ke(),i=Ke(),a=i&&!o.enabledNotifications,s=v.useCallback(c=>{r({toastStacking:c.target.checked})},[r]);return i?l.jsx(St,{label:e,align:t,onChange:s,checked:o.toastStacking??!1,disabled:a,...n}):null}const Ju={application:"Application",severity:"Priority"},rS=Object.fromEntries(Object.entries(Ju).map(([e,t])=>[t,e]));function G0({className:e,title:t="Group by",...n}){const o=re("flex","jc-between","ai-center",e),{settings:r,saveSetting:i}=ke(),a=Ke(),s=a&&!r.enabledNotifications,c=v.useCallback((d="severity")=>{r.stackBy!==d&&i({stackBy:d.toLowerCase()})},[r.stackBy,i]);if(!a)return null;const u=Object.values(Ju);return l.jsxs("div",{className:o,...n,children:[l.jsx("div",{className:re("io-text-clipper",{"io-text-disabled":s}),children:l.jsx("span",{children:t})}),l.jsxs(pe,{variant:"light",disabled:s,children:[l.jsx(pe.Button,{text:Ju[r.stackBy??"severity"]}),l.jsx(pe.Content,{children:l.jsx(pe.List,{variant:"single",children:u.map(d=>l.jsx(pe.Item,{onClick:()=>{const f=rS[d];c(f)},children:d},d))})})]})]})}function q0({className:e,title:t="Placement",...n}){const o=re("io-notifications-settings-panel-placement",e),{PlacementPanel:r,PlacementToasts:i}=Br();return Ke()?l.jsx("div",{className:o,...n,children:l.jsxs(Xe,{title:t,children:[l.jsx(r,{}),l.jsx(i,{})]})}):null}const J0=e=>e.replace(/(^|-)\w/g,t=>t.toUpperCase().replace("-"," "));function Z0({className:e,title:t="Panel position",...n}){var c,u;const o=re("flex","jc-between","ai-center",e),{settings:r,saveSetting:i}=ke(),a=Ke(),s=v.useCallback(d=>{var f;d||(d="right"),((f=r.placement)==null?void 0:f.panel)!==d&&i({placement:{...r.placement,panel:d.toLowerCase()}})},[r.placement,i]);return a?l.jsxs("div",{className:o,...n,children:[l.jsx("div",{className:"io-text-clipper",children:l.jsx("span",{children:t})}),l.jsxs(pe,{variant:"light",children:[l.jsx(pe.Button,{text:(c=r.placement)!=null&&c.panel?J0((u=r.placement)==null?void 0:u.panel):"Right"}),l.jsx(pe.Content,{children:l.jsx(pe.List,{variant:"single",children:["Right","Left"].map(d=>l.jsx(pe.Item,{onClick:()=>{s(d)},children:d},d))})})]})]}):null}function Y0({className:e,title:t="Toasts position",...n}){var c,u;const o=re("flex","jc-between","ai-center",e),{settings:r,saveSetting:i}=ke(),a=Ke(),s=v.useCallback(d=>{var h;if(d||(d="bottom-right"),((h=r.placement)==null?void 0:h.toasts)===d)return;const f=d.replace(/\s+/g,"-").toLowerCase();i({placement:{...r.placement,toasts:f}})},[r.placement,i]);return a?l.jsxs("div",{className:o,...n,children:[l.jsx("div",{className:"io-text-clipper",children:l.jsx("span",{children:t})}),l.jsxs(pe,{variant:"light",children:[l.jsx(pe.Button,{text:(c=r.placement)!=null&&c.toasts?J0((u=r.placement)==null?void 0:u.toasts):"Bottom Right"}),l.jsx(pe.Content,{children:l.jsx(pe.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map(d=>l.jsx(pe.Item,{onClick:()=>{s(d)},children:d},d))})})]})]}):null}function X0({className:e,title:t="Snooze",...n}){var a;const o=re("io-notifications-settings-panel-snooze",e),{SnoozeDuration:r}=Br(),{settings:i}=ke();return Ke()&&((a=i.snooze)!=null&&a.enabled)?l.jsx("div",{className:o,...n,children:l.jsx(Xe,{title:t,children:l.jsx(r,{})})}):null}function Q0({className:e,title:t="Default duration",items:n=[60,120,180,300],...o}){var d,f;const r=re("flex","jc-between","ai-center",e),{settings:i,saveSetting:a}=ke(),s=Ke(),c=s&&!i.enabledNotifications,u=v.useCallback((h=6e4)=>{var p;i.snooze&&((p=i.snooze)==null?void 0:p.duration)!==h&&a({snooze:{...i.snooze,duration:1e3*h}})},[i.snooze,a]);return s&&((d=i.snooze)!=null&&d.enabled)?l.jsxs("div",{className:r,...o,children:[l.jsx("div",{className:re("io-text-clipper",{"io-text-disabled":c}),children:l.jsx("span",{children:t})}),l.jsxs(pe,{variant:"light",disabled:c,children:[l.jsx(pe.Button,{text:ic((((f=i.snooze)==null?void 0:f.duration)??0)/1e3)}),l.jsx(pe.Content,{children:l.jsx(pe.List,{variant:"single",children:n.map(h=>l.jsx(pe.Item,{onClick:()=>{u(h)},children:ic(h)},h))})})]})]}):null}function ey({className:e,title:t,...n}){const o=re("io-notifications-settings-panel-subscriptions",e),{SubscribeAll:r,SubscribeApp:i,SubscribeMuteAll:a,SubscribeMuteApp:s}=Br(),{sortAppsAlphabetically:c}=nf(),u=Ke(),d=c(),f="io-notifications-subscriptions-grid "+(u?"with-three-columns":"with-two-columns");return l.jsx("div",{className:o,...n,children:l.jsxs(Xe,{title:t??(u?"Subscribe & Mute":"Subscribe"),children:[l.jsxs("div",{className:f,children:[l.jsx("p",{className:"io-text-section",children:"Sources"}),l.jsx("p",{className:"io-text-section",children:"Subscribe"}),u&&l.jsx("p",{className:"io-text-section",children:"Mute"})]}),l.jsxs("div",{className:f,children:[l.jsx("p",{children:"All Sources"}),l.jsx(r,{label:""}),u&&l.jsx(a,{label:""})]}),d.map(h=>{var p;return!h||h.hidden||(p=h==null?void 0:h.userProperties)!=null&&p.hidden?null:l.jsxs("div",{className:f,children:[l.jsx("p",{children:h.title??h.name}),l.jsx(i,{app:h,label:""}),u&&l.jsx(s,{app:h,label:""})]},h.name)})]})})}function ty({label:e="All apps",align:t="right",...n}){var c,u,d,f;const{settings:o,configuration:r,saveAllFilter:i}=ke(),a=Ke()&&!o.enabledNotifications,s=v.useCallback(h=>{i({subscribe:h.target.checked})},[i]);return l.jsx(St,{align:t,label:e,onChange:s,checked:(((u=(c=r.sourceFilter)==null?void 0:c.allowed)==null?void 0:u.includes("*"))&&((f=(d=r.sourceFilter)==null?void 0:d.blocked)==null?void 0:f.length)===0)??!1,disabled:a,...n})}function ny({label:e="App",align:t="right",app:n,...o}){var d,f,h,p,m,g;const{allApps:r,settings:i,configuration:a,saveFilter:s}=ke(),c=Ke()&&!i.enabledNotifications,u=v.useCallback((y,w)=>{var k,x,C,I,R,M;const S={...a.sourceFilter},b=(k=S.allowed)==null?void 0:k.indexOf("*");typeof b=="number"&&b>-1&&((x=S.allowed)==null||x.splice(b,1),r.forEach(_=>{var T;_.name!==w.name&&((T=S.allowed)==null||T.push(_.name))})),y?(S.allowed=[...new Set([...S.allowed??[],w.name])],S.blocked=(C=S.blocked)==null?void 0:C.filter(_=>_!==w.name)):(S.allowed=(I=S.allowed)==null?void 0:I.filter(_=>_!==w.name),S.blocked=[...new Set([...S.blocked??[],w.name])]),(R=S.allowed)!=null&&R.length&&((M=S.blocked)!=null&&M.includes("*"))&&S.blocked.splice(S.blocked.indexOf("*"),1),s(S)},[r,a.sourceFilter,s]);return l.jsx(St,{id:`subscribe-${n.name}`,label:e,align:t,onChange:y=>u(y.target.checked,n),checked:(((f=(d=a.sourceFilter)==null?void 0:d.allowed)==null?void 0:f.includes("*"))&&!((p=(h=a.sourceFilter)==null?void 0:h.blocked)!=null&&p.includes(n.name))||((g=(m=a.sourceFilter)==null?void 0:m.allowed)==null?void 0:g.includes(n.name)))??!1,disabled:c,...o})}function oy({label:e="Mute all",align:t="right",...n}){var u,d,f,h;const{settings:o,configuration:r,saveAllFilter:i}=ke(),a=Ke(),s=a&&(!o.enabledNotifications||((d=(u=r.sourceFilter)==null?void 0:u.allowed)==null?void 0:d.indexOf("*"))===-1),c=v.useCallback(p=>{i({mute:p.target.checked})},[i]);return a?l.jsx(St,{align:t,label:e,onChange:c,checked:((h=(f=r.sourceFilter)==null?void 0:f.muted)==null?void 0:h.includes("*"))??!1,disabled:s??!1,...n}):null}function ry({label:e="App",align:t="right",app:n,...o}){var f,h,p,m,g,y,w,S,b,k,x,C,I,R,M,_;const{allApps:r,settings:i,configuration:a,saveFilter:s}=ke(),c=Ke(),u=c&&(!i.enabledNotifications||((h=(f=a.sourceFilter)==null?void 0:f.blocked)==null?void 0:h.includes("*"))||((m=(p=a.sourceFilter)==null?void 0:p.blocked)==null?void 0:m.includes(n.name))||((y=(g=a.sourceFilter)==null?void 0:g.allowed)==null?void 0:y.length)===0||((S=(w=a.sourceFilter)==null?void 0:w.allowed)==null?void 0:S.indexOf(n.name))===-1&&((k=(b=a.sourceFilter)==null?void 0:b.allowed)==null?void 0:k.indexOf("*"))===-1&&((C=(x=a.sourceFilter)==null?void 0:x.blocked)==null?void 0:C.length)===0),d=v.useCallback((T,P)=>{var W,J,L,G;const X={...a.sourceFilter},te=(W=X==null?void 0:X.muted)==null?void 0:W.indexOf("*");typeof te=="number"&&te>-1&&((J=X.muted)==null||J.splice(te,1),r.forEach(F=>{var N;F.name===P.name||F.hidden||((N=X.muted)==null||N.push(F.name))})),T?(L=X.muted)==null||L.push(P.name):X.muted=(G=X.muted)==null?void 0:G.filter(F=>F!==P.name),s(X)},[r,a.sourceFilter,s]);return!c||n.hidden?null:l.jsx(St,{id:`mute-${n.name}`,label:e,align:t,onChange:T=>d(T.target.checked,n),checked:(((R=(I=a.sourceFilter)==null?void 0:I.muted)==null?void 0:R.includes("*"))||((_=(M=a.sourceFilter)==null?void 0:M.muted)==null?void 0:_.includes(n.name)))??!1,disabled:u??!1,...o})}const iy={Body:e=>{const{General:t,Placement:n,Stacking:o,Snooze:r,Subscriptions:i}=Br();return l.jsxs(ir,{element:ki,elementProps:e,children:[l.jsx(t,{}),l.jsx(o,{}),l.jsx(n,{}),l.jsx(r,{}),l.jsx(i,{})]})},General:L0,AllowNotifications:H0,AllowNotificationToasts:B0,ShowNotificationBadge:W0,CloseNotificationOnClick:F0,PanelAutoHide:z0,HideToastsAfter:U0,Stacking:K0,ToastStacking:V0,ToastStackBy:G0,Placement:q0,PlacementPanel:Z0,PlacementToasts:Y0,Snooze:X0,SnoozeDuration:Q0,Subscriptions:ey,SubscribeAll:ty,SubscribeApp:ny,SubscribeMuteAll:oy,SubscribeMuteApp:ry},ay=v.createContext(iy),of=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...iy,...t}),[t]);return l.jsx(ay.Provider,{value:n,children:e})});of.displayName="NotificationsSettingsPanelComponentsStoreProvider";const Br=()=>v.useContext(ay),iS=({className:e,onClose:t,title:n="Notification Settings",...o})=>{const{Body:r}=Br();return l.jsxs(nt,{className:re("io-notifications-settings-panel",e),"data-testid":"notifications-settings-panel",...o,children:[l.jsxs(nt.Header,{children:[l.jsx(nt.Header.Title,{size:"large",text:n,tag:"h1"}),l.jsx(nt.Header.ButtonGroup,{children:l.jsx(nt.Header.ButtonIcon,{className:"non-draggable",variant:"circle",icon:"close",size:"32",onClick:t})})]}),l.jsx(r,{})]})},rf=({components:e,...t})=>l.jsx(of,{components:e,children:l.jsx(iS,{...t})}),aS=({name:e,value:t})=>l.jsxs("div",{className:"io-profile-section-item",children:[l.jsx("div",{className:"io-profile-section-item-name",children:e}),l.jsx("div",{className:"io-profile-section-item-value",children:t})]}),sy=({className:e,items:t,title:n})=>l.jsxs("div",{className:re("io-profile-section-body",e),children:[n&&l.jsx(qn,{className:"io-profile-section-title",text:n}),t.map(({name:o,value:r})=>l.jsx(aS,{name:o,value:r},o))]}),af=({className:e,items:t,title:n})=>l.jsxs("section",{className:re("io-profile-section",e),children:[l.jsx(sy,{items:t,title:n}),l.jsx(Di,{className:"mt-8"})]}),cy=({title:e="License",...t})=>l.jsx(af,{title:e,...t}),ly=({title:e="Version",...t})=>l.jsx(af,{title:e,...t}),uy=({title:e="Plugins",...t})=>l.jsx(af,{title:e,...t}),dy=({className:e})=>{const t=Da()?"io.Connect Desktop":"io.Connect Browser";return l.jsxs("div",{className:re("io-trademark-container",e),children:[l.jsx("h4",{className:"io-trademark-title",children:t}),l.jsxs("p",{className:"io-trademark-text",children:[t,"® is a registered trademark of"," ",l.jsx("a",{href:"https://www.interop.io",rel:"noreferrer",target:"_blank",children:"Interop Inc©"})," ",new Date().getFullYear(),". All rights reserved."]})]})},fy=({avatarInitials:e=Da()?"CD":"CB",className:t,items:n,onLogout:o,title:r})=>l.jsxs("section",{className:re("io-profile-section",t),children:[l.jsxs("div",{className:"io-user-details-container",children:[l.jsx("div",{className:"io-user-avatar",children:e}),l.jsx(sy,{className:"mt-12",items:n,title:r})]}),o&&l.jsx(et,{className:"io-log-out-button",onClick:o,variant:"primary",icon:"arrow-right-from-bracket",children:"Log out"}),l.jsx(Di,{className:"mt-8"})]}),hy={LicenseSection:cy,ProductsInfoSection:ly,PluginsSection:uy,Trademark:dy,UserSection:fy},py=v.createContext(hy),my=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...hy,...t}),[t]);return l.jsx(py.Provider,{value:n,children:e})});my.displayName="ProfilePanelComponentsStoreProvider";const sS=e=>{const t=new Date(e);return[{day:"numeric"},{month:"short"},{year:"numeric"}].map(n=>t.toLocaleDateString("en",n)).join(" ")},cS=e=>{if(!e)return{items:[]};const t=[...e.email?[{name:"Email",value:e.email}]:[],...e.type?[{name:"User Type",value:e.type}]:[],...e.role?[{name:"User Role",value:e.role}]:[],{name:"User ID",value:e.id}];if(e.firstName||e.lastName){const n=[e.firstName,e.lastName].filter(o=>!!o);return{avatarInitials:n.map(o=>o.charAt(0)).join(""),items:t,title:n.join(" ")}}return e.username?{avatarInitials:e.username.charAt(0),items:t,title:e.username}:e.email?{avatarInitials:e.email.charAt(0),items:t}:{items:t}},lS=e=>{const t=new Date(2023,5,6),n=e.expiration<t.getTime()?1e3:1;return{items:[{name:"Type",value:e.type},{name:"Expiration Date",value:sS(e.expiration*n)}]}},uS=e=>({items:e.map(t=>({name:t.name,value:t.version}))}),dS=e=>{var n;const t={"@interopio/workspaces-ui-react":"Workspaces React Frame","@interopio/workspaces-ui-web-components":"Workspaces Web Components Frame"};return{items:[{name:"io.Connect Browser platform",value:e.platform.apiVersion},{name:"io.Connect Browser client",value:e.client.apiVersion},...e.workspaces?[{name:"Workspaces API",value:e.workspaces.apiVersion}]:[],...(n=e.workspaces)!=null&&n.container&&j0(e.workspaces.container.type,t)?[{name:t[e.workspaces.container.type],value:e.workspaces.container.version}]:[],...e.home?[{name:"Home UI",value:e.home.version}]:[],...e.search?[{name:"Search API",value:e.search.apiVersion}]:[],...e.modals?[{name:"Modals API",value:e.modals.apiVersion}]:[]]}},fS=()=>{const e=window.glue42gd??window.iodesktop;if(!e)throw new Error("both window.glue42gd and window.iodesktop are not available");const{user:t,env:n}=e,o=[{name:"Environment",value:n.env},{name:"Region",value:n.region}];return t?{avatarInitials:t.charAt(0),items:o,title:t}:{items:o}},hS=e=>({items:Object.entries(e??{}).map(([n,o])=>({name:n,value:o}))}),pS=(e=[])=>({items:e.map(({product:t,version:n})=>({name:t,value:n}))}),mS=e=>Da()?(async t=>{const{licInfo:n,productInfo:o}=(await t.interop.invoke("T42.GD.GetInfo")).returned;return{user:fS(),license:hS(n),productsInfo:pS(o)}})(e):(async()=>{if(!window.iobrowser)throw new Error("window.iobrowser is not available");const t=await window.iobrowser.system.getProfileData();return{user:cS(t.user),license:lS(t.license),plugins:uS(t.plugins),productsInfo:dS(t.productsInfo)}})(),gS=({className:e,onClose:t,onLogout:n,title:o="Profile",...r})=>{var p;const{LicenseSection:i,ProductsInfoSection:a,PluginsSection:s,Trademark:c,UserSection:u}=v.useContext(py),d=v.useContext(Te.IOConnectContext),[f,h]=v.useState(null);return v.useEffect(()=>{d&&(async()=>{const m=await mS(d);h(m)})().catch(console.error)},[d]),l.jsxs(nt,{className:re("io-profile-panel",e),"data-testid":"profile-panel",...r,children:[l.jsxs(nt.Header,{children:[l.jsx(nt.Header.Title,{size:"large",text:o}),l.jsx(nt.Header.ButtonGroup,{children:l.jsx(nt.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:t})})]}),l.jsxs(ir,{element:nt.Body,children:[f!=null&&f.user.items.length||f!=null&&f.user.title?l.jsx(u,{avatarInitials:f.user.avatarInitials,items:f.user.items,onLogout:n,title:f.user.title}):null,l.jsxs("div",{className:"io-profile-sections-container",children:[f!=null&&f.license.items.length?l.jsx(i,{items:f.license.items}):null,f!=null&&f.productsInfo.items.length?l.jsx(a,{items:f.productsInfo.items}):null,(p=f==null?void 0:f.plugins)!=null&&p.items.length?l.jsx(s,{items:f.plugins.items}):null]}),l.jsx(c,{className:"mt-auto"})]})]})},gy=({components:e,...t})=>l.jsx(my,{components:e,children:l.jsx(gS,{...t})}),vS=document.querySelector("#root")??document.body,yS={preferences:R0,"notification-settings":rf,profile:gy};var wS=Object.freeze({__proto__:null,ActivePanelRenderer:()=>{const{panel:e,deselectPanel:t}=pp();yu(()=>{e&&t()},["Escape"]);const n=e?yS[e]:null;return n?$o.createPortal(l.jsx("div",{className:"io-panel-overlay",children:l.jsx(n,{onClose:t})}),vS):null},PanelManagerProvider:({children:e})=>{const[t,n]=v.useState(null),o=v.useCallback(a=>{n(a)},[]),r=v.useCallback(()=>{n(null)},[]),i=v.useMemo(()=>({panel:t,selectPanel:o,deselectPanel:r}),[t,o,r]);return l.jsx(Wv.Provider,{value:i,children:e})},usePanelManagerContext:pp});v.createContext({theme:"dark"});const bS="var(--io-neutrals-0)",Ml="var(--io-neutrals-900)";function vy(e){var r;let t,n,o;if(e.startsWith("#")){let i=e.slice(1);i.length===3&&(i=i.split("").map(a=>a+a).join("")),t=parseInt(i.substring(0,2),16),n=parseInt(i.substring(2,4),16),o=parseInt(i.substring(4,6),16)}else{if(!e.startsWith("rgb")){const i=document.createElement("canvas").getContext("2d");return i?(i.fillStyle=e,vy(i.fillStyle)):Ml}{const i=(r=e.match(/\d+/g))==null?void 0:r.map(Number);if(!i||i.length<3)return Ml;[t,n,o]=i}}return(.2126*t+.7152*n+.0722*o)/255>.5?Ml:bS}function xS({className:e,channel:t,...n}){const o=re("io-channel-badge",e),r=v.useMemo(()=>vy(t.color),[t.color]);return l.jsx("div",{className:o,style:{color:r,backgroundColor:t.color},"data-testid":`channel-selector-badge-${t.color}`,...n,children:l.jsx("span",{className:"io-channel-selector-badge-label","data-testid":"channel-selector-label",children:t.label})})}function SS(){return l.jsx(xt,{variant:"check","data-testid":"channel-selector-channel-selected"})}function kS({channel:e,handleChannelRestricted:t,lockedChannelRestriction:n}){const o=(r,i)=>a=>{a.stopPropagation(),vo(a)&&(a.preventDefault(),i||t({...e,[r]:!e[r]}))};return l.jsxs(l.Fragment,{children:[l.jsx("div",{children:e.isSelected&&l.jsx("span",{"data-testid":"channel-selector-channel-selected",children:"Active"})}),l.jsx("div",{role:"button",onClick:r=>r.stopPropagation(),"data-testid":"channel-selector-publish-toggle-container",children:l.jsx(St,{label:"Publish",checked:e.write,onChange:()=>{t({...e,write:!e.write})},onKeyDown:o("write",!e.isSelected||(n==null?void 0:n.write)),onClick:r=>r.stopPropagation(),disabled:!e.isSelected||(n==null?void 0:n.write)})}),l.jsx("div",{role:"button",onClick:r=>r.stopPropagation(),"data-testid":"channel-selector-subscribe-toggle-container",children:l.jsx(St,{label:"Subscribe",checked:e.read,onChange:()=>{t({...e,read:!e.read})},onKeyDown:o("read",!e.isSelected||(n==null?void 0:n.read)),disabled:!e.isSelected||(n==null?void 0:n.read)})})]})}const yy=v.createContext({});function CS({channel:e,isSelected:t,onChannelSelect:n,onChannelRestrict:o,...r}){const{variant:i,selectedChannels:a,lockedChannelRestrictions:s}=v.useContext(yy),c=t||e.isSelected||(a==null?void 0:a.includes(e)),u=s==null?void 0:s.find(p=>p.name===e.name),d=v.useCallback(()=>n==null?void 0:n({...e,isSelected:!c}),[e,n,c]),f=v.useCallback(p=>{const m=p.target;m.closest(".io-toggle")||m.classList.contains("io-toggle")||vo(p)&&(p.preventDefault(),n==null||n({...e,isSelected:!c}))},[e,n,c]),h=v.useCallback(p=>{o==null||o(p)},[o]);return l.jsx(Cc,{prepend:l.jsx(xS,{channel:e}),append:i==="single"||i==="multi"?c&&l.jsx(SS,{}):l.jsx(kS,{channel:e,handleChannelRestricted:h,lockedChannelRestriction:u}),isSelected:c,onClick:d,onKeyDown:f,...r,children:e.name},e.name)}function ES({variant:e,onVariantChange:t,disabled:n=!1}){const o=e==="directionalSingle"||e==="directionalMulti",r=v.useCallback(()=>{t==null||t(!o)},[o,t]),i=v.useCallback(s=>{s.stopPropagation()},[]),a=v.useCallback(s=>{s.stopPropagation(),vo(s)&&(s.preventDefault(),n||r())},[n,r]);return l.jsx(St,{label:"Directional",align:"right",checked:o,onChange:r,onClick:i,onKeyDown:a,disabled:n,"data-testid":`channel-selector-toggle-${e}`})}const jS=v.forwardRef(({className:e,variant:t="single",variantToggle:n=!1,channels:o=[],lockedChannelRestrictions:r=[],onVariantChange:i,onChannelSelect:a,onChannelRestrict:s,...c},u)=>{const d=re("io-list-channels","io-channel-selector-panel",(t==="directionalSingle"||t==="directionalMulti")&&"io-list-channels-directional io-channel-selector-panel-directional",e),f=v.useMemo(()=>({variant:t,selectedChannels:o.filter(h=>h.isSelected),lockedChannelRestrictions:r,onVariantChange:i,onChannelSelect:a,onChannelRestrict:s}),[o,t,r,i,a,s]);return l.jsx(yy.Provider,{value:f,children:l.jsx("div",{className:d,ref:u,children:l.jsxs(gt,{...c,children:[l.jsx(gt.ItemTitle,{"data-testid":"channel-selector-title",append:n&&l.jsx(ES,{variant:t,onVariantChange:i}),children:{single:"Select Channel",directionalSingle:"Select Directional Channel",multi:"Select Channels",directionalMulti:"Select Directional Channels"}[t]}),o==null?void 0:o.map(h=>l.jsx(CS,{channel:h,isSelected:h.isSelected,onChannelSelect:a,onChannelRestrict:s,"data-testid":`channel-selector-channel-${h.name}`},h.name))]})})})});jS.displayName="ChannelSelector";const AS=v.forwardRef(({className:e,title:t,ariaLabel:n,onClick:o,onKeyDown:r,children:i,disabled:a=!1,...s},c)=>l.jsx("div",{ref:c,className:re(e,{disabled:a}),title:t,role:"button",tabIndex:a?-1:0,"aria-label":n,"aria-disabled":a,onClick:u=>{!a&&o&&o(u)},onKeyDown:u=>{!a&&r&&r(u)},...s,children:i}));AS.displayName="ChannelSelectorButtonWrapper";function OS({actionButtons:e,actionButtonElementsRefs:t,isAutofocusButton:n,isButtonDisabled:o,onButtonClick:r}){return l.jsx(De,{"data-testid":"io-dialog-action-buttons-group",align:"right",children:e.map((i,a)=>{const{id:s,text:c,variant:u}=i,d=n(s);return l.jsx(et,{"data-testid":`io-dialog-action-button-${s}`,id:s,ref:f=>{a===0&&(t.current=[]),t.current[a]=f},className:d?"io-focus-button":void 0,disabled:o(s),onClick:()=>r(i),variant:u,children:c},s)})})}function sf({actionButtons:e,children:t,onCompletion:n,size:o,title:r=Da()?"io.Connect Desktop":"io.Connect Browser",validationErrors:i=[]}){const{actionButtonElementsRefs:a,autofocusButtonId:s,hasAutofocusButtonLostInitialFocus:c}=(f=>{const h=v.useRef([]),p=v.useMemo(()=>{var w;return((w=f.find(S=>S.autofocus))==null?void 0:w.id)??null},[f]),m=v.useRef(p),[g,y]=v.useState(!m.current);return v.useLayoutEffect(()=>{if(g)return;if(p!==m.current)return void y(!0);const w=h.current.find(b=>(b==null?void 0:b.id)===p);if(!w)return;w.focus();const S=()=>{y(!0)};return w.addEventListener("blur",S),()=>{w.removeEventListener("blur",S)}},[p,g]),{actionButtonElementsRefs:h,autofocusButtonId:p,hasAutofocusButtonLostInitialFocus:g}})(e),u=()=>{n({isClosed:!0})},d={...o};return l.jsxs(hi,{className:"io-dialog-template",closeFn:u,isOpen:!0,onCancel:f=>{f.preventDefault(),u()},onKeyDown:f=>{!vo(f)||i.length||f.target instanceof HTMLButtonElement||f.key===" "&&f.target instanceof HTMLInputElement||n({isEnterPressed:!0})},style:d,title:r,draggable:!0,children:[l.jsx(hi.Body,{children:t}),l.jsx(hi.Footer,{children:l.jsx(OS,{actionButtonElementsRefs:a,actionButtons:e,isAutofocusButton:f=>s===f&&!c,isButtonDisabled:f=>i.some(h=>h.disabledButtonIds.some(p=>p===f)),onButtonClick:({id:f,text:h})=>{n({responseButtonClicked:{id:f,text:h}})}})})]})}function cf({children:e}){return l.jsx("h3",{"data-testid":"io-dialog-heading",className:"io-dialog-template-heading",children:e})}function PS({onCompletion:e,size:t,variables:n}){const{actionButtons:o,heading:r,text:i,title:a}=n;return l.jsx(sf,{actionButtons:o,onCompletion:e,size:t,title:a,children:l.jsxs("div",{children:[l.jsx(cf,{children:r}),l.jsx("p",{"data-testid":"io-dialog-text",children:i})]})})}function _S({onCompletion:e,size:t,variables:n}){const{actionButtons:o,checkbox:r,heading:i,text:a,title:s}=n,[c,u]=v.useState(r.initialValue),d=v.useCallback(()=>u(h=>!h),[]),f=[{id:r.id,type:"checkbox",checked:c}];return l.jsxs(sf,{actionButtons:o,onCompletion:h=>e({...h,inputs:f}),size:t,title:s,children:[l.jsxs("div",{children:[l.jsx(cf,{children:i}),l.jsx("p",{"data-testid":"io-dialog-text",children:a})]}),l.jsx(La,{"data-testid":`io-dialog-checkbox-${r.id}`,checked:c,id:r.id,label:r.label,name:r.id,onChange:d})]})}function TS({onCompletion:e,size:t,variables:n}){const{actionButtons:o,heading:r,input:i,title:a}=n,[s,c]=v.useState(i.initialValue??""),u=v.useRef(null),d=(f=s,!(h=i.validation)||new RegExp(h.regexPattern).test(f)?null:{disabledButtonIds:h.disabledButtonIds,message:h.errorMessage});var f,h;const p=[{id:i.id,type:"text",value:s}];return v.useLayoutEffect(()=>{var m;(m=u.current)==null||m.select()},[]),l.jsxs(sf,{actionButtons:o,onCompletion:m=>e({...m,inputs:p}),size:t,title:a,validationErrors:d?[d]:[],children:[l.jsx(cf,{children:r}),l.jsx(er,{"data-testid":`io-dialog-input-${i.id}`,ref:u,errorDataTestId:`io-dialog-input-${i.id}-error-message`,errorMessage:d==null?void 0:d.message,id:i.id,label:i.label,name:i.id,onChange:m=>c(m.target.value),placeholder:i.placeholder,type:"text",value:s})]})}const Nr=$t().where(e=>e.length>0,"Expected a non-empty string"),wp=z2().where(e=>e>=0,"Expected a non-negative number"),lf=en({width:wp,height:wp}),uf=rc().andThen(e=>((t,n)=>{const o=typeof t;return o==="function"?rc():U2(`The argument provided as "${n}" must be a function, received: ${o}`)})(e,"onCompletion")),df=en({autofocus:Ee(ct()),id:Nr,text:Nr,variant:$a(K("default"),K("primary"),K("critical"),K("outline"),K("link"))}),NS=en({disabledButtonIds:Jo(Nr),errorMessage:Nr,regexPattern:Nr}),IS=en({actionButtons:Jo(df),heading:$t(),text:$t(),title:Ee($t())}),RS=en({templateName:K("noInputsConfirmationDialog"),onCompletion:uf,size:Ee(lf),variables:IS}),LS=en({actionButtons:Jo(df),checkbox:en({id:Nr,initialValue:Ee(ct()),label:Ee($t())}),heading:$t(),text:$t(),title:Ee($t())}),DS=en({templateName:K("singleCheckboxDialog"),onCompletion:uf,size:Ee(lf),variables:LS}),MS=en({actionButtons:Jo(df),heading:$t(),input:en({id:Nr,initialValue:Ee($t()),label:Ee($t()),placeholder:Ee($t()),validation:Ee(NS)}),title:Ee($t())}),$S=en({templateName:K("singleTextInputDialog"),onCompletion:uf,size:Ee(lf),variables:MS});RS.runWithException,DS.runWithException,$S.runWithException;v.createContext({config:{message:""},theme:"dark",setResult:()=>{}});const HS={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"},BS=v.createContext({config:HS,onThemeChanged:()=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:()=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),Mn=()=>v.useContext(BS);function WS({...e}){const{config:t,close:n}=Mn(),{applicationTitle:o}=t;return l.jsxs(sn,{draggable:!0,...e,children:[l.jsx(sn.Title,{tag:"h1",text:o?`Feedback Form - ${o}`:"Feedback Form",size:"large"}),l.jsx(sn.ButtonGroup,{className:"non-draggable",children:l.jsx(sn.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>n()})})]})}function FS({className:e,handleSubmit:t,...n}){const o=re("io-panel-body",e),{config:r,submitFeedback:i}=Mn(),{IntroField:a,DescriptionField:s,TechInfoField:c,EnvInfoField:u,FileAttachmentsField:d,CategoryAttachmentsField:f,MailListField:h}=Gc(),p=t??i,m=`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 l.jsxs("form",{className:o,id:"feedback",onSubmit:p,...n,children:[l.jsx(a,{children:l.jsx("p",{children:m})}),l.jsx(h,{}),l.jsx(s,{}),l.jsx(c,{readOnly:!0}),l.jsx(u,{readOnly:!0}),r.attachmentsViewMode==="file"?l.jsx(d,{}):l.jsx(f,{})]})}function zS({...e}){const{FooterButtons:t}=Gc(),{openUrl:n,submitInProgress:o,submitStatus:r,jiraTicketURL:i}=Mn();return l.jsx(Ar,{...e,children:l.jsxs("div",o?{className:"flex ai-center jc-between",children:[l.jsx(Xe,{children:l.jsx("p",{children:r.title})}),l.jsx($x,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[l.jsxs(Xe,{children:[l.jsx("p",{className:r.type==="error"?"io-text-error":"",children:r.title}),i&&l.jsx("a",{href:i,onClick:a=>{a.preventDefault(),n(i)},children:i})]}),l.jsx(t,{})]})})}function US({className:e,...t}){const{CloseButton:n}=Gc(),{close:o}=Mn(),r=re("non-draggable",e);return l.jsx(De,{className:r,...t,children:l.jsx(n,{onClick:()=>o()})})}function KS({className:e,...t}){const{SubmitButton:n,CancelButton:o,CloseButton:r}=Gc(),{close:i,submitCompleted:a}=Mn();return a?l.jsx(De,{className:e,...t,children:l.jsx(r,{text:"Close",onClick:()=>i()})}):l.jsxs(De,{className:e,...t,children:[l.jsx(n,{}),l.jsx(o,{onClick:()=>i()})]})}function VS({text:e="Submit",...t}){return l.jsx(et,{form:"feedback",type:"submit",variant:"primary",text:e,...t})}function GS({text:e="Cancel",...t}){return l.jsx(et,{variant:"link",text:e,...t})}function qS({...e}){return l.jsx(et,{variant:"primary",...e})}function JS({showField:e=!0,className:t,title:n,hint:o,children:r,...i}){return e?l.jsx(Xe,{className:t,title:n,hint:o,...i,children:r}):null}function ZS({showField:e=!0,className:t,title:n="Description",hint:o,readOnly:r=!1,disabled:i,...a}){return e?l.jsx(Xe,{className:t,hint:o,title:"",...a,children:l.jsx(Fc,{id:"description",name:"description",label:n,readOnly:r,disabled:i})}):null}function YS({showField:e,className:t,title:n="Technical Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...s}){const{config:c}=Mn(),u=e??c.errorMessage,d=r??c.errorMessage;return u&&d?l.jsx(Xe,{className:t,hint:o,...s,children:l.jsx(Fc,{id:"errorMessage",name:"errorMessage",label:n,value:d,readOnly:i,disabled:a})}):null}function XS({showField:e,className:t,title:n="Environment Information",hint:o,fieldValue:r,readOnly:i=!1,disabled:a,...s}){const{config:c}=Mn(),u=e??c.showEnvironmentInfo,d=r??c.environmentInfo;return u&&d?l.jsx(Xe,{className:t,hint:o,...s,children:l.jsx(Fc,{id:"environmentInfo",name:"environmentInfo",label:n,value:d,readOnly:i,disabled:a})}):null}function QS({showField:e=!0,className:t,title:n="Attachments",hint:o,readOnly:r=!1,disabled:i,attachments:a,selectedCategories:s,...c}){const u=re("io-block-list-gap",t),{config:d}=Mn(),f=a??d.attachments,h=s??d.selectedCategories,p=v.useCallback(m=>!!h&&h.indexOf(m)!==-1,[h]);return e?!f||f.length<=0?l.jsx(Xe,{title:"Attachments",children:l.jsx("p",{children:"No Attachments"})}):l.jsx(Xe,{className:u,title:n,hint:o,...c,children:l.jsx("div",{className:"file-attachments",children:f.map(m=>l.jsx(La,{id:m.id,name:m.id,label:m.name,readOnly:r,disabled:i,defaultChecked:p(m.category)},m.id))})}):null}function ek({showField:e=!0,className:t,title:n="Attachments",hint:o,readOnly:r=!1,disabled:i,categories:a,selectedCategories:s,...c}){const{config:u,attachmentCategories:d}=Mn(),f=a??d,h=s??u.selectedCategories,p=v.useCallback(m=>!!h&&h.indexOf(m)!==-1,[h]);return e?!f||f.length<=0?l.jsx("p",{children:"No Attachments"}):l.jsx(Xe,{className:t,title:n,hint:o,...c,children:l.jsx("div",{className:"category-attachments",children:f.map(m=>l.jsx(St,{id:m,name:m,align:"right",label:m,readOnly:r,disabled:i,defaultChecked:p(m)},m))})}):null}function tk({className:e,title:t,hint:n,showField:o=!0,showJiraTicketField:r,jiraTicketLabel:i="Create Jira Ticket",showSendEmailField:a,sendEmailLabel:s="Send Email",readOnly:c=!1,disabled:u,...d}){const f=re("io-block-list-gap",e),{config:h,showMailingList:p,setShowMailingList:m}=Mn();if(!o)return null;const g=r??h.createJiraTicket,y=a??h.sendEmail;return l.jsxs(Xe,{className:f,hint:n,title:t,...d,children:[g&&l.jsx(St,{id:"createJiraTicket",name:"createJiraTicket",label:i,align:"right",readOnly:c,disabled:u,defaultChecked:g}),y&&l.jsx(St,{onChange:()=>{m(!p)},id:"sendEmail",name:"sendEmail",label:s,align:"right",readOnly:c,disabled:u,defaultChecked:y})]})}function nk({showField:e=!0,className:t,title:n="Email List",hint:o="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:i,disabled:a,...s}){const{config:c,showMailingList:u}=Mn(),d=e??c.sendEmail,f=i??c.allowEditRecipients===!1;return d&&u?l.jsx(Xe,{className:t,hint:o,...s,children:l.jsx(er,{id:"mailingList",name:"mailingList",label:n,placeholder:r,readOnly:f,disabled:a,defaultValue:c.mailingList??""})}):null}const wy={Header:WS,Body:FS,Footer:zS,HeaderButtons:US,FooterButtons:KS,SubmitButton:VS,CancelButton:GS,CloseButton:qS,IntroField:JS,DescriptionField:ZS,TechInfoField:YS,EnvInfoField:XS,FileAttachmentsField:QS,CategoryAttachmentsField:ek,SettingsField:tk,MailListField:nk},by=v.createContext(wy),ok=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...wy,...t}),[t]);return l.jsx(by.Provider,{value:n,children:e})});function Gc(e){return{...v.useContext(by),...e}}ok.displayName="ComponentsStore";function rk({isOpen:e,onClose:t,container:n}){return e?$o.createPortal(l.jsx(rf,{onClose:t}),n??document.querySelector("#root")??document.body):null}const xy=v.createContext({searchQuery:"",setSearch:()=>{},isPanelVisible:!1,sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),Ht=()=>v.useContext(xy);function Sy({title:e,onOpenSettings:t,onClose:n,...o}){const{HeaderCaptionTitle:r,HeaderCaptionCount:i,HeaderCaptionButtonSettings:a,HeaderCaptionButtonClose:s,HeaderActions:c,HeaderBulkActions:u,HeaderSearch:d}=Mr(),{isBulkActionsSupported:f,notificationsCount:h}=ke(),{isBulkActionsVisible:p}=Ht(),m=Ke();return l.jsxs(Lo,{...o,children:[l.jsxs("div",{className:"io-panel-header-caption",children:[l.jsx(r,{title:e}),l.jsx(i,{}),l.jsxs(Lo.ButtonGroup,{children:[m&&l.jsx(a,{onClick:t}),l.jsx(s,{onClick:n})]})]}),l.jsx(d,{}),f?l.jsxs("div",{className:`io-panel-header-actions-wrapper ${p&&h>0?"io-panel-header-bulk-actions-opened":""} `,children:[l.jsx(c,{}),l.jsx(u,{})]}):l.jsx(c,{})]})}function ky({text:e="Notifications",counter:t,...n}){const{notificationsCount:o}=ke();return l.jsx(qn,{text:e,size:"large",...n,children:(t??!0)&&l.jsxs("span",{children:["(",o,")"]})})}const Cy="newest",ik="oldest",ak="severity",$l=["None","Low","Medium","High","Critical"],bp={key:Cy,descending:!0},Ey=e=>[...e].sort((t,n)=>(n.timestamp||0)-(t.timestamp||0)),jy=e=>[...e].sort((t,n)=>(t.timestamp||0)-(n.timestamp||0)),Ay=(e,t)=>{const n=$l[0];return[...e].sort((o,r)=>{const i=$l.indexOf(o.severity||n),a=$l.indexOf(r.severity||n);return(t?-1:1)*(i-a)})},sk={[Cy]:Ey,[ik]:jy,[ak]:Ay},ck={severity:"Priority",newest:"Newest",oldest:"Oldest"};function Oy({...e}){const[t,n]=v.useState([]),{NotificationsList:o,Notification:r}=Mr(),{notifications:i,setCount:a,notificationsCount:s}=ke(),{sortNotificationsBy:c,viewNotificationsBy:u,searchQuery:d}=Ht(),f=v.useRef(null),h=kv(d),p=v.useMemo(()=>((g,y)=>{if(!g)return[];switch(y){case"all":default:return g;case"unread":return g.filter(w=>w.state==="Active"||w.state==="Stale");case"read":return g.filter(w=>w.state==="Acknowledged"||w.state==="Seen");case"snoozed":return g.filter(w=>w.state==="Snoozed")}})(i,u).filter(g=>{var y,w;return g.title.toLowerCase().includes(h.toLowerCase())||((y=g.source)==null?void 0:y.toLowerCase().includes(h.toLowerCase()))||((w=g.body)==null?void 0:w.toLowerCase().includes(h.toLowerCase()))}),[h,i,u]);return v.useEffect(()=>{switch(c){case"newest":n(Ey(p));break;case"oldest":n(jy(p));break;case"severity":n(Ay(p,!0));break;default:n(p)}a(p.length)},[p,c,a]),v.useEffect(()=>{var m;f.current&&((m=f.current)==null||m.scrollTo({top:0,behavior:"smooth"}))},[h,s,c,u]),l.jsx(ir,{ref:f,element:ki,elementProps:e,children:l.jsx(o,{notifications:t,Notification:r})})}function Py({...e}){const{FooterButtons:t}=Mr();return l.jsx(ei,{...e,children:l.jsx(t,{})})}function _y({className:e,...t}){const{FooterButtonClearAll:n,FooterButtonClearAllOld:o}=Mr(),{notifications:r}=ke(),[i,a]=v.useState(!1);return v.useEffect(()=>{r.filter(s=>s.state==="Stale"||s.state==="Acknowledged").length>0?a(!0):a(!1)},[r]),l.jsxs(De,{className:e,align:"right",...t,children:[l.jsx(o,{disabled:!i}),l.jsx(n,{disabled:r.length<=0})]})}function Ty({text:e="Clear All",...t}){const{clearAll:n}=ke();return l.jsx(et,{text:e,onClick:()=>{n()},...t})}function Ny({text:e="Clear Old",...t}){const{clearAllOld:n}=ke();return l.jsx(et,{text:e,onClick:()=>{n()},...t})}function ff(e){const t=Ke(),{onClose:n,settings:o}=ke(),{isPanelVisible:r}=Ht(),{id:i,onClick:a,updateState:s}=e,c=v.useCallback(async()=>{if(!a)return;if(!t){try{await a({close:!0})}catch(h){console.error(h)}return void n(i)}const d=(o==null?void 0:o.toastStacking)??!1;let f;f=r?(o==null?void 0:o.closeNotificationOnClick)??!0:!d&&null;try{f!==null?await a({close:f}):(await a({close:!1}),await s("Acknowledged"))}catch(h){console.error(h)}},[t,i,r,a,n,s,o==null?void 0:o.closeNotificationOnClick,o==null?void 0:o.toastStacking]),u=v.useCallback(async d=>{const f=d.target;f.closest("button")||f.closest("[role='button']")||f.closest("a")||f.closest(".io-dropdown-menu")||await c()},[c]);return{handleClick:c,handleWrapperClick:u}}function Iy({className:e,notification:t,onClick:n,...o}){const r=re("io-notification-header",e),{HeaderCount:i,HeaderBadge:a,HeaderTitle:s,HeaderTimestamp:c,HeaderButtonSnooze:u,HeaderButtonClose:d}=qc(),{handleWrapperClick:f}=ff(t);return l.jsxs("div",{className:r,onClick:async h=>{await f(h),n==null||n(h)},...o,children:[l.jsx(a,{notification:t}),l.jsx(i,{notification:t}),l.jsx(s,{notification:t}),l.jsx(c,{notification:t}),l.jsxs(De,{children:[l.jsx(u,{notification:t}),l.jsx(d,{notification:t})]})]})}function Ry({notification:e,...t}){const{settings:n,notificationStacks:o}=ke(),{isPanelVisible:r}=Ht(),{toastStacking:i,stackBy:a}=n,s=a==="application"?"source":a??"source";let c=0;if(i){const u=o.find(d=>d.key===e[s]);c=(u==null?void 0:u.items.length)??0}return r||!i||c<=1?null:l.jsx(Tc,{...t,children:c>9?"9+":c})}function Ly({className:e,notification:t,...n}){if(!(t!=null&&t.severity)||t.severity==="None")return null;const o=re("io-notification-header-badge",e);return l.jsx(Tc,{className:o,...n,children:t.severity})}function Dy({className:e,state:t,severity:n="None",icon:o,...r}){const i=re("io-notification-header-icon",e),{isPanelVisible:a}=Ht();return l.jsxs("div",{className:i,...r,children:[o&&l.jsx("span",{className:"io-notification-header-icon-image",children:l.jsx("img",{src:o,alt:`io-notification-header-icon-${o}`})}),l.jsx("span",{className:`io-notification-header-icon-badge color-${n.toLowerCase()}`,children:a&&t!=="Acknowledged"&&"New"})]})}function My({className:e,notification:{appTitle:t},...n}){const o=re("io-notification-header-title",e);return l.jsx("div",{className:o,...n,children:t})}function $y({className:e,notification:{timestamp:t,state:n,snooze:o},...r}){const i=re("io-notification-timestamp",e);return l.jsx("small",o&&n==="Snoozed"?{className:i,...r,children:"Snoozed"}:{className:i,...r,children:u0(t??0)??"Just Now"})}function Hy({notification:{id:e,state:t},...n}){var a,s;const{settings:o,snooze:r}=ke(),i=v.useCallback(c=>{var u;c.stopPropagation(),r&&r(e,((u=o.snooze)==null?void 0:u.duration)??0)},[e,r,(a=o.snooze)==null?void 0:a.duration]);return r&&t!=="Snoozed"&&((s=o.snooze)!=null&&s.enabled)?l.jsx(et,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:i,...n}):null}function By({notification:{id:e,updateState:t},...n}){const o=Ke(),{onClose:r}=ke(),{isPanelVisible:i}=Ht(),a=v.useCallback(s=>{s.stopPropagation(),!o||i?r(e):t("Acknowledged").catch(console.error)},[o,e,r,i,t]);return l.jsx(Ue,{icon:"close",iconSize:"10",tabIndex:-1,onClick:a,...n})}function Wy({className:e,notification:t,...n}){const o=re("io-notification-body",e),{BodyIcon:r,BodyTitle:i,BodyDescription:a}=qc(),{icon:s,title:c,body:u}=t,{handleClick:d}=ff(t);return l.jsxs("div",{className:o,role:"button",tabIndex:0,onKeyDown:async f=>{vo(f)&&await d()},onClick:d,...n,children:[l.jsx(r,{icon:s}),l.jsxs("div",{className:"io-notification-body-content",children:[l.jsx(i,{text:c}),l.jsx(a,{text:u})]})]})}function Fy({className:e,icon:t,altText:n="notification icon",...o}){if(!t)return null;const r=re("io-notification-body-icon",e);return l.jsx("div",{className:r,...o,children:l.jsx("img",{src:t,alt:n})})}function zy({text:e,...t}){return l.jsx(qn,{text:e,...t})}function Uy({className:e,text:t,...n}){const o=re("io-notification-body-description",e);return l.jsx("p",{className:o,...n,children:t})}function Ky({className:e,notification:t}){const n=re("io-notification-footer",e),{FooterButton:o}=qc(),{handleWrapperClick:r}=ff(t),i=v.useMemo(()=>function(s){const c=[],u={};if(!s)return;s.forEach(f=>{var g;const{displayId:h,displayPath:p}=f,m={...f,children:[]};if(p&&p.length>0){let y;p.forEach((w,S)=>{var b;S===0?y=u[w]:y&&(y=(b=y.children)==null?void 0:b.find(k=>k.displayId===w))}),y&&((g=y.children)==null||g.push(m))}else h?(c.push(m),u[h]=m):c.push(m);h&&(u[h]=m)});const d=f=>{f.forEach(h=>{var p;((p=h.children)==null?void 0:p.length)===0?delete h.children:h.children&&d(h.children)})};return d(c),c}(t.actions),[t.actions]),a=(s,c)=>s.children?l.jsx(Nn,{text:s.title,children:s.children.map(a)},`${s.title}-${c}`):((u,d)=>l.jsx(Nn.Item,{children:l.jsx(o,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:u})},`${u.title}-${d}`))(s,c);return l.jsx("div",{className:n,onClick:r,children:l.jsx(De,{align:"right",children:i==null?void 0:i.map((s,c)=>s.children?l.jsxs(De,{variant:"append",children:[l.jsx(o,{notificationAction:s,variant:c===0?"primary":"default"}),l.jsx(Nn,{variant:c===0?"primary":"default",icon:"ellipsis",children:s.children.map(a)})]},`${s.title}-${c}`):l.jsx(o,{notificationAction:s,variant:c===0?"primary":"link"},`${s.title}-${c}`))})})}function Vy({notificationAction:e,...t}){const n=v.useCallback(o=>{o.stopPropagation(),e.onClick({close:!0})},[e]);return l.jsx(et,{text:e.title,onClick:n,...t})}const Gy={Header:Iy,HeaderCount:Ry,HeaderBadge:Ly,HeaderIcon:Dy,HeaderTitle:My,HeaderTimestamp:$y,HeaderButtonSnooze:Hy,HeaderButtonClose:By,Body:Wy,BodyIcon:Fy,BodyTitle:zy,BodyDescription:Uy,Footer:Ky,FooterButton:Vy},qy=v.createContext(Gy),Jy=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...Gy,...t}),[t]);return l.jsx(qy.Provider,{value:n,children:e})});function qc(e){return{...v.useContext(qy),...e}}function lk({className:e,notification:t,...n}){const{Header:o,Body:r,Footer:i}=qc(),{severity:a}=t,s=re("io-notification",`severity-${(a==null?void 0:a.toLowerCase())??"none"}`,t.state!=="Acknowledged"&&"state-new",e);return l.jsxs("div",{className:s,...n,children:[l.jsx(o,{notification:t}),l.jsx(r,{notification:t}),l.jsx(i,{notification:t})]})}function Jc({components:e,notification:t,...n}){return l.jsx(Jy,{components:e,children:l.jsx(lk,{notification:t,...n})})}function Zy({className:e,notifications:t,...n}){const[o,r]=v.useState(!1),i=t.length>=3?"large":"normal",a=t.length===2?"small":i,s=t[0].severity,c=re("io-notification-stack",o&&"io-notification-stack-open",a!=="normal"&&[`io-notification-stack-${a}`],s&&s!=="None"&&[`io-notification-stack-${s.toLowerCase()}`],e),u=v.useCallback(()=>{r(!0)},[]),d=v.useCallback(f=>{f.stopPropagation(),t.forEach(h=>{h.close()})},[t]);return l.jsxs("div",{className:c,onClick:u,...n,children:[o&&a!=="normal"&&l.jsx("div",{className:"io-notification-stack-btn",children:l.jsx(et,{icon:"close",onClick:f=>d(f),children:l.jsx("span",{className:"io-btn-text",children:"Clear Stack"})})}),t.map(f=>l.jsx(Jc,{notification:f},f.id))]})}function uk({...e}){const{notificationStacks:t}=ke();return l.jsx(l.Fragment,{children:t.map(n=>l.jsx(Zy,{notifications:n.items,...e},n.key))})}Jy.displayName="ComponentsStoreProvider";const dk=({notification:e,Notification:t,...n})=>{var p;const{configuration:o,isBulkActionsSupported:r,selectedNotifications:i,selectNotification:a}=ke(),{isPanelVisible:s,isBulkActionsVisible:c}=Ht(),u=((p=o.sourceFilter)==null?void 0:p.muted)??[],d=e.source&&u.includes(e.source)||u.includes("*");if(!s&&d)return null;const f=s&&r&&c,h=i.includes(e.id);return f?l.jsxs("div",{className:re("io-notification-list-bulk-action-item",{selected:h}),children:[l.jsx(La,{checked:h,onChange:m=>a(e.id,m.target.checked)}),l.jsx(t,{notification:e,...n})]}):l.jsx(t,{notification:e,...n})};function hf({className:e,Notification:t,notifications:n=[],noNotificationText:o="No notifications to display",...r}){const i=re("io-notification-list",e),{settings:a}=ke(),{isPanelVisible:s}=Ht(),{toastStacking:c}=a,u=c&&!s,d=n.length>0;return l.jsxs("div",{className:i,...r,children:[u&&l.jsx(uk,{}),!u&&(d?n.map(f=>l.jsx(dk,{notification:f,Notification:t,...r},f.id)):l.jsx("div",{className:"io-notification-list-no-notifications",children:o}))]})}const Yy={Header:Sy,HeaderCaptionTitle:ky,HeaderCaptionCount:function({variant:e="primary",...t}){const{notificationsCount:n=0}=ke();return n===0?null:l.jsx(Gb,{variant:e,...t,children:n>99?"99+":n})},HeaderCaptionButtonSettings:function({icon:e="cog",size:t="32",variant:n="circle",...o}){return Ke()?l.jsx(Ue,{icon:e,size:t,variant:n,...o}):null},HeaderCaptionButtonClose:function({icon:e="close",size:t="32",variant:n="circle",onClick:o,...r}){const{hidePanel:i}=ke(),a=Ke();return l.jsx(Ue,{icon:e,size:t,variant:n,onClick:s=>{o?o(s):a&&i()},...r})},HeaderActions:function({className:e,...t}){const n=re("io-panel-header-actions",e),{HeaderActionSort:o,HeaderActionView:r,HeaderActionClear:i,HeaderActionEdit:a}=Mr();return l.jsxs("div",{className:n,...t,children:[l.jsxs(De,{children:[l.jsx(o,{}),l.jsx(r,{})]}),l.jsxs(De,{children:[l.jsx(i,{}),l.jsx(a,{})]})]})},HeaderActionSort:function({text:e="Sort by",...t}){const{sortNotificationsBy:n,setSortBy:o}=Ht(),{onNotificationsSort:r}=(()=>{const{notifications:i}=ke(),[a,s]=v.useState(bp),{key:c,descending:u}=a,d=v.useMemo(()=>sk[c](i,u),[i,c,u]);return{onNotificationsSort:v.useCallback(h=>{s(p=>({key:h,descending:p.key!==h?bp.descending:!p.descending}))},[]),sortedNotifications:d}})();return l.jsxs(pe,{variant:"light",...t,children:[l.jsxs(pe.Button,{variant:"link",children:[e," ",l.jsx("strong",{children:ck[n].toLowerCase()})]}),l.jsx(pe.Content,{children:l.jsx(pe.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Priority"].map(i=>{const a=i==="Priority"?"severity":i.toLowerCase();return l.jsx(pe.Item,{isSelected:n===a,onClick:()=>{o(a),r(a)},children:i},i)})})})]})},HeaderActionView:function({text:e="View",...t}){var a;const{settings:n}=ke(),{viewNotificationsBy:o,setViewBy:r}=Ht(),i=(a=n.snooze)!=null&&a.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return l.jsxs(pe,{variant:"light",...t,children:[l.jsxs(pe.Button,{variant:"link",children:[e," ",l.jsx("strong",{children:o})]}),l.jsx(pe.Content,{children:l.jsx(pe.List,{variant:"single",checkIcon:"check",children:i.map(s=>l.jsx(pe.Item,{isSelected:o===s.toLowerCase(),onClick:()=>r(s.toLowerCase()),children:s},s))})})]})},HeaderActionClear:function({text:e="Clear All",...t}){const{clearAll:n,notificationsCount:o}=ke();return l.jsx(et,{variant:"link",text:e,onClick:n,disabled:o===0,...t})},HeaderActionEdit:function({tooltip:e="Bulk Edit",...t}){const{isBulkActionsSupported:n,notificationsCount:o}=ke(),{showBulkActions:r}=Ht();return n?l.jsx(Ue,{icon:"pen-to-square",title:e,size:"32",onClick:r,disabled:o===0,...t}):null},HeaderBulkActions:function({className:e,...t}){const n=re("io-panel-header-bulk-actions",e),{HeaderBulkActionSelect:o,HeaderBulkActionSelectDropdown:r,HeaderBulkActionMarkAsRead:i,HeaderBulkActionMarkAsUnread:a,HeaderBulkActionSnooze:s,HeaderBulkActionClear:c,HeaderBulkActionClose:u}=Mr(),{isBulkActionsSupported:d}=ke();return d?l.jsx("div",{className:n,...t,children:l.jsxs(De,{children:[l.jsx(o,{}),l.jsx(r,{}),l.jsx(i,{}),l.jsx(a,{}),l.jsx(s,{}),l.jsx(c,{}),l.jsx(u,{})]})}):null},HeaderBulkActionSelect:function({...e}){const{isBulkActionsSupported:t,selectedNotifications:n,selectAllNotifications:o,notificationsCount:r}=ke();return t?l.jsx(La,{checked:r===n.length&&r>0,onChange:i=>o("all",i.target.checked),disabled:r===0,...e}):null},HeaderBulkActionSelectDropdown:function({...e}){const{isBulkActionsSupported:t,selectAllNotifications:n,notificationsCount:o}=ke();return t?l.jsxs(pe,{variant:"light",...e,children:[l.jsx(pe.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:o===0}),l.jsx(Km,{children:l.jsxs(pe.List,{variant:"single",checkIcon:"check",children:[l.jsx(pe.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map(r=>l.jsx(pe.Item,{onClick:()=>n(r.toLowerCase(),!0),children:r},r))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:e="envelope-open",size:t="32",variant:n="circle",tooltip:o="Mark as read",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:s,notificationsCount:c}=ke(),u=v.useCallback(()=>{s(a,"Seen")},[a,s]);return i?l.jsx(Ue,{icon:e,size:t,variant:n,title:o,onClick:u,disabled:c===0,...r}):null},HeaderBulkActionMarkAsUnread:function({icon:e="envelope",size:t="32",variant:n="circle",tooltip:o="Mark as unread",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,setStates:s,notificationsCount:c}=ke(),u=v.useCallback(()=>{s(a,"Active")},[a,s]);return i?l.jsx(Ue,{icon:e,size:t,variant:n,title:o,onClick:u,disabled:c===0,...r}):null},HeaderBulkActionSnooze:function({icon:e="snooze",size:t="32",variant:n="circle",tooltip:o="Snooze",...r}){var f,h;const{isBulkActionsSupported:i,selectedNotifications:a,snoozeMany:s,settings:c,notificationsCount:u}=ke(),d=v.useCallback(()=>{var p;s(a,((p=c.snooze)==null?void 0:p.duration)??0)},[a,s,(f=c.snooze)==null?void 0:f.duration]);return i&&((h=c.snooze)!=null&&h.enabled)?l.jsx(Ue,{icon:e,size:t,variant:n,title:o,onClick:d,disabled:u===0,...r}):null},HeaderBulkActionClear:function({icon:e="trash",size:t="32",variant:n="circle",tooltip:o="Clear",...r}){const{isBulkActionsSupported:i,selectedNotifications:a,clearMany:s,notificationsCount:c}=ke(),u=v.useCallback(()=>{s(a)},[a,s]);return i?l.jsx(Ue,{icon:e,size:t,variant:n,title:o,onClick:u,disabled:c===0,...r}):null},HeaderBulkActionClose:function({text:e="Done",variant:t="primary",...n}){const{isBulkActionsSupported:o,notificationsCount:r}=ke(),{hideBulkActions:i}=Ht();return o?l.jsx(et,{variant:t,text:e,onClick:i,disabled:r===0,...n}):null},HeaderSearch:function({className:e,placeholder:t="Search",iconPrepend:n="search",iconAppend:o="close",...r}){const i=re("io-panel-header-search",e),a=v.useRef(null),{notificationsCount:s}=ke(),{searchQuery:c,setSearch:u}=Ht(),d=c.length>0,f=v.useCallback(()=>{u(""),a.current&&a.current.focus()},[u]);return l.jsxs("div",{className:i,children:[l.jsx(er,{ref:a,value:c,iconPrepend:n,iconAppend:d?o:void 0,iconAppendOnClick:d?f:void 0,placeholder:t,onChange:h=>u(h.target.value),...r}),d&&l.jsx("p",{className:"io-panel-header-search-count",children:`${s} results`})]})},Body:Oy,Footer:Py,FooterButtons:_y,FooterButtonClearAll:Ty,FooterButtonClearAllOld:Ny,Notification:Jc,NotificationsList:hf},Xy=v.createContext(Yy),Qy=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...Yy,...t}),[t]);return l.jsx(Xy.Provider,{value:n,children:e})});function Mr(e){return{...v.useContext(Xy),...e}}Qy.displayName="ComponentsStoreProvider";function e1(){var r,i;const e=v.useContext(Te.IOConnectContext),{settings:t}=ke(),n=Ke(),o=v.useCallback(async()=>{var c,u,d;const a=e.windows.my();if(!e||!a||!n)return;const s=a.placementSettings;await a.place({...s,snapped:!0,top:12,left:((c=t.placement)==null?void 0:c.panel)==="left"?12:void 0,right:((u=t.placement)==null?void 0:u.panel)==="right"?12:void 0,bottom:12,width:400,horizontalAlignment:(d=t.placement)==null?void 0:d.panel})},[e,n,(r=t.placement)==null?void 0:r.panel]);v.useEffect(()=>{var a;e&&((a=t.placement)!=null&&a.panel)&&n&&o().catch(console.error)},[e,n,o,(i=t.placement)==null?void 0:i.panel])}function fk({className:e,onClose:t,title:n="Notifications",...o}){var h,p;const{Header:r,Body:i}=Mr(),{settings:a}=ke(),{isPanelVisible:s}=Ht(),[c,u]=v.useState(!1),d=Ke(),f=re("io-notifications-panel",((h=a.placement)==null?void 0:h.panel)==="left"&&"io-panel-left",((p=a.placement)==null?void 0:p.panel)==="right"&&"io-panel-right",e);return e1(),v.useEffect(()=>{s||u(!1)},[s]),l.jsxs(l.Fragment,{children:[l.jsxs(nt,{className:f,...o,children:[l.jsx(r,{title:n,onClose:t,onOpenSettings:()=>u(!0)}),l.jsx(i,{})]}),d&&s&&l.jsx(rk,{isOpen:c,onClose:()=>u(!1)})]})}const t1=({className:e,notifications:t,maxToasts:n=1,...o})=>{const r=re("io-toasts-body",e),{NotificationsList:i,Notification:a}=i1(),[s,c]=v.useState([]);return v.useEffect(()=>{const u=n<0?t.length:n,d=t.filter(f=>f.state==="Active").slice(0,u);for(const f of d)f.onShow();c(d)},[t,n]),l.jsx("div",{className:r,...o,children:l.jsx(i,{Notification:a,notifications:s,noNotificationText:""})})};t1.displayName="Body";const n1={Body:t1,Notification:Jc,NotificationsList:hf},o1=v.createContext(n1),r1=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...n1,...t}),[t]);return l.jsx(o1.Provider,{value:n,children:e})});function i1(e){return{...v.useContext(o1),...e}}r1.displayName="ComponentsStoreProvider";function a1(){var r;const e=v.useContext(Te.IOConnectContext),{settings:t}=ke(),n=(r=t.placement)==null?void 0:r.toasts,o=v.useCallback(async()=>{const i=e.windows.my();if(!e||!i)return;const a=i.placementSettings;await i.place({...a,snapped:!0,left:n==="top-left"||n==="bottom-left"?12:void 0,right:n==="top-right"||n==="bottom-right"?12:void 0,width:400,verticalAlignment:n==="top-left"||n==="top-right"?"top":"bottom",horizontalAlignment:n==="top-right"||n==="bottom-right"?"right":"left"})},[e,n]);v.useEffect(()=>{e&&n&&o().catch(console.error)},[e,o,n])}function hk({className:e,maxToasts:t=10,...n}){var h;const{Header:o,Body:r,Footer:i}=i1(),{notifications:a,settings:s}=ke(),c=v.useRef(null),u=function(p){const m=v.useContext(Te.IOConnectContext),g=v.useRef(null),y=v.useRef(0),[w,S]=v.useState(!1),b=v.useCallback(async k=>{if(!m)return;const x=m.windows.my();if(!x)return;let C=1080;try{C=(await m.displays.getPrimary()).workArea.height}catch(R){console.warn("Could not get primary display, using fallback height:",R)}const I=Math.min(Math.max(k,92),C);if(S(k>=C),!(Math.abs(I-y.current)<5)){y.current=I;try{const R=x.placementSettings;await x.place({...R,height:I})}catch(R){console.error("Error updating toasts window height:",R)}}},[m]);return v.useEffect(()=>{if(!p.current||!m)return;const k=p.current,x=new ResizeObserver(C=>{const I=C.at(-1);if(!I)return;const{height:R}=I.contentRect,M=getComputedStyle(k),_=Number.parseInt(M.paddingTop,10),T=Number.parseInt(M.paddingBottom,10),P=(Number.isNaN(_)?0:_)+R+(Number.isNaN(T)?0:T);g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{b(P).catch(console.error)},100)});return x.observe(k),()=>{x.disconnect(),g.current&&clearTimeout(g.current)}},[m,b]),w}(c),d=(h=s.placement)==null?void 0:h.toasts,f=re("io-toasts",(d==="top-left"||d==="top-right")&&"io-toasts-top",(d==="top-right"||d==="bottom-right")&&"io-toasts-right",(d==="bottom-left"||d==="bottom-right")&&"io-toasts-bottom",(d==="top-left"||d==="bottom-left")&&"io-toasts-left",u&&"io-toasts-max-height",e);return a1(),l.jsxs("div",{className:f,...n,children:[o&&l.jsx(o,{}),l.jsx("div",{ref:c,children:l.jsx(r,{notifications:a,maxToasts:t})}),i&&l.jsx(i,{})]})}var pf=Object.freeze({__proto__:null,Notification:Jc,NotificationBody:Wy,NotificationBodyDescription:Uy,NotificationBodyIcon:Fy,NotificationBodyTitle:zy,NotificationFooter:Ky,NotificationFooterButton:Vy,NotificationHeader:Iy,NotificationHeaderBadge:Ly,NotificationHeaderButtonClose:By,NotificationHeaderButtonSnooze:Hy,NotificationHeaderCount:Ry,NotificationHeaderIcon:Dy,NotificationHeaderTimestamp:$y,NotificationHeaderTitle:My,NotificationStack:Zy,NotificationsList:hf,NotificationsPanelProvider:({children:e})=>{const{searchQuery:t,setSearch:n,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:s,isBulkActionsVisible:c,showBulkActions:u,hideBulkActions:d}=function(){const h=v.useContext(Te.IOConnectContext),[p,m]=v.useState(!1),[g,y]=v.useState("newest"),[w,S]=v.useState("all"),[b,k]=v.useState(""),[x,C]=v.useState(!1),I=Ke(),{isBulkActionsSupported:R}=ke();return v.useEffect(()=>{const M=mt.onPanelVisibilityChanged(_=>m(_));return()=>{M()}},[]),v.useEffect(()=>{I!==null&&I&&(async()=>{const M=await h.notifications.panel.isVisible();m(M)})()},[h.notifications.panel,I]),v.useEffect(()=>{p||(C(!1),S("all"))},[p]),{isPanelVisible:p,sortNotificationsBy:g,setSortBy:M=>{y(M)},viewNotificationsBy:w,setViewBy:M=>{S(M)},searchQuery:b,setSearch:M=>{k(M)},isBulkActionsVisible:x,showBulkActions:()=>{R&&C(!0)},hideBulkActions:()=>{R&&C(!1)}}}(),f=v.useMemo(()=>({searchQuery:t,setSearch:n,isPanelVisible:o,sortNotificationsBy:r,setSortBy:i,viewNotificationsBy:a,setViewBy:s,isBulkActionsVisible:c,showBulkActions:u,hideBulkActions:d}),[t,n,o,r,i,a,s,c,u,d]);return l.jsx(xy.Provider,{value:f,children:e})},NotificationsProvider:({children:e})=>{const{notifications:t,notificationStacks:n,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:s,allowedApplications:c,clearAll:u,clearAllOld:d,close:f,hidePanel:h,showPanel:p,saveSetting:m,saveFilter:g,saveAllFilter:y,isBulkActionsSupported:w,selectedNotifications:S,selectNotification:b,selectAllNotifications:k,clearMany:x,snooze:C,snoozeMany:I,setState:R,setStates:M,setCount:_}=oS(),T=v.useMemo(()=>({notifications:t,notificationStacks:n,notificationsCount:o,configuration:r,settings:i,allApplications:a,allApps:s,allowedApplications:c,clearAll:u,clearAllOld:d,onClose:f,hidePanel:h,showPanel:p,saveSetting:m,saveFilter:g,saveAllFilter:y,isBulkActionsSupported:w,selectedNotifications:S,selectNotification:b,selectAllNotifications:k,clearMany:x,snooze:C,snoozeMany:I,setState:R,setStates:M,setCount:_}),[t,n,o,r,i,a,s,c,u,d,f,h,p,m,g,y,w,S,b,k,x,C,I,R,M,_]);return l.jsx($0.Provider,{value:T,children:e})},Panel:function({components:e,settings:t,...n}){return l.jsx(of,{components:t,children:l.jsx(Qy,{components:e,children:l.jsx(fk,{...n})})})},PanelBody:Oy,PanelFooter:Py,PanelFooterButtonClearAll:Ty,PanelFooterButtonClearAllOld:Ny,PanelFooterButtons:_y,PanelHeader:Sy,PanelHeaderCaptionTitle:ky,SettingsAllowNotificationToasts:B0,SettingsAllowNotifications:H0,SettingsCloseNotificationOnClick:F0,SettingsGeneral:L0,SettingsHideToastsAfter:U0,SettingsPanel:rf,SettingsPanelAutoHide:z0,SettingsPlacement:q0,SettingsPlacementPanel:Z0,SettingsPlacementToasts:Y0,SettingsShowNotificationBadge:W0,SettingsSnooze:X0,SettingsSnoozeDuration:Q0,SettingsStacking:K0,SettingsSubscribeAll:ty,SettingsSubscribeApp:ny,SettingsSubscribeMuteAll:oy,SettingsSubscribeMuteApp:ry,SettingsSubscriptions:ey,SettingsToastStackBy:G0,SettingsToastStacking:V0,Toasts:function({components:e,...t}){return l.jsx(r1,{components:e,children:l.jsx(hk,{...t})})},useAddRemoveApps:nf,useHidePanelOnFocusLost:function(e=!0){const t=v.useContext(Te.IOConnectContext),n=Ke();return v.useEffect(()=>{var r;if(!t||!e||n===null||!n)return;const o=(r=t.windows.my())==null?void 0:r.onFocusChanged(i=>{i.isFocused||t.notifications.panel.hide().catch(a=>{console.error("Error hiding panel:",a)})});return()=>o==null?void 0:o()},[t,n,e]),t},useHidePanelOnKeyUp:function(e="Escape"){const{hidePanel:t}=ke();C2(e,t)},useNotificationStacking:D0,useNotificationsContext:ke,useNotificationsPanelContext:Ht,usePanelWindowPlacement:e1,useSelectNotifications:M0,useShowHidePanelWindow:function(e=!0){const t=v.useContext(Te.IOConnectContext),n=t==null?void 0:t.windows.my(),o=Ke(),{isPanelVisible:r}=Ht();return v.useEffect(()=>{t&&n&&o&&(r?n.show().then(()=>{e&&n.focus().catch(i=>{console.error("Error focusing window:",i)})}).catch(i=>console.error("Error showing window:",i)):n.hide().catch(i=>console.error("Error hiding window:",i)))},[t,n,o,r,e]),{myWindow:n}},useToastsWindowPlacement:a1}),pk=Object.freeze({__proto__:null,AllowDocking:Gv,AutoClose:({align:e="right",label:t="Auto-close on starting apps and workspaces",...n})=>l.jsx(Kt,{align:e,label:t,prefKey:Ev,disabled:!0,...n}),DockedAlwaysOnTop:qv,DockedClaimsSpace:Jv,Downloads:n0,DownloadsAskForEachDownload:k0,DownloadsLocation:S0,General:zv,HideFavoritesFromLaunchpad:Vv,HideLabelsInExtendedArea:Yv,Layouts:e0,LayoutsRestoreLastSaved:({align:e="right",label:t="Restore last saved on startup",...n})=>l.jsx(Kt,{align:e,label:t,prefKey:Rv,...n}),LayoutsSaveCurrentOnExit:t0,LayoutsShowDeletePrompt:Vc,LayoutsShowUnsavedChangesPrompt:Kc,MinimizeToTray:Uv,Panel:R0,PanelBody:Fv,PinnedPosition:Kv,ShowExtendedArea:Zv,ShowFavoritesInExtendedArea:Xv,ShowRecentAppsInExtendedArea:Qv,System:C0,SystemRestartSection:O0,SystemShutdownSection:P0,Theme:Uc});const s1=e=>{const{General:t,Layouts:n}=Zc();return l.jsxs(ir,{element:ki,elementProps:e,children:[l.jsx(t,{}),l.jsx(n,{})]})},c1=({title:e="General",...t})=>{const{Theme:n}=Zc();return l.jsx(Xe,{title:e,"data-testid":"preferences-panel-general-block",...t,children:l.jsx(n,{})})},l1=({title:e="Layouts",...t})=>{const{LayoutsShowDeletePrompt:n}=Zc();return l.jsx(Xe,{title:e,"data-testid":"preferences-panel-layouts-block",...t,children:l.jsx(n,{})})},u1={Body:s1,General:c1,Theme:Uc,Layouts:l1,LayoutsShowUnsavedChangesPrompt:Kc,LayoutsShowDeletePrompt:Vc},d1=v.createContext(u1),f1=v.memo(({children:e,components:t})=>{const n=v.useMemo(()=>({...u1,...t}),[t]);return l.jsx(d1.Provider,{value:n,children:e})});f1.displayName="PreferencesPanelComponentsStoreProvider";const Zc=()=>v.useContext(d1),mk=({onClose:e,title:t="Platform Preferences",...n})=>{const{Body:o}=Zc();return l.jsx(I0,{title:t,onClose:e,...n,children:l.jsx(o,{})})};var gk=Object.freeze({__proto__:null,General:c1,Layouts:l1,LayoutsShowDeletePrompt:Vc,LayoutsShowUnsavedChangesPrompt:Kc,Panel:({components:e,...t})=>l.jsx(f1,{components:e,children:l.jsx(mk,{...t})}),PanelBody:s1,Theme:Uc}),h1=Object.freeze({__proto__:null,LicenseSection:cy,Panel:gy,PluginsSection:uy,ProductsInfoSection:ly,Trademark:dy,UserSection:fy});const ua=e=>"items"in e,It={APPLICATION:"application",WORKSPACE:"workspace",LAYOUT:"layout",ACTION_BUTTON:"action-button"},Zu=e=>typeof e=="string"?e:e!=null&&e.message?typeof e.message=="string"?e.message:JSON.stringify(e.message):JSON.stringify(e),p1=()=>typeof window.glue42gd<"u"||typeof window.glue42alert<"u"||typeof window.glue42dialog<"u"||typeof window.iodesktop<"u",ac={OPEN_IN_NEW_WINDOW:"openInNewWindow",OPEN_IN_NEW_WORKSPACE:"openInNewWorkspace"},m1=p1()?[]:[{name:ac.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out"},{name:ac.OPEN_IN_NEW_WORKSPACE,displayName:"Open in a new Workspace",icon:"pop-out"}],sc={OPEN_IN_NEW_WINDOW:"openInNewWindow",DELETE:"delete"},g1=[{name:sc.OPEN_IN_NEW_WINDOW,displayName:"Open in a new window",icon:"pop-out",separatorAfter:!0},{name:sc.DELETE,displayName:"Delete",icon:"trash-can"}],Ea={ASCENDING:"ascending",DESCENDING:"descending",DISABLED:"disabled"},Yc=new Intl.Collator(void 0,{sensitivity:"base"}),v1=(e,t)=>Yc.compare(e.title,t.title),y1=(e,t)=>Yc.compare(t.title,e.title),mf=e=>{const{items:t,sortOrder:n,ascendingCompare:o,descendingCompare:r}=e;if(n===Ea.DISABLED)return t;const i=n===Ea.ASCENDING?o:r;return[...t].sort(i)},vi={FAVORITES:"favorites-section",WORKSPACES:"workspaces-section",APPLICATIONS:"applications-section"},Yu=e=>{var m;const{items:t,newItem:n,settings:o,path:r,accumulatedPath:i=""}=e,{isFolderCollapsible:a}=o,s="/",[c,...u]=r.split(s),d=i?`${i}/${c}`:c,f=t.findIndex(g=>ua(g)&&g.title===c),h=f!==-1?t[f]:null;if(!h){const g=u.length>0?Yu({items:[],newItem:n,settings:o,path:u.join(s),accumulatedPath:d}):[n];return[...t,{id:c,title:c,items:g,isCollapsible:a,getIcon:(m=o.folderIconGetters)==null?void 0:m[d]}]}const p=u.length>0?Yu({items:h.items,newItem:n,settings:o,path:u.join(s),accumulatedPath:d}):[...h.items,n];return[...t.slice(0,f),{...h,items:p},...t.slice(f+1)]},cc=e=>{const{title:t,userProperties:n}=e,{folder:o}=n;return o?`${o}/${t}`:t},vk=(e,t)=>Yc.compare(cc(e),cc(t)),yk=(e,t)=>Yc.compare(cc(t),cc(e)),wk=(e,t,n)=>{const{isSectionCollapsible:o,sortOrder:r=Ea.ASCENDING}=n,a=mf({items:e,sortOrder:r,ascendingCompare:vk,descendingCompare:yk}).reduce((s,c)=>{var f;const u={id:c.id,title:c.title,description:c.caption,type:It.APPLICATION,icon:"application",iconSrc:c.icon,openInstances:(f=t[c.name])==null?void 0:f.length,contextMenuActions:m1},d=c.userProperties.folder;return d?Yu({items:s,newItem:u,settings:n,path:d}):[...s,u]},[]);return{id:vi.APPLICATIONS,title:"Apps",items:a,isCollapsible:o}};var bk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xu={exports:{}},ls={exports:{}},Ve={};/** @license React v16.13.1
|
|
17
17
|
* react-is.production.min.js
|
|
18
18
|
*
|
|
19
19
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
20
20
|
*
|
|
21
21
|
* This source code is licensed under the MIT license found in the
|
|
22
22
|
* LICENSE file in the root directory of this source tree.
|
|
23
|
-
*/var
|
|
23
|
+
*/var xp;function xk(){if(xp)return Ve;xp=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function b(x){if(typeof x=="object"&&x!==null){var C=x.$$typeof;switch(C){case t:switch(x=x.type,x){case c:case u:case o:case i:case r:case f:return x;default:switch(x=x&&x.$$typeof,x){case s:case d:case m:case p:case a:return x;default:return C}}case n:return C}}}function k(x){return b(x)===u}return Ve.AsyncMode=c,Ve.ConcurrentMode=u,Ve.ContextConsumer=s,Ve.ContextProvider=a,Ve.Element=t,Ve.ForwardRef=d,Ve.Fragment=o,Ve.Lazy=m,Ve.Memo=p,Ve.Portal=n,Ve.Profiler=i,Ve.StrictMode=r,Ve.Suspense=f,Ve.isAsyncMode=function(x){return k(x)||b(x)===c},Ve.isConcurrentMode=k,Ve.isContextConsumer=function(x){return b(x)===s},Ve.isContextProvider=function(x){return b(x)===a},Ve.isElement=function(x){return typeof x=="object"&&x!==null&&x.$$typeof===t},Ve.isForwardRef=function(x){return b(x)===d},Ve.isFragment=function(x){return b(x)===o},Ve.isLazy=function(x){return b(x)===m},Ve.isMemo=function(x){return b(x)===p},Ve.isPortal=function(x){return b(x)===n},Ve.isProfiler=function(x){return b(x)===i},Ve.isStrictMode=function(x){return b(x)===r},Ve.isSuspense=function(x){return b(x)===f},Ve.isValidElementType=function(x){return typeof x=="string"||typeof x=="function"||x===o||x===u||x===i||x===r||x===f||x===h||typeof x=="object"&&x!==null&&(x.$$typeof===m||x.$$typeof===p||x.$$typeof===a||x.$$typeof===s||x.$$typeof===d||x.$$typeof===y||x.$$typeof===w||x.$$typeof===S||x.$$typeof===g)},Ve.typeOf=b,Ve}var Ge={};/** @license React v16.13.1
|
|
24
24
|
* react-is.development.js
|
|
25
25
|
*
|
|
26
26
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
27
27
|
*
|
|
28
28
|
* This source code is licensed under the MIT license found in the
|
|
29
29
|
* LICENSE file in the root directory of this source tree.
|
|
30
|
-
*/var
|
|
30
|
+
*/var Sp;function Sk(){return Sp||(Sp=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,o=e?Symbol.for("react.fragment"):60107,r=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,a=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,c=e?Symbol.for("react.async_mode"):60111,u=e?Symbol.for("react.concurrent_mode"):60111,d=e?Symbol.for("react.forward_ref"):60112,f=e?Symbol.for("react.suspense"):60113,h=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,g=e?Symbol.for("react.block"):60121,y=e?Symbol.for("react.fundamental"):60117,w=e?Symbol.for("react.responder"):60118,S=e?Symbol.for("react.scope"):60119;function b(D){return typeof D=="string"||typeof D=="function"||D===o||D===u||D===i||D===r||D===f||D===h||typeof D=="object"&&D!==null&&(D.$$typeof===m||D.$$typeof===p||D.$$typeof===a||D.$$typeof===s||D.$$typeof===d||D.$$typeof===y||D.$$typeof===w||D.$$typeof===S||D.$$typeof===g)}function k(D){if(typeof D=="object"&&D!==null){var le=D.$$typeof;switch(le){case t:var ue=D.type;switch(ue){case c:case u:case o:case i:case r:case f:return ue;default:var ve=ue&&ue.$$typeof;switch(ve){case s:case d:case m:case p:case a:return ve;default:return le}}case n:return le}}}var x=c,C=u,I=s,R=a,M=t,_=d,T=o,P=m,X=p,te=n,W=i,J=r,L=f,G=!1;function F(D){return G||(G=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),N(D)||k(D)===c}function N(D){return k(D)===u}function $(D){return k(D)===s}function H(D){return k(D)===a}function B(D){return typeof D=="object"&&D!==null&&D.$$typeof===t}function E(D){return k(D)===d}function j(D){return k(D)===o}function A(D){return k(D)===m}function O(D){return k(D)===p}function q(D){return k(D)===n}function z(D){return k(D)===i}function U(D){return k(D)===r}function Q(D){return k(D)===f}Ge.AsyncMode=x,Ge.ConcurrentMode=C,Ge.ContextConsumer=I,Ge.ContextProvider=R,Ge.Element=M,Ge.ForwardRef=_,Ge.Fragment=T,Ge.Lazy=P,Ge.Memo=X,Ge.Portal=te,Ge.Profiler=W,Ge.StrictMode=J,Ge.Suspense=L,Ge.isAsyncMode=F,Ge.isConcurrentMode=N,Ge.isContextConsumer=$,Ge.isContextProvider=H,Ge.isElement=B,Ge.isForwardRef=E,Ge.isFragment=j,Ge.isLazy=A,Ge.isMemo=O,Ge.isPortal=q,Ge.isProfiler=z,Ge.isStrictMode=U,Ge.isSuspense=Q,Ge.isValidElementType=b,Ge.typeOf=k}()),Ge}var kp;function w1(){return kp||(kp=1,process.env.NODE_ENV==="production"?ls.exports=xk():ls.exports=Sk()),ls.exports}/*
|
|
31
31
|
object-assign
|
|
32
32
|
(c) Sindre Sorhus
|
|
33
33
|
@license MIT
|
|
34
|
-
*/var
|
|
35
|
-
Valid keys: `+JSON.stringify(Object.keys(
|
|
34
|
+
*/var Hl,Cp;function kk(){if(Cp)return Hl;Cp=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function o(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function r(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var a={},s=0;s<10;s++)a["_"+String.fromCharCode(s)]=s;var c=Object.getOwnPropertyNames(a).map(function(d){return a[d]});if(c.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(d){u[d]=d}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return Hl=r()?Object.assign:function(i,a){for(var s,c=o(i),u,d=1;d<arguments.length;d++){s=Object(arguments[d]);for(var f in s)t.call(s,f)&&(c[f]=s[f]);if(e){u=e(s);for(var h=0;h<u.length;h++)n.call(s,u[h])&&(c[u[h]]=s[u[h]])}}return c},Hl}var Bl,Ep;function gf(){if(Ep)return Bl;Ep=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Bl=e,Bl}var Wl,jp;function b1(){return jp||(jp=1,Wl=Function.call.bind(Object.prototype.hasOwnProperty)),Wl}var Fl,Ap;function Ck(){if(Ap)return Fl;Ap=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=gf(),n={},o=b1();e=function(i){var a="Warning: "+i;typeof console<"u"&&console.error(a);try{throw new Error(a)}catch{}}}function r(i,a,s,c,u){if(process.env.NODE_ENV!=="production"){for(var d in i)if(o(i,d)){var f;try{if(typeof i[d]!="function"){var h=Error((c||"React class")+": "+s+" type `"+d+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[d]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}f=i[d](a,d,c,s,null,t)}catch(m){f=m}if(f&&!(f instanceof Error)&&e((c||"React class")+": type specification of "+s+" `"+d+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof f+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),f instanceof Error&&!(f.message in n)){n[f.message]=!0;var p=u?u():"";e("Failed "+s+" type: "+f.message+(p??""))}}}}return r.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},Fl=r,Fl}var zl,Op;function Ek(){if(Op)return zl;Op=1;var e=w1(),t=kk(),n=gf(),o=b1(),r=Ck(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(s){var c="Warning: "+s;typeof console<"u"&&console.error(c);try{throw new Error(c)}catch{}});function a(){return null}return zl=function(s,c){var u=typeof Symbol=="function"&&Symbol.iterator,d="@@iterator";function f(N){var $=N&&(u&&N[u]||N[d]);if(typeof $=="function")return $}var h="<<anonymous>>",p={array:w("array"),bigint:w("bigint"),bool:w("boolean"),func:w("function"),number:w("number"),object:w("object"),string:w("string"),symbol:w("symbol"),any:S(),arrayOf:b,element:k(),elementType:x(),instanceOf:C,node:_(),objectOf:R,oneOf:I,oneOfType:M,shape:P,exact:X};function m(N,$){return N===$?N!==0||1/N===1/$:N!==N&&$!==$}function g(N,$){this.message=N,this.data=$&&typeof $=="object"?$:{},this.stack=""}g.prototype=Error.prototype;function y(N){if(process.env.NODE_ENV!=="production")var $={},H=0;function B(j,A,O,q,z,U,Q){if(q=q||h,U=U||O,Q!==n){if(c){var D=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw D.name="Invariant Violation",D}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var le=q+":"+O;!$[le]&&H<3&&(i("You are manually calling a React.PropTypes validation function for the `"+U+"` prop on `"+q+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),$[le]=!0,H++)}}return A[O]==null?j?A[O]===null?new g("The "+z+" `"+U+"` is marked as required "+("in `"+q+"`, but its value is `null`.")):new g("The "+z+" `"+U+"` is marked as required in "+("`"+q+"`, but its value is `undefined`.")):null:N(A,O,q,z,U)}var E=B.bind(null,!1);return E.isRequired=B.bind(null,!0),E}function w(N){function $(H,B,E,j,A,O){var q=H[B],z=J(q);if(z!==N){var U=L(q);return new g("Invalid "+j+" `"+A+"` of type "+("`"+U+"` supplied to `"+E+"`, expected ")+("`"+N+"`."),{expectedType:N})}return null}return y($)}function S(){return y(a)}function b(N){function $(H,B,E,j,A){if(typeof N!="function")return new g("Property `"+A+"` of component `"+E+"` has invalid PropType notation inside arrayOf.");var O=H[B];if(!Array.isArray(O)){var q=J(O);return new g("Invalid "+j+" `"+A+"` of type "+("`"+q+"` supplied to `"+E+"`, expected an array."))}for(var z=0;z<O.length;z++){var U=N(O,z,E,j,A+"["+z+"]",n);if(U instanceof Error)return U}return null}return y($)}function k(){function N($,H,B,E,j){var A=$[H];if(!s(A)){var O=J(A);return new g("Invalid "+E+" `"+j+"` of type "+("`"+O+"` supplied to `"+B+"`, expected a single ReactElement."))}return null}return y(N)}function x(){function N($,H,B,E,j){var A=$[H];if(!e.isValidElementType(A)){var O=J(A);return new g("Invalid "+E+" `"+j+"` of type "+("`"+O+"` supplied to `"+B+"`, expected a single ReactElement type."))}return null}return y(N)}function C(N){function $(H,B,E,j,A){if(!(H[B]instanceof N)){var O=N.name||h,q=F(H[B]);return new g("Invalid "+j+" `"+A+"` of type "+("`"+q+"` supplied to `"+E+"`, expected ")+("instance of `"+O+"`."))}return null}return y($)}function I(N){if(!Array.isArray(N))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),a;function $(H,B,E,j,A){for(var O=H[B],q=0;q<N.length;q++)if(m(O,N[q]))return null;var z=JSON.stringify(N,function(Q,D){var le=L(D);return le==="symbol"?String(D):D});return new g("Invalid "+j+" `"+A+"` of value `"+String(O)+"` "+("supplied to `"+E+"`, expected one of "+z+"."))}return y($)}function R(N){function $(H,B,E,j,A){if(typeof N!="function")return new g("Property `"+A+"` of component `"+E+"` has invalid PropType notation inside objectOf.");var O=H[B],q=J(O);if(q!=="object")return new g("Invalid "+j+" `"+A+"` of type "+("`"+q+"` supplied to `"+E+"`, expected an object."));for(var z in O)if(o(O,z)){var U=N(O,z,E,j,A+"."+z,n);if(U instanceof Error)return U}return null}return y($)}function M(N){if(!Array.isArray(N))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),a;for(var $=0;$<N.length;$++){var H=N[$];if(typeof H!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+G(H)+" at index "+$+"."),a}function B(E,j,A,O,q){for(var z=[],U=0;U<N.length;U++){var Q=N[U],D=Q(E,j,A,O,q,n);if(D==null)return null;D.data&&o(D.data,"expectedType")&&z.push(D.data.expectedType)}var le=z.length>0?", expected one of type ["+z.join(", ")+"]":"";return new g("Invalid "+O+" `"+q+"` supplied to "+("`"+A+"`"+le+"."))}return y(B)}function _(){function N($,H,B,E,j){return te($[H])?null:new g("Invalid "+E+" `"+j+"` supplied to "+("`"+B+"`, expected a ReactNode."))}return y(N)}function T(N,$,H,B,E){return new g((N||"React class")+": "+$+" type `"+H+"."+B+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+E+"`.")}function P(N){function $(H,B,E,j,A){var O=H[B],q=J(O);if(q!=="object")return new g("Invalid "+j+" `"+A+"` of type `"+q+"` "+("supplied to `"+E+"`, expected `object`."));for(var z in N){var U=N[z];if(typeof U!="function")return T(E,j,A,z,L(U));var Q=U(O,z,E,j,A+"."+z,n);if(Q)return Q}return null}return y($)}function X(N){function $(H,B,E,j,A){var O=H[B],q=J(O);if(q!=="object")return new g("Invalid "+j+" `"+A+"` of type `"+q+"` "+("supplied to `"+E+"`, expected `object`."));var z=t({},H[B],N);for(var U in z){var Q=N[U];if(o(N,U)&&typeof Q!="function")return T(E,j,A,U,L(Q));if(!Q)return new g("Invalid "+j+" `"+A+"` key `"+U+"` supplied to `"+E+"`.\nBad object: "+JSON.stringify(H[B],null," ")+`
|
|
35
|
+
Valid keys: `+JSON.stringify(Object.keys(N),null," "));var D=Q(O,U,E,j,A+"."+U,n);if(D)return D}return null}return y($)}function te(N){switch(typeof N){case"number":case"string":case"undefined":return!0;case"boolean":return!N;case"object":if(Array.isArray(N))return N.every(te);if(N===null||s(N))return!0;var $=f(N);if($){var H=$.call(N),B;if($!==N.entries){for(;!(B=H.next()).done;)if(!te(B.value))return!1}else for(;!(B=H.next()).done;){var E=B.value;if(E&&!te(E[1]))return!1}}else return!1;return!0;default:return!1}}function W(N,$){return N==="symbol"?!0:$?$["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&$ instanceof Symbol:!1}function J(N){var $=typeof N;return Array.isArray(N)?"array":N instanceof RegExp?"object":W($,N)?"symbol":$}function L(N){if(typeof N>"u"||N===null)return""+N;var $=J(N);if($==="object"){if(N instanceof Date)return"date";if(N instanceof RegExp)return"regexp"}return $}function G(N){var $=L(N);switch($){case"array":case"object":return"an "+$;case"boolean":case"date":case"regexp":return"a "+$;default:return $}}function F(N){return!N.constructor||!N.constructor.name?h:N.constructor.name}return p.checkPropTypes=r,p.resetWarningCache=r.resetWarningCache,p.PropTypes=p,p},zl}var Ul,Pp;function jk(){if(Pp)return Ul;Pp=1;var e=gf();function t(){}function n(){}return n.resetWarningCache=t,Ul=function(){function o(a,s,c,u,d,f){if(f!==e){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}o.isRequired=o;function r(){return o}var i={array:o,bigint:o,bool:o,func:o,number:o,object:o,string:o,symbol:o,any:o,arrayOf:r,element:o,elementType:o,instanceOf:r,node:o,objectOf:r,oneOf:r,oneOfType:r,shape:r,exact:r,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},Ul}if(process.env.NODE_ENV!=="production"){var Ak=w1(),Ok=!0;Xu.exports=Ek()(Ak.isElement,Ok)}else Xu.exports=jk()();var Pk=Xu.exports;const ie=Xc(Pk);var x1={exports:{}};/*!
|
|
36
36
|
Copyright (c) 2018 Jed Watson.
|
|
37
37
|
Licensed under the MIT License (MIT), see
|
|
38
38
|
http://jedwatson.github.io/classnames
|
|
39
|
-
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(i=r(i,o(s)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var s in i)t.call(i,s)&&i[s]&&(a=r(a,s));return a}function r(i,a){return a?i?i+" "+a:i+a:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(Wy);var zS=Wy.exports;const dt=Ic(zS);function ju(e){"@babel/helpers - typeof";return ju=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ju(e)}var US;function Tc(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:US;return t?e.split(" ").map(function(n){return t[n]||n}).join(" "):e}function KS(e,t){var n={};return Object.keys(e).forEach(function(o){t.indexOf(o)===-1&&(n[o]=e[o])}),n}function VS(e,t){for(var n=Array.isArray(t)?t:[t],o=n.length,r,i={};o>0;)o-=1,r=n[o],i[r]=e[r];return i}var GS=(typeof window>"u"?"undefined":ju(window))==="object"&&window.Element||function(){};function qS(e,t,n){if(!(e[t]instanceof GS))return new Error("Invalid prop `"+t+"` supplied to `"+n+"`. Expected prop to be an instance of Element. Validation failed.")}re.oneOfType([re.string,re.func,qS,re.shape({current:re.any})]);var zd=re.oneOfType([re.func,re.string,re.shape({$$typeof:re.symbol,render:re.func}),re.arrayOf(re.oneOfType([re.func,re.string,re.shape({$$typeof:re.symbol,render:re.func})]))]),JS={Fade:150,Collapse:350,Modal:300,Carousel:600,Offcanvas:300},ep=["in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],Va={ENTERING:"entering",ENTERED:"entered",EXITING:"exiting",EXITED:"exited"},ZS=["className","cssModule","variant","innerRef"];function Ou(){return Ou=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ou.apply(this,arguments)}function tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function YS(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?tp(Object(n),!0).forEach(function(o){XS(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tp(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function XS(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function QS(e,t){if(e==null)return{};var n=ek(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function ek(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var tk={active:re.bool,"aria-label":re.string,onClick:re.func,variant:re.oneOf(["white"]),className:re.string,cssModule:re.object,innerRef:re.oneOfType([re.object,re.string,re.func])};function Fy(e){var t=e.className;e.cssModule;var n=e.variant,o=e.innerRef,r=QS(e,ZS),i=Tc(dt(t,"btn-close",n&&"btn-close-".concat(n)));return v.createElement("button",Ou({ref:o,type:"button",className:i},YS({"aria-label":"close"},r)))}Fy.propTypes=tk;var nk=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"];function Pu(){return Pu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Pu.apply(this,arguments)}function ok(e,t){if(e==null)return{};var n=rk(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function rk(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var ik={active:re.bool,"aria-label":re.string,block:re.bool,children:re.node,className:re.string,cssModule:re.object,close:re.bool,color:re.string,disabled:re.bool,innerRef:re.oneOfType([re.object,re.func,re.string]),onClick:re.func,outline:re.bool,size:re.string,tag:zd};function Ws(e){var t=v.useCallback(function(k){if(e.disabled){k.preventDefault();return}if(e.onClick)return e.onClick(k)},[e.onClick,e.disabled]),n=e.active,o=e["aria-label"],r=e.block,i=e.className,a=e.close,s=e.cssModule,c=e.color,l=c===void 0?"secondary":c,d=e.outline,f=e.size,h=e.tag,p=h===void 0?"button":h,m=e.innerRef,g=ok(e,nk);if(a)return v.createElement(Fy,g);var y="btn".concat(d?"-outline":"","-").concat(l),w=Tc(dt(i,"btn",y,f?"btn-".concat(f):!1,r?"d-block w-100":!1,{active:n,disabled:e.disabled}),s);return g.href&&p==="button"&&(p="a"),v.createElement(p,Pu({type:p==="button"&&g.onClick?"button":void 0},g,{className:w,ref:m,onClick:t,"aria-label":o}))}Ws.propTypes=ik;var np=function(t){return t.reduce(function(n,o){var r=o[0],i=o[1];return n[r]=i,n},{})},op=typeof window<"u"&&window.document&&window.document.createElement?U.useLayoutEffect:U.useEffect,Yt="top",vn="bottom",yn="right",Xt="left",Ud="auto",ba=[Yt,vn,yn,Xt],fi="start",ua="end",ak="clippingParents",By="viewport",Ii="popper",sk="reference",rp=ba.reduce(function(e,t){return e.concat([t+"-"+fi,t+"-"+ua])},[]),zy=[].concat(ba,[Ud]).reduce(function(e,t){return e.concat([t,t+"-"+fi,t+"-"+ua])},[]),ck="beforeRead",lk="read",uk="afterRead",dk="beforeMain",fk="main",hk="afterMain",pk="beforeWrite",mk="write",gk="afterWrite",vk=[ck,lk,uk,dk,fk,hk,pk,mk,gk];function Vn(e){return e?(e.nodeName||"").toLowerCase():null}function ln(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ar(e){var t=ln(e).Element;return e instanceof t||e instanceof Element}function mn(e){var t=ln(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function Kd(e){if(typeof ShadowRoot>"u")return!1;var t=ln(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function yk(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var o=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];!mn(i)||!Vn(i)||(Object.assign(i.style,o),Object.keys(r).forEach(function(a){var s=r[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function wk(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(o){var r=t.elements[o],i=t.attributes[o]||{},a=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:n[o]),s=a.reduce(function(c,l){return c[l]="",c},{});!mn(r)||!Vn(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(c){r.removeAttribute(c)}))})}}const bk={name:"applyStyles",enabled:!0,phase:"write",fn:yk,effect:wk,requires:["computeStyles"]};function Bn(e){return e.split("-")[0]}var br=Math.max,Fs=Math.min,hi=Math.round;function Nu(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Uy(){return!/^((?!chrome|android).)*safari/i.test(Nu())}function pi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&mn(e)&&(r=e.offsetWidth>0&&hi(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&hi(o.height)/e.offsetHeight||1);var a=Ar(e)?ln(e):window,s=a.visualViewport,c=!Uy()&&n,l=(o.left+(c&&s?s.offsetLeft:0))/r,d=(o.top+(c&&s?s.offsetTop:0))/i,f=o.width/r,h=o.height/i;return{width:f,height:h,top:d,right:l+f,bottom:d+h,left:l,x:l,y:d}}function Vd(e){var t=pi(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function Ky(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Kd(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function co(e){return ln(e).getComputedStyle(e)}function xk(e){return["table","td","th"].indexOf(Vn(e))>=0}function Zo(e){return((Ar(e)?e.ownerDocument:e.document)||window.document).documentElement}function Rc(e){return Vn(e)==="html"?e:e.assignedSlot||e.parentNode||(Kd(e)?e.host:null)||Zo(e)}function ip(e){return!mn(e)||co(e).position==="fixed"?null:e.offsetParent}function Sk(e){var t=/firefox/i.test(Nu()),n=/Trident/i.test(Nu());if(n&&mn(e)){var o=co(e);if(o.position==="fixed")return null}var r=Rc(e);for(Kd(r)&&(r=r.host);mn(r)&&["html","body"].indexOf(Vn(r))<0;){var i=co(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function xa(e){for(var t=ln(e),n=ip(e);n&&xk(n)&&co(n).position==="static";)n=ip(n);return n&&(Vn(n)==="html"||Vn(n)==="body"&&co(n).position==="static")?t:n||Sk(e)||t}function Gd(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ji(e,t,n){return br(e,Fs(t,n))}function kk(e,t,n){var o=Ji(e,t,n);return o>n?n:o}function Vy(){return{top:0,right:0,bottom:0,left:0}}function Gy(e){return Object.assign({},Vy(),e)}function qy(e,t){return t.reduce(function(n,o){return n[o]=e,n},{})}var Ck=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Gy(typeof t!="number"?t:qy(t,ba))};function Ek(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Bn(n.placement),c=Gd(s),l=[Xt,yn].indexOf(s)>=0,d=l?"height":"width";if(!(!i||!a)){var f=Ck(r.padding,n),h=Vd(i),p=c==="y"?Yt:Xt,m=c==="y"?vn:yn,g=n.rects.reference[d]+n.rects.reference[c]-a[c]-n.rects.popper[d],y=a[c]-n.rects.reference[c],w=xa(i),k=w?c==="y"?w.clientHeight||0:w.clientWidth||0:0,b=g/2-y/2,S=f[p],x=k-h[d]-f[m],C=k/2-h[d]/2+b,T=Ji(S,C,x),L=c;n.modifiersData[o]=(t={},t[L]=T,t.centerOffset=T-C,t)}}function Ak(e){var t=e.state,n=e.options,o=n.element,r=o===void 0?"[data-popper-arrow]":o;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||Ky(t.elements.popper,r)&&(t.elements.arrow=r))}const _k={name:"arrow",enabled:!0,phase:"main",fn:Ek,effect:Ak,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function mi(e){return e.split("-")[1]}var jk={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ok(e,t){var n=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:hi(n*r)/r||0,y:hi(o*r)/r||0}}function ap(e){var t,n=e.popper,o=e.popperRect,r=e.placement,i=e.variation,a=e.offsets,s=e.position,c=e.gpuAcceleration,l=e.adaptive,d=e.roundOffsets,f=e.isFixed,h=a.x,p=h===void 0?0:h,m=a.y,g=m===void 0?0:m,y=typeof d=="function"?d({x:p,y:g}):{x:p,y:g};p=y.x,g=y.y;var w=a.hasOwnProperty("x"),k=a.hasOwnProperty("y"),b=Xt,S=Yt,x=window;if(l){var C=xa(n),T="clientHeight",L="clientWidth";if(C===ln(n)&&(C=Zo(n),co(C).position!=="static"&&s==="absolute"&&(T="scrollHeight",L="scrollWidth")),C=C,r===Yt||(r===Xt||r===yn)&&i===ua){S=vn;var M=f&&C===x&&x.visualViewport?x.visualViewport.height:C[T];g-=M-o.height,g*=c?1:-1}if(r===Xt||(r===Yt||r===vn)&&i===ua){b=yn;var j=f&&C===x&&x.visualViewport?x.visualViewport.width:C[L];p-=j-o.width,p*=c?1:-1}}var N=Object.assign({position:s},l&&jk),O=d===!0?Ok({x:p,y:g},ln(n)):{x:p,y:g};if(p=O.x,g=O.y,c){var Y;return Object.assign({},N,(Y={},Y[S]=k?"0":"",Y[b]=w?"0":"",Y.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",Y))}return Object.assign({},N,(t={},t[S]=k?g+"px":"",t[b]=w?p+"px":"",t.transform="",t))}function Pk(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=o===void 0?!0:o,i=n.adaptive,a=i===void 0?!0:i,s=n.roundOffsets,c=s===void 0?!0:s,l={placement:Bn(t.placement),variation:mi(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ap(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ap(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Nk={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Pk,data:{}};var Ga={passive:!0};function Ik(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=r===void 0?!0:r,a=o.resize,s=a===void 0?!0:a,c=ln(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&l.forEach(function(d){d.addEventListener("scroll",n.update,Ga)}),s&&c.addEventListener("resize",n.update,Ga),function(){i&&l.forEach(function(d){d.removeEventListener("scroll",n.update,Ga)}),s&&c.removeEventListener("resize",n.update,Ga)}}const Tk={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Ik,data:{}};var Rk={left:"right",right:"left",bottom:"top",top:"bottom"};function ps(e){return e.replace(/left|right|bottom|top/g,function(t){return Rk[t]})}var Lk={start:"end",end:"start"};function sp(e){return e.replace(/start|end/g,function(t){return Lk[t]})}function qd(e){var t=ln(e),n=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:n,scrollTop:o}}function Jd(e){return pi(Zo(e)).left+qd(e).scrollLeft}function Dk(e,t){var n=ln(e),o=Zo(e),r=n.visualViewport,i=o.clientWidth,a=o.clientHeight,s=0,c=0;if(r){i=r.width,a=r.height;var l=Uy();(l||!l&&t==="fixed")&&(s=r.offsetLeft,c=r.offsetTop)}return{width:i,height:a,x:s+Jd(e),y:c}}function Mk(e){var t,n=Zo(e),o=qd(e),r=(t=e.ownerDocument)==null?void 0:t.body,i=br(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=br(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-o.scrollLeft+Jd(e),c=-o.scrollTop;return co(r||n).direction==="rtl"&&(s+=br(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:s,y:c}}function Zd(e){var t=co(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function Jy(e){return["html","body","#document"].indexOf(Vn(e))>=0?e.ownerDocument.body:mn(e)&&Zd(e)?e:Jy(Rc(e))}function Zi(e,t){var n;t===void 0&&(t=[]);var o=Jy(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),i=ln(o),a=r?[i].concat(i.visualViewport||[],Zd(o)?o:[]):o,s=t.concat(a);return r?s:s.concat(Zi(Rc(a)))}function Iu(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $k(e,t){var n=pi(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function cp(e,t,n){return t===By?Iu(Dk(e,n)):Ar(t)?$k(t,n):Iu(Mk(Zo(e)))}function Hk(e){var t=Zi(Rc(e)),n=["absolute","fixed"].indexOf(co(e).position)>=0,o=n&&mn(e)?xa(e):e;return Ar(o)?t.filter(function(r){return Ar(r)&&Ky(r,o)&&Vn(r)!=="body"}):[]}function Wk(e,t,n,o){var r=t==="clippingParents"?Hk(e):[].concat(t),i=[].concat(r,[n]),a=i[0],s=i.reduce(function(c,l){var d=cp(e,l,o);return c.top=br(d.top,c.top),c.right=Fs(d.right,c.right),c.bottom=Fs(d.bottom,c.bottom),c.left=br(d.left,c.left),c},cp(e,a,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Zy(e){var t=e.reference,n=e.element,o=e.placement,r=o?Bn(o):null,i=o?mi(o):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(r){case Yt:c={x:a,y:t.y-n.height};break;case vn:c={x:a,y:t.y+t.height};break;case yn:c={x:t.x+t.width,y:s};break;case Xt:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var l=r?Gd(r):null;if(l!=null){var d=l==="y"?"height":"width";switch(i){case fi:c[l]=c[l]-(t[d]/2-n[d]/2);break;case ua:c[l]=c[l]+(t[d]/2-n[d]/2);break}}return c}function da(e,t){t===void 0&&(t={});var n=t,o=n.placement,r=o===void 0?e.placement:o,i=n.strategy,a=i===void 0?e.strategy:i,s=n.boundary,c=s===void 0?ak:s,l=n.rootBoundary,d=l===void 0?By:l,f=n.elementContext,h=f===void 0?Ii:f,p=n.altBoundary,m=p===void 0?!1:p,g=n.padding,y=g===void 0?0:g,w=Gy(typeof y!="number"?y:qy(y,ba)),k=h===Ii?sk:Ii,b=e.rects.popper,S=e.elements[m?k:h],x=Wk(Ar(S)?S:S.contextElement||Zo(e.elements.popper),c,d,a),C=pi(e.elements.reference),T=Zy({reference:C,element:b,strategy:"absolute",placement:r}),L=Iu(Object.assign({},b,T)),M=h===Ii?L:C,j={top:x.top-M.top+w.top,bottom:M.bottom-x.bottom+w.bottom,left:x.left-M.left+w.left,right:M.right-x.right+w.right},N=e.modifiersData.offset;if(h===Ii&&N){var O=N[r];Object.keys(j).forEach(function(Y){var z=[yn,vn].indexOf(Y)>=0?1:-1,R=[Yt,vn].indexOf(Y)>=0?"y":"x";j[Y]+=O[R]*z})}return j}function Fk(e,t){t===void 0&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,l=c===void 0?zy:c,d=mi(o),f=d?s?rp:rp.filter(function(m){return mi(m)===d}):ba,h=f.filter(function(m){return l.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,g){return m[g]=da(e,{placement:g,boundary:r,rootBoundary:i,padding:a})[Bn(g)],m},{});return Object.keys(p).sort(function(m,g){return p[m]-p[g]})}function Bk(e){if(Bn(e)===Ud)return[];var t=ps(e);return[sp(e),t,sp(t)]}function zk(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var r=n.mainAxis,i=r===void 0?!0:r,a=n.altAxis,s=a===void 0?!0:a,c=n.fallbackPlacements,l=n.padding,d=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,g=n.allowedAutoPlacements,y=t.options.placement,w=Bn(y),k=w===y,b=c||(k||!m?[ps(y)]:Bk(y)),S=[y].concat(b).reduce(function(I,E){return I.concat(Bn(E)===Ud?Fk(t,{placement:E,boundary:d,rootBoundary:f,padding:l,flipVariations:m,allowedAutoPlacements:g}):E)},[]),x=t.rects.reference,C=t.rects.popper,T=new Map,L=!0,M=S[0],j=0;j<S.length;j++){var N=S[j],O=Bn(N),Y=mi(N)===fi,z=[Yt,vn].indexOf(O)>=0,R=z?"width":"height",$=da(t,{placement:N,boundary:d,rootBoundary:f,altBoundary:h,padding:l}),H=z?Y?yn:Xt:Y?vn:Yt;x[R]>C[R]&&(H=ps(H));var K=ps(H),B=[];if(i&&B.push($[O]<=0),s&&B.push($[H]<=0,$[K]<=0),B.every(function(I){return I})){M=N,L=!1;break}T.set(N,B)}if(L)for(var D=m?3:1,V=function(E){var A=S.find(function(_){var W=T.get(_);if(W)return W.slice(0,E).every(function(F){return F})});if(A)return M=A,"break"},G=D;G>0;G--){var Z=V(G);if(Z==="break")break}t.placement!==M&&(t.modifiersData[o]._skip=!0,t.placement=M,t.reset=!0)}}const Uk={name:"flip",enabled:!0,phase:"main",fn:zk,requiresIfExists:["offset"],data:{_skip:!1}};function lp(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function up(e){return[Yt,yn,vn,Xt].some(function(t){return e[t]>=0})}function Kk(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,a=da(t,{elementContext:"reference"}),s=da(t,{altBoundary:!0}),c=lp(a,o),l=lp(s,r,i),d=up(c),f=up(l);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const Vk={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kk};function Gk(e,t,n){var o=Bn(e),r=[Xt,Yt].indexOf(o)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*r,[Xt,yn].indexOf(o)>=0?{x:s,y:a}:{x:a,y:s}}function qk(e){var t=e.state,n=e.options,o=e.name,r=n.offset,i=r===void 0?[0,0]:r,a=zy.reduce(function(d,f){return d[f]=Gk(f,t.rects,i),d},{}),s=a[t.placement],c=s.x,l=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[o]=a}const Jk={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:qk};function Zk(e){var t=e.state,n=e.name;t.modifiersData[n]=Zy({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Yk={name:"popperOffsets",enabled:!0,phase:"read",fn:Zk,data:{}};function Xk(e){return e==="x"?"y":"x"}function Qk(e){var t=e.state,n=e.options,o=e.name,r=n.mainAxis,i=r===void 0?!0:r,a=n.altAxis,s=a===void 0?!1:a,c=n.boundary,l=n.rootBoundary,d=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,g=m===void 0?0:m,y=da(t,{boundary:c,rootBoundary:l,padding:f,altBoundary:d}),w=Bn(t.placement),k=mi(t.placement),b=!k,S=Gd(w),x=Xk(S),C=t.modifiersData.popperOffsets,T=t.rects.reference,L=t.rects.popper,M=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,j=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),N=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,O={x:0,y:0};if(C){if(i){var Y,z=S==="y"?Yt:Xt,R=S==="y"?vn:yn,$=S==="y"?"height":"width",H=C[S],K=H+y[z],B=H-y[R],D=p?-L[$]/2:0,V=k===fi?T[$]:L[$],G=k===fi?-L[$]:-T[$],Z=t.elements.arrow,I=p&&Z?Vd(Z):{width:0,height:0},E=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Vy(),A=E[z],_=E[R],W=Ji(0,T[$],I[$]),F=b?T[$]/2-D-W-A-j.mainAxis:V-W-A-j.mainAxis,X=b?-T[$]/2+D+W+_+j.mainAxis:G+W+_+j.mainAxis,q=t.elements.arrow&&xa(t.elements.arrow),P=q?S==="y"?q.clientTop||0:q.clientLeft||0:0,ce=(Y=N==null?void 0:N[S])!=null?Y:0,le=H+F-ce-P,ve=H+X-ce,be=Ji(p?Fs(K,le):K,H,p?br(B,ve):B);C[S]=be,O[S]=be-H}if(s){var ke,te=S==="x"?Yt:Xt,ne=S==="x"?vn:yn,Q=C[x],xe=x==="y"?"height":"width",Pe=Q+y[te],ue=Q-y[ne],Ne=[Yt,Xt].indexOf(w)!==-1,Je=(ke=N==null?void 0:N[x])!=null?ke:0,ot=Ne?Pe:Q-T[xe]-L[xe]-Je+j.altAxis,Ae=Ne?Q+T[xe]+L[xe]-Je-j.altAxis:ue,Oe=p&&Ne?kk(ot,Q,Ae):Ji(p?ot:Pe,Q,p?Ae:ue);C[x]=Oe,O[x]=Oe-Q}t.modifiersData[o]=O}}const eC={name:"preventOverflow",enabled:!0,phase:"main",fn:Qk,requiresIfExists:["offset"]};function tC(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function nC(e){return e===ln(e)||!mn(e)?qd(e):tC(e)}function oC(e){var t=e.getBoundingClientRect(),n=hi(t.width)/e.offsetWidth||1,o=hi(t.height)/e.offsetHeight||1;return n!==1||o!==1}function rC(e,t,n){n===void 0&&(n=!1);var o=mn(t),r=mn(t)&&oC(t),i=Zo(t),a=pi(e,r,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&((Vn(t)!=="body"||Zd(i))&&(s=nC(t)),mn(t)?(c=pi(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=Jd(i))),{x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}function iC(e){var t=new Map,n=new Set,o=[];e.forEach(function(i){t.set(i.name,i)});function r(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var c=t.get(s);c&&r(c)}}),o.push(i)}return e.forEach(function(i){n.has(i.name)||r(i)}),o}function aC(e){var t=iC(e);return vk.reduce(function(n,o){return n.concat(t.filter(function(r){return r.phase===o}))},[])}function sC(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function cC(e){var t=e.reduce(function(n,o){var r=n[o.name];return n[o.name]=r?Object.assign({},r,o,{options:Object.assign({},r.options,o.options),data:Object.assign({},r.data,o.data)}):o,n},{});return Object.keys(t).map(function(n){return t[n]})}var dp={placement:"bottom",modifiers:[],strategy:"absolute"};function fp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function lC(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,o=n===void 0?[]:n,r=t.defaultOptions,i=r===void 0?dp:r;return function(s,c,l){l===void 0&&(l=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},dp,i),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},f=[],h=!1,p={state:d,setOptions:function(w){var k=typeof w=="function"?w(d.options):w;g(),d.options=Object.assign({},i,d.options,k),d.scrollParents={reference:Ar(s)?Zi(s):s.contextElement?Zi(s.contextElement):[],popper:Zi(c)};var b=aC(cC([].concat(o,d.options.modifiers)));return d.orderedModifiers=b.filter(function(S){return S.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var w=d.elements,k=w.reference,b=w.popper;if(fp(k,b)){d.rects={reference:rC(k,xa(b),d.options.strategy==="fixed"),popper:Vd(b)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(j){return d.modifiersData[j.name]=Object.assign({},j.data)});for(var S=0;S<d.orderedModifiers.length;S++){if(d.reset===!0){d.reset=!1,S=-1;continue}var x=d.orderedModifiers[S],C=x.fn,T=x.options,L=T===void 0?{}:T,M=x.name;typeof C=="function"&&(d=C({state:d,options:L,name:M,instance:p})||d)}}}},update:sC(function(){return new Promise(function(y){p.forceUpdate(),y(d)})}),destroy:function(){g(),h=!0}};if(!fp(s,c))return p;p.setOptions(l).then(function(y){!h&&l.onFirstUpdate&&l.onFirstUpdate(y)});function m(){d.orderedModifiers.forEach(function(y){var w=y.name,k=y.options,b=k===void 0?{}:k,S=y.effect;if(typeof S=="function"){var x=S({state:d,name:w,instance:p,options:b}),C=function(){};f.push(x||C)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var uC=[Tk,Yk,Nk,bk,Jk,Uk,eC,_k,Vk],dC=lC({defaultModifiers:uC}),fC=typeof Element<"u",hC=typeof Map=="function",pC=typeof Set=="function",mC=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function ms(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,o,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(!ms(e[o],t[o]))return!1;return!0}var i;if(hC&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(o=i.next()).done;)if(!t.has(o.value[0]))return!1;for(i=e.entries();!(o=i.next()).done;)if(!ms(o.value[1],t.get(o.value[0])))return!1;return!0}if(pC&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(o=i.next()).done;)if(!t.has(o.value[0]))return!1;return!0}if(mC&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[o]))return!1;if(fC&&e instanceof Element)return!1;for(o=n;o--!==0;)if(!((r[o]==="_owner"||r[o]==="__v"||r[o]==="__o")&&e.$$typeof)&&!ms(e[r[o]],t[r[o]]))return!1;return!0}return e!==e&&t!==t}var gC=function(t,n){try{return ms(t,n)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}};const vC=Ic(gC);var yC=[],wC=function(t,n,o){o===void 0&&(o={});var r=U.useRef(null),i={onFirstUpdate:o.onFirstUpdate,placement:o.placement||"bottom",strategy:o.strategy||"absolute",modifiers:o.modifiers||yC},a=U.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=a[0],c=a[1],l=U.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(p){var m=p.state,g=Object.keys(m.elements);rm.flushSync(function(){c({styles:np(g.map(function(y){return[y,m.styles[y]||{}]})),attributes:np(g.map(function(y){return[y,m.attributes[y]]}))})})},requires:["computeStyles"]}},[]),d=U.useMemo(function(){var h={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[l,{name:"applyStyles",enabled:!1}])};return vC(r.current,h)?r.current||h:(r.current=h,h)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,l]),f=U.useRef();return op(function(){f.current&&f.current.setOptions(d)},[d]),op(function(){if(!(t==null||n==null)){var h=o.createPopper||dC,p=h(t,n,d);return f.current=p,function(){p.destroy(),f.current=null}}},[t,n,o.createPopper]),{state:f.current?f.current.state:null,styles:s.styles,attributes:s.attributes,update:f.current?f.current.update:null,forceUpdate:f.current?f.current.forceUpdate:null}},bC=["className","cssModule","size","vertical","tag"];function Tu(){return Tu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Tu.apply(this,arguments)}function hp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function xC(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?hp(Object(n),!0).forEach(function(o){SC(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):hp(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function SC(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kC(e,t){if(e==null)return{};var n=CC(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function CC(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var EC={"aria-label":re.string,className:re.string,cssModule:re.object,role:re.string,size:re.string,tag:zd,vertical:re.bool};function Yy(e){var t=e.className,n=e.cssModule,o=e.size,r=e.vertical,i=e.tag,a=i===void 0?"div":i,s=kC(e,bC),c=Tc(dt(t,o?"btn-group-"+o:!1,r?"btn-group-vertical":"btn-group"),n);return v.createElement(a,Tu({},xC({role:"group"},s),{className:c}))}Yy.propTypes=EC;function AC(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function Ru(e,t){return Ru=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Ru(e,t)}function _C(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ru(e,t)}const pp={disabled:!1};var jC=process.env.NODE_ENV!=="production"?re.oneOfType([re.number,re.shape({enter:re.number,exit:re.number,appear:re.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&re.oneOfType([re.string,re.shape({enter:re.string,exit:re.string,active:re.string}),re.shape({enter:re.string,enterDone:re.string,enterActive:re.string,exit:re.string,exitDone:re.string,exitActive:re.string})]);const Xy=v.createContext(null);var OC=function(t){return t.scrollTop},Ui="unmounted",cr="exited",lr="entering",zr="entered",Lu="exiting",uo=function(e){_C(t,e);function t(o,r){var i;i=e.call(this,o,r)||this;var a=r,s=a&&!a.isMounting?o.enter:o.appear,c;return i.appearStatus=null,o.in?s?(c=cr,i.appearStatus=lr):c=zr:o.unmountOnExit||o.mountOnEnter?c=Ui:c=cr,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(r,i){var a=r.in;return a&&i.status===Ui?{status:cr}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(r){var i=null;if(r!==this.props){var a=this.state.status;this.props.in?a!==lr&&a!==zr&&(i=lr):(a===lr||a===zr)&&(i=Lu)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var r=this.props.timeout,i,a,s;return i=a=s=r,r!=null&&typeof r!="number"&&(i=r.exit,a=r.enter,s=r.appear!==void 0?r.appear:a),{exit:i,enter:a,appear:s}},n.updateStatus=function(r,i){if(r===void 0&&(r=!1),i!==null)if(this.cancelNextCallback(),i===lr){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:jo.findDOMNode(this);a&&OC(a)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===cr&&this.setState({status:Ui})},n.performEnter=function(r){var i=this,a=this.props.enter,s=this.context?this.context.isMounting:r,c=this.props.nodeRef?[s]:[jo.findDOMNode(this),s],l=c[0],d=c[1],f=this.getTimeouts(),h=s?f.appear:f.enter;if(!r&&!a||pp.disabled){this.safeSetState({status:zr},function(){i.props.onEntered(l)});return}this.props.onEnter(l,d),this.safeSetState({status:lr},function(){i.props.onEntering(l,d),i.onTransitionEnd(h,function(){i.safeSetState({status:zr},function(){i.props.onEntered(l,d)})})})},n.performExit=function(){var r=this,i=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:jo.findDOMNode(this);if(!i||pp.disabled){this.safeSetState({status:cr},function(){r.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:Lu},function(){r.props.onExiting(s),r.onTransitionEnd(a.exit,function(){r.safeSetState({status:cr},function(){r.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},n.setNextCallback=function(r){var i=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,i.nextCallback=null,r(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(r,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:jo.findDOMNode(this),s=r==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],l=c[0],d=c[1];this.props.addEndListener(l,d)}r!=null&&setTimeout(this.nextCallback,r)},n.render=function(){var r=this.state.status;if(r===Ui)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 s=AC(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return v.createElement(Xy.Provider,{value:null},typeof a=="function"?a(r,s):v.cloneElement(v.Children.only(a),s))},t}(v.Component);uo.contextType=Xy;uo.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:re.shape({current:typeof Element>"u"?re.any:function(e,t,n,o,r,i){var a=e[t];return re.instanceOf(a&&"ownerDocument"in a?a.ownerDocument.defaultView.Element:Element)(e,t,n,o,r,i)}}),children:re.oneOfType([re.func.isRequired,re.element.isRequired]).isRequired,in:re.bool,mountOnEnter:re.bool,unmountOnExit:re.bool,appear:re.bool,enter:re.bool,exit:re.bool,timeout:function(t){var n=jC;t.addEndListener||(n=n.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 n.apply(void 0,[t].concat(r))},addEndListener:re.func,onEnter:re.func,onEntering:re.func,onEntered:re.func,onExit:re.func,onExiting:re.func,onExited:re.func}:{};function Dr(){}uo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Dr,onEntering:Dr,onEntered:Dr,onExit:Dr,onExiting:Dr,onExited:Dr};uo.UNMOUNTED=Ui;uo.EXITED=cr;uo.ENTERING=lr;uo.ENTERED=zr;uo.EXITING=Lu;const Yd=uo;function Du(e){"@babel/helpers - typeof";return Du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Du(e)}var PC=["tag","horizontal","isOpen","className","navbar","cssModule","children","innerRef"],Mr;function Bs(){return Bs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Bs.apply(this,arguments)}function NC(e,t){if(e==null)return{};var n=IC(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function IC(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function TC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function mp(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function RC(e,t,n){return t&&mp(e.prototype,t),n&&mp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function LC(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mu(e,t)}function Mu(e,t){return Mu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},Mu(e,t)}function DC(e){var t=$C();return function(){var o=zs(e),r;if(t){var i=zs(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return MC(this,r)}}function MC(e,t){if(t&&(Du(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Qy(e)}function Qy(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $C(){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 zs(e){return zs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},zs(e)}function gp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function gi(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?gp(Object(n),!0).forEach(function(o){Zr(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gp(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Zr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var HC=gi(gi({},Yd.propTypes),{},{horizontal:re.bool,isOpen:re.bool,children:re.oneOfType([re.arrayOf(re.node),re.node]),tag:zd,className:re.node,navbar:re.bool,cssModule:re.object,innerRef:re.shape({current:re.object})}),WC=gi(gi({},Yd.defaultProps),{},{horizontal:!1,isOpen:!1,appear:!1,enter:!0,exit:!0,tag:"div",timeout:JS.Collapse}),FC=(Mr={},Zr(Mr,Va.ENTERING,"collapsing"),Zr(Mr,Va.ENTERED,"collapse show"),Zr(Mr,Va.EXITING,"collapsing"),Zr(Mr,Va.EXITED,"collapse"),Mr);function BC(e){return FC[e]||"collapse"}var Xd=function(e){LC(n,e);var t=DC(n);function n(o){var r;return TC(this,n),r=t.call(this,o),r.state={dimension:null},r.nodeRef=o.innerRef||v.createRef(),["onEntering","onEntered","onExit","onExiting","onExited"].forEach(function(i){r[i]=r[i].bind(Qy(r))}),r}return RC(n,[{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,s=i.horizontal,c=i.isOpen,l=i.className,d=i.navbar,f=i.cssModule,h=i.children;i.innerRef;var p=NC(i,PC),m=this.state.dimension,g=VS(p,ep),y=KS(p,ep);return v.createElement(Yd,Bs({},g,{in:c,nodeRef:this.nodeRef,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}),function(w){var k=BC(w),b=Tc(dt(l,s&&"collapse-horizontal",k,d&&"navbar-collapse"),f),S=m===null?null:Zr({},s?"width":"height",m);return v.createElement(a,Bs({},y,{style:gi(gi({},y.style),S),className:b,ref:r.nodeRef}),h)})}}]),n}(v.Component);Xd.propTypes=HC;Xd.defaultProps=WC;const e1=Xd,zC=e=>{const{className:t,isOpen:n,getIcon:o,showCollapseIcon:r,showFolderIcon:i,title:a,...s}=e;return u.jsx(gt.ItemHeader,{className:dt("io-base-section-header",t),prepend:i&&(o?u.jsx(fd,{size:"16",src:o(n),alt:`${a} icon`,"data-testid":`base-section-header-${a}-folder-custom-icon`}):u.jsx(kt,{size:"16",variant:n?"folder-open":"folder","data-testid":`base-section-header-${a}-folder-default-icon`})),append:r&&u.jsx(Ue,{className:dt("collapse-icon",!n&&"collapsed"),iconSize:"10",size:"16",icon:"expand","data-testid":"base-section-header-collapse-icon"}),tooltip:a,...s,children:a})},t1=()=>{const[e,t]=v.useState([]),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=c=>{const{name:l,title:d,caption:f,icon:h,userProperties:p}=c;return{id:l,name:l,title:d??l,caption:f,icon:h,userProperties:p}},r=n.appManager.onAppAdded(c=>{if(c.userProperties.hidden||"hidden"in c&&c.hidden)return;const l=o(c);t(d=>[...d,l])}),i=n.appManager.onAppChanged(c=>{if(c.userProperties.hidden||"hidden"in c&&c.hidden)return;const l=o(c);t(d=>[...d.filter(f=>f.id!==l.id),l])}),a=n.appManager.onAppRemoved(c=>{const l=o(c);t(d=>d.filter(f=>f.id!==l.id))}),s=[r,a,i];return()=>s.forEach(c=>c())},[n]),e},UC=()=>{const[e,t]=v.useState({}),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=n.appManager.onInstanceStarted(a=>{t(s=>{const c=s[a.application.name]??[];return{...s,[a.application.name]:[...c,a.id]}})}),r=n.appManager.onInstanceStopped(a=>{t(s=>{const c=s[a.application.name];return c?{...s,[a.application.name]:c.filter(l=>l!==a.id)}:s})}),i=[o,r];return()=>i.forEach(a=>a())},[n]),e},KC=e=>{v.useEffect(()=>{var n;if(!((n=window.iobrowser)!=null&&n.platformStarted)||e)return;const t=o=>{o.preventDefault(),o.returnValue=!0};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[e])},Qd=()=>{const[e,t]=v.useState(),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{var o;try{const i=!((o=n.windows.my())!=null&&o.name)?ai.getFrameId():void 0;t(i)}catch(r){console.error("Failed to get the current frame ID ",{error:r})}},[n,ai.getFrameId,t]),e},Fe={SUCCESS:"success",WARNING:"warning"},VC={success:5*1e3,warning:10*1e3},Be=async e=>{const{io:t,variant:n,text:o,error:r}=e,i=Eu(r);try{if(n===Fe.WARNING&&t.logger.warn(i?`${o} ${i}`:o),!("modals"in t&&t.modals))throw new Error("Modals are not enabled.");const a={text:o,variant:n,ttl:VC[n]};await t.modals.alerts.request(a)}catch(a){t.logger.warn(`Failed to request alert. ${Eu(a)}`)}},GC=async e=>{var o;const{io:t,item:n}=e;try{await((o=t.appManager.application(n.id))==null?void 0:o.start())}catch(r){await Be({io:t,variant:Fe.WARNING,text:`Failed to start app "${n.title}" in a new window.`,error:r})}},qC=async e=>{const{io:t,item:n,frameId:o}=e;if(!t.workspaces)return;const r={type:"workspace",definition:{frame:o?{reuseFrameId:o}:{newFrame:!0}}},i=t.workspaces.getBuilder(r);i.addGroup().addWindow({appName:n.id});try{await i.create()}catch(a){await Be({io:t,variant:Fe.WARNING,text:`Failed to start app "${n.title}" in a new Workspace.`,error:a})}},JC={[Ms.OPEN_IN_NEW_WINDOW]:GC,[Ms.OPEN_IN_NEW_WORKSPACE]:qC},n1=()=>{const e=v.useContext(Ie.IOConnectContext),t=Qd();return(n,o)=>{JC[o]({io:e,item:n,frameId:t})}},Ci={NO_INPUTS_CONFIRMATION_DIALOG:"noInputsConfirmationDialog",SINGLE_CHECKBOX_DIALOG:"singleCheckboxDialog",SINGLE_TEXT_INPUT_DIALOG:"singleTextInputDialog"},ef="(.|\\s)*\\S(.|\\s)*",ZC=async e=>{var i;const{io:t,layout:n,showDeletePromptPref:o,updateShowDeletePromptPref:r}=e;if("modals"in t&&t.modals&&o){const a="delete",s="do-not-ask-again",{isEnterPressed:c,responseButtonClicked:l,inputs:d}=await t.modals.dialogs.request({templateName:Ci.SINGLE_CHECKBOX_DIALOG,variables:{heading:`Delete Layout "${n.name}"`,text:"Are you sure you want to delete this Layout?",checkbox:{id:s,label:"Don't ask me again"},actionButtons:[{variant:"critical",text:"Delete",id:a},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(((i=d==null?void 0:d.find(p=>p.id===s))==null?void 0:i.checked)&&r(!1),!(c||(l==null?void 0:l.id)===a))return}try{await t.layouts.remove("Global",n.name),n.isDefault&&await t.layouts.clearDefaultGlobal(),await Be({io:t,variant:Fe.SUCCESS,text:`Layout "${n.name}" was successfully deleted.`})}catch(a){await Be({io:t,variant:Fe.WARNING,text:`Failed to delete Layout "${n.name}".`,error:a})}},YC=async e=>{var f;const{io:t,layout:n,setDefaultLayout:o}=e;if(!("modals"in t&&t.modals)){console.error("Cannot rename Layout because io dialogs are not enabled");return}const r="rename",i="new-layout-name",{isEnterPressed:a,responseButtonClicked:s,inputs:c}=await t.modals.dialogs.request({templateName:Ci.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Rename "${n.name}"`,input:{id:i,initialValue:n.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:ef}},actionButtons:[{variant:"primary",text:"Rename",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),l=(f=c==null?void 0:c.find(h=>h.id===i))==null?void 0:f.value;if(a||(s==null?void 0:s.id)===r){if(l===n.name){await Be({io:t,variant:Fe.WARNING,text:`Failed to rename Layout "${n.name}". The new Layout name must be different from the current one.`});return}try{if((await t.layouts.getAll("Global")).find(m=>m.name===l)){await Be({io:t,variant:Fe.WARNING,text:`Failed to rename Layout "${n.name}" to "${l}". A Layout with name "${l}" already exists.`});return}const p=await t.layouts.get(n.name,"Global");if(!p){await Be({io:t,variant:Fe.WARNING,text:`Failed to rename Layout "${n.name}". The Layout wasn't found.`});return}await t.layouts.rename(p,l),n.isDefault&&await o({name:l}),await Be({io:t,variant:Fe.SUCCESS,text:`Layout "${n.name}" was successfully renamed to "${l}".`})}catch(h){await Be({io:t,variant:Fe.WARNING,text:`Failed to rename Layout "${n.name}".`,error:h})}}},XC=async e=>{const{io:t,layout:n}=e;try{await t.layouts.save({name:n.name,type:"Global"}),await Be({io:t,variant:Fe.SUCCESS,text:`Layout "${n.name}" was saved successfully.`})}catch(o){await Be({io:t,variant:Fe.WARNING,text:`Failed to save Layout "${n.name}".`,error:o})}},QC=async e=>{var f;const{io:t,layout:n,setActiveLayout:o}=e;if(!("modals"in t&&t.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:s,inputs:c}=await t.modals.dialogs.request({templateName:Ci.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Save Layout "${n.name}" as`,input:{id:i,initialValue:n.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:ef}},actionButtons:[{variant:"primary",text:"Save as",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),l=(f=c==null?void 0:c.find(h=>h.id===i))==null?void 0:f.value;if(a||(s==null?void 0:s.id)===r){if(l===n.name){await Be({io:t,variant:Fe.WARNING,text:`Failed to save Layout as "${l}". The new Layout must have a unique name.`});return}try{if((await t.layouts.getAll("Global")).find(m=>m.name===l)){await Be({io:t,variant:Fe.WARNING,text:`Failed to save Layout as "${l}". A Layout with this name already exists.`});return}const p=await t.layouts.get(n.name,"Global");if(!p){await Be({io:t,variant:Fe.WARNING,text:`Failed to save Layout "${n.name}". The Layout wasn't found.`});return}await t.layouts.import([{...p,name:l}],"merge"),n.isActive&&o({name:l}),await Be({io:t,variant:Fe.SUCCESS,text:`The Layout was successfully saved as "${l}".`})}catch(h){await Be({io:t,variant:Fe.WARNING,text:`Failed to save Layout "${l}".`,error:h})}}},e3=async e=>{const{io:t,layout:n,setDefaultLayout:o}=e;try{await o({name:n.name}),await Be({io:t,variant:Fe.SUCCESS,text:`Layout "${n.name}" was successfully set as the default Layout.`})}catch{await Be({io:t,variant:Fe.WARNING,text:`Failed to set Layout "${n.name}" as the default Layout.`})}},t3=async e=>{const{io:t,layout:n,closeLaunchpad:o}=e;try{await t.layouts.restore({name:n.name}),o(),await Be({io:t,variant:Fe.SUCCESS,text:`Layout "${n.name}" was loaded successfully.`})}catch(r){await Be({io:t,variant:Fe.WARNING,text:`Failed to load Layout "${n.name}".`,error:r})}},n3={delete:ZC,rename:YC,save:XC,saveAs:QC,setAsDefault:e3,load:t3},o3="interopio_home_ui_auth0_validation_error",r3="interopio_home_ui_user",i3="interopio_home_ui_platform_window",Sa="interopio_home_ui_platform_setup",o1="interopio_home_ui_active_layout";var _t=function(e){return{ok:!0,result:e}},wt=function(e){return{ok:!1,error:e}},a3=function(e){return e.ok===!0?Promise.resolve(e.result):Promise.reject(e.error)},s3=function(e,t){return t.ok===!0?t.result:e},c3=function(e){if(e.ok===!0)return e.result;throw e.error},l3=function(e,t){return t.ok===!0?_t(e(t.result)):t},vp=function(e,t,n){return t.ok===!1?t:n.ok===!1?n:_t(e(t.result,n.result))},Sl=function(e,t){return t.ok===!0?t:wt(e(t.error))},u3=function(e,t){return t.ok===!0?e(t.result):t};/*! *****************************************************************************
|
|
39
|
+
*/(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var i="",a=0;a<arguments.length;a++){var s=arguments[a];s&&(i=r(i,o(s)))}return i}function o(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return n.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var a="";for(var s in i)t.call(i,s)&&i[s]&&(a=r(a,s));return a}function r(i,a){return a?i?i+" "+a:i+a:i}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(x1);var _k=x1.exports;const pt=Xc(_k);function Qu(e){"@babel/helpers - typeof";return Qu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qu(e)}var Tk;function Qc(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Tk;return t?e.split(" ").map(function(n){return t[n]||n}).join(" "):e}function Nk(e,t){var n={};return Object.keys(e).forEach(function(o){t.indexOf(o)===-1&&(n[o]=e[o])}),n}function Ik(e,t){for(var n=Array.isArray(t)?t:[t],o=n.length,r,i={};o>0;)o-=1,r=n[o],i[r]=e[r];return i}var Rk=(typeof window>"u"?"undefined":Qu(window))==="object"&&window.Element||function(){};function Lk(e,t,n){if(!(e[t]instanceof Rk))return new Error("Invalid prop `"+t+"` supplied to `"+n+"`. Expected prop to be an instance of Element. Validation failed.")}ie.oneOfType([ie.string,ie.func,Lk,ie.shape({current:ie.any})]);var vf=ie.oneOfType([ie.func,ie.string,ie.shape({$$typeof:ie.symbol,render:ie.func}),ie.arrayOf(ie.oneOfType([ie.func,ie.string,ie.shape({$$typeof:ie.symbol,render:ie.func})]))]),Dk={Fade:150,Collapse:350,Modal:300,Carousel:600,Offcanvas:300},_p=["in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","onEnter","onEntering","onEntered","onExit","onExiting","onExited"],us={ENTERING:"entering",ENTERED:"entered",EXITING:"exiting",EXITED:"exited"},Mk=["className","cssModule","variant","innerRef"];function ed(){return ed=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},ed.apply(this,arguments)}function Tp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function $k(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Tp(Object(n),!0).forEach(function(o){Hk(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Tp(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Hk(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bk(e,t){if(e==null)return{};var n=Wk(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function Wk(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var Fk={active:ie.bool,"aria-label":ie.string,onClick:ie.func,variant:ie.oneOf(["white"]),className:ie.string,cssModule:ie.object,innerRef:ie.oneOfType([ie.object,ie.string,ie.func])};function S1(e){var t=e.className;e.cssModule;var n=e.variant,o=e.innerRef,r=Bk(e,Mk),i=Qc(pt(t,"btn-close",n&&"btn-close-".concat(n)));return v.createElement("button",ed({ref:o,type:"button",className:i},$k({"aria-label":"close"},r)))}S1.propTypes=Fk;var zk=["active","aria-label","block","className","close","cssModule","color","outline","size","tag","innerRef"];function td(){return td=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},td.apply(this,arguments)}function Uk(e,t){if(e==null)return{};var n=Kk(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function Kk(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var Vk={active:ie.bool,"aria-label":ie.string,block:ie.bool,children:ie.node,className:ie.string,cssModule:ie.object,close:ie.bool,color:ie.string,disabled:ie.bool,innerRef:ie.oneOfType([ie.object,ie.func,ie.string]),onClick:ie.func,outline:ie.bool,size:ie.string,tag:vf};function lc(e){var t=v.useCallback(function(S){if(e.disabled){S.preventDefault();return}if(e.onClick)return e.onClick(S)},[e.onClick,e.disabled]),n=e.active,o=e["aria-label"],r=e.block,i=e.className,a=e.close,s=e.cssModule,c=e.color,u=c===void 0?"secondary":c,d=e.outline,f=e.size,h=e.tag,p=h===void 0?"button":h,m=e.innerRef,g=Uk(e,zk);if(a)return v.createElement(S1,g);var y="btn".concat(d?"-outline":"","-").concat(u),w=Qc(pt(i,"btn",y,f?"btn-".concat(f):!1,r?"d-block w-100":!1,{active:n,disabled:e.disabled}),s);return g.href&&p==="button"&&(p="a"),v.createElement(p,td({type:p==="button"&&g.onClick?"button":void 0},g,{className:w,ref:m,onClick:t,"aria-label":o}))}lc.propTypes=Vk;var Np=function(t){return t.reduce(function(n,o){var r=o[0],i=o[1];return n[r]=i,n},{})},Ip=typeof window<"u"&&window.document&&window.document.createElement?V.useLayoutEffect:V.useEffect,Xt="top",xn="bottom",Sn="right",Qt="left",yf="auto",Ba=[Xt,xn,Sn,Qt],Ai="start",ja="end",Gk="clippingParents",k1="viewport",Ji="popper",qk="reference",Rp=Ba.reduce(function(e,t){return e.concat([t+"-"+Ai,t+"-"+ja])},[]),C1=[].concat(Ba,[yf]).reduce(function(e,t){return e.concat([t,t+"-"+Ai,t+"-"+ja])},[]),Jk="beforeRead",Zk="read",Yk="afterRead",Xk="beforeMain",Qk="main",eC="afterMain",tC="beforeWrite",nC="write",oC="afterWrite",rC=[Jk,Zk,Yk,Xk,Qk,eC,tC,nC,oC];function Yn(e){return e?(e.nodeName||"").toLowerCase():null}function hn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function $r(e){var t=hn(e).Element;return e instanceof t||e instanceof Element}function wn(e){var t=hn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function wf(e){if(typeof ShadowRoot>"u")return!1;var t=hn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function iC(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var o=t.styles[n]||{},r=t.attributes[n]||{},i=t.elements[n];!wn(i)||!Yn(i)||(Object.assign(i.style,o),Object.keys(r).forEach(function(a){var s=r[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function aC(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(o){var r=t.elements[o],i=t.attributes[o]||{},a=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:n[o]),s=a.reduce(function(c,u){return c[u]="",c},{});!wn(r)||!Yn(r)||(Object.assign(r.style,s),Object.keys(i).forEach(function(c){r.removeAttribute(c)}))})}}const sC={name:"applyStyles",enabled:!0,phase:"write",fn:iC,effect:aC,requires:["computeStyles"]};function Gn(e){return e.split("-")[0]}var Ir=Math.max,uc=Math.min,Oi=Math.round;function nd(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function E1(){return!/^((?!chrome|android).)*safari/i.test(nd())}function Pi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var o=e.getBoundingClientRect(),r=1,i=1;t&&wn(e)&&(r=e.offsetWidth>0&&Oi(o.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Oi(o.height)/e.offsetHeight||1);var a=$r(e)?hn(e):window,s=a.visualViewport,c=!E1()&&n,u=(o.left+(c&&s?s.offsetLeft:0))/r,d=(o.top+(c&&s?s.offsetTop:0))/i,f=o.width/r,h=o.height/i;return{width:f,height:h,top:d,right:u+f,bottom:d+h,left:u,x:u,y:d}}function bf(e){var t=Pi(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function j1(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&wf(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function go(e){return hn(e).getComputedStyle(e)}function cC(e){return["table","td","th"].indexOf(Yn(e))>=0}function ar(e){return(($r(e)?e.ownerDocument:e.document)||window.document).documentElement}function el(e){return Yn(e)==="html"?e:e.assignedSlot||e.parentNode||(wf(e)?e.host:null)||ar(e)}function Lp(e){return!wn(e)||go(e).position==="fixed"?null:e.offsetParent}function lC(e){var t=/firefox/i.test(nd()),n=/Trident/i.test(nd());if(n&&wn(e)){var o=go(e);if(o.position==="fixed")return null}var r=el(e);for(wf(r)&&(r=r.host);wn(r)&&["html","body"].indexOf(Yn(r))<0;){var i=go(r);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return r;r=r.parentNode}return null}function Wa(e){for(var t=hn(e),n=Lp(e);n&&cC(n)&&go(n).position==="static";)n=Lp(n);return n&&(Yn(n)==="html"||Yn(n)==="body"&&go(n).position==="static")?t:n||lC(e)||t}function xf(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function da(e,t,n){return Ir(e,uc(t,n))}function uC(e,t,n){var o=da(e,t,n);return o>n?n:o}function A1(){return{top:0,right:0,bottom:0,left:0}}function O1(e){return Object.assign({},A1(),e)}function P1(e,t){return t.reduce(function(n,o){return n[o]=e,n},{})}var dC=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,O1(typeof t!="number"?t:P1(t,Ba))};function fC(e){var t,n=e.state,o=e.name,r=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Gn(n.placement),c=xf(s),u=[Qt,Sn].indexOf(s)>=0,d=u?"height":"width";if(!(!i||!a)){var f=dC(r.padding,n),h=bf(i),p=c==="y"?Xt:Qt,m=c==="y"?xn:Sn,g=n.rects.reference[d]+n.rects.reference[c]-a[c]-n.rects.popper[d],y=a[c]-n.rects.reference[c],w=Wa(i),S=w?c==="y"?w.clientHeight||0:w.clientWidth||0:0,b=g/2-y/2,k=f[p],x=S-h[d]-f[m],C=S/2-h[d]/2+b,I=da(k,C,x),R=c;n.modifiersData[o]=(t={},t[R]=I,t.centerOffset=I-C,t)}}function hC(e){var t=e.state,n=e.options,o=n.element,r=o===void 0?"[data-popper-arrow]":o;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||j1(t.elements.popper,r)&&(t.elements.arrow=r))}const pC={name:"arrow",enabled:!0,phase:"main",fn:fC,effect:hC,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function _i(e){return e.split("-")[1]}var mC={top:"auto",right:"auto",bottom:"auto",left:"auto"};function gC(e,t){var n=e.x,o=e.y,r=t.devicePixelRatio||1;return{x:Oi(n*r)/r||0,y:Oi(o*r)/r||0}}function Dp(e){var t,n=e.popper,o=e.popperRect,r=e.placement,i=e.variation,a=e.offsets,s=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,f=e.isFixed,h=a.x,p=h===void 0?0:h,m=a.y,g=m===void 0?0:m,y=typeof d=="function"?d({x:p,y:g}):{x:p,y:g};p=y.x,g=y.y;var w=a.hasOwnProperty("x"),S=a.hasOwnProperty("y"),b=Qt,k=Xt,x=window;if(u){var C=Wa(n),I="clientHeight",R="clientWidth";if(C===hn(n)&&(C=ar(n),go(C).position!=="static"&&s==="absolute"&&(I="scrollHeight",R="scrollWidth")),C=C,r===Xt||(r===Qt||r===Sn)&&i===ja){k=xn;var M=f&&C===x&&x.visualViewport?x.visualViewport.height:C[I];g-=M-o.height,g*=c?1:-1}if(r===Qt||(r===Xt||r===xn)&&i===ja){b=Sn;var _=f&&C===x&&x.visualViewport?x.visualViewport.width:C[R];p-=_-o.width,p*=c?1:-1}}var T=Object.assign({position:s},u&&mC),P=d===!0?gC({x:p,y:g},hn(n)):{x:p,y:g};if(p=P.x,g=P.y,c){var X;return Object.assign({},T,(X={},X[k]=S?"0":"",X[b]=w?"0":"",X.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",X))}return Object.assign({},T,(t={},t[k]=S?g+"px":"",t[b]=w?p+"px":"",t.transform="",t))}function vC(e){var t=e.state,n=e.options,o=n.gpuAcceleration,r=o===void 0?!0:o,i=n.adaptive,a=i===void 0?!0:i,s=n.roundOffsets,c=s===void 0?!0:s,u={placement:Gn(t.placement),variation:_i(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Dp(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Dp(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const yC={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:vC,data:{}};var ds={passive:!0};function wC(e){var t=e.state,n=e.instance,o=e.options,r=o.scroll,i=r===void 0?!0:r,a=o.resize,s=a===void 0?!0:a,c=hn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(d){d.addEventListener("scroll",n.update,ds)}),s&&c.addEventListener("resize",n.update,ds),function(){i&&u.forEach(function(d){d.removeEventListener("scroll",n.update,ds)}),s&&c.removeEventListener("resize",n.update,ds)}}const bC={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:wC,data:{}};var xC={left:"right",right:"left",bottom:"top",top:"bottom"};function Ls(e){return e.replace(/left|right|bottom|top/g,function(t){return xC[t]})}var SC={start:"end",end:"start"};function Mp(e){return e.replace(/start|end/g,function(t){return SC[t]})}function Sf(e){var t=hn(e),n=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:n,scrollTop:o}}function kf(e){return Pi(ar(e)).left+Sf(e).scrollLeft}function kC(e,t){var n=hn(e),o=ar(e),r=n.visualViewport,i=o.clientWidth,a=o.clientHeight,s=0,c=0;if(r){i=r.width,a=r.height;var u=E1();(u||!u&&t==="fixed")&&(s=r.offsetLeft,c=r.offsetTop)}return{width:i,height:a,x:s+kf(e),y:c}}function CC(e){var t,n=ar(e),o=Sf(e),r=(t=e.ownerDocument)==null?void 0:t.body,i=Ir(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Ir(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-o.scrollLeft+kf(e),c=-o.scrollTop;return go(r||n).direction==="rtl"&&(s+=Ir(n.clientWidth,r?r.clientWidth:0)-i),{width:i,height:a,x:s,y:c}}function Cf(e){var t=go(e),n=t.overflow,o=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+o)}function _1(e){return["html","body","#document"].indexOf(Yn(e))>=0?e.ownerDocument.body:wn(e)&&Cf(e)?e:_1(el(e))}function fa(e,t){var n;t===void 0&&(t=[]);var o=_1(e),r=o===((n=e.ownerDocument)==null?void 0:n.body),i=hn(o),a=r?[i].concat(i.visualViewport||[],Cf(o)?o:[]):o,s=t.concat(a);return r?s:s.concat(fa(el(a)))}function od(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function EC(e,t){var n=Pi(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function $p(e,t,n){return t===k1?od(kC(e,n)):$r(t)?EC(t,n):od(CC(ar(e)))}function jC(e){var t=fa(el(e)),n=["absolute","fixed"].indexOf(go(e).position)>=0,o=n&&wn(e)?Wa(e):e;return $r(o)?t.filter(function(r){return $r(r)&&j1(r,o)&&Yn(r)!=="body"}):[]}function AC(e,t,n,o){var r=t==="clippingParents"?jC(e):[].concat(t),i=[].concat(r,[n]),a=i[0],s=i.reduce(function(c,u){var d=$p(e,u,o);return c.top=Ir(d.top,c.top),c.right=uc(d.right,c.right),c.bottom=uc(d.bottom,c.bottom),c.left=Ir(d.left,c.left),c},$p(e,a,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function T1(e){var t=e.reference,n=e.element,o=e.placement,r=o?Gn(o):null,i=o?_i(o):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,c;switch(r){case Xt:c={x:a,y:t.y-n.height};break;case xn:c={x:a,y:t.y+t.height};break;case Sn:c={x:t.x+t.width,y:s};break;case Qt:c={x:t.x-n.width,y:s};break;default:c={x:t.x,y:t.y}}var u=r?xf(r):null;if(u!=null){var d=u==="y"?"height":"width";switch(i){case Ai:c[u]=c[u]-(t[d]/2-n[d]/2);break;case ja:c[u]=c[u]+(t[d]/2-n[d]/2);break}}return c}function Aa(e,t){t===void 0&&(t={});var n=t,o=n.placement,r=o===void 0?e.placement:o,i=n.strategy,a=i===void 0?e.strategy:i,s=n.boundary,c=s===void 0?Gk:s,u=n.rootBoundary,d=u===void 0?k1:u,f=n.elementContext,h=f===void 0?Ji:f,p=n.altBoundary,m=p===void 0?!1:p,g=n.padding,y=g===void 0?0:g,w=O1(typeof y!="number"?y:P1(y,Ba)),S=h===Ji?qk:Ji,b=e.rects.popper,k=e.elements[m?S:h],x=AC($r(k)?k:k.contextElement||ar(e.elements.popper),c,d,a),C=Pi(e.elements.reference),I=T1({reference:C,element:b,strategy:"absolute",placement:r}),R=od(Object.assign({},b,I)),M=h===Ji?R:C,_={top:x.top-M.top+w.top,bottom:M.bottom-x.bottom+w.bottom,left:x.left-M.left+w.left,right:M.right-x.right+w.right},T=e.modifiersData.offset;if(h===Ji&&T){var P=T[r];Object.keys(_).forEach(function(X){var te=[Sn,xn].indexOf(X)>=0?1:-1,W=[Xt,xn].indexOf(X)>=0?"y":"x";_[X]+=P[W]*te})}return _}function OC(e,t){t===void 0&&(t={});var n=t,o=n.placement,r=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,c=n.allowedAutoPlacements,u=c===void 0?C1:c,d=_i(o),f=d?s?Rp:Rp.filter(function(m){return _i(m)===d}):Ba,h=f.filter(function(m){return u.indexOf(m)>=0});h.length===0&&(h=f);var p=h.reduce(function(m,g){return m[g]=Aa(e,{placement:g,boundary:r,rootBoundary:i,padding:a})[Gn(g)],m},{});return Object.keys(p).sort(function(m,g){return p[m]-p[g]})}function PC(e){if(Gn(e)===yf)return[];var t=Ls(e);return[Mp(e),t,Mp(t)]}function _C(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var r=n.mainAxis,i=r===void 0?!0:r,a=n.altAxis,s=a===void 0?!0:a,c=n.fallbackPlacements,u=n.padding,d=n.boundary,f=n.rootBoundary,h=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,g=n.allowedAutoPlacements,y=t.options.placement,w=Gn(y),S=w===y,b=c||(S||!m?[Ls(y)]:PC(y)),k=[y].concat(b).reduce(function(E,j){return E.concat(Gn(j)===yf?OC(t,{placement:j,boundary:d,rootBoundary:f,padding:u,flipVariations:m,allowedAutoPlacements:g}):j)},[]),x=t.rects.reference,C=t.rects.popper,I=new Map,R=!0,M=k[0],_=0;_<k.length;_++){var T=k[_],P=Gn(T),X=_i(T)===Ai,te=[Xt,xn].indexOf(P)>=0,W=te?"width":"height",J=Aa(t,{placement:T,boundary:d,rootBoundary:f,altBoundary:h,padding:u}),L=te?X?Sn:Qt:X?xn:Xt;x[W]>C[W]&&(L=Ls(L));var G=Ls(L),F=[];if(i&&F.push(J[P]<=0),s&&F.push(J[L]<=0,J[G]<=0),F.every(function(E){return E})){M=T,R=!1;break}I.set(T,F)}if(R)for(var N=m?3:1,$=function(j){var A=k.find(function(O){var q=I.get(O);if(q)return q.slice(0,j).every(function(z){return z})});if(A)return M=A,"break"},H=N;H>0;H--){var B=$(H);if(B==="break")break}t.placement!==M&&(t.modifiersData[o]._skip=!0,t.placement=M,t.reset=!0)}}const TC={name:"flip",enabled:!0,phase:"main",fn:_C,requiresIfExists:["offset"],data:{_skip:!1}};function Hp(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Bp(e){return[Xt,Sn,xn,Qt].some(function(t){return e[t]>=0})}function NC(e){var t=e.state,n=e.name,o=t.rects.reference,r=t.rects.popper,i=t.modifiersData.preventOverflow,a=Aa(t,{elementContext:"reference"}),s=Aa(t,{altBoundary:!0}),c=Hp(a,o),u=Hp(s,r,i),d=Bp(c),f=Bp(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:d,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const IC={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:NC};function RC(e,t,n){var o=Gn(e),r=[Qt,Xt].indexOf(o)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*r,[Qt,Sn].indexOf(o)>=0?{x:s,y:a}:{x:a,y:s}}function LC(e){var t=e.state,n=e.options,o=e.name,r=n.offset,i=r===void 0?[0,0]:r,a=C1.reduce(function(d,f){return d[f]=RC(f,t.rects,i),d},{}),s=a[t.placement],c=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[o]=a}const DC={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:LC};function MC(e){var t=e.state,n=e.name;t.modifiersData[n]=T1({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const $C={name:"popperOffsets",enabled:!0,phase:"read",fn:MC,data:{}};function HC(e){return e==="x"?"y":"x"}function BC(e){var t=e.state,n=e.options,o=e.name,r=n.mainAxis,i=r===void 0?!0:r,a=n.altAxis,s=a===void 0?!1:a,c=n.boundary,u=n.rootBoundary,d=n.altBoundary,f=n.padding,h=n.tether,p=h===void 0?!0:h,m=n.tetherOffset,g=m===void 0?0:m,y=Aa(t,{boundary:c,rootBoundary:u,padding:f,altBoundary:d}),w=Gn(t.placement),S=_i(t.placement),b=!S,k=xf(w),x=HC(k),C=t.modifiersData.popperOffsets,I=t.rects.reference,R=t.rects.popper,M=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,_=typeof M=="number"?{mainAxis:M,altAxis:M}:Object.assign({mainAxis:0,altAxis:0},M),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,P={x:0,y:0};if(C){if(i){var X,te=k==="y"?Xt:Qt,W=k==="y"?xn:Sn,J=k==="y"?"height":"width",L=C[k],G=L+y[te],F=L-y[W],N=p?-R[J]/2:0,$=S===Ai?I[J]:R[J],H=S===Ai?-R[J]:-I[J],B=t.elements.arrow,E=p&&B?bf(B):{width:0,height:0},j=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:A1(),A=j[te],O=j[W],q=da(0,I[J],E[J]),z=b?I[J]/2-N-q-A-_.mainAxis:$-q-A-_.mainAxis,U=b?-I[J]/2+N+q+O+_.mainAxis:H+q+O+_.mainAxis,Q=t.elements.arrow&&Wa(t.elements.arrow),D=Q?k==="y"?Q.clientTop||0:Q.clientLeft||0:0,le=(X=T==null?void 0:T[k])!=null?X:0,ue=L+z-le-D,ve=L+U-le,we=da(p?uc(G,ue):G,L,p?Ir(F,ve):F);C[k]=we,P[k]=we-L}if(s){var Ae,Z=k==="x"?Xt:Qt,oe=k==="x"?xn:Sn,ce=C[x],Se=x==="y"?"height":"width",Oe=ce+y[Z],fe=ce-y[oe],Re=[Xt,Qt].indexOf(w)!==-1,Je=(Ae=T==null?void 0:T[x])!=null?Ae:0,ot=Re?Oe:ce-I[Se]-R[Se]-Je+_.altAxis,Pe=Re?ce+I[Se]+R[Se]-Je-_.altAxis:fe,Ce=p&&Re?uC(ot,ce,Pe):da(p?ot:Oe,ce,p?Pe:fe);C[x]=Ce,P[x]=Ce-ce}t.modifiersData[o]=P}}const WC={name:"preventOverflow",enabled:!0,phase:"main",fn:BC,requiresIfExists:["offset"]};function FC(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function zC(e){return e===hn(e)||!wn(e)?Sf(e):FC(e)}function UC(e){var t=e.getBoundingClientRect(),n=Oi(t.width)/e.offsetWidth||1,o=Oi(t.height)/e.offsetHeight||1;return n!==1||o!==1}function KC(e,t,n){n===void 0&&(n=!1);var o=wn(t),r=wn(t)&&UC(t),i=ar(t),a=Pi(e,r,n),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&((Yn(t)!=="body"||Cf(i))&&(s=zC(t)),wn(t)?(c=Pi(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):i&&(c.x=kf(i))),{x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}function VC(e){var t=new Map,n=new Set,o=[];e.forEach(function(i){t.set(i.name,i)});function r(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var c=t.get(s);c&&r(c)}}),o.push(i)}return e.forEach(function(i){n.has(i.name)||r(i)}),o}function GC(e){var t=VC(e);return rC.reduce(function(n,o){return n.concat(t.filter(function(r){return r.phase===o}))},[])}function qC(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function JC(e){var t=e.reduce(function(n,o){var r=n[o.name];return n[o.name]=r?Object.assign({},r,o,{options:Object.assign({},r.options,o.options),data:Object.assign({},r.data,o.data)}):o,n},{});return Object.keys(t).map(function(n){return t[n]})}var Wp={placement:"bottom",modifiers:[],strategy:"absolute"};function Fp(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(o){return!(o&&typeof o.getBoundingClientRect=="function")})}function ZC(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,o=n===void 0?[]:n,r=t.defaultOptions,i=r===void 0?Wp:r;return function(s,c,u){u===void 0&&(u=i);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},Wp,i),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},f=[],h=!1,p={state:d,setOptions:function(w){var S=typeof w=="function"?w(d.options):w;g(),d.options=Object.assign({},i,d.options,S),d.scrollParents={reference:$r(s)?fa(s):s.contextElement?fa(s.contextElement):[],popper:fa(c)};var b=GC(JC([].concat(o,d.options.modifiers)));return d.orderedModifiers=b.filter(function(k){return k.enabled}),m(),p.update()},forceUpdate:function(){if(!h){var w=d.elements,S=w.reference,b=w.popper;if(Fp(S,b)){d.rects={reference:KC(S,Wa(b),d.options.strategy==="fixed"),popper:bf(b)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(_){return d.modifiersData[_.name]=Object.assign({},_.data)});for(var k=0;k<d.orderedModifiers.length;k++){if(d.reset===!0){d.reset=!1,k=-1;continue}var x=d.orderedModifiers[k],C=x.fn,I=x.options,R=I===void 0?{}:I,M=x.name;typeof C=="function"&&(d=C({state:d,options:R,name:M,instance:p})||d)}}}},update:qC(function(){return new Promise(function(y){p.forceUpdate(),y(d)})}),destroy:function(){g(),h=!0}};if(!Fp(s,c))return p;p.setOptions(u).then(function(y){!h&&u.onFirstUpdate&&u.onFirstUpdate(y)});function m(){d.orderedModifiers.forEach(function(y){var w=y.name,S=y.options,b=S===void 0?{}:S,k=y.effect;if(typeof k=="function"){var x=k({state:d,name:w,instance:p,options:b}),C=function(){};f.push(x||C)}})}function g(){f.forEach(function(y){return y()}),f=[]}return p}}var YC=[bC,$C,yC,sC,DC,TC,WC,pC,IC],XC=ZC({defaultModifiers:YC}),QC=typeof Element<"u",e3=typeof Map=="function",t3=typeof Set=="function",n3=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Ds(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,o,r;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(!Ds(e[o],t[o]))return!1;return!0}var i;if(e3&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(i=e.entries();!(o=i.next()).done;)if(!t.has(o.value[0]))return!1;for(i=e.entries();!(o=i.next()).done;)if(!Ds(o.value[1],t.get(o.value[0])))return!1;return!0}if(t3&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(i=e.entries();!(o=i.next()).done;)if(!t.has(o.value[0]))return!1;return!0}if(n3&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,r[o]))return!1;if(QC&&e instanceof Element)return!1;for(o=n;o--!==0;)if(!((r[o]==="_owner"||r[o]==="__v"||r[o]==="__o")&&e.$$typeof)&&!Ds(e[r[o]],t[r[o]]))return!1;return!0}return e!==e&&t!==t}var o3=function(t,n){try{return Ds(t,n)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}};const r3=Xc(o3);var i3=[],a3=function(t,n,o){o===void 0&&(o={});var r=V.useRef(null),i={onFirstUpdate:o.onFirstUpdate,placement:o.placement||"bottom",strategy:o.strategy||"absolute",modifiers:o.modifiers||i3},a=V.useState({styles:{popper:{position:i.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=a[0],c=a[1],u=V.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(p){var m=p.state,g=Object.keys(m.elements);Bm.flushSync(function(){c({styles:Np(g.map(function(y){return[y,m.styles[y]||{}]})),attributes:Np(g.map(function(y){return[y,m.attributes[y]]}))})})},requires:["computeStyles"]}},[]),d=V.useMemo(function(){var h={onFirstUpdate:i.onFirstUpdate,placement:i.placement,strategy:i.strategy,modifiers:[].concat(i.modifiers,[u,{name:"applyStyles",enabled:!1}])};return r3(r.current,h)?r.current||h:(r.current=h,h)},[i.onFirstUpdate,i.placement,i.strategy,i.modifiers,u]),f=V.useRef();return Ip(function(){f.current&&f.current.setOptions(d)},[d]),Ip(function(){if(!(t==null||n==null)){var h=o.createPopper||XC,p=h(t,n,d);return f.current=p,function(){p.destroy(),f.current=null}}},[t,n,o.createPopper]),{state:f.current?f.current.state:null,styles:s.styles,attributes:s.attributes,update:f.current?f.current.update:null,forceUpdate:f.current?f.current.forceUpdate:null}},s3=["className","cssModule","size","vertical","tag"];function rd(){return rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},rd.apply(this,arguments)}function zp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function c3(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zp(Object(n),!0).forEach(function(o){l3(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zp(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function l3(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u3(e,t){if(e==null)return{};var n=d3(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function d3(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}var f3={"aria-label":ie.string,className:ie.string,cssModule:ie.object,role:ie.string,size:ie.string,tag:vf,vertical:ie.bool};function N1(e){var t=e.className,n=e.cssModule,o=e.size,r=e.vertical,i=e.tag,a=i===void 0?"div":i,s=u3(e,s3),c=Qc(pt(t,o?"btn-group-"+o:!1,r?"btn-group-vertical":"btn-group"),n);return v.createElement(a,rd({},c3({role:"group"},s),{className:c}))}N1.propTypes=f3;function h3(e,t){if(e==null)return{};var n={};for(var o in e)if({}.hasOwnProperty.call(e,o)){if(t.indexOf(o)!==-1)continue;n[o]=e[o]}return n}function id(e,t){return id=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},id(e,t)}function p3(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,id(e,t)}const Up={disabled:!1};var m3=process.env.NODE_ENV!=="production"?ie.oneOfType([ie.number,ie.shape({enter:ie.number,exit:ie.number,appear:ie.number}).isRequired]):null;process.env.NODE_ENV!=="production"&&ie.oneOfType([ie.string,ie.shape({enter:ie.string,exit:ie.string,active:ie.string}),ie.shape({enter:ie.string,enterDone:ie.string,enterActive:ie.string,exit:ie.string,exitDone:ie.string,exitActive:ie.string})]);const I1=v.createContext(null);var g3=function(t){return t.scrollTop},aa="unmounted",br="exited",xr="entering",ti="entered",ad="exiting",wo=function(e){p3(t,e);function t(o,r){var i;i=e.call(this,o,r)||this;var a=r,s=a&&!a.isMounting?o.enter:o.appear,c;return i.appearStatus=null,o.in?s?(c=br,i.appearStatus=xr):c=ti:o.unmountOnExit||o.mountOnEnter?c=aa:c=br,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(r,i){var a=r.in;return a&&i.status===aa?{status:br}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(r){var i=null;if(r!==this.props){var a=this.state.status;this.props.in?a!==xr&&a!==ti&&(i=xr):(a===xr||a===ti)&&(i=ad)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var r=this.props.timeout,i,a,s;return i=a=s=r,r!=null&&typeof r!="number"&&(i=r.exit,a=r.enter,s=r.appear!==void 0?r.appear:a),{exit:i,enter:a,appear:s}},n.updateStatus=function(r,i){if(r===void 0&&(r=!1),i!==null)if(this.cancelNextCallback(),i===xr){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:$o.findDOMNode(this);a&&g3(a)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===br&&this.setState({status:aa})},n.performEnter=function(r){var i=this,a=this.props.enter,s=this.context?this.context.isMounting:r,c=this.props.nodeRef?[s]:[$o.findDOMNode(this),s],u=c[0],d=c[1],f=this.getTimeouts(),h=s?f.appear:f.enter;if(!r&&!a||Up.disabled){this.safeSetState({status:ti},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:xr},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:ti},function(){i.props.onEntered(u,d)})})})},n.performExit=function(){var r=this,i=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:$o.findDOMNode(this);if(!i||Up.disabled){this.safeSetState({status:br},function(){r.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:ad},function(){r.props.onExiting(s),r.onTransitionEnd(a.exit,function(){r.safeSetState({status:br},function(){r.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(r,i){i=this.setNextCallback(i),this.setState(r,i)},n.setNextCallback=function(r){var i=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,i.nextCallback=null,r(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(r,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:$o.findDOMNode(this),s=r==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=c[0],d=c[1];this.props.addEndListener(u,d)}r!=null&&setTimeout(this.nextCallback,r)},n.render=function(){var r=this.state.status;if(r===aa)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 s=h3(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return v.createElement(I1.Provider,{value:null},typeof a=="function"?a(r,s):v.cloneElement(v.Children.only(a),s))},t}(v.Component);wo.contextType=I1;wo.propTypes=process.env.NODE_ENV!=="production"?{nodeRef:ie.shape({current:typeof Element>"u"?ie.any:function(e,t,n,o,r,i){var a=e[t];return ie.instanceOf(a&&"ownerDocument"in a?a.ownerDocument.defaultView.Element:Element)(e,t,n,o,r,i)}}),children:ie.oneOfType([ie.func.isRequired,ie.element.isRequired]).isRequired,in:ie.bool,mountOnEnter:ie.bool,unmountOnExit:ie.bool,appear:ie.bool,enter:ie.bool,exit:ie.bool,timeout:function(t){var n=m3;t.addEndListener||(n=n.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 n.apply(void 0,[t].concat(r))},addEndListener:ie.func,onEnter:ie.func,onEntering:ie.func,onEntered:ie.func,onExit:ie.func,onExiting:ie.func,onExited:ie.func}:{};function Gr(){}wo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Gr,onEntering:Gr,onEntered:Gr,onExit:Gr,onExiting:Gr,onExited:Gr};wo.UNMOUNTED=aa;wo.EXITED=br;wo.ENTERING=xr;wo.ENTERED=ti;wo.EXITING=ad;const Ef=wo;function sd(e){"@babel/helpers - typeof";return sd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sd(e)}var v3=["tag","horizontal","isOpen","className","navbar","cssModule","children","innerRef"],qr;function dc(){return dc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},dc.apply(this,arguments)}function y3(e,t){if(e==null)return{};var n=w3(e,t),o,r;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)o=i[r],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function w3(e,t){if(e==null)return{};var n={},o=Object.keys(e),r,i;for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&(n[r]=e[r]);return n}function b3(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Kp(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function x3(e,t,n){return t&&Kp(e.prototype,t),n&&Kp(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function S3(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cd(e,t)}function cd(e,t){return cd=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,r){return o.__proto__=r,o},cd(e,t)}function k3(e){var t=E3();return function(){var o=fc(e),r;if(t){var i=fc(this).constructor;r=Reflect.construct(o,arguments,i)}else r=o.apply(this,arguments);return C3(this,r)}}function C3(e,t){if(t&&(sd(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return R1(e)}function R1(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E3(){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 fc(e){return fc=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},fc(e)}function Vp(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function Ti(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Vp(Object(n),!0).forEach(function(o){li(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vp(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function li(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j3=Ti(Ti({},Ef.propTypes),{},{horizontal:ie.bool,isOpen:ie.bool,children:ie.oneOfType([ie.arrayOf(ie.node),ie.node]),tag:vf,className:ie.node,navbar:ie.bool,cssModule:ie.object,innerRef:ie.shape({current:ie.object})}),A3=Ti(Ti({},Ef.defaultProps),{},{horizontal:!1,isOpen:!1,appear:!1,enter:!0,exit:!0,tag:"div",timeout:Dk.Collapse}),O3=(qr={},li(qr,us.ENTERING,"collapsing"),li(qr,us.ENTERED,"collapse show"),li(qr,us.EXITING,"collapsing"),li(qr,us.EXITED,"collapse"),qr);function P3(e){return O3[e]||"collapse"}var jf=function(e){S3(n,e);var t=k3(n);function n(o){var r;return b3(this,n),r=t.call(this,o),r.state={dimension:null},r.nodeRef=o.innerRef||v.createRef(),["onEntering","onEntered","onExit","onExiting","onExited"].forEach(function(i){r[i]=r[i].bind(R1(r))}),r}return x3(n,[{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,s=i.horizontal,c=i.isOpen,u=i.className,d=i.navbar,f=i.cssModule,h=i.children;i.innerRef;var p=y3(i,v3),m=this.state.dimension,g=Ik(p,_p),y=Nk(p,_p);return v.createElement(Ef,dc({},g,{in:c,nodeRef:this.nodeRef,onEntering:this.onEntering,onEntered:this.onEntered,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}),function(w){var S=P3(w),b=Qc(pt(u,s&&"collapse-horizontal",S,d&&"navbar-collapse"),f),k=m===null?null:li({},s?"width":"height",m);return v.createElement(a,dc({},y,{style:Ti(Ti({},y.style),k),className:b,ref:r.nodeRef}),h)})}}]),n}(v.Component);jf.propTypes=j3;jf.defaultProps=A3;const L1=jf,_3=e=>{const{className:t,isOpen:n,getIcon:o,showCollapseIcon:r,showFolderIcon:i,title:a,...s}=e;return l.jsx(gt.ItemHeader,{className:pt("io-base-section-header",t),prepend:i&&(o?l.jsx(Dd,{size:"16",src:o(n),alt:`${a} icon`,"data-testid":`base-section-header-${a}-folder-custom-icon`}):l.jsx(xt,{size:"16",variant:n?"folder-open":"folder","data-testid":`base-section-header-${a}-folder-default-icon`})),append:r&&l.jsx(Ue,{className:pt("collapse-icon",!n&&"collapsed"),iconSize:"10",size:"16",icon:"expand","data-testid":"base-section-header-collapse-icon"}),tooltip:a,...s,children:a})},D1=()=>{const[e,t]=v.useState([]),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=c=>{const{name:u,title:d,caption:f,icon:h,userProperties:p}=c;return{id:u,name:u,title:d??u,caption:f,icon:h,userProperties:p}},r=n.appManager.onAppAdded(c=>{if(c.userProperties.hidden||"hidden"in c&&c.hidden)return;const u=o(c);t(d=>[...d,u])}),i=n.appManager.onAppChanged(c=>{if(c.userProperties.hidden||"hidden"in c&&c.hidden)return;const u=o(c);t(d=>[...d.filter(f=>f.id!==u.id),u])}),a=n.appManager.onAppRemoved(c=>{const u=o(c);t(d=>d.filter(f=>f.id!==u.id))}),s=[r,a,i];return()=>s.forEach(c=>c())},[n]),e},T3=()=>{const[e,t]=v.useState({}),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=n.appManager.onInstanceStarted(a=>{t(s=>{const c=s[a.application.name]??[];return{...s,[a.application.name]:[...c,a.id]}})}),r=n.appManager.onInstanceStopped(a=>{t(s=>{const c=s[a.application.name];return c?{...s,[a.application.name]:c.filter(u=>u!==a.id)}:s})}),i=[o,r];return()=>i.forEach(a=>a())},[n]),e},N3=e=>{v.useEffect(()=>{var n;if(!((n=window.iobrowser)!=null&&n.platformStarted)||e)return;const t=o=>{o.preventDefault(),o.returnValue=!0};return window.addEventListener("beforeunload",t),()=>window.removeEventListener("beforeunload",t)},[e])},Af=()=>{const[e,t]=v.useState(),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{var o;try{const i=!((o=n.windows.my())!=null&&o.name)?xi.getFrameId():void 0;t(i)}catch(r){console.error("Failed to get the current frame ID ",{error:r})}},[n,xi.getFrameId,t]),e},Be={SUCCESS:"success",WARNING:"warning"},I3={success:5*1e3,warning:10*1e3},Fe=async e=>{const{io:t,variant:n,text:o,error:r}=e,i=Zu(r);try{if(n===Be.WARNING&&t.logger.warn(i?`${o} ${i}`:o),!("modals"in t&&t.modals))throw new Error("Modals are not enabled.");const a={text:o,variant:n,ttl:I3[n]};await t.modals.alerts.request(a)}catch(a){t.logger.warn(`Failed to request alert. ${Zu(a)}`)}},R3=async e=>{var o;const{io:t,item:n}=e;try{await((o=t.appManager.application(n.id))==null?void 0:o.start())}catch(r){await Fe({io:t,variant:Be.WARNING,text:`Failed to start app "${n.title}" in a new window.`,error:r})}},L3=async e=>{const{io:t,item:n,frameId:o}=e;if(!t.workspaces)return;const r={type:"workspace",definition:{frame:o?{reuseFrameId:o}:{newFrame:!0}}},i=t.workspaces.getBuilder(r);i.addGroup().addWindow({appName:n.id});try{await i.create()}catch(a){await Fe({io:t,variant:Be.WARNING,text:`Failed to start app "${n.title}" in a new Workspace.`,error:a})}},D3={[ac.OPEN_IN_NEW_WINDOW]:R3,[ac.OPEN_IN_NEW_WORKSPACE]:L3},M1=()=>{const e=v.useContext(Te.IOConnectContext),t=Af();return(n,o)=>{D3[o]({io:e,item:n,frameId:t})}},Bi={NO_INPUTS_CONFIRMATION_DIALOG:"noInputsConfirmationDialog",SINGLE_CHECKBOX_DIALOG:"singleCheckboxDialog",SINGLE_TEXT_INPUT_DIALOG:"singleTextInputDialog"},Of="(.|\\s)*\\S(.|\\s)*",M3=async e=>{var i;const{io:t,layout:n,showDeletePromptPref:o,updateShowDeletePromptPref:r}=e;if("modals"in t&&t.modals&&o){const a="delete",s="do-not-ask-again",{isEnterPressed:c,responseButtonClicked:u,inputs:d}=await t.modals.dialogs.request({templateName:Bi.SINGLE_CHECKBOX_DIALOG,variables:{heading:`Delete Layout "${n.name}"`,text:"Are you sure you want to delete this Layout?",checkbox:{id:s,label:"Don't ask me again"},actionButtons:[{variant:"critical",text:"Delete",id:a},{variant:"outline",text:"Cancel",id:"cancel",autofocus:!0}]}});if(((i=d==null?void 0:d.find(p=>p.id===s))==null?void 0:i.checked)&&r(!1),!(c||(u==null?void 0:u.id)===a))return}try{await t.layouts.remove("Global",n.name),n.isDefault&&await t.layouts.clearDefaultGlobal(),await Fe({io:t,variant:Be.SUCCESS,text:`Layout "${n.name}" was successfully deleted.`})}catch(a){await Fe({io:t,variant:Be.WARNING,text:`Failed to delete Layout "${n.name}".`,error:a})}},$3=async e=>{var f;const{io:t,layout:n,setDefaultLayout:o}=e;if(!("modals"in t&&t.modals)){console.error("Cannot rename Layout because io dialogs are not enabled");return}const r="rename",i="new-layout-name",{isEnterPressed:a,responseButtonClicked:s,inputs:c}=await t.modals.dialogs.request({templateName:Bi.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Rename "${n.name}"`,input:{id:i,initialValue:n.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Of}},actionButtons:[{variant:"primary",text:"Rename",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(f=c==null?void 0:c.find(h=>h.id===i))==null?void 0:f.value;if(a||(s==null?void 0:s.id)===r){if(u===n.name){await Fe({io:t,variant:Be.WARNING,text:`Failed to rename Layout "${n.name}". The new Layout name must be different from the current one.`});return}try{if((await t.layouts.getAll("Global")).find(m=>m.name===u)){await Fe({io:t,variant:Be.WARNING,text:`Failed to rename Layout "${n.name}" to "${u}". A Layout with name "${u}" already exists.`});return}const p=await t.layouts.get(n.name,"Global");if(!p){await Fe({io:t,variant:Be.WARNING,text:`Failed to rename Layout "${n.name}". The Layout wasn't found.`});return}await t.layouts.rename(p,u),n.isDefault&&await o({name:u}),await Fe({io:t,variant:Be.SUCCESS,text:`Layout "${n.name}" was successfully renamed to "${u}".`})}catch(h){await Fe({io:t,variant:Be.WARNING,text:`Failed to rename Layout "${n.name}".`,error:h})}}},H3=async e=>{const{io:t,layout:n}=e;try{await t.layouts.save({name:n.name,type:"Global"}),await Fe({io:t,variant:Be.SUCCESS,text:`Layout "${n.name}" was saved successfully.`})}catch(o){await Fe({io:t,variant:Be.WARNING,text:`Failed to save Layout "${n.name}".`,error:o})}},B3=async e=>{var f;const{io:t,layout:n,setActiveLayout:o}=e;if(!("modals"in t&&t.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:s,inputs:c}=await t.modals.dialogs.request({templateName:Bi.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:`Save Layout "${n.name}" as`,input:{id:i,initialValue:n.name,validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Of}},actionButtons:[{variant:"primary",text:"Save as",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(f=c==null?void 0:c.find(h=>h.id===i))==null?void 0:f.value;if(a||(s==null?void 0:s.id)===r){if(u===n.name){await Fe({io:t,variant:Be.WARNING,text:`Failed to save Layout as "${u}". The new Layout must have a unique name.`});return}try{if((await t.layouts.getAll("Global")).find(m=>m.name===u)){await Fe({io:t,variant:Be.WARNING,text:`Failed to save Layout as "${u}". A Layout with this name already exists.`});return}const p=await t.layouts.get(n.name,"Global");if(!p){await Fe({io:t,variant:Be.WARNING,text:`Failed to save Layout "${n.name}". The Layout wasn't found.`});return}await t.layouts.import([{...p,name:u}],"merge"),n.isActive&&o({name:u}),await Fe({io:t,variant:Be.SUCCESS,text:`The Layout was successfully saved as "${u}".`})}catch(h){await Fe({io:t,variant:Be.WARNING,text:`Failed to save Layout "${u}".`,error:h})}}},W3=async e=>{const{io:t,layout:n,setDefaultLayout:o}=e;try{await o({name:n.name}),await Fe({io:t,variant:Be.SUCCESS,text:`Layout "${n.name}" was successfully set as the default Layout.`})}catch{await Fe({io:t,variant:Be.WARNING,text:`Failed to set Layout "${n.name}" as the default Layout.`})}},F3=async e=>{const{io:t,layout:n,closeLaunchpad:o}=e;try{await t.layouts.restore({name:n.name}),o(),await Fe({io:t,variant:Be.SUCCESS,text:`Layout "${n.name}" was loaded successfully.`})}catch(r){await Fe({io:t,variant:Be.WARNING,text:`Failed to load Layout "${n.name}".`,error:r})}},z3={delete:M3,rename:$3,save:H3,saveAs:B3,setAsDefault:W3,load:F3},U3="interopio_home_ui_auth0_validation_error",K3="interopio_home_ui_user",V3="interopio_home_ui_platform_window",Fa="interopio_home_ui_platform_setup",$1="interopio_home_ui_active_layout";var Et=function(e){return{ok:!0,result:e}},wt=function(e){return{ok:!1,error:e}},G3=function(e){return e.ok===!0?Promise.resolve(e.result):Promise.reject(e.error)},q3=function(e,t){return t.ok===!0?t.result:e},J3=function(e){if(e.ok===!0)return e.result;throw e.error},Z3=function(e,t){return t.ok===!0?Et(e(t.result)):t},Gp=function(e,t,n){return t.ok===!1?t:n.ok===!1?n:Et(e(t.result,n.result))},Kl=function(e,t){return t.ok===!0?t:wt(e(t.error))},Y3=function(e,t){return t.ok===!0?e(t.result):t};/*! *****************************************************************************
|
|
40
40
|
Copyright (c) Microsoft Corporation.
|
|
41
41
|
|
|
42
42
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -49,17 +49,17 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
49
49
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
50
50
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
51
51
|
PERFORMANCE OF THIS SOFTWARE.
|
|
52
|
-
***************************************************************************** */var $u=function(){return $u=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},$u.apply(this,arguments)};function d3(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function Hu(e,t){if(e===t||e===null&&t===null)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="object"){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!Hu(e[n],t[n]))return!1;return!0}var o=Object.keys(e);if(o.length!==Object.keys(t).length)return!1;for(var n=0;n<o.length;n++)if(!t.hasOwnProperty(o[n])||!Hu(e[o[n]],t[o[n]]))return!1;return!0}}var Ki=function(e){return Array.isArray(e)},qa=function(e){return typeof e=="object"&&e!==null&&!Ki(e)},f3=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)}},Qn=function(e,t){return"expected "+e+", got "+f3(t)},Ti=function(e){return e.map(function(t){return typeof t=="string"?"."+t:"["+t+"]"}).join("")},Ri=function(e,t){var n=t.at,o=d3(t,["at"]);return $u({at:e+(n||"")},o)},Et=function(){function e(t){var n=this;this.decode=t,this.run=function(o){return Sl(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},n.decode(o))},this.runPromise=function(o){return a3(n.run(o))},this.runWithException=function(o){return c3(n.run(o))},this.map=function(o){return new e(function(r){return l3(o,n.decode(r))})},this.andThen=function(o){return new e(function(r){return u3(function(i){return o(i).decode(r)},n.decode(r))})},this.where=function(o,r){return n.andThen(function(i){return o(i)?e.succeed(i):e.fail(r)})}}return e.string=function(){return new e(function(t){return typeof t=="string"?_t(t):wt({message:Qn("a string",t)})})},e.number=function(){return new e(function(t){return typeof t=="number"?_t(t):wt({message:Qn("a number",t)})})},e.boolean=function(){return new e(function(t){return typeof t=="boolean"?_t(t):wt({message:Qn("a boolean",t)})})},e.constant=function(t){return new e(function(n){return Hu(n,t)?_t(t):wt({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(n)})})},e.object=function(t){return new e(function(n){if(qa(n)&&t){var o={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r].decode(n[r]);if(i.ok===!0)i.result!==void 0&&(o[r]=i.result);else return n[r]===void 0?wt({message:"the key '"+r+"' is required but was not present"}):wt(Ri("."+r,i.error))}return _t(o)}else return qa(n)?_t(n):wt({message:Qn("an object",n)})})},e.array=function(t){return new e(function(n){if(Ki(n)&&t){var o=function(r,i){return Sl(function(a){return Ri("["+i+"]",a)},t.decode(r))};return n.reduce(function(r,i,a){return vp(function(s,c){return s.concat([c])},r,o(i,a))},_t([]))}else return Ki(n)?_t(n):wt({message:Qn("an array",n)})})},e.tuple=function(t){return new e(function(n){if(Ki(n)){if(n.length!==t.length)return wt({message:"expected a tuple of length "+t.length+", got one of length "+n.length});for(var o=[],r=0;r<t.length;r++){var i=t[r].decode(n[r]);if(i.ok)o[r]=i.result;else return wt(Ri("["+r+"]",i.error))}return _t(o)}else return wt({message:Qn("a tuple of length "+t.length,n)})})},e.union=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return e.oneOf.apply(e,[t,n].concat(o))},e.intersection=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new e(function(i){return[t,n].concat(o).reduce(function(a,s){return vp(Object.assign,a,s.decode(i))},_t({}))})},e.anyJson=function(){return new e(function(t){return _t(t)})},e.unknownJson=function(){return new e(function(t){return _t(t)})},e.dict=function(t){return new e(function(n){if(qa(n)){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=t.decode(n[r]);if(i.ok===!0)o[r]=i.result;else return wt(Ri("."+r,i.error))}return _t(o)}else return wt({message:Qn("an object",n)})})},e.optional=function(t){return new e(function(n){return n==null?_t(void 0):t.decode(n)})},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(function(o){for(var r=[],i=0;i<t.length;i++){var a=t[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var s=r.map(function(c){return"at error"+(c.at||"")+": "+c.message}).join('", "');return wt({message:'expected a value matching one of the decoders, got the errors ["'+s+'"]'})})},e.withDefault=function(t,n){return new e(function(o){return _t(s3(t,n.decode(o)))})},e.valueAt=function(t,n){return new e(function(o){for(var r=o,i=0;i<t.length;i++){if(r===void 0)return wt({at:Ti(t.slice(0,i+1)),message:"path does not exist"});if(typeof t[i]=="string"&&!qa(r))return wt({at:Ti(t.slice(0,i+1)),message:Qn("an object",r)});if(typeof t[i]=="number"&&!Ki(r))return wt({at:Ti(t.slice(0,i+1)),message:Qn("an array",r)});r=r[t[i]]}return Sl(function(a){return r===void 0?{at:Ti(t),message:"path does not exist"}:Ri(Ti(t),a)},n.decode(r))})},e.succeed=function(t){return new e(function(n){return _t(t)})},e.fail=function(t){return new e(function(n){return wt({message:t})})},e.lazy=function(t){return new e(function(n){return t().decode(n)})},e}(),h3=Et.string,p3=Et.number,vi=Et.boolean,Ft=Et.anyJson;Et.unknownJson;var Uo=Et.constant,lt=Et.object,m3=Et.array;Et.tuple;Et.dict;var Re=Et.optional,fa=Et.oneOf;Et.union;Et.intersection;Et.withDefault;Et.valueAt;Et.succeed;var g3=Et.fail;Et.lazy;const Gt=h3().where(e=>e.length>0,"Expected a non-empty string"),v3=p3().where(e=>e>=0,"Expected a non-negative number");vi();const un=(e,t)=>{const n=typeof e;return n==="function"?Ft():g3(`The provided argument as ${t} should be of type function, provided: ${typeof n}`)},r1=lt({name:Gt}),y3="Welcome",w3=e=>e.components.reduce((n,o)=>{if(o.type==="workspaceFrame"){const r=o.state.workspaces.map(i=>i.config.name);n.push(...r)}return n},[]),i1=e=>e.trim().length>0,b3=(e,t)=>{const[n,o]=v.useState(void 0),[r,i]=Gn("sessionStorage",o1,r1),a=v.useRef(!1),s=sf(),c=cf(),l=v.useContext(Ie.IOConnectContext),d=v.useCallback(async({name:f})=>{try{await l.layouts.setDefaultGlobal(f)}catch(h){console.error("Failed to set default Layout: ",{error:h})}},[l]);return v.useEffect(()=>{if(l)return l.layouts.onDefaultGlobalChanged(f=>{o(f)})},[l]),v.useEffect(()=>{if(l)return l.layouts.onRestored(f=>{i({name:f.name})})},[l]),v.useEffect(()=>{if(l)return l.layouts.onRemoved(f=>{(f==null?void 0:f.name)===(r==null?void 0:r.name)&&i(null)})},[l,r]),v.useEffect(()=>{if(l)return l.layouts.onRenamed((f,h)=>{(h==null?void 0:h.name)===(r==null?void 0:r.name)&&i({name:f.name})})},[l,r]),v.useEffect(()=>{var h;if(!l||!((h=window.iobrowser)!=null&&h.platformStarted)||a.current)return;(async()=>{var w;a.current=!0;const p=await l.layouts.getDefaultGlobal()??(await l.layouts.getAll("Global")).find(k=>k.name===y3);if(!p||(o({name:p.name}),r))return;if(e(!0),t){await s(p.name),e(!1);return}const m=await((w=l.workspaces)==null?void 0:w.getWorkspace(k=>k.children.length===0)),g=await l.layouts.get(p.name,"Global");if(!g)throw new Error("Default Global Layout not found.");const y=w3(g);Promise.all(y.map((k,b)=>c({id:k,reuseWorkspaceId:b===0?m==null?void 0:m.id:void 0}))),e(!1)})().catch(p=>console.error("Initial Global Layout setup failed. ",Eu(p)))},[l,r,s,c,t]),{defaultLayout:n,activeLayout:r,setDefaultLayout:d,setActiveLayout:i}},a1=v.createContext(void 0),Tn=()=>{const e=v.useContext(a1);if(e===void 0)throw new Error("useLaunchpadAPI must be used within a LaunchpadAPIProvider");return e},x3=({children:e,close:t,isOpen:n,isGlobalLayoutsAvailable:o})=>{const[r,i]=v.useState(!1),{defaultLayout:a,activeLayout:s,setDefaultLayout:c,setActiveLayout:l}=b3(i,o),d=v.useMemo(()=>({close:t,isOpen:n,defaultLayout:a,activeLayout:s,setDefaultLayout:c,setActiveLayout:l,isLayoutOperationBlocked:r,setIsLayoutOperationBlocked:i,isGlobalLayoutsAvailable:o}),[t,n,a,s,c,l,r,o]);return u.jsx(a1.Provider,{value:d,children:e})},Pr={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",HIDE_FAVORITES_SECTION:"_launchpad_hideFavoritesSection",LAYOUTS_SHOW_DELETE_PROMPT:"_layouts_showDeletePrompt"},Nr=()=>{const{value:e,update:t,isLoading:n,error:o}=Tt({prefKey:Pr.IS_LAUNCHPAD_PINNED}),r=v.useCallback(()=>t(i=>!i),[t]);return{error:o,isLaunchpadPinned:e,isLoading:n,toggle:r}},s1=()=>{const e=v.useContext(Ie.IOConnectContext),{setActiveLayout:t,setDefaultLayout:n,close:o}=Tn(),{isLaunchpadPinned:r}=Nr(),{value:i,update:a}=Tt({prefKey:Pr.LAYOUTS_SHOW_DELETE_PROMPT}),s=()=>{r||o==null||o()};return v.useCallback(async l=>{const{layout:d,actionName:f}=l;return await n3[f]({io:e,layout:d,setActiveLayout:t,setDefaultLayout:n,closeLaunchpad:s,showDeletePromptPref:i,updateShowDeletePromptPref:a})},[e,n,t,o,i,a])},Ei=()=>{const{isLayoutOperationBlocked:e,setIsLayoutOperationBlocked:t}=Tn();return async n=>{if(!e){t(!0);try{await n()}catch(o){console.error("Layout operation failed: ",{error:o})}t(!1)}}},c1={CREATE_WORKSPACE:"createWorkspace"},S3=async e=>{const{io:t,item:n}=e;if(t.workspaces)try{await t.workspaces.restoreWorkspace(n.id,{newFrame:!0})}catch(o){await Be({io:t,variant:Fe.WARNING,text:`Failed to load Workspace "${n.title}".`,error:o})}},k3=async e=>{const{io:t,item:n,removeFavorite:o}=e;if(t.workspaces){if("modals"in t&&t.modals){const r="delete",{isEnterPressed:i,responseButtonClicked:a}=await t.modals.dialogs.request({templateName:Ci.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:`Delete "${n.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 t.workspaces.layouts.delete(n.id),await o(n),await Be({io:t,variant:Fe.SUCCESS,text:`"Workspace ${n.title}" was successfully deleted.`})}catch(r){await Be({io:t,variant:Fe.WARNING,text:`Failed to delete Workspace "${n.title}".`,error:r})}}},C3=async e=>{const{io:t}=e;if(t.workspaces)try{await t.workspaces.createWorkspace({children:[],frame:{newFrame:!0}})}catch(n){await Be({io:t,variant:Fe.WARNING,text:"Failed to create a new Workspace.",error:n})}},E3={[$s.OPEN_IN_NEW_WINDOW]:S3,[$s.DELETE]:k3,[c1.CREATE_WORKSPACE]:C3};class l1{constructor(){bn(this,"queue",[]);bn(this,"isExecutingQueue",!1)}enqueue(t){return new Promise((n,o)=>{this.queue.push({action:t,resolve:n,reject:o}),this.executeQueue()})}async executeQueue(){if(!this.isExecutingQueue){for(this.isExecutingQueue=!0;this.queue.length;){const t=this.queue.shift();if(!t){this.isExecutingQueue=!1;return}try{const n=await t.action();t.resolve(n)}catch(n){t.reject(n)}await this.intervalBreak()}this.isExecutingQueue=!1}}intervalBreak(){return new Promise(t=>setTimeout(t,0))}}const u1=()=>{const[e,t]=v.useState([]),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!(n!=null&&n.workspaces))return;let o=!1;const r=n.workspaces.layouts.onSaved(({name:s})=>{o||e.some(({id:c})=>c===s)||t(c=>[...c,{id:s,title:s}])}),i=n.workspaces.layouts.onRemoved(({name:s})=>{o||t(c=>c.filter(({id:l})=>l!==s))}),a=n.layouts.onRenamed((s,c)=>{if(o||s.type!=="Workspace")return;const{name:l}=s;t(d=>{const f=d.findIndex(h=>h.id===(c==null?void 0:c.name));return f===-1?d:[...d.slice(0,f),{id:l,title:l},...d.slice(f+1)]})});return()=>{o=!0,a(),[r,i].forEach(async s=>{try{(await s)()}catch(c){console.error(c)}})}},[n,e]),e},yp=new l1,Lc=()=>{const{value:e,update:t,isLoading:n}=Tt({prefKey:Pr.FAVORITES}),o=t1(),r=u1(),i=v.useMemo(()=>(e??[]).filter(c=>c.type===Rt.APPLICATION?o.some(l=>l.id===c.id):c.type===Rt.WORKSPACE?r.some(l=>l.id===c.id):!0),[e,o,r]),a=v.useCallback(({openInstances:c,...l})=>yp.enqueue(()=>t((d=[])=>{const f=d.find(h=>h.id===l.id&&h.type&&l.type);return f?d.filter(h=>h!==f):[l,...d]})),[t]),s=v.useCallback(c=>yp.enqueue(()=>t((l=[])=>l.filter(d=>!(d.id===c.id&&d.type===c.type)))),[t]);return{favorites:i,toggleFavorite:a,removeFavorite:s,isLoading:n}},d1=()=>{const e=v.useContext(Ie.IOConnectContext),{removeFavorite:t}=Lc();return(n,o)=>{E3[o]({io:e,item:n,removeFavorite:t})}},A3=()=>{const e=v.useContext(Ie.IOConnectContext);return async t=>e.interop.methods().every(n=>n.name!==(t==null?void 0:t.method))?console.error("Interop method not found."):await e.interop.invoke(t.method,t.params,t.target).catch(n=>console.error({error:n}))},_3=()=>{const{value:e,update:t,isLoading:n,error:o}=Tt({prefKey:Pr.HIDE_FAVORITES_SECTION}),r=v.useCallback(()=>t(i=>!i),[t]);return{error:o,isFavoritesSectionHidden:e,isLoading:n,toggle:r}},j3=()=>{const[e,t]=v.useState(!1),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!n)return;let o;return(async()=>{var r;try{o=await((r=n.workspaces)==null?void 0:r.onWorkspaceOpened(()=>t(!0)))}catch(i){console.error(i)}})(),()=>o==null?void 0:o()},[n]),e},tf=()=>{const{value:e,update:t,isLoading:n,error:o}=Tt({prefKey:Pr.IS_LAUNCHPAD_COLLAPSED});return{error:o,isLaunchpadCollapsed:e,setIsLaunchpadCollapsed:t,isLoading:n}};var Wu={exports:{}};(function(e,t){(function(n,o){var r="1.0.41",i="",a="?",s="function",c="undefined",l="object",d="string",f="major",h="model",p="name",m="type",g="vendor",y="version",w="architecture",k="console",b="mobile",S="tablet",x="smarttv",C="wearable",T="embedded",L=500,M="Amazon",j="Apple",N="ASUS",O="BlackBerry",Y="Browser",z="Chrome",R="Edge",$="Firefox",H="Google",K="Honor",B="Huawei",D="Lenovo",V="LG",G="Microsoft",Z="Motorola",I="Nvidia",E="OnePlus",A="Opera",_="OPPO",W="Samsung",F="Sharp",X="Sony",q="Xiaomi",P="Zebra",ce="Facebook",le="Chromium OS",ve="Mac OS",be=" Browser",ke=function(he,ge){var ie={};for(var ye in he)ge[ye]&&ge[ye].length%2===0?ie[ye]=ge[ye].concat(he[ye]):ie[ye]=he[ye];return ie},te=function(he){for(var ge={},ie=0;ie<he.length;ie++)ge[he[ie].toUpperCase()]=he[ie];return ge},ne=function(he,ge){return typeof he===d?Q(ge).indexOf(Q(he))!==-1:!1},Q=function(he){return he.toLowerCase()},xe=function(he){return typeof he===d?he.replace(/[^\d\.]/g,i).split(".")[0]:o},Pe=function(he,ge){if(typeof he===d)return he=he.replace(/^\s\s*/,i),typeof ge===c?he:he.substring(0,L)},ue=function(he,ge){for(var ie=0,ye,$e,we,ae,ee,se;ie<ge.length&&!ee;){var me=ge[ie],Te=ge[ie+1];for(ye=$e=0;ye<me.length&&!ee&&me[ye];)if(ee=me[ye++].exec(he),ee)for(we=0;we<Te.length;we++)se=ee[++$e],ae=Te[we],typeof ae===l&&ae.length>0?ae.length===2?typeof ae[1]==s?this[ae[0]]=ae[1].call(this,se):this[ae[0]]=ae[1]:ae.length===3?typeof ae[1]===s&&!(ae[1].exec&&ae[1].test)?this[ae[0]]=se?ae[1].call(this,se,ae[2]):o:this[ae[0]]=se?se.replace(ae[1],ae[2]):o:ae.length===4&&(this[ae[0]]=se?ae[3].call(this,se.replace(ae[1],ae[2])):o):this[ae]=se||o;ie+=2}},Ne=function(he,ge){for(var ie in ge)if(typeof ge[ie]===l&&ge[ie].length>0){for(var ye=0;ye<ge[ie].length;ye++)if(ne(ge[ie][ye],he))return ie===a?o:ie}else if(ne(ge[ie],he))return ie===a?o:ie;return ge.hasOwnProperty("*")?ge["*"]:he},Je={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},ot={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"},Ae={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,y],[/opios[\/ ]+([\w\.]+)/i],[y,[p,A+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[p,A+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[p,A]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[p,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[y,[p,"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],[p,y],[/quark(?:pc)?\/([-\w\.]+)/i],[y,[p,"Quark"]],[/\bddg\/([\w\.]+)/i],[y,[p,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[p,"UC"+Y]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[p,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[p,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[p,"Smart Lenovo "+Y]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure "+Y],y],[/\bfocus\/([\w\.]+)/i],[y,[p,$+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[p,A+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[p,A+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[p,"MIUI"+be]],[/fxios\/([\w\.-]+)/i],[y,[p,$]],[/\bqihoobrowser\/?([\w\.]*)/i],[y,[p,"360"]],[/\b(qq)\/([\w\.]+)/i],[[p,/(.+)/,"$1Browser"],y],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1"+be],y],[/samsungbrowser\/([\w\.]+)/i],[y,[p,W+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[y,[p,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[p,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[p,y],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[p],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[y,p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,ce],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\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],[p,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[p,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[p,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[p,z+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,z+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[p,"Android "+Y]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[p,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[y,Ne,Je]],[/(webkit|khtml)\/([\w\.]+)/i],[p,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],y],[/(wolvic|librewolf)\/([\w\.]+)/i],[p,y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[p,$+" 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,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[p,[y,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[p,[y,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[w,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[w,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[w,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[w,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[w,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[w,/ower/,i,Q]],[/ sun4\w[;\)]/i],[[w,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[w,Q]]],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],[h,[g,W],[m,S]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[h,[g,W],[m,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[h,[g,j],[m,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[h,[g,j],[m,S]],[/(macintosh);/i],[h,[g,j]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[h,[g,F],[m,b]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[h,[g,K],[m,S]],[/honor([-\w ]+)[;\)]/i],[h,[g,K],[m,b]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[h,[g,B],[m,S]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[h,[g,B],[m,b]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[h,/_/g," "],[g,q],[m,S]],[/\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,/ ([\w ]+) miui\/v?\d/i],[[h,/_/g," "],[g,q],[m,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[h,[g,_],[m,b]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[h,[g,Ne,{OnePlus:["304","403","203"],"*":_}],[m,S]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[h,[g,"Vivo"],[m,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[h,[g,"Realme"],[m,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[h,[g,Z],[m,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[h,[g,Z],[m,S]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[h,[g,V],[m,S]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[h,[g,V],[m,b]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[h,[g,D],[m,S]],[/(nokia) (t[12][01])/i],[g,h,[m,S]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[h,/_/g," "],[m,b],[g,"Nokia"]],[/(pixel (c|tablet))\b/i],[h,[g,H],[m,S]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[h,[g,H],[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],[h,[g,X],[m,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[h,"Xperia Tablet"],[g,X],[m,S]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[h,[g,E],[m,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[h,[g,M],[m,S]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[h,/(.+)/g,"Fire Phone $1"],[g,M],[m,b]],[/(playbook);[-\w\),; ]+(rim)/i],[h,g,[m,S]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[h,[g,O],[m,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[h,[g,N],[m,S]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[h,[g,N],[m,b]],[/(nexus 9)/i],[h,[g,"HTC"],[m,S]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[h,/_/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],[h,[g,"TCL"],[m,S]],[/(itel) ((\w+))/i],[[g,Q],h,[m,Ne,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[h,[g,"Acer"],[m,S]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[h,[g,"Meizu"],[m,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[h,[g,"Ulefone"],[m,b]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[h,[g,"Energizer"],[m,b]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[h,[g,"Cat"],[m,b]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[h,[g,"Smartfren"],[m,b]],[/droid.+; (a(?:015|06[35]|142p?))/i],[h,[g,"Nothing"],[m,b]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[h,[g,"Archos"],[m,S]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[h,[g,"Archos"],[m,b]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[g,h,[m,S]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[g,h,[m,b]],[/(kobo)\s(ereader|touch)/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],[g,h,[m,S]],[/(surface duo)/i],[h,[g,G],[m,S]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[h,[g,"Fairphone"],[m,b]],[/(u304aa)/i],[h,[g,"AT&T"],[m,b]],[/\bsie-(\w*)/i],[h,[g,"Siemens"],[m,b]],[/\b(rct\w+) b/i],[h,[g,"RCA"],[m,S]],[/\b(venue[\d ]{2,7}) b/i],[h,[g,"Dell"],[m,S]],[/\b(q(?:mv|ta)\w+) b/i],[h,[g,"Verizon"],[m,S]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[h,[g,"Barnes & Noble"],[m,S]],[/\b(tm\d{3}\w+) b/i],[h,[g,"NuVision"],[m,S]],[/\b(k88) b/i],[h,[g,"ZTE"],[m,S]],[/\b(nx\d{3}j) b/i],[h,[g,"ZTE"],[m,b]],[/\b(gen\d{3}) b.+49h/i],[h,[g,"Swiss"],[m,b]],[/\b(zur\d{3}) b/i],[h,[g,"Swiss"],[m,S]],[/\b((zeki)?tb.*\b) b/i],[h,[g,"Zeki"],[m,S]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],h,[m,S]],[/\b(ns-?\w{0,9}) b/i],[h,[g,"Insignia"],[m,S]],[/\b((nxa|next)-?\w{0,9}) b/i],[h,[g,"NextBook"],[m,S]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],h,[m,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],h,[m,b]],[/\b(ph-1) /i],[h,[g,"Essential"],[m,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[h,[g,"Envizen"],[m,S]],[/\b(trio[-\w\. ]+) b/i],[h,[g,"MachSpeed"],[m,S]],[/\btu_(1491) b/i],[h,[g,"Rotor"],[m,S]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[h,[g,I],[m,S]],[/(sprint) (\w+)/i],[g,h,[m,b]],[/(kin\.[onetw]{3})/i],[[h,/\./g," "],[g,G],[m,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[h,[g,P],[m,S]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[h,[g,P],[m,b]],[/smart-tv.+(samsung)/i],[g,[m,x]],[/hbbtv.+maple;(\d+)/i],[[h,/^/,"SmartTV"],[g,W],[m,x]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,V],[m,x]],[/(apple) ?tv/i],[g,[h,j+" TV"],[m,x]],[/crkey/i],[[h,z+"cast"],[g,H],[m,x]],[/droid.+aft(\w+)( bui|\))/i],[h,[g,M],[m,x]],[/(shield \w+ tv)/i],[h,[g,I],[m,x]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[h,[g,F],[m,x]],[/(bravia[\w ]+)( bui|\))/i],[h,[g,X],[m,x]],[/(mi(tv|box)-?\w+) bui/i],[h,[g,q],[m,x]],[/Hbbtv.*(technisat) (.*);/i],[g,h,[m,x]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,Pe],[h,Pe],[m,x]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[h,[m,x]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,x]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,h,[m,k]],[/droid.+; (shield)( bui|\))/i],[h,[g,I],[m,k]],[/(playstation \w+)/i],[h,[g,X],[m,k]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[h,[g,G],[m,k]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[h,[g,W],[m,C]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[g,h,[m,C]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[h,[g,_],[m,C]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[h,[g,j],[m,C]],[/(opwwe\d{3})/i],[h,[g,E],[m,C]],[/(moto 360)/i],[h,[g,Z],[m,C]],[/(smartwatch 3)/i],[h,[g,X],[m,C]],[/(g watch r)/i],[h,[g,V],[m,C]],[/droid.+; (wt63?0{2,3})\)/i],[h,[g,P],[m,C]],[/droid.+; (glass) \d/i],[h,[g,H],[m,C]],[/(pico) (4|neo3(?: link|pro)?)/i],[g,h,[m,C]],[/; (quest( \d| pro)?)/i],[h,[g,ce],[m,C]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[m,T]],[/(aeobc)\b/i],[h,[g,M],[m,T]],[/(homepod).+mac os/i],[h,[g,j],[m,T]],[/windows iot/i],[[m,T]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[h,[m,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[h,[m,S]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,S]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,b]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[h,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[p,R+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[p,y],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[p,"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],[p,y],[/ladybird\//i],[[p,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,y],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[p,[y,Ne,ot]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,Ne,ot],[p,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,ve],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,p],[/(ubuntu) ([\w\.]+) like android/i],[[p,/(.+)/,"$1 Touch"],y],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[p,y],[/\(bb(10);/i],[y,[p,O]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[y,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[p,$+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[p,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[p,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[p,z+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,le],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)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,y],[/(sunos) ?([\w\.\d]*)/i],[[p,"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],[p,y]]},Oe=function(he,ge){if(typeof he===l&&(ge=he,he=o),!(this instanceof Oe))return new Oe(he,ge).getResult();var ie=typeof n!==c&&n.navigator?n.navigator:o,ye=he||(ie&&ie.userAgent?ie.userAgent:i),$e=ie&&ie.userAgentData?ie.userAgentData:o,we=ge?ke(Ae,ge):Ae,ae=ie&&ie.userAgent==ye;return this.getBrowser=function(){var ee={};return ee[p]=o,ee[y]=o,ue.call(ee,ye,we.browser),ee[f]=xe(ee[y]),ae&&ie&&ie.brave&&typeof ie.brave.isBrave==s&&(ee[p]="Brave"),ee},this.getCPU=function(){var ee={};return ee[w]=o,ue.call(ee,ye,we.cpu),ee},this.getDevice=function(){var ee={};return ee[g]=o,ee[h]=o,ee[m]=o,ue.call(ee,ye,we.device),ae&&!ee[m]&&$e&&$e.mobile&&(ee[m]=b),ae&&ee[h]=="Macintosh"&&ie&&typeof ie.standalone!==c&&ie.maxTouchPoints&&ie.maxTouchPoints>2&&(ee[h]="iPad",ee[m]=S),ee},this.getEngine=function(){var ee={};return ee[p]=o,ee[y]=o,ue.call(ee,ye,we.engine),ee},this.getOS=function(){var ee={};return ee[p]=o,ee[y]=o,ue.call(ee,ye,we.os),ae&&!ee[p]&&$e&&$e.platform&&$e.platform!="Unknown"&&(ee[p]=$e.platform.replace(/chrome os/i,le).replace(/macos/i,ve)),ee},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 ye},this.setUA=function(ee){return ye=typeof ee===d&&ee.length>L?Pe(ee,L):ee,this},this.setUA(ye),this};Oe.VERSION=r,Oe.BROWSER=te([p,y,f]),Oe.CPU=te([w]),Oe.DEVICE=te([h,g,m,k,b,x,S,C,T]),Oe.ENGINE=Oe.OS=te([p,y]),e.exports&&(t=e.exports=Oe),t.UAParser=Oe;var Me=typeof n!==c&&(n.jQuery||n.Zepto);if(Me&&!Me.ua){var Le=new Oe;Me.ua=Le.getResult(),Me.ua.get=function(){return Le.getUA()},Me.ua.set=function(he){Le.setUA(he);var ge=Le.getResult();for(var ie in ge)Me.ua[ie]=ge[ie]}}})(typeof window=="object"?window:TS)})(Wu,Wu.exports);var O3=Wu.exports;const ur=new O3.UAParser,P3=()=>U.useMemo(()=>({os:ur.getOS(),browser:ur.getBrowser(),cpu:ur.getCPU(),device:ur.getDevice(),engine:ur.getEngine(),ua:ur.getUA()}),[]),N3=()=>U.useMemo(()=>ur.getBrowser(),[]),nf=()=>{const{ua:e}=P3();return e.includes("io-connect-desktop")},f1=()=>{const[e,t]=v.useState([]),[n,o]=v.useState(!1),r=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!r)return;let i=!1;const a=[],s=r.layouts.onAdded(d=>{if(d.type!=="Global"||i)return;o(!0);const{name:f}=d;t(h=>[...h,{name:f}])}),c=r.layouts.onRemoved(d=>{d.type!=="Global"||i||t(f=>f.filter(h=>h.name!==d.name))}),l=r.layouts.onRenamed((d,f)=>{if(d.type!=="Global"||i)return;const{name:h}=d;t(p=>{const m=p.findIndex(g=>g.name===(f==null?void 0:f.name));return m===-1?p:[...p.slice(0,m),{name:h},...p.slice(m+1)]})});return a.push(s,c,l),()=>{i=!0,a.forEach(d=>d())}},[r]),{layouts:e,isInitialized:n}},h1=()=>{const[e,t]=v.useState([]),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=n.notifications.onRaised(a=>t(s=>[...s,a])),r=n.notifications.onClosed(a=>t(s=>s.filter(c=>c.id!==a.id))),i=n.notifications.onStateChanged(({id:a},s)=>{t(c=>{const l=c.findIndex(d=>d.id===a);return l===-1?c:[...c.slice(0,l),{...c[l],state:s},...c.slice(l+1)]})});return n.notifications.list().then(t).catch(console.error),()=>{o(),r(),i()}},[n]),e},I3=()=>{const[e,t]=v.useState({}),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=n.notifications.onConfigurationChanged(r=>t(r));return()=>{o()}},[n]),e},of=e=>{const{handler:t,skip:n}=e;v.useEffect(()=>{if(n)return;const o=r=>{setTimeout(()=>{var i;((i=document.activeElement)==null?void 0:i.nodeName)==="IFRAME"&&t(r)},0)};return window.addEventListener("blur",o,!0),()=>{window.removeEventListener("blur",o,!0)}},[t,n])},rf=e=>{const{eventType:t,handler:n,ref:o,skip:r}=e;v.useEffect(()=>{if(r)return;const i=a=>{const s=a.target;(Array.isArray(o)?o.every(l=>l.current&&!l.current.contains(s)):o.current&&!o.current.contains(s))&&n(a)};return document.addEventListener(t,i,!0),()=>{document.removeEventListener(t,i,!0)}},[t,n,o,r])},T3=lt({name:Gt}),ka=lt({isCompleted:vi()}),Gn=(e,t,n)=>{const[o,r]=v.useState(()=>{try{const s=window[e].getItem(t);return s?JSON.parse(s):null}catch(s){return console.log(s),null}}),i=`${e}-${t}`;v.useEffect(()=>{const s=c=>{r(c.detail)};return window.addEventListener(i,s),()=>{window.removeEventListener(i,s)}},[i]);const a=v.useCallback(s=>{try{if(!s){window[e].removeItem(t),r(null);return}const c=n.run(s);if(!c.ok){console.warn(`Error validating the value to be stored: ${c.error.message}`);return}const l=c.result;r(l),window[e].setItem(t,JSON.stringify(l)),window.dispatchEvent(new CustomEvent(i,{detail:l}))}catch(c){console.log(c)}},[t,e,i,n]);return[o,a]},af=()=>{const[e,t]=Gn("sessionStorage",i3,T3);return{isPlatformWindow:!e||window.name===e.name,setPlatformWindow:t}},p1=()=>{const[e,t]=v.useState([]);return v.useEffect(()=>{const n=({key:i})=>{t(a=>a.includes(i)?a:a.concat(i))},o=i=>{t(a=>a.filter(s=>s!==i.key))},r=()=>{t([])};return document.addEventListener("keydown",n),document.addEventListener("keyup",o),window.addEventListener("blur",r),()=>{document.removeEventListener("keydown",n),document.removeEventListener("keyup",o),window.removeEventListener("blur",r)}},[]),e.length===1?e[0]:null},sf=()=>{const e=v.useContext(Ie.IOConnectContext);return v.useCallback(async(t,n)=>{if(e)try{await e.layouts.restore({name:t}),n==null||n({name:t}),await Be({io:e,variant:Fe.SUCCESS,text:`Layout "${t}" was loaded successfully.`})}catch(o){await Be({io:e,variant:Fe.WARNING,text:`Failed to load Layout "${t}".`,error:o})}},[e])},Dc={CONTROL:"Control",SHIFT:"Shift"},cf=()=>{const e=v.useContext(Ie.IOConnectContext),t=Qd();return async({id:n,modifier:o,reuseWorkspaceId:r})=>{var i;try{const a=o===Dc.CONTROL?{newFrame:!0}:{frameId:t,reuseWorkspaceId:r};await((i=e.workspaces)==null?void 0:i.restoreWorkspace(n,a))}catch(a){await Be({io:e,variant:Fe.WARNING,text:`Failed to load Workspace "${n}".`,error:a})}}},R3=e=>{const[t,n]=v.useState([]),[o,r]=v.useState(!0),i=v.useRef(null),a=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{const s=a==null?void 0:a.search;if(!s)return;const c=[],l=[];return(async f=>{r(!0),n([]);const h=await s.query({search:f.trim(),providerLimits:{maxResults:100,maxResultsPerType:5}});if(h===i.current)return;i.current=h;const p=h.onResults(y=>{y.results.forEach(w=>{l.find(b=>b.id===w.id&&b.type.name===w.type.name)||l.push(w)}),r(!1),n([...l])}),m=h.onCompleted(()=>{r(!1)}),g=h.onError(y=>{console.error(`Query failed. Provider: ${y.provider}; Error: ${y.error}`)});c.push(p,m,g)})(e),()=>{c.forEach(f=>f())}},[a,e]),{resultsToRender:t,isLoading:o}},m1=()=>{const e=v.useContext(Ie.IOConnectContext),t=async({id:o})=>{var r;await((r=e.appManager.application(o))==null?void 0:r.start())},n=async({id:o,modifier:r})=>{var l,d;const i=await((l=e.workspaces)==null?void 0:l.getWorkspace(f=>f.isSelected===!0)),a=i==null?void 0:i.children[0];if(r===Dc.CONTROL||!i||(a==null?void 0:a.type)==="window"){await((d=e.appManager.application(o))==null?void 0:d.start());return}await((a==null?void 0:a.type)==="group"?a:await(a??i).addGroup()).addWindow({appName:o})};return async o=>{try{await(Ty()?t:n)(o)}catch(r){await Be({io:e,variant:Fe.WARNING,text:`Failed to start app "${o.title}".`,error:r})}}},L3=()=>{const[e,t]=v.useState({}),n=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{const o=n.workspaces,r=[];if(o)return(async()=>{try{const i=await o.onWorkspaceOpened(s=>t(c=>{const l={...c};return l[s.title]=l[s.title]??new Set,l[s.title].add(s.id),l})),a=await o.onWorkspaceClosed(({workspaceId:s})=>t(c=>{const l={...c};for(const d in l)if(l[d].has(s)){l[d].delete(s);break}return l}));r.push(i,a)}catch(i){console.error(i)}})(),()=>r.forEach(i=>i==null?void 0:i())},[n]),e},g1=e=>e.key==="Enter"||e.key===" ",Mc=(e,t)=>typeof e>"u"?{}:{tabIndex:0,onClick:e,onKeyDown:n=>{g1(n)&&(n.preventDefault(),e==null||e(n)),t==null||t(n)}},v1=({event:e,currentIndex:t,moveFocus:n,min:o,max:r,onClose:i})=>{switch(e.key){case"ArrowUp":{n(Math.max(t-1,o));break}case"ArrowDown":{n(Math.min(t+1,r));break}case"Home":{n(o);break}case"End":{n(r);break}case"Escape":{if(i){i();break}return}default:return}e.stopPropagation(),e.preventDefault()};const D3=v.forwardRef((e,t)=>{const{title:n,actions:o,className:r,onClose:i,onActionItemClick:a,"data-testid":s="context-menu",...c}=e,l=v.useRef({}),[d,f]=v.useState(0),h=p=>{var m;(m=l.current[p])==null||m.focus(),f(p)};return v.useEffect(()=>{var p;(p=l.current[d])==null||p.focus()},[]),u.jsxs(gt,{ref:t,className:dt(r,"context-menu"),onClick:p=>p.stopPropagation(),onKeyDown:p=>v1({event:p,currentIndex:d,min:0,max:o.length-1,moveFocus:h,onClose:i}),"data-testid":s,...c,children:[n&&u.jsx(gt.ItemSection,{children:n}),o.map((p,m)=>{const g=p.displayName||p.name,y=p.iconSrc?u.jsx(fd,{size:"16",src:p.iconSrc,alt:`${g} icon`}):p.icon&&u.jsx(kt,{size:"16",variant:p.icon});return u.jsxs(v.Fragment,{children:[u.jsx(gt.Item,{ref:w=>l.current[m]=w,prepend:y,disabled:p.disabled,tabIndex:-1,...Mc(w=>a(w,p)),"data-testid":`${s}-item-${p.name}`,children:g}),p.separatorAfter&&u.jsx("li",{className:"context-menu-separator","aria-hidden":!0,"data-testid":`${s}-separator`})]},p.name)})]})});function lf(e){const{title:t,buttonSize:n="16",icon:o="ellipsis-vertical",iconSize:r="12",actions:i,isTabStop:a,onActionItemClick:s,buttonVariant:c,placement:l,strategy:d,offset:f,shouldCloseOnOutsideScroll:h=!1,shouldCloseOnWindowBlur:p=!1,shouldCloseOnWindowResize:m=!1,"data-testid":g,contextMenuDataTestId:y}=e,[w,k]=v.useState(!1),[b,S]=v.useState(null),[x,C]=v.useState(null),T=v.useRef(null),L=v.useRef(null),M=v.useMemo(()=>[L,T],[]),j=v.useCallback(()=>k(!1),[]),{styles:N,attributes:O}=wC(b,x,{placement:l,strategy:d,modifiers:[{name:"offset",options:{offset:f}}]});v.useEffect(()=>{T.current=b},[b]),v.useEffect(()=>{L.current=x},[x]),rf({eventType:"mouseup",handler:j,ref:M,skip:!w}),of({handler:j,skip:!w}),v.useEffect(()=>{if(!(!p||!w))return window.addEventListener("blur",j),()=>{window.removeEventListener("blur",j)}},[j,w,p]),v.useEffect(()=>{if(!h||!x)return;const R=$=>{if(x.contains($.target)){$.preventDefault();return}j()};return document.addEventListener("touchmove",R,{passive:!1}),document.addEventListener("wheel",R,{passive:!1}),()=>{document.removeEventListener("touchmove",R),document.removeEventListener("wheel",R)}},[j,x,h]),v.useEffect(()=>{if(!(!m||!w))return window.addEventListener("resize",j),()=>{window.removeEventListener("resize",j)}},[j,w,m]);const Y=R=>{R.stopPropagation(),k($=>!$),x==null||x.focus()},z=(R,$)=>{R.stopPropagation(),s(R,$),j()};return u.jsxs(u.Fragment,{children:[u.jsx(Ue,{ref:S,size:n,icon:o,iconSize:r,variant:c,...Mc(Y),tabIndex:a?0:-1,"data-testid":g}),w&&u.jsx(D3,{ref:C,title:t,actions:i,onActionItemClick:z,onClose:()=>{b==null||b.focus(),j()},style:N.popper,"data-testid":y,...O.popper})]})}const M3=e=>{const{isFavoritismEnabled:t=!0,item:n,onClick:o,onKeyDown:r,isFocused:i,liRef:a,...s}=e,{favorites:c,toggleFavorite:l,isLoading:d}=Lc(),{description:f,icon:h="application",iconSrc:p,openInstances:m=0,title:g,tooltip:y,className:w,contextMenuActions:k=[]}=n,b=t&&c.some(T=>T.type===n.type&&T.title===n.title),S=T=>{if(g1(T)){o(T),T.preventDefault(),T.stopPropagation();return}r(T)},x=p?u.jsx(fd,{size:"16",src:p,alt:`${g} icon`,"data-testid":"base-section-item-icon"}):u.jsx(kt,{size:"16",variant:h,"data-testid":"base-section-item-icon"}),C=u.jsxs(u.Fragment,{children:[m!==0&&u.jsx("span",{className:"open-instances io-text-smaller","data-testid":"base-section-item-open-instances",children:m===1?"Opened":`${m} opened`}),(t||k.length>0)&&u.jsxs(We,{className:"item-actions",children:[t&&u.jsx(Ue,{...Mc(T=>{T.stopPropagation(),l(n)}),tabIndex:i?0:-1,size:"24",iconSize:"12",icon:b?"star-full":"star",disabled:d,"data-testid":"base-section-item-favorite-button"}),k.length>0&&u.jsx(lf,{buttonSize:"24",iconSize:"12",icon:"ellipsis-vertical",title:g,actions:k,onActionItemClick:o,isTabStop:i,placement:"bottom-end",offset:[0,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0,shouldCloseOnWindowResize:!0,"data-testid":"base-section-item-context-menu-button"})]})]});return u.jsx(gt.Item,{ref:a,tabIndex:i?0:-1,className:dt("io-base-section-item",w),onKeyDown:S,onClick:o,prepend:x,append:C,description:f,tooltip:y??g,"data-testid":`base-section-item-${n.id}`,...s,children:g})},$3=new l1,H3=()=>{const{value:e,update:t}=Tt({prefKey:Pr.COLLAPSED_SECTIONS}),n=v.useCallback(o=>$3.enqueue(()=>t((r=[])=>r.includes(o)?r.filter(a=>a!==o):[...r,o])),[t]);return{collapsedSections:e,toggleSection:n}},uf=e=>{const{config:t,level:n=1,path:o=t.id,onItemClick:r}=e,{isCollapsible:i=!0,getIcon:a}=t,s=p1(),[c,l]=v.useState(0),d=v.useRef({}),{collapsedSections:f,toggleSection:h}=H3(),p=i?!(f!=null&&f.includes(o)):!0,m=t.items.filter(x=>qi(x)),g=t.items.filter(x=>!qi(x)),y=[...m,...g],w=16,k=24,b=x=>{var C,T;(T=(C=d.current[x])==null?void 0:C.querySelector("[tabIndex]"))==null||T.focus(),l(x)},S=async()=>{i&&await h(o)};return u.jsxs(gt.ItemWithSubItems,{className:n===1?"main-section":void 0,"data-testid":`base-section-${t.id}`,children:[u.jsx(zC,{className:n===1?"io-list-item-title main-section-header":void 0,isOpen:p,onClick:S,showCollapseIcon:i,showFolderIcon:n!==1,getIcon:a,style:{paddingLeft:`${w+k*Math.max(0,n-2)}px`},"data-testid":`base-section-header-${t.id}`,title:t.title}),u.jsx(e1,{isOpen:p,tag:gt,children:y.map((x,C)=>qi(x)?u.jsx(uf,{config:x,level:n+1,onItemClick:r,path:`${o}/${x.id}`},x.id):u.jsx(M3,{style:{paddingLeft:`${w+k*(n-1)}px`},liRef:T=>d.current[C]=T,isFavoritismEnabled:x.type===Rt.APPLICATION||x.type===Rt.WORKSPACE,item:x,onClick:(T,L)=>r==null?void 0:r(T,{item:x,modifier:s,selectedContextMenuActionName:L==null?void 0:L.name}),onKeyDown:T=>{v1({event:T,moveFocus:b,currentIndex:c,min:0,max:y.length-1})},isFocused:c===C},x.id))})]})},y1=e=>`${e.type}-${e.id}`,W3=(e,t)=>w1(e)[t],w1=e=>e.reduce((t,n)=>qi(n)?{...t,...w1(n.items)}:{...t,[y1(n)]:n},{}),b1=v.createContext(void 0),F3=()=>{const e=v.useContext(b1);if(e===void 0)throw new Error("useSection must be used within a SectionProvider");return e},B3=({children:e})=>{const[t,n]=v.useState(null),o=v.useMemo(()=>[t,n],[t]);return u.jsx(b1.Provider,{value:o,children:e})},$c=({config:e,onItemClick:t})=>{const[n,o]=F3(),r=Tn(),{isLaunchpadPinned:i}=Nr(),a=(s,c)=>{const{item:l,modifier:d,selectedContextMenuActionName:f}=c;o({itemName:y1(l),modifier:d,selectedContextMenuActionName:f})};return v.useEffect(()=>{var f;if(!t||!n)return;const{itemName:s,modifier:c,selectedContextMenuActionName:l}=n,d=W3(e.items,s);d&&(t({item:d,modifier:c,selectedContextMenuActionName:l}),o(null),!(c===Dc.SHIFT||i)&&((f=r.close)==null||f.call(r)))},[n,e.items,r,t,o,i]),u.jsx(uf,{config:e,onItemClick:a})};function x1(e){const{isFolderCollapsible:t,isSectionCollapsible:n,sortOrder:o,folderIconGetters:r}=e,i=t1(),a=UC(),s=m1(),c=n1(),l=v.useMemo(()=>IS(i,a,{isFolderCollapsible:t,isSectionCollapsible:n,sortOrder:o,folderIconGetters:r}),[i,a,t,n,o,r]),d=f=>{const{item:h,modifier:p,selectedContextMenuActionName:m}=f;if(!m)return s({id:h.id,title:h.title,modifier:p});c(h,m)};return u.jsx($c,{config:l,onItemClick:d})}const z3=(e,t)=>{const{isSectionCollapsible:n,sortOrder:o=la.DISABLED}=t,r=Fd({items:e,sortOrder:o,ascendingCompare:Dy,descendingCompare:My});return{id:oi.FAVORITES,title:"Favorites",items:r,isCollapsible:n}},S1=e=>{const{isSectionCollapsible:t,sortOrder:n}=e,{favorites:o}=Lc(),{isFavoritesSectionHidden:r}=_3(),i=v.useMemo(()=>z3(o,{isSectionCollapsible:t,sortOrder:n}),[o,t,n]);return o.length>0&&!r?u.jsx($c,{config:i}):null},U3=e=>{const{active:t,className:n,...o}=e;return u.jsx(Ue,{className:dt("launchpad-button",{active:t},n),"aria-label":"Launchpad",icon:"logo",variant:"circle",size:"32",title:t?"Close Launchpad":"Open Launchpad","data-testid":"launchpad-button",...o})};var K3=function(t){return V3(t)&&!G3(t)};function V3(e){return!!e&&typeof e=="object"}function G3(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||Z3(e)}var q3=typeof Symbol=="function"&&Symbol.for,J3=q3?Symbol.for("react.element"):60103;function Z3(e){return e.$$typeof===J3}function Y3(e){return Array.isArray(e)?[]:{}}function ha(e,t){return t.clone!==!1&&t.isMergeableObject(e)?yi(Y3(e),e,t):e}function X3(e,t,n){return e.concat(t).map(function(o){return ha(o,n)})}function Q3(e,t){if(!t.customMerge)return yi;var n=t.customMerge(e);return typeof n=="function"?n:yi}function eE(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function wp(e){return Object.keys(e).concat(eE(e))}function k1(e,t){try{return t in e}catch{return!1}}function tE(e,t){return k1(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function nE(e,t,n){var o={};return n.isMergeableObject(e)&&wp(e).forEach(function(r){o[r]=ha(e[r],n)}),wp(t).forEach(function(r){tE(e,r)||(k1(e,r)&&n.isMergeableObject(t[r])?o[r]=Q3(r,n)(e[r],t[r],n):o[r]=ha(t[r],n))}),o}function yi(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||X3,n.isMergeableObject=n.isMergeableObject||K3,n.cloneUnlessOtherwiseSpecified=ha;var o=Array.isArray(t),r=Array.isArray(e),i=o===r;return i?o?n.arrayMerge(e,t,n):nE(e,t,n):ha(t,n)}yi.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(o,r){return yi(o,r,n)},{})};var oE=yi,rE=oE;const iE=Ic(rE),aE={header:{showHeader:!0,showSearch:!0},mode:"default"},Wo={WINDOW_MANAGEMENT:"window-management",NOTIFICATIONS:"notifications"},Hc="getScreenDetails"in window,C1=v.createContext(void 0),E1=()=>{const e=v.useContext(C1);if(e===void 0)throw new Error("useLaunchpadConfig must be used within an LaunchpadConfigProvider");return e},sE=({children:e,settings:t,components:n})=>{const o=v.useMemo(()=>({settings:t,components:n}),[t,n]);return u.jsx(C1.Provider,{value:o,children:e})},A1=v.createContext(void 0),_1=()=>{const e=v.useContext(A1);if(e===void 0)throw new Error("useLaunchpadSearch must be used within a LaunchpadSearchProvider");return e},cE=({children:e})=>{const[t,n]=v.useState(""),o=v.useMemo(()=>({searchTerm:t,setSearchTerm:n}),[t]);return u.jsx(A1.Provider,{value:o,children:e})},j1=({settings:e={},components:t={},isOpen:n=!0,onClose:o,windowManagementPermissionState:r="granted",children:i,className:a,...s})=>{const c=Hc&&r==="granted",l=v.useMemo(()=>iE(aE,e),[e]);return u.jsx(x3,{close:o,isOpen:n,isGlobalLayoutsAvailable:c,children:u.jsx(sE,{settings:l,components:t,children:u.jsx(cE,{children:u.jsx("div",{className:dt("launchpad",a),"data-testid":"launchpad",...s,children:i})})})})},lE=v.forwardRef((e,t)=>{const{onSearch:n,searchTerm:o,onClear:r,className:i}=e,a=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{a!=null&&a.search&&a.search.setDebounceMS(450)},[a]),u.jsx(Cr,{id:"search-input",className:dt("search-bar",i),ref:t,placeholder:"Find anything",value:o,onChange:n,autoComplete:"off",iconPrepend:"search",iconAppend:o.length?"close":void 0,iconAppendOnClick:r})}),O1=({className:e})=>{const{isLaunchpadPinned:t,isLoading:n,toggle:o}=Nr();return u.jsx(Ue,{className:e,size:"32",variant:"circle",icon:t?"unpin":"pin",onClick:o,disabled:n})},P1=({className:e})=>{const t=Qd(),{isOpen:n}=Tn(),{settings:o,components:r}=E1(),{isLaunchpadPinned:i}=Nr(),{isLaunchpadCollapsed:a,setIsLaunchpadCollapsed:s}=tf(),{searchTerm:c,setSearchTerm:l}=_1(),d=v.useRef(null),{showSearch:f,showHeader:h}=o.header??{},{BeforeSearch:p,AfterSearch:m}=r.header??{};v.useEffect(()=>{var w;n&&((w=d.current)==null||w.focus())},[n]),v.useEffect(()=>{i&&s(!1)},[s,i]);const g=w=>{const k=w.target.value;i1(k)&&a&&s(!1),l(k)},y=()=>{var w;l(""),(w=d.current)==null||w.focus()};return h?u.jsxs("div",{className:dt("launchpad-header",t||i?void 0:"draggable",e),"data-testid":"launchpad-header",children:[p&&u.jsx(p,{}),f&&u.jsx(lE,{ref:d,searchTerm:c,onSearch:g,onClear:y,className:t?void 0:"non-draggable"}),m&&u.jsx(m,{}),m===void 0&&(o==null?void 0:o.mode)!=="pinned"&&u.jsx(O1,{className:"ms-auto"})]}):null},uE=(e,t,n)=>{const{isSectionCollapsible:o,sortOrder:r=la.ASCENDING}=n,a=Fd({items:e,sortOrder:r,ascendingCompare:Dy,descendingCompare:My}).map(s=>{var c;return{...s,type:Rt.WORKSPACE,icon:"workspace",openInstances:(c=t[s.title])==null?void 0:c.size,contextMenuActions:Ly}});return{id:oi.WORKSPACES,title:"Workspaces",items:[...a,{id:c1.CREATE_WORKSPACE,icon:"add",title:"Create Workspace",type:Rt.ACTION_BUTTON,tooltip:"Create an empty Workspace in a new window",className:"create-workspace-btn"}],isCollapsible:o}},N1=e=>{const{isSectionCollapsible:t,sortOrder:n}=e,o=u1(),r=L3(),i=cf(),a=d1(),s=v.useMemo(()=>uE(o,r,{isSectionCollapsible:t,sortOrder:n}),[o,r,t,n]),c=l=>{const{item:d,modifier:f,selectedContextMenuActionName:h}=l;return h?a(d,h):d.type===Rt.ACTION_BUTTON?a(d,d.id):i({id:d.id,modifier:f})};return u.jsx($c,{config:s,onItemClick:c})},dE=[{placementId:oi.FAVORITES,Component:S1},{placementId:oi.WORKSPACES,Component:N1},{placementId:oi.APPLICATIONS,Component:x1}],I1=()=>{const{defaultLayout:e,activeLayout:t}=Tn();return n=>({name:n,isDefault:n===(e==null?void 0:e.name),isActive:n===(t==null?void 0:t.name)})},fE=()=>{const e=s1(),t=I1(),n=Ei();return async(o,r)=>{const{id:i}=o,a=t(i);await n(()=>e({layout:a,actionName:r}))}},hE=()=>{const e=n1(),t=d1(),n=fE();return o=>{if(o===Rt.APPLICATION)return e;if(o===Rt.WORKSPACE)return t;if(o===Rt.LAYOUT)return n}},$r={RENAME:"rename",SAVE:"save",SAVE_AS:"saveAs",DELETE:"delete",SET_AS_DEFAULT:"setAsDefault",LOAD:"load"},T1=e=>[{name:$r.RENAME,displayName:"Rename",icon:"pen-line"},{name:$r.SAVE,displayName:"Save",disabled:!e.isActive,icon:"floppy"},{name:$r.SAVE_AS,displayName:"Save as",icon:"floppy-disk-pen",separatorAfter:!0},{name:$r.DELETE,displayName:"Delete",icon:"trash-can",separatorAfter:!0},{name:$r.SET_AS_DEFAULT,displayName:"Set as Default",disabled:e.isDefault,icon:"user-gear",separatorAfter:!0},{name:$r.LOAD,displayName:"Load",icon:"spinner"}],pE=e=>{const t=I1();return e.reduce((n,o)=>{const{type:r}=o,i=o.id||o.displayName;if(!i)return n;let a=[];if(r.name===Rt.APPLICATION)a=Ry;else if(r.name===Rt.WORKSPACE)a=Ly;else if(r.name===Rt.LAYOUT){const d=t(i);a=T1(d)}else o.secondaryActions&&(a=o.secondaryActions.map(({name:d,method:f,params:h,target:p})=>({name:d,interopParams:{method:f,params:h,target:p}})));const s={id:i,title:o.displayName||i,description:o.description,type:r.name,iconSrc:o.iconURL,mainAction:o.action,contextMenuActions:a},c=n.findIndex(({title:d})=>r.displayName?d===r.displayName:d===r.name),l=n[c];return l?[...n.slice(0,c),{...l,items:[...l.items,s]},...n.slice(c+1)]:[...n,{id:r.name,title:r.displayName||r.name,items:[s]}]},[])};function mE(e){const{resultsToRender:t,isLoading:n}=R3(e.searchTerm),{close:o}=Tn(),r=A3(),i=cf(),a=m1(),s=sf(),c=hE(),l=pE(t),d=Ei(),{isLaunchpadPinned:f}=Nr(),h=(m,g)=>{const y=c(m.type);y==null||y(m,g)},p=async(m,g)=>{var L;const{item:y,modifier:w,selectedContextMenuActionName:k}=g,{type:b,id:S,title:x,mainAction:C}=y,T=k?(L=y.contextMenuActions)==null?void 0:L.find(M=>M.name===k):null;T!=null&&T.interopParams?r(T.interopParams):k?h(y,k):C?r(C):b===Rt.APPLICATION?a({id:S,title:x,modifier:w}):b===Rt.WORKSPACE?i({id:S,modifier:w}):b===Rt.LAYOUT&&d(()=>s(S)),!(w===Dc.SHIFT||f)&&(o==null||o())};return n?u.jsx("p",{className:"search-loading",children:"Loading..."}):t.length===0?u.jsx("p",{className:"search-no-results",children:"No results found. Try searching by app name, workspace title, or keywords."}):u.jsx(gt,{children:l.map((m,g)=>u.jsx(uf,{config:m,onItemClick:p},m.id||g))})}const gE=()=>{const{value:e,update:t,isLoading:n,error:o}=Tt({prefKey:Pr.IS_LAYOUTS_PANEL_OPEN});return{error:o,isLayoutsPanelOpen:e,setIsLayoutsPanelOpen:t,isLoading:n}},vE=({layoutName:e})=>{const t=v.useContext(Ie.IOConnectContext),n=Ei(),o=r=>{r.stopPropagation(),n(async()=>{try{await t.layouts.save({name:e,type:"Global"}),await Be({io:t,variant:Fe.SUCCESS,text:`Layout "${e}" was saved successfully.`})}catch(a){await Be({io:t,variant:Fe.WARNING,text:`Failed to save Layout "${e}".`,error:a})}})};return u.jsx(Ue,{icon:"floppy",size:"24",iconSize:"12",onClick:o,title:"Save Layout","data-testid":"save-layout-button"})},yE=({layout:e})=>{const t=s1(),n=Ei(),o=async(r,i)=>{r.stopPropagation(),await n(()=>t({layout:e,actionName:i.name}))};return u.jsx(lf,{buttonSize:"24",iconSize:"12",title:e.name,icon:"ellipsis-vertical",actions:T1(e),onActionItemClick:o,placement:"top-end",strategy:"fixed",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0,shouldCloseOnWindowResize:!0,"data-testid":"layout-context-menu-button",contextMenuDataTestId:"layout-context-menu"})};const R1=({layouts:e,className:t,...n})=>{const{isLaunchpadPinned:o}=Nr(),{close:r}=Tn(),i=sf(),a=Ei(),s=()=>{o||r==null||r()},c=l=>a(()=>i(l.name,s));return u.jsx(Jo,{element:gt,elementProps:{className:dt("layouts-list",t),variant:"single",checkIcon:{variant:"check",tooltip:"Active Layout"},...n},wrapperClassName:"layouts-list-scrollable-container",children:e.map(l=>u.jsx(gt.Item,{className:"layouts-list-item",onClick:()=>c(l),append:u.jsxs(u.Fragment,{children:[l.isDefault&&u.jsx(cc,{variant:"default",title:"Default Layout","data-testid":"default-layout-pill",children:"Default"}),u.jsxs(Yy,{children:[l.isActive&&u.jsx(vE,{layoutName:l.name}),u.jsx(yE,{layout:l})]})]}),isSelected:l.isActive,tooltip:l.name,"data-testid":`layout-item-${l.name}`,children:l.name},l.name))})},wE=()=>{const{layouts:e}=f1(),{activeLayout:t,defaultLayout:n}=Tn(),o=v.useMemo(()=>e.map(r=>({...r,isActive:r.name===(t==null?void 0:t.name),isDefault:r.name===(n==null?void 0:n.name)})),[e,t,n]);return u.jsx(R1,{layouts:o,"data-testid":"all-layouts"})},bE=()=>{const{defaultLayout:e,activeLayout:t}=Tn();return t?u.jsx(R1,{layouts:[{...t,isDefault:t.name===(e==null?void 0:e.name),isActive:!0}],"data-testid":"active-layout"}):u.jsx("p",{className:"io-text-small no-active-layout","data-testid":"choose-layout-message",children:"Choose which Layout to load"})},xE=()=>{const e=v.useContext(Ie.IOConnectContext),{setActiveLayout:t}=Tn(),n=Ei(),o=async()=>{var f;if(!("modals"in e&&e.modals)){console.error("Cannot create Layout because io dialogs are not enabled");return}const r="create",i="layout-name",{isEnterPressed:a,responseButtonClicked:s,inputs:c}=await e.modals.dialogs.request({templateName:Ci.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:"Create Layout",input:{id:i,initialValue:"Create Layout",validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:ef}},actionButtons:[{variant:"primary",text:"Create",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),l=(f=c==null?void 0:c.find(h=>h.id===i))==null?void 0:f.value;if(a||(s==null?void 0:s.id)===r)try{if((await e.layouts.getAll("Global")).find(p=>p.name===l)){await Be({io:e,variant:Fe.WARNING,text:`Failed to create Layout "${l}". A Layout with this name already exists.`});return}await e.layouts.save({name:l}),t({name:l}),await Be({io:e,variant:Fe.SUCCESS,text:`Layout "${l}" was created successfully.`})}catch(h){await Be({io:e,variant:Fe.WARNING,text:`Failed to create Layout "${l}".`,error:h})}};return u.jsx(We,{variant:"fullwidth",className:"create-layout-btn-group",children:u.jsx(Qe,{variant:"primary",text:"Create Layout",onClick:()=>n(o),"data-testid":"create-layout-button"})})};const SE=()=>{const e=v.useRef(null),{layouts:t,isInitialized:n}=f1(),{isLayoutsPanelOpen:o,setIsLayoutsPanelOpen:r}=gE();v.useEffect(()=>{!n||t.length>0||!o||r(!1)},[t,n,o,r]);const i=v.useCallback(()=>r(a=>!a),[r]);return u.jsxs("footer",{className:"layouts-panel",ref:e,"data-testid":"layouts-panel",children:[u.jsx(bi,{className:"layouts-panel-separator"}),u.jsxs("div",{className:"layouts-panel-header","aria-label":"Layouts panel","aria-expanded":o,role:"button","data-testid":"layouts-panel-header",...Mc(t.length?i:void 0),children:[u.jsx(zn,{tag:"h2",size:"normal",text:t.length>0?"Layouts":"Start using Layouts"}),t.length>0&&u.jsx(Ue,{className:dt("layouts-panel-toggle-button",{"layouts-panel-toggle-button-rotated":o}),icon:"expand",iconSize:"12",size:"24","data-testid":"layouts-panel-toggle-button"})]}),u.jsx(e1,{isOpen:o,tag:"div",children:u.jsx(wE,{})}),t.length>0&&!o?u.jsx(bE,{}):u.jsx(xE,{})]})},L1=({className:e})=>{const{isLaunchpadCollapsed:t}=tf(),{isGlobalLayoutsAvailable:n}=Tn(),{components:o}=E1(),{searchTerm:r}=_1(),{sections:i=dE}=o;return u.jsxs("div",{className:dt("launchpad-body",t?"collapsed":void 0,e),children:[u.jsx(Jo,{wrapperClassName:"launchpad-main-scrollable-container",element:"main",elementProps:{className:"launchpad-main"},children:i1(r)?u.jsx(mE,{searchTerm:r}):u.jsx(B3,{children:u.jsx(gt,{children:i.map(({Component:a,placementId:s})=>u.jsx(a,{},s))})})}),n&&u.jsx(SE,{})]})};const D1=e=>u.jsxs(j1,{...e,children:[u.jsx(P1,{}),u.jsx(L1,{})]}),M1=v.createContext(void 0),$1=()=>{const e=v.useContext(M1);if(e===void 0)throw new Error("useWorkspaceComponentsContext must be used within an WorkspaceComponentsContextProvider");return e},kE=()=>{const e=Hc?[Wo.NOTIFICATIONS,Wo.WINDOW_MANAGEMENT]:[Wo.NOTIFICATIONS];return Promise.all(e.map(async t=>{const n=await navigator.permissions.query({name:t});return n.stableName=t,n}))},H1=v.createContext(void 0),Yo=()=>{const e=v.useContext(H1);if(e===void 0)throw new Error("useIOConnectHome must be used within an IOConnectHomeProvider");return e},CE=({children:e})=>{const[t,n]=Gn("localStorage",Sa,ka),[o,r]=v.useState([]),i=v.useMemo(()=>o.reduce((f,h)=>({...f,[h.stableName]:{state:h.state}}),{}),[o]),a={isLoading:o.length===0,statuses:i},[s,c]=v.useState(!1),l={isLoggingOut:s,setIsLoggingOut:c};v.useEffect(()=>{let f=!1;const h=kE().then(p=>{if(f)return;r(p);const m=[];let g=!1;return p.forEach((y,w)=>{const k=b=>{if(f||!b.target||g)return;const S=b.target;if(S.state==="prompt")return n({isCompleted:!1}),g=!0,window.location.reload();r(C=>[...C.slice(0,w),S,...C.slice(w+1)])};y.addEventListener("change",k),m.push(()=>y.removeEventListener("change",k))}),m}).catch(console.warn);return()=>{f=!0,h.then(p=>{p==null||p.forEach(m=>m())})}},[n]);const d=v.useMemo(()=>({permission:a,login:l}),[a,l]);return u.jsx(H1.Provider,{value:d,children:e})},EE=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[u.jsxs("g",{clipPath:"url(#a)",children:[u.jsxs("g",{clipPath:"url(#b)",children:[u.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),u.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)"}),u.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)"}),u.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"}),u.jsx("rect",{width:21.694,height:6.057,fill:"#AAB0B0",rx:3.028,transform:"matrix(1 0 0 -1 132.72 99.844)"}),u.jsx("mask",{id:"d",fill:"#fff",children:u.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),u.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),u.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),u.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),u.jsx("rect",{width:64,height:64,x:53,y:24,fill:"#36AA6C",rx:32}),u.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"}),u.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"})]}),u.jsxs("defs",{children:[u.jsx("clipPath",{id:"a",children:u.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),u.jsx("clipPath",{id:"b",children:u.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),u.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[u.jsx("stop",{stopColor:"#313131"}),u.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),AE=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[u.jsxs("g",{clipPath:"url(#a)",children:[u.jsxs("g",{clipPath:"url(#b)",children:[u.jsx("path",{fill:"url(#c)",d:"M0 0h170v94H0z",transform:"translate(0 20)"}),u.jsx("mask",{id:"d",fill:"#fff",children:u.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),u.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),u.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),u.jsx("rect",{width:169,height:113,x:.5,y:20.5,stroke:"#5D5D5D",rx:5.5}),u.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"}),u.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"}),u.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"}),u.jsx("circle",{cx:46.208,cy:58.882,r:20.294,fill:"#36AA6C"}),u.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"})]}),u.jsxs("defs",{children:[u.jsx("clipPath",{id:"a",children:u.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),u.jsx("clipPath",{id:"b",children:u.jsx("rect",{width:170,height:114,y:20,fill:"#fff",rx:6})}),u.jsxs("linearGradient",{id:"c",x1:20.715,x2:50.521,y1:5.735,y2:95.406,gradientUnits:"userSpaceOnUse",children:[u.jsx("stop",{stopColor:"#313131"}),u.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),_E=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[u.jsxs("g",{clipPath:"url(#a)",children:[u.jsxs("g",{clipPath:"url(#b)",children:[u.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),u.jsx("mask",{id:"d",fill:"#fff",children:u.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),u.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),u.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),u.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.jsx("rect",{width:30,height:30,fill:"#5A5C5C",rx:15,transform:"matrix(1 0 0 -1 12 45.46)"}),u.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"}),u.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"}),u.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"}),u.jsx("circle",{cx:85,cy:57.277,r:32,fill:"#36AA6C"}),u.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"})]}),u.jsxs("defs",{children:[u.jsx("clipPath",{id:"a",children:u.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),u.jsx("clipPath",{id:"b",children:u.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),u.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[u.jsx("stop",{stopColor:"#313131"}),u.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),jE=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[u.jsxs("g",{clipPath:"url(#a)",children:[u.jsxs("g",{clipPath:"url(#b)",children:[u.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),u.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"}),u.jsx("mask",{id:"d",fill:"#fff",children:u.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),u.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),u.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),u.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"}),u.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"})]}),u.jsxs("defs",{children:[u.jsx("clipPath",{id:"a",children:u.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),u.jsx("clipPath",{id:"b",children:u.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),u.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[u.jsx("stop",{stopColor:"#313131"}),u.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),OE=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[u.jsxs("g",{clipPath:"url(#a)",children:[u.jsxs("g",{clipPath:"url(#b)",children:[u.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),u.jsx("mask",{id:"d",fill:"#fff",children:u.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),u.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),u.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),u.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),u.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"}),u.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"}),u.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"})]}),u.jsxs("defs",{children:[u.jsx("clipPath",{id:"a",children:u.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),u.jsx("clipPath",{id:"b",children:u.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),u.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[u.jsx("stop",{stopColor:"#313131"}),u.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),PE={edgeNotificationsPermissionTimeout:15e3},ut={WINDOW_MANAGEMENT:Wo.WINDOW_MANAGEMENT,NOTIFICATIONS:Wo.NOTIFICATIONS,POPUPS:"popups",PWA_INSTALL:"pwa-install"},NE={name:ut.WINDOW_MANAGEMENT,label:`Allow window management${Hc?"":" (not available in your browser)"}`,heading:"Allow Window Management",description:`By granting this permission you will be able to load layouts containing multiple
|
|
52
|
+
***************************************************************************** */var ld=function(){return ld=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},ld.apply(this,arguments)};function X3(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function ud(e,t){if(e===t||e===null&&t===null)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="object"){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!ud(e[n],t[n]))return!1;return!0}var o=Object.keys(e);if(o.length!==Object.keys(t).length)return!1;for(var n=0;n<o.length;n++)if(!t.hasOwnProperty(o[n])||!ud(e[o[n]],t[o[n]]))return!1;return!0}}var sa=function(e){return Array.isArray(e)},fs=function(e){return typeof e=="object"&&e!==null&&!sa(e)},Q3=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)}},ro=function(e,t){return"expected "+e+", got "+Q3(t)},Zi=function(e){return e.map(function(t){return typeof t=="string"?"."+t:"["+t+"]"}).join("")},Yi=function(e,t){var n=t.at,o=X3(t,["at"]);return ld({at:e+(n||"")},o)},kt=function(){function e(t){var n=this;this.decode=t,this.run=function(o){return Kl(function(r){return{kind:"DecoderError",input:o,at:"input"+(r.at||""),message:r.message||""}},n.decode(o))},this.runPromise=function(o){return G3(n.run(o))},this.runWithException=function(o){return J3(n.run(o))},this.map=function(o){return new e(function(r){return Z3(o,n.decode(r))})},this.andThen=function(o){return new e(function(r){return Y3(function(i){return o(i).decode(r)},n.decode(r))})},this.where=function(o,r){return n.andThen(function(i){return o(i)?e.succeed(i):e.fail(r)})}}return e.string=function(){return new e(function(t){return typeof t=="string"?Et(t):wt({message:ro("a string",t)})})},e.number=function(){return new e(function(t){return typeof t=="number"?Et(t):wt({message:ro("a number",t)})})},e.boolean=function(){return new e(function(t){return typeof t=="boolean"?Et(t):wt({message:ro("a boolean",t)})})},e.constant=function(t){return new e(function(n){return ud(n,t)?Et(t):wt({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(n)})})},e.object=function(t){return new e(function(n){if(fs(n)&&t){var o={};for(var r in t)if(t.hasOwnProperty(r)){var i=t[r].decode(n[r]);if(i.ok===!0)i.result!==void 0&&(o[r]=i.result);else return n[r]===void 0?wt({message:"the key '"+r+"' is required but was not present"}):wt(Yi("."+r,i.error))}return Et(o)}else return fs(n)?Et(n):wt({message:ro("an object",n)})})},e.array=function(t){return new e(function(n){if(sa(n)&&t){var o=function(r,i){return Kl(function(a){return Yi("["+i+"]",a)},t.decode(r))};return n.reduce(function(r,i,a){return Gp(function(s,c){return s.concat([c])},r,o(i,a))},Et([]))}else return sa(n)?Et(n):wt({message:ro("an array",n)})})},e.tuple=function(t){return new e(function(n){if(sa(n)){if(n.length!==t.length)return wt({message:"expected a tuple of length "+t.length+", got one of length "+n.length});for(var o=[],r=0;r<t.length;r++){var i=t[r].decode(n[r]);if(i.ok)o[r]=i.result;else return wt(Yi("["+r+"]",i.error))}return Et(o)}else return wt({message:ro("a tuple of length "+t.length,n)})})},e.union=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return e.oneOf.apply(e,[t,n].concat(o))},e.intersection=function(t,n){for(var o=[],r=2;r<arguments.length;r++)o[r-2]=arguments[r];return new e(function(i){return[t,n].concat(o).reduce(function(a,s){return Gp(Object.assign,a,s.decode(i))},Et({}))})},e.anyJson=function(){return new e(function(t){return Et(t)})},e.unknownJson=function(){return new e(function(t){return Et(t)})},e.dict=function(t){return new e(function(n){if(fs(n)){var o={};for(var r in n)if(n.hasOwnProperty(r)){var i=t.decode(n[r]);if(i.ok===!0)o[r]=i.result;else return wt(Yi("."+r,i.error))}return Et(o)}else return wt({message:ro("an object",n)})})},e.optional=function(t){return new e(function(n){return n==null?Et(void 0):t.decode(n)})},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e(function(o){for(var r=[],i=0;i<t.length;i++){var a=t[i].decode(o);if(a.ok===!0)return a;r[i]=a.error}var s=r.map(function(c){return"at error"+(c.at||"")+": "+c.message}).join('", "');return wt({message:'expected a value matching one of the decoders, got the errors ["'+s+'"]'})})},e.withDefault=function(t,n){return new e(function(o){return Et(q3(t,n.decode(o)))})},e.valueAt=function(t,n){return new e(function(o){for(var r=o,i=0;i<t.length;i++){if(r===void 0)return wt({at:Zi(t.slice(0,i+1)),message:"path does not exist"});if(typeof t[i]=="string"&&!fs(r))return wt({at:Zi(t.slice(0,i+1)),message:ro("an object",r)});if(typeof t[i]=="number"&&!sa(r))return wt({at:Zi(t.slice(0,i+1)),message:ro("an array",r)});r=r[t[i]]}return Kl(function(a){return r===void 0?{at:Zi(t),message:"path does not exist"}:Yi(Zi(t),a)},n.decode(r))})},e.succeed=function(t){return new e(function(n){return Et(t)})},e.fail=function(t){return new e(function(n){return wt({message:t})})},e.lazy=function(t){return new e(function(n){return t().decode(n)})},e}(),e5=kt.string,t5=kt.number,Ni=kt.boolean,Wt=kt.anyJson;kt.unknownJson;var tr=kt.constant,dt=kt.object,n5=kt.array;kt.tuple;kt.dict;var Ie=kt.optional,Oa=kt.oneOf;kt.union;kt.intersection;kt.withDefault;kt.valueAt;kt.succeed;var o5=kt.fail;kt.lazy;const qt=e5().where(e=>e.length>0,"Expected a non-empty string"),r5=t5().where(e=>e>=0,"Expected a non-negative number");Ni();const pn=(e,t)=>{const n=typeof e;return n==="function"?Wt():o5(`The provided argument as ${t} should be of type function, provided: ${typeof n}`)},H1=dt({name:qt}),i5="Welcome",a5=e=>e.components.reduce((n,o)=>{if(o.type==="workspaceFrame"){const r=o.state.workspaces.map(i=>i.config.name);n.push(...r)}return n},[]),B1=e=>e.trim().length>0,s5=(e,t)=>{const[n,o]=v.useState(void 0),[r,i]=Xn("sessionStorage",$1,H1),a=v.useRef(!1),s=Rf(),c=Lf(),u=v.useContext(Te.IOConnectContext),d=v.useCallback(async({name:f})=>{try{await u.layouts.setDefaultGlobal(f)}catch(h){console.error("Failed to set default Layout: ",{error:h})}},[u]);return v.useEffect(()=>{if(u)return u.layouts.onDefaultGlobalChanged(f=>{o(f)})},[u]),v.useEffect(()=>{if(u)return u.layouts.onRestored(f=>{i({name:f.name})})},[u]),v.useEffect(()=>{if(u)return u.layouts.onRemoved(f=>{(f==null?void 0:f.name)===(r==null?void 0:r.name)&&i(null)})},[u,r]),v.useEffect(()=>{if(u)return u.layouts.onRenamed((f,h)=>{(h==null?void 0:h.name)===(r==null?void 0:r.name)&&i({name:f.name})})},[u,r]),v.useEffect(()=>{var h;if(!u||!((h=window.iobrowser)!=null&&h.platformStarted)||a.current)return;(async()=>{var w;a.current=!0;const p=await u.layouts.getDefaultGlobal()??(await u.layouts.getAll("Global")).find(S=>S.name===i5);if(!p||(o({name:p.name}),r))return;if(e(!0),t){await s(p.name),e(!1);return}const m=await((w=u.workspaces)==null?void 0:w.getWorkspace(S=>S.children.length===0)),g=await u.layouts.get(p.name,"Global");if(!g)throw new Error("Default Global Layout not found.");const y=a5(g);Promise.all(y.map((S,b)=>c({id:S,reuseWorkspaceId:b===0?m==null?void 0:m.id:void 0}))),e(!1)})().catch(p=>console.error("Initial Global Layout setup failed. ",Zu(p)))},[u,r,s,c,t]),{defaultLayout:n,activeLayout:r,setDefaultLayout:d,setActiveLayout:i}},W1=v.createContext(void 0),$n=()=>{const e=v.useContext(W1);if(e===void 0)throw new Error("useLaunchpadAPI must be used within a LaunchpadAPIProvider");return e},c5=({children:e,close:t,isOpen:n,isGlobalLayoutsAvailable:o})=>{const[r,i]=v.useState(!1),{defaultLayout:a,activeLayout:s,setDefaultLayout:c,setActiveLayout:u}=s5(i,o),d=v.useMemo(()=>({close:t,isOpen:n,defaultLayout:a,activeLayout:s,setDefaultLayout:c,setActiveLayout:u,isLayoutOperationBlocked:r,setIsLayoutOperationBlocked:i,isGlobalLayoutsAvailable:o}),[t,n,a,s,c,u,r,o]);return l.jsx(W1.Provider,{value:d,children:e})},Wr={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",HIDE_FAVORITES_SECTION:"_launchpad_hideFavoritesSection",LAYOUTS_SHOW_DELETE_PROMPT:"_layouts_showDeletePrompt"},Fr=()=>{const{value:e,update:t,isLoading:n,error:o}=Nt({prefKey:Wr.IS_LAUNCHPAD_PINNED}),r=v.useCallback(()=>t(i=>!i),[t]);return{error:o,isLaunchpadPinned:e,isLoading:n,toggle:r}},F1=()=>{const e=v.useContext(Te.IOConnectContext),{setActiveLayout:t,setDefaultLayout:n,close:o}=$n(),{isLaunchpadPinned:r}=Fr(),{value:i,update:a}=Nt({prefKey:Wr.LAYOUTS_SHOW_DELETE_PROMPT}),s=()=>{r||o==null||o()};return v.useCallback(async u=>{const{layout:d,actionName:f}=u;return await z3[f]({io:e,layout:d,setActiveLayout:t,setDefaultLayout:n,closeLaunchpad:s,showDeletePromptPref:i,updateShowDeletePromptPref:a})},[e,n,t,o,i,a])},Wi=()=>{const{isLayoutOperationBlocked:e,setIsLayoutOperationBlocked:t}=$n();return async n=>{if(!e){t(!0);try{await n()}catch(o){console.error("Layout operation failed: ",{error:o})}t(!1)}}},z1={CREATE_WORKSPACE:"createWorkspace"},l5=async e=>{const{io:t,item:n}=e;if(t.workspaces)try{await t.workspaces.restoreWorkspace(n.id,{newFrame:!0})}catch(o){await Fe({io:t,variant:Be.WARNING,text:`Failed to load Workspace "${n.title}".`,error:o})}},u5=async e=>{const{io:t,item:n,removeFavorite:o}=e;if(t.workspaces){if("modals"in t&&t.modals){const r="delete",{isEnterPressed:i,responseButtonClicked:a}=await t.modals.dialogs.request({templateName:Bi.NO_INPUTS_CONFIRMATION_DIALOG,variables:{heading:`Delete "${n.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 t.workspaces.layouts.delete(n.id),await o(n),await Fe({io:t,variant:Be.SUCCESS,text:`"Workspace ${n.title}" was successfully deleted.`})}catch(r){await Fe({io:t,variant:Be.WARNING,text:`Failed to delete Workspace "${n.title}".`,error:r})}}},d5=async e=>{const{io:t}=e;if(t.workspaces)try{await t.workspaces.createWorkspace({children:[],frame:{newFrame:!0}})}catch(n){await Fe({io:t,variant:Be.WARNING,text:"Failed to create a new Workspace.",error:n})}},f5={[sc.OPEN_IN_NEW_WINDOW]:l5,[sc.DELETE]:u5,[z1.CREATE_WORKSPACE]:d5};class U1{constructor(){Cn(this,"queue",[]);Cn(this,"isExecutingQueue",!1)}enqueue(t){return new Promise((n,o)=>{this.queue.push({action:t,resolve:n,reject:o}),this.executeQueue()})}async executeQueue(){if(!this.isExecutingQueue){for(this.isExecutingQueue=!0;this.queue.length;){const t=this.queue.shift();if(!t){this.isExecutingQueue=!1;return}try{const n=await t.action();t.resolve(n)}catch(n){t.reject(n)}await this.intervalBreak()}this.isExecutingQueue=!1}}intervalBreak(){return new Promise(t=>setTimeout(t,0))}}const K1=()=>{const[e,t]=v.useState([]),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!(n!=null&&n.workspaces))return;let o=!1;const r=n.workspaces.layouts.onSaved(({name:s})=>{o||e.some(({id:c})=>c===s)||t(c=>[...c,{id:s,title:s}])}),i=n.workspaces.layouts.onRemoved(({name:s})=>{o||t(c=>c.filter(({id:u})=>u!==s))}),a=n.layouts.onRenamed((s,c)=>{if(o||s.type!=="Workspace")return;const{name:u}=s;t(d=>{const f=d.findIndex(h=>h.id===(c==null?void 0:c.name));return f===-1?d:[...d.slice(0,f),{id:u,title:u},...d.slice(f+1)]})});return()=>{o=!0,a(),[r,i].forEach(async s=>{try{(await s)()}catch(c){console.error(c)}})}},[n,e]),e},qp=new U1,tl=()=>{const{value:e,update:t,isLoading:n}=Nt({prefKey:Wr.FAVORITES}),o=D1(),r=K1(),i=v.useMemo(()=>(e??[]).filter(c=>c.type===It.APPLICATION?o.some(u=>u.id===c.id):c.type===It.WORKSPACE?r.some(u=>u.id===c.id):!0),[e,o,r]),a=v.useCallback(({openInstances:c,...u})=>qp.enqueue(()=>t((d=[])=>{const f=d.find(h=>h.id===u.id&&h.type&&u.type);return f?d.filter(h=>h!==f):[u,...d]})),[t]),s=v.useCallback(c=>qp.enqueue(()=>t((u=[])=>u.filter(d=>!(d.id===c.id&&d.type===c.type)))),[t]);return{favorites:i,toggleFavorite:a,removeFavorite:s,isLoading:n}},V1=()=>{const e=v.useContext(Te.IOConnectContext),{removeFavorite:t}=tl();return(n,o)=>{f5[o]({io:e,item:n,removeFavorite:t})}},h5=()=>{const e=v.useContext(Te.IOConnectContext);return async t=>e.interop.methods().every(n=>n.name!==(t==null?void 0:t.method))?console.error("Interop method not found."):await e.interop.invoke(t.method,t.params,t.target).catch(n=>console.error({error:n}))},p5=()=>{const{value:e,update:t,isLoading:n,error:o}=Nt({prefKey:Wr.HIDE_FAVORITES_SECTION}),r=v.useCallback(()=>t(i=>!i),[t]);return{error:o,isFavoritesSectionHidden:e,isLoading:n,toggle:r}},m5=()=>{const[e,t]=v.useState(!1),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!n)return;let o;return(async()=>{var r;try{o=await((r=n.workspaces)==null?void 0:r.onWorkspaceOpened(()=>t(!0)))}catch(i){console.error(i)}})(),()=>o==null?void 0:o()},[n]),e},Pf=()=>{const{value:e,update:t,isLoading:n,error:o}=Nt({prefKey:Wr.IS_LAUNCHPAD_COLLAPSED});return{error:o,isLaunchpadCollapsed:e,setIsLaunchpadCollapsed:t,isLoading:n}};var dd={exports:{}};(function(e,t){(function(n,o){var r="1.0.41",i="",a="?",s="function",c="undefined",u="object",d="string",f="major",h="model",p="name",m="type",g="vendor",y="version",w="architecture",S="console",b="mobile",k="tablet",x="smarttv",C="wearable",I="embedded",R=500,M="Amazon",_="Apple",T="ASUS",P="BlackBerry",X="Browser",te="Chrome",W="Edge",J="Firefox",L="Google",G="Honor",F="Huawei",N="Lenovo",$="LG",H="Microsoft",B="Motorola",E="Nvidia",j="OnePlus",A="Opera",O="OPPO",q="Samsung",z="Sharp",U="Sony",Q="Xiaomi",D="Zebra",le="Facebook",ue="Chromium OS",ve="Mac OS",we=" Browser",Ae=function(he,ye){var ae={};for(var se in he)ye[se]&&ye[se].length%2===0?ae[se]=ye[se].concat(he[se]):ae[se]=he[se];return ae},Z=function(he){for(var ye={},ae=0;ae<he.length;ae++)ye[he[ae].toUpperCase()]=he[ae];return ye},oe=function(he,ye){return typeof he===d?ce(ye).indexOf(ce(he))!==-1:!1},ce=function(he){return he.toLowerCase()},Se=function(he){return typeof he===d?he.replace(/[^\d\.]/g,i).split(".")[0]:o},Oe=function(he,ye){if(typeof he===d)return he=he.replace(/^\s\s*/,i),typeof ye===c?he:he.substring(0,R)},fe=function(he,ye){for(var ae=0,se,Ne,ge,ee,Y,de;ae<ye.length&&!Y;){var be=ye[ae],We=ye[ae+1];for(se=Ne=0;se<be.length&&!Y&&be[se];)if(Y=be[se++].exec(he),Y)for(ge=0;ge<We.length;ge++)de=Y[++Ne],ee=We[ge],typeof ee===u&&ee.length>0?ee.length===2?typeof ee[1]==s?this[ee[0]]=ee[1].call(this,de):this[ee[0]]=ee[1]:ee.length===3?typeof ee[1]===s&&!(ee[1].exec&&ee[1].test)?this[ee[0]]=de?ee[1].call(this,de,ee[2]):o:this[ee[0]]=de?de.replace(ee[1],ee[2]):o:ee.length===4&&(this[ee[0]]=de?ee[3].call(this,de.replace(ee[1],ee[2])):o):this[ee]=de||o;ae+=2}},Re=function(he,ye){for(var ae in ye)if(typeof ye[ae]===u&&ye[ae].length>0){for(var se=0;se<ye[ae].length;se++)if(oe(ye[ae][se],he))return ae===a?o:ae}else if(oe(ye[ae],he))return ae===a?o:ae;return ye.hasOwnProperty("*")?ye["*"]:he},Je={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},ot={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"},Pe={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[y,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[y,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,y],[/opios[\/ ]+([\w\.]+)/i],[y,[p,A+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[y,[p,A+" GX"]],[/\bopr\/([\w\.]+)/i],[y,[p,A]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[y,[p,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[y,[p,"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],[p,y],[/quark(?:pc)?\/([-\w\.]+)/i],[y,[p,"Quark"]],[/\bddg\/([\w\.]+)/i],[y,[p,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[y,[p,"UC"+X]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[y,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[y,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[y,[p,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[y,[p,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[y,[p,"Smart Lenovo "+X]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure "+X],y],[/\bfocus\/([\w\.]+)/i],[y,[p,J+" Focus"]],[/\bopt\/([\w\.]+)/i],[y,[p,A+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[y,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[y,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[y,[p,A+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[y,[p,"MIUI"+we]],[/fxios\/([\w\.-]+)/i],[y,[p,J]],[/\bqihoobrowser\/?([\w\.]*)/i],[y,[p,"360"]],[/\b(qq)\/([\w\.]+)/i],[[p,/(.+)/,"$1Browser"],y],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1"+we],y],[/samsungbrowser\/([\w\.]+)/i],[y,[p,q+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[y,[p,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[p,"Sogou Mobile"],y],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[p,y],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[p],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[y,p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,le],y],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\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],[p,y],[/\bgsa\/([\w\.]+) .*safari\//i],[y,[p,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[y,[p,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[y,[p,te+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,te+" WebView"],y],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[y,[p,"Android "+X]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,y],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[y,[p,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[y,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[y,Re,Je]],[/(webkit|khtml)\/([\w\.]+)/i],[p,y],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],y],[/(wolvic|librewolf)\/([\w\.]+)/i],[p,y],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[y,[p,J+" 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,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[p,[y,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[p,[y,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[w,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[w,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[w,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[w,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[w,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[w,/ower/,i,ce]],[/ sun4\w[;\)]/i],[[w,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[w,ce]]],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],[h,[g,q],[m,k]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[h,[g,q],[m,b]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[h,[g,_],[m,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[h,[g,_],[m,k]],[/(macintosh);/i],[h,[g,_]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[h,[g,z],[m,b]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[h,[g,G],[m,k]],[/honor([-\w ]+)[;\)]/i],[h,[g,G],[m,b]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[h,[g,F],[m,k]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[h,[g,F],[m,b]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[h,/_/g," "],[g,Q],[m,k]],[/\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,/ ([\w ]+) miui\/v?\d/i],[[h,/_/g," "],[g,Q],[m,b]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[h,[g,O],[m,b]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[h,[g,Re,{OnePlus:["304","403","203"],"*":O}],[m,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[h,[g,"Vivo"],[m,b]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[h,[g,"Realme"],[m,b]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[h,[g,B],[m,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[h,[g,B],[m,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[h,[g,$],[m,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[h,[g,$],[m,b]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[h,[g,N],[m,k]],[/(nokia) (t[12][01])/i],[g,h,[m,k]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[h,/_/g," "],[m,b],[g,"Nokia"]],[/(pixel (c|tablet))\b/i],[h,[g,L],[m,k]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[h,[g,L],[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],[h,[g,U],[m,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[h,"Xperia Tablet"],[g,U],[m,k]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[h,[g,j],[m,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[h,[g,M],[m,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[h,/(.+)/g,"Fire Phone $1"],[g,M],[m,b]],[/(playbook);[-\w\),; ]+(rim)/i],[h,g,[m,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[h,[g,P],[m,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[h,[g,T],[m,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[h,[g,T],[m,b]],[/(nexus 9)/i],[h,[g,"HTC"],[m,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[h,/_/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],[h,[g,"TCL"],[m,k]],[/(itel) ((\w+))/i],[[g,ce],h,[m,Re,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[h,[g,"Acer"],[m,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[h,[g,"Meizu"],[m,b]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[h,[g,"Ulefone"],[m,b]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[h,[g,"Energizer"],[m,b]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[h,[g,"Cat"],[m,b]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[h,[g,"Smartfren"],[m,b]],[/droid.+; (a(?:015|06[35]|142p?))/i],[h,[g,"Nothing"],[m,b]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[h,[g,"Archos"],[m,k]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[h,[g,"Archos"],[m,b]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[g,h,[m,k]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[g,h,[m,b]],[/(kobo)\s(ereader|touch)/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],[g,h,[m,k]],[/(surface duo)/i],[h,[g,H],[m,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[h,[g,"Fairphone"],[m,b]],[/(u304aa)/i],[h,[g,"AT&T"],[m,b]],[/\bsie-(\w*)/i],[h,[g,"Siemens"],[m,b]],[/\b(rct\w+) b/i],[h,[g,"RCA"],[m,k]],[/\b(venue[\d ]{2,7}) b/i],[h,[g,"Dell"],[m,k]],[/\b(q(?:mv|ta)\w+) b/i],[h,[g,"Verizon"],[m,k]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[h,[g,"Barnes & Noble"],[m,k]],[/\b(tm\d{3}\w+) b/i],[h,[g,"NuVision"],[m,k]],[/\b(k88) b/i],[h,[g,"ZTE"],[m,k]],[/\b(nx\d{3}j) b/i],[h,[g,"ZTE"],[m,b]],[/\b(gen\d{3}) b.+49h/i],[h,[g,"Swiss"],[m,b]],[/\b(zur\d{3}) b/i],[h,[g,"Swiss"],[m,k]],[/\b((zeki)?tb.*\b) b/i],[h,[g,"Zeki"],[m,k]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],h,[m,k]],[/\b(ns-?\w{0,9}) b/i],[h,[g,"Insignia"],[m,k]],[/\b((nxa|next)-?\w{0,9}) b/i],[h,[g,"NextBook"],[m,k]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],h,[m,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],h,[m,b]],[/\b(ph-1) /i],[h,[g,"Essential"],[m,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[h,[g,"Envizen"],[m,k]],[/\b(trio[-\w\. ]+) b/i],[h,[g,"MachSpeed"],[m,k]],[/\btu_(1491) b/i],[h,[g,"Rotor"],[m,k]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[h,[g,E],[m,k]],[/(sprint) (\w+)/i],[g,h,[m,b]],[/(kin\.[onetw]{3})/i],[[h,/\./g," "],[g,H],[m,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[h,[g,D],[m,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[h,[g,D],[m,b]],[/smart-tv.+(samsung)/i],[g,[m,x]],[/hbbtv.+maple;(\d+)/i],[[h,/^/,"SmartTV"],[g,q],[m,x]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,$],[m,x]],[/(apple) ?tv/i],[g,[h,_+" TV"],[m,x]],[/crkey/i],[[h,te+"cast"],[g,L],[m,x]],[/droid.+aft(\w+)( bui|\))/i],[h,[g,M],[m,x]],[/(shield \w+ tv)/i],[h,[g,E],[m,x]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[h,[g,z],[m,x]],[/(bravia[\w ]+)( bui|\))/i],[h,[g,U],[m,x]],[/(mi(tv|box)-?\w+) bui/i],[h,[g,Q],[m,x]],[/Hbbtv.*(technisat) (.*);/i],[g,h,[m,x]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,Oe],[h,Oe],[m,x]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[h,[m,x]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,x]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,h,[m,S]],[/droid.+; (shield)( bui|\))/i],[h,[g,E],[m,S]],[/(playstation \w+)/i],[h,[g,U],[m,S]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[h,[g,H],[m,S]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[h,[g,q],[m,C]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[g,h,[m,C]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[h,[g,O],[m,C]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[h,[g,_],[m,C]],[/(opwwe\d{3})/i],[h,[g,j],[m,C]],[/(moto 360)/i],[h,[g,B],[m,C]],[/(smartwatch 3)/i],[h,[g,U],[m,C]],[/(g watch r)/i],[h,[g,$],[m,C]],[/droid.+; (wt63?0{2,3})\)/i],[h,[g,D],[m,C]],[/droid.+; (glass) \d/i],[h,[g,L],[m,C]],[/(pico) (4|neo3(?: link|pro)?)/i],[g,h,[m,C]],[/; (quest( \d| pro)?)/i],[h,[g,le],[m,C]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[m,I]],[/(aeobc)\b/i],[h,[g,M],[m,I]],[/(homepod).+mac os/i],[h,[g,_],[m,I]],[/windows iot/i],[[m,I]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[h,[m,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[h,[m,k]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,b]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[h,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[y,[p,W+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[p,y],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[y,[p,"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],[p,y],[/ladybird\//i],[[p,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[y,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,y],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[p,[y,Re,ot]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[y,Re,ot],[p,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[y,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,ve],[y,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[y,p],[/(ubuntu) ([\w\.]+) like android/i],[[p,/(.+)/,"$1 Touch"],y],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[p,y],[/\(bb(10);/i],[y,[p,P]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[y,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[y,[p,J+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[y,[p,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[y,[p,"watchOS"]],[/crkey\/([\d\.]+)/i],[y,[p,te+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[p,ue],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)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[p,y],[/(sunos) ?([\w\.\d]*)/i],[[p,"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],[p,y]]},Ce=function(he,ye){if(typeof he===u&&(ye=he,he=o),!(this instanceof Ce))return new Ce(he,ye).getResult();var ae=typeof n!==c&&n.navigator?n.navigator:o,se=he||(ae&&ae.userAgent?ae.userAgent:i),Ne=ae&&ae.userAgentData?ae.userAgentData:o,ge=ye?Ae(Pe,ye):Pe,ee=ae&&ae.userAgent==se;return this.getBrowser=function(){var Y={};return Y[p]=o,Y[y]=o,fe.call(Y,se,ge.browser),Y[f]=Se(Y[y]),ee&&ae&&ae.brave&&typeof ae.brave.isBrave==s&&(Y[p]="Brave"),Y},this.getCPU=function(){var Y={};return Y[w]=o,fe.call(Y,se,ge.cpu),Y},this.getDevice=function(){var Y={};return Y[g]=o,Y[h]=o,Y[m]=o,fe.call(Y,se,ge.device),ee&&!Y[m]&&Ne&&Ne.mobile&&(Y[m]=b),ee&&Y[h]=="Macintosh"&&ae&&typeof ae.standalone!==c&&ae.maxTouchPoints&&ae.maxTouchPoints>2&&(Y[h]="iPad",Y[m]=k),Y},this.getEngine=function(){var Y={};return Y[p]=o,Y[y]=o,fe.call(Y,se,ge.engine),Y},this.getOS=function(){var Y={};return Y[p]=o,Y[y]=o,fe.call(Y,se,ge.os),ee&&!Y[p]&&Ne&&Ne.platform&&Ne.platform!="Unknown"&&(Y[p]=Ne.platform.replace(/chrome os/i,ue).replace(/macos/i,ve)),Y},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 se},this.setUA=function(Y){return se=typeof Y===d&&Y.length>R?Oe(Y,R):Y,this},this.setUA(se),this};Ce.VERSION=r,Ce.BROWSER=Z([p,y,f]),Ce.CPU=Z([w]),Ce.DEVICE=Z([h,g,m,S,b,x,k,C,I]),Ce.ENGINE=Ce.OS=Z([p,y]),e.exports&&(t=e.exports=Ce),t.UAParser=Ce;var Le=typeof n!==c&&(n.jQuery||n.Zepto);if(Le&&!Le.ua){var Me=new Ce;Le.ua=Me.getResult(),Le.ua.get=function(){return Me.getUA()},Le.ua.set=function(he){Me.setUA(he);var ye=Me.getResult();for(var ae in ye)Le.ua[ae]=ye[ae]}}})(typeof window=="object"?window:bk)})(dd,dd.exports);var g5=dd.exports;const Sr=new g5.UAParser,v5=()=>V.useMemo(()=>({os:Sr.getOS(),browser:Sr.getBrowser(),cpu:Sr.getCPU(),device:Sr.getDevice(),engine:Sr.getEngine(),ua:Sr.getUA()}),[]),y5=()=>V.useMemo(()=>Sr.getBrowser(),[]),_f=()=>{const{ua:e}=v5();return e.includes("io-connect-desktop")},G1=()=>{const[e,t]=v.useState([]),[n,o]=v.useState(!1),r=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!r)return;let i=!1;const a=[],s=r.layouts.onAdded(d=>{if(d.type!=="Global"||i)return;o(!0);const{name:f}=d;t(h=>[...h,{name:f}])}),c=r.layouts.onRemoved(d=>{d.type!=="Global"||i||t(f=>f.filter(h=>h.name!==d.name))}),u=r.layouts.onRenamed((d,f)=>{if(d.type!=="Global"||i)return;const{name:h}=d;t(p=>{const m=p.findIndex(g=>g.name===(f==null?void 0:f.name));return m===-1?p:[...p.slice(0,m),{name:h},...p.slice(m+1)]})});return a.push(s,c,u),()=>{i=!0,a.forEach(d=>d())}},[r]),{layouts:e,isInitialized:n}},q1=()=>{const[e,t]=v.useState([]),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=n.notifications.onRaised(a=>t(s=>[...s,a])),r=n.notifications.onClosed(a=>t(s=>s.filter(c=>c.id!==a.id))),i=n.notifications.onStateChanged(({id:a},s)=>{t(c=>{const u=c.findIndex(d=>d.id===a);return u===-1?c:[...c.slice(0,u),{...c[u],state:s},...c.slice(u+1)]})});return n.notifications.list().then(t).catch(console.error),()=>{o(),r(),i()}},[n]),e},w5=()=>{const[e,t]=v.useState({}),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{if(!n)return;const o=n.notifications.onConfigurationChanged(r=>t(r));return()=>{o()}},[n]),e},Tf=e=>{const{handler:t,skip:n}=e;v.useEffect(()=>{if(n)return;const o=r=>{setTimeout(()=>{var i;((i=document.activeElement)==null?void 0:i.nodeName)==="IFRAME"&&t(r)},0)};return window.addEventListener("blur",o,!0),()=>{window.removeEventListener("blur",o,!0)}},[t,n])},Nf=e=>{const{eventType:t,handler:n,ref:o,skip:r}=e;v.useEffect(()=>{if(r)return;const i=a=>{const s=a.target;(Array.isArray(o)?o.every(u=>u.current&&!u.current.contains(s)):o.current&&!o.current.contains(s))&&n(a)};return document.addEventListener(t,i,!0),()=>{document.removeEventListener(t,i,!0)}},[t,n,o,r])},b5=dt({name:qt}),za=dt({isCompleted:Ni()}),Xn=(e,t,n)=>{const[o,r]=v.useState(()=>{try{const s=window[e].getItem(t);return s?JSON.parse(s):null}catch(s){return console.log(s),null}}),i=`${e}-${t}`;v.useEffect(()=>{const s=c=>{r(c.detail)};return window.addEventListener(i,s),()=>{window.removeEventListener(i,s)}},[i]);const a=v.useCallback(s=>{try{if(!s){window[e].removeItem(t),r(null);return}const c=n.run(s);if(!c.ok){console.warn(`Error validating the value to be stored: ${c.error.message}`);return}const u=c.result;r(u),window[e].setItem(t,JSON.stringify(u)),window.dispatchEvent(new CustomEvent(i,{detail:u}))}catch(c){console.log(c)}},[t,e,i,n]);return[o,a]},If=()=>{const[e,t]=Xn("sessionStorage",V3,b5);return{isPlatformWindow:!e||window.name===e.name,setPlatformWindow:t}},J1=()=>{const[e,t]=v.useState([]);return v.useEffect(()=>{const n=({key:i})=>{t(a=>a.includes(i)?a:a.concat(i))},o=i=>{t(a=>a.filter(s=>s!==i.key))},r=()=>{t([])};return document.addEventListener("keydown",n),document.addEventListener("keyup",o),window.addEventListener("blur",r),()=>{document.removeEventListener("keydown",n),document.removeEventListener("keyup",o),window.removeEventListener("blur",r)}},[]),e.length===1?e[0]:null},Rf=()=>{const e=v.useContext(Te.IOConnectContext);return v.useCallback(async(t,n)=>{if(e)try{await e.layouts.restore({name:t}),n==null||n({name:t}),await Fe({io:e,variant:Be.SUCCESS,text:`Layout "${t}" was loaded successfully.`})}catch(o){await Fe({io:e,variant:Be.WARNING,text:`Failed to load Layout "${t}".`,error:o})}},[e])},nl={CONTROL:"Control",SHIFT:"Shift"},Lf=()=>{const e=v.useContext(Te.IOConnectContext),t=Af();return async({id:n,modifier:o,reuseWorkspaceId:r})=>{var i;try{const a=o===nl.CONTROL?{newFrame:!0}:{frameId:t,reuseWorkspaceId:r};await((i=e.workspaces)==null?void 0:i.restoreWorkspace(n,a))}catch(a){await Fe({io:e,variant:Be.WARNING,text:`Failed to load Workspace "${n}".`,error:a})}}},x5=e=>{const[t,n]=v.useState([]),[o,r]=v.useState(!0),i=v.useRef(null),a=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{const s=a==null?void 0:a.search;if(!s)return;const c=[],u=[];return(async f=>{r(!0),n([]);const h=await s.query({search:f.trim(),providerLimits:{maxResults:100,maxResultsPerType:5}});if(h===i.current)return;i.current=h;const p=h.onResults(y=>{y.results.forEach(w=>{u.find(b=>b.id===w.id&&b.type.name===w.type.name)||u.push(w)}),r(!1),n([...u])}),m=h.onCompleted(()=>{r(!1)}),g=h.onError(y=>{console.error(`Query failed. Provider: ${y.provider}; Error: ${y.error}`)});c.push(p,m,g)})(e),()=>{c.forEach(f=>f())}},[a,e]),{resultsToRender:t,isLoading:o}},Z1=()=>{const e=v.useContext(Te.IOConnectContext),t=async({id:o})=>{var r;await((r=e.appManager.application(o))==null?void 0:r.start())},n=async({id:o,modifier:r})=>{var u,d;const i=await((u=e.workspaces)==null?void 0:u.getWorkspace(f=>f.isSelected===!0)),a=i==null?void 0:i.children[0];if(r===nl.CONTROL||!i||(a==null?void 0:a.type)==="window"){await((d=e.appManager.application(o))==null?void 0:d.start());return}await((a==null?void 0:a.type)==="group"?a:await(a??i).addGroup()).addWindow({appName:o})};return async o=>{try{await(p1()?t:n)(o)}catch(r){await Fe({io:e,variant:Be.WARNING,text:`Failed to start app "${o.title}".`,error:r})}}},S5=()=>{const[e,t]=v.useState({}),n=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{const o=n.workspaces,r=[];if(o)return(async()=>{try{const i=await o.onWorkspaceOpened(s=>t(c=>{const u={...c};return u[s.title]=u[s.title]??new Set,u[s.title].add(s.id),u})),a=await o.onWorkspaceClosed(({workspaceId:s})=>t(c=>{const u={...c};for(const d in u)if(u[d].has(s)){u[d].delete(s);break}return u}));r.push(i,a)}catch(i){console.error(i)}})(),()=>r.forEach(i=>i==null?void 0:i())},[n]),e},Y1=e=>e.key==="Enter"||e.key===" ",ol=(e,t)=>typeof e>"u"?{}:{tabIndex:0,onClick:e,onKeyDown:n=>{Y1(n)&&(n.preventDefault(),e==null||e(n)),t==null||t(n)}},X1=({event:e,currentIndex:t,moveFocus:n,min:o,max:r,onClose:i})=>{switch(e.key){case"ArrowUp":{n(Math.max(t-1,o));break}case"ArrowDown":{n(Math.min(t+1,r));break}case"Home":{n(o);break}case"End":{n(r);break}case"Escape":{if(i){i();break}return}default:return}e.stopPropagation(),e.preventDefault()};const k5=v.forwardRef((e,t)=>{const{title:n,actions:o,className:r,onClose:i,onActionItemClick:a,"data-testid":s="context-menu",...c}=e,u=v.useRef({}),[d,f]=v.useState(0),h=p=>{var m;(m=u.current[p])==null||m.focus(),f(p)};return v.useEffect(()=>{var p;(p=u.current[d])==null||p.focus()},[]),l.jsxs(gt,{ref:t,className:pt(r,"context-menu"),onClick:p=>p.stopPropagation(),onKeyDown:p=>X1({event:p,currentIndex:d,min:0,max:o.length-1,moveFocus:h,onClose:i}),"data-testid":s,...c,children:[n&&l.jsx(gt.ItemSection,{children:n}),o.map((p,m)=>{const g=p.displayName||p.name,y=p.iconSrc?l.jsx(Dd,{size:"16",src:p.iconSrc,alt:`${g} icon`}):p.icon&&l.jsx(xt,{size:"16",variant:p.icon});return l.jsxs(v.Fragment,{children:[l.jsx(gt.Item,{ref:w=>u.current[m]=w,prepend:y,disabled:p.disabled,tabIndex:-1,...ol(w=>a(w,p)),"data-testid":`${s}-item-${p.name}`,children:g}),p.separatorAfter&&l.jsx("li",{className:"context-menu-separator","aria-hidden":!0,"data-testid":`${s}-separator`})]},p.name)})]})});function Df(e){const{title:t,buttonSize:n="16",icon:o="ellipsis-vertical",iconSize:r="12",actions:i,isTabStop:a,onActionItemClick:s,buttonVariant:c,placement:u,strategy:d,offset:f,shouldCloseOnOutsideScroll:h=!1,shouldCloseOnWindowBlur:p=!1,shouldCloseOnWindowResize:m=!1,"data-testid":g,contextMenuDataTestId:y}=e,[w,S]=v.useState(!1),[b,k]=v.useState(null),[x,C]=v.useState(null),I=v.useRef(null),R=v.useRef(null),M=v.useMemo(()=>[R,I],[]),_=v.useCallback(()=>S(!1),[]),{styles:T,attributes:P}=a3(b,x,{placement:u,strategy:d,modifiers:[{name:"offset",options:{offset:f}}]});v.useEffect(()=>{I.current=b},[b]),v.useEffect(()=>{R.current=x},[x]),Nf({eventType:"mouseup",handler:_,ref:M,skip:!w}),Tf({handler:_,skip:!w}),v.useEffect(()=>{if(!(!p||!w))return window.addEventListener("blur",_),()=>{window.removeEventListener("blur",_)}},[_,w,p]),v.useEffect(()=>{if(!h||!x)return;const W=J=>{if(x.contains(J.target)){J.preventDefault();return}_()};return document.addEventListener("touchmove",W,{passive:!1}),document.addEventListener("wheel",W,{passive:!1}),()=>{document.removeEventListener("touchmove",W),document.removeEventListener("wheel",W)}},[_,x,h]),v.useEffect(()=>{if(!(!m||!w))return window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}},[_,w,m]);const X=W=>{W.stopPropagation(),S(J=>!J),x==null||x.focus()},te=(W,J)=>{W.stopPropagation(),s(W,J),_()};return l.jsxs(l.Fragment,{children:[l.jsx(Ue,{ref:k,size:n,icon:o,iconSize:r,variant:c,...ol(X),tabIndex:a?0:-1,"data-testid":g}),w&&l.jsx(k5,{ref:C,title:t,actions:i,onActionItemClick:te,onClose:()=>{b==null||b.focus(),_()},style:T.popper,"data-testid":y,...P.popper})]})}const C5=e=>{const{isFavoritismEnabled:t=!0,item:n,onClick:o,onKeyDown:r,isFocused:i,liRef:a,...s}=e,{favorites:c,toggleFavorite:u,isLoading:d}=tl(),{description:f,icon:h="application",iconSrc:p,openInstances:m=0,title:g,tooltip:y,className:w,contextMenuActions:S=[]}=n,b=t&&c.some(I=>I.type===n.type&&I.title===n.title),k=I=>{if(Y1(I)){o(I),I.preventDefault(),I.stopPropagation();return}r(I)},x=p?l.jsx(Dd,{size:"16",src:p,alt:`${g} icon`,"data-testid":"base-section-item-icon"}):l.jsx(xt,{size:"16",variant:h,"data-testid":"base-section-item-icon"}),C=l.jsxs(l.Fragment,{children:[m!==0&&l.jsx("span",{className:"open-instances io-text-smaller","data-testid":"base-section-item-open-instances",children:m===1?"Opened":`${m} opened`}),(t||S.length>0)&&l.jsxs(De,{className:"item-actions",children:[t&&l.jsx(Ue,{...ol(I=>{I.stopPropagation(),u(n)}),tabIndex:i?0:-1,size:"24",iconSize:"12",icon:b?"star-full":"star",disabled:d,"data-testid":"base-section-item-favorite-button"}),S.length>0&&l.jsx(Df,{buttonSize:"24",iconSize:"12",icon:"ellipsis-vertical",title:g,actions:S,onActionItemClick:o,isTabStop:i,placement:"bottom-end",offset:[0,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0,shouldCloseOnWindowResize:!0,"data-testid":"base-section-item-context-menu-button"})]})]});return l.jsx(gt.Item,{ref:a,tabIndex:i?0:-1,className:pt("io-base-section-item",w),onKeyDown:k,onClick:o,prepend:x,append:C,description:f,tooltip:y??g,"data-testid":`base-section-item-${n.id}`,...s,children:g})},E5=new U1,j5=()=>{const{value:e,update:t}=Nt({prefKey:Wr.COLLAPSED_SECTIONS}),n=v.useCallback(o=>E5.enqueue(()=>t((r=[])=>r.includes(o)?r.filter(a=>a!==o):[...r,o])),[t]);return{collapsedSections:e,toggleSection:n}},Mf=e=>{const{config:t,level:n=1,path:o=t.id,onItemClick:r}=e,{isCollapsible:i=!0,getIcon:a}=t,s=J1(),[c,u]=v.useState(0),d=v.useRef({}),{collapsedSections:f,toggleSection:h}=j5(),p=i?!(f!=null&&f.includes(o)):!0,m=t.items.filter(x=>ua(x)),g=t.items.filter(x=>!ua(x)),y=[...m,...g],w=16,S=24,b=x=>{var C,I;(I=(C=d.current[x])==null?void 0:C.querySelector("[tabIndex]"))==null||I.focus(),u(x)},k=async()=>{i&&await h(o)};return l.jsxs(gt.ItemWithSubItems,{className:n===1?"main-section":void 0,"data-testid":`base-section-${t.id}`,children:[l.jsx(_3,{className:n===1?"io-list-item-title main-section-header":void 0,isOpen:p,onClick:k,showCollapseIcon:i,showFolderIcon:n!==1,getIcon:a,style:{paddingLeft:`${w+S*Math.max(0,n-2)}px`},"data-testid":`base-section-header-${t.id}`,title:t.title}),l.jsx(L1,{isOpen:p,tag:gt,children:y.map((x,C)=>ua(x)?l.jsx(Mf,{config:x,level:n+1,onItemClick:r,path:`${o}/${x.id}`},x.id):l.jsx(C5,{style:{paddingLeft:`${w+S*(n-1)}px`},liRef:I=>d.current[C]=I,isFavoritismEnabled:x.type===It.APPLICATION||x.type===It.WORKSPACE,item:x,onClick:(I,R)=>r==null?void 0:r(I,{item:x,modifier:s,selectedContextMenuActionName:R==null?void 0:R.name}),onKeyDown:I=>{X1({event:I,moveFocus:b,currentIndex:c,min:0,max:y.length-1})},isFocused:c===C},x.id))})]})},Q1=e=>`${e.type}-${e.id}`,A5=(e,t)=>ew(e)[t],ew=e=>e.reduce((t,n)=>ua(n)?{...t,...ew(n.items)}:{...t,[Q1(n)]:n},{}),tw=v.createContext(void 0),O5=()=>{const e=v.useContext(tw);if(e===void 0)throw new Error("useSection must be used within a SectionProvider");return e},P5=({children:e})=>{const[t,n]=v.useState(null),o=v.useMemo(()=>[t,n],[t]);return l.jsx(tw.Provider,{value:o,children:e})},rl=({config:e,onItemClick:t})=>{const[n,o]=O5(),r=$n(),{isLaunchpadPinned:i}=Fr(),a=(s,c)=>{const{item:u,modifier:d,selectedContextMenuActionName:f}=c;o({itemName:Q1(u),modifier:d,selectedContextMenuActionName:f})};return v.useEffect(()=>{var f;if(!t||!n)return;const{itemName:s,modifier:c,selectedContextMenuActionName:u}=n,d=A5(e.items,s);d&&(t({item:d,modifier:c,selectedContextMenuActionName:u}),o(null),!(c===nl.SHIFT||i)&&((f=r.close)==null||f.call(r)))},[n,e.items,r,t,o,i]),l.jsx(Mf,{config:e,onItemClick:a})};function nw(e){const{isFolderCollapsible:t,isSectionCollapsible:n,sortOrder:o,folderIconGetters:r}=e,i=D1(),a=T3(),s=Z1(),c=M1(),u=v.useMemo(()=>wk(i,a,{isFolderCollapsible:t,isSectionCollapsible:n,sortOrder:o,folderIconGetters:r}),[i,a,t,n,o,r]),d=f=>{const{item:h,modifier:p,selectedContextMenuActionName:m}=f;if(!m)return s({id:h.id,title:h.title,modifier:p});c(h,m)};return l.jsx(rl,{config:u,onItemClick:d})}const _5=(e,t)=>{const{isSectionCollapsible:n,sortOrder:o=Ea.DISABLED}=t,r=mf({items:e,sortOrder:o,ascendingCompare:v1,descendingCompare:y1});return{id:vi.FAVORITES,title:"Favorites",items:r,isCollapsible:n}},ow=e=>{const{isSectionCollapsible:t,sortOrder:n}=e,{favorites:o}=tl(),{isFavoritesSectionHidden:r}=p5(),i=v.useMemo(()=>_5(o,{isSectionCollapsible:t,sortOrder:n}),[o,t,n]);return o.length>0&&!r?l.jsx(rl,{config:i}):null},T5=e=>{const{active:t,className:n,...o}=e;return l.jsx(Ue,{className:pt("launchpad-button",{active:t},n),"aria-label":"Launchpad",icon:"logo",variant:"circle",size:"32",title:t?"Close Launchpad":"Open Launchpad","data-testid":"launchpad-button",...o})};var N5=function(t){return I5(t)&&!R5(t)};function I5(e){return!!e&&typeof e=="object"}function R5(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||M5(e)}var L5=typeof Symbol=="function"&&Symbol.for,D5=L5?Symbol.for("react.element"):60103;function M5(e){return e.$$typeof===D5}function $5(e){return Array.isArray(e)?[]:{}}function Pa(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Ii($5(e),e,t):e}function H5(e,t,n){return e.concat(t).map(function(o){return Pa(o,n)})}function B5(e,t){if(!t.customMerge)return Ii;var n=t.customMerge(e);return typeof n=="function"?n:Ii}function W5(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Jp(e){return Object.keys(e).concat(W5(e))}function rw(e,t){try{return t in e}catch{return!1}}function F5(e,t){return rw(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function z5(e,t,n){var o={};return n.isMergeableObject(e)&&Jp(e).forEach(function(r){o[r]=Pa(e[r],n)}),Jp(t).forEach(function(r){F5(e,r)||(rw(e,r)&&n.isMergeableObject(t[r])?o[r]=B5(r,n)(e[r],t[r],n):o[r]=Pa(t[r],n))}),o}function Ii(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||H5,n.isMergeableObject=n.isMergeableObject||N5,n.cloneUnlessOtherwiseSpecified=Pa;var o=Array.isArray(t),r=Array.isArray(e),i=o===r;return i?o?n.arrayMerge(e,t,n):z5(e,t,n):Pa(t,n)}Ii.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(o,r){return Ii(o,r,n)},{})};var U5=Ii,K5=U5;const V5=Xc(K5),G5={header:{showHeader:!0,showSearch:!0},mode:"default"},Zo={WINDOW_MANAGEMENT:"window-management",NOTIFICATIONS:"notifications"},il="getScreenDetails"in window,iw=v.createContext(void 0),aw=()=>{const e=v.useContext(iw);if(e===void 0)throw new Error("useLaunchpadConfig must be used within an LaunchpadConfigProvider");return e},q5=({children:e,settings:t,components:n})=>{const o=v.useMemo(()=>({settings:t,components:n}),[t,n]);return l.jsx(iw.Provider,{value:o,children:e})},sw=v.createContext(void 0),cw=()=>{const e=v.useContext(sw);if(e===void 0)throw new Error("useLaunchpadSearch must be used within a LaunchpadSearchProvider");return e},J5=({children:e})=>{const[t,n]=v.useState(""),o=v.useMemo(()=>({searchTerm:t,setSearchTerm:n}),[t]);return l.jsx(sw.Provider,{value:o,children:e})},lw=({settings:e={},components:t={},isOpen:n=!0,onClose:o,windowManagementPermissionState:r="granted",children:i,className:a,...s})=>{const c=il&&r==="granted",u=v.useMemo(()=>V5(G5,e),[e]);return l.jsx(c5,{close:o,isOpen:n,isGlobalLayoutsAvailable:c,children:l.jsx(q5,{settings:u,components:t,children:l.jsx(J5,{children:l.jsx("div",{className:pt("launchpad",a),"data-testid":"launchpad",...s,children:i})})})})},Z5=v.forwardRef((e,t)=>{const{onSearch:n,searchTerm:o,onClear:r,className:i}=e,a=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{a!=null&&a.search&&a.search.setDebounceMS(450)},[a]),l.jsx(er,{id:"search-input",className:pt("search-bar",i),ref:t,placeholder:"Find anything",value:o,onChange:n,autoComplete:"off",iconPrepend:"search",iconAppend:o.length?"close":void 0,iconAppendOnClick:r})}),uw=({className:e})=>{const{isLaunchpadPinned:t,isLoading:n,toggle:o}=Fr();return l.jsx(Ue,{className:e,size:"32",variant:"circle",icon:t?"unpin":"pin",onClick:o,disabled:n})},dw=({className:e})=>{const t=Af(),{isOpen:n}=$n(),{settings:o,components:r}=aw(),{isLaunchpadPinned:i}=Fr(),{isLaunchpadCollapsed:a,setIsLaunchpadCollapsed:s}=Pf(),{searchTerm:c,setSearchTerm:u}=cw(),d=v.useRef(null),{showSearch:f,showHeader:h}=o.header??{},{BeforeSearch:p,AfterSearch:m}=r.header??{};v.useEffect(()=>{var w;n&&((w=d.current)==null||w.focus())},[n]),v.useEffect(()=>{i&&s(!1)},[s,i]);const g=w=>{const S=w.target.value;B1(S)&&a&&s(!1),u(S)},y=()=>{var w;u(""),(w=d.current)==null||w.focus()};return h?l.jsxs("div",{className:pt("launchpad-header",t||i?void 0:"draggable",e),"data-testid":"launchpad-header",children:[p&&l.jsx(p,{}),f&&l.jsx(Z5,{ref:d,searchTerm:c,onSearch:g,onClear:y,className:t?void 0:"non-draggable"}),m&&l.jsx(m,{}),m===void 0&&(o==null?void 0:o.mode)!=="pinned"&&l.jsx(uw,{className:"ms-auto"})]}):null},Y5=(e,t,n)=>{const{isSectionCollapsible:o,sortOrder:r=Ea.ASCENDING}=n,a=mf({items:e,sortOrder:r,ascendingCompare:v1,descendingCompare:y1}).map(s=>{var c;return{...s,type:It.WORKSPACE,icon:"workspace",openInstances:(c=t[s.title])==null?void 0:c.size,contextMenuActions:g1}});return{id:vi.WORKSPACES,title:"Workspaces",items:[...a,{id:z1.CREATE_WORKSPACE,icon:"add",title:"Create Workspace",type:It.ACTION_BUTTON,tooltip:"Create an empty Workspace in a new window",className:"create-workspace-btn"}],isCollapsible:o}},fw=e=>{const{isSectionCollapsible:t,sortOrder:n}=e,o=K1(),r=S5(),i=Lf(),a=V1(),s=v.useMemo(()=>Y5(o,r,{isSectionCollapsible:t,sortOrder:n}),[o,r,t,n]),c=u=>{const{item:d,modifier:f,selectedContextMenuActionName:h}=u;return h?a(d,h):d.type===It.ACTION_BUTTON?a(d,d.id):i({id:d.id,modifier:f})};return l.jsx(rl,{config:s,onItemClick:c})},X5=[{placementId:vi.FAVORITES,Component:ow},{placementId:vi.WORKSPACES,Component:fw},{placementId:vi.APPLICATIONS,Component:nw}],hw=()=>{const{defaultLayout:e,activeLayout:t}=$n();return n=>({name:n,isDefault:n===(e==null?void 0:e.name),isActive:n===(t==null?void 0:t.name)})},Q5=()=>{const e=F1(),t=hw(),n=Wi();return async(o,r)=>{const{id:i}=o,a=t(i);await n(()=>e({layout:a,actionName:r}))}},eE=()=>{const e=M1(),t=V1(),n=Q5();return o=>{if(o===It.APPLICATION)return e;if(o===It.WORKSPACE)return t;if(o===It.LAYOUT)return n}},Jr={RENAME:"rename",SAVE:"save",SAVE_AS:"saveAs",DELETE:"delete",SET_AS_DEFAULT:"setAsDefault",LOAD:"load"},pw=e=>[{name:Jr.RENAME,displayName:"Rename",icon:"pen-line"},{name:Jr.SAVE,displayName:"Save",disabled:!e.isActive,icon:"floppy"},{name:Jr.SAVE_AS,displayName:"Save as",icon:"floppy-disk-pen",separatorAfter:!0},{name:Jr.DELETE,displayName:"Delete",icon:"trash-can",separatorAfter:!0},{name:Jr.SET_AS_DEFAULT,displayName:"Set as Default",disabled:e.isDefault,icon:"user-gear",separatorAfter:!0},{name:Jr.LOAD,displayName:"Load",icon:"spinner"}],tE=e=>{const t=hw();return e.reduce((n,o)=>{const{type:r}=o,i=o.id||o.displayName;if(!i)return n;let a=[];if(r.name===It.APPLICATION)a=m1;else if(r.name===It.WORKSPACE)a=g1;else if(r.name===It.LAYOUT){const d=t(i);a=pw(d)}else o.secondaryActions&&(a=o.secondaryActions.map(({name:d,method:f,params:h,target:p})=>({name:d,interopParams:{method:f,params:h,target:p}})));const s={id:i,title:o.displayName||i,description:o.description,type:r.name,iconSrc:o.iconURL,mainAction:o.action,contextMenuActions:a},c=n.findIndex(({title:d})=>r.displayName?d===r.displayName:d===r.name),u=n[c];return u?[...n.slice(0,c),{...u,items:[...u.items,s]},...n.slice(c+1)]:[...n,{id:r.name,title:r.displayName||r.name,items:[s]}]},[])};function nE(e){const{resultsToRender:t,isLoading:n}=x5(e.searchTerm),{close:o}=$n(),r=h5(),i=Lf(),a=Z1(),s=Rf(),c=eE(),u=tE(t),d=Wi(),{isLaunchpadPinned:f}=Fr(),h=(m,g)=>{const y=c(m.type);y==null||y(m,g)},p=async(m,g)=>{var R;const{item:y,modifier:w,selectedContextMenuActionName:S}=g,{type:b,id:k,title:x,mainAction:C}=y,I=S?(R=y.contextMenuActions)==null?void 0:R.find(M=>M.name===S):null;I!=null&&I.interopParams?r(I.interopParams):S?h(y,S):C?r(C):b===It.APPLICATION?a({id:k,title:x,modifier:w}):b===It.WORKSPACE?i({id:k,modifier:w}):b===It.LAYOUT&&d(()=>s(k)),!(w===nl.SHIFT||f)&&(o==null||o())};return n?l.jsx("p",{className:"search-loading",children:"Loading..."}):t.length===0?l.jsx("p",{className:"search-no-results",children:"No results found. Try searching by app name, workspace title, or keywords."}):l.jsx(gt,{children:u.map((m,g)=>l.jsx(Mf,{config:m,onItemClick:p},m.id||g))})}const oE=()=>{const{value:e,update:t,isLoading:n,error:o}=Nt({prefKey:Wr.IS_LAYOUTS_PANEL_OPEN});return{error:o,isLayoutsPanelOpen:e,setIsLayoutsPanelOpen:t,isLoading:n}},rE=({layoutName:e})=>{const t=v.useContext(Te.IOConnectContext),n=Wi(),o=r=>{r.stopPropagation(),n(async()=>{try{await t.layouts.save({name:e,type:"Global"}),await Fe({io:t,variant:Be.SUCCESS,text:`Layout "${e}" was saved successfully.`})}catch(a){await Fe({io:t,variant:Be.WARNING,text:`Failed to save Layout "${e}".`,error:a})}})};return l.jsx(Ue,{icon:"floppy",size:"24",iconSize:"12",onClick:o,title:"Save Layout","data-testid":"save-layout-button"})},iE=({layout:e})=>{const t=F1(),n=Wi(),o=async(r,i)=>{r.stopPropagation(),await n(()=>t({layout:e,actionName:i.name}))};return l.jsx(Df,{buttonSize:"24",iconSize:"12",title:e.name,icon:"ellipsis-vertical",actions:pw(e),onActionItemClick:o,placement:"top-end",strategy:"fixed",offset:[4,0],shouldCloseOnOutsideScroll:!0,shouldCloseOnWindowBlur:!0,shouldCloseOnWindowResize:!0,"data-testid":"layout-context-menu-button",contextMenuDataTestId:"layout-context-menu"})};const mw=({layouts:e,className:t,...n})=>{const{isLaunchpadPinned:o}=Fr(),{close:r}=$n(),i=Rf(),a=Wi(),s=()=>{o||r==null||r()},c=u=>a(()=>i(u.name,s));return l.jsx(ir,{element:gt,elementProps:{className:pt("layouts-list",t),variant:"single",checkIcon:{variant:"check",tooltip:"Active Layout"},...n},wrapperClassName:"layouts-list-scrollable-container",children:e.map(u=>l.jsx(gt.Item,{className:"layouts-list-item",onClick:()=>c(u),append:l.jsxs(l.Fragment,{children:[u.isDefault&&l.jsx(Tc,{variant:"default",title:"Default Layout","data-testid":"default-layout-pill",children:"Default"}),l.jsxs(N1,{children:[u.isActive&&l.jsx(rE,{layoutName:u.name}),l.jsx(iE,{layout:u})]})]}),isSelected:u.isActive,tooltip:u.name,"data-testid":`layout-item-${u.name}`,children:u.name},u.name))})},aE=()=>{const{layouts:e}=G1(),{activeLayout:t,defaultLayout:n}=$n(),o=v.useMemo(()=>e.map(r=>({...r,isActive:r.name===(t==null?void 0:t.name),isDefault:r.name===(n==null?void 0:n.name)})),[e,t,n]);return l.jsx(mw,{layouts:o,"data-testid":"all-layouts"})},sE=()=>{const{defaultLayout:e,activeLayout:t}=$n();return t?l.jsx(mw,{layouts:[{...t,isDefault:t.name===(e==null?void 0:e.name),isActive:!0}],"data-testid":"active-layout"}):l.jsx("p",{className:"io-text-small no-active-layout","data-testid":"choose-layout-message",children:"Choose which Layout to load"})},cE=()=>{const e=v.useContext(Te.IOConnectContext),{setActiveLayout:t}=$n(),n=Wi(),o=async()=>{var f;if(!("modals"in e&&e.modals)){console.error("Cannot create Layout because io dialogs are not enabled");return}const r="create",i="layout-name",{isEnterPressed:a,responseButtonClicked:s,inputs:c}=await e.modals.dialogs.request({templateName:Bi.SINGLE_TEXT_INPUT_DIALOG,variables:{heading:"Create Layout",input:{id:i,initialValue:"Create Layout",validation:{disabledButtonIds:[r],errorMessage:"Please provide a Layout name",regexPattern:Of}},actionButtons:[{variant:"primary",text:"Create",id:r},{variant:"outline",text:"Cancel",id:"cancel"}]}}),u=(f=c==null?void 0:c.find(h=>h.id===i))==null?void 0:f.value;if(a||(s==null?void 0:s.id)===r)try{if((await e.layouts.getAll("Global")).find(p=>p.name===u)){await Fe({io:e,variant:Be.WARNING,text:`Failed to create Layout "${u}". A Layout with this name already exists.`});return}await e.layouts.save({name:u}),t({name:u}),await Fe({io:e,variant:Be.SUCCESS,text:`Layout "${u}" was created successfully.`})}catch(h){await Fe({io:e,variant:Be.WARNING,text:`Failed to create Layout "${u}".`,error:h})}};return l.jsx(De,{variant:"fullwidth",className:"create-layout-btn-group",children:l.jsx(et,{variant:"primary",text:"Create Layout",onClick:()=>n(o),"data-testid":"create-layout-button"})})};const lE=()=>{const e=v.useRef(null),{layouts:t,isInitialized:n}=G1(),{isLayoutsPanelOpen:o,setIsLayoutsPanelOpen:r}=oE();v.useEffect(()=>{!n||t.length>0||!o||r(!1)},[t,n,o,r]);const i=v.useCallback(()=>r(a=>!a),[r]);return l.jsxs("footer",{className:"layouts-panel",ref:e,"data-testid":"layouts-panel",children:[l.jsx(Di,{className:"layouts-panel-separator"}),l.jsxs("div",{className:"layouts-panel-header","aria-label":"Layouts panel","aria-expanded":o,role:"button","data-testid":"layouts-panel-header",...ol(t.length?i:void 0),children:[l.jsx(qn,{tag:"h2",size:"normal",text:t.length>0?"Layouts":"Start using Layouts"}),t.length>0&&l.jsx(Ue,{className:pt("layouts-panel-toggle-button",{"layouts-panel-toggle-button-rotated":o}),icon:"expand",iconSize:"12",size:"24","data-testid":"layouts-panel-toggle-button"})]}),l.jsx(L1,{isOpen:o,tag:"div",children:l.jsx(aE,{})}),t.length>0&&!o?l.jsx(sE,{}):l.jsx(cE,{})]})},gw=({className:e})=>{const{isLaunchpadCollapsed:t}=Pf(),{isGlobalLayoutsAvailable:n}=$n(),{components:o}=aw(),{searchTerm:r}=cw(),{sections:i=X5}=o;return l.jsxs("div",{className:pt("launchpad-body",t?"collapsed":void 0,e),children:[l.jsx(ir,{wrapperClassName:"launchpad-main-scrollable-container",element:"main",elementProps:{className:"launchpad-main"},children:B1(r)?l.jsx(nE,{searchTerm:r}):l.jsx(P5,{children:l.jsx(gt,{children:i.map(({Component:a,placementId:s})=>l.jsx(a,{},s))})})}),n&&l.jsx(lE,{})]})};const vw=e=>l.jsxs(lw,{...e,children:[l.jsx(dw,{}),l.jsx(gw,{})]}),yw=v.createContext(void 0),ww=()=>{const e=v.useContext(yw);if(e===void 0)throw new Error("useWorkspaceComponentsContext must be used within an WorkspaceComponentsContextProvider");return e},uE=()=>{const e=il?[Zo.NOTIFICATIONS,Zo.WINDOW_MANAGEMENT]:[Zo.NOTIFICATIONS];return Promise.all(e.map(async t=>{const n=await navigator.permissions.query({name:t});return n.stableName=t,n}))},bw=v.createContext(void 0),sr=()=>{const e=v.useContext(bw);if(e===void 0)throw new Error("useIOConnectHome must be used within an IOConnectHomeProvider");return e},dE=({children:e})=>{const[t,n]=Xn("localStorage",Fa,za),[o,r]=v.useState([]),i=v.useMemo(()=>o.reduce((f,h)=>({...f,[h.stableName]:{state:h.state}}),{}),[o]),a={isLoading:o.length===0,statuses:i},[s,c]=v.useState(!1),u={isLoggingOut:s,setIsLoggingOut:c};v.useEffect(()=>{let f=!1;const h=uE().then(p=>{if(f)return;r(p);const m=[];let g=!1;return p.forEach((y,w)=>{const S=b=>{if(f||!b.target||g)return;const k=b.target;if(k.state==="prompt")return n({isCompleted:!1}),g=!0,window.location.reload();r(C=>[...C.slice(0,w),k,...C.slice(w+1)])};y.addEventListener("change",S),m.push(()=>y.removeEventListener("change",S))}),m}).catch(console.warn);return()=>{f=!0,h.then(p=>{p==null||p.forEach(m=>m())})}},[n]);const d=v.useMemo(()=>({permission:a,login:u}),[a,u]);return l.jsx(bw.Provider,{value:d,children:e})},fE=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),l.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)"}),l.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)"}),l.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"}),l.jsx("rect",{width:21.694,height:6.057,fill:"#AAB0B0",rx:3.028,transform:"matrix(1 0 0 -1 132.72 99.844)"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),l.jsx("rect",{width:64,height:64,x:53,y:24,fill:"#36AA6C",rx:32}),l.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"}),l.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"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),hE=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v94H0z",transform:"translate(0 20)"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:113,x:.5,y:20.5,stroke:"#5D5D5D",rx:5.5}),l.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"}),l.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"}),l.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"}),l.jsx("circle",{cx:46.208,cy:58.882,r:20.294,fill:"#36AA6C"}),l.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"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:114,y:20,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:50.521,y1:5.735,y2:95.406,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),pE=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.jsx("rect",{width:30,height:30,fill:"#5A5C5C",rx:15,transform:"matrix(1 0 0 -1 12 45.46)"}),l.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"}),l.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"}),l.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"}),l.jsx("circle",{cx:85,cy:57.277,r:32,fill:"#36AA6C"}),l.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"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),mE=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),l.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"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"}),l.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"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),gE=e=>l.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:170,height:134,fill:"none",...e,children:[l.jsxs("g",{clipPath:"url(#a)",children:[l.jsxs("g",{clipPath:"url(#b)",children:[l.jsx("path",{fill:"url(#c)",d:"M0 0h170v114H0z"}),l.jsx("mask",{id:"d",fill:"#fff",children:l.jsx("path",{d:"M0 114h170v20H0v-20Z"})}),l.jsx("path",{fill:"#3C3E3F",d:"M0 114h170v20H0v-20Z"}),l.jsx("path",{fill:"#5D5D5D",d:"M0 115h170v-2H0v2Z",mask:"url(#d)"})]}),l.jsx("rect",{width:169,height:133,x:.5,y:.5,stroke:"#5D5D5D",rx:5.5}),l.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"}),l.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"}),l.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"})]}),l.jsxs("defs",{children:[l.jsx("clipPath",{id:"a",children:l.jsx("path",{fill:"#fff",d:"M0 0h170v134H0z"})}),l.jsx("clipPath",{id:"b",children:l.jsx("rect",{width:170,height:134,fill:"#fff",rx:6})}),l.jsxs("linearGradient",{id:"c",x1:20.715,x2:62.592,y1:6.956,y2:110.839,gradientUnits:"userSpaceOnUse",children:[l.jsx("stop",{stopColor:"#313131"}),l.jsx("stop",{offset:1,stopColor:"#1B1B1B"})]})]})]}),vE={edgeNotificationsPermissionTimeout:15e3},ht={WINDOW_MANAGEMENT:Zo.WINDOW_MANAGEMENT,NOTIFICATIONS:Zo.NOTIFICATIONS,POPUPS:"popups",PWA_INSTALL:"pwa-install"},yE={name:ht.WINDOW_MANAGEMENT,label:`Allow window management${il?"":" (not available in your browser)"}`,heading:"Allow Window Management",description:`By granting this permission you will be able to load layouts containing multiple
|
|
53
53
|
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.
|
|
54
54
|
Click the "Open permissions prompt" button again and grant the Window Management
|
|
55
|
-
permission to allow the platform to function properly.`},Image:
|
|
55
|
+
permission to allow the platform to function properly.`},Image:mE,actionBtnText:"Open permission prompt"},wE={name:ht.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
|
|
56
56
|
operating system.`,instructions:{initial:"Click “Allow” when the browser prompt appears.",additional:`It seems that you closed the permission prompt or your browser automatically blocks notifications.
|
|
57
57
|
To allow browser notifications, go to your browser settings or click the "Bell" icon
|
|
58
|
-
in the address bar and allow notifications for this site.`},Image:
|
|
58
|
+
in the address bar and allow notifications for this site.`},Image:fE,actionBtnText:"Open permission prompt"},bE={name:ht.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
|
|
59
59
|
browser pop-up settings.`,additional:`It seems that pop-ups are disabled in your browser.
|
|
60
60
|
To allow pop-ups, go to your browser settings or click the "Pop-up blocked" icon
|
|
61
|
-
in the address bar and allow pop-ups for this site.`},Image:AE,actionBtnText:"Test pop-up settings"},RE={name:ut.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:_E,actionBtnText:"Continue to the platform"},gs=[NE,IE,TE,RE],Ja={isCompleted:!1,state:"prompt"},LE={[ut.WINDOW_MANAGEMENT]:Ja,[ut.NOTIFICATIONS]:Ja,[ut.POPUPS]:Ja,[ut.PWA_INSTALL]:Ja},DE=({isOpen:e,onClose:t})=>{var a;const{launchpadComponents:n,launchpadSettings:o}=$1(),{permission:r}=Yo(),i=(a=r.statuses[ut.WINDOW_MANAGEMENT])==null?void 0:a.state;return u.jsx(D1,{components:n,isOpen:e,onClose:t,settings:o,windowManagementPermissionState:i})};const W1=v.forwardRef((e,t)=>{const{className:n,isOpen:o,onClose:r,Panel:i,pinned:a=!1,position:s="left"}=e;return o&&!i&&console.error('Invalid use of PanelWrapper component. Please provide Panel component when "isOpen" is "true".'),u.jsx("div",{className:dt(n,"panel-wrapper",s,{open:o,pinned:a}),ref:t,children:i&&u.jsx(i,{isOpen:o,onClose:r})})}),df=e=>{const{Button:t,Panel:n,panelWrapperClassName:o,pinned:r=!1,position:i="left",tag:a="div",onClose:s}=e,[c,l]=v.useState(!1),d=v.useRef(null),f=v.useCallback(async()=>{l(!1),await(s==null?void 0:s())},[s]),h=()=>{if(c){f();return}l(!0)},p=!c||r;return rf({eventType:"mouseup",handler:f,ref:d,skip:p}),of({handler:f,skip:p}),u.jsxs(a,{ref:d,children:[u.jsx(t,{active:c,onClick:h}),u.jsx(W1,{className:o,isOpen:c,onClose:f,Panel:n,pinned:r,position:i})]})};const F1=({Button:e=U3})=>{const{isLaunchpadPinned:t}=Nr();return u.jsx(df,{Button:e,Panel:DE,panelWrapperClassName:"launchpad-panel-wrapper",pinned:t})};var Fu=function(e,t){return Fu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},Fu(e,t)};function ME(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Fu(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Pt=function(){return Pt=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Pt.apply(this,arguments)};function bp(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function vo(e,t,n,o){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(d){try{l(o.next(d))}catch(f){a(f)}}function c(d){try{l(o.throw(d))}catch(f){a(f)}}function l(d){d.done?i(d.value):r(d.value).then(s,c)}l((o=o.apply(e,t||[])).next())})}function yo(e,t){var n={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=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(l){return function(d){return c([l,d])}}function c(l){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(n=0)),n;)try{if(o=1,r&&(i=l[0]&2?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,r=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){n.label=l[1];break}if(l[0]===6&&n.label<i[1]){n.label=i[1],i=l;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(l);break}i[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(d){l=[6,d],r=0}finally{o=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function $E(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}function Sn(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}var _r=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},B1={},ff={};Object.defineProperty(ff,"__esModule",{value:!0});var HE=function(){function e(){var t=this;this.locked=new Map,this.addToLocked=function(n,o){var r=t.locked.get(n);r===void 0?o===void 0?t.locked.set(n,[]):t.locked.set(n,[o]):o!==void 0&&(r.unshift(o),t.locked.set(n,r))},this.isLocked=function(n){return t.locked.has(n)},this.lock=function(n){return new Promise(function(o,r){t.isLocked(n)?t.addToLocked(n,o):(t.addToLocked(n),o())})},this.unlock=function(n){var o=t.locked.get(n);if(o!==void 0&&o.length!==0){var r=o.pop();t.locked.set(n,o),r!==void 0&&setTimeout(r,0)}else t.locked.delete(n)}}return e.getInstance=function(){return e.instance===void 0&&(e.instance=new e),e.instance},e}();ff.default=function(){return HE.getInstance()};var Cn=_r&&_r.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(l){try{c(o.next(l))}catch(d){i(d)}}function s(l){try{c(o.throw(l))}catch(d){i(d)}}function c(l){l.done?r(l.value):new n(function(d){d(l.value)}).then(a,s)}c((o=o.apply(e,t||[])).next())})},En=_r&&_r.__generator||function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(l){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&d[0]?o.return:d[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,d[1])).done)return r;switch(o=0,r&&(d=[2&d[0],r.value]),d[0]){case 0:case 1:r=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,o=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!r||d[1]>r[0]&&d[1]<r[3])){a.label=d[1];break}if(d[0]===6&&a.label<r[1]){a.label=r[1],r=d;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(d);break}r[2]&&a.ops.pop(),a.trys.pop();continue}d=t.call(e,a)}catch(f){d=[6,f],o=0}finally{n=r=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,l])}}},Li=_r;Object.defineProperty(B1,"__esModule",{value:!0});var Hr=ff,Za={key:function(e){return Cn(Li,void 0,void 0,function(){return En(this,function(t){throw new Error("Unsupported")})})},getItem:function(e){return Cn(Li,void 0,void 0,function(){return En(this,function(t){throw new Error("Unsupported")})})},clear:function(){return Cn(Li,void 0,void 0,function(){return En(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return Cn(Li,void 0,void 0,function(){return En(this,function(t){throw new Error("Unsupported")})})},setItem:function(e,t){return Cn(Li,void 0,void 0,function(){return En(this,function(n){throw new Error("Unsupported")})})},keySync:function(e){return window.localStorage.key(e)},getItemSync:function(e){return window.localStorage.getItem(e)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(e){return window.localStorage.removeItem(e)},setItemSync:function(e,t){return window.localStorage.setItem(e,t)}};function kl(e){return new Promise(function(t){return setTimeout(t,e)})}function Cl(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",o=0;o<e;o++)n+=t[Math.floor(Math.random()*t.length)];return n}var WE=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+Cl(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=t,e.waiters===void 0&&(e.waiters=[])}return e.prototype.acquireLock=function(t,n){return n===void 0&&(n=5e3),Cn(this,void 0,void 0,function(){var o,r,i,a,s,c,l;return En(this,function(d){switch(d.label){case 0:o=Date.now()+Cl(4),r=Date.now()+n,i="browser-tabs-lock-key-"+t,a=this.storageHandler===void 0?Za:this.storageHandler,d.label=1;case 1:return Date.now()<r?[4,kl(30)]:[3,8];case 2:return d.sent(),a.getItemSync(i)!==null?[3,5]:(s=this.id+"-"+t+"-"+o,[4,kl(Math.floor(25*Math.random()))]);case 3:return d.sent(),a.setItemSync(i,JSON.stringify({id:this.id,iat:o,timeoutKey:s,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,kl(30)];case 4:return d.sent(),(c=a.getItemSync(i))!==null&&(l=JSON.parse(c)).id===this.id&&l.iat===o?(this.acquiredIatSet.add(o),this.refreshLockWhileAcquired(i,o),[2,!0]):[3,7];case 5:return e.lockCorrector(this.storageHandler===void 0?Za:this.storageHandler),[4,this.waitForSomethingToChange(r)];case 6:d.sent(),d.label=7;case 7:return o=Date.now()+Cl(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(t,n){return Cn(this,void 0,void 0,function(){var o=this;return En(this,function(r){return setTimeout(function(){return Cn(o,void 0,void 0,function(){var i,a,s;return En(this,function(c){switch(c.label){case 0:return[4,Hr.default().lock(n)];case 1:return c.sent(),this.acquiredIatSet.has(n)?(i=this.storageHandler===void 0?Za:this.storageHandler,(a=i.getItemSync(t))===null?(Hr.default().unlock(n),[2]):((s=JSON.parse(a)).timeRefreshed=Date.now(),i.setItemSync(t,JSON.stringify(s)),Hr.default().unlock(n),this.refreshLockWhileAcquired(t,n),[2])):(Hr.default().unlock(n),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return Cn(this,void 0,void 0,function(){return En(this,function(n){switch(n.label){case 0:return[4,new Promise(function(o){var r=!1,i=Date.now(),a=!1;function s(){if(a||(window.removeEventListener("storage",s),e.removeFromWaiting(s),clearTimeout(c),a=!0),!r){r=!0;var l=50-(Date.now()-i);l>0?setTimeout(o,l):o(null)}}window.addEventListener("storage",s),e.addToWaiting(s);var c=setTimeout(s,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),e.waiters!==void 0&&e.waiters.push(t)},e.removeFromWaiting=function(t){e.waiters!==void 0&&(e.waiters=e.waiters.filter(function(n){return n!==t}))},e.notifyWaiters=function(){e.waiters!==void 0&&e.waiters.slice().forEach(function(t){return t()})},e.prototype.releaseLock=function(t){return Cn(this,void 0,void 0,function(){return En(this,function(n){switch(n.label){case 0:return[4,this.releaseLock__private__(t)];case 1:return[2,n.sent()]}})})},e.prototype.releaseLock__private__=function(t){return Cn(this,void 0,void 0,function(){var n,o,r,i;return En(this,function(a){switch(a.label){case 0:return n=this.storageHandler===void 0?Za:this.storageHandler,o="browser-tabs-lock-key-"+t,(r=n.getItemSync(o))===null?[2]:(i=JSON.parse(r)).id!==this.id?[3,2]:[4,Hr.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),n.removeItemSync(o),Hr.default().unlock(i.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,o=t,r=[],i=0;;){var a=o.keySync(i);if(a===null)break;r.push(a),i++}for(var s=!1,c=0;c<r.length;c++){var l=r[c];if(l.includes("browser-tabs-lock-key")){var d=o.getItemSync(l);if(d!==null){var f=JSON.parse(d);(f.timeRefreshed===void 0&&f.timeAcquired<n||f.timeRefreshed!==void 0&&f.timeRefreshed<n)&&(o.removeItemSync(l),s=!0)}}}s&&e.notifyWaiters()},e.waiters=void 0,e}(),FE=B1.default=WE;const BE={timeoutInSeconds:60},z1={name:"auth0-spa-js",version:"2.14.0"},U1=()=>Date.now();class at extends Error{constructor(t,n){super(n),this.error=t,this.error_description=n,Object.setPrototypeOf(this,at.prototype)}static fromPayload(t){let{error:n,error_description:o}=t;return new at(n,o)}}class hf extends at{constructor(t,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;super(t,n),this.state=o,this.appState=r,Object.setPrototypeOf(this,hf.prototype)}}class pf extends at{constructor(t,n,o,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;super(t,n),this.connection=o,this.state=r,this.appState=i,Object.setPrototypeOf(this,pf.prototype)}}class ri extends at{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,ri.prototype)}}class mf extends ri{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,mf.prototype)}}class gf extends at{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,gf.prototype)}}class vf extends at{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,vf.prototype)}}class Ca extends at{constructor(t,n,o,r){super(t,n),this.mfa_token=o,this.mfa_requirements=r,Object.setPrototypeOf(this,Ca.prototype)}}class Wc extends at{constructor(t,n){super("missing_refresh_token","Missing Refresh Token (audience: '".concat(Us(t,["default"]),"', scope: '").concat(Us(n),"')")),this.audience=t,this.scope=n,Object.setPrototypeOf(this,Wc.prototype)}}class yf extends at{constructor(t,n){super("missing_scopes","Missing requested scopes after refresh (audience: '".concat(Us(t,["default"]),"', missing scope: '").concat(Us(n),"')")),this.audience=t,this.scope=n,Object.setPrototypeOf(this,yf.prototype)}}class Fc extends at{constructor(t){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=t,Object.setPrototypeOf(this,Fc.prototype)}}function Us(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return e&&!t.includes(e)?e:""}const Ks=()=>window.crypto,Di=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";return Array.from(Ks().getRandomValues(new Uint8Array(43))).forEach(n=>t+=e[n%e.length]),t},El=e=>btoa(e),zE=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],K1=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return Object.keys(e).reduce((n,o)=>{if(t&&o==="env")return n;const r=zE.find(i=>i.key===o);return r&&r.type.includes(typeof e[o])&&(n[o]=e[o]),n},{})},Bu=e=>{var{clientId:t}=e,n=Sn(e,["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:t},n))).toString()},xp=async e=>await Ks().subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),Sp=e=>(t=>decodeURIComponent(atob(t).split("").map(n=>"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),kp=e=>{const t=new Uint8Array(e);return(n=>{const o={"+":"-","/":"_","=":""};return n.replace(/[+/=]/g,r=>o[r])})(window.btoa(String.fromCharCode(...Array.from(t))))},UE=new TextEncoder,KE=new TextDecoder;function Yi(e){return typeof e=="string"?UE.encode(e):KE.decode(e)}function Cp(e){if(typeof e.modulusLength!="number"||e.modulusLength<2048)throw new GE(`${e.name} modulusLength must be at least 2048 bits`)}async function VE(e,t,n){if(n.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const o=`${Xi(Yi(JSON.stringify(e)))}.${Xi(Yi(JSON.stringify(t)))}`;return`${o}.${Xi(await crypto.subtle.sign(function(r){switch(r.algorithm.name){case"ECDSA":return{name:r.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return Cp(r.algorithm),{name:r.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return Cp(r.algorithm),{name:r.algorithm.name};case"Ed25519":return{name:r.algorithm.name}}throw new gr}(n),n,Yi(o)))}`}let zu;Uint8Array.prototype.toBase64?zu=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):zu=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let o=0;o<t.byteLength;o+=32768)n.push(String.fromCharCode.apply(null,t.subarray(o,o+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Xi(e){return zu(e)}class gr extends Error{constructor(t){var n;super(t??"operation not supported"),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}class GE extends Error{constructor(t){var n;super(t),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}function qE(e){switch(e.algorithm.name){case"RSA-PSS":return function(t){if(t.algorithm.hash.name==="SHA-256")return"PS256";throw new gr("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"RSASSA-PKCS1-v1_5":return function(t){if(t.algorithm.hash.name==="SHA-256")return"RS256";throw new gr("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"ECDSA":return function(t){if(t.algorithm.namedCurve==="P-256")return"ES256";throw new gr("unsupported EcKeyAlgorithm namedCurve")}(e);case"Ed25519":return"Ed25519";default:throw new gr("unsupported CryptoKey algorithm name")}}function V1(e){return e instanceof CryptoKey}function G1(e){return V1(e)&&e.type==="public"}async function JE(e,t,n,o,r,i){const a=e==null?void 0:e.privateKey,s=e==null?void 0:e.publicKey;if(!V1(c=a)||c.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var c;if(!G1(s))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(s.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof t!="string")throw new TypeError('"htu" must be a string');if(typeof n!="string")throw new TypeError('"htm" must be a string');if(o!==void 0&&typeof o!="string")throw new TypeError('"nonce" must be a string or undefined');if(r!==void 0&&typeof r!="string")throw new TypeError('"accessToken" must be a string or undefined');if(i!==void 0&&(typeof i!="object"||i===null||Array.isArray(i)))throw new TypeError('"additional" must be an object');return VE({alg:qE(a),typ:"dpop+jwt",jwk:await q1(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:n,nonce:o,htu:t,ath:r?Xi(await crypto.subtle.digest("SHA-256",Yi(r))):void 0}),a)}async function q1(e){const{kty:t,e:n,n:o,x:r,y:i,crv:a}=await crypto.subtle.exportKey("jwk",e);return{kty:t,crv:a,e:n,n:o,x:r,y:i}}const ZE=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange","http://auth0.com/oauth/grant-type/mfa-oob","http://auth0.com/oauth/grant-type/mfa-otp","http://auth0.com/oauth/grant-type/mfa-recovery-code"];function YE(){return async function(e,t){var n;let o;if(typeof e!="string"||e.length===0)throw new TypeError('"alg" must be a non-empty string');switch(e){case"PS256":o={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":o={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":o={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":o={name:"Ed25519"};break;default:throw new gr}return crypto.subtle.generateKey(o,(n=t==null?void 0:t.extractable)!==null&&n!==void 0&&n,["sign","verify"])}("ES256",{extractable:!1})}function XE(e){return async function(t){if(!G1(t))throw new TypeError('"publicKey" must be a public CryptoKey');if(t.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const n=await q1(t);let o;switch(n.kty){case"EC":o={crv:n.crv,kty:n.kty,x:n.x,y:n.y};break;case"OKP":o={crv:n.crv,kty:n.kty,x:n.x};break;case"RSA":o={e:n.e,kty:n.kty,n:n.n};break;default:throw new gr("unsupported JWK kty")}return Xi(await crypto.subtle.digest({name:"SHA-256"},Yi(JSON.stringify(o))))}(e.publicKey)}function QE(e){let{keyPair:t,url:n,method:o,nonce:r,accessToken:i}=e;const a=function(s){const c=new URL(s);return c.search="",c.hash="",c.href}(n);return JE(t,a,o,r,i)}const e5=async(e,t)=>{const n=await fetch(e,t);return{ok:n.ok,json:await n.json(),headers:(o=n.headers,[...o].reduce((r,i)=>{let[a,s]=i;return r[a]=s,r},{}))};var o},t5=async(e,t,n)=>{const o=new AbortController;let r;return t.signal=o.signal,Promise.race([e5(e,t),new Promise((i,a)=>{r=setTimeout(()=>{o.abort(),a(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(r)})},n5=async(e,t,n,o,r,i,a,s)=>((c,l)=>new Promise(function(d,f){const h=new MessageChannel;h.port1.onmessage=function(p){p.data.error?f(new Error(p.data.error)):d(p.data),h.port1.close()},l.postMessage(c,[h.port2])}))({auth:{audience:t,scope:n},timeout:r,fetchUrl:e,fetchOptions:o,useFormData:a,useMrrt:s},i),o5=async function(e,t,n,o,r,i){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:1e4,s=arguments.length>7?arguments[7]:void 0;return r?n5(e,t,n,o,a,r,i,s):t5(e,o,a)};async function J1(e,t,n,o,r,i,a,s,c,l){if(c){const b=await c.generateProof({url:e,method:r.method||"GET",nonce:await c.getNonce()});r.headers=Object.assign(Object.assign({},r.headers),{dpop:b})}let d,f=null;for(let b=0;b<3;b++)try{d=await o5(e,n,o,r,i,a,t,s),f=null;break}catch(S){f=S}if(f)throw f;const h=d.json,{error:p,error_description:m}=h,g=Sn(h,["error","error_description"]),{headers:y,ok:w}=d;let k;if(c&&(k=y["dpop-nonce"],k&&await c.setNonce(k)),!w){const b=m||"HTTP error. Unable to fetch ".concat(e);if(p==="mfa_required")throw new Ca(p,b,g.mfa_token,g.mfa_requirements);if(p==="missing_refresh_token")throw new Wc(n,o);if(p==="use_dpop_nonce"){if(!c||!k||l)throw new Fc(k);return J1(e,t,n,o,r,i,a,s,c,!0)}throw new at(p||"request_error",b)}return g}async function r5(e,t){var{baseUrl:n,timeout:o,audience:r,scope:i,auth0Client:a,useFormData:s,useMrrt:c,dpop:l}=e,d=Sn(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const f=d.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",h=d.grant_type==="refresh_token"&&c,p=Object.assign(Object.assign(Object.assign(Object.assign({},d),f&&r&&{audience:r}),f&&i&&{scope:i}),h&&{audience:r,scope:i}),m=s?Bu(p):JSON.stringify(p),g=(y=d.grant_type,ZE.includes(y));var y;return await J1("".concat(n,"/oauth/token"),o,r||"default",i,{method:"POST",body:m,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(K1(a||z1)))}},t,s,c,g?l:void 0)}const i5=e=>Array.from(new Set(e)),vs=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return i5(t.filter(Boolean).join(" ").trim().split(/\s+/)).join(" ")},Ya=(e,t,n)=>{let o;return n&&(o=e[n]),o||(o=e.default),vs(o,t)};class hn{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"@@auth0spajs@@",o=arguments.length>2?arguments[2]:void 0;this.prefix=n,this.suffix=o,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[n,o,r,i]=t.split("::");return new hn({clientId:o,scope:i,audience:r},n)}static fromCacheEntry(t){const{scope:n,audience:o,client_id:r}=t;return new hn({scope:n,audience:o,clientId:r})}}class a5{set(t,n){localStorage.setItem(t,JSON.stringify(n))}get(t){const n=window.localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith("@@auth0spajs@@"))}}class Z1{constructor(){this.enclosedCache=function(){let t={};return{set(n,o){t[n]=o},get(n){const o=t[n];if(o)return o},remove(n){delete t[n]},allKeys:()=>Object.keys(t)}}()}}class s5{constructor(t,n,o){this.cache=t,this.keyManifest=n,this.nowProvider=o||U1}async setIdToken(t,n,o){var r;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:n,decodedToken:o}),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(i))}async getIdToken(t){const n=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!n&&t.scope&&t.audience){const o=await this.get(t);return!o||!o.id_token||!o.decodedToken?void 0:{id_token:o.id_token,decodedToken:o.decodedToken}}if(n)return{id_token:n.id_token,decodedToken:n.decodedToken}}async get(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3?arguments[3]:void 0;var i;let a=await this.cache.get(t.toKey());if(!a){const l=await this.getCacheKeys();if(!l)return;const d=this.matchExistingCacheKey(t,l);if(d&&(a=await this.cache.get(d)),!a&&o&&r!=="cache-only")return this.getEntryWithRefreshToken(t,l)}if(!a)return;const s=await this.nowProvider(),c=Math.floor(s/1e3);return a.expiresAt-n<c?a.body.refresh_token?this.modifiedCachedEntry(a,t):(await this.cache.remove(t.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(t.toKey()))):a.body}async modifiedCachedEntry(t,n){return t.body={refresh_token:t.body.refresh_token,audience:t.body.audience,scope:t.body.scope},await this.cache.set(n.toKey(),t),{refresh_token:t.body.refresh_token,audience:t.body.audience,scope:t.body.scope}}async set(t){var n;const o=new hn({clientId:t.client_id,scope:t.scope,audience:t.audience}),r=await this.wrapCacheEntry(t);await this.cache.set(o.toKey(),r),await((n=this.keyManifest)===null||n===void 0?void 0:n.add(o.toKey()))}async remove(t,n,o){const r=new hn({clientId:t,scope:o,audience:n});await this.cache.remove(r.toKey())}async clear(t){var n;const o=await this.getCacheKeys();o&&(await o.filter(r=>!t||r.includes(t)).reduce(async(r,i)=>{await r,await this.cache.remove(i)},Promise.resolve()),await((n=this.keyManifest)===null||n===void 0?void 0:n.clear()))}async wrapCacheEntry(t){const n=await this.nowProvider();return{body:t,expiresAt:Math.floor(n/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new hn({clientId:t},"@@auth0spajs@@","@@user@@").toKey()}matchExistingCacheKey(t,n){return n.filter(o=>{var r;const i=hn.fromKey(o),a=new Set(i.scope&&i.scope.split(" ")),s=((r=t.scope)===null||r===void 0?void 0:r.split(" "))||[],c=i.scope&&s.reduce((l,d)=>l&&a.has(d),!0);return i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId&&i.audience===t.audience&&c})[0]}async getEntryWithRefreshToken(t,n){var o;for(const r of n){const i=hn.fromKey(r);if(i.prefix==="@@auth0spajs@@"&&i.clientId===t.clientId){const a=await this.cache.get(r);if(!((o=a==null?void 0:a.body)===null||o===void 0)&&o.refresh_token)return this.modifiedCachedEntry(a,t)}}}async updateEntry(t,n){var o;const r=await this.getCacheKeys();if(r)for(const i of r){const a=await this.cache.get(i);if(((o=a==null?void 0:a.body)===null||o===void 0?void 0:o.refresh_token)===t){const s=Object.assign(Object.assign({},a.body),{refresh_token:n});await this.set(s)}}}}class c5{constructor(t,n,o){this.storage=t,this.clientId=n,this.cookieDomain=o,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId)}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const Mi=e=>typeof e=="number",l5=["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"],u5=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const a=i.split("."),[s,c,l]=a;if(a.length!==3||!s||!c||!l)throw new Error("ID token could not be decoded");const d=JSON.parse(Sp(c)),f={__raw:i},h={};return Object.keys(d).forEach(p=>{f[p]=d[p],l5.includes(p)||(h[p]=d[p])}),{encoded:{header:s,payload:c,signature:l},header:JSON.parse(Sp(s)),claims:f,user:h}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(e.iss,'", found "').concat(t.claims.iss,'"'));if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error('Signature algorithm of "'.concat(t.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but was not one of "').concat(t.claims.aud.join(", "),'"'));if(t.claims.aud.length>1){if(!t.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(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(t.claims.aud,'"'));if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&!Mi(t.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(t.claims.exp==null||!Mi(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!Mi(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,o=new Date(e.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(t.claims.exp+n),o>r)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(o,") is after expiration time (").concat(r,")"));if(t.claims.nbf!=null&&Mi(t.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-n),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 (".concat(o,") is before ").concat(i))}if(t.claims.auth_time!=null&&Mi(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),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 (".concat(o,") is after last auth at ").concat(i))}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const a=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(a!==t.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(a,'", found "').concat(t.claims.org_id,'"'))}else{const a=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(a!==t.claims.org_name)throw new Error('Organization Name (org_name) claim mismatch in the ID token; expected "'.concat(a,'", found "').concat(t.claims.org_name,'"'))}}return t};var pa=_r&&_r.__assign||function(){return pa=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},pa.apply(this,arguments)};function $i(e,t){if(!t)return"";var n="; "+e;return t===!0?n:n+"="+t}function d5(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(o){if(typeof o.expires=="number"){var r=new Date;r.setMilliseconds(r.getMilliseconds()+864e5*o.expires),o.expires=r}return $i("Expires",o.expires?o.expires.toUTCString():"")+$i("Domain",o.domain)+$i("Path",o.path)+$i("Secure",o.secure)+$i("SameSite",o.sameSite)}(n)}function f5(){return function(e){for(var t={},n=e?e.split("; "):[],o=/(%[\dA-F]{2})+/gi,r=0;r<n.length;r++){var i=n[r].split("="),a=i.slice(1).join("=");a.charAt(0)==='"'&&(a=a.slice(1,-1));try{t[i[0].replace(o,decodeURIComponent)]=a.replace(o,decodeURIComponent)}catch{}}return t}(document.cookie)}var h5=function(e){return f5()[e]};function Y1(e,t,n){document.cookie=d5(e,t,pa({path:"/"},n))}var X1=Y1,Q1=function(e,t){Y1(e,"",pa(pa({},t),{expires:-1}))};const Ur={get(e){const t=h5(e);if(t!==void 0)return JSON.parse(t)},save(e,t,n){let o={};window.location.protocol==="https:"&&(o={secure:!0,sameSite:"none"}),n!=null&&n.daysUntilExpire&&(o.expires=n.daysUntilExpire),n!=null&&n.cookieDomain&&(o.domain=n.cookieDomain),X1(e,JSON.stringify(t),o)},remove(e,t){let n={};t!=null&&t.cookieDomain&&(n.domain=t.cookieDomain),Q1(e,n)}},p5={get(e){return Ur.get(e)||Ur.get("".concat("_legacy_").concat(e))},save(e,t,n){let o={};window.location.protocol==="https:"&&(o={secure:!0}),n!=null&&n.daysUntilExpire&&(o.expires=n.daysUntilExpire),n!=null&&n.cookieDomain&&(o.domain=n.cookieDomain),X1("".concat("_legacy_").concat(e),JSON.stringify(t),o),Ur.save(e,t,n)},remove(e,t){let n={};t!=null&&t.cookieDomain&&(n.domain=t.cookieDomain),Q1(e,n),Ur.remove(e,t),Ur.remove("".concat("_legacy_").concat(e),t)}},m5={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var _o;(function(e){e.Code="code",e.ConnectCode="connect_code"})(_o||(_o={}));function g5(e,t,n){var o=t===void 0?null:t,r=function(c,l){var d=atob(c);if(l){for(var f=new Uint8Array(d.length),h=0,p=d.length;h<p;++h)f[h]=d.charCodeAt(h);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return d}(e,n!==void 0&&n),i=r.indexOf(`
|
|
62
|
-
`,10)+1,a=r.substring(i)+(o?"//# sourceMappingURL="+o:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var Ep,Ap,_p,Al,v5=(Ep="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHQpe2xldHtlcnJvcjpyLGVycm9yX2Rlc2NyaXB0aW9uOnN9PXQ7cmV0dXJuIG5ldyBlKHIscyl9fWNsYXNzIHQgZXh0ZW5kcyBle2NvbnN0cnVjdG9yKGUscyl7c3VwZXIoIm1pc3NpbmdfcmVmcmVzaF90b2tlbiIsIk1pc3NpbmcgUmVmcmVzaCBUb2tlbiAoYXVkaWVuY2U6ICciLmNvbmNhdChyKGUsWyJkZWZhdWx0Il0pLCInLCBzY29wZTogJyIpLmNvbmNhdChyKHMpLCInKSIpKSx0aGlzLmF1ZGllbmNlPWUsdGhpcy5zY29wZT1zLE9iamVjdC5zZXRQcm90b3R5cGVPZih0aGlzLHQucHJvdG90eXBlKX19ZnVuY3Rpb24gcihlKXtsZXQgdD1hcmd1bWVudHMubGVuZ3RoPjEmJnZvaWQgMCE9PWFyZ3VtZW50c1sxXT9hcmd1bWVudHNbMV06W107cmV0dXJuIGUmJiF0LmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIoKHQ9PnZvaWQgMCE9PWVbdF0pKS5yZWR1Y2UoKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkpLHt9KSkoT2JqZWN0LmFzc2lnbih7Y2xpZW50X2lkOnR9LHIpKSkudG9TdHJpbmcoKX07bGV0IG89e307Y29uc3Qgbj0oZSx0KT0+IiIuY29uY2F0KGUsInwiKS5jb25jYXQodCk7YWRkRXZlbnRMaXN0ZW5lcigibWVzc2FnZSIsKGFzeW5jIGU9PntsZXQgcixjLHtkYXRhOnt0aW1lb3V0OmksYXV0aDphLGZldGNoVXJsOmYsZmV0Y2hPcHRpb25zOmwsdXNlRm9ybURhdGE6cCx1c2VNcnJ0Omh9LHBvcnRzOlt1XX09ZSxkPXt9O2NvbnN0e2F1ZGllbmNlOmcsc2NvcGU6eX09YXx8e307dHJ5e2NvbnN0IGU9cD8oZT0+e2NvbnN0IHQ9bmV3IFVSTFNlYXJjaFBhcmFtcyhlKSxyPXt9O3JldHVybiB0LmZvckVhY2goKChlLHQpPT57clt0XT1lfSkpLHJ9KShsLmJvZHkpOkpTT04ucGFyc2UobC5ib2R5KTtpZighZS5yZWZyZXNoX3Rva2VuJiYicmVmcmVzaF90b2tlbiI9PT1lLmdyYW50X3R5cGUpe2lmKGM9KChlLHQpPT5vW24oZSx0KV0pKGcseSksIWMmJmgpe2NvbnN0IGU9by5sYXRlc3RfcmVmcmVzaF90b2tlbix0PSgoZSx0KT0+e2NvbnN0IHI9T2JqZWN0LmtleXMobykuZmluZCgocj0+e2lmKCJsYXRlc3RfcmVmcmVzaF90b2tlbiIhPT1yKXtjb25zdCBzPSgoZSx0KT0+dC5zdGFydHNXaXRoKCIiLmNvbmNhdChlLCJ8IikpKSh0LHIpLG89ci5zcGxpdCgifCIpWzFdLnNwbGl0KCIgIiksbj1lLnNwbGl0KCIgIikuZXZlcnkoKGU9Pm8uaW5jbHVkZXMoZSkpKTtyZXR1cm4gcyYmbn19KSk7cmV0dXJuISFyfSkoeSxnKTtlJiYhdCYmKGM9ZSl9aWYoIWMpdGhyb3cgbmV3IHQoZyx5KTtsLmJvZHk9cD9zKE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpjfSkpOkpTT04uc3RyaW5naWZ5KE9iamVjdC5hc3NpZ24oT2JqZWN0LmFzc2lnbih7fSxlKSx7cmVmcmVzaF90b2tlbjpjfSkpfWxldCBhLGs7ImZ1bmN0aW9uIj09dHlwZW9mIEFib3J0Q29udHJvbGxlciYmKGE9bmV3IEFib3J0Q29udHJvbGxlcixsLnNpZ25hbD1hLnNpZ25hbCk7dHJ5e2s9YXdhaXQgUHJvbWlzZS5yYWNlKFsoaj1pLG5ldyBQcm9taXNlKChlPT5zZXRUaW1lb3V0KGUsaikpKSksZmV0Y2goZixPYmplY3QuYXNzaWduKHt9LGwpKV0pfWNhdGNoKGUpe3JldHVybiB2b2lkIHUucG9zdE1lc3NhZ2Uoe2Vycm9yOmUubWVzc2FnZX0pfWlmKCFrKXJldHVybiBhJiZhLmFib3J0KCksdm9pZCB1LnBvc3RNZXNzYWdlKHtlcnJvcjoiVGltZW91dCB3aGVuIGV4ZWN1dGluZyAnZmV0Y2gnIn0pO189ay5oZWFkZXJzLGQ9Wy4uLl9dLnJlZHVjZSgoKGUsdCk9PntsZXRbcixzXT10O3JldHVybiBlW3JdPXMsZX0pLHt9KSxyPWF3YWl0IGsuanNvbigpLHIucmVmcmVzaF90b2tlbj8oaCYmKG8ubGF0ZXN0X3JlZnJlc2hfdG9rZW49ci5yZWZyZXNoX3Rva2VuLE89YyxiPXIucmVmcmVzaF90b2tlbixPYmplY3QuZW50cmllcyhvKS5mb3JFYWNoKChlPT57bGV0W3Qscl09ZTtyPT09TyYmKG9bdF09Yil9KSkpLCgoZSx0LHIpPT57b1tuKHQscildPWV9KShyLnJlZnJlc2hfdG9rZW4sZyx5KSxkZWxldGUgci5yZWZyZXNoX3Rva2VuKTooKGUsdCk9PntkZWxldGUgb1tuKGUsdCldfSkoZyx5KSx1LnBvc3RNZXNzYWdlKHtvazprLm9rLGpzb246cixoZWFkZXJzOmR9KX1jYXRjaChlKXt1LnBvc3RNZXNzYWdlKHtvazohMSxqc29uOntlcnJvcjplLmVycm9yLGVycm9yX2Rlc2NyaXB0aW9uOmUubWVzc2FnZX0saGVhZGVyczpkfSl9dmFyIE8sYixfLGp9KSl9KCk7Cgo=",Ap=null,_p=!1,function(e){return Al=Al||g5(Ep,Ap,_p),new Worker(Al,e)});const _l={},jp=async function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:3;for(let n=0;n<t;n++)if(await e())return!0;return!1};class y5{constructor(t,n){this.cache=t,this.clientId=n,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var n;const o=new Set(((n=await this.cache.get(this.manifestKey))===null||n===void 0?void 0:n.keys)||[]);o.add(t),await this.cache.set(this.manifestKey,{keys:[...o]})}async remove(t){const n=await this.cache.get(this.manifestKey);if(n){const o=new Set(n.keys);return o.delete(t),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(t){return"".concat("@@auth0spajs@@","::").concat(t)}}const w5={memory:()=>new Z1().enclosedCache,localstorage:()=>new a5},Op=e=>w5[e],Pp=e=>{const{openUrl:t,onRedirect:n}=e,o=Sn(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},o),{openUrl:t===!1||t?t:n})},Np=(e,t)=>{const n=(t==null?void 0:t.split(" "))||[];return((e==null?void 0:e.split(" "))||[]).every(o=>n.includes(o))},tr={NONCE:"nonce",KEYPAIR:"keypair"};class b5{constructor(t){this.clientId=t}getVersion(){return 1}createDbHandle(){const t=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((n,o)=>{t.onupgradeneeded=()=>Object.values(tr).forEach(r=>t.result.createObjectStore(r)),t.onerror=()=>o(t.error),t.onsuccess=()=>n(t.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(t,n,o){const r=o((await this.getDbHandle()).transaction(t,n).objectStore(t));return new Promise((i,a)=>{r.onsuccess=()=>i(r.result),r.onerror=()=>a(r.error)})}buildKey(t){const n=t?"_".concat(t):"auth0";return"".concat(this.clientId,"::").concat(n)}setNonce(t,n){return this.save(tr.NONCE,this.buildKey(n),t)}setKeyPair(t){return this.save(tr.KEYPAIR,this.buildKey(),t)}async save(t,n,o){await this.executeDbRequest(t,"readwrite",r=>r.put(o,n))}findNonce(t){return this.find(tr.NONCE,this.buildKey(t))}findKeyPair(){return this.find(tr.KEYPAIR,this.buildKey())}find(t,n){return this.executeDbRequest(t,"readonly",o=>o.get(n))}async deleteBy(t,n){const o=await this.executeDbRequest(t,"readonly",r=>r.getAllKeys());o==null||o.filter(n).map(r=>this.executeDbRequest(t,"readwrite",i=>i.delete(r)))}deleteByClientId(t,n){return this.deleteBy(t,o=>typeof o=="string"&&o.startsWith("".concat(n,"::")))}clearNonces(){return this.deleteByClientId(tr.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(tr.KEYPAIR,this.clientId)}}class x5{constructor(t){this.storage=new b5(t)}getNonce(t){return this.storage.findNonce(t)}setNonce(t,n){return this.storage.setNonce(t,n)}async getOrGenerateKeyPair(){let t=await this.storage.findKeyPair();return t||(t=await YE(),await this.storage.setKeyPair(t)),t}async generateProof(t){const n=await this.getOrGenerateKeyPair();return QE(Object.assign({keyPair:n},t))}async calculateThumbprint(){return XE(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var Yr;(function(e){e.Bearer="Bearer",e.DPoP="DPoP"})(Yr||(Yr={}));class S5{constructor(t,n){this.hooks=n,this.config=Object.assign(Object.assign({},t),{fetch:t.fetch||(typeof window>"u"?fetch:window.fetch.bind(window))})}isAbsoluteUrl(t){return/^(https?:)?\/\//i.test(t)}buildUrl(t,n){if(n){if(this.isAbsoluteUrl(n))return n;if(t)return"".concat(t.replace(/\/?\/$/,""),"/").concat(n.replace(/^\/+/,""))}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(t){return this.config.getAccessToken?this.config.getAccessToken(t):this.hooks.getAccessToken(t)}extractUrl(t){return typeof t=="string"?t:t instanceof URL?t.href:t.url}buildBaseRequest(t,n){if(!this.config.baseUrl)return new Request(t,n);const o=this.buildUrl(this.config.baseUrl,this.extractUrl(t)),r=t instanceof Request?new Request(o,t):o;return new Request(r,n)}setAuthorizationHeader(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Yr.Bearer;t.headers.set("authorization","".concat(o," ").concat(n))}async setDpopProofHeader(t,n){if(!this.config.dpopNonceId)return;const o=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:n,method:t.method,nonce:o,url:t.url});t.headers.set("dpop",r)}async prepareRequest(t,n){const o=await this.getAccessToken(n);let r,i;typeof o=="string"?(r=this.config.dpopNonceId?Yr.DPoP:Yr.Bearer,i=o):(r=o.token_type,i=o.access_token),this.setAuthorizationHeader(t,i,r),r===Yr.DPoP&&await this.setDpopProofHeader(t,i)}getHeader(t,n){return Array.isArray(t)?new Headers(t).get(n)||"":typeof t.get=="function"?t.get(n)||"":t[n]||""}hasUseDpopNonceError(t){if(t.status!==401)return!1;const n=this.getHeader(t.headers,"www-authenticate");return n.includes("invalid_dpop_nonce")||n.includes("use_dpop_nonce")}async handleResponse(t,n){const o=this.getHeader(t.headers,"dpop-nonce");if(o&&await this.hooks.setDpopNonce(o),!this.hasUseDpopNonceError(t))return t;if(!o||!n.onUseDpopNonceError)throw new Fc(o);return n.onUseDpopNonceError()}async internalFetchWithAuth(t,n,o,r){const i=this.buildBaseRequest(t,n);await this.prepareRequest(i,r);const a=await this.config.fetch(i);return this.handleResponse(a,o)}fetchWithAuth(t,n,o){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(t,n,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),o)};return this.internalFetchWithAuth(t,n,r,o)}}class k5{constructor(t,n){this.myAccountFetcher=t,this.apiBase=n}async connectAccount(t){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return this._handleResponse(n)}async completeAccount(t){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return this._handleResponse(n)}async _handleResponse(t){let n;try{n=await t.text(),n=JSON.parse(n)}catch(o){throw new Vs({type:"invalid_json",status:t.status,title:"Invalid JSON response",detail:n||String(o)})}if(t.ok)return n;throw new Vs(n)}}class Vs extends Error{constructor(t){let{type:n,status:o,title:r,detail:i,validation_errors:a}=t;super(i),this.name="MyAccountApiError",this.type=n,this.status=o,this.title=r,this.detail=i,this.validation_errors=a,Object.setPrototypeOf(this,Vs.prototype)}}const C5={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}},E5="http://auth0.com/oauth/grant-type/mfa-otp",A5="http://auth0.com/oauth/grant-type/mfa-oob",_5="http://auth0.com/oauth/grant-type/mfa-recovery-code";function ew(e,t){this.v=e,this.k=t}function mt(e,t,n){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function j5(e){return new ew(e,0)}function tw(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function de(e,t){return e.get(mt(e,t))}function bt(e,t,n){tw(e,t),t.set(e,n)}function it(e,t,n){return e.set(mt(e,t),n),n}function pe(e,t,n){return(t=function(o){var r=function(i,a){if(typeof i!="object"||!i)return i;var s=i[Symbol.toPrimitive];if(s!==void 0){var c=s.call(i,a||"default");if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(o,"string");return typeof r=="symbol"?r:r+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ip(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function Se(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ip(Object(n),!0).forEach(function(o){pe(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ip(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Tp(e,t){if(e==null)return{};var n,o,r=function(a,s){if(a==null)return{};var c={};for(var l in a)if({}.hasOwnProperty.call(a,l)){if(s.indexOf(l)!==-1)continue;c[l]=a[l]}return c}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function O5(e){return function(){return new Vi(e.apply(this,arguments))}}function Vi(e){var t,n;function o(i,a){try{var s=e[i](a),c=s.value,l=c instanceof ew;Promise.resolve(l?c.v:c).then(function(d){if(l){var f=i==="return"?"return":"next";if(!c.k||d.done)return o(f,d);d=e[f](d).value}r(s.done?"return":"normal",d)},function(d){o("throw",d)})}catch(d){r("throw",d)}}function r(i,a){switch(i){case"return":t.resolve({value:a,done:!0});break;case"throw":t.reject(a);break;default:t.resolve({value:a,done:!1})}(t=t.next)?o(t.key,t.arg):n=null}this._invoke=function(i,a){return new Promise(function(s,c){var l={key:i,arg:a,resolve:s,reject:c,next:null};n?n=n.next=l:(t=n=l,o(i,a))})},typeof e.return!="function"&&(this.return=void 0)}var Xa,jl;let Uu;if(Vi.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Vi.prototype.next=function(e){return this._invoke("next",e)},Vi.prototype.throw=function(e){return this._invoke("throw",e)},Vi.prototype.return=function(e){return this._invoke("return",e)},typeof navigator>"u"||(Xa=navigator.userAgent)===null||Xa===void 0||(jl=Xa.startsWith)===null||jl===void 0||!jl.call(Xa,"Mozilla/5.0 ")){const e="v3.8.3";Uu="".concat("oauth4webapi","/").concat(e)}function Ai(e,t){if(e==null)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}function qe(e,t,n){const o=new TypeError(e,{cause:n});return Object.assign(o,{code:t}),o}const wn=Symbol(),Ku=Symbol(),Vu=Symbol(),Rn=Symbol(),P5=Symbol(),qn=Symbol(),N5=new TextEncoder,I5=new TextDecoder;function ii(e){return typeof e=="string"?N5.encode(e):I5.decode(e)}let Gu,nw;Uint8Array.prototype.toBase64?Gu=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):Gu=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let o=0;o<t.byteLength;o+=32768)n.push(String.fromCharCode.apply(null,t.subarray(o,o+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function xr(e){return typeof e=="string"?nw(e):Gu(e)}nw=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(t){throw qe("The input to be decoded is not correctly encoded.","ERR_INVALID_ARG_VALUE",t)}}:e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}catch(t){throw qe("The input to be decoded is not correctly encoded.","ERR_INVALID_ARG_VALUE",t)}};class sn extends Error{constructor(t,n){var o;super(t,n),pe(this,"code",void 0),this.name=this.constructor.name,this.code=Zu,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}class wf extends Error{constructor(t,n){var o;super(t,n),pe(this,"code",void 0),this.name=this.constructor.name,n!=null&&n.code&&(this.code=n==null?void 0:n.code),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}function je(e,t,n){return new wf(e,{code:t,cause:n})}function T5(e,t){if(function(n,o){if(!(n instanceof CryptoKey))throw qe("".concat(o," must be a CryptoKey"),"ERR_INVALID_ARG_TYPE")}(e,t),e.type!=="private")throw qe("".concat(t," must be a private CryptoKey"),"ERR_INVALID_ARG_VALUE")}function Gs(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Bc(e){Ai(e,Headers)&&(e=Object.fromEntries(e.entries()));const t=new Headers(e??{});if(Uu&&!t.has("user-agent")&&t.set("user-agent",Uu),t.has("authorization"))throw qe('"options.headers" must not include the "authorization" header name',"ERR_INVALID_ARG_VALUE");return t}function ow(e,t){if(t!==void 0){if(typeof t=="function"&&(t=t(e.href)),!(t instanceof AbortSignal))throw qe('"options.signal" must return or be an instance of AbortSignal',"ERR_INVALID_ARG_TYPE");return t}}function Rp(e){return e.includes("//")?e.replace("//","/"):e}async function R5(e,t){return async function(n,o,r,i){if(!(n instanceof URL))throw qe('"'.concat(o,'" must be an instance of URL'),"ERR_INVALID_ARG_TYPE");bf(n,(i==null?void 0:i[wn])!==!0);const a=r(new URL(n.href)),s=Bc(i==null?void 0:i.headers);return s.set("accept","application/json"),((i==null?void 0:i[Rn])||fetch)(a.href,{body:void 0,headers:Object.fromEntries(s.entries()),method:"GET",redirect:"manual",signal:ow(a,i==null?void 0:i.signal)})}(e,"issuerIdentifier",n=>{switch(t==null?void 0:t.algorithm){case void 0:case"oidc":(function(o,r){o.pathname=Rp("".concat(o.pathname,"/").concat(r))})(n,".well-known/openid-configuration");break;case"oauth2":(function(o,r){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2];o.pathname==="/"?o.pathname=r:o.pathname=Rp("".concat(r,"/").concat(i?o.pathname:o.pathname.replace(/(\/)$/,"")))})(n,".well-known/oauth-authorization-server");break;default:throw qe('"options.algorithm" must be "oidc" (default), or "oauth2"',"ERR_INVALID_ARG_VALUE")}return n},t)}function Fo(e,t,n,o,r){try{if(typeof e!="number"||!Number.isFinite(e))throw qe("".concat(n," must be a number"),"ERR_INVALID_ARG_TYPE",r);if(e>0)return;if(t){if(e!==0)throw qe("".concat(n," must be a non-negative number"),"ERR_INVALID_ARG_VALUE",r);return}throw qe("".concat(n," must be a positive number"),"ERR_INVALID_ARG_VALUE",r)}catch(i){throw o?je(i.message,o,r):i}}function vt(e,t,n,o){try{if(typeof e!="string")throw qe("".concat(t," must be a string"),"ERR_INVALID_ARG_TYPE",o);if(e.length===0)throw qe("".concat(t," must not be empty"),"ERR_INVALID_ARG_VALUE",o)}catch(r){throw n?je(r.message,n,o):r}}function rw(e){(function(t,n){if(cw(t)!==n)throw function(o){let r='"response" content-type must be ';for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];if(a.length>2){const c=a.pop();r+="".concat(a.join(", "),", or ").concat(c)}else a.length===2?r+="".concat(a[0]," or ").concat(a[1]):r+=a[0];return je(r,uw,o)}(t,n)})(e,"application/json")}function iw(){return xr(crypto.getRandomValues(new Uint8Array(32)))}function L5(e){switch(e.algorithm.name){case"RSA-PSS":return function(t){switch(t.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new sn("unsupported RsaHashedKeyAlgorithm hash name",{cause:t})}}(e);case"RSASSA-PKCS1-v1_5":return function(t){switch(t.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new sn("unsupported RsaHashedKeyAlgorithm hash name",{cause:t})}}(e);case"ECDSA":return function(t){switch(t.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new sn("unsupported EcKeyAlgorithm namedCurve",{cause:t})}}(e);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return e.algorithm.name;case"EdDSA":return"Ed25519";default:throw new sn("unsupported CryptoKey algorithm name",{cause:e})}}function qs(e){const t=e==null?void 0:e[Ku];return typeof t=="number"&&Number.isFinite(t)?t:0}function qu(e){const t=e==null?void 0:e[Vu];return typeof t=="number"&&Number.isFinite(t)&&Math.sign(t)!==-1?t:30}function Js(){return Math.floor(Date.now()/1e3)}function On(e){if(typeof e!="object"||e===null)throw qe('"as" must be an object',"ERR_INVALID_ARG_TYPE");vt(e.issuer,'"as.issuer"')}function Pn(e){if(typeof e!="object"||e===null)throw qe('"client" must be an object',"ERR_INVALID_ARG_TYPE");vt(e.client_id,'"client.client_id"')}function Lp(e){return vt(e,'"clientSecret"'),(t,n,o,r)=>{o.set("client_id",n.client_id),o.set("client_secret",e)}}function D5(e,t){const{key:n,kid:o}=(r=e)instanceof CryptoKey?{key:r}:(r==null?void 0:r.key)instanceof CryptoKey?(r.kid!==void 0&&vt(r.kid,'"kid"'),{key:r.key,kid:r.kid}):{};var r;return T5(n,'"clientPrivateKey.key"'),async(i,a,s,c)=>{var l;const d={alg:L5(n),kid:o},f=function(h,p){const m=Js()+qs(p);return{jti:iw(),aud:h.issuer,exp:m+60,iat:m,nbf:m,iss:p.client_id,sub:p.client_id}}(i,a);t==null||(l=t[P5])===null||l===void 0||l.call(t,d,f),s.set("client_id",a.client_id),s.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),s.set("client_assertion",await async function(h,p,m){if(!m.usages.includes("sign"))throw qe('CryptoKey instances used for signing assertions must include "sign" in their "usages"',"ERR_INVALID_ARG_VALUE");const g="".concat(xr(ii(JSON.stringify(h))),".").concat(xr(ii(JSON.stringify(p)))),y=xr(await crypto.subtle.sign(function(w){switch(w.algorithm.name){case"ECDSA":return{name:w.algorithm.name,hash:eA(w)};case"RSA-PSS":switch($p(w),w.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:w.algorithm.name,saltLength:parseInt(w.algorithm.hash.name.slice(-3),10)>>3};default:throw new sn("unsupported RSA-PSS hash name",{cause:w})}case"RSASSA-PKCS1-v1_5":return $p(w),w.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return w.algorithm.name}throw new sn("unsupported CryptoKey algorithm name",{cause:w})}(m),m,ii(g)));return"".concat(g,".").concat(y)}(d,f,n))}}const M5=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function bf(e,t){if(t&&e.protocol!=="https:")throw je("only requests to HTTPS are allowed",dw,e);if(e.protocol!=="https:"&&e.protocol!=="http:")throw je("only HTTP and HTTPS requests are allowed",fw,e)}function Dp(e,t,n,o){let r;if(typeof e!="string"||!(r=M5(e)))throw je("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),e===void 0?X5:Q5,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return bf(r,o),r}function Ea(e,t,n,o){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?Dp(e.mtls_endpoint_aliases[t],t,n,o):Dp(e[t],t,n,o)}class zc extends Error{constructor(t,n){var o;super(t,n),pe(this,"cause",void 0),pe(this,"code",void 0),pe(this,"error",void 0),pe(this,"status",void 0),pe(this,"error_description",void 0),pe(this,"response",void 0),this.name=this.constructor.name,this.code=Z5,this.cause=n.cause,this.error=n.cause.error,this.status=n.response.status,this.error_description=n.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:n.response}),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}class aw extends Error{constructor(t,n){var o,r;super(t,n),pe(this,"cause",void 0),pe(this,"code",void 0),pe(this,"error",void 0),pe(this,"error_description",void 0),this.name=this.constructor.name,this.code=Y5,this.cause=n.cause,this.error=n.cause.get("error"),this.error_description=(o=n.cause.get("error_description"))!==null&&o!==void 0?o:void 0,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}}class xf extends Error{constructor(t,n){var o;super(t,n),pe(this,"cause",void 0),pe(this,"code",void 0),pe(this,"response",void 0),pe(this,"status",void 0),this.name=this.constructor.name,this.code=J5,this.cause=n.cause,this.status=n.response.status,this.response=n.response,Object.defineProperty(this,"response",{enumerable:!1}),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}const $5="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",H5=new RegExp("^[,\\s]*("+$5+")"),W5=new RegExp('^[,\\s]*([a-zA-Z0-9!#$%&\\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"[,\\s]*(.*)'),F5=new RegExp("^[,\\s]*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)\\s*=\\s*([a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+)[,\\s]*(.*)"),B5=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Sf(e,t,n){if(e.status!==t){let r;var o;throw function(i){let a;if(a=function(s){if(!Ai(s,Response))throw qe('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");const c=s.headers.get("www-authenticate");if(c===null)return;const l=[];let d=c;for(;d;){var f;let h=d.match(H5);const p=(f=h)===null||f===void 0?void 0:f[1].toLowerCase();if(!p)return;const m=d.substring(h[0].length);if(m&&!m.match(/^[\s,]/))return;const g=m.match(/^\s+(.*)$/),y=!!g;d=g?g[1]:void 0;const w={};let k;if(y)for(;d;){let S,x;if(h=d.match(W5)){if([,S,x,d]=h,x.includes("\\"))try{x=JSON.parse('"'.concat(x,'"'))}catch{}w[S.toLowerCase()]=x}else{if(!(h=d.match(F5))){if(h=d.match(B5)){if(Object.keys(w).length)break;[,k,d]=h;break}return}[,S,x,d]=h,w[S.toLowerCase()]=x}}else d=m||void 0;const b={scheme:p,parameters:w};k&&(b.token68=k),l.push(b)}return l.length?l:void 0}(i))throw new xf("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:a,response:i})}(e),(r=await async function(i){if(i.status>399&&i.status<500){_a(i),rw(i);try{const a=await i.clone().json();if(Gs(a)&&typeof a.error=="string"&&a.error.length)return a}catch{}}}(e))?(await((o=e.body)===null||o===void 0?void 0:o.cancel()),new zc("server responded with an error in the response body",{cause:r,response:e})):je('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),Ef,e)}}function sw(e){if(!Cf.has(e))throw qe('"options.DPoP" is not a valid DPoPHandle',"ERR_INVALID_ARG_VALUE")}function cw(e){var t;return(t=e.headers.get("content-type"))===null||t===void 0?void 0:t.split(";")[0]}async function kf(e,t,n,o,r,i,a){return await n(e,t,r,i),i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((a==null?void 0:a[Rn])||fetch)(o.href,{body:r,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:ow(o,a==null?void 0:a.signal)})}async function Aa(e,t,n,o,r,i){var a;const s=Ea(e,"token_endpoint",t.use_mtls_endpoint_aliases,(i==null?void 0:i[wn])!==!0);r.set("grant_type",o);const c=Bc(i==null?void 0:i.headers);c.set("accept","application/json"),(i==null?void 0:i.DPoP)!==void 0&&(sw(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const l=await kf(e,t,n,s,r,c,i);return i==null||(a=i.DPoP)===null||a===void 0||a.cacheNonce(l,s),l}const lw=new WeakMap,z5=new WeakMap;function Ju(e){if(!e.id_token)return;const t=lw.get(e);if(!t)throw qe('"ref" was already garbage collected or did not resolve from the proper sources',"ERR_INVALID_ARG_VALUE");return t}async function wi(e,t,n,o,r,i){if(On(e),Pn(t),!Ai(n,Response))throw qe('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Sf(n,200,"Token Endpoint"),_a(n);const a=await Uc(n);if(vt(a.access_token,'"response" body "access_token" property',He,{body:a}),vt(a.token_type,'"response" body "token_type" property',He,{body:a}),a.token_type=a.token_type.toLowerCase(),a.expires_in!==void 0){let s=typeof a.expires_in!="number"?parseFloat(a.expires_in):a.expires_in;Fo(s,!0,'"response" body "expires_in" property',He,{body:a}),a.expires_in=s}if(a.refresh_token!==void 0&&vt(a.refresh_token,'"response" body "refresh_token" property',He,{body:a}),a.scope!==void 0&&typeof a.scope!="string")throw je('"response" body "scope" property must be a string',He,{body:a});if(a.id_token!==void 0){vt(a.id_token,'"response" body "id_token" property',He,{body:a});const s=["aud","exp","iat","iss","sub"];t.require_auth_time===!0&&s.push("auth_time"),t.default_max_age!==void 0&&(Fo(t.default_max_age,!0,'"client.default_max_age"'),s.push("auth_time")),o!=null&&o.length&&s.push(...o);const{claims:c,jwt:l}=await async function(d,f,h,p,m){let g,y,{0:w,1:k,length:b}=d.split(".");if(b===5){if(m===void 0)throw new sn("JWE decryption is not configured",{cause:d});d=await m(d),{0:w,1:k,length:b}=d.split(".")}if(b!==3)throw je("Invalid JWT",He,d);try{g=JSON.parse(ii(xr(w)))}catch(x){throw je("failed to parse JWT Header body as base64url encoded JSON",Zs,x)}if(!Gs(g))throw je("JWT Header must be a top level object",He,d);if(f(g),g.crit!==void 0)throw new sn('no JWT "crit" header parameter extensions are supported',{cause:{header:g}});try{y=JSON.parse(ii(xr(k)))}catch(x){throw je("failed to parse JWT Payload body as base64url encoded JSON",Zs,x)}if(!Gs(y))throw je("JWT Payload must be a top level object",He,d);const S=Js()+h;if(y.exp!==void 0){if(typeof y.exp!="number")throw je('unexpected JWT "exp" (expiration time) claim type',He,{claims:y});if(y.exp<=S-p)throw je('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',ma,{claims:y,now:S,tolerance:p,claim:"exp"})}if(y.iat!==void 0&&typeof y.iat!="number")throw je('unexpected JWT "iat" (issued at) claim type',He,{claims:y});if(y.iss!==void 0&&typeof y.iss!="string")throw je('unexpected JWT "iss" (issuer) claim type',He,{claims:y});if(y.nbf!==void 0){if(typeof y.nbf!="number")throw je('unexpected JWT "nbf" (not before) claim type',He,{claims:y});if(y.nbf>S+p)throw je('unexpected JWT "nbf" (not before) claim value',ma,{claims:y,now:S,tolerance:p,claim:"nbf"})}if(y.aud!==void 0&&typeof y.aud!="string"&&!Array.isArray(y.aud))throw je('unexpected JWT "aud" (audience) claim type',He,{claims:y});return{header:g,claims:y,jwt:d}}(a.id_token,nA.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),qs(t),qu(t),r).then(G5.bind(void 0,s)).then(K5.bind(void 0,e)).then(U5.bind(void 0,t.client_id));if(Array.isArray(c.aud)&&c.aud.length!==1){if(c.azp===void 0)throw je('ID Token "aud" (audience) claim includes additional untrusted audiences',so,{claims:c,claim:"aud"});if(c.azp!==t.client_id)throw je('unexpected ID Token "azp" (authorized party) claim value',so,{expected:t.client_id,claims:c,claim:"azp"})}c.auth_time!==void 0&&Fo(c.auth_time,!0,'ID Token "auth_time" (authentication time)',He,{claims:c}),z5.set(n,l),lw.set(a,c)}if((i==null?void 0:i[a.token_type])!==void 0)i[a.token_type](n,a);else if(a.token_type!=="dpop"&&a.token_type!=="bearer")throw new sn("unsupported `token_type` value",{cause:{body:a}});return a}function U5(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw je('unexpected JWT "aud" (audience) claim value',so,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw je('unexpected JWT "aud" (audience) claim value',so,{expected:e,claims:t.claims,claim:"aud"});return t}function K5(e,t){var n,o;const r=(n=(o=e[hw])===null||o===void 0?void 0:o.call(e,t))!==null&&n!==void 0?n:e.issuer;if(t.claims.iss!==r)throw je('unexpected JWT "iss" (issuer) claim value',so,{expected:r,claims:t.claims,claim:"iss"});return t}const Cf=new WeakSet,Mp=Symbol(),V5={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function G5(e,t){for(const n of e)if(t.claims[n]===void 0)throw je('JWT "'.concat(n,'" (').concat(V5[n],") claim missing"),He,{claims:t.claims});return t}const Ol=Symbol(),Pl=Symbol();async function q5(e,t,n,o){return typeof(o==null?void 0:o.expectedNonce)=="string"||typeof(o==null?void 0:o.maxAge)=="number"||o!=null&&o.requireIdToken?async function(r,i,a,s,c,l,d){const f=[];switch(s){case void 0:s=Ol;break;case Ol:break;default:vt(s,'"expectedNonce" argument'),f.push("nonce")}switch(c!=null||(c=i.default_max_age),c){case void 0:c=Pl;break;case Pl:break;default:Fo(c,!0,'"maxAge" argument'),f.push("auth_time")}const h=await wi(r,i,a,f,l,d);vt(h.id_token,'"response" body "id_token" property',He,{body:h});const p=Ju(h);if(c!==Pl){const m=Js()+qs(i),g=qu(i);if(p.auth_time+c<m-g)throw je("too much time has elapsed since the last End-User authentication",ma,{claims:p,now:m,tolerance:g,claim:"auth_time"})}if(s===Ol){if(p.nonce!==void 0)throw je('unexpected ID Token "nonce" claim value',so,{expected:void 0,claims:p,claim:"nonce"})}else if(p.nonce!==s)throw je('unexpected ID Token "nonce" claim value',so,{expected:s,claims:p,claim:"nonce"});return h}(e,t,n,o.expectedNonce,o.maxAge,o[qn],o.recognizedTokenTypes):async function(r,i,a,s,c){const l=await wi(r,i,a,void 0,s,c),d=Ju(l);if(d){if(i.default_max_age!==void 0){Fo(i.default_max_age,!0,'"client.default_max_age"');const f=Js()+qs(i),h=qu(i);if(d.auth_time+i.default_max_age<f-h)throw je("too much time has elapsed since the last End-User authentication",ma,{claims:d,now:f,tolerance:h,claim:"auth_time"})}if(d.nonce!==void 0)throw je('unexpected ID Token "nonce" claim value',so,{expected:void 0,claims:d,claim:"nonce"})}return l}(e,t,n,o==null?void 0:o[qn],o==null?void 0:o.recognizedTokenTypes)}const J5="OAUTH_WWW_AUTHENTICATE_CHALLENGE",Z5="OAUTH_RESPONSE_BODY_ERROR",Zu="OAUTH_UNSUPPORTED_OPERATION",Y5="OAUTH_AUTHORIZATION_RESPONSE_ERROR",Zs="OAUTH_PARSE_ERROR",He="OAUTH_INVALID_RESPONSE",uw="OAUTH_RESPONSE_IS_NOT_JSON",Ef="OAUTH_RESPONSE_IS_NOT_CONFORM",dw="OAUTH_HTTP_REQUEST_FORBIDDEN",fw="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",ma="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",so="OAUTH_JWT_CLAIM_COMPARISON_FAILED",Yu="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",X5="OAUTH_MISSING_SERVER_METADATA",Q5="OAUTH_INVALID_SERVER_METADATA";function _a(e){if(e.bodyUsed)throw qe('"response" body has been used already',"ERR_INVALID_ARG_VALUE")}function $p(e){const{algorithm:t}=e;if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new sn("unsupported ".concat(t.name," modulusLength"),{cause:e})}function eA(e){const{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new sn("unsupported ECDSA namedCurve",{cause:e})}}async function tA(e){if(e.method!=="POST")throw qe("form_post responses are expected to use the POST method","ERR_INVALID_ARG_VALUE",{cause:e});if(cw(e)!=="application/x-www-form-urlencoded")throw qe("form_post responses are expected to use the application/x-www-form-urlencoded content-type","ERR_INVALID_ARG_VALUE",{cause:e});return async function(t){if(t.bodyUsed)throw qe("form_post Request instances must contain a readable body","ERR_INVALID_ARG_VALUE",{cause:t});return t.text()}(e)}function nA(e,t,n,o){if(e===void 0)if(Array.isArray(t)){if(!t.includes(o.alg))throw je('unexpected JWT "alg" header parameter',He,{header:o,expected:t,reason:"authorization server metadata"})}else{if(n===void 0)throw je('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:n});if(typeof n=="string"?o.alg!==n:typeof n=="function"?!n(o.alg):!n.includes(o.alg))throw je('unexpected JWT "alg" header parameter',He,{header:o,expected:n,reason:"default value"})}else if(typeof e=="string"?o.alg!==e:!e.includes(o.alg))throw je('unexpected JWT "alg" header parameter',He,{header:o,expected:e,reason:"client configuration"})}function dr(e,t){const{0:n,length:o}=e.getAll(t);if(o>1)throw je('"'.concat(t,'" parameter must be provided only once'),He);return n}const oA=Symbol(),rA=Symbol();function iA(e,t,n,o){if(On(e),Pn(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw qe('"parameters" must be an instance of URLSearchParams, or URL',"ERR_INVALID_ARG_TYPE");if(dr(n,"response"))throw je('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',He,{parameters:n});const r=dr(n,"iss"),i=dr(n,"state");if(!r&&e.authorization_response_iss_parameter_supported)throw je('response parameter "iss" (issuer) missing',He,{parameters:n});if(r&&r!==e.issuer)throw je('unexpected "iss" (issuer) response parameter value',He,{expected:e.issuer,parameters:n});switch(o){case void 0:case rA:if(i!==void 0)throw je('unexpected "state" response parameter encountered',He,{expected:void 0,parameters:n});break;case oA:break;default:if(vt(o,'"expectedState" argument'),i!==o)throw je(i===void 0?'response parameter "state" missing':'unexpected "state" response parameter value',He,{expected:o,parameters:n})}if(dr(n,"error"))throw new aw("authorization response from the server is an error",{cause:n});const a=dr(n,"id_token"),s=dr(n,"token");if(a!==void 0||s!==void 0)throw new sn("implicit and hybrid flows are not supported");return c=new URLSearchParams(n),Cf.add(c),c;var c}async function Uc(e){let t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:rw;try{t=await e.json()}catch(o){throw n(e),je('failed to parse "response" body as JSON',Zs,o)}if(!Gs(t))throw je('"response" body must be a top level object',He,{body:t});return t}const Nl=Symbol(),hw=Symbol(),Hp=new TextEncoder,ga=new TextDecoder;function Il(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");t[n]=o}return t}function pw(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function Qi(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:ga.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=ga.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{return pw(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}class Lt extends Error{constructor(t,n){var o;super(t,n),pe(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}pe(Lt,"code","ERR_JOSE_GENERIC");class xn extends Lt{constructor(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(t,{cause:{claim:o,reason:r,payload:n}}),pe(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),pe(this,"claim",void 0),pe(this,"reason",void 0),pe(this,"payload",void 0),this.claim=o,this.reason=r,this.payload=n}}pe(xn,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class Xu extends Lt{constructor(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(t,{cause:{claim:o,reason:r,payload:n}}),pe(this,"code","ERR_JWT_EXPIRED"),pe(this,"claim",void 0),pe(this,"reason",void 0),pe(this,"payload",void 0),this.claim=o,this.reason=r,this.payload=n}}pe(Xu,"code","ERR_JWT_EXPIRED");class mw extends Lt{constructor(){super(...arguments),pe(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}pe(mw,"code","ERR_JOSE_ALG_NOT_ALLOWED");class rn extends Lt{constructor(){super(...arguments),pe(this,"code","ERR_JOSE_NOT_SUPPORTED")}}pe(rn,"code","ERR_JOSE_NOT_SUPPORTED");pe(class extends Lt{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),pe(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED");pe(class extends Lt{constructor(){super(...arguments),pe(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class jt extends Lt{constructor(){super(...arguments),pe(this,"code","ERR_JWS_INVALID")}}pe(jt,"code","ERR_JWS_INVALID");class Qu extends Lt{constructor(){super(...arguments),pe(this,"code","ERR_JWT_INVALID")}}pe(Qu,"code","ERR_JWT_INVALID");pe(class extends Lt{constructor(){super(...arguments),pe(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class Af extends Lt{constructor(){super(...arguments),pe(this,"code","ERR_JWKS_INVALID")}}pe(Af,"code","ERR_JWKS_INVALID");class _f extends Lt{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),pe(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}pe(_f,"code","ERR_JWKS_NO_MATCHING_KEY");class gw extends Lt{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),pe(this,Symbol.asyncIterator,void 0),pe(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}pe(gw,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class vw extends Lt{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),pe(this,"code","ERR_JWKS_TIMEOUT")}}pe(vw,"code","ERR_JWKS_TIMEOUT");class yw extends Lt{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),pe(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}pe(yw,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const Dn=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"algorithm.name";return new TypeError("CryptoKey does not support this operation, its ".concat(t," must be ").concat(e))},Wr=(e,t)=>e.name===t;function Tl(e){return parseInt(e.name.slice(4),10)}function aA(e,t,n){switch(t){case"HS256":case"HS384":case"HS512":{if(!Wr(e.algorithm,"HMAC"))throw Dn("HMAC");const o=parseInt(t.slice(2),10);if(Tl(e.algorithm.hash)!==o)throw Dn("SHA-".concat(o),"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Wr(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Dn("RSASSA-PKCS1-v1_5");const o=parseInt(t.slice(2),10);if(Tl(e.algorithm.hash)!==o)throw Dn("SHA-".concat(o),"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Wr(e.algorithm,"RSA-PSS"))throw Dn("RSA-PSS");const o=parseInt(t.slice(2),10);if(Tl(e.algorithm.hash)!==o)throw Dn("SHA-".concat(o),"algorithm.hash");break}case"Ed25519":case"EdDSA":if(!Wr(e.algorithm,"Ed25519"))throw Dn("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":if(!Wr(e.algorithm,t))throw Dn(t);break;case"ES256":case"ES384":case"ES512":{if(!Wr(e.algorithm,"ECDSA"))throw Dn("ECDSA");const o=function(r){switch(r){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==o)throw Dn(o,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}(function(o,r){if(r&&!o.usages.includes(r))throw new TypeError("CryptoKey does not support this operation, its usages must include ".concat(r,"."))})(e,n)}function ww(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];if((o=o.filter(Boolean)).length>2){const a=o.pop();e+="one of type ".concat(o.join(", "),", or ").concat(a,".")}else o.length===2?e+="one of type ".concat(o[0]," or ").concat(o[1],"."):e+="of type ".concat(o[0],".");if(t==null)e+=" Received ".concat(t);else if(typeof t=="function"&&t.name)e+=" Received function ".concat(t.name);else if(typeof t=="object"&&t!=null){var i;(i=t.constructor)!==null&&i!==void 0&&i.name&&(e+=" Received an instance of ".concat(t.constructor.name))}return e}const Wp=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return ww("Key for the ".concat(e," algorithm must be "),t,...o)},bw=e=>{if((e==null?void 0:e[Symbol.toStringTag])==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},xw=e=>(e==null?void 0:e[Symbol.toStringTag])==="KeyObject",Fp=e=>bw(e)||xw(e);function Ko(e){if(typeof(t=e)!="object"||t===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;var t;if(Object.getPrototypeOf(e)===null)return!0;let n=e;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}const Rl=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0},ea=e=>{const t=e.data[e.pos++];if(128&t){const n=127&t;let o=0;for(let r=0;r<n;r++)o=o<<8|e.data[e.pos++];return o}return t},ta=(e,t,n)=>{if(e.data[e.pos++]!==t)throw new Error(n)},Bp=(e,t)=>{const n=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,n},sA=e=>{const t=(r=>{ta(r,6,"Expected algorithm OID");const i=ea(r);return Bp(r,i)})(e);if(Rl(t,[43,101,110]))return"X25519";if(!Rl(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");ta(e,6,"Expected curve OID");const n=ea(e),o=Bp(e,n);for(const{name:r,oid:i}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(Rl(o,i))return r;throw new Error("Unsupported named curve")},cA=async(e,t,n,o)=>{var r;let i,a;const s=e==="spki",c=()=>s?["verify"]:["sign"];switch(n){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(n.slice(-3),10)||1)},a=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":i={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[n]},a=c();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const l=o.getNamedCurve(t);i=l==="X25519"?{name:"X25519"}:{name:"ECDH",namedCurve:l}}catch{throw new rn("Invalid or unsupported key format")}a=s?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":i={name:"Ed25519"},a=c();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":i={name:n},a=c();break;default:throw new rn('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,i,(r=o==null?void 0:o.extractable)!==null&&r!==void 0?r:!!s,a)},lA=(e,t,n)=>{var o;const r=((a,s)=>pw(a.replace(s,"")))(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g);let i=n;return t!=null&&(o=t.startsWith)!==null&&o!==void 0&&o.call(t,"ECDH-ES")&&(i||(i={}),i.getNamedCurve=a=>{const s={data:a,pos:0};return function(c){ta(c,48,"Invalid PKCS#8 structure"),ea(c),ta(c,2,"Expected version field");const l=ea(c);c.pos+=l,ta(c,48,"Expected algorithm identifier"),ea(c),c.pos}(s),sA(s)}),cA("pkcs8",r,t,i)};async function ys(e){var t,n;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:o,keyUsages:r}=function(a){let s,c;switch(a.kty){case"AKP":switch(a.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":s={name:a.alg},c=a.priv?["sign"]:["verify"];break;default:throw new rn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"RSA":switch(a.alg){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:"SHA-".concat(a.alg.slice(-3))},c=a.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(a.alg.slice(-3))},c=a.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(a.alg.slice(-3),10)||1)},c=a.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new rn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"EC":switch(a.alg){case"ES256":s={name:"ECDSA",namedCurve:"P-256"},c=a.d?["sign"]:["verify"];break;case"ES384":s={name:"ECDSA",namedCurve:"P-384"},c=a.d?["sign"]:["verify"];break;case"ES512":s={name:"ECDSA",namedCurve:"P-521"},c=a.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":s={name:"ECDH",namedCurve:a.crv},c=a.d?["deriveBits"]:[];break;default:throw new rn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;case"OKP":switch(a.alg){case"Ed25519":case"EdDSA":s={name:"Ed25519"},c=a.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":s={name:a.crv},c=a.d?["deriveBits"]:[];break;default:throw new rn('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break;default:throw new rn('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:s,keyUsages:c}}(e),i=Se({},e);return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,o,(t=e.ext)!==null&&t!==void 0?t:!e.d&&!e.priv,(n=e.key_ops)!==null&&n!==void 0?n:r)}const ed=e=>Ko(e)&&typeof e.kty=="string";let Ro;const zp=async function(e,t,n){let o=arguments.length>3&&arguments[3]!==void 0&&arguments[3];Ro||(Ro=new WeakMap);let r=Ro.get(e);if(r!=null&&r[n])return r[n];const i=await ys(Se(Se({},t),{},{alg:n}));return o&&Object.freeze(e),r?r[n]=i:Ro.set(e,{[n]:i}),i};async function uA(e,t){if(e instanceof Uint8Array||bw(e))return e;if(xw(e)){if(e.type==="secret")return e.export();if("toCryptoKey"in e&&typeof e.toCryptoKey=="function")try{return((o,r)=>{Ro||(Ro=new WeakMap);let i=Ro.get(o);if(i!=null&&i[r])return i[r];const a=o.type==="public",s=!!a;let c;if(o.asymmetricKeyType==="x25519"){switch(r){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}c=o.toCryptoKey(o.asymmetricKeyType,s,a?[]:["deriveBits"])}if(o.asymmetricKeyType==="ed25519"){if(r!=="EdDSA"&&r!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=o.toCryptoKey(o.asymmetricKeyType,s,[a?"verify":"sign"])}switch(o.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(r!==o.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");c=o.toCryptoKey(o.asymmetricKeyType,s,[a?"verify":"sign"])}if(o.asymmetricKeyType==="rsa"){let d;switch(r){case"RSA-OAEP":d="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":d="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":d="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":d="SHA-512";break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(r.startsWith("RSA-OAEP"))return o.toCryptoKey({name:"RSA-OAEP",hash:d},s,a?["encrypt"]:["decrypt"]);c=o.toCryptoKey({name:r.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:d},s,[a?"verify":"sign"])}if(o.asymmetricKeyType==="ec"){var l;const d=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get((l=o.asymmetricKeyDetails)===null||l===void 0?void 0:l.namedCurve);if(!d)throw new TypeError("given KeyObject instance cannot be used for this algorithm");r==="ES256"&&d==="P-256"&&(c=o.toCryptoKey({name:"ECDSA",namedCurve:d},s,[a?"verify":"sign"])),r==="ES384"&&d==="P-384"&&(c=o.toCryptoKey({name:"ECDSA",namedCurve:d},s,[a?"verify":"sign"])),r==="ES512"&&d==="P-521"&&(c=o.toCryptoKey({name:"ECDSA",namedCurve:d},s,[a?"verify":"sign"])),r.startsWith("ECDH-ES")&&(c=o.toCryptoKey({name:"ECDH",namedCurve:d},s,a?[]:["deriveBits"]))}if(!c)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return i?i[r]=c:Ro.set(o,{[r]:c}),c})(e,t)}catch(o){if(o instanceof TypeError)throw o}let n=e.export({format:"jwk"});return zp(e,n,t)}if(ed(e))return e.k?Qi(e.k):zp(e,e,t,!0);throw new Error("unreachable")}const Fr=e=>e==null?void 0:e[Symbol.toStringTag],Ll=(e,t,n)=>{if(t.use!==void 0){let i;switch(n){case"sign":case"verify":i="sig";break;case"encrypt":case"decrypt":i="enc"}if(t.use!==i)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(i,'" when present'))}if(t.alg!==void 0&&t.alg!==e)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(e,'" when present'));if(Array.isArray(t.key_ops)){var o,r;let i;switch(!0){case(n==="sign"||n==="verify"):case e==="dir":case e.includes("CBC-HS"):i=n;break;case e.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):i=!e.includes("GCM")&&e.endsWith("KW")?n==="encrypt"?"wrapKey":"unwrapKey":n;break;case(n==="encrypt"&&e.startsWith("RSA")):i="wrapKey";break;case n==="decrypt":i=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&((o=t.key_ops)===null||o===void 0||(r=o.includes)===null||r===void 0?void 0:r.call(o,i))===!1)throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}return!0};function dA(e,t,n){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((o,r,i)=>{if(!(r instanceof Uint8Array)){if(ed(r)){if((a=>a.kty==="oct"&&typeof a.k=="string")(r)&&Ll(o,r,i))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Fp(r))throw new TypeError(Wp(o,r,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(r.type!=="secret")throw new TypeError("".concat(Fr(r),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,n);break;default:((o,r,i)=>{if(ed(r))switch(i){case"decrypt":case"sign":if((a=>a.kty!=="oct"&&(a.kty==="AKP"&&typeof a.priv=="string"||typeof a.d=="string"))(r)&&Ll(o,r,i))return;throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if((a=>a.kty!=="oct"&&a.d===void 0&&a.priv===void 0)(r)&&Ll(o,r,i))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!Fp(r))throw new TypeError(Wp(o,r,"CryptoKey","KeyObject","JSON Web Key"));if(r.type==="secret")throw new TypeError("".concat(Fr(r),' instances for asymmetric algorithms must not be of type "secret"'));if(r.type==="public")switch(i){case"sign":throw new TypeError("".concat(Fr(r),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(Fr(r),' instances for asymmetric algorithm decryption must be of type "private"'))}if(r.type==="private")switch(i){case"verify":throw new TypeError("".concat(Fr(r),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(Fr(r),' instances for asymmetric algorithm encryption must be of type "public"'))}})(e,t,n)}}var Qa,Dl;let Jn,Up;if(typeof navigator>"u"||(Qa=navigator.userAgent)===null||Qa===void 0||(Dl=Qa.startsWith)===null||Dl===void 0||!Dl.call(Qa,"Mozilla/5.0 ")){const e="v6.8.1";Up="".concat("openid-client","/").concat(e),Jn={"user-agent":Up}}const It=e=>ws.get(e);let ws,es;function Sw(e){return e!==void 0?Lp(e):(es||(es=new WeakMap),(t,n,o,r)=>{let i;return(i=es.get(n))||(function(a,s){if(typeof a!="string")throw Zn("".concat(s," must be a string"),Oa);if(a.length===0)throw Zn("".concat(s," must not be empty"),ja)}(n.client_secret,'"metadata.client_secret"'),i=Lp(n.client_secret),es.set(n,i)),i(t,n,o,r)})}const Lo=Rn,ja="ERR_INVALID_ARG_VALUE",Oa="ERR_INVALID_ARG_TYPE";function Zn(e,t,n){const o=new TypeError(e,{cause:n});return Object.assign(o,{code:t}),o}function fA(e){return async function(t){return vt(t,"codeVerifier"),xr(await crypto.subtle.digest("SHA-256",ii(t)))}(e)}function hA(){return iw()}class Ys extends Error{constructor(t,n){var o;super(t,n),pe(this,"code",void 0),this.name=this.constructor.name,this.code=n==null?void 0:n.code,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}function Bt(e,t,n){return new Ys(e,{cause:t,code:n})}function Ut(e){if(e instanceof TypeError||e instanceof Ys||e instanceof zc||e instanceof aw||e instanceof xf)throw e;if(e instanceof wf)switch(e.code){case dw:throw Bt("only requests to HTTPS are allowed",e,e.code);case fw:throw Bt("only requests to HTTP or HTTPS are allowed",e,e.code);case Ef:throw Bt("unexpected HTTP response status code",e.cause,e.code);case uw:throw Bt("unexpected response content-type",e.cause,e.code);case Zs:throw Bt("parsing error occured",e,e.code);case He:throw Bt("invalid response encountered",e,e.code);case so:throw Bt("unexpected JWT claim value encountered",e,e.code);case Yu:throw Bt("unexpected JSON attribute value encountered",e,e.code);case ma:throw Bt("JWT timestamp claim value failed validation",e,e.code);default:throw Bt(e.message,e,e.code)}if(e instanceof sn)throw Bt("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw Bt("runtime operation error",e,Zu);case"NotSupportedError":throw Bt("runtime unsupported operation",e,Zu);case"TimeoutError":throw Bt("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw Bt("operation aborted",e,"OAUTH_ABORT")}throw new Ys("something went wrong",{cause:e})}async function pA(e,t,n,o,r){const i=await async function(c,l){var d,f;if(!(c instanceof URL))throw Zn('"server" must be an instance of URL',Oa);const h=!c.href.includes("/.well-known/"),p=(d=l==null?void 0:l.timeout)!==null&&d!==void 0?d:30,m=AbortSignal.timeout(1e3*p),g=await(h?R5(c,{algorithm:l==null?void 0:l.algorithm,[Rn]:l==null?void 0:l[Lo],[wn]:l==null||(f=l.execute)===null||f===void 0?void 0:f.includes(Gp),signal:m,headers:new Headers(Jn)}):((l==null?void 0:l[Lo])||fetch)((bf(c,l==null||(y=l.execute)===null||y===void 0||!y.includes(Gp)),c.href),{headers:Object.fromEntries(new Headers(Se({accept:"application/json"},Jn)).entries()),body:void 0,method:"GET",redirect:"manual",signal:m})).then(w=>async function(k,b){const S=k;if(!(S instanceof URL)&&S!==Nl)throw qe('"expectedIssuerIdentifier" must be an instance of URL',"ERR_INVALID_ARG_TYPE");if(!Ai(b,Response))throw qe('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");if(b.status!==200)throw je('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',Ef,b);_a(b);const x=await Uc(b);if(vt(x.issuer,'"response" body "issuer" property',He,{body:x}),S!==Nl&&new URL(x.issuer).href!==S.href)throw je('"response" body "issuer" property does not match the expected value',Yu,{expected:S.href,body:x,attribute:"issuer"});return x}(Nl,w)).catch(Ut);var y;return h&&new URL(g.issuer).href!==c.href&&(function(w,k,b){return!(w.origin!=="https://login.microsoftonline.com"||b!=null&&b.algorithm&&b.algorithm!=="oidc"||(k[kw]=!0,0))}(c,g,l)||function(w,k){return!(!w.hostname.endsWith(".b2clogin.com")||k!=null&&k.algorithm&&k.algorithm!=="oidc")}(c,l)||(()=>{throw new Ys("discovered metadata issuer does not match the expected issuer",{code:Yu,cause:{expected:c.href,body:g,attribute:"issuer"}})})()),g}(e,r),a=new Xs(i,t,n,o);let s=It(a);if(r!=null&&r[Lo]&&(s.fetch=r[Lo]),r!=null&&r.timeout&&(s.timeout=r.timeout),r!=null&&r.execute)for(const c of r.execute)c(a);return a}new TextDecoder;const kw=Symbol();class Xs{constructor(t,n,o,r){var i,a,s,c,l;if(typeof n!="string"||!n.length)throw Zn('"clientId" must be a non-empty string',Oa);if(typeof o=="string"&&(o={client_secret:o}),((i=o)===null||i===void 0?void 0:i.client_id)!==void 0&&n!==o.client_id)throw Zn('"clientId" and "metadata.client_id" must be the same',ja);const d=Se(Se({},structuredClone(o)),{},{client_id:n});let f;d[Ku]=(a=(s=o)===null||s===void 0?void 0:s[Ku])!==null&&a!==void 0?a:0,d[Vu]=(c=(l=o)===null||l===void 0?void 0:l[Vu])!==null&&c!==void 0?c:30,f=r||(typeof d.client_secret=="string"&&d.client_secret.length?Sw(d.client_secret):(g,y,w,k)=>{w.set("client_id",y.client_id)});let h=Object.freeze(d);const p=structuredClone(t);kw in t&&(p[hw]=g=>{let{claims:{tid:y}}=g;return t.issuer.replace("{tenantid}",y)});let m=Object.freeze(p);ws||(ws=new WeakMap),ws.set(this,{__proto__:null,as:m,c:h,auth:f,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const t=structuredClone(It(this).as);return function(n){Object.defineProperties(n,function(o){return{supportsPKCE:{__proto__:null,value(){var r;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"S256";return((r=o.code_challenge_methods_supported)===null||r===void 0?void 0:r.includes(i))===!0}}}}(n))}(t),t}clientMetadata(){return structuredClone(It(this).c)}get timeout(){return It(this).timeout}set timeout(t){It(this).timeout=t}get[Lo](){return It(this).fetch}set[Lo](t){It(this).fetch=t}}function Pa(e){Object.defineProperties(e,function(t){let n;if(t.expires_in!==void 0){const o=new Date;o.setSeconds(o.getSeconds()+t.expires_in),n=o.getTime()}return{expiresIn:{__proto__:null,value(){if(n){const o=Date.now();return n>o?Math.floor((n-o)/1e3):0}}},claims:{__proto__:null,value(){try{return Ju(this)}catch{return}}}}}(e))}async function Kp(e,t,n){var o;let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const i=(o=e.headers.get("retry-after"))===null||o===void 0?void 0:o.trim();if(i===void 0)return;let a;if(/^\d+$/.test(i))a=parseInt(i,10);else{const s=new Date(i);if(Number.isFinite(s.getTime())){const c=new Date,l=s.getTime()-c.getTime();l>0&&(a=Math.ceil(l/1e3))}}if(r&&!Number.isFinite(a))throw new wf("invalid Retry-After header value",{cause:e});a>t&&await Cw(a-t,n)}function Cw(e,t){return new Promise((n,o)=>{const r=i=>{try{t.throwIfAborted()}catch(s){return void o(s)}if(i<=0)return void n();const a=Math.min(i,5);setTimeout(()=>r(i-a),1e3*a)};r(e)})}async function Vp(e,t){fo(e);const{as:n,c:o,auth:r,fetch:i,tlsOnly:a,timeout:s}=It(e);return async function(c,l,d,f,h){On(c),Pn(l);const p=Ea(c,"backchannel_authentication_endpoint",l.use_mtls_endpoint_aliases,(h==null?void 0:h[wn])!==!0),m=new URLSearchParams(f);m.set("client_id",l.client_id);const g=Bc(h==null?void 0:h.headers);return g.set("accept","application/json"),kf(c,l,d,p,m,g,h)}(n,o,r,t,{[Rn]:i,[wn]:!a,headers:new Headers(Jn),signal:Ir(s)}).then(c=>async function(l,d,f){if(On(l),Pn(d),!Ai(f,Response))throw qe('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Sf(f,200,"Backchannel Authentication Endpoint"),_a(f);const h=await Uc(f);vt(h.auth_req_id,'"response" body "auth_req_id" property',He,{body:h});let p=typeof h.expires_in!="number"?parseFloat(h.expires_in):h.expires_in;return Fo(p,!0,'"response" body "expires_in" property',He,{body:h}),h.expires_in=p,h.interval!==void 0&&Fo(h.interval,!1,'"response" body "interval" property',He,{body:h}),h}(n,o,c)).catch(Ut)}async function Ew(e,t,n,o){var r,i;fo(e),n=new URLSearchParams(n);let a=(r=t.interval)!==null&&r!==void 0?r:5;const s=(i=o==null?void 0:o.signal)!==null&&i!==void 0?i:AbortSignal.timeout(1e3*t.expires_in);try{await Cw(a,s)}catch(x){Ut(x)}const{as:c,c:l,auth:d,fetch:f,tlsOnly:h,nonRepudiation:p,timeout:m,decrypt:g}=It(e),y=(x,C)=>Ew(e,Se(Se({},t),{},{interval:x}),n,Se(Se({},o),{},{signal:s,flag:C})),w=await async function(x,C,T,L,M){On(x),Pn(C),vt(L,'"authReqId"');const j=new URLSearchParams(M==null?void 0:M.additionalParameters);return j.set("auth_req_id",L),Aa(x,C,T,"urn:openid:params:grant-type:ciba",j,M)}(c,l,d,t.auth_req_id,{[Rn]:f,[wn]:!h,additionalParameters:n,DPoP:o==null?void 0:o.DPoP,headers:new Headers(Jn),signal:s.aborted?s:Ir(m)}).catch(Ut);var k;if(w.status===503&&w.headers.has("retry-after"))return await Kp(w,a,s,!0),await((k=w.body)===null||k===void 0?void 0:k.cancel()),y(a);const b=async function(x,C,T,L){return wi(x,C,T,void 0,L==null?void 0:L[qn],L==null?void 0:L.recognizedTokenTypes)}(c,l,w,{[qn]:g});let S;try{S=await b}catch(x){if(Na(x,o))return y(a,Bo);if(x instanceof zc)switch(x.error){case"slow_down":a+=5;case"authorization_pending":return await Kp(x.response,a,s),y(a)}Ut(x)}return S.id_token&&await(p==null?void 0:p(w)),Pa(S),S}function Gp(e){It(e).tlsOnly=!1}async function Aw(e,t,n,o,r){if(fo(e),!((r==null?void 0:r.flag)===Bo||t instanceof URL||function(x,C){try{return Object.getPrototypeOf(x)[Symbol.toStringTag]===C}catch{return!1}}(t,"Request")))throw Zn('"currentUrl" must be an instance of URL, or Request',Oa);let i,a;const{as:s,c,auth:l,fetch:d,tlsOnly:f,jarm:h,hybrid:p,nonRepudiation:m,timeout:g,decrypt:y,implicit:w}=It(e);if((r==null?void 0:r.flag)===Bo)i=r.authResponse,a=r.redirectUri;else{if(!(t instanceof URL)){const x=t;switch(t=new URL(t.url),x.method){case"GET":break;case"POST":const C=new URLSearchParams(await tA(x));if(p)t.hash=C.toString();else for(const[T,L]of C.entries())t.searchParams.append(T,L);break;default:throw Zn("unexpected Request HTTP method",ja)}}switch(a=function(x){return(x=new URL(x)).search="",x.hash="",x.href}(t),!0){case!!h:i=await h(t,n==null?void 0:n.expectedState);break;case!!p:i=await p(t,n==null?void 0:n.expectedNonce,n==null?void 0:n.expectedState,n==null?void 0:n.maxAge);break;case!!w:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{i=iA(s,c,t.searchParams,n==null?void 0:n.expectedState)}catch(x){Ut(x)}}}const k=await async function(x,C,T,L,M,j,N){if(On(x),Pn(C),!Cf.has(L))throw qe('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',"ERR_INVALID_ARG_VALUE");vt(M,'"redirectUri"');const O=dr(L,"code");if(!O)throw je('no authorization code in "callbackParameters"',He);const Y=new URLSearchParams(N==null?void 0:N.additionalParameters);return Y.set("redirect_uri",M),Y.set("code",O),j!==Mp&&(vt(j,'"codeVerifier"'),Y.set("code_verifier",j)),Aa(x,C,T,"authorization_code",Y,N)}(s,c,l,i,a,(n==null?void 0:n.pkceCodeVerifier)||Mp,{additionalParameters:o,[Rn]:d,[wn]:!f,DPoP:r==null?void 0:r.DPoP,headers:new Headers(Jn),signal:Ir(g)}).catch(Ut);typeof(n==null?void 0:n.expectedNonce)!="string"&&typeof(n==null?void 0:n.maxAge)!="number"||(n.idTokenExpected=!0);const b=q5(s,c,k,{expectedNonce:n==null?void 0:n.expectedNonce,maxAge:n==null?void 0:n.maxAge,requireIdToken:n==null?void 0:n.idTokenExpected,[qn]:y});let S;try{S=await b}catch(x){if(Na(x,r))return Aw(e,void 0,n,o,Se(Se({},r),{},{flag:Bo,authResponse:i,redirectUri:a}));Ut(x)}return S.id_token&&await(m==null?void 0:m(k)),Pa(S),S}async function _w(e,t,n,o){fo(e),n=new URLSearchParams(n);const{as:r,c:i,auth:a,fetch:s,tlsOnly:c,nonRepudiation:l,timeout:d,decrypt:f}=It(e),h=await async function(g,y,w,k,b){On(g),Pn(y),vt(k,'"refreshToken"');const S=new URLSearchParams(b==null?void 0:b.additionalParameters);return S.set("refresh_token",k),Aa(g,y,w,"refresh_token",S,b)}(r,i,a,t,{[Rn]:s,[wn]:!c,additionalParameters:n,DPoP:o==null?void 0:o.DPoP,headers:new Headers(Jn),signal:Ir(d)}).catch(Ut),p=async function(g,y,w,k){return wi(g,y,w,void 0,k==null?void 0:k[qn],k==null?void 0:k.recognizedTokenTypes)}(r,i,h,{[qn]:f});let m;try{m=await p}catch(g){if(Na(g,o))return _w(e,t,n,Se(Se({},o),{},{flag:Bo}));Ut(g)}return m.id_token&&await(l==null?void 0:l(h)),Pa(m),m}async function jw(e,t,n){fo(e),t=new URLSearchParams(t);const{as:o,c:r,auth:i,fetch:a,tlsOnly:s,timeout:c}=It(e),l=await async function(h,p,m,g,y){return On(h),Pn(p),Aa(h,p,m,"client_credentials",new URLSearchParams(g),y)}(o,r,i,t,{[Rn]:a,[wn]:!s,DPoP:n==null?void 0:n.DPoP,headers:new Headers(Jn),signal:Ir(c)}).catch(Ut),d=async function(h,p,m,g){return wi(h,p,m,void 0,g==null?void 0:g[qn],g==null?void 0:g.recognizedTokenTypes)}(o,r,l);let f;try{f=await d}catch(h){if(Na(h,n))return jw(e,t,Se(Se({},n),{},{flag:Bo}));Ut(h)}return Pa(f),f}function td(e,t){fo(e);const{as:n,c:o,tlsOnly:r,hybrid:i,jarm:a,implicit:s}=It(e),c=Ea(n,"authorization_endpoint",!1,r);if((t=new URLSearchParams(t)).has("client_id")||t.set("client_id",o.client_id),!t.has("request_uri")&&!t.has("request")){if(t.has("response_type")||t.set("response_type",i?"code id_token":s?"id_token":"code"),s&&!t.has("nonce"))throw Zn("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",ja);a&&t.set("response_mode","jwt")}for(const[l,d]of t.entries())c.searchParams.append(l,d);return c}async function Ow(e,t,n){fo(e);const o=td(e,t),{as:r,c:i,auth:a,fetch:s,tlsOnly:c,timeout:l}=It(e),d=await async function(p,m,g,y,w){var k;On(p),Pn(m);const b=Ea(p,"pushed_authorization_request_endpoint",m.use_mtls_endpoint_aliases,(w==null?void 0:w[wn])!==!0),S=new URLSearchParams(y);S.set("client_id",m.client_id);const x=Bc(w==null?void 0:w.headers);x.set("accept","application/json"),(w==null?void 0:w.DPoP)!==void 0&&(sw(w.DPoP),await w.DPoP.addProof(b,x,"POST"));const C=await kf(p,m,g,b,S,x,w);return w==null||(k=w.DPoP)===null||k===void 0||k.cacheNonce(C,b),C}(r,i,a,o.searchParams,{[Rn]:s,[wn]:!c,DPoP:n==null?void 0:n.DPoP,headers:new Headers(Jn),signal:Ir(l)}).catch(Ut),f=async function(p,m,g){if(On(p),Pn(m),!Ai(g,Response))throw qe('"response" must be an instance of Response',"ERR_INVALID_ARG_TYPE");await Sf(g,201,"Pushed Authorization Request Endpoint"),_a(g);const y=await Uc(g);vt(y.request_uri,'"response" body "request_uri" property',He,{body:y});let w=typeof y.expires_in!="number"?parseFloat(y.expires_in):y.expires_in;return Fo(w,!0,'"response" body "expires_in" property',He,{body:y}),y.expires_in=w,y}(r,i,d);let h;try{h=await f}catch(p){if(Na(p,n))return Ow(e,t,Se(Se({},n),{},{flag:Bo}));Ut(p)}return td(e,{request_uri:h.request_uri})}function fo(e){if(!(e instanceof Xs))throw Zn('"config" must be an instance of Configuration',Oa);if(Object.getPrototypeOf(e)!==Xs.prototype)throw Zn("subclassing Configuration is not allowed",ja)}function Ir(e){return e?AbortSignal.timeout(1e3*e):void 0}function Na(e,t){return!(t==null||!t.DPoP||t.flag===Bo)&&function(n){if(n instanceof xf){const{0:o,length:r}=n.cause;return r===1&&o.scheme==="dpop"&&o.parameters.error==="use_dpop_nonce"}return n instanceof zc&&n.error==="use_dpop_nonce"}(e)}Object.freeze(Xs.prototype);const Bo=Symbol();async function jf(e,t,n,o){fo(e);const{as:r,c:i,auth:a,fetch:s,tlsOnly:c,timeout:l,decrypt:d}=It(e),f=await async function(h,p,m,g,y,w){return On(h),Pn(p),vt(g,'"grantType"'),Aa(h,p,m,g,new URLSearchParams(y),w)}(r,i,a,t,new URLSearchParams(n),{[Rn]:s,[wn]:!c,DPoP:o==null?void 0:o.DPoP,headers:new Headers(Jn),signal:Ir(l)}).then(h=>{let p;return t==="urn:ietf:params:oauth:grant-type:token-exchange"&&(p={n_a:()=>{}}),async function(m,g,y,w){return wi(m,g,y,void 0,w==null?void 0:w[qn],w==null?void 0:w.recognizedTokenTypes)}(r,i,h,{[qn]:d,recognizedTokenTypes:p})}).catch(Ut);return Pa(f),f}async function mA(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(function(o){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return ww("Key must be ",o,...i)}(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:"SHA-".concat(e.slice(-3)),name:"HMAC"},!1,[n])}return aA(t,e,n),t}async function gA(e,t,n,o){const r=await mA(e,t,"verify");(function(a,s){if(a.startsWith("RS")||a.startsWith("PS")){const{modulusLength:c}=s.algorithm;if(typeof c!="number"||c<2048)throw new TypeError("".concat(a," requires key modulusLength to be 2048 bits or larger"))}})(e,r);const i=function(a,s){const c="SHA-".concat(a.slice(-3));switch(a){case"HS256":case"HS384":case"HS512":return{hash:c,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:c,name:"RSA-PSS",saltLength:parseInt(a.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:c,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:c,name:"ECDSA",namedCurve:s.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:a};default:throw new rn("alg ".concat(a," is not supported either by JOSE or your javascript runtime"))}}(e,r.algorithm);try{return await crypto.subtle.verify(i,r,n,o)}catch{return!1}}async function vA(e,t,n){if(!Ko(e))throw new jt("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new jt('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new jt("JWS Protected Header incorrect type");if(e.payload===void 0)throw new jt("JWS Payload missing");if(typeof e.signature!="string")throw new jt("JWS Signature missing or incorrect type");if(e.header!==void 0&&!Ko(e.header))throw new jt("JWS Unprotected Header incorrect type");let o={};if(e.protected)try{const g=Qi(e.protected);o=JSON.parse(ga.decode(g))}catch{throw new jt("JWS Protected Header is invalid")}if(!function(){for(var g=arguments.length,y=new Array(g),w=0;w<g;w++)y[w]=arguments[w];const k=y.filter(Boolean);if(k.length===0||k.length===1)return!0;let b;for(const S of k){const x=Object.keys(S);if(b&&b.size!==0)for(const C of x){if(b.has(C))return!1;b.add(C)}else b=new Set(x)}return!0}(o,e.header))throw new jt("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r=Se(Se({},o),e.header),i=function(g,y,w,k,b){if(b.crit!==void 0&&(k==null?void 0:k.crit)===void 0)throw new g('"crit" (Critical) Header Parameter MUST be integrity protected');if(!k||k.crit===void 0)return new Set;if(!Array.isArray(k.crit)||k.crit.length===0||k.crit.some(x=>typeof x!="string"||x.length===0))throw new g('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let S;S=w!==void 0?new Map([...Object.entries(w),...y.entries()]):y;for(const x of k.crit){if(!S.has(x))throw new rn('Extension Header Parameter "'.concat(x,'" is not recognized'));if(b[x]===void 0)throw new g('Extension Header Parameter "'.concat(x,'" is missing'));if(S.get(x)&&k[x]===void 0)throw new g('Extension Header Parameter "'.concat(x,'" MUST be integrity protected'))}return new Set(k.crit)}(jt,new Map([["b64",!0]]),n==null?void 0:n.crit,o,r);let a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new jt('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=r;if(typeof s!="string"||!s)throw new jt('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&function(g,y){if(y!==void 0&&(!Array.isArray(y)||y.some(w=>typeof w!="string")))throw new TypeError('"'.concat(g,'" option must be an array of strings'));if(y)return new Set(y)}("algorithms",n.algorithms);if(c&&!c.has(s))throw new mw('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new jt("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new jt("JWS Payload must be a string or an Uint8Array instance");let l=!1;typeof t=="function"&&(t=await t(o,e),l=!0),dA(s,t,"verify");const d=function(){for(var g=arguments.length,y=new Array(g),w=0;w<g;w++)y[w]=arguments[w];const k=y.reduce((x,C)=>{let{length:T}=C;return x+T},0),b=new Uint8Array(k);let S=0;for(const x of y)b.set(x,S),S+=x.length;return b}(e.protected!==void 0?Il(e.protected):new Uint8Array,Il("."),typeof e.payload=="string"?a?Il(e.payload):Hp.encode(e.payload):e.payload);let f;try{f=Qi(e.signature)}catch{throw new jt("Failed to base64url decode the signature")}const h=await uA(t,s);if(!await gA(s,h,f,d))throw new yw;let p;if(a)try{p=Qi(e.payload)}catch{throw new jt("Failed to base64url decode the payload")}else p=typeof e.payload=="string"?Hp.encode(e.payload):e.payload;const m={payload:p};return e.protected!==void 0&&(m.protectedHeader=o),e.header!==void 0&&(m.unprotectedHeader=e.header),l?Se(Se({},m),{},{key:h}):m}const yA=e=>Math.floor(e.getTime()/1e3),wA=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function qp(e){const t=wA.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const n=parseFloat(t[2]);let o;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":o=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":o=Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":o=Math.round(3600*n);break;case"day":case"days":case"d":o=Math.round(86400*n);break;case"week":case"weeks":case"w":o=Math.round(604800*n);break;default:o=Math.round(31557600*n)}return t[1]==="-"||t[4]==="ago"?-o:o}const Jp=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase()),bA=(e,t)=>typeof e=="string"?t.includes(e):!!Array.isArray(e)&&t.some(Set.prototype.has.bind(new Set(e)));async function xA(e,t,n){var o;const r=await async function(s,c,l){if(s instanceof Uint8Array&&(s=ga.decode(s)),typeof s!="string")throw new jt("Compact JWS must be a string or Uint8Array");const{0:d,1:f,2:h,length:p}=s.split(".");if(p!==3)throw new jt("Invalid Compact JWS");const m=await vA({payload:f,protected:d,signature:h},c,l),g={payload:m.payload,protectedHeader:m.protectedHeader};return typeof c=="function"?Se(Se({},g),{},{key:m.key}):g}(e,t,n);if((o=r.protectedHeader.crit)!==null&&o!==void 0&&o.includes("b64")&&r.protectedHeader.b64===!1)throw new Qu("JWTs MUST NOT use unencoded payload");const i=function(s,c){let l,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};try{l=JSON.parse(ga.decode(c))}catch{}if(!Ko(l))throw new Qu("JWT Claims Set must be a top-level JSON object");const{typ:f}=d;if(f&&(typeof s.typ!="string"||Jp(s.typ)!==Jp(f)))throw new xn('unexpected "typ" JWT header value',l,"typ","check_failed");const{requiredClaims:h=[],issuer:p,subject:m,audience:g,maxTokenAge:y}=d,w=[...h];y!==void 0&&w.push("iat"),g!==void 0&&w.push("aud"),m!==void 0&&w.push("sub"),p!==void 0&&w.push("iss");for(const x of new Set(w.reverse()))if(!(x in l))throw new xn('missing required "'.concat(x,'" claim'),l,x,"missing");if(p&&!(Array.isArray(p)?p:[p]).includes(l.iss))throw new xn('unexpected "iss" claim value',l,"iss","check_failed");if(m&&l.sub!==m)throw new xn('unexpected "sub" claim value',l,"sub","check_failed");if(g&&!bA(l.aud,typeof g=="string"?[g]:g))throw new xn('unexpected "aud" claim value',l,"aud","check_failed");let k;switch(typeof d.clockTolerance){case"string":k=qp(d.clockTolerance);break;case"number":k=d.clockTolerance;break;case"undefined":k=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:b}=d,S=yA(b||new Date);if((l.iat!==void 0||y)&&typeof l.iat!="number")throw new xn('"iat" claim must be a number',l,"iat","invalid");if(l.nbf!==void 0){if(typeof l.nbf!="number")throw new xn('"nbf" claim must be a number',l,"nbf","invalid");if(l.nbf>S+k)throw new xn('"nbf" claim timestamp check failed',l,"nbf","check_failed")}if(l.exp!==void 0){if(typeof l.exp!="number")throw new xn('"exp" claim must be a number',l,"exp","invalid");if(l.exp<=S-k)throw new Xu('"exp" claim timestamp check failed',l,"exp","check_failed")}if(y){const x=S-l.iat;if(x-k>(typeof y=="number"?y:qp(y)))throw new Xu('"iat" claim timestamp check failed (too far in the past)',l,"iat","check_failed");if(x<0-k)throw new xn('"iat" claim timestamp check failed (it should be in the past)',l,"iat","check_failed")}return l}(r.protectedHeader,r.payload,n),a={payload:i,protectedHeader:r.protectedHeader};return typeof t=="function"?Se(Se({},a),{},{key:r.key}):a}function SA(e){return Ko(e)}var ts,Ml,ns=new WeakMap,$l=new WeakMap;class kA{constructor(t){if(bt(this,ns,void 0),bt(this,$l,new WeakMap),!function(n){return n&&typeof n=="object"&&Array.isArray(n.keys)&&n.keys.every(SA)}(t))throw new Af("JSON Web Key Set malformed");it(ns,this,structuredClone(t))}jwks(){return de(ns,this)}async getKey(t,n){const{alg:o,kid:r}=Se(Se({},t),n==null?void 0:n.header),i=function(l){switch(typeof l=="string"&&l.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new rn('Unsupported "alg" value for a JSON Web Key Set')}}(o),a=de(ns,this).keys.filter(l=>{let d=i===l.kty;if(d&&typeof r=="string"&&(d=r===l.kid),!d||typeof l.alg!="string"&&i!=="AKP"||(d=o===l.alg),d&&typeof l.use=="string"&&(d=l.use==="sig"),d&&Array.isArray(l.key_ops)&&(d=l.key_ops.includes("verify")),d)switch(o){case"ES256":d=l.crv==="P-256";break;case"ES384":d=l.crv==="P-384";break;case"ES512":d=l.crv==="P-521";break;case"Ed25519":case"EdDSA":d=l.crv==="Ed25519"}return d}),{0:s,length:c}=a;if(c===0)throw new _f;if(c!==1){const l=new gw,d=de($l,this);throw l[Symbol.asyncIterator]=O5(function*(){for(const f of a)try{yield yield j5(Zp(d,f,o))}catch{}}),l}return Zp(de($l,this),s,o)}}async function Zp(e,t,n){const o=e.get(t)||e.set(t,{}).get(t);if(o[n]===void 0){const r=await async function(i,a,s){var c;if(!Ko(i))throw new TypeError("JWK must be an object");let l;switch(a!=null||(a=i.alg),l!=null||(l=(c=s==null?void 0:s.extractable)!==null&&c!==void 0?c:i.ext),i.kty){case"oct":if(typeof i.k!="string"||!i.k)throw new TypeError('missing "k" (Key Value) Parameter value');return Qi(i.k);case"RSA":if("oth"in i&&i.oth!==void 0)throw new rn('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return ys(Se(Se({},i),{},{alg:a,ext:l}));case"AKP":if(typeof i.alg!="string"||!i.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(a!==void 0&&a!==i.alg)throw new TypeError("JWK alg and alg option value mismatch");return ys(Se(Se({},i),{},{ext:l}));case"EC":case"OKP":return ys(Se(Se({},i),{},{alg:a,ext:l}));default:throw new rn('Unsupported "kty" (Key Type) Parameter value')}}(Se(Se({},t),{},{ext:!0}),n);if(r instanceof Uint8Array||r.type!=="public")throw new Af("JSON Web Key Set members must be public keys");o[n]=r}return o[n]}function Yp(e){const t=new kA(e),n=async(o,r)=>t.getKey(o,r);return Object.defineProperties(n,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),n}let nd;if(typeof navigator>"u"||(ts=navigator.userAgent)===null||ts===void 0||(Ml=ts.startsWith)===null||Ml===void 0||!Ml.call(ts,"Mozilla/5.0 ")){const e="v6.1.3";nd="".concat("jose","/").concat(e)}const Pw=Symbol(),Hl=Symbol();var Wl=new WeakMap,Fl=new WeakMap,Bl=new WeakMap,os=new WeakMap,nr=new WeakMap,eo=new WeakMap,wo=new WeakMap,zl=new WeakMap,or=new WeakMap,rr=new WeakMap;class CA{constructor(t,n){if(bt(this,Wl,void 0),bt(this,Fl,void 0),bt(this,Bl,void 0),bt(this,os,void 0),bt(this,nr,void 0),bt(this,eo,void 0),bt(this,wo,void 0),bt(this,zl,void 0),bt(this,or,void 0),bt(this,rr,void 0),!(t instanceof URL))throw new TypeError("url must be an instance of URL");var o,r;it(Wl,this,new URL(t.href)),it(Fl,this,typeof(n==null?void 0:n.timeoutDuration)=="number"?n==null?void 0:n.timeoutDuration:5e3),it(Bl,this,typeof(n==null?void 0:n.cooldownDuration)=="number"?n==null?void 0:n.cooldownDuration:3e4),it(os,this,typeof(n==null?void 0:n.cacheMaxAge)=="number"?n==null?void 0:n.cacheMaxAge:6e5),it(wo,this,new Headers(n==null?void 0:n.headers)),nd&&!de(wo,this).has("User-Agent")&&de(wo,this).set("User-Agent",nd),de(wo,this).has("accept")||(de(wo,this).set("accept","application/json"),de(wo,this).append("accept","application/jwk-set+json")),it(zl,this,n==null?void 0:n[Pw]),(n==null?void 0:n[Hl])!==void 0&&(it(rr,this,n==null?void 0:n[Hl]),o=n==null?void 0:n[Hl],r=de(os,this),typeof o=="object"&&o!==null&&"uat"in o&&typeof o.uat=="number"&&!(Date.now()-o.uat>=r)&&"jwks"in o&&Ko(o.jwks)&&Array.isArray(o.jwks.keys)&&Array.prototype.every.call(o.jwks.keys,Ko)&&(it(nr,this,de(rr,this).uat),it(or,this,Yp(de(rr,this).jwks))))}pendingFetch(){return!!de(eo,this)}coolingDown(){return typeof de(nr,this)=="number"&&Date.now()<de(nr,this)+de(Bl,this)}fresh(){return typeof de(nr,this)=="number"&&Date.now()<de(nr,this)+de(os,this)}jwks(){var t;return(t=de(or,this))===null||t===void 0?void 0:t.jwks()}async getKey(t,n){de(or,this)&&this.fresh()||await this.reload();try{return await de(or,this).call(this,t,n)}catch(o){if(o instanceof _f&&this.coolingDown()===!1)return await this.reload(),de(or,this).call(this,t,n);throw o}}async reload(){de(eo,this)&&(typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel")&&it(eo,this,void 0),de(eo,this)||it(eo,this,async function(t,n,o){const i=await(arguments.length>3&&arguments[3]!==void 0?arguments[3]:fetch)(t,{method:"GET",signal:o,redirect:"manual",headers:n}).catch(a=>{throw a.name==="TimeoutError"?new vw:a});if(i.status!==200)throw new Lt("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch{throw new Lt("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(de(Wl,this).href,de(wo,this),AbortSignal.timeout(de(Fl,this)),de(zl,this)).then(t=>{it(or,this,Yp(t)),de(rr,this)&&(de(rr,this).uat=Date.now(),de(rr,this).jwks=t),it(nr,this,Date.now()),it(eo,this,void 0)}).catch(t=>{throw it(eo,this,void 0),t})),await de(eo,this)}}const EA=["mfaToken"],AA=["mfaToken"];var ir,rs,ar,So,Xr,Ze,Hi,pt,Xp=class extends Error{constructor(e,t){super(t),pe(this,"code",void 0),this.name="NotSupportedError",this.code=e}},ho=class extends Error{constructor(e,t,n){super(t),pe(this,"cause",void 0),pe(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},_A=class extends ho{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},jA=class extends ho{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},OA=class extends ho{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},Ul=class extends ho{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},$n=class extends ho{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},bo=class extends Error{constructor(e){super(e),pe(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},Kl=class extends ho{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),pe(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},PA=class extends ho{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},NA=class extends ho{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},IA=class extends ho{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},TA=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),pe(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function od(e){return Object.entries(e).filter(t=>{let[,n]=t;return n!==void 0}).reduce((t,n)=>Se(Se({},t),{},{[n[0]]:n[1]}),{})}var Kc=class extends Error{constructor(e,t,n){super(t),pe(this,"cause",void 0),pe(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},Nw=class extends Kc{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},Iw=class extends Kc{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},RA=class extends Kc{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},Tw=class extends Kc{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function LA(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var DA=(ir=new WeakMap,rs=new WeakMap,ar=new WeakMap,class{constructor(e){var t;bt(this,ir,void 0),bt(this,rs,void 0),bt(this,ar,void 0),it(ir,this,"https://".concat(e.domain)),it(rs,this,e.clientId),it(ar,this,(t=e.customFetch)!==null&&t!==void 0?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(de(ir,this),"/mfa/authenticators"),{mfaToken:n}=e,o=await de(ar,this).call(this,t,{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!o.ok){const r=await o.json();throw new Nw(r.error_description||"Failed to list authenticators",r)}return(await o.json()).map(LA)}async enrollAuthenticator(e){const t="".concat(de(ir,this),"/mfa/associate"),{mfaToken:n}=e,o=Tp(e,EA),r={authenticator_types:o.authenticatorTypes};"oobChannels"in o&&(r.oob_channels=o.oobChannels),"phoneNumber"in o&&o.phoneNumber&&(r.phone_number=o.phoneNumber),"email"in o&&o.email&&(r.email=o.email);const i=await de(ar,this).call(this,t,{method:"POST",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){const a=await i.json();throw new Iw(a.error_description||"Failed to enroll authenticator",a)}return function(a){if(a.authenticator_type==="otp")return{authenticatorType:"otp",secret:a.secret,barcodeUri:a.barcode_uri,recoveryCodes:a.recovery_codes,id:a.id};if(a.authenticator_type==="oob")return{authenticatorType:"oob",oobChannel:a.oob_channel,oobCode:a.oob_code,bindingMethod:a.binding_method,id:a.id};throw new Error("Unexpected authenticator type: ".concat(a.authenticator_type))}(await i.json())}async deleteAuthenticator(e){const{authenticatorId:t,mfaToken:n}=e,o="".concat(de(ir,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),r=await de(ar,this).call(this,o,{method:"DELETE",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!r.ok){const i=await r.json();throw new RA(i.error_description||"Failed to delete authenticator",i)}}async challengeAuthenticator(e){const t="".concat(de(ir,this),"/mfa/challenge"),{mfaToken:n}=e,o=Tp(e,AA),r={mfa_token:n,client_id:de(rs,this),challenge_type:o.challengeType};o.authenticatorId&&(r.authenticator_id=o.authenticatorId);const i=await de(ar,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){const a=await i.json();throw new Tw(a.error_description||"Failed to challenge authenticator",a)}return function(a){const s={challengeType:a.challenge_type};return a.oob_code!==void 0&&(s.oobCode=a.oob_code),a.binding_method!==void 0&&(s.bindingMethod=a.binding_method),s}(await i.json())}}),pr=class Rw{constructor(t,n,o,r,i,a,s){pe(this,"accessToken",void 0),pe(this,"idToken",void 0),pe(this,"refreshToken",void 0),pe(this,"expiresAt",void 0),pe(this,"scope",void 0),pe(this,"claims",void 0),pe(this,"authorizationDetails",void 0),pe(this,"tokenType",void 0),pe(this,"issuedTokenType",void 0),this.accessToken=t,this.idToken=o,this.refreshToken=r,this.expiresAt=n,this.scope=i,this.claims=a,this.authorizationDetails=s}static fromTokenEndpointResponse(t){const n=t.id_token?t.claims():void 0,o=new Rw(t.access_token,Math.floor(Date.now()/1e3)+Number(t.expires_in),t.id_token,t.refresh_token,t.scope,n,t.authorization_details);return o.tokenType=t.token_type,o.issuedTokenType=t.issued_token_type,o}},rd="openid profile email offline_access",MA=Object.freeze(new Set(["grant_type","client_id","client_secret","client_assertion","client_assertion_type","subject_token","subject_token_type","requested_token_type","actor_token","actor_token_type","audience","aud","resource","resources","resource_indicator","scope","connection","login_hint","organization","assertion"]));function Lw(e){if(e==null)throw new $n("subject_token is required");if(typeof e!="string")throw new $n("subject_token must be a string");if(e.trim().length===0)throw new $n("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new $n("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new $n("subject_token must not include the 'Bearer ' prefix")}function Dw(e,t){if(t){for(const[n,o]of Object.entries(t))if(!MA.has(n))if(Array.isArray(o)){if(o.length>20)throw new $n("Parameter '".concat(n,"' exceeds maximum array size of ").concat(20));o.forEach(r=>{e.append(n,r)})}else e.append(n,o)}}var $A=(So=new WeakMap,Xr=new WeakMap,Ze=new WeakMap,Hi=new WeakMap,pt=new WeakSet,class{constructor(e){if(function(t,n){tw(t,n),n.add(t)}(this,pt),bt(this,So,void 0),bt(this,Xr,void 0),bt(this,Ze,void 0),bt(this,Hi,void 0),pe(this,"mfa",void 0),it(Ze,this,e),e.useMtls&&!e.customFetch)throw new Xp("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");this.mfa=new DA({domain:de(Ze,this).domain,clientId:de(Ze,this).clientId,customFetch:de(Ze,this).customFetch})}async buildAuthorizationUrl(e){const{serverMetadata:t}=await mt(pt,this,fn).call(this);if(e!=null&&e.pushedAuthorizationRequests&&!t.pushed_authorization_request_endpoint)throw new Xp("par_not_supported_error","The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par");try{return await mt(pt,this,Vl).call(this,e)}catch(n){throw new PA(n)}}async buildLinkUserUrl(e){try{const t=await mt(pt,this,Vl).call(this,{authorizationParams:Se(Se({},e.authorizationParams),{},{requested_connection:e.connection,requested_connection_scope:e.connectionScope,scope:"openid link_account offline_access",id_token_hint:e.idToken})});return{linkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(t){throw new NA(t)}}async buildUnlinkUserUrl(e){try{const t=await mt(pt,this,Vl).call(this,{authorizationParams:Se(Se({},e.authorizationParams),{},{requested_connection:e.connection,scope:"openid unlink_account",id_token_hint:e.idToken})});return{unlinkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(t){throw new IA(t)}}async backchannelAuthentication(e){const{configuration:t,serverMetadata:n}=await mt(pt,this,fn).call(this),o=od(Se(Se({},de(Ze,this).authorizationParams),e==null?void 0:e.authorizationParams)),r=new URLSearchParams(Se(Se({scope:rd},o),{},{client_id:de(Ze,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:n.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&r.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&r.append("authorization_details",JSON.stringify(e.authorizationDetails));try{const i=await Vp(t,r),a=await Ew(t,i);return pr.fromTokenEndpointResponse(a)}catch(i){throw new Kl(i)}}async initiateBackchannelAuthentication(e){const{configuration:t,serverMetadata:n}=await mt(pt,this,fn).call(this),o=od(Se(Se({},de(Ze,this).authorizationParams),e==null?void 0:e.authorizationParams)),r=new URLSearchParams(Se(Se({scope:rd},o),{},{client_id:de(Ze,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:n.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&r.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&r.append("authorization_details",JSON.stringify(e.authorizationDetails));try{const i=await Vp(t,r);return{authReqId:i.auth_req_id,expiresIn:i.expires_in,interval:i.interval}}catch(i){throw new Kl(i)}}async backchannelAuthenticationGrant(e){let{authReqId:t}=e;const{configuration:n}=await mt(pt,this,fn).call(this),o=new URLSearchParams({auth_req_id:t});try{const r=await jf(n,"urn:openid:params:grant-type:ciba",o);return pr.fromTokenEndpointResponse(r)}catch(r){throw new Kl(r)}}async getTokenForConnection(e){var t;if(e.refreshToken&&e.accessToken)throw new Ul("Either a refresh or access token should be specified, but not both.");const n=(t=e.accessToken)!==null&&t!==void 0?t:e.refreshToken;if(!n)throw new Ul("Either a refresh or access token must be specified.");try{return await this.exchangeToken({connection:e.connection,subjectToken:n,subjectTokenType:e.accessToken?"urn:ietf:params:oauth:token-type:access_token":"urn:ietf:params:oauth:token-type:refresh_token",loginHint:e.loginHint})}catch(o){throw o instanceof $n?new Ul(o.message,o.cause):o}}async exchangeToken(e){return"connection"in e?mt(pt,this,HA).call(this,e):mt(pt,this,WA).call(this,e)}async getTokenByCode(e,t){const{configuration:n}=await mt(pt,this,fn).call(this);try{const o=await Aw(n,e,{pkceCodeVerifier:t.codeVerifier});return pr.fromTokenEndpointResponse(o)}catch(o){throw new _A("There was an error while trying to request a token.",o)}}async getTokenByRefreshToken(e){const{configuration:t}=await mt(pt,this,fn).call(this);try{const n=await _w(t,e.refreshToken);return pr.fromTokenEndpointResponse(n)}catch(n){throw new OA("The access token has expired and there was an error while trying to refresh it.",n)}}async getTokenByClientCredentials(e){const{configuration:t}=await mt(pt,this,fn).call(this);try{const n=new URLSearchParams({audience:e.audience});e.organization&&n.append("organization",e.organization);const o=await jw(t,n);return pr.fromTokenEndpointResponse(o)}catch(n){throw new jA("There was an error while trying to request a token.",n)}}async buildLogoutUrl(e){const{configuration:t,serverMetadata:n}=await mt(pt,this,fn).call(this);if(!n.end_session_endpoint){const o=new URL("https://".concat(de(Ze,this).domain,"/v2/logout"));return o.searchParams.set("returnTo",e.returnTo),o.searchParams.set("client_id",de(Ze,this).clientId),o}return function(o,r){fo(o);const{as:i,c:a,tlsOnly:s}=It(o),c=Ea(i,"end_session_endpoint",!1,s);(r=new URLSearchParams(r)).has("client_id")||r.set("client_id",a.client_id);for(const[l,d]of r.entries())c.searchParams.append(l,d);return c}(t,{post_logout_redirect_uri:e.returnTo})}async verifyLogoutToken(e){const{serverMetadata:t}=await mt(pt,this,fn).call(this);de(Hi,this)||it(Hi,this,function(o,r){const i=new CA(o,r),a=async(s,c)=>i.getKey(s,c);return Object.defineProperties(a,{coolingDown:{get:()=>i.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>i.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>i.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>i.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>i.jwks(),enumerable:!0,configurable:!1,writable:!1}}),a}(new URL(t.jwks_uri),{[Pw]:de(Ze,this).customFetch}));const{payload:n}=await xA(e.logoutToken,de(Hi,this),{issuer:t.issuer,audience:de(Ze,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]});if(!("sid"in n)&&!("sub"in n))throw new bo('either "sid" or "sub" (or both) claims must be present');if("sid"in n&&typeof n.sid!="string")throw new bo('"sid" claim must be a string');if("sub"in n&&typeof n.sub!="string")throw new bo('"sub" claim must be a string');if("nonce"in n)throw new bo('"nonce" claim is prohibited');if(!("events"in n))throw new bo('"events" claim is missing');if(typeof n.events!="object"||n.events===null)throw new bo('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in n.events))throw new bo('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if(typeof n.events["http://schemas.openid.net/event/backchannel-logout"]!="object")throw new bo('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:n.sid,sub:n.sub}}});async function fn(){if(de(So,this)&&de(Xr,this))return{configuration:de(So,this),serverMetadata:de(Xr,this)};const e=await mt(pt,this,FA).call(this);return it(So,this,await pA(new URL("https://".concat(de(Ze,this).domain)),de(Ze,this).clientId,{use_mtls_endpoint_aliases:de(Ze,this).useMtls},e,{[Lo]:de(Ze,this).customFetch})),it(Xr,this,de(So,this).serverMetadata()),de(So,this)[Lo]=de(Ze,this).customFetch||fetch,{configuration:de(So,this),serverMetadata:de(Xr,this)}}async function HA(e){var t,n;const{configuration:o}=await mt(pt,this,fn).call(this);if("audience"in e||"resource"in e)throw new $n("audience and resource parameters are not supported for Token Vault exchanges");Lw(e.subjectToken);const r=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:(t=e.subjectTokenType)!==null&&t!==void 0?t:"urn:ietf:params:oauth:token-type:access_token",requested_token_type:(n=e.requestedTokenType)!==null&&n!==void 0?n:"http://auth0.com/oauth/token-type/federated-connection-access-token"});e.loginHint&&r.append("login_hint",e.loginHint),e.scope&&r.append("scope",e.scope),Dw(r,e.extra);try{const i=await jf(o,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",r);return pr.fromTokenEndpointResponse(i)}catch(i){throw new $n("Failed to exchange token for connection '".concat(e.connection,"'."),i)}}async function WA(e){const{configuration:t}=await mt(pt,this,fn).call(this);Lw(e.subjectToken);const n=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),e.requestedTokenType&&n.append("requested_token_type",e.requestedTokenType),e.organization&&n.append("organization",e.organization),Dw(n,e.extra);try{const o=await jf(t,"urn:ietf:params:oauth:grant-type:token-exchange",n);return pr.fromTokenEndpointResponse(o)}catch(o){throw new $n("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),o)}}async function FA(){if(!de(Ze,this).clientSecret&&!de(Ze,this).clientAssertionSigningKey&&!de(Ze,this).useMtls)throw new TA;if(de(Ze,this).useMtls)return(t,n,o,r)=>{o.set("client_id",n.client_id)};let e=de(Ze,this).clientAssertionSigningKey;return!e||e instanceof CryptoKey||(e=await async function(t,n,o){if(typeof t!="string"||t.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return lA(t,n,o)}(e,de(Ze,this).clientAssertionSigningAlg||"RS256")),e?function(t,n){return D5(t,n)}(e):Sw(de(Ze,this).clientSecret)}async function Vl(e){const{configuration:t}=await mt(pt,this,fn).call(this),n=hA(),o=await fA(n),r=od(Se(Se({},de(Ze,this).authorizationParams),e==null?void 0:e.authorizationParams)),i=new URLSearchParams(Se(Se({scope:rd},r),{},{client_id:de(Ze,this).clientId,code_challenge:o,code_challenge_method:"S256"}));return{authorizationUrl:e!=null&&e.pushedAuthorizationRequests?await Ow(t,i):await td(t,i),codeVerifier:n}}class Vo extends at{constructor(t,n){super(t,n),Object.setPrototypeOf(this,Vo.prototype)}static fromPayload(t){let{error:n,error_description:o}=t;return new Vo(n,o)}}class Qs extends Vo{constructor(t,n){super(t,n),Object.setPrototypeOf(this,Qs.prototype)}}class Of extends Vo{constructor(t,n){super(t,n),Object.setPrototypeOf(this,Of.prototype)}}class Pf extends Vo{constructor(t,n){super(t,n),Object.setPrototypeOf(this,Pf.prototype)}}class Qr extends Vo{constructor(t,n){super(t,n),Object.setPrototypeOf(this,Qr.prototype)}}class Nf extends Vo{constructor(t,n){super(t,n),Object.setPrototypeOf(this,Nf.prototype)}}class BA{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6e5;this.contexts=new Map,this.ttlMs=t}set(t,n){this.cleanup(),this.contexts.set(t,Object.assign(Object.assign({},n),{createdAt:Date.now()}))}get(t){const n=this.contexts.get(t);if(n){if(!(Date.now()-n.createdAt>this.ttlMs))return n;this.contexts.delete(t)}}remove(t){this.contexts.delete(t)}cleanup(){const t=Date.now();for(const[n,o]of this.contexts)t-o.createdAt>this.ttlMs&&this.contexts.delete(n)}get size(){return this.contexts.size}}class zA{constructor(t,n){this.authJsMfaClient=t,this.auth0Client=n,this.contextManager=new BA}setMFAAuthDetails(t,n,o,r){this.contextManager.set(t,{scope:n,audience:o,mfaRequirements:r})}async getAuthenticators(t){var n,o;const r=this.contextManager.get(t);if(!(!((n=r==null?void 0:r.mfaRequirements)===null||n===void 0)&&n.challenge)||r.mfaRequirements.challenge.length===0)throw new Qs("invalid_request","challengeType is required and must contain at least one challenge type, please check mfa_required error payload");const i=r.mfaRequirements.challenge.map(a=>a.type);try{return(await this.authJsMfaClient.listAuthenticators({mfaToken:t})).filter(a=>!!a.type&&i.includes(a.type))}catch(a){throw a instanceof Nw?new Qs((o=a.cause)===null||o===void 0?void 0:o.error,a.message):a}}async enroll(t){var n;const o=function(r){const i=C5[r.factorType];return Object.assign(Object.assign(Object.assign({mfaToken:r.mfaToken,authenticatorTypes:i.authenticatorTypes},i.oobChannels&&{oobChannels:i.oobChannels}),"phoneNumber"in r&&{phoneNumber:r.phoneNumber}),"email"in r&&{email:r.email})}(t);try{return await this.authJsMfaClient.enrollAuthenticator(o)}catch(r){throw r instanceof Iw?new Of((n=r.cause)===null||n===void 0?void 0:n.error,r.message):r}}async challenge(t){var n;try{const o={challengeType:t.challengeType,mfaToken:t.mfaToken};return t.authenticatorId&&(o.authenticatorId=t.authenticatorId),await this.authJsMfaClient.challengeAuthenticator(o)}catch(o){throw o instanceof Tw?new Pf((n=o.cause)===null||n===void 0?void 0:n.error,o.message):o}}async getEnrollmentFactors(t){const n=this.contextManager.get(t);if(!n||!n.mfaRequirements)throw new Nf("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");return n.mfaRequirements.enroll&&n.mfaRequirements.enroll.length!==0?n.mfaRequirements.enroll:[]}async verify(t){const n=this.contextManager.get(t.mfaToken);if(!n)throw new Qr("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");const o=function(a){return"otp"in a&&a.otp?E5:"oobCode"in a&&a.oobCode?A5:"recoveryCode"in a&&a.recoveryCode?_5:void 0}(t);if(!o)throw new Qr("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const r=n.scope,i=n.audience;try{const a=await this.auth0Client._requestTokenForMfa({grant_type:o,mfaToken:t.mfaToken,scope:r,audience:i,otp:t.otp,oob_code:t.oobCode,binding_code:t.bindingCode,recovery_code:t.recoveryCode});return this.contextManager.remove(t.mfaToken),a}catch(a){if(a instanceof Ca)this.setMFAAuthDetails(a.mfa_token,r,i,a.mfa_requirements);else if(a instanceof Qr)throw new Qr(a.error,a.error_description);throw a}}}const Wi=new FE;class UA{constructor(t){let n,o;if(this.userCache=new Z1().enclosedCache,this.activeLockKeys=new Set,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this._releaseLockOnPageHide=async()=>{const l=Array.from(this.activeLockKeys);for(const d of l)await Wi.releaseLock(d);this.activeLockKeys.clear(),window.removeEventListener("pagehide",this._releaseLockOnPageHide)},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!Ks())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(Ks().subtle===void 0)throw new Error(`
|
|
61
|
+
in the address bar and allow pop-ups for this site.`},Image:hE,actionBtnText:"Test pop-up settings"},xE={name:ht.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:pE,actionBtnText:"Continue to the platform"},Ms=[yE,wE,bE,xE],hs={isCompleted:!1,state:"prompt"},SE={[ht.WINDOW_MANAGEMENT]:hs,[ht.NOTIFICATIONS]:hs,[ht.POPUPS]:hs,[ht.PWA_INSTALL]:hs},kE=({isOpen:e,onClose:t})=>{var a;const{launchpadComponents:n,launchpadSettings:o}=ww(),{permission:r}=sr(),i=(a=r.statuses[ht.WINDOW_MANAGEMENT])==null?void 0:a.state;return l.jsx(vw,{components:n,isOpen:e,onClose:t,settings:o,windowManagementPermissionState:i})};const xw=v.forwardRef((e,t)=>{const{className:n,isOpen:o,onClose:r,Panel:i,pinned:a=!1,position:s="left"}=e;return o&&!i&&console.error('Invalid use of PanelWrapper component. Please provide Panel component when "isOpen" is "true".'),l.jsx("div",{className:pt(n,"panel-wrapper",s,{open:o,pinned:a}),ref:t,children:i&&l.jsx(i,{isOpen:o,onClose:r})})}),$f=e=>{const{Button:t,Panel:n,panelWrapperClassName:o,pinned:r=!1,position:i="left",tag:a="div",onClose:s}=e,[c,u]=v.useState(!1),d=v.useRef(null),f=v.useCallback(async()=>{u(!1),await(s==null?void 0:s())},[s]),h=()=>{if(c){f();return}u(!0)},p=!c||r;return Nf({eventType:"mouseup",handler:f,ref:d,skip:p}),Tf({handler:f,skip:p}),l.jsxs(a,{ref:d,children:[l.jsx(t,{active:c,onClick:h}),l.jsx(xw,{className:o,isOpen:c,onClose:f,Panel:n,pinned:r,position:i})]})};const Sw=({Button:e=T5})=>{const{isLaunchpadPinned:t}=Fr();return l.jsx($f,{Button:e,Panel:kE,panelWrapperClassName:"launchpad-panel-wrapper",pinned:t})};var fd=function(e,t){return fd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(n[r]=o[r])},fd(e,t)};function CE(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");fd(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Ot=function(){return Ot=Object.assign||function(t){for(var n,o=1,r=arguments.length;o<r;o++){n=arguments[o];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Ot.apply(this,arguments)};function Zp(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]]);return n}function jo(e,t,n,o){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(d){try{u(o.next(d))}catch(f){a(f)}}function c(d){try{u(o.throw(d))}catch(f){a(f)}}function u(d){d.done?i(d.value):r(d.value).then(s,c)}u((o=o.apply(e,t||[])).next())})}function Ao(e,t){var n={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=s(0),a.throw=s(1),a.return=s(2),typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(d){return c([u,d])}}function c(u){if(o)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)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 n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){n.label=u[1];break}if(u[0]===6&&n.label<i[1]){n.label=i[1],i=u;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(u);break}i[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(d){u=[6,d],r=0}finally{o=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function EE(e,t,n){if(n||arguments.length===2)for(var o=0,r=t.length,i;o<r;o++)(i||!(o in t))&&(i||(i=Array.prototype.slice.call(t,0,o)),i[o]=t[o]);return e.concat(i||Array.prototype.slice.call(t))}function An(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function"){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}const jE={timeoutInSeconds:60},Yp="memory",kw={name:"auth0-spa-js",version:"2.18.0"},Cw=()=>Date.now(),Vt="default";class tt extends Error{constructor(t,n){super(n),this.error=t,this.error_description=n,Object.setPrototypeOf(this,tt.prototype)}static fromPayload(t){let{error:n,error_description:o}=t;return new tt(n,o)}}class Hf extends tt{constructor(t,n,o){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;super(t,n),this.state=o,this.appState=r,Object.setPrototypeOf(this,Hf.prototype)}}class Bf extends tt{constructor(t,n,o,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null;super(t,n),this.connection=o,this.state=r,this.appState=i,Object.setPrototypeOf(this,Bf.prototype)}}class Fi extends tt{constructor(){super("timeout","Timeout"),Object.setPrototypeOf(this,Fi.prototype)}}class Wf extends Fi{constructor(t){super(),this.popup=t,Object.setPrototypeOf(this,Wf.prototype)}}class Ff extends tt{constructor(t){super("cancelled","Popup closed"),this.popup=t,Object.setPrototypeOf(this,Ff.prototype)}}class zf extends tt{constructor(){super("popup_open","Unable to open a popup for loginWithPopup - window.open returned `null`"),Object.setPrototypeOf(this,zf.prototype)}}class Ri extends tt{constructor(t,n,o,r){super(t,n),this.mfa_token=o,this.mfa_requirements=r,Object.setPrototypeOf(this,Ri.prototype)}}class al extends tt{constructor(t,n){super("missing_refresh_token","Missing Refresh Token (audience: '".concat(hc(t,["default"]),"', scope: '").concat(hc(n),"')")),this.audience=t,this.scope=n,Object.setPrototypeOf(this,al.prototype)}}class Uf extends tt{constructor(t,n){super("missing_scopes","Missing requested scopes after refresh (audience: '".concat(hc(t,["default"]),"', missing scope: '").concat(hc(n),"')")),this.audience=t,this.scope=n,Object.setPrototypeOf(this,Uf.prototype)}}class sl extends tt{constructor(t){super("use_dpop_nonce","Server rejected DPoP proof: wrong nonce"),this.newDpopNonce=t,Object.setPrototypeOf(this,sl.prototype)}}function hc(e){return e&&!(arguments.length>1&&arguments[1]!==void 0?arguments[1]:[]).includes(e)?e:""}const pc=()=>window.crypto,Xi=()=>{const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_~.";let t="";for(;t.length<43;){const n=pc().getRandomValues(new Uint8Array(43-t.length));for(const o of n)t.length<43&&o<198&&(t+=e[o%66])}return t},Vl=e=>btoa(e),AE=[{key:"name",type:["string"]},{key:"version",type:["string","number"]},{key:"env",type:["object"]}],Ew=function(e){let t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return Object.keys(e).reduce((n,o)=>{if(t&&o==="env")return n;const r=AE.find(i=>i.key===o);return r&&r.type.includes(typeof e[o])&&(n[o]=e[o]),n},{})},hd=e=>{var{clientId:t}=e,n=An(e,["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:t},n))).toString()},Xp=async e=>await pc().subtle.digest({name:"SHA-256"},new TextEncoder().encode(e)),Qp=e=>(t=>decodeURIComponent(atob(t).split("").map(n=>"%"+("00"+n.charCodeAt(0).toString(16)).slice(-2)).join("")))(e.replace(/_/g,"/").replace(/-/g,"+")),em=e=>{const t=new Uint8Array(e);return(n=>{const o={"+":"-","/":"_","=":""};return n.replace(/[+/=]/g,r=>o[r])})(window.btoa(String.fromCharCode(...Array.from(t))))};var Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},jw={},Kf={};Object.defineProperty(Kf,"__esModule",{value:!0});var OE=function(){function e(){var t=this;this.locked=new Map,this.addToLocked=function(n,o){var r=t.locked.get(n);r===void 0?o===void 0?t.locked.set(n,[]):t.locked.set(n,[o]):o!==void 0&&(r.unshift(o),t.locked.set(n,r))},this.isLocked=function(n){return t.locked.has(n)},this.lock=function(n){return new Promise(function(o,r){t.isLocked(n)?t.addToLocked(n,o):(t.addToLocked(n),o())})},this.unlock=function(n){var o=t.locked.get(n);if(o!==void 0&&o.length!==0){var r=o.pop();t.locked.set(n,o),r!==void 0&&setTimeout(r,0)}else t.locked.delete(n)}}return e.getInstance=function(){return e.instance===void 0&&(e.instance=new e),e.instance},e}();Kf.default=function(){return OE.getInstance()};var Pn=Hr&&Hr.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(u){try{c(o.next(u))}catch(d){i(d)}}function s(u){try{c(o.throw(u))}catch(d){i(d)}}function c(u){u.done?r(u.value):new n(function(d){d(u.value)}).then(a,s)}c((o=o.apply(e,t||[])).next())})},_n=Hr&&Hr.__generator||function(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(u){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&d[0]?o.return:d[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,d[1])).done)return r;switch(o=0,r&&(d=[2&d[0],r.value]),d[0]){case 0:case 1:r=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,o=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!r||d[1]>r[0]&&d[1]<r[3])){a.label=d[1];break}if(d[0]===6&&a.label<r[1]){a.label=r[1],r=d;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(d);break}r[2]&&a.ops.pop(),a.trys.pop();continue}d=t.call(e,a)}catch(f){d=[6,f],o=0}finally{n=r=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,u])}}},Qi=Hr;Object.defineProperty(jw,"__esModule",{value:!0});var Zr=Kf,Gl="browser-tabs-lock-key",ps={key:function(e){return Pn(Qi,void 0,void 0,function(){return _n(this,function(t){throw new Error("Unsupported")})})},getItem:function(e){return Pn(Qi,void 0,void 0,function(){return _n(this,function(t){throw new Error("Unsupported")})})},clear:function(){return Pn(Qi,void 0,void 0,function(){return _n(this,function(e){return[2,window.localStorage.clear()]})})},removeItem:function(e){return Pn(Qi,void 0,void 0,function(){return _n(this,function(t){throw new Error("Unsupported")})})},setItem:function(e,t){return Pn(Qi,void 0,void 0,function(){return _n(this,function(n){throw new Error("Unsupported")})})},keySync:function(e){return window.localStorage.key(e)},getItemSync:function(e){return window.localStorage.getItem(e)},clearSync:function(){return window.localStorage.clear()},removeItemSync:function(e){return window.localStorage.removeItem(e)},setItemSync:function(e,t){return window.localStorage.setItem(e,t)}};function ql(e){return new Promise(function(t){return setTimeout(t,e)})}function Jl(e){for(var t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz",n="",o=0;o<e;o++)n+=t[Math.floor(61*Math.random())];return n}var PE=function(){function e(t){this.acquiredIatSet=new Set,this.storageHandler=void 0,this.id=Date.now().toString()+Jl(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=t,e.waiters===void 0&&(e.waiters=[])}return e.prototype.acquireLock=function(t,n){return n===void 0&&(n=5e3),Pn(this,void 0,void 0,function(){var o,r,i,a,s,c,u;return _n(this,function(d){switch(d.label){case 0:o=Date.now()+Jl(4),r=Date.now()+n,i=Gl+"-"+t,a=this.storageHandler===void 0?ps:this.storageHandler,d.label=1;case 1:return Date.now()<r?[4,ql(30)]:[3,8];case 2:return d.sent(),a.getItemSync(i)!==null?[3,5]:(s=this.id+"-"+t+"-"+o,[4,ql(Math.floor(25*Math.random()))]);case 3:return d.sent(),a.setItemSync(i,JSON.stringify({id:this.id,iat:o,timeoutKey:s,timeAcquired:Date.now(),timeRefreshed:Date.now()})),[4,ql(30)];case 4:return d.sent(),(c=a.getItemSync(i))!==null&&(u=JSON.parse(c)).id===this.id&&u.iat===o?(this.acquiredIatSet.add(o),this.refreshLockWhileAcquired(i,o),[2,!0]):[3,7];case 5:return e.lockCorrector(this.storageHandler===void 0?ps:this.storageHandler),[4,this.waitForSomethingToChange(r)];case 6:d.sent(),d.label=7;case 7:return o=Date.now()+Jl(4),[3,1];case 8:return[2,!1]}})})},e.prototype.refreshLockWhileAcquired=function(t,n){return Pn(this,void 0,void 0,function(){var o=this;return _n(this,function(r){return setTimeout(function(){return Pn(o,void 0,void 0,function(){var i,a,s;return _n(this,function(c){switch(c.label){case 0:return[4,Zr.default().lock(n)];case 1:return c.sent(),this.acquiredIatSet.has(n)?(i=this.storageHandler===void 0?ps:this.storageHandler,(a=i.getItemSync(t))===null?(Zr.default().unlock(n),[2]):((s=JSON.parse(a)).timeRefreshed=Date.now(),i.setItemSync(t,JSON.stringify(s)),Zr.default().unlock(n),this.refreshLockWhileAcquired(t,n),[2])):(Zr.default().unlock(n),[2])}})})},1e3),[2]})})},e.prototype.waitForSomethingToChange=function(t){return Pn(this,void 0,void 0,function(){return _n(this,function(n){switch(n.label){case 0:return[4,new Promise(function(o){var r=!1,i=Date.now(),a=!1;function s(){if(a||(window.removeEventListener("storage",s),e.removeFromWaiting(s),clearTimeout(c),a=!0),!r){r=!0;var u=50-(Date.now()-i);u>0?setTimeout(o,u):o(null)}}window.addEventListener("storage",s),e.addToWaiting(s);var c=setTimeout(s,Math.max(0,t-Date.now()))})];case 1:return n.sent(),[2]}})})},e.addToWaiting=function(t){this.removeFromWaiting(t),e.waiters!==void 0&&e.waiters.push(t)},e.removeFromWaiting=function(t){e.waiters!==void 0&&(e.waiters=e.waiters.filter(function(n){return n!==t}))},e.notifyWaiters=function(){e.waiters!==void 0&&e.waiters.slice().forEach(function(t){return t()})},e.prototype.releaseLock=function(t){return Pn(this,void 0,void 0,function(){return _n(this,function(n){switch(n.label){case 0:return[4,this.releaseLock__private__(t)];case 1:return[2,n.sent()]}})})},e.prototype.releaseLock__private__=function(t){return Pn(this,void 0,void 0,function(){var n,o,r,i;return _n(this,function(a){switch(a.label){case 0:return n=this.storageHandler===void 0?ps:this.storageHandler,o=Gl+"-"+t,(r=n.getItemSync(o))===null?[2]:(i=JSON.parse(r)).id!==this.id?[3,2]:[4,Zr.default().lock(i.iat)];case 1:a.sent(),this.acquiredIatSet.delete(i.iat),n.removeItemSync(o),Zr.default().unlock(i.iat),e.notifyWaiters(),a.label=2;case 2:return[2]}})})},e.lockCorrector=function(t){for(var n=Date.now()-5e3,o=t,r=[],i=0;;){var a=o.keySync(i);if(a===null)break;r.push(a),i++}for(var s=!1,c=0;c<r.length;c++){var u=r[c];if(u.includes(Gl)){var d=o.getItemSync(u);if(d!==null){var f=JSON.parse(d);(f.timeRefreshed===void 0&&f.timeAcquired<n||f.timeRefreshed!==void 0&&f.timeRefreshed<n)&&(o.removeItemSync(u),s=!0)}}}s&&e.notifyWaiters()},e.waiters=void 0,e}(),_E=jw.default=PE;class TE{async runWithLock(t,n,o){const r=new AbortController,i=setTimeout(()=>r.abort(),n);try{return await navigator.locks.request(t,{mode:"exclusive",signal:r.signal},async a=>{if(clearTimeout(i),!a)throw new Error("Lock not available");return await o()})}catch(a){throw clearTimeout(i),(a==null?void 0:a.name)==="AbortError"?new Fi:a}}}class NE{constructor(){this.activeLocks=new Set,this.lock=new _E,this.pagehideHandler=()=>{this.activeLocks.forEach(t=>this.lock.releaseLock(t)),this.activeLocks.clear()}}async runWithLock(t,n,o){let r=!1;for(let i=0;i<10&&!r;i++)r=await this.lock.acquireLock(t,n);if(!r)throw new Fi;this.activeLocks.add(t),this.activeLocks.size===1&&typeof window<"u"&&window.addEventListener("pagehide",this.pagehideHandler);try{return await o()}finally{this.activeLocks.delete(t),await this.lock.releaseLock(t),this.activeLocks.size===0&&typeof window<"u"&&window.removeEventListener("pagehide",this.pagehideHandler)}}}function IE(){return typeof navigator<"u"&&typeof((e=navigator.locks)===null||e===void 0?void 0:e.request)=="function"?new TE:new NE;var e}let Zl=null;const RE=new TextEncoder,LE=new TextDecoder;function ha(e){return typeof e=="string"?RE.encode(e):LE.decode(e)}function tm(e){if(typeof e.modulusLength!="number"||e.modulusLength<2048)throw new ME(`${e.name} modulusLength must be at least 2048 bits`)}async function DE(e,t,n){if(n.usages.includes("sign")===!1)throw new TypeError('private CryptoKey instances used for signing assertions must include "sign" in their "usages"');const o=`${pa(ha(JSON.stringify(e)))}.${pa(ha(JSON.stringify(t)))}`;return`${o}.${pa(await crypto.subtle.sign(function(r){switch(r.algorithm.name){case"ECDSA":return{name:r.algorithm.name,hash:"SHA-256"};case"RSA-PSS":return tm(r.algorithm),{name:r.algorithm.name,saltLength:32};case"RSASSA-PKCS1-v1_5":return tm(r.algorithm),{name:r.algorithm.name};case"Ed25519":return{name:r.algorithm.name}}throw new Or}(n),n,ha(o)))}`}let pd;Uint8Array.prototype.toBase64?pd=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):pd=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let o=0;o<t.byteLength;o+=32768)n.push(String.fromCharCode.apply(null,t.subarray(o,o+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function pa(e){return pd(e)}class Or extends Error{constructor(t){var n;super(t??"operation not supported"),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}class ME extends Error{constructor(t){var n;super(t),this.name=this.constructor.name,(n=Error.captureStackTrace)===null||n===void 0||n.call(Error,this,this.constructor)}}function $E(e){switch(e.algorithm.name){case"RSA-PSS":return function(t){if(t.algorithm.hash.name==="SHA-256")return"PS256";throw new Or("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"RSASSA-PKCS1-v1_5":return function(t){if(t.algorithm.hash.name==="SHA-256")return"RS256";throw new Or("unsupported RsaHashedKeyAlgorithm hash name")}(e);case"ECDSA":return function(t){if(t.algorithm.namedCurve==="P-256")return"ES256";throw new Or("unsupported EcKeyAlgorithm namedCurve")}(e);case"Ed25519":return"Ed25519";default:throw new Or("unsupported CryptoKey algorithm name")}}function Aw(e){return e instanceof CryptoKey}function Ow(e){return Aw(e)&&e.type==="public"}async function HE(e,t,n,o,r,i){const a=e==null?void 0:e.privateKey,s=e==null?void 0:e.publicKey;if(!Aw(c=a)||c.type!=="private")throw new TypeError('"keypair.privateKey" must be a private CryptoKey');var c;if(!Ow(s))throw new TypeError('"keypair.publicKey" must be a public CryptoKey');if(s.extractable!==!0)throw new TypeError('"keypair.publicKey.extractable" must be true');if(typeof t!="string")throw new TypeError('"htu" must be a string');if(typeof n!="string")throw new TypeError('"htm" must be a string');if(o!==void 0&&typeof o!="string")throw new TypeError('"nonce" must be a string or undefined');if(r!==void 0&&typeof r!="string")throw new TypeError('"accessToken" must be a string or undefined');if(i!==void 0&&(typeof i!="object"||i===null||Array.isArray(i)))throw new TypeError('"additional" must be an object');return DE({alg:$E(a),typ:"dpop+jwt",jwk:await Pw(s)},Object.assign(Object.assign({},i),{iat:Math.floor(Date.now()/1e3),jti:crypto.randomUUID(),htm:n,nonce:o,htu:t,ath:r?pa(await crypto.subtle.digest("SHA-256",ha(r))):void 0}),a)}async function Pw(e){const{kty:t,e:n,n:o,x:r,y:i,crv:a}=await crypto.subtle.exportKey("jwk",e);return{kty:t,crv:a,e:n,n:o,x:r,y:i}}const _w="dpop-nonce",BE=["authorization_code","refresh_token","urn:ietf:params:oauth:grant-type:token-exchange","http://auth0.com/oauth/grant-type/mfa-oob","http://auth0.com/oauth/grant-type/mfa-otp","http://auth0.com/oauth/grant-type/mfa-recovery-code"];function WE(){return async function(e,t){var n;let o;if(typeof e!="string"||e.length===0)throw new TypeError('"alg" must be a non-empty string');switch(e){case"PS256":o={name:"RSA-PSS",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"RS256":o={name:"RSASSA-PKCS1-v1_5",hash:"SHA-256",modulusLength:2048,publicExponent:new Uint8Array([1,0,1])};break;case"ES256":o={name:"ECDSA",namedCurve:"P-256"};break;case"Ed25519":o={name:"Ed25519"};break;default:throw new Or}return crypto.subtle.generateKey(o,(n=t==null?void 0:t.extractable)!==null&&n!==void 0&&n,["sign","verify"])}("ES256",{extractable:!1})}function FE(e){return async function(t){if(!Ow(t))throw new TypeError('"publicKey" must be a public CryptoKey');if(t.extractable!==!0)throw new TypeError('"publicKey.extractable" must be true');const n=await Pw(t);let o;switch(n.kty){case"EC":o={crv:n.crv,kty:n.kty,x:n.x,y:n.y};break;case"OKP":o={crv:n.crv,kty:n.kty,x:n.x};break;case"RSA":o={e:n.e,kty:n.kty,n:n.n};break;default:throw new Or("unsupported JWK kty")}return pa(await crypto.subtle.digest({name:"SHA-256"},ha(JSON.stringify(o))))}(e.publicKey)}function zE(e){let{keyPair:t,url:n,method:o,nonce:r,accessToken:i}=e;const a=function(s){const c=new URL(s);return c.search="",c.hash="",c.href}(n);return HE(t,a,o,r,i)}const UE=async(e,t)=>{const n=await fetch(e,t);return{ok:n.ok,json:await n.json(),headers:(o=n.headers,[...o].reduce((r,i)=>{let[a,s]=i;return r[a]=s,r},{}))};var o},KE=async(e,t,n)=>{const o=new AbortController;let r;return t.signal=o.signal,Promise.race([UE(e,t),new Promise((i,a)=>{r=setTimeout(()=>{o.abort(),a(new Error("Timeout when executing 'fetch'"))},n)})]).finally(()=>{clearTimeout(r)})},VE=async(e,t,n,o,r,i,a,s)=>((c,u)=>new Promise(function(d,f){const h=new MessageChannel;h.port1.onmessage=function(p){p.data.error?f(new Error(p.data.error)):d(p.data),h.port1.close()},u.postMessage(c,[h.port2])}))({auth:{audience:t,scope:n},timeout:r,fetchUrl:e,fetchOptions:o,useFormData:a,useMrrt:s},i),GE=async function(e,t,n,o,r,i){let a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:1e4;return r?VE(e,t,n,o,a,r,i,arguments.length>7?arguments[7]:void 0):KE(e,o,a)};async function Tw(e,t,n,o,r,i,a,s,c,u){if(c){const b=await c.generateProof({url:e,method:r.method||"GET",nonce:await c.getNonce()});r.headers=Object.assign(Object.assign({},r.headers),{dpop:b})}let d,f=null;for(let b=0;b<3;b++)try{d=await GE(e,n,o,r,i,a,t,s),f=null;break}catch(k){f=k}if(f)throw f;const h=d.json,{error:p,error_description:m}=h,g=An(h,["error","error_description"]),{headers:y,ok:w}=d;let S;if(c&&(S=y[_w],S&&await c.setNonce(S)),!w){const b=m||"HTTP error. Unable to fetch ".concat(e);if(p==="mfa_required")throw new Ri(p,b,g.mfa_token,g.mfa_requirements);if(p==="missing_refresh_token")throw new al(n,o);if(p==="use_dpop_nonce"){if(!c||!S||u)throw new sl(S);return Tw(e,t,n,o,r,i,a,s,c,!0)}throw new tt(p||"request_error",b)}return g}async function qE(e,t){var{baseUrl:n,timeout:o,audience:r,scope:i,auth0Client:a,useFormData:s,useMrrt:c,dpop:u}=e,d=An(e,["baseUrl","timeout","audience","scope","auth0Client","useFormData","useMrrt","dpop"]);const f=d.grant_type==="urn:ietf:params:oauth:grant-type:token-exchange",h=d.grant_type==="refresh_token"&&c,p=Object.assign(Object.assign(Object.assign(Object.assign({},d),f&&r&&{audience:r}),f&&i&&{scope:i}),h&&{audience:r,scope:i}),m=s?hd(p):JSON.stringify(p),g=(y=d.grant_type,BE.includes(y));var y;return await Tw("".concat(n,"/oauth/token"),o,r||Vt,i,{method:"POST",body:m,headers:{"Content-Type":s?"application/x-www-form-urlencoded":"application/json","Auth0-Client":btoa(JSON.stringify(Ew(a||kw)))}},t,s,c,g?u:void 0)}const $s=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(o=t.filter(Boolean).join(" ").trim().split(/\s+/),Array.from(new Set(o))).join(" ");var o},ms=(e,t,n)=>{let o;return n&&(o=e[n]),o||(o=e[Vt]),$s(o,t)},yi="@@auth0spajs@@",ni="@@user@@";class vn{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:yi,o=arguments.length>2?arguments[2]:void 0;this.prefix=n,this.suffix=o,this.clientId=t.clientId,this.scope=t.scope,this.audience=t.audience}toKey(){return[this.prefix,this.clientId,this.audience,this.scope,this.suffix].filter(Boolean).join("::")}static fromKey(t){const[n,o,r,i]=t.split("::");return new vn({clientId:o,scope:i,audience:r},n)}static fromCacheEntry(t){const{scope:n,audience:o,client_id:r}=t;return new vn({scope:n,audience:o,clientId:r})}}class JE{set(t,n){localStorage.setItem(t,JSON.stringify(n))}get(t){const n=window.localStorage.getItem(t);if(n)try{return JSON.parse(n)}catch{return}}remove(t){localStorage.removeItem(t)}allKeys(){return Object.keys(window.localStorage).filter(t=>t.startsWith(yi))}}class Nw{constructor(){this.enclosedCache=function(){let t={};return{set(n,o){t[n]=o},get(n){const o=t[n];if(o)return o},remove(n){delete t[n]},allKeys:()=>Object.keys(t)}}()}}class ZE{constructor(t,n,o){this.cache=t,this.keyManifest=n,this.nowProvider=o||Cw}async setIdToken(t,n,o){var r;const i=this.getIdTokenCacheKey(t);await this.cache.set(i,{id_token:n,decodedToken:o}),await((r=this.keyManifest)===null||r===void 0?void 0:r.add(i))}async getIdToken(t){const n=await this.cache.get(this.getIdTokenCacheKey(t.clientId));if(!n&&t.scope&&t.audience){const o=await this.get(t);return!o||!o.id_token||!o.decodedToken?void 0:{id_token:o.id_token,decodedToken:o.decodedToken}}if(n)return{id_token:n.id_token,decodedToken:n.decodedToken}}async get(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=arguments.length>2&&arguments[2]!==void 0&&arguments[2],r=arguments.length>3?arguments[3]:void 0;var i;let a=await this.cache.get(t.toKey());if(!a){const u=await this.getCacheKeys();if(!u)return;const d=this.matchExistingCacheKey(t,u);if(d&&(a=await this.cache.get(d)),!a&&o&&r!=="cache-only")return this.getEntryWithRefreshToken(t,u)}if(!a)return;const s=await this.nowProvider(),c=Math.floor(s/1e3);return a.expiresAt-n<c?a.body.refresh_token?this.modifiedCachedEntry(a,t):(await this.cache.remove(t.toKey()),void await((i=this.keyManifest)===null||i===void 0?void 0:i.remove(t.toKey()))):a.body}async modifiedCachedEntry(t,n){return t.body={refresh_token:t.body.refresh_token,audience:t.body.audience,scope:t.body.scope},await this.cache.set(n.toKey(),t),{refresh_token:t.body.refresh_token,audience:t.body.audience,scope:t.body.scope}}async set(t){var n;const o=new vn({clientId:t.client_id,scope:t.scope,audience:t.audience}),r=await this.wrapCacheEntry(t);await this.cache.set(o.toKey(),r),await((n=this.keyManifest)===null||n===void 0?void 0:n.add(o.toKey()))}async remove(t,n,o){const r=new vn({clientId:t,scope:o,audience:n});await this.cache.remove(r.toKey())}async clear(t){var n;const o=await this.getCacheKeys();o&&(await o.filter(r=>!t||r.includes(t)).reduce(async(r,i)=>{await r,await this.cache.remove(i)},Promise.resolve()),await((n=this.keyManifest)===null||n===void 0?void 0:n.clear()))}async wrapCacheEntry(t){const n=await this.nowProvider();return{body:t,expiresAt:Math.floor(n/1e3)+t.expires_in}}async getCacheKeys(){var t;return this.keyManifest?(t=await this.keyManifest.get())===null||t===void 0?void 0:t.keys:this.cache.allKeys?this.cache.allKeys():void 0}getIdTokenCacheKey(t){return new vn({clientId:t},yi,ni).toKey()}matchExistingCacheKey(t,n){return n.filter(o=>{var r;const i=vn.fromKey(o),a=new Set(i.scope&&i.scope.split(" ")),s=((r=t.scope)===null||r===void 0?void 0:r.split(" "))||[],c=i.scope&&s.reduce((u,d)=>u&&a.has(d),!0);return i.prefix===yi&&i.clientId===t.clientId&&i.audience===t.audience&&c})[0]}async getEntryWithRefreshToken(t,n){var o;for(const r of n){const i=vn.fromKey(r);if(i.prefix===yi&&i.clientId===t.clientId){const a=await this.cache.get(r);if(!((o=a==null?void 0:a.body)===null||o===void 0)&&o.refresh_token)return this.modifiedCachedEntry(a,t)}}}async updateEntry(t,n){var o;const r=await this.getCacheKeys();if(r)for(const i of r){const a=await this.cache.get(i);((o=a==null?void 0:a.body)===null||o===void 0?void 0:o.refresh_token)===t&&(a.body.refresh_token=n,await this.cache.set(i,a))}}}class YE{constructor(t,n,o){this.storage=t,this.clientId=n,this.cookieDomain=o,this.storageKey="".concat("a0.spajs.txs",".").concat(this.clientId)}create(t){this.storage.save(this.storageKey,t,{daysUntilExpire:1,cookieDomain:this.cookieDomain})}get(){return this.storage.get(this.storageKey)}remove(){this.storage.remove(this.storageKey,{cookieDomain:this.cookieDomain})}}const ea=e=>typeof e=="number",XE=["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"],QE=e=>{if(!e.id_token)throw new Error("ID token is required but missing");const t=(i=>{const a=i.split("."),[s,c,u]=a;if(a.length!==3||!s||!c||!u)throw new Error("ID token could not be decoded");const d=JSON.parse(Qp(c)),f={__raw:i},h={};return Object.keys(d).forEach(p=>{f[p]=d[p],XE.includes(p)||(h[p]=d[p])}),{encoded:{header:s,payload:c,signature:u},header:JSON.parse(Qp(s)),claims:f,user:h}})(e.id_token);if(!t.claims.iss)throw new Error("Issuer (iss) claim must be a string present in the ID token");if(t.claims.iss!==e.iss)throw new Error('Issuer (iss) claim mismatch in the ID token; expected "'.concat(e.iss,'", found "').concat(t.claims.iss,'"'));if(!t.user.sub)throw new Error("Subject (sub) claim must be a string present in the ID token");if(t.header.alg!=="RS256")throw new Error('Signature algorithm of "'.concat(t.header.alg,'" is not supported. Expected the ID token to be signed with "RS256".'));if(!t.claims.aud||typeof t.claims.aud!="string"&&!Array.isArray(t.claims.aud))throw new Error("Audience (aud) claim must be a string or array of strings present in the ID token");if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e.aud))throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but was not one of "').concat(t.claims.aud.join(", "),'"'));if(t.claims.aud.length>1){if(!t.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(t.claims.azp!==e.aud)throw new Error('Authorized Party (azp) claim mismatch in the ID token; expected "'.concat(e.aud,'", found "').concat(t.claims.azp,'"'))}}else if(t.claims.aud!==e.aud)throw new Error('Audience (aud) claim mismatch in the ID token; expected "'.concat(e.aud,'" but found "').concat(t.claims.aud,'"'));if(e.nonce){if(!t.claims.nonce)throw new Error("Nonce (nonce) claim must be a string present in the ID token");if(t.claims.nonce!==e.nonce)throw new Error('Nonce (nonce) claim mismatch in the ID token; expected "'.concat(e.nonce,'", found "').concat(t.claims.nonce,'"'))}if(e.max_age&&!ea(t.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(t.claims.exp==null||!ea(t.claims.exp))throw new Error("Expiration Time (exp) claim must be a number present in the ID token");if(!ea(t.claims.iat))throw new Error("Issued At (iat) claim must be a number present in the ID token");const n=e.leeway||60,o=new Date(e.now||Date.now()),r=new Date(0);if(r.setUTCSeconds(t.claims.exp+n),o>r)throw new Error("Expiration Time (exp) claim error in the ID token; current time (".concat(o,") is after expiration time (").concat(r,")"));if(t.claims.nbf!=null&&ea(t.claims.nbf)){const i=new Date(0);if(i.setUTCSeconds(t.claims.nbf-n),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 (".concat(o,") is before ").concat(i))}if(t.claims.auth_time!=null&&ea(t.claims.auth_time)){const i=new Date(0);if(i.setUTCSeconds(parseInt(t.claims.auth_time)+e.max_age+n),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 (".concat(o,") is after last auth at ").concat(i))}if(e.organization){const i=e.organization.trim();if(i.startsWith("org_")){const a=i;if(!t.claims.org_id)throw new Error("Organization ID (org_id) claim must be a string present in the ID token");if(a!==t.claims.org_id)throw new Error('Organization ID (org_id) claim mismatch in the ID token; expected "'.concat(a,'", found "').concat(t.claims.org_id,'"'))}else{const a=i.toLowerCase();if(!t.claims.org_name)throw new Error("Organization Name (org_name) claim must be a string present in the ID token");if(a!==t.claims.org_name)throw new Error('Organization Name (org_name) claim mismatch in the ID token; expected "'.concat(a,'", found "').concat(t.claims.org_name,'"'))}}return t};var _a=Hr&&Hr.__assign||function(){return _a=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},_a.apply(this,arguments)};function ta(e,t){if(!t)return"";var n="; "+e;return t===!0?n:n+"="+t}function e4(e,t,n){return encodeURIComponent(e).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/\(/g,"%28").replace(/\)/g,"%29")+"="+encodeURIComponent(t).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent)+function(o){if(typeof o.expires=="number"){var r=new Date;r.setMilliseconds(r.getMilliseconds()+864e5*o.expires),o.expires=r}return ta("Expires",o.expires?o.expires.toUTCString():"")+ta("Domain",o.domain)+ta("Path",o.path)+ta("Secure",o.secure)+ta("SameSite",o.sameSite)}(n)}function t4(){return function(e){for(var t={},n=e?e.split("; "):[],o=/(%[\dA-F]{2})+/gi,r=0;r<n.length;r++){var i=n[r].split("="),a=i.slice(1).join("=");a.charAt(0)==='"'&&(a=a.slice(1,-1));try{t[i[0].replace(o,decodeURIComponent)]=a.replace(o,decodeURIComponent)}catch{}}return t}(document.cookie)}var n4=function(e){return t4()[e]};function Iw(e,t,n){document.cookie=e4(e,t,_a({path:"/"},n))}var Rw=Iw,Lw=function(e,t){Iw(e,"",_a(_a({},t),{expires:-1}))};const oi={get(e){const t=n4(e);if(t!==void 0)return JSON.parse(t)},save(e,t,n){let o={};window.location.protocol==="https:"&&(o={secure:!0,sameSite:"none"}),n!=null&&n.daysUntilExpire&&(o.expires=n.daysUntilExpire),n!=null&&n.cookieDomain&&(o.domain=n.cookieDomain),Rw(e,JSON.stringify(t),o)},remove(e,t){let n={};t!=null&&t.cookieDomain&&(n.domain=t.cookieDomain),Lw(e,n)}},Yl="_legacy_",o4={get(e){return oi.get(e)||oi.get("".concat(Yl).concat(e))},save(e,t,n){let o={};window.location.protocol==="https:"&&(o={secure:!0}),n!=null&&n.daysUntilExpire&&(o.expires=n.daysUntilExpire),n!=null&&n.cookieDomain&&(o.domain=n.cookieDomain),Rw("".concat(Yl).concat(e),JSON.stringify(t),o),oi.save(e,t,n)},remove(e,t){let n={};t!=null&&t.cookieDomain&&(n.domain=t.cookieDomain),Lw(e,n),oi.remove(e,t),oi.remove("".concat(Yl).concat(e),t)}},r4={get(e){if(typeof sessionStorage>"u")return;const t=sessionStorage.getItem(e);return t!=null?JSON.parse(t):void 0},save(e,t){sessionStorage.setItem(e,JSON.stringify(t))},remove(e){sessionStorage.removeItem(e)}};var Do;(function(e){e.Code="code",e.ConnectCode="connect_code"})(Do||(Do={}));function i4(e,t,n){var o=t===void 0?null:t,r=function(c,u){var d=atob(c);if(u){for(var f=new Uint8Array(d.length),h=0,p=d.length;h<p;++h)f[h]=d.charCodeAt(h);return String.fromCharCode.apply(null,new Uint16Array(f.buffer))}return d}(e,n!==void 0&&n),i=r.indexOf(`
|
|
62
|
+
`,10)+1,a=r.substring(i)+(o?"//# sourceMappingURL="+o:""),s=new Blob([a],{type:"application/javascript"});return URL.createObjectURL(s)}var nm,om,rm,Xl,a4=(nm="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y2xhc3MgZSBleHRlbmRzIEVycm9ye2NvbnN0cnVjdG9yKHQscil7c3VwZXIociksdGhpcy5lcnJvcj10LHRoaXMuZXJyb3JfZGVzY3JpcHRpb249cixPYmplY3Quc2V0UHJvdG90eXBlT2YodGhpcyxlLnByb3RvdHlwZSl9c3RhdGljIGZyb21QYXlsb2FkKHQpe2xldHtlcnJvcjpyLGVycm9yX2Rlc2NyaXB0aW9uOnN9PXQ7cmV0dXJuIG5ldyBlKHIscyl9fWNsYXNzIHQgZXh0ZW5kcyBle2NvbnN0cnVjdG9yKGUscyl7c3VwZXIoIm1pc3NpbmdfcmVmcmVzaF90b2tlbiIsIk1pc3NpbmcgUmVmcmVzaCBUb2tlbiAoYXVkaWVuY2U6ICciLmNvbmNhdChyKGUsWyJkZWZhdWx0Il0pLCInLCBzY29wZTogJyIpLmNvbmNhdChyKHMpLCInKSIpKSx0aGlzLmF1ZGllbmNlPWUsdGhpcy5zY29wZT1zLE9iamVjdC5zZXRQcm90b3R5cGVPZih0aGlzLHQucHJvdG90eXBlKX19ZnVuY3Rpb24gcihlKXtyZXR1cm4gZSYmIShhcmd1bWVudHMubGVuZ3RoPjEmJnZvaWQgMCE9PWFyZ3VtZW50c1sxXT9hcmd1bWVudHNbMV06W10pLmluY2x1ZGVzKGUpP2U6IiJ9ImZ1bmN0aW9uIj09dHlwZW9mIFN1cHByZXNzZWRFcnJvciYmU3VwcHJlc3NlZEVycm9yO2NvbnN0IHM9ZT0+e3ZhcntjbGllbnRJZDp0fT1lLHI9ZnVuY3Rpb24oZSx0KXt2YXIgcj17fTtmb3IodmFyIHMgaW4gZSlPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwoZSxzKSYmdC5pbmRleE9mKHMpPDAmJihyW3NdPWVbc10pO2lmKG51bGwhPWUmJiJmdW5jdGlvbiI9PXR5cGVvZiBPYmplY3QuZ2V0T3duUHJvcGVydHlTeW1ib2xzKXt2YXIgbz0wO2ZvcihzPU9iamVjdC5nZXRPd25Qcm9wZXJ0eVN5bWJvbHMoZSk7bzxzLmxlbmd0aDtvKyspdC5pbmRleE9mKHNbb10pPDAmJk9iamVjdC5wcm90b3R5cGUucHJvcGVydHlJc0VudW1lcmFibGUuY2FsbChlLHNbb10pJiYocltzW29dXT1lW3Nbb11dKX1yZXR1cm4gcn0oZSxbImNsaWVudElkIl0pO3JldHVybiBuZXcgVVJMU2VhcmNoUGFyYW1zKChlPT5PYmplY3Qua2V5cyhlKS5maWx0ZXIodD0+dm9pZCAwIT09ZVt0XSkucmVkdWNlKCh0LHIpPT5PYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sdCkse1tyXTplW3JdfSkse30pKShPYmplY3QuYXNzaWduKHtjbGllbnRfaWQ6dH0scikpKS50b1N0cmluZygpfTtsZXQgbz17fTtjb25zdCBuPShlLHQpPT4iIi5jb25jYXQoZSwifCIpLmNvbmNhdCh0KTthZGRFdmVudExpc3RlbmVyKCJtZXNzYWdlIixhc3luYyBlPT57bGV0IHIsYyx7ZGF0YTp7dGltZW91dDppLGF1dGg6YSxmZXRjaFVybDpmLGZldGNoT3B0aW9uczpsLHVzZUZvcm1EYXRhOnAsdXNlTXJydDpofSxwb3J0czpbdV19PWUsZD17fTtjb25zdHthdWRpZW5jZTpnLHNjb3BlOnl9PWF8fHt9O3RyeXtjb25zdCBlPXA/KGU9Pntjb25zdCB0PW5ldyBVUkxTZWFyY2hQYXJhbXMoZSkscj17fTtyZXR1cm4gdC5mb3JFYWNoKChlLHQpPT57clt0XT1lfSkscn0pKGwuYm9keSk6SlNPTi5wYXJzZShsLmJvZHkpO2lmKCFlLnJlZnJlc2hfdG9rZW4mJiJyZWZyZXNoX3Rva2VuIj09PWUuZ3JhbnRfdHlwZSl7aWYoYz0oKGUsdCk9Pm9bbihlLHQpXSkoZyx5KSwhYyYmaCl7Y29uc3QgZT1vLmxhdGVzdF9yZWZyZXNoX3Rva2VuLHQ9KChlLHQpPT57Y29uc3Qgcj1PYmplY3Qua2V5cyhvKS5maW5kKHI9PntpZigibGF0ZXN0X3JlZnJlc2hfdG9rZW4iIT09cil7Y29uc3Qgcz0oKGUsdCk9PnQuc3RhcnRzV2l0aCgiIi5jb25jYXQoZSwifCIpKSkodCxyKSxvPXIuc3BsaXQoInwiKVsxXS5zcGxpdCgiICIpLG49ZS5zcGxpdCgiICIpLmV2ZXJ5KGU9Pm8uaW5jbHVkZXMoZSkpO3JldHVybiBzJiZufX0pO3JldHVybiEhcn0pKHksZyk7ZSYmIXQmJihjPWUpfWlmKCFjKXRocm93IG5ldyB0KGcseSk7bC5ib2R5PXA/cyhPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sZSkse3JlZnJlc2hfdG9rZW46Y30pKTpKU09OLnN0cmluZ2lmeShPYmplY3QuYXNzaWduKE9iamVjdC5hc3NpZ24oe30sZSkse3JlZnJlc2hfdG9rZW46Y30pKX1sZXQgYSxrOyJmdW5jdGlvbiI9PXR5cGVvZiBBYm9ydENvbnRyb2xsZXImJihhPW5ldyBBYm9ydENvbnRyb2xsZXIsbC5zaWduYWw9YS5zaWduYWwpO3RyeXtrPWF3YWl0IFByb21pc2UucmFjZShbKGo9aSxuZXcgUHJvbWlzZShlPT5zZXRUaW1lb3V0KGUsaikpKSxmZXRjaChmLE9iamVjdC5hc3NpZ24oe30sbCkpXSl9Y2F0Y2goZSl7cmV0dXJuIHZvaWQgdS5wb3N0TWVzc2FnZSh7ZXJyb3I6ZS5tZXNzYWdlfSl9aWYoIWspcmV0dXJuIGEmJmEuYWJvcnQoKSx2b2lkIHUucG9zdE1lc3NhZ2Uoe2Vycm9yOiJUaW1lb3V0IHdoZW4gZXhlY3V0aW5nICdmZXRjaCcifSk7Xz1rLmhlYWRlcnMsZD1bLi4uX10ucmVkdWNlKChlLHQpPT57bGV0W3Isc109dDtyZXR1cm4gZVtyXT1zLGV9LHt9KSxyPWF3YWl0IGsuanNvbigpLHIucmVmcmVzaF90b2tlbj8oaCYmKG8ubGF0ZXN0X3JlZnJlc2hfdG9rZW49ci5yZWZyZXNoX3Rva2VuLE89YyxiPXIucmVmcmVzaF90b2tlbixPYmplY3QuZW50cmllcyhvKS5mb3JFYWNoKGU9PntsZXRbdCxyXT1lO3I9PT1PJiYob1t0XT1iKX0pKSwoKGUsdCxyKT0+e29bbih0LHIpXT1lfSkoci5yZWZyZXNoX3Rva2VuLGcseSksZGVsZXRlIHIucmVmcmVzaF90b2tlbik6KChlLHQpPT57ZGVsZXRlIG9bbihlLHQpXX0pKGcseSksdS5wb3N0TWVzc2FnZSh7b2s6ay5vayxqc29uOnIsaGVhZGVyczpkfSl9Y2F0Y2goZSl7dS5wb3N0TWVzc2FnZSh7b2s6ITEsanNvbjp7ZXJyb3I6ZS5lcnJvcixlcnJvcl9kZXNjcmlwdGlvbjplLm1lc3NhZ2V9LGhlYWRlcnM6ZH0pfXZhciBPLGIsXyxqfSl9KCk7Cgo=",om=null,rm=!1,function(e){return Xl=Xl||i4(nm,om,rm),new Worker(Xl,e)});const Ql={};class s4{constructor(t,n){this.cache=t,this.clientId=n,this.manifestKey=this.createManifestKeyFrom(this.clientId)}async add(t){var n;const o=new Set(((n=await this.cache.get(this.manifestKey))===null||n===void 0?void 0:n.keys)||[]);o.add(t),await this.cache.set(this.manifestKey,{keys:[...o]})}async remove(t){const n=await this.cache.get(this.manifestKey);if(n){const o=new Set(n.keys);return o.delete(t),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(t){return"".concat(yi,"::").concat(t)}}const im="auth0.is.authenticated",c4={memory:()=>new Nw().enclosedCache,localstorage:()=>new JE},am=e=>c4[e],sm=e=>{const{openUrl:t,onRedirect:n}=e,o=An(e,["openUrl","onRedirect"]);return Object.assign(Object.assign({},o),{openUrl:t===!1||t?t:n})},cm=(e,t)=>{const n=(t==null?void 0:t.split(" "))||[];return((e==null?void 0:e.split(" "))||[]).every(o=>n.includes(o))},fr={NONCE:"nonce",KEYPAIR:"keypair"};class l4{constructor(t){this.clientId=t}getVersion(){return 1}createDbHandle(){const t=window.indexedDB.open("auth0-spa-js",this.getVersion());return new Promise((n,o)=>{t.onupgradeneeded=()=>Object.values(fr).forEach(r=>t.result.createObjectStore(r)),t.onerror=()=>o(t.error),t.onsuccess=()=>n(t.result)})}async getDbHandle(){return this.dbHandle||(this.dbHandle=await this.createDbHandle()),this.dbHandle}async executeDbRequest(t,n,o){const r=o((await this.getDbHandle()).transaction(t,n).objectStore(t));return new Promise((i,a)=>{r.onsuccess=()=>i(r.result),r.onerror=()=>a(r.error)})}buildKey(t){const n=t?"_".concat(t):"auth0";return"".concat(this.clientId,"::").concat(n)}setNonce(t,n){return this.save(fr.NONCE,this.buildKey(n),t)}setKeyPair(t){return this.save(fr.KEYPAIR,this.buildKey(),t)}async save(t,n,o){await this.executeDbRequest(t,"readwrite",r=>r.put(o,n))}findNonce(t){return this.find(fr.NONCE,this.buildKey(t))}findKeyPair(){return this.find(fr.KEYPAIR,this.buildKey())}find(t,n){return this.executeDbRequest(t,"readonly",o=>o.get(n))}async deleteBy(t,n){const o=await this.executeDbRequest(t,"readonly",r=>r.getAllKeys());o==null||o.filter(n).map(r=>this.executeDbRequest(t,"readwrite",i=>i.delete(r)))}deleteByClientId(t,n){return this.deleteBy(t,o=>typeof o=="string"&&o.startsWith("".concat(n,"::")))}clearNonces(){return this.deleteByClientId(fr.NONCE,this.clientId)}clearKeyPairs(){return this.deleteByClientId(fr.KEYPAIR,this.clientId)}}class u4{constructor(t){this.storage=new l4(t)}getNonce(t){return this.storage.findNonce(t)}setNonce(t,n){return this.storage.setNonce(t,n)}async getOrGenerateKeyPair(){let t=await this.storage.findKeyPair();return t||(t=await WE(),await this.storage.setKeyPair(t)),t}async generateProof(t){const n=await this.getOrGenerateKeyPair();return zE(Object.assign({keyPair:n},t))}async calculateThumbprint(){return FE(await this.getOrGenerateKeyPair())}async clear(){await Promise.all([this.storage.clearNonces(),this.storage.clearKeyPairs()])}}var ui;(function(e){e.Bearer="Bearer",e.DPoP="DPoP"})(ui||(ui={}));class d4{constructor(t,n){this.hooks=n,this.config=Object.assign(Object.assign({},t),{fetch:t.fetch||(typeof window>"u"?fetch:window.fetch.bind(window))})}isAbsoluteUrl(t){return/^(https?:)?\/\//i.test(t)}buildUrl(t,n){if(n){if(this.isAbsoluteUrl(n))return n;if(t)return"".concat(t.replace(/\/?\/$/,""),"/").concat(n.replace(/^\/+/,""))}throw new TypeError("`url` must be absolute or `baseUrl` non-empty.")}getAccessToken(t){return this.config.getAccessToken?this.config.getAccessToken(t):this.hooks.getAccessToken(t)}extractUrl(t){return typeof t=="string"?t:t instanceof URL?t.href:t.url}buildBaseRequest(t,n){if(!this.config.baseUrl)return new Request(t,n);const o=this.buildUrl(this.config.baseUrl,this.extractUrl(t)),r=t instanceof Request?new Request(o,t):o;return new Request(r,n)}setAuthorizationHeader(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ui.Bearer;t.headers.set("authorization","".concat(o," ").concat(n))}async setDpopProofHeader(t,n){if(!this.config.dpopNonceId)return;const o=await this.hooks.getDpopNonce(),r=await this.hooks.generateDpopProof({accessToken:n,method:t.method,nonce:o,url:t.url});t.headers.set("dpop",r)}async prepareRequest(t,n){const o=await this.getAccessToken(n);let r,i;typeof o=="string"?(r=this.config.dpopNonceId?ui.DPoP:ui.Bearer,i=o):(r=o.token_type,i=o.access_token),this.setAuthorizationHeader(t,i,r),r===ui.DPoP&&await this.setDpopProofHeader(t,i)}getHeader(t,n){return Array.isArray(t)?new Headers(t).get(n)||"":typeof t.get=="function"?t.get(n)||"":t[n]||""}hasUseDpopNonceError(t){if(t.status!==401)return!1;const n=this.getHeader(t.headers,"www-authenticate");return n.includes("invalid_dpop_nonce")||n.includes("use_dpop_nonce")}async handleResponse(t,n){const o=this.getHeader(t.headers,_w);if(o&&await this.hooks.setDpopNonce(o),!this.hasUseDpopNonceError(t))return t;if(!o||!n.onUseDpopNonceError)throw new sl(o);return n.onUseDpopNonceError()}async internalFetchWithAuth(t,n,o,r){const i=this.buildBaseRequest(t,n);await this.prepareRequest(i,r);const a=await this.config.fetch(i);return this.handleResponse(a,o)}fetchWithAuth(t,n,o){const r={onUseDpopNonceError:()=>this.internalFetchWithAuth(t,n,Object.assign(Object.assign({},r),{onUseDpopNonceError:void 0}),o)};return this.internalFetchWithAuth(t,n,r,o)}}class f4{constructor(t,n){this.myAccountFetcher=t,this.apiBase=n}async connectAccount(t){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/connect"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return this._handleResponse(n)}async completeAccount(t){const n=await this.myAccountFetcher.fetchWithAuth("".concat(this.apiBase,"v1/connected-accounts/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return this._handleResponse(n)}async _handleResponse(t){let n;try{n=await t.text(),n=JSON.parse(n)}catch(o){throw new mc({type:"invalid_json",status:t.status,title:"Invalid JSON response",detail:n||String(o)})}if(t.ok)return n;throw new mc(n)}}class mc extends Error{constructor(t){let{type:n,status:o,title:r,detail:i,validation_errors:a}=t;super(i),this.name="MyAccountApiError",this.type=n,this.status=o,this.title=r,this.detail=i,this.validation_errors=a,Object.setPrototypeOf(this,mc.prototype)}}const h4={otp:{authenticatorTypes:["otp"]},sms:{authenticatorTypes:["oob"],oobChannels:["sms"]},email:{authenticatorTypes:["oob"],oobChannels:["email"]},push:{authenticatorTypes:["oob"],oobChannels:["auth0"]},voice:{authenticatorTypes:["oob"],oobChannels:["voice"]}},p4="http://auth0.com/oauth/grant-type/mfa-otp",m4="http://auth0.com/oauth/grant-type/mfa-oob",g4="http://auth0.com/oauth/grant-type/mfa-recovery-code";function Dw(e,t){this.v=e,this.k=t}function it(e,t,n){if(typeof e=="function"?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function v4(e){return new Dw(e,0)}function Mw(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ne(e,t){return e.get(it(e,t))}function Qe(e,t,n){Mw(e,t),t.set(e,n)}function $e(e,t,n){return e.set(it(e,t),n),n}function me(e,t,n){return(t=function(o){var r=function(i,a){if(typeof i!="object"||!i)return i;var s=i[Symbol.toPrimitive];if(s!==void 0){var c=s.call(i,a||"default");if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}(o,"string");return typeof r=="symbol"?r:r+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function lm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,o)}return n}function xe(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?lm(Object(n),!0).forEach(function(o){me(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lm(Object(n)).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function um(e,t){if(e==null)return{};var n,o,r=function(a,s){if(a==null)return{};var c={};for(var u in a)if({}.hasOwnProperty.call(a,u)){if(s.indexOf(u)!==-1)continue;c[u]=a[u]}return c}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)n=i[o],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function y4(e){return function(){return new ca(e.apply(this,arguments))}}function ca(e){var t,n;function o(i,a){try{var s=e[i](a),c=s.value,u=c instanceof Dw;Promise.resolve(u?c.v:c).then(function(d){if(u){var f=i==="return"&&c.k?i:"next";if(!c.k||d.done)return o(f,d);d=e[f](d).value}r(!!s.done,d)},function(d){o("throw",d)})}catch(d){r(2,d)}}function r(i,a){i===2?t.reject(a):t.resolve({value:a,done:i}),(t=t.next)?o(t.key,t.arg):n=null}this._invoke=function(i,a){return new Promise(function(s,c){var u={key:i,arg:a,resolve:s,reject:c,next:null};n?n=n.next=u:(t=n=u,o(i,a))})},typeof e.return!="function"&&(this.return=void 0)}var gs,eu;let md;if(ca.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},ca.prototype.next=function(e){return this._invoke("next",e)},ca.prototype.throw=function(e){return this._invoke("throw",e)},ca.prototype.return=function(e){return this._invoke("return",e)},typeof navigator>"u"||(gs=navigator.userAgent)===null||gs===void 0||(eu=gs.startsWith)===null||eu===void 0||!eu.call(gs,"Mozilla/5.0 ")){const e="v3.8.5";md="".concat("oauth4webapi","/").concat(e)}function zi(e,t){if(e==null)return!1;try{return e instanceof t||Object.getPrototypeOf(e)[Symbol.toStringTag]===t.prototype[Symbol.toStringTag]}catch{return!1}}const Bt="ERR_INVALID_ARG_VALUE",tn="ERR_INVALID_ARG_TYPE";function qe(e,t,n){const o=new TypeError(e,{cause:n});return Object.assign(o,{code:t}),o}const kn=Symbol(),gd=Symbol(),vd=Symbol(),Hn=Symbol(),w4=Symbol(),Qn=Symbol(),b4=new TextEncoder,x4=new TextDecoder;function wi(e){return typeof e=="string"?b4.encode(e):x4.decode(e)}let yd,$w;Uint8Array.prototype.toBase64?yd=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:"base64url",omitPadding:!0})):yd=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));const n=[];for(let o=0;o<t.byteLength;o+=32768)n.push(String.fromCharCode.apply(null,t.subarray(o,o+32768)));return btoa(n.join("")).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")};function Rr(e){return typeof e=="string"?$w(e):yd(e)}$w=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:"base64url"})}catch(t){throw qe("The input to be decoded is not correctly encoded.",Bt,t)}}:e=>{try{const t=atob(e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"")),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}catch(t){throw qe("The input to be decoded is not correctly encoded.",Bt,t)}};class dn extends Error{constructor(t,n){var o;super(t,n),me(this,"code",void 0),this.name=this.constructor.name,this.code=xd,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}class Vf extends Error{constructor(t,n){var o;super(t,n),me(this,"code",void 0),this.name=this.constructor.name,n!=null&&n.code&&(this.code=n==null?void 0:n.code),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}function _e(e,t,n){return new Vf(e,{code:t,cause:n})}function S4(e,t){if(function(n,o){if(!(n instanceof CryptoKey))throw qe("".concat(o," must be a CryptoKey"),tn)}(e,t),e.type!=="private")throw qe("".concat(t," must be a private CryptoKey"),Bt)}function gc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function cl(e){zi(e,Headers)&&(e=Object.fromEntries(e.entries()));const t=new Headers(e??{});if(md&&!t.has("user-agent")&&t.set("user-agent",md),t.has("authorization"))throw qe('"options.headers" must not include the "authorization" header name',Bt);return t}function Hw(e,t){if(t!==void 0){if(typeof t=="function"&&(t=t(e.href)),!(t instanceof AbortSignal))throw qe('"options.signal" must return or be an instance of AbortSignal',tn);return t}}function dm(e){return e.includes("//")?e.replace("//","/"):e}async function k4(e,t){return async function(n,o,r,i){if(!(n instanceof URL))throw qe('"'.concat(o,'" must be an instance of URL'),tn);Gf(n,(i==null?void 0:i[kn])!==!0);const a=r(new URL(n.href)),s=cl(i==null?void 0:i.headers);return s.set("accept","application/json"),((i==null?void 0:i[Hn])||fetch)(a.href,{body:void 0,headers:Object.fromEntries(s.entries()),method:"GET",redirect:"manual",signal:Hw(a,i==null?void 0:i.signal)})}(e,"issuerIdentifier",n=>{switch(t==null?void 0:t.algorithm){case void 0:case"oidc":(function(o,r){o.pathname=dm("".concat(o.pathname,"/").concat(r))})(n,".well-known/openid-configuration");break;case"oauth2":(function(o,r){let i=arguments.length>2&&arguments[2]!==void 0&&arguments[2];o.pathname==="/"?o.pathname=r:o.pathname=dm("".concat(r,"/").concat(i?o.pathname:o.pathname.replace(/(\/)$/,"")))})(n,".well-known/oauth-authorization-server");break;default:throw qe('"options.algorithm" must be "oidc" (default), or "oauth2"',Bt)}return n},t)}function Yo(e,t,n,o,r){try{if(typeof e!="number"||!Number.isFinite(e))throw qe("".concat(n," must be a number"),tn,r);if(e>0)return;if(t){if(e!==0)throw qe("".concat(n," must be a non-negative number"),Bt,r);return}throw qe("".concat(n," must be a positive number"),Bt,r)}catch(i){throw o?_e(i.message,o,r):i}}function vt(e,t,n,o){try{if(typeof e!="string")throw qe("".concat(t," must be a string"),tn,o);if(e.length===0)throw qe("".concat(t," must not be empty"),Bt,o)}catch(r){throw n?_e(r.message,n,o):r}}function Bw(e){(function(t,n){if(Uw(t)!==n)throw function(o){let r='"response" content-type must be ';for(var i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];if(a.length>2){const c=a.pop();r+="".concat(a.join(", "),", or ").concat(c)}else a.length===2?r+="".concat(a[0]," or ").concat(a[1]):r+=a[0];return _e(r,Vw,o)}(t,n)})(e,"application/json")}function Ww(){return Rr(crypto.getRandomValues(new Uint8Array(32)))}function C4(e){switch(e.algorithm.name){case"RSA-PSS":return function(t){switch(t.algorithm.hash.name){case"SHA-256":return"PS256";case"SHA-384":return"PS384";case"SHA-512":return"PS512";default:throw new dn("unsupported RsaHashedKeyAlgorithm hash name",{cause:t})}}(e);case"RSASSA-PKCS1-v1_5":return function(t){switch(t.algorithm.hash.name){case"SHA-256":return"RS256";case"SHA-384":return"RS384";case"SHA-512":return"RS512";default:throw new dn("unsupported RsaHashedKeyAlgorithm hash name",{cause:t})}}(e);case"ECDSA":return function(t){switch(t.algorithm.namedCurve){case"P-256":return"ES256";case"P-384":return"ES384";case"P-521":return"ES512";default:throw new dn("unsupported EcKeyAlgorithm namedCurve",{cause:t})}}(e);case"Ed25519":case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return e.algorithm.name;case"EdDSA":return"Ed25519";default:throw new dn("unsupported CryptoKey algorithm name",{cause:e})}}function vc(e){const t=e==null?void 0:e[gd];return typeof t=="number"&&Number.isFinite(t)?t:0}function wd(e){const t=e==null?void 0:e[vd];return typeof t=="number"&&Number.isFinite(t)&&Math.sign(t)!==-1?t:30}function yc(){return Math.floor(Date.now()/1e3)}function Rn(e){if(typeof e!="object"||e===null)throw qe('"as" must be an object',tn);vt(e.issuer,'"as.issuer"')}function Ln(e){if(typeof e!="object"||e===null)throw qe('"client" must be an object',tn);vt(e.client_id,'"client.client_id"')}function fm(e){return vt(e,'"clientSecret"'),(t,n,o,r)=>{o.set("client_id",n.client_id),o.set("client_secret",e)}}function E4(e,t){const{key:n,kid:o}=(r=e)instanceof CryptoKey?{key:r}:(r==null?void 0:r.key)instanceof CryptoKey?(r.kid!==void 0&&vt(r.kid,'"kid"'),{key:r.key,kid:r.kid}):{};var r;return S4(n,'"clientPrivateKey.key"'),async(i,a,s,c)=>{var u;const d={alg:C4(n),kid:o},f=function(h,p){const m=yc()+vc(p);return{jti:Ww(),aud:h.issuer,exp:m+60,iat:m,nbf:m,iss:p.client_id,sub:p.client_id}}(i,a);t==null||(u=t[w4])===null||u===void 0||u.call(t,d,f),s.set("client_id",a.client_id),s.set("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),s.set("client_assertion",await async function(h,p,m){if(!m.usages.includes("sign"))throw qe('CryptoKey instances used for signing assertions must include "sign" in their "usages"',Bt);const g="".concat(Rr(wi(JSON.stringify(h))),".").concat(Rr(wi(JSON.stringify(p)))),y=Rr(await crypto.subtle.sign(function(w){switch(w.algorithm.name){case"ECDSA":return{name:w.algorithm.name,hash:U4(w)};case"RSA-PSS":switch(mm(w),w.algorithm.hash.name){case"SHA-256":case"SHA-384":case"SHA-512":return{name:w.algorithm.name,saltLength:parseInt(w.algorithm.hash.name.slice(-3),10)>>3};default:throw new dn("unsupported RSA-PSS hash name",{cause:w})}case"RSASSA-PKCS1-v1_5":return mm(w),w.algorithm.name;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":case"Ed25519":return w.algorithm.name}throw new dn("unsupported CryptoKey algorithm name",{cause:w})}(m),m,wi(g)));return"".concat(g,".").concat(y)}(d,f,n))}}const j4=URL.parse?(e,t)=>URL.parse(e,t):(e,t)=>{try{return new URL(e,t)}catch{return null}};function Gf(e,t){if(t&&e.protocol!=="https:")throw _e("only requests to HTTPS are allowed",Gw,e);if(e.protocol!=="https:"&&e.protocol!=="http:")throw _e("only HTTP and HTTPS requests are allowed",qw,e)}function hm(e,t,n,o){let r;if(typeof e!="string"||!(r=j4(e)))throw _e("authorization server metadata does not contain a valid ".concat(n?'"as.mtls_endpoint_aliases.'.concat(t,'"'):'"as.'.concat(t,'"')),e===void 0?F4:z4,{attribute:n?"mtls_endpoint_aliases.".concat(t):t});return Gf(r,o),r}function Ua(e,t,n,o){return n&&e.mtls_endpoint_aliases&&t in e.mtls_endpoint_aliases?hm(e.mtls_endpoint_aliases[t],t,n,o):hm(e[t],t,n,o)}class ll extends Error{constructor(t,n){var o;super(t,n),me(this,"cause",void 0),me(this,"code",void 0),me(this,"error",void 0),me(this,"status",void 0),me(this,"error_description",void 0),me(this,"response",void 0),this.name=this.constructor.name,this.code=B4,this.cause=n.cause,this.error=n.cause.error,this.status=n.response.status,this.error_description=n.cause.error_description,Object.defineProperty(this,"response",{enumerable:!1,value:n.response}),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}class Fw extends Error{constructor(t,n){var o,r;super(t,n),me(this,"cause",void 0),me(this,"code",void 0),me(this,"error",void 0),me(this,"error_description",void 0),this.name=this.constructor.name,this.code=W4,this.cause=n.cause,this.error=n.cause.get("error"),this.error_description=(o=n.cause.get("error_description"))!==null&&o!==void 0?o:void 0,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}}class qf extends Error{constructor(t,n){var o;super(t,n),me(this,"cause",void 0),me(this,"code",void 0),me(this,"response",void 0),me(this,"status",void 0),this.name=this.constructor.name,this.code=H4,this.cause=n.cause,this.status=n.response.status,this.response=n.response,Object.defineProperty(this,"response",{enumerable:!1}),(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}const wc="[a-zA-Z0-9!#$%&\\'\\*\\+\\-\\.\\^_`\\|~]+",A4="("+wc+')\\s*=\\s*"((?:[^"\\\\]|\\\\[\\s\\S])*)"',O4="("+wc+")\\s*=\\s*("+wc+")",P4=new RegExp("^[,\\s]*("+wc+")"),_4=new RegExp("^[,\\s]*"+A4+"[,\\s]*(.*)"),T4=new RegExp("^[,\\s]*"+O4+"[,\\s]*(.*)"),N4=new RegExp("^([a-zA-Z0-9\\-\\._\\~\\+\\/]+={0,2})(?:$|[,\\s])(.*)");async function Jf(e,t,n){if(e.status!==t){let r;var o;throw function(i){let a;if(a=function(s){if(!zi(s,Response))throw qe('"response" must be an instance of Response',tn);const c=s.headers.get("www-authenticate");if(c===null)return;const u=[];let d=c;for(;d;){var f;let h=d.match(P4);const p=(f=h)===null||f===void 0?void 0:f[1].toLowerCase();if(!p)return;const m=d.substring(h[0].length);if(m&&!m.match(/^[\s,]/))return;const g=m.match(/^\s+(.*)$/),y=!!g;d=g?g[1]:void 0;const w={};let S;if(y)for(;d;){let k,x;if(h=d.match(_4)){if([,k,x,d]=h,x.includes("\\"))try{x=JSON.parse('"'.concat(x,'"'))}catch{}w[k.toLowerCase()]=x}else{if(!(h=d.match(T4))){if(h=d.match(N4)){if(Object.keys(w).length)break;[,S,d]=h;break}return}[,k,x,d]=h,w[k.toLowerCase()]=x}}else d=m||void 0;const b={scheme:p,parameters:w};S&&(b.token68=S),u.push(b)}return u.length?u:void 0}(i))throw new qf("server responded with a challenge in the WWW-Authenticate HTTP Header",{cause:a,response:i})}(e),(r=await async function(i){if(i.status>399&&i.status<500){Va(i),Bw(i);try{const a=await i.clone().json();if(gc(a)&&typeof a.error=="string"&&a.error.length)return a}catch{}}}(e))?(await((o=e.body)===null||o===void 0?void 0:o.cancel()),new ll("server responded with an error in the response body",{cause:r,response:e})):_e('"response" is not a conform '.concat(n," response (unexpected HTTP status code)"),Xf,e)}}function zw(e){if(!Yf.has(e))throw qe('"options.DPoP" is not a valid DPoPHandle',Bt)}function Uw(e){var t;return(t=e.headers.get("content-type"))===null||t===void 0?void 0:t.split(";")[0]}async function Zf(e,t,n,o,r,i,a){return await n(e,t,r,i),i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),((a==null?void 0:a[Hn])||fetch)(o.href,{body:r,headers:Object.fromEntries(i.entries()),method:"POST",redirect:"manual",signal:Hw(o,a==null?void 0:a.signal)})}async function Ka(e,t,n,o,r,i){var a;const s=Ua(e,"token_endpoint",t.use_mtls_endpoint_aliases,(i==null?void 0:i[kn])!==!0);r.set("grant_type",o);const c=cl(i==null?void 0:i.headers);c.set("accept","application/json"),(i==null?void 0:i.DPoP)!==void 0&&(zw(i.DPoP),await i.DPoP.addProof(s,c,"POST"));const u=await Zf(e,t,n,s,r,c,i);return i==null||(a=i.DPoP)===null||a===void 0||a.cacheNonce(u,s),u}const Kw=new WeakMap,I4=new WeakMap;function bd(e){if(!e.id_token)return;const t=Kw.get(e);if(!t)throw qe('"ref" was already garbage collected or did not resolve from the proper sources',Bt);return t}async function Li(e,t,n,o,r,i){if(Rn(e),Ln(t),!zi(n,Response))throw qe('"response" must be an instance of Response',tn);await Jf(n,200,"Token Endpoint"),Va(n);const a=await ul(n);if(vt(a.access_token,'"response" body "access_token" property',He,{body:a}),vt(a.token_type,'"response" body "token_type" property',He,{body:a}),a.token_type=a.token_type.toLowerCase(),a.expires_in!==void 0){let s=typeof a.expires_in!="number"?parseFloat(a.expires_in):a.expires_in;Yo(s,!0,'"response" body "expires_in" property',He,{body:a}),a.expires_in=s}if(a.refresh_token!==void 0&&vt(a.refresh_token,'"response" body "refresh_token" property',He,{body:a}),a.scope!==void 0&&typeof a.scope!="string")throw _e('"response" body "scope" property must be a string',He,{body:a});if(a.id_token!==void 0){vt(a.id_token,'"response" body "id_token" property',He,{body:a});const s=["aud","exp","iat","iss","sub"];t.require_auth_time===!0&&s.push("auth_time"),t.default_max_age!==void 0&&(Yo(t.default_max_age,!0,'"client.default_max_age"'),s.push("auth_time")),o!=null&&o.length&&s.push(...o);const{claims:c,jwt:u}=await async function(d,f,h,p,m){let g,y,{0:w,1:S,length:b}=d.split(".");if(b===5){if(m===void 0)throw new dn("JWE decryption is not configured",{cause:d});d=await m(d),{0:w,1:S,length:b}=d.split(".")}if(b!==3)throw _e("Invalid JWT",He,d);try{g=JSON.parse(wi(Rr(w)))}catch(x){throw _e("failed to parse JWT Header body as base64url encoded JSON",bc,x)}if(!gc(g))throw _e("JWT Header must be a top level object",He,d);if(f(g),g.crit!==void 0)throw new dn('no JWT "crit" header parameter extensions are supported',{cause:{header:g}});try{y=JSON.parse(wi(Rr(S)))}catch(x){throw _e("failed to parse JWT Payload body as base64url encoded JSON",bc,x)}if(!gc(y))throw _e("JWT Payload must be a top level object",He,d);const k=yc()+h;if(y.exp!==void 0){if(typeof y.exp!="number")throw _e('unexpected JWT "exp" (expiration time) claim type',He,{claims:y});if(y.exp<=k-p)throw _e('unexpected JWT "exp" (expiration time) claim value, expiration is past current timestamp',Ta,{claims:y,now:k,tolerance:p,claim:"exp"})}if(y.iat!==void 0&&typeof y.iat!="number")throw _e('unexpected JWT "iat" (issued at) claim type',He,{claims:y});if(y.iss!==void 0&&typeof y.iss!="string")throw _e('unexpected JWT "iss" (issuer) claim type',He,{claims:y});if(y.nbf!==void 0){if(typeof y.nbf!="number")throw _e('unexpected JWT "nbf" (not before) claim type',He,{claims:y});if(y.nbf>k+p)throw _e('unexpected JWT "nbf" (not before) claim value',Ta,{claims:y,now:k,tolerance:p,claim:"nbf"})}if(y.aud!==void 0&&typeof y.aud!="string"&&!Array.isArray(y.aud))throw _e('unexpected JWT "aud" (audience) claim type',He,{claims:y});return{header:g,claims:y,jwt:d}}(a.id_token,V4.bind(void 0,t.id_token_signed_response_alg,e.id_token_signing_alg_values_supported,"RS256"),vc(t),wd(t),r).then(M4.bind(void 0,s)).then(L4.bind(void 0,e)).then(R4.bind(void 0,t.client_id));if(Array.isArray(c.aud)&&c.aud.length!==1){if(c.azp===void 0)throw _e('ID Token "aud" (audience) claim includes additional untrusted audiences',mo,{claims:c,claim:"aud"});if(c.azp!==t.client_id)throw _e('unexpected ID Token "azp" (authorized party) claim value',mo,{expected:t.client_id,claims:c,claim:"azp"})}c.auth_time!==void 0&&Yo(c.auth_time,!0,'ID Token "auth_time" (authentication time)',He,{claims:c}),I4.set(n,u),Kw.set(a,c)}if((i==null?void 0:i[a.token_type])!==void 0)i[a.token_type](n,a);else if(a.token_type!=="dpop"&&a.token_type!=="bearer")throw new dn("unsupported `token_type` value",{cause:{body:a}});return a}function R4(e,t){if(Array.isArray(t.claims.aud)){if(!t.claims.aud.includes(e))throw _e('unexpected JWT "aud" (audience) claim value',mo,{expected:e,claims:t.claims,claim:"aud"})}else if(t.claims.aud!==e)throw _e('unexpected JWT "aud" (audience) claim value',mo,{expected:e,claims:t.claims,claim:"aud"});return t}function L4(e,t){var n,o;const r=(n=(o=e[Jw])===null||o===void 0?void 0:o.call(e,t))!==null&&n!==void 0?n:e.issuer;if(t.claims.iss!==r)throw _e('unexpected JWT "iss" (issuer) claim value',mo,{expected:r,claims:t.claims,claim:"iss"});return t}const Yf=new WeakSet,pm=Symbol(),D4={aud:"audience",c_hash:"code hash",client_id:"client id",exp:"expiration time",iat:"issued at",iss:"issuer",jti:"jwt id",nonce:"nonce",s_hash:"state hash",sub:"subject",ath:"access token hash",htm:"http method",htu:"http uri",cnf:"confirmation",auth_time:"authentication time"};function M4(e,t){for(const n of e)if(t.claims[n]===void 0)throw _e('JWT "'.concat(n,'" (').concat(D4[n],") claim missing"),He,{claims:t.claims});return t}const tu=Symbol(),nu=Symbol();async function $4(e,t,n,o){return typeof(o==null?void 0:o.expectedNonce)=="string"||typeof(o==null?void 0:o.maxAge)=="number"||o!=null&&o.requireIdToken?async function(r,i,a,s,c,u,d){const f=[];switch(s){case void 0:s=tu;break;case tu:break;default:vt(s,'"expectedNonce" argument'),f.push("nonce")}switch(c!=null||(c=i.default_max_age),c){case void 0:c=nu;break;case nu:break;default:Yo(c,!0,'"maxAge" argument'),f.push("auth_time")}const h=await Li(r,i,a,f,u,d);vt(h.id_token,'"response" body "id_token" property',He,{body:h});const p=bd(h);if(c!==nu){const m=yc()+vc(i),g=wd(i);if(p.auth_time+c<m-g)throw _e("too much time has elapsed since the last End-User authentication",Ta,{claims:p,now:m,tolerance:g,claim:"auth_time"})}if(s===tu){if(p.nonce!==void 0)throw _e('unexpected ID Token "nonce" claim value',mo,{expected:void 0,claims:p,claim:"nonce"})}else if(p.nonce!==s)throw _e('unexpected ID Token "nonce" claim value',mo,{expected:s,claims:p,claim:"nonce"});return h}(e,t,n,o.expectedNonce,o.maxAge,o[Qn],o.recognizedTokenTypes):async function(r,i,a,s,c){const u=await Li(r,i,a,void 0,s,c),d=bd(u);if(d){if(i.default_max_age!==void 0){Yo(i.default_max_age,!0,'"client.default_max_age"');const f=yc()+vc(i),h=wd(i);if(d.auth_time+i.default_max_age<f-h)throw _e("too much time has elapsed since the last End-User authentication",Ta,{claims:d,now:f,tolerance:h,claim:"auth_time"})}if(d.nonce!==void 0)throw _e('unexpected ID Token "nonce" claim value',mo,{expected:void 0,claims:d,claim:"nonce"})}return u}(e,t,n,o==null?void 0:o[Qn],o==null?void 0:o.recognizedTokenTypes)}const H4="OAUTH_WWW_AUTHENTICATE_CHALLENGE",B4="OAUTH_RESPONSE_BODY_ERROR",xd="OAUTH_UNSUPPORTED_OPERATION",W4="OAUTH_AUTHORIZATION_RESPONSE_ERROR",bc="OAUTH_PARSE_ERROR",He="OAUTH_INVALID_RESPONSE",Vw="OAUTH_RESPONSE_IS_NOT_JSON",Xf="OAUTH_RESPONSE_IS_NOT_CONFORM",Gw="OAUTH_HTTP_REQUEST_FORBIDDEN",qw="OAUTH_REQUEST_PROTOCOL_FORBIDDEN",Ta="OAUTH_JWT_TIMESTAMP_CHECK_FAILED",mo="OAUTH_JWT_CLAIM_COMPARISON_FAILED",Sd="OAUTH_JSON_ATTRIBUTE_COMPARISON_FAILED",F4="OAUTH_MISSING_SERVER_METADATA",z4="OAUTH_INVALID_SERVER_METADATA";function Va(e){if(e.bodyUsed)throw qe('"response" body has been used already',Bt)}function mm(e){const{algorithm:t}=e;if(typeof t.modulusLength!="number"||t.modulusLength<2048)throw new dn("unsupported ".concat(t.name," modulusLength"),{cause:e})}function U4(e){const{algorithm:t}=e;switch(t.namedCurve){case"P-256":return"SHA-256";case"P-384":return"SHA-384";case"P-521":return"SHA-512";default:throw new dn("unsupported ECDSA namedCurve",{cause:e})}}async function K4(e){if(e.method!=="POST")throw qe("form_post responses are expected to use the POST method",Bt,{cause:e});if(Uw(e)!=="application/x-www-form-urlencoded")throw qe("form_post responses are expected to use the application/x-www-form-urlencoded content-type",Bt,{cause:e});return async function(t){if(t.bodyUsed)throw qe("form_post Request instances must contain a readable body",Bt,{cause:t});return t.text()}(e)}function V4(e,t,n,o){if(e===void 0)if(Array.isArray(t)){if(!t.includes(o.alg))throw _e('unexpected JWT "alg" header parameter',He,{header:o,expected:t,reason:"authorization server metadata"})}else{if(n===void 0)throw _e('missing client or server configuration to verify used JWT "alg" header parameter',void 0,{client:e,issuer:t,fallback:n});if(typeof n=="string"?o.alg!==n:typeof n=="function"?!n(o.alg):!n.includes(o.alg))throw _e('unexpected JWT "alg" header parameter',He,{header:o,expected:n,reason:"default value"})}else if(typeof e=="string"?o.alg!==e:!e.includes(o.alg))throw _e('unexpected JWT "alg" header parameter',He,{header:o,expected:e,reason:"client configuration"})}function kr(e,t){const{0:n,length:o}=e.getAll(t);if(o>1)throw _e('"'.concat(t,'" parameter must be provided only once'),He);return n}const G4=Symbol(),q4=Symbol();function J4(e,t,n,o){if(Rn(e),Ln(t),n instanceof URL&&(n=n.searchParams),!(n instanceof URLSearchParams))throw qe('"parameters" must be an instance of URLSearchParams, or URL',tn);if(kr(n,"response"))throw _e('"parameters" contains a JARM response, use validateJwtAuthResponse() instead of validateAuthResponse()',He,{parameters:n});const r=kr(n,"iss"),i=kr(n,"state");if(!r&&e.authorization_response_iss_parameter_supported)throw _e('response parameter "iss" (issuer) missing',He,{parameters:n});if(r&&r!==e.issuer)throw _e('unexpected "iss" (issuer) response parameter value',He,{expected:e.issuer,parameters:n});switch(o){case void 0:case q4:if(i!==void 0)throw _e('unexpected "state" response parameter encountered',He,{expected:void 0,parameters:n});break;case G4:break;default:if(vt(o,'"expectedState" argument'),i!==o)throw _e(i===void 0?'response parameter "state" missing':'unexpected "state" response parameter value',He,{expected:o,parameters:n})}if(kr(n,"error"))throw new Fw("authorization response from the server is an error",{cause:n});const a=kr(n,"id_token"),s=kr(n,"token");if(a!==void 0||s!==void 0)throw new dn("implicit and hybrid flows are not supported");return c=new URLSearchParams(n),Yf.add(c),c;var c}async function ul(e){let t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bw;try{t=await e.json()}catch(o){throw n(e),_e('failed to parse "response" body as JSON',bc,o)}if(!gc(t))throw _e('"response" body must be a top level object',He,{body:t});return t}const ou=Symbol(),Jw=Symbol(),gm=new TextEncoder,Na=new TextDecoder;function ru(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)throw new TypeError("non-ASCII string encountered in encode()");t[n]=o}return t}function Zw(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n}function dl(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:Na.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=Na.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{return Zw(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}const _o=function(e){return new TypeError("CryptoKey does not support this operation, its ".concat(arguments.length>1&&arguments[1]!==void 0?arguments[1]:"algorithm.name"," must be ").concat(e))},Yr=(e,t)=>e.name===t;function iu(e,t){var n;if(n=e.hash,parseInt(n.name.slice(4),10)!==t)throw _o("SHA-".concat(t),"algorithm.hash")}function Z4(e,t,n){switch(t){case"HS256":case"HS384":case"HS512":if(!Yr(e.algorithm,"HMAC"))throw _o("HMAC");iu(e.algorithm,parseInt(t.slice(2),10));break;case"RS256":case"RS384":case"RS512":if(!Yr(e.algorithm,"RSASSA-PKCS1-v1_5"))throw _o("RSASSA-PKCS1-v1_5");iu(e.algorithm,parseInt(t.slice(2),10));break;case"PS256":case"PS384":case"PS512":if(!Yr(e.algorithm,"RSA-PSS"))throw _o("RSA-PSS");iu(e.algorithm,parseInt(t.slice(2),10));break;case"Ed25519":case"EdDSA":if(!Yr(e.algorithm,"Ed25519"))throw _o("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":if(!Yr(e.algorithm,t))throw _o(t);break;case"ES256":case"ES384":case"ES512":{if(!Yr(e.algorithm,"ECDSA"))throw _o("ECDSA");const o=function(r){switch(r){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}(t);if(e.algorithm.namedCurve!==o)throw _o(o,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}(function(o,r){if(r&&!o.usages.includes(r))throw new TypeError("CryptoKey does not support this operation, its usages must include ".concat(r,"."))})(e,n)}function Yw(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];if((o=o.filter(Boolean)).length>2){const a=o.pop();e+="one of type ".concat(o.join(", "),", or ").concat(a,".")}else o.length===2?e+="one of type ".concat(o[0]," or ").concat(o[1],"."):e+="of type ".concat(o[0],".");if(t==null)e+=" Received ".concat(t);else if(typeof t=="function"&&t.name)e+=" Received function ".concat(t.name);else if(typeof t=="object"&&t!=null){var i;(i=t.constructor)!==null&&i!==void 0&&i.name&&(e+=" Received an instance of ".concat(t.constructor.name))}return e}const vm=function(e,t){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;r<n;r++)o[r-2]=arguments[r];return Yw("Key for the ".concat(e," algorithm must be "),t,...o)};class Rt extends Error{constructor(t,n){var o;super(t,n),me(this,"code","ERR_JOSE_GENERIC"),this.name=this.constructor.name,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}me(Rt,"code","ERR_JOSE_GENERIC");class En extends Rt{constructor(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(t,{cause:{claim:o,reason:r,payload:n}}),me(this,"code","ERR_JWT_CLAIM_VALIDATION_FAILED"),me(this,"claim",void 0),me(this,"reason",void 0),me(this,"payload",void 0),this.claim=o,this.reason=r,this.payload=n}}me(En,"code","ERR_JWT_CLAIM_VALIDATION_FAILED");class kd extends Rt{constructor(t,n){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"unspecified",r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"unspecified";super(t,{cause:{claim:o,reason:r,payload:n}}),me(this,"code","ERR_JWT_EXPIRED"),me(this,"claim",void 0),me(this,"reason",void 0),me(this,"payload",void 0),this.claim=o,this.reason=r,this.payload=n}}me(kd,"code","ERR_JWT_EXPIRED");class Xw extends Rt{constructor(){super(...arguments),me(this,"code","ERR_JOSE_ALG_NOT_ALLOWED")}}me(Xw,"code","ERR_JOSE_ALG_NOT_ALLOWED");class ln extends Rt{constructor(){super(...arguments),me(this,"code","ERR_JOSE_NOT_SUPPORTED")}}me(ln,"code","ERR_JOSE_NOT_SUPPORTED");me(class extends Rt{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"decryption operation failed",arguments.length>1?arguments[1]:void 0),me(this,"code","ERR_JWE_DECRYPTION_FAILED")}},"code","ERR_JWE_DECRYPTION_FAILED");me(class extends Rt{constructor(){super(...arguments),me(this,"code","ERR_JWE_INVALID")}},"code","ERR_JWE_INVALID");class jt extends Rt{constructor(){super(...arguments),me(this,"code","ERR_JWS_INVALID")}}me(jt,"code","ERR_JWS_INVALID");class Qf extends Rt{constructor(){super(...arguments),me(this,"code","ERR_JWT_INVALID")}}me(Qf,"code","ERR_JWT_INVALID");me(class extends Rt{constructor(){super(...arguments),me(this,"code","ERR_JWK_INVALID")}},"code","ERR_JWK_INVALID");class eh extends Rt{constructor(){super(...arguments),me(this,"code","ERR_JWKS_INVALID")}}me(eh,"code","ERR_JWKS_INVALID");class th extends Rt{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"no applicable key found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),me(this,"code","ERR_JWKS_NO_MATCHING_KEY")}}me(th,"code","ERR_JWKS_NO_MATCHING_KEY");class Qw extends Rt{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"multiple matching keys found in the JSON Web Key Set",arguments.length>1?arguments[1]:void 0),me(this,Symbol.asyncIterator,void 0),me(this,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS")}}me(Qw,"code","ERR_JWKS_MULTIPLE_MATCHING_KEYS");class eb extends Rt{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"request timed out",arguments.length>1?arguments[1]:void 0),me(this,"code","ERR_JWKS_TIMEOUT")}}me(eb,"code","ERR_JWKS_TIMEOUT");class tb extends Rt{constructor(){super(arguments.length>0&&arguments[0]!==void 0?arguments[0]:"signature verification failed",arguments.length>1?arguments[1]:void 0),me(this,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED")}}me(tb,"code","ERR_JWS_SIGNATURE_VERIFICATION_FAILED");const nb=e=>{if((e==null?void 0:e[Symbol.toStringTag])==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},ob=e=>(e==null?void 0:e[Symbol.toStringTag])==="KeyObject",ym=e=>nb(e)||ob(e);function wm(e,t,n){try{return dl(e)}catch{throw new n("Failed to base64url decode the ".concat(t))}}function nr(e){if(typeof(t=e)!="object"||t===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;var t;if(Object.getPrototypeOf(e)===null)return!0;let n=e;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}const Cd=e=>nr(e)&&typeof e.kty=="string";async function Y4(e,t,n){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(function(o){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];return Yw("Key must be ",o,...i)}(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:"SHA-".concat(e.slice(-3)),name:"HMAC"},!1,[n])}return Z4(t,e,n),t}async function X4(e,t,n,o){const r=await Y4(e,t,"verify");(function(a,s){if(a.startsWith("RS")||a.startsWith("PS")){const{modulusLength:c}=s.algorithm;if(typeof c!="number"||c<2048)throw new TypeError("".concat(a," requires key modulusLength to be 2048 bits or larger"))}})(e,r);const i=function(a,s){const c="SHA-".concat(a.slice(-3));switch(a){case"HS256":case"HS384":case"HS512":return{hash:c,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:c,name:"RSA-PSS",saltLength:parseInt(a.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:c,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:c,name:"ECDSA",namedCurve:s.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:a};default:throw new ln("alg ".concat(a," is not supported either by JOSE or your javascript runtime"))}}(e,r.algorithm);try{return await crypto.subtle.verify(i,r,n,o)}catch{return!1}}const vs='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';async function Hs(e){var t,n;if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');const{algorithm:o,keyUsages:r}=function(a){let s,c;switch(a.kty){case"AKP":switch(a.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":s={name:a.alg},c=a.priv?["sign"]:["verify"];break;default:throw new ln(vs)}break;case"RSA":switch(a.alg){case"PS256":case"PS384":case"PS512":s={name:"RSA-PSS",hash:"SHA-".concat(a.alg.slice(-3))},c=a.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":s={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(a.alg.slice(-3))},c=a.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":s={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(a.alg.slice(-3),10)||1)},c=a.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new ln(vs)}break;case"EC":switch(a.alg){case"ES256":case"ES384":case"ES512":s={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[a.alg]},c=a.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":s={name:"ECDH",namedCurve:a.crv},c=a.d?["deriveBits"]:[];break;default:throw new ln(vs)}break;case"OKP":switch(a.alg){case"Ed25519":case"EdDSA":s={name:"Ed25519"},c=a.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":s={name:a.crv},c=a.d?["deriveBits"]:[];break;default:throw new ln(vs)}break;default:throw new ln('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:s,keyUsages:c}}(e),i=xe({},e);return i.kty!=="AKP"&&delete i.alg,delete i.use,crypto.subtle.importKey("jwk",i,o,(t=e.ext)!==null&&t!==void 0?t:!e.d&&!e.priv,(n=e.key_ops)!==null&&n!==void 0?n:r)}const Xr="given KeyObject instance cannot be used for this algorithm";let Uo;const bm=async function(e,t,n){let o=arguments.length>3&&arguments[3]!==void 0&&arguments[3];Uo||(Uo=new WeakMap);let r=Uo.get(e);if(r!=null&&r[n])return r[n];const i=await Hs(xe(xe({},t),{},{alg:n}));return o&&Object.freeze(e),r?r[n]=i:Uo.set(e,{[n]:i}),i};async function Q4(e,t){if(e instanceof Uint8Array||nb(e))return e;if(ob(e)){if(e.type==="secret")return e.export();if("toCryptoKey"in e&&typeof e.toCryptoKey=="function")try{return((o,r)=>{Uo||(Uo=new WeakMap);let i=Uo.get(o);if(i!=null&&i[r])return i[r];const a=o.type==="public",s=!!a;let c;if(o.asymmetricKeyType==="x25519"){switch(r){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError(Xr)}c=o.toCryptoKey(o.asymmetricKeyType,s,a?[]:["deriveBits"])}if(o.asymmetricKeyType==="ed25519"){if(r!=="EdDSA"&&r!=="Ed25519")throw new TypeError(Xr);c=o.toCryptoKey(o.asymmetricKeyType,s,[a?"verify":"sign"])}switch(o.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(r!==o.asymmetricKeyType.toUpperCase())throw new TypeError(Xr);c=o.toCryptoKey(o.asymmetricKeyType,s,[a?"verify":"sign"])}if(o.asymmetricKeyType==="rsa"){let d;switch(r){case"RSA-OAEP":d="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":d="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":d="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":d="SHA-512";break;default:throw new TypeError(Xr)}if(r.startsWith("RSA-OAEP"))return o.toCryptoKey({name:"RSA-OAEP",hash:d},s,a?["encrypt"]:["decrypt"]);c=o.toCryptoKey({name:r.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:d},s,[a?"verify":"sign"])}if(o.asymmetricKeyType==="ec"){var u;const d=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get((u=o.asymmetricKeyDetails)===null||u===void 0?void 0:u.namedCurve);if(!d)throw new TypeError(Xr);const f={ES256:"P-256",ES384:"P-384",ES512:"P-521"};f[r]&&d===f[r]&&(c=o.toCryptoKey({name:"ECDSA",namedCurve:d},s,[a?"verify":"sign"])),r.startsWith("ECDH-ES")&&(c=o.toCryptoKey({name:"ECDH",namedCurve:d},s,a?[]:["deriveBits"]))}if(!c)throw new TypeError(Xr);return i?i[r]=c:Uo.set(o,{[r]:c}),c})(e,t)}catch(o){if(o instanceof TypeError)throw o}let n=e.export({format:"jwk"});return bm(e,n,t)}if(Cd(e))return e.k?dl(e.k):bm(e,e,t,!0);throw new Error("unreachable")}const au=(e,t)=>{if(e.byteLength!==t.length)return!1;for(let n=0;n<e.byteLength;n++)if(e[n]!==t[n])return!1;return!0},ma=e=>{const t=e.data[e.pos++];if(128&t){const n=127&t;let o=0;for(let r=0;r<n;r++)o=o<<8|e.data[e.pos++];return o}return t},ga=(e,t,n)=>{if(e.data[e.pos++]!==t)throw new Error(n)},xm=(e,t)=>{const n=e.data.subarray(e.pos,e.pos+t);return e.pos+=t,n},ej=e=>{const t=(r=>{ga(r,6,"Expected algorithm OID");const i=ma(r);return xm(r,i)})(e);if(au(t,[43,101,110]))return"X25519";if(!au(t,[42,134,72,206,61,2,1]))throw new Error("Unsupported key algorithm");ga(e,6,"Expected curve OID");const n=ma(e),o=xm(e,n);for(const{name:r,oid:i}of[{name:"P-256",oid:[42,134,72,206,61,3,1,7]},{name:"P-384",oid:[43,129,4,0,34]},{name:"P-521",oid:[43,129,4,0,35]}])if(au(o,i))return r;throw new Error("Unsupported named curve")},tj=async(e,t,n,o)=>{var r;let i,a;const s=e==="spki",c=()=>s?["verify"]:["sign"];switch(n){case"PS256":case"PS384":case"PS512":i={name:"RSA-PSS",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RS256":case"RS384":case"RS512":i={name:"RSASSA-PKCS1-v1_5",hash:"SHA-".concat(n.slice(-3))},a=c();break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":i={name:"RSA-OAEP",hash:"SHA-".concat(parseInt(n.slice(-3),10)||1)},a=s?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":case"ES384":case"ES512":i={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[n]},a=c();break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":try{const u=o.getNamedCurve(t);i=u==="X25519"?{name:"X25519"}:{name:"ECDH",namedCurve:u}}catch{throw new ln("Invalid or unsupported key format")}a=s?[]:["deriveBits"];break;case"Ed25519":case"EdDSA":i={name:"Ed25519"},a=c();break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":i={name:n},a=c();break;default:throw new ln('Invalid or unsupported "alg" (Algorithm) value')}return crypto.subtle.importKey(e,t,i,(r=o==null?void 0:o.extractable)!==null&&r!==void 0?r:!!s,a)},nj=(e,t,n)=>{var o;const r=((a,s)=>Zw(a.replace(s,"")))(e,/(?:-----(?:BEGIN|END) PRIVATE KEY-----|\s)/g);let i=n;return t!=null&&(o=t.startsWith)!==null&&o!==void 0&&o.call(t,"ECDH-ES")&&(i||(i={}),i.getNamedCurve=a=>{const s={data:a,pos:0};return function(c){ga(c,48,"Invalid PKCS#8 structure"),ma(c),ga(c,2,"Expected version field");const u=ma(c);c.pos+=u,ga(c,48,"Expected algorithm identifier"),ma(c),c.pos}(s),ej(s)}),tj("pkcs8",r,t,i)},Qr=e=>e==null?void 0:e[Symbol.toStringTag],su=(e,t,n)=>{if(t.use!==void 0){let i;switch(n){case"sign":case"verify":i="sig";break;case"encrypt":case"decrypt":i="enc"}if(t.use!==i)throw new TypeError('Invalid key for this operation, its "use" must be "'.concat(i,'" when present'))}if(t.alg!==void 0&&t.alg!==e)throw new TypeError('Invalid key for this operation, its "alg" must be "'.concat(e,'" when present'));if(Array.isArray(t.key_ops)){var o,r;let i;switch(!0){case(n==="sign"||n==="verify"):case e==="dir":case e.includes("CBC-HS"):i=n;break;case e.startsWith("PBES2"):i="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):i=!e.includes("GCM")&&e.endsWith("KW")?n==="encrypt"?"wrapKey":"unwrapKey":n;break;case(n==="encrypt"&&e.startsWith("RSA")):i="wrapKey";break;case n==="decrypt":i=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(i&&((o=t.key_ops)===null||o===void 0||(r=o.includes)===null||r===void 0?void 0:r.call(o,i))===!1)throw new TypeError('Invalid key for this operation, its "key_ops" must include "'.concat(i,'" when present'))}return!0};function oj(e,t,n){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":((o,r,i)=>{if(!(r instanceof Uint8Array)){if(Cd(r)){if((a=>a.kty==="oct"&&typeof a.k=="string")(r)&&su(o,r,i))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!ym(r))throw new TypeError(vm(o,r,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(r.type!=="secret")throw new TypeError("".concat(Qr(r),' instances for symmetric algorithms must be of type "secret"'))}})(e,t,n);break;default:((o,r,i)=>{if(Cd(r))switch(i){case"decrypt":case"sign":if((a=>a.kty!=="oct"&&(a.kty==="AKP"&&typeof a.priv=="string"||typeof a.d=="string"))(r)&&su(o,r,i))return;throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if((a=>a.kty!=="oct"&&a.d===void 0&&a.priv===void 0)(r)&&su(o,r,i))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!ym(r))throw new TypeError(vm(o,r,"CryptoKey","KeyObject","JSON Web Key"));if(r.type==="secret")throw new TypeError("".concat(Qr(r),' instances for asymmetric algorithms must not be of type "secret"'));if(r.type==="public")switch(i){case"sign":throw new TypeError("".concat(Qr(r),' instances for asymmetric algorithm signing must be of type "private"'));case"decrypt":throw new TypeError("".concat(Qr(r),' instances for asymmetric algorithm decryption must be of type "private"'))}if(r.type==="private")switch(i){case"verify":throw new TypeError("".concat(Qr(r),' instances for asymmetric algorithm verifying must be of type "public"'));case"encrypt":throw new TypeError("".concat(Qr(r),' instances for asymmetric algorithm encryption must be of type "public"'))}})(e,t,n)}}var ys,cu;let eo,Sm;if(typeof navigator>"u"||(ys=navigator.userAgent)===null||ys===void 0||(cu=ys.startsWith)===null||cu===void 0||!cu.call(ys,"Mozilla/5.0 ")){const e="v6.8.2";Sm="".concat("openid-client","/").concat(e),eo={"user-agent":Sm}}const Tt=e=>Bs.get(e);let Bs,ws;function rb(e){return e!==void 0?fm(e):(ws||(ws=new WeakMap),(t,n,o,r)=>{let i;return(i=ws.get(n))||(function(a,s){if(typeof a!="string")throw to("".concat(s," must be a string"),qa);if(a.length===0)throw to("".concat(s," must not be empty"),Ga)}(n.client_secret,'"metadata.client_secret"'),i=fm(n.client_secret),ws.set(n,i)),i(t,n,o,r)})}const ho=Hn,Ga="ERR_INVALID_ARG_VALUE",qa="ERR_INVALID_ARG_TYPE";function to(e,t,n){const o=new TypeError(e,{cause:n});return Object.assign(o,{code:t}),o}function rj(e){return async function(t){return vt(t,"codeVerifier"),Rr(await crypto.subtle.digest("SHA-256",wi(t)))}(e)}function ij(){return Ww()}class xc extends Error{constructor(t,n){var o;super(t,n),me(this,"code",void 0),this.name=this.constructor.name,this.code=n==null?void 0:n.code,(o=Error.captureStackTrace)===null||o===void 0||o.call(Error,this,this.constructor)}}function Ft(e,t,n){return new xc(e,{cause:t,code:n})}function Ut(e){if(e instanceof TypeError||e instanceof xc||e instanceof ll||e instanceof Fw||e instanceof qf)throw e;if(e instanceof Vf)switch(e.code){case Gw:throw Ft("only requests to HTTPS are allowed",e,e.code);case qw:throw Ft("only requests to HTTP or HTTPS are allowed",e,e.code);case Xf:throw Ft("unexpected HTTP response status code",e.cause,e.code);case Vw:throw Ft("unexpected response content-type",e.cause,e.code);case bc:throw Ft("parsing error occured",e,e.code);case He:throw Ft("invalid response encountered",e,e.code);case mo:throw Ft("unexpected JWT claim value encountered",e,e.code);case Sd:throw Ft("unexpected JSON attribute value encountered",e,e.code);case Ta:throw Ft("JWT timestamp claim value failed validation",e,e.code);default:throw Ft(e.message,e,e.code)}if(e instanceof dn)throw Ft("unsupported operation",e,e.code);if(e instanceof DOMException)switch(e.name){case"OperationError":throw Ft("runtime operation error",e,xd);case"NotSupportedError":throw Ft("runtime unsupported operation",e,xd);case"TimeoutError":throw Ft("operation timed out",e,"OAUTH_TIMEOUT");case"AbortError":throw Ft("operation aborted",e,"OAUTH_ABORT")}throw new xc("something went wrong",{cause:e})}async function aj(e,t,n,o,r){const i=await async function(c,u){var d,f;if(!(c instanceof URL))throw to('"server" must be an instance of URL',qa);const h=!c.href.includes("/.well-known/"),p=(d=u==null?void 0:u.timeout)!==null&&d!==void 0?d:30,m=AbortSignal.timeout(1e3*p),g=await(h?k4(c,{algorithm:u==null?void 0:u.algorithm,[Hn]:u==null?void 0:u[ho],[kn]:u==null||(f=u.execute)===null||f===void 0?void 0:f.includes(Em),signal:m,headers:new Headers(eo)}):((u==null?void 0:u[ho])||fetch)((Gf(c,u==null||(y=u.execute)===null||y===void 0||!y.includes(Em)),c.href),{headers:Object.fromEntries(new Headers(xe({accept:"application/json"},eo)).entries()),body:void 0,method:"GET",redirect:"manual",signal:m})).then(w=>async function(S,b){const k=S;if(!(k instanceof URL)&&k!==ou)throw qe('"expectedIssuerIdentifier" must be an instance of URL',tn);if(!zi(b,Response))throw qe('"response" must be an instance of Response',tn);if(b.status!==200)throw _e('"response" is not a conform Authorization Server Metadata response (unexpected HTTP status code)',Xf,b);Va(b);const x=await ul(b);if(vt(x.issuer,'"response" body "issuer" property',He,{body:x}),k!==ou&&new URL(x.issuer).href!==k.href)throw _e('"response" body "issuer" property does not match the expected value',Sd,{expected:k.href,body:x,attribute:"issuer"});return x}(ou,w)).catch(Ut);var y;return h&&new URL(g.issuer).href!==c.href&&(function(w,S,b){return!(w.origin!=="https://login.microsoftonline.com"||b!=null&&b.algorithm&&b.algorithm!=="oidc"||(S[ib]=!0,0))}(c,g,u)||function(w,S){return!(!w.hostname.endsWith(".b2clogin.com")||S!=null&&S.algorithm&&S.algorithm!=="oidc")}(c,u)||(()=>{throw new xc("discovered metadata issuer does not match the expected issuer",{code:Sd,cause:{expected:c.href,body:g,attribute:"issuer"}})})()),g}(e,r),a=new Ia(i,t,n,o);let s=Tt(a);if(r!=null&&r[ho]&&(s.fetch=r[ho]),r!=null&&r.timeout&&(s.timeout=r.timeout),r!=null&&r.execute)for(const c of r.execute)c(a);return a}new TextDecoder;const ib=Symbol();class Ia{constructor(t,n,o,r){var i,a,s,c,u;if(typeof n!="string"||!n.length)throw to('"clientId" must be a non-empty string',qa);if(typeof o=="string"&&(o={client_secret:o}),((i=o)===null||i===void 0?void 0:i.client_id)!==void 0&&n!==o.client_id)throw to('"clientId" and "metadata.client_id" must be the same',Ga);const d=xe(xe({},structuredClone(o)),{},{client_id:n});let f;d[gd]=(a=(s=o)===null||s===void 0?void 0:s[gd])!==null&&a!==void 0?a:0,d[vd]=(c=(u=o)===null||u===void 0?void 0:u[vd])!==null&&c!==void 0?c:30,f=r||(typeof d.client_secret=="string"&&d.client_secret.length?rb(d.client_secret):(g,y,w,S)=>{w.set("client_id",y.client_id)});let h=Object.freeze(d);const p=structuredClone(t);ib in t&&(p[Jw]=g=>{let{claims:{tid:y}}=g;return t.issuer.replace("{tenantid}",y)});let m=Object.freeze(p);Bs||(Bs=new WeakMap),Bs.set(this,{__proto__:null,as:m,c:h,auth:f,tlsOnly:!0,jwksCache:{}})}serverMetadata(){const t=structuredClone(Tt(this).as);return function(n){Object.defineProperties(n,function(o){return{supportsPKCE:{__proto__:null,value(){var r;let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"S256";return((r=o.code_challenge_methods_supported)===null||r===void 0?void 0:r.includes(i))===!0}}}}(n))}(t),t}clientMetadata(){return structuredClone(Tt(this).c)}get timeout(){return Tt(this).timeout}set timeout(t){Tt(this).timeout=t}get[ho](){return Tt(this).fetch}set[ho](t){Tt(this).fetch=t}}function Ja(e){Object.defineProperties(e,function(t){let n;if(t.expires_in!==void 0){const o=new Date;o.setSeconds(o.getSeconds()+t.expires_in),n=o.getTime()}return{expiresIn:{__proto__:null,value(){if(n){const o=Date.now();return n>o?Math.floor((n-o)/1e3):0}}},claims:{__proto__:null,value(){try{return bd(this)}catch{return}}}}}(e))}async function km(e,t,n){var o;let r=arguments.length>3&&arguments[3]!==void 0&&arguments[3];const i=(o=e.headers.get("retry-after"))===null||o===void 0?void 0:o.trim();if(i===void 0)return;let a;if(/^\d+$/.test(i))a=parseInt(i,10);else{const s=new Date(i);if(Number.isFinite(s.getTime())){const c=new Date,u=s.getTime()-c.getTime();u>0&&(a=Math.ceil(u/1e3))}}if(r&&!Number.isFinite(a))throw new Vf("invalid Retry-After header value",{cause:e});a>t&&await ab(a-t,n)}function ab(e,t){return new Promise((n,o)=>{const r=i=>{try{t.throwIfAborted()}catch(s){return void o(s)}if(i<=0)return void n();const a=Math.min(i,5);setTimeout(()=>r(i-a),1e3*a)};r(e)})}async function Cm(e,t){bo(e);const{as:n,c:o,auth:r,fetch:i,tlsOnly:a,timeout:s}=Tt(e);return async function(c,u,d,f,h){Rn(c),Ln(u);const p=Ua(c,"backchannel_authentication_endpoint",u.use_mtls_endpoint_aliases,(h==null?void 0:h[kn])!==!0),m=new URLSearchParams(f);m.set("client_id",u.client_id);const g=cl(h==null?void 0:h.headers);return g.set("accept","application/json"),Zf(c,u,d,p,m,g,h)}(n,o,r,t,{[Hn]:i,[kn]:!a,headers:new Headers(eo),signal:zr(s)}).then(c=>async function(u,d,f){if(Rn(u),Ln(d),!zi(f,Response))throw qe('"response" must be an instance of Response',tn);await Jf(f,200,"Backchannel Authentication Endpoint"),Va(f);const h=await ul(f);vt(h.auth_req_id,'"response" body "auth_req_id" property',He,{body:h});let p=typeof h.expires_in!="number"?parseFloat(h.expires_in):h.expires_in;return Yo(p,!0,'"response" body "expires_in" property',He,{body:h}),h.expires_in=p,h.interval!==void 0&&Yo(h.interval,!1,'"response" body "interval" property',He,{body:h}),h}(n,o,c)).catch(Ut)}async function sb(e,t,n,o){var r,i;bo(e),n=new URLSearchParams(n);let a=(r=t.interval)!==null&&r!==void 0?r:5;const s=(i=o==null?void 0:o.signal)!==null&&i!==void 0?i:AbortSignal.timeout(1e3*t.expires_in);try{await ab(a,s)}catch(x){Ut(x)}const{as:c,c:u,auth:d,fetch:f,tlsOnly:h,nonRepudiation:p,timeout:m,decrypt:g}=Tt(e),y=(x,C)=>sb(e,xe(xe({},t),{},{interval:x}),n,xe(xe({},o),{},{signal:s,flag:C})),w=await async function(x,C,I,R,M){Rn(x),Ln(C),vt(R,'"authReqId"');const _=new URLSearchParams(M==null?void 0:M.additionalParameters);return _.set("auth_req_id",R),Ka(x,C,I,"urn:openid:params:grant-type:ciba",_,M)}(c,u,d,t.auth_req_id,{[Hn]:f,[kn]:!h,additionalParameters:n,DPoP:o==null?void 0:o.DPoP,headers:new Headers(eo),signal:s.aborted?s:zr(m)}).catch(Ut);var S;if(w.status===503&&w.headers.has("retry-after"))return await km(w,a,s,!0),await((S=w.body)===null||S===void 0?void 0:S.cancel()),y(a);const b=async function(x,C,I,R){return Li(x,C,I,void 0,R==null?void 0:R[Qn],R==null?void 0:R.recognizedTokenTypes)}(c,u,w,{[Qn]:g});let k;try{k=await b}catch(x){if(Za(x,o))return y(a,Xo);if(x instanceof ll)switch(x.error){case"slow_down":a+=5;case"authorization_pending":return await km(x.response,a,s),y(a)}Ut(x)}return k.id_token&&await(p==null?void 0:p(w)),Ja(k),k}function Em(e){Tt(e).tlsOnly=!1}async function cb(e,t,n,o,r){if(bo(e),!((r==null?void 0:r.flag)===Xo||t instanceof URL||function(x,C){try{return Object.getPrototypeOf(x)[Symbol.toStringTag]===C}catch{return!1}}(t,"Request")))throw to('"currentUrl" must be an instance of URL, or Request',qa);let i,a;const{as:s,c,auth:u,fetch:d,tlsOnly:f,jarm:h,hybrid:p,nonRepudiation:m,timeout:g,decrypt:y,implicit:w}=Tt(e);if((r==null?void 0:r.flag)===Xo)i=r.authResponse,a=r.redirectUri;else{if(!(t instanceof URL)){const x=t;switch(t=new URL(t.url),x.method){case"GET":break;case"POST":const C=new URLSearchParams(await K4(x));if(p)t.hash=C.toString();else for(const[I,R]of C.entries())t.searchParams.append(I,R);break;default:throw to("unexpected Request HTTP method",Ga)}}switch(a=function(x){return(x=new URL(x)).search="",x.hash="",x.href}(t),!0){case!!h:i=await h(t,n==null?void 0:n.expectedState);break;case!!p:i=await p(t,n==null?void 0:n.expectedNonce,n==null?void 0:n.expectedState,n==null?void 0:n.maxAge);break;case!!w:throw new TypeError("authorizationCodeGrant() cannot be used by response_type=id_token clients");default:try{i=J4(s,c,t.searchParams,n==null?void 0:n.expectedState)}catch(x){Ut(x)}}}const S=await async function(x,C,I,R,M,_,T){if(Rn(x),Ln(C),!Yf.has(R))throw qe('"callbackParameters" must be an instance of URLSearchParams obtained from "validateAuthResponse()", or "validateJwtAuthResponse()',Bt);vt(M,'"redirectUri"');const P=kr(R,"code");if(!P)throw _e('no authorization code in "callbackParameters"',He);const X=new URLSearchParams(T==null?void 0:T.additionalParameters);return X.set("redirect_uri",M),X.set("code",P),_!==pm&&(vt(_,'"codeVerifier"'),X.set("code_verifier",_)),Ka(x,C,I,"authorization_code",X,T)}(s,c,u,i,a,(n==null?void 0:n.pkceCodeVerifier)||pm,{additionalParameters:o,[Hn]:d,[kn]:!f,DPoP:r==null?void 0:r.DPoP,headers:new Headers(eo),signal:zr(g)}).catch(Ut);typeof(n==null?void 0:n.expectedNonce)!="string"&&typeof(n==null?void 0:n.maxAge)!="number"||(n.idTokenExpected=!0);const b=$4(s,c,S,{expectedNonce:n==null?void 0:n.expectedNonce,maxAge:n==null?void 0:n.maxAge,requireIdToken:n==null?void 0:n.idTokenExpected,[Qn]:y});let k;try{k=await b}catch(x){if(Za(x,r))return cb(e,void 0,n,o,xe(xe({},r),{},{flag:Xo,authResponse:i,redirectUri:a}));Ut(x)}return k.id_token&&await(m==null?void 0:m(S)),Ja(k),k}async function lb(e,t,n,o){bo(e),n=new URLSearchParams(n);const{as:r,c:i,auth:a,fetch:s,tlsOnly:c,nonRepudiation:u,timeout:d,decrypt:f}=Tt(e),h=await async function(g,y,w,S,b){Rn(g),Ln(y),vt(S,'"refreshToken"');const k=new URLSearchParams(b==null?void 0:b.additionalParameters);return k.set("refresh_token",S),Ka(g,y,w,"refresh_token",k,b)}(r,i,a,t,{[Hn]:s,[kn]:!c,additionalParameters:n,DPoP:o==null?void 0:o.DPoP,headers:new Headers(eo),signal:zr(d)}).catch(Ut),p=async function(g,y,w,S){return Li(g,y,w,void 0,S==null?void 0:S[Qn],S==null?void 0:S.recognizedTokenTypes)}(r,i,h,{[Qn]:f});let m;try{m=await p}catch(g){if(Za(g,o))return lb(e,t,n,xe(xe({},o),{},{flag:Xo}));Ut(g)}return m.id_token&&await(u==null?void 0:u(h)),Ja(m),m}async function ub(e,t,n){bo(e),t=new URLSearchParams(t);const{as:o,c:r,auth:i,fetch:a,tlsOnly:s,timeout:c}=Tt(e),u=await async function(h,p,m,g,y){return Rn(h),Ln(p),Ka(h,p,m,"client_credentials",new URLSearchParams(g),y)}(o,r,i,t,{[Hn]:a,[kn]:!s,DPoP:n==null?void 0:n.DPoP,headers:new Headers(eo),signal:zr(c)}).catch(Ut),d=async function(h,p,m,g){return Li(h,p,m,void 0,g==null?void 0:g[Qn],g==null?void 0:g.recognizedTokenTypes)}(o,r,u);let f;try{f=await d}catch(h){if(Za(h,n))return ub(e,t,xe(xe({},n),{},{flag:Xo}));Ut(h)}return Ja(f),f}function Ed(e,t){bo(e);const{as:n,c:o,tlsOnly:r,hybrid:i,jarm:a,implicit:s}=Tt(e),c=Ua(n,"authorization_endpoint",!1,r);if((t=new URLSearchParams(t)).has("client_id")||t.set("client_id",o.client_id),!t.has("request_uri")&&!t.has("request")){if(t.has("response_type")||t.set("response_type",i?"code id_token":s?"id_token":"code"),s&&!t.has("nonce"))throw to("response_type=id_token clients must provide a nonce parameter in their authorization request parameters",Ga);a&&t.set("response_mode","jwt")}for(const[u,d]of t.entries())c.searchParams.append(u,d);return c}async function db(e,t,n){bo(e);const o=Ed(e,t),{as:r,c:i,auth:a,fetch:s,tlsOnly:c,timeout:u}=Tt(e),d=await async function(p,m,g,y,w){var S;Rn(p),Ln(m);const b=Ua(p,"pushed_authorization_request_endpoint",m.use_mtls_endpoint_aliases,(w==null?void 0:w[kn])!==!0),k=new URLSearchParams(y);k.set("client_id",m.client_id);const x=cl(w==null?void 0:w.headers);x.set("accept","application/json"),(w==null?void 0:w.DPoP)!==void 0&&(zw(w.DPoP),await w.DPoP.addProof(b,x,"POST"));const C=await Zf(p,m,g,b,k,x,w);return w==null||(S=w.DPoP)===null||S===void 0||S.cacheNonce(C,b),C}(r,i,a,o.searchParams,{[Hn]:s,[kn]:!c,DPoP:n==null?void 0:n.DPoP,headers:new Headers(eo),signal:zr(u)}).catch(Ut),f=async function(p,m,g){if(Rn(p),Ln(m),!zi(g,Response))throw qe('"response" must be an instance of Response',tn);await Jf(g,201,"Pushed Authorization Request Endpoint"),Va(g);const y=await ul(g);vt(y.request_uri,'"response" body "request_uri" property',He,{body:y});let w=typeof y.expires_in!="number"?parseFloat(y.expires_in):y.expires_in;return Yo(w,!0,'"response" body "expires_in" property',He,{body:y}),y.expires_in=w,y}(r,i,d);let h;try{h=await f}catch(p){if(Za(p,n))return db(e,t,xe(xe({},n),{},{flag:Xo}));Ut(p)}return Ed(e,{request_uri:h.request_uri})}function bo(e){if(!(e instanceof Ia))throw to('"config" must be an instance of Configuration',qa);if(Object.getPrototypeOf(e)!==Ia.prototype)throw to("subclassing Configuration is not allowed",Ga)}function zr(e){return e?AbortSignal.timeout(1e3*e):void 0}function Za(e,t){return!(t==null||!t.DPoP||t.flag===Xo)&&function(n){if(n instanceof qf){const{0:o,length:r}=n.cause;return r===1&&o.scheme==="dpop"&&o.parameters.error==="use_dpop_nonce"}return n instanceof ll&&n.error==="use_dpop_nonce"}(e)}Object.freeze(Ia.prototype);const Xo=Symbol();async function nh(e,t,n,o){bo(e);const{as:r,c:i,auth:a,fetch:s,tlsOnly:c,timeout:u,decrypt:d}=Tt(e),f=await async function(h,p,m,g,y,w){return Rn(h),Ln(p),vt(g,'"grantType"'),Ka(h,p,m,g,new URLSearchParams(y),w)}(r,i,a,t,new URLSearchParams(n),{[Hn]:s,[kn]:!c,DPoP:o==null?void 0:o.DPoP,headers:new Headers(eo),signal:zr(u)}).then(h=>{let p;return t==="urn:ietf:params:oauth:grant-type:token-exchange"&&(p={n_a:()=>{}}),async function(m,g,y,w){return Li(m,g,y,void 0,w==null?void 0:w[Qn],w==null?void 0:w.recognizedTokenTypes)}(r,i,h,{[Qn]:d,recognizedTokenTypes:p})}).catch(Ut);return Ja(f),f}async function sj(e,t,n){if(!nr(e))throw new jt("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new jt('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new jt("JWS Protected Header incorrect type");if(e.payload===void 0)throw new jt("JWS Payload missing");if(typeof e.signature!="string")throw new jt("JWS Signature missing or incorrect type");if(e.header!==void 0&&!nr(e.header))throw new jt("JWS Unprotected Header incorrect type");let o={};if(e.protected)try{const g=dl(e.protected);o=JSON.parse(Na.decode(g))}catch{throw new jt("JWS Protected Header is invalid")}if(!function(){for(var g=arguments.length,y=new Array(g),w=0;w<g;w++)y[w]=arguments[w];const S=y.filter(Boolean);if(S.length===0||S.length===1)return!0;let b;for(const k of S){const x=Object.keys(k);if(b&&b.size!==0)for(const C of x){if(b.has(C))return!1;b.add(C)}else b=new Set(x)}return!0}(o,e.header))throw new jt("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const r=xe(xe({},o),e.header),i=function(g,y,w,S,b){if(b.crit!==void 0&&(S==null?void 0:S.crit)===void 0)throw new g('"crit" (Critical) Header Parameter MUST be integrity protected');if(!S||S.crit===void 0)return new Set;if(!Array.isArray(S.crit)||S.crit.length===0||S.crit.some(x=>typeof x!="string"||x.length===0))throw new g('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let k;k=w!==void 0?new Map([...Object.entries(w),...y.entries()]):y;for(const x of S.crit){if(!k.has(x))throw new ln('Extension Header Parameter "'.concat(x,'" is not recognized'));if(b[x]===void 0)throw new g('Extension Header Parameter "'.concat(x,'" is missing'));if(k.get(x)&&S[x]===void 0)throw new g('Extension Header Parameter "'.concat(x,'" MUST be integrity protected'))}return new Set(S.crit)}(jt,new Map([["b64",!0]]),n==null?void 0:n.crit,o,r);let a=!0;if(i.has("b64")&&(a=o.b64,typeof a!="boolean"))throw new jt('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:s}=r;if(typeof s!="string"||!s)throw new jt('JWS "alg" (Algorithm) Header Parameter missing or invalid');const c=n&&function(g,y){if(y!==void 0&&(!Array.isArray(y)||y.some(w=>typeof w!="string")))throw new TypeError('"'.concat(g,'" option must be an array of strings'));if(y)return new Set(y)}("algorithms",n.algorithms);if(c&&!c.has(s))throw new Xw('"alg" (Algorithm) Header Parameter value not allowed');if(a){if(typeof e.payload!="string")throw new jt("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new jt("JWS Payload must be a string or an Uint8Array instance");let u=!1;typeof t=="function"&&(t=await t(o,e),u=!0),oj(s,t,"verify");const d=function(){for(var g=arguments.length,y=new Array(g),w=0;w<g;w++)y[w]=arguments[w];const S=y.reduce((x,C)=>{let{length:I}=C;return x+I},0),b=new Uint8Array(S);let k=0;for(const x of y)b.set(x,k),k+=x.length;return b}(e.protected!==void 0?ru(e.protected):new Uint8Array,ru("."),typeof e.payload=="string"?a?ru(e.payload):gm.encode(e.payload):e.payload),f=wm(e.signature,"signature",jt),h=await Q4(t,s);if(!await X4(s,h,f,d))throw new tb;let p;p=a?wm(e.payload,"payload",jt):typeof e.payload=="string"?gm.encode(e.payload):e.payload;const m={payload:p};return e.protected!==void 0&&(m.protectedHeader=o),e.header!==void 0&&(m.unprotectedHeader=e.header),u?xe(xe({},m),{},{key:h}):m}const cj=86400,lj=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function jm(e){const t=lj.exec(e);if(!t||t[4]&&t[1])throw new TypeError("Invalid time period format");const n=parseFloat(t[2]);let o;switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":o=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":o=Math.round(60*n);break;case"hour":case"hours":case"hr":case"hrs":case"h":o=Math.round(3600*n);break;case"day":case"days":case"d":o=Math.round(n*cj);break;case"week":case"weeks":case"w":o=Math.round(604800*n);break;default:o=Math.round(31557600*n)}return t[1]==="-"||t[4]==="ago"?-o:o}const Am=e=>e.includes("/")?e.toLowerCase():"application/".concat(e.toLowerCase());function uj(e,t){let n,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};try{n=JSON.parse(Na.decode(t))}catch{}if(!nr(n))throw new Qf("JWT Claims Set must be a top-level JSON object");const{typ:r}=o;if(r&&(typeof e.typ!="string"||Am(e.typ)!==Am(r)))throw new En('unexpected "typ" JWT header value',n,"typ","check_failed");const{requiredClaims:i=[],issuer:a,subject:s,audience:c,maxTokenAge:u}=o,d=[...i];u!==void 0&&d.push("iat"),c!==void 0&&d.push("aud"),s!==void 0&&d.push("sub"),a!==void 0&&d.push("iss");for(const w of new Set(d.reverse()))if(!(w in n))throw new En('missing required "'.concat(w,'" claim'),n,w,"missing");if(a&&!(Array.isArray(a)?a:[a]).includes(n.iss))throw new En('unexpected "iss" claim value',n,"iss","check_failed");if(s&&n.sub!==s)throw new En('unexpected "sub" claim value',n,"sub","check_failed");if(c&&(f=n.aud,h=typeof c=="string"?[c]:c,!(typeof f=="string"?h.includes(f):Array.isArray(f)&&h.some(Set.prototype.has.bind(new Set(f))))))throw new En('unexpected "aud" claim value',n,"aud","check_failed");var f,h;let p;switch(typeof o.clockTolerance){case"string":p=jm(o.clockTolerance);break;case"number":p=o.clockTolerance;break;case"undefined":p=0;break;default:throw new TypeError("Invalid clockTolerance option type")}const{currentDate:m}=o,g=(y=m||new Date,Math.floor(y.getTime()/1e3));var y;if((n.iat!==void 0||u)&&typeof n.iat!="number")throw new En('"iat" claim must be a number',n,"iat","invalid");if(n.nbf!==void 0){if(typeof n.nbf!="number")throw new En('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>g+p)throw new En('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(n.exp!==void 0){if(typeof n.exp!="number")throw new En('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=g-p)throw new kd('"exp" claim timestamp check failed',n,"exp","check_failed")}if(u){const w=g-n.iat;if(w-p>(typeof u=="number"?u:jm(u)))throw new kd('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(w<0-p)throw new En('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n}async function dj(e,t,n){var o;const r=await async function(a,s,c){if(a instanceof Uint8Array&&(a=Na.decode(a)),typeof a!="string")throw new jt("Compact JWS must be a string or Uint8Array");const{0:u,1:d,2:f,length:h}=a.split(".");if(h!==3)throw new jt("Invalid Compact JWS");const p=await sj({payload:d,protected:u,signature:f},s,c),m={payload:p.payload,protectedHeader:p.protectedHeader};return typeof s=="function"?xe(xe({},m),{},{key:p.key}):m}(e,t,n);if((o=r.protectedHeader.crit)!==null&&o!==void 0&&o.includes("b64")&&r.protectedHeader.b64===!1)throw new Qf("JWTs MUST NOT use unencoded payload");const i={payload:uj(r.protectedHeader,r.payload,n),protectedHeader:r.protectedHeader};return typeof t=="function"?xe(xe({},i),{},{key:r.key}):i}function fj(e){return nr(e)}var bs,lu,xs=new WeakMap,uu=new WeakMap;class hj{constructor(t){if(Qe(this,xs,void 0),Qe(this,uu,new WeakMap),!function(n){return n&&typeof n=="object"&&Array.isArray(n.keys)&&n.keys.every(fj)}(t))throw new eh("JSON Web Key Set malformed");$e(xs,this,structuredClone(t))}jwks(){return ne(xs,this)}async getKey(t,n){const{alg:o,kid:r}=xe(xe({},t),n==null?void 0:n.header),i=function(u){switch(typeof u=="string"&&u.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new ln('Unsupported "alg" value for a JSON Web Key Set')}}(o),a=ne(xs,this).keys.filter(u=>{let d=i===u.kty;if(d&&typeof r=="string"&&(d=r===u.kid),!d||typeof u.alg!="string"&&i!=="AKP"||(d=o===u.alg),d&&typeof u.use=="string"&&(d=u.use==="sig"),d&&Array.isArray(u.key_ops)&&(d=u.key_ops.includes("verify")),d)switch(o){case"ES256":d=u.crv==="P-256";break;case"ES384":d=u.crv==="P-384";break;case"ES512":d=u.crv==="P-521";break;case"Ed25519":case"EdDSA":d=u.crv==="Ed25519"}return d}),{0:s,length:c}=a;if(c===0)throw new th;if(c!==1){const u=new Qw,d=ne(uu,this);throw u[Symbol.asyncIterator]=y4(function*(){for(const f of a)try{yield yield v4(Om(d,f,o))}catch{}}),u}return Om(ne(uu,this),s,o)}}async function Om(e,t,n){const o=e.get(t)||e.set(t,{}).get(t);if(o[n]===void 0){const r=await async function(i,a,s){var c;if(!nr(i))throw new TypeError("JWK must be an object");let u;switch(a!=null||(a=i.alg),u!=null||(u=(c=s==null?void 0:s.extractable)!==null&&c!==void 0?c:i.ext),i.kty){case"oct":if(typeof i.k!="string"||!i.k)throw new TypeError('missing "k" (Key Value) Parameter value');return dl(i.k);case"RSA":if("oth"in i&&i.oth!==void 0)throw new ln('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return Hs(xe(xe({},i),{},{alg:a,ext:u}));case"AKP":if(typeof i.alg!="string"||!i.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(a!==void 0&&a!==i.alg)throw new TypeError("JWK alg and alg option value mismatch");return Hs(xe(xe({},i),{},{ext:u}));case"EC":case"OKP":return Hs(xe(xe({},i),{},{alg:a,ext:u}));default:throw new ln('Unsupported "kty" (Key Type) Parameter value')}}(xe(xe({},t),{},{ext:!0}),n);if(r instanceof Uint8Array||r.type!=="public")throw new eh("JSON Web Key Set members must be public keys");o[n]=r}return o[n]}function Pm(e){const t=new hj(e),n=async(o,r)=>t.getKey(o,r);return Object.defineProperties(n,{jwks:{value:()=>structuredClone(t.jwks()),enumerable:!1,configurable:!1,writable:!1}}),n}let jd;if(typeof navigator>"u"||(bs=navigator.userAgent)===null||bs===void 0||(lu=bs.startsWith)===null||lu===void 0||!lu.call(bs,"Mozilla/5.0 ")){const e="v6.2.2";jd="".concat("jose","/").concat(e)}const fb=Symbol(),Ws=Symbol();var du=new WeakMap,fu=new WeakMap,hu=new WeakMap,Ss=new WeakMap,hr=new WeakMap,io=new WeakMap,Oo=new WeakMap,pu=new WeakMap,pr=new WeakMap,mr=new WeakMap;class pj{constructor(t,n){if(Qe(this,du,void 0),Qe(this,fu,void 0),Qe(this,hu,void 0),Qe(this,Ss,void 0),Qe(this,hr,void 0),Qe(this,io,void 0),Qe(this,Oo,void 0),Qe(this,pu,void 0),Qe(this,pr,void 0),Qe(this,mr,void 0),!(t instanceof URL))throw new TypeError("url must be an instance of URL");var o,r;$e(du,this,new URL(t.href)),$e(fu,this,typeof(n==null?void 0:n.timeoutDuration)=="number"?n==null?void 0:n.timeoutDuration:5e3),$e(hu,this,typeof(n==null?void 0:n.cooldownDuration)=="number"?n==null?void 0:n.cooldownDuration:3e4),$e(Ss,this,typeof(n==null?void 0:n.cacheMaxAge)=="number"?n==null?void 0:n.cacheMaxAge:6e5),$e(Oo,this,new Headers(n==null?void 0:n.headers)),jd&&!ne(Oo,this).has("User-Agent")&&ne(Oo,this).set("User-Agent",jd),ne(Oo,this).has("accept")||(ne(Oo,this).set("accept","application/json"),ne(Oo,this).append("accept","application/jwk-set+json")),$e(pu,this,n==null?void 0:n[fb]),(n==null?void 0:n[Ws])!==void 0&&($e(mr,this,n==null?void 0:n[Ws]),o=n==null?void 0:n[Ws],r=ne(Ss,this),typeof o=="object"&&o!==null&&"uat"in o&&typeof o.uat=="number"&&!(Date.now()-o.uat>=r)&&"jwks"in o&&nr(o.jwks)&&Array.isArray(o.jwks.keys)&&Array.prototype.every.call(o.jwks.keys,nr)&&($e(hr,this,ne(mr,this).uat),$e(pr,this,Pm(ne(mr,this).jwks))))}pendingFetch(){return!!ne(io,this)}coolingDown(){return typeof ne(hr,this)=="number"&&Date.now()<ne(hr,this)+ne(hu,this)}fresh(){return typeof ne(hr,this)=="number"&&Date.now()<ne(hr,this)+ne(Ss,this)}jwks(){var t;return(t=ne(pr,this))===null||t===void 0?void 0:t.jwks()}async getKey(t,n){ne(pr,this)&&this.fresh()||await this.reload();try{return await ne(pr,this).call(this,t,n)}catch(o){if(o instanceof th&&this.coolingDown()===!1)return await this.reload(),ne(pr,this).call(this,t,n);throw o}}async reload(){ne(io,this)&&(typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel")&&$e(io,this,void 0),ne(io,this)||$e(io,this,async function(t,n,o){const i=await(arguments.length>3&&arguments[3]!==void 0?arguments[3]:fetch)(t,{method:"GET",signal:o,redirect:"manual",headers:n}).catch(a=>{throw a.name==="TimeoutError"?new eb:a});if(i.status!==200)throw new Rt("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch{throw new Rt("Failed to parse the JSON Web Key Set HTTP response as JSON")}}(ne(du,this).href,ne(Oo,this),AbortSignal.timeout(ne(fu,this)),ne(pu,this)).then(t=>{$e(pr,this,Pm(t)),ne(mr,this)&&(ne(mr,this).uat=Date.now(),ne(mr,this).jwks=t),$e(hr,this,Date.now()),$e(io,this,void 0)}).catch(t=>{throw $e(io,this,void 0),t})),await ne(io,this)}}const mj=["mfaToken"],gj=["mfaToken"];var gr,ks,vr,gn,Cs,Es,jn,Fn,di,Ze,Mo,na,va,bi,js,rt,_m=class extends Error{constructor(e,t){super(t),me(this,"code",void 0),this.name="NotSupportedError",this.code=e}},xo=class extends Error{constructor(e,t,n){super(t),me(this,"cause",void 0),me(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},vj=class extends xo{constructor(e,t){super("token_by_code_error",e,t),this.name="TokenByCodeError"}},yj=class extends xo{constructor(e,t){super("token_by_client_credentials_error",e,t),this.name="TokenByClientCredentialsError"}},wj=class extends xo{constructor(e,t){super("token_by_refresh_token_error",e,t),this.name="TokenByRefreshTokenError"}},mu=class extends xo{constructor(e,t){super("token_for_connection_error",e,t),this.name="TokenForConnectionErrorCode"}},zn=class extends xo{constructor(e,t){super("token_exchange_error",e,t),this.name="TokenExchangeError"}},Po=class extends Error{constructor(e){super(e),me(this,"code","verify_logout_token_error"),this.name="VerifyLogoutTokenError"}},gu=class extends xo{constructor(e){super("backchannel_authentication_error","There was an error when trying to use Client-Initiated Backchannel Authentication.",e),me(this,"code","backchannel_authentication_error"),this.name="BackchannelAuthenticationError"}},bj=class extends xo{constructor(e){super("build_authorization_url_error","There was an error when trying to build the authorization URL.",e),this.name="BuildAuthorizationUrlError"}},xj=class extends xo{constructor(e){super("build_link_user_url_error","There was an error when trying to build the Link User URL.",e),this.name="BuildLinkUserUrlError"}},Sj=class extends xo{constructor(e){super("build_unlink_user_url_error","There was an error when trying to build the Unlink User URL.",e),this.name="BuildUnlinkUserUrlError"}},kj=class extends Error{constructor(){super("The client secret or client assertion signing key must be provided."),me(this,"code","missing_client_auth_error"),this.name="MissingClientAuthError"}};function Ad(e){return Object.entries(e).filter(t=>{let[,n]=t;return n!==void 0}).reduce((t,n)=>xe(xe({},t),{},{[n[0]]:n[1]}),{})}var fl=class extends Error{constructor(e,t,n){super(t),me(this,"cause",void 0),me(this,"code",void 0),this.code=e,this.cause=n&&{error:n.error,error_description:n.error_description,message:n.message}}},hb=class extends fl{constructor(e,t){super("mfa_list_authenticators_error",e,t),this.name="MfaListAuthenticatorsError"}},pb=class extends fl{constructor(e,t){super("mfa_enrollment_error",e,t),this.name="MfaEnrollmentError"}},Cj=class extends fl{constructor(e,t){super("mfa_delete_authenticator_error",e,t),this.name="MfaDeleteAuthenticatorError"}},mb=class extends fl{constructor(e,t){super("mfa_challenge_error",e,t),this.name="MfaChallengeError"}};function Ej(e){return{id:e.id,authenticatorType:e.authenticator_type,active:e.active,name:e.name,oobChannels:e.oob_channels,type:e.type}}var jj=(gr=new WeakMap,ks=new WeakMap,vr=new WeakMap,class{constructor(e){var t;Qe(this,gr,void 0),Qe(this,ks,void 0),Qe(this,vr,void 0),$e(gr,this,"https://".concat(e.domain)),$e(ks,this,e.clientId),$e(vr,this,(t=e.customFetch)!==null&&t!==void 0?t:function(){return fetch(...arguments)})}async listAuthenticators(e){const t="".concat(ne(gr,this),"/mfa/authenticators"),{mfaToken:n}=e,o=await ne(vr,this).call(this,t,{method:"GET",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!o.ok){const r=await o.json();throw new hb(r.error_description||"Failed to list authenticators",r)}return(await o.json()).map(Ej)}async enrollAuthenticator(e){const t="".concat(ne(gr,this),"/mfa/associate"),{mfaToken:n}=e,o=um(e,mj),r={authenticator_types:o.authenticatorTypes};"oobChannels"in o&&(r.oob_channels=o.oobChannels),"phoneNumber"in o&&o.phoneNumber&&(r.phone_number=o.phoneNumber),"email"in o&&o.email&&(r.email=o.email);const i=await ne(vr,this).call(this,t,{method:"POST",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){const a=await i.json();throw new pb(a.error_description||"Failed to enroll authenticator",a)}return function(a){if(a.authenticator_type==="otp")return{authenticatorType:"otp",secret:a.secret,barcodeUri:a.barcode_uri,recoveryCodes:a.recovery_codes,id:a.id};if(a.authenticator_type==="oob")return{authenticatorType:"oob",oobChannel:a.oob_channel,oobCode:a.oob_code,bindingMethod:a.binding_method,id:a.id,barcodeUri:a.barcode_uri,recoveryCodes:a.recovery_codes};throw new Error("Unexpected authenticator type: ".concat(a.authenticator_type))}(await i.json())}async deleteAuthenticator(e){const{authenticatorId:t,mfaToken:n}=e,o="".concat(ne(gr,this),"/mfa/authenticators/").concat(encodeURIComponent(t)),r=await ne(vr,this).call(this,o,{method:"DELETE",headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});if(!r.ok){const i=await r.json();throw new Cj(i.error_description||"Failed to delete authenticator",i)}}async challengeAuthenticator(e){const t="".concat(ne(gr,this),"/mfa/challenge"),{mfaToken:n}=e,o=um(e,gj),r={mfa_token:n,client_id:ne(ks,this),challenge_type:o.challengeType};o.authenticatorId&&(r.authenticator_id=o.authenticatorId);const i=await ne(vr,this).call(this,t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!i.ok){const a=await i.json();throw new mb(a.error_description||"Failed to challenge authenticator",a)}return function(a){const s={challengeType:a.challenge_type};return a.oob_code!==void 0&&(s.oobCode=a.oob_code),a.binding_method!==void 0&&(s.bindingMethod=a.binding_method),s}(await i.json())}}),jr=class gb{constructor(t,n,o,r,i,a,s){me(this,"accessToken",void 0),me(this,"idToken",void 0),me(this,"refreshToken",void 0),me(this,"expiresAt",void 0),me(this,"scope",void 0),me(this,"claims",void 0),me(this,"authorizationDetails",void 0),me(this,"tokenType",void 0),me(this,"issuedTokenType",void 0),this.accessToken=t,this.idToken=o,this.refreshToken=r,this.expiresAt=n,this.scope=i,this.claims=a,this.authorizationDetails=s}static fromTokenEndpointResponse(t){const n=t.id_token?t.claims():void 0,o=new gb(t.access_token,Math.floor(Date.now()/1e3)+Number(t.expires_in),t.id_token,t.refresh_token,t.scope,n,t.authorization_details);return o.tokenType=t.token_type,o.issuedTokenType=t.issued_token_type,o}},Aj=(gn=new WeakMap,Cs=new WeakMap,Es=new WeakMap,class{constructor(e,t){Qe(this,gn,new Map),Qe(this,Cs,void 0),Qe(this,Es,void 0),$e(Es,this,Math.max(1,Math.floor(e))),$e(Cs,this,Math.max(0,Math.floor(t)))}get(e){const t=ne(gn,this).get(e);if(t){if(!(Date.now()>=t.expiresAt))return ne(gn,this).delete(e),ne(gn,this).set(e,t),t.value;ne(gn,this).delete(e)}}set(e,t){for(ne(gn,this).has(e)&&ne(gn,this).delete(e),ne(gn,this).set(e,{value:t,expiresAt:Date.now()+ne(Cs,this)});ne(gn,this).size>ne(Es,this);){const n=ne(gn,this).keys().next().value;if(n===void 0)break;ne(gn,this).delete(n)}}}),Tm=new Map;function Nm(e){return{ttlMs:1e3*(typeof(e==null?void 0:e.ttl)=="number"?e.ttl:600),maxEntries:typeof(e==null?void 0:e.maxEntries)=="number"&&e.maxEntries>0?e.maxEntries:100}}var Im=class{static createDiscoveryCache(e){const t=(n=e.maxEntries,o=e.ttlMs,"".concat(n,":").concat(o));var n,o;let r=(i=t,Tm.get(i));var i;return r||(r=new Aj(e.maxEntries,e.ttlMs),Tm.set(t,r)),r}static createJwksCache(){return{}}},Od="openid profile email offline_access",Oj=Object.freeze(new Set(["grant_type","client_id","client_secret","client_assertion","client_assertion_type","subject_token","subject_token_type","requested_token_type","actor_token","actor_token_type","audience","aud","resource","resources","resource_indicator","scope","connection","login_hint","organization","assertion"]));function vb(e){if(e==null)throw new zn("subject_token is required");if(typeof e!="string")throw new zn("subject_token must be a string");if(e.trim().length===0)throw new zn("subject_token cannot be blank or whitespace");if(e!==e.trim())throw new zn("subject_token must not include leading or trailing whitespace");if(/^bearer\s+/i.test(e))throw new zn("subject_token must not include the 'Bearer ' prefix")}function yb(e,t){if(t){for(const[n,o]of Object.entries(t))if(!Oj.has(n))if(Array.isArray(o)){if(o.length>20)throw new zn("Parameter '".concat(n,"' exceeds maximum array size of ").concat(20));o.forEach(r=>{e.append(n,r)})}else e.append(n,o)}}var wb="urn:ietf:params:oauth:token-type:access_token",Pj=(jn=new WeakMap,Fn=new WeakMap,di=new WeakMap,Ze=new WeakMap,Mo=new WeakMap,na=new WeakMap,va=new WeakMap,bi=new WeakMap,js=new WeakMap,rt=new WeakSet,class{constructor(e){var t,n,o,r;if(function(a,s){Mw(a,s),s.add(a)}(this,rt),Qe(this,jn,void 0),Qe(this,Fn,void 0),Qe(this,di,void 0),Qe(this,Ze,void 0),Qe(this,Mo,void 0),Qe(this,na,void 0),Qe(this,va,void 0),Qe(this,bi,void 0),Qe(this,js,void 0),me(this,"mfa",void 0),$e(Ze,this,e),e.useMtls&&!e.customFetch)throw new _m("mtls_without_custom_fetch_not_supported","Using mTLS without a custom fetch implementation is not supported");$e(Mo,this,function(a,s){if(s.enabled===!1)return a;const c={name:s.name,version:s.version},u=btoa(JSON.stringify(c));return async(d,f)=>{const h=d instanceof Request?new Headers(d.headers):new Headers;return f!=null&&f.headers&&new Headers(f.headers).forEach((p,m)=>{h.set(m,p)}),h.set("Auth0-Client",u),a(d,xe(xe({},f),{},{headers:h}))}}((t=e.customFetch)!==null&&t!==void 0?t:function(){return fetch(...arguments)},((n=e.telemetry)==null?void 0:n.enabled)===!1?n:{enabled:!0,name:(o=n==null?void 0:n.name)!==null&&o!==void 0?o:"@auth0/auth0-auth-js",version:(r=n==null?void 0:n.version)!==null&&r!==void 0?r:"1.5.0"}));const i=Nm(e.discoveryCache);$e(va,this,Im.createDiscoveryCache(i)),$e(bi,this,new Map),$e(js,this,Im.createJwksCache()),this.mfa=new jj({domain:ne(Ze,this).domain,clientId:ne(Ze,this).clientId,customFetch:ne(Mo,this)})}async getServerMetadata(){const{serverMetadata:e}=await it(rt,this,rn).call(this);return e}async buildAuthorizationUrl(e){const{serverMetadata:t}=await it(rt,this,rn).call(this);if(e!=null&&e.pushedAuthorizationRequests&&!t.pushed_authorization_request_endpoint)throw new _m("par_not_supported_error","The Auth0 tenant does not have pushed authorization requests enabled. Learn how to enable it here: https://auth0.com/docs/get-started/applications/configure-par");try{return await it(rt,this,vu).call(this,e)}catch(n){throw new bj(n)}}async buildLinkUserUrl(e){try{const t=await it(rt,this,vu).call(this,{authorizationParams:xe(xe({},e.authorizationParams),{},{requested_connection:e.connection,requested_connection_scope:e.connectionScope,scope:"openid link_account offline_access",id_token_hint:e.idToken})});return{linkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(t){throw new xj(t)}}async buildUnlinkUserUrl(e){try{const t=await it(rt,this,vu).call(this,{authorizationParams:xe(xe({},e.authorizationParams),{},{requested_connection:e.connection,scope:"openid unlink_account",id_token_hint:e.idToken})});return{unlinkUserUrl:t.authorizationUrl,codeVerifier:t.codeVerifier}}catch(t){throw new Sj(t)}}async backchannelAuthentication(e){const{configuration:t,serverMetadata:n}=await it(rt,this,rn).call(this),o=Ad(xe(xe({},ne(Ze,this).authorizationParams),e==null?void 0:e.authorizationParams)),r=new URLSearchParams(xe(xe({scope:Od},o),{},{client_id:ne(Ze,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:n.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&r.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&r.append("authorization_details",JSON.stringify(e.authorizationDetails));try{const i=await Cm(t,r),a=await sb(t,i);return jr.fromTokenEndpointResponse(a)}catch(i){throw new gu(i)}}async initiateBackchannelAuthentication(e){const{configuration:t,serverMetadata:n}=await it(rt,this,rn).call(this),o=Ad(xe(xe({},ne(Ze,this).authorizationParams),e==null?void 0:e.authorizationParams)),r=new URLSearchParams(xe(xe({scope:Od},o),{},{client_id:ne(Ze,this).clientId,binding_message:e.bindingMessage,login_hint:JSON.stringify({format:"iss_sub",iss:n.issuer,sub:e.loginHint.sub})}));e.requestedExpiry&&r.append("requested_expiry",e.requestedExpiry.toString()),e.authorizationDetails&&r.append("authorization_details",JSON.stringify(e.authorizationDetails));try{const i=await Cm(t,r);return{authReqId:i.auth_req_id,expiresIn:i.expires_in,interval:i.interval}}catch(i){throw new gu(i)}}async backchannelAuthenticationGrant(e){let{authReqId:t}=e;const{configuration:n}=await it(rt,this,rn).call(this),o=new URLSearchParams({auth_req_id:t});try{const r=await nh(n,"urn:openid:params:grant-type:ciba",o);return jr.fromTokenEndpointResponse(r)}catch(r){throw new gu(r)}}async getTokenForConnection(e){var t;if(e.refreshToken&&e.accessToken)throw new mu("Either a refresh or access token should be specified, but not both.");const n=(t=e.accessToken)!==null&&t!==void 0?t:e.refreshToken;if(!n)throw new mu("Either a refresh or access token must be specified.");try{return await this.exchangeToken({connection:e.connection,subjectToken:n,subjectTokenType:e.accessToken?wb:"urn:ietf:params:oauth:token-type:refresh_token",loginHint:e.loginHint})}catch(o){throw o instanceof zn?new mu(o.message,o.cause):o}}async exchangeToken(e){return"connection"in e?it(rt,this,Tj).call(this,e):it(rt,this,Nj).call(this,e)}async getTokenByCode(e,t){const{configuration:n}=await it(rt,this,rn).call(this);try{const o=await cb(n,e,{pkceCodeVerifier:t.codeVerifier});return jr.fromTokenEndpointResponse(o)}catch(o){throw new vj("There was an error while trying to request a token.",o)}}async getTokenByRefreshToken(e){const{configuration:t}=await it(rt,this,rn).call(this),n=new URLSearchParams;e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope);try{const o=await lb(t,e.refreshToken,n);return jr.fromTokenEndpointResponse(o)}catch(o){throw new wj("The access token has expired and there was an error while trying to refresh it.",o)}}async getTokenByClientCredentials(e){const{configuration:t}=await it(rt,this,rn).call(this);try{const n=new URLSearchParams({audience:e.audience});e.organization&&n.append("organization",e.organization);const o=await ub(t,n);return jr.fromTokenEndpointResponse(o)}catch(n){throw new yj("There was an error while trying to request a token.",n)}}async buildLogoutUrl(e){const{configuration:t,serverMetadata:n}=await it(rt,this,rn).call(this);if(!n.end_session_endpoint){const o=new URL("https://".concat(ne(Ze,this).domain,"/v2/logout"));return o.searchParams.set("returnTo",e.returnTo),o.searchParams.set("client_id",ne(Ze,this).clientId),o}return function(o,r){bo(o);const{as:i,c:a,tlsOnly:s}=Tt(o),c=Ua(i,"end_session_endpoint",!1,s);(r=new URLSearchParams(r)).has("client_id")||r.set("client_id",a.client_id);for(const[u,d]of r.entries())c.searchParams.append(u,d);return c}(t,{post_logout_redirect_uri:e.returnTo})}async verifyLogoutToken(e){const{serverMetadata:t}=await it(rt,this,rn).call(this),n=Nm(ne(Ze,this).discoveryCache),o=t.jwks_uri;ne(na,this)||$e(na,this,function(i,a){const s=new pj(i,a),c=async(u,d)=>s.getKey(u,d);return Object.defineProperties(c,{coolingDown:{get:()=>s.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>s.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>s.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>s.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>s.jwks(),enumerable:!0,configurable:!1,writable:!1}}),c}(new URL(o),{cacheMaxAge:n.ttlMs,[fb]:ne(Mo,this),[Ws]:ne(js,this)}));const{payload:r}=await dj(e.logoutToken,ne(na,this),{issuer:t.issuer,audience:ne(Ze,this).clientId,algorithms:["RS256"],requiredClaims:["iat"]});if(!("sid"in r)&&!("sub"in r))throw new Po('either "sid" or "sub" (or both) claims must be present');if("sid"in r&&typeof r.sid!="string")throw new Po('"sid" claim must be a string');if("sub"in r&&typeof r.sub!="string")throw new Po('"sub" claim must be a string');if("nonce"in r)throw new Po('"nonce" claim is prohibited');if(!("events"in r))throw new Po('"events" claim is missing');if(typeof r.events!="object"||r.events===null)throw new Po('"events" claim must be an object');if(!("http://schemas.openid.net/event/backchannel-logout"in r.events))throw new Po('"http://schemas.openid.net/event/backchannel-logout" member is missing in the "events" claim');if(typeof r.events["http://schemas.openid.net/event/backchannel-logout"]!="object")throw new Po('"http://schemas.openid.net/event/backchannel-logout" member in the "events" claim must be an object');return{sid:r.sid,sub:r.sub}}});function _j(){const e=ne(Ze,this).domain.toLowerCase();return"".concat(e,"|mtls:").concat(ne(Ze,this).useMtls?"1":"0")}async function Rm(e){const t=await it(rt,this,bb).call(this),n=new Ia(e,ne(Ze,this).clientId,ne(Ze,this).clientSecret,t);return n[ho]=ne(Mo,this),n}async function rn(){if(ne(jn,this)&&ne(Fn,this))return{configuration:ne(jn,this),serverMetadata:ne(Fn,this)};const e=it(rt,this,_j).call(this),t=ne(va,this).get(e);if(t)return $e(Fn,this,t.serverMetadata),$e(jn,this,await it(rt,this,Rm).call(this,t.serverMetadata)),{configuration:ne(jn,this),serverMetadata:ne(Fn,this)};const n=ne(bi,this).get(e);if(n){const i=await n;return $e(Fn,this,i.serverMetadata),$e(jn,this,await it(rt,this,Rm).call(this,i.serverMetadata)),{configuration:ne(jn,this),serverMetadata:ne(Fn,this)}}const o=(async()=>{const i=await it(rt,this,bb).call(this),a=await aj(new URL("https://".concat(ne(Ze,this).domain)),ne(Ze,this).clientId,{use_mtls_endpoint_aliases:ne(Ze,this).useMtls},i,{[ho]:ne(Mo,this)}),s=a.serverMetadata();return ne(va,this).set(e,{serverMetadata:s}),{configuration:a,serverMetadata:s}})(),r=o.then(i=>{let{serverMetadata:a}=i;return{serverMetadata:a}});r.catch(()=>{}),ne(bi,this).set(e,r);try{const{configuration:i,serverMetadata:a}=await o;$e(jn,this,i),$e(Fn,this,a),ne(jn,this)[ho]=ne(Mo,this)}finally{ne(bi,this).delete(e)}return{configuration:ne(jn,this),serverMetadata:ne(Fn,this)}}async function Tj(e){var t,n;const{configuration:o}=await it(rt,this,rn).call(this);if("audience"in e||"resource"in e)throw new zn("audience and resource parameters are not supported for Token Vault exchanges");vb(e.subjectToken);const r=new URLSearchParams({connection:e.connection,subject_token:e.subjectToken,subject_token_type:(t=e.subjectTokenType)!==null&&t!==void 0?t:wb,requested_token_type:(n=e.requestedTokenType)!==null&&n!==void 0?n:"http://auth0.com/oauth/token-type/federated-connection-access-token"});e.loginHint&&r.append("login_hint",e.loginHint),e.scope&&r.append("scope",e.scope),yb(r,e.extra);try{const i=await nh(o,"urn:auth0:params:oauth:grant-type:token-exchange:federated-connection-access-token",r);return jr.fromTokenEndpointResponse(i)}catch(i){throw new zn("Failed to exchange token for connection '".concat(e.connection,"'."),i)}}async function Nj(e){const{configuration:t}=await it(rt,this,rn).call(this);vb(e.subjectToken);const n=new URLSearchParams({subject_token_type:e.subjectTokenType,subject_token:e.subjectToken});e.audience&&n.append("audience",e.audience),e.scope&&n.append("scope",e.scope),e.requestedTokenType&&n.append("requested_token_type",e.requestedTokenType),e.organization&&n.append("organization",e.organization),yb(n,e.extra);try{const o=await nh(t,"urn:ietf:params:oauth:grant-type:token-exchange",n);return jr.fromTokenEndpointResponse(o)}catch(o){throw new zn("Failed to exchange token of type '".concat(e.subjectTokenType,"'").concat(e.audience?" for audience '".concat(e.audience,"'"):"","."),o)}}async function bb(){return ne(di,this)||$e(di,this,(async()=>{if(!ne(Ze,this).clientSecret&&!ne(Ze,this).clientAssertionSigningKey&&!ne(Ze,this).useMtls)throw new kj;if(ne(Ze,this).useMtls)return(t,n,o,r)=>{o.set("client_id",n.client_id)};let e=ne(Ze,this).clientAssertionSigningKey;return!e||e instanceof CryptoKey||(e=await async function(t,n,o){if(typeof t!="string"||t.indexOf("-----BEGIN PRIVATE KEY-----")!==0)throw new TypeError('"pkcs8" must be PKCS#8 formatted string');return nj(t,n,o)}(e,ne(Ze,this).clientAssertionSigningAlg||"RS256")),e?function(t,n){return E4(t,n)}(e):rb(ne(Ze,this).clientSecret)})().catch(e=>{throw $e(di,this,void 0),e})),ne(di,this)}async function vu(e){const{configuration:t}=await it(rt,this,rn).call(this),n=ij(),o=await rj(n),r=Ad(xe(xe({},ne(Ze,this).authorizationParams),e==null?void 0:e.authorizationParams)),i=new URLSearchParams(xe(xe({scope:Od},r),{},{client_id:ne(Ze,this).clientId,code_challenge:o,code_challenge_method:"S256"}));return{authorizationUrl:e!=null&&e.pushedAuthorizationRequests?await db(t,i):await Ed(t,i),codeVerifier:n}}class or extends tt{constructor(t,n){super(t,n),Object.setPrototypeOf(this,or.prototype)}static fromPayload(t){let{error:n,error_description:o}=t;return new or(n,o)}}class Sc extends or{constructor(t,n){super(t,n),Object.setPrototypeOf(this,Sc.prototype)}}class oh extends or{constructor(t,n){super(t,n),Object.setPrototypeOf(this,oh.prototype)}}class rh extends or{constructor(t,n){super(t,n),Object.setPrototypeOf(this,rh.prototype)}}class fi extends or{constructor(t,n){super(t,n),Object.setPrototypeOf(this,fi.prototype)}}class ih extends or{constructor(t,n){super(t,n),Object.setPrototypeOf(this,ih.prototype)}}class Ij{constructor(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:6e5;this.contexts=new Map,this.ttlMs=t}set(t,n){this.cleanup(),this.contexts.set(t,Object.assign(Object.assign({},n),{createdAt:Date.now()}))}get(t){const n=this.contexts.get(t);if(n){if(!(Date.now()-n.createdAt>this.ttlMs))return n;this.contexts.delete(t)}}remove(t){this.contexts.delete(t)}cleanup(){const t=Date.now();for(const[n,o]of this.contexts)t-o.createdAt>this.ttlMs&&this.contexts.delete(n)}get size(){return this.contexts.size}}class Rj{constructor(t,n){this.authJsMfaClient=t,this.auth0Client=n,this.contextManager=new Ij}setMFAAuthDetails(t,n,o,r){this.contextManager.set(t,{scope:n,audience:o,mfaRequirements:r})}async getAuthenticators(t){var n,o;const r=this.contextManager.get(t);if(!(!((n=r==null?void 0:r.mfaRequirements)===null||n===void 0)&&n.challenge)||r.mfaRequirements.challenge.length===0)throw new Sc("invalid_request","challengeType is required and must contain at least one challenge type, please check mfa_required error payload");const i=r.mfaRequirements.challenge.map(a=>a.type);try{return(await this.authJsMfaClient.listAuthenticators({mfaToken:t})).filter(a=>!!a.type&&i.includes(a.type))}catch(a){throw a instanceof hb?new Sc((o=a.cause)===null||o===void 0?void 0:o.error,a.message):a}}async enroll(t){var n;const o=function(r){const i=h4[r.factorType];return Object.assign(Object.assign(Object.assign({mfaToken:r.mfaToken,authenticatorTypes:i.authenticatorTypes},i.oobChannels&&{oobChannels:i.oobChannels}),"phoneNumber"in r&&{phoneNumber:r.phoneNumber}),"email"in r&&{email:r.email})}(t);try{return await this.authJsMfaClient.enrollAuthenticator(o)}catch(r){throw r instanceof pb?new oh((n=r.cause)===null||n===void 0?void 0:n.error,r.message):r}}async challenge(t){var n;try{const o={challengeType:t.challengeType,mfaToken:t.mfaToken};return t.authenticatorId&&(o.authenticatorId=t.authenticatorId),await this.authJsMfaClient.challengeAuthenticator(o)}catch(o){throw o instanceof mb?new rh((n=o.cause)===null||n===void 0?void 0:n.error,o.message):o}}async getEnrollmentFactors(t){const n=this.contextManager.get(t);if(!n||!n.mfaRequirements)throw new ih("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");return n.mfaRequirements.enroll&&n.mfaRequirements.enroll.length!==0?n.mfaRequirements.enroll:[]}async verify(t){const n=this.contextManager.get(t.mfaToken);if(!n)throw new fi("mfa_context_not_found","MFA context not found for this MFA token. Please retry the original request to get a new MFA token.");const o=function(a){return"otp"in a&&a.otp?p4:"oobCode"in a&&a.oobCode?m4:"recoveryCode"in a&&a.recoveryCode?g4:void 0}(t);if(!o)throw new fi("invalid_request","Unable to determine grant type. Provide one of: otp, oobCode, or recoveryCode.");const r=n.scope,i=n.audience;try{const a=await this.auth0Client._requestTokenForMfa({grant_type:o,mfaToken:t.mfaToken,scope:r,audience:i,otp:t.otp,oob_code:t.oobCode,binding_code:t.bindingCode,recovery_code:t.recoveryCode});return this.contextManager.remove(t.mfaToken),a}catch(a){if(a instanceof Ri)this.setMFAAuthDetails(a.mfa_token,r,i,a.mfa_requirements);else if(a instanceof fi)throw new fi(a.error,a.error_description);throw a}}}class Lj{constructor(t){let n,o;if(this.userCache=new Nw().enclosedCache,this.defaultOptions={authorizationParams:{scope:"openid profile email"},useRefreshTokensFallback:!1,useFormData:!0},this.options=Object.assign(Object.assign(Object.assign({},this.defaultOptions),t),{authorizationParams:Object.assign(Object.assign({},this.defaultOptions.authorizationParams),t.authorizationParams)}),typeof window<"u"&&(()=>{if(!pc())throw new Error("For security reasons, `window.crypto` is required to run `auth0-spa-js`.");if(pc().subtle===void 0)throw new Error(`
|
|
63
63
|
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.
|
|
64
|
-
`)})(),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)o=t.cache;else{if(n=t.cacheLocation||"memory",!Op(n))throw new Error('Invalid cache location "'.concat(n,'"'));o=Op(n)()}var r;this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?Ur:p5,this.orgHintCookieName=(r=this.options.clientId,"auth0.".concat(r,".organization_hint")),this.isAuthenticatedCookieName=(l=>"auth0.".concat(l,".is.authenticated"))(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const i=t.useCookiesForTransactions?this.cookieStorage:m5;var a;this.scope=function(l,d){for(var f=arguments.length,h=new Array(f>2?f-2:0),p=2;p<f;p++)h[p-2]=arguments[p];if(typeof l!="object")return{default:vs(d,l,...h)};let m={default:vs(d,...h)};return Object.keys(l).forEach(g=>{const y=l[g];m[g]=vs(d,y,...h)}),m}(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new c5(i,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||U1,this.cacheManager=new s5(o,o.allKeys?void 0:new y5(o,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new x5(this.options.clientId):void 0,this.domainUrl=(a=this.options.domain,/^https?:\/\//.test(a)?a:"https://".concat(a)),this.tokenIssuer=((l,d)=>l?l.startsWith("https://")?l:"https://".concat(l,"/"):"".concat(d,"/"))(this.options.issuer,this.domainUrl);const s="".concat(this.domainUrl,"/me/"),c=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:s},detailedResponse:!0})}));this.myAccountApi=new k5(c,s),this.authJsClient=new $A({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new zA(this.authJsClient.mfa,this),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n==="memory"&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new v5)}getConfiguration(){return Object.freeze({domain:this.options.domain,clientId:this.options.clientId})}_url(t){const n=this.options.auth0Client||z1,o=K1(n,!0),r=encodeURIComponent(btoa(JSON.stringify(o)));return"".concat(this.domainUrl).concat(t,"&auth0Client=").concat(r)}_authorizeUrl(t){return this._url("/authorize?".concat(Bu(t)))}async _verifyIdToken(t,n,o){const r=await this.nowProvider();return u5({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:n,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(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}async _prepareAuthorizeUrl(t,n,o){var r;const i=El(Di()),a=El(Di()),s=Di(),c=await xp(s),l=kp(c),d=await((r=this.dpop)===null||r===void 0?void 0:r.calculateThumbprint()),f=((p,m,g,y,w,k,b,S,x)=>Object.assign(Object.assign(Object.assign({client_id:p.clientId},p.authorizationParams),g),{scope:Ya(m,g.scope,g.audience),response_type:"code",response_mode:S||"query",state:y,nonce:w,redirect_uri:b||p.authorizationParams.redirect_uri,code_challenge:k,code_challenge_method:"S256",dpop_jkt:x}))(this.options,this.scope,t,i,a,l,t.redirect_uri||this.options.authorizationParams.redirect_uri||o,n==null?void 0:n.response_mode,d),h=this._authorizeUrl(f);return{nonce:a,code_verifier:s,scope:f.scope,audience:f.audience||"default",redirect_uri:f.redirect_uri,state:i,url:h}}async loginWithPopup(t,n){var o;if(t=t||{},!(n=n||{}).popup&&(n.popup=(s=>{const c=window.screenX+(window.innerWidth-400)/2,l=window.screenY+(window.innerHeight-600)/2;return window.open(s,"auth0:authorize:popup","left=".concat(c,",top=").concat(l,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))})(""),!n.popup))throw new vf;const r=await this._prepareAuthorizeUrl(t.authorizationParams||{},{response_mode:"web_message"},window.location.origin);n.popup.location.href=r.url;const i=await(s=>new Promise((c,l)=>{let d;const f=setInterval(()=>{s.popup&&s.popup.closed&&(clearInterval(f),clearTimeout(h),window.removeEventListener("message",d,!1),l(new gf(s.popup)))},1e3),h=setTimeout(()=>{clearInterval(f),l(new mf(s.popup)),window.removeEventListener("message",d,!1)},1e3*(s.timeoutInSeconds||60));d=function(p){if(p.data&&p.data.type==="authorization_response"){if(clearTimeout(h),clearInterval(f),window.removeEventListener("message",d,!1),s.closePopup!==!1&&s.popup.close(),p.data.response.error)return l(at.fromPayload(p.data.response));c(p.data.response)}},window.addEventListener("message",d)}))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(r.state!==i.state)throw new at("state_mismatch","Invalid state");const a=((o=t.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 t;const n=await this._getIdTokenFromCache();return(t=n==null?void 0:n.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const n=await this._getIdTokenFromCache();return(t=n==null?void 0:n.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(){var t;const n=Pp(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),{openUrl:o,fragment:r,appState:i}=n,a=Sn(n,["openUrl","fragment","appState"]),s=((t=a.authorizationParams)===null||t===void 0?void 0:t.organization)||this.options.authorizationParams.organization,c=await this._prepareAuthorizeUrl(a.authorizationParams||{}),{url:l}=c,d=Sn(c,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},d),{appState:i,response_type:_o.Code}),s&&{organization:s}));const f=r?"".concat(l,"#").concat(r):l;o?await o(f):window.location.assign(f)}async handleRedirectCallback(){const t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location.href).split("?").slice(1);if(t.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new at("missing_transaction","Invalid state");this.transactionManager.remove();const o=(r=>{r.indexOf("#")>-1&&(r=r.substring(0,r.indexOf("#")));const i=new URLSearchParams(r);return{state:i.get("state"),code:i.get("code")||void 0,connect_code:i.get("connect_code")||void 0,error:i.get("error")||void 0,error_description:i.get("error_description")||void 0}})(t.join(""));return n.response_type===_o.ConnectCode?this._handleConnectAccountRedirectCallback(o,n):this._handleLoginRedirectCallback(o,n)}async _handleLoginRedirectCallback(t,n){const{code:o,state:r,error:i,error_description:a}=t;if(i)throw new hf(i,a||i,r,n.appState);if(!n.code_verifier||n.state&&n.state!==r)throw new at("state_mismatch","Invalid state");const s=n.organization,c=n.nonce,l=n.redirect_uri;return await this._requestToken(Object.assign({audience:n.audience,scope:n.scope,code_verifier:n.code_verifier,grant_type:"authorization_code",code:o},l?{redirect_uri:l}:{}),{nonceIn:c,organization:s}),{appState:n.appState,response_type:_o.Code}}async _handleConnectAccountRedirectCallback(t,n){const{connect_code:o,state:r,error:i,error_description:a}=t;if(i)throw new pf(i,a||i,n.connection,r,n.appState);if(!o)throw new at("missing_connect_code","Missing connect code");if(!(n.code_verifier&&n.state&&n.auth_session&&n.redirect_uri&&n.state===r))throw new at("state_mismatch","Invalid state");const s=await this.myAccountApi.completeAccount({auth_session:n.auth_session,connect_code:o,redirect_uri:n.redirect_uri,code_verifier:n.code_verifier});return Object.assign(Object.assign({},s),{appState:n.appState,response_type:_o.ConnectCode})}async checkSession(t){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(t)}catch{}}async getTokenSilently(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n,o;const r=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:Ya(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope,((o=t.authorizationParams)===null||o===void 0?void 0:o.audience)||this.options.authorizationParams.audience)})}),i=await((a,s)=>{let c=_l[s];return c||(c=a().finally(()=>{delete _l[s],c=null}),_l[s]=c),c})(()=>this._getTokenSilently(r),"".concat(this.options.clientId,"::").concat(r.authorizationParams.audience,"::").concat(r.authorizationParams.scope));return t.detailedResponse?i:i==null?void 0:i.access_token}async _getTokenSilently(t){const{cacheMode:n}=t,o=Sn(t,["cacheMode"]);if(n!=="off"){const s=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId,cacheMode:n});if(s)return s}if(n==="cache-only")return;const r=(i=this.options.clientId,a=o.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(i,".").concat(a));var i,a;if(!await jp(()=>Wi.acquireLock(r,5e3),10))throw new ri;this.activeLockKeys.add(r),this.activeLockKeys.size===1&&window.addEventListener("pagehide",this._releaseLockOnPageHide);try{if(n!=="off"){const p=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||"default",clientId:this.options.clientId});if(p)return p}const s=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(o):await this._getTokenFromIFrame(o),{id_token:c,token_type:l,access_token:d,oauthTokenScope:f,expires_in:h}=s;return Object.assign(Object.assign({id_token:c,token_type:l,access_token:d},f?{scope:f}:null),{expires_in:h})}finally{await Wi.releaseLock(r),this.activeLockKeys.delete(r),this.activeLockKeys.size===0&&window.removeEventListener("pagehide",this._releaseLockOnPageHide)}}async getTokenWithPopup(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var o,r;const i=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:Ya(this.scope,(o=t.authorizationParams)===null||o===void 0?void 0:o.scope,((r=t.authorizationParams)===null||r===void 0?void 0:r.audience)||this.options.authorizationParams.audience)})});return n=Object.assign(Object.assign({},BE),n),await this.loginWithPopup(i,n),(await this.cacheManager.get(new hn({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const n=t.logoutParams||{},{federated:o}=n,r=Sn(n,["federated"]),i=o?"&federated":"";return this._url("/v2/logout?".concat(Bu(Object.assign({clientId:t.clientId},r))))+i}async logout(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n;const o=Pp(t),{openUrl:r}=o,i=Sn(o,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.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@@"),await((n=this.dpop)===null||n===void 0?void 0:n.clear());const a=this._buildLogoutUrl(i);r?await r(a):r!==!1&&window.location.assign(a)}async _getTokenFromIFrame(t){const n=(o=this.options.clientId,"".concat("auth0.lock.getTokenFromIFrame",".").concat(o));var o;if(!await jp(()=>Wi.acquireLock(n,5e3),10))throw new ri;try{const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),i=this.cookieStorage.get(this.orgHintCookieName);i&&!r.organization&&(r.organization=i);const{url:a,state:s,nonce:c,code_verifier:l,redirect_uri:d,scope:f,audience:h}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);if(window.crossOriginIsolated)throw new at("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const p=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let m;try{m=new URL(this.domainUrl).origin}catch{m=this.domainUrl}const g=await function(w,k){let b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:60;return new Promise((S,x)=>{const C=window.document.createElement("iframe");C.setAttribute("width","0"),C.setAttribute("height","0"),C.style.display="none";const T=()=>{window.document.body.contains(C)&&(window.document.body.removeChild(C),window.removeEventListener("message",L,!1))};let L;const M=setTimeout(()=>{x(new ri),T()},1e3*b);L=function(j){if(j.origin!=k||!j.data||j.data.type!=="authorization_response")return;const N=j.source;N&&N.close(),j.data.response.error?x(at.fromPayload(j.data.response)):S(j.data.response),clearTimeout(M),window.removeEventListener("message",L,!1),setTimeout(T,2e3)},window.addEventListener("message",L,!1),window.document.body.appendChild(C),C.setAttribute("src",w)})}(a,m,p);if(s!==g.state)throw new at("state_mismatch","Invalid state");const y=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:l,code:g.code,grant_type:"authorization_code",redirect_uri:d,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:c,organization:r.organization});return Object.assign(Object.assign({},y),{scope:f,oauthTokenScope:y.scope,audience:h})}catch(r){throw r.error==="login_required"&&this.logout({openUrl:!1}),r}finally{await Wi.releaseLock(n)}}async _getTokenUsingRefreshToken(t){var n,o;const r=await this.cacheManager.get(new hn({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||"default",clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new Wc(t.authorizationParams.audience||"default",t.authorizationParams.scope)}const i=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null,s=((h,p,m,g)=>{var y;if(h&&m&&g){if(p.audience!==m)return p.scope;const w=g.split(" "),k=((y=p.scope)===null||y===void 0?void 0:y.split(" "))||[],b=k.every(S=>w.includes(S));return w.length>=k.length&&b?g:p.scope}return p.scope})(this.options.useMrrt,t.authorizationParams,r==null?void 0:r.audience,r==null?void 0:r.scope);try{const h=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:i}),a&&{timeout:a}),{scopesToRequest:s});if(h.refresh_token&&(r!=null&&r.refresh_token)&&await this.cacheManager.updateEntry(r.refresh_token,h.refresh_token),this.options.useMrrt&&(c=r==null?void 0:r.audience,l=r==null?void 0:r.scope,d=t.authorizationParams.audience,f=t.authorizationParams.scope,(c!==d||!Np(f,l))&&!Np(s,h.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);await this.cacheManager.remove(this.options.clientId,t.authorizationParams.audience,t.authorizationParams.scope);const p=((m,g)=>{const y=(m==null?void 0:m.split(" "))||[],w=(g==null?void 0:g.split(" "))||[];return y.filter(k=>w.indexOf(k)==-1).join(",")})(s,h.scope);throw new yf(t.authorizationParams.audience||"default",p)}return Object.assign(Object.assign({},h),{scope:t.authorizationParams.scope,oauthTokenScope:h.scope,audience:t.authorizationParams.audience||"default"})}catch(h){if(h.message){if(h.message.includes("user is blocked"))throw await this.logout({openUrl:!1}),h;if((h.message.includes("Missing Refresh Token")||h.message.includes("invalid refresh token"))&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t)}throw h instanceof Ca&&this.mfa.setMFAAuthDetails(h.mfa_token,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope,(o=t.authorizationParams)===null||o===void 0?void 0:o.audience,h.mfa_requirements),h}var c,l,d,f}async _saveEntryInCache(t){const{id_token:n,decodedToken:o}=t,r=Sn(t,["id_token","decodedToken"]);this.userCache.set("@@user@@",{id_token:n,decodedToken:o}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||"default",n=this.scope[t],o=await this.cacheManager.getIdToken(new hn({clientId:this.options.clientId,audience:t,scope:n})),r=this.userCache.get("@@user@@");return o&&o.id_token===(r==null?void 0:r.id_token)?r:(this.userCache.set("@@user@@",o),o)}async _getEntryFromCache(t){let{scope:n,audience:o,clientId:r,cacheMode:i}=t;const a=await this.cacheManager.get(new hn({scope:n,audience:o,clientId:r}),60,this.options.useMrrt,i);if(a&&a.access_token){const{token_type:s,access_token:c,oauthTokenScope:l,expires_in:d}=a,f=await this._getIdTokenFromCache();return f&&Object.assign(Object.assign({id_token:f.id_token,token_type:s||"Bearer",access_token:c},l?{scope:l}:null),{expires_in:d})}}async _requestToken(t,n){var o,r;const{nonceIn:i,organization:a,scopesToRequest:s}=n||{},c=await r5(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},t),{scope:s||t.scope}),this.worker),l=await this._verifyIdToken(c.id_token,i,a);if(t.grant_type==="authorization_code"){const d=await this._getIdTokenFromCache();!((r=(o=d==null?void 0:d.decodedToken)===null||o===void 0?void 0:o.claims)===null||r===void 0)&&r.sub&&d.decodedToken.claims.sub!==l.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove("@@user@@"))}return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},c),{decodedToken:l,scope:t.scope,audience:t.audience||"default"}),c.scope?{oauthTokenScope:c.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||l.claims.org_id),Object.assign(Object.assign({},c),{decodedToken:l})}async loginWithCustomTokenExchange(t){return this._requestToken(Object.assign(Object.assign({},t),{grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:t.subject_token,subject_token_type:t.subject_token_type,scope:Ya(this.scope,t.scope,t.audience||this.options.authorizationParams.audience),audience:t.audience||this.options.authorizationParams.audience,organization:t.organization||this.options.authorizationParams.organization}))}async exchangeToken(t){return this.loginWithCustomTokenExchange(t)}_assertDpop(t){if(!t)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(t){return this._assertDpop(this.dpop),this.dpop.getNonce(t)}setDpopNonce(t,n){return this._assertDpop(this.dpop),this.dpop.setNonce(t,n)}generateDpopProof(t){return this._assertDpop(this.dpop),this.dpop.generateProof(t)}createFetcher(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new S5(t,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:n=>{var o;return this.getTokenSilently({authorizationParams:{scope:(o=n==null?void 0:n.scope)===null||o===void 0?void 0:o.join(" "),audience:n==null?void 0:n.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(t.dpopNonceId),setDpopNonce:n=>this.setDpopNonce(n,t.dpopNonceId),generateDpopProof:n=>this.generateDpopProof(n)})}async connectAccountWithRedirect(t){const{openUrl:n,appState:o,connection:r,scopes:i,authorization_params:a,redirectUri:s=this.options.authorizationParams.redirect_uri||window.location.origin}=t;if(!r)throw new Error("connection is required");const c=El(Di()),l=Di(),d=await xp(l),f=kp(d),{connect_uri:h,connect_params:p,auth_session:m}=await this.myAccountApi.connectAccount({connection:r,scopes:i,redirect_uri:s,state:c,code_challenge:f,code_challenge_method:"S256",authorization_params:a});this.transactionManager.create({state:c,code_verifier:l,auth_session:m,redirect_uri:s,appState:o,connection:r,response_type:_o.ConnectCode});const g=new URL(h);g.searchParams.set("ticket",p.ticket),n?await n(g.toString()):window.location.assign(g)}async _requestTokenForMfa(t,n){const{mfaToken:o}=t,r=Sn(t,["mfaToken"]);return this._requestToken(Object.assign(Object.assign({},r),{mfa_token:o}),n)}}var Mw={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},Nt=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},KA=Pt(Pt({},Mw),{buildAuthorizeUrl:Nt,buildLogoutUrl:Nt,getAccessTokenSilently:Nt,getAccessTokenWithPopup:Nt,getIdTokenClaims:Nt,loginWithCustomTokenExchange:Nt,exchangeToken:Nt,loginWithRedirect:Nt,loginWithPopup:Nt,connectAccountWithRedirect:Nt,logout:Nt,handleRedirectCallback:Nt,getDpopNonce:Nt,setDpopNonce:Nt,generateDpopProof:Nt,createFetcher:Nt,getConfiguration:Nt}),$w=v.createContext(KA),Qp=function(e){ME(t,e);function t(n,o){var r=e.call(this,o??n)||this;return r.error=n,r.error_description=o,Object.setPrototypeOf(r,t.prototype),r}return t}(Error),VA=/[?&](?:connect_)?code=[^&]+/,GA=/[?&]state=[^&]+/,qA=/[?&]error=[^&]+/,JA=function(e){return e===void 0&&(e=window.location.search),(VA.test(e)||qA.test(e))&&GA.test(e)},Hw=function(e){return function(t){if(t instanceof Error)return t;if(t!==null&&typeof t=="object"&&"error"in t&&typeof t.error=="string"){if("error_description"in t&&typeof t.error_description=="string"){var n=t;return new Qp(n.error,n.error_description)}var o=t;return new Qp(o.error)}return new Error(e)}},em=Hw("Login failed"),is=Hw("Get access token failed"),Ww=function(e){var t,n;e!=null&&e.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"),e.authorizationParams=(t=e.authorizationParams)!==null&&t!==void 0?t:{},e.authorizationParams.redirect_uri=e.redirectUri,delete e.redirectUri),!((n=e==null?void 0:e.authorizationParams)===null||n===void 0)&&n.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"),e.authorizationParams.redirect_uri=e.authorizationParams.redirectUri,delete e.authorizationParams.redirectUri)},ZA=function(e,t){switch(t.type){case"LOGIN_POPUP_STARTED":return Pt(Pt({},e),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return Pt(Pt({},e),{isAuthenticated:!!t.user,user:t.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return e.user===t.user?e:Pt(Pt({},e),{isAuthenticated:!!t.user,user:t.user});case"LOGOUT":return Pt(Pt({},e),{isAuthenticated:!1,user:void 0});case"ERROR":return Pt(Pt({},e),{isLoading:!1,error:t.error})}},YA=function(e){return Ww(e),Pt(Pt({},e),{auth0Client:{name:"auth0-react",version:"2.13.0"}})},XA=function(e){var t;window.history.replaceState({},document.title,(t=e.returnTo)!==null&&t!==void 0?t:window.location.pathname)},QA=function(e){var t=e.children,n=e.skipRedirectCallback,o=e.onRedirectCallback,r=o===void 0?XA:o,i=e.context,a=i===void 0?$w:i,s=bp(e,["children","skipRedirectCallback","onRedirectCallback","context"]),c=v.useState(function(){return new UA(YA(s))})[0],l=v.useReducer(ZA,Mw),d=l[0],f=l[1],h=v.useRef(!1),p=v.useCallback(function(z){return f({type:"ERROR",error:z}),z},[]);v.useEffect(function(){h.current||(h.current=!0,function(){return vo(void 0,void 0,void 0,function(){var z,R,$,H,K,B,D;return yo(this,function(V){switch(V.label){case 0:return V.trys.push([0,7,,8]),z=void 0,JA()&&!n?[4,c.handleRedirectCallback()]:[3,3];case 1:return R=V.sent(),$=R.appState,H=$===void 0?{}:$,K=R.response_type,B=bp(R,["appState","response_type"]),[4,c.getUser()];case 2:return z=V.sent(),H.response_type=K,K===_o.ConnectCode&&(H.connectedAccount=B),r(H,z),[3,6];case 3:return[4,c.checkSession()];case 4:return V.sent(),[4,c.getUser()];case 5:z=V.sent(),V.label=6;case 6:return f({type:"INITIALISED",user:z}),[3,8];case 7:return D=V.sent(),p(em(D)),[3,8];case 8:return[2]}})})}())},[c,r,n,p]);var m=v.useCallback(function(z){return Ww(z),c.loginWithRedirect(z)},[c]),g=v.useCallback(function(z,R){return vo(void 0,void 0,void 0,function(){var $,H;return yo(this,function(K){switch(K.label){case 0:f({type:"LOGIN_POPUP_STARTED"}),K.label=1;case 1:return K.trys.push([1,3,,4]),[4,c.loginWithPopup(z,R)];case 2:return K.sent(),[3,4];case 3:return $=K.sent(),p(em($)),[2];case 4:return[4,c.getUser()];case 5:return H=K.sent(),f({type:"LOGIN_POPUP_COMPLETE",user:H}),[2]}})})},[c,p]),y=v.useCallback(function(){for(var z=[],R=0;R<arguments.length;R++)z[R]=arguments[R];return vo(void 0,$E([],z,!0),void 0,function($){return $===void 0&&($={}),yo(this,function(H){switch(H.label){case 0:return[4,c.logout($)];case 1:return H.sent(),($.openUrl||$.openUrl===!1)&&f({type:"LOGOUT"}),[2]}})})},[c]),w=v.useCallback(function(z){return vo(void 0,void 0,void 0,function(){var R,$,H,K;return yo(this,function(B){switch(B.label){case 0:return B.trys.push([0,2,3,5]),[4,c.getTokenSilently(z)];case 1:return R=B.sent(),[3,5];case 2:throw $=B.sent(),is($);case 3:return H=f,K={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,c.getUser()];case 4:return H.apply(void 0,[(K.user=B.sent(),K)]),[7];case 5:return[2,R]}})})},[c]),k=v.useCallback(function(z,R){return vo(void 0,void 0,void 0,function(){var $,H,K,B;return yo(this,function(D){switch(D.label){case 0:return D.trys.push([0,2,3,5]),[4,c.getTokenWithPopup(z,R)];case 1:return $=D.sent(),[3,5];case 2:throw H=D.sent(),is(H);case 3:return K=f,B={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,c.getUser()];case 4:return K.apply(void 0,[(B.user=D.sent(),B)]),[7];case 5:return[2,$]}})})},[c]),b=v.useCallback(function(z){return c.connectAccountWithRedirect(z)},[c]),S=v.useCallback(function(){return c.getIdTokenClaims()},[c]),x=v.useCallback(function(z){return vo(void 0,void 0,void 0,function(){var R,$,H,K;return yo(this,function(B){switch(B.label){case 0:return B.trys.push([0,2,3,5]),[4,c.loginWithCustomTokenExchange(z)];case 1:return R=B.sent(),[3,5];case 2:throw $=B.sent(),is($);case 3:return H=f,K={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,c.getUser()];case 4:return H.apply(void 0,[(K.user=B.sent(),K)]),[7];case 5:return[2,R]}})})},[c]),C=v.useCallback(function(z){return vo(void 0,void 0,void 0,function(){return yo(this,function(R){return[2,x(z)]})})},[x]),T=v.useCallback(function(z){return vo(void 0,void 0,void 0,function(){var R,$,H;return yo(this,function(K){switch(K.label){case 0:return K.trys.push([0,2,3,5]),[4,c.handleRedirectCallback(z)];case 1:return[2,K.sent()];case 2:throw R=K.sent(),is(R);case 3:return $=f,H={type:"HANDLE_REDIRECT_COMPLETE"},[4,c.getUser()];case 4:return $.apply(void 0,[(H.user=K.sent(),H)]),[7];case 5:return[2]}})})},[c]),L=v.useCallback(function(z){return c.getDpopNonce(z)},[c]),M=v.useCallback(function(z,R){return c.setDpopNonce(z,R)},[c]),j=v.useCallback(function(z){return c.generateDpopProof(z)},[c]),N=v.useCallback(function(z){return c.createFetcher(z)},[c]),O=v.useCallback(function(){return c.getConfiguration()},[c]),Y=v.useMemo(function(){return Pt(Pt({},d),{getAccessTokenSilently:w,getAccessTokenWithPopup:k,getIdTokenClaims:S,loginWithCustomTokenExchange:x,exchangeToken:C,loginWithRedirect:m,loginWithPopup:g,connectAccountWithRedirect:b,logout:y,handleRedirectCallback:T,getDpopNonce:L,setDpopNonce:M,generateDpopProof:j,createFetcher:N,getConfiguration:O})},[d,w,k,S,x,C,m,g,b,y,T,L,M,j,N,O]);return v.createElement(a.Provider,{value:Y},t)},Fw=function(e){return e===void 0&&(e=$w),v.useContext(e)};const Bw=({className:e,children:t,Logo:n})=>u.jsxs("div",{className:dt("info-page-container",e),children:[u.jsx(n,{className:"info-page-logo"}),u.jsx("div",{className:"info-page-wrapper",children:t})]}),e4={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"},t4={loginPageLogo:e4},n4="200px",Ia=({logoSrc:e=t4.loginPageLogo.value,width:t=n4,className:n="logo"})=>u.jsx("img",{width:t,src:e,className:n,alt:"Login logo"}),zw=()=>u.jsx("span",{className:"spinner"});const Xo=({Logo:e=Ia,text:t="Loading..."})=>u.jsx("div",{className:"system-loader-background",children:u.jsxs("div",{className:"system-loader-container flex flex-column ai-center",children:[u.jsx(e,{}),u.jsx("h1",{className:"system-loader-text io-title",children:t}),u.jsx(zw,{})]})});const Uw=({children:e,description:t,heading:n,Image:o,title:r,className:i})=>u.jsxs("div",{className:dt("info-card",i),children:[r&&u.jsx("h1",{className:"info-card-title io-title-large",children:r}),o&&u.jsx("div",{className:"info-card-image",children:u.jsx(o,{})}),n&&u.jsx("h3",{className:"info-card-heading io-title",children:n}),u.jsx("p",{className:"info-card-description io-text-default-lh16",children:t}),e]}),o4=({activeStepName:e,showWarnIcon:t,stepsStatuses:n})=>u.jsx("ul",{className:"setup-flow-list io-text-default-lh16",children:gs.map(({name:o,label:r},i)=>{const a=o===e,s=n[o].state,c=t&&a?u.jsx(kt,{variant:"exclamation-mark",size:"12"}):u.jsxs("span",{children:[i+1,"."]});return u.jsx("li",{className:dt(a&&"active"),children:u.jsxs("div",{className:"setup-flow-list-item",children:[u.jsxs("div",{className:"setup-flow-list-item-icon-wrapper",children:[s==="prompt"&&c,s==="granted"&&u.jsx(kt,{variant:"check-solid",size:"12"}),s==="denied"&&u.jsx(kt,{variant:"close",size:"12"})]}),r]})},o)})}),r4=({edgeNotificationsPermissionTimeout:e,isNotificationsPermissionPromptOpen:t})=>{const{name:n}=N3(),[o,r]=v.useState(!1);return v.useEffect(()=>{if(!t||n!=="Edge")return;const i=setTimeout(()=>r(!0),e);return()=>clearTimeout(i)},[n,e,t]),v.useEffect(()=>{t&&!o||r(!1)},[t,o,r]),{hasEdgeNotificationsPermissionError:o}},i4=(e,t)=>{const{type:n,payload:o}=t;switch(n){case"completed":return{...e,[o.stepName]:{...e[o.stepName],isCompleted:!0}};case"skipped":return{...e,[o.stepName]:{isCompleted:!0,state:"denied"}};case"stateUpdated":{if(!o.state)throw Error('"stateUpdated" action invoked without state in payload');return{...e,[o.stepName]:{isCompleted:o.stepName===ut.POPUPS?o.state==="granted":o.state!=="prompt",state:o.state}}}default:throw Error("Unknown action: "+n)}},a4=e=>{const{handleDeferredStep:t,handleOperationComplete:n}=e;window.getScreenDetails().catch(async()=>{const{state:o}=await navigator.permissions.query({name:Wo.WINDOW_MANAGEMENT});o==="prompt"&&t()}).finally(n)},s4=e=>{const{handleDeferredStep:t,handleOperationComplete:n}=e;Notification.requestPermission().then(async()=>{const{state:o}=await navigator.permissions.query({name:Wo.NOTIFICATIONS});o==="prompt"&&t()}).finally(n)},c4=e=>{const{handleDeferredStep:t,handleOperationComplete:n,dispatchAction:o}=e,r="about:blank",i="popup,width=1,height=1,top=9999,left=9999",a=window.open(r,void 0,i),s=window.open(r,void 0,i);a==null||a.close(),s==null||s.close();const c=!(a&&s);c&&t(),o({type:"stateUpdated",payload:{stepName:ut.POPUPS,state:c?"denied":"granted"}}),n()},l4=e=>{const{dispatchAction:t}=e;t({type:"completed",payload:{stepName:ut.PWA_INSTALL}})},u4={[ut.WINDOW_MANAGEMENT]:a4,[ut.NOTIFICATIONS]:s4,[ut.POPUPS]:c4,[ut.PWA_INSTALL]:l4},d4=({settings:e})=>{const{permission:t}=Yo(),[n,o]=Gn("localStorage",Sa,ka),[r,i]=v.useReducer(i4,LE),[a,s]=v.useState(!1),[c,l]=v.useState(!1),d=gs.find(y=>!r[y.name].isCompleted);if(!d)throw new Error("All setup steps are completed. The SetupSteps component should not be used in such case.");const f=d.name,h=gs[gs.length-1].name,{hasEdgeNotificationsPermissionError:p}=r4({edgeNotificationsPermissionTimeout:e.edgeNotificationsPermissionTimeout,isNotificationsPermissionPromptOpen:c&&f===Wo.NOTIFICATIONS}),m=()=>{s(!1),l(!0),u4[f]({handleDeferredStep:()=>s(!0),handleOperationComplete:()=>l(!1),dispatchAction:y=>i(y)}),f===h&&o({isCompleted:!0})},g=()=>{s(!1),i({type:"skipped",payload:{stepName:f}})};return v.useEffect(()=>{p&&(l(!1),s(!0))},[p]),v.useEffect(()=>{var y,w;s(!1),i({type:"stateUpdated",payload:{stepName:ut.WINDOW_MANAGEMENT,state:Hc?(y=t.statuses[ut.WINDOW_MANAGEMENT])==null?void 0:y.state:"denied"}}),i({type:"stateUpdated",payload:{stepName:ut.NOTIFICATIONS,state:(w=t.statuses[ut.NOTIFICATIONS])==null?void 0:w.state}})},[t.statuses]),u.jsxs(Uw,{description:d.description,heading:d.heading,Image:d.Image,title:"Platform Setup",children:[u.jsx(o4,{activeStepName:f,showWarnIcon:a&&f!==ut.POPUPS,stepsStatuses:r}),u.jsx("p",{className:"io-text-default-lh16",children:a?d.instructions.additional:d.instructions.initial}),u.jsxs(We,{children:[u.jsx(Ws,{className:"io-btn io-btn-lg io-btn-primary setup-flow-btn",disabled:c,onClick:m,children:d.actionBtnText}),f!==h&&f!==ut.WINDOW_MANAGEMENT&&u.jsx(Ws,{className:"io-btn io-btn-lg io-btn-outline setup-flow-btn",disabled:c,onClick:g,children:"Skip"})]}),c&&u.jsx(zw,{})]})};const If=({components:{Logo:e=Ia,Loader:t=Xo}={},settings:n={}})=>{const{permission:o}=Yo();return o.isLoading?u.jsx(t,{text:"Checking browser permissions..."}):u.jsx(Bw,{Logo:e,children:u.jsx(d4,{settings:{...PE,...n}})})};const Tf=({errorMessage:e})=>{const t="https://support.interop.io",n=u.jsxs(u.Fragment,{children:["It seems that the following error prevents io.Connect Browser",u.jsx("br",{}),"from operating properly:",u.jsxs("span",{className:"browser-start-failed-error",children:["“",e,"”"]}),u.jsxs("span",{className:"help-center-info",children:["For further assistance, visit our"," ",u.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"help center"}),"."]}),u.jsx("span",{className:"thank-you",children:"Thank you for your cooperation."})]});return u.jsx(Bw,{Logo:Ia,children:u.jsx(Uw,{className:"io-init-error-card",heading:"Oops! io.Connect Browser couldn't start...",description:n,Image:OE,children:u.jsx(Ws,{className:"io-btn io-btn-lg io-btn-primary",onClick:()=>window.open(t,"_blank","noopener,noreferrer"),children:"Visit the interop.io Help Center"})})})},Kw=()=>u.jsxs(u.Fragment,{children:[u.jsx(zn,{tag:"h1",className:"login-title",text:"Making Your Work Flow",size:"large"}),u.jsxs("p",{className:"io-text-default-lh16 login-description",children:["Integrate apps, simplify user experiences and accelerate",u.jsx("br",{}),"digital transformation."]})]}),Vw=({Logo:e,children:t,className:n})=>u.jsx("div",{className:"login-page-background",children:u.jsxs("div",{className:dt(n,"login-form-container flex flex-column ai-center"),children:[u.jsx(e,{}),t]})}),f4=({onLogin:e,isLoading:t,validationError:n,components:{Logo:o=Ia,Heading:r=Kw,Loader:i=Xo}={}})=>t?u.jsx(i,{text:"Verifying credentials..."}):u.jsxs(Vw,{Logo:o,children:[u.jsx(r,{}),u.jsx(Qe,{className:"auth0-login-btn",onClick:e,size:"large",variant:"primary",children:"Log In"}),n&&u.jsx(cb,{variant:"critical",text:n.message})]}),tm=(e,t)=>{const n=t.value,o=n.trim().length>3;return{value:n,isValid:o}},h4=({onLogin:e,setIsLoading:t,loginError:n,setLoginError:o,userInputName:r="email"})=>{const[i,a]=v.useReducer(tm,{value:"",isValid:!1}),[s,c]=v.useReducer(tm,{value:"",isValid:!1}),[l,d]=v.useState(!1),[f,h]=v.useState(!1),{isValid:p}=i,{isValid:m}=s,g=p&&m,y=x=>a({value:x.target.value}),w=x=>c({value:x.target.value}),k=()=>{p||d(!0)},b=()=>{m||h(!0)},S=async x=>{if(x.preventDefault(),!!g){t(!0);try{await e(i.value,s.value)}catch(C){o(C)}t(!1)}};return u.jsxs("form",{className:"simple-login-form",onSubmit:S,children:[u.jsx(Cr,{id:"user",errorMessage:l?`The ${r} is too short`:void 0,autoFocus:!0,autoComplete:"off",type:"text",placeholder:`Enter your ${r}`,value:i.value,onChange:y,onBlur:k,onFocus:()=>d(!1)}),u.jsx(Cr,{id:"password",errorMessage:f?"The password is too short":void 0,autoComplete:"off",type:"password",placeholder:"Enter your password",value:s.value,onChange:w,onBlur:b,onFocus:()=>h(!1)}),u.jsx(Qe,{type:"submit",size:"large",variant:"primary",children:"Log In"}),n&&u.jsxs("div",{className:"login-error-feedback",children:[u.jsx(kt,{className:"error-icon",variant:"close",size:"12"}),n.message]})]})};const p4=({onLogin:e,userInputName:t,components:{Logo:n=Ia,Heading:o=Kw,Loader:r=Xo}={}})=>{const[i,a]=v.useState(!1),[s,c]=v.useState(null);return i?u.jsx(r,{text:"Verifying credentials..."}):u.jsxs(Vw,{Logo:n,children:[u.jsx(o,{}),u.jsx(h4,{onLogin:e,setIsLoading:a,loginError:s,setLoginError:c,userInputName:t})]})};function m4(e,t){const[n,o]=v.useState(!0),r=v.useContext(Ie.IOConnectContext);return v.useEffect(()=>{let i;return(async()=>{if(!r.workspaces)return;let a;try{a=await r.workspaces.getWorkspaceById(e)}catch(c){console.warn(c);return}const s=a.getAllGroups().find(c=>c.id===t);s&&(i=await s.onLockConfigurationChanged(({showAddWindowButton:c})=>{c!==void 0&&o(c)}),o(!!s.showAddWindowButton))})(),()=>i==null?void 0:i()},[e,t,r.workspaces]),n}const g4=({groupId:e,workspaceId:t})=>{const n=m4(t,e),o=v.useCallback(r=>{ai.showAddApplicationPopup({bounds:r,groupId:e,workspaceId:t})},[e,t]);return n&&u.jsx(ai.AddWindowButton,{title:"Add App",visible:n,showPopup:o})},v4=e=>u.jsx(ai.GroupHeaderButtons,{...e,addWindow:{visible:!1,showPopup:e.addWindow.showPopup}}),y4=()=>null;const Gw=({className:e,components:t,onClose:n,title:o})=>{const{NotificationsProvider:r,NotificationsPanelProvider:i,SettingsPanel:a}=Hd;return u.jsx(r,{children:u.jsx(i,{children:u.jsx(a,{className:e,components:t,onClose:n,title:o})})})};const qw=OS.Panel;const Jw=({className:e,components:t,onClose:n,title:o})=>{const r=v.useContext(Ie.IOConnectContext),{onLogout:i}=$1(),[a,s]=Gn("sessionStorage",o1,r1),{login:{setIsLoggingOut:c}}=Yo(),l=v.useCallback(async()=>{var d;if("modals"in r&&r.modals){const f="log-out",{isEnterPressed:h,responseButtonClicked:p}=await r.modals.dialogs.request({templateName:Ci.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:f,autofocus:!0},{variant:"outline",text:"Cancel",id:"cancel"}]}});if(!(h||(p==null?void 0:p.id)===f))return}jo.flushSync(()=>c(!0)),s(null),await((d=r.webPlatform)==null?void 0:d.system.shutdown());try{i==null||i()}catch(f){console.error(f)}},[r,i]);return u.jsx(Ny.Panel,{className:e,components:t,onClose:n,onLogout:l,title:o})},w4=[{name:"platformPreferences",displayName:"Platform Preferences",icon:"cog",onClick:e=>e(qw)},{name:"notificationSettings",displayName:"Notification Settings",icon:"bell",onClick:e=>e(Gw),separatorAfter:!0},{name:"profile",displayName:"Profile",icon:"user",onClick:e=>e(Jw)}],b4=e=>({onClose:t})=>u.jsx(e,{className:"system-menu-panel",onClose:t});const Zw=({actions:e,panelWrapperClassName:t})=>{const[n,o]=v.useState(),r=v.useRef(null),i=p1(),a=v.useCallback(()=>o(void 0),[]),s=!!n;v.useEffect(()=>{!s||i!=="Escape"||a()},[s,i]);const c=v.useCallback((l,d)=>{const f=e.find(({name:p})=>p===d.name);if(!f){console.error(`Action named ${d.name} is not part of the provided list of actions: ${JSON.stringify(e)}!`);return}const h=p=>{const m=b4(p);o(()=>m)};f.onClick(h)},[e]);return rf({eventType:"mouseup",handler:a,ref:r,skip:!s}),of({handler:a,skip:!s}),u.jsxs(u.Fragment,{children:[u.jsx(lf,{buttonSize:"32",iconSize:"16",actions:e,onActionItemClick:c,icon:"ellipsis-vertical",buttonVariant:"circle",placement:"bottom-end",offset:[0,8],"data-testid":"system-menu-button",contextMenuDataTestId:"system-menu"}),u.jsx(W1,{className:dt("system-menu-panel-wrapper",t),isOpen:s,onClose:a,Panel:n,position:"right",ref:r})]})},x4=()=>u.jsx("li",{className:"default-header-system-menu",children:u.jsx(Zw,{actions:w4})}),S4=()=>{const{showNotificationBadge:e}=I3(),t=h1(),o=v.useMemo(()=>t.filter(({state:r})=>r==="Active"||r==="Stale"),[t]).length;return o>0&&e?u.jsx("div",{className:"io-badge io-badge-primary notifications-badge",children:o<100?o:"99+"}):null};const Yw=e=>{const{className:t,active:n,...o}=e;return u.jsxs("div",{className:dt(t,"notifications-panel-button"),...o,children:[u.jsx(Ue,{icon:"bell",size:"32",iconSize:"16",variant:"circle"}),u.jsx(S4,{})]})},Xw=({className:e,components:t,onClose:n,settings:o,title:r})=>{const{NotificationsProvider:i,NotificationsPanelProvider:a,Panel:s}=Hd;return u.jsx(i,{children:u.jsx(a,{children:u.jsx(s,{className:e,components:t,onClose:n,settings:o,title:r})})})},Qw=({Button:e=Yw,Panel:t=Xw,position:n="right",...o})=>{const r=h1(),i=v.useContext(Ie.IOConnectContext),a=v.useCallback(async()=>{await Promise.all(r.map(({id:s})=>i.notifications.setState(s,"Seen")))},[r]);return u.jsx(df,{Button:e,Panel:t,position:n,onClose:a,...o})};const k4=()=>u.jsxs(u.Fragment,{children:[u.jsx(Qw,{tag:"li"}),u.jsx(x4,{})]}),Rf=({onLogout:e,workspaces:t,launchpad:n,Loader:o=Xo,isBeforeunloadDialogEnabled:r})=>{var g,y,w,k;const{LogoComponent:i,SystemButtonsComponent:a}=((g=t==null?void 0:t.components)==null?void 0:g.header)??{},{setPlatformWindow:s}=af(),{isInitialSetupCompleted:c}=iv(),l=(y=window.iobrowser)==null?void 0:y.platformStarted,d=i??(l?F1:y4),f=a??(l?k4:void 0),h=j3(),{login:{isLoggingOut:p}}=Yo();KC(r===!1||p),v.useEffect(()=>{l&&s({name:window.name})},[l,s]);const m=v.useMemo(()=>({onLogout:e,launchpadSettings:n==null?void 0:n.settings,launchpadComponents:n==null?void 0:n.components}),[e,n==null?void 0:n.settings,n==null?void 0:n.components]);return u.jsxs(M1.Provider,{value:m,children:[(!h||!c)&&u.jsx(o,{text:"Loading io.Connect Home..."}),u.jsx(ai,{components:{...t==null?void 0:t.components,header:{...(w=t==null?void 0:t.components)==null?void 0:w.header,LogoComponent:d,SystemButtonsComponent:f},groupHeader:{AfterTabsComponent:g4,ButtonsComponent:v4,...(k=t==null?void 0:t.components)==null?void 0:k.groupHeader}}})]})},C4=lt({id:Gt,username:Re(Gt),email:Re(Gt),firstName:Re(Gt),lastName:Re(Gt),token:Re(Gt),password:Re(Gt)}),E4=({config:e})=>{var w,k,b,S;const{setupFlow:t,login:n,workspaces:o,launchpad:r,getIOConnectConfig:i}=e,[a,s]=Gn("localStorage",r3,C4),[c]=Gn("localStorage",Sa,ka),[l,d]=v.useState(null),{login:{isLoggingOut:f}}=Yo(),h=nf(),p=((w=e.components)==null?void 0:w.SystemLoader)??Xo,m=((k=e.components)==null?void 0:k.IOInitErrorScreen)??Tf,g=v.useCallback(async(x,C)=>{const T=await n.onLogin(x,C);s(T)},[n,s]),y=v.useCallback(()=>{var x;(x=n.onLogout)==null||x.call(n),s(null),window.location.reload()},[n.onLogout,s]);return f?u.jsx(p,{text:"Logging out..."}):a?!(c!=null&&c.isCompleted)&&(t==null?void 0:t.enabled)!==!1&&!h?u.jsx(If,{settings:t==null?void 0:t.settings,components:{...t==null?void 0:t.components,Loader:p}}):l&&!l.message.includes("has already been started")?u.jsx(m,{errorMessage:l.message}):u.jsx(Ie.IOConnectProvider,{settings:i({type:"simple",user:a}),onInitError:d,fallback:u.jsx(p,{text:"Initializing the platform..."}),children:u.jsx(kc,{launchpadMode:(b=r==null?void 0:r.settings)==null?void 0:b.mode,children:u.jsx(Rf,{workspaces:o,launchpad:r,onLogout:y,isBeforeunloadDialogEnabled:(S=e.settings)==null?void 0:S.isBeforeunloadDialogEnabled,Loader:p})})}):u.jsx(p4,{onLogin:g,userInputName:n.userInputName,components:{...n.components,Loader:p}})},A4=lt({message:Gt}),_4=e=>{const t=Fw(),[n,o]=v.useState(void 0),[r,i]=Gn("sessionStorage",o3,A4),a=v.useMemo(()=>t.user?(e==null?void 0:e(t.user))??{ok:!0}:null,[t.user,e]),s=(a==null?void 0:a.ok)===!1,c=t.isLoading||t.isAuthenticated&&!n,l=s||c,d=v.useMemo(()=>{var f;return a!=null&&a.ok&&((f=t.user)!=null&&f.email)&&n?{username:t.user.name,id:t.user.email,token:n}:null},[t.user,n,a==null?void 0:a.ok]);return v.useEffect(()=>{t.isAuthenticated&&t.getAccessTokenSilently().then(o).catch(console.warn)},[t]),v.useEffect(()=>{if(a){if(a.ok){i(null);return}i({message:a.message}),t.logout()}},[t,i,a]),{isLoading:l,validationError:r,user:d}},id={POPUP:"popup",REDIRECT:"redirect"},j4=({config:e})=>{var b,S,x,C;const t=Fw(),{setupFlow:n,login:o,launchpad:r,workspaces:i,getIOConnectConfig:a}=e,{isLoading:s,validationError:c,user:l}=_4(o.validateUser),f=(o.loginType??id.REDIRECT)===id.REDIRECT?t.loginWithRedirect:t.loginWithPopup,[h]=Gn("localStorage",Sa,ka),[p,m]=v.useState(null),{login:{isLoggingOut:g}}=Yo(),y=nf(),w=((b=e.components)==null?void 0:b.SystemLoader)??Xo,k=((S=e.components)==null?void 0:S.IOInitErrorScreen)??Tf;return g?u.jsx(w,{text:"Logging out..."}):l?!(h!=null&&h.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&!y?u.jsx(If,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:w}}):p&&!p.message.includes("has already been started")?u.jsx(k,{errorMessage:p.message}):u.jsx(Ie.IOConnectProvider,{settings:a({type:"auth0",user:{...t.user,id:l.id,token:l.token}}),onInitError:m,fallback:u.jsx(w,{text:"Initializing the platform..."}),children:u.jsx(kc,{launchpadMode:(x=r==null?void 0:r.settings)==null?void 0:x.mode,children:u.jsx(Rf,{workspaces:i,launchpad:r,onLogout:t.logout,isBeforeunloadDialogEnabled:(C=e.settings)==null?void 0:C.isBeforeunloadDialogEnabled,Loader:w})})}):u.jsx(f4,{onLogin:f,isLoading:s,validationError:c,components:{...o.components,Loader:w}})},nm=({config:e})=>{var g,y,w,k;const{setupFlow:t,launchpad:n,workspaces:o,getIOConnectConfig:r}=e,{onLogout:i,user:a}=e.login??{},{isPlatformWindow:s}=af(),[c]=Gn("localStorage",Sa,ka),[l,d]=v.useState(null),{login:{isLoggingOut:f}}=Yo(),h=nf(),p=((g=e.components)==null?void 0:g.SystemLoader)??Xo,m=((y=e.components)==null?void 0:y.IOInitErrorScreen)??Tf;return f?u.jsx(p,{text:"Logging out..."}):!(c!=null&&c.isCompleted)&&(t==null?void 0:t.enabled)!==!1&&s&&!h?u.jsx(If,{settings:t==null?void 0:t.settings,components:{...t==null?void 0:t.components,Loader:p}}):l&&!l.message.includes("has already been started")?u.jsx(m,{errorMessage:l.message}):u.jsx(Ie.IOConnectProvider,{settings:r({type:"custom",user:a}),onInitError:d,fallback:u.jsx(p,{text:"Initializing the platform..."}),children:u.jsx(kc,{launchpadMode:(w=n==null?void 0:n.settings)==null?void 0:w.mode,children:u.jsx(Rf,{workspaces:o,launchpad:n,onLogout:i,isBeforeunloadDialogEnabled:(k=e.settings)==null?void 0:k.isBeforeunloadDialogEnabled,Loader:p})})})},eb=lt({Logo:Re(Ft().andThen(e=>un(e,"Logo"))),Heading:Re(Ft().andThen(e=>un(e,"Heading")))}),O4=fa(...Object.values(id).map(e=>Uo(e))),P4=lt({type:Uo("auth0"),validateUser:Re(Ft().andThen(e=>un(e,"validateUser"))),loginType:Re(O4),providerOptions:Ft(),components:Re(eb)}),N4=lt({type:Uo("simple"),onLogin:Ft().andThen(e=>un(e,"onLogin")),onLogout:Re(Ft().andThen(e=>un(e,"onLogout"))),userInputName:Re(Gt),components:Re(eb)}),I4=lt({id:Gt,username:Gt}),T4=lt({type:Uo("custom"),onLogout:Ft().andThen(e=>un(e,"onLogout")),user:I4}),R4=fa(P4,N4,T4),L4=lt({edgeNotificationsPermissionTimeout:Re(v3)}),D4=lt({Logo:Re(Ft().andThen(e=>un(e,"Logo")))}),M4=lt({enabled:Re(vi()),components:Re(D4),settings:Re(L4)}),$4=lt({components:Re(Ft())}),H4=lt({BeforeSearch:fa(Uo(null),Re(Ft().andThen(e=>un(e,"BeforeSearch")))),AfterSearch:fa(Uo(null),Re(Ft().andThen(e=>un(e,"AfterSearch"))))}),W4=lt({Component:Ft().andThen(e=>un(e,"Component")),placementId:Gt}),F4=lt({header:Re(H4),sections:Re(m3(W4))}),B4=lt({showHeader:Re(vi()),showSearch:Re(vi())}),z4=lt({header:Re(B4),mode:Re(fa(Uo("pinned"),Uo("default")))}),U4=lt({components:Re(F4),settings:Re(z4)}),K4=lt({SystemLoader:Re(Ft().andThen(e=>un(e,"SystemLoader"))),IOInitErrorScreen:Re(Ft().andThen(e=>un(e,"IOInitErrorScreen")))}),V4=lt({isBeforeunloadDialogEnabled:Re(vi())}),G4=lt({getIOConnectConfig:Ft().andThen(e=>un(e,"getIOConnectConfig")),login:Re(R4),setupFlow:Re(M4),workspaces:Re($4),launchpad:Re(U4),components:Re(K4),settings:Re(V4)}),q4=({config:e})=>{var i;const t=v.useMemo(()=>G4.runWithException(e),[e]),n=t.login,{isPlatformWindow:o}=af();if(!n||!o){const{login:a,...s}=t;return u.jsx(nm,{config:s})}if(n.type==="custom")return u.jsx(nm,{config:t});if(n.type==="simple")return u.jsx(E4,{config:t});const{providerOptions:r}=n;return u.jsx(QA,{...r,authorizationParams:{...r.authorizationParams,redirect_uri:((i=r.authorizationParams)==null?void 0:i.redirect_uri)??window.location.origin},children:u.jsx(j4,{config:t})})};const J4=({config:e})=>u.jsx(CE,{children:u.jsx(q4,{config:e})});exports.ApplicationsSection=x1;exports.FavoritesSection=S1;exports.IOActivePanelRenderer=_S;exports.IOConnectHome=J4;exports.IODownloadManager=_2;exports.IONotifications=Hd;exports.IOPreferencesDesktop=jS;exports.IOProfile=Ny;exports.Launchpad=D1;exports.LaunchpadAccess=F1;exports.LaunchpadBody=L1;exports.LaunchpadContentsContainer=j1;exports.LaunchpadHeader=P1;exports.LaunchpadPinButton=O1;exports.NotificationSettingsPanel=Gw;exports.NotificationsPanel=Xw;exports.NotificationsPanelButton=Yw;exports.NotificationsPanelWithToggleButton=Qw;exports.PanelWithToggleButton=df;exports.PlatformPrefsProvider=kc;exports.PreferencesPanel=qw;exports.ProfilePanel=Jw;exports.Section=$c;exports.SystemLoader=Xo;exports.SystemMenu=Zw;exports.WorkspacesSection=N1;exports.useFavorites=Lc;exports.useIsLaunchpadCollapsed=tf;exports.usePlatformPref=Tt;exports.usePlatformPrefs=iv;
|
|
64
|
+
`)})(),this.lockManager=(Zl||(Zl=IE()),Zl),t.cache&&t.cacheLocation&&console.warn("Both `cache` and `cacheLocation` options have been specified in the Auth0Client configuration; ignoring `cacheLocation` and using `cache`."),t.cache)o=t.cache;else{if(n=t.cacheLocation||Yp,!am(n))throw new Error('Invalid cache location "'.concat(n,'"'));o=am(n)()}var r;this.httpTimeoutMs=t.httpTimeoutInSeconds?1e3*t.httpTimeoutInSeconds:1e4,this.cookieStorage=t.legacySameSiteCookie===!1?oi:o4,this.orgHintCookieName=(r=this.options.clientId,"auth0.".concat(r,".organization_hint")),this.isAuthenticatedCookieName=(u=>"auth0.".concat(u,".is.authenticated"))(this.options.clientId),this.sessionCheckExpiryDays=t.sessionCheckExpiryDays||1;const i=t.useCookiesForTransactions?this.cookieStorage:r4;var a;this.scope=function(u,d){for(var f=arguments.length,h=new Array(f>2?f-2:0),p=2;p<f;p++)h[p-2]=arguments[p];if(typeof u!="object")return{[Vt]:$s(d,u,...h)};let m={[Vt]:$s(d,...h)};return Object.keys(u).forEach(g=>{const y=u[g];m[g]=$s(d,y,...h)}),m}(this.options.authorizationParams.scope,"openid",this.options.useRefreshTokens?"offline_access":""),this.transactionManager=new YE(i,this.options.clientId,this.options.cookieDomain),this.nowProvider=this.options.nowProvider||Cw,this.cacheManager=new ZE(o,o.allKeys?void 0:new s4(o,this.options.clientId),this.nowProvider),this.dpop=this.options.useDpop?new u4(this.options.clientId):void 0,this.domainUrl=(a=this.options.domain,/^https?:\/\//.test(a)?a:"https://".concat(a)),this.tokenIssuer=((u,d)=>u?u.startsWith("https://")?u:"https://".concat(u,"/"):"".concat(d,"/"))(this.options.issuer,this.domainUrl);const s="".concat(this.domainUrl,"/me/"),c=this.createFetcher(Object.assign(Object.assign({},this.options.useDpop&&{dpopNonceId:"__auth0_my_account_api__"}),{getAccessToken:()=>this.getTokenSilently({authorizationParams:{scope:"create:me:connected_accounts",audience:s},detailedResponse:!0})}));this.myAccountApi=new f4(c,s),this.authJsClient=new Pj({domain:this.options.domain,clientId:this.options.clientId}),this.mfa=new Rj(this.authJsClient.mfa,this),typeof window<"u"&&window.Worker&&this.options.useRefreshTokens&&n===Yp&&(this.options.workerUrl?this.worker=new Worker(this.options.workerUrl):this.worker=new a4)}getConfiguration(){return Object.freeze({domain:this.options.domain,clientId:this.options.clientId})}_url(t){const n=this.options.auth0Client||kw,o=Ew(n,!0),r=encodeURIComponent(btoa(JSON.stringify(o)));return"".concat(this.domainUrl).concat(t,"&auth0Client=").concat(r)}_authorizeUrl(t){return this._url("/authorize?".concat(hd(t)))}async _verifyIdToken(t,n,o){const r=await this.nowProvider();return QE({iss:this.tokenIssuer,aud:this.options.clientId,id_token:t,nonce:n,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(t){t?this.cookieStorage.save(this.orgHintCookieName,t,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}):this.cookieStorage.remove(this.orgHintCookieName,{cookieDomain:this.options.cookieDomain})}_extractSessionTransferToken(t){return new URLSearchParams(window.location.search).get(t)||void 0}_clearSessionTransferTokenFromUrl(t){try{const n=new URL(window.location.href);n.searchParams.has(t)&&(n.searchParams.delete(t),window.history.replaceState({},"",n.toString()))}catch{}}_applySessionTransferToken(t){const n=this.options.sessionTransferTokenQueryParamName;if(!n||t.session_transfer_token)return t;const o=this._extractSessionTransferToken(n);return o?(this._clearSessionTransferTokenFromUrl(n),Object.assign(Object.assign({},t),{session_transfer_token:o})):t}async _prepareAuthorizeUrl(t,n,o){var r;const i=Vl(Xi()),a=Vl(Xi()),s=Xi(),c=await Xp(s),u=em(c),d=await((r=this.dpop)===null||r===void 0?void 0:r.calculateThumbprint()),f=((p,m,g,y,w,S,b,k,x)=>Object.assign(Object.assign(Object.assign({client_id:p.clientId},p.authorizationParams),g),{scope:ms(m,g.scope,g.audience),response_type:"code",response_mode:k||"query",state:y,nonce:w,redirect_uri:b||p.authorizationParams.redirect_uri,code_challenge:S,code_challenge_method:"S256",dpop_jkt:x}))(this.options,this.scope,t,i,a,u,t.redirect_uri||this.options.authorizationParams.redirect_uri||o,n==null?void 0:n.response_mode,d),h=this._authorizeUrl(f);return{nonce:a,code_verifier:s,scope:f.scope,audience:f.audience||Vt,redirect_uri:f.redirect_uri,state:i,url:h}}async loginWithPopup(t,n){var o;if(t=t||{},!(n=n||{}).popup&&(n.popup=(c=>{const u=window.screenX+(window.innerWidth-400)/2,d=window.screenY+(window.innerHeight-600)/2;return window.open(c,"auth0:authorize:popup","left=".concat(u,",top=").concat(d,",width=").concat(400,",height=").concat(600,",resizable,scrollbars=yes,status=1"))})(""),!n.popup))throw new zf;const r=this._applySessionTransferToken(t.authorizationParams||{}),i=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);n.popup.location.href=i.url;const a=await(c=>new Promise((u,d)=>{let f;const h=setInterval(()=>{c.popup&&c.popup.closed&&(clearInterval(h),clearTimeout(p),window.removeEventListener("message",f,!1),d(new Ff(c.popup)))},1e3),p=setTimeout(()=>{clearInterval(h),d(new Wf(c.popup)),window.removeEventListener("message",f,!1)},1e3*(c.timeoutInSeconds||60));f=function(m){if(m.data&&m.data.type==="authorization_response"){if(clearTimeout(p),clearInterval(h),window.removeEventListener("message",f,!1),c.closePopup!==!1&&c.popup.close(),m.data.response.error)return d(tt.fromPayload(m.data.response));u(m.data.response)}},window.addEventListener("message",f)}))(Object.assign(Object.assign({},n),{timeoutInSeconds:n.timeoutInSeconds||this.options.authorizeTimeoutInSeconds||60}));if(i.state!==a.state)throw new tt("state_mismatch","Invalid state");const s=((o=t.authorizationParams)===null||o===void 0?void 0:o.organization)||this.options.authorizationParams.organization;await this._requestToken({audience:i.audience,scope:i.scope,code_verifier:i.code_verifier,grant_type:"authorization_code",code:a.code,redirect_uri:i.redirect_uri},{nonceIn:i.nonce,organization:s})}async getUser(){var t;const n=await this._getIdTokenFromCache();return(t=n==null?void 0:n.decodedToken)===null||t===void 0?void 0:t.user}async getIdTokenClaims(){var t;const n=await this._getIdTokenFromCache();return(t=n==null?void 0:n.decodedToken)===null||t===void 0?void 0:t.claims}async loginWithRedirect(){var t;const n=sm(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}),{openUrl:o,fragment:r,appState:i}=n,a=An(n,["openUrl","fragment","appState"]),s=((t=a.authorizationParams)===null||t===void 0?void 0:t.organization)||this.options.authorizationParams.organization,c=this._applySessionTransferToken(a.authorizationParams||{}),u=await this._prepareAuthorizeUrl(c),{url:d}=u,f=An(u,["url"]);this.transactionManager.create(Object.assign(Object.assign(Object.assign({},f),{appState:i,response_type:Do.Code}),s&&{organization:s}));const h=r?"".concat(d,"#").concat(r):d;o?await o(h):window.location.assign(h)}async handleRedirectCallback(){const t=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.location.href).split("?").slice(1);if(t.length===0)throw new Error("There are no query params available for parsing.");const n=this.transactionManager.get();if(!n)throw new tt("missing_transaction","Invalid state");this.transactionManager.remove();const o=(r=>{r.indexOf("#")>-1&&(r=r.substring(0,r.indexOf("#")));const i=new URLSearchParams(r);return{state:i.get("state"),code:i.get("code")||void 0,connect_code:i.get("connect_code")||void 0,error:i.get("error")||void 0,error_description:i.get("error_description")||void 0}})(t.join(""));return n.response_type===Do.ConnectCode?this._handleConnectAccountRedirectCallback(o,n):this._handleLoginRedirectCallback(o,n)}async _handleLoginRedirectCallback(t,n){const{code:o,state:r,error:i,error_description:a}=t;if(i)throw new Hf(i,a||i,r,n.appState);if(!n.code_verifier||n.state&&n.state!==r)throw new tt("state_mismatch","Invalid state");const s=n.organization,c=n.nonce,u=n.redirect_uri;return await this._requestToken(Object.assign({audience:n.audience,scope:n.scope,code_verifier:n.code_verifier,grant_type:"authorization_code",code:o},u?{redirect_uri:u}:{}),{nonceIn:c,organization:s}),{appState:n.appState,response_type:Do.Code}}async _handleConnectAccountRedirectCallback(t,n){const{connect_code:o,state:r,error:i,error_description:a}=t;if(i)throw new Bf(i,a||i,n.connection,r,n.appState);if(!o)throw new tt("missing_connect_code","Missing connect code");if(!(n.code_verifier&&n.state&&n.auth_session&&n.redirect_uri&&n.state===r))throw new tt("state_mismatch","Invalid state");const s=await this.myAccountApi.completeAccount({auth_session:n.auth_session,connect_code:o,redirect_uri:n.redirect_uri,code_verifier:n.code_verifier});return Object.assign(Object.assign({},s),{appState:n.appState,response_type:Do.ConnectCode})}async checkSession(t){if(!this.cookieStorage.get(this.isAuthenticatedCookieName)){if(!this.cookieStorage.get(im))return;this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this.cookieStorage.remove(im)}try{await this.getTokenSilently(t)}catch{}}async getTokenSilently(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n,o;const r=Object.assign(Object.assign({cacheMode:"on"},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:ms(this.scope,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope,((o=t.authorizationParams)===null||o===void 0?void 0:o.audience)||this.options.authorizationParams.audience)})}),i=await((a,s)=>{let c=Ql[s];return c||(c=a().finally(()=>{delete Ql[s],c=null}),Ql[s]=c),c})(()=>this._getTokenSilently(r),"".concat(this.options.clientId,"::").concat(r.authorizationParams.audience,"::").concat(r.authorizationParams.scope));return t.detailedResponse?i:i==null?void 0:i.access_token}async _getTokenSilently(t){const{cacheMode:n}=t,o=An(t,["cacheMode"]);if(n!=="off"){const s=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||Vt,clientId:this.options.clientId,cacheMode:n});if(s)return s}if(n==="cache-only")return;const r=(i=this.options.clientId,a=o.authorizationParams.audience||"default","".concat("auth0.lock.getTokenSilently",".").concat(i,".").concat(a));var i,a;try{return await this.lockManager.runWithLock(r,5e3,async()=>{if(n!=="off"){const p=await this._getEntryFromCache({scope:o.authorizationParams.scope,audience:o.authorizationParams.audience||Vt,clientId:this.options.clientId});if(p)return p}const s=this.options.useRefreshTokens?await this._getTokenUsingRefreshToken(o):await this._getTokenFromIFrame(o),{id_token:c,token_type:u,access_token:d,oauthTokenScope:f,expires_in:h}=s;return Object.assign(Object.assign({id_token:c,token_type:u,access_token:d},f?{scope:f}:null),{expires_in:h})})}catch(s){if(this._isInteractiveError(s)&&this.options.interactiveErrorHandler==="popup")return await this._handleInteractiveErrorWithPopup(o);throw s}}_isInteractiveError(t){return t instanceof Ri||t instanceof tt&&this._isIframeMfaError(t)}_isIframeMfaError(t){return t.error==="login_required"&&t.error_description==="Multifactor authentication required"}async _handleInteractiveErrorWithPopup(t){try{await this.loginWithPopup({authorizationParams:t.authorizationParams});const n=await this._getEntryFromCache({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||Vt,clientId:this.options.clientId});if(!n)throw new tt("interactive_handler_cache_miss","Token not found in cache after interactive authentication");return n}catch(n){throw n}}async getTokenWithPopup(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};var o,r;const i=Object.assign(Object.assign({},t),{authorizationParams:Object.assign(Object.assign(Object.assign({},this.options.authorizationParams),t.authorizationParams),{scope:ms(this.scope,(o=t.authorizationParams)===null||o===void 0?void 0:o.scope,((r=t.authorizationParams)===null||r===void 0?void 0:r.audience)||this.options.authorizationParams.audience)})});return n=Object.assign(Object.assign({},jE),n),await this.loginWithPopup(i,n),(await this.cacheManager.get(new vn({scope:i.authorizationParams.scope,audience:i.authorizationParams.audience||Vt,clientId:this.options.clientId}),void 0,this.options.useMrrt)).access_token}async isAuthenticated(){return!!await this.getUser()}_buildLogoutUrl(t){t.clientId!==null?t.clientId=t.clientId||this.options.clientId:delete t.clientId;const n=t.logoutParams||{},{federated:o}=n,r=An(n,["federated"]),i=o?"&federated":"";return this._url("/v2/logout?".concat(hd(Object.assign({clientId:t.clientId},r))))+i}async logout(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};var n;const o=sm(t),{openUrl:r}=o,i=An(o,["openUrl"]);t.clientId===null?await this.cacheManager.clear():await this.cacheManager.clear(t.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(ni),await((n=this.dpop)===null||n===void 0?void 0:n.clear());const a=this._buildLogoutUrl(i);r?await r(a):r!==!1&&window.location.assign(a)}async _getTokenFromIFrame(t){const n=(o=this.options.clientId,"".concat("auth0.lock.getTokenFromIFrame",".").concat(o));var o;try{return await this.lockManager.runWithLock(n,5e3,async()=>{const r=Object.assign(Object.assign({},t.authorizationParams),{prompt:"none"}),i=this.cookieStorage.get(this.orgHintCookieName);i&&!r.organization&&(r.organization=i);const{url:a,state:s,nonce:c,code_verifier:u,redirect_uri:d,scope:f,audience:h}=await this._prepareAuthorizeUrl(r,{response_mode:"web_message"},window.location.origin);if(window.crossOriginIsolated)throw new tt("login_required","The application is running in a Cross-Origin Isolated context, silently retrieving a token without refresh token is not possible.");const p=t.timeoutInSeconds||this.options.authorizeTimeoutInSeconds;let m;try{m=new URL(this.domainUrl).origin}catch{m=this.domainUrl}const g=await function(w,S){let b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:60;return new Promise((k,x)=>{const C=window.document.createElement("iframe");C.setAttribute("width","0"),C.setAttribute("height","0"),C.style.display="none";const I=()=>{window.document.body.contains(C)&&(window.document.body.removeChild(C),window.removeEventListener("message",R,!1))};let R;const M=setTimeout(()=>{x(new Fi),I()},1e3*b);R=function(_){if(_.origin!=S||!_.data||_.data.type!=="authorization_response")return;const T=_.source;T&&T.close(),_.data.response.error?x(tt.fromPayload(_.data.response)):k(_.data.response),clearTimeout(M),window.removeEventListener("message",R,!1),setTimeout(I,2e3)},window.addEventListener("message",R,!1),window.document.body.appendChild(C),C.setAttribute("src",w)})}(a,m,p);if(s!==g.state)throw new tt("state_mismatch","Invalid state");const y=await this._requestToken(Object.assign(Object.assign({},t.authorizationParams),{code_verifier:u,code:g.code,grant_type:"authorization_code",redirect_uri:d,timeout:t.authorizationParams.timeout||this.httpTimeoutMs}),{nonceIn:c,organization:r.organization});return Object.assign(Object.assign({},y),{scope:f,oauthTokenScope:y.scope,audience:h})})}catch(r){throw r.error==="login_required"&&(r instanceof tt&&this._isIframeMfaError(r)&&this.options.interactiveErrorHandler==="popup"||this.logout({openUrl:!1})),r}}async _getTokenUsingRefreshToken(t){var n,o;const r=await this.cacheManager.get(new vn({scope:t.authorizationParams.scope,audience:t.authorizationParams.audience||Vt,clientId:this.options.clientId}),void 0,this.options.useMrrt);if(!(r&&r.refresh_token||this.worker)){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);throw new al(t.authorizationParams.audience||Vt,t.authorizationParams.scope)}const i=t.authorizationParams.redirect_uri||this.options.authorizationParams.redirect_uri||window.location.origin,a=typeof t.timeoutInSeconds=="number"?1e3*t.timeoutInSeconds:null,s=((h,p,m,g)=>{var y;if(h&&m&&g){if(p.audience!==m)return p.scope;const w=g.split(" "),S=((y=p.scope)===null||y===void 0?void 0:y.split(" "))||[],b=S.every(k=>w.includes(k));return w.length>=S.length&&b?g:p.scope}return p.scope})(this.options.useMrrt,t.authorizationParams,r==null?void 0:r.audience,r==null?void 0:r.scope);try{const h=await this._requestToken(Object.assign(Object.assign(Object.assign({},t.authorizationParams),{grant_type:"refresh_token",refresh_token:r&&r.refresh_token,redirect_uri:i}),a&&{timeout:a}),{scopesToRequest:s});if(h.refresh_token&&(r!=null&&r.refresh_token)&&await this.cacheManager.updateEntry(r.refresh_token,h.refresh_token),this.options.useMrrt&&(c=r==null?void 0:r.audience,u=r==null?void 0:r.scope,d=t.authorizationParams.audience,f=t.authorizationParams.scope,(c!==d||!cm(f,u))&&!cm(s,h.scope))){if(this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t);await this.cacheManager.remove(this.options.clientId,t.authorizationParams.audience,t.authorizationParams.scope);const p=((m,g)=>{const y=(m==null?void 0:m.split(" "))||[],w=(g==null?void 0:g.split(" "))||[];return y.filter(S=>w.indexOf(S)==-1).join(",")})(s,h.scope);throw new Uf(t.authorizationParams.audience||"default",p)}return Object.assign(Object.assign({},h),{scope:t.authorizationParams.scope,oauthTokenScope:h.scope,audience:t.authorizationParams.audience||Vt})}catch(h){if(h.message){if(h.message.includes("user is blocked"))throw await this.logout({openUrl:!1}),h;if((h.message.includes("Missing Refresh Token")||h.message.includes("invalid refresh token"))&&this.options.useRefreshTokensFallback)return await this._getTokenFromIFrame(t)}throw h instanceof Ri&&this.mfa.setMFAAuthDetails(h.mfa_token,(n=t.authorizationParams)===null||n===void 0?void 0:n.scope,(o=t.authorizationParams)===null||o===void 0?void 0:o.audience,h.mfa_requirements),h}var c,u,d,f}async _saveEntryInCache(t){const{id_token:n,decodedToken:o}=t,r=An(t,["id_token","decodedToken"]);this.userCache.set(ni,{id_token:n,decodedToken:o}),await this.cacheManager.setIdToken(this.options.clientId,t.id_token,t.decodedToken),await this.cacheManager.set(r)}async _getIdTokenFromCache(){const t=this.options.authorizationParams.audience||Vt,n=this.scope[t],o=await this.cacheManager.getIdToken(new vn({clientId:this.options.clientId,audience:t,scope:n})),r=this.userCache.get(ni);return o&&o.id_token===(r==null?void 0:r.id_token)?r:(this.userCache.set(ni,o),o)}async _getEntryFromCache(t){let{scope:n,audience:o,clientId:r,cacheMode:i}=t;const a=await this.cacheManager.get(new vn({scope:n,audience:o,clientId:r}),60,this.options.useMrrt,i);if(a&&a.access_token){const{token_type:s,access_token:c,oauthTokenScope:u,expires_in:d}=a,f=await this._getIdTokenFromCache();return f&&Object.assign(Object.assign({id_token:f.id_token,token_type:s||"Bearer",access_token:c},u?{scope:u}:null),{expires_in:d})}}async _requestToken(t,n){var o,r;const{nonceIn:i,organization:a,scopesToRequest:s}=n||{},c=await qE(Object.assign(Object.assign({baseUrl:this.domainUrl,client_id:this.options.clientId,auth0Client:this.options.auth0Client,useFormData:this.options.useFormData,timeout:this.httpTimeoutMs,useMrrt:this.options.useMrrt,dpop:this.dpop},t),{scope:s||t.scope}),this.worker),u=await this._verifyIdToken(c.id_token,i,a);if(t.grant_type==="authorization_code"){const d=await this._getIdTokenFromCache();!((r=(o=d==null?void 0:d.decodedToken)===null||o===void 0?void 0:o.claims)===null||r===void 0)&&r.sub&&d.decodedToken.claims.sub!==u.claims.sub&&(await this.cacheManager.clear(this.options.clientId),this.userCache.remove(ni))}return await this._saveEntryInCache(Object.assign(Object.assign(Object.assign(Object.assign({},c),{decodedToken:u,scope:t.scope,audience:t.audience||Vt}),c.scope?{oauthTokenScope:c.scope}:null),{client_id:this.options.clientId})),this.cookieStorage.save(this.isAuthenticatedCookieName,!0,{daysUntilExpire:this.sessionCheckExpiryDays,cookieDomain:this.options.cookieDomain}),this._processOrgHint(a||u.claims.org_id),Object.assign(Object.assign({},c),{decodedToken:u})}async loginWithCustomTokenExchange(t){return this._requestToken(Object.assign(Object.assign({},t),{grant_type:"urn:ietf:params:oauth:grant-type:token-exchange",subject_token:t.subject_token,subject_token_type:t.subject_token_type,scope:ms(this.scope,t.scope,t.audience||this.options.authorizationParams.audience),audience:t.audience||this.options.authorizationParams.audience,organization:t.organization||this.options.authorizationParams.organization}))}async exchangeToken(t){return this.loginWithCustomTokenExchange(t)}_assertDpop(t){if(!t)throw new Error("`useDpop` option must be enabled before using DPoP.")}getDpopNonce(t){return this._assertDpop(this.dpop),this.dpop.getNonce(t)}setDpopNonce(t,n){return this._assertDpop(this.dpop),this.dpop.setNonce(t,n)}generateDpopProof(t){return this._assertDpop(this.dpop),this.dpop.generateProof(t)}createFetcher(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return new d4(t,{isDpopEnabled:()=>!!this.options.useDpop,getAccessToken:n=>{var o;return this.getTokenSilently({authorizationParams:{scope:(o=n==null?void 0:n.scope)===null||o===void 0?void 0:o.join(" "),audience:n==null?void 0:n.audience},detailedResponse:!0})},getDpopNonce:()=>this.getDpopNonce(t.dpopNonceId),setDpopNonce:n=>this.setDpopNonce(n,t.dpopNonceId),generateDpopProof:n=>this.generateDpopProof(n)})}async connectAccountWithRedirect(t){const{openUrl:n,appState:o,connection:r,scopes:i,authorization_params:a,redirectUri:s=this.options.authorizationParams.redirect_uri||window.location.origin}=t;if(!r)throw new Error("connection is required");const c=Vl(Xi()),u=Xi(),d=await Xp(u),f=em(d),{connect_uri:h,connect_params:p,auth_session:m}=await this.myAccountApi.connectAccount({connection:r,scopes:i,redirect_uri:s,state:c,code_challenge:f,code_challenge_method:"S256",authorization_params:a});this.transactionManager.create({state:c,code_verifier:u,auth_session:m,redirect_uri:s,appState:o,connection:r,response_type:Do.ConnectCode});const g=new URL(h);g.searchParams.set("ticket",p.ticket),n?await n(g.toString()):window.location.assign(g)}async _requestTokenForMfa(t,n){const{mfaToken:o}=t,r=An(t,["mfaToken"]);return this._requestToken(Object.assign(Object.assign({},r),{mfa_token:o}),n)}}var xb={isAuthenticated:!1,isLoading:!0,error:void 0,user:void 0},ft=function(){throw new Error("You forgot to wrap your component in <Auth0Provider>.")},Dj=Ot(Ot({},xb),{buildAuthorizeUrl:ft,buildLogoutUrl:ft,getAccessTokenSilently:ft,getAccessTokenWithPopup:ft,getIdTokenClaims:ft,loginWithCustomTokenExchange:ft,exchangeToken:ft,loginWithRedirect:ft,loginWithPopup:ft,connectAccountWithRedirect:ft,logout:ft,handleRedirectCallback:ft,getDpopNonce:ft,setDpopNonce:ft,generateDpopProof:ft,createFetcher:ft,getConfiguration:ft,mfa:{getAuthenticators:ft,enroll:ft,challenge:ft,verify:ft,getEnrollmentFactors:ft}}),Sb=v.createContext(Dj),Lm=function(e){CE(t,e);function t(n,o){var r=e.call(this,o??n)||this;return r.error=n,r.error_description=o,Object.setPrototypeOf(r,t.prototype),r}return t}(Error),Mj=/[?&](?:connect_)?code=[^&]+/,$j=/[?&]state=[^&]+/,Hj=/[?&]error=[^&]+/,Bj=function(e){return e===void 0&&(e=window.location.search),(Mj.test(e)||Hj.test(e))&&$j.test(e)},kb=function(e){return function(t){if(t instanceof Error)return t;if(t!==null&&typeof t=="object"&&"error"in t&&typeof t.error=="string"){if("error_description"in t&&typeof t.error_description=="string"){var n=t;return new Lm(n.error,n.error_description)}var o=t;return new Lm(o.error)}return new Error(e)}},Dm=kb("Login failed"),As=kb("Get access token failed"),Cb=function(e){var t,n;e!=null&&e.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"),e.authorizationParams=(t=e.authorizationParams)!==null&&t!==void 0?t:{},e.authorizationParams.redirect_uri=e.redirectUri,delete e.redirectUri),!((n=e==null?void 0:e.authorizationParams)===null||n===void 0)&&n.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"),e.authorizationParams.redirect_uri=e.authorizationParams.redirectUri,delete e.authorizationParams.redirectUri)},Wj=function(e,t){switch(t.type){case"LOGIN_POPUP_STARTED":return Ot(Ot({},e),{isLoading:!0});case"LOGIN_POPUP_COMPLETE":case"INITIALISED":return Ot(Ot({},e),{isAuthenticated:!!t.user,user:t.user,isLoading:!1,error:void 0});case"HANDLE_REDIRECT_COMPLETE":case"GET_ACCESS_TOKEN_COMPLETE":return e.user===t.user?e:Ot(Ot({},e),{isAuthenticated:!!t.user,user:t.user});case"LOGOUT":return Ot(Ot({},e),{isAuthenticated:!1,user:void 0});case"ERROR":return Ot(Ot({},e),{isLoading:!1,error:t.error})}},Fj=function(e){return Cb(e),Ot(Ot({},e),{auth0Client:{name:"auth0-react",version:"2.16.0"}})},zj=function(e){var t;window.history.replaceState({},document.title,(t=e.returnTo)!==null&&t!==void 0?t:window.location.pathname)},Uj=function(e){var t=e,n=t.children,o=t.skipRedirectCallback,r=t.onRedirectCallback,i=r===void 0?zj:r,a=t.context,s=a===void 0?Sb:a,c=t.client,u=Zp(t,["children","skipRedirectCallback","onRedirectCallback","context","client"]);c&&(u.domain||u.clientId)&&console.warn("Auth0Provider: the `client` prop takes precedence over `domain`/`clientId` and other configuration options. Remove `domain`, `clientId`, and any other Auth0Client configuration props when using the `client` prop.");var d=v.useState(function(){return c??new Lj(Fj(u))})[0],f=v.useReducer(Wj,xb),h=f[0],p=f[1],m=v.useRef(!1),g=v.useCallback(function(L){return p({type:"ERROR",error:L}),L},[]);v.useEffect(function(){m.current||(m.current=!0,function(){return jo(void 0,void 0,void 0,function(){var L,G,F,N,$,H,B;return Ao(this,function(E){switch(E.label){case 0:return E.trys.push([0,7,,8]),L=void 0,Bj()&&!o?[4,d.handleRedirectCallback()]:[3,3];case 1:return G=E.sent(),F=G.appState,N=F===void 0?{}:F,$=G.response_type,H=Zp(G,["appState","response_type"]),[4,d.getUser()];case 2:return L=E.sent(),N.response_type=$,$===Do.ConnectCode&&(N.connectedAccount=H),i(N,L),[3,6];case 3:return[4,d.checkSession()];case 4:return E.sent(),[4,d.getUser()];case 5:L=E.sent(),E.label=6;case 6:return p({type:"INITIALISED",user:L}),[3,8];case 7:return B=E.sent(),g(Dm(B)),[3,8];case 8:return[2]}})})}())},[d,i,o,g]);var y=v.useCallback(function(L){return Cb(L),d.loginWithRedirect(L)},[d]),w=v.useCallback(function(L,G){return jo(void 0,void 0,void 0,function(){var F,N;return Ao(this,function($){switch($.label){case 0:p({type:"LOGIN_POPUP_STARTED"}),$.label=1;case 1:return $.trys.push([1,3,,4]),[4,d.loginWithPopup(L,G)];case 2:return $.sent(),[3,4];case 3:return F=$.sent(),g(Dm(F)),[2];case 4:return[4,d.getUser()];case 5:return N=$.sent(),p({type:"LOGIN_POPUP_COMPLETE",user:N}),[2]}})})},[d,g]),S=v.useCallback(function(){for(var L=[],G=0;G<arguments.length;G++)L[G]=arguments[G];return jo(void 0,EE([],L,!0),void 0,function(F){return F===void 0&&(F={}),Ao(this,function(N){switch(N.label){case 0:return[4,d.logout(F)];case 1:return N.sent(),(F.openUrl||F.openUrl===!1)&&p({type:"LOGOUT"}),[2]}})})},[d]),b=v.useCallback(function(L){return jo(void 0,void 0,void 0,function(){var G,F,N,$;return Ao(this,function(H){switch(H.label){case 0:return H.trys.push([0,2,3,5]),[4,d.getTokenSilently(L)];case 1:return G=H.sent(),[3,5];case 2:throw F=H.sent(),As(F);case 3:return N=p,$={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,d.getUser()];case 4:return N.apply(void 0,[($.user=H.sent(),$)]),[7];case 5:return[2,G]}})})},[d]),k=v.useCallback(function(L,G){return jo(void 0,void 0,void 0,function(){var F,N,$,H;return Ao(this,function(B){switch(B.label){case 0:return B.trys.push([0,2,3,5]),[4,d.getTokenWithPopup(L,G)];case 1:return F=B.sent(),[3,5];case 2:throw N=B.sent(),As(N);case 3:return $=p,H={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,d.getUser()];case 4:return $.apply(void 0,[(H.user=B.sent(),H)]),[7];case 5:return[2,F]}})})},[d]),x=v.useCallback(function(L){return d.connectAccountWithRedirect(L)},[d]),C=v.useCallback(function(){return d.getIdTokenClaims()},[d]),I=v.useCallback(function(L){return jo(void 0,void 0,void 0,function(){var G,F,N,$;return Ao(this,function(H){switch(H.label){case 0:return H.trys.push([0,2,3,5]),[4,d.loginWithCustomTokenExchange(L)];case 1:return G=H.sent(),[3,5];case 2:throw F=H.sent(),As(F);case 3:return N=p,$={type:"GET_ACCESS_TOKEN_COMPLETE"},[4,d.getUser()];case 4:return N.apply(void 0,[($.user=H.sent(),$)]),[7];case 5:return[2,G]}})})},[d]),R=v.useCallback(function(L){return jo(void 0,void 0,void 0,function(){return Ao(this,function(G){return[2,I(L)]})})},[I]),M=v.useCallback(function(L){return jo(void 0,void 0,void 0,function(){var G,F,N;return Ao(this,function($){switch($.label){case 0:return $.trys.push([0,2,3,5]),[4,d.handleRedirectCallback(L)];case 1:return[2,$.sent()];case 2:throw G=$.sent(),As(G);case 3:return F=p,N={type:"HANDLE_REDIRECT_COMPLETE"},[4,d.getUser()];case 4:return F.apply(void 0,[(N.user=$.sent(),N)]),[7];case 5:return[2]}})})},[d]),_=v.useCallback(function(L){return d.getDpopNonce(L)},[d]),T=v.useCallback(function(L,G){return d.setDpopNonce(L,G)},[d]),P=v.useCallback(function(L){return d.generateDpopProof(L)},[d]),X=v.useCallback(function(L){return d.createFetcher(L)},[d]),te=v.useCallback(function(){return d.getConfiguration()},[d]),W=v.useMemo(function(){return d.mfa},[d]),J=v.useMemo(function(){return Ot(Ot({},h),{getAccessTokenSilently:b,getAccessTokenWithPopup:k,getIdTokenClaims:C,loginWithCustomTokenExchange:I,exchangeToken:R,loginWithRedirect:y,loginWithPopup:w,connectAccountWithRedirect:x,logout:S,handleRedirectCallback:M,getDpopNonce:_,setDpopNonce:T,generateDpopProof:P,createFetcher:X,getConfiguration:te,mfa:W})},[h,b,k,C,I,R,y,w,x,S,M,_,T,P,X,te,W]);return v.createElement(s.Provider,{value:J},n)},Eb=function(e){return e===void 0&&(e=Sb),v.useContext(e)};const jb=({className:e,children:t,Logo:n})=>l.jsxs("div",{className:pt("info-page-container",e),children:[l.jsx(n,{className:"info-page-logo"}),l.jsx("div",{className:"info-page-wrapper",children:t})]}),Kj={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"},Vj={loginPageLogo:Kj},Gj="200px",Ya=({logoSrc:e=Vj.loginPageLogo.value,width:t=Gj,className:n="logo"})=>l.jsx("img",{width:t,src:e,className:n,alt:"Login logo"}),Ab=()=>l.jsx("span",{className:"spinner"});const cr=({Logo:e=Ya,text:t="Loading..."})=>l.jsx("div",{className:"system-loader-background",children:l.jsxs("div",{className:"system-loader-container flex flex-column ai-center",children:[l.jsx(e,{}),l.jsx("h1",{className:"system-loader-text io-title",children:t}),l.jsx(Ab,{})]})});const Ob=({children:e,description:t,heading:n,Image:o,title:r,className:i})=>l.jsxs("div",{className:pt("info-card",i),children:[r&&l.jsx("h1",{className:"info-card-title io-title-large",children:r}),o&&l.jsx("div",{className:"info-card-image",children:l.jsx(o,{})}),n&&l.jsx("h3",{className:"info-card-heading io-title",children:n}),l.jsx("p",{className:"info-card-description io-text-default-lh16",children:t}),e]}),qj=({activeStepName:e,showWarnIcon:t,stepsStatuses:n})=>l.jsx("ul",{className:"setup-flow-list io-text-default-lh16",children:Ms.map(({name:o,label:r},i)=>{const a=o===e,s=n[o].state,c=t&&a?l.jsx(xt,{variant:"exclamation-mark",size:"12"}):l.jsxs("span",{children:[i+1,"."]});return l.jsx("li",{className:pt(a&&"active"),children:l.jsxs("div",{className:"setup-flow-list-item",children:[l.jsxs("div",{className:"setup-flow-list-item-icon-wrapper",children:[s==="prompt"&&c,s==="granted"&&l.jsx(xt,{variant:"check-solid",size:"12"}),s==="denied"&&l.jsx(xt,{variant:"close",size:"12"})]}),r]})},o)})}),Jj=({edgeNotificationsPermissionTimeout:e,isNotificationsPermissionPromptOpen:t})=>{const{name:n}=y5(),[o,r]=v.useState(!1);return v.useEffect(()=>{if(!t||n!=="Edge")return;const i=setTimeout(()=>r(!0),e);return()=>clearTimeout(i)},[n,e,t]),v.useEffect(()=>{t&&!o||r(!1)},[t,o,r]),{hasEdgeNotificationsPermissionError:o}},Zj=(e,t)=>{const{type:n,payload:o}=t;switch(n){case"completed":return{...e,[o.stepName]:{...e[o.stepName],isCompleted:!0}};case"skipped":return{...e,[o.stepName]:{isCompleted:!0,state:"denied"}};case"stateUpdated":{if(!o.state)throw Error('"stateUpdated" action invoked without state in payload');return{...e,[o.stepName]:{isCompleted:o.stepName===ht.POPUPS?o.state==="granted":o.state!=="prompt",state:o.state}}}default:throw Error("Unknown action: "+n)}},Yj=e=>{const{handleDeferredStep:t,handleOperationComplete:n}=e;window.getScreenDetails().catch(async()=>{const{state:o}=await navigator.permissions.query({name:Zo.WINDOW_MANAGEMENT});o==="prompt"&&t()}).finally(n)},Xj=e=>{const{handleDeferredStep:t,handleOperationComplete:n}=e;Notification.requestPermission().then(async()=>{const{state:o}=await navigator.permissions.query({name:Zo.NOTIFICATIONS});o==="prompt"&&t()}).finally(n)},Qj=e=>{const{handleDeferredStep:t,handleOperationComplete:n,dispatchAction:o}=e,r="about:blank",i="popup,width=1,height=1,top=9999,left=9999",a=window.open(r,void 0,i),s=window.open(r,void 0,i);a==null||a.close(),s==null||s.close();const c=!(a&&s);c&&t(),o({type:"stateUpdated",payload:{stepName:ht.POPUPS,state:c?"denied":"granted"}}),n()},eA=e=>{const{dispatchAction:t}=e;t({type:"completed",payload:{stepName:ht.PWA_INSTALL}})},tA={[ht.WINDOW_MANAGEMENT]:Yj,[ht.NOTIFICATIONS]:Xj,[ht.POPUPS]:Qj,[ht.PWA_INSTALL]:eA},nA=({settings:e})=>{const{permission:t}=sr(),[n,o]=Xn("localStorage",Fa,za),[r,i]=v.useReducer(Zj,SE),[a,s]=v.useState(!1),[c,u]=v.useState(!1),d=Ms.find(y=>!r[y.name].isCompleted);if(!d)throw new Error("All setup steps are completed. The SetupSteps component should not be used in such case.");const f=d.name,h=Ms[Ms.length-1].name,{hasEdgeNotificationsPermissionError:p}=Jj({edgeNotificationsPermissionTimeout:e.edgeNotificationsPermissionTimeout,isNotificationsPermissionPromptOpen:c&&f===Zo.NOTIFICATIONS}),m=()=>{s(!1),u(!0),tA[f]({handleDeferredStep:()=>s(!0),handleOperationComplete:()=>u(!1),dispatchAction:y=>i(y)}),f===h&&o({isCompleted:!0})},g=()=>{s(!1),i({type:"skipped",payload:{stepName:f}})};return v.useEffect(()=>{p&&(u(!1),s(!0))},[p]),v.useEffect(()=>{var y,w;s(!1),i({type:"stateUpdated",payload:{stepName:ht.WINDOW_MANAGEMENT,state:il?(y=t.statuses[ht.WINDOW_MANAGEMENT])==null?void 0:y.state:"denied"}}),i({type:"stateUpdated",payload:{stepName:ht.NOTIFICATIONS,state:(w=t.statuses[ht.NOTIFICATIONS])==null?void 0:w.state}})},[t.statuses]),l.jsxs(Ob,{description:d.description,heading:d.heading,Image:d.Image,title:"Platform Setup",children:[l.jsx(qj,{activeStepName:f,showWarnIcon:a&&f!==ht.POPUPS,stepsStatuses:r}),l.jsx("p",{className:"io-text-default-lh16",children:a?d.instructions.additional:d.instructions.initial}),l.jsxs(De,{children:[l.jsx(lc,{className:"io-btn io-btn-lg io-btn-primary setup-flow-btn",disabled:c,onClick:m,children:d.actionBtnText}),f!==h&&f!==ht.WINDOW_MANAGEMENT&&l.jsx(lc,{className:"io-btn io-btn-lg io-btn-outline setup-flow-btn",disabled:c,onClick:g,children:"Skip"})]}),c&&l.jsx(Ab,{})]})};const ah=({components:{Logo:e=Ya,Loader:t=cr}={},settings:n={}})=>{const{permission:o}=sr();return o.isLoading?l.jsx(t,{text:"Checking browser permissions..."}):l.jsx(jb,{Logo:e,children:l.jsx(nA,{settings:{...vE,...n}})})};const sh=({errorMessage:e})=>{const t="https://support.interop.io",n=l.jsxs(l.Fragment,{children:["It seems that the following error prevents io.Connect Browser",l.jsx("br",{}),"from operating properly:",l.jsxs("span",{className:"browser-start-failed-error",children:["“",e,"”"]}),l.jsxs("span",{className:"help-center-info",children:["For further assistance, visit our"," ",l.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"help center"}),"."]}),l.jsx("span",{className:"thank-you",children:"Thank you for your cooperation."})]});return l.jsx(jb,{Logo:Ya,children:l.jsx(Ob,{className:"io-init-error-card",heading:"Oops! io.Connect Browser couldn't start...",description:n,Image:gE,children:l.jsx(lc,{className:"io-btn io-btn-lg io-btn-primary",onClick:()=>window.open(t,"_blank","noopener,noreferrer"),children:"Visit the interop.io Help Center"})})})},Pb=()=>l.jsxs(l.Fragment,{children:[l.jsx(qn,{tag:"h1",className:"login-title",text:"Making Your Work Flow",size:"large"}),l.jsxs("p",{className:"io-text-default-lh16 login-description",children:["Integrate apps, simplify user experiences and accelerate",l.jsx("br",{}),"digital transformation."]})]}),_b=({Logo:e,children:t,className:n})=>l.jsx("div",{className:"login-page-background",children:l.jsxs("div",{className:pt(n,"login-form-container flex flex-column ai-center"),children:[l.jsx(e,{}),t]})}),oA=({onLogin:e,isLoading:t,validationError:n,components:{Logo:o=Ya,Heading:r=Pb,Loader:i=cr}={}})=>t?l.jsx(i,{text:"Verifying credentials..."}):l.jsxs(_b,{Logo:o,children:[l.jsx(r,{}),l.jsx(et,{className:"auth0-login-btn",onClick:e,size:"large",variant:"primary",children:"Log In"}),n&&l.jsx(Vb,{variant:"critical",text:n.message})]}),Mm=(e,t)=>{const n=t.value,o=n.trim().length>3;return{value:n,isValid:o}},rA=({onLogin:e,setIsLoading:t,loginError:n,setLoginError:o,userInputName:r="email"})=>{const[i,a]=v.useReducer(Mm,{value:"",isValid:!1}),[s,c]=v.useReducer(Mm,{value:"",isValid:!1}),[u,d]=v.useState(!1),[f,h]=v.useState(!1),{isValid:p}=i,{isValid:m}=s,g=p&&m,y=x=>a({value:x.target.value}),w=x=>c({value:x.target.value}),S=()=>{p||d(!0)},b=()=>{m||h(!0)},k=async x=>{if(x.preventDefault(),!!g){t(!0);try{await e(i.value,s.value)}catch(C){o(C)}t(!1)}};return l.jsxs("form",{className:"simple-login-form",onSubmit:k,children:[l.jsx(er,{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:()=>d(!1)}),l.jsx(er,{id:"password",errorMessage:f?"The password is too short":void 0,autoComplete:"off",type:"password",placeholder:"Enter your password",value:s.value,onChange:w,onBlur:b,onFocus:()=>h(!1)}),l.jsx(et,{type:"submit",size:"large",variant:"primary",children:"Log In"}),n&&l.jsxs("div",{className:"login-error-feedback",children:[l.jsx(xt,{className:"error-icon",variant:"close",size:"12"}),n.message]})]})};const iA=({onLogin:e,userInputName:t,components:{Logo:n=Ya,Heading:o=Pb,Loader:r=cr}={}})=>{const[i,a]=v.useState(!1),[s,c]=v.useState(null);return i?l.jsx(r,{text:"Verifying credentials..."}):l.jsxs(_b,{Logo:n,children:[l.jsx(o,{}),l.jsx(rA,{onLogin:e,setIsLoading:a,loginError:s,setLoginError:c,userInputName:t})]})};function aA(e,t){const[n,o]=v.useState(!0),r=v.useContext(Te.IOConnectContext);return v.useEffect(()=>{let i;return(async()=>{if(!r.workspaces)return;let a;try{a=await r.workspaces.getWorkspaceById(e)}catch(c){console.warn(c);return}const s=a.getAllGroups().find(c=>c.id===t);s&&(i=await s.onLockConfigurationChanged(({showAddWindowButton:c})=>{c!==void 0&&o(c)}),o(!!s.showAddWindowButton))})(),()=>i==null?void 0:i()},[e,t,r.workspaces]),n}const sA=({groupId:e,workspaceId:t})=>{const n=aA(t,e),o=v.useCallback(r=>{xi.showAddApplicationPopup({bounds:r,groupId:e,workspaceId:t})},[e,t]);return n&&l.jsx(xi.AddWindowButton,{title:"Add App",visible:n,showPopup:o})},cA=e=>l.jsx(xi.GroupHeaderButtons,{...e,addWindow:{visible:!1,showPopup:e.addWindow.showPopup}}),lA=()=>null;const Tb=({className:e,components:t,onClose:n,title:o})=>{const{NotificationsProvider:r,NotificationsPanelProvider:i,SettingsPanel:a}=pf;return l.jsx(r,{children:l.jsx(i,{children:l.jsx(a,{className:e,components:t,onClose:n,title:o})})})};const Nb=gk.Panel;const Ib=({className:e,components:t,onClose:n,title:o})=>{const r=v.useContext(Te.IOConnectContext),{onLogout:i}=ww(),[a,s]=Xn("sessionStorage",$1,H1),{login:{setIsLoggingOut:c}}=sr(),u=v.useCallback(async()=>{var d;if("modals"in r&&r.modals){const f="log-out",{isEnterPressed:h,responseButtonClicked:p}=await r.modals.dialogs.request({templateName:Bi.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:f,autofocus:!0},{variant:"outline",text:"Cancel",id:"cancel"}]}});if(!(h||(p==null?void 0:p.id)===f))return}$o.flushSync(()=>c(!0)),s(null),await((d=r.webPlatform)==null?void 0:d.system.shutdown());try{i==null||i()}catch(f){console.error(f)}},[r,i]);return l.jsx(h1.Panel,{className:e,components:t,onClose:n,onLogout:u,title:o})},uA=[{name:"platformPreferences",displayName:"Platform Preferences",icon:"cog",onClick:e=>e(Nb)},{name:"notificationSettings",displayName:"Notification Settings",icon:"bell",onClick:e=>e(Tb),separatorAfter:!0},{name:"profile",displayName:"Profile",icon:"user",onClick:e=>e(Ib)}],dA=e=>({onClose:t})=>l.jsx(e,{className:"system-menu-panel",onClose:t});const Rb=({actions:e,panelWrapperClassName:t})=>{const[n,o]=v.useState(),r=v.useRef(null),i=J1(),a=v.useCallback(()=>o(void 0),[]),s=!!n;v.useEffect(()=>{!s||i!=="Escape"||a()},[s,i]);const c=v.useCallback((u,d)=>{const f=e.find(({name:p})=>p===d.name);if(!f){console.error(`Action named ${d.name} is not part of the provided list of actions: ${JSON.stringify(e)}!`);return}const h=p=>{const m=dA(p);o(()=>m)};f.onClick(h)},[e]);return Nf({eventType:"mouseup",handler:a,ref:r,skip:!s}),Tf({handler:a,skip:!s}),l.jsxs(l.Fragment,{children:[l.jsx(Df,{buttonSize:"32",iconSize:"16",actions:e,onActionItemClick:c,icon:"ellipsis-vertical",buttonVariant:"circle",placement:"bottom-end",offset:[0,8],"data-testid":"system-menu-button",contextMenuDataTestId:"system-menu"}),l.jsx(xw,{className:pt("system-menu-panel-wrapper",t),isOpen:s,onClose:a,Panel:n,position:"right",ref:r})]})},fA=()=>l.jsx("li",{className:"default-header-system-menu",children:l.jsx(Rb,{actions:uA})}),hA=()=>{const{showNotificationBadge:e}=w5(),t=q1(),o=v.useMemo(()=>t.filter(({state:r})=>r==="Active"||r==="Stale"),[t]).length;return o>0&&e?l.jsx("div",{className:"io-badge io-badge-primary notifications-badge",children:o<100?o:"99+"}):null};const Lb=e=>{const{className:t,active:n,...o}=e;return l.jsxs("div",{className:pt(t,"notifications-panel-button"),...o,children:[l.jsx(Ue,{icon:"bell",size:"32",iconSize:"16",variant:"circle"}),l.jsx(hA,{})]})},Db=({className:e,components:t,onClose:n,settings:o,title:r})=>{const{NotificationsProvider:i,NotificationsPanelProvider:a,Panel:s}=pf;return l.jsx(i,{children:l.jsx(a,{children:l.jsx(s,{className:e,components:t,onClose:n,settings:o,title:r})})})},Mb=({Button:e=Lb,Panel:t=Db,position:n="right",...o})=>{const r=q1(),i=v.useContext(Te.IOConnectContext),a=v.useCallback(async()=>{await Promise.all(r.map(({id:s})=>i.notifications.setState(s,"Seen")))},[r]);return l.jsx($f,{Button:e,Panel:t,position:n,onClose:a,...o})};const pA=()=>l.jsxs(l.Fragment,{children:[l.jsx(Mb,{tag:"li"}),l.jsx(fA,{})]}),ch=({onLogout:e,workspaces:t,launchpad:n,Loader:o=cr,isBeforeunloadDialogEnabled:r})=>{var g,y,w,S;const{LogoComponent:i,SystemButtonsComponent:a}=((g=t==null?void 0:t.components)==null?void 0:g.header)??{},{setPlatformWindow:s}=If(),{isInitialSetupCompleted:c}=Bv(),u=(y=window.iobrowser)==null?void 0:y.platformStarted,d=i??(u?Sw:lA),f=a??(u?pA:void 0),h=m5(),{login:{isLoggingOut:p}}=sr();N3(r===!1||p),v.useEffect(()=>{u&&s({name:window.name})},[u,s]);const m=v.useMemo(()=>({onLogout:e,launchpadSettings:n==null?void 0:n.settings,launchpadComponents:n==null?void 0:n.components}),[e,n==null?void 0:n.settings,n==null?void 0:n.components]);return l.jsxs(yw.Provider,{value:m,children:[(!h||!c)&&l.jsx(o,{text:"Loading io.Connect Home..."}),l.jsx(xi,{components:{...t==null?void 0:t.components,header:{...(w=t==null?void 0:t.components)==null?void 0:w.header,LogoComponent:d,SystemButtonsComponent:f},groupHeader:{AfterTabsComponent:sA,ButtonsComponent:cA,...(S=t==null?void 0:t.components)==null?void 0:S.groupHeader}}})]})},mA=dt({id:qt,username:Ie(qt),email:Ie(qt),firstName:Ie(qt),lastName:Ie(qt),token:Ie(qt),password:Ie(qt)}),gA=({config:e})=>{var w,S,b,k;const{setupFlow:t,login:n,workspaces:o,launchpad:r,getIOConnectConfig:i}=e,[a,s]=Xn("localStorage",K3,mA),[c]=Xn("localStorage",Fa,za),[u,d]=v.useState(null),{login:{isLoggingOut:f}}=sr(),h=_f(),p=((w=e.components)==null?void 0:w.SystemLoader)??cr,m=((S=e.components)==null?void 0:S.IOInitErrorScreen)??sh,g=v.useCallback(async(x,C)=>{const I=await n.onLogin(x,C);s(I)},[n,s]),y=v.useCallback(()=>{var x;(x=n.onLogout)==null||x.call(n),s(null),window.location.reload()},[n.onLogout,s]);return f?l.jsx(p,{text:"Logging out..."}):a?!(c!=null&&c.isCompleted)&&(t==null?void 0:t.enabled)!==!1&&!h?l.jsx(ah,{settings:t==null?void 0:t.settings,components:{...t==null?void 0:t.components,Loader:p}}):u&&!u.message.includes("has already been started")?l.jsx(m,{errorMessage:u.message}):l.jsx(Te.IOConnectProvider,{settings:i({type:"simple",user:a}),onInitError:d,fallback:l.jsx(p,{text:"Initializing the platform..."}),children:l.jsx(zc,{launchpadMode:(b=r==null?void 0:r.settings)==null?void 0:b.mode,children:l.jsx(ch,{workspaces:o,launchpad:r,onLogout:y,isBeforeunloadDialogEnabled:(k=e.settings)==null?void 0:k.isBeforeunloadDialogEnabled,Loader:p})})}):l.jsx(iA,{onLogin:g,userInputName:n.userInputName,components:{...n.components,Loader:p}})},vA=dt({message:qt}),yA=e=>{const t=Eb(),[n,o]=v.useState(void 0),[r,i]=Xn("sessionStorage",U3,vA),a=v.useMemo(()=>t.user?(e==null?void 0:e(t.user))??{ok:!0}:null,[t.user,e]),s=(a==null?void 0:a.ok)===!1,c=t.isLoading||t.isAuthenticated&&!n,u=s||c,d=v.useMemo(()=>{var f;return a!=null&&a.ok&&((f=t.user)!=null&&f.email)&&n?{username:t.user.name,id:t.user.email,token:n}:null},[t.user,n,a==null?void 0:a.ok]);return v.useEffect(()=>{t.isAuthenticated&&t.getAccessTokenSilently().then(o).catch(console.warn)},[t]),v.useEffect(()=>{if(a){if(a.ok){i(null);return}i({message:a.message}),t.logout()}},[t,i,a]),{isLoading:u,validationError:r,user:d}},Pd={POPUP:"popup",REDIRECT:"redirect"},wA=({config:e})=>{var b,k,x,C;const t=Eb(),{setupFlow:n,login:o,launchpad:r,workspaces:i,getIOConnectConfig:a}=e,{isLoading:s,validationError:c,user:u}=yA(o.validateUser),f=(o.loginType??Pd.REDIRECT)===Pd.REDIRECT?t.loginWithRedirect:t.loginWithPopup,[h]=Xn("localStorage",Fa,za),[p,m]=v.useState(null),{login:{isLoggingOut:g}}=sr(),y=_f(),w=((b=e.components)==null?void 0:b.SystemLoader)??cr,S=((k=e.components)==null?void 0:k.IOInitErrorScreen)??sh;return g?l.jsx(w,{text:"Logging out..."}):u?!(h!=null&&h.isCompleted)&&(n==null?void 0:n.enabled)!==!1&&!y?l.jsx(ah,{settings:n==null?void 0:n.settings,components:{...n==null?void 0:n.components,Loader:w}}):p&&!p.message.includes("has already been started")?l.jsx(S,{errorMessage:p.message}):l.jsx(Te.IOConnectProvider,{settings:a({type:"auth0",user:{...t.user,id:u.id,token:u.token}}),onInitError:m,fallback:l.jsx(w,{text:"Initializing the platform..."}),children:l.jsx(zc,{launchpadMode:(x=r==null?void 0:r.settings)==null?void 0:x.mode,children:l.jsx(ch,{workspaces:i,launchpad:r,onLogout:t.logout,isBeforeunloadDialogEnabled:(C=e.settings)==null?void 0:C.isBeforeunloadDialogEnabled,Loader:w})})}):l.jsx(oA,{onLogin:f,isLoading:s,validationError:c,components:{...o.components,Loader:w}})},$m=({config:e})=>{var g,y,w,S;const{setupFlow:t,launchpad:n,workspaces:o,getIOConnectConfig:r}=e,{onLogout:i,user:a}=e.login??{},{isPlatformWindow:s}=If(),[c]=Xn("localStorage",Fa,za),[u,d]=v.useState(null),{login:{isLoggingOut:f}}=sr(),h=_f(),p=((g=e.components)==null?void 0:g.SystemLoader)??cr,m=((y=e.components)==null?void 0:y.IOInitErrorScreen)??sh;return f?l.jsx(p,{text:"Logging out..."}):!(c!=null&&c.isCompleted)&&(t==null?void 0:t.enabled)!==!1&&s&&!h?l.jsx(ah,{settings:t==null?void 0:t.settings,components:{...t==null?void 0:t.components,Loader:p}}):u&&!u.message.includes("has already been started")?l.jsx(m,{errorMessage:u.message}):l.jsx(Te.IOConnectProvider,{settings:r({type:"custom",user:a}),onInitError:d,fallback:l.jsx(p,{text:"Initializing the platform..."}),children:l.jsx(zc,{launchpadMode:(w=n==null?void 0:n.settings)==null?void 0:w.mode,children:l.jsx(ch,{workspaces:o,launchpad:n,onLogout:i,isBeforeunloadDialogEnabled:(S=e.settings)==null?void 0:S.isBeforeunloadDialogEnabled,Loader:p})})})},$b=dt({Logo:Ie(Wt().andThen(e=>pn(e,"Logo"))),Heading:Ie(Wt().andThen(e=>pn(e,"Heading")))}),bA=Oa(...Object.values(Pd).map(e=>tr(e))),xA=dt({type:tr("auth0"),validateUser:Ie(Wt().andThen(e=>pn(e,"validateUser"))),loginType:Ie(bA),providerOptions:Wt(),components:Ie($b)}),SA=dt({type:tr("simple"),onLogin:Wt().andThen(e=>pn(e,"onLogin")),onLogout:Ie(Wt().andThen(e=>pn(e,"onLogout"))),userInputName:Ie(qt),components:Ie($b)}),kA=dt({id:qt,username:qt}),CA=dt({type:tr("custom"),onLogout:Wt().andThen(e=>pn(e,"onLogout")),user:kA}),EA=Oa(xA,SA,CA),jA=dt({edgeNotificationsPermissionTimeout:Ie(r5)}),AA=dt({Logo:Ie(Wt().andThen(e=>pn(e,"Logo")))}),OA=dt({enabled:Ie(Ni()),components:Ie(AA),settings:Ie(jA)}),PA=dt({components:Ie(Wt())}),_A=dt({BeforeSearch:Oa(tr(null),Ie(Wt().andThen(e=>pn(e,"BeforeSearch")))),AfterSearch:Oa(tr(null),Ie(Wt().andThen(e=>pn(e,"AfterSearch"))))}),TA=dt({Component:Wt().andThen(e=>pn(e,"Component")),placementId:qt}),NA=dt({header:Ie(_A),sections:Ie(n5(TA))}),IA=dt({showHeader:Ie(Ni()),showSearch:Ie(Ni())}),RA=dt({header:Ie(IA),mode:Ie(Oa(tr("pinned"),tr("default")))}),LA=dt({components:Ie(NA),settings:Ie(RA)}),DA=dt({SystemLoader:Ie(Wt().andThen(e=>pn(e,"SystemLoader"))),IOInitErrorScreen:Ie(Wt().andThen(e=>pn(e,"IOInitErrorScreen")))}),MA=dt({isBeforeunloadDialogEnabled:Ie(Ni())}),$A=dt({getIOConnectConfig:Wt().andThen(e=>pn(e,"getIOConnectConfig")),login:Ie(EA),setupFlow:Ie(OA),workspaces:Ie(PA),launchpad:Ie(LA),components:Ie(DA),settings:Ie(MA)}),HA=({config:e})=>{var i;const t=v.useMemo(()=>$A.runWithException(e),[e]),n=t.login,{isPlatformWindow:o}=If();if(!n||!o){const{login:a,...s}=t;return l.jsx($m,{config:s})}if(n.type==="custom")return l.jsx($m,{config:t});if(n.type==="simple")return l.jsx(gA,{config:t});const{providerOptions:r}=n;return l.jsx(Uj,{...r,authorizationParams:{...r.authorizationParams,redirect_uri:((i=r.authorizationParams)==null?void 0:i.redirect_uri)??window.location.origin},children:l.jsx(wA,{config:t})})};const BA=({config:e})=>l.jsx(dE,{children:l.jsx(HA,{config:e})});exports.ApplicationsSection=nw;exports.FavoritesSection=ow;exports.IOActivePanelRenderer=wS;exports.IOConnectHome=BA;exports.IODownloadManager=X2;exports.IONotifications=pf;exports.IOPreferencesDesktop=pk;exports.IOProfile=h1;exports.Launchpad=vw;exports.LaunchpadAccess=Sw;exports.LaunchpadBody=gw;exports.LaunchpadContentsContainer=lw;exports.LaunchpadHeader=dw;exports.LaunchpadPinButton=uw;exports.NotificationSettingsPanel=Tb;exports.NotificationsPanel=Db;exports.NotificationsPanelButton=Lb;exports.NotificationsPanelWithToggleButton=Mb;exports.PanelWithToggleButton=$f;exports.PlatformPrefsProvider=zc;exports.PreferencesPanel=Nb;exports.ProfilePanel=Ib;exports.Section=rl;exports.SystemLoader=cr;exports.SystemMenu=Rb;exports.WorkspacesSection=fw;exports.useFavorites=tl;exports.useIsLaunchpadCollapsed=Pf;exports.usePlatformPref=Nt;exports.usePlatformPrefs=Bv;
|
|
65
65
|
//# sourceMappingURL=index.js.map
|