@kingsimba/nc-ui 0.1.27 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
- "use strict";var et=Object.defineProperty;var tt=(e,t,r)=>t in e?et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var K=(e,t,r)=>tt(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),O=require("./GeneratedIcons-CGjL38ny.cjs"),l=require("react"),ie=require("react-dom"),Y=require("react-i18next"),ze=require("./YamlTextArea-Cn98kXG6.cjs"),nt=require("i18next");function me({size:e="default",color:t,overlay:r=!1,className:s=""}){const o=n.jsx("svg",{className:`nc-activity-indicator nc-${e} ${s}`,viewBox:"0 0 50 50",style:t?{color:t}:void 0,children:n.jsx("circle",{className:"nc-activity-indicator-circle",cx:"25",cy:"25",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round"})});return r?n.jsx("div",{className:"nc-activity-indicator-overlay",children:o}):o}function F({variant:e="default",block:t,size:r="default",appearance:s="default",className:o,disabled:i,textSelectable:c,loading:a,onClick:d,children:f,...h}){const x=["nc-button",e!=="default"?`nc-${e}`:"",t?"nc-block":"",r==="small"?"nc-small":"",r==="large"?"nc-large":"",s==="transparent"?"nc-transparent":"",i||a?"nc-disabled":"",c?"nc-text-selectable":"",a?"nc-loading":"",o??""].filter(Boolean).join(" "),u=m=>{if(!a){if(c){const y=window.getSelection();if(y&&y.toString().length>0)return}d==null||d(m)}};return n.jsxs("button",{className:x,disabled:i||a,onClick:u,...h,children:[a&&n.jsx(me,{size:"small",className:"nc-button-spinner",color:s==="transparent"||e!=="default"&&e!=="ghost"?"white":void 0}),f]})}const rt={info:"primary",success:"success",warning:"warning",error:"danger",danger:"danger"};function st({code:e,text:t,type:r,button:s,onAction:o,children:i,onClose:c,className:a="",style:d}){const f=i??n.jsxs(n.Fragment,{children:[e!==void 0&&n.jsx("span",{className:"nc-alert-code",children:e}),t]});return n.jsxs("div",{className:`nc-alert nc-${r} ${a}`.trim(),style:d,children:[n.jsxs("div",{className:"nc-alert-main",children:[n.jsx("div",{className:`nc-alert-message nc-${r}`,children:f}),c&&n.jsx("button",{type:"button",className:"nc-alert-close","aria-label":"Close alert",onClick:c,children:n.jsx(O.CloseIcon,{size:16})})]}),s&&n.jsx("span",{className:"nc-alert-action",children:n.jsx(F,{size:"small",variant:s.variant??rt[r],onClick:o,children:s.text})})]})}function ot({percentage:e=.5,status:t="discharging",darkMode:r=!1,colored:s=!1}){const o=Math.max(0,Math.min(1,Number(e)||0));let i;s?o<.1?i="var(--nc-danger)":o<.2?i="var(--nc-warning)":i="var(--nc-success)":i=r?"#ffffff":"#000000";const c=r?"rgba(255, 255, 255, 0.5)":"rgba(0, 0, 0, 0.2)",a=24,d=14,f=2,h=0,x=12,u=0,m=0,y=0,b=a,w=d,N=w-u*2,v=b-u*2,p=Math.max(1,Math.min(4,w/4)),g=o===0?0:.05+o*.95,k=a+f+x,C=20,$=.65,E=Math.max(d,C*$),j=a+f+1,M=(d-C*$)/2;return n.jsxs("svg",{className:"nc-battery",width:k,height:E,viewBox:`0 0 ${k} ${E}`,role:"img","aria-label":`Battery ${o===0?"-":Math.round(o*100)+"%"} ${t}`,children:[n.jsxs("defs",{children:[n.jsx("mask",{id:`nc-battery-fill-mask-${o}`,children:n.jsx("rect",{x:"0",y:"0",width:v*g,height:N,fill:"white"})}),n.jsxs("mask",{id:`nc-battery-text-mask-${o}`,children:[n.jsx("rect",{x:"0",y:"0",width:k,height:E,fill:"white"}),n.jsx("text",{x:m+b/2,y:d-3,fontSize:11,fontWeight:"bold",fill:"black",textAnchor:"middle",children:o===0?"-":Math.round(o*100)})]})]}),n.jsxs("g",{mask:`url(#nc-battery-text-mask-${o})`,children:[n.jsx("rect",{x:m,y,rx:p,ry:p,width:b,height:w,fill:c}),n.jsx("rect",{x:m+u,y:y+u,width:v,height:N,fill:i,rx:p,ry:p,mask:`url(#nc-battery-fill-mask-${o})`}),n.jsx("rect",{x:a+h,y:d*.26,width:f,height:d*.48,rx:.8,ry:.8,fill:o===1?i:c}),t==="charging"?n.jsx("g",{transform:`translate(${j}, ${M}) scale(${$})`,fill:i,children:n.jsx("path",{d:"M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z"})}):null]})]})}function it({value:e,onChange:t,options:r,disabled:s,size:o="default"}){return n.jsx("div",{className:`nc-button-group ${o==="small"?"nc-small":""}`,children:r.map(i=>{const c=s||!!i.disabled;return n.jsx("button",{type:"button",className:`nc-button-group-item ${e===i.key?"nc-active":""}`,onClick:()=>!c&&t(i.key),disabled:c,children:i.label},i.key)})})}function at({size:e}){return n.jsx("svg",{className:`nc-checkbox-icon ${e==="small"?"nc-small":""}`,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M2 6L5 9L10 3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ct({checked:e,onChange:t,disabled:r,label:s,size:o="default",labelColor:i,style:c,className:a=""}){const d=o==="small";return n.jsxs("label",{className:`nc-checkbox-label ${d?"nc-small":""} ${r?"nc-disabled":""} ${a}`.trim(),style:c,onClick:f=>{r||(f.preventDefault(),t(!e))},children:[n.jsx("span",{role:"checkbox","aria-checked":e,tabIndex:0,className:`nc-checkbox-box ${d?"nc-small":""} ${e?"nc-checked":""}`,onKeyDown:f=>{r||(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),t(!e))},children:e&&n.jsx(at,{size:o})}),s&&n.jsx("span",{className:"nc-checkbox-text",style:i?{color:i}:void 0,children:s})]})}function lt({option:e,onChange:t,selected:r,highlighted:s,small:o}){const i=l.useRef(null),{t:c}=Y.useTranslation();return l.useEffect(()=>{s&&i.current&&i.current.scrollIntoView({block:"nearest"})},[s]),n.jsxs("div",{ref:i,className:`nc-combo-dropdown-option ${o?"nc-small":""} ${s?"nc-highlighted":""}`,role:"option",onMouseDown:()=>t(e.value),"aria-selected":r,style:{cursor:"pointer",background:s?"rgba(59,130,246,0.18)":r?"rgba(59,130,246,0.12)":void 0},children:[e.label,e.default&&n.jsxs("span",{style:{fontSize:"0.85em",color:"var(--nc-text-weak)",marginLeft:6},children:["(",c("common.default"),")"]})]})}function dt({isOpen:e,options:t,onSelect:r,selectedValue:s,placement:o="bottom",anchorRef:i,small:c,highlightedIndex:a=-1}){const[d,f]=l.useState({top:0,left:0,width:0}),[h,x]=l.useState(o),{t:u}=Y.useTranslation();if(l.useEffect(()=>{if(e&&i.current){const y=i.current.getBoundingClientRect();let b=o;if(o==="bottom"){const w=window.innerHeight-y.bottom,N=y.top;w<320&&N>w&&(b="top")}x(b),f({top:b==="top"?y.top-4:y.bottom+4,left:y.left,width:y.width})}},[e,i,o]),!e)return null;const m=n.jsx("div",{className:"nc-combo-dropdown",style:{position:"fixed",top:h==="top"?void 0:d.top,bottom:h==="top"?window.innerHeight-d.top:void 0,left:d.left,width:d.width,zIndex:1e3,maxHeight:300,overflowY:"auto"},children:t.length===0?n.jsx("div",{className:`nc-combo-dropdown-option nc-no-results ${c?"nc-small":""}`,children:u("common.noResults")}):t.map((y,b)=>n.jsx(lt,{option:y,onChange:r,selected:y.value===s,highlighted:b===a,small:c},y.value))});return ie.createPortal(m,document.body)}function ut({onClick:e,small:t}){return n.jsx("button",{className:`nc-button nc-ghost nc-combo-button nc-combo-clear ${t?"nc-small":""}`,onClick:e,onMouseDown:r=>r.stopPropagation(),"aria-label":"Clear selection",children:"✕"})}function pt({open:e,onClick:t,small:r}){return n.jsx("button",{className:`nc-button nc-ghost nc-combo-button nc-combo-toggle ${r?"nc-small":""} ${e?"nc-open":""}`,onClick:t,onMouseDown:s=>s.stopPropagation(),"aria-label":e?"Close":"Open",children:"▾"})}function ft({value:e,onChange:t,placeholder:r="Select…",options:s,disabled:o,label:i,clearable:c=!0,allowTyping:a=!1,placement:d="bottom",size:f="default",appearance:h="default",textAlign:x="left",style:u,className:m}){const[y,b]=l.useState(!1),[w,N]=l.useState(""),[v,p]=l.useState(-1),g=l.useRef(null),k=l.useRef(null),C=f==="small",{t:$}=Y.useTranslation(),E=l.useMemo(()=>{const I=w.toLowerCase();return a?s.filter(P=>P.label.toLowerCase().includes(I)):s},[s,w,a]);l.useEffect(()=>{y&&p(-1)},[y,E]),l.useEffect(()=>{if(!c&&!e&&s.length>0&&t){const I=s.find(P=>P.default)||s[0];t(I.value)}},[c,e,s,t]),l.useEffect(()=>{function I(P){var z;P.target instanceof Node&&g.current&&((z=g.current.parentElement)!=null&&z.contains(P.target)||b(!1))}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);const j=s.find(I=>I.value===e),M=j&&c,S=!o&&!M,A=`nc-align-${x}`,T=!(y&&a)&&!!j,B=(I,P=!1)=>{var z;t==null||t(I),b(!1),N(""),P&&((z=g.current)==null||z.blur())},U=()=>{t==null||t(void 0),N(""),b(!1)},W=I=>{if(!y){(I.key==="ArrowDown"||I.key==="ArrowUp")&&(b(!0),I.preventDefault());return}switch(I.key){case"ArrowDown":I.preventDefault(),p(P=>{const z=P+1;return z>=E.length?0:z});break;case"ArrowUp":I.preventDefault(),p(P=>{const z=P-1;return z<0?E.length-1:z});break;case"Enter":I.preventDefault(),v>=0&&v<E.length&&B(E[v].value,!0);break;case"Escape":I.preventDefault(),b(!1),N("");break}};return n.jsxs("div",{className:`nc-combo-container ${h==="transparent"?"nc-transparent":""} ${A} ${m||""}`.trim(),style:{position:"relative",...u},children:[i&&n.jsx("span",{className:`nc-label ${C?"nc-small":""}`,children:i}),n.jsxs("div",{ref:k,style:{position:"relative",display:"flex",alignItems:"center"},onMouseDown:I=>{o||a&&I.target===g.current||(b(P=>(!P&&a&&j&&N(j.label),!P)),a&&!y&&setTimeout(()=>{var P,z;(P=g.current)==null||P.focus(),(z=g.current)==null||z.select()},0))},children:[n.jsx("input",{ref:g,className:`nc-input ${C?"nc-small":""}`,placeholder:r,onFocus:()=>{var I;!o&&a&&(b(!0),j&&(N(j.label),setTimeout(()=>{var P;return(P=g.current)==null?void 0:P.select()},0))),a||(I=g.current)==null||I.blur()},onChange:I=>a&&N(I.target.value),onKeyDown:W,value:y&&a?w:(j==null?void 0:j.label)||"",readOnly:o||!a,style:{width:"100%",paddingRight:S||M?C?32:44:12,caretColor:a?void 0:"transparent",cursor:a?void 0:"pointer",userSelect:a?void 0:"none",color:T?"transparent":"var(--nc-text)"}}),T&&n.jsxs("div",{"aria-hidden":!0,className:`nc-combo-overlay ${A}`,style:{position:"absolute",left:C?8:12,right:S||M?C?12:24:C?8:12,top:"50%",transform:"translateY(-50%)",pointerEvents:"none"},children:[n.jsx("span",{className:`nc-combo-overlay-text ${C?"nc-small":""}`,children:j==null?void 0:j.label}),(j==null?void 0:j.default)&&n.jsxs("span",{className:`nc-combo-overlay-default ${C?"nc-small":""}`,children:["(",$("common.default"),")"]})]}),M&&n.jsx(ut,{onClick:U,small:C}),S&&n.jsx(pt,{open:y,onClick:()=>b(I=>!I),small:C})]}),n.jsx(dt,{isOpen:y,options:E,onSelect:B,selectedValue:e,placement:d,anchorRef:k,small:C,highlightedIndex:v})]})}function ht({onClick:e,loading:t=!1,disabled:r=!1,size:s="default",title:o,"aria-label":i}){const c=s==="small"?14:s==="large"?20:18,a=t?"Refreshing...":"Refresh",d=t?"Refreshing":"Refresh";return n.jsx("button",{className:"nc-icon-button",onClick:e,disabled:r||t,title:o??a,"aria-label":i??d,"data-size":s,children:n.jsx(O.RefreshIcon,{size:c,className:t?"nc-spinning":""})})}function ge({onClick:e,disabled:t=!1,size:r="default",title:s="Close","aria-label":o="Close"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-close",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(O.CloseIcon,{size:i})})}function mt({onClick:e,disabled:t=!1,size:r="default",title:s="Edit","aria-label":o="Edit"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-edit",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(O.EditIcon,{size:i})})}function gt({onClick:e,disabled:t=!1,size:r="default",title:s="Delete","aria-label":o="Delete"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-trash",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(O.TrashIcon,{size:i})})}function bt({onClick:e,disabled:t=!1,children:r,title:s,"aria-label":o,size:i="default"}){return n.jsx("button",{className:"nc-hyperlink",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":i,children:r})}function xt({open:e,onClose:t,options:r,anchorRef:s,anchor:o,preferredDirection:i="down"}){const c=l.useRef(null),[a,d]=l.useState({top:0,left:0}),f=o||(s==null?void 0:s.current);if(l.useEffect(()=>{if(!e||!f||!c.current)return;const u=f.getBoundingClientRect(),m=c.current.getBoundingClientRect(),y=window.innerHeight,b=window.innerWidth,w=u.bottom+8,N=w+m.height<=y-8;let v=i;(!N&&i==="down"||i==="up"&&N)&&(v="up");let p;v==="down"?p=w:p=u.top-m.height-8;let g=u.left;g+m.width>b-8&&(g=u.right-m.width),d({top:Math.max(8,p),left:Math.max(8,g)})},[e,f,i]),l.useEffect(()=>{if(!e)return;const u=y=>{c.current&&!c.current.contains(y.target)&&f&&!f.contains(y.target)&&t()},m=y=>{y.key==="Escape"&&t()};return document.addEventListener("mousedown",u),document.addEventListener("keydown",m),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",m)}},[e,t,f]),!e)return null;const h=u=>{u.type!=="separator"&&!u.disabled&&u.onClick&&(u.onClick(),t())},x=r.some(u=>u.icon);return ie.createPortal(n.jsx("div",{ref:c,className:"nc-context-menu",style:{position:"fixed",top:`${a.top}px`,left:`${a.left}px`,zIndex:1e4},role:"menu",children:r.map(u=>{if(u.type==="separator")return n.jsx("div",{className:"nc-context-menu-separator",role:"separator"},u.id);const m=["nc-context-menu-item",u.variant&&u.variant!=="default"?`nc-${u.variant}`:"",u.disabled?"nc-disabled":"",x&&!u.icon?"nc-indented":""].filter(Boolean).join(" ");return n.jsxs("button",{className:m,onClick:()=>h(u),disabled:u.disabled,role:"menuitem",children:[u.icon&&n.jsx("span",{className:"nc-context-menu-icon",children:u.icon}),n.jsx("span",{className:"nc-context-menu-label",children:u.label})]},u.id)})}),document.body)}const Le=l.createContext(null);function Be(){const e=l.useContext(Le);if(!e)throw new Error("useDialog must be used inside a Dialog component");return e}function X({children:e,onClick:t,...r}){const{close:s}=Be(),{t:o}=Y.useTranslation(),i=c=>{t==null||t(c),s()};return n.jsx(F,{onClick:i,...r,children:e??o("common.close")})}function vt({open:e,onClose:t,title:r,children:s,style:o,footerType:i="ok-cancel",footer:c,onOk:a,onSave:d,onDelete:f,onCancel:h,onConnect:x,closeOnOverlay:u=!0,primaryDisabled:m=!1,fullScreen:y=!1,hideTitleBar:b=!1,className:w="",onContentHeightChange:N}){const v=l.useRef(null),p=l.useRef(null),{t:g}=Y.useTranslation(),k={close:t},C=j=>{u&&j.target===j.currentTarget&&t()};if(l.useEffect(()=>{e&&v.current&&v.current.focus()},[e]),l.useEffect(()=>{if(!N||!p.current)return;const j=new ResizeObserver(M=>{for(const S of M){const A=S.contentRect.height;N(A)}});return j.observe(p.current),()=>{j.disconnect()}},[N]),!e)return null;const $=()=>{switch(i){case"ok":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(F,{variant:"primary",onClick:a??t,disabled:m,children:g("common.ok")})});case"ok-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(X,{onClick:h,children:g("common.cancel")}),n.jsx(F,{variant:"primary",onClick:a??t,disabled:m,children:g("common.ok")})]});case"save-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(X,{onClick:h,children:g("common.cancel")}),n.jsx(F,{variant:"primary",onClick:d,disabled:m,children:g("common.save")})]});case"delete-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(X,{onClick:h,children:g("common.cancel")}),n.jsx(F,{variant:"danger",onClick:f,disabled:m,children:g("common.delete")})]});case"connect":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(X,{onClick:h,children:g("common.cancel")}),n.jsx(F,{variant:"primary",onClick:x,disabled:m,children:g("common.connect")})]});case"close":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(X,{variant:"primary"})});case"gotit":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(X,{variant:"primary",children:g("common.gotit")})});case"custom":return n.jsx("div",{className:"nc-dialog-footer",children:c});case"none":return null;default:return null}},E=n.jsx(Le.Provider,{value:k,children:n.jsx("div",{className:`nc-dialog-overlay${y?" nc-fullscreen":""}`,onClick:C,children:n.jsxs("div",{ref:v,className:`nc-dialog-container ${w}`,style:o,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":b?void 0:"nc-dialog-title",children:[!b&&n.jsxs("div",{className:"nc-dialog-header",children:[n.jsx("h3",{id:"nc-dialog-title",className:"nc-dialog-title",children:r}),n.jsx(ge,{onClick:t,"aria-label":"Close dialog"})]}),n.jsx("div",{ref:p,className:"nc-dialog-content",children:s}),$()]})})});return y?ie.createPortal(E,document.body):E}function wt({onClick:e,size:t="default",rightOffset:r=4}){const s=t==="small"?28:34;return n.jsx("button",{className:"nc-button nc-ghost",onClick:e,onMouseDown:o=>{o.preventDefault(),o.stopPropagation()},tabIndex:-1,"aria-label":"Clear input",style:{position:"absolute",right:r,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:t==="small"?"12px":"14px"},children:"✕"})}function yt({visible:e,onClick:t,size:r="default"}){const s=r==="small"?28:34,o=r==="small"?16:18;return n.jsx("button",{className:"nc-button nc-ghost",onClick:t,onMouseDown:i=>{i.preventDefault(),i.stopPropagation()},tabIndex:-1,"aria-label":e?"Hide password":"Show password",style:{position:"absolute",right:4,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:e?n.jsx(O.EyeHiddenIcon,{size:o}):n.jsx(O.ViewIcon,{size:o})})}function jt({value:e,defaultValue:t="",onChange:r,onEnter:s,onClear:o,placeholder:i,disabled:c,label:a,clearable:d=!0,type:f="text",className:h="",size:x="default",style:u,leadingIcon:m,showPasswordToggle:y=!1,multiline:b=!1,rows:w=3,validator:N,showErrorMessage:v=!0}){const p=l.useRef(null),g=l.useRef(null),[k,C]=l.useState(!1),[$,E]=l.useState(!1),j=e!==void 0,[M,S]=l.useState(t),A=j?e:M,T=N?N(A):null,B=!!T,U=f==="password",W=U&&y&&!c&&!b,I=d&&A&&!c&&$,P=x==="small"?32:44;let z=12;I&&W?z=P*2:(I||W)&&(z=P);const D=m?x==="small"?28:34:void 0,Ze=()=>{var Z,ne;j||S(""),r==null||r(""),o==null||o(),b?(Z=g.current)==null||Z.focus():(ne=p.current)==null||ne.focus()},ke=Z=>{Z.key==="Enter"&&!b&&(s==null||s())},Ne=Z=>{const ne=Z.target.value;j||S(ne),r==null||r(ne)},Se=()=>{E(!0)},Ce=()=>{E(!1)},Ae=`nc-input ${x==="small"?"nc-small ":""} ${B?"nc-error ":""}${h}`;return n.jsxs("div",{className:"nc-col",style:{position:"relative",flex:1,...u},children:[a&&n.jsx("span",{className:"nc-label",children:a}),n.jsxs("div",{style:{position:"relative",display:"flex",alignItems:b?"flex-start":"center"},children:[m&&n.jsx("span",{className:"nc-input-leading-icon",style:{height:b?void 0:"100%",top:b?10:void 0},children:m}),b?n.jsx("textarea",{ref:g,className:Ae,placeholder:i,value:A,onChange:Ne,onKeyDown:ke,onFocus:Se,onBlur:Ce,readOnly:c,"aria-disabled":c,tabIndex:c?-1:void 0,rows:w,style:{width:"100%",paddingRight:z,...D!==void 0?{paddingLeft:D}:{}}}):n.jsx("input",{ref:p,type:U&&k?"text":f,className:Ae,placeholder:i,value:A,onChange:Ne,onKeyDown:ke,onFocus:Se,onBlur:Ce,readOnly:c,"aria-disabled":c,tabIndex:c?-1:void 0,style:{width:"100%",paddingRight:z,...D!==void 0?{paddingLeft:D}:{}}}),I&&n.jsx(wt,{onClick:Ze,size:x,rightOffset:W?P+4:4}),W&&n.jsx(yt,{visible:k,onClick:()=>C(!k),size:x})]}),B&&v&&n.jsx("span",{className:"nc-error-message",children:T})]})}function kt({children:e,onClick:t,showBorder:r=!0,selectable:s=!1,style:o}){const[i,c]=l.useState(!1),a=d=>{if(t){if(s){const f=window.getSelection();if(f&&f.toString().length>0)return}t(d)}};return n.jsx("div",{onClick:a,onMouseDown:()=>t&&c(!0),onMouseUp:()=>c(!1),onMouseLeave:()=>c(!1),style:{cursor:t?"pointer":"default",userSelect:s?"text":void 0,borderBottom:r?void 0:"none",...o},className:`nc-list-group-item ${t?"nc-list-group-item-clickable":""} ${i?"nc-list-group-item-active":""}`,children:n.jsx("div",{style:{flex:1},children:e})})}function Nt({title:e,titleTools:t,children:r,style:s}){return n.jsxs("div",{className:"nc-list-group",style:s,children:[(e||t)&&n.jsxs("div",{className:"nc-list-group-title",children:[n.jsx("div",{children:e}),t&&n.jsx("div",{className:"nc-list-group-title-tools",children:t})]}),n.jsx("div",{className:"nc-list-group-content",children:r})]})}function St({values:e,onChange:t,options:r,placeholder:s="Select…",label:o}){const[i,c]=l.useState(!1),[a,d]=l.useState(""),f=l.useRef(null),h=l.useMemo(()=>r.filter(u=>u.label.toLowerCase().includes(a.toLowerCase())),[r,a]);l.useEffect(()=>{function u(m){!(m.target instanceof Node)||!f.current||f.current.contains(m.target)||c(!1)}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);const x=u=>{e.includes(u)?t(e.filter(m=>m!==u)):t([...e,u])};return n.jsxs("div",{ref:f,className:"nc-col",style:{position:"relative"},children:[o&&n.jsx("span",{className:"nc-label",children:o}),n.jsxs("div",{className:"nc-row",style:{flexWrap:"wrap",gap:6,minHeight:42,alignItems:"center",border:"1px solid var(--nc-button-border)",borderRadius:8,background:"var(--nc-button-bg)",padding:"4px 8px"},children:[e.length===0&&n.jsx("span",{className:"nc-label",children:s}),e.map(u=>{const m=r.find(y=>y.value===u);return m?n.jsxs("span",{style:{padding:"4px 8px",borderRadius:6,display:"inline-flex",alignItems:"center",gap:4,background:"var(--nc-button-bg)",border:"1px solid var(--nc-button-border)"},children:[m.label,n.jsx("button",{className:"nc-button nc-ghost",style:{padding:0,minHeight:0,height:20,width:20,display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none"},onClick:()=>x(u),"aria-label":`Remove ${m.label}`,children:"✕"})]},u):null}),n.jsx("input",{className:"nc-input",value:a,onChange:u=>d(u.target.value),onFocus:()=>c(!0),style:{minWidth:50,border:"none",background:"transparent",padding:4,minHeight:32,flex:1}})]}),i&&n.jsxs("div",{className:"nc-combo-dropdown",style:{position:"absolute",top:"100%",left:0,right:0,zIndex:10,marginTop:4,boxShadow:"0 4px 12px var(--nc-shadow)"},children:[h.map(u=>{const m=e.includes(u.value);return n.jsxs("div",{className:"nc-section nc-row",style:{justifyContent:"space-between",cursor:"pointer",padding:12},onMouseDown:()=>x(u.value),children:[n.jsx("span",{children:u.label}),n.jsx("span",{children:m?"✔️":""})]},u.value)}),h.length===0&&n.jsx("div",{className:"nc-section nc-label",children:"No results"})]})]})}function ae(e){if(!e)return null;const t=/^\d{2}-\d{1,2}$/,r=/^\d{4}-\d{1,2}$/;if(!t.test(e)&&!r.test(e))return"Format must be YY-M(M) or YYYY-M(M)";const s=e.split("-"),o=parseInt(s[1],10);return o<1||o>12?"Month must be between 1 and 12":null}function oe(e){if(!e)return"";const t=e.split("-");if(t.length!==2)return e;let r=t[0];const s=t[1].padStart(2,"0");if(r.length===2){const o=parseInt(r,10);r=String(o<50?2e3+o:1900+o)}return`${r}-${s}`}function Re(e){if(!e)return"";const t=oe(e);if(!/^\d{4}-\d{2}$/.test(t))return e;const[r,s]=t.split("-");return`${r}/${s}`}function Ie(){const e=new Date,t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0");return`${t}-${r}`}function Ct({startMonth:e,endMonth:t,onChange:r,label:s,className:o="",disabled:i=!1,size:c="default"}){const[a,d]=l.useState(!1),[f,h]=l.useState(""),[x,u]=l.useState(""),[m,y]=l.useState({top:0,left:0,width:0,right:void 0}),b=l.useRef(null),w=l.useRef(null);l.useEffect(()=>{if(a&&b.current){const S=b.current.getBoundingClientRect(),T=Math.max(S.width,400);window.innerWidth-S.left<T&&S.right>=T?y({top:S.bottom+4,left:0,right:window.innerWidth-S.right,width:T}):y({top:S.bottom+4,left:S.left,right:void 0,width:T})}},[a]),l.useEffect(()=>{if(!a)return;const S=A=>{b.current&&!b.current.contains(A.target)&&w.current&&!w.current.contains(A.target)&&d(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[a]);const N=()=>{h(e||Ie()),u(t||Ie()),d(!0)},v=()=>{d(!1)},p=()=>{const S=ae(f),A=ae(x);if(S||A)return;const T=oe(f),B=oe(x);T&&B&&(r==null||r(T,B)),d(!1)},g=e&&t?`${Re(e)} - ${Re(t)}`:"Select month range",k=ae(f),C=ae(x),$=oe(f),E=oe(x),j=$&&E&&$>E,M=a?ie.createPortal(n.jsx("div",{ref:w,className:"nc-month-range-picker-popup",style:{position:"fixed",top:m.top,...m.right!==void 0?{right:m.right}:{left:m.left},width:m.width,zIndex:1e3},children:n.jsxs("div",{className:"nc-month-range-picker-content",children:[n.jsxs("div",{className:"nc-month-range-picker-row",children:[n.jsxs("div",{className:"nc-month-range-picker-column",children:[n.jsx("label",{className:"nc-label",children:"Start Month"}),n.jsx("input",{type:"text",className:`nc-month-input ${k?"nc-error":""}`,value:f,onChange:S=>h(S.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),k&&n.jsx("div",{className:"nc-month-error-text",children:k})]}),n.jsxs("div",{className:"nc-month-range-picker-column",children:[n.jsx("label",{className:"nc-label",children:"End Month"}),n.jsx("input",{type:"text",className:`nc-month-input ${C?"nc-error":""}`,value:x,onChange:S=>u(S.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),C&&n.jsx("div",{className:"nc-month-error-text",children:C})]})]}),j&&!k&&!C&&n.jsx("div",{className:"nc-month-range-error",children:"End month must be after or equal to start month"}),n.jsxs("div",{className:"nc-month-range-picker-footer",children:[n.jsx(F,{variant:"primary",onClick:p,disabled:!f||!x||!!k||!!C||!!j,children:"Apply"}),n.jsx(F,{variant:"ghost",onClick:v,children:"Cancel"})]})]})}),document.body):null;return n.jsxs("div",{className:`nc-month-range-picker ${c==="small"?"nc-small ":""}${o}`,children:[s&&n.jsx("label",{className:`nc-label${c==="small"?" nc-small":""}`,children:s}),n.jsx("button",{ref:b,className:`nc-month-range-picker-input${c==="small"?" nc-small":""}`,onClick:N,disabled:i,children:g}),M]})}function At({value:e,onChange:t,min:r,max:s,step:o=1,label:i,disabled:c,size:a="default"}){const d=a==="small",f=()=>{const u=e-o;r!==void 0&&u<r||t(parseFloat(u.toFixed(10)))},h=()=>{const u=e+o;s!==void 0&&u>s||t(parseFloat(u.toFixed(10)))},x=u=>{const m=parseFloat(u.target.value);isNaN(m)||r!==void 0&&m<r||s!==void 0&&m>s||t(m)};return n.jsxs("div",{className:`nc-col nc-number-input-col ${d?"nc-small":""}`,children:[i&&n.jsx("span",{className:`nc-label ${d?"nc-small":""}`,children:i}),n.jsxs("div",{className:`nc-number-input-container ${d?"nc-small":""}`,children:[n.jsx("input",{className:`nc-input nc-number-input ${d?"nc-small":""}`,type:"number",value:e,onChange:x,min:r,max:s,step:o,disabled:c}),n.jsx("button",{className:`nc-button nc-ghost nc-number-input-button ${d?"nc-small":""}`,onClick:f,disabled:c||r!==void 0&&e<=r,children:"−"}),n.jsx("button",{className:`nc-button nc-ghost nc-number-input-button ${d?"nc-small":""}`,onClick:h,disabled:c||s!==void 0&&e>=s,children:"+"})]})]})}function Rt({value:e,onChange:t,min:r=0,max:s=100,step:o=1,label:i,disabled:c,showValue:a=!0,formatValue:d=h=>h.toString(),width:f=200}){const h=u=>{const m=parseFloat(u.target.value);t(m)},x=(e-r)/(s-r)*100;return n.jsxs("div",{className:"nc-col",style:{gap:6},children:[i&&n.jsx("span",{className:"nc-label",children:i}),n.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[n.jsx("input",{type:"range",className:"nc-slider",value:e,onChange:h,min:r,max:s,step:o,disabled:c,style:{width:f,"--nc-slider-percentage":`${x}%`}}),a&&n.jsx("span",{style:{color:"var(--nc-text)",fontFamily:"monospace",fontSize:14,minWidth:60,textAlign:"right"},children:d(e)})]})]})}const It=({size:e=24,className:t,style:r})=>n.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,style:r,children:n.jsx("polyline",{points:"18 15 12 9 6 15"})});function De({children:e,className:t="",style:r}){return n.jsx("div",{className:`nc-tab-panel ${t}`,style:r,children:e})}function Mt({active:e,children:t,keepMounted:r=!1,className:s="",style:o}){const i=l.Children.toArray(t).filter(a=>l.isValidElement(a)&&(a.type===De||a.type.displayName==="TabPanel"));if(r)return n.jsx("div",{className:`nc-tab-panels ${s}`,style:o,children:i.map(a=>{const d=a.props.tab===e;return n.jsx("div",{className:`nc-tab-panel-wrapper ${d?"nc-active":""}`,style:{display:d?void 0:"none"},"aria-hidden":!d,children:a},a.props.tab)})});const c=i.find(a=>a.props.tab===e);return n.jsx("div",{className:`nc-tab-panels ${s}`,style:o,children:c})}function Et({tabs:e,active:t,onChange:r,onClose:s,permanentTabs:o,className:i,toolbar:c,multiline:a,orientation:d="horizontal",style:f}){const h=l.useRef(null),[x,u]=l.useState(!1),[m,y]=l.useState(!1),b=d==="verticalLeft"||d==="verticalRight",w=l.useRef(!1),N=l.useRef(0),v=l.useRef(0),p=l.useRef(!1);l.useEffect(()=>{const j=()=>{if(h.current)if(b){const{scrollTop:S,scrollHeight:A,clientHeight:T}=h.current;u(S>1),y(S<A-T-1)}else{const{scrollLeft:S,scrollWidth:A,clientWidth:T}=h.current;u(S>1),y(S<A-T-1)}},M=h.current;if(M)return j(),M.addEventListener("scroll",j),window.addEventListener("resize",j),()=>{M.removeEventListener("scroll",j),window.removeEventListener("resize",j)}},[e,b]);const g=j=>{h.current&&(w.current=!0,p.current=!1,N.current=b?j.clientY:j.clientX,v.current=b?h.current.scrollTop:h.current.scrollLeft,h.current.style.cursor="grabbing",h.current.style.userSelect="none")},k=j=>{if(!w.current||!h.current)return;const M=b?j.clientY:j.clientX,S=N.current-M;Math.abs(S)>3&&(p.current=!0),b?h.current.scrollTop=v.current+S:h.current.scrollLeft=v.current+S},C=()=>{h.current&&(w.current=!1,h.current.style.cursor="",h.current.style.userSelect="")},$=()=>{C()};l.useEffect(()=>{const j=h.current;if(!j||b)return;const M=S=>{S.deltaY!==0&&(S.preventDefault(),j.scrollLeft+=S.deltaY*.3)};return j.addEventListener("wheel",M,{passive:!1}),()=>{j.removeEventListener("wheel",M)}},[b]);const E=j=>{p.current||r(j)};return n.jsxs("div",{className:`nc-tab-container ${b?`nc-vertical nc-${d}`:""} ${i||""}`,style:f,children:[n.jsxs("div",{className:"nc-tab-scroll-wrapper",children:[x&&n.jsx("div",{className:`nc-tab-scroll-indicator ${b?"nc-top":"nc-left"}`,children:b?n.jsx(It,{size:16}):n.jsx(O.ChevronLeftIcon,{size:16})}),n.jsx("div",{ref:h,className:`nc-tab-scroll ${a?"nc-multiline":""}`,onMouseDown:g,onMouseMove:k,onMouseUp:C,onMouseLeave:$,style:{cursor:"grab"},children:e.map(j=>{const M=typeof j=="string"?j:j.id,S=typeof j=="string"?j:j.label,A=s&&!(o!=null&&o.includes(M));return n.jsxs("div",{className:`nc-tab-item ${t===M?"nc-active":""} ${A?"nc-closable":""}`,onClick:()=>E(M),role:"button",tabIndex:0,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&r(M)},children:[n.jsx("span",{className:"nc-tab-label",children:b?S:typeof S=="string"?S.toUpperCase():S}),A&&n.jsx("span",{className:"nc-tab-close",role:"button",tabIndex:0,"aria-label":`Close ${typeof S=="string"?S:M}`,onClick:T=>{T.stopPropagation(),s(M)},onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.stopPropagation(),s(M))},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},M)})}),m&&n.jsx("div",{className:`nc-tab-scroll-indicator ${b?"nc-bottom":"nc-right"}`,children:b?n.jsx(O.ChevronDownIcon,{size:16}):n.jsx(O.ChevronRightIcon,{size:16})})]}),c&&n.jsx("div",{className:"nc-tab-toolbar",children:c})]})}function $t({checked:e,onChange:t,disabled:r,label:s}){return n.jsxs("label",{className:"nc-row",style:{gap:10,alignItems:"center",cursor:r?"not-allowed":"pointer"},children:[s&&n.jsx("span",{className:"nc-label",children:s}),n.jsx("span",{role:"switch","aria-checked":e,tabIndex:0,onKeyDown:o=>{r||(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t(!e))},onClick:()=>!r&&t(!e),style:{position:"relative",width:56,height:30,borderRadius:18,padding:4,display:"inline-flex",alignItems:"center",justifyContent:"flex-start",border:`2px solid ${e?"var(--nc-primary)":"var(--nc-button-border)"}`,background:e?"rgba(99,102,241,0.08)":"transparent",transition:"border-color 160ms, background 160ms"},children:n.jsx("span",{style:{width:22,height:22,borderRadius:12,background:e?"var(--nc-text)":"var(--nc-muted)",transform:`translateX(${e?24:0}px)`,transition:"transform 160ms, background 160ms",boxShadow:e?"0 2px 6px rgba(99,102,241,0.28)":"0 1px 2px rgba(0,0,0,0.08)",border:"none"}})})]})}const Me=["var(--nc-csv-col-0)","var(--nc-csv-col-1)","var(--nc-csv-col-2)","var(--nc-csv-col-3)","var(--nc-csv-col-4)","var(--nc-csv-col-5)","var(--nc-csv-col-6)","var(--nc-csv-col-7)","var(--nc-csv-col-8)","var(--nc-csv-col-9)"];function Tt(e,t){const s=e.slice(0,t).split(`
1
+ "use strict";var et=Object.defineProperty;var tt=(e,t,r)=>t in e?et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var K=(e,t,r)=>tt(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),O=require("./GeneratedIcons-CGjL38ny.cjs"),l=require("react"),ie=require("react-dom"),Y=require("react-i18next"),ze=require("./YamlTextArea-Cn98kXG6.cjs"),nt=require("i18next");function me({size:e="default",color:t,overlay:r=!1,className:s=""}){const o=n.jsx("svg",{className:`nc-activity-indicator nc-${e} ${s}`,viewBox:"0 0 50 50",style:t?{color:t}:void 0,children:n.jsx("circle",{className:"nc-activity-indicator-circle",cx:"25",cy:"25",r:"20",fill:"none",stroke:"currentColor",strokeWidth:"5",strokeLinecap:"round"})});return r?n.jsx("div",{className:"nc-activity-indicator-overlay",children:o}):o}function F({variant:e="default",block:t,size:r="default",appearance:s="default",className:o,disabled:i,textSelectable:c,loading:a,onClick:d,children:p,...h}){const x=["nc-button",e!=="default"?`nc-${e}`:"",t?"nc-block":"",r==="small"?"nc-small":"",r==="large"?"nc-large":"",s==="transparent"?"nc-transparent":"",i||a?"nc-disabled":"",c?"nc-text-selectable":"",a?"nc-loading":"",o??""].filter(Boolean).join(" "),u=g=>{if(!a){if(c){const y=window.getSelection();if(y&&y.toString().length>0)return}d==null||d(g)}};return n.jsxs("button",{className:x,disabled:i||a,onClick:u,...h,children:[a&&n.jsx(me,{size:"small",className:"nc-button-spinner",color:s==="transparent"||e!=="default"&&e!=="ghost"?"white":void 0}),p]})}const rt={info:"primary",success:"success",warning:"warning",error:"danger",danger:"danger"};function st({code:e,text:t,type:r,button:s,onAction:o,children:i,onClose:c,className:a="",style:d}){const p=i??n.jsxs(n.Fragment,{children:[e!==void 0&&n.jsx("span",{className:"nc-alert-code",children:e}),t]});return n.jsxs("div",{className:`nc-alert nc-${r} ${a}`.trim(),style:d,children:[n.jsxs("div",{className:"nc-alert-main",children:[n.jsx("div",{className:`nc-alert-message nc-${r}`,children:p}),c&&n.jsx("button",{type:"button",className:"nc-alert-close","aria-label":"Close alert",onClick:c,children:n.jsx(O.CloseIcon,{size:16})})]}),s&&n.jsx("span",{className:"nc-alert-action",children:n.jsx(F,{size:"small",variant:s.variant??rt[r],onClick:o,children:s.text})})]})}function ot({percentage:e=.5,status:t="discharging",darkMode:r=!1,colored:s=!1}){const o=Math.max(0,Math.min(1,Number(e)||0)),i=o===0?"-":String(Math.round(o*100));let c;s?o<.1?c="var(--nc-danger)":o<.2?c="var(--nc-warning)":c="var(--nc-success)":c=r?"#ffffff":"#000000";const a="var(--nc-battery-shell-bg)",d=24,p=14,h=2,x=0,u=12,g=0,y=0,b=0,w=d,k=p,v=k-g*2,f=w-g*2,m=Math.max(1,Math.min(4,k/4)),N=o===0?0:.05+o*.95,C=d+h+u,$=20,E=.65,j=Math.max(p,$*E),M=d+h+1,S=(p-$*E)/2;return n.jsxs("svg",{className:"nc-battery",width:C,height:j,viewBox:`0 0 ${C} ${j}`,role:"img","aria-label":`Battery ${i==="-"?"-":`${i}%`} ${t}`,children:[n.jsx("defs",{children:n.jsx("mask",{id:`nc-battery-fill-mask-${o}`,children:n.jsx("rect",{x:"0",y:"0",width:f*N,height:v,fill:"white"})})}),n.jsx("rect",{x:y,y:b,rx:m,ry:m,width:w,height:k,fill:a}),n.jsx("rect",{x:y+g,y:b+g,width:f,height:v,fill:c,rx:m,ry:m,mask:`url(#nc-battery-fill-mask-${o})`}),n.jsx("text",{x:y+w/2,y:p-3,fontSize:11,fontWeight:"bold",fill:"var(--nc-battery-text-contrast)",textAnchor:"middle",children:i}),n.jsx("rect",{x:d+x,y:p*.26,width:h,height:p*.48,rx:.8,ry:.8,fill:o===1?c:a}),t==="charging"?n.jsx("g",{transform:`translate(${M}, ${S}) scale(${E})`,fill:c,children:n.jsx("path",{d:"M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z"})}):null]})}function it({value:e,onChange:t,options:r,disabled:s,size:o="default"}){return n.jsx("div",{className:`nc-button-group ${o==="small"?"nc-small":""}`,children:r.map(i=>{const c=s||!!i.disabled;return n.jsx("button",{type:"button",className:`nc-button-group-item ${e===i.key?"nc-active":""}`,onClick:()=>!c&&t(i.key),disabled:c,children:i.label},i.key)})})}function at({size:e}){return n.jsx("svg",{className:`nc-checkbox-icon ${e==="small"?"nc-small":""}`,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M2 6L5 9L10 3",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ct({checked:e,onChange:t,disabled:r,label:s,size:o="default",labelColor:i,style:c,className:a=""}){const d=o==="small";return n.jsxs("label",{className:`nc-checkbox-label ${d?"nc-small":""} ${r?"nc-disabled":""} ${a}`.trim(),style:c,onClick:p=>{r||(p.preventDefault(),t(!e))},children:[n.jsx("span",{role:"checkbox","aria-checked":e,tabIndex:0,className:`nc-checkbox-box ${d?"nc-small":""} ${e?"nc-checked":""}`,onKeyDown:p=>{r||(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),t(!e))},children:e&&n.jsx(at,{size:o})}),s&&n.jsx("span",{className:"nc-checkbox-text",style:i?{color:i}:void 0,children:s})]})}function lt({option:e,onChange:t,selected:r,highlighted:s,small:o}){const i=l.useRef(null),{t:c}=Y.useTranslation();return l.useEffect(()=>{s&&i.current&&i.current.scrollIntoView({block:"nearest"})},[s]),n.jsxs("div",{ref:i,className:`nc-combo-dropdown-option ${o?"nc-small":""} ${s?"nc-highlighted":""}`,role:"option",onMouseDown:()=>t(e.value),"aria-selected":r,style:{cursor:"pointer",background:s?"rgba(59,130,246,0.18)":r?"rgba(59,130,246,0.12)":void 0},children:[e.label,e.default&&n.jsxs("span",{style:{fontSize:"0.85em",color:"var(--nc-text-weak)",marginLeft:6},children:["(",c("common.default"),")"]})]})}function dt({isOpen:e,options:t,onSelect:r,selectedValue:s,placement:o="bottom",anchorRef:i,small:c,highlightedIndex:a=-1}){const[d,p]=l.useState({top:0,left:0,width:0}),[h,x]=l.useState(o),{t:u}=Y.useTranslation();if(l.useEffect(()=>{if(e&&i.current){const y=i.current.getBoundingClientRect();let b=o;if(o==="bottom"){const w=window.innerHeight-y.bottom,k=y.top;w<320&&k>w&&(b="top")}x(b),p({top:b==="top"?y.top-4:y.bottom+4,left:y.left,width:y.width})}},[e,i,o]),!e)return null;const g=n.jsx("div",{className:"nc-combo-dropdown",style:{position:"fixed",top:h==="top"?void 0:d.top,bottom:h==="top"?window.innerHeight-d.top:void 0,left:d.left,width:d.width,zIndex:1e3,maxHeight:300,overflowY:"auto"},children:t.length===0?n.jsx("div",{className:`nc-combo-dropdown-option nc-no-results ${c?"nc-small":""}`,children:u("common.noResults")}):t.map((y,b)=>n.jsx(lt,{option:y,onChange:r,selected:y.value===s,highlighted:b===a,small:c},y.value))});return ie.createPortal(g,document.body)}function ut({onClick:e,small:t}){return n.jsx("button",{className:`nc-button nc-ghost nc-combo-button nc-combo-clear ${t?"nc-small":""}`,onClick:e,onMouseDown:r=>r.stopPropagation(),"aria-label":"Clear selection",children:"✕"})}function pt({open:e,onClick:t,small:r}){return n.jsx("button",{className:`nc-button nc-ghost nc-combo-button nc-combo-toggle ${r?"nc-small":""} ${e?"nc-open":""}`,onClick:t,onMouseDown:s=>s.stopPropagation(),"aria-label":e?"Close":"Open",children:"▾"})}function ft({value:e,onChange:t,placeholder:r="Select…",options:s,disabled:o,label:i,clearable:c=!0,allowTyping:a=!1,placement:d="bottom",size:p="default",appearance:h="default",textAlign:x="left",style:u,className:g}){const[y,b]=l.useState(!1),[w,k]=l.useState(""),[v,f]=l.useState(-1),m=l.useRef(null),N=l.useRef(null),C=p==="small",{t:$}=Y.useTranslation(),E=l.useMemo(()=>{const I=w.toLowerCase();return a?s.filter(P=>P.label.toLowerCase().includes(I)):s},[s,w,a]);l.useEffect(()=>{y&&f(-1)},[y,E]),l.useEffect(()=>{if(!c&&!e&&s.length>0&&t){const I=s.find(P=>P.default)||s[0];t(I.value)}},[c,e,s,t]),l.useEffect(()=>{function I(P){var z;P.target instanceof Node&&m.current&&((z=m.current.parentElement)!=null&&z.contains(P.target)||b(!1))}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);const j=s.find(I=>I.value===e),M=j&&c,S=!o&&!M,A=`nc-align-${x}`,T=!(y&&a)&&!!j,B=(I,P=!1)=>{var z;t==null||t(I),b(!1),k(""),P&&((z=m.current)==null||z.blur())},U=()=>{t==null||t(void 0),k(""),b(!1)},W=I=>{if(!y){(I.key==="ArrowDown"||I.key==="ArrowUp")&&(b(!0),I.preventDefault());return}switch(I.key){case"ArrowDown":I.preventDefault(),f(P=>{const z=P+1;return z>=E.length?0:z});break;case"ArrowUp":I.preventDefault(),f(P=>{const z=P-1;return z<0?E.length-1:z});break;case"Enter":I.preventDefault(),v>=0&&v<E.length&&B(E[v].value,!0);break;case"Escape":I.preventDefault(),b(!1),k("");break}};return n.jsxs("div",{className:`nc-combo-container ${h==="transparent"?"nc-transparent":""} ${A} ${g||""}`.trim(),style:{position:"relative",...u},children:[i&&n.jsx("span",{className:`nc-label ${C?"nc-small":""}`,children:i}),n.jsxs("div",{ref:N,style:{position:"relative",display:"flex",alignItems:"center"},onMouseDown:I=>{o||a&&I.target===m.current||(b(P=>(!P&&a&&j&&k(j.label),!P)),a&&!y&&setTimeout(()=>{var P,z;(P=m.current)==null||P.focus(),(z=m.current)==null||z.select()},0))},children:[n.jsx("input",{ref:m,className:`nc-input ${C?"nc-small":""}`,placeholder:r,onFocus:()=>{var I;!o&&a&&(b(!0),j&&(k(j.label),setTimeout(()=>{var P;return(P=m.current)==null?void 0:P.select()},0))),a||(I=m.current)==null||I.blur()},onChange:I=>a&&k(I.target.value),onKeyDown:W,value:y&&a?w:(j==null?void 0:j.label)||"",readOnly:o||!a,style:{width:"100%",paddingRight:S||M?C?32:44:12,caretColor:a?void 0:"transparent",cursor:a?void 0:"pointer",userSelect:a?void 0:"none",color:T?"transparent":"var(--nc-text)"}}),T&&n.jsxs("div",{"aria-hidden":!0,className:`nc-combo-overlay ${A}`,style:{position:"absolute",left:C?8:12,right:S||M?C?12:24:C?8:12,top:"50%",transform:"translateY(-50%)",pointerEvents:"none"},children:[n.jsx("span",{className:`nc-combo-overlay-text ${C?"nc-small":""}`,children:j==null?void 0:j.label}),(j==null?void 0:j.default)&&n.jsxs("span",{className:`nc-combo-overlay-default ${C?"nc-small":""}`,children:["(",$("common.default"),")"]})]}),M&&n.jsx(ut,{onClick:U,small:C}),S&&n.jsx(pt,{open:y,onClick:()=>b(I=>!I),small:C})]}),n.jsx(dt,{isOpen:y,options:E,onSelect:B,selectedValue:e,placement:d,anchorRef:N,small:C,highlightedIndex:v})]})}function ht({onClick:e,loading:t=!1,disabled:r=!1,size:s="default",title:o,"aria-label":i}){const c=s==="small"?14:s==="large"?20:18,a=t?"Refreshing...":"Refresh",d=t?"Refreshing":"Refresh";return n.jsx("button",{className:"nc-icon-button",onClick:e,disabled:r||t,title:o??a,"aria-label":i??d,"data-size":s,children:n.jsx(O.RefreshIcon,{size:c,className:t?"nc-spinning":""})})}function ge({onClick:e,disabled:t=!1,size:r="default",title:s="Close","aria-label":o="Close"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-close",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(O.CloseIcon,{size:i})})}function mt({onClick:e,disabled:t=!1,size:r="default",title:s="Edit","aria-label":o="Edit"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-edit",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(O.EditIcon,{size:i})})}function gt({onClick:e,disabled:t=!1,size:r="default",title:s="Delete","aria-label":o="Delete"}){const i=r==="small"?14:r==="large"?20:18;return n.jsx("button",{className:"nc-icon-button nc-icon-button-trash",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":r,children:n.jsx(O.TrashIcon,{size:i})})}function bt({onClick:e,disabled:t=!1,children:r,title:s,"aria-label":o,size:i="default"}){return n.jsx("button",{className:"nc-hyperlink",onClick:e,disabled:t,title:s,"aria-label":o,"data-size":i,children:r})}function xt({open:e,onClose:t,options:r,anchorRef:s,anchor:o,preferredDirection:i="down"}){const c=l.useRef(null),[a,d]=l.useState({top:0,left:0}),p=o||(s==null?void 0:s.current);if(l.useEffect(()=>{if(!e||!p||!c.current)return;const u=p.getBoundingClientRect(),g=c.current.getBoundingClientRect(),y=window.innerHeight,b=window.innerWidth,w=u.bottom+8,k=w+g.height<=y-8;let v=i;(!k&&i==="down"||i==="up"&&k)&&(v="up");let f;v==="down"?f=w:f=u.top-g.height-8;let m=u.left;m+g.width>b-8&&(m=u.right-g.width),d({top:Math.max(8,f),left:Math.max(8,m)})},[e,p,i]),l.useEffect(()=>{if(!e)return;const u=y=>{c.current&&!c.current.contains(y.target)&&p&&!p.contains(y.target)&&t()},g=y=>{y.key==="Escape"&&t()};return document.addEventListener("mousedown",u),document.addEventListener("keydown",g),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",g)}},[e,t,p]),!e)return null;const h=u=>{u.type!=="separator"&&!u.disabled&&u.onClick&&(u.onClick(),t())},x=r.some(u=>u.icon);return ie.createPortal(n.jsx("div",{ref:c,className:"nc-context-menu",style:{position:"fixed",top:`${a.top}px`,left:`${a.left}px`,zIndex:1e4},role:"menu",children:r.map(u=>{if(u.type==="separator")return n.jsx("div",{className:"nc-context-menu-separator",role:"separator"},u.id);const g=["nc-context-menu-item",u.variant&&u.variant!=="default"?`nc-${u.variant}`:"",u.disabled?"nc-disabled":"",x&&!u.icon?"nc-indented":""].filter(Boolean).join(" ");return n.jsxs("button",{className:g,onClick:()=>h(u),disabled:u.disabled,role:"menuitem",children:[u.icon&&n.jsx("span",{className:"nc-context-menu-icon",children:u.icon}),n.jsx("span",{className:"nc-context-menu-label",children:u.label})]},u.id)})}),document.body)}const Le=l.createContext(null);function Be(){const e=l.useContext(Le);if(!e)throw new Error("useDialog must be used inside a Dialog component");return e}function X({children:e,onClick:t,...r}){const{close:s}=Be(),{t:o}=Y.useTranslation(),i=c=>{t==null||t(c),s()};return n.jsx(F,{onClick:i,...r,children:e??o("common.close")})}function vt({open:e,onClose:t,title:r,children:s,style:o,footerType:i="ok-cancel",footer:c,onOk:a,onSave:d,onDelete:p,onCancel:h,onConnect:x,closeOnOverlay:u=!0,primaryDisabled:g=!1,fullScreen:y=!1,hideTitleBar:b=!1,className:w="",onContentHeightChange:k}){const v=l.useRef(null),f=l.useRef(null),{t:m}=Y.useTranslation(),N={close:t},C=j=>{u&&j.target===j.currentTarget&&t()};if(l.useEffect(()=>{e&&v.current&&v.current.focus()},[e]),l.useEffect(()=>{if(!k||!f.current)return;const j=new ResizeObserver(M=>{for(const S of M){const A=S.contentRect.height;k(A)}});return j.observe(f.current),()=>{j.disconnect()}},[k]),!e)return null;const $=()=>{switch(i){case"ok":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(F,{variant:"primary",onClick:a??t,disabled:g,children:m("common.ok")})});case"ok-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(X,{onClick:h,children:m("common.cancel")}),n.jsx(F,{variant:"primary",onClick:a??t,disabled:g,children:m("common.ok")})]});case"save-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(X,{onClick:h,children:m("common.cancel")}),n.jsx(F,{variant:"primary",onClick:d,disabled:g,children:m("common.save")})]});case"delete-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(X,{onClick:h,children:m("common.cancel")}),n.jsx(F,{variant:"danger",onClick:p,disabled:g,children:m("common.delete")})]});case"connect":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(X,{onClick:h,children:m("common.cancel")}),n.jsx(F,{variant:"primary",onClick:x,disabled:g,children:m("common.connect")})]});case"close":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(X,{variant:"primary"})});case"gotit":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(X,{variant:"primary",children:m("common.gotit")})});case"custom":return n.jsx("div",{className:"nc-dialog-footer",children:c});case"none":return null;default:return null}},E=n.jsx(Le.Provider,{value:N,children:n.jsx("div",{className:`nc-dialog-overlay${y?" nc-fullscreen":""}`,onClick:C,children:n.jsxs("div",{ref:v,className:`nc-dialog-container ${w}`,style:o,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":b?void 0:"nc-dialog-title",children:[!b&&n.jsxs("div",{className:"nc-dialog-header",children:[n.jsx("h3",{id:"nc-dialog-title",className:"nc-dialog-title",children:r}),n.jsx(ge,{onClick:t,"aria-label":"Close dialog"})]}),n.jsx("div",{ref:f,className:"nc-dialog-content",children:s}),$()]})})});return y?ie.createPortal(E,document.body):E}function wt({onClick:e,size:t="default",rightOffset:r=4}){const s=t==="small"?28:34;return n.jsx("button",{className:"nc-button nc-ghost",onClick:e,onMouseDown:o=>{o.preventDefault(),o.stopPropagation()},tabIndex:-1,"aria-label":"Clear input",style:{position:"absolute",right:r,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center",fontSize:t==="small"?"12px":"14px"},children:"✕"})}function yt({visible:e,onClick:t,size:r="default"}){const s=r==="small"?28:34,o=r==="small"?16:18;return n.jsx("button",{className:"nc-button nc-ghost",onClick:t,onMouseDown:i=>{i.preventDefault(),i.stopPropagation()},tabIndex:-1,"aria-label":e?"Hide password":"Show password",style:{position:"absolute",right:4,padding:0,minHeight:0,height:s,width:s,border:"none",display:"flex",alignItems:"center",justifyContent:"center"},children:e?n.jsx(O.EyeHiddenIcon,{size:o}):n.jsx(O.ViewIcon,{size:o})})}function jt({value:e,defaultValue:t="",onChange:r,onEnter:s,onClear:o,placeholder:i,disabled:c,label:a,clearable:d=!0,type:p="text",className:h="",size:x="default",style:u,leadingIcon:g,showPasswordToggle:y=!1,multiline:b=!1,rows:w=3,validator:k,showErrorMessage:v=!0}){const f=l.useRef(null),m=l.useRef(null),[N,C]=l.useState(!1),[$,E]=l.useState(!1),j=e!==void 0,[M,S]=l.useState(t),A=j?e:M,T=k?k(A):null,B=!!T,U=p==="password",W=U&&y&&!c&&!b,I=d&&A&&!c&&$,P=x==="small"?32:44;let z=12;I&&W?z=P*2:(I||W)&&(z=P);const D=g?x==="small"?28:34:void 0,Ze=()=>{var Z,ne;j||S(""),r==null||r(""),o==null||o(),b?(Z=m.current)==null||Z.focus():(ne=f.current)==null||ne.focus()},ke=Z=>{Z.key==="Enter"&&!b&&(s==null||s())},Ne=Z=>{const ne=Z.target.value;j||S(ne),r==null||r(ne)},Se=()=>{E(!0)},Ce=()=>{E(!1)},Ae=`nc-input ${x==="small"?"nc-small ":""} ${B?"nc-error ":""}${h}`;return n.jsxs("div",{className:"nc-col",style:{position:"relative",flex:1,...u},children:[a&&n.jsx("span",{className:"nc-label",children:a}),n.jsxs("div",{style:{position:"relative",display:"flex",alignItems:b?"flex-start":"center"},children:[g&&n.jsx("span",{className:"nc-input-leading-icon",style:{height:b?void 0:"100%",top:b?10:void 0},children:g}),b?n.jsx("textarea",{ref:m,className:Ae,placeholder:i,value:A,onChange:Ne,onKeyDown:ke,onFocus:Se,onBlur:Ce,readOnly:c,"aria-disabled":c,tabIndex:c?-1:void 0,rows:w,style:{width:"100%",paddingRight:z,...D!==void 0?{paddingLeft:D}:{}}}):n.jsx("input",{ref:f,type:U&&N?"text":p,className:Ae,placeholder:i,value:A,onChange:Ne,onKeyDown:ke,onFocus:Se,onBlur:Ce,readOnly:c,"aria-disabled":c,tabIndex:c?-1:void 0,style:{width:"100%",paddingRight:z,...D!==void 0?{paddingLeft:D}:{}}}),I&&n.jsx(wt,{onClick:Ze,size:x,rightOffset:W?P+4:4}),W&&n.jsx(yt,{visible:N,onClick:()=>C(!N),size:x})]}),B&&v&&n.jsx("span",{className:"nc-error-message",children:T})]})}function kt({children:e,onClick:t,showBorder:r=!0,selectable:s=!1,style:o}){const[i,c]=l.useState(!1),a=d=>{if(t){if(s){const p=window.getSelection();if(p&&p.toString().length>0)return}t(d)}};return n.jsx("div",{onClick:a,onMouseDown:()=>t&&c(!0),onMouseUp:()=>c(!1),onMouseLeave:()=>c(!1),style:{cursor:t?"pointer":"default",userSelect:s?"text":void 0,borderBottom:r?void 0:"none",...o},className:`nc-list-group-item ${t?"nc-list-group-item-clickable":""} ${i?"nc-list-group-item-active":""}`,children:n.jsx("div",{style:{flex:1},children:e})})}function Nt({title:e,titleTools:t,children:r,style:s}){return n.jsxs("div",{className:"nc-list-group",style:s,children:[(e||t)&&n.jsxs("div",{className:"nc-list-group-title",children:[n.jsx("div",{children:e}),t&&n.jsx("div",{className:"nc-list-group-title-tools",children:t})]}),n.jsx("div",{className:"nc-list-group-content",children:r})]})}function St({values:e,onChange:t,options:r,placeholder:s="Select…",label:o}){const[i,c]=l.useState(!1),[a,d]=l.useState(""),p=l.useRef(null),h=l.useMemo(()=>r.filter(u=>u.label.toLowerCase().includes(a.toLowerCase())),[r,a]);l.useEffect(()=>{function u(g){!(g.target instanceof Node)||!p.current||p.current.contains(g.target)||c(!1)}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);const x=u=>{e.includes(u)?t(e.filter(g=>g!==u)):t([...e,u])};return n.jsxs("div",{ref:p,className:"nc-col",style:{position:"relative"},children:[o&&n.jsx("span",{className:"nc-label",children:o}),n.jsxs("div",{className:"nc-row",style:{flexWrap:"wrap",gap:6,minHeight:42,alignItems:"center",border:"1px solid var(--nc-button-border)",borderRadius:8,background:"var(--nc-button-bg)",padding:"4px 8px"},children:[e.length===0&&n.jsx("span",{className:"nc-label",children:s}),e.map(u=>{const g=r.find(y=>y.value===u);return g?n.jsxs("span",{style:{padding:"4px 8px",borderRadius:6,display:"inline-flex",alignItems:"center",gap:4,background:"var(--nc-button-bg)",border:"1px solid var(--nc-button-border)"},children:[g.label,n.jsx("button",{className:"nc-button nc-ghost",style:{padding:0,minHeight:0,height:20,width:20,display:"inline-flex",alignItems:"center",justifyContent:"center",border:"none"},onClick:()=>x(u),"aria-label":`Remove ${g.label}`,children:"✕"})]},u):null}),n.jsx("input",{className:"nc-input",value:a,onChange:u=>d(u.target.value),onFocus:()=>c(!0),style:{minWidth:50,border:"none",background:"transparent",padding:4,minHeight:32,flex:1}})]}),i&&n.jsxs("div",{className:"nc-combo-dropdown",style:{position:"absolute",top:"100%",left:0,right:0,zIndex:10,marginTop:4,boxShadow:"0 4px 12px var(--nc-shadow)"},children:[h.map(u=>{const g=e.includes(u.value);return n.jsxs("div",{className:"nc-section nc-row",style:{justifyContent:"space-between",cursor:"pointer",padding:12},onMouseDown:()=>x(u.value),children:[n.jsx("span",{children:u.label}),n.jsx("span",{children:g?"✔️":""})]},u.value)}),h.length===0&&n.jsx("div",{className:"nc-section nc-label",children:"No results"})]})]})}function ae(e){if(!e)return null;const t=/^\d{2}-\d{1,2}$/,r=/^\d{4}-\d{1,2}$/;if(!t.test(e)&&!r.test(e))return"Format must be YY-M(M) or YYYY-M(M)";const s=e.split("-"),o=parseInt(s[1],10);return o<1||o>12?"Month must be between 1 and 12":null}function oe(e){if(!e)return"";const t=e.split("-");if(t.length!==2)return e;let r=t[0];const s=t[1].padStart(2,"0");if(r.length===2){const o=parseInt(r,10);r=String(o<50?2e3+o:1900+o)}return`${r}-${s}`}function Re(e){if(!e)return"";const t=oe(e);if(!/^\d{4}-\d{2}$/.test(t))return e;const[r,s]=t.split("-");return`${r}/${s}`}function Ie(){const e=new Date,t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0");return`${t}-${r}`}function Ct({startMonth:e,endMonth:t,onChange:r,label:s,className:o="",disabled:i=!1,size:c="default"}){const[a,d]=l.useState(!1),[p,h]=l.useState(""),[x,u]=l.useState(""),[g,y]=l.useState({top:0,left:0,width:0,right:void 0}),b=l.useRef(null),w=l.useRef(null);l.useEffect(()=>{if(a&&b.current){const S=b.current.getBoundingClientRect(),T=Math.max(S.width,400);window.innerWidth-S.left<T&&S.right>=T?y({top:S.bottom+4,left:0,right:window.innerWidth-S.right,width:T}):y({top:S.bottom+4,left:S.left,right:void 0,width:T})}},[a]),l.useEffect(()=>{if(!a)return;const S=A=>{b.current&&!b.current.contains(A.target)&&w.current&&!w.current.contains(A.target)&&d(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[a]);const k=()=>{h(e||Ie()),u(t||Ie()),d(!0)},v=()=>{d(!1)},f=()=>{const S=ae(p),A=ae(x);if(S||A)return;const T=oe(p),B=oe(x);T&&B&&(r==null||r(T,B)),d(!1)},m=e&&t?`${Re(e)} - ${Re(t)}`:"Select month range",N=ae(p),C=ae(x),$=oe(p),E=oe(x),j=$&&E&&$>E,M=a?ie.createPortal(n.jsx("div",{ref:w,className:"nc-month-range-picker-popup",style:{position:"fixed",top:g.top,...g.right!==void 0?{right:g.right}:{left:g.left},width:g.width,zIndex:1e3},children:n.jsxs("div",{className:"nc-month-range-picker-content",children:[n.jsxs("div",{className:"nc-month-range-picker-row",children:[n.jsxs("div",{className:"nc-month-range-picker-column",children:[n.jsx("label",{className:"nc-label",children:"Start Month"}),n.jsx("input",{type:"text",className:`nc-month-input ${N?"nc-error":""}`,value:p,onChange:S=>h(S.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),N&&n.jsx("div",{className:"nc-month-error-text",children:N})]}),n.jsxs("div",{className:"nc-month-range-picker-column",children:[n.jsx("label",{className:"nc-label",children:"End Month"}),n.jsx("input",{type:"text",className:`nc-month-input ${C?"nc-error":""}`,value:x,onChange:S=>u(S.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),C&&n.jsx("div",{className:"nc-month-error-text",children:C})]})]}),j&&!N&&!C&&n.jsx("div",{className:"nc-month-range-error",children:"End month must be after or equal to start month"}),n.jsxs("div",{className:"nc-month-range-picker-footer",children:[n.jsx(F,{variant:"primary",onClick:f,disabled:!p||!x||!!N||!!C||!!j,children:"Apply"}),n.jsx(F,{variant:"ghost",onClick:v,children:"Cancel"})]})]})}),document.body):null;return n.jsxs("div",{className:`nc-month-range-picker ${c==="small"?"nc-small ":""}${o}`,children:[s&&n.jsx("label",{className:`nc-label${c==="small"?" nc-small":""}`,children:s}),n.jsx("button",{ref:b,className:`nc-month-range-picker-input${c==="small"?" nc-small":""}`,onClick:k,disabled:i,children:m}),M]})}function At({value:e,onChange:t,min:r,max:s,step:o=1,label:i,disabled:c,size:a="default"}){const d=a==="small",p=()=>{const u=e-o;r!==void 0&&u<r||t(parseFloat(u.toFixed(10)))},h=()=>{const u=e+o;s!==void 0&&u>s||t(parseFloat(u.toFixed(10)))},x=u=>{const g=parseFloat(u.target.value);isNaN(g)||r!==void 0&&g<r||s!==void 0&&g>s||t(g)};return n.jsxs("div",{className:`nc-col nc-number-input-col ${d?"nc-small":""}`,children:[i&&n.jsx("span",{className:`nc-label ${d?"nc-small":""}`,children:i}),n.jsxs("div",{className:`nc-number-input-container ${d?"nc-small":""}`,children:[n.jsx("input",{className:`nc-input nc-number-input ${d?"nc-small":""}`,type:"number",value:e,onChange:x,min:r,max:s,step:o,disabled:c}),n.jsx("button",{className:`nc-button nc-ghost nc-number-input-button ${d?"nc-small":""}`,onClick:p,disabled:c||r!==void 0&&e<=r,children:"−"}),n.jsx("button",{className:`nc-button nc-ghost nc-number-input-button ${d?"nc-small":""}`,onClick:h,disabled:c||s!==void 0&&e>=s,children:"+"})]})]})}function Rt({value:e,onChange:t,min:r=0,max:s=100,step:o=1,label:i,disabled:c,showValue:a=!0,formatValue:d=h=>h.toString(),width:p=200}){const h=u=>{const g=parseFloat(u.target.value);t(g)},x=(e-r)/(s-r)*100;return n.jsxs("div",{className:"nc-col",style:{gap:6},children:[i&&n.jsx("span",{className:"nc-label",children:i}),n.jsxs("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[n.jsx("input",{type:"range",className:"nc-slider",value:e,onChange:h,min:r,max:s,step:o,disabled:c,style:{width:p,"--nc-slider-percentage":`${x}%`}}),a&&n.jsx("span",{style:{color:"var(--nc-text)",fontFamily:"monospace",fontSize:14,minWidth:60,textAlign:"right"},children:d(e)})]})]})}const It=({size:e=24,className:t,style:r})=>n.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:t,style:r,children:n.jsx("polyline",{points:"18 15 12 9 6 15"})});function De({children:e,className:t="",style:r}){return n.jsx("div",{className:`nc-tab-panel ${t}`,style:r,children:e})}function Mt({active:e,children:t,keepMounted:r=!1,className:s="",style:o}){const i=l.Children.toArray(t).filter(a=>l.isValidElement(a)&&(a.type===De||a.type.displayName==="TabPanel"));if(r)return n.jsx("div",{className:`nc-tab-panels ${s}`,style:o,children:i.map(a=>{const d=a.props.tab===e;return n.jsx("div",{className:`nc-tab-panel-wrapper ${d?"nc-active":""}`,style:{display:d?void 0:"none"},"aria-hidden":!d,children:a},a.props.tab)})});const c=i.find(a=>a.props.tab===e);return n.jsx("div",{className:`nc-tab-panels ${s}`,style:o,children:c})}function Et({tabs:e,active:t,onChange:r,onClose:s,permanentTabs:o,className:i,toolbar:c,multiline:a,orientation:d="horizontal",style:p}){const h=l.useRef(null),[x,u]=l.useState(!1),[g,y]=l.useState(!1),b=d==="verticalLeft"||d==="verticalRight",w=l.useRef(!1),k=l.useRef(0),v=l.useRef(0),f=l.useRef(!1);l.useEffect(()=>{const j=()=>{if(h.current)if(b){const{scrollTop:S,scrollHeight:A,clientHeight:T}=h.current;u(S>1),y(S<A-T-1)}else{const{scrollLeft:S,scrollWidth:A,clientWidth:T}=h.current;u(S>1),y(S<A-T-1)}},M=h.current;if(M)return j(),M.addEventListener("scroll",j),window.addEventListener("resize",j),()=>{M.removeEventListener("scroll",j),window.removeEventListener("resize",j)}},[e,b]);const m=j=>{h.current&&(w.current=!0,f.current=!1,k.current=b?j.clientY:j.clientX,v.current=b?h.current.scrollTop:h.current.scrollLeft,h.current.style.cursor="grabbing",h.current.style.userSelect="none")},N=j=>{if(!w.current||!h.current)return;const M=b?j.clientY:j.clientX,S=k.current-M;Math.abs(S)>3&&(f.current=!0),b?h.current.scrollTop=v.current+S:h.current.scrollLeft=v.current+S},C=()=>{h.current&&(w.current=!1,h.current.style.cursor="",h.current.style.userSelect="")},$=()=>{C()};l.useEffect(()=>{const j=h.current;if(!j||b)return;const M=S=>{S.deltaY!==0&&(S.preventDefault(),j.scrollLeft+=S.deltaY*.3)};return j.addEventListener("wheel",M,{passive:!1}),()=>{j.removeEventListener("wheel",M)}},[b]);const E=j=>{f.current||r(j)};return n.jsxs("div",{className:`nc-tab-container ${b?`nc-vertical nc-${d}`:""} ${i||""}`,style:p,children:[n.jsxs("div",{className:"nc-tab-scroll-wrapper",children:[x&&n.jsx("div",{className:`nc-tab-scroll-indicator ${b?"nc-top":"nc-left"}`,children:b?n.jsx(It,{size:16}):n.jsx(O.ChevronLeftIcon,{size:16})}),n.jsx("div",{ref:h,className:`nc-tab-scroll ${a?"nc-multiline":""}`,onMouseDown:m,onMouseMove:N,onMouseUp:C,onMouseLeave:$,style:{cursor:"grab"},children:e.map(j=>{const M=typeof j=="string"?j:j.id,S=typeof j=="string"?j:j.label,A=s&&!(o!=null&&o.includes(M));return n.jsxs("div",{className:`nc-tab-item ${t===M?"nc-active":""} ${A?"nc-closable":""}`,onClick:()=>E(M),role:"button",tabIndex:0,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&r(M)},children:[n.jsx("span",{className:"nc-tab-label",children:b?S:typeof S=="string"?S.toUpperCase():S}),A&&n.jsx("span",{className:"nc-tab-close",role:"button",tabIndex:0,"aria-label":`Close ${typeof S=="string"?S:M}`,onClick:T=>{T.stopPropagation(),s(M)},onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.stopPropagation(),s(M))},children:n.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]},M)})}),g&&n.jsx("div",{className:`nc-tab-scroll-indicator ${b?"nc-bottom":"nc-right"}`,children:b?n.jsx(O.ChevronDownIcon,{size:16}):n.jsx(O.ChevronRightIcon,{size:16})})]}),c&&n.jsx("div",{className:"nc-tab-toolbar",children:c})]})}function $t({checked:e,onChange:t,disabled:r,label:s}){return n.jsxs("label",{className:"nc-row",style:{gap:10,alignItems:"center",cursor:r?"not-allowed":"pointer"},children:[s&&n.jsx("span",{className:"nc-label",children:s}),n.jsx("span",{role:"switch","aria-checked":e,tabIndex:0,onKeyDown:o=>{r||(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),t(!e))},onClick:()=>!r&&t(!e),style:{position:"relative",width:56,height:30,borderRadius:18,padding:4,display:"inline-flex",alignItems:"center",justifyContent:"flex-start",border:`2px solid ${e?"var(--nc-primary)":"var(--nc-button-border)"}`,background:e?"rgba(99,102,241,0.08)":"transparent",transition:"border-color 160ms, background 160ms"},children:n.jsx("span",{style:{width:22,height:22,borderRadius:12,background:e?"var(--nc-text)":"var(--nc-muted)",transform:`translateX(${e?24:0}px)`,transition:"transform 160ms, background 160ms",boxShadow:e?"0 2px 6px rgba(99,102,241,0.28)":"0 1px 2px rgba(0,0,0,0.08)",border:"none"}})})]})}const Me=["var(--nc-csv-col-0)","var(--nc-csv-col-1)","var(--nc-csv-col-2)","var(--nc-csv-col-3)","var(--nc-csv-col-4)","var(--nc-csv-col-5)","var(--nc-csv-col-6)","var(--nc-csv-col-7)","var(--nc-csv-col-8)","var(--nc-csv-col-9)"];function Tt(e,t){const s=e.slice(0,t).split(`
2
2
  `),o=s.length,c=s[o-1].split(" "),a=c.length,d=c[a-1].length+1;return{line:o,column:a,character:d,offset:t}}function Pt(e,t,r,s){const o=e.split(`
3
- `),i=Math.max(1,Math.min(t,o.length));let c=0;for(let x=0;x<i-1;x++)c+=o[x].length+1;const d=o[i-1].split(" "),f=Math.max(1,Math.min(r,d.length));for(let x=0;x<f-1;x++)c+=d[x].length+1;const h=Math.max(1,Math.min(s,d[f-1].length+1));return c+=h-1,c}function zt(e,t){const r=e.split(`
4
- `),s=Math.max(1,Math.min(t,r.length));let o=0;for(let i=0;i<s-1;i++)o+=r[i].length+1;return o}const Lt=l.forwardRef(function({value:t,onChange:r,placeholder:s,className:o,style:i,showLineNumbers:c=!1,onCursorChange:a,highlightLine:d},f){const h=l.useRef(null),x=l.useRef(null),u=l.useRef(null);l.useImperativeHandle(f,()=>({goToLine(v){const p=h.current;if(!p)return;const g=zt(t,v);p.focus(),p.setSelectionRange(g,g);const k=parseFloat(getComputedStyle(p).lineHeight)||18;p.scrollTop=(Math.max(1,v)-1)*k,y(),m()},goToPosition(v,p,g){const k=h.current;if(!k)return;const C=Pt(t,v,p,g);k.focus(),k.setSelectionRange(C,C);const $=parseFloat(getComputedStyle(k).lineHeight)||18;k.scrollTop=(Math.max(1,v)-1)*$,y(),m()}}),[t]);const m=l.useCallback(()=>{if(!a||!h.current)return;const v=Tt(t,h.current.selectionStart);a(v)},[a,t]),y=l.useCallback(()=>{const v=h.current;v&&(x.current&&(x.current.scrollTop=v.scrollTop,x.current.scrollLeft=v.scrollLeft),u.current&&(u.current.scrollTop=v.scrollTop))},[]);l.useEffect(()=>{if(d==null||d<1)return;const v=h.current;if(!v)return;const p=parseFloat(getComputedStyle(v).lineHeight)||18,g=(d-1)*p,k=g+p;(g<v.scrollTop||k>v.scrollTop+v.clientHeight)&&(v.scrollTop=g-v.clientHeight/2+p/2),y()},[d]);const b=l.useMemo(()=>t.split(`
5
- `).length,[t]),w=()=>{const v=[];for(let p=1;p<=b;p++)v.push(n.jsx("div",{className:`nc-csv-line-number ${d===p?"nc-csv-highlight":""}`,children:p},p));return n.jsx("div",{className:"nc-csv-gutter",ref:u,children:v})},N=v=>v?v.split(`
6
- `).map((g,k)=>{const C=g.split(" ");return n.jsxs("div",{className:`nc-csv-line ${d===k+1?"nc-csv-highlight":""}`,children:[C.map(($,E)=>n.jsxs("span",{children:[E>0&&n.jsx("span",{className:"nc-csv-tab-char",children:" "}),n.jsx("span",{style:{color:Me[E%Me.length]},children:$})]},E)),g===""&&`
7
- `]},k)}):null;return n.jsxs("div",{className:`nc-csv-textarea-container ${c?"nc-csv-with-gutter":""} ${o??""}`,style:i,children:[c&&w(),n.jsxs("div",{className:"nc-csv-textarea-editor",children:[n.jsx("div",{className:"nc-csv-textarea-backdrop",ref:x,children:n.jsx("pre",{className:"nc-csv-textarea-highlights",children:N(t)})}),n.jsx("textarea",{ref:h,className:"nc-csv-textarea-input",value:t,onChange:v=>{r(v.target.value),requestAnimationFrame(m)},onScroll:y,onSelect:m,onKeyUp:m,onClick:m,placeholder:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off"})]})]})});let J={notifications:[]};const pe=new Set,Ee=new Map;function fe(){const e=J.notifications.slice();for(const t of Array.from(pe))try{t(e)}catch{}}function Bt(e){pe.add(e);try{e(J.notifications.slice())}catch{}return()=>{pe.delete(e)}}function Dt(e){const t=`notification-${Date.now()}-${Math.random()}`,{duration:r,type:s,...o}=e,i={id:t,dismissible:!0,...o,type:s==="error"?"danger":s??"info",duration:r??5e3};return J.notifications=[i,...J.notifications],fe(),i.duration&&i.duration>0&&setTimeout(()=>{He(t)},i.duration),t}function He(e){const t=J.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,fe();const r=window.setTimeout(()=>{J.notifications=J.notifications.filter(s=>s.id!==e),fe(),Ee.delete(e)},300);Ee.set(e,r)}function We({notification:e}){const{t}=Y.useTranslation(),r=()=>{if(e.title)return e.title;switch(e.type){case"success":return t("common.success");case"danger":return t("common.error");case"warning":return t("common.warning");default:return t("common.info")}},s=()=>{He(e.id)};return n.jsx("div",{className:`nc-notification nc-notification-${e.type||"info"}`,children:n.jsxs("div",{className:"nc-notification-content",children:[n.jsxs("div",{className:"nc-notification-body",style:{paddingRight:e.dismissible?"8px":"0"},children:[n.jsx("div",{className:"nc-notification-title",children:r()}),n.jsx("div",{className:"nc-notification-message",children:e.message})]}),e.dismissible&&n.jsx("button",{className:"nc-notification-dismiss",onClick:s,children:n.jsx(O.CloseIcon,{size:16})})]})})}function Ht(){const[e,t]=l.useState([]),[r,s]=l.useState(new Map),[o,i]=l.useState(new Set),c=l.useRef(null),a=l.useRef([]);return l.useEffect(()=>Bt(f=>{const h=new Set(a.current.map(u=>u.id)),x=f.filter(u=>!h.has(u.id)).map(u=>u.id);x.length>0?(t(f),i(new Set(x)),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i(new Set)})})):t(f),a.current=f}),[]),l.useEffect(()=>{if(!c.current)return;const d=new Map;let f=0;const h=c.current.children;e.forEach((x,u)=>{if(d.set(x.id,f),h[u]){const m=h[u].offsetHeight;x.isRemoving||(f+=m+12)}}),s(d)},[e]),n.jsx("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none"},children:n.jsx("div",{ref:c,style:{pointerEvents:"auto",position:"relative"},children:e.map(d=>{const f=o.has(d.id),h=d.isRemoving,x=r.get(d.id)||0;return n.jsx("div",{style:{position:"absolute",top:0,left:0,transform:f?"translateY(-120px)":`translateY(${x}px)`,transition:h?"opacity 300ms ease-out":"transform 300ms ease-out, opacity 300ms ease-out",opacity:h?0:1,width:"100%"},children:n.jsx(We,{notification:d})},d.id)})})})}function Oe(e){return Dt(e)}const Wt={show:e=>Oe(e)};function Ot(e){const t=nt.createInstance(),r={};for(const o in e)r[o]={translation:e[o]};const s=typeof document<"u"&&document.documentElement.lang||"en";return t.init({resources:r,lng:s,fallbackLng:"en",interpolation:{escapeValue:!1}}),typeof MutationObserver<"u"&&typeof document<"u"&&new MutationObserver(i=>{for(const c of i)if(c.type==="attributes"&&c.attributeName==="lang"){const a=document.documentElement.lang||"en";t.changeLanguage(a)}}).observe(document.documentElement,{attributes:!0}),t}class Ft{constructor(){K(this,"apps",new Map)}register(t){this.apps.has(t.id)&&console.warn(`App "${t.id}" is already registered. Overwriting.`),this.apps.set(t.id,{...t,width:t.width??400,padding:t.padding??0})}unregister(t){this.apps.delete(t)}get(t){return this.apps.get(t)}list(){return Array.from(this.apps.values())}has(t){return this.apps.has(t)}}const Q=new Ft,$e="nc-ui-app-state";class Vt{constructor(){K(this,"state");K(this,"listeners",new Map);this.state=this.loadState()}loadState(){try{const t=localStorage.getItem($e);if(t)return JSON.parse(t)}catch{}return{activeAppId:null}}saveState(){try{localStorage.setItem($e,JSON.stringify(this.state))}catch{}}getActiveAppId(){return this.state.activeAppId}_setActiveAppId(t){this.state.activeAppId!==t&&(this.state.activeAppId=t,this.saveState(),this.notify("activeAppId",t))}subscribe(t,r){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r),()=>{var s;(s=this.listeners.get(t))==null||s.delete(r)}}notify(t,r){var s;(s=this.listeners.get(t))==null||s.forEach(o=>o(r))}}const V=new Vt;class Gt{constructor(){K(this,"apps",[]);K(this,"activeAppId",null);K(this,"listeners",new Set);K(this,"refReadyResolvers",new Map)}async launchApp(t,r){const{launchInBackground:s=!1}=r||{};if(!Q.has(t))return console.error(`Cannot launch app "${t}": not registered`),null;const o=this.apps.find(c=>c.appId===t);if(o)return s||(this.setActiveApp(t),V._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),s||(this.activeAppId=t,V._setActiveAppId(t)),this.notify(),this.waitForRef(t)}waitForRef(t){return new Promise(r=>{const s=this.refReadyResolvers.get(t)||[];s.push(r),this.refReadyResolvers.set(t,s)})}setAppRef(t,r){const s=this.apps.find(i=>i.appId===t);if(!s){console.warn(`Cannot set ref for app "${t}": not running`);return}s.ref=r;const o=this.refReadyResolvers.get(t);o&&(o.forEach(i=>i(s)),this.refReadyResolvers.delete(t))}getApp(t){return this.apps.find(r=>r.appId===t)}closeApp(t){const r=this.apps.findIndex(o=>o.appId===t);if(r===-1)return;const s=this.apps[r];if(s.ref&&(s.ref=void 0),this.apps.splice(r,1),this.activeAppId===t){const o=window.innerWidth>=768;this.activeAppId=o&&this.apps.length>0?this.apps[this.apps.length-1].appId:null,V._setActiveAppId(this.activeAppId)}this.notify()}setActiveApp(t){if(t!==null&&!this.apps.find(r=>r.appId===t)){console.warn(`Cannot activate app "${t}": not running`);return}this.activeAppId!==t&&(this.activeAppId=t,this.notify(),V._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?Q.get(this.activeAppId)??null:null}getRunningApps(){return[...this.apps]}isRunning(t){return this.apps.some(r=>r.appId===t)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){this.listeners.forEach(t=>t())}}const H=new Gt,be=l.createContext(null);function Fe(){const e=l.useContext(be);if(!e)throw new Error("useApp must be used inside an App");return e}function Yt({size:e=16}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M19 12H5"}),n.jsx("path",{d:"M12 19l-7-7 7-7"})]})}function Ve({title:e,onClose:t,onBack:r,toolbar:s,hideBackButton:o}){const i=r&&!o;return n.jsxs("div",{className:"nc-app-title-bar",children:[n.jsxs("div",{className:"nc-app-title-bar-left",children:[i&&n.jsx("button",{className:"nc-app-title-bar-back",onClick:r,title:"Back","aria-label":"Go back",children:n.jsx(Yt,{size:16})}),n.jsx("span",{className:"nc-app-title-bar-title",children:e})]}),n.jsxs("div",{className:"nc-app-title-bar-right",children:[s&&n.jsx("div",{className:"nc-app-title-bar-toolbar",children:s}),n.jsx(ge,{onClick:t,"aria-label":"Close application"})]})]})}class Kt extends l.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error(`Error loading app ${this.props.appId}:`,t,r)}render(){return this.state.hasError?n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,flexDirection:"column",gap:"16px",padding:"20px",textAlign:"center",color:"var(--text-secondary)"},children:[n.jsx("div",{children:"Failed to load app"}),this.state.error&&n.jsx("div",{style:{fontSize:"12px",opacity:.7},children:this.state.error.message})]}):this.props.children}}function xe({appId:e,isActive:t,onClose:r}){const{t:s}=Y.useTranslation(),o=Q.get(e),[i,c]=l.useState(""),[a,d]=l.useState(null),[f,h]=l.useState(null),[x,u]=l.useState(!1),[m,y]=l.useState(!1);l.useEffect(()=>{o!=null&&o.titleKey&&c(s(o.titleKey))},[o,s]);const b=l.useCallback(j=>{c(j)},[]),w=l.useCallback(j=>{d(()=>j)},[]),N=l.useCallback(()=>{d(null)},[]),v=l.useCallback(j=>{h(j)},[]),p=l.useCallback(()=>{h(null)},[]),g=l.useCallback(j=>{u(j)},[]),k=l.useCallback(j=>{y(j)},[]),C=l.useMemo(()=>({setTitle:b,setBackHandler:w,clearBackHandler:N,setToolbar:v,clearToolbar:p,setHideBackButton:g,setHideTitleBar:k,close:r}),[b,w,N,v,p,g,k,r]);if(!o)return null;const $=o.component,E=!o.hideTitleBar&&!m;return n.jsxs("div",{style:{display:t?"flex":"none",flexDirection:"column",flex:1,minHeight:0},children:[E&&n.jsx(Ve,{title:i,onClose:r,onBack:a??void 0,toolbar:f,hideBackButton:x}),n.jsx("div",{className:E?"nc-app-content-wrapper":"",style:{padding:o.padding,flex:1,minHeight:0,display:"flex",flexDirection:"column",backgroundColor:"var(--nc-bg-tertiary)",position:"relative"},children:n.jsx(be.Provider,{value:C,children:n.jsx(Kt,{appId:e,children:n.jsx(l.Suspense,{fallback:n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1},children:n.jsx(me,{})}),children:n.jsx($,{})})})})})]})}const ce=768,le=1024,Ge={isMobile:!1,isTablet:!1,isDesktop:!0,width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},Ye=l.createContext(Ge);function qt({children:e}){const[t,r]=l.useState(()=>{if(typeof window>"u")return Ge;const s=window.innerWidth,o=window.innerHeight;return{isMobile:s<ce,isTablet:s>=ce&&s<le,isDesktop:s>=le,width:s,height:o}});return l.useEffect(()=>{const s=()=>{const o=window.innerWidth,i=window.innerHeight;r({isMobile:o<ce,isTablet:o>=ce&&o<le,isDesktop:o>=le,width:o,height:i})};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),n.jsx(Ye.Provider,{value:t,children:e})}function ve(){return l.useContext(Ye)}const we="-",_t=e=>{const t=Xt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const a=c.split(we);return a[0]===""&&a.length!==1&&a.shift(),Ke(a,t)||Ut(c)},getConflictingClassGroupIds:(c,a)=>{const d=r[c]||[];return a&&s[c]?[...d,...s[c]]:d}}},Ke=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const r=e[0],s=t.nextPart.get(r),o=s?Ke(e.slice(1),s):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(we);return(c=t.validators.find(({validator:a})=>a(i)))==null?void 0:c.classGroupId},Te=/^\[(.+)\]$/,Ut=e=>{if(Te.test(e)){const t=Te.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Xt=e=>{const{theme:t,prefix:r}=e,s={nextPart:new Map,validators:[]};return Qt(Object.entries(e.classGroups),r).forEach(([i,c])=>{he(c,s,i,t)}),s},he=(e,t,r,s)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Pe(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(Jt(o)){he(o(s),t,r,s);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,c])=>{he(c,Pe(t,i),r,s)})})},Pe=(e,t)=>{let r=e;return t.split(we).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},Jt=e=>e.isThemeGetter,Qt=(e,t)=>t?e.map(([r,s])=>{const o=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([c,a])=>[t+c,a])):i);return[r,o]}):e,Zt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,s=new Map;const o=(i,c)=>{r.set(i,c),t++,t>e&&(t=0,s=r,r=new Map)};return{get(i){let c=r.get(i);if(c!==void 0)return c;if((c=s.get(i))!==void 0)return o(i,c),c},set(i,c){r.has(i)?r.set(i,c):o(i,c)}}},qe="!",en=e=>{const{separator:t,experimentalParseClassName:r}=e,s=t.length===1,o=t[0],i=t.length,c=a=>{const d=[];let f=0,h=0,x;for(let w=0;w<a.length;w++){let N=a[w];if(f===0){if(N===o&&(s||a.slice(w,w+i)===t)){d.push(a.slice(h,w)),h=w+i;continue}if(N==="/"){x=w;continue}}N==="["?f++:N==="]"&&f--}const u=d.length===0?a:a.substring(h),m=u.startsWith(qe),y=m?u.substring(1):u,b=x&&x>h?x-h:void 0;return{modifiers:d,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:b}};return r?a=>r({className:a,parseClassName:c}):c},tn=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(s=>{s[0]==="["?(t.push(...r.sort(),s),r=[]):r.push(s)}),t.push(...r.sort()),t},nn=e=>({cache:Zt(e.cacheSize),parseClassName:en(e),..._t(e)}),rn=/\s+/,sn=(e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o}=t,i=[],c=e.trim().split(rn);let a="";for(let d=c.length-1;d>=0;d-=1){const f=c[d],{modifiers:h,hasImportantModifier:x,baseClassName:u,maybePostfixModifierPosition:m}=r(f);let y=!!m,b=s(y?u.substring(0,m):u);if(!b){if(!y){a=f+(a.length>0?" "+a:a);continue}if(b=s(u),!b){a=f+(a.length>0?" "+a:a);continue}y=!1}const w=tn(h).join(":"),N=x?w+qe:w,v=N+b;if(i.includes(v))continue;i.push(v);const p=o(b,y);for(let g=0;g<p.length;++g){const k=p[g];i.push(N+k)}a=f+(a.length>0?" "+a:a)}return a};function on(){let e=0,t,r,s="";for(;e<arguments.length;)(t=arguments[e++])&&(r=_e(t))&&(s&&(s+=" "),s+=r);return s}const _e=e=>{if(typeof e=="string")return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=_e(e[s]))&&(r&&(r+=" "),r+=t);return r};function an(e,...t){let r,s,o,i=c;function c(d){const f=t.reduce((h,x)=>x(h),e());return r=nn(f),s=r.cache.get,o=r.cache.set,i=a,a(d)}function a(d){const f=s(d);if(f)return f;const h=sn(d,r);return o(d,h),h}return function(){return i(on.apply(null,arguments))}}const L=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ue=/^\[(?:([a-z-]+):)?(.+)\]$/i,cn=/^\d+\/\d+$/,ln=new Set(["px","full","screen"]),dn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,un=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,G=e=>ee(e)||ln.has(e)||cn.test(e),q=e=>te(e,"length",jn),ee=e=>!!e&&!Number.isNaN(Number(e)),ue=e=>te(e,"number",ee),re=e=>!!e&&Number.isInteger(Number(e)),mn=e=>e.endsWith("%")&&ee(e.slice(0,-1)),R=e=>Ue.test(e),_=e=>dn.test(e),gn=new Set(["length","size","percentage"]),bn=e=>te(e,gn,Xe),xn=e=>te(e,"position",Xe),vn=new Set(["image","url"]),wn=e=>te(e,vn,Nn),yn=e=>te(e,"",kn),se=()=>!0,te=(e,t,r)=>{const s=Ue.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):r(s[2]):!1},jn=e=>un.test(e)&&!pn.test(e),Xe=()=>!1,kn=e=>fn.test(e),Nn=e=>hn.test(e),Sn=()=>{const e=L("colors"),t=L("spacing"),r=L("blur"),s=L("brightness"),o=L("borderColor"),i=L("borderRadius"),c=L("borderSpacing"),a=L("borderWidth"),d=L("contrast"),f=L("grayscale"),h=L("hueRotate"),x=L("invert"),u=L("gap"),m=L("gradientColorStops"),y=L("gradientColorStopPositions"),b=L("inset"),w=L("margin"),N=L("opacity"),v=L("padding"),p=L("saturate"),g=L("scale"),k=L("sepia"),C=L("skew"),$=L("space"),E=L("translate"),j=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto",R,t],A=()=>[R,t],T=()=>["",G,q],B=()=>["auto",ee,R],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",R],de=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[ee,R];return{cacheSize:500,separator:":",theme:{colors:[se],spacing:[G,q],blur:["none","",_,R],brightness:D(),borderColor:[e],borderRadius:["none","","full",_,R],borderSpacing:A(),borderWidth:T(),contrast:D(),grayscale:z(),hueRotate:D(),invert:z(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[mn,q],inset:S(),margin:S(),opacity:D(),padding:A(),saturate:D(),scale:D(),sepia:z(),skew:D(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",R]}],container:["container"],columns:[{columns:[_]}],"break-after":[{"break-after":de()}],"break-before":[{"break-before":de()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),R]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",re,R]}],basis:[{basis:S()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",R]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",re,R]}],"grid-cols":[{"grid-cols":[se]}],"col-start-end":[{col:["auto",{span:["full",re,R]},R]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[se]}],"row-start-end":[{row:["auto",{span:[re,R]},R]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",R]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",R]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",R,t]}],"min-w":[{"min-w":[R,t,"min","max","fit"]}],"max-w":[{"max-w":[R,t,"none","full","min","max","fit","prose",{screen:[_]},_]}],h:[{h:[R,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[R,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[R,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[R,t,"auto","min","max","fit"]}],"font-size":[{text:["base",_,q]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ue]}],"font-family":[{font:[se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",R]}],"line-clamp":[{"line-clamp":["none",ee,ue]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",G,R]}],"list-image":[{"list-image":["none",R]}],"list-style-type":[{list:["none","disc","decimal",R]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",G,q]}],"underline-offset":[{"underline-offset":["auto",G,R]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",R]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",R]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),xn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},wn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:W()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[G,R]}],"outline-w":[{outline:[G,q]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[G,q]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_,yn]}],"shadow-color":[{shadow:[se]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",_,R]}],grayscale:[{grayscale:[f]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[x]}],saturate:[{saturate:[p]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[f]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[p]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",R]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",R]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",R]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[g]}],"scale-x":[{"scale-x":[g]}],"scale-y":[{"scale-y":[g]}],rotate:[{rotate:[re,R]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",R]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",R]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",R]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[G,q,ue]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Cn=an(Sn);function Je(...e){return Cn(ze.clsx(e))}function An({autoWidth:e=!0,className:t,style:r}){const[s,o]=l.useState(()=>V.getActiveAppId()),[i,c]=l.useState(()=>H.getRunningApps()),{isMobile:a}=ve();l.useEffect(()=>{const w=V.subscribe("activeAppId",N=>{o(N)});return()=>{w()}},[]),l.useEffect(()=>H.subscribe(()=>{c(H.getRunningApps())}),[]),l.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const v=V.getActiveAppId();v&&!H.isRunning(v)&&H.launchApp(v)}},[]);const d=w=>{H.closeApp(w)},f=s?Q.get(s):null,x=(f==null?void 0:f.width)??400,u=s!==null,b={...{overflow:"hidden",display:u?"flex":"none",flexDirection:"column",flexShrink:0,...e&&u?{width:a?"100%":x}:{}},...r};return n.jsx("div",{className:Je("nc-app-panel",t),style:b,children:i.map(w=>n.jsx(xe,{appId:w.appId,isActive:s===w.appId,onClose:()=>d(w.appId)},w.appId))})}function Rn({pinnedAppIds:e,className:t="",showIndicators:r=!0,side:s="left",getBadge:o}){const{t:i}=Y.useTranslation(),{isMobile:c}=ve(),[a,d]=l.useState(()=>V.getActiveAppId()),[f,h]=l.useState(()=>H.getRunningApps());l.useEffect(()=>{const p=V.subscribe("activeAppId",g=>{d(g)});return()=>{p()}},[]),l.useEffect(()=>H.subscribe(()=>{h(H.getRunningApps())}),[]);const x=p=>{a===p?H.setActiveApp(null):H.launchApp(p)},u=e.map(p=>Q.get(p)).filter(p=>!!p),m=f.filter(p=>!e.includes(p.appId)).map(p=>({running:p,def:Q.get(p.appId)})).filter(p=>!!p.def),y=p=>f.some(g=>g.appId===p),b=p=>p.titleKey?String(i(p.titleKey)):p.id,w=p=>typeof p=="number"&&p>99?"99+":p,N=(p,g)=>{const k=o==null?void 0:o(p,g);return k?n.jsx("span",{className:`nc-app-taskbar-badge nc-${k.tone??"default"}`,"aria-label":k.ariaLabel,children:w(k.content)}):null},v=c?24:28;return n.jsxs("div",{className:`nc-app-taskbar ${c?"nc-mobile":"nc-desktop"} nc-${s} ${t}`,children:[u.map(p=>{const g=p.icon,k=a===p.id,C=y(p.id),$={isActive:k,isRunning:C,isPinned:!0};return n.jsxs("button",{className:`nc-app-taskbar-button ${k?"nc-active":""} ${C?"nc-running":""}`,onClick:()=>x(p.id),title:b(p),children:[n.jsx(g,{size:v}),N(p,$),r&&C&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},p.id)}),m.length>0&&n.jsx("div",{className:"nc-app-taskbar-separator"}),m.map(({running:p,def:g})=>{const k=g.icon,C=a===p.appId,$={isActive:C,isRunning:!0,isPinned:!1};return n.jsxs("button",{className:`nc-app-taskbar-button ${C?"nc-active":""} nc-running`,onClick:()=>x(p.appId),title:b(g),children:[n.jsx(k,{size:v}),N(g,$),r&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},p.appId)})]})}function In({appId:e,open:t,onClose:r,closeOnBackdrop:s=!1,className:o="",style:i}){const c=d=>{s&&d.target===d.currentTarget&&r()};if(!t)return null;const a=n.jsx("div",{className:"nc-dialog-overlay nc-fullscreen",onClick:c,children:n.jsx("div",{className:`nc-app-dialog-container ${o}`,style:i,onClick:d=>d.stopPropagation(),children:n.jsx(xe,{appId:e,isActive:!0,onClose:r})})});return ie.createPortal(a,document.body)}const ye=l.createContext(null),Qe=l.createContext(null);function Mn(){const e=l.useContext(ye);if(!e)throw new Error("useNavStack must be used within a NavStackProvider");return e}function En(){const e=l.useContext(Qe);if(!e)throw new Error("useNavView must be used within NavStack");return e}const je=l.createContext(null);function $n({rootView:e,children:t}){const{t:r}=Y.useTranslation(),s=Fe(),[o,i]=l.useState([e]),[c,a]=l.useState([null]),d=l.useCallback((g,k)=>{a(C=>{const $=[...C];return $[g]=k,$})},[]),f=l.useCallback(g=>{a(k=>{const C=[...k];return C[g]=null,C})},[]),h=l.useCallback(g=>{i(k=>[...k,g]),a(k=>[...k,null])},[]),x=l.useCallback(()=>{i(g=>g.length<=1?g:g.slice(0,-1)),a(g=>g.slice(0,-1))},[]),u=l.useCallback(()=>{i([e]),a([null])},[e]),m=o.length,y=m>1,b=o.length-1,w=o[o.length-1],N=w!=null&&w.titleKey?r(w.titleKey):(w==null?void 0:w.title)??"";l.useEffect(()=>{s.setTitle(N)},[N,s]),l.useEffect(()=>{y?s.setBackHandler(x):s.clearBackHandler()},[y,x,s]),l.useEffect(()=>{const g=c[c.length-1];g?s.setToolbar(g):s.clearToolbar()},[c,s]);const v={push:h,pop:x,reset:u,depth:m,canGoBack:y,currentTitle:N},p={stack:o,toolbarStack:c,updateToolbar:d,clearToolbarAt:f,topIndex:b};return n.jsx(ye.Provider,{value:v,children:n.jsx(je.Provider,{value:p,children:t})})}function Tn({index:e,children:t}){const r=l.useContext(je);if(!r)throw new Error("NavViewProvider must be used within NavStackProvider");const{updateToolbar:s,clearToolbarAt:o,topIndex:i}=r,c=l.useCallback(f=>{e===i&&s(e,f)},[e,i,s]),a=l.useCallback(()=>{e===i&&o(e)},[e,i,o]),d={setToolbar:c,clearToolbar:a};return n.jsx(Qe.Provider,{value:d,children:t})}function Pn(){const e=l.useContext(ye),t=l.useContext(je);if(!e||!t)throw new Error("NavStackContainer must be used within a NavStackProvider");const{stack:r}=t;return n.jsx("div",{className:"nav-stack-container",children:n.jsx("div",{className:"nav-stack-content",children:r.map((s,o)=>{const i=o===r.length-1;return n.jsx(Tn,{index:o,children:n.jsx("div",{style:{display:i?"flex":"none",flexDirection:"column",height:"100%"},children:s.component})},s.id)})})})}exports.YamlTextArea=ze.YamlTextArea;exports.ActivityIndicator=me;exports.Alert=st;exports.AppContainer=xe;exports.AppContext=be;exports.AppDialog=In;exports.AppPanel=An;exports.AppTaskbar=Rn;exports.AppTitleBar=Ve;exports.Battery=ot;exports.Button=F;exports.ButtonGroup=it;exports.Checkbox=ct;exports.CloseButton=ge;exports.ComboBox=ft;exports.ContextMenu=xt;exports.CsvTextArea=Lt;exports.Dialog=vt;exports.DialogClose=X;exports.EditButton=mt;exports.Hyperlink=bt;exports.Input=jt;exports.ListGroup=Nt;exports.ListGroupItem=kt;exports.MonthRangePicker=Ct;exports.MultiSelect=St;exports.NavStackContainer=Pn;exports.NavStackProvider=$n;exports.Notification=We;exports.NotificationContainer=Ht;exports.NumberInput=At;exports.RefreshButton=ht;exports.Slider=Rt;exports.TabPanel=De;exports.TabPanels=Mt;exports.Tabs=Et;exports.Toggle=$t;exports.TrashButton=gt;exports.ViewportProvider=qt;exports.appRegistry=Q;exports.appStateStore=V;exports.cn=Je;exports.createAppI18nFactory=Ot;exports.notificationManager=Wt;exports.runningAppsStore=H;exports.showNotification=Oe;exports.useApp=Fe;exports.useDialog=Be;exports.useNavStack=Mn;exports.useNavView=En;exports.useViewport=ve;
3
+ `),i=Math.max(1,Math.min(t,o.length));let c=0;for(let x=0;x<i-1;x++)c+=o[x].length+1;const d=o[i-1].split(" "),p=Math.max(1,Math.min(r,d.length));for(let x=0;x<p-1;x++)c+=d[x].length+1;const h=Math.max(1,Math.min(s,d[p-1].length+1));return c+=h-1,c}function zt(e,t){const r=e.split(`
4
+ `),s=Math.max(1,Math.min(t,r.length));let o=0;for(let i=0;i<s-1;i++)o+=r[i].length+1;return o}const Lt=l.forwardRef(function({value:t,onChange:r,placeholder:s,className:o,style:i,showLineNumbers:c=!1,onCursorChange:a,highlightLine:d},p){const h=l.useRef(null),x=l.useRef(null),u=l.useRef(null);l.useImperativeHandle(p,()=>({goToLine(v){const f=h.current;if(!f)return;const m=zt(t,v);f.focus(),f.setSelectionRange(m,m);const N=parseFloat(getComputedStyle(f).lineHeight)||18;f.scrollTop=(Math.max(1,v)-1)*N,y(),g()},goToPosition(v,f,m){const N=h.current;if(!N)return;const C=Pt(t,v,f,m);N.focus(),N.setSelectionRange(C,C);const $=parseFloat(getComputedStyle(N).lineHeight)||18;N.scrollTop=(Math.max(1,v)-1)*$,y(),g()}}),[t]);const g=l.useCallback(()=>{if(!a||!h.current)return;const v=Tt(t,h.current.selectionStart);a(v)},[a,t]),y=l.useCallback(()=>{const v=h.current;v&&(x.current&&(x.current.scrollTop=v.scrollTop,x.current.scrollLeft=v.scrollLeft),u.current&&(u.current.scrollTop=v.scrollTop))},[]);l.useEffect(()=>{if(d==null||d<1)return;const v=h.current;if(!v)return;const f=parseFloat(getComputedStyle(v).lineHeight)||18,m=(d-1)*f,N=m+f;(m<v.scrollTop||N>v.scrollTop+v.clientHeight)&&(v.scrollTop=m-v.clientHeight/2+f/2),y()},[d]);const b=l.useMemo(()=>t.split(`
5
+ `).length,[t]),w=()=>{const v=[];for(let f=1;f<=b;f++)v.push(n.jsx("div",{className:`nc-csv-line-number ${d===f?"nc-csv-highlight":""}`,children:f},f));return n.jsx("div",{className:"nc-csv-gutter",ref:u,children:v})},k=v=>v?v.split(`
6
+ `).map((m,N)=>{const C=m.split(" ");return n.jsxs("div",{className:`nc-csv-line ${d===N+1?"nc-csv-highlight":""}`,children:[C.map(($,E)=>n.jsxs("span",{children:[E>0&&n.jsx("span",{className:"nc-csv-tab-char",children:" "}),n.jsx("span",{style:{color:Me[E%Me.length]},children:$})]},E)),m===""&&`
7
+ `]},N)}):null;return n.jsxs("div",{className:`nc-csv-textarea-container ${c?"nc-csv-with-gutter":""} ${o??""}`,style:i,children:[c&&w(),n.jsxs("div",{className:"nc-csv-textarea-editor",children:[n.jsx("div",{className:"nc-csv-textarea-backdrop",ref:x,children:n.jsx("pre",{className:"nc-csv-textarea-highlights",children:k(t)})}),n.jsx("textarea",{ref:h,className:"nc-csv-textarea-input",value:t,onChange:v=>{r(v.target.value),requestAnimationFrame(g)},onScroll:y,onSelect:g,onKeyUp:g,onClick:g,placeholder:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off"})]})]})});let J={notifications:[]};const pe=new Set,Ee=new Map;function fe(){const e=J.notifications.slice();for(const t of Array.from(pe))try{t(e)}catch{}}function Bt(e){pe.add(e);try{e(J.notifications.slice())}catch{}return()=>{pe.delete(e)}}function Dt(e){const t=`notification-${Date.now()}-${Math.random()}`,{duration:r,type:s,...o}=e,i={id:t,dismissible:!0,...o,type:s==="error"?"danger":s??"info",duration:r??5e3};return J.notifications=[i,...J.notifications],fe(),i.duration&&i.duration>0&&setTimeout(()=>{He(t)},i.duration),t}function He(e){const t=J.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,fe();const r=window.setTimeout(()=>{J.notifications=J.notifications.filter(s=>s.id!==e),fe(),Ee.delete(e)},300);Ee.set(e,r)}function We({notification:e}){const{t}=Y.useTranslation(),r=()=>{if(e.title)return e.title;switch(e.type){case"success":return t("common.success");case"danger":return t("common.error");case"warning":return t("common.warning");default:return t("common.info")}},s=()=>{He(e.id)};return n.jsx("div",{className:`nc-notification nc-notification-${e.type||"info"}`,children:n.jsxs("div",{className:"nc-notification-content",children:[n.jsxs("div",{className:"nc-notification-body",style:{paddingRight:e.dismissible?"8px":"0"},children:[n.jsx("div",{className:"nc-notification-title",children:r()}),n.jsx("div",{className:"nc-notification-message",children:e.message})]}),e.dismissible&&n.jsx("button",{className:"nc-notification-dismiss",onClick:s,children:n.jsx(O.CloseIcon,{size:16})})]})})}function Ht(){const[e,t]=l.useState([]),[r,s]=l.useState(new Map),[o,i]=l.useState(new Set),c=l.useRef(null),a=l.useRef([]);return l.useEffect(()=>Bt(p=>{const h=new Set(a.current.map(u=>u.id)),x=p.filter(u=>!h.has(u.id)).map(u=>u.id);x.length>0?(t(p),i(new Set(x)),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i(new Set)})})):t(p),a.current=p}),[]),l.useEffect(()=>{if(!c.current)return;const d=new Map;let p=0;const h=c.current.children;e.forEach((x,u)=>{if(d.set(x.id,p),h[u]){const g=h[u].offsetHeight;x.isRemoving||(p+=g+12)}}),s(d)},[e]),n.jsx("div",{style:{position:"fixed",top:"16px",left:"16px",zIndex:9999,pointerEvents:"none"},children:n.jsx("div",{ref:c,style:{pointerEvents:"auto",position:"relative"},children:e.map(d=>{const p=o.has(d.id),h=d.isRemoving,x=r.get(d.id)||0;return n.jsx("div",{style:{position:"absolute",top:0,left:0,transform:p?"translateY(-120px)":`translateY(${x}px)`,transition:h?"opacity 300ms ease-out":"transform 300ms ease-out, opacity 300ms ease-out",opacity:h?0:1,width:"100%"},children:n.jsx(We,{notification:d})},d.id)})})})}function Oe(e){return Dt(e)}const Wt={show:e=>Oe(e)};function Ot(e){const t=nt.createInstance(),r={};for(const o in e)r[o]={translation:e[o]};const s=typeof document<"u"&&document.documentElement.lang||"en";return t.init({resources:r,lng:s,fallbackLng:"en",interpolation:{escapeValue:!1}}),typeof MutationObserver<"u"&&typeof document<"u"&&new MutationObserver(i=>{for(const c of i)if(c.type==="attributes"&&c.attributeName==="lang"){const a=document.documentElement.lang||"en";t.changeLanguage(a)}}).observe(document.documentElement,{attributes:!0}),t}class Ft{constructor(){K(this,"apps",new Map)}register(t){this.apps.has(t.id)&&console.warn(`App "${t.id}" is already registered. Overwriting.`),this.apps.set(t.id,{...t,width:t.width??400,padding:t.padding??0})}unregister(t){this.apps.delete(t)}get(t){return this.apps.get(t)}list(){return Array.from(this.apps.values())}has(t){return this.apps.has(t)}}const Q=new Ft,$e="nc-ui-app-state";class Vt{constructor(){K(this,"state");K(this,"listeners",new Map);this.state=this.loadState()}loadState(){try{const t=localStorage.getItem($e);if(t)return JSON.parse(t)}catch{}return{activeAppId:null}}saveState(){try{localStorage.setItem($e,JSON.stringify(this.state))}catch{}}getActiveAppId(){return this.state.activeAppId}_setActiveAppId(t){this.state.activeAppId!==t&&(this.state.activeAppId=t,this.saveState(),this.notify("activeAppId",t))}subscribe(t,r){return this.listeners.has(t)||this.listeners.set(t,new Set),this.listeners.get(t).add(r),()=>{var s;(s=this.listeners.get(t))==null||s.delete(r)}}notify(t,r){var s;(s=this.listeners.get(t))==null||s.forEach(o=>o(r))}}const V=new Vt;class Gt{constructor(){K(this,"apps",[]);K(this,"activeAppId",null);K(this,"listeners",new Set);K(this,"refReadyResolvers",new Map)}async launchApp(t,r){const{launchInBackground:s=!1}=r||{};if(!Q.has(t))return console.error(`Cannot launch app "${t}": not registered`),null;const o=this.apps.find(c=>c.appId===t);if(o)return s||(this.setActiveApp(t),V._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),s||(this.activeAppId=t,V._setActiveAppId(t)),this.notify(),this.waitForRef(t)}waitForRef(t){return new Promise(r=>{const s=this.refReadyResolvers.get(t)||[];s.push(r),this.refReadyResolvers.set(t,s)})}setAppRef(t,r){const s=this.apps.find(i=>i.appId===t);if(!s){console.warn(`Cannot set ref for app "${t}": not running`);return}s.ref=r;const o=this.refReadyResolvers.get(t);o&&(o.forEach(i=>i(s)),this.refReadyResolvers.delete(t))}getApp(t){return this.apps.find(r=>r.appId===t)}closeApp(t){const r=this.apps.findIndex(o=>o.appId===t);if(r===-1)return;const s=this.apps[r];if(s.ref&&(s.ref=void 0),this.apps.splice(r,1),this.activeAppId===t){const o=window.innerWidth>=768;this.activeAppId=o&&this.apps.length>0?this.apps[this.apps.length-1].appId:null,V._setActiveAppId(this.activeAppId)}this.notify()}setActiveApp(t){if(t!==null&&!this.apps.find(r=>r.appId===t)){console.warn(`Cannot activate app "${t}": not running`);return}this.activeAppId!==t&&(this.activeAppId=t,this.notify(),V._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?Q.get(this.activeAppId)??null:null}getRunningApps(){return[...this.apps]}isRunning(t){return this.apps.some(r=>r.appId===t)}subscribe(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}notify(){this.listeners.forEach(t=>t())}}const H=new Gt,be=l.createContext(null);function Fe(){const e=l.useContext(be);if(!e)throw new Error("useApp must be used inside an App");return e}function Yt({size:e=16}){return n.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("path",{d:"M19 12H5"}),n.jsx("path",{d:"M12 19l-7-7 7-7"})]})}function Ve({title:e,onClose:t,onBack:r,toolbar:s,hideBackButton:o}){const i=r&&!o;return n.jsxs("div",{className:"nc-app-title-bar",children:[n.jsxs("div",{className:"nc-app-title-bar-left",children:[i&&n.jsx("button",{className:"nc-app-title-bar-back",onClick:r,title:"Back","aria-label":"Go back",children:n.jsx(Yt,{size:16})}),n.jsx("span",{className:"nc-app-title-bar-title",children:e})]}),n.jsxs("div",{className:"nc-app-title-bar-right",children:[s&&n.jsx("div",{className:"nc-app-title-bar-toolbar",children:s}),n.jsx(ge,{onClick:t,"aria-label":"Close application"})]})]})}class Kt extends l.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error(`Error loading app ${this.props.appId}:`,t,r)}render(){return this.state.hasError?n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,flexDirection:"column",gap:"16px",padding:"20px",textAlign:"center",color:"var(--text-secondary)"},children:[n.jsx("div",{children:"Failed to load app"}),this.state.error&&n.jsx("div",{style:{fontSize:"12px",opacity:.7},children:this.state.error.message})]}):this.props.children}}function xe({appId:e,isActive:t,onClose:r}){const{t:s}=Y.useTranslation(),o=Q.get(e),[i,c]=l.useState(""),[a,d]=l.useState(null),[p,h]=l.useState(null),[x,u]=l.useState(!1),[g,y]=l.useState(!1);l.useEffect(()=>{o!=null&&o.titleKey&&c(s(o.titleKey))},[o,s]);const b=l.useCallback(j=>{c(j)},[]),w=l.useCallback(j=>{d(()=>j)},[]),k=l.useCallback(()=>{d(null)},[]),v=l.useCallback(j=>{h(j)},[]),f=l.useCallback(()=>{h(null)},[]),m=l.useCallback(j=>{u(j)},[]),N=l.useCallback(j=>{y(j)},[]),C=l.useMemo(()=>({setTitle:b,setBackHandler:w,clearBackHandler:k,setToolbar:v,clearToolbar:f,setHideBackButton:m,setHideTitleBar:N,close:r}),[b,w,k,v,f,m,N,r]);if(!o)return null;const $=o.component,E=!o.hideTitleBar&&!g;return n.jsxs("div",{style:{display:t?"flex":"none",flexDirection:"column",flex:1,minHeight:0},children:[E&&n.jsx(Ve,{title:i,onClose:r,onBack:a??void 0,toolbar:p,hideBackButton:x}),n.jsx("div",{className:E?"nc-app-content-wrapper":"",style:{padding:o.padding,flex:1,minHeight:0,display:"flex",flexDirection:"column",backgroundColor:"var(--nc-bg-tertiary)",position:"relative"},children:n.jsx(be.Provider,{value:C,children:n.jsx(Kt,{appId:e,children:n.jsx(l.Suspense,{fallback:n.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1},children:n.jsx(me,{})}),children:n.jsx($,{})})})})})]})}const ce=768,le=1024,Ge={isMobile:!1,isTablet:!1,isDesktop:!0,width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},Ye=l.createContext(Ge);function qt({children:e}){const[t,r]=l.useState(()=>{if(typeof window>"u")return Ge;const s=window.innerWidth,o=window.innerHeight;return{isMobile:s<ce,isTablet:s>=ce&&s<le,isDesktop:s>=le,width:s,height:o}});return l.useEffect(()=>{const s=()=>{const o=window.innerWidth,i=window.innerHeight;r({isMobile:o<ce,isTablet:o>=ce&&o<le,isDesktop:o>=le,width:o,height:i})};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),n.jsx(Ye.Provider,{value:t,children:e})}function ve(){return l.useContext(Ye)}const we="-",_t=e=>{const t=Xt(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const a=c.split(we);return a[0]===""&&a.length!==1&&a.shift(),Ke(a,t)||Ut(c)},getConflictingClassGroupIds:(c,a)=>{const d=r[c]||[];return a&&s[c]?[...d,...s[c]]:d}}},Ke=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const r=e[0],s=t.nextPart.get(r),o=s?Ke(e.slice(1),s):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(we);return(c=t.validators.find(({validator:a})=>a(i)))==null?void 0:c.classGroupId},Te=/^\[(.+)\]$/,Ut=e=>{if(Te.test(e)){const t=Te.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Xt=e=>{const{theme:t,prefix:r}=e,s={nextPart:new Map,validators:[]};return Qt(Object.entries(e.classGroups),r).forEach(([i,c])=>{he(c,s,i,t)}),s},he=(e,t,r,s)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:Pe(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(Jt(o)){he(o(s),t,r,s);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,c])=>{he(c,Pe(t,i),r,s)})})},Pe=(e,t)=>{let r=e;return t.split(we).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},Jt=e=>e.isThemeGetter,Qt=(e,t)=>t?e.map(([r,s])=>{const o=s.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([c,a])=>[t+c,a])):i);return[r,o]}):e,Zt=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,s=new Map;const o=(i,c)=>{r.set(i,c),t++,t>e&&(t=0,s=r,r=new Map)};return{get(i){let c=r.get(i);if(c!==void 0)return c;if((c=s.get(i))!==void 0)return o(i,c),c},set(i,c){r.has(i)?r.set(i,c):o(i,c)}}},qe="!",en=e=>{const{separator:t,experimentalParseClassName:r}=e,s=t.length===1,o=t[0],i=t.length,c=a=>{const d=[];let p=0,h=0,x;for(let w=0;w<a.length;w++){let k=a[w];if(p===0){if(k===o&&(s||a.slice(w,w+i)===t)){d.push(a.slice(h,w)),h=w+i;continue}if(k==="/"){x=w;continue}}k==="["?p++:k==="]"&&p--}const u=d.length===0?a:a.substring(h),g=u.startsWith(qe),y=g?u.substring(1):u,b=x&&x>h?x-h:void 0;return{modifiers:d,hasImportantModifier:g,baseClassName:y,maybePostfixModifierPosition:b}};return r?a=>r({className:a,parseClassName:c}):c},tn=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(s=>{s[0]==="["?(t.push(...r.sort(),s),r=[]):r.push(s)}),t.push(...r.sort()),t},nn=e=>({cache:Zt(e.cacheSize),parseClassName:en(e),..._t(e)}),rn=/\s+/,sn=(e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o}=t,i=[],c=e.trim().split(rn);let a="";for(let d=c.length-1;d>=0;d-=1){const p=c[d],{modifiers:h,hasImportantModifier:x,baseClassName:u,maybePostfixModifierPosition:g}=r(p);let y=!!g,b=s(y?u.substring(0,g):u);if(!b){if(!y){a=p+(a.length>0?" "+a:a);continue}if(b=s(u),!b){a=p+(a.length>0?" "+a:a);continue}y=!1}const w=tn(h).join(":"),k=x?w+qe:w,v=k+b;if(i.includes(v))continue;i.push(v);const f=o(b,y);for(let m=0;m<f.length;++m){const N=f[m];i.push(k+N)}a=p+(a.length>0?" "+a:a)}return a};function on(){let e=0,t,r,s="";for(;e<arguments.length;)(t=arguments[e++])&&(r=_e(t))&&(s&&(s+=" "),s+=r);return s}const _e=e=>{if(typeof e=="string")return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=_e(e[s]))&&(r&&(r+=" "),r+=t);return r};function an(e,...t){let r,s,o,i=c;function c(d){const p=t.reduce((h,x)=>x(h),e());return r=nn(p),s=r.cache.get,o=r.cache.set,i=a,a(d)}function a(d){const p=s(d);if(p)return p;const h=sn(d,r);return o(d,h),h}return function(){return i(on.apply(null,arguments))}}const L=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ue=/^\[(?:([a-z-]+):)?(.+)\]$/i,cn=/^\d+\/\d+$/,ln=new Set(["px","full","screen"]),dn=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,un=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,hn=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,G=e=>ee(e)||ln.has(e)||cn.test(e),q=e=>te(e,"length",jn),ee=e=>!!e&&!Number.isNaN(Number(e)),ue=e=>te(e,"number",ee),re=e=>!!e&&Number.isInteger(Number(e)),mn=e=>e.endsWith("%")&&ee(e.slice(0,-1)),R=e=>Ue.test(e),_=e=>dn.test(e),gn=new Set(["length","size","percentage"]),bn=e=>te(e,gn,Xe),xn=e=>te(e,"position",Xe),vn=new Set(["image","url"]),wn=e=>te(e,vn,Nn),yn=e=>te(e,"",kn),se=()=>!0,te=(e,t,r)=>{const s=Ue.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):r(s[2]):!1},jn=e=>un.test(e)&&!pn.test(e),Xe=()=>!1,kn=e=>fn.test(e),Nn=e=>hn.test(e),Sn=()=>{const e=L("colors"),t=L("spacing"),r=L("blur"),s=L("brightness"),o=L("borderColor"),i=L("borderRadius"),c=L("borderSpacing"),a=L("borderWidth"),d=L("contrast"),p=L("grayscale"),h=L("hueRotate"),x=L("invert"),u=L("gap"),g=L("gradientColorStops"),y=L("gradientColorStopPositions"),b=L("inset"),w=L("margin"),k=L("opacity"),v=L("padding"),f=L("saturate"),m=L("scale"),N=L("sepia"),C=L("skew"),$=L("space"),E=L("translate"),j=()=>["auto","contain","none"],M=()=>["auto","hidden","clip","visible","scroll"],S=()=>["auto",R,t],A=()=>[R,t],T=()=>["",G,q],B=()=>["auto",ee,R],U=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],W=()=>["solid","dashed","dotted","double","none"],I=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],P=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",R],de=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>[ee,R];return{cacheSize:500,separator:":",theme:{colors:[se],spacing:[G,q],blur:["none","",_,R],brightness:D(),borderColor:[e],borderRadius:["none","","full",_,R],borderSpacing:A(),borderWidth:T(),contrast:D(),grayscale:z(),hueRotate:D(),invert:z(),gap:A(),gradientColorStops:[e],gradientColorStopPositions:[mn,q],inset:S(),margin:S(),opacity:D(),padding:A(),saturate:D(),scale:D(),sepia:z(),skew:D(),space:A(),translate:A()},classGroups:{aspect:[{aspect:["auto","square","video",R]}],container:["container"],columns:[{columns:[_]}],"break-after":[{"break-after":de()}],"break-before":[{"break-before":de()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...U(),R]}],overflow:[{overflow:M()}],"overflow-x":[{"overflow-x":M()}],"overflow-y":[{"overflow-y":M()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",re,R]}],basis:[{basis:S()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",R]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",re,R]}],"grid-cols":[{"grid-cols":[se]}],"col-start-end":[{col:["auto",{span:["full",re,R]},R]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[se]}],"row-start-end":[{row:["auto",{span:[re,R]},R]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",R]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",R]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...P()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...P(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...P(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[v]}],px:[{px:[v]}],py:[{py:[v]}],ps:[{ps:[v]}],pe:[{pe:[v]}],pt:[{pt:[v]}],pr:[{pr:[v]}],pb:[{pb:[v]}],pl:[{pl:[v]}],m:[{m:[w]}],mx:[{mx:[w]}],my:[{my:[w]}],ms:[{ms:[w]}],me:[{me:[w]}],mt:[{mt:[w]}],mr:[{mr:[w]}],mb:[{mb:[w]}],ml:[{ml:[w]}],"space-x":[{"space-x":[$]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[$]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",R,t]}],"min-w":[{"min-w":[R,t,"min","max","fit"]}],"max-w":[{"max-w":[R,t,"none","full","min","max","fit","prose",{screen:[_]},_]}],h:[{h:[R,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[R,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[R,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[R,t,"auto","min","max","fit"]}],"font-size":[{text:["base",_,q]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ue]}],"font-family":[{font:[se]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",R]}],"line-clamp":[{"line-clamp":["none",ee,ue]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",G,R]}],"list-image":[{"list-image":["none",R]}],"list-style-type":[{list:["none","disc","decimal",R]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...W(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",G,q]}],"underline-offset":[{"underline-offset":["auto",G,R]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",R]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",R]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...U(),xn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",bn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},wn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[g]}],"gradient-via":[{via:[g]}],"gradient-to":[{to:[g]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...W(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:W()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...W()]}],"outline-offset":[{"outline-offset":[G,R]}],"outline-w":[{outline:[G,q]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[G,q]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",_,yn]}],"shadow-color":[{shadow:[se]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...I(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":I()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",_,R]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[x]}],saturate:[{saturate:[f]}],sepia:[{sepia:[N]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[p]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[f]}],"backdrop-sepia":[{"backdrop-sepia":[N]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",R]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",R]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",R]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[m]}],"scale-x":[{"scale-x":[m]}],"scale-y":[{"scale-y":[m]}],rotate:[{rotate:[re,R]}],"translate-x":[{"translate-x":[E]}],"translate-y":[{"translate-y":[E]}],"skew-x":[{"skew-x":[C]}],"skew-y":[{"skew-y":[C]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",R]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",R]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",R]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[G,q,ue]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Cn=an(Sn);function Je(...e){return Cn(ze.clsx(e))}function An({autoWidth:e=!0,className:t,style:r}){const[s,o]=l.useState(()=>V.getActiveAppId()),[i,c]=l.useState(()=>H.getRunningApps()),{isMobile:a}=ve();l.useEffect(()=>{const w=V.subscribe("activeAppId",k=>{o(k)});return()=>{w()}},[]),l.useEffect(()=>H.subscribe(()=>{c(H.getRunningApps())}),[]),l.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const v=V.getActiveAppId();v&&!H.isRunning(v)&&H.launchApp(v)}},[]);const d=w=>{H.closeApp(w)},p=s?Q.get(s):null,x=(p==null?void 0:p.width)??400,u=s!==null,b={...{overflow:"hidden",display:u?"flex":"none",flexDirection:"column",flexShrink:0,...e&&u?{width:a?"100%":x}:{}},...r};return n.jsx("div",{className:Je("nc-app-panel",t),style:b,children:i.map(w=>n.jsx(xe,{appId:w.appId,isActive:s===w.appId,onClose:()=>d(w.appId)},w.appId))})}function Rn({pinnedAppIds:e,className:t="",showIndicators:r=!0,side:s="left",getBadge:o}){const{t:i}=Y.useTranslation(),{isMobile:c}=ve(),[a,d]=l.useState(()=>V.getActiveAppId()),[p,h]=l.useState(()=>H.getRunningApps());l.useEffect(()=>{const f=V.subscribe("activeAppId",m=>{d(m)});return()=>{f()}},[]),l.useEffect(()=>H.subscribe(()=>{h(H.getRunningApps())}),[]);const x=f=>{a===f?H.setActiveApp(null):H.launchApp(f)},u=e.map(f=>Q.get(f)).filter(f=>!!f),g=p.filter(f=>!e.includes(f.appId)).map(f=>({running:f,def:Q.get(f.appId)})).filter(f=>!!f.def),y=f=>p.some(m=>m.appId===f),b=f=>f.titleKey?String(i(f.titleKey)):f.id,w=f=>typeof f=="number"&&f>99?"99+":f,k=(f,m)=>{const N=o==null?void 0:o(f,m);return N?n.jsx("span",{className:`nc-app-taskbar-badge nc-${N.tone??"default"}`,"aria-label":N.ariaLabel,children:w(N.content)}):null},v=c?24:28;return n.jsxs("div",{className:`nc-app-taskbar ${c?"nc-mobile":"nc-desktop"} nc-${s} ${t}`,children:[u.map(f=>{const m=f.icon,N=a===f.id,C=y(f.id),$={isActive:N,isRunning:C,isPinned:!0};return n.jsxs("button",{className:`nc-app-taskbar-button ${N?"nc-active":""} ${C?"nc-running":""}`,onClick:()=>x(f.id),title:b(f),children:[n.jsx(m,{size:v}),k(f,$),r&&C&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},f.id)}),g.length>0&&n.jsx("div",{className:"nc-app-taskbar-separator"}),g.map(({running:f,def:m})=>{const N=m.icon,C=a===f.appId,$={isActive:C,isRunning:!0,isPinned:!1};return n.jsxs("button",{className:`nc-app-taskbar-button ${C?"nc-active":""} nc-running`,onClick:()=>x(f.appId),title:b(m),children:[n.jsx(N,{size:v}),k(m,$),r&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},f.appId)})]})}function In({appId:e,open:t,onClose:r,closeOnBackdrop:s=!1,className:o="",style:i}){const c=d=>{s&&d.target===d.currentTarget&&r()};if(!t)return null;const a=n.jsx("div",{className:"nc-dialog-overlay nc-fullscreen",onClick:c,children:n.jsx("div",{className:`nc-app-dialog-container ${o}`,style:i,onClick:d=>d.stopPropagation(),children:n.jsx(xe,{appId:e,isActive:!0,onClose:r})})});return ie.createPortal(a,document.body)}const ye=l.createContext(null),Qe=l.createContext(null);function Mn(){const e=l.useContext(ye);if(!e)throw new Error("useNavStack must be used within a NavStackProvider");return e}function En(){const e=l.useContext(Qe);if(!e)throw new Error("useNavView must be used within NavStack");return e}const je=l.createContext(null);function $n({rootView:e,children:t}){const{t:r}=Y.useTranslation(),s=Fe(),[o,i]=l.useState([e]),[c,a]=l.useState([null]),d=l.useCallback((m,N)=>{a(C=>{const $=[...C];return $[m]=N,$})},[]),p=l.useCallback(m=>{a(N=>{const C=[...N];return C[m]=null,C})},[]),h=l.useCallback(m=>{i(N=>[...N,m]),a(N=>[...N,null])},[]),x=l.useCallback(()=>{i(m=>m.length<=1?m:m.slice(0,-1)),a(m=>m.slice(0,-1))},[]),u=l.useCallback(()=>{i([e]),a([null])},[e]),g=o.length,y=g>1,b=o.length-1,w=o[o.length-1],k=w!=null&&w.titleKey?r(w.titleKey):(w==null?void 0:w.title)??"";l.useEffect(()=>{s.setTitle(k)},[k,s]),l.useEffect(()=>{y?s.setBackHandler(x):s.clearBackHandler()},[y,x,s]),l.useEffect(()=>{const m=c[c.length-1];m?s.setToolbar(m):s.clearToolbar()},[c,s]);const v={push:h,pop:x,reset:u,depth:g,canGoBack:y,currentTitle:k},f={stack:o,toolbarStack:c,updateToolbar:d,clearToolbarAt:p,topIndex:b};return n.jsx(ye.Provider,{value:v,children:n.jsx(je.Provider,{value:f,children:t})})}function Tn({index:e,children:t}){const r=l.useContext(je);if(!r)throw new Error("NavViewProvider must be used within NavStackProvider");const{updateToolbar:s,clearToolbarAt:o,topIndex:i}=r,c=l.useCallback(p=>{e===i&&s(e,p)},[e,i,s]),a=l.useCallback(()=>{e===i&&o(e)},[e,i,o]),d={setToolbar:c,clearToolbar:a};return n.jsx(Qe.Provider,{value:d,children:t})}function Pn(){const e=l.useContext(ye),t=l.useContext(je);if(!e||!t)throw new Error("NavStackContainer must be used within a NavStackProvider");const{stack:r}=t;return n.jsx("div",{className:"nav-stack-container",children:n.jsx("div",{className:"nav-stack-content",children:r.map((s,o)=>{const i=o===r.length-1;return n.jsx(Tn,{index:o,children:n.jsx("div",{style:{display:i?"flex":"none",flexDirection:"column",height:"100%"},children:s.component})},s.id)})})})}exports.YamlTextArea=ze.YamlTextArea;exports.ActivityIndicator=me;exports.Alert=st;exports.AppContainer=xe;exports.AppContext=be;exports.AppDialog=In;exports.AppPanel=An;exports.AppTaskbar=Rn;exports.AppTitleBar=Ve;exports.Battery=ot;exports.Button=F;exports.ButtonGroup=it;exports.Checkbox=ct;exports.CloseButton=ge;exports.ComboBox=ft;exports.ContextMenu=xt;exports.CsvTextArea=Lt;exports.Dialog=vt;exports.DialogClose=X;exports.EditButton=mt;exports.Hyperlink=bt;exports.Input=jt;exports.ListGroup=Nt;exports.ListGroupItem=kt;exports.MonthRangePicker=Ct;exports.MultiSelect=St;exports.NavStackContainer=Pn;exports.NavStackProvider=$n;exports.Notification=We;exports.NotificationContainer=Ht;exports.NumberInput=At;exports.RefreshButton=ht;exports.Slider=Rt;exports.TabPanel=De;exports.TabPanels=Mt;exports.Tabs=Et;exports.Toggle=$t;exports.TrashButton=gt;exports.ViewportProvider=qt;exports.appRegistry=Q;exports.appStateStore=V;exports.cn=Je;exports.createAppI18nFactory=Ot;exports.notificationManager=Wt;exports.runningAppsStore=H;exports.showNotification=Oe;exports.useApp=Fe;exports.useDialog=Be;exports.useNavStack=Mn;exports.useNavView=En;exports.useViewport=ve;
8
8
  //# sourceMappingURL=index.cjs.map