@interopio/widget 2.0.2 → 2.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/io-browser-widget-react.es.js +4 -4
- package/dist/io-browser-widget-react.es.js.map +1 -1
- package/dist/io-browser-widget-react.umd.js +4 -4
- package/dist/io-browser-widget-react.umd.js.map +1 -1
- package/dist/io-browser-widget.es.js +45 -45
- package/dist/io-browser-widget.es.js.map +1 -1
- package/dist/io-browser-widget.umd.js +45 -45
- package/dist/io-browser-widget.umd.js.map +1 -1
- package/package.json +3 -3
- package/widget.d.ts +2 -54
|
@@ -1167,11 +1167,11 @@ function v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"de
|
|
|
1167
1167
|
Copyright (c) 2018 Jed Watson.
|
|
1168
1168
|
Licensed under the MIT License (MIT), see
|
|
1169
1169
|
http://jedwatson.github.io/classnames
|
|
1170
|
-
*/b=y,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=i(e,n(o)));}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return "";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var o="";for(var r in n)e.call(n,r)&&n[r]&&(o=i(o,r));return o}function i(e,t){return t?e?e+" "+t:e+t:e}b.exports?(t.default=t,b.exports=t):window.classNames=t;}();var w=v(y.exports);function k({className:t,size:n="16",variant:i="workspace",...o}){const r=w("icon",n&&[`icon-size-${n}`],t);return jsxRuntimeExports.jsx("span",{className:r,...o,children:jsxRuntimeExports.jsx("i",{className:`icon-${i}`})})}const S=forwardRef((({className:t,variant:n="default",icon:i="workspace",size:o="16",iconSize:a="16",onClick:s,disabled:c,children:l,...u},d)=>{const f=w("io-btn-icon","default"!==n&&[`io-btn-icon-${n}`],[`io-btn-icon-size-${o}`],t),h=useCallback((e=>{if(!c)return s?s(e):void 0;e.preventDefault();}),[s,c]);return jsxRuntimeExports.jsx("button",{className:f,type:"button",ref:d,"aria-label":"button",onClick:h,disabled:c,...u,children:l??(i&&jsxRuntimeExports.jsx(k,{variant:i,size:a}))})}));S.displayName="ButtonIcon";function x({className:t,variant:n="default",children:i,...o}){const r=w("io-badge",{[`io-badge-${n}`]:"default"!==n},t);return jsxRuntimeExports.jsx("div",{className:r,...o,children:i})}function I({className:t,tag:n="h2",size:i="normal",text:o="Title",...r}){const a=n,s=w("small"===i&&"io-title-semibold","normal"===i&&"io-title","large"===i&&"io-title-large",t);return jsxRuntimeExports.jsx(a,{className:s,...r,children:o})}function E({className:n,title:i,titleSize:o="normal",tag:r,hint:a,children:s,...c}){const l=w("io-block",n);return jsxRuntimeExports.jsxs("div",{className:l,...c,children:[i&&jsxRuntimeExports.jsx(I,{tag:r,text:i,size:o}),s,a&&jsxRuntimeExports.jsx("p",{className:"io-text-smaller",children:a})]})}const A=forwardRef((({className:n,variant:i="default",size:o="normal",icon:a,iconSize:s="12",iconRight:c=!1,text:l,onClick:u,disabled:d,children:f,...h},m)=>{const p=w("io-btn",("primary"===i||"critical"===i||"outline"===i||"link"===i)&&[`io-btn-${i}`],"large"===o&&"io-btn-lg",n),g=useCallback((e=>{if(!d)return u?u(e):void 0;e.preventDefault();}),[u,d]);return jsxRuntimeExports.jsxs("button",{className:p,ref:m,type:"button","aria-label":"button",onClick:g,disabled:d,tabIndex:0,...h,children:[a&&!c&&jsxRuntimeExports.jsx(k,{variant:a,size:s}),f??l,a&&c&&jsxRuntimeExports.jsx(k,{variant:a,size:s})]})}));A.displayName="Button";const B=createContext({});function T({className:t,...n}){const{handleOpen:i}=useContext(B),o=w("io-dropdown-content",t),a=useCallback((e=>{e.stopPropagation(),i&&i();}),[i]);return jsxRuntimeExports.jsx("div",{className:o,role:"button",onClick:a,...n})}const P=createContext({}),R=forwardRef(((n,i)=>{const{className:o,prepend:r,append:a,isSelected:c,onClick:l,description:u,disabled:d=!1,children:f,tooltip:h,...m}=n,{variant:p="default",selected:g,checkIcon:v="none",handleItemClick:b}=useContext(P),y=c??g?.some((e=>e.children===f)),S="default"!==p&&"none"!==v,N=S||r,C=w("io-list-item",N&&"io-list-item-left",a&&"io-list-item-right","default"!==p&&y&&"selected",u&&"io-list-item-description",d&&"io-list-item-disabled",o);return jsxRuntimeExports.jsxs("li",{className:C,ref:i,role:"menuitem","aria-roledescription":"menuitem",tabIndex:0,onClick:e=>{d?e.preventDefault():(b?.(e,{children:f}),l?.(e));},...m,children:[N&&jsxRuntimeExports.jsxs("div",{className:"io-list-left-column",children:[S&&jsxRuntimeExports.jsx(k,{variant:v}),r]}),jsxRuntimeExports.jsx("span",{className:"io-list-text",title:h,children:f}),a&&jsxRuntimeExports.jsx("div",{className:"io-list-right-column",children:a}),u&&jsxRuntimeExports.jsx("div",{className:"io-list-text-description",children:u})]})}));R.displayName="ListItem";const L=forwardRef((({className:n,prepend:i,append:o,children:r,tooltip:a,...s},c)=>{const l=w("io-list-item",i&&"io-list-item-left",o&&"io-list-item-right","io-list-item-title",n);return jsxRuntimeExports.jsxs("li",{className:l,ref:c,...s,children:[i&&jsxRuntimeExports.jsx("div",{className:"io-list-left-column",children:i}),jsxRuntimeExports.jsx("span",{className:"io-list-text",title:a,children:r}),o&&jsxRuntimeExports.jsx("div",{className:"io-list-right-column",children:o})]})}));L.displayName="ListItemTitle";const O=forwardRef((({className:n,prepend:i,append:o,children:r,tooltip:a,...s},c)=>{const l=w("io-list-item",i&&"io-list-item-left",o&&"io-list-item-right","io-list-item-section",n);return jsxRuntimeExports.jsxs("li",{className:l,ref:c,...s,children:[i&&jsxRuntimeExports.jsx("div",{className:"io-list-left-column",children:i}),jsxRuntimeExports.jsx("span",{className:"io-list-text",title:a,children:r}),o&&jsxRuntimeExports.jsx("div",{className:"io-list-right-column",children:o})]})}));O.displayName="ListItemSection";const F=forwardRef((({className:n,prepend:i,append:o,children:r,tooltip:a,...s},c)=>{const l=w("io-list-item-header",n);return jsxRuntimeExports.jsxs("div",{className:l,ref:c,...s,children:[i&&jsxRuntimeExports.jsx("div",{className:"io-list-left-column",children:i}),jsxRuntimeExports.jsx("span",{className:"io-list-text",title:a,children:r}),o&&jsxRuntimeExports.jsx("div",{className:"io-list-right-column",children:o})]})}));F.displayName="ListItemHeader";const D=forwardRef((({className:t,children:n,...i},o)=>{const r=w("io-list-item","io-list-with-sub-items",t);return jsxRuntimeExports.jsx("li",{className:r,ref:o,...i,children:n})}));D.displayName="ListItemWithSubItems";const M=forwardRef(((t,n)=>{const{className:i,variant:o="default",checkIcon:a="none",children:s,...u}=t,[d,f]=useState([]),h=w("io-list","default"!==o&&"io-list-selectable",i),m=useCallback(((e,t)=>{if("default"===o)return;const n=d.some((e=>e.children?.toString()===t.children?.toString()));"single"===o?f([t]):(()=>{const e=n?d.filter((e=>e.children!==t.children)):[...d,t];f(e);})();}),[d,o]),p=useMemo((()=>({variant:o,selected:d,checkIcon:a,handleItemClick:m})),[o,d,a,m]);return jsxRuntimeExports.jsx(P.Provider,{value:p,children:jsxRuntimeExports.jsx("ul",{className:h,ref:n,...u,children:s})})}));M.displayName="List";const z=M;function _(e,t){useEffect((()=>{const n=n=>{e.current&&!e.current.contains(n.target)&&t();};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n);}}),[e,t]);}function H({className:t,variant:n="outline",align:i="down",disabled:o,children:a,...s}){const[u,f]=useState(!1),h=useRef(null),m=w("io-dropdown",u&&"io-dropdown-open","default"!==n&&[`io-dropdown-${n}`],t),p=useCallback((()=>{f(!u);}),[u]);_(h,useCallback((()=>{f(!1);}),[]));const g=useMemo((()=>({isOpen:u,handleOpen:p,variant:n,align:i,disabled:o})),[u,p,n,i,o]);return jsxRuntimeExports.jsx(B.Provider,{value:g,children:jsxRuntimeExports.jsx("div",{className:m,ref:h,...s,children:a})})}function $({className:t,variant:n="default",align:i="left",children:o,...r}){const a=w("io-btn-group","sticky"===n&&"io-btn-group-sticky","append"===n&&"io-btn-group-append","fullwidth"===n&&"io-btn-group-fullwidth","right"===i&&"io-btn-group-right",t);return jsxRuntimeExports.jsx("div",{className:a,...r,children:o})}function j({className:t,draggable:n=!1,children:i,...o}){const r=w("io-header",n&&["draggable"],t);return jsxRuntimeExports.jsx("header",{className:r,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--spacing-8)"},...o,children:i})}function V({className:t,children:n,...i}){const o=w("io-dialog-header",t);return jsxRuntimeExports.jsx(j,{className:o,...i,children:n})}function U({className:t,children:n,...i}){const o=w("io-dialog-body",t);return jsxRuntimeExports.jsx("div",{className:o,...i,children:n})}function J({className:t,children:n,...i}){const o=w("io-footer",t);return jsxRuntimeExports.jsx("footer",{className:o,...i,children:n})}function W({className:t,...n}){const i=w("io-dialog-footer",t);return jsxRuntimeExports.jsx(J,{className:i,...n})}function K(){return "undefined"!=typeof window}function G(e){return X(e)?(e.nodeName||"").toLowerCase():"#document"}function Y(e){var t;return (null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Q(e){var t;return null==(t=(X(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function X(e){return !!K()&&(e instanceof Node||e instanceof Y(e).Node)}function Z(e){return !!K()&&(e instanceof Element||e instanceof Y(e).Element)}function ee(e){return !!K()&&(e instanceof HTMLElement||e instanceof Y(e).HTMLElement)}function te(e){return !(!K()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot)}function ne(e){const{overflow:t,overflowX:n,overflowY:i,display:o}=ce(e);return /auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(o)}function ie(e){return ["table","td","th"].includes(G(e))}function oe(e){return [":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return !1}}))}function re(e){const t=ae(),n=Z(e)?ce(e):e;return "none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function ae(){return !("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function se(e){return ["html","body","#document"].includes(G(e))}function ce(e){return Y(e).getComputedStyle(e)}function le(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ue(e){if("html"===G(e))return e;const t=e.assignedSlot||e.parentNode||te(e)&&e.host||Q(e);return te(t)?t.host:t}function de(e){const t=ue(e);return se(t)?e.ownerDocument?e.ownerDocument.body:e.body:ee(t)&&ne(t)?t:de(t)}function fe(e,t,n){var i;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=de(e),r=o===(null==(i=e.ownerDocument)?void 0:i.body),a=Y(o);if(r){const e=he(a);return t.concat(a,a.visualViewport||[],ne(o)?o:[],e&&n?fe(e):[])}return t.concat(o,fe(o,[],n))}function he(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function me(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement;}return t}function pe(e,t){if(!e||!t)return !1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return !0;if(n&&te(n)){let n=t;for(;n;){if(e===n)return !0;n=n.parentNode||n.host;}}return !1}function ge(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function ve(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function be(e){return !(0!==e.mozInputSource||!e.isTrusted)||(ke()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function ye(e){return !ve().includes("jsdom/")&&(!ke()&&0===e.width&&0===e.height||ke()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function we(){return /apple/i.test(navigator.vendor)}function ke(){const e=/android/i;return e.test(ge())||e.test(ve())}function Se(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Ne(e){return (null==e?void 0:e.ownerDocument)||document}function Ce(e,t){if(null==t)return !1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function xe(e){return "composedPath"in e?e.composedPath()[0]:e.target}z.Item=R,z.ItemTitle=L,z.ItemSection=O,z.ItemHeader=F,z.ItemWithSubItems=D,H.Button=function({icon:t="chevron-down",...n}){const{handleOpen:i,disabled:o}=useContext(B),a=useCallback((e=>{e.stopPropagation(),i&&i();}),[i]);return jsxRuntimeExports.jsx(A,{icon:t,iconRight:!0,onClick:a,disabled:o,...n})},H.ButtonIcon=function({size:t="32",...n}){const{handleOpen:i,disabled:o}=useContext(B),a=useCallback((()=>{i&&i();}),[i]);return jsxRuntimeExports.jsx(S,{size:t,onClick:a,disabled:o,...n})},H.Content=T,H.List=z,H.Item=R,H.ItemTitle=L,H.ItemSection=O,$.Button=A,$.ButtonIcon=S,$.Dropdown=H,j.Title=I,j.ButtonGroup=$,j.Button=A,j.ButtonIcon=S,j.Dropdown=H,V.Title=I,V.ButtonGroup=$,V.Button=A,V.ButtonIcon=S,V.Dropdown=H,U.Content=function({className:t,children:n,...i}){const o=w("io-dialog-content",t);return jsxRuntimeExports.jsx("div",{className:o,...i,children:n})},J.ButtonGroup=$,J.Button=A,J.ButtonIcon=S,J.Dropdown=H,W.ButtonGroup=$,W.Button=A,W.ButtonIcon=S,W.Dropdown=H;function Ie(e){return ee(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Ee(e){e.preventDefault(),e.stopPropagation();}function Ae(e){return !!e&&("combobox"===e.getAttribute("role")&&Ie(e))}const Be=Math.min,Te=Math.max,Pe=Math.round,Re=Math.floor,Le=e=>({x:e,y:e}),Oe={left:"right",right:"left",bottom:"top",top:"bottom"},Fe={start:"end",end:"start"};function De(e,t,n){return Te(e,Be(t,n))}function Me(e,t){return "function"==typeof e?e(t):e}function ze(e){return e.split("-")[0]}function _e(e){return e.split("-")[1]}function He(e){return "x"===e?"y":"x"}function $e(e){return "y"===e?"height":"width"}function je(e){return ["top","bottom"].includes(ze(e))?"y":"x"}function Ve(e){return He(je(e))}function Ue(e){return e.replace(/start|end/g,(e=>Fe[e]))}function Je(e){return e.replace(/left|right|bottom|top/g,(e=>Oe[e]))}function We(e){const{x:t,y:n,width:i,height:o}=e;return {width:i,height:o,top:n,left:t,right:t+i,bottom:n+o,x:t,y:n}}
|
|
1170
|
+
*/b=y,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var o=arguments[t];o&&(e=i(e,n(o)));}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return "";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var o="";for(var r in n)e.call(n,r)&&n[r]&&(o=i(o,r));return o}function i(e,t){return t?e?e+" "+t:e+t:e}b.exports?(t.default=t,b.exports=t):window.classNames=t;}();var w=v(y.exports);function k({className:t,size:n="16",variant:i="workspace",...o}){const r=w("icon",n&&[`icon-size-${n}`],t);return jsxRuntimeExports.jsx("span",{className:r,...o,children:jsxRuntimeExports.jsx("i",{className:`icon-${i}`})})}const S=forwardRef((({className:t,variant:n="default",icon:i="workspace",size:o="16",iconSize:a="16",onClick:s,disabled:c,children:l,...u},d)=>{const f=w("io-btn-icon","default"!==n&&[`io-btn-icon-${n}`],[`io-btn-icon-size-${o}`],t),h=useCallback((e=>{if(!c)return s?s(e):void 0;e.preventDefault();}),[s,c]);return jsxRuntimeExports.jsx("button",{className:f,type:"button",ref:d,"aria-label":"button",onClick:h,disabled:c,...u,children:l??(i&&jsxRuntimeExports.jsx(k,{variant:i,size:a}))})}));S.displayName="ButtonIcon";function x({className:t,variant:n="default",children:i,...o}){const r=w("io-badge",{[`io-badge-${n}`]:"default"!==n},t);return jsxRuntimeExports.jsx("div",{className:r,...o,children:i})}function E({className:t,tag:n="h2",size:i="normal",text:o="Title",...r}){const a=n,s=w("small"===i&&"io-title-semibold","normal"===i&&"io-title","large"===i&&"io-title-large",t);return jsxRuntimeExports.jsx(a,{className:s,...r,children:o})}function I({className:n,title:i,titleSize:o="normal",tag:r,hint:a,children:s,...c}){const l=w("io-block",n);return jsxRuntimeExports.jsxs("div",{className:l,...c,children:[i&&jsxRuntimeExports.jsx(E,{tag:r,text:i,size:o}),s,a&&jsxRuntimeExports.jsx("p",{className:"io-text-smaller",children:a})]})}const A=forwardRef((({className:n,variant:i="default",size:o="normal",icon:a,iconSize:s="12",iconRight:c=!1,text:l,onClick:u,disabled:d,children:f,...h},m)=>{const p=w("io-btn",("primary"===i||"critical"===i||"outline"===i||"link"===i)&&[`io-btn-${i}`],"large"===o&&"io-btn-lg",n),g=useCallback((e=>{if(!d)return u?u(e):void 0;e.preventDefault();}),[u,d]);return jsxRuntimeExports.jsxs("button",{className:p,ref:m,type:"button","aria-label":"button",onClick:g,disabled:d,tabIndex:0,...h,children:[a&&!c&&jsxRuntimeExports.jsx(k,{variant:a,size:s}),f??l,a&&c&&jsxRuntimeExports.jsx(k,{variant:a,size:s})]})}));A.displayName="Button";const B=createContext({});function T({className:t,...n}){const{handleOpen:i}=useContext(B),o=w("io-dropdown-content",t),a=useCallback((e=>{e.stopPropagation(),i&&i();}),[i]);return jsxRuntimeExports.jsx("div",{className:o,role:"button",onClick:a,...n})}const P=createContext({}),R=forwardRef(((n,i)=>{const{className:o,prepend:r,append:a,isSelected:c,onClick:l,description:u,disabled:d=!1,children:f,tooltip:h,...m}=n,{variant:p="default",selected:g,checkIcon:v="none",handleItemClick:b}=useContext(P),y=c??g?.some((e=>e.children===f)),S="default"!==p&&"none"!==v,N=S||r,C=w("io-list-item",N&&"io-list-item-left",a&&"io-list-item-right","default"!==p&&y&&"selected",u&&"io-list-item-description",d&&"io-list-item-disabled",o);return jsxRuntimeExports.jsxs("li",{className:C,ref:i,role:"menuitem","aria-roledescription":"menuitem",tabIndex:0,onClick:e=>{d?e.preventDefault():(b?.(e,{children:f}),l?.(e));},...m,children:[N&&jsxRuntimeExports.jsxs("div",{className:"io-list-left-column",children:[S&&jsxRuntimeExports.jsx(k,{variant:v}),r]}),jsxRuntimeExports.jsx("span",{className:"io-list-text",title:h,children:f}),a&&jsxRuntimeExports.jsx("div",{className:"io-list-right-column",children:a}),u&&jsxRuntimeExports.jsx("div",{className:"io-list-text-description",children:u})]})}));R.displayName="ListItem";const L=forwardRef((({className:n,prepend:i,append:o,children:r,tooltip:a,...s},c)=>{const l=w("io-list-item",i&&"io-list-item-left",o&&"io-list-item-right","io-list-item-title",n);return jsxRuntimeExports.jsxs("li",{className:l,ref:c,...s,children:[i&&jsxRuntimeExports.jsx("div",{className:"io-list-left-column",children:i}),jsxRuntimeExports.jsx("span",{className:"io-list-text",title:a,children:r}),o&&jsxRuntimeExports.jsx("div",{className:"io-list-right-column",children:o})]})}));L.displayName="ListItemTitle";const O=forwardRef((({className:n,prepend:i,append:o,children:r,tooltip:a,...s},c)=>{const l=w("io-list-item",i&&"io-list-item-left",o&&"io-list-item-right","io-list-item-section",n);return jsxRuntimeExports.jsxs("li",{className:l,ref:c,...s,children:[i&&jsxRuntimeExports.jsx("div",{className:"io-list-left-column",children:i}),jsxRuntimeExports.jsx("span",{className:"io-list-text",title:a,children:r}),o&&jsxRuntimeExports.jsx("div",{className:"io-list-right-column",children:o})]})}));O.displayName="ListItemSection";const F=forwardRef((({className:n,prepend:i,append:o,children:r,tooltip:a,...s},c)=>{const l=w("io-list-item-header",n);return jsxRuntimeExports.jsxs("div",{className:l,ref:c,...s,children:[i&&jsxRuntimeExports.jsx("div",{className:"io-list-left-column",children:i}),jsxRuntimeExports.jsx("span",{className:"io-list-text",title:a,children:r}),o&&jsxRuntimeExports.jsx("div",{className:"io-list-right-column",children:o})]})}));F.displayName="ListItemHeader";const D=forwardRef((({className:t,children:n,...i},o)=>{const r=w("io-list-item","io-list-with-sub-items",t);return jsxRuntimeExports.jsx("li",{className:r,ref:o,...i,children:n})}));D.displayName="ListItemWithSubItems";const M=forwardRef(((t,n)=>{const{className:i,variant:o="default",checkIcon:a="none",children:s,...u}=t,[d,f]=useState([]),h=w("io-list","default"!==o&&"io-list-selectable",i),m=useCallback(((e,t)=>{if("default"===o)return;const n=d.some((e=>e.children?.toString()===t.children?.toString()));"single"===o?f([t]):(()=>{const e=n?d.filter((e=>e.children!==t.children)):[...d,t];f(e);})();}),[d,o]),p=useMemo((()=>({variant:o,selected:d,checkIcon:a,handleItemClick:m})),[o,d,a,m]);return jsxRuntimeExports.jsx(P.Provider,{value:p,children:jsxRuntimeExports.jsx("ul",{className:h,ref:n,...u,children:s})})}));M.displayName="List";const z=M;function _(e,t){useEffect((()=>{const n=n=>{e.current&&!e.current.contains(n.target)&&t();};return document.addEventListener("mousedown",n),()=>{document.removeEventListener("mousedown",n);}}),[e,t]);}function H({className:t,variant:n="outline",align:i="down",disabled:o,children:a,...s}){const[u,f]=useState(!1),h=useRef(null),m=w("io-dropdown",u&&"io-dropdown-open","default"!==n&&[`io-dropdown-${n}`],t),p=useCallback((()=>{f(!u);}),[u]);_(h,useCallback((()=>{f(!1);}),[]));const g=useMemo((()=>({isOpen:u,handleOpen:p,variant:n,align:i,disabled:o})),[u,p,n,i,o]);return jsxRuntimeExports.jsx(B.Provider,{value:g,children:jsxRuntimeExports.jsx("div",{className:m,ref:h,...s,children:a})})}function $({className:t,variant:n="default",align:i="left",children:o,...r}){const a=w("io-btn-group","sticky"===n&&"io-btn-group-sticky","append"===n&&"io-btn-group-append","fullwidth"===n&&"io-btn-group-fullwidth","right"===i&&"io-btn-group-right",t);return jsxRuntimeExports.jsx("div",{className:a,...r,children:o})}function j({className:t,draggable:n=!1,children:i,...o}){const r=w("io-header",n&&["draggable"],t);return jsxRuntimeExports.jsx("header",{className:r,style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"var(--spacing-8)"},...o,children:i})}function V({className:t,children:n,...i}){const o=w("io-dialog-header",t);return jsxRuntimeExports.jsx(j,{className:o,...i,children:n})}function U({className:t,children:n,...i}){const o=w("io-dialog-body",t);return jsxRuntimeExports.jsx("div",{className:o,...i,children:n})}function J({className:t,children:n,...i}){const o=w("io-footer",t);return jsxRuntimeExports.jsx("footer",{className:o,...i,children:n})}function W({className:t,...n}){const i=w("io-dialog-footer",t);return jsxRuntimeExports.jsx(J,{className:i,...n})}function K(){return "undefined"!=typeof window}function G(e){return X(e)?(e.nodeName||"").toLowerCase():"#document"}function Y(e){var t;return (null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Q(e){var t;return null==(t=(X(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function X(e){return !!K()&&(e instanceof Node||e instanceof Y(e).Node)}function Z(e){return !!K()&&(e instanceof Element||e instanceof Y(e).Element)}function ee(e){return !!K()&&(e instanceof HTMLElement||e instanceof Y(e).HTMLElement)}function te(e){return !(!K()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot)}function ne(e){const{overflow:t,overflowX:n,overflowY:i,display:o}=ce(e);return /auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(o)}function ie(e){return ["table","td","th"].includes(G(e))}function oe(e){return [":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return !1}}))}function re(e){const t=ae(),n=Z(e)?ce(e):e;return "none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function ae(){return !("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function se(e){return ["html","body","#document"].includes(G(e))}function ce(e){return Y(e).getComputedStyle(e)}function le(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ue(e){if("html"===G(e))return e;const t=e.assignedSlot||e.parentNode||te(e)&&e.host||Q(e);return te(t)?t.host:t}function de(e){const t=ue(e);return se(t)?e.ownerDocument?e.ownerDocument.body:e.body:ee(t)&&ne(t)?t:de(t)}function fe(e,t,n){var i;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=de(e),r=o===(null==(i=e.ownerDocument)?void 0:i.body),a=Y(o);if(r){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}(a);return t.concat(a,a.visualViewport||[],ne(o)?o:[],e&&n?fe(e):[])}return t.concat(o,fe(o,[],n))}function he(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement;}return t}function me(e,t){if(!e||!t)return !1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return !0;if(n&&te(n)){let n=t;for(;n;){if(e===n)return !0;n=n.parentNode||n.host;}}return !1}function pe(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function ge(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function ve(e){return !(0!==e.mozInputSource||!e.isTrusted)||(we()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function be(e){return !ge().includes("jsdom/")&&(!we()&&0===e.width&&0===e.height||we()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function ye(){return /apple/i.test(navigator.vendor)}function we(){const e=/android/i;return e.test(pe())||e.test(ge())}function ke(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Se(e){return (null==e?void 0:e.ownerDocument)||document}function Ne(e,t){if(null==t)return !1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Ce(e){return "composedPath"in e?e.composedPath()[0]:e.target}z.Item=R,z.ItemTitle=L,z.ItemSection=O,z.ItemHeader=F,z.ItemWithSubItems=D,H.Button=function({icon:t="chevron-down",...n}){const{handleOpen:i,disabled:o}=useContext(B),a=useCallback((e=>{e.stopPropagation(),i&&i();}),[i]);return jsxRuntimeExports.jsx(A,{icon:t,iconRight:!0,onClick:a,disabled:o,...n})},H.ButtonIcon=function({size:t="32",...n}){const{handleOpen:i,disabled:o}=useContext(B),a=useCallback((()=>{i&&i();}),[i]);return jsxRuntimeExports.jsx(S,{size:t,onClick:a,disabled:o,...n})},H.Content=T,H.List=z,H.Item=R,H.ItemTitle=L,H.ItemSection=O,$.Button=A,$.ButtonIcon=S,$.Dropdown=H,j.Title=E,j.ButtonGroup=$,j.Button=A,j.ButtonIcon=S,j.Dropdown=H,V.Title=E,V.ButtonGroup=$,V.Button=A,V.ButtonIcon=S,V.Dropdown=H,U.Content=function({className:t,children:n,...i}){const o=w("io-dialog-content",t);return jsxRuntimeExports.jsx("div",{className:o,...i,children:n})},J.ButtonGroup=$,J.Button=A,J.ButtonIcon=S,J.Dropdown=H,W.ButtonGroup=$,W.Button=A,W.ButtonIcon=S,W.Dropdown=H;const xe="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ee(e){return ee(e)&&e.matches(xe)}function Ie(e){e.preventDefault(),e.stopPropagation();}function Ae(e){return !!e&&("combobox"===e.getAttribute("role")&&Ee(e))}const Be=Math.min,Te=Math.max,Pe=Math.round,Re=Math.floor,Le=e=>({x:e,y:e}),Oe={left:"right",right:"left",bottom:"top",top:"bottom"},Fe={start:"end",end:"start"};function De(e,t,n){return Te(e,Be(t,n))}function Me(e,t){return "function"==typeof e?e(t):e}function ze(e){return e.split("-")[0]}function _e(e){return e.split("-")[1]}function He(e){return "x"===e?"y":"x"}function $e(e){return "y"===e?"height":"width"}function je(e){return ["top","bottom"].includes(ze(e))?"y":"x"}function Ve(e){return He(je(e))}function Ue(e){return e.replace(/start|end/g,(e=>Fe[e]))}function Je(e){return e.replace(/left|right|bottom|top/g,(e=>Oe[e]))}function We(e){const{x:t,y:n,width:i,height:o}=e;return {width:i,height:o,top:n,left:t,right:t+i,bottom:n+o,x:t,y:n}}
|
|
1171
1171
|
/*!
|
|
1172
1172
|
* tabbable 6.2.0
|
|
1173
1173
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
1174
|
-
*/var qe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Ke="undefined"==typeof Element,Ge=Ke?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ye=!Ke&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Qe=function e(t,n){var i;void 0===n&&(n=!0);var o=null==t||null===(i=t.getAttribute)||void 0===i?void 0:i.call(t,"inert");return ""===o||"true"===o||n&&t&&e(t.parentNode)},Xe=function e(t,n,i){for(var o=[],r=Array.from(t);r.length;){var a=r.shift();if(!Qe(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),c=e(s.length?s:a.children,!0,i);i.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c});}else {Ge.call(a,qe)&&i.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(a),u=!Qe(l,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(a));if(l&&u){var d=e(!0===l?a.children:l.children,!0,i);i.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d});}else r.unshift.apply(r,a.children);}}return o},Ze=function(e){return !isNaN(parseInt(e.getAttribute("tabindex"),10))},et=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return ""===n||"true"===n}(e))&&!Ze(e)?0:e.tabIndex},tt=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},nt=function(e){return "INPUT"===e.tagName},it=function(e){return function(e){return nt(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return !0;var t,n=e.form||Ye(e),i=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=i(window.CSS.escape(e.name));else try{t=i(e.name);}catch(e){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",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return !o||o===e}(e)},ot=function(e){var t=e.getBoundingClientRect(),n=t.width,i=t.height;return 0===n&&0===i},rt=function(e,t){var n=t.displayCheck,i=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return !0;var o=Ge.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ge.call(o,"details:not([open]) *"))return !0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ot(e)}else {if("function"==typeof i){for(var r=e;e;){var a=e.parentElement,s=Ye(e);if(a&&!a.shadowRoot&&!0===i(a))return ot(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host;}e=r;}if(function(e){var t,n,i,o,r=e&&Ye(e),a=null===(t=r)||void 0===t?void 0:t.host,s=!1;if(r&&r!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(i=n.ownerDocument)&&void 0!==i&&i.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&a;){var c,l,u;s=!(null===(l=a=null===(c=r=Ye(a))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(a));}return s}(e))return !e.getClientRects().length;if("legacy-full"!==n)return !0}return !1},at=function(e,t){return !(t.disabled||Qe(t)||function(e){return nt(e)&&"hidden"===e.type}(t)||rt(t,e)||function(e){return "DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return "SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var i=t.children.item(n);if("LEGEND"===i.tagName)return !!Ge.call(t,"fieldset[disabled] *")||!i.contains(e)}return !0}t=t.parentElement;}return !1}(t))},st=function(e,t){return !(it(t)||et(t)<0||!at(e,t))},ct=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return !!(isNaN(t)||t>=0)},lt=function e(t){var n=[],i=[];return t.forEach((function(t,o){var r=!!t.scopeParent,a=r?t.scopeParent:t,s=function(e,t){var n=et(e);return n<0&&t&&!Ze(e)?0:n}(a,r),c=r?e(t.candidates):a;0===s?r?n.push.apply(n,c):n.push(a):i.push({documentOrder:o,tabIndex:s,item:t,isScope:r,content:c});})),i.sort(tt).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ut=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Xe([e],t.includeContainer,{filter:st.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ct}):function(e,t,n){if(Qe(e))return [];var i=Array.prototype.slice.apply(e.querySelectorAll(qe));return t&&Ge.call(e,qe)&&i.unshift(e),i.filter(n)}(e,t.includeContainer,st.bind(null,t)),lt(n)};function dt(e,t,n){let{reference:i,floating:o}=e;const r=je(t),a=Ve(t),s=$e(a),c=ze(t),l="y"===r,u=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,f=i[s]/2-o[s]/2;let h;switch(c){case"top":h={x:u,y:i.y-o.height};break;case"bottom":h={x:u,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:d};break;case"left":h={x:i.x-o.width,y:d};break;default:h={x:i.x,y:i.y};}switch(_e(t)){case"start":h[a]-=f*(n&&l?-1:1);break;case"end":h[a]+=f*(n&&l?-1:1);}return h}async function ft(e,t){var n;void 0===t&&(t={});const{x:i,y:o,platform:r,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Me(t,e),m=function(e){return "number"!=typeof e?function(e){return {top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(h),p=s[f?"floating"===d?"reference":"floating":d],g=We(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(p)))||n?p:p.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),v="floating"===d?{x:i,y:o,width:a.floating.width,height:a.floating.height}:a.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),y=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},w=We(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:b,strategy:c}):v);return {top:(g.top-w.top+m.top)/y.y,bottom:(w.bottom-g.bottom+m.bottom)/y.y,left:(g.left-w.left+m.left)/y.x,right:(w.right-g.right+m.right)/y.x}}function ht(e){const t=ce(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=ee(e),r=o?e.offsetWidth:n,a=o?e.offsetHeight:i,s=Pe(n)!==r||Pe(i)!==a;return s&&(n=r,i=a),{width:n,height:i,$:s}}function mt(e){return Z(e)?e:e.contextElement}function pt(e){const t=mt(e);if(!ee(t))return Le(1);const n=t.getBoundingClientRect(),{width:i,height:o,$:r}=ht(t);let a=(r?Pe(n.width):n.width)/i,s=(r?Pe(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const gt=Le(0);function vt(e){const t=Y(e);return ae()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:gt}function bt(e,t,n,i){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),r=mt(e);let a=Le(1);t&&(i?Z(i)&&(a=pt(i)):a=pt(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Y(e))&&t}(r,n,i)?vt(r):Le(0);let c=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(r){const e=Y(r),t=i&&Z(i)?Y(i):i;let n=e,o=he(n);for(;o&&i&&t!==n;){const e=pt(o),t=o.getBoundingClientRect(),i=ce(o),r=t.left+(o.clientLeft+parseFloat(i.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(i.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=r,l+=a,n=Y(o),o=he(n);}}return We({width:u,height:d,x:c,y:l})}function yt(e,t){const n=le(e).scrollLeft;return t?t.left+n:bt(Q(e)).left+n}function wt(e,t,n){let i;if("viewport"===t)i=function(e,t){const n=Y(e),i=Q(e),o=n.visualViewport;let r=i.clientWidth,a=i.clientHeight,s=0,c=0;if(o){r=o.width,a=o.height;const e=ae();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop);}return {width:r,height:a,x:s,y:c}}(e,n);else if("document"===t)i=function(e){const t=Q(e),n=le(e),i=e.ownerDocument.body,o=Te(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=Te(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-n.scrollLeft+yt(e);const s=-n.scrollTop;return "rtl"===ce(i).direction&&(a+=Te(t.clientWidth,i.clientWidth)-o),{width:o,height:r,x:a,y:s}}(Q(e));else if(Z(t))i=function(e,t){const n=bt(e,!0,"fixed"===t),i=n.top+e.clientTop,o=n.left+e.clientLeft,r=ee(e)?pt(e):Le(1);return {width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:o*r.x,y:i*r.y}}(t,n);else {const n=vt(e);i={...t,x:t.x-n.x,y:t.y-n.y};}return We(i)}function kt(e,t){const n=ue(e);return !(n===t||!Z(n)||se(n))&&("fixed"===ce(n).position||kt(n,t))}function St(e,t,n){const i=ee(t),o=Q(t),r="fixed"===n,a=bt(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const c=Le(0);if(i||!i&&!r)if(("body"!==G(t)||ne(o))&&(s=le(t)),i){const e=bt(t,!0,r,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop;}else o&&(c.x=yt(o));let l=0,u=0;if(o&&!i&&!r){const e=o.getBoundingClientRect();u=e.top+s.scrollTop,l=e.left+s.scrollLeft-yt(o,e);}return {x:a.left+s.scrollLeft-c.x-l,y:a.top+s.scrollTop-c.y-u,width:a.width,height:a.height}}function Nt(e){return "static"===ce(e).position}function Ct(e,t){if(!ee(e)||"fixed"===ce(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Q(e)===n&&(n=n.ownerDocument.body),n}function xt(e,t){const n=Y(e);if(oe(e))return n;if(!ee(e)){let t=ue(e);for(;t&&!se(t);){if(Z(t)&&!Nt(t))return t;t=ue(t);}return n}let i=Ct(e,t);for(;i&&ie(i)&&Nt(i);)i=Ct(i,t);return i&&se(i)&&Nt(i)&&!re(i)?n:i||function(e){let t=ue(e);for(;ee(t)&&!se(t);){if(re(t))return t;if(oe(t))return null;t=ue(t);}return null}(e)||n}const It={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:i,strategy:o}=e;const r="fixed"===o,a=Q(i),s=!!t&&oe(t.floating);if(i===a||s&&r)return n;let c={scrollLeft:0,scrollTop:0},l=Le(1);const u=Le(0),d=ee(i);if((d||!d&&!r)&&(("body"!==G(i)||ne(a))&&(c=le(i)),ee(i))){const e=bt(i);l=pt(i),u.x=e.x+i.clientLeft,u.y=e.y+i.clientTop;}return {width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x,y:n.y*l.y-c.scrollTop*l.y+u.y}},getDocumentElement:Q,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:i,strategy:o}=e;const r=[..."clippingAncestors"===n?oe(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let i=fe(e,[],!1).filter((e=>Z(e)&&"body"!==G(e))),o=null;const r="fixed"===ce(e).position;let a=r?ue(e):e;for(;Z(a)&&!se(a);){const t=ce(a),n=re(a);n||"fixed"!==t.position||(o=null),(r?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||ne(a)&&!n&&kt(e,a))?i=i.filter((e=>e!==a)):o=t,a=ue(a);}return t.set(e,i),i}(t,this._c):[].concat(n),i],a=r[0],s=r.reduce(((e,n)=>{const i=wt(t,n,o);return e.top=Te(i.top,e.top),e.right=Be(i.right,e.right),e.bottom=Be(i.bottom,e.bottom),e.left=Te(i.left,e.left),e}),wt(t,a,o));return {width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:xt,getElementRects:async function(e){const t=this.getOffsetParent||xt,n=this.getDimensions,i=await n(e.floating);return {reference:St(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ht(e);return {width:t,height:n}},getScale:pt,isElement:Z,isRTL:function(e){return "rtl"===ce(e).direction}};function Et(e,t,n,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=i,l=mt(e),u=o||r?[...l?fe(l):[],...fe(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),r&&e.addEventListener("resize",n);}));const d=l&&s?function(e,t){let n,i=null;const o=Q(e);function r(){var e;clearTimeout(n),null==(e=i)||e.disconnect(),i=null;}return function a(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),r();const{left:l,top:u,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const h={rootMargin:-Re(u)+"px "+-Re(o.clientWidth-(l+d))+"px "+-Re(o.clientHeight-(u+f))+"px "+-Re(l)+"px",threshold:Te(0,Be(1,c))||1};let m=!0;function p(e){const t=e[0].intersectionRatio;if(t!==c){if(!m)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7);}),1e3);}m=!1;}try{i=new IntersectionObserver(p,{...h,root:o.ownerDocument});}catch(e){i=new IntersectionObserver(p,h);}i.observe(e);}(!0),r}(l,n):null;let f,h=-1,m=null;a&&(m=new ResizeObserver((e=>{let[i]=e;i&&i.target===l&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=m)||e.observe(t);}))),n();})),l&&!c&&m.observe(l),m.observe(t));let p=c?bt(e):null;return c&&function t(){const i=bt(e);!p||i.x===p.x&&i.y===p.y&&i.width===p.width&&i.height===p.height||n();p=i,f=requestAnimationFrame(t);}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),r&&e.removeEventListener("resize",n);})),null==d||d(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(f);}}const At=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:o,y:r,placement:a,middlewareData:s}=t,c=await async function(e,t){const{placement:n,platform:i,elements:o}=e,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),a=ze(n),s=_e(n),c="y"===je(n),l=["left","top"].includes(a)?-1:1,u=r&&c?-1:1,d=Me(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:o+c.x,y:r+c.y,data:{...c,placement:a}}}}},Bt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:o}=t,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return {x:t,y:n}}},...c}=Me(e,t),l={x:n,y:i},u=await ft(t,c),d=je(ze(o)),f=He(d);let h=l[f],m=l[d];if(r){const e="y"===f?"bottom":"right";h=De(h+u["y"===f?"top":"left"],h,h-u[e]);}if(a){const e="y"===d?"bottom":"right";m=De(m+u["y"===d?"top":"left"],m,m-u[e]);}const p=s.fn({...t,[f]:h,[d]:m});return {...p,data:{x:p.x-n,y:p.y-i,enabled:{[f]:r,[d]:a}}}}}},Tt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:o,middlewareData:r,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=Me(e,t);if(null!=(n=r.arrow)&&n.alignmentOffset)return {};const v=ze(o),b=je(s),y=ze(s)===s,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),k=f||(y||!p?[Je(s)]:function(e){const t=Je(e);return [Ue(e),t,Ue(t)]}(s)),S="none"!==m;!f&&S&&k.push(...function(e,t,n,i){const o=_e(e);let r=function(e,t,n){const i=["left","right"],o=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:i:t?i:o;case"left":case"right":return t?r:a;default:return []}}(ze(e),"start"===n,i);return o&&(r=r.map((e=>e+"-"+o)),t&&(r=r.concat(r.map(Ue)))),r}(s,p,m,w));const N=[s,...k],C=await ft(t,g),x=[];let I=(null==(i=r.flip)?void 0:i.overflows)||[];if(u&&x.push(C[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const i=_e(e),o=Ve(e),r=$e(o);let a="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[r]>t.floating[r]&&(a=Je(a)),[a,Je(a)]}(o,a,w);x.push(C[e[0]],C[e[1]]);}if(I=[...I,{placement:o,overflows:x}],!x.every((e=>e<=0))){var E,A;const e=((null==(E=r.flip)?void 0:E.index)||0)+1,t=N[e];if(t)return {data:{index:e,overflows:I},reset:{placement:t}};let n=null==(A=I.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:A.placement;if(!n)switch(h){case"bestFit":{var B;const e=null==(B=I.filter((e=>{if(S){const t=je(e.placement);return t===b||"y"===t}return !0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:B[0];e&&(n=e);break}case"initialPlacement":n=s;}if(o!==n)return {reset:{placement:n}}}return {}}}},Pt=(e,t,n)=>{const i=new Map,o={platform:It,...n},r={...o.platform,_c:i};return (async(e,t,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=dt(l,i,c),f=i,h={},m=0;for(let n=0;n<s.length;n++){const{name:r,fn:p}=s[n],{x:g,y:v,data:b,reset:y}=await p({x:u,y:d,initialPlacement:i,placement:f,strategy:o,middlewareData:h,rects:l,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,h={...h,[r]:{...h[r],...b}},y&&m<=50&&(m++,"object"==typeof y&&(y.placement&&(f=y.placement),y.rects&&(l=!0===y.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:u,y:d}=dt(l,f,c))),n=-1);}return {x:u,y:d,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:r})};var Rt="undefined"!=typeof document?useLayoutEffect:useEffect;function Lt(e,t){if(e===t)return !0;if(typeof e!=typeof t)return !1;if("function"==typeof e&&e.toString()===t.toString())return !0;let n,i,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return !1;for(i=n;0!=i--;)if(!Lt(e[i],t[i]))return !1;return !0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return !1;for(i=n;0!=i--;)if(!{}.hasOwnProperty.call(t,o[i]))return !1;for(i=n;0!=i--;){const n=o[i];if(("_owner"!==n||!e.$$typeof)&&!Lt(e[n],t[n]))return !1}return !0}return e!=e&&t!=t}function Ot(e){if("undefined"==typeof window)return 1;return (e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ft(e,t){const n=Ot(e);return Math.round(t*n)/n}function Dt(e){const t=i.useRef(e);return Rt((()=>{t.current=e;})),t}const Mt=(e,t)=>({...Bt(e),options:[e,t]}),zt=(e,t)=>({...Tt(e),options:[e,t]});function _t(e){return i.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t);}));}),e)}const Ht={...i},$t=Ht.useInsertionEffect||(e=>e());function jt(e){const t=i.useRef((()=>{}));return $t((()=>{t.current=e;})),i.useCallback((function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return null==t.current?void 0:t.current(...n)}),[])}const Vt="ArrowUp",Ut="ArrowDown",Jt="ArrowLeft",Wt="ArrowRight";function qt(e,t,n){return Math.floor(e/t)!==n}function Kt(e,t){return t<0||t>=e.current.length}function Gt(e,t){return Qt(e,{disabledIndices:t})}function Yt(e,t){return Qt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Qt(e,t){let{startingIndex:n=-1,decrement:i=!1,disabledIndices:o,amount:r=1}=void 0===t?{}:t;const a=e.current;let s=n;do{s+=i?-r:r;}while(s>=0&&s<=a.length-1&&en(a,s,o));return s}function Xt(e,t,n,i,o){if(-1===e)return -1;const r=n.indexOf(e),a=t[e];switch(o){case"tl":return r;case"tr":return a?r+a.width-1:r;case"bl":return a?r+(a.height-1)*i:r;case"br":return n.lastIndexOf(e)}}function Zt(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function en(e,t,n){if(n)return n.includes(t);const i=e[t];return null==i||i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled")}let tn=0;function nn(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:i=!0,sync:o=!1}=t;i&&cancelAnimationFrame(tn);const r=()=>null==e?void 0:e.focus({preventScroll:n});o?r():tn=requestAnimationFrame(r);}var on="undefined"!=typeof document?useLayoutEffect:useEffect;function rn(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 an=i.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function sn(e){const{children:t,elementsRef:n,labelsRef:o}=e,[r,a]=i.useState((()=>new Map)),s=i.useCallback((e=>{a((t=>new Map(t).set(e,null)));}),[]),c=i.useCallback((e=>{a((t=>{const n=new Map(t);return n.delete(e),n}));}),[]);return on((()=>{const e=new Map(r);Array.from(e.keys()).sort(rn).forEach(((t,n)=>{e.set(t,n);})),function(e,t){if(e.size!==t.size)return !1;for(const[n,i]of e.entries())if(i!==t.get(n))return !1;return !0}(r,e)||a(e);}),[r]),i.createElement(an.Provider,{value:i.useMemo((()=>({register:s,unregister:c,map:r,elementsRef:n,labelsRef:o})),[s,c,r,n,o])},t)}function cn(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:o,map:r,elementsRef:a,labelsRef:s}=i.useContext(an),[c,l]=i.useState(null),u=i.useRef(null),d=i.useCallback((e=>{if(u.current=e,null!==c&&(a.current[c]=e,s)){var n;const i=void 0!==t;s.current[c]=i?t:null!=(n=null==e?void 0:e.textContent)?n:null;}}),[c,a,s,t]);return on((()=>{const e=u.current;if(e)return n(e),()=>{o(e);}}),[n,o]),on((()=>{const e=u.current?r.get(u.current):null;null!=e&&l(e);}),[r]),i.useMemo((()=>({ref:d,index:null==c?-1:c})),[c,d])}function ln(){return ln=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);}return e},ln.apply(this,arguments)}let un=!1,dn=0;const fn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+dn++;const hn=Ht.useId||function(){const[e,t]=i.useState((()=>un?fn():void 0));return on((()=>{null==e&&t(fn());}),[]),i.useEffect((()=>{un=!0;}),[]),e};function gn(){const e=new Map;return {emit(t,n){var i;null==(i=e.get(t))||i.forEach((e=>e(n)));},on(t,n){e.set(t,[...e.get(t)||[],n]);},off(t,n){var i;e.set(t,(null==(i=e.get(t))?void 0:i.filter((e=>e!==n)))||[]);}}}const vn=i.createContext(null),bn=i.createContext(null),yn=()=>{var e;return (null==(e=i.useContext(vn))?void 0:e.id)||null},wn=()=>i.useContext(bn);function kn(e){const{children:t,id:n}=e,o=yn();return i.createElement(vn.Provider,{value:i.useMemo((()=>({id:n,parentId:o})),[n,o])},t)}function Sn(e){const{children:t}=e,n=i.useRef([]),o=i.useCallback((e=>{n.current=[...n.current,e];}),[]),r=i.useCallback((e=>{n.current=n.current.filter((t=>t!==e));}),[]),a=i.useState((()=>gn()))[0];return i.createElement(bn.Provider,{value:i.useMemo((()=>({nodesRef:n,addNode:o,removeNode:r,events:a})),[o,r,a])},t)}function Nn(e){return "data-floating-ui-"+e}function Cn(e){const t=useRef(e);return on((()=>{t.current=e;})),t}const xn=Nn("safe-polygon");function In(e,t,n){return n&&!Se(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function En(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),i=n;for(;i.length;)i=e.filter((e=>{var t;return null==(t=i)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(i);return n}let An=new WeakMap,Bn=new WeakSet,Tn={},Pn=0;const Rn=e=>e&&(e.host||Rn(e.parentNode));function Ln(e,t,n,i){const o="data-floating-ui-inert",r=i?"inert":n?"aria-hidden":null,a=(s=t,e.map((e=>{if(s.contains(e))return e;const t=Rn(e);return s.contains(t)?t:null})).filter((e=>null!=e)));var s;const c=new Set,l=new Set(a),u=[];Tn[o]||(Tn[o]=new WeakMap);const d=Tn[o];return a.forEach((function e(t){if(!t||c.has(t))return;c.add(t),t.parentNode&&e(t.parentNode);})),function e(t){if(!t||l.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==G(t))if(c.has(t))e(t);else {const e=r?t.getAttribute(r):null,n=null!==e&&"false"!==e,i=(An.get(t)||0)+1,a=(d.get(t)||0)+1;An.set(t,i),d.set(t,a),u.push(t),1===i&&n&&Bn.add(t),1===a&&t.setAttribute(o,""),!n&&r&&t.setAttribute(r,"true");}}));}(t),c.clear(),Pn++,()=>{u.forEach((e=>{const t=(An.get(e)||0)-1,n=(d.get(e)||0)-1;An.set(e,t),d.set(e,n),t||(!Bn.has(e)&&r&&e.removeAttribute(r),Bn.delete(e)),n||e.removeAttribute(o);})),Pn--,Pn||(An=new WeakMap,An=new WeakMap,Bn=new WeakSet,Tn={});}}function On(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=Ne(e[0]).body;return Ln(e.concat(Array.from(i.querySelectorAll("[aria-live]"))),i,t,n)}const Fn=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Dn(e,t){const n=ut(e,Fn());"prev"===t&&n.reverse();const i=n.indexOf(me(Ne(e)));return n.slice(i+1)[0]}function Mn(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return !i||!pe(n,i)}const zn={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 _n(e){"Tab"===e.key&&(e.target,clearTimeout(undefined));}const Hn=i.forwardRef((function(e,t){const[n,o]=i.useState();on((()=>(we()&&o("button"),document.addEventListener("keydown",_n),()=>{document.removeEventListener("keydown",_n);})),[]);const r={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Nn("focus-guard")]:"",style:zn};return i.createElement("span",ln({},e,r))})),$n=i.createContext(null),jn="data-floating-ui-focusable";function Vn(e){return e?e.hasAttribute(jn)?e:e.querySelector("["+jn+"]")||e:null}let Un=[];function Jn(e){Un=Un.filter((e=>e.isConnected));let t=e;if(t&&"body"!==G(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return !1!==Ge.call(e,qe)&&st(t,e)}(t,Fn())){const e=ut(t,Fn())[0];e&&(t=e);}Un.push(t),Un.length>20&&(Un=Un.slice(-20));}}function Wn(){return Un.slice().reverse().find((e=>e.isConnected))}const qn=i.forwardRef((function(e,t){return i.createElement("button",ln({},e,{type:"button",ref:t,tabIndex:-1,style:zn}))}));function Kn(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:a=!0,initialFocus:s=0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:m,nodeId:p,onOpenChange:g,events:v,dataRef:b,floatingId:y,elements:{domReference:w,floating:k}}=t,S="number"==typeof s&&s<0,N=Ae(w)&&S,C="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||a,x=Cn(r),I=Cn(s),E=Cn(c),A=wn(),B=i.useContext($n),T=i.useRef(null),P=i.useRef(null),R=i.useRef(!1),L=i.useRef(!1),O=i.useRef(-1),F=null!=B,D=Vn(k),M=jt((function(e){return void 0===e&&(e=D),e?ut(e,Fn()):[]})),z=jt((e=>{const t=M(e);return x.current.map((e=>w&&"reference"===e?w:D&&"floating"===e?D:t)).filter(Boolean).flat()}));function _(e){return !o&&d&&u?i.createElement(qn,{ref:"start"===e?T:P,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}i.useEffect((()=>{R.current=!1;}),[o]),i.useEffect((()=>{if(o)return;if(!u)return;function e(e){if("Tab"===e.key){pe(D,me(Ne(D)))&&0===M().length&&!N&&Ee(e);const t=z(),n=xe(e);"reference"===x.current[0]&&n===w&&(Ee(e),e.shiftKey?nn(t[t.length-1]):nn(t[1])),"floating"===x.current[1]&&n===D&&e.shiftKey&&(Ee(e),nn(t[0]));}}const t=Ne(D);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e);}}),[o,w,D,u,x,N,M,z]),i.useEffect((()=>{if(!o&&k)return k.addEventListener("focusin",e),()=>{k.removeEventListener("focusin",e);};function e(e){const t=xe(e),n=M().indexOf(t);-1!==n&&(O.current=n);}}),[o,k,M]),i.useEffect((()=>{if(!o&&f)return k&&ee(w)?(w.addEventListener("focusout",t),w.addEventListener("pointerdown",e),k.addEventListener("focusout",t),()=>{w.removeEventListener("focusout",t),w.removeEventListener("pointerdown",e),k.removeEventListener("focusout",t);}):void 0;function e(){L.current=!0,setTimeout((()=>{L.current=!1;}));}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(pe(w,t)||pe(k,t)||pe(t,k)||pe(null==B?void 0:B.portalNode,t)||null!=t&&t.hasAttribute(Nn("focus-guard"))||A&&(En(A.nodesRef.current,p).find((e=>{var n,i;return pe(null==(n=e.context)?void 0:n.elements.floating,t)||pe(null==(i=e.context)?void 0:i.elements.domReference,t)}))||function(e,t){var n;let i=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(i=i.concat(t));}return i}(A.nodesRef.current,p).find((e=>{var n,i;return (null==(n=e.context)?void 0:n.elements.floating)===t||(null==(i=e.context)?void 0:i.elements.domReference)===t}))));if(l&&n&&me(Ne(D))===Ne(D).body){ee(D)&&D.focus();const e=O.current,t=M(),n=t[e]||t[t.length-1]||D;ee(n)&&n.focus();}!N&&u||!t||!n||L.current||t===Wn()||(R.current=!0,g(!1,e,"focus-out"));}));}}),[o,w,k,D,u,p,A,B,g,f,l,M,N]),i.useEffect((()=>{var e;if(o)return;const t=Array.from((null==B||null==(e=B.portalNode)?void 0:e.querySelectorAll("["+Nn("portal")+"]"))||[]);if(k){const e=[k,...t,T.current,P.current,x.current.includes("reference")||N?w:null].filter((e=>null!=e)),n=u||N?On(e,C,!C):On(e);return ()=>{n();}}}),[o,w,k,u,x,B,N,C]),on((()=>{if(o||!ee(D))return;const e=me(Ne(D));queueMicrotask((()=>{const t=z(D),n=I.current,i=("number"==typeof n?t[n]:n.current)||D,o=pe(D,e);S||o||!h||nn(i,{preventScroll:i===D});}));}),[o,h,D,S,z,I]),on((()=>{if(o||!D)return;let e=!1;const t=Ne(D),n=me(t);let i=b.current.openEvent;function r(t){let{open:n,reason:o,event:r,nested:a}=t;n&&(i=r),"escape-key"===o&&m.domReference.current&&Jn(m.domReference.current),"hover"===o&&"mouseleave"===r.type&&(R.current=!0),"outside-press"===o&&(a?(R.current=!1,e=!0):R.current=!(be(r)||ye(r)));}Jn(n),v.on("openchange",r);const a=t.createElement("span");return a.setAttribute("tabindex","-1"),a.setAttribute("aria-hidden","true"),Object.assign(a.style,zn),F&&w&&w.insertAdjacentElement("afterend",a),()=>{v.off("openchange",r);const n=me(t),o=pe(k,n)||A&&En(A.nodesRef.current,p).some((e=>{var t;return pe(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||i&&["click","mousedown"].includes(i.type))&&m.domReference.current&&Jn(m.domReference.current);const s=Wn()||a;queueMicrotask((()=>{E.current&&!R.current&&ee(s)&&(s===n||n===t.body||o)&&s.focus({preventScroll:e}),a.remove();}));}}),[o,k,D,E,b,m,v,A,p,F,w]),on((()=>{if(!o&&B)return B.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:g,refs:m}),()=>{B.setFocusManagerState(null);}}),[o,B,u,h,g,m,f]),on((()=>{if(o)return;if(!D)return;if("function"!=typeof MutationObserver)return;if(S)return;const e=()=>{const e=D.getAttribute("tabindex"),t=M(),n=me(Ne(k)),i=t.indexOf(n);-1!==i&&(O.current=i),x.current.includes("floating")||n!==m.domReference.current&&0===t.length?"0"!==e&&D.setAttribute("tabindex","0"):"-1"!==e&&D.setAttribute("tabindex","-1");};e();const t=new MutationObserver(e);return t.observe(D,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect();}}),[o,k,D,m,x,M,S]);const H=!o&&C&&(!u||!N)&&(F||u);return i.createElement(i.Fragment,null,H&&i.createElement(Hn,{"data-type":"inside",ref:null==B?void 0:B.beforeInsideRef,onFocus:e=>{if(u){const e=z();nn("reference"===r[0]?e[0]:e[e.length-1]);}else if(null!=B&&B.preserveTabOrder&&B.portalNode)if(R.current=!1,Mn(e,B.portalNode)){const e=Dn(document.body,"next")||w;null==e||e.focus();}else {var t;null==(t=B.beforeOutsideRef.current)||t.focus();}}}),!N&&_("start"),n,_("end"),H&&i.createElement(Hn,{"data-type":"inside",ref:null==B?void 0:B.afterInsideRef,onFocus:e=>{if(u)nn(z()[0]);else if(null!=B&&B.preserveTabOrder&&B.portalNode)if(f&&(R.current=!0),Mn(e,B.portalNode)){const e=Dn(document.body,"prev")||w;null==e||e.focus();}else {var t;null==(t=B.afterOutsideRef.current)||t.focus();}}}))}function Gn(e){return ee(e.target)&&"BUTTON"===e.target.tagName}function Yn(e){return Ie(e)}const Qn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Xn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Zn=e=>{var t,n;return {escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function ei(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=hn(),a=i.useRef({}),[s]=i.useState((()=>gn())),c=null!=yn();const[l,u]=i.useState(o.reference),d=jt(((e,t,i)=>{a.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:i,nested:c}),null==n||n(e,t,i);})),f=i.useMemo((()=>({setPositionReference:u})),[]),h=i.useMemo((()=>({reference:l||o.reference||null,floating:o.floating||null,domReference:o.reference})),[l,o.reference,o.floating]);return i.useMemo((()=>({dataRef:a,open:t,onOpenChange:d,elements:h,events:s,floatingId:r,refs:f})),[t,d,h,s,r,f])}function ti(e){void 0===e&&(e={});const{nodeId:t}=e,n=ei({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[a,s]=i.useState(null),[c,l]=i.useState(null),u=(null==r?void 0:r.reference)||a,d=i.useRef(null),f=wn();on((()=>{u&&(d.current=u);}),[u]);const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:a,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=i.useState(o);Lt(h,o)||p(o);const[g,v]=i.useState(null),[b,y]=i.useState(null),w=i.useCallback((e=>{e!==C.current&&(C.current=e,v(e));}),[]),k=i.useCallback((e=>{e!==x.current&&(x.current=e,y(e));}),[]),S=a||g,N=s||b,C=i.useRef(null),x=i.useRef(null),I=i.useRef(d),E=null!=l,A=Dt(l),B=Dt(r),T=Dt(u),P=i.useCallback((()=>{if(!C.current||!x.current)return;const e={placement:t,strategy:n,middleware:h};B.current&&(e.platform=B.current),Pt(C.current,x.current,e).then((e=>{const t={...e,isPositioned:!1!==T.current};R.current&&!Lt(I.current,t)&&(I.current=t,require$$0.flushSync((()=>{f(t);})));}));}),[h,t,n,B,T]);Rt((()=>{!1===u&&I.current.isPositioned&&(I.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))));}),[u]);const R=i.useRef(!1);Rt((()=>(R.current=!0,()=>{R.current=!1;})),[]),Rt((()=>{if(S&&(C.current=S),N&&(x.current=N),S&&N){if(A.current)return A.current(S,N,P);P();}}),[S,N,P,A,E]);const L=i.useMemo((()=>({reference:C,floating:x,setReference:w,setFloating:k})),[w,k]),O=i.useMemo((()=>({reference:S,floating:N})),[S,N]),F=i.useMemo((()=>{const e={position:n,left:0,top:0};if(!O.floating)return e;const t=Ft(O.floating,d.x),i=Ft(O.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+i+"px)",...Ot(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:i}}),[n,c,O.floating,d.x,d.y]);return i.useMemo((()=>({...d,update:P,refs:L,elements:O,floatingStyles:F})),[d,P,L,O,F])}({...e,elements:{...r,...c&&{reference:c}}}),p=i.useCallback((e=>{const t=Z(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),h.refs.setReference(t);}),[h.refs]),g=i.useCallback((e=>{(Z(e)||null===e)&&(d.current=e,s(e)),(Z(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!Z(e))&&h.refs.setReference(e);}),[h.refs]),v=i.useMemo((()=>({...h.refs,setReference:g,setPositionReference:p,domReference:d})),[h.refs,g,p]),b=i.useMemo((()=>({...h.elements,domReference:u})),[h.elements,u]),y=i.useMemo((()=>({...h,...o,refs:v,elements:b,nodeId:t})),[h,v,b,t,o]);return on((()=>{o.dataRef.current.floatingContext=y;const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===t));e&&(e.context=y);})),i.useMemo((()=>({...h,context:y,refs:v,elements:b})),[h,v,b,y])}const ni="active",ii="selected";function oi(e,t,n){const i=new Map,o="item"===n;let r=e;if(o&&e){const{[ni]:t,[ii]:n,...i}=e;r=i;}return {..."floating"===n&&{tabIndex:-1,[jn]:""},...r,...t.map((t=>{const i=t?t[n]:null;return "function"==typeof i?e?i(e):null:i})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,r]=t;var a;o&&[ni,ii].includes(n)||(0===n.indexOf("on")?(i.has(n)||i.set(n,[]),"function"==typeof r&&(null==(a=i.get(n))||a.push(r),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return null==(e=i.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=r);})),e):e),{})}}let ri=!1;function ai(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function si(e,t){return ai(t,e===Vt||e===Ut,e===Jt||e===Wt)}function ci(e,t,n){return ai(t,e===Ut,n?e===Jt:e===Wt)||"Enter"===e||" "===e||""===e}function li(e,t,n){return ai(t,n?e===Wt:e===Jt,e===Vt)}function ui(e,t){const{open:n,onOpenChange:o,elements:r}=e,{listRef:a,activeIndex:s,onNavigate:c=()=>{},enabled:l=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:h=!1,rtl:m=!1,virtual:p=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:y,orientation:w="vertical",cols:k=1,scrollItemIntoView:S=!0,virtualItemRef:N,itemSizes:C,dense:x=!1}=t;const I=Cn(Vn(r.floating)),E=yn(),A=wn(),B=jt(c),T=i.useRef(g),P=i.useRef(null!=u?u:-1),R=i.useRef(null),L=i.useRef(!0),O=i.useRef(B),F=i.useRef(!!r.floating),D=i.useRef(n),M=i.useRef(!1),z=i.useRef(!1),_=Cn(y),H=Cn(n),$=Cn(S),j=Cn(u),[V,U]=i.useState(),[J,W]=i.useState(),q=jt((function(e,t,n){function i(e){p?(U(e.id),null==A||A.events.emit("virtualfocus",e),N&&(N.current=e)):nn(e,{preventScroll:!0,sync:!(!ge().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!we())&&(ri||M.current)});}void 0===n&&(n=!1);const o=e.current[t.current];o&&i(o),requestAnimationFrame((()=>{const r=e.current[t.current]||o;if(!r)return;o||i(r);const a=$.current;a&&G&&(n||!L.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof a?{block:"nearest",inline:"nearest"}:a));}));}));on((()=>{document.createElement("div").focus({get preventScroll(){return ri=!0,!1}});}),[]),on((()=>{l&&(n&&r.floating?T.current&&null!=u&&(z.current=!0,P.current=u,B(u)):F.current&&(P.current=-1,O.current(null)));}),[l,n,r.floating,u,B]),on((()=>{if(l&&n&&r.floating)if(null==s){if(M.current=!1,null!=j.current)return;if(F.current&&(P.current=-1,q(a,P)),(!D.current||!F.current)&&T.current&&(null!=R.current||!0===T.current&&null==R.current)){let e=0;const t=()=>{if(null==a.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t);}e++;}else P.current=null==R.current||ci(R.current,w,m)||h?Gt(a,_.current):Yt(a,_.current),R.current=null,B(P.current);};t();}}else Kt(a,s)||(P.current=s,q(a,P,z.current),z.current=!1);}),[l,n,r.floating,s,j,h,a,w,m,B,q,_]),on((()=>{var e;if(!l||r.floating||!A||p||!F.current)return;const t=A.nodesRef.current,n=null==(e=t.find((e=>e.id===E)))||null==(e=e.context)?void 0:e.elements.floating,i=me(Ne(r.floating)),o=t.some((e=>e.context&&pe(e.context.elements.floating,i)));n&&!o&&L.current&&n.focus({preventScroll:!0});}),[l,r.floating,A,E,p]),on((()=>{if(l&&A&&p&&!E)return A.events.on("virtualfocus",e),()=>{A.events.off("virtualfocus",e);};function e(e){W(e.id),N&&(N.current=e);}}),[l,A,p,E,N]),on((()=>{O.current=B,F.current=!!r.floating;})),on((()=>{n||(R.current=null);}),[n]),on((()=>{D.current=n;}),[n]);const K=null!=s,G=i.useMemo((()=>{function e(e){if(!n)return;const t=a.current.indexOf(e);-1!==t&&B(t);}return {onFocus(t){let{currentTarget:n}=t;e(n);},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;e(n);},onPointerLeave(e){let{pointerType:t}=e;L.current&&"touch"!==t&&(P.current=-1,q(a,P),B(null),p||nn(I.current,{preventScroll:!0}));}}}}),[n,I,q,v,a,B,p]),Y=jt((e=>{if(L.current=!1,M.current=!0,229===e.which)return;if(!H.current&&e.currentTarget===I.current)return;if(h&&li(e.key,w,m))return Ee(e),o(!1,e.nativeEvent,"list-navigation"),void(ee(r.domReference)&&!p&&r.domReference.focus());const t=P.current,i=Gt(a,y),s=Yt(a,y);if("Home"===e.key&&(Ee(e),P.current=i,B(P.current)),"End"===e.key&&(Ee(e),P.current=s,B(P.current)),k>1){const t=C||Array.from({length:a.current.length},(()=>({width:1,height:1}))),n=function(e,t,n){const i=[];let o=0;return e.forEach(((e,r)=>{let{width:a,height:s}=e;if(a>t&&"production"!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+r+" is greater than grid columns");let c=!1;for(n&&(o=0);!c;){const e=[];for(let n=0;n<a;n++)for(let i=0;i<s;i++)e.push(o+n+i*t);o%t+a<=t&&e.every((e=>null==i[e]))?(e.forEach((e=>{i[e]=r;})),c=!0):o++;}})),[...i]}(t,k,x),o=n.findIndex((e=>null!=e&&!en(a.current,e,y))),r=n.reduce(((e,t,n)=>null==t||en(a.current,t,y)?e:n),-1),c=n[function(e,t){let{event:n,orientation:i,loop:o,cols:r,disabledIndices:a,minIndex:s,maxIndex:c,prevIndex:l,stopEvent:u=!1}=t,d=l;if(n.key===Vt){if(u&&Ee(n),-1===l)d=c;else if(d=Qt(e,{startingIndex:d,amount:r,decrement:!0,disabledIndices:a}),o&&(l-r<s||d<0)){const e=l%r,t=c%r,n=c-(t-e);d=t===e?c:t>e?n:n-r;}Kt(e,d)&&(d=l);}if(n.key===Ut&&(u&&Ee(n),-1===l?d=s:(d=Qt(e,{startingIndex:l,amount:r,disabledIndices:a}),o&&l+r>c&&(d=Qt(e,{startingIndex:l%r-r,amount:r,disabledIndices:a}))),Kt(e,d)&&(d=l)),"both"===i){const t=Re(l/r);n.key===Wt&&(u&&Ee(n),l%r!=r-1?(d=Qt(e,{startingIndex:l,disabledIndices:a}),o&&qt(d,r,t)&&(d=Qt(e,{startingIndex:l-l%r-1,disabledIndices:a}))):o&&(d=Qt(e,{startingIndex:l-l%r-1,disabledIndices:a})),qt(d,r,t)&&(d=l)),n.key===Jt&&(u&&Ee(n),l%r!=0?(d=Qt(e,{startingIndex:l,decrement:!0,disabledIndices:a}),o&&qt(d,r,t)&&(d=Qt(e,{startingIndex:l+(r-l%r),decrement:!0,disabledIndices:a}))):o&&(d=Qt(e,{startingIndex:l+(r-l%r),decrement:!0,disabledIndices:a})),qt(d,r,t)&&(d=l));const i=Re(c/r)===t;Kt(e,d)&&(d=o&&i?n.key===Jt?c:Qt(e,{startingIndex:l-l%r-1,disabledIndices:a}):l);}return d}({current:n.map((e=>null!=e?a.current[e]:null))},{event:e,orientation:w,loop:f,cols:k,disabledIndices:Zt([...y||a.current.map(((e,t)=>en(a.current,t)?t:void 0)),void 0],n),minIndex:o,maxIndex:r,prevIndex:Xt(P.current>s?i:P.current,t,n,k,e.key===Ut?"bl":e.key===Wt?"tr":"tl"),stopEvent:!0})];if(null!=c&&(P.current=c,B(P.current)),"both"===w)return}if(si(e.key,w)){if(Ee(e),n&&!p&&me(e.currentTarget.ownerDocument)===e.currentTarget)return P.current=ci(e.key,w,m)?i:s,void B(P.current);ci(e.key,w,m)?P.current=f?t>=s?d&&t!==a.current.length?-1:i:Qt(a,{startingIndex:t,disabledIndices:y}):Math.min(s,Qt(a,{startingIndex:t,disabledIndices:y})):P.current=f?t<=i?d&&-1!==t?a.current.length:s:Qt(a,{startingIndex:t,decrement:!0,disabledIndices:y}):Math.max(i,Qt(a,{startingIndex:t,decrement:!0,disabledIndices:y})),Kt(a,P.current)?B(null):B(P.current);}})),Q=i.useMemo((()=>p&&n&&K&&{"aria-activedescendant":J||V}),[p,n,K,J,V]),X=i.useMemo((()=>({"aria-orientation":"both"===w?void 0:w,...!Ae(r.domReference)&&Q,onKeyDown:Y,onPointerMove(){L.current=!0;}})),[Q,Y,r.domReference,w]),Z=i.useMemo((()=>{function e(e){"auto"===g&&be(e.nativeEvent)&&(T.current=!0);}return {...Q,onKeyDown(e){L.current=!1;const t=e.key.startsWith("Arrow"),i=["Home","End"].includes(e.key),r=t||i,s=function(e,t,n){return ai(t,n?e===Jt:e===Wt,e===Ut)}(e.key,w,m),c=li(e.key,w,m),l=si(e.key,w),d=(h?s:l)||"Enter"===e.key||""===e.key.trim();if(p&&n){const t=null==A?void 0:A.nodesRef.current.find((e=>null==e.parentId)),n=A&&t?function(e,t){let n,i=-1;return function t(o,r){r>i&&(n=o,i=r),En(e,o).forEach((e=>{t(e.id,r+1);}));}(t,0),e.find((e=>e.id===n))}(A.nodesRef.current,t.id):null;if(r&&n&&N){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(s||c){var f,g;const i=(null==(f=n.context)?void 0:f.elements.domReference)===e.currentTarget,o=c&&!i?null==(g=n.context)?void 0:g.elements.domReference:s?a.current.find((e=>(null==e?void 0:e.id)===V)):null;o&&(Ee(e),o.dispatchEvent(t),W(void 0));}var v;if((l||i)&&n.context)if(n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return Ee(e),void(null==(v=n.context.elements.domReference)||v.dispatchEvent(t))}return Y(e)}(n||b||!t)&&(d&&(R.current=h&&l?null:e.key),h?s&&(Ee(e),n?(P.current=Gt(a,_.current),B(P.current)):o(!0,e.nativeEvent,"list-navigation")):l&&(null!=u&&(P.current=u),Ee(e),!n&&b?o(!0,e.nativeEvent,"list-navigation"):Y(e),n&&B(P.current)));},onFocus(){n&&!p&&B(null);},onPointerDown:function(e){T.current=g,"auto"===g&&ye(e.nativeEvent)&&(T.current=!0);},onMouseDown:e,onClick:e}}),[V,Q,Y,_,g,a,h,B,o,n,b,w,m,u,A,p,N]);return i.useMemo((()=>l?{reference:Z,floating:X,item:G}:{}),[l,Z,X,G])}const di=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function fi(e,t){const[n,i]=e;let o=!1;const r=t.length;for(let e=0,a=r-1;e<r;a=e++){const[r,s]=t[e]||[0,0],[c,l]=t[a]||[0,0];s>=i!=l>=i&&n<=(c-r)*(i-s)/(l-s)+r&&(o=!o);}return o}function hi(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:i=!0}=e;let o,r=!1,a=null,s=null,c=performance.now();const l=e=>{let{x:n,y:l,placement:u,elements:d,onClose:f,nodeId:h,tree:m}=e;return function(e){function p(){clearTimeout(o),f();}if(clearTimeout(o),!d.domReference||!d.floating||null==u||null==n||null==l)return;const{clientX:g,clientY:v}=e,b=[g,v],y=xe(e),w="mouseleave"===e.type,k=pe(d.floating,y),S=pe(d.domReference,y),N=d.domReference.getBoundingClientRect(),C=d.floating.getBoundingClientRect(),x=u.split("-")[0],I=n>C.right-C.width/2,E=l>C.bottom-C.height/2,A=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(b,N),B=C.width>N.width,T=C.height>N.height,P=(B?N:C).left,R=(B?N:C).right,L=(T?N:C).top,O=(T?N:C).bottom;if(k&&(r=!0,!w))return;if(S&&(r=!1),S&&!w)return void(r=!0);if(w&&Z(e.relatedTarget)&&pe(d.floating,e.relatedTarget))return;if(m&&En(m.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===x&&l>=N.bottom-1||"bottom"===x&&l<=N.top+1||"left"===x&&n>=N.right-1||"right"===x&&n<=N.left+1)return p();let F=[];switch(x){case"top":F=[[P,N.top+1],[P,C.bottom-1],[R,C.bottom-1],[R,N.top+1]];break;case"bottom":F=[[P,C.top+1],[P,N.bottom-1],[R,N.bottom-1],[R,C.top+1]];break;case"left":F=[[C.right-1,O],[C.right-1,L],[N.left+1,L],[N.left+1,O]];break;case"right":F=[[N.right-1,O],[N.right-1,L],[C.left+1,L],[C.left+1,O]];}if(!fi([g,v],F)){if(r&&!A)return p();if(!w&&i){const t=function(e,t){const n=performance.now(),i=n-c;if(null===a||null===s||0===i)return a=e,s=t,c=n,null;const o=e-a,r=t-s,l=Math.sqrt(o*o+r*r);return a=e,s=t,c=n,l/i}(e.clientX,e.clientY);if(null!==t&&t<.1)return p()}fi([g,v],function(e){let[n,i]=e;switch(x){case"top":return [[B?n+t/2:I?n+4*t:n-4*t,i+t+1],[B?n-t/2:I?n+4*t:n-4*t,i+t+1],...[[C.left,I||B?C.bottom-t:C.top],[C.right,I?B?C.bottom-t:C.top:C.bottom-t]]];case"bottom":return [[B?n+t/2:I?n+4*t:n-4*t,i-t],[B?n-t/2:I?n+4*t:n-4*t,i-t],...[[C.left,I||B?C.top+t:C.bottom],[C.right,I?B?C.top+t:C.bottom:C.top+t]]];case"left":{const e=[n+t+1,T?i+t/2:E?i+4*t:i-4*t],o=[n+t+1,T?i-t/2:E?i+4*t:i-4*t];return [...[[E||T?C.right-t:C.left,C.top],[E?T?C.right-t:C.left:C.right-t,C.bottom]],e,o]}case"right":return [[n-t,T?i+t/2:E?i+4*t:i-4*t],[n-t,T?i-t/2:E?i+4*t:i-4*t],...[[E||T?C.left+t:C.right,C.top],[E?T?C.left+t:C.right:C.left+t,C.bottom]]]}}([n,l]))?!r&&i&&(o=window.setTimeout(p,40)):p();}}};return l.__options={blockPointerEvents:n},l}const mi=createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1}),pi=forwardRef((({className:t,disabled:n,children:i,...o},r)=>{const a=useContext(mi),c=cn(),l=wn(),u=c.index===a.activeIndex,d=w("io-dropdown-menu-item",n&&"io-dropdown-menu-item-disabled",t);return jsxRuntimeExports.jsx("div",{ref:_t([c.ref,r]),role:"menuitem",className:d,tabIndex:u?0:-1,...a.getItemProps({onClick(e){o.onClick?.(e),l?.events.emit("click");},onFocus(e){o.onFocus?.(e),a.setHasFocusInside(!0);}}),...o,children:i})}));pi.displayName="DropdownMenuItem";const gi=forwardRef((({className:n,variant:o="default",icon:r,iconRight:a,text:f="",disabled:h,children:m,...p},g)=>{const[v,b]=useState(!1),[y,k]=useState(!1),[S,N]=useState(null),C=useRef([]),x=useRef([]),I=useContext(mi),E=wn(),B=function(e){const t=hn(),n=wn(),i=yn(),o=i;return on((()=>{const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e);}}),[n,t,o]),t}(),T=yn(),P=cn(),R=null!=T,{floatingStyles:L,refs:O,context:F}=ti({nodeId:B,open:v,onOpenChange:b,placement:R?"right-start":"bottom-start",middleware:[(D={mainAxis:R?0:4,alignmentAxis:R?-4:0},{...At(D),options:[D,M]}),zt(),Mt()],whileElementsMounted:Et});var D,M;const z=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:a,elements:s}=e,{enabled:c=!0,delay:l=0,handleClose:u=null,mouseOnly:d=!1,restMs:f=0,move:h=!0}=t,m=wn(),p=yn(),g=Cn(u),v=Cn(l),b=Cn(n),y=i.useRef(),w=i.useRef(-1),k=i.useRef(),S=i.useRef(-1),N=i.useRef(!0),C=i.useRef(!1),x=i.useRef((()=>{})),I=i.useRef(!1),E=i.useCallback((()=>{var e;const t=null==(e=r.current.openEvent)?void 0:e.type;return (null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[r]);i.useEffect((()=>{if(c)return a.on("openchange",e),()=>{a.off("openchange",e);};function e(e){let{open:t}=e;t||(clearTimeout(w.current),clearTimeout(S.current),N.current=!0,I.current=!1);}}),[c,a]),i.useEffect((()=>{if(!c)return;if(!g.current)return;if(!n)return;function e(e){E()&&o(!1,e,"hover");}const t=Ne(s.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e);}}),[s.floating,n,o,c,g,E]);const A=i.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const i=In(v.current,"close",y.current);i&&!k.current?(clearTimeout(w.current),w.current=window.setTimeout((()=>o(!1,e,n)),i)):t&&(clearTimeout(w.current),o(!1,e,n));}),[v,o]),B=jt((()=>{x.current(),k.current=void 0;})),T=jt((()=>{if(C.current){const e=Ne(s.floating).body;e.style.pointerEvents="",e.removeAttribute(xn),C.current=!1;}}));i.useEffect((()=>{if(c&&Z(s.domReference)){var e;const t=s.domReference;return n&&t.addEventListener("mouseleave",l),null==(e=s.floating)||e.addEventListener("mouseleave",l),h&&t.addEventListener("mousemove",i,{once:!0}),t.addEventListener("mouseenter",i),t.addEventListener("mouseleave",a),()=>{var e;n&&t.removeEventListener("mouseleave",l),null==(e=s.floating)||e.removeEventListener("mouseleave",l),h&&t.removeEventListener("mousemove",i),t.removeEventListener("mouseenter",i),t.removeEventListener("mouseleave",a);}}function t(){return !!r.current.openEvent&&["click","mousedown"].includes(r.current.openEvent.type)}function i(e){if(clearTimeout(w.current),N.current=!1,d&&!Se(y.current)||f>0&&!In(v.current,"open"))return;const t=In(v.current,"open",y.current);t?w.current=window.setTimeout((()=>{b.current||o(!0,e,"hover");}),t):o(!0,e,"hover");}function a(e){if(t())return;x.current();const i=Ne(s.floating);if(clearTimeout(S.current),I.current=!1,g.current&&r.current.floatingContext){n||clearTimeout(w.current),k.current=g.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){T(),B(),A(e,!0,"safe-polygon");}});const t=k.current;return i.addEventListener("mousemove",t),void(x.current=()=>{i.removeEventListener("mousemove",t);})}("touch"!==y.current||!pe(s.floating,e.relatedTarget))&&A(e);}function l(e){t()||r.current.floatingContext&&(null==g.current||g.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){T(),B(),A(e);}})(e));}}),[s,c,e,d,f,h,A,B,T,o,n,b,m,v,g,r]),on((()=>{var e;if(c&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&E()){C.current=!0;const e=s.floating;if(Z(s.domReference)&&e){var t;const n=Ne(s.floating).body;n.setAttribute(xn,"");const i=s.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===p)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",i.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",i.style.pointerEvents="",e.style.pointerEvents="";}}}}),[c,n,p,s,m,g,E]),on((()=>{n||(y.current=void 0,I.current=!1,B(),T());}),[n,B,T]),i.useEffect((()=>()=>{B(),clearTimeout(w.current),clearTimeout(S.current),T();}),[c,s.domReference,B,T]);const P=i.useMemo((()=>{function e(e){y.current=e.pointerType;}return {onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function i(){N.current||b.current||o(!0,t,"hover");}d&&!Se(y.current)||n||0===f||I.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(S.current),"touch"===y.current?i():(I.current=!0,S.current=window.setTimeout(i,f)));}}}),[d,o,n,b,f]),R=i.useMemo((()=>({onMouseEnter(){clearTimeout(w.current);},onMouseLeave(e){A(e.nativeEvent,!1);}})),[A]);return i.useMemo((()=>c?{reference:P,floating:R}:{}),[c,P,R])}(F,{enabled:R,delay:{open:75},handleClose:hi({blockPointerEvents:!0})}),_=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:r,elements:{domReference:a}}=e,{enabled:s=!0,event:c="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0}=t,f=i.useRef(),h=i.useRef(!1),m=i.useMemo((()=>({onPointerDown(e){f.current=e.pointerType;},onMouseDown(e){const t=f.current;0===e.button&&"click"!==c&&(Se(t,!0)&&u||(!n||!l||r.current.openEvent&&"mousedown"!==r.current.openEvent.type?(e.preventDefault(),o(!0,e.nativeEvent,"click")):o(!1,e.nativeEvent,"click")));},onClick(e){const t=f.current;"mousedown"===c&&f.current?f.current=void 0:Se(t,!0)&&u||(!n||!l||r.current.openEvent&&"click"!==r.current.openEvent.type?o(!0,e.nativeEvent,"click"):o(!1,e.nativeEvent,"click"));},onKeyDown(e){f.current=void 0,e.defaultPrevented||!d||Gn(e)||(" "!==e.key||Yn(a)||(e.preventDefault(),h.current=!0),"Enter"===e.key&&o(!n||!l,e.nativeEvent,"click"));},onKeyUp(e){e.defaultPrevented||!d||Gn(e)||Yn(a)||" "===e.key&&h.current&&(h.current=!1,o(!n||!l,e.nativeEvent,"click"));}})),[r,a,c,u,d,o,n,l]);return i.useMemo((()=>s?{reference:m}:{}),[s,m])}(F,{event:"mousedown",toggle:!R,ignoreMouse:R}),H=function(e,t){var n;void 0===t&&(t={});const{open:o,floatingId:r}=e,{enabled:a=!0,role:s="dialog"}=t,c=null!=(n=di.get(s))?n:s,l=hn(),u=null!=yn(),d=i.useMemo((()=>"tooltip"===c||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:o?r:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":o?r:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:l},..."menu"===c&&u&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}}),[c,r,u,o,l,s]),f=i.useMemo((()=>{const e={id:r,...c&&{role:c}};return "tooltip"===c||"label"===s?e:{...e,..."menu"===c&&{"aria-labelledby":l}}}),[c,r,l,s]),h=i.useCallback((e=>{let{active:t,selected:n}=e;const i={role:"option",...t&&{id:r+"-option"}};switch(s){case"select":return {...i,"aria-selected":t&&n};case"combobox":return {...i,...t&&{"aria-selected":!0}}}return {}}),[r,s]);return i.useMemo((()=>a?{reference:d,floating:f,item:h}:{}),[a,d,f,h])}(F,{role:"menu"}),$=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:a}=e,{enabled:s=!0,escapeKey:c=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:m,capture:p}=t,g=wn(),v=jt("function"==typeof l?l:()=>!1),b="function"==typeof l?v:l,y=i.useRef(!1),w=i.useRef(!1),{escapeKey:k,outsidePress:S}=Zn(m),{escapeKey:N,outsidePress:C}=Zn(p),x=i.useRef(!1),I=jt((e=>{var t;if(!n||!s||!c||"Escape"!==e.key)return;if(x.current)return;const i=null==(t=a.current.floatingContext)?void 0:t.nodeId,r=g?En(g.nodesRef.current,i):[];if(!k&&(e.stopPropagation(),r.length>0)){let e=!0;if(r.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1);})),!e)return}o(!1,function(e){return "nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key");})),E=jt((e=>{var t;const n=()=>{var t;I(e),null==(t=xe(e))||t.removeEventListener("keydown",n);};null==(t=xe(e))||t.addEventListener("keydown",n);})),A=jt((e=>{var t;const n=y.current;y.current=!1;const i=w.current;if(w.current=!1,"click"===u&&i)return;if(n)return;if("function"==typeof b&&!b(e))return;const s=xe(e),c="["+Nn("inert")+"]",l=Ne(r.floating).querySelectorAll(c);let d=Z(s)?s:null;for(;d&&!se(d);){const e=ue(d);if(se(e)||!Z(e))break;d=e;}if(l.length&&Z(s)&&!s.matches("html,body")&&!pe(s,r.floating)&&Array.from(l).every((e=>!pe(d,e))))return;if(ee(s)&&P){const t=s.clientWidth>0&&s.scrollWidth>s.clientWidth,n=s.clientHeight>0&&s.scrollHeight>s.clientHeight;let i=n&&e.offsetX>s.clientWidth;if(n&&"rtl"===ce(s).direction&&(i=e.offsetX<=s.offsetWidth-s.clientWidth),i||t&&e.offsetY>s.clientHeight)return}const f=null==(t=a.current.floatingContext)?void 0:t.nodeId,h=g&&En(g.nodesRef.current,f).some((t=>{var n;return Ce(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Ce(e,r.floating)||Ce(e,r.domReference)||h)return;const m=g?En(g.nodesRef.current,f):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1);})),!e)return}o(!1,e,"outside-press");})),B=jt((e=>{var t;const n=()=>{var t;A(e),null==(t=xe(e))||t.removeEventListener(u,n);};null==(t=xe(e))||t.addEventListener(u,n);}));i.useEffect((()=>{if(!n||!s)return;a.current.__escapeKeyBubbles=k,a.current.__outsidePressBubbles=S;let e=-1;function t(e){o(!1,e,"ancestor-scroll");}function i(){window.clearTimeout(e),x.current=!0;}function l(){e=window.setTimeout((()=>{x.current=!1;}),ae()?5:0);}const d=Ne(r.floating);c&&(d.addEventListener("keydown",N?E:I,N),d.addEventListener("compositionstart",i),d.addEventListener("compositionend",l)),b&&d.addEventListener(u,C?B:A,C);let f=[];return h&&(Z(r.domReference)&&(f=fe(r.domReference)),Z(r.floating)&&(f=f.concat(fe(r.floating))),!Z(r.reference)&&r.reference&&r.reference.contextElement&&(f=f.concat(fe(r.reference.contextElement)))),f=f.filter((e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)})),f.forEach((e=>{e.addEventListener("scroll",t,{passive:!0});})),()=>{c&&(d.removeEventListener("keydown",N?E:I,N),d.removeEventListener("compositionstart",i),d.removeEventListener("compositionend",l)),b&&d.removeEventListener(u,C?B:A,C),f.forEach((e=>{e.removeEventListener("scroll",t);})),window.clearTimeout(e);}}),[a,r,c,b,u,n,o,h,s,k,S,I,N,E,A,C,B]),i.useEffect((()=>{y.current=!1;}),[b,u]);const T=i.useMemo((()=>({onKeyDown:I,[Qn[f]]:e=>{d&&o(!1,e.nativeEvent,"reference-press");}})),[I,o,d,f]),P=i.useMemo((()=>({onKeyDown:I,onMouseDown(){w.current=!0;},onMouseUp(){w.current=!0;},[Xn[u]]:()=>{y.current=!0;}})),[I,u]);return i.useMemo((()=>s?{reference:T,floating:P}:{}),[s,T,P])}(F,{bubbles:!0}),j=ui(F,{listRef:C,activeIndex:S,nested:R,onNavigate:N}),{getReferenceProps:V,getFloatingProps:U,getItemProps:J}=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),o=e.map((e=>null==e?void 0:e.item)),r=i.useCallback((t=>oi(t,e,"reference")),t),a=i.useCallback((t=>oi(t,e,"floating")),n),s=i.useCallback((t=>oi(t,e,"item")),o);return i.useMemo((()=>({getReferenceProps:r,getFloatingProps:a,getItemProps:s})),[r,a,s])}([z,_,H,$,j]);useEffect((()=>{if(E)return E.events.on("click",e),E.events.on("menuopen",t),()=>{E.events.off("click",e),E.events.off("menuopen",t);};function e(){b(!1);}function t(e){e.nodeId!==B&&e.parentId===T&&b(!1);}}),[E,B,T]),useEffect((()=>{v&&E&&E.events.emit("menuopen",{parentId:T,nodeId:B});}),[E,v,B,T]);const W={activeIndex:S,setActiveIndex:N,getItemProps:J,setHasFocusInside:k,isOpen:v},q=useMemo((()=>W),[S,N,J,k,v]),K=w("io-dropdown-menu-button",R&&"io-dropdown-menu-item",v&&!R&&"active",n),G=_t([O.setReference,P.ref,g]),Y=I.activeIndex===P.index?0:-1;return jsxRuntimeExports.jsxs(kn,{id:B,children:[jsxRuntimeExports.jsx(A,{className:K,ref:G,variant:R?"link":o,tabIndex:R?Y:void 0,role:R?"menuitem":void 0,"data-open":v?"":void 0,"data-nested":R?"":void 0,"data-focus-inside":y?"":void 0,text:f,icon:R?"chevron-right":r,iconSize:"10",iconRight:!!R||a,disabled:h,...V(I.getItemProps({onFocus(e){p.onFocus?.(e),k(!1),I.setHasFocusInside(!0);},...p}))}),jsxRuntimeExports.jsx(mi.Provider,{value:q,children:jsxRuntimeExports.jsx(sn,{elementsRef:C,labelsRef:x,children:v&&jsxRuntimeExports.jsx(Kn,{context:F,modal:!1,initialFocus:R?-1:0,returnFocus:!R,children:jsxRuntimeExports.jsx("div",{ref:O.setFloating,className:"io-dropdown-menu",style:L,...U(),children:m})})})})]})}));function vi({className:t,...n}){const i=w("io-separator",t);return jsxRuntimeExports.jsx("hr",{className:i,...n})}gi.displayName="DropdownMenu";const bi=forwardRef((({...t},n)=>null===yn()?jsxRuntimeExports.jsx(Sn,{children:jsxRuntimeExports.jsx(gi,{ref:n,...t})}):jsxRuntimeExports.jsx(gi,{ref:n,...t})));function wi({className:n,size:i="large",variant:o="default",align:r="up",text:a,...s}){const c=w("io-loader",{[`io-loader-${o}`]:"default"!==o},"normal"===i&&"io-loader-md","small"===i&&"io-loader-sm",r&&[`direction-${r}`],n);return jsxRuntimeExports.jsxs("div",{className:c,...s,children:[jsxRuntimeExports.jsx("div",{className:"io-loader-icon"}),a&&jsxRuntimeExports.jsx("div",{className:"io-loader-text",children:a})]})}function ki({className:t,children:n,...i}){const o=w("io-panel-header",t);return jsxRuntimeExports.jsx(j,{className:o,...i,children:n})}bi.displayName="DropdownMenu",bi.Item=pi,bi.Separator=vi,ki.Title=I,ki.ButtonGroup=$,ki.Button=A,ki.ButtonIcon=S,ki.Dropdown=H;const Si=forwardRef((({className:t,children:n,...i},o)=>{const r=w("io-panel-body",t);return jsxRuntimeExports.jsx("div",{className:r,ref:o,...i,children:n})}));function Ni({className:t,...n}){const i=w("io-panel-footer",t);return jsxRuntimeExports.jsx(J,{className:i,...n})}function Ci({className:t,children:n,...i}){const o=w("io-panel",t);return jsxRuntimeExports.jsx("div",{className:o,...i,children:n})}function Ei({className:t,variant:n="active",value:i=0,...o}){const r=w("io-progress",n,t);return jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsx("div",{className:"io-progress-bar",style:{width:`${i<0?0:i>100?100:i}%`}})})}function Ai({text:t="Label",...n}){return jsxRuntimeExports.jsx("label",{...n,children:t})}Si.displayName="PanelBody",Ni.ButtonGroup=$,Ni.Button=A,Ni.ButtonIcon=S,Ni.Dropdown=H,Ci.Header=ki,Ci.Body=Si,Ci.Footer=Ni;const Bi=forwardRef((({id:n="input",className:i,type:o="text",name:a="input",align:s="up",label:c,iconPrepend:l,iconPrependOnClick:u,iconAppend:d,iconAppendOnClick:f,placeholder:h,disabled:m,readOnly:p,errorMessage:g,...v},b)=>{const y=w("io-control-input",l&&"io-control-leading-icon",d&&"io-control-trailing-icon",m&&"io-control-disabled",p&&"io-control-readonly",g&&"io-control-error",s&&[`direction-${s}`],i),S=useCallback((e=>{m?e.preventDefault():u&&u(e);}),[u,m]),N=useCallback((e=>{m?e.preventDefault():f&&f(e);}),[f,m]);return jsxRuntimeExports.jsxs("div",{className:y,children:[c&&jsxRuntimeExports.jsx(Ai,{htmlFor:n,text:c}),l&&jsxRuntimeExports.jsx(k,{variant:l,onClick:e=>S(e)}),jsxRuntimeExports.jsx("input",{id:n,className:"io-input",ref:b,type:o,name:a,tabIndex:0,placeholder:h??(()=>{switch(o){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..."}})(),disabled:m,readOnly:p,...v}),d&&jsxRuntimeExports.jsx(k,{variant:d,onClick:e=>N(e)}),g&&jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(k,{variant:"close"}),g]})]})}));Bi.displayName="Input";const Ti=forwardRef((({id:n="textarea",className:i,name:o="textarea",align:r="up",label:a,rows:s=4,placeholder:c="Enter text here...",disabled:l,readOnly:u,...d},f)=>{const h=w("io-control-textarea",l&&"io-control-disabled",u&&"io-control-readonly",r&&[`direction-${r}`],i);return jsxRuntimeExports.jsxs("div",{className:h,children:[a&&jsxRuntimeExports.jsx(Ai,{htmlFor:n,text:a}),jsxRuntimeExports.jsx("textarea",{id:n,className:"io-textarea",ref:f,name:o,tabIndex:0,placeholder:c,disabled:l,readOnly:u,rows:s,...d})]})}));Ti.displayName="Textarea";const Pi=forwardRef((({id:n="checkbox",className:i,name:o="checkbox",align:r="left",label:a,checked:s,disabled:c,...l},u)=>{const d=w("io-control-checkbox",s&&"io-control-checked",c&&"io-control-disabled",r&&[`direction-${r}`],i);return jsxRuntimeExports.jsxs("div",{className:d,children:[jsxRuntimeExports.jsx("input",{type:"checkbox",id:n,className:"io-checkbox",ref:u,name:o,tabIndex:0,checked:s,disabled:c,...l}),a&&jsxRuntimeExports.jsx(Ai,{htmlFor:n,text:a})]})}));Pi.displayName="Checkbox";const Ri=forwardRef((({id:n="radio",className:i,name:o="radio",align:r="left",label:a,checked:s,disabled:c,...l},u)=>{const d=w("io-control-radio",s&&"io-control-checked",c&&"io-control-disabled",r&&[`direction-${r}`],i);return jsxRuntimeExports.jsxs("div",{className:d,children:[jsxRuntimeExports.jsx("input",{type:"radio",id:n,className:"io-radio",ref:u,name:o,tabIndex:0,checked:s,disabled:c,...l}),a&&jsxRuntimeExports.jsx(Ai,{htmlFor:n,text:a})]})}));Ri.displayName="Radio";const Li=forwardRef((({id:n="toggle",className:i,name:o="toggle",align:r="left",label:a="Toggle",checked:s,disabled:c,...l},u)=>{const d=w("io-control-toggle",s&&"io-control-checked",c&&"io-control-disabled",r&&[`direction-${r}`],i);return jsxRuntimeExports.jsx("div",{className:d,children:jsxRuntimeExports.jsxs("label",{className:"io-toggle",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",id:n,className:"io-checkbox",ref:u,name:o,checked:s,disabled:c,...l}),jsxRuntimeExports.jsx("span",{className:"slider"}),a]})})}));function Fi(e,t){const n=useCallback((n=>{t.some((e=>n.key===e))&&(n.preventDefault(),e());}),[e,t]);useEffect((()=>(document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n);})),[n]);}Li.displayName="Toggle";const Di=e=>"string"==typeof e?e:e?.message?"string"==typeof e.message?e.message:JSON.stringify(e.message):JSON.stringify(e);function Mi({app:e,prefKey:t,decoder:n}){const i=useContext(IOConnectContext),[o,a]=useState(),[l,f]=useState(!0),[h,m]=useState(),p=useRef(0),v=useCallback((e=>{if(null==e)return;return n.runWithException(e)}),[n]),b=useCallback((async()=>{if(!i)return;const n=await i.prefs.get(e);try{return v(n?.data[t])}catch(e){throw new Error(`The stored value for prefKey "${t}" is of an incorrect shape: ${Di(e)}`)}}),[e,i,t,v]),y=useCallback((async n=>{if(!i)return;const o=++p.current;f(!0),m(void 0);const r=e=>{o===p.current&&(f(!1),e&&(console.error(e),m({message:Di(e)})));};let a,s;if(n instanceof Function)try{a=n(await b());}catch(e){return r(e)}else a=n;try{s=v(a);}catch(e){return r(`The provided value for prefKey "${t}" is of an incorrect shape: ${Di(e)}`)}try{await i.prefs.updateFor(e,{[t]:s});}catch(e){return r(e)}r();}),[e,b,i,t,v]);return useEffect((()=>{if(!i)return;let n=!0;const o=i.prefs.subscribeFor(e,(e=>{try{const n=v(e.data[t]);a(n),m(void 0);}catch(e){const n=`The stored value for prefKey "${t}" is of an incorrect shape: ${Di(e)}`;console.error(n),m({message:n});}n&&(n=!1,f(!1));}));return o}),[e,t,i,v]),{error:h,isLoading:l,value:o,update:y}}function Hi(e,t=500){const[n,i]=useState(e);return useEffect((()=>{const n=setTimeout((()=>{i(e);}),t);return ()=>clearTimeout(n)}),[e,t]),n}createContext({theme:"dark"});function Wi(e,t,n){return Math.min(Math.max(e,n),t)}class qi extends Error{constructor(e){super(`Failed to parse color: "${e}"`);}}var Ki=qi;function Gi(e){if("string"!=typeof e)throw new Ki(e);if("transparent"===e.trim().toLowerCase())return [0,0,0,0];let t=e.trim();t=io.test(e)?function(e){const t=e.toLowerCase().trim(),n=Qi[function(e){let t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return (t>>>0)%2341}(t)];if(!n)throw new Ki(e);return `#${n}`}(e):e;const n=Zi.exec(t);if(n){const e=Array.from(n).slice(1);return [...e.slice(0,3).map((e=>parseInt(Xi(e,2),16))),parseInt(Xi(e[3]||"f",2),16)/255]}const i=eo.exec(t);if(i){const e=Array.from(i).slice(1);return [...e.slice(0,3).map((e=>parseInt(e,16))),parseInt(e[3]||"ff",16)/255]}const o=to.exec(t);if(o){const e=Array.from(o).slice(1);return [...e.slice(0,3).map((e=>parseInt(e,10))),parseFloat(e[3]||"1")]}const r=no.exec(t);if(r){const[t,n,i,o]=Array.from(r).slice(1).map(parseFloat);if(Wi(0,100,n)!==n)throw new Ki(e);if(Wi(0,100,i)!==i)throw new Ki(e);return [...ro(t,n,i),Number.isNaN(o)?1:o]}throw new Ki(e)}const Yi=e=>parseInt(e.replace(/_/g,""),36),Qi="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce(((e,t)=>{const n=Yi(t.substring(0,3)),i=Yi(t.substring(3)).toString(16);let o="";for(let e=0;e<6-i.length;e++)o+="0";return e[n]=`${o}${i}`,e}),{});const Xi=(e,t)=>Array.from(Array(t)).map((()=>e)).join(""),Zi=new RegExp(`^#${Xi("([a-f0-9])",3)}([a-f0-9])?$`,"i"),eo=new RegExp(`^#${Xi("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),to=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${Xi(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),no=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,io=/^[a-z]+$/i,oo=e=>Math.round(255*e),ro=(e,t,n)=>{let i=n/100;if(0===t)return [i,i,i].map(oo);const o=(e%360+360)%360/60,r=(1-Math.abs(2*i-1))*(t/100),a=r*(1-Math.abs(o%2-1));let s=0,c=0,l=0;o>=0&&o<1?(s=r,c=a):o>=1&&o<2?(s=a,c=r):o>=2&&o<3?(c=r,l=a):o>=3&&o<4?(c=a,l=r):o>=4&&o<5?(s=a,l=r):o>=5&&o<6&&(s=r,l=a);const u=i-r/2;return [s+u,c+u,l+u].map(oo)};function ao(e){return function(e){if("transparent"===e)return 0;function t(e){const t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}const[n,i,o]=Gi(e);return .2126*t(n)+.7152*t(i)+.0722*t(o)}(e)>.179}function so({className:t,channel:n,...i}){const o=w("io-channel-badge",t);return jsxRuntimeExports.jsx("div",{className:o,style:{color:(r=n.color,ao(r)?"#000":"#fff"),backgroundColor:n.color},...i,children:jsxRuntimeExports.jsx("span",{className:"io-channel-badge-label",children:n.label})});var r;}function co(){return jsxRuntimeExports.jsx(k,{variant:"check"})}function lo({channel:i,handleChannelRestricted:o,restricted:r}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{children:i.isSelected&&jsxRuntimeExports.jsx("span",{children:"Active"})}),jsxRuntimeExports.jsx("div",{role:"button",onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||e.stopPropagation();},tabIndex:0,children:jsxRuntimeExports.jsx(Li,{label:"Publish",checked:i.write,onChange:()=>{o({...i,write:!i.write});},disabled:r?.write})}),jsxRuntimeExports.jsx("div",{role:"button",onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||e.stopPropagation();},tabIndex:0,children:jsxRuntimeExports.jsx(Li,{label:"Subscribe",checked:i.read,onChange:()=>{o({...i,read:!i.read});},disabled:r?.read})})]})}const uo=createContext({});function fo({channel:t,isSelected:n,onChannelSelect:i,onChannelRestrict:o,...a}){const{variant:c,selectedChannels:l,restrictedChannels:u}=useContext(uo),d=n||t.isSelected||l?.includes(t),f=u?.find((e=>e.name===t.name)),h=useCallback((()=>i?.({...t,isSelected:!d})),[t,i,d]),m=useCallback((e=>{o&&o(e);}),[o]);return jsxRuntimeExports.jsx(R,{prepend:jsxRuntimeExports.jsx(so,{channel:t}),append:"single"===c||"multi"===c?d&&jsxRuntimeExports.jsx(co,{}):jsxRuntimeExports.jsx(lo,{channel:t,handleChannelRestricted:m,restricted:f}),isSelected:d,onClick:h,...a,children:t.name},t.name)}const ho=forwardRef((({className:n,variant:i="single",variantToggle:o=!1,channels:r=[],restrictedChannels:a=[],onVariantChange:s,onChannelSelect:c,onChannelRestrict:u,...d},f)=>{const h=w("io-list-channels","directionalSingle"===i&&"io-bi-direction",n),m=r.filter((e=>e.isSelected)),p=useMemo((()=>({variant:i,selectedChannels:m,restrictedChannels:a,onVariantChange:s,onChannelSelect:c,onChannelRestrict:u})),[i,m,a,s,c,u]);let g="Select Channel";return "multi"===i?g="Select Channels":"directionalSingle"===i&&(g="Select Directional Channel"),jsxRuntimeExports.jsx(uo.Provider,{value:p,children:jsxRuntimeExports.jsx("div",{className:h,ref:f,children:jsxRuntimeExports.jsxs(z,{variant:"single",...d,children:[jsxRuntimeExports.jsx(z.ItemTitle,{append:o&&jsxRuntimeExports.jsx(Li,{label:"Directional",align:"right",onChange:e=>s&&s(e.target.checked),checked:"directionalSingle"===i}),children:g}),r?.map((t=>jsxRuntimeExports.jsx(fo,{channel:t,onChannelSelect:c,onChannelRestrict:u},t.name)))]})})})}));ho.displayName="ChannelSelector";var mo=Object.freeze({__proto__:null,Channel:fo,ChannelBadge:so,ChannelDirectionalAppend:lo,ChannelSelector:ho,ChannelSingleAppend:co,useIOCDChannels:function(e){const t="T42.ChannelSelector.Execute",n=useContext(IOConnectContext),[i,o]=useState(null),[a,l]=useState([]),[h,m]=useState(""),[p,v]=useState(!1),[b,y]=useState(),[w,k]=useState("single"),S=useRef(),N=n?.windows.my(),C=useCallback((async e=>{const t=n.windows.findById(e),i=await(t?.application?.getConfiguration());return t&&i?i.details?.channelSelector?.preventModifyingRestrictionsFor??[]:[]}),[n.windows]),x=useCallback(((e,t,i)=>{if("will-show"===e.command){const t=async()=>{S.current=i,v(!0);const{windowId:t,channels:r,variant:a}=e,s="function"==typeof n.channels.getRestrictions?await n.channels.getRestrictions(t):{channels:[]},c=r.map((e=>{const t=((e,t)=>e.channels.find((e=>e.name===t.name)))(s,e);return t?{...e,read:t.read??!0,write:t.write??!0}:{...e,read:!0,write:!0}}));let u=c.find((e=>e.isSelected))?.name;if(!u){const e=n?.windows.findById(t);u=await(e?.getChannel());}const d=await C(t);l(d),k(a),m(t),o(((e,t)=>{const n=Array.from({length:e.length},((e,t)=>String.fromCharCode(t+65)));return e.map(((e,i)=>{const o=e.meta;return {key:e.name,color:o.color,name:e.name,isSelected:e.isSelected??e.name===t,label:o?.label??n[i],write:e.write,read:e.read}}))})(c,u)),v(!1);};t().catch((e=>{y(e),v(!1);}));}}),[n?.windows,n?.channels,C]),I=useCallback((({name:e,read:t,write:r,isSelected:a})=>{const s=()=>{if("directionalSingle"!==w)return N?.hide()};o((n=>n?n?.map((n=>n.name===e?{...n,isSelected:a,read:t,write:r}:{...n,isSelected:!1})):n));let c=!0;const l=i?.find((e=>e.isSelected))?.name;"single"===w||"directionalSingle"===w?c=l===e:"multi"===w&&(c=i?.find((t=>t.name===e))?.isSelected??!1),c?(n?.channels.leave)(h,e).finally((()=>{s()?.catch(console.error);})):n?.channels.join(e,h).finally((()=>{s()?.catch(console.error);}));}),[n?.channels,i,w,N,h]),E=useCallback((({name:e,read:t,write:i})=>{const o=n?.channels;"directionalSingle"===w&&"function"==typeof o?.restrict&&o?.restrict({name:e,read:t,write:i,windowId:h}).catch(console.error);}),[n?.channels,w,h]),A=useCallback((e=>{o((t=>t?t.map((t=>{const n=((e,t)=>e.channels.find((e=>e.name===t.name)))(e,t);return n?{...t,read:n.read,write:n.write}:t})):t));}),[]);return Fi((()=>{N?.hide().catch(console.error);}),["Escape"]),useEffect((()=>{const e=N?.onClosing((async e=>(e({showDialog:!1}),Promise.resolve())));return e}),[N]),useEffect((()=>{const e=n.windows.findById(h);if(!e)return;if("function"!=typeof e?.onChannelRestrictionsChanged)return;return e.onChannelRestrictionsChanged(A)}),[n.windows,h,A]),useEffect((()=>((async()=>{await(n?.interop.registerAsync(t,x));})(),()=>{n?.interop.unregister(t);})),[n?.interop,x]),useLayoutEffect((()=>{if(e?.current&&i&&i.length>0){const{height:t,width:n,x:i,y:o}=e.current.getBoundingClientRect();S.current&&t>0&&S.current({height:t,width:n,x:i,y:o});}}),[i,e]),{onChannelSelected:I,onChannelRestricted:E,variant:w,isLoading:p,channels:i,restrictedChannels:a,error:b,windowId:h}}});createContext({config:{message:""},theme:"dark",setResult:()=>{}});function Io({title:n="Downloads"}){const{ItemSearch:i,HeaderButtons:o}=Qo();return jsxRuntimeExports.jsxs("div",{className:"io-dm-header",children:[jsxRuntimeExports.jsxs(j,{children:[jsxRuntimeExports.jsx(j.Title,{tag:"h1",text:n,size:"large"}),jsxRuntimeExports.jsx(o,{})]}),jsxRuntimeExports.jsx(i,{})]})}const Ao=createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},isSearchVisible:!1,showSearch:()=>{},hideSearch:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),Bo=()=>useContext(Ao);function To({className:n,icon:i="search",placeholder:o="Search",...r}){const a=w("io-header-search",n),s=useRef(null),{isSearchVisible:c,searchQuery:l,setSearch:f,itemsCount:h}=Bo();return useEffect((()=>{c?s.current?.focus():(s.current?.blur(),f(""));}),[c,f]),c?jsxRuntimeExports.jsxs("div",{className:a,children:[jsxRuntimeExports.jsx(Bi,{ref:s,value:l,iconPrepend:i,placeholder:o,onChange:e=>f(e.target.value),...r}),c&&l.length>0&&jsxRuntimeExports.jsx("p",{className:"io-header-search-count",children:`${h} results`})]}):null}function Po({className:n,...i}){const{SearchButton:o,SettingsButton:r,MoreButton:a}=Qo();return jsxRuntimeExports.jsxs($,{className:n,align:"right",...i,children:[jsxRuntimeExports.jsx(o,{}),jsxRuntimeExports.jsx(r,{}),jsxRuntimeExports.jsx(a,{})]})}function Ro({...t}){const{isSearchVisible:n,showSearch:i,hideSearch:o,items:r}=Bo();return jsxRuntimeExports.jsx(S,{icon:n?"search-filled":"search",variant:"circle",size:"32",onClick:n?o:i,disabled:0===r.length,...t})}function Lo({icon:t="cog",...n}){const{showSettings:i}=Bo();return jsxRuntimeExports.jsx(S,{icon:t,variant:"circle",size:"32",onClick:i,...n})}function Oo({icon:n="ellipsis",...i}){const{items:o,clearItems:r}=Bo(),a=0===o.length;return jsxRuntimeExports.jsxs(H,{variant:"light",...i,children:[jsxRuntimeExports.jsx(H.ButtonIcon,{icon:n,variant:"circle",size:"32"}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{children:jsxRuntimeExports.jsx(H.Item,{disabled:a,onClick:e=>(e=>{a?e.stopPropagation():r();})(e),children:"Clear All"})})})]})}function Fo(e,t=!1,n=!1,i=!1){const o=e.getDate(),r=["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?"Today"===t?n?"Today":`Today at ${s}:${l}`:"Yesterday"===t?n?"Yesterday":`Yesterday at ${s}:${l}`:`${s}:${l}`:i?n?`${r} ${o}`:`${r} ${o} at ${s}:${l}`:n?`${r} ${o}, ${a}`:`${r} ${o}, ${a} at ${s}:${l}`}function Do(e,t={showTime:!0}){const n=new Date(1e3*e),i=new Date,o=Math.round((i-n)/1e3),r=Math.round(o/60),a=i.toDateString()===n.toDateString(),s=new Date(i.setDate(i.getDate()-1)).toDateString()===n.toDateString(),c=i.getFullYear()===n.getFullYear();return t.showTime?o<5?"Just Now":o<60?`${o} seconds ago`:o<90?"about a minute ago":r<60?`${r} minutes ago`:a?Fo(n,"Today",!1,!0):s?Fo(n,"Yesterday",!1,!0):c?Fo(n,!1,!1,!0):Fo(n):a?"Today":s?"Yesterday":c?Fo(n,!1,!0,!0):Fo(n,!1,!0)}function Mo({className:t,...n}){const i=w("io-dm-body",t),{DownloadListEmpty:o,ItemGroup:r,Item:a}=Qo(),{items:s,searchQuery:c,setCount:d,sortItems:f}=Bo(),h=f(s),m=Hi(c),p=useMemo((()=>h.filter((e=>e.displayInfo.filename.toLowerCase().includes(m.toLowerCase())||e.displayInfo.url.toLowerCase().includes(m.toLowerCase())))),[h,m]),g=useMemo((()=>p.map((e=>({...e,displayInfo:{...e.displayInfo,startTime:Do(e.displayInfo.startTime,{showTime:!1})}})))),[p]),v=useMemo((()=>Object.values(g.reduce(((e={},t)=>(e[t.displayInfo.startTime]=e[t.displayInfo.startTime]?.concat([])??[],e[t.displayInfo.startTime].push(t),e)),{}))),[g]);return useEffect((()=>{d(p.length);}),[p,d]),jsxRuntimeExports.jsx("div",{className:i,...n,children:v&&0!==v.length?v.map((t=>jsxRuntimeExports.jsx(r,{title:String(t[0].displayInfo.startTime)??null,children:t.map((t=>jsxRuntimeExports.jsx(a,{item:t},t.id)))},t[0].id??""))):jsxRuntimeExports.jsx(o,{})})}function zo({className:n,icon:i="download",text:o="No downloads to display.",...r}){const a=w("io-dm-no-items",n);return jsxRuntimeExports.jsxs("div",{className:a,...r,children:[jsxRuntimeExports.jsx(k,{variant:i}),jsxRuntimeExports.jsx("p",{children:o})]})}function _o({className:n,title:i,children:o,...r}){const a=w("io-dm-item-group",n);return jsxRuntimeExports.jsxs("div",{className:a,...r,children:[i&&jsxRuntimeExports.jsx("p",{children:i}),o]})}function Ho({className:i,item:o,...r}){const{ItemHeader:a,ItemBody:s,ItemFooter:c}=Qo(),{state:l,url:u,filename:d,receivedBytes:f,totalBytes:h,speed:m,timeRemaining:p}=o.displayInfo;if(!o)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{});const g=w("io-dm-item",o.displayInfo.state&&[l],i);return jsxRuntimeExports.jsxs("div",{className:g,...r,children:[jsxRuntimeExports.jsx(a,{itemID:o.id,filename:d,state:l}),jsxRuntimeExports.jsx(s,{state:l,url:u,bytesReceived:f,bytesTotal:h,speed:m,timeRemaining:p}),jsxRuntimeExports.jsx(c,{itemID:o.id,state:l})]})}function $o({bytesReceived:t=0,bytesTotal:n=0,...i}){const o=useCallback((()=>t&&n?Math.round(t/n*100):0),[t,n]);return jsxRuntimeExports.jsx(Ei,{value:o(),...i})}function jo({className:n,itemID:i,filename:o,state:a,cancel:s,remove:c,...l}){const u=w("io-dm-item-header",n),{cancelItem:d,removeItem:f}=Bo(),h=useCallback((e=>{s?s(e):d(e);}),[s,d]),m=useCallback((e=>{c?c(e):f(e);}),[c,f]);return jsxRuntimeExports.jsxs("div",{className:u,...l,children:[jsxRuntimeExports.jsx(I,{text:o,style:{textDecoration:"interrupted"===a||"cancelled"===a?"line-through":"none"}}),jsxRuntimeExports.jsx(S,{icon:"close",onClick:()=>{"progressing"===a||"paused"===a?h(i):m(i);}})]})}function Vo({className:n,state:i,url:o,bytesReceived:r=0,bytesTotal:a=0,speed:s=0,timeRemaining:c=0,...l}){const u=w("io-dm-item-body",n),d=e=>{const t=["Bytes","KB","MB","GB","TB"];if(0===e)return "0";const n=Math.floor(Math.log(e)/Math.log(1024));return 0===n?`${e}${t[n]}`:`${(e/1024**n).toFixed(1)}${t[n]}`};return jsxRuntimeExports.jsxs("div",{className:u,...l,children:[jsxRuntimeExports.jsx("p",{className:"io-text-small",children:o}),(h=i,"cancelled"===h||"interrupted"===h||"completed"===h?null:jsxRuntimeExports.jsx($o,{variant:"paused"===h?"paused":"active",bytesReceived:r,bytesTotal:a})),jsxRuntimeExports.jsx("p",{className:"io-text-default-lh16",children:"completed"===i?`${d(r??0)} - Done`:"cancelled"===i||"interrupted"===i?`${d(r??0)}/${d(a??0)} - Failed`:`${d(r??0)}/${d(a??0)} (${f=s,(f?`${(f/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60);let i="";return t>0&&(i+=`${t} hour${t>1?"s":""}, `),n>0&&(i+=`${n} min${n>1?"s":""}, `),((e=Math.floor(e%60))>0||""===i)&&(i+=`${e} sec${1!==e?"s":""}`),`${i.trim()} left`})(c)??0}`})]});var f,h;}const Uo={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function Jo({className:n,variant:i,text:o}){const r=w("io-dm-item-status",`io-dm-item-status-${i}`,n);return jsxRuntimeExports.jsxs("div",{className:r,children:[i&&jsxRuntimeExports.jsx(k,{variant:Uo[i],className:"icon-severity"}),o&&jsxRuntimeExports.jsx("p",{className:"io-text-smaller",children:o})]})}function Wo({className:i,itemID:o,state:a,pauseResume:s,showInFolder:c,cancel:l,...u}){const d=w("io-dm-item-footer",i),{pauseResumeItem:f,showItemInFolder:h,cancelItem:m}=Bo(),p=useCallback((e=>{s?s(e):f(e);}),[s,f]),g=useCallback((e=>{c?c(e):h(e);}),[c,h]),v=useCallback((e=>{l?l(e):m(e);}),[l,m]);return jsxRuntimeExports.jsx("div",{className:d,...u,children:(()=>{switch(a){case"progressing":return jsxRuntimeExports.jsxs($,{align:"right",children:[jsxRuntimeExports.jsx($.Button,{variant:"primary",text:"Pause",onClick:()=>p(o)}),jsxRuntimeExports.jsx($.Button,{variant:"link",text:"Cancel",onClick:()=>v(o)})]});case"paused":return jsxRuntimeExports.jsx($,{align:"right",children:jsxRuntimeExports.jsx($.Button,{variant:"primary",text:"Resume",onClick:()=>p(o)})});case"completed":return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Jo,{variant:"success",text:"Complete"}),jsxRuntimeExports.jsx($,{align:"right",children:jsxRuntimeExports.jsx($.Button,{variant:"primary",text:"Show in Folder",onClick:()=>g(o)})})]});case"cancelled":return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Jo,{variant:"warning",text:"Cancelled"})});case"interrupted":return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Jo,{variant:"critical",text:"Failed"}),jsxRuntimeExports.jsx($,{align:"right",children:jsxRuntimeExports.jsx($.Button,{variant:"primary",text:"Retry",onClick:()=>p(o)})})]});default:return null}})()})}function qo({className:n,title:i="Settings",...o}){const r=w("io-settings-panel",n),{configuration:{downloadFolder:a},hideSettings:s,setDownloadLocation:c,setDownloadLocationWithDialog:l,isDownloadLocationDialogVisible:u,downloadLocationList:d}=Bo();return jsxRuntimeExports.jsxs(Ci,{className:r,...o,children:[jsxRuntimeExports.jsxs(Ci.Header,{children:[jsxRuntimeExports.jsx(Ci.Header.Title,{size:"large",text:i,tag:"h1"}),jsxRuntimeExports.jsx(Ci.Header.ButtonGroup,{children:jsxRuntimeExports.jsx(S,{variant:"circle",icon:"close",size:"32",onClick:()=>{s();},disabled:u})})]}),jsxRuntimeExports.jsx(Ci.Body,{children:jsxRuntimeExports.jsxs($,{children:[jsxRuntimeExports.jsxs(H,{variant:"outline",disabled:u,children:[jsxRuntimeExports.jsx(H.Button,{children:jsxRuntimeExports.jsx("span",{className:"io-settings-panel-download-location",children:a??d[0]})}),d.length>1&&jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{children:d.map(((t,n)=>!t||0===n||n>3?null:jsxRuntimeExports.jsx(H.Item,{onClick:()=>{c(t);},children:t},t)))})})]}),jsxRuntimeExports.jsx(A,{className:"io-btn io-settings-panel-download-location-btn",text:"Browse",onClick:()=>{l();},disabled:u})]})})]})}const Ko={Header:Io,ItemSearch:To,HeaderButtons:Po,SearchButton:Ro,SettingsButton:Lo,MoreButton:Oo,Body:Mo,DownloadListEmpty:zo,ItemGroup:_o,Item:Ho,ItemProgress:$o,ItemHeader:jo,ItemBody:Vo,ItemFooter:Wo,Settings:qo},Go=createContext(Ko),Yo=memo((({children:t,components:n})=>{const i=useMemo((()=>({...Ko,...n})),[n]);return jsxRuntimeExports.jsx(Go.Provider,{value:i,children:t})}));Yo.displayName="ComponentsStore";const Qo=()=>useContext(Go);function er(e){if(e&&e.errorHandling&&"function"!=typeof e.errorHandling&&"log"!==e.errorHandling&&"silent"!==e.errorHandling&&"throw"!==e.errorHandling)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&&"function"==typeof e.errorHandling&&e.errorHandling,n={};function i(n,i){var o=n instanceof Error?n:new Error(n);if(t)t(o);else {var r='[ERROR] callback-registry: User callback for key "'+i+'" failed: '+o.stack;if(e)switch(e.errorHandling){case"log":return console.error(r);case"silent":return;case"throw":throw new Error(r)}console.error(r);}}return {add:function(e,t,o){var r=n[e];return r||(r=[],n[e]=r),r.push(t),o&&setTimeout((function(){o.forEach((function(o){var r;if(null===(r=n[e])||void 0===r?void 0:r.includes(t))try{Array.isArray(o)?t.apply(void 0,o):t.apply(void 0,[o]);}catch(t){i(t,e);}}));}),0),function(){var i=n[e];i&&(i=i.reduce((function(e,n,i){return n===t&&e.length===i||e.push(n),e}),[]),0===i.length?delete n[e]:n[e]=i);}},execute:function(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];var r=n[e];if(!r||0===r.length)return [];var a=[];return r.forEach((function(n){try{var o=n.apply(void 0,t);a.push(o);}catch(t){a.push(void 0),i(t,e);}})),a},clear:function(){n={};},clearKey:function(e){n[e]&&delete n[e];}}}er.default=er;v(er);const ir=createContext({config:{env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"},onThemeChanged:e=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:e=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),or=()=>useContext(ir);function rr({...n}){const{config:i,close:o}=or(),{applicationTitle:r}=i;return jsxRuntimeExports.jsxs(j,{draggable:!0,...n,children:[jsxRuntimeExports.jsx(j.Title,{tag:"h1",text:r?`Feedback Form - ${r}`:"Feedback Form",size:"large"}),jsxRuntimeExports.jsx(j.ButtonGroup,{className:"non-draggable",children:jsxRuntimeExports.jsx(j.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>o()})})]})}function ar({className:n,handleSubmit:i,...o}){const r=w("io-panel-body",n),{config:a,submitFeedback:s}=or(),{IntroField:c,DescriptionField:l,TechInfoField:u,EnvInfoField:d,FileAttachmentsField:f,CategoryAttachmentsField:h,SettingsField:m,MailListField:p}=Cr(),g=i??s,v=`Your feedback will be submitted to the ${a.buildVersion} team and some additional information will be automatically included to help us examine your issue.`;return jsxRuntimeExports.jsxs("form",{className:r,id:"feedback",onSubmit:e=>g(e),...o,children:[jsxRuntimeExports.jsx(c,{children:jsxRuntimeExports.jsx("p",{children:v})}),jsxRuntimeExports.jsx(m,{}),jsxRuntimeExports.jsx(p,{}),jsxRuntimeExports.jsx(l,{}),jsxRuntimeExports.jsx(u,{readOnly:!0}),jsxRuntimeExports.jsx(d,{readOnly:!0}),"file"===a.attachmentsViewMode?jsxRuntimeExports.jsx(f,{}):jsxRuntimeExports.jsx(h,{})]})}function sr({...n}){const{FooterButtons:i}=Cr(),{openUrl:o,submitInProgress:r,submitStatus:a,jiraTicketURL:s}=or();return jsxRuntimeExports.jsx(J,{...n,children:jsxRuntimeExports.jsxs("div",r?{className:"flex ai-center jc-between",children:[jsxRuntimeExports.jsx(E,{children:jsxRuntimeExports.jsx("p",{children:a.title})}),jsxRuntimeExports.jsx(wi,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[jsxRuntimeExports.jsxs(E,{children:[jsxRuntimeExports.jsx("p",{className:"error"===a.type?"io-text-error":"",children:a.title}),s&&jsxRuntimeExports.jsx("a",{href:s,onClick:e=>{e.preventDefault(),o(s);},children:s})]}),jsxRuntimeExports.jsx(i,{})]})})}function cr({className:t,...n}){const{CloseButton:i}=Cr(),{close:o}=or();return jsxRuntimeExports.jsx($,{className:t,...n,children:jsxRuntimeExports.jsx(i,{onClick:()=>o()})})}function lr({className:n,...i}){const{SubmitButton:o,CancelButton:r,CloseButton:a}=Cr(),{close:s,submitCompleted:c}=or();return c?jsxRuntimeExports.jsx($,{className:n,...i,children:jsxRuntimeExports.jsx(a,{text:"Close",onClick:()=>s()})}):jsxRuntimeExports.jsxs($,{className:n,...i,children:[jsxRuntimeExports.jsx(o,{}),jsxRuntimeExports.jsx(r,{onClick:()=>s()})]})}function ur({text:t="Submit",...n}){return jsxRuntimeExports.jsx(A,{form:"feedback",type:"submit",variant:"primary",text:t,...n})}function dr({text:t="Cancel",...n}){return jsxRuntimeExports.jsx(A,{variant:"link",text:t,...n})}function fr({...t}){return jsxRuntimeExports.jsx(A,{variant:"primary",...t})}function hr({showField:t=!0,className:n,title:i,hint:o,children:r,...a}){return t?jsxRuntimeExports.jsx(E,{className:n,title:i,hint:o,...a,children:r}):null}function mr({showField:t=!0,className:n,title:i="Description",hint:o,readOnly:r=!1,disabled:a,...s}){return t?jsxRuntimeExports.jsx(E,{className:n,hint:o,title:"",...s,children:jsxRuntimeExports.jsx(Ti,{id:"description",name:"description",label:i,readOnly:r,disabled:a})}):null}function pr({showField:t,className:n,title:i="Technical Information",hint:o,fieldValue:r,readOnly:a=!1,disabled:s,...c}){const{config:l}=or(),u=t??l.errorMessage,d=r??l.errorMessage;return u&&d?jsxRuntimeExports.jsx(E,{className:n,hint:o,...c,children:jsxRuntimeExports.jsx(Ti,{id:"errorMessage",name:"errorMessage",label:i,value:d,readOnly:a,disabled:s})}):null}function gr({showField:t,className:n,title:i="Environment Information",hint:o,fieldValue:r,readOnly:a=!1,disabled:s,...c}){const{config:l}=or(),u=t??l.showEnvironmentInfo,d=r??l.environmentInfo;return u&&d?jsxRuntimeExports.jsx(E,{className:n,hint:o,...c,children:jsxRuntimeExports.jsx(Ti,{id:"environmentInfo",name:"environmentInfo",label:i,value:d,readOnly:a,disabled:s})}):null}function vr({showField:t=!0,className:n,title:i="Attachments",hint:o,readOnly:a=!1,disabled:s,attachments:c,selectedCategories:l,...u}){const d=w("io-block-list-gap",n),{config:f}=or(),h=c??f.attachments,m=l??f.selectedCategories,p=useCallback((e=>!!m&&-1!==m.indexOf(e)),[m]);return t?!h||h.length<=0?jsxRuntimeExports.jsx(E,{title:"Attachments",children:jsxRuntimeExports.jsx("p",{children:"No Attachments"})}):jsxRuntimeExports.jsx(E,{className:d,title:i,hint:o,...u,children:jsxRuntimeExports.jsx("div",{className:"file-attachments",children:h.map((t=>jsxRuntimeExports.jsx(Pi,{id:t.id,name:t.id,label:t.name,readOnly:a,disabled:s,defaultChecked:p(t.category)},t.id)))})}):null}function br({showField:t=!0,className:n,title:i="Attachments",hint:o,readOnly:a=!1,disabled:s,categories:c,selectedCategories:l,...u}){const{config:d,attachmentCategories:f}=or(),h=c??f,m=l??d.selectedCategories,p=useCallback((e=>!!m&&-1!==m.indexOf(e)),[m]);return t?!h||h.length<=0?jsxRuntimeExports.jsx("p",{children:"No Attachments"}):jsxRuntimeExports.jsx(E,{className:n,title:i,hint:o,...u,children:jsxRuntimeExports.jsx("div",{className:"category-attachments",children:h.map((t=>jsxRuntimeExports.jsx(Li,{id:t,name:t,align:"right",label:t,readOnly:a,disabled:s,defaultChecked:p(t)},t)))})}):null}function yr({className:n,title:i,hint:o,showField:r=!0,showJiraTicketField:a,jiraTicketLabel:s="Create Jira Ticket",showSendEmailField:c,sendEmailLabel:l="Send Email",readOnly:u=!1,disabled:d,...f}){const h=w("io-block-list-gap",n),{config:m,showMailingList:p,setShowMailingList:g}=or();if(!r)return null;const v=a??m.createJiraTicket,b=c??m.sendEmail;return jsxRuntimeExports.jsxs(E,{className:h,hint:o,title:i,...f,children:[v&&jsxRuntimeExports.jsx(Li,{id:"createJiraTicket",name:"createJiraTicket",label:s,align:"right",readOnly:u,disabled:d,defaultChecked:v}),b&&jsxRuntimeExports.jsx(Li,{onChange:()=>{g(!p);},id:"sendEmail",name:"sendEmail",label:l,align:"right",readOnly:u,disabled:d,defaultChecked:b})]})}function wr({showField:t=!0,className:n,title:i="Email List",hint:o="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:a,disabled:s,...c}){const{config:l,showMailingList:u}=or(),d=t??l.sendEmail,f=a??!1===l.allowEditRecipients;return d&&u?jsxRuntimeExports.jsx(E,{className:n,hint:o,...c,children:jsxRuntimeExports.jsx(Bi,{id:"mailingList",name:"mailingList",label:i,placeholder:r,readOnly:f,disabled:s,defaultValue:l.mailingList??""})}):null}const kr={Header:rr,Body:ar,Footer:sr,HeaderButtons:cr,FooterButtons:lr,SubmitButton:ur,CancelButton:dr,CloseButton:fr,IntroField:hr,DescriptionField:mr,TechInfoField:pr,EnvInfoField:gr,FileAttachmentsField:vr,CategoryAttachmentsField:br,SettingsField:yr,MailListField:wr},Sr=createContext(kr),Nr=memo((({children:t,components:n})=>{const i=useMemo((()=>({...kr,...n})),[n]);return jsxRuntimeExports.jsx(Sr.Provider,{value:i,children:t})}));function Cr(e){return {...useContext(Sr),...e}}Nr.displayName="ComponentsStore";function Ar(e){const t=useContext(IOConnectContext),n=t?.appManager,[i,o]=useState([]),[a,l]=useState(0),d="*",f=useCallback((e=>[...e].sort(((e,t)=>{const n=(e.title??e.name).toLowerCase(),i=(t.title??t.name).toLowerCase();return n<i?-1:n>i?1:0}))),[]);return useEffect((()=>{if(!n)return;const e=n.onAppAdded((e=>{o((t=>[...t,{title:e.title,name:e.name,hidden:e.hidden}]));}));return ()=>{e();}}),[n]),useEffect((()=>{if(!n)return;const e=n.onAppRemoved((e=>{o((t=>t.filter((t=>t.name!==e.name))));}));return ()=>{e();}}),[n,i]),useEffect((()=>{if(!n)return;const e=n.onAppChanged((e=>{o((t=>{const n=t.find((t=>t.name===e.name));return [...t.filter((t=>t.name!==e.name)),{title:e.title,name:n?.name,hidden:n?.hidden,allowed:n?.allowed}]}));}));return ()=>{e();}}),[n]),useEffect((()=>{const n=e?.allApplications??t.appManager.applications().length;let r=0;const a=[...i],s=e?.sourceFilter;if(void 0===s||!Array.isArray(s.allowed)||!Array.isArray(s.blocked))return;const c=s.allowed,u=s.blocked;0===c.length||-1!==u.indexOf(d)||0===c.length&&0===u.length||-1!==c.indexOf(d)&&-1!==u.indexOf(d)?(r=n,a.forEach((e=>{e.allowed=!1;}))):-1!==c.indexOf(d)&&a.forEach((e=>{e.allowed=!0;})),-1===u.indexOf(d)&&u.length>0&&(r=s.blocked.length),c.forEach((e=>{const t=a.find((t=>t.name===e));t&&(t.allowed=!0);})),u.forEach((e=>{const t=a.find((t=>t.name===e));t&&(t.allowed=!1);})),l(n-r),o(a);}),[e]),{apps:i,allowedApps:a,sortAppsAlphabetically:f}}const Rr=createContext({allApps:[],settings:{},configuration:{},notifications:[],onClose:()=>{},allApplications:0,clearAll:()=>{},showPanel:()=>{},hidePanel:()=>{},saveFilter:()=>{},clearAllOld:()=>{},notificationStacks:[],isPanelVisible:!1,saveSetting:()=>{},allowedApplications:0,saveAllFilter:()=>{},isBulkActionsSupported:!1,selectedNotifications:[],selectNotification:()=>{},selectAllNotifications:()=>{},clearMany:()=>{},snooze:()=>{},snoozeMany:()=>{},setState:()=>{},setStates:()=>{}}),Lr=()=>useContext(Rr);const Or=createContext({isSearchVisible:!1,showSearch:()=>{},hideSearch:()=>{},searchQuery:"",setSearch:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},notificationsCount:0,setCount:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),Fr=()=>useContext(Or);function Dr({...n}){const{HeaderCaption:i,HeaderActions:o,HeaderBulkActions:r,HeaderSearch:a}=Ya(),{isBulkActionsSupported:s}=Lr(),{isBulkActionsVisible:c,notificationsCount:l}=Fr();return jsxRuntimeExports.jsxs(ki,{...n,children:[jsxRuntimeExports.jsx(i,{}),s?jsxRuntimeExports.jsxs("div",{className:`io-panel-header-actions-wrapper ${c&&l>0?"io-panel-header-bulk-actions-opened":""} `,children:[jsxRuntimeExports.jsx(o,{}),jsxRuntimeExports.jsx(r,{})]}):jsxRuntimeExports.jsx(o,{}),jsxRuntimeExports.jsx(a,{})]})}function Mr({className:n,...i}){const o=w("io-panel-header-caption",n),{HeaderCaptionTitle:r,HeaderCaptionCount:a,HeaderCaptionButtons:s}=Ya();return jsxRuntimeExports.jsxs("div",{className:o,...i,children:[jsxRuntimeExports.jsx(r,{}),jsxRuntimeExports.jsx(a,{}),jsxRuntimeExports.jsx(s,{})]})}function zr({className:n,...i}){const o=w("io-panel-header-caption-filter",n),{allApplications:r,allowedApplications:a}=Lr();return jsxRuntimeExports.jsxs("div",{className:o,...i,children:[jsxRuntimeExports.jsx(k,{variant:"filter"}),jsxRuntimeExports.jsx("span",{className:"io-panel-header-caption-filter-allowed",children:a}),"of"," ",jsxRuntimeExports.jsx("span",{className:"io-panel-header-caption-filter-all",children:r}),"apps"]})}function _r({text:n="Notifications",counter:i,...o}){const{notificationsCount:r}=Fr();return jsxRuntimeExports.jsx(I,{text:n,size:"large",...o,children:(i??!0)&&jsxRuntimeExports.jsxs("span",{children:["(",r,")"]})})}function Hr({...n}){const{HeaderCaptionButtonSearch:i,HeaderCaptionButtonSettings:o,HeaderCaptionButtonClose:r}=Ya();return jsxRuntimeExports.jsxs($,{...n,children:[jsxRuntimeExports.jsx(i,{}),jsxRuntimeExports.jsx(o,{}),jsxRuntimeExports.jsx(r,{})]})}const $r="newest",jr="oldest",Vr="severity",Ur=["None","Low","Medium","High","Critical"],Jr={key:$r,descending:!0},Wr=e=>[...e].sort(((e,t)=>(t.timestamp||0)-(e.timestamp||0))),qr=e=>[...e].sort(((e,t)=>(e.timestamp||0)-(t.timestamp||0))),Kr=(e,t)=>{const n=Ur[0];return [...e].sort(((e,i)=>{const o=Ur.indexOf(e.severity||n),r=Ur.indexOf(i.severity||n);return (t?-1:1)*(o-r)}))},Gr={[$r]:Wr,[jr]:qr,[Vr]:Kr};function Yr({...t}){const[n,i]=useState([]),{NotificationsList:o,Notification:r}=Ya(),{sortNotificationsBy:a,viewNotificationsBy:s,setCount:f,searchQuery:h,notificationsCount:m}=Fr(),{notifications:p}=Lr(),g=useRef(null),v=Hi(h),b=useMemo((()=>((e,t)=>{if(!e)return [];switch(t){case"all":default:return e;case"unread":return e.filter((e=>"Active"===e.state||"Stale"===e.state));case"read":return e.filter((e=>"Acknowledged"===e.state||"Seen"===e.state));case"snoozed":return e.filter((e=>"Snoozed"===e.state))}})(p,s)),[p,s]),y=useMemo((()=>b.filter((e=>e.title.toLowerCase().includes(v.toLowerCase())||e.source?.toLowerCase().includes(v.toLowerCase())||e.body?.toLowerCase().includes(v.toLowerCase())))),[b,v]);return useEffect((()=>{switch(a){case"newest":i(Wr(y));break;case"oldest":i(qr(y));break;case"severity":i(Kr(y,!0));break;default:i(y);}f(y.length);}),[y,a,f]),useEffect((()=>{g.current&&g.current?.scrollTo({top:0,behavior:"smooth"});}),[v,m,a,s]),jsxRuntimeExports.jsx(Si,{ref:g,...t,children:jsxRuntimeExports.jsx(o,{notifications:n,Notification:r})})}function Qr({...t}){const{FooterButtons:n}=Ya();return jsxRuntimeExports.jsx(Ni,{...t,children:jsxRuntimeExports.jsx(n,{})})}function Xr({className:n,...i}){const{FooterButtonClearAll:o,FooterButtonClearAllOld:r}=Ya(),{notifications:a}=Lr(),[s,l]=useState(!1);return useEffect((()=>{a.filter((e=>"Stale"===e.state||"Acknowledged"===e.state)).length>0?l(!0):l(!1);}),[a]),jsxRuntimeExports.jsxs($,{className:n,align:"right",...i,children:[jsxRuntimeExports.jsx(r,{disabled:!s}),jsxRuntimeExports.jsx(o,{disabled:a.length<=0})]})}function Zr({text:t="Clear All",...n}){const{clearAll:i}=Lr();return jsxRuntimeExports.jsx(A,{text:t,onClick:()=>{i();},...n})}function ea({text:t="Clear Old",...n}){const{clearAllOld:i}=Lr();return jsxRuntimeExports.jsx(A,{text:t,onClick:()=>{i();},...n})}function ta({className:n,title:i="Settings",...o}){const r=w("io-settings-panel",n),{SettingsGeneral:a,SettingsPlacement:s,SettingsStacking:c,SettingsSnooze:l,SettingsSubscriptions:u}=Ya(),{hideSettings:d}=Fr();return jsxRuntimeExports.jsxs(Ci,{className:r,...o,children:[jsxRuntimeExports.jsxs(Ci.Header,{children:[jsxRuntimeExports.jsx(Ci.Header.Title,{size:"large",text:i,tag:"h1"}),jsxRuntimeExports.jsx(Ci.Header.ButtonGroup,{children:jsxRuntimeExports.jsx(Ci.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:d})})]}),jsxRuntimeExports.jsxs(Ci.Body,{children:[jsxRuntimeExports.jsx(a,{}),jsxRuntimeExports.jsx(c,{}),jsxRuntimeExports.jsx(s,{}),jsxRuntimeExports.jsx(l,{}),jsxRuntimeExports.jsx(u,{})]})]})}function na({className:n,title:i="General",...o}){const r=w("io-panel-settings-general",n),{SettingsAllowNotifications:a,SettingsShowNotificationBadge:s,SettingsCloseNotificationOnClick:c,SettingsPanelAutoHide:l,SettingsHideToastsAfter:u}=Ya();return jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsxs(E,{title:i,children:[jsxRuntimeExports.jsx(a,{}),jsxRuntimeExports.jsx(s,{}),jsxRuntimeExports.jsx(c,{}),jsxRuntimeExports.jsx(l,{}),jsxRuntimeExports.jsx(u,{})]})})}function ia({label:t="Allow notifications",align:n="right",...i}){const{settings:o,saveSetting:a}=Lr(),s=useCallback((e=>{a({enabledNotifications:e.target.checked});}),[a]);return jsxRuntimeExports.jsx(Li,{label:t,align:n,onChange:s,checked:o.enabledNotifications,...i})}function oa({label:t="Show notification badge",align:n="right",...i}){const{settings:o,saveSetting:a}=Lr(),s=useCallback((e=>{a({showNotificationBadge:e.target.checked});}),[a]);return jsxRuntimeExports.jsx(Li,{label:t,align:n,onChange:s,checked:o.showNotificationBadge,disabled:!o.enabledNotifications,...i})}function ra({label:t="Close notification on click",align:n="right",...i}){const{settings:o,saveSetting:a}=Lr(),s=useCallback((e=>{a({closeNotificationOnClick:e.target.checked});}),[a]);return jsxRuntimeExports.jsx(Li,{label:t,align:n,onChange:s,checked:o.closeNotificationOnClick,disabled:!o.enabledNotifications,...i})}function aa({label:t="Auto hide panel",align:n="right",...i}){const{settings:o,saveSetting:a}=Lr(),s=useCallback((e=>{a({autoHidePanel:e.target.checked});}),[a]);return jsxRuntimeExports.jsx(Li,{label:t,align:n,onChange:s,checked:o.autoHidePanel,...i})}function sa({label:t="Panel always on top",align:n="right",...i}){const{settings:o,saveSetting:a}=Lr(),s=useCallback((e=>{a({alwaysOnTop:e.target.checked});}),[a]);return jsxRuntimeExports.jsx(Li,{label:t,align:n,onChange:s,checked:o.alwaysOnTop,...i})}function ca({className:n,title:i="Hide toasts after",items:o=[15,30,45,60],...a}){const s=w("flex","jc-between","ai-center",n),{settings:c,saveSetting:l}=Lr(),u=useCallback((e=>{e||(e=15e3),c.toastExpiry!==e&&l({toastExpiry:1e3*e});}),[c.toastExpiry,l]),d=e=>e<60?`${e} seconds`:60===e?"1 minute":e/60+" minutes";return jsxRuntimeExports.jsxs("div",{className:s,...a,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper "+(c.enabledNotifications?"":"io-text-disabled"),children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"light",disabled:!c.enabledNotifications,children:[jsxRuntimeExports.jsx(H.Button,{text:d(c.toastExpiry/1e3)}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:o.map((t=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>{u(t);},children:d(t)},t)))})})]})]})}function la({className:n,title:i="Highlight new for",...o}){const r=w("flex","jc-between","ai-center",n),{settings:a}=Lr(),s=["30 seconds","1 minute","5 minutes","Never"];return jsxRuntimeExports.jsxs("div",{className:r,...o,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper "+(a.enabledNotifications?"":"io-text-disabled"),children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"outline",disabled:!a.enabledNotifications,children:[jsxRuntimeExports.jsx(H.Button,{text:s[0]}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:s.map((t=>jsxRuntimeExports.jsx(H.Item,{children:t},t)))})})]})]})}function ua({className:n,title:i="Mark as read after",...o}){const r=w("flex","jc-between","ai-center",n),{settings:a}=Lr(),s=["1 minute","5 minutes","Never"];return jsxRuntimeExports.jsxs("div",{className:r,...o,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper "+(a.enabledNotifications?"":"io-text-disabled"),children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"outline",disabled:!a.enabledNotifications,children:[jsxRuntimeExports.jsx(H.Button,{text:s[0]}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:s.map((t=>jsxRuntimeExports.jsx(H.Item,{children:t},t)))})})]})]})}function da({className:n,title:i="Stacking",...o}){const r=w("io-panel-settings-stacking",n),{SettingsToastStacking:a,SettingsToastStackBy:s}=Ya();return jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsxs(E,{title:i,children:[jsxRuntimeExports.jsx(a,{}),jsxRuntimeExports.jsx(s,{})]})})}function fa({label:t="Allow toast stacking",align:n="right",...i}){const{settings:o,saveSetting:a}=Lr(),s=useCallback((e=>{a({toastStacking:e.target.checked});}),[a]);return jsxRuntimeExports.jsx(Li,{label:t,align:n,onChange:s,checked:o.toastStacking,disabled:!o.enabledNotifications,...i})}const ha=e=>e.replace(/(^|-)\w/g,(e=>e.toUpperCase().replace("-"," ")));function ma({className:n,title:i="Group by",...o}){const a=w("flex","jc-between","ai-center",n),{settings:s,saveSetting:c}=Lr(),l=useCallback((e=>{e||(e="severity"),s.stackBy!==e&&c({stackBy:e.toLowerCase()});}),[s.stackBy,c]);return jsxRuntimeExports.jsxs("div",{className:a,...o,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper "+(s.enabledNotifications?"":"io-text-disabled"),children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"light",disabled:!s.enabledNotifications,children:[jsxRuntimeExports.jsx(H.Button,{text:s.stackBy?ha(s.stackBy):"Severity"}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:["Severity","Application"].map((t=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>{l(t);},children:t},t)))})})]})]})}function pa({className:n,title:i="Placement",...o}){const r=w("io-panel-settings-placement",n),{SettingsPlacementPanel:a,SettingsPlacementToasts:s}=Ya();return jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsxs(E,{title:i,children:[jsxRuntimeExports.jsx(a,{}),jsxRuntimeExports.jsx(s,{})]})})}function ga({className:n,title:i="Panel position",...o}){const a=w("flex","jc-between","ai-center",n),{settings:s,saveSetting:c}=Lr(),l=useCallback((e=>{e||(e="right"),s.placement?.panel!==e&&c({placement:{...s.placement,panel:e.toLowerCase()}});}),[s.placement,c]);return jsxRuntimeExports.jsxs("div",{className:a,...o,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper",children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"light",children:[jsxRuntimeExports.jsx(H.Button,{text:s.placement?.panel?ha(s.placement?.panel):"Right"}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:["Right","Left"].map((t=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>{l(t);},children:t},t)))})})]})]})}function va({className:n,title:i="Toasts position",...o}){const a=w("flex","jc-between","ai-center",n),{settings:s,saveSetting:c}=Lr(),l=useCallback((e=>{if(e||(e="bottom-right"),s.placement?.toasts===e)return;const t=e.replace(/\s+/g,"-").toLowerCase();c({placement:{...s.placement,toasts:t}});}),[s.placement,c]);return jsxRuntimeExports.jsxs("div",{className:a,...o,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper",children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"light",children:[jsxRuntimeExports.jsx(H.Button,{text:s.placement?.toasts?ha(s.placement?.toasts):"Bottom Right"}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map((t=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>{l(t);},children:t},t)))})})]})]})}function ba({className:t,title:n="Snooze",...i}){const o=w("io-panel-settings-snooze",t),{SettingsSnoozeDuration:r}=Ya(),{settings:a}=Lr();return a.snooze?.enabled?jsxRuntimeExports.jsx("div",{className:o,...i,children:jsxRuntimeExports.jsx(E,{title:n,children:jsxRuntimeExports.jsx(r,{})})}):null}function ya({className:n,title:i="Default duration",items:o=[60,120,180,300],...a}){const s=w("flex","jc-between","ai-center",n),{settings:c,saveSetting:l}=Lr(),u=useCallback((e=>{e||(e=6e4),c.snooze&&c.snooze?.duration!==e&&l({snooze:{...c.snooze,duration:1e3*e}});}),[c.snooze,l]),d=e=>e<60?`${e} seconds`:60===e?"1 minute":e/60+" minutes";return c.snooze?.enabled?jsxRuntimeExports.jsxs("div",{className:s,...a,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper "+(c.enabledNotifications?"":"io-text-disabled"),children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"outline",disabled:!c.enabledNotifications,children:[jsxRuntimeExports.jsx(H.Button,{text:d(c.snooze?.duration/1e3)}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:o.map((t=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>{u(t);},children:d(t)},t)))})})]})]}):null}function wa({className:n,title:i="Subscribe and Mute",...o}){const r=w("io-panel-settings-subscriptions",n),{SettingsSubscribeAll:a,SettingsSubscribeApp:s,SettingsSubscribeMuteAll:c,SettingsSubscribeMuteApp:l}=Ya(),{allApps:u}=Lr(),{sortAppsAlphabetically:d}=Ar(),f=d(u);return jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsxs(E,{title:i,children:[jsxRuntimeExports.jsxs("div",{className:"io-panel-settings-subscriptions-grid",children:[jsxRuntimeExports.jsx("p",{className:"io-text-section",children:"Sources"}),jsxRuntimeExports.jsx("p",{className:"io-text-section",children:"Subscribe"}),jsxRuntimeExports.jsx("p",{className:"io-text-section",children:"Mute"})]}),jsxRuntimeExports.jsxs("div",{className:"io-panel-settings-subscriptions-grid",children:[jsxRuntimeExports.jsx("p",{children:"All Sources"}),jsxRuntimeExports.jsx(a,{label:""}),jsxRuntimeExports.jsx(c,{label:""})]}),f.map((n=>!n||n.hidden?null:jsxRuntimeExports.jsxs("div",{className:"io-panel-settings-subscriptions-grid",children:[jsxRuntimeExports.jsx("p",{children:n.title??n.name}),jsxRuntimeExports.jsx(s,{app:n,label:""}),jsxRuntimeExports.jsx(l,{app:n,label:""})]},n.name)))]})})}function ka({label:t="All apps",align:n="right",...i}){const{settings:o,configuration:a,saveAllFilter:s}=Lr(),c=useCallback((e=>{s({subscribe:e.target.checked});}),[s]);return jsxRuntimeExports.jsx(Li,{align:n,label:t,onChange:c,checked:a.sourceFilter?.allowed?.includes("*"),disabled:!o.enabledNotifications,...i})}function Sa({label:t="App",align:n="right",app:i,...o}){const{allApps:a,settings:s,configuration:c,saveFilter:l}=Lr(),u=useCallback(((e,t)=>{const n={...c.sourceFilter},i=n.allowed?.indexOf("*");"number"==typeof i&&i>-1&&(n.allowed?.splice(i,1),a.forEach((e=>{e.name!==t.name&&n.allowed?.push(e.name);}))),e?(n.allowed?.push(t.name),n.blocked=n.blocked?.filter((e=>e!==t.name))):(n.allowed=n.allowed?.filter((e=>e!==t.name)),n.blocked?.push(t.name)),n.allowed?.length&&n.allowed?.length>0&&n.blocked?.includes("*")&&n.blocked.splice(n.blocked.indexOf("*"),1),l(n);}),[a,c.sourceFilter,l]);return jsxRuntimeExports.jsx(Li,{id:i.name,label:t,align:n,onChange:e=>u(e.target.checked,i),checked:c.sourceFilter?.allowed?.includes("*")||c.sourceFilter?.allowed?.includes(i.name),disabled:!s.enabledNotifications,...o})}function Na({label:t="Mute all",align:n="right",...i}){const{settings:o,configuration:a,saveAllFilter:s}=Lr(),c=useCallback((e=>{s({mute:e.target.checked});}),[s]);return jsxRuntimeExports.jsx(Li,{align:n,label:t,onChange:c,checked:a.sourceFilter?.muted?.includes("*"),disabled:!o.enabledNotifications||-1===a.sourceFilter?.allowed?.indexOf("*"),...i})}function Ca({label:t="App",align:n="right",app:i,...o}){const{allApps:a,settings:s,configuration:c,saveFilter:l}=Lr(),u=useCallback(((e,t)=>{const n={...c.sourceFilter},i=n?.muted?.indexOf("*");"number"==typeof i&&i>-1&&(n.muted?.splice(i,1),a.forEach((e=>{e.name===t.name||e.hidden||n.muted?.push(e.name);}))),e?n.muted?.push(t.name):n.muted=n.muted?.filter((e=>e!==t.name)),l(n);}),[a,c.sourceFilter,l]);return jsxRuntimeExports.jsx(Li,{id:i.name,label:t,align:n,onChange:e=>u(e.target.checked,i),checked:c.sourceFilter?.muted?.includes("*")||c.sourceFilter?.muted?.includes(i.name),disabled:!s.enabledNotifications||c.sourceFilter?.blocked?.includes("*")||c.sourceFilter?.blocked?.includes(i.name)||0===c.sourceFilter?.allowed?.length||-1===c.sourceFilter?.allowed?.indexOf(i.name)&&-1===c.sourceFilter?.allowed?.indexOf("*")&&0===c.sourceFilter?.blocked?.length,...o})}function xa({className:n,notification:i,...o}){const r=w("io-notification-header",n),{HeaderCount:a,HeaderBadge:s,HeaderTitle:c,HeaderTimestamp:l,HeaderButtonSnooze:u,HeaderButtonClose:d}=ja();return jsxRuntimeExports.jsxs("div",{className:r,...o,children:[jsxRuntimeExports.jsx(s,{notification:i}),jsxRuntimeExports.jsx(a,{notification:i}),jsxRuntimeExports.jsx(c,{notification:i}),jsxRuntimeExports.jsx(l,{notification:i}),jsxRuntimeExports.jsxs($,{children:[jsxRuntimeExports.jsx(u,{notification:i}),jsxRuntimeExports.jsx(d,{notification:i})]})]})}function Ia({notification:t,...n}){const{settings:i,isPanelVisible:o,notificationStacks:r}=Lr(),{toastStacking:a,stackBy:s}=i,c="application"===s?"source":s??"source";let l;if(a){const e=r.find((e=>e.key===t[c]));l=e?.items.length??0;}return a&&!o&&l&&l>1?jsxRuntimeExports.jsx(x,{...n,children:l<10?l:"9+"}):null}function Ea({className:n,notification:i,...o}){if(!i?.severity||"None"===i.severity)return null;const r=w("io-notification-header-badge",n);return jsxRuntimeExports.jsxs("div",{className:r,...o,children:[jsxRuntimeExports.jsx(k,{variant:((e="None")=>{switch(e.toLowerCase()){case"low":case"medium":case"none":default:return "circle-info";case"high":return "triangle-exclamation";case"critical":return "ban"}})(i.severity),size:"12"}),i.severity]})}function Aa({className:n,state:i,severity:o="None",icon:r,...a}){const s=w("io-notification-header-icon",n),{isPanelVisible:c}=Lr();return jsxRuntimeExports.jsxs("div",{className:s,...a,children:[r&&jsxRuntimeExports.jsx("span",{className:"io-notification-header-icon-image",children:jsxRuntimeExports.jsx("img",{src:r,alt:`io-notification-header-icon-${r}`})}),jsxRuntimeExports.jsx("span",{className:`io-notification-header-icon-badge color-${o.toLowerCase()}`,children:c&&"Acknowledged"!==i&&"New"})]})}function Ba({className:t,notification:{appTitle:n},...i}){const o=w("io-notification-header-title",t);return jsxRuntimeExports.jsx("div",{className:o,...i,children:n})}function Ta({className:t,notification:{timestamp:n,state:i,snooze:o},...r}){const a=w("io-notification-timestamp",t);return jsxRuntimeExports.jsx("small",o&&"Snoozed"===i?{className:a,...r,children:"Snoozed"}:{className:a,...r,children:Do(n??0)??"Just Now"})}function Pa({notification:{id:t,state:n},...i}){const{settings:o,snooze:a}=Lr(),s=useCallback((e=>{e.stopPropagation(),a&&a(t,o.snooze?.duration??0);}),[t,a,o.snooze?.duration]);return a&&"Snoozed"!==n&&o.snooze?.enabled?jsxRuntimeExports.jsx(A,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:s,...i}):null}function Ra({notification:{updateState:t,close:n},...i}){const{isPanelVisible:o}=Lr();return jsxRuntimeExports.jsx(S,{icon:"close",iconSize:"10",size:"24",tabIndex:-1,onClick:e=>{o?n().catch(console.error):(e.stopPropagation(),t("Acknowledged").catch(console.error));},...i})}function La({className:n,notification:i,...o}){const r=w("io-notification-body",n),{BodyIcon:a,BodyTitle:s,BodyDescription:c}=ja(),{onClick:l}=i,{settings:u,isPanelVisible:d}=Lr();return jsxRuntimeExports.jsxs("div",{className:r,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||l({close:!1});},onClick:()=>{if(u.toastStacking)l({close:!1});else {l({close:d||(u?.closeNotificationOnClick??!0)});}},...o,children:[jsxRuntimeExports.jsx(a,{icon:i.icon}),jsxRuntimeExports.jsxs("div",{className:"io-notification-body-content",children:[jsxRuntimeExports.jsx(s,{text:i.title}),jsxRuntimeExports.jsx(c,{text:i.body})]})]})}function Oa({className:t,icon:n,altText:i="notification icon",...o}){if(!n)return null;const r=w("io-notification-body-icon",t);return jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsx("img",{src:n,alt:i})})}function Fa({text:t,...n}){return jsxRuntimeExports.jsx(I,{text:t,...n})}function Da({className:t,text:n,...i}){const o=w("io-notification-body-description",t);return jsxRuntimeExports.jsx("p",{className:o,...i,children:n})}function Ma({className:n,notification:i}){const o=w("io-notification-footer",n),{FooterButton:r}=ja(),a=useMemo((()=>function(e){const t=[],n={};e.forEach((e=>{const{displayId:i,displayPath:o}=e,r={...e,children:[]};if(o&&o.length>0){let e;o.forEach(((t,i)=>{0===i?e=n[t]:e&&(e=e.children?.find((e=>e.displayId===t)));})),e&&e.children?.push(r);}else i?(t.push(r),n[i]=r):t.push(r);i&&(n[i]=r);}));const i=e=>{e.forEach((e=>{e.children&&0===e.children.length?delete e.children:e.children&&i(e.children);}));};return i(t),t}(i.actions)),[i.actions]),s=(t,n)=>t.children?jsxRuntimeExports.jsx(bi,{text:t.title,children:t.children.map(s)},`${t.title}-${n}`):((t,n)=>jsxRuntimeExports.jsx(bi.Item,{children:jsxRuntimeExports.jsx(r,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:t,notificationId:i.id})},`${t.title}-${n}`))(t,n);return jsxRuntimeExports.jsx("div",{className:o,children:jsxRuntimeExports.jsx($,{align:"right",children:a.map(((n,o)=>n.children?jsxRuntimeExports.jsxs($,{variant:"append",children:[jsxRuntimeExports.jsx(r,{notificationAction:n,variant:0===o?"primary":"default",notificationId:i.id}),jsxRuntimeExports.jsx(bi,{variant:0===o?"primary":"default",icon:"ellipsis",children:n.children.map(s)})]},`${n.title}-${o}`):jsxRuntimeExports.jsx(r,{notificationAction:n,variant:0===o?"primary":"link",notificationId:i.id},`${n.title}-${o}`)))})})}function za({notificationAction:t,notificationId:n,...i}){const{settings:o,setState:r,isPanelVisible:a}=Lr();return jsxRuntimeExports.jsx(A,{text:t.title,onClick:e=>{e.stopPropagation();const i="boolean"!=typeof o?.closeNotificationOnClick||o?.closeNotificationOnClick;a||i?t.onClick({close:i}):(t.onClick({close:!1}),r(n,"Acknowledged"));},...i})}const _a={Header:xa,HeaderCount:Ia,HeaderBadge:Ea,HeaderIcon:Aa,HeaderTitle:Ba,HeaderTimestamp:Ta,HeaderButtonSnooze:Pa,HeaderButtonClose:Ra,Body:La,BodyIcon:Oa,BodyTitle:Fa,BodyDescription:Da,Footer:Ma,FooterButton:za},Ha=createContext(_a),$a=memo((({children:t,components:n})=>{const i=useMemo((()=>({..._a,...n})),[n]);return jsxRuntimeExports.jsx(Ha.Provider,{value:i,children:t})}));function ja(e){return {...useContext(Ha),...e}}function Va({className:n,notification:i,...o}){const{Header:r,Body:a,Footer:s}=ja(),{severity:c}=i,l=w("io-notification",`severity-${c?.toLowerCase()??"none"}`,"Acknowledged"!==i.state&&"state-new",n);return jsxRuntimeExports.jsxs("div",{className:l,...o,children:[jsxRuntimeExports.jsx(r,{notification:i}),jsxRuntimeExports.jsx(a,{notification:i}),jsxRuntimeExports.jsx(s,{notification:i})]})}function Ua({components:t,notification:n,...i}){return jsxRuntimeExports.jsx($a,{components:t,children:jsxRuntimeExports.jsx(Va,{notification:n,...i})})}function Ja({className:n,notifications:i,...o}){const[a,s]=useState(!1),l=i.length>=3?"large":"normal",u=2===i.length?"small":l,d=i[0].severity,f=w("io-notification-stack",a&&"io-notification-stack-open","normal"!==u&&[`io-notification-stack-${u}`],d&&"None"!==d&&[`io-notification-stack-${d.toLowerCase()}`],n),h=useCallback((()=>{s(!0);}),[]),m=useCallback((e=>{e.stopPropagation(),i.forEach((e=>{e.close();}));}),[i]);return jsxRuntimeExports.jsxs("div",{className:f,onClick:h,...o,children:[a&&"normal"!==u&&jsxRuntimeExports.jsx("div",{className:"io-notification-stack-btn",children:jsxRuntimeExports.jsx(A,{icon:"close",onClick:e=>m(e),children:jsxRuntimeExports.jsx("span",{className:"io-btn-text",children:"Clear All"})})}),i.map((t=>jsxRuntimeExports.jsx(Ua,{notification:t},t.id)))]})}function Wa({className:n,Notification:i,notifications:o,noNotificationText:r="No notifications to display",...a}){const s=w("io-notification-list",n),{notifications:c,notificationStacks:l,settings:u,configuration:d,isPanelVisible:f,selectedNotifications:h,selectNotification:m,isBulkActionsSupported:p}=Lr(),{isBulkActionsVisible:g}=Fr(),{toastStacking:v}=u,b=o??c;return jsxRuntimeExports.jsx("div",{className:s,...a,children:v&&!f?l.length>0?l.map((t=>jsxRuntimeExports.jsx(Ja,{notifications:t.items},t.key))):jsxRuntimeExports.jsx("div",{className:"flex jc-center mt-8",children:r??""}):b.length>0?b.map((n=>{const o=d.sourceFilter?.muted?.includes(n.source)||d.sourceFilter?.muted?.includes("*");return !f&&o?null:f&&p&&g?jsxRuntimeExports.jsxs("div",{className:"io-notification-list-bulk-action-item "+(h.includes(n.id)?"selected":""),children:[jsxRuntimeExports.jsx(Pi,{checked:h.includes(n.id),onChange:e=>m(n.id,e.target.checked)}),jsxRuntimeExports.jsx(i,{notification:n})]},n.id):jsxRuntimeExports.jsx(i,{notification:n},n.id)})):jsxRuntimeExports.jsx("div",{className:"flex jc-center mt-8",children:r??""})})}$a.displayName="ComponentsStoreProvider";const qa={Header:Dr,HeaderCaption:Mr,HeaderCaptionFilter:zr,HeaderCaptionTitle:_r,HeaderCaptionCount:function({...t}){const{notificationsCount:n}=Fr();return jsxRuntimeExports.jsx(x,{...t,children:(n||0).toString()})},HeaderCaptionButtons:Hr,HeaderCaptionButtonSearch:function({...t}){const{isSearchVisible:n,showSearch:i,hideSearch:o,notificationsCount:r}=Fr();return jsxRuntimeExports.jsx(S,{icon:n?"search-filled":"search",variant:"circle",size:"32",onClick:n?o:i,disabled:0===r,...t})},HeaderCaptionButtonSettings:function({icon:t="cog",size:n="32",variant:i="circle",...o}){const{showSettings:r}=Fr();return jsxRuntimeExports.jsx(S,{icon:t,size:n,variant:i,onClick:r,...o})},HeaderCaptionButtonClose:function({icon:t="close",size:n="32",variant:i="circle",...o}){const{hidePanel:r}=Lr();return jsxRuntimeExports.jsx(S,{icon:t,size:n,variant:i,onClick:r,...o})},HeaderActions:function({className:n,...i}){const o=w("io-panel-header-actions",n),{HeaderActionSort:r,HeaderActionView:a,HeaderActionClear:s,HeaderActionEdit:c}=Ya();return jsxRuntimeExports.jsxs("div",{className:o,...i,children:[jsxRuntimeExports.jsxs($,{children:[jsxRuntimeExports.jsx(r,{}),jsxRuntimeExports.jsx(a,{})]}),jsxRuntimeExports.jsxs($,{children:[jsxRuntimeExports.jsx(s,{}),jsxRuntimeExports.jsx(c,{})]})]})},HeaderActionSort:function({text:n="Sort by",...i}){const{sortNotificationsBy:o,setSortBy:a}=Fr(),{onNotificationsSort:s}=(()=>{const{notifications:e}=Lr(),[t,n]=useState(Jr),{key:i,descending:o}=t,a=useMemo((()=>Gr[i](e,o)),[e,i,o]),s=useCallback((e=>{n((t=>({key:e,descending:t.key!==e?Jr.descending:!t.descending})));}),[]);return {onNotificationsSort:s,sortedNotifications:a}})();return jsxRuntimeExports.jsxs(H,{variant:"light",...i,children:[jsxRuntimeExports.jsxs(H.Button,{variant:"link",children:[n," ",jsxRuntimeExports.jsx("strong",{children:o})]}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Severity"].map((t=>jsxRuntimeExports.jsx(H.Item,{isSelected:o===t.toLowerCase(),onClick:()=>{a(t.toLowerCase()),s(t.toLowerCase());},children:t},t)))})})]})},HeaderActionView:function({text:n="View",...i}){const{settings:o}=Lr(),{viewNotificationsBy:r,setViewBy:a}=Fr(),s=o.snooze?.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return jsxRuntimeExports.jsxs(H,{variant:"light",...i,children:[jsxRuntimeExports.jsxs(H.Button,{variant:"link",children:[n," ",jsxRuntimeExports.jsx("strong",{children:r})]}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",checkIcon:"check",children:s.map((t=>jsxRuntimeExports.jsx(H.Item,{isSelected:r===t.toLowerCase(),onClick:()=>a(t.toLowerCase()),children:t},t)))})})]})},HeaderActionClear:function({text:t="Clear All",...n}){const{clearAll:i}=Lr(),{notificationsCount:o}=Fr();return jsxRuntimeExports.jsx(A,{variant:"link",text:t,onClick:i,disabled:0===o,...n})},HeaderActionEdit:function({tooltip:t="Bulk Edit",...n}){const{isBulkActionsSupported:i}=Lr(),{showBulkActions:o,notificationsCount:r}=Fr();return i?jsxRuntimeExports.jsx(S,{icon:"pen-to-square",title:t,size:"32",onClick:o,disabled:0===r,...n}):null},HeaderBulkActions:function({className:n,...i}){const o=w("io-panel-header-bulk-actions",n),{HeaderBulkActionSelect:r,HeaderBulkActionSelectDropdown:a,HeaderBulkActionMarkAsRead:s,HeaderBulkActionMarkAsUnread:c,HeaderBulkActionSnooze:l,HeaderBulkActionClear:u,HeaderBulkActionClose:d}=Ya(),{isBulkActionsSupported:f}=Lr();return f?jsxRuntimeExports.jsx("div",{className:o,...i,children:jsxRuntimeExports.jsxs($,{children:[jsxRuntimeExports.jsx(r,{}),jsxRuntimeExports.jsx(a,{}),jsxRuntimeExports.jsx(s,{}),jsxRuntimeExports.jsx(c,{}),jsxRuntimeExports.jsx(l,{}),jsxRuntimeExports.jsx(u,{}),jsxRuntimeExports.jsx(d,{})]})}):null},HeaderBulkActionSelect:function({...t}){const{isBulkActionsSupported:n,selectedNotifications:i,selectAllNotifications:o}=Lr(),{notificationsCount:r}=Fr();return n?jsxRuntimeExports.jsx(Pi,{checked:r===i.length&&r>0,onChange:e=>o("all",e.target.checked),disabled:0===r,...t}):null},HeaderBulkActionSelectDropdown:function({...n}){const{isBulkActionsSupported:i,selectAllNotifications:o}=Lr(),{notificationsCount:r}=Fr();return i?jsxRuntimeExports.jsxs(H,{variant:"light",...n,children:[jsxRuntimeExports.jsx(H.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:0===r}),jsxRuntimeExports.jsx(T,{children:jsxRuntimeExports.jsxs(H.List,{variant:"single",checkIcon:"check",children:[jsxRuntimeExports.jsx(H.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map((t=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>o(t.toLowerCase(),!0),children:t},t)))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:t="envelope-open",size:n="32",variant:i="circle",tooltip:o="Mark as read",...a}){const{isBulkActionsSupported:s,selectedNotifications:c,setStates:l}=Lr(),{notificationsCount:u}=Fr(),d=useCallback((()=>{l(c,"Seen");}),[c,l]);return s?jsxRuntimeExports.jsx(S,{icon:t,size:n,variant:i,title:o,onClick:d,disabled:0===u,...a}):null},HeaderBulkActionMarkAsUnread:function({icon:t="envelope",size:n="32",variant:i="circle",tooltip:o="Mark as unread",...a}){const{isBulkActionsSupported:s,selectedNotifications:c,setStates:l}=Lr(),{notificationsCount:u}=Fr(),d=useCallback((()=>{l(c,"Active");}),[c,l]);return s?jsxRuntimeExports.jsx(S,{icon:t,size:n,variant:i,title:o,onClick:d,disabled:0===u,...a}):null},HeaderBulkActionSnooze:function({icon:t="snooze",size:n="32",variant:i="circle",tooltip:o="Snooze",...a}){const{isBulkActionsSupported:s,selectedNotifications:c,snoozeMany:l,settings:u}=Lr(),{notificationsCount:d}=Fr(),f=useCallback((()=>{l(c,u.snooze?.duration??0);}),[c,l,u.snooze?.duration]);return s&&u.snooze?.enabled?jsxRuntimeExports.jsx(S,{icon:t,size:n,variant:i,title:o,onClick:f,disabled:0===d,...a}):null},HeaderBulkActionClear:function({icon:t="trash",size:n="32",variant:i="circle",tooltip:o="Clear",...a}){const{isBulkActionsSupported:s,selectedNotifications:c,clearMany:l}=Lr(),{notificationsCount:u}=Fr(),d=useCallback((()=>{l(c);}),[c,l]);return s?jsxRuntimeExports.jsx(S,{icon:t,size:n,variant:i,title:o,onClick:d,disabled:0===u,...a}):null},HeaderBulkActionClose:function({text:t="Done",variant:n="primary",...i}){const{isBulkActionsSupported:o}=Lr(),{hideBulkActions:r,notificationsCount:a}=Fr();return o?jsxRuntimeExports.jsx(A,{variant:n,text:t,onClick:r,disabled:0===a,...i}):null},HeaderSearch:function({className:n,icon:i="search",placeholder:o="Search",...r}){const a=w("io-panel-header-search",n),{isSearchVisible:s,searchQuery:c,setSearch:l,notificationsCount:f}=Fr(),h=useRef(null);return useEffect((()=>{s?h.current?.focus():(h.current?.blur(),l(""));}),[s,l]),s?jsxRuntimeExports.jsxs("div",{className:a,children:[jsxRuntimeExports.jsx(Bi,{ref:h,value:c,iconPrepend:i,placeholder:o,onChange:e=>l(e.target.value),...r}),s&&c.length>0&&jsxRuntimeExports.jsx("p",{className:"io-panel-header-search-count",children:`${f} results`})]}):null},Body:Yr,Footer:Qr,FooterButtons:Xr,FooterButtonClearAll:Zr,FooterButtonClearAllOld:ea,Notification:Ua,NotificationsList:Wa,Settings:ta,SettingsGeneral:na,SettingsAllowNotifications:ia,SettingsShowNotificationBadge:oa,SettingsCloseNotificationOnClick:ra,SettingsPanelAutoHide:aa,SettingsPanelAlwaysOnTop:sa,SettingsHideToastsAfter:ca,SettingsMarkAsNew:la,SettingsMarkAsRead:ua,SettingsStacking:da,SettingsToastStacking:fa,SettingsToastStackBy:ma,SettingsPlacement:pa,SettingsPlacementPanel:ga,SettingsPlacementToasts:va,SettingsSnooze:ba,SettingsSnoozeDuration:ya,SettingsSubscriptions:wa,SettingsSubscribeAll:ka,SettingsSubscribeApp:Sa,SettingsSubscribeMuteAll:Na,SettingsSubscribeMuteApp:Ca},Ka=createContext(qa),Ga=memo((({children:t,components:n})=>{const i=useMemo((()=>({...qa,...n})),[n]);return jsxRuntimeExports.jsx(Ka.Provider,{value:i,children:t})}));function Ya(e){return {...useContext(Ka),...e}}Ga.displayName="ComponentsStoreProvider";const Za={Body:function({className:t,notifications:n,maxToasts:i=1,...o}){const r=w("io-toasts-body",t),{NotificationsList:a,Notification:s}=ns(),[l,d]=useState([]);return useEffect((()=>{const e=i<0?n.length:i,t=n.filter((e=>"Active"===e.state)).slice(0,e);for(const e of t)e.onShow();d(t);}),[n,i]),jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsx(a,{Notification:s,notifications:l,noNotificationText:""})})},Notification:Ua,NotificationsList:Wa},es=createContext(Za),ts=memo((({children:t,components:n})=>{const i=useMemo((()=>({...Za,...n})),[n]);return jsxRuntimeExports.jsx(es.Provider,{value:i,children:t})}));function ns(e){return {...useContext(es),...e}}ts.displayName="ComponentsStoreProvider";const as=n=>{const{General:i,Layouts:o,Widget:r}=Fs();return jsxRuntimeExports.jsxs(Si,{...n,children:[jsxRuntimeExports.jsx(i,{}),jsxRuntimeExports.jsx(o,{}),jsxRuntimeExports.jsx(r,{})]})},ss=({className:t,title:n="General",...i})=>{const{Theme:o}=Fs();return jsxRuntimeExports.jsx(E,{className:w("io-block io-block-list-gap",t),title:n,...i,children:jsxRuntimeExports.jsx(o,{})})},cs=({className:n,title:i="Layouts",...o})=>{const{LayoutsShowDeletePrompt:r,LayoutsShowUnsavedChangesPrompt:a}=Fs();return jsxRuntimeExports.jsxs(E,{className:w("io-block io-block-list-gap",n),title:i,...o,children:[jsxRuntimeExports.jsx(r,{}),jsxRuntimeExports.jsx(a,{})]})},ls="layoutsShowDeletePrompt",us="layoutsShowUnsavedChangesPrompt",ds="widgetEnableForExternalApps";var fs=function(e){return {ok:!0,result:e}},hs=function(e){return {ok:!1,error:e}},ms=function(e,t,n){return !1===t.ok?t:!1===n.ok?n:fs(e(t.result,n.result))},ps=function(e,t){return !0===t.ok?t:hs(e(t.error))},gs=function(){return gs=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},gs.apply(this,arguments)};function vs(e,t){if(e===t)return !0;if(null===e&&null===t)return !0;if(typeof e!=typeof t)return !1;if("object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(t))return !1;if(e.length!==t.length)return !1;for(var n=0;n<e.length;n++)if(!vs(e[n],t[n]))return !1;return !0}var i=Object.keys(e);if(i.length!==Object.keys(t).length)return !1;for(n=0;n<i.length;n++){if(!t.hasOwnProperty(i[n]))return !1;if(!vs(e[i[n]],t[i[n]]))return !1}return !0}}var bs=function(e){return Array.isArray(e)},ys=function(e){return "object"==typeof e&&null!==e&&!bs(e)},ws=function(e,t){return "expected "+e+", got "+function(e){switch(typeof e){case"string":return "a string";case"number":return "a number";case"boolean":return "a boolean";case"undefined":return "undefined";case"object":return e instanceof Array?"an array":null===e?"null":"an object";default:return JSON.stringify(e)}}(t)},ks=function(e){return e.map((function(e){return "string"==typeof e?"."+e:"["+e+"]"})).join("")},Ss=function(e,t){var n=t.at,i=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);}return n}(t,["at"]);return gs({at:e+(n||"")},i)},Ns=function(){function e(t){var n=this;this.decode=t,this.run=function(e){return ps((function(t){return {kind:"DecoderError",input:e,at:"input"+(t.at||""),message:t.message||""}}),n.decode(e))},this.runPromise=function(e){return function(e){return !0===e.ok?Promise.resolve(e.result):Promise.reject(e.error)}(n.run(e))},this.runWithException=function(e){return function(e){if(!0===e.ok)return e.result;throw e.error}(n.run(e))},this.map=function(t){return new e((function(e){return function(e,t){return !0===t.ok?fs(e(t.result)):t}(t,n.decode(e))}))},this.andThen=function(t){return new e((function(e){return function(e,t){return !0===t.ok?e(t.result):t}((function(n){return t(n).decode(e)}),n.decode(e))}))},this.where=function(t,i){return n.andThen((function(n){return t(n)?e.succeed(n):e.fail(i)}))};}return e.string=function(){return new e((function(e){return "string"==typeof e?fs(e):hs({message:ws("a string",e)})}))},e.number=function(){return new e((function(e){return "number"==typeof e?fs(e):hs({message:ws("a number",e)})}))},e.boolean=function(){return new e((function(e){return "boolean"==typeof e?fs(e):hs({message:ws("a boolean",e)})}))},e.constant=function(t){return new e((function(e){return vs(e,t)?fs(t):hs({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(e)})}))},e.object=function(t){return new e((function(e){if(ys(e)&&t){var n={};for(var i in t)if(t.hasOwnProperty(i)){var o=t[i].decode(e[i]);if(!0!==o.ok)return void 0===e[i]?hs({message:"the key '"+i+"' is required but was not present"}):hs(Ss("."+i,o.error));void 0!==o.result&&(n[i]=o.result);}return fs(n)}return ys(e)?fs(e):hs({message:ws("an object",e)})}))},e.array=function(t){return new e((function(e){if(bs(e)&&t){return e.reduce((function(e,n,i){return ms((function(e,t){return e.concat([t])}),e,function(e,n){return ps((function(e){return Ss("["+n+"]",e)}),t.decode(e))}(n,i))}),fs([]))}return bs(e)?fs(e):hs({message:ws("an array",e)})}))},e.tuple=function(t){return new e((function(e){if(bs(e)){if(e.length!==t.length)return hs({message:"expected a tuple of length "+t.length+", got one of length "+e.length});for(var n=[],i=0;i<t.length;i++){var o=t[i].decode(e[i]);if(!o.ok)return hs(Ss("["+i+"]",o.error));n[i]=o.result;}return fs(n)}return hs({message:ws("a tuple of length "+t.length,e)})}))},e.union=function(t,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];return e.oneOf.apply(e,[t,n].concat(i))},e.intersection=function(t,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];return new e((function(e){return [t,n].concat(i).reduce((function(t,n){return ms(Object.assign,t,n.decode(e))}),fs({}))}))},e.anyJson=function(){return new e((function(e){return fs(e)}))},e.unknownJson=function(){return new e((function(e){return fs(e)}))},e.dict=function(t){return new e((function(e){if(ys(e)){var n={};for(var i in e)if(e.hasOwnProperty(i)){var o=t.decode(e[i]);if(!0!==o.ok)return hs(Ss("."+i,o.error));n[i]=o.result;}return fs(n)}return hs({message:ws("an object",e)})}))},e.optional=function(t){return new e((function(e){return null==e?fs(void 0):t.decode(e)}))},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e((function(e){for(var n=[],i=0;i<t.length;i++){var o=t[i].decode(e);if(!0===o.ok)return o;n[i]=o.error;}var r=n.map((function(e){return "at error"+(e.at||"")+": "+e.message})).join('", "');return hs({message:'expected a value matching one of the decoders, got the errors ["'+r+'"]'})}))},e.withDefault=function(t,n){return new e((function(e){return fs(function(e,t){return !0===t.ok?t.result:e}(t,n.decode(e)))}))},e.valueAt=function(t,n){return new e((function(e){for(var i=e,o=0;o<t.length;o++){if(void 0===i)return hs({at:ks(t.slice(0,o+1)),message:"path does not exist"});if("string"==typeof t[o]&&!ys(i))return hs({at:ks(t.slice(0,o+1)),message:ws("an object",i)});if("number"==typeof t[o]&&!bs(i))return hs({at:ks(t.slice(0,o+1)),message:ws("an array",i)});i=i[t[o]];}return ps((function(e){return void 0===i?{at:ks(t),message:"path does not exist"}:Ss(ks(t),e)}),n.decode(i))}))},e.succeed=function(t){return new e((function(e){return fs(t)}))},e.fail=function(t){return new e((function(e){return hs({message:t})}))},e.lazy=function(t){return new e((function(e){return t().decode(e)}))},e}();Ns.string,Ns.number;var Cs=Ns.boolean;Ns.anyJson,Ns.unknownJson,Ns.constant,Ns.object,Ns.array,Ns.tuple,Ns.dict,Ns.optional,Ns.oneOf,Ns.union,Ns.intersection,Ns.withDefault,Ns.valueAt,Ns.succeed,Ns.fail,Ns.lazy;const xs=Cs(),Is=({prefKey:t,...n})=>{const{isLoading:i,value:o=!1,update:r}=Mi({app:"io-connect-platform",prefKey:t,decoder:xs});return jsxRuntimeExports.jsx(Li,{checked:o,disabled:i,onChange:e=>r(e.target.checked),...n})},Es=({align:t="right",label:n="Show prompt for deleting",...i})=>jsxRuntimeExports.jsx(Is,{align:t,label:n,prefKey:ls,...i}),As=({align:t="right",label:n="Show prompt for unsaved changes",...i})=>jsxRuntimeExports.jsx(Is,{align:t,label:n,prefKey:us,...i}),Bs=({className:n,title:i="Theme",...o})=>{const{currentTheme:a,selectTheme:l}=(()=>{const e=useContext(IOConnectContext),[t,n]=useState(null),i=useCallback((t=>e?.themes?.select(t)),[e]);return useEffect((()=>{if(!e)return;let t=!1;const i=e=>{t||n(e);};return e.themes?.onChanged(i),e.themes?.getCurrent().then(i).catch(console.warn),()=>{t=!0;}}),[e]),{currentTheme:t,selectTheme:i}})(),d=(()=>{const e=useContext(IOConnectContext),[t,n]=useState([]);return useEffect((()=>{e&&e.themes?.list().then(n).catch(console.warn);}),[e]),t})();return jsxRuntimeExports.jsxs("div",{className:w("flex jc-between ai-center",n),...o,children:[jsxRuntimeExports.jsx("label",{className:"io-text-clipper",children:i}),jsxRuntimeExports.jsxs(H,{variant:"light",children:[jsxRuntimeExports.jsx(H.Button,{text:a?.displayName}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:d.map((({name:t,displayName:n})=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>l(t),children:n},t)))})})]})]})},Ts=({className:t,title:n="Widget",...i})=>{const{WidgetEnableForExternalApps:o}=Fs();return jsxRuntimeExports.jsx(E,{className:w("io-block io-block-list-gap",t),title:n,...i,children:jsxRuntimeExports.jsx(o,{})})},Ps=({align:t="right",label:n="Enable for external apps",...i})=>jsxRuntimeExports.jsx(Is,{align:t,label:n,prefKey:ds,...i}),Rs={Body:as,General:ss,Layouts:cs,LayoutsShowDeletePrompt:Es,LayoutsShowUnsavedChangesPrompt:As,Theme:Bs,Widget:Ts,WidgetEnableForExternalApps:Ps},Ls=createContext(Rs),Os=memo((({children:t,components:n})=>{const i=useMemo((()=>({...Rs,...n})),[n]);return jsxRuntimeExports.jsx(Ls.Provider,{value:i,children:t})}));Os.displayName="PreferencesPanelComponentsStoreProvider";const Fs=()=>useContext(Ls);
|
|
1174
|
+
*/var qe=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),Ke="undefined"==typeof Element,Ge=Ke?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ye=!Ke&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},Qe=function e(t,n){var i;void 0===n&&(n=!0);var o=null==t||null===(i=t.getAttribute)||void 0===i?void 0:i.call(t,"inert");return ""===o||"true"===o||n&&t&&e(t.parentNode)},Xe=function e(t,n,i){for(var o=[],r=Array.from(t);r.length;){var a=r.shift();if(!Qe(a,!1))if("SLOT"===a.tagName){var s=a.assignedElements(),c=e(s.length?s:a.children,!0,i);i.flatten?o.push.apply(o,c):o.push({scopeParent:a,candidates:c});}else {Ge.call(a,qe)&&i.filter(a)&&(n||!t.includes(a))&&o.push(a);var l=a.shadowRoot||"function"==typeof i.getShadowRoot&&i.getShadowRoot(a),u=!Qe(l,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(a));if(l&&u){var d=e(!0===l?a.children:l.children,!0,i);i.flatten?o.push.apply(o,d):o.push({scopeParent:a,candidates:d});}else r.unshift.apply(r,a.children);}}return o},Ze=function(e){return !isNaN(parseInt(e.getAttribute("tabindex"),10))},et=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return ""===n||"true"===n}(e))&&!Ze(e)?0:e.tabIndex},tt=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},nt=function(e){return "INPUT"===e.tagName},it=function(e){return function(e){return nt(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return !0;var t,n=e.form||Ye(e),i=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=i(window.CSS.escape(e.name));else try{t=i(e.name);}catch(e){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",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return !o||o===e}(e)},ot=function(e){var t=e.getBoundingClientRect(),n=t.width,i=t.height;return 0===n&&0===i},rt=function(e,t){var n=t.displayCheck,i=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return !0;var o=Ge.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ge.call(o,"details:not([open]) *"))return !0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ot(e)}else {if("function"==typeof i){for(var r=e;e;){var a=e.parentElement,s=Ye(e);if(a&&!a.shadowRoot&&!0===i(a))return ot(e);e=e.assignedSlot?e.assignedSlot:a||s===e.ownerDocument?a:s.host;}e=r;}if(function(e){var t,n,i,o,r=e&&Ye(e),a=null===(t=r)||void 0===t?void 0:t.host,s=!1;if(r&&r!==e)for(s=!!(null!==(n=a)&&void 0!==n&&null!==(i=n.ownerDocument)&&void 0!==i&&i.contains(a)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&a;){var c,l,u;s=!(null===(l=a=null===(c=r=Ye(a))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(a));}return s}(e))return !e.getClientRects().length;if("legacy-full"!==n)return !0}return !1},at=function(e,t){return !(t.disabled||Qe(t)||function(e){return nt(e)&&"hidden"===e.type}(t)||rt(t,e)||function(e){return "DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return "SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var i=t.children.item(n);if("LEGEND"===i.tagName)return !!Ge.call(t,"fieldset[disabled] *")||!i.contains(e)}return !0}t=t.parentElement;}return !1}(t))},st=function(e,t){return !(it(t)||et(t)<0||!at(e,t))},ct=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return !!(isNaN(t)||t>=0)},lt=function e(t){var n=[],i=[];return t.forEach((function(t,o){var r=!!t.scopeParent,a=r?t.scopeParent:t,s=function(e,t){var n=et(e);return n<0&&t&&!Ze(e)?0:n}(a,r),c=r?e(t.candidates):a;0===s?r?n.push.apply(n,c):n.push(a):i.push({documentOrder:o,tabIndex:s,item:t,isScope:r,content:c});})),i.sort(tt).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ut=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Xe([e],t.includeContainer,{filter:st.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ct}):function(e,t,n){if(Qe(e))return [];var i=Array.prototype.slice.apply(e.querySelectorAll(qe));return t&&Ge.call(e,qe)&&i.unshift(e),i.filter(n)}(e,t.includeContainer,st.bind(null,t)),lt(n)},dt=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return !1!==Ge.call(e,qe)&&st(t,e)};function ft(e,t,n){let{reference:i,floating:o}=e;const r=je(t),a=Ve(t),s=$e(a),c=ze(t),l="y"===r,u=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,f=i[s]/2-o[s]/2;let h;switch(c){case"top":h={x:u,y:i.y-o.height};break;case"bottom":h={x:u,y:i.y+i.height};break;case"right":h={x:i.x+i.width,y:d};break;case"left":h={x:i.x-o.width,y:d};break;default:h={x:i.x,y:i.y};}switch(_e(t)){case"start":h[a]-=f*(n&&l?-1:1);break;case"end":h[a]+=f*(n&&l?-1:1);}return h}async function ht(e,t){var n;void 0===t&&(t={});const{x:i,y:o,platform:r,rects:a,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:h=0}=Me(t,e),m=function(e){return "number"!=typeof e?function(e){return {top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(h),p=s[f?"floating"===d?"reference":"floating":d],g=We(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(p)))||n?p:p.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),v="floating"===d?{x:i,y:o,width:a.floating.width,height:a.floating.height}:a.reference,b=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),y=await(null==r.isElement?void 0:r.isElement(b))&&await(null==r.getScale?void 0:r.getScale(b))||{x:1,y:1},w=We(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:b,strategy:c}):v);return {top:(g.top-w.top+m.top)/y.y,bottom:(w.bottom-g.bottom+m.bottom)/y.y,left:(g.left-w.left+m.left)/y.x,right:(w.right-g.right+m.right)/y.x}}function mt(e){const t=ce(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=ee(e),r=o?e.offsetWidth:n,a=o?e.offsetHeight:i,s=Pe(n)!==r||Pe(i)!==a;return s&&(n=r,i=a),{width:n,height:i,$:s}}function pt(e){return Z(e)?e:e.contextElement}function gt(e){const t=pt(e);if(!ee(t))return Le(1);const n=t.getBoundingClientRect(),{width:i,height:o,$:r}=mt(t);let a=(r?Pe(n.width):n.width)/i,s=(r?Pe(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const vt=Le(0);function bt(e){const t=Y(e);return ae()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:vt}function yt(e,t,n,i){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),r=pt(e);let a=Le(1);t&&(i?Z(i)&&(a=gt(i)):a=gt(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Y(e))&&t}(r,n,i)?bt(r):Le(0);let c=(o.left+s.x)/a.x,l=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(r){const e=Y(r),t=i&&Z(i)?Y(i):i;let n=e,o=n.frameElement;for(;o&&i&&t!==n;){const e=gt(o),t=o.getBoundingClientRect(),i=ce(o),r=t.left+(o.clientLeft+parseFloat(i.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(i.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=r,l+=a,n=Y(o),o=n.frameElement;}}return We({width:u,height:d,x:c,y:l})}const wt=[":popover-open",":modal"];function kt(e){return wt.some((t=>{try{return e.matches(t)}catch(e){return !1}}))}function St(e){return yt(Q(e)).left+le(e).scrollLeft}function Nt(e,t,n){let i;if("viewport"===t)i=function(e,t){const n=Y(e),i=Q(e),o=n.visualViewport;let r=i.clientWidth,a=i.clientHeight,s=0,c=0;if(o){r=o.width,a=o.height;const e=ae();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,c=o.offsetTop);}return {width:r,height:a,x:s,y:c}}(e,n);else if("document"===t)i=function(e){const t=Q(e),n=le(e),i=e.ownerDocument.body,o=Te(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),r=Te(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-n.scrollLeft+St(e);const s=-n.scrollTop;return "rtl"===ce(i).direction&&(a+=Te(t.clientWidth,i.clientWidth)-o),{width:o,height:r,x:a,y:s}}(Q(e));else if(Z(t))i=function(e,t){const n=yt(e,!0,"fixed"===t),i=n.top+e.clientTop,o=n.left+e.clientLeft,r=ee(e)?gt(e):Le(1);return {width:e.clientWidth*r.x,height:e.clientHeight*r.y,x:o*r.x,y:i*r.y}}(t,n);else {const n=bt(e);i={...t,x:t.x-n.x,y:t.y-n.y};}return We(i)}function Ct(e,t){const n=ue(e);return !(n===t||!Z(n)||se(n))&&("fixed"===ce(n).position||Ct(n,t))}function xt(e,t,n){const i=ee(t),o=Q(t),r="fixed"===n,a=yt(e,!0,r,t);let s={scrollLeft:0,scrollTop:0};const c=Le(0);if(i||!i&&!r)if(("body"!==G(t)||ne(o))&&(s=le(t)),i){const e=yt(t,!0,r,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop;}else o&&(c.x=St(o));return {x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}function Et(e){return "static"===ce(e).position}function It(e,t){return ee(e)&&"fixed"!==ce(e).position?t?t(e):e.offsetParent:null}function At(e,t){const n=Y(e);if(kt(e))return n;if(!ee(e)){let t=ue(e);for(;t&&!se(t);){if(Z(t)&&!Et(t))return t;t=ue(t);}return n}let i=It(e,t);for(;i&&ie(i)&&Et(i);)i=It(i,t);return i&&se(i)&&Et(i)&&!re(i)?n:i||function(e){let t=ue(e);for(;ee(t)&&!se(t);){if(re(t))return t;if(oe(t))return null;t=ue(t);}return null}(e)||n}const Bt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:i,strategy:o}=e;const r="fixed"===o,a=Q(i),s=!!t&&kt(t.floating);if(i===a||s&&r)return n;let c={scrollLeft:0,scrollTop:0},l=Le(1);const u=Le(0),d=ee(i);if((d||!d&&!r)&&(("body"!==G(i)||ne(a))&&(c=le(i)),ee(i))){const e=yt(i);l=gt(i),u.x=e.x+i.clientLeft,u.y=e.y+i.clientTop;}return {width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x,y:n.y*l.y-c.scrollTop*l.y+u.y}},getDocumentElement:Q,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:i,strategy:o}=e;const r=[..."clippingAncestors"===n?kt(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let i=fe(e,[],!1).filter((e=>Z(e)&&"body"!==G(e))),o=null;const r="fixed"===ce(e).position;let a=r?ue(e):e;for(;Z(a)&&!se(a);){const t=ce(a),n=re(a);n||"fixed"!==t.position||(o=null),(r?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||ne(a)&&!n&&Ct(e,a))?i=i.filter((e=>e!==a)):o=t,a=ue(a);}return t.set(e,i),i}(t,this._c):[].concat(n),i],a=r[0],s=r.reduce(((e,n)=>{const i=Nt(t,n,o);return e.top=Te(i.top,e.top),e.right=Be(i.right,e.right),e.bottom=Be(i.bottom,e.bottom),e.left=Te(i.left,e.left),e}),Nt(t,a,o));return {width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:At,getElementRects:async function(e){const t=this.getOffsetParent||At,n=this.getDimensions,i=await n(e.floating);return {reference:xt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=mt(e);return {width:t,height:n}},getScale:gt,isElement:Z,isRTL:function(e){return "rtl"===ce(e).direction}};function Tt(e,t,n,i){void 0===i&&(i={});const{ancestorScroll:o=!0,ancestorResize:r=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=i,l=pt(e),u=o||r?[...l?fe(l):[],...fe(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),r&&e.addEventListener("resize",n);}));const d=l&&s?function(e,t){let n,i=null;const o=Q(e);function r(){var e;clearTimeout(n),null==(e=i)||e.disconnect(),i=null;}return function a(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),r();const{left:l,top:u,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;const h={rootMargin:-Re(u)+"px "+-Re(o.clientWidth-(l+d))+"px "+-Re(o.clientHeight-(u+f))+"px "+-Re(l)+"px",threshold:Te(0,Be(1,c))||1};let m=!0;function p(e){const t=e[0].intersectionRatio;if(t!==c){if(!m)return a();t?a(!1,t):n=setTimeout((()=>{a(!1,1e-7);}),1e3);}m=!1;}try{i=new IntersectionObserver(p,{...h,root:o.ownerDocument});}catch(e){i=new IntersectionObserver(p,h);}i.observe(e);}(!0),r}(l,n):null;let f,h=-1,m=null;a&&(m=new ResizeObserver((e=>{let[i]=e;i&&i.target===l&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=m)||e.observe(t);}))),n();})),l&&!c&&m.observe(l),m.observe(t));let p=c?yt(e):null;return c&&function t(){const i=yt(e);!p||i.x===p.x&&i.y===p.y&&i.width===p.width&&i.height===p.height||n();p=i,f=requestAnimationFrame(t);}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),r&&e.removeEventListener("resize",n);})),null==d||d(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(f);}}const Pt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:o,y:r,placement:a,middlewareData:s}=t,c=await async function(e,t){const{placement:n,platform:i,elements:o}=e,r=await(null==i.isRTL?void 0:i.isRTL(o.floating)),a=ze(n),s=_e(n),c="y"===je(n),l=["left","top"].includes(a)?-1:1,u=r&&c?-1:1,d=Me(t,e);let{mainAxis:f,crossAxis:h,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof m&&(h="end"===s?-1*m:m),c?{x:h*u,y:f*l}:{x:f*l,y:h*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(i=s.arrow)&&i.alignmentOffset?{}:{x:o+c.x,y:r+c.y,data:{...c,placement:a}}}}},Rt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:o}=t,{mainAxis:r=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return {x:t,y:n}}},...c}=Me(e,t),l={x:n,y:i},u=await ht(t,c),d=je(ze(o)),f=He(d);let h=l[f],m=l[d];if(r){const e="y"===f?"bottom":"right";h=De(h+u["y"===f?"top":"left"],h,h-u[e]);}if(a){const e="y"===d?"bottom":"right";m=De(m+u["y"===d?"top":"left"],m,m-u[e]);}const p=s.fn({...t,[f]:h,[d]:m});return {...p,data:{x:p.x-n,y:p.y-i}}}}},Lt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:o,middlewareData:r,rects:a,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...g}=Me(e,t);if(null!=(n=r.arrow)&&n.alignmentOffset)return {};const v=ze(o),b=ze(s)===s,y=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=f||(b||!p?[Je(s)]:function(e){const t=Je(e);return [Ue(e),t,Ue(t)]}(s));f||"none"===m||w.push(...function(e,t,n,i){const o=_e(e);let r=function(e,t,n){const i=["left","right"],o=["right","left"],r=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:i:t?i:o;case"left":case"right":return t?r:a;default:return []}}(ze(e),"start"===n,i);return o&&(r=r.map((e=>e+"-"+o)),t&&(r=r.concat(r.map(Ue)))),r}(s,p,m,y));const k=[s,...w],S=await ht(t,g),N=[];let C=(null==(i=r.flip)?void 0:i.overflows)||[];if(u&&N.push(S[v]),d){const e=function(e,t,n){void 0===n&&(n=!1);const i=_e(e),o=Ve(e),r=$e(o);let a="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return t.reference[r]>t.floating[r]&&(a=Je(a)),[a,Je(a)]}(o,a,y);N.push(S[e[0]],S[e[1]]);}if(C=[...C,{placement:o,overflows:N}],!N.every((e=>e<=0))){var x,E;const e=((null==(x=r.flip)?void 0:x.index)||0)+1,t=k[e];if(t)return {data:{index:e,overflows:C},reset:{placement:t}};let n=null==(E=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:E.placement;if(!n)switch(h){case"bestFit":{var I;const e=null==(I=C.map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:I[0];e&&(n=e);break}case"initialPlacement":n=s;}if(o!==n)return {reset:{placement:n}}}return {}}}},Ot=(e,t,n)=>{const i=new Map,o={platform:Bt,...n},r={...o.platform,_c:i};return (async(e,t,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:r=[],platform:a}=n,s=r.filter(Boolean),c=await(null==a.isRTL?void 0:a.isRTL(t));let l=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=ft(l,i,c),f=i,h={},m=0;for(let n=0;n<s.length;n++){const{name:r,fn:p}=s[n],{x:g,y:v,data:b,reset:y}=await p({x:u,y:d,initialPlacement:i,placement:f,strategy:o,middlewareData:h,rects:l,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=v?v:d,h={...h,[r]:{...h[r],...b}},y&&m<=50&&(m++,"object"==typeof y&&(y.placement&&(f=y.placement),y.rects&&(l=!0===y.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):y.rects),({x:u,y:d}=ft(l,f,c))),n=-1);}return {x:u,y:d,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:r})};var Ft="undefined"!=typeof document?useLayoutEffect:useEffect;function Dt(e,t){if(e===t)return !0;if(typeof e!=typeof t)return !1;if("function"==typeof e&&e.toString()===t.toString())return !0;let n,i,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return !1;for(i=n;0!=i--;)if(!Dt(e[i],t[i]))return !1;return !0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return !1;for(i=n;0!=i--;)if(!{}.hasOwnProperty.call(t,o[i]))return !1;for(i=n;0!=i--;){const n=o[i];if(("_owner"!==n||!e.$$typeof)&&!Dt(e[n],t[n]))return !1}return !0}return e!=e&&t!=t}function Mt(e){if("undefined"==typeof window)return 1;return (e.ownerDocument.defaultView||window).devicePixelRatio||1}function zt(e,t){const n=Mt(e);return Math.round(t*n)/n}function _t(e){const t=i.useRef(e);return Ft((()=>{t.current=e;})),t}const Ht=(e,t)=>({...Rt(e),options:[e,t]}),$t=(e,t)=>({...Lt(e),options:[e,t]});function jt(e){return i.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t);}));}),e)}const Vt={...i},Ut=Vt.useInsertionEffect||(e=>e());function Jt(e){const t=i.useRef((()=>{}));return Ut((()=>{t.current=e;})),i.useCallback((function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return null==t.current?void 0:t.current(...n)}),[])}const Wt="ArrowUp",qt="ArrowDown",Kt="ArrowLeft",Gt="ArrowRight";function Yt(e,t,n){return Math.floor(e/t)!==n}function Qt(e,t){return t<0||t>=e.current.length}function Xt(e,t){return en(e,{disabledIndices:t})}function Zt(e,t){return en(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function en(e,t){let{startingIndex:n=-1,decrement:i=!1,disabledIndices:o,amount:r=1}=void 0===t?{}:t;const a=e.current;let s=n;do{s+=i?-r:r;}while(s>=0&&s<=a.length-1&&on(a,s,o));return s}function tn(e,t,n,i,o){if(-1===e)return -1;const r=n.indexOf(e),a=t[e];switch(o){case"tl":return r;case"tr":return a?r+a.width-1:r;case"bl":return a?r+(a.height-1)*i:r;case"br":return n.lastIndexOf(e)}}function nn(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function on(e,t,n){if(n)return n.includes(t);const i=e[t];return null==i||i.hasAttribute("disabled")||"true"===i.getAttribute("aria-disabled")}var rn="undefined"!=typeof document?useLayoutEffect:useEffect;function an(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 sn=i.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function cn(e){const{children:t,elementsRef:n,labelsRef:o}=e,[r,a]=i.useState((()=>new Map)),s=i.useCallback((e=>{a((t=>new Map(t).set(e,null)));}),[]),c=i.useCallback((e=>{a((t=>{const n=new Map(t);return n.delete(e),n}));}),[]);return rn((()=>{const e=new Map(r);Array.from(e.keys()).sort(an).forEach(((t,n)=>{e.set(t,n);})),function(e,t){if(e.size!==t.size)return !1;for(const[n,i]of e.entries())if(i!==t.get(n))return !1;return !0}(r,e)||a(e);}),[r]),i.createElement(sn.Provider,{value:i.useMemo((()=>({register:s,unregister:c,map:r,elementsRef:n,labelsRef:o})),[s,c,r,n,o])},t)}function ln(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:o,map:r,elementsRef:a,labelsRef:s}=i.useContext(sn),[c,l]=i.useState(null),u=i.useRef(null),d=i.useCallback((e=>{if(u.current=e,null!==c&&(a.current[c]=e,s)){var n;const i=void 0!==t;s.current[c]=i?t:null!=(n=null==e?void 0:e.textContent)?n:null;}}),[c,a,s,t]);return rn((()=>{const e=u.current;if(e)return n(e),()=>{o(e);}}),[n,o]),rn((()=>{const e=u.current?r.get(u.current):null;null!=e&&l(e);}),[r]),i.useMemo((()=>({ref:d,index:null==c?-1:c})),[c,d])}function un(){return un=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);}return e},un.apply(this,arguments)}let dn=!1,fn=0;const hn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+fn++;const mn=Vt.useId||function(){const[e,t]=i.useState((()=>dn?hn():void 0));return rn((()=>{null==e&&t(hn());}),[]),i.useEffect((()=>{dn=!0;}),[]),e};function vn(){const e=new Map;return {emit(t,n){var i;null==(i=e.get(t))||i.forEach((e=>e(n)));},on(t,n){e.set(t,[...e.get(t)||[],n]);},off(t,n){var i;e.set(t,(null==(i=e.get(t))?void 0:i.filter((e=>e!==n)))||[]);}}}const bn=i.createContext(null),yn=i.createContext(null),wn=()=>{var e;return (null==(e=i.useContext(bn))?void 0:e.id)||null},kn=()=>i.useContext(yn);function Sn(e){const{children:t,id:n}=e,o=wn();return i.createElement(bn.Provider,{value:i.useMemo((()=>({id:n,parentId:o})),[n,o])},t)}function Nn(e){const{children:t}=e,n=i.useRef([]),o=i.useCallback((e=>{n.current=[...n.current,e];}),[]),r=i.useCallback((e=>{n.current=n.current.filter((t=>t!==e));}),[]),a=i.useState((()=>vn()))[0];return i.createElement(yn.Provider,{value:i.useMemo((()=>({nodesRef:n,addNode:o,removeNode:r,events:a})),[o,r,a])},t)}function Cn(e){return "data-floating-ui-"+e}function xn(e){const t=useRef(e);return rn((()=>{t.current=e;})),t}const En=Cn("safe-polygon");function In(e,t,n){return n&&!ke(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let An=0;function Bn(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:i=!0,sync:o=!1}=t;i&&cancelAnimationFrame(An);const r=()=>null==e?void 0:e.focus({preventScroll:n});o?r():An=requestAnimationFrame(r);}function Tn(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),i=n;for(;i.length;)i=e.filter((e=>{var t;return null==(t=i)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(i);return n}let Pn=new WeakMap,Rn=new WeakSet,Ln={},On=0;const Fn=e=>e&&(e.host||Fn(e.parentNode)),Dn=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=Fn(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Mn(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=Se(e[0]).body;return function(e,t,n,i){const o="data-floating-ui-inert",r=i?"inert":n?"aria-hidden":null,a=Dn(t,e),s=new Set,c=new Set(a),l=[];Ln[o]||(Ln[o]=new WeakMap);const u=Ln[o];return a.forEach((function e(t){t&&!s.has(t)&&(s.add(t),t.parentNode&&e(t.parentNode));})),function e(t){t&&!c.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==G(t))if(s.has(t))e(t);else {const e=r?t.getAttribute(r):null,n=null!==e&&"false"!==e,i=(Pn.get(t)||0)+1,a=(u.get(t)||0)+1;Pn.set(t,i),u.set(t,a),l.push(t),1===i&&n&&Rn.add(t),1===a&&t.setAttribute(o,""),!n&&r&&t.setAttribute(r,"true");}}));}(t),s.clear(),On++,()=>{l.forEach((e=>{const t=(Pn.get(e)||0)-1,n=(u.get(e)||0)-1;Pn.set(e,t),u.set(e,n),t||(!Rn.has(e)&&r&&e.removeAttribute(r),Rn.delete(e)),n||e.removeAttribute(o);})),On--,On||(Pn=new WeakMap,Pn=new WeakMap,Rn=new WeakSet,Ln={});}}(e.concat(Array.from(i.querySelectorAll("[aria-live]"))),i,t,n)}const zn=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function _n(e,t){const n=ut(e,zn());"prev"===t&&n.reverse();const i=n.indexOf(he(Se(e)));return n.slice(i+1)[0]}function Hn(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return !i||!me(n,i)}const $n={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 jn(e){"Tab"===e.key&&(e.target,clearTimeout(undefined));}const Vn=i.forwardRef((function(e,t){const[n,o]=i.useState();rn((()=>(ye()&&o("button"),document.addEventListener("keydown",jn),()=>{document.removeEventListener("keydown",jn);})),[]);const r={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Cn("focus-guard")]:"",style:$n};return i.createElement("span",un({},e,r))})),Un=i.createContext(null),Jn="data-floating-ui-focusable";function Wn(e){return e?e.hasAttribute(Jn)?e:e.querySelector("["+Jn+"]")||e:null}const qn=20;let Kn=[];function Gn(e){Kn=Kn.filter((e=>e.isConnected));let t=e;if(t&&"body"!==G(t)){if(!dt(t,zn())){const e=ut(t,zn())[0];e&&(t=e);}Kn.push(t),Kn.length>qn&&(Kn=Kn.slice(-qn));}}function Yn(){return Kn.slice().reverse().find((e=>e.isConnected))}const Qn=i.forwardRef((function(e,t){return i.createElement("button",un({},e,{type:"button",ref:t,tabIndex:-1,style:$n}))}));function Xn(e){const{context:t,children:n,disabled:o=!1,order:r=["content"],guards:a=!0,initialFocus:s=0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:h,refs:m,nodeId:p,onOpenChange:g,events:v,dataRef:b,floatingId:y,elements:{domReference:w,floating:k}}=t,S="number"==typeof s&&s<0,N=Ae(w)&&S,C="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||a,x=xn(r),E=xn(s),I=xn(c),A=kn(),B=i.useContext(Un),T=i.useRef(null),P=i.useRef(null),R=i.useRef(!1),L=i.useRef(!1),O=i.useRef(-1),F=null!=B,D=Wn(k),M=Jt((function(e){return void 0===e&&(e=D),e?ut(e,zn()):[]})),z=Jt((e=>{const t=M(e);return x.current.map((e=>w&&"reference"===e?w:D&&"floating"===e?D:t)).filter(Boolean).flat()}));function _(e){return !o&&d&&u?i.createElement(Qn,{ref:"start"===e?T:P,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}i.useEffect((()=>{if(o)return;if(!u)return;function e(e){if("Tab"===e.key){me(D,he(Se(D)))&&0===M().length&&!N&&Ie(e);const t=z(),n=Ce(e);"reference"===x.current[0]&&n===w&&(Ie(e),e.shiftKey?Bn(t[t.length-1]):Bn(t[1])),"floating"===x.current[1]&&n===D&&e.shiftKey&&(Ie(e),Bn(t[0]));}}const t=Se(D);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e);}}),[o,w,D,u,x,N,M,z]),i.useEffect((()=>{if(!o&&k)return k.addEventListener("focusin",e),()=>{k.removeEventListener("focusin",e);};function e(e){const t=Ce(e),n=M().indexOf(t);-1!==n&&(O.current=n);}}),[o,k,M]),i.useEffect((()=>{if(!o&&f)return k&&ee(w)?(w.addEventListener("focusout",t),w.addEventListener("pointerdown",e),k.addEventListener("focusout",t),()=>{w.removeEventListener("focusout",t),w.removeEventListener("pointerdown",e),k.removeEventListener("focusout",t);}):void 0;function e(){L.current=!0,setTimeout((()=>{L.current=!1;}));}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(me(w,t)||me(k,t)||me(t,k)||me(null==B?void 0:B.portalNode,t)||null!=t&&t.hasAttribute(Cn("focus-guard"))||A&&(Tn(A.nodesRef.current,p).find((e=>{var n,i;return me(null==(n=e.context)?void 0:n.elements.floating,t)||me(null==(i=e.context)?void 0:i.elements.domReference,t)}))||function(e,t){var n;let i=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(i=i.concat(t));}return i}(A.nodesRef.current,p).find((e=>{var n,i;return (null==(n=e.context)?void 0:n.elements.floating)===t||(null==(i=e.context)?void 0:i.elements.domReference)===t}))));if(l&&n&&he(Se(D))===Se(D).body){ee(D)&&D.focus();const e=O.current,t=M(),n=t[e]||t[t.length-1]||D;ee(n)&&n.focus();}!N&&u||!t||!n||L.current||t===Yn()||(R.current=!0,g(!1,e,"focus-out"));}));}}),[o,w,k,D,u,p,A,B,g,f,l,M,N]),i.useEffect((()=>{var e;if(o)return;const t=Array.from((null==B||null==(e=B.portalNode)?void 0:e.querySelectorAll("["+Cn("portal")+"]"))||[]);if(k){const e=[k,...t,T.current,P.current,x.current.includes("reference")||N?w:null].filter((e=>null!=e)),n=u||N?Mn(e,C,!C):Mn(e);return ()=>{n();}}}),[o,w,k,u,x,B,N,C]),rn((()=>{if(o||!ee(D))return;const e=he(Se(D));queueMicrotask((()=>{const t=z(D),n=E.current,i=("number"==typeof n?t[n]:n.current)||D,o=me(D,e);S||o||!h||Bn(i,{preventScroll:i===D});}));}),[o,h,D,S,z,E]),rn((()=>{if(o||!D)return;let e=!1;const t=Se(D),n=he(t);let i=b.current.openEvent;function r(t){let{open:n,reason:o,event:r,nested:a}=t;n&&(i=r),"escape-key"===o&&m.domReference.current&&Gn(m.domReference.current),"hover"===o&&"mouseleave"===r.type&&(R.current=!0),"outside-press"===o&&(a?(R.current=!1,e=!0):R.current=!(ve(r)||be(r)));}Gn(n),v.on("openchange",r);const a=t.createElement("span");return a.setAttribute("tabindex","-1"),a.setAttribute("aria-hidden","true"),Object.assign(a.style,$n),F&&w&&w.insertAdjacentElement("afterend",a),()=>{v.off("openchange",r);const n=he(t),o=me(k,n)||A&&Tn(A.nodesRef.current,p).some((e=>{var t;return me(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||i&&["click","mousedown"].includes(i.type))&&m.domReference.current&&Gn(m.domReference.current);const s="boolean"==typeof I.current?Yn()||a:I.current.current||a;queueMicrotask((()=>{I.current&&!R.current&&ee(s)&&(s===n||n===t.body||o)&&s.focus({preventScroll:e}),a.remove();}));}}),[o,k,D,I,b,m,v,A,p,F,w]),i.useEffect((()=>{queueMicrotask((()=>{R.current=!1;}));}),[o]),rn((()=>{if(!o&&B)return B.setFocusManagerState({modal:u,closeOnFocusOut:f,open:h,onOpenChange:g,refs:m}),()=>{B.setFocusManagerState(null);}}),[o,B,u,h,g,m,f]),rn((()=>{if(o)return;if(!D)return;if("function"!=typeof MutationObserver)return;if(S)return;const e=()=>{const e=D.getAttribute("tabindex"),t=M(),n=he(Se(k)),i=t.indexOf(n);-1!==i&&(O.current=i),x.current.includes("floating")||n!==m.domReference.current&&0===t.length?"0"!==e&&D.setAttribute("tabindex","0"):"-1"!==e&&D.setAttribute("tabindex","-1");};e();const t=new MutationObserver(e);return t.observe(D,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect();}}),[o,k,D,m,x,M,S]);const H=!o&&C&&(!u||!N)&&(F||u);return i.createElement(i.Fragment,null,H&&i.createElement(Vn,{"data-type":"inside",ref:null==B?void 0:B.beforeInsideRef,onFocus:e=>{if(u){const e=z();Bn("reference"===r[0]?e[0]:e[e.length-1]);}else if(null!=B&&B.preserveTabOrder&&B.portalNode)if(R.current=!1,Hn(e,B.portalNode)){const e=_n(document.body,"next")||w;null==e||e.focus();}else {var t;null==(t=B.beforeOutsideRef.current)||t.focus();}}}),!N&&_("start"),n,_("end"),H&&i.createElement(Vn,{"data-type":"inside",ref:null==B?void 0:B.afterInsideRef,onFocus:e=>{if(u)Bn(z()[0]);else if(null!=B&&B.preserveTabOrder&&B.portalNode)if(f&&(R.current=!0),Hn(e,B.portalNode)){const e=_n(document.body,"prev")||w;null==e||e.focus();}else {var t;null==(t=B.afterOutsideRef.current)||t.focus();}}}))}function Zn(e){return ee(e.target)&&"BUTTON"===e.target.tagName}function ei(e){return Ee(e)}const ti={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ni={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ii=e=>{var t,n;return {escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function oi(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=mn(),a=i.useRef({}),[s]=i.useState((()=>vn())),c=null!=wn();const[l,u]=i.useState(o.reference),d=Jt(((e,t,i)=>{a.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:i,nested:c}),null==n||n(e,t,i);})),f=i.useMemo((()=>({setPositionReference:u})),[]),h=i.useMemo((()=>({reference:l||o.reference||null,floating:o.floating||null,domReference:o.reference})),[l,o.reference,o.floating]);return i.useMemo((()=>({dataRef:a,open:t,onOpenChange:d,elements:h,events:s,floatingId:r,refs:f})),[t,d,h,s,r,f])}function ri(e){void 0===e&&(e={});const{nodeId:t}=e,n=oi({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[a,s]=i.useState(null),[c,l]=i.useState(null),u=(null==r?void 0:r.domReference)||a,d=i.useRef(null),f=kn();rn((()=>{u&&(d.current=u);}),[u]);const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:a,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=i.useState(o);Dt(h,o)||p(o);const[g,v]=i.useState(null),[b,y]=i.useState(null),w=i.useCallback((e=>{e!==C.current&&(C.current=e,v(e));}),[]),k=i.useCallback((e=>{e!==x.current&&(x.current=e,y(e));}),[]),S=a||g,N=s||b,C=i.useRef(null),x=i.useRef(null),E=i.useRef(d),I=null!=l,A=_t(l),B=_t(r),T=_t(u),P=i.useCallback((()=>{if(!C.current||!x.current)return;const e={placement:t,strategy:n,middleware:h};B.current&&(e.platform=B.current),Ot(C.current,x.current,e).then((e=>{const t={...e,isPositioned:!1!==T.current};R.current&&!Dt(E.current,t)&&(E.current=t,require$$0.flushSync((()=>{f(t);})));}));}),[h,t,n,B,T]);Ft((()=>{!1===u&&E.current.isPositioned&&(E.current.isPositioned=!1,f((e=>({...e,isPositioned:!1}))));}),[u]);const R=i.useRef(!1);Ft((()=>(R.current=!0,()=>{R.current=!1;})),[]),Ft((()=>{if(S&&(C.current=S),N&&(x.current=N),S&&N){if(A.current)return A.current(S,N,P);P();}}),[S,N,P,A,I]);const L=i.useMemo((()=>({reference:C,floating:x,setReference:w,setFloating:k})),[w,k]),O=i.useMemo((()=>({reference:S,floating:N})),[S,N]),F=i.useMemo((()=>{const e={position:n,left:0,top:0};if(!O.floating)return e;const t=zt(O.floating,d.x),i=zt(O.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+i+"px)",...Mt(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:i}}),[n,c,O.floating,d.x,d.y]);return i.useMemo((()=>({...d,update:P,refs:L,elements:O,floatingStyles:F})),[d,P,L,O,F])}({...e,elements:{...r,...c&&{reference:c}}}),p=i.useCallback((e=>{const t=Z(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;l(t),h.refs.setReference(t);}),[h.refs]),g=i.useCallback((e=>{(Z(e)||null===e)&&(d.current=e,s(e)),(Z(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!Z(e))&&h.refs.setReference(e);}),[h.refs]),v=i.useMemo((()=>({...h.refs,setReference:g,setPositionReference:p,domReference:d})),[h.refs,g,p]),b=i.useMemo((()=>({...h.elements,domReference:u})),[h.elements,u]),y=i.useMemo((()=>({...h,...o,refs:v,elements:b,nodeId:t})),[h,v,b,t,o]);return rn((()=>{o.dataRef.current.floatingContext=y;const e=null==f?void 0:f.nodesRef.current.find((e=>e.id===t));e&&(e.context=y);})),i.useMemo((()=>({...h,context:y,refs:v,elements:b})),[h,v,b,y])}const ai="active",si="selected";function ci(e,t,n){const i=new Map,o="item"===n;let r=e;if(o&&e){const{[ai]:t,[si]:n,...i}=e;r=i;}return {..."floating"===n&&{tabIndex:-1,[Jn]:""},...r,...t.map((t=>{const i=t?t[n]:null;return "function"==typeof i?e?i(e):null:i})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,r]=t;var a;o&&[ai,si].includes(n)||(0===n.indexOf("on")?(i.has(n)||i.set(n,[]),"function"==typeof r&&(null==(a=i.get(n))||a.push(r),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),r=0;r<t;r++)o[r]=arguments[r];return null==(e=i.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=r);})),e):e),{})}}let li=!1;function ui(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function di(e,t){return ui(t,e===Wt||e===qt,e===Kt||e===Gt)}function fi(e,t,n){return ui(t,e===qt,n?e===Kt:e===Gt)||"Enter"===e||" "===e||""===e}function hi(e,t,n){return ui(t,n?e===Gt:e===Kt,e===Wt)}function mi(e,t){const{open:n,onOpenChange:o,elements:r}=e,{listRef:a,activeIndex:s,onNavigate:c=(()=>{}),enabled:l=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:h=!1,rtl:m=!1,virtual:p=!1,focusItemOnOpen:g="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:b=!0,disabledIndices:y,orientation:w="vertical",cols:k=1,scrollItemIntoView:S=!0,virtualItemRef:N,itemSizes:C,dense:x=!1}=t;const E=xn(Wn(r.floating)),I=wn(),A=kn(),B=Jt(c),T=Ae(r.domReference),P=i.useRef(g),R=i.useRef(null!=u?u:-1),L=i.useRef(null),O=i.useRef(!0),F=i.useRef(B),D=i.useRef(!!r.floating),M=i.useRef(n),z=i.useRef(!1),_=i.useRef(!1),H=xn(y),$=xn(n),j=xn(S),V=xn(u),[U,J]=i.useState(),[W,q]=i.useState(),K=Jt((function(e,t,n){function i(e){p?(J(e.id),null==A||A.events.emit("virtualfocus",e),N&&(N.current=e)):Bn(e,{preventScroll:!0,sync:!(!pe().toLowerCase().startsWith("mac")||navigator.maxTouchPoints||!ye())&&(li||z.current)});}void 0===n&&(n=!1);const o=e.current[t.current];o&&i(o),requestAnimationFrame((()=>{const r=e.current[t.current]||o;if(!r)return;o||i(r);const a=j.current;a&&Y&&(n||!O.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof a?{block:"nearest",inline:"nearest"}:a));}));}));rn((()=>{document.createElement("div").focus({get preventScroll(){return li=!0,!1}});}),[]),rn((()=>{l&&(n&&r.floating?P.current&&null!=u&&(_.current=!0,R.current=u,B(u)):D.current&&(R.current=-1,F.current(null)));}),[l,n,r.floating,u,B]),rn((()=>{if(l&&n&&r.floating)if(null==s){if(z.current=!1,null!=V.current)return;if(D.current&&(R.current=-1,K(a,R)),(!M.current||!D.current)&&P.current&&(null!=L.current||!0===P.current&&null==L.current)){let e=0;const t=()=>{if(null==a.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t);}e++;}else R.current=null==L.current||fi(L.current,w,m)||h?Xt(a,H.current):Zt(a,H.current),L.current=null,B(R.current);};t();}}else Qt(a,s)||(R.current=s,K(a,R,_.current),_.current=!1);}),[l,n,r.floating,s,V,h,a,w,m,B,K,H]),rn((()=>{var e;if(!l||r.floating||!A||p||!D.current)return;const t=A.nodesRef.current,n=null==(e=t.find((e=>e.id===I)))||null==(e=e.context)?void 0:e.elements.floating,i=he(Se(r.floating)),o=t.some((e=>e.context&&me(e.context.elements.floating,i)));n&&!o&&O.current&&n.focus({preventScroll:!0});}),[l,r.floating,A,I,p]),rn((()=>{if(l&&A&&p&&!I)return A.events.on("virtualfocus",e),()=>{A.events.off("virtualfocus",e);};function e(e){q(e.id),N&&(N.current=e);}}),[l,A,p,I,N]),rn((()=>{F.current=B,D.current=!!r.floating;})),rn((()=>{n||(L.current=null);}),[n]),rn((()=>{M.current=n;}),[n]);const G=null!=s,Y=i.useMemo((()=>{function e(e){if(!n)return;const t=a.current.indexOf(e);-1!==t&&B(t);}return {onFocus(t){let{currentTarget:n}=t;e(n);},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...v&&{onMouseMove(t){let{currentTarget:n}=t;e(n);},onPointerLeave(e){let{pointerType:t}=e;O.current&&"touch"!==t&&(R.current=-1,K(a,R),B(null),p||Bn(E.current,{preventScroll:!0}));}}}}),[n,E,K,v,a,B,p]),Q=Jt((e=>{if(O.current=!1,z.current=!0,229===e.which)return;if(!$.current&&e.currentTarget===E.current)return;if(h&&hi(e.key,w,m))return Ie(e),o(!1,e.nativeEvent,"list-navigation"),void(ee(r.domReference)&&(p?null==A||A.events.emit("virtualfocus",r.domReference):r.domReference.focus()));const t=R.current,i=Xt(a,y),s=Zt(a,y);if(T||("Home"===e.key&&(Ie(e),R.current=i,B(R.current)),"End"===e.key&&(Ie(e),R.current=s,B(R.current))),k>1){const t=C||Array.from({length:a.current.length},(()=>({width:1,height:1}))),n=function(e,t,n){const i=[];let o=0;return e.forEach(((e,r)=>{let{width:a,height:s}=e;if(a>t&&"production"!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+r+" is greater than grid columns");let c=!1;for(n&&(o=0);!c;){const e=[];for(let n=0;n<a;n++)for(let i=0;i<s;i++)e.push(o+n+i*t);o%t+a<=t&&e.every((e=>null==i[e]))?(e.forEach((e=>{i[e]=r;})),c=!0):o++;}})),[...i]}(t,k,x),o=n.findIndex((e=>null!=e&&!on(a.current,e,y))),r=n.reduce(((e,t,n)=>null==t||on(a.current,t,y)?e:n),-1),c=n[function(e,t){let{event:n,orientation:i,loop:o,rtl:r,cols:a,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}=t,f=u;if(n.key===Wt){if(d&&Ie(n),-1===u)f=l;else if(f=en(e,{startingIndex:f,amount:a,decrement:!0,disabledIndices:s}),o&&(u-a<c||f<0)){const e=u%a,t=l%a,n=l-(t-e);f=t===e?l:t>e?n:n-a;}Qt(e,f)&&(f=u);}if(n.key===qt&&(d&&Ie(n),-1===u?f=c:(f=en(e,{startingIndex:u,amount:a,disabledIndices:s}),o&&u+a>l&&(f=en(e,{startingIndex:u%a-a,amount:a,disabledIndices:s}))),Qt(e,f)&&(f=u)),"both"===i){const t=Re(u/a);n.key===(r?Kt:Gt)&&(d&&Ie(n),u%a!=a-1?(f=en(e,{startingIndex:u,disabledIndices:s}),o&&Yt(f,a,t)&&(f=en(e,{startingIndex:u-u%a-1,disabledIndices:s}))):o&&(f=en(e,{startingIndex:u-u%a-1,disabledIndices:s})),Yt(f,a,t)&&(f=u)),n.key===(r?Gt:Kt)&&(d&&Ie(n),u%a!=0?(f=en(e,{startingIndex:u,decrement:!0,disabledIndices:s}),o&&Yt(f,a,t)&&(f=en(e,{startingIndex:u+(a-u%a),decrement:!0,disabledIndices:s}))):o&&(f=en(e,{startingIndex:u+(a-u%a),decrement:!0,disabledIndices:s})),Yt(f,a,t)&&(f=u));const i=Re(l/a)===t;Qt(e,f)&&(f=o&&i?n.key===(r?Gt:Kt)?l:en(e,{startingIndex:u-u%a-1,disabledIndices:s}):u);}return f}({current:n.map((e=>null!=e?a.current[e]:null))},{event:e,orientation:w,loop:f,rtl:m,cols:k,disabledIndices:nn([...y||a.current.map(((e,t)=>on(a.current,t)?t:void 0)),void 0],n),minIndex:o,maxIndex:r,prevIndex:tn(R.current>s?i:R.current,t,n,k,e.key===qt?"bl":e.key===(m?Kt:Gt)?"tr":"tl"),stopEvent:!0})];if(null!=c&&(R.current=c,B(R.current)),"both"===w)return}if(di(e.key,w)){if(Ie(e),n&&!p&&he(e.currentTarget.ownerDocument)===e.currentTarget)return R.current=fi(e.key,w,m)?i:s,void B(R.current);fi(e.key,w,m)?R.current=f?t>=s?d&&t!==a.current.length?-1:i:en(a,{startingIndex:t,disabledIndices:y}):Math.min(s,en(a,{startingIndex:t,disabledIndices:y})):R.current=f?t<=i?d&&-1!==t?a.current.length:s:en(a,{startingIndex:t,decrement:!0,disabledIndices:y}):Math.max(i,en(a,{startingIndex:t,decrement:!0,disabledIndices:y})),Qt(a,R.current)?B(null):B(R.current);}})),X=i.useMemo((()=>p&&n&&G&&{"aria-activedescendant":W||U}),[p,n,G,W,U]),Z=i.useMemo((()=>({"aria-orientation":"both"===w?void 0:w,...!Ae(r.domReference)&&X,onKeyDown:Q,onPointerMove(){O.current=!0;}})),[X,Q,r.domReference,w]),te=i.useMemo((()=>{function e(e){"auto"===g&&ve(e.nativeEvent)&&(P.current=!0);}return {...X,onKeyDown(e){O.current=!1;const t=e.key.startsWith("Arrow"),i=["Home","End"].includes(e.key),r=t||i,s=function(e,t,n){return ui(t,n?e===Kt:e===Gt,e===qt)}(e.key,w,m),c=hi(e.key,w,m),l=di(e.key,w),d=(h?s:l)||"Enter"===e.key||""===e.key.trim();if(p&&n){const t=null==A?void 0:A.nodesRef.current.find((e=>null==e.parentId)),n=A&&t?function(e,t){let n,i=-1;return function t(o,r){r>i&&(n=o,i=r),Tn(e,o).forEach((e=>{t(e.id,r+1);}));}(t,0),e.find((e=>e.id===n))}(A.nodesRef.current,t.id):null;if(r&&n&&N){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(s||c){var f,g;const i=(null==(f=n.context)?void 0:f.elements.domReference)===e.currentTarget,o=c&&!i?null==(g=n.context)?void 0:g.elements.domReference:s?a.current.find((e=>(null==e?void 0:e.id)===U)):null;o&&(Ie(e),o.dispatchEvent(t),q(void 0));}var v;if((l||i)&&n.context)if(n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return Ie(e),void(null==(v=n.context.elements.domReference)||v.dispatchEvent(t))}return Q(e)}(n||b||!t)&&(d&&(L.current=h&&l?null:e.key),h?s&&(Ie(e),n?(R.current=Xt(a,H.current),B(R.current)):o(!0,e.nativeEvent,"list-navigation")):l&&(null!=u&&(R.current=u),Ie(e),!n&&b?o(!0,e.nativeEvent,"list-navigation"):Q(e),n&&B(R.current)));},onFocus(){n&&!p&&B(null);},onPointerDown:function(e){P.current=g,"auto"===g&&be(e.nativeEvent)&&(P.current=!0);},onMouseDown:e,onClick:e}}),[U,X,Q,H,g,a,h,B,o,n,b,w,m,u,A,p,N]);return i.useMemo((()=>l?{reference:te,floating:Z,item:Y}:{}),[l,te,Z,Y])}const pi=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function gi(e,t){const[n,i]=e;let o=!1;const r=t.length;for(let e=0,a=r-1;e<r;a=e++){const[r,s]=t[e]||[0,0],[c,l]=t[a]||[0,0];s>=i!=l>=i&&n<=(c-r)*(i-s)/(l-s)+r&&(o=!o);}return o}function vi(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:i=!0}=e;let o,r=!1,a=null,s=null,c=performance.now();const l=e=>{let{x:n,y:l,placement:u,elements:d,onClose:f,nodeId:h,tree:m}=e;return function(e){function p(){clearTimeout(o),f();}if(clearTimeout(o),!d.domReference||!d.floating||null==u||null==n||null==l)return;const{clientX:g,clientY:v}=e,b=[g,v],y=Ce(e),w="mouseleave"===e.type,k=me(d.floating,y),S=me(d.domReference,y),N=d.domReference.getBoundingClientRect(),C=d.floating.getBoundingClientRect(),x=u.split("-")[0],E=n>C.right-C.width/2,I=l>C.bottom-C.height/2,A=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(b,N),B=C.width>N.width,T=C.height>N.height,P=(B?N:C).left,R=(B?N:C).right,L=(T?N:C).top,O=(T?N:C).bottom;if(k&&(r=!0,!w))return;if(S&&(r=!1),S&&!w)return void(r=!0);if(w&&Z(e.relatedTarget)&&me(d.floating,e.relatedTarget))return;if(m&&Tn(m.nodesRef.current,h).some((e=>{let{context:t}=e;return null==t?void 0:t.open})))return;if("top"===x&&l>=N.bottom-1||"bottom"===x&&l<=N.top+1||"left"===x&&n>=N.right-1||"right"===x&&n<=N.left+1)return p();let F=[];switch(x){case"top":F=[[P,N.top+1],[P,C.bottom-1],[R,C.bottom-1],[R,N.top+1]];break;case"bottom":F=[[P,C.top+1],[P,N.bottom-1],[R,N.bottom-1],[R,C.top+1]];break;case"left":F=[[C.right-1,O],[C.right-1,L],[N.left+1,L],[N.left+1,O]];break;case"right":F=[[N.right-1,O],[N.right-1,L],[C.left+1,L],[C.left+1,O]];}if(!gi([g,v],F)){if(r&&!A)return p();if(!w&&i){const t=function(e,t){const n=performance.now(),i=n-c;if(null===a||null===s||0===i)return a=e,s=t,c=n,null;const o=e-a,r=t-s,l=Math.sqrt(o*o+r*r);return a=e,s=t,c=n,l/i}(e.clientX,e.clientY);if(null!==t&&t<.1)return p()}gi([g,v],function(e){let[n,i]=e;switch(x){case"top":return [[B?n+t/2:E?n+4*t:n-4*t,i+t+1],[B?n-t/2:E?n+4*t:n-4*t,i+t+1],...[[C.left,E||B?C.bottom-t:C.top],[C.right,E?B?C.bottom-t:C.top:C.bottom-t]]];case"bottom":return [[B?n+t/2:E?n+4*t:n-4*t,i-t],[B?n-t/2:E?n+4*t:n-4*t,i-t],...[[C.left,E||B?C.top+t:C.bottom],[C.right,E?B?C.top+t:C.bottom:C.top+t]]];case"left":{const e=[n+t+1,T?i+t/2:I?i+4*t:i-4*t],o=[n+t+1,T?i-t/2:I?i+4*t:i-4*t];return [...[[I||T?C.right-t:C.left,C.top],[I?T?C.right-t:C.left:C.right-t,C.bottom]],e,o]}case"right":return [[n-t,T?i+t/2:I?i+4*t:i-4*t],[n-t,T?i-t/2:I?i+4*t:i-4*t],...[[I||T?C.left+t:C.right,C.top],[I?T?C.left+t:C.right:C.left+t,C.bottom]]]}}([n,l]))?!r&&i&&(o=window.setTimeout(p,40)):p();}}};return l.__options={blockPointerEvents:n},l}const bi=createContext({getItemProps:()=>({}),activeIndex:null,setActiveIndex:()=>{},setHasFocusInside:()=>{},isOpen:!1}),yi=forwardRef((({className:t,disabled:n,children:i,...o},r)=>{const a=useContext(bi),c=ln(),l=kn(),u=c.index===a.activeIndex,d=w("io-dropdown-menu-item",n&&"io-dropdown-menu-item-disabled",t);return jsxRuntimeExports.jsx("div",{ref:jt([c.ref,r]),role:"menuitem",className:d,tabIndex:u?0:-1,...a.getItemProps({onClick(e){o.onClick?.(e),l?.events.emit("click");},onFocus(e){o.onFocus?.(e),a.setHasFocusInside(!0);}}),...o,children:i})}));yi.displayName="DropdownMenuItem";const wi=forwardRef((({className:n,variant:o="default",icon:r,iconRight:a,text:f="",disabled:h,children:m,...p},g)=>{const[v,b]=useState(!1),[y,k]=useState(!1),[S,N]=useState(null),C=useRef([]),x=useRef([]),E=useContext(bi),I=kn(),B=function(e){const t=mn(),n=kn(),i=wn();return rn((()=>{const e={id:t,parentId:i};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e);}}),[n,t,i]),t}(),T=wn(),P=ln(),R=null!=T,{floatingStyles:L,refs:O,context:F}=ri({nodeId:B,open:v,onOpenChange:b,placement:R?"right-start":"bottom-start",middleware:[(D={mainAxis:R?0:4,alignmentAxis:R?-4:0},{...Pt(D),options:[D,M]}),$t(),Ht()],whileElementsMounted:Tt});var D,M;const z=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:a,elements:s}=e,{enabled:c=!0,delay:l=0,handleClose:u=null,mouseOnly:d=!1,restMs:f=0,move:h=!0}=t,m=kn(),p=wn(),g=xn(u),v=xn(l),b=xn(n),y=i.useRef(),w=i.useRef(-1),k=i.useRef(),S=i.useRef(-1),N=i.useRef(!0),C=i.useRef(!1),x=i.useRef((()=>{})),E=i.useRef(!1),I=i.useCallback((()=>{var e;const t=null==(e=r.current.openEvent)?void 0:e.type;return (null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[r]);i.useEffect((()=>{if(c)return a.on("openchange",e),()=>{a.off("openchange",e);};function e(e){let{open:t}=e;t||(clearTimeout(w.current),clearTimeout(S.current),N.current=!0,E.current=!1);}}),[c,a]),i.useEffect((()=>{if(!c)return;if(!g.current)return;if(!n)return;function e(e){I()&&o(!1,e,"hover");}const t=Se(s.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e);}}),[s.floating,n,o,c,g,I]);const A=i.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const i=In(v.current,"close",y.current);i&&!k.current?(clearTimeout(w.current),w.current=window.setTimeout((()=>o(!1,e,n)),i)):t&&(clearTimeout(w.current),o(!1,e,n));}),[v,o]),B=Jt((()=>{x.current(),k.current=void 0;})),T=Jt((()=>{if(C.current){const e=Se(s.floating).body;e.style.pointerEvents="",e.removeAttribute(En),C.current=!1;}})),P=Jt((()=>!!r.current.openEvent&&["click","mousedown"].includes(r.current.openEvent.type)));i.useEffect((()=>{if(c&&Z(s.domReference)){var e;const o=s.domReference;return n&&o.addEventListener("mouseleave",a),null==(e=s.floating)||e.addEventListener("mouseleave",a),h&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",i),()=>{var e;n&&o.removeEventListener("mouseleave",a),null==(e=s.floating)||e.removeEventListener("mouseleave",a),h&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",i);}}function t(e){if(clearTimeout(w.current),N.current=!1,d&&!ke(y.current)||f>0&&!In(v.current,"open"))return;const t=In(v.current,"open",y.current);t?w.current=window.setTimeout((()=>{b.current||o(!0,e,"hover");}),t):n||o(!0,e,"hover");}function i(e){if(P())return;x.current();const t=Se(s.floating);if(clearTimeout(S.current),E.current=!1,g.current&&r.current.floatingContext){n||clearTimeout(w.current),k.current=g.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){T(),B(),P()||A(e,!0,"safe-polygon");}});const i=k.current;return t.addEventListener("mousemove",i),void(x.current=()=>{t.removeEventListener("mousemove",i);})}("touch"!==y.current||!me(s.floating,e.relatedTarget))&&A(e);}function a(e){P()||r.current.floatingContext&&(null==g.current||g.current({...r.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){T(),B(),P()||A(e);}})(e));}}),[s,c,e,d,f,h,A,B,T,o,n,b,m,v,g,r,P]),rn((()=>{var e;if(c&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&I()){C.current=!0;const e=s.floating;if(Z(s.domReference)&&e){var t;const n=Se(s.floating).body;n.setAttribute(En,"");const i=s.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===p)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",i.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",i.style.pointerEvents="",e.style.pointerEvents="";}}}}),[c,n,p,s,m,g,I]),rn((()=>{n||(y.current=void 0,E.current=!1,B(),T());}),[n,B,T]),i.useEffect((()=>()=>{B(),clearTimeout(w.current),clearTimeout(S.current),T();}),[c,s.domReference,B,T]);const R=i.useMemo((()=>{function e(e){y.current=e.pointerType;}return {onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function i(){N.current||b.current||o(!0,t,"hover");}d&&!ke(y.current)||n||0===f||E.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(S.current),"touch"===y.current?i():(E.current=!0,S.current=window.setTimeout(i,f)));}}}),[d,o,n,b,f]),L=i.useMemo((()=>({onMouseEnter(){clearTimeout(w.current);},onMouseLeave(e){P()||A(e.nativeEvent,!1);}})),[A,P]);return i.useMemo((()=>c?{reference:R,floating:L}:{}),[c,R,L])}(F,{enabled:R,delay:{open:75},handleClose:vi({blockPointerEvents:!0})}),_=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,dataRef:r,elements:{domReference:a}}=e,{enabled:s=!0,event:c="click",toggle:l=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:f=!0}=t,h=i.useRef(),m=i.useRef(!1),p=i.useMemo((()=>({onPointerDown(e){h.current=e.pointerType;},onMouseDown(e){const t=h.current;0===e.button&&"click"!==c&&(ke(t,!0)&&u||(!n||!l||r.current.openEvent&&f&&"mousedown"!==r.current.openEvent.type?(e.preventDefault(),o(!0,e.nativeEvent,"click")):o(!1,e.nativeEvent,"click")));},onClick(e){const t=h.current;"mousedown"===c&&h.current?h.current=void 0:ke(t,!0)&&u||(!n||!l||r.current.openEvent&&f&&"click"!==r.current.openEvent.type?o(!0,e.nativeEvent,"click"):o(!1,e.nativeEvent,"click"));},onKeyDown(e){h.current=void 0,e.defaultPrevented||!d||Zn(e)||(" "!==e.key||ei(a)||(e.preventDefault(),m.current=!0),"Enter"===e.key&&o(!n||!l,e.nativeEvent,"click"));},onKeyUp(e){e.defaultPrevented||!d||Zn(e)||ei(a)||" "===e.key&&m.current&&(m.current=!1,o(!n||!l,e.nativeEvent,"click"));}})),[r,a,c,u,d,o,n,f,l]);return i.useMemo((()=>s?{reference:p}:{}),[s,p])}(F,{event:"mousedown",toggle:!R,ignoreMouse:R}),H=function(e,t){var n;void 0===t&&(t={});const{open:o,floatingId:r}=e,{enabled:a=!0,role:s="dialog"}=t,c=null!=(n=pi.get(s))?n:s,l=mn(),u=null!=wn(),d=i.useMemo((()=>"tooltip"===c||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:o?r:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":o?r:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:l},..."menu"===c&&u&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}}),[c,r,u,o,l,s]),f=i.useMemo((()=>{const e={id:r,...c&&{role:c}};return "tooltip"===c||"label"===s?e:{...e,..."menu"===c&&{"aria-labelledby":l}}}),[c,r,l,s]),h=i.useCallback((e=>{let{active:t,selected:n}=e;const i={role:"option",...t&&{id:r+"-option"}};switch(s){case"select":return {...i,"aria-selected":t&&n};case"combobox":return {...i,...t&&{"aria-selected":!0}}}return {}}),[r,s]);return i.useMemo((()=>a?{reference:d,floating:f,item:h}:{}),[a,d,f,h])}(F,{role:"menu"}),$=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:a}=e,{enabled:s=!0,escapeKey:c=!0,outsidePress:l=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:m,capture:p}=t,g=kn(),v=Jt("function"==typeof l?l:()=>!1),b="function"==typeof l?v:l,y=i.useRef(!1),w=i.useRef(!1),{escapeKey:k,outsidePress:S}=ii(m),{escapeKey:N,outsidePress:C}=ii(p),x=i.useRef(!1),E=Jt((e=>{var t;if(!n||!s||!c||"Escape"!==e.key)return;if(x.current)return;const i=null==(t=a.current.floatingContext)?void 0:t.nodeId,r=g?Tn(g.nodesRef.current,i):[];if(!k&&(e.stopPropagation(),r.length>0)){let e=!0;if(r.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1);})),!e)return}o(!1,function(e){return "nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key");})),I=Jt((e=>{var t;const n=()=>{var t;E(e),null==(t=Ce(e))||t.removeEventListener("keydown",n);};null==(t=Ce(e))||t.addEventListener("keydown",n);})),A=Jt((e=>{var t;const n=y.current;y.current=!1;const i=w.current;if(w.current=!1,"click"===u&&i)return;if(n)return;if("function"==typeof b&&!b(e))return;const s=Ce(e),c="["+Cn("inert")+"]",l=Se(r.floating).querySelectorAll(c);let d=Z(s)?s:null;for(;d&&!se(d);){const e=ue(d);if(se(e)||!Z(e))break;d=e;}if(l.length&&Z(s)&&!s.matches("html,body")&&!me(s,r.floating)&&Array.from(l).every((e=>!me(d,e))))return;if(ee(s)&&P){const t=s.clientWidth>0&&s.scrollWidth>s.clientWidth,n=s.clientHeight>0&&s.scrollHeight>s.clientHeight;let i=n&&e.offsetX>s.clientWidth;if(n&&"rtl"===ce(s).direction&&(i=e.offsetX<=s.offsetWidth-s.clientWidth),i||t&&e.offsetY>s.clientHeight)return}const f=null==(t=a.current.floatingContext)?void 0:t.nodeId,h=g&&Tn(g.nodesRef.current,f).some((t=>{var n;return Ne(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Ne(e,r.floating)||Ne(e,r.domReference)||h)return;const m=g?Tn(g.nodesRef.current,f):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1);})),!e)return}o(!1,e,"outside-press");})),B=Jt((e=>{var t;const n=()=>{var t;A(e),null==(t=Ce(e))||t.removeEventListener(u,n);};null==(t=Ce(e))||t.addEventListener(u,n);}));i.useEffect((()=>{if(!n||!s)return;a.current.__escapeKeyBubbles=k,a.current.__outsidePressBubbles=S;let e=-1;function t(e){o(!1,e,"ancestor-scroll");}function i(){window.clearTimeout(e),x.current=!0;}function l(){e=window.setTimeout((()=>{x.current=!1;}),ae()?5:0);}const d=Se(r.floating);c&&(d.addEventListener("keydown",N?I:E,N),d.addEventListener("compositionstart",i),d.addEventListener("compositionend",l)),b&&d.addEventListener(u,C?B:A,C);let f=[];return h&&(Z(r.domReference)&&(f=fe(r.domReference)),Z(r.floating)&&(f=f.concat(fe(r.floating))),!Z(r.reference)&&r.reference&&r.reference.contextElement&&(f=f.concat(fe(r.reference.contextElement)))),f=f.filter((e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)})),f.forEach((e=>{e.addEventListener("scroll",t,{passive:!0});})),()=>{c&&(d.removeEventListener("keydown",N?I:E,N),d.removeEventListener("compositionstart",i),d.removeEventListener("compositionend",l)),b&&d.removeEventListener(u,C?B:A,C),f.forEach((e=>{e.removeEventListener("scroll",t);})),window.clearTimeout(e);}}),[a,r,c,b,u,n,o,h,s,k,S,E,N,I,A,C,B]),i.useEffect((()=>{y.current=!1;}),[b,u]);const T=i.useMemo((()=>({onKeyDown:E,[ti[f]]:e=>{d&&o(!1,e.nativeEvent,"reference-press");}})),[E,o,d,f]),P=i.useMemo((()=>({onKeyDown:E,onMouseDown(){w.current=!0;},onMouseUp(){w.current=!0;},[ni[u]]:()=>{y.current=!0;}})),[E,u]);return i.useMemo((()=>s?{reference:T,floating:P}:{}),[s,T,P])}(F,{bubbles:!0}),j=mi(F,{listRef:C,activeIndex:S,nested:R,onNavigate:N}),{getReferenceProps:V,getFloatingProps:U,getItemProps:J}=function(e){void 0===e&&(e=[]);const t=e.map((e=>null==e?void 0:e.reference)),n=e.map((e=>null==e?void 0:e.floating)),o=e.map((e=>null==e?void 0:e.item)),r=i.useCallback((t=>ci(t,e,"reference")),t),a=i.useCallback((t=>ci(t,e,"floating")),n),s=i.useCallback((t=>ci(t,e,"item")),o);return i.useMemo((()=>({getReferenceProps:r,getFloatingProps:a,getItemProps:s})),[r,a,s])}([z,_,H,$,j]);useEffect((()=>{if(I)return I.events.on("click",e),I.events.on("menuopen",t),()=>{I.events.off("click",e),I.events.off("menuopen",t);};function e(){b(!1);}function t(e){e.nodeId!==B&&e.parentId===T&&b(!1);}}),[I,B,T]),useEffect((()=>{v&&I&&I.events.emit("menuopen",{parentId:T,nodeId:B});}),[I,v,B,T]);const W={activeIndex:S,setActiveIndex:N,getItemProps:J,setHasFocusInside:k,isOpen:v},q=useMemo((()=>W),[S,N,J,k,v]),K=w("io-dropdown-menu-button",R&&"io-dropdown-menu-item",v&&!R&&"active",n),G=jt([O.setReference,P.ref,g]),Y=E.activeIndex===P.index?0:-1;return jsxRuntimeExports.jsxs(Sn,{id:B,children:[jsxRuntimeExports.jsx(A,{className:K,ref:G,variant:R?"link":o,tabIndex:R?Y:void 0,role:R?"menuitem":void 0,"data-open":v?"":void 0,"data-nested":R?"":void 0,"data-focus-inside":y?"":void 0,text:f,icon:R?"chevron-right":r,iconSize:"10",iconRight:!!R||a,disabled:h,...V(E.getItemProps({onFocus(e){p.onFocus?.(e),k(!1),E.setHasFocusInside(!0);},...p}))}),jsxRuntimeExports.jsx(bi.Provider,{value:q,children:jsxRuntimeExports.jsx(cn,{elementsRef:C,labelsRef:x,children:v&&jsxRuntimeExports.jsx(Xn,{context:F,modal:!1,initialFocus:R?-1:0,returnFocus:!R,children:jsxRuntimeExports.jsx("div",{ref:O.setFloating,className:"io-dropdown-menu",style:L,...U(),children:m})})})})]})}));function ki({className:t,...n}){const i=w("io-separator",t);return jsxRuntimeExports.jsx("hr",{className:i,...n})}wi.displayName="DropdownMenu";const Si=forwardRef((({...t},n)=>null===wn()?jsxRuntimeExports.jsx(Nn,{children:jsxRuntimeExports.jsx(wi,{ref:n,...t})}):jsxRuntimeExports.jsx(wi,{ref:n,...t})));function Ci({className:n,size:i="large",variant:o="default",align:r="up",text:a,...s}){const c=w("io-loader",{[`io-loader-${o}`]:"default"!==o},"normal"===i&&"io-loader-md","small"===i&&"io-loader-sm",r&&[`direction-${r}`],n);return jsxRuntimeExports.jsxs("div",{className:c,...s,children:[jsxRuntimeExports.jsx("div",{className:"io-loader-icon"}),a&&jsxRuntimeExports.jsx("div",{className:"io-loader-text",children:a})]})}function xi({className:t,children:n,...i}){const o=w("io-panel-header",t);return jsxRuntimeExports.jsx(j,{className:o,...i,children:n})}Si.displayName="DropdownMenu",Si.Item=yi,Si.Separator=ki,xi.Title=E,xi.ButtonGroup=$,xi.Button=A,xi.ButtonIcon=S,xi.Dropdown=H;const Ei=forwardRef((({className:t,children:n,...i},o)=>{const r=w("io-panel-body",t);return jsxRuntimeExports.jsx("div",{className:r,ref:o,...i,children:n})}));function Ii({className:t,...n}){const i=w("io-panel-footer",t);return jsxRuntimeExports.jsx(J,{className:i,...n})}function Ai({className:t,children:n,...i}){const o=w("io-panel",t);return jsxRuntimeExports.jsx("div",{className:o,...i,children:n})}function Pi({className:t,variant:n="active",value:i=0,...o}){const r=w("io-progress",n,t);return jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsx("div",{className:"io-progress-bar",style:{width:`${i<0?0:i>100?100:i}%`}})})}function Ri({text:t="Label",...n}){return jsxRuntimeExports.jsx("label",{...n,children:t})}Ei.displayName="PanelBody",Ii.ButtonGroup=$,Ii.Button=A,Ii.ButtonIcon=S,Ii.Dropdown=H,Ai.Header=xi,Ai.Body=Ei,Ai.Footer=Ii;const Li=forwardRef((({id:n="input",className:i,type:o="text",name:a="input",align:s="up",label:c,iconPrepend:l,iconPrependOnClick:u,iconAppend:d,iconAppendOnClick:f,placeholder:h,disabled:m,readOnly:p,errorMessage:g,...v},b)=>{const y=w("io-control-input",l&&"io-control-leading-icon",d&&"io-control-trailing-icon",m&&"io-control-disabled",p&&"io-control-readonly",g&&"io-control-error",s&&[`direction-${s}`],i),S=useCallback((e=>{m?e.preventDefault():u&&u(e);}),[u,m]),N=useCallback((e=>{m?e.preventDefault():f&&f(e);}),[f,m]);return jsxRuntimeExports.jsxs("div",{className:y,children:[c&&jsxRuntimeExports.jsx(Ri,{htmlFor:n,text:c}),l&&jsxRuntimeExports.jsx(k,{variant:l,onClick:e=>S(e)}),jsxRuntimeExports.jsx("input",{id:n,className:"io-input",ref:b,type:o,name:a,tabIndex:0,placeholder:h??(()=>{switch(o){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..."}})(),disabled:m,readOnly:p,...v}),d&&jsxRuntimeExports.jsx(k,{variant:d,onClick:e=>N(e)}),g&&jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(k,{variant:"close"}),g]})]})}));Li.displayName="Input";const Oi=forwardRef((({id:n="textarea",className:i,name:o="textarea",align:r="up",label:a,rows:s=4,placeholder:c="Enter text here...",disabled:l,readOnly:u,...d},f)=>{const h=w("io-control-textarea",l&&"io-control-disabled",u&&"io-control-readonly",r&&[`direction-${r}`],i);return jsxRuntimeExports.jsxs("div",{className:h,children:[a&&jsxRuntimeExports.jsx(Ri,{htmlFor:n,text:a}),jsxRuntimeExports.jsx("textarea",{id:n,className:"io-textarea",ref:f,name:o,tabIndex:0,placeholder:c,disabled:l,readOnly:u,rows:s,...d})]})}));Oi.displayName="Textarea";const Fi=forwardRef((({id:n="checkbox",className:i,name:o="checkbox",align:r="left",label:a,checked:s,disabled:c,...l},u)=>{const d=w("io-control-checkbox",s&&"io-control-checked",c&&"io-control-disabled",r&&[`direction-${r}`],i);return jsxRuntimeExports.jsxs("div",{className:d,children:[jsxRuntimeExports.jsx("input",{type:"checkbox",id:n,className:"io-checkbox",ref:u,name:o,tabIndex:0,checked:s,disabled:c,...l}),a&&jsxRuntimeExports.jsx(Ri,{htmlFor:n,text:a})]})}));Fi.displayName="Checkbox";const Di=forwardRef((({id:n="radio",className:i,name:o="radio",align:r="left",label:a,checked:s,disabled:c,...l},u)=>{const d=w("io-control-radio",s&&"io-control-checked",c&&"io-control-disabled",r&&[`direction-${r}`],i);return jsxRuntimeExports.jsxs("div",{className:d,children:[jsxRuntimeExports.jsx("input",{type:"radio",id:n,className:"io-radio",ref:u,name:o,tabIndex:0,checked:s,disabled:c,...l}),a&&jsxRuntimeExports.jsx(Ri,{htmlFor:n,text:a})]})}));Di.displayName="Radio";const Mi=forwardRef((({id:n="toggle",className:i,name:o="toggle",align:r="left",label:a="Toggle",checked:s,disabled:c,...l},u)=>{const d=w("io-control-toggle",s&&"io-control-checked",c&&"io-control-disabled",r&&[`direction-${r}`],i);return jsxRuntimeExports.jsx("div",{className:d,children:jsxRuntimeExports.jsxs("label",{className:"io-toggle",children:[jsxRuntimeExports.jsx("input",{type:"checkbox",id:n,className:"io-checkbox",ref:u,name:o,checked:s,disabled:c,...l}),jsxRuntimeExports.jsx("span",{className:"slider"}),a]})})}));function _i(e,t){const n=useCallback((n=>{t.some((e=>n.key===e))&&(n.preventDefault(),e());}),[e,t]);useEffect((()=>(document.addEventListener("keydown",n),()=>{document.removeEventListener("keydown",n);})),[n]);}Mi.displayName="Toggle";const Hi=e=>"string"==typeof e?e:e?.message?"string"==typeof e.message?e.message:JSON.stringify(e.message):JSON.stringify(e);function $i({app:e,prefKey:t,decoder:n}){const i=useContext(IOConnectContext),[o,a]=useState(),[l,f]=useState(!0),[h,m]=useState(),p=useRef(0),v=useCallback((e=>{if(null==e)return;return n.runWithException(e)}),[n]),b=useCallback((async()=>{if(!i)return;const n=await i.prefs.get(e);try{return v(n?.data[t])}catch(e){throw new Error(`The stored value for prefKey "${t}" is of an incorrect shape: ${Hi(e)}`)}}),[e,i,t,v]),y=useCallback((async n=>{if(!i)return;const o=++p.current;f(!0),m(void 0);const r=e=>{o===p.current&&(f(!1),e&&(console.error(e),m({message:Hi(e)})));};let a,s;if(n instanceof Function)try{a=n(await b());}catch(e){return r(e)}else a=n;try{s=v(a);}catch(e){return r(`The provided value for prefKey "${t}" is of an incorrect shape: ${Hi(e)}`)}try{await i.prefs.updateFor(e,{[t]:s});}catch(e){return r(e)}r();}),[e,b,i,t,v]);return useEffect((()=>{if(!i)return;let n=!0;const o=i.prefs.subscribeFor(e,(e=>{try{const n=v(e.data[t]);a(n),m(void 0);}catch(e){const n=`The stored value for prefKey "${t}" is of an incorrect shape: ${Hi(e)}`;console.error(n),m({message:n});}n&&(n=!1,f(!1));}));return o}),[e,t,i,v]),{error:h,isLoading:l,value:o,update:y}}function Ui(e,t=500){const[n,i]=useState(e);return useEffect((()=>{const n=setTimeout((()=>{i(e);}),t);return ()=>clearTimeout(n)}),[e,t]),n}createContext({theme:"dark"});function Yi(e,t,n){return Math.min(Math.max(e,n),t)}class Qi extends Error{constructor(e){super(`Failed to parse color: "${e}"`);}}var Xi=Qi;function Zi(e){if("string"!=typeof e)throw new Xi(e);if("transparent"===e.trim().toLowerCase())return [0,0,0,0];let t=e.trim();t=so.test(e)?function(e){const t=e.toLowerCase().trim(),n=to[function(e){let t=5381,n=e.length;for(;n;)t=33*t^e.charCodeAt(--n);return (t>>>0)%2341}(t)];if(!n)throw new Xi(e);return `#${n}`}(e):e;const n=io.exec(t);if(n){const e=Array.from(n).slice(1);return [...e.slice(0,3).map((e=>parseInt(no(e,2),16))),parseInt(no(e[3]||"f",2),16)/255]}const i=oo.exec(t);if(i){const e=Array.from(i).slice(1);return [...e.slice(0,3).map((e=>parseInt(e,16))),parseInt(e[3]||"ff",16)/255]}const o=ro.exec(t);if(o){const e=Array.from(o).slice(1);return [...e.slice(0,3).map((e=>parseInt(e,10))),parseFloat(e[3]||"1")]}const r=ao.exec(t);if(r){const[t,n,i,o]=Array.from(r).slice(1).map(parseFloat);if(Yi(0,100,n)!==n)throw new Xi(e);if(Yi(0,100,i)!==i)throw new Xi(e);return [...lo(t,n,i),Number.isNaN(o)?1:o]}throw new Xi(e)}const eo=e=>parseInt(e.replace(/_/g,""),36),to="1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce(((e,t)=>{const n=eo(t.substring(0,3)),i=eo(t.substring(3)).toString(16);let o="";for(let e=0;e<6-i.length;e++)o+="0";return e[n]=`${o}${i}`,e}),{});const no=(e,t)=>Array.from(Array(t)).map((()=>e)).join(""),io=new RegExp(`^#${no("([a-f0-9])",3)}([a-f0-9])?$`,"i"),oo=new RegExp(`^#${no("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),ro=new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${no(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),ao=/^hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%(?:\s*,\s*([\d.]+))?\s*\)$/i,so=/^[a-z]+$/i,co=e=>Math.round(255*e),lo=(e,t,n)=>{let i=n/100;if(0===t)return [i,i,i].map(co);const o=(e%360+360)%360/60,r=(1-Math.abs(2*i-1))*(t/100),a=r*(1-Math.abs(o%2-1));let s=0,c=0,l=0;o>=0&&o<1?(s=r,c=a):o>=1&&o<2?(s=a,c=r):o>=2&&o<3?(c=r,l=a):o>=3&&o<4?(c=a,l=r):o>=4&&o<5?(s=a,l=r):o>=5&&o<6&&(s=r,l=a);const u=i-r/2;return [s+u,c+u,l+u].map(co)};function uo(e){return function(e){if("transparent"===e)return 0;function t(e){const t=e/255;return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}const[n,i,o]=Zi(e);return .2126*t(n)+.7152*t(i)+.0722*t(o)}(e)>.179}function fo({className:t,channel:n,...i}){const o=w("io-channel-badge",t);return jsxRuntimeExports.jsx("div",{className:o,style:{color:(r=n.color,uo(r)?"#000":"#fff"),backgroundColor:n.color},...i,children:jsxRuntimeExports.jsx("span",{className:"io-channel-badge-label",children:n.label})});var r;}function ho(){return jsxRuntimeExports.jsx(k,{variant:"check"})}function mo({channel:i,handleChannelRestricted:o,restricted:r}){return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{children:i.isSelected&&jsxRuntimeExports.jsx("span",{children:"Active"})}),jsxRuntimeExports.jsx("div",{role:"button",onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||e.stopPropagation();},tabIndex:0,children:jsxRuntimeExports.jsx(Mi,{label:"Publish",checked:i.write,onChange:()=>{o({...i,write:!i.write});},disabled:r?.write})}),jsxRuntimeExports.jsx("div",{role:"button",onClick:e=>e.stopPropagation(),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||e.stopPropagation();},tabIndex:0,children:jsxRuntimeExports.jsx(Mi,{label:"Subscribe",checked:i.read,onChange:()=>{o({...i,read:!i.read});},disabled:r?.read})})]})}const po=createContext({});function go({channel:t,isSelected:n,onChannelSelect:i,onChannelRestrict:o,...a}){const{variant:c,selectedChannels:l,restrictedChannels:u}=useContext(po),d=n||t.isSelected||l?.includes(t),f=u?.find((e=>e.name===t.name)),h=useCallback((()=>i?.({...t,isSelected:!d})),[t,i,d]),m=useCallback((e=>{o&&o(e);}),[o]);return jsxRuntimeExports.jsx(R,{prepend:jsxRuntimeExports.jsx(fo,{channel:t}),append:"single"===c||"multi"===c?d&&jsxRuntimeExports.jsx(ho,{}):jsxRuntimeExports.jsx(mo,{channel:t,handleChannelRestricted:m,restricted:f}),isSelected:d,onClick:h,...a,children:t.name},t.name)}const vo=forwardRef((({className:n,variant:i="single",variantToggle:o=!1,channels:r=[],restrictedChannels:a=[],onVariantChange:s,onChannelSelect:c,onChannelRestrict:u,...d},f)=>{const h=w("io-list-channels","directionalSingle"===i&&"io-bi-direction",n),m=r.filter((e=>e.isSelected)),p=useMemo((()=>({variant:i,selectedChannels:m,restrictedChannels:a,onVariantChange:s,onChannelSelect:c,onChannelRestrict:u})),[i,m,a,s,c,u]);let g="Select Channel";return "multi"===i?g="Select Channels":"directionalSingle"===i&&(g="Select Directional Channel"),jsxRuntimeExports.jsx(po.Provider,{value:p,children:jsxRuntimeExports.jsx("div",{className:h,ref:f,children:jsxRuntimeExports.jsxs(z,{variant:"single",...d,children:[jsxRuntimeExports.jsx(z.ItemTitle,{append:o&&jsxRuntimeExports.jsx(Mi,{label:"Directional",align:"right",onChange:e=>s&&s(e.target.checked),checked:"directionalSingle"===i}),children:g}),r?.map((t=>jsxRuntimeExports.jsx(go,{channel:t,onChannelSelect:c,onChannelRestrict:u},t.name)))]})})})}));vo.displayName="ChannelSelector";var bo=Object.freeze({__proto__:null,Channel:go,ChannelBadge:fo,ChannelDirectionalAppend:mo,ChannelSelector:vo,ChannelSingleAppend:ho,useIOCDChannels:function(e){const t="T42.ChannelSelector.Execute",n=useContext(IOConnectContext),[i,o]=useState(null),[a,l]=useState([]),[h,m]=useState(""),[p,v]=useState(!1),[b,y]=useState(),[w,k]=useState("single"),S=useRef(),N=n?.windows.my(),C=useCallback((async e=>{const t=n.windows.findById(e),i=await(t?.application?.getConfiguration());return t&&i?i.details?.channelSelector?.preventModifyingRestrictionsFor??[]:[]}),[n.windows]),x=useCallback(((e,t,i)=>{if("will-show"===e.command){const t=async()=>{S.current=i,v(!0);const{windowId:t,channels:r,variant:a}=e,s="function"==typeof n.channels.getRestrictions?await n.channels.getRestrictions(t):{channels:[]},c=r.map((e=>{const t=((e,t)=>e.channels.find((e=>e.name===t.name)))(s,e);return t?{...e,read:t.read??!0,write:t.write??!0}:{...e,read:!0,write:!0}}));let u=c.find((e=>e.isSelected))?.name;if(!u){const e=n?.windows.findById(t);u=await(e?.getChannel());}const d=await C(t);l(d),k(a),m(t),o(((e,t)=>{const n=Array.from({length:e.length},((e,t)=>String.fromCharCode(t+65)));return e.map(((e,i)=>{const o=e.meta;return {key:e.name,color:o.color,name:e.name,isSelected:e.isSelected??e.name===t,label:o?.label??n[i],write:e.write,read:e.read}}))})(c,u)),v(!1);};t().catch((e=>{y(e),v(!1);}));}}),[n?.windows,n?.channels,C]),E=useCallback((({name:e,read:t,write:r,isSelected:a})=>{const s=()=>{if("directionalSingle"!==w)return N?.hide()};o((n=>n?n?.map((n=>n.name===e?{...n,isSelected:a,read:t,write:r}:{...n,isSelected:!1})):n));let c=!0;const l=i?.find((e=>e.isSelected))?.name;"single"===w||"directionalSingle"===w?c=l===e:"multi"===w&&(c=i?.find((t=>t.name===e))?.isSelected??!1),c?(n?.channels.leave)(h,e).finally((()=>{s()?.catch(console.error);})):n?.channels.join(e,h).finally((()=>{s()?.catch(console.error);}));}),[n?.channels,i,w,N,h]),I=useCallback((({name:e,read:t,write:i})=>{const o=n?.channels;"directionalSingle"===w&&"function"==typeof o?.restrict&&o?.restrict({name:e,read:t,write:i,windowId:h}).catch(console.error);}),[n?.channels,w,h]),A=useCallback((e=>{o((t=>t?t.map((t=>{const n=((e,t)=>e.channels.find((e=>e.name===t.name)))(e,t);return n?{...t,read:n.read,write:n.write}:t})):t));}),[]);return _i((()=>{N?.hide().catch(console.error);}),["Escape"]),useEffect((()=>{const e=N?.onClosing((async e=>(e({showDialog:!1}),Promise.resolve())));return e}),[N]),useEffect((()=>{const e=n.windows.findById(h);if(!e)return;if("function"!=typeof e?.onChannelRestrictionsChanged)return;return e.onChannelRestrictionsChanged(A)}),[n.windows,h,A]),useEffect((()=>((async()=>{await(n?.interop.registerAsync(t,x));})(),()=>{n?.interop.unregister(t);})),[n?.interop,x]),useLayoutEffect((()=>{if(e?.current&&i&&i.length>0){const{height:t,width:n,x:i,y:o}=e.current.getBoundingClientRect();S.current&&t>0&&S.current({height:t,width:n,x:i,y:o});}}),[i,e]),{onChannelSelected:E,onChannelRestricted:I,variant:w,isLoading:p,channels:i,restrictedChannels:a,error:b,windowId:h}}});createContext({config:{message:""},theme:"dark",setResult:()=>{}});function To({title:n="Downloads"}){const{ItemSearch:i,HeaderButtons:o}=tr();return jsxRuntimeExports.jsxs("div",{className:"io-dm-header",children:[jsxRuntimeExports.jsxs(j,{children:[jsxRuntimeExports.jsx(j.Title,{tag:"h1",text:n,size:"large"}),jsxRuntimeExports.jsx(o,{})]}),jsxRuntimeExports.jsx(i,{})]})}const Ro=createContext({configuration:{},items:[],removeItem:()=>{},pauseResumeItem:()=>{},cancelItem:()=>{},clearItems:()=>{},showItemInFolder:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},isSearchVisible:!1,showSearch:()=>{},hideSearch:()=>{},searchQuery:"",setSearch:()=>{},itemsCount:0,setCount:()=>{},setDownloadLocation:()=>{},setDownloadLocationWithDialog:()=>{},sortItems:()=>[],downloadLocationList:[],isDownloadLocationDialogVisible:!1}),Lo=()=>useContext(Ro);function Oo({className:n,icon:i="search",placeholder:o="Search",...r}){const a=w("io-header-search",n),s=useRef(null),{isSearchVisible:c,searchQuery:l,setSearch:f,itemsCount:h}=Lo();return useEffect((()=>{c?s.current?.focus():(s.current?.blur(),f(""));}),[c,f]),c?jsxRuntimeExports.jsxs("div",{className:a,children:[jsxRuntimeExports.jsx(Li,{ref:s,value:l,iconPrepend:i,placeholder:o,onChange:e=>f(e.target.value),...r}),c&&l.length>0&&jsxRuntimeExports.jsx("p",{className:"io-header-search-count",children:`${h} results`})]}):null}function Fo({className:n,...i}){const{SearchButton:o,SettingsButton:r,MoreButton:a}=tr();return jsxRuntimeExports.jsxs($,{className:n,align:"right",...i,children:[jsxRuntimeExports.jsx(o,{}),jsxRuntimeExports.jsx(r,{}),jsxRuntimeExports.jsx(a,{})]})}function Do({...t}){const{isSearchVisible:n,showSearch:i,hideSearch:o,items:r}=Lo();return jsxRuntimeExports.jsx(S,{icon:n?"search-filled":"search",variant:"circle",size:"32",onClick:n?o:i,disabled:0===r.length,...t})}function Mo({icon:t="cog",...n}){const{showSettings:i}=Lo();return jsxRuntimeExports.jsx(S,{icon:t,variant:"circle",size:"32",onClick:i,...n})}function zo({icon:n="ellipsis",...i}){const{items:o,clearItems:r}=Lo(),a=0===o.length;return jsxRuntimeExports.jsxs(H,{variant:"light",...i,children:[jsxRuntimeExports.jsx(H.ButtonIcon,{icon:n,variant:"circle",size:"32"}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{children:jsxRuntimeExports.jsx(H.Item,{disabled:a,onClick:e=>(e=>{a?e.stopPropagation():r();})(e),children:"Clear All"})})})]})}function _o(e,t=!1,n=!1,i=!1){const o=e.getDate(),r=["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?"Today"===t?n?"Today":`Today at ${s}:${l}`:"Yesterday"===t?n?"Yesterday":`Yesterday at ${s}:${l}`:`${s}:${l}`:i?n?`${r} ${o}`:`${r} ${o} at ${s}:${l}`:n?`${r} ${o}, ${a}`:`${r} ${o}, ${a} at ${s}:${l}`}function Ho(e,t={showTime:!0}){const n=new Date(1e3*e),i=new Date,o=Math.round((i-n)/1e3),r=Math.round(o/60),a=i.toDateString()===n.toDateString(),s=new Date(i.setDate(i.getDate()-1)).toDateString()===n.toDateString(),c=i.getFullYear()===n.getFullYear();return t.showTime?o<5?"Just Now":o<60?`${o} seconds ago`:o<90?"about a minute ago":r<60?`${r} minutes ago`:a?_o(n,"Today",!1,!0):s?_o(n,"Yesterday",!1,!0):c?_o(n,!1,!1,!0):_o(n):a?"Today":s?"Yesterday":c?_o(n,!1,!0,!0):_o(n,!1,!0)}function $o({className:t,...n}){const i=w("io-dm-body",t),{DownloadListEmpty:o,ItemGroup:r,Item:a}=tr(),{items:s,searchQuery:c,setCount:d,sortItems:f}=Lo(),h=f(s),m=Ui(c),p=useMemo((()=>h.filter((e=>e.displayInfo.filename.toLowerCase().includes(m.toLowerCase())||e.displayInfo.url.toLowerCase().includes(m.toLowerCase())))),[h,m]),g=useMemo((()=>p.map((e=>({...e,displayInfo:{...e.displayInfo,startTime:Ho(e.displayInfo.startTime,{showTime:!1})}})))),[p]),v=useMemo((()=>Object.values(g.reduce(((e={},t)=>(e[t.displayInfo.startTime]=e[t.displayInfo.startTime]?.concat([])??[],e[t.displayInfo.startTime].push(t),e)),{}))),[g]);return useEffect((()=>{d(p.length);}),[p,d]),jsxRuntimeExports.jsx("div",{className:i,...n,children:v&&0!==v.length?v.map((t=>jsxRuntimeExports.jsx(r,{title:String(t[0].displayInfo.startTime)??null,children:t.map((t=>jsxRuntimeExports.jsx(a,{item:t},t.id)))},t[0].id??""))):jsxRuntimeExports.jsx(o,{})})}function jo({className:n,icon:i="download",text:o="No downloads to display.",...r}){const a=w("io-dm-no-items",n);return jsxRuntimeExports.jsxs("div",{className:a,...r,children:[jsxRuntimeExports.jsx(k,{variant:i}),jsxRuntimeExports.jsx("p",{children:o})]})}function Vo({className:n,title:i,children:o,...r}){const a=w("io-dm-item-group",n);return jsxRuntimeExports.jsxs("div",{className:a,...r,children:[i&&jsxRuntimeExports.jsx("p",{children:i}),o]})}function Uo({className:i,item:o,...r}){const{ItemHeader:a,ItemBody:s,ItemFooter:c}=tr(),{state:l,url:u,filename:d,receivedBytes:f,totalBytes:h,speed:m,timeRemaining:p}=o.displayInfo;if(!o)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{});const g=w("io-dm-item",o.displayInfo.state&&[l],i);return jsxRuntimeExports.jsxs("div",{className:g,...r,children:[jsxRuntimeExports.jsx(a,{itemID:o.id,filename:d,state:l}),jsxRuntimeExports.jsx(s,{state:l,url:u,bytesReceived:f,bytesTotal:h,speed:m,timeRemaining:p}),jsxRuntimeExports.jsx(c,{itemID:o.id,state:l})]})}function Jo({bytesReceived:t=0,bytesTotal:n=0,...i}){const o=useCallback((()=>t&&n?Math.round(t/n*100):0),[t,n]);return jsxRuntimeExports.jsx(Pi,{value:o(),...i})}function Wo({className:n,itemID:i,filename:o,state:a,cancel:s,remove:c,...l}){const u=w("io-dm-item-header",n),{cancelItem:d,removeItem:f}=Lo(),h=useCallback((e=>{s?s(e):d(e);}),[s,d]),m=useCallback((e=>{c?c(e):f(e);}),[c,f]);return jsxRuntimeExports.jsxs("div",{className:u,...l,children:[jsxRuntimeExports.jsx(E,{text:o,style:{textDecoration:"interrupted"===a||"cancelled"===a?"line-through":"none"}}),jsxRuntimeExports.jsx(S,{icon:"close",onClick:()=>{"progressing"===a||"paused"===a?h(i):m(i);}})]})}function qo({className:n,state:i,url:o,bytesReceived:r=0,bytesTotal:a=0,speed:s=0,timeRemaining:c=0,...l}){const u=w("io-dm-item-body",n),d=e=>{const t=["Bytes","KB","MB","GB","TB"];if(0===e)return "0";const n=Math.floor(Math.log(e)/Math.log(1024));return 0===n?`${e}${t[n]}`:`${(e/1024**n).toFixed(1)}${t[n]}`};return jsxRuntimeExports.jsxs("div",{className:u,...l,children:[jsxRuntimeExports.jsx("p",{className:"io-text-small",children:o}),(h=i,"cancelled"===h||"interrupted"===h||"completed"===h?null:jsxRuntimeExports.jsx(Jo,{variant:"paused"===h?"paused":"active",bytesReceived:r,bytesTotal:a})),jsxRuntimeExports.jsx("p",{className:"io-text-default-lh16",children:"completed"===i?`${d(r??0)} - Done`:"cancelled"===i||"interrupted"===i?`${d(r??0)}/${d(a??0)} - Failed`:`${d(r??0)}/${d(a??0)} (${f=s,(f?`${(f/1e6/8).toFixed(2)}MB/s`:0)??0}) - ${(e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60);let i="";return t>0&&(i+=`${t} hour${t>1?"s":""}, `),n>0&&(i+=`${n} min${n>1?"s":""}, `),((e=Math.floor(e%60))>0||""===i)&&(i+=`${e} sec${1!==e?"s":""}`),`${i.trim()} left`})(c)??0}`})]});var f,h;}const Ko={success:"check-solid",warning:"exclamation-mark",critical:"exclamation-mark"};function Go({className:n,variant:i,text:o}){const r=w("io-dm-item-status",`io-dm-item-status-${i}`,n);return jsxRuntimeExports.jsxs("div",{className:r,children:[i&&jsxRuntimeExports.jsx(k,{variant:Ko[i],className:"icon-severity"}),o&&jsxRuntimeExports.jsx("p",{className:"io-text-smaller",children:o})]})}function Yo({className:i,itemID:o,state:a,pauseResume:s,showInFolder:c,cancel:l,...u}){const d=w("io-dm-item-footer",i),{pauseResumeItem:f,showItemInFolder:h,cancelItem:m}=Lo(),p=useCallback((e=>{s?s(e):f(e);}),[s,f]),g=useCallback((e=>{c?c(e):h(e);}),[c,h]),v=useCallback((e=>{l?l(e):m(e);}),[l,m]);return jsxRuntimeExports.jsx("div",{className:d,...u,children:(()=>{switch(a){case"progressing":return jsxRuntimeExports.jsxs($,{align:"right",children:[jsxRuntimeExports.jsx($.Button,{variant:"primary",text:"Pause",onClick:()=>p(o)}),jsxRuntimeExports.jsx($.Button,{variant:"link",text:"Cancel",onClick:()=>v(o)})]});case"paused":return jsxRuntimeExports.jsx($,{align:"right",children:jsxRuntimeExports.jsx($.Button,{variant:"primary",text:"Resume",onClick:()=>p(o)})});case"completed":return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Go,{variant:"success",text:"Complete"}),jsxRuntimeExports.jsx($,{align:"right",children:jsxRuntimeExports.jsx($.Button,{variant:"primary",text:"Show in Folder",onClick:()=>g(o)})})]});case"cancelled":return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(Go,{variant:"warning",text:"Cancelled"})});case"interrupted":return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Go,{variant:"critical",text:"Failed"}),jsxRuntimeExports.jsx($,{align:"right",children:jsxRuntimeExports.jsx($.Button,{variant:"primary",text:"Retry",onClick:()=>p(o)})})]});default:return null}})()})}function Qo({className:n,title:i="Settings",...o}){const r=w("io-settings-panel",n),{configuration:{downloadFolder:a},hideSettings:s,setDownloadLocation:c,setDownloadLocationWithDialog:l,isDownloadLocationDialogVisible:u,downloadLocationList:d}=Lo();return jsxRuntimeExports.jsxs(Ai,{className:r,...o,children:[jsxRuntimeExports.jsxs(Ai.Header,{children:[jsxRuntimeExports.jsx(Ai.Header.Title,{size:"large",text:i,tag:"h1"}),jsxRuntimeExports.jsx(Ai.Header.ButtonGroup,{children:jsxRuntimeExports.jsx(S,{variant:"circle",icon:"close",size:"32",onClick:()=>{s();},disabled:u})})]}),jsxRuntimeExports.jsx(Ai.Body,{children:jsxRuntimeExports.jsxs($,{children:[jsxRuntimeExports.jsxs(H,{variant:"outline",disabled:u,children:[jsxRuntimeExports.jsx(H.Button,{children:jsxRuntimeExports.jsx("span",{className:"io-settings-panel-download-location",children:a??d[0]})}),d.length>1&&jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{children:d.map(((t,n)=>!t||0===n||n>3?null:jsxRuntimeExports.jsx(H.Item,{onClick:()=>{c(t);},children:t},t)))})})]}),jsxRuntimeExports.jsx(A,{className:"io-btn io-settings-panel-download-location-btn",text:"Browse",onClick:()=>{l();},disabled:u})]})})]})}const Xo={Header:To,ItemSearch:Oo,HeaderButtons:Fo,SearchButton:Do,SettingsButton:Mo,MoreButton:zo,Body:$o,DownloadListEmpty:jo,ItemGroup:Vo,Item:Uo,ItemProgress:Jo,ItemHeader:Wo,ItemBody:qo,ItemFooter:Yo,Settings:Qo},Zo=createContext(Xo),er=memo((({children:t,components:n})=>{const i=useMemo((()=>({...Xo,...n})),[n]);return jsxRuntimeExports.jsx(Zo.Provider,{value:i,children:t})}));er.displayName="ComponentsStore";const tr=()=>useContext(Zo);function or(e){if(e&&e.errorHandling&&"function"!=typeof e.errorHandling&&"log"!==e.errorHandling&&"silent"!==e.errorHandling&&"throw"!==e.errorHandling)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&&"function"==typeof e.errorHandling&&e.errorHandling,n={};function i(n,i){var o=n instanceof Error?n:new Error(n);if(t)t(o);else {var r='[ERROR] callback-registry: User callback for key "'+i+'" failed: '+o.stack;if(e)switch(e.errorHandling){case"log":return console.error(r);case"silent":return;case"throw":throw new Error(r)}console.error(r);}}return {add:function(e,t,o){var r=n[e];return r||(r=[],n[e]=r),r.push(t),o&&setTimeout((function(){o.forEach((function(o){var r;if(null===(r=n[e])||void 0===r?void 0:r.includes(t))try{Array.isArray(o)?t.apply(void 0,o):t.apply(void 0,[o]);}catch(t){i(t,e);}}));}),0),function(){var i=n[e];i&&(i=i.reduce((function(e,n,i){return n===t&&e.length===i||e.push(n),e}),[]),0===i.length?delete n[e]:n[e]=i);}},execute:function(e){for(var t=[],o=1;o<arguments.length;o++)t[o-1]=arguments[o];var r=n[e];if(!r||0===r.length)return [];var a=[];return r.forEach((function(n){try{var o=n.apply(void 0,t);a.push(o);}catch(t){a.push(void 0),i(t,e);}})),a},clear:function(){n={};},clearKey:function(e){n[e]&&delete n[e];}}}or.default=or;v(or);const sr=createContext({config:{env:"",region:"",version:"",buildVersion:"",theme:"",isError:!1,mailingList:"",createJiraTicket:!0,sendEmail:!1,attachments:[],applicationTitle:"",allowEditRecipients:!0,attachmentsViewMode:"category",environmentInfo:"",selectedCategories:[],errorMessage:"",showEnvironmentInfo:!1,context:{},technicalInfo:"",sendEmailClient:"Outlook"},onThemeChanged:e=>{},openUrl:()=>{},submit:()=>Promise.resolve({}),setBounds:()=>{},close:e=>{},showMailingList:!0,setShowMailingList:()=>{},attachmentCategories:[],submitInProgress:!1,setSubmitInProgress:()=>{},submitStatus:{type:"success",title:"",text:""},setSubmitStatus:()=>{},submitCompleted:!1,setSubmitCompleted:()=>{},jiraTicketURL:"",setJiraTicketURL:()=>{},submitFeedback:()=>{}}),cr=()=>useContext(sr);function lr({...n}){const{config:i,close:o}=cr(),{applicationTitle:r}=i;return jsxRuntimeExports.jsxs(j,{draggable:!0,...n,children:[jsxRuntimeExports.jsx(j.Title,{tag:"h1",text:r?`Feedback Form - ${r}`:"Feedback Form",size:"large"}),jsxRuntimeExports.jsx(j.ButtonGroup,{className:"non-draggable",children:jsxRuntimeExports.jsx(j.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:()=>o()})})]})}function ur({className:n,handleSubmit:i,...o}){const r=w("io-panel-body",n),{config:a,submitFeedback:s}=cr(),{IntroField:c,DescriptionField:l,TechInfoField:u,EnvInfoField:d,FileAttachmentsField:f,CategoryAttachmentsField:h,SettingsField:m,MailListField:p}=Ar(),g=i??s,v=`Your feedback will be submitted to the ${a.buildVersion} team and some additional information will be automatically included to help us examine your issue.`;return jsxRuntimeExports.jsxs("form",{className:r,id:"feedback",onSubmit:e=>g(e),...o,children:[jsxRuntimeExports.jsx(c,{children:jsxRuntimeExports.jsx("p",{children:v})}),jsxRuntimeExports.jsx(m,{}),jsxRuntimeExports.jsx(p,{}),jsxRuntimeExports.jsx(l,{}),jsxRuntimeExports.jsx(u,{readOnly:!0}),jsxRuntimeExports.jsx(d,{readOnly:!0}),"file"===a.attachmentsViewMode?jsxRuntimeExports.jsx(f,{}):jsxRuntimeExports.jsx(h,{})]})}function dr({...n}){const{FooterButtons:i}=Ar(),{openUrl:o,submitInProgress:r,submitStatus:a,jiraTicketURL:s}=cr();return jsxRuntimeExports.jsx(J,{...n,children:jsxRuntimeExports.jsxs("div",r?{className:"flex ai-center jc-between",children:[jsxRuntimeExports.jsx(I,{children:jsxRuntimeExports.jsx("p",{children:a.title})}),jsxRuntimeExports.jsx(Ci,{align:"right",size:"small"})]}:{className:"flex ai-center jc-between",children:[jsxRuntimeExports.jsxs(I,{children:[jsxRuntimeExports.jsx("p",{className:"error"===a.type?"io-text-error":"",children:a.title}),s&&jsxRuntimeExports.jsx("a",{href:s,onClick:e=>{e.preventDefault(),o(s);},children:s})]}),jsxRuntimeExports.jsx(i,{})]})})}function fr({className:t,...n}){const{CloseButton:i}=Ar(),{close:o}=cr();return jsxRuntimeExports.jsx($,{className:t,...n,children:jsxRuntimeExports.jsx(i,{onClick:()=>o()})})}function hr({className:n,...i}){const{SubmitButton:o,CancelButton:r,CloseButton:a}=Ar(),{close:s,submitCompleted:c}=cr();return c?jsxRuntimeExports.jsx($,{className:n,...i,children:jsxRuntimeExports.jsx(a,{text:"Close",onClick:()=>s()})}):jsxRuntimeExports.jsxs($,{className:n,...i,children:[jsxRuntimeExports.jsx(o,{}),jsxRuntimeExports.jsx(r,{onClick:()=>s()})]})}function mr({text:t="Submit",...n}){return jsxRuntimeExports.jsx(A,{form:"feedback",type:"submit",variant:"primary",text:t,...n})}function pr({text:t="Cancel",...n}){return jsxRuntimeExports.jsx(A,{variant:"link",text:t,...n})}function gr({...t}){return jsxRuntimeExports.jsx(A,{variant:"primary",...t})}function vr({showField:t=!0,className:n,title:i,hint:o,children:r,...a}){return t?jsxRuntimeExports.jsx(I,{className:n,title:i,hint:o,...a,children:r}):null}function br({showField:t=!0,className:n,title:i="Description",hint:o,readOnly:r=!1,disabled:a,...s}){return t?jsxRuntimeExports.jsx(I,{className:n,hint:o,title:"",...s,children:jsxRuntimeExports.jsx(Oi,{id:"description",name:"description",label:i,readOnly:r,disabled:a})}):null}function yr({showField:t,className:n,title:i="Technical Information",hint:o,fieldValue:r,readOnly:a=!1,disabled:s,...c}){const{config:l}=cr(),u=t??l.errorMessage,d=r??l.errorMessage;return u&&d?jsxRuntimeExports.jsx(I,{className:n,hint:o,...c,children:jsxRuntimeExports.jsx(Oi,{id:"errorMessage",name:"errorMessage",label:i,value:d,readOnly:a,disabled:s})}):null}function wr({showField:t,className:n,title:i="Environment Information",hint:o,fieldValue:r,readOnly:a=!1,disabled:s,...c}){const{config:l}=cr(),u=t??l.showEnvironmentInfo,d=r??l.environmentInfo;return u&&d?jsxRuntimeExports.jsx(I,{className:n,hint:o,...c,children:jsxRuntimeExports.jsx(Oi,{id:"environmentInfo",name:"environmentInfo",label:i,value:d,readOnly:a,disabled:s})}):null}function kr({showField:t=!0,className:n,title:i="Attachments",hint:o,readOnly:a=!1,disabled:s,attachments:c,selectedCategories:l,...u}){const d=w("io-block-list-gap",n),{config:f}=cr(),h=c??f.attachments,m=l??f.selectedCategories,p=useCallback((e=>!!m&&-1!==m.indexOf(e)),[m]);return t?!h||h.length<=0?jsxRuntimeExports.jsx(I,{title:"Attachments",children:jsxRuntimeExports.jsx("p",{children:"No Attachments"})}):jsxRuntimeExports.jsx(I,{className:d,title:i,hint:o,...u,children:jsxRuntimeExports.jsx("div",{className:"file-attachments",children:h.map((t=>jsxRuntimeExports.jsx(Fi,{id:t.id,name:t.id,label:t.name,readOnly:a,disabled:s,defaultChecked:p(t.category)},t.id)))})}):null}function Sr({showField:t=!0,className:n,title:i="Attachments",hint:o,readOnly:a=!1,disabled:s,categories:c,selectedCategories:l,...u}){const{config:d,attachmentCategories:f}=cr(),h=c??f,m=l??d.selectedCategories,p=useCallback((e=>!!m&&-1!==m.indexOf(e)),[m]);return t?!h||h.length<=0?jsxRuntimeExports.jsx("p",{children:"No Attachments"}):jsxRuntimeExports.jsx(I,{className:n,title:i,hint:o,...u,children:jsxRuntimeExports.jsx("div",{className:"category-attachments",children:h.map((t=>jsxRuntimeExports.jsx(Mi,{id:t,name:t,align:"right",label:t,readOnly:a,disabled:s,defaultChecked:p(t)},t)))})}):null}function Nr({className:n,title:i,hint:o,showField:r=!0,showJiraTicketField:a,jiraTicketLabel:s="Create Jira Ticket",showSendEmailField:c,sendEmailLabel:l="Send Email",readOnly:u=!1,disabled:d,...f}){const h=w("io-block-list-gap",n),{config:m,showMailingList:p,setShowMailingList:g}=cr();if(!r)return null;const v=a??m.createJiraTicket,b=c??m.sendEmail;return jsxRuntimeExports.jsxs(I,{className:h,hint:o,title:i,...f,children:[v&&jsxRuntimeExports.jsx(Mi,{id:"createJiraTicket",name:"createJiraTicket",label:s,align:"right",readOnly:u,disabled:d,defaultChecked:v}),b&&jsxRuntimeExports.jsx(Mi,{onChange:()=>{g(!p);},id:"sendEmail",name:"sendEmail",label:l,align:"right",readOnly:u,disabled:d,defaultChecked:b})]})}function Cr({showField:t=!0,className:n,title:i="Email List",hint:o="Separate with commas or semicolons.",placeholder:r="john.doe@somedomain.com; jane.doe@otherdomain.com",readOnly:a,disabled:s,...c}){const{config:l,showMailingList:u}=cr(),d=t??l.sendEmail,f=a??!1===l.allowEditRecipients;return d&&u?jsxRuntimeExports.jsx(I,{className:n,hint:o,...c,children:jsxRuntimeExports.jsx(Li,{id:"mailingList",name:"mailingList",label:i,placeholder:r,readOnly:f,disabled:s,defaultValue:l.mailingList??""})}):null}const xr={Header:lr,Body:ur,Footer:dr,HeaderButtons:fr,FooterButtons:hr,SubmitButton:mr,CancelButton:pr,CloseButton:gr,IntroField:vr,DescriptionField:br,TechInfoField:yr,EnvInfoField:wr,FileAttachmentsField:kr,CategoryAttachmentsField:Sr,SettingsField:Nr,MailListField:Cr},Er=createContext(xr),Ir=memo((({children:t,components:n})=>{const i=useMemo((()=>({...xr,...n})),[n]);return jsxRuntimeExports.jsx(Er.Provider,{value:i,children:t})}));function Ar(e){return {...useContext(Er),...e}}Ir.displayName="ComponentsStore";function Rr(e){const t=useContext(IOConnectContext),n=t?.appManager,[i,o]=useState([]),[a,l]=useState(0),d="*",f=useCallback((e=>[...e].sort(((e,t)=>{const n=(e.title??e.name).toLowerCase(),i=(t.title??t.name).toLowerCase();return n<i?-1:n>i?1:0}))),[]);return useEffect((()=>{if(!n)return;const e=n.onAppAdded((e=>{o((t=>[...t,{title:e.title,name:e.name,hidden:e.hidden}]));}));return ()=>{e();}}),[n]),useEffect((()=>{if(!n)return;const e=n.onAppRemoved((e=>{o((t=>t.filter((t=>t.name!==e.name))));}));return ()=>{e();}}),[n,i]),useEffect((()=>{if(!n)return;const e=n.onAppChanged((e=>{o((t=>{const n=t.find((t=>t.name===e.name));return [...t.filter((t=>t.name!==e.name)),{title:e.title,name:n?.name,hidden:n?.hidden,allowed:n?.allowed}]}));}));return ()=>{e();}}),[n]),useEffect((()=>{const n=e?.allApplications??t.appManager.applications().length;let r=0;const a=[...i],s=e?.sourceFilter;if(void 0===s||!Array.isArray(s.allowed)||!Array.isArray(s.blocked))return;const c=s.allowed,u=s.blocked;0===c.length||-1!==u.indexOf(d)||0===c.length&&0===u.length||-1!==c.indexOf(d)&&-1!==u.indexOf(d)?(r=n,a.forEach((e=>{e.allowed=!1;}))):-1!==c.indexOf(d)&&a.forEach((e=>{e.allowed=!0;})),-1===u.indexOf(d)&&u.length>0&&(r=s.blocked.length),c.forEach((e=>{const t=a.find((t=>t.name===e));t&&(t.allowed=!0);})),u.forEach((e=>{const t=a.find((t=>t.name===e));t&&(t.allowed=!1);})),l(n-r),o(a);}),[e]),{apps:i,allowedApps:a,sortAppsAlphabetically:f}}const Dr=createContext({allApps:[],settings:{},configuration:{},notifications:[],onClose:()=>{},allApplications:0,clearAll:()=>{},showPanel:()=>{},hidePanel:()=>{},saveFilter:()=>{},clearAllOld:()=>{},notificationStacks:[],isPanelVisible:!1,saveSetting:()=>{},allowedApplications:0,saveAllFilter:()=>{},isBulkActionsSupported:!1,selectedNotifications:[],selectNotification:()=>{},selectAllNotifications:()=>{},clearMany:()=>{},snooze:()=>{},snoozeMany:()=>{},setState:()=>{},setStates:()=>{}}),Mr=()=>useContext(Dr);const zr=createContext({isSearchVisible:!1,showSearch:()=>{},hideSearch:()=>{},searchQuery:"",setSearch:()=>{},isSettingsVisible:!1,showSettings:()=>{},hideSettings:()=>{},sortNotificationsBy:"newest",setSortBy:()=>{},viewNotificationsBy:"all",setViewBy:()=>{},notificationsCount:0,setCount:()=>{},isBulkActionsVisible:!1,showBulkActions:()=>{},hideBulkActions:()=>{}}),_r=()=>useContext(zr);function Hr({...n}){const{HeaderCaption:i,HeaderActions:o,HeaderBulkActions:r,HeaderSearch:a}=Xa(),{isBulkActionsSupported:s}=Mr(),{isBulkActionsVisible:c,notificationsCount:l}=_r();return jsxRuntimeExports.jsxs(xi,{...n,children:[jsxRuntimeExports.jsx(i,{}),s?jsxRuntimeExports.jsxs("div",{className:`io-panel-header-actions-wrapper ${c&&l>0?"io-panel-header-bulk-actions-opened":""} `,children:[jsxRuntimeExports.jsx(o,{}),jsxRuntimeExports.jsx(r,{})]}):jsxRuntimeExports.jsx(o,{}),jsxRuntimeExports.jsx(a,{})]})}function $r({className:n,...i}){const o=w("io-panel-header-caption",n),{HeaderCaptionTitle:r,HeaderCaptionCount:a,HeaderCaptionButtons:s}=Xa();return jsxRuntimeExports.jsxs("div",{className:o,...i,children:[jsxRuntimeExports.jsx(r,{}),jsxRuntimeExports.jsx(a,{}),jsxRuntimeExports.jsx(s,{})]})}function jr({className:n,...i}){const o=w("io-panel-header-caption-filter",n),{allApplications:r,allowedApplications:a}=Mr();return jsxRuntimeExports.jsxs("div",{className:o,...i,children:[jsxRuntimeExports.jsx(k,{variant:"filter"}),jsxRuntimeExports.jsx("span",{className:"io-panel-header-caption-filter-allowed",children:a}),"of"," ",jsxRuntimeExports.jsx("span",{className:"io-panel-header-caption-filter-all",children:r}),"apps"]})}function Vr({text:n="Notifications",counter:i,...o}){const{notificationsCount:r}=_r();return jsxRuntimeExports.jsx(E,{text:n,size:"large",...o,children:(i??!0)&&jsxRuntimeExports.jsxs("span",{children:["(",r,")"]})})}function Ur({...n}){const{HeaderCaptionButtonSearch:i,HeaderCaptionButtonSettings:o,HeaderCaptionButtonClose:r}=Xa();return jsxRuntimeExports.jsxs($,{...n,children:[jsxRuntimeExports.jsx(i,{}),jsxRuntimeExports.jsx(o,{}),jsxRuntimeExports.jsx(r,{})]})}const Jr="newest",Wr=["None","Low","Medium","High","Critical"],qr={key:Jr,descending:!0},Kr=e=>[...e].sort(((e,t)=>(t.timestamp||0)-(e.timestamp||0))),Gr=e=>[...e].sort(((e,t)=>(e.timestamp||0)-(t.timestamp||0))),Yr=(e,t)=>{const n=Wr[0];return [...e].sort(((e,i)=>{const o=Wr.indexOf(e.severity||n),r=Wr.indexOf(i.severity||n);return (t?-1:1)*(o-r)}))},Qr={[Jr]:Kr,["oldest"]:Gr,["severity"]:Yr};function Xr({...t}){const[n,i]=useState([]),{NotificationsList:o,Notification:r}=Xa(),{sortNotificationsBy:a,viewNotificationsBy:s,setCount:f,searchQuery:h,notificationsCount:m}=_r(),{notifications:p}=Mr(),g=useRef(null),v=Ui(h),b=useMemo((()=>((e,t)=>{if(!e)return [];switch(t){case"all":default:return e;case"unread":return e.filter((e=>"Active"===e.state||"Stale"===e.state));case"read":return e.filter((e=>"Acknowledged"===e.state||"Seen"===e.state));case"snoozed":return e.filter((e=>"Snoozed"===e.state))}})(p,s)),[p,s]),y=useMemo((()=>b.filter((e=>e.title.toLowerCase().includes(v.toLowerCase())||e.source?.toLowerCase().includes(v.toLowerCase())||e.body?.toLowerCase().includes(v.toLowerCase())))),[b,v]);return useEffect((()=>{switch(a){case"newest":i(Kr(y));break;case"oldest":i(Gr(y));break;case"severity":i(Yr(y,!0));break;default:i(y);}f(y.length);}),[y,a,f]),useEffect((()=>{g.current&&g.current?.scrollTo({top:0,behavior:"smooth"});}),[v,m,a,s]),jsxRuntimeExports.jsx(Ei,{ref:g,...t,children:jsxRuntimeExports.jsx(o,{notifications:n,Notification:r})})}function Zr({...t}){const{FooterButtons:n}=Xa();return jsxRuntimeExports.jsx(Ii,{...t,children:jsxRuntimeExports.jsx(n,{})})}function ea({className:n,...i}){const{FooterButtonClearAll:o,FooterButtonClearAllOld:r}=Xa(),{notifications:a}=Mr(),[s,l]=useState(!1);return useEffect((()=>{a.filter((e=>"Stale"===e.state||"Acknowledged"===e.state)).length>0?l(!0):l(!1);}),[a]),jsxRuntimeExports.jsxs($,{className:n,align:"right",...i,children:[jsxRuntimeExports.jsx(r,{disabled:!s}),jsxRuntimeExports.jsx(o,{disabled:a.length<=0})]})}function ta({text:t="Clear All",...n}){const{clearAll:i}=Mr();return jsxRuntimeExports.jsx(A,{text:t,onClick:()=>{i();},...n})}function na({text:t="Clear Old",...n}){const{clearAllOld:i}=Mr();return jsxRuntimeExports.jsx(A,{text:t,onClick:()=>{i();},...n})}function ia({className:n,title:i="Settings",...o}){const r=w("io-settings-panel",n),{SettingsGeneral:a,SettingsPlacement:s,SettingsStacking:c,SettingsSnooze:l,SettingsSubscriptions:u}=Xa(),{hideSettings:d}=_r();return jsxRuntimeExports.jsxs(Ai,{className:r,...o,children:[jsxRuntimeExports.jsxs(Ai.Header,{children:[jsxRuntimeExports.jsx(Ai.Header.Title,{size:"large",text:i,tag:"h1"}),jsxRuntimeExports.jsx(Ai.Header.ButtonGroup,{children:jsxRuntimeExports.jsx(Ai.Header.ButtonIcon,{variant:"circle",icon:"close",size:"32",onClick:d})})]}),jsxRuntimeExports.jsxs(Ai.Body,{children:[jsxRuntimeExports.jsx(a,{}),jsxRuntimeExports.jsx(c,{}),jsxRuntimeExports.jsx(s,{}),jsxRuntimeExports.jsx(l,{}),jsxRuntimeExports.jsx(u,{})]})]})}function oa({className:n,title:i="General",...o}){const r=w("io-panel-settings-general",n),{SettingsAllowNotifications:a,SettingsShowNotificationBadge:s,SettingsCloseNotificationOnClick:c,SettingsPanelAutoHide:l,SettingsHideToastsAfter:u}=Xa();return jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsxs(I,{title:i,children:[jsxRuntimeExports.jsx(a,{}),jsxRuntimeExports.jsx(s,{}),jsxRuntimeExports.jsx(c,{}),jsxRuntimeExports.jsx(l,{}),jsxRuntimeExports.jsx(u,{})]})})}function ra({label:t="Allow notifications",align:n="right",...i}){const{settings:o,saveSetting:a}=Mr(),s=useCallback((e=>{a({enabledNotifications:e.target.checked});}),[a]);return jsxRuntimeExports.jsx(Mi,{label:t,align:n,onChange:s,checked:o.enabledNotifications,...i})}function aa({label:t="Show notification badge",align:n="right",...i}){const{settings:o,saveSetting:a}=Mr(),s=useCallback((e=>{a({showNotificationBadge:e.target.checked});}),[a]);return jsxRuntimeExports.jsx(Mi,{label:t,align:n,onChange:s,checked:o.showNotificationBadge,disabled:!o.enabledNotifications,...i})}function sa({label:t="Close notification on click",align:n="right",...i}){const{settings:o,saveSetting:a}=Mr(),s=useCallback((e=>{a({closeNotificationOnClick:e.target.checked});}),[a]);return jsxRuntimeExports.jsx(Mi,{label:t,align:n,onChange:s,checked:o.closeNotificationOnClick,disabled:!o.enabledNotifications,...i})}function ca({label:t="Auto hide panel",align:n="right",...i}){const{settings:o,saveSetting:a}=Mr(),s=useCallback((e=>{a({autoHidePanel:e.target.checked});}),[a]);return jsxRuntimeExports.jsx(Mi,{label:t,align:n,onChange:s,checked:o.autoHidePanel,...i})}function la({label:t="Panel always on top",align:n="right",...i}){const{settings:o,saveSetting:a}=Mr(),s=useCallback((e=>{a({alwaysOnTop:e.target.checked});}),[a]);return jsxRuntimeExports.jsx(Mi,{label:t,align:n,onChange:s,checked:o.alwaysOnTop,...i})}function ua({className:n,title:i="Hide toasts after",items:o=[15,30,45,60],...a}){const s=w("flex","jc-between","ai-center",n),{settings:c,saveSetting:l}=Mr(),u=useCallback((e=>{e||(e=15e3),c.toastExpiry!==e&&l({toastExpiry:1e3*e});}),[c.toastExpiry,l]),d=e=>e<60?`${e} seconds`:60===e?"1 minute":e/60+" minutes";return jsxRuntimeExports.jsxs("div",{className:s,...a,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper "+(c.enabledNotifications?"":"io-text-disabled"),children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"light",disabled:!c.enabledNotifications,children:[jsxRuntimeExports.jsx(H.Button,{text:d(c.toastExpiry/1e3)}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:o.map((t=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>{u(t);},children:d(t)},t)))})})]})]})}function da({className:n,title:i="Highlight new for",...o}){const r=w("flex","jc-between","ai-center",n),{settings:a}=Mr(),s=["30 seconds","1 minute","5 minutes","Never"];return jsxRuntimeExports.jsxs("div",{className:r,...o,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper "+(a.enabledNotifications?"":"io-text-disabled"),children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"outline",disabled:!a.enabledNotifications,children:[jsxRuntimeExports.jsx(H.Button,{text:s[0]}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:s.map((t=>jsxRuntimeExports.jsx(H.Item,{children:t},t)))})})]})]})}function fa({className:n,title:i="Mark as read after",...o}){const r=w("flex","jc-between","ai-center",n),{settings:a}=Mr(),s=["1 minute","5 minutes","Never"];return jsxRuntimeExports.jsxs("div",{className:r,...o,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper "+(a.enabledNotifications?"":"io-text-disabled"),children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"outline",disabled:!a.enabledNotifications,children:[jsxRuntimeExports.jsx(H.Button,{text:s[0]}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:s.map((t=>jsxRuntimeExports.jsx(H.Item,{children:t},t)))})})]})]})}function ha({className:n,title:i="Stacking",...o}){const r=w("io-panel-settings-stacking",n),{SettingsToastStacking:a,SettingsToastStackBy:s}=Xa();return jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsxs(I,{title:i,children:[jsxRuntimeExports.jsx(a,{}),jsxRuntimeExports.jsx(s,{})]})})}function ma({label:t="Allow toast stacking",align:n="right",...i}){const{settings:o,saveSetting:a}=Mr(),s=useCallback((e=>{a({toastStacking:e.target.checked});}),[a]);return jsxRuntimeExports.jsx(Mi,{label:t,align:n,onChange:s,checked:o.toastStacking,disabled:!o.enabledNotifications,...i})}const pa=e=>e.replace(/(^|-)\w/g,(e=>e.toUpperCase().replace("-"," ")));function ga({className:n,title:i="Group by",...o}){const a=w("flex","jc-between","ai-center",n),{settings:s,saveSetting:c}=Mr(),l=useCallback((e=>{e||(e="severity"),s.stackBy!==e&&c({stackBy:e.toLowerCase()});}),[s.stackBy,c]);return jsxRuntimeExports.jsxs("div",{className:a,...o,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper "+(s.enabledNotifications?"":"io-text-disabled"),children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"light",disabled:!s.enabledNotifications,children:[jsxRuntimeExports.jsx(H.Button,{text:s.stackBy?pa(s.stackBy):"Severity"}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:["Severity","Application"].map((t=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>{l(t);},children:t},t)))})})]})]})}function va({className:n,title:i="Placement",...o}){const r=w("io-panel-settings-placement",n),{SettingsPlacementPanel:a,SettingsPlacementToasts:s}=Xa();return jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsxs(I,{title:i,children:[jsxRuntimeExports.jsx(a,{}),jsxRuntimeExports.jsx(s,{})]})})}function ba({className:n,title:i="Panel position",...o}){const a=w("flex","jc-between","ai-center",n),{settings:s,saveSetting:c}=Mr(),l=useCallback((e=>{e||(e="right"),s.placement?.panel!==e&&c({placement:{...s.placement,panel:e.toLowerCase()}});}),[s.placement,c]);return jsxRuntimeExports.jsxs("div",{className:a,...o,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper",children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"light",children:[jsxRuntimeExports.jsx(H.Button,{text:s.placement?.panel?pa(s.placement?.panel):"Right"}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:["Right","Left"].map((t=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>{l(t);},children:t},t)))})})]})]})}function ya({className:n,title:i="Toasts position",...o}){const a=w("flex","jc-between","ai-center",n),{settings:s,saveSetting:c}=Mr(),l=useCallback((e=>{if(e||(e="bottom-right"),s.placement?.toasts===e)return;const t=e.replace(/\s+/g,"-").toLowerCase();c({placement:{...s.placement,toasts:t}});}),[s.placement,c]);return jsxRuntimeExports.jsxs("div",{className:a,...o,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper",children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"light",children:[jsxRuntimeExports.jsx(H.Button,{text:s.placement?.toasts?pa(s.placement?.toasts):"Bottom Right"}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:["Top Right","Top Left","Bottom Right","Bottom Left"].map((t=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>{l(t);},children:t},t)))})})]})]})}function wa({className:t,title:n="Snooze",...i}){const o=w("io-panel-settings-snooze",t),{SettingsSnoozeDuration:r}=Xa(),{settings:a}=Mr();return a.snooze?.enabled?jsxRuntimeExports.jsx("div",{className:o,...i,children:jsxRuntimeExports.jsx(I,{title:n,children:jsxRuntimeExports.jsx(r,{})})}):null}function ka({className:n,title:i="Default duration",items:o=[60,120,180,300],...a}){const s=w("flex","jc-between","ai-center",n),{settings:c,saveSetting:l}=Mr(),u=useCallback((e=>{e||(e=6e4),c.snooze&&c.snooze?.duration!==e&&l({snooze:{...c.snooze,duration:1e3*e}});}),[c.snooze,l]),d=e=>e<60?`${e} seconds`:60===e?"1 minute":e/60+" minutes";return c.snooze?.enabled?jsxRuntimeExports.jsxs("div",{className:s,...a,children:[jsxRuntimeExports.jsx("div",{className:"io-text-clipper "+(c.enabledNotifications?"":"io-text-disabled"),children:jsxRuntimeExports.jsx("span",{children:i})}),jsxRuntimeExports.jsxs(H,{variant:"outline",disabled:!c.enabledNotifications,children:[jsxRuntimeExports.jsx(H.Button,{text:d(c.snooze?.duration/1e3)}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:o.map((t=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>{u(t);},children:d(t)},t)))})})]})]}):null}function Sa({className:n,title:i="Subscribe and Mute",...o}){const r=w("io-panel-settings-subscriptions",n),{SettingsSubscribeAll:a,SettingsSubscribeApp:s,SettingsSubscribeMuteAll:c,SettingsSubscribeMuteApp:l}=Xa(),{allApps:u}=Mr(),{sortAppsAlphabetically:d}=Rr(),f=d(u);return jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsxs(I,{title:i,children:[jsxRuntimeExports.jsxs("div",{className:"io-panel-settings-subscriptions-grid",children:[jsxRuntimeExports.jsx("p",{className:"io-text-section",children:"Sources"}),jsxRuntimeExports.jsx("p",{className:"io-text-section",children:"Subscribe"}),jsxRuntimeExports.jsx("p",{className:"io-text-section",children:"Mute"})]}),jsxRuntimeExports.jsxs("div",{className:"io-panel-settings-subscriptions-grid",children:[jsxRuntimeExports.jsx("p",{children:"All Sources"}),jsxRuntimeExports.jsx(a,{label:""}),jsxRuntimeExports.jsx(c,{label:""})]}),f.map((n=>!n||n.hidden?null:jsxRuntimeExports.jsxs("div",{className:"io-panel-settings-subscriptions-grid",children:[jsxRuntimeExports.jsx("p",{children:n.title??n.name}),jsxRuntimeExports.jsx(s,{app:n,label:""}),jsxRuntimeExports.jsx(l,{app:n,label:""})]},n.name)))]})})}function Na({label:t="All apps",align:n="right",...i}){const{settings:o,configuration:a,saveAllFilter:s}=Mr(),c=useCallback((e=>{s({subscribe:e.target.checked});}),[s]);return jsxRuntimeExports.jsx(Mi,{align:n,label:t,onChange:c,checked:a.sourceFilter?.allowed?.includes("*"),disabled:!o.enabledNotifications,...i})}function Ca({label:t="App",align:n="right",app:i,...o}){const{allApps:a,settings:s,configuration:c,saveFilter:l}=Mr(),u=useCallback(((e,t)=>{const n={...c.sourceFilter},i=n.allowed?.indexOf("*");"number"==typeof i&&i>-1&&(n.allowed?.splice(i,1),a.forEach((e=>{e.name!==t.name&&n.allowed?.push(e.name);}))),e?(n.allowed?.push(t.name),n.blocked=n.blocked?.filter((e=>e!==t.name))):(n.allowed=n.allowed?.filter((e=>e!==t.name)),n.blocked?.push(t.name)),n.allowed?.length&&n.allowed?.length>0&&n.blocked?.includes("*")&&n.blocked.splice(n.blocked.indexOf("*"),1),l(n);}),[a,c.sourceFilter,l]);return jsxRuntimeExports.jsx(Mi,{id:i.name,label:t,align:n,onChange:e=>u(e.target.checked,i),checked:c.sourceFilter?.allowed?.includes("*")||c.sourceFilter?.allowed?.includes(i.name),disabled:!s.enabledNotifications,...o})}function xa({label:t="Mute all",align:n="right",...i}){const{settings:o,configuration:a,saveAllFilter:s}=Mr(),c=useCallback((e=>{s({mute:e.target.checked});}),[s]);return jsxRuntimeExports.jsx(Mi,{align:n,label:t,onChange:c,checked:a.sourceFilter?.muted?.includes("*"),disabled:!o.enabledNotifications||-1===a.sourceFilter?.allowed?.indexOf("*"),...i})}function Ea({label:t="App",align:n="right",app:i,...o}){const{allApps:a,settings:s,configuration:c,saveFilter:l}=Mr(),u=useCallback(((e,t)=>{const n={...c.sourceFilter},i=n?.muted?.indexOf("*");"number"==typeof i&&i>-1&&(n.muted?.splice(i,1),a.forEach((e=>{e.name===t.name||e.hidden||n.muted?.push(e.name);}))),e?n.muted?.push(t.name):n.muted=n.muted?.filter((e=>e!==t.name)),l(n);}),[a,c.sourceFilter,l]);return jsxRuntimeExports.jsx(Mi,{id:i.name,label:t,align:n,onChange:e=>u(e.target.checked,i),checked:c.sourceFilter?.muted?.includes("*")||c.sourceFilter?.muted?.includes(i.name),disabled:!s.enabledNotifications||c.sourceFilter?.blocked?.includes("*")||c.sourceFilter?.blocked?.includes(i.name)||0===c.sourceFilter?.allowed?.length||-1===c.sourceFilter?.allowed?.indexOf(i.name)&&-1===c.sourceFilter?.allowed?.indexOf("*")&&0===c.sourceFilter?.blocked?.length,...o})}function Ia({className:n,notification:i,...o}){const r=w("io-notification-header",n),{HeaderCount:a,HeaderBadge:s,HeaderTitle:c,HeaderTimestamp:l,HeaderButtonSnooze:u,HeaderButtonClose:d}=Ua();return jsxRuntimeExports.jsxs("div",{className:r,...o,children:[jsxRuntimeExports.jsx(s,{notification:i}),jsxRuntimeExports.jsx(a,{notification:i}),jsxRuntimeExports.jsx(c,{notification:i}),jsxRuntimeExports.jsx(l,{notification:i}),jsxRuntimeExports.jsxs($,{children:[jsxRuntimeExports.jsx(u,{notification:i}),jsxRuntimeExports.jsx(d,{notification:i})]})]})}function Aa({notification:t,...n}){const{settings:i,isPanelVisible:o,notificationStacks:r}=Mr(),{toastStacking:a,stackBy:s}=i,c="application"===s?"source":s??"source";let l;if(a){const e=r.find((e=>e.key===t[c]));l=e?.items.length??0;}return a&&!o&&l&&l>1?jsxRuntimeExports.jsx(x,{...n,children:l<10?l:"9+"}):null}function Ba({className:n,notification:i,...o}){if(!i?.severity||"None"===i.severity)return null;const r=w("io-notification-header-badge",n);return jsxRuntimeExports.jsxs("div",{className:r,...o,children:[jsxRuntimeExports.jsx(k,{variant:((e="None")=>{switch(e.toLowerCase()){case"low":case"medium":case"none":default:return "circle-info";case"high":return "triangle-exclamation";case"critical":return "ban"}})(i.severity),size:"12"}),i.severity]})}function Ta({className:n,state:i,severity:o="None",icon:r,...a}){const s=w("io-notification-header-icon",n),{isPanelVisible:c}=Mr();return jsxRuntimeExports.jsxs("div",{className:s,...a,children:[r&&jsxRuntimeExports.jsx("span",{className:"io-notification-header-icon-image",children:jsxRuntimeExports.jsx("img",{src:r,alt:`io-notification-header-icon-${r}`})}),jsxRuntimeExports.jsx("span",{className:`io-notification-header-icon-badge color-${o.toLowerCase()}`,children:c&&"Acknowledged"!==i&&"New"})]})}function Pa({className:t,notification:{appTitle:n},...i}){const o=w("io-notification-header-title",t);return jsxRuntimeExports.jsx("div",{className:o,...i,children:n})}function Ra({className:t,notification:{timestamp:n,state:i,snooze:o},...r}){const a=w("io-notification-timestamp",t);return jsxRuntimeExports.jsx("small",o&&"Snoozed"===i?{className:a,...r,children:"Snoozed"}:{className:a,...r,children:Ho(n??0)??"Just Now"})}function La({notification:{id:t,state:n},...i}){const{settings:o,snooze:a}=Mr(),s=useCallback((e=>{e.stopPropagation(),a&&a(t,o.snooze?.duration??0);}),[t,a,o.snooze?.duration]);return a&&"Snoozed"!==n&&o.snooze?.enabled?jsxRuntimeExports.jsx(A,{icon:"snooze",variant:"link",text:"Snooze",tabIndex:-1,onClick:s,...i}):null}function Oa({notification:{updateState:t,close:n},...i}){const{isPanelVisible:o}=Mr();return jsxRuntimeExports.jsx(S,{icon:"close",iconSize:"10",size:"24",tabIndex:-1,onClick:e=>{o?n().catch(console.error):(e.stopPropagation(),t("Acknowledged").catch(console.error));},...i})}function Fa({className:n,notification:i,...o}){const r=w("io-notification-body",n),{BodyIcon:a,BodyTitle:s,BodyDescription:c}=Ua(),{onClick:l}=i,{settings:u,isPanelVisible:d}=Mr();return jsxRuntimeExports.jsxs("div",{className:r,role:"button",tabIndex:0,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||l({close:!1});},onClick:()=>{if(u.toastStacking)l({close:!1});else {l({close:d||(u?.closeNotificationOnClick??!0)});}},...o,children:[jsxRuntimeExports.jsx(a,{icon:i.icon}),jsxRuntimeExports.jsxs("div",{className:"io-notification-body-content",children:[jsxRuntimeExports.jsx(s,{text:i.title}),jsxRuntimeExports.jsx(c,{text:i.body})]})]})}function Da({className:t,icon:n,altText:i="notification icon",...o}){if(!n)return null;const r=w("io-notification-body-icon",t);return jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsx("img",{src:n,alt:i})})}function Ma({text:t,...n}){return jsxRuntimeExports.jsx(E,{text:t,...n})}function za({className:t,text:n,...i}){const o=w("io-notification-body-description",t);return jsxRuntimeExports.jsx("p",{className:o,...i,children:n})}function _a({className:n,notification:i}){const o=w("io-notification-footer",n),{FooterButton:r}=Ua(),a=useMemo((()=>function(e){const t=[],n={};e.forEach((e=>{const{displayId:i,displayPath:o}=e,r={...e,children:[]};if(o&&o.length>0){let e;o.forEach(((t,i)=>{0===i?e=n[t]:e&&(e=e.children?.find((e=>e.displayId===t)));})),e&&e.children?.push(r);}else i?(t.push(r),n[i]=r):t.push(r);i&&(n[i]=r);}));const i=e=>{e.forEach((e=>{e.children&&0===e.children.length?delete e.children:e.children&&i(e.children);}));};return i(t),t}(i.actions)),[i.actions]),s=(t,n)=>t.children?jsxRuntimeExports.jsx(Si,{text:t.title,children:t.children.map(s)},`${t.title}-${n}`):((t,n)=>jsxRuntimeExports.jsx(Si.Item,{children:jsxRuntimeExports.jsx(r,{variant:"link",className:"io-dropdown-menu-item io-dropdown-menu-button",notificationAction:t,notificationId:i.id})},`${t.title}-${n}`))(t,n);return jsxRuntimeExports.jsx("div",{className:o,children:jsxRuntimeExports.jsx($,{align:"right",children:a.map(((n,o)=>n.children?jsxRuntimeExports.jsxs($,{variant:"append",children:[jsxRuntimeExports.jsx(r,{notificationAction:n,variant:0===o?"primary":"default",notificationId:i.id}),jsxRuntimeExports.jsx(Si,{variant:0===o?"primary":"default",icon:"ellipsis",children:n.children.map(s)})]},`${n.title}-${o}`):jsxRuntimeExports.jsx(r,{notificationAction:n,variant:0===o?"primary":"link",notificationId:i.id},`${n.title}-${o}`)))})})}function Ha({notificationAction:t,notificationId:n,...i}){const{settings:o,setState:r,isPanelVisible:a}=Mr();return jsxRuntimeExports.jsx(A,{text:t.title,onClick:e=>{e.stopPropagation();const i="boolean"!=typeof o?.closeNotificationOnClick||o?.closeNotificationOnClick;a||i?t.onClick({close:i}):(t.onClick({close:!1}),r(n,"Acknowledged"));},...i})}const $a={Header:Ia,HeaderCount:Aa,HeaderBadge:Ba,HeaderIcon:Ta,HeaderTitle:Pa,HeaderTimestamp:Ra,HeaderButtonSnooze:La,HeaderButtonClose:Oa,Body:Fa,BodyIcon:Da,BodyTitle:Ma,BodyDescription:za,Footer:_a,FooterButton:Ha},ja=createContext($a),Va=memo((({children:t,components:n})=>{const i=useMemo((()=>({...$a,...n})),[n]);return jsxRuntimeExports.jsx(ja.Provider,{value:i,children:t})}));function Ua(e){return {...useContext(ja),...e}}function Ja({className:n,notification:i,...o}){const{Header:r,Body:a,Footer:s}=Ua(),{severity:c}=i,l=w("io-notification",`severity-${c?.toLowerCase()??"none"}`,"Acknowledged"!==i.state&&"state-new",n);return jsxRuntimeExports.jsxs("div",{className:l,...o,children:[jsxRuntimeExports.jsx(r,{notification:i}),jsxRuntimeExports.jsx(a,{notification:i}),jsxRuntimeExports.jsx(s,{notification:i})]})}function Wa({components:t,notification:n,...i}){return jsxRuntimeExports.jsx(Va,{components:t,children:jsxRuntimeExports.jsx(Ja,{notification:n,...i})})}function qa({className:n,notifications:i,...o}){const[a,s]=useState(!1),l=i.length>=3?"large":"normal",u=2===i.length?"small":l,d=i[0].severity,f=w("io-notification-stack",a&&"io-notification-stack-open","normal"!==u&&[`io-notification-stack-${u}`],d&&"None"!==d&&[`io-notification-stack-${d.toLowerCase()}`],n),h=useCallback((()=>{s(!0);}),[]),m=useCallback((e=>{e.stopPropagation(),i.forEach((e=>{e.close();}));}),[i]);return jsxRuntimeExports.jsxs("div",{className:f,onClick:h,...o,children:[a&&"normal"!==u&&jsxRuntimeExports.jsx("div",{className:"io-notification-stack-btn",children:jsxRuntimeExports.jsx(A,{icon:"close",onClick:e=>m(e),children:jsxRuntimeExports.jsx("span",{className:"io-btn-text",children:"Clear All"})})}),i.map((t=>jsxRuntimeExports.jsx(Wa,{notification:t},t.id)))]})}function Ka({className:n,Notification:i,notifications:o,noNotificationText:r="No notifications to display",...a}){const s=w("io-notification-list",n),{notifications:c,notificationStacks:l,settings:u,configuration:d,isPanelVisible:f,selectedNotifications:h,selectNotification:m,isBulkActionsSupported:p}=Mr(),{isBulkActionsVisible:g}=_r(),{toastStacking:v}=u,b=o??c;return jsxRuntimeExports.jsx("div",{className:s,...a,children:v&&!f?l.length>0?l.map((t=>jsxRuntimeExports.jsx(qa,{notifications:t.items},t.key))):jsxRuntimeExports.jsx("div",{className:"flex jc-center mt-8",children:r??""}):b.length>0?b.map((n=>{const o=d.sourceFilter?.muted?.includes(n.source)||d.sourceFilter?.muted?.includes("*");return !f&&o?null:f&&p&&g?jsxRuntimeExports.jsxs("div",{className:"io-notification-list-bulk-action-item "+(h.includes(n.id)?"selected":""),children:[jsxRuntimeExports.jsx(Fi,{checked:h.includes(n.id),onChange:e=>m(n.id,e.target.checked)}),jsxRuntimeExports.jsx(i,{notification:n})]},n.id):jsxRuntimeExports.jsx(i,{notification:n},n.id)})):jsxRuntimeExports.jsx("div",{className:"flex jc-center mt-8",children:r??""})})}Va.displayName="ComponentsStoreProvider";const Ga={Header:Hr,HeaderCaption:$r,HeaderCaptionFilter:jr,HeaderCaptionTitle:Vr,HeaderCaptionCount:function({...t}){const{notificationsCount:n}=_r();return jsxRuntimeExports.jsx(x,{...t,children:(n||0).toString()})},HeaderCaptionButtons:Ur,HeaderCaptionButtonSearch:function({...t}){const{isSearchVisible:n,showSearch:i,hideSearch:o,notificationsCount:r}=_r();return jsxRuntimeExports.jsx(S,{icon:n?"search-filled":"search",variant:"circle",size:"32",onClick:n?o:i,disabled:0===r,...t})},HeaderCaptionButtonSettings:function({icon:t="cog",size:n="32",variant:i="circle",...o}){const{showSettings:r}=_r();return jsxRuntimeExports.jsx(S,{icon:t,size:n,variant:i,onClick:r,...o})},HeaderCaptionButtonClose:function({icon:t="close",size:n="32",variant:i="circle",...o}){const{hidePanel:r}=Mr();return jsxRuntimeExports.jsx(S,{icon:t,size:n,variant:i,onClick:r,...o})},HeaderActions:function({className:n,...i}){const o=w("io-panel-header-actions",n),{HeaderActionSort:r,HeaderActionView:a,HeaderActionClear:s,HeaderActionEdit:c}=Xa();return jsxRuntimeExports.jsxs("div",{className:o,...i,children:[jsxRuntimeExports.jsxs($,{children:[jsxRuntimeExports.jsx(r,{}),jsxRuntimeExports.jsx(a,{})]}),jsxRuntimeExports.jsxs($,{children:[jsxRuntimeExports.jsx(s,{}),jsxRuntimeExports.jsx(c,{})]})]})},HeaderActionSort:function({text:n="Sort by",...i}){const{sortNotificationsBy:o,setSortBy:a}=_r(),{onNotificationsSort:s}=(()=>{const{notifications:e}=Mr(),[t,n]=useState(qr),{key:i,descending:o}=t,a=useMemo((()=>Qr[i](e,o)),[e,i,o]),s=useCallback((e=>{n((t=>({key:e,descending:t.key!==e?qr.descending:!t.descending})));}),[]);return {onNotificationsSort:s,sortedNotifications:a}})();return jsxRuntimeExports.jsxs(H,{variant:"light",...i,children:[jsxRuntimeExports.jsxs(H.Button,{variant:"link",children:[n," ",jsxRuntimeExports.jsx("strong",{children:o})]}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",checkIcon:"check",children:["Newest","Oldest","Severity"].map((t=>jsxRuntimeExports.jsx(H.Item,{isSelected:o===t.toLowerCase(),onClick:()=>{a(t.toLowerCase()),s(t.toLowerCase());},children:t},t)))})})]})},HeaderActionView:function({text:n="View",...i}){const{settings:o}=Mr(),{viewNotificationsBy:r,setViewBy:a}=_r(),s=o.snooze?.enabled?["All","Read","Unread","Snoozed"]:["All","Read","Unread"];return jsxRuntimeExports.jsxs(H,{variant:"light",...i,children:[jsxRuntimeExports.jsxs(H.Button,{variant:"link",children:[n," ",jsxRuntimeExports.jsx("strong",{children:r})]}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",checkIcon:"check",children:s.map((t=>jsxRuntimeExports.jsx(H.Item,{isSelected:r===t.toLowerCase(),onClick:()=>a(t.toLowerCase()),children:t},t)))})})]})},HeaderActionClear:function({text:t="Clear All",...n}){const{clearAll:i}=Mr(),{notificationsCount:o}=_r();return jsxRuntimeExports.jsx(A,{variant:"link",text:t,onClick:i,disabled:0===o,...n})},HeaderActionEdit:function({tooltip:t="Bulk Edit",...n}){const{isBulkActionsSupported:i}=Mr(),{showBulkActions:o,notificationsCount:r}=_r();return i?jsxRuntimeExports.jsx(S,{icon:"pen-to-square",title:t,size:"32",onClick:o,disabled:0===r,...n}):null},HeaderBulkActions:function({className:n,...i}){const o=w("io-panel-header-bulk-actions",n),{HeaderBulkActionSelect:r,HeaderBulkActionSelectDropdown:a,HeaderBulkActionMarkAsRead:s,HeaderBulkActionMarkAsUnread:c,HeaderBulkActionSnooze:l,HeaderBulkActionClear:u,HeaderBulkActionClose:d}=Xa(),{isBulkActionsSupported:f}=Mr();return f?jsxRuntimeExports.jsx("div",{className:o,...i,children:jsxRuntimeExports.jsxs($,{children:[jsxRuntimeExports.jsx(r,{}),jsxRuntimeExports.jsx(a,{}),jsxRuntimeExports.jsx(s,{}),jsxRuntimeExports.jsx(c,{}),jsxRuntimeExports.jsx(l,{}),jsxRuntimeExports.jsx(u,{}),jsxRuntimeExports.jsx(d,{})]})}):null},HeaderBulkActionSelect:function({...t}){const{isBulkActionsSupported:n,selectedNotifications:i,selectAllNotifications:o}=Mr(),{notificationsCount:r}=_r();return n?jsxRuntimeExports.jsx(Fi,{checked:r===i.length&&r>0,onChange:e=>o("all",e.target.checked),disabled:0===r,...t}):null},HeaderBulkActionSelectDropdown:function({...n}){const{isBulkActionsSupported:i,selectAllNotifications:o}=Mr(),{notificationsCount:r}=_r();return i?jsxRuntimeExports.jsxs(H,{variant:"light",...n,children:[jsxRuntimeExports.jsx(H.ButtonIcon,{variant:"default",icon:"chevron-down",size:"16",iconSize:"10",disabled:0===r}),jsxRuntimeExports.jsx(T,{children:jsxRuntimeExports.jsxs(H.List,{variant:"single",checkIcon:"check",children:[jsxRuntimeExports.jsx(H.ItemSection,{children:"Select"}),["All","Read","Unread","Snoozed"].map((t=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>o(t.toLowerCase(),!0),children:t},t)))]})})]}):null},HeaderBulkActionMarkAsRead:function({icon:t="envelope-open",size:n="32",variant:i="circle",tooltip:o="Mark as read",...a}){const{isBulkActionsSupported:s,selectedNotifications:c,setStates:l}=Mr(),{notificationsCount:u}=_r(),d=useCallback((()=>{l(c,"Seen");}),[c,l]);return s?jsxRuntimeExports.jsx(S,{icon:t,size:n,variant:i,title:o,onClick:d,disabled:0===u,...a}):null},HeaderBulkActionMarkAsUnread:function({icon:t="envelope",size:n="32",variant:i="circle",tooltip:o="Mark as unread",...a}){const{isBulkActionsSupported:s,selectedNotifications:c,setStates:l}=Mr(),{notificationsCount:u}=_r(),d=useCallback((()=>{l(c,"Active");}),[c,l]);return s?jsxRuntimeExports.jsx(S,{icon:t,size:n,variant:i,title:o,onClick:d,disabled:0===u,...a}):null},HeaderBulkActionSnooze:function({icon:t="snooze",size:n="32",variant:i="circle",tooltip:o="Snooze",...a}){const{isBulkActionsSupported:s,selectedNotifications:c,snoozeMany:l,settings:u}=Mr(),{notificationsCount:d}=_r(),f=useCallback((()=>{l(c,u.snooze?.duration??0);}),[c,l,u.snooze?.duration]);return s&&u.snooze?.enabled?jsxRuntimeExports.jsx(S,{icon:t,size:n,variant:i,title:o,onClick:f,disabled:0===d,...a}):null},HeaderBulkActionClear:function({icon:t="trash",size:n="32",variant:i="circle",tooltip:o="Clear",...a}){const{isBulkActionsSupported:s,selectedNotifications:c,clearMany:l}=Mr(),{notificationsCount:u}=_r(),d=useCallback((()=>{l(c);}),[c,l]);return s?jsxRuntimeExports.jsx(S,{icon:t,size:n,variant:i,title:o,onClick:d,disabled:0===u,...a}):null},HeaderBulkActionClose:function({text:t="Done",variant:n="primary",...i}){const{isBulkActionsSupported:o}=Mr(),{hideBulkActions:r,notificationsCount:a}=_r();return o?jsxRuntimeExports.jsx(A,{variant:n,text:t,onClick:r,disabled:0===a,...i}):null},HeaderSearch:function({className:n,icon:i="search",placeholder:o="Search",...r}){const a=w("io-panel-header-search",n),{isSearchVisible:s,searchQuery:c,setSearch:l,notificationsCount:f}=_r(),h=useRef(null);return useEffect((()=>{s?h.current?.focus():(h.current?.blur(),l(""));}),[s,l]),s?jsxRuntimeExports.jsxs("div",{className:a,children:[jsxRuntimeExports.jsx(Li,{ref:h,value:c,iconPrepend:i,placeholder:o,onChange:e=>l(e.target.value),...r}),s&&c.length>0&&jsxRuntimeExports.jsx("p",{className:"io-panel-header-search-count",children:`${f} results`})]}):null},Body:Xr,Footer:Zr,FooterButtons:ea,FooterButtonClearAll:ta,FooterButtonClearAllOld:na,Notification:Wa,NotificationsList:Ka,Settings:ia,SettingsGeneral:oa,SettingsAllowNotifications:ra,SettingsShowNotificationBadge:aa,SettingsCloseNotificationOnClick:sa,SettingsPanelAutoHide:ca,SettingsPanelAlwaysOnTop:la,SettingsHideToastsAfter:ua,SettingsMarkAsNew:da,SettingsMarkAsRead:fa,SettingsStacking:ha,SettingsToastStacking:ma,SettingsToastStackBy:ga,SettingsPlacement:va,SettingsPlacementPanel:ba,SettingsPlacementToasts:ya,SettingsSnooze:wa,SettingsSnoozeDuration:ka,SettingsSubscriptions:Sa,SettingsSubscribeAll:Na,SettingsSubscribeApp:Ca,SettingsSubscribeMuteAll:xa,SettingsSubscribeMuteApp:Ea},Ya=createContext(Ga),Qa=memo((({children:t,components:n})=>{const i=useMemo((()=>({...Ga,...n})),[n]);return jsxRuntimeExports.jsx(Ya.Provider,{value:i,children:t})}));function Xa(e){return {...useContext(Ya),...e}}Qa.displayName="ComponentsStoreProvider";const ts={Body:function({className:t,notifications:n,maxToasts:i=1,...o}){const r=w("io-toasts-body",t),{NotificationsList:a,Notification:s}=os(),[l,d]=useState([]);return useEffect((()=>{const e=i<0?n.length:i,t=n.filter((e=>"Active"===e.state)).slice(0,e);for(const e of t)e.onShow();d(t);}),[n,i]),jsxRuntimeExports.jsx("div",{className:r,...o,children:jsxRuntimeExports.jsx(a,{Notification:s,notifications:l,noNotificationText:""})})},Notification:Wa,NotificationsList:Ka},ns=createContext(ts),is=memo((({children:t,components:n})=>{const i=useMemo((()=>({...ts,...n})),[n]);return jsxRuntimeExports.jsx(ns.Provider,{value:i,children:t})}));function os(e){return {...useContext(ns),...e}}is.displayName="ComponentsStoreProvider";const cs=n=>{const{General:i,Layouts:o,Widget:r}=Ms();return jsxRuntimeExports.jsxs(Ei,{...n,children:[jsxRuntimeExports.jsx(i,{}),jsxRuntimeExports.jsx(o,{}),jsxRuntimeExports.jsx(r,{})]})},ls=({className:t,title:n="General",...i})=>{const{Theme:o}=Ms();return jsxRuntimeExports.jsx(I,{className:w("io-block io-block-list-gap",t),title:n,...i,children:jsxRuntimeExports.jsx(o,{})})},us=({className:n,title:i="Layouts",...o})=>{const{LayoutsShowDeletePrompt:r,LayoutsShowUnsavedChangesPrompt:a}=Ms();return jsxRuntimeExports.jsxs(I,{className:w("io-block io-block-list-gap",n),title:i,...o,children:[jsxRuntimeExports.jsx(r,{}),jsxRuntimeExports.jsx(a,{})]})},ds="layoutsShowDeletePrompt",fs="layoutsShowUnsavedChangesPrompt",hs="widgetEnableForExternalApps";var ms=function(e){return {ok:!0,result:e}},ps=function(e){return {ok:!1,error:e}},gs=function(e,t,n){return !1===t.ok?t:!1===n.ok?n:ms(e(t.result,n.result))},vs=function(e,t){return !0===t.ok?t:ps(e(t.error))},bs=function(){return bs=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},bs.apply(this,arguments)};function ys(e,t){if(e===t)return !0;if(null===e&&null===t)return !0;if(typeof e!=typeof t)return !1;if("object"==typeof e){if(Array.isArray(e)){if(!Array.isArray(t))return !1;if(e.length!==t.length)return !1;for(var n=0;n<e.length;n++)if(!ys(e[n],t[n]))return !1;return !0}var i=Object.keys(e);if(i.length!==Object.keys(t).length)return !1;for(n=0;n<i.length;n++){if(!t.hasOwnProperty(i[n]))return !1;if(!ys(e[i[n]],t[i[n]]))return !1}return !0}}var ws=function(e){return Array.isArray(e)},ks=function(e){return "object"==typeof e&&null!==e&&!ws(e)},Ss=function(e,t){return "expected "+e+", got "+function(e){switch(typeof e){case"string":return "a string";case"number":return "a number";case"boolean":return "a boolean";case"undefined":return "undefined";case"object":return e instanceof Array?"an array":null===e?"null":"an object";default:return JSON.stringify(e)}}(t)},Ns=function(e){return e.map((function(e){return "string"==typeof e?"."+e:"["+e+"]"})).join("")},Cs=function(e,t){var n=t.at,i=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(i=Object.getOwnPropertySymbols(e);o<i.length;o++)t.indexOf(i[o])<0&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(n[i[o]]=e[i[o]]);}return n}(t,["at"]);return bs({at:e+(n||"")},i)},xs=function(){function e(t){var n=this;this.decode=t,this.run=function(e){return vs((function(t){return {kind:"DecoderError",input:e,at:"input"+(t.at||""),message:t.message||""}}),n.decode(e))},this.runPromise=function(e){return function(e){return !0===e.ok?Promise.resolve(e.result):Promise.reject(e.error)}(n.run(e))},this.runWithException=function(e){return function(e){if(!0===e.ok)return e.result;throw e.error}(n.run(e))},this.map=function(t){return new e((function(e){return function(e,t){return !0===t.ok?ms(e(t.result)):t}(t,n.decode(e))}))},this.andThen=function(t){return new e((function(e){return function(e,t){return !0===t.ok?e(t.result):t}((function(n){return t(n).decode(e)}),n.decode(e))}))},this.where=function(t,i){return n.andThen((function(n){return t(n)?e.succeed(n):e.fail(i)}))};}return e.string=function(){return new e((function(e){return "string"==typeof e?ms(e):ps({message:Ss("a string",e)})}))},e.number=function(){return new e((function(e){return "number"==typeof e?ms(e):ps({message:Ss("a number",e)})}))},e.boolean=function(){return new e((function(e){return "boolean"==typeof e?ms(e):ps({message:Ss("a boolean",e)})}))},e.constant=function(t){return new e((function(e){return ys(e,t)?ms(t):ps({message:"expected "+JSON.stringify(t)+", got "+JSON.stringify(e)})}))},e.object=function(t){return new e((function(e){if(ks(e)&&t){var n={};for(var i in t)if(t.hasOwnProperty(i)){var o=t[i].decode(e[i]);if(!0!==o.ok)return void 0===e[i]?ps({message:"the key '"+i+"' is required but was not present"}):ps(Cs("."+i,o.error));void 0!==o.result&&(n[i]=o.result);}return ms(n)}return ks(e)?ms(e):ps({message:Ss("an object",e)})}))},e.array=function(t){return new e((function(e){if(ws(e)&&t){return e.reduce((function(e,n,i){return gs((function(e,t){return e.concat([t])}),e,function(e,n){return vs((function(e){return Cs("["+n+"]",e)}),t.decode(e))}(n,i))}),ms([]))}return ws(e)?ms(e):ps({message:Ss("an array",e)})}))},e.tuple=function(t){return new e((function(e){if(ws(e)){if(e.length!==t.length)return ps({message:"expected a tuple of length "+t.length+", got one of length "+e.length});for(var n=[],i=0;i<t.length;i++){var o=t[i].decode(e[i]);if(!o.ok)return ps(Cs("["+i+"]",o.error));n[i]=o.result;}return ms(n)}return ps({message:Ss("a tuple of length "+t.length,e)})}))},e.union=function(t,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];return e.oneOf.apply(e,[t,n].concat(i))},e.intersection=function(t,n){for(var i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];return new e((function(e){return [t,n].concat(i).reduce((function(t,n){return gs(Object.assign,t,n.decode(e))}),ms({}))}))},e.anyJson=function(){return new e((function(e){return ms(e)}))},e.unknownJson=function(){return new e((function(e){return ms(e)}))},e.dict=function(t){return new e((function(e){if(ks(e)){var n={};for(var i in e)if(e.hasOwnProperty(i)){var o=t.decode(e[i]);if(!0!==o.ok)return ps(Cs("."+i,o.error));n[i]=o.result;}return ms(n)}return ps({message:Ss("an object",e)})}))},e.optional=function(t){return new e((function(e){return null==e?ms(void 0):t.decode(e)}))},e.oneOf=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new e((function(e){for(var n=[],i=0;i<t.length;i++){var o=t[i].decode(e);if(!0===o.ok)return o;n[i]=o.error;}var r=n.map((function(e){return "at error"+(e.at||"")+": "+e.message})).join('", "');return ps({message:'expected a value matching one of the decoders, got the errors ["'+r+'"]'})}))},e.withDefault=function(t,n){return new e((function(e){return ms(function(e,t){return !0===t.ok?t.result:e}(t,n.decode(e)))}))},e.valueAt=function(t,n){return new e((function(e){for(var i=e,o=0;o<t.length;o++){if(void 0===i)return ps({at:Ns(t.slice(0,o+1)),message:"path does not exist"});if("string"==typeof t[o]&&!ks(i))return ps({at:Ns(t.slice(0,o+1)),message:Ss("an object",i)});if("number"==typeof t[o]&&!ws(i))return ps({at:Ns(t.slice(0,o+1)),message:Ss("an array",i)});i=i[t[o]];}return vs((function(e){return void 0===i?{at:Ns(t),message:"path does not exist"}:Cs(Ns(t),e)}),n.decode(i))}))},e.succeed=function(t){return new e((function(e){return ms(t)}))},e.fail=function(t){return new e((function(e){return ps({message:t})}))},e.lazy=function(t){return new e((function(e){return t().decode(e)}))},e}();xs.string,xs.number;var Es=xs.boolean;xs.anyJson,xs.unknownJson,xs.constant,xs.object,xs.array,xs.tuple,xs.dict,xs.optional,xs.oneOf,xs.union,xs.intersection,xs.withDefault,xs.valueAt,xs.succeed,xs.fail,xs.lazy;const Is=Es(),As=({prefKey:t,...n})=>{const{isLoading:i,value:o=!1,update:r}=$i({app:"io-connect-platform",prefKey:t,decoder:Is});return jsxRuntimeExports.jsx(Mi,{checked:o,disabled:i,onChange:e=>r(e.target.checked),...n})},Bs=({align:t="right",label:n="Show prompt for deleting",...i})=>jsxRuntimeExports.jsx(As,{align:t,label:n,prefKey:ds,...i}),Ts=({align:t="right",label:n="Show prompt for unsaved changes",...i})=>jsxRuntimeExports.jsx(As,{align:t,label:n,prefKey:fs,...i}),Ps=({className:n,title:i="Theme",...o})=>{const{currentTheme:a,selectTheme:l}=(()=>{const e=useContext(IOConnectContext),[t,n]=useState(null),i=useCallback((t=>e?.themes?.select(t)),[e]);return useEffect((()=>{if(!e)return;let t=!1;const i=e=>{t||n(e);};return e.themes?.onChanged(i),e.themes?.getCurrent().then(i).catch(console.warn),()=>{t=!0;}}),[e]),{currentTheme:t,selectTheme:i}})(),d=(()=>{const e=useContext(IOConnectContext),[t,n]=useState([]);return useEffect((()=>{e&&e.themes?.list().then(n).catch(console.warn);}),[e]),t})();return jsxRuntimeExports.jsxs("div",{className:w("flex jc-between ai-center",n),...o,children:[jsxRuntimeExports.jsx("label",{className:"io-text-clipper",children:i}),jsxRuntimeExports.jsxs(H,{variant:"light",children:[jsxRuntimeExports.jsx(H.Button,{text:a?.displayName}),jsxRuntimeExports.jsx(H.Content,{children:jsxRuntimeExports.jsx(H.List,{variant:"single",children:d.map((({name:t,displayName:n})=>jsxRuntimeExports.jsx(H.Item,{onClick:()=>l(t),children:n},t)))})})]})]})},Rs=({className:t,title:n="Widget",...i})=>{const{WidgetEnableForExternalApps:o}=Ms();return jsxRuntimeExports.jsx(I,{className:w("io-block io-block-list-gap",t),title:n,...i,children:jsxRuntimeExports.jsx(o,{})})},Ls=({align:t="right",label:n="Enable for external apps",...i})=>jsxRuntimeExports.jsx(As,{align:t,label:n,prefKey:hs,...i}),Os={Body:cs,General:ls,Layouts:us,LayoutsShowDeletePrompt:Bs,LayoutsShowUnsavedChangesPrompt:Ts,Theme:Ps,Widget:Rs,WidgetEnableForExternalApps:Ls},Fs=createContext(Os),Ds=memo((({children:t,components:n})=>{const i=useMemo((()=>({...Os,...n})),[n]);return jsxRuntimeExports.jsx(Fs.Provider,{value:i,children:t})}));Ds.displayName="PreferencesPanelComponentsStoreProvider";const Ms=()=>useContext(Fs);
|
|
1175
1175
|
|
|
1176
1176
|
const getInitialType = (glueController) => {
|
|
1177
1177
|
const type = glueController.config.channels?.selector?.type;
|
|
@@ -1188,7 +1188,7 @@ const getChannelRestrictions = async (glueController, name) => {
|
|
|
1188
1188
|
return { read, write };
|
|
1189
1189
|
};
|
|
1190
1190
|
|
|
1191
|
-
const { ChannelSelector } =
|
|
1191
|
+
const { ChannelSelector } = bo;
|
|
1192
1192
|
const ChannelSelectorWrapper = ({ mode, channelsDisplayMode }) => {
|
|
1193
1193
|
const glueController = useGlueController();
|
|
1194
1194
|
const channelsMode = glueController.io.channels.mode;
|
|
@@ -1307,7 +1307,7 @@ const ModeDropdown = ({ mode, modeClickHandler }) => {
|
|
|
1307
1307
|
return (i__default.createElement(H.List, null,
|
|
1308
1308
|
i__default.createElement(H.ItemSection, null, "Widget Mode"),
|
|
1309
1309
|
i__default.createElement(H.Item, null,
|
|
1310
|
-
i__default.createElement(
|
|
1310
|
+
i__default.createElement(Mi, { label: "Compact", align: "right", checked: mode === "compact", onChange: () => modeClickHandler(mode === "compact" ? "default" : "compact") }))));
|
|
1311
1311
|
};
|
|
1312
1312
|
|
|
1313
1313
|
const Settings = ({ position, positionClickHandler, mode, modeClickHandler }) => {
|