@kingsimba/nc-ui 0.1.38 → 0.1.39

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 pt=Object.defineProperty;var ft=(e,t,r)=>t in e?pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var te=(e,t,r)=>ft(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),q=require("./GeneratedIcons-CGjL38ny.cjs"),l=require("react"),ve=require("react-dom"),ee=require("react-i18next"),ht=require("i18next"),mt=require("./clsx-C11secjj.cjs");function Ce({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 X({variant:e="default",block:t,size:r="default",appearance:s="default",className:o,disabled:i,textSelectable:c,loading:a,onClick:d,children:u,...m}){const w=["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(" "),p=x=>{if(!a){if(c){const N=window.getSelection();if(N&&N.toString().length>0)return}d==null||d(x)}};return n.jsxs("button",{className:w,disabled:i||a,onClick:p,...m,children:[a&&n.jsx(Ce,{size:"small",className:"nc-button-spinner",color:s==="transparent"||e!=="default"&&e!=="ghost"?"white":void 0}),u]})}const gt={info:"primary",success:"success",warning:"warning",error:"danger",danger:"danger"};function bt({code:e,text:t,type:r,button:s,onAction:o,children:i,onClose:c,className:a="",style:d}){const u=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:u}),c&&n.jsx("button",{type:"button",className:"nc-alert-close","aria-label":"Close alert",onClick:c,children:n.jsx(q.CloseIcon,{size:16})})]}),s&&n.jsx("span",{className:"nc-alert-action",children:n.jsx(X,{size:"small",variant:s.variant??gt[r],onClick:o,children:s.text})})]})}function xt({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?"rgba(255,255,255,0.35)":"#000000";const a="var(--nc-battery-shell-bg)",d=24,u=14,m=2,w=0,p=12,x=0,N=0,v=0,y=d,j=u,g=j-x*2,h=y-x*2,f=Math.max(1,Math.min(4,j/4)),b=o===0?0:.05+o*.95,A=d+m+p,E=20,C=.65,S=Math.max(u,E*C),$=d+m+1,k=(u-E*C)/2;return n.jsxs("svg",{className:"nc-battery",width:A,height:S,viewBox:`0 0 ${A} ${S}`,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:h*b,height:g,fill:"white"})})}),n.jsx("rect",{x:N,y:v,rx:f,ry:f,width:y,height:j,fill:a}),n.jsx("rect",{x:N+x,y:v+x,width:h,height:g,fill:c,rx:f,ry:f,mask:`url(#nc-battery-fill-mask-${o})`}),n.jsx("text",{x:N+y/2,y:u-3,fontSize:11,fontWeight:"bold",fill:"var(--nc-battery-text-contrast)",textAnchor:"middle",children:i}),n.jsx("rect",{x:d+w,y:u*.26,width:m,height:u*.48,rx:.8,ry:.8,fill:o===1?c:a}),t==="charging"?n.jsx("g",{transform:`translate(${$}, ${k}) scale(${C})`,fill:c,children:n.jsx("path",{d:"M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z"})}):null]})}function vt({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 wt({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 yt({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:u=>{r||(u.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:u=>{r||(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),t(!e))},children:e&&n.jsx(wt,{size:o})}),s&&n.jsx("span",{className:"nc-checkbox-text",style:i?{color:i}:void 0,children:s})]})}function jt({option:e,onChange:t,selected:r,highlighted:s,small:o,renderOption:i,index:c}){const a=l.useRef(null),{t:d}=ee.useTranslation(),u=e.disabled===!0;return l.useEffect(()=>{s&&a.current&&a.current.scrollIntoView({block:"nearest"})},[s]),n.jsx("div",{ref:a,className:`nc-combo-dropdown-option ${o?"nc-small":""} ${s?"nc-highlighted":""} ${u?"nc-disabled":""}`,role:"option",onClick:()=>{u||t(e.value,e.label)},"aria-selected":r,"aria-disabled":u,style:{cursor:u?"default":"pointer",opacity:u?.4:void 0,background:s&&!u?"rgba(59,130,246,0.18)":r&&!u?"rgba(59,130,246,0.12)":void 0},children:i?i(e,c,!!s):n.jsxs(n.Fragment,{children:[e.label,e.default&&n.jsxs("span",{style:{fontSize:"0.85em",color:"var(--nc-text-weak)",marginLeft:6},children:["(",d("common.default"),")"]})]})})}function kt({isOpen:e,options:t,onSelect:r,selectedValue:s,placement:o="bottom",anchorRef:i,small:c,highlightedIndex:a=-1,renderOption:d}){const[u,m]=l.useState({top:0,left:0,width:0}),[w,p]=l.useState(o),{t:x}=ee.useTranslation();if(l.useEffect(()=>{if(e&&i.current){const v=i.current.getBoundingClientRect();let y=o;if(o==="bottom"){const j=window.innerHeight-v.bottom,g=v.top;j<320&&g>j&&(y="top")}p(y),m({top:y==="top"?v.top-4:v.bottom+4,left:v.left,width:v.width})}},[e,i,o]),!e)return null;const N=n.jsx("div",{className:"nc-combo-dropdown",onMouseDown:v=>v.stopPropagation(),style:{position:"fixed",top:w==="top"?void 0:u.top,bottom:w==="top"?window.innerHeight-u.top:void 0,left:u.left,width:u.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:x("common.noResults")}):t.map((v,y)=>n.jsx(jt,{option:v,onChange:r,selected:v.value===s,highlighted:y===a,small:c,renderOption:d,index:y},v.value))});return ve.createPortal(N,document.body)}function Nt({onClick:e,small:t}){return n.jsx("span",{role:"button",tabIndex:0,className:`nc-combo-button nc-combo-clear ${t?"nc-small":""}`,onClick:r=>{r.stopPropagation(),e()},onMouseDown:r=>r.stopPropagation(),onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation(),e())},"aria-label":"Clear selection",children:"✕"})}function St({open:e,small:t}){return n.jsx("span",{"aria-hidden":!0,className:`nc-combo-button nc-combo-toggle ${t?"nc-small":""} ${e?"nc-open":""}`,children:"▾"})}function At({value:e,onChange:t,placeholder:r="Select…",options:s,candidates:o,renderOption:i,renderSelected:c,selectedOption:a,disabled:d,label:u,clearable:m=!0,allowTyping:w=!1,placement:p="bottom",size:x="default",appearance:N="default",textAlign:v="left",style:y,className:j}){const[g,h]=l.useState(!1),[f,b]=l.useState(""),[A,E]=l.useState(-1),C=l.useRef(null),S=l.useRef(null),$=l.useRef(null),k=x==="small",{t:R}=ee.useTranslation(),T=!!o,z=w||T,[se,K]=l.useState([]),[F,O]=l.useState(()=>{if(s&&e){const I=s.find(B=>B.value===e);return I?I.label:""}return o&&e?e:""});l.useEffect(()=>{if(!e){O("");return}if(s){const I=s.find(B=>B.value===e);I&&O(I.label)}else o&&O(e)},[e,s,o]);const G=(I,B=!1)=>{if(!o)return;$.current&&clearTimeout($.current);const L=async()=>{try{const V=await o(I);K(V),E(-1)}catch{K([])}};B?L():$.current=setTimeout(L,200)},H=l.useMemo(()=>{if(T)return se;const I=f.toLowerCase();return z?(s||[]).filter(B=>B.label.toLowerCase().includes(I)):s||[]},[s,f,z,T,se]);l.useEffect(()=>{g&&E(-1)},[g,H]),l.useEffect(()=>{if(!m&&!e&&s&&s.length>0&&t){const I=s.find(B=>B.default)||s[0];t(I.value)}},[m,e,s,t]),l.useEffect(()=>{function I(B){var L;B.target instanceof Node&&C.current&&((L=C.current.parentElement)!=null&&L.contains(B.target)||h(!1))}return document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[]);const P=a??(s?s.find(I=>I.value===e):e?{label:F,value:e}:void 0),Y=P&&m,oe=!d&&!Y,de=`nc-align-${v}`,fe=!(g&&z)&&!!P,ie=(I,B,L=!1)=>{var V;O(B),t==null||t(I),h(!1),b(""),L&&((V=C.current)==null||V.blur())},he=()=>{t==null||t(void 0),b(""),h(!1)},me=I=>{if(!g){(I.key==="ArrowDown"||I.key==="ArrowUp")&&(h(!0),I.preventDefault());return}const B=(L,V)=>{if(V===1){for(let D=L;D<H.length;D++)if(!H[D].disabled)return D;for(let D=0;D<L;D++)if(!H[D].disabled)return D}else{for(let D=L;D>=0;D--)if(!H[D].disabled)return D;for(let D=H.length-1;D>L;D--)if(!H[D].disabled)return D}return L};switch(I.key){case"ArrowDown":I.preventDefault(),E(L=>{const V=L+1,D=V>=H.length?0:V;return B(D,1)});break;case"ArrowUp":I.preventDefault(),E(L=>{const V=L-1,D=V<0?H.length-1:V;return B(D,-1)});break;case"Enter":I.preventDefault(),A>=0&&A<H.length&&!H[A].disabled&&ie(H[A].value,H[A].label,!0);break;case"Escape":I.preventDefault(),h(!1),b("");break}};return n.jsxs("div",{className:`nc-combo-container ${N==="transparent"?"nc-transparent":""} ${N==="plain"?"nc-plain":""} ${g?"nc-open":""} ${de} ${j||""}`.trim(),style:{position:"relative",...y},children:[u&&n.jsx("span",{className:`nc-label ${k?"nc-small":""}`,children:u}),n.jsxs("div",{ref:S,style:{position:"relative",display:"flex",alignItems:"center"},onMouseDown:I=>{if(d||z&&I.target===C.current)return;const B=!g;if(h(L=>(!L&&z&&P&&b(P.label),!L)),T&&B){const L=z&&P?P.label:"";K([]),setTimeout(()=>G(L,!0),0)}z&&!g&&setTimeout(()=>{var L,V;(L=C.current)==null||L.focus(),(V=C.current)==null||V.select()},0)},children:[n.jsx("input",{ref:C,className:`nc-input ${k?"nc-small":""}`,placeholder:r,onFocus:()=>{if(!d&&z){h(!0);const I=P?P.label:"";P&&(b(I),setTimeout(()=>{var B;return(B=C.current)==null?void 0:B.select()},0)),T&&(K([]),G(I,!0))}},onChange:I=>{const B=I.target.value;z&&(b(B),T&&G(B))},onKeyDown:me,value:g&&z?f:(P==null?void 0:P.label)||"",readOnly:d||!z,style:{width:"100%",paddingRight:oe||Y?k?32:44:12,caretColor:w?void 0:"transparent",cursor:w?void 0:"pointer",userSelect:w?void 0:"none",color:fe?"transparent":"var(--nc-text)"}}),fe&&n.jsx("div",{"aria-hidden":!0,className:`nc-combo-overlay ${de}`,style:{position:"absolute",left:k?8:12,right:oe||Y?k?12:24:k?8:12,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",display:"flex",alignItems:"center",gap:6},children:c&&P?c(P):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:`nc-combo-overlay-text ${k?"nc-small":""}`,children:P==null?void 0:P.label}),(P==null?void 0:P.default)&&n.jsxs("span",{className:`nc-combo-overlay-default ${k?"nc-small":""}`,children:["(",R("common.default"),")"]})]})}),Y&&n.jsx(Nt,{onClick:he,small:k}),oe&&n.jsx(St,{open:g,small:k})]}),n.jsx(kt,{isOpen:g,options:H,onSelect:ie,selectedValue:e,placement:p,anchorRef:S,small:k,highlightedIndex:A,renderOption:i})]})}function Ct({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(q.RefreshIcon,{size:c,className:t?"nc-spinning":""})})}function Re({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(q.CloseIcon,{size:i})})}function Rt({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(q.EditIcon,{size:i})})}function Mt({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(q.TrashIcon,{size:i})})}function It({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 Et({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}),u=o||(s==null?void 0:s.current);if(l.useEffect(()=>{if(!e||!u||!c.current)return;const p=u.getBoundingClientRect(),x=c.current.getBoundingClientRect(),N=window.innerHeight,v=window.innerWidth,y=p.bottom+8,j=y+x.height<=N-8;let g=i;(!j&&i==="down"||i==="up"&&j)&&(g="up");let h;g==="down"?h=y:h=p.top-x.height-8;let f=p.left;f+x.width>v-8&&(f=p.right-x.width),d({top:Math.max(8,h),left:Math.max(8,f)})},[e,u,i]),l.useEffect(()=>{if(!e)return;const p=N=>{c.current&&!c.current.contains(N.target)&&u&&!u.contains(N.target)&&t()},x=N=>{N.key==="Escape"&&t()};return document.addEventListener("mousedown",p),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",x)}},[e,t,u]),!e)return null;const m=p=>{p.type!=="separator"&&!p.disabled&&p.onClick&&(p.onClick(),t())},w=r.some(p=>p.icon);return ve.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(p=>{if(p.type==="separator")return n.jsx("div",{className:"nc-context-menu-separator",role:"separator"},p.id);const x=["nc-context-menu-item",p.variant&&p.variant!=="default"?`nc-${p.variant}`:"",p.disabled?"nc-disabled":"",w&&!p.icon?"nc-indented":""].filter(Boolean).join(" ");return n.jsxs("button",{className:x,onClick:()=>m(p),disabled:p.disabled,role:"menuitem",children:[p.icon&&n.jsx("span",{className:"nc-context-menu-icon",children:p.icon}),n.jsx("span",{className:"nc-context-menu-label",children:p.label})]},p.id)})}),document.body)}const Ue=l.createContext(null);function qe(){const e=l.useContext(Ue);if(!e)throw new Error("useDialog must be used inside a Dialog component");return e}function ae({children:e,onClick:t,...r}){const{close:s}=qe(),{t:o}=ee.useTranslation(),i=c=>{t==null||t(c),s()};return n.jsx(X,{onClick:i,...r,children:e??o("common.close")})}function $t({open:e,onClose:t,title:r,children:s,style:o,footerType:i="ok-cancel",footer:c,onOk:a,onSave:d,onDelete:u,onCancel:m,onConnect:w,closeOnOverlay:p=!0,primaryDisabled:x=!1,fullScreen:N=!1,hideTitleBar:v=!1,className:y="",onContentHeightChange:j}){const g=l.useRef(null),h=l.useRef(null),{t:f}=ee.useTranslation(),b={close:t},A=S=>{p&&S.target===S.currentTarget&&t()};if(l.useEffect(()=>{e&&g.current&&g.current.focus()},[e]),l.useEffect(()=>{if(!j||!h.current)return;const S=new ResizeObserver($=>{for(const k of $){const R=k.contentRect.height;j(R)}});return S.observe(h.current),()=>{S.disconnect()}},[j]),!e)return null;const E=()=>{switch(i){case"ok":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(X,{variant:"primary",onClick:a??t,disabled:x,children:f("common.ok")})});case"ok-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:m,children:f("common.cancel")}),n.jsx(X,{variant:"primary",onClick:a??t,disabled:x,children:f("common.ok")})]});case"save-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:m,children:f("common.cancel")}),n.jsx(X,{variant:"primary",onClick:d,disabled:x,children:f("common.save")})]});case"delete-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:m,children:f("common.cancel")}),n.jsx(X,{variant:"danger",onClick:u,disabled:x,children:f("common.delete")})]});case"connect":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:m,children:f("common.cancel")}),n.jsx(X,{variant:"primary",onClick:w,disabled:x,children:f("common.connect")})]});case"close":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(ae,{variant:"primary"})});case"gotit":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(ae,{variant:"primary",children:f("common.gotit")})});case"custom":return n.jsx("div",{className:"nc-dialog-footer",children:c});case"none":return null;default:return null}},C=n.jsx(Ue.Provider,{value:b,children:n.jsx("div",{className:`nc-dialog-overlay${N?" nc-fullscreen":""}`,onClick:A,children:n.jsxs("div",{ref:g,className:`nc-dialog-container ${y}`,style:o,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":v?void 0:"nc-dialog-title",children:[!v&&n.jsxs("div",{className:"nc-dialog-header",children:[n.jsx("h3",{id:"nc-dialog-title",className:"nc-dialog-title",children:r}),n.jsx(Re,{onClick:t,"aria-label":"Close dialog"})]}),n.jsx("div",{ref:h,className:"nc-dialog-content",children:s}),E()]})})});return N?ve.createPortal(C,document.body):C}function Tt({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 Pt({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(q.EyeHiddenIcon,{size:o}):n.jsx(q.ViewIcon,{size:o})})}function Lt({value:e,defaultValue:t="",onChange:r,onChangeConfirmed:s,onEnter:o,onClear:i,placeholder:c,disabled:a,label:d,clearable:u=!0,type:m="text",className:w="",size:p="default",appearance:x="default",style:N,leadingIcon:v,showPasswordToggle:y=!1,multiline:j=!1,rows:g=3,validator:h,showErrorMessage:f=!0}){const b=l.useRef(null),A=l.useRef(null),E=l.useRef(!1),[C,S]=l.useState(!1),[$,k]=l.useState(!1),[R,T]=l.useState(!1),z=e!==void 0,[se,K]=l.useState(t),F=z?e:se,[O,G]=l.useState(F),H=h?h(F):null,P=!!H,Y=!j&&x==="plain",oe=Y&&$,de=oe?O:F;l.useEffect(()=>{oe||G(F)},[F,oe]);const fe=m==="password",ie=fe&&y&&!a&&!j,he=u&&de&&!a&&($||R),me=p==="small"?32:44;let I=12;he&&ie?I=me*2:(he||ie)&&(I=me);const L=v?p==="small"?28:34:void 0,V=()=>{if(!Y)return F;const _=O!==F;return z||K(O),_&&(r==null||r(O),s==null||s(O)),O},D=()=>{G(F)},ut=()=>{var _,Q,He;if(Y){G(""),i==null||i(),(_=b.current)==null||_.focus();return}z||K(""),r==null||r(""),i==null||i(),j?(Q=A.current)==null||Q.focus():(He=b.current)==null||He.focus()},Le=_=>{if(Y&&_.key==="Escape"){_.preventDefault(),E.current=!0,D(),_.currentTarget.blur();return}if(_.key==="Enter"&&!j){const Q=Y?V():F;Y&&(_.preventDefault(),E.current=!0,_.currentTarget.blur()),o==null||o(Q)}},Be=_=>{const Q=_.target.value;if(Y){G(Q),r==null||r(Q);return}z||K(Q),r==null||r(Q)},ze=()=>{k(!0),Y&&G(F)},De=()=>{if(Y&&E.current){E.current=!1,k(!1);return}Y&&V(),k(!1)},We=`nc-input ${p==="small"?"nc-small ":""}${!j&&x==="plain"?"nc-plain ":""}${P?"nc-error ":""}${w}`;return n.jsxs("div",{className:"nc-col",style:{position:"relative",flex:1,...N},onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:[d&&n.jsx("span",{className:"nc-label",children:d}),n.jsxs("div",{style:{position:"relative",display:"flex",alignItems:j?"flex-start":"center"},children:[v&&n.jsx("span",{className:"nc-input-leading-icon",style:{height:j?void 0:"100%",top:j?10:void 0},children:v}),j?n.jsx("textarea",{ref:A,className:We,placeholder:c,value:de,onChange:Be,onKeyDown:Le,onFocus:ze,onBlur:De,readOnly:a,"aria-disabled":a,tabIndex:a?-1:void 0,rows:g,style:{width:"100%",paddingRight:I,...L!==void 0?{paddingLeft:L}:{}}}):n.jsx("input",{ref:b,type:fe&&C?"text":m,className:We,placeholder:c,value:de,onChange:Be,onKeyDown:Le,onFocus:ze,onBlur:De,readOnly:a,"aria-disabled":a,tabIndex:a?-1:void 0,style:{width:"100%",paddingRight:I,...L!==void 0?{paddingLeft:L}:{}}}),he&&n.jsx(Tt,{onClick:ut,size:p,rightOffset:ie?me+4:4}),ie&&n.jsx(Pt,{visible:C,onClick:()=>S(!C),size:p})]}),P&&f&&n.jsx("span",{className:"nc-error-message",children:H})]})}function Bt({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 u=window.getSelection();if(u&&u.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 zt({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 Dt({values:e,onChange:t,options:r,placeholder:s="Select…",label:o}){const[i,c]=l.useState(!1),[a,d]=l.useState(""),u=l.useRef(null),m=l.useMemo(()=>r.filter(p=>p.label.toLowerCase().includes(a.toLowerCase())),[r,a]);l.useEffect(()=>{function p(x){!(x.target instanceof Node)||!u.current||u.current.contains(x.target)||c(!1)}return document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[]);const w=p=>{e.includes(p)?t(e.filter(x=>x!==p)):t([...e,p])};return n.jsxs("div",{ref:u,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(p=>{const x=r.find(N=>N.value===p);return x?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:[x.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:()=>w(p),"aria-label":`Remove ${x.label}`,children:"✕"})]},p):null}),n.jsx("input",{className:"nc-input",value:a,onChange:p=>d(p.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:[m.map(p=>{const x=e.includes(p.value);return n.jsxs("div",{className:"nc-section nc-row",style:{justifyContent:"space-between",cursor:"pointer",padding:12},onMouseDown:()=>w(p.value),children:[n.jsx("span",{children:p.label}),n.jsx("span",{children:x?"✔️":""})]},p.value)}),m.length===0&&n.jsx("div",{className:"nc-section nc-label",children:"No results"})]})]})}function we(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 xe(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 Ve(e){if(!e)return"";const t=xe(e);if(!/^\d{4}-\d{2}$/.test(t))return e;const[r,s]=t.split("-");return`${r}/${s}`}function Fe(){const e=new Date,t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0");return`${t}-${r}`}function Wt({startMonth:e,endMonth:t,onChange:r,label:s,className:o="",disabled:i=!1,size:c="default"}){const[a,d]=l.useState(!1),[u,m]=l.useState(""),[w,p]=l.useState(""),[x,N]=l.useState({top:0,left:0,width:0,right:void 0}),v=l.useRef(null),y=l.useRef(null);l.useEffect(()=>{if(a&&v.current){const k=v.current.getBoundingClientRect(),T=Math.max(k.width,400);window.innerWidth-k.left<T&&k.right>=T?N({top:k.bottom+4,left:0,right:window.innerWidth-k.right,width:T}):N({top:k.bottom+4,left:k.left,right:void 0,width:T})}},[a]),l.useEffect(()=>{if(!a)return;const k=R=>{v.current&&!v.current.contains(R.target)&&y.current&&!y.current.contains(R.target)&&d(!1)};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[a]);const j=()=>{m(e||Fe()),p(t||Fe()),d(!0)},g=()=>{d(!1)},h=()=>{const k=we(u),R=we(w);if(k||R)return;const T=xe(u),z=xe(w);T&&z&&(r==null||r(T,z)),d(!1)},f=e&&t?`${Ve(e)} - ${Ve(t)}`:"Select month range",b=we(u),A=we(w),E=xe(u),C=xe(w),S=E&&C&&E>C,$=a?ve.createPortal(n.jsx("div",{ref:y,className:"nc-month-range-picker-popup",style:{position:"fixed",top:x.top,...x.right!==void 0?{right:x.right}:{left:x.left},width:x.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 ${b?"nc-error":""}`,value:u,onChange:k=>m(k.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),b&&n.jsx("div",{className:"nc-month-error-text",children:b})]}),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 ${A?"nc-error":""}`,value:w,onChange:k=>p(k.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),A&&n.jsx("div",{className:"nc-month-error-text",children:A})]})]}),S&&!b&&!A&&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(X,{variant:"primary",onClick:h,disabled:!u||!w||!!b||!!A||!!S,children:"Apply"}),n.jsx(X,{variant:"ghost",onClick:g,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:v,className:`nc-month-range-picker-input${c==="small"?" nc-small":""}`,onClick:j,disabled:i,children:f}),$]})}const Ht=5,Vt=3;function Ft({value:e,onChange:t,min:r,max:s,step:o=1,label:i,disabled:c,size:a="default"}){const d=a==="small",u=l.useRef(null),m=l.useRef(!1),[w,p]=l.useState(!1),x=()=>{const f=e-o;r!==void 0&&f<r||t(parseFloat(f.toFixed(10)))},N=()=>{const f=e+o;s!==void 0&&f>s||t(parseFloat(f.toFixed(10)))},v=f=>{const b=parseFloat(f.target.value);isNaN(b)||r!==void 0&&b<r||s!==void 0&&b>s||t(b)},y=f=>{c||f.button!==0||(m.current=!1,u.current={startY:f.clientY,startValue:e,pointerId:f.pointerId,hasMoved:!1,lastValue:e},f.currentTarget.setPointerCapture(f.pointerId))},j=f=>{const b=u.current;if(!b||b.pointerId!==f.pointerId)return;const A=b.startY-f.clientY;if(Math.abs(A)>=Vt&&(b.hasMoved=!0,m.current=!0,p(!0)),!b.hasMoved)return;const E=Math.trunc(A/Ht);let C=b.startValue+E*o;r!==void 0&&(C=Math.max(r,C)),s!==void 0&&(C=Math.min(s,C)),C=parseFloat(C.toFixed(10)),C!==b.lastValue&&(b.lastValue=C,t(C))},g=f=>{const b=u.current;!b||b.pointerId!==f.pointerId||(f.currentTarget.hasPointerCapture(f.pointerId)&&f.currentTarget.releasePointerCapture(f.pointerId),u.current=null,p(!1))},h=f=>b=>{if(m.current){m.current=!1,b.preventDefault();return}f()};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:v,min:r,max:s,step:o,disabled:c}),n.jsxs("div",{className:`nc-number-input-spinners ${d?"nc-small":""} ${c?"nc-disabled":""} ${w?"nc-dragging":""}`,children:[n.jsx("button",{className:`nc-number-input-spin nc-number-input-spin-up ${d?"nc-small":""}`,onClick:h(N),onPointerDown:y,onPointerMove:j,onPointerUp:g,onPointerCancel:g,disabled:c||s!==void 0&&e>=s,tabIndex:-1,children:"▲"}),n.jsx("button",{className:`nc-number-input-spin nc-number-input-spin-down ${d?"nc-small":""}`,onClick:h(x),onPointerDown:y,onPointerMove:j,onPointerUp:g,onPointerCancel:g,disabled:c||r!==void 0&&e<=r,tabIndex:-1,children:"▼"})]})]})]})}function Ot({value:e,onChange:t,min:r=0,max:s=100,step:o=1,label:i,disabled:c,showValue:a=!0,formatValue:d=m=>m.toString(),width:u=200}){const m=p=>{const x=parseFloat(p.target.value);t(x)},w=(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:m,min:r,max:s,step:o,disabled:c,style:{width:u,"--nc-slider-percentage":`${w}%`}}),a&&n.jsx("span",{style:{color:"var(--nc-text)",fontFamily:"monospace",fontSize:14,minWidth:60,textAlign:"right"},children:d(e)})]})]})}const Gt=({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 Xe({children:e,className:t="",style:r}){return n.jsx("div",{className:`nc-tab-panel ${t}`,style:r,children:e})}function Yt({active:e,children:t,keepMounted:r=!1,className:s="",style:o}){const i=l.Children.toArray(t).filter(a=>l.isValidElement(a)&&(a.type===Xe||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 Kt({tabs:e,active:t,onChange:r,onClose:s,permanentTabs:o,className:i,toolbar:c,multiline:a,orientation:d="horizontal",style:u}){const m=l.useRef(null),[w,p]=l.useState(!1),[x,N]=l.useState(!1),v=d==="verticalLeft"||d==="verticalRight",y=l.useRef(!1),j=l.useRef(0),g=l.useRef(0),h=l.useRef(!1);l.useEffect(()=>{const S=()=>{if(m.current)if(v){const{scrollTop:k,scrollHeight:R,clientHeight:T}=m.current;p(k>1),N(k<R-T-1)}else{const{scrollLeft:k,scrollWidth:R,clientWidth:T}=m.current;p(k>1),N(k<R-T-1)}},$=m.current;if($)return S(),$.addEventListener("scroll",S),window.addEventListener("resize",S),()=>{$.removeEventListener("scroll",S),window.removeEventListener("resize",S)}},[e,v]);const f=S=>{m.current&&(y.current=!0,h.current=!1,j.current=v?S.clientY:S.clientX,g.current=v?m.current.scrollTop:m.current.scrollLeft,m.current.style.cursor="grabbing",m.current.style.userSelect="none")},b=S=>{if(!y.current||!m.current)return;const $=v?S.clientY:S.clientX,k=j.current-$;Math.abs(k)>3&&(h.current=!0),v?m.current.scrollTop=g.current+k:m.current.scrollLeft=g.current+k},A=()=>{m.current&&(y.current=!1,m.current.style.cursor="",m.current.style.userSelect="")},E=()=>{A()};l.useEffect(()=>{const S=m.current;if(!S||v)return;const $=k=>{k.deltaY!==0&&(k.preventDefault(),S.scrollLeft+=k.deltaY*.3)};return S.addEventListener("wheel",$,{passive:!1}),()=>{S.removeEventListener("wheel",$)}},[v]);const C=S=>{h.current||r(S)};return n.jsxs("div",{className:`nc-tab-container ${v?`nc-vertical nc-${d}`:""} ${i||""}`,style:u,children:[n.jsxs("div",{className:"nc-tab-scroll-wrapper",children:[w&&n.jsx("div",{className:`nc-tab-scroll-indicator ${v?"nc-top":"nc-left"}`,children:v?n.jsx(Gt,{size:16}):n.jsx(q.ChevronLeftIcon,{size:16})}),n.jsx("div",{ref:m,className:`nc-tab-scroll ${a?"nc-multiline":""}`,onMouseDown:f,onMouseMove:b,onMouseUp:A,onMouseLeave:E,style:{cursor:"grab"},children:e.map(S=>{const $=typeof S=="string"?S:S.id,k=typeof S=="string"?S:S.label,R=s&&!(o!=null&&o.includes($));return n.jsxs("div",{className:`nc-tab-item ${t===$?"nc-active":""} ${R?"nc-closable":""}`,onClick:()=>C($),role:"button",tabIndex:0,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&r($)},children:[n.jsx("span",{className:"nc-tab-label",children:v?k:typeof k=="string"?k.toUpperCase():k}),R&&n.jsx("span",{className:"nc-tab-close",role:"button",tabIndex:0,"aria-label":`Close ${typeof k=="string"?k:$}`,onClick:T=>{T.stopPropagation(),s($)},onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.stopPropagation(),s($))},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"})]})})]},$)})}),x&&n.jsx("div",{className:`nc-tab-scroll-indicator ${v?"nc-bottom":"nc-right"}`,children:v?n.jsx(q.ChevronDownIcon,{size:16}):n.jsx(q.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 Oe=["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 Ut(e,t){const s=e.slice(0,t).split(`
1
+ "use strict";var pt=Object.defineProperty;var ft=(e,t,r)=>t in e?pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var te=(e,t,r)=>ft(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),q=require("./GeneratedIcons-CGjL38ny.cjs"),l=require("react"),ve=require("react-dom"),ee=require("react-i18next"),ht=require("i18next"),mt=require("./clsx-C11secjj.cjs");function Ce({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 X({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 b=["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=x=>{if(!a){if(c){const S=window.getSelection();if(S&&S.toString().length>0)return}d==null||d(x)}};return n.jsxs("button",{className:b,disabled:i||a,onClick:u,...h,children:[a&&n.jsx(Ce,{size:"small",className:"nc-button-spinner",color:s==="transparent"||e!=="default"&&e!=="ghost"?"white":void 0}),p]})}const gt={info:"primary",success:"success",warning:"warning",error:"danger",danger:"danger"};function bt({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(q.CloseIcon,{size:16})})]}),s&&n.jsx("span",{className:"nc-alert-action",children:n.jsx(X,{size:"small",variant:s.variant??gt[r],onClick:o,children:s.text})})]})}function xt({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?"rgba(255,255,255,0.35)":"#000000";const a="var(--nc-battery-shell-bg)",d=24,p=14,h=2,b=0,u=12,x=0,S=0,v=0,w=d,k=p,m=k-x*2,f=w-x*2,g=Math.max(1,Math.min(4,k/4)),j=o===0?0:.05+o*.95,y=d+h+u,C=20,$=.65,A=Math.max(p,C*$),R=d+h+1,N=(p-C*$)/2;return n.jsxs("svg",{className:"nc-battery",width:y,height:A,viewBox:`0 0 ${y} ${A}`,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*j,height:m,fill:"white"})})}),n.jsx("rect",{x:S,y:v,rx:g,ry:g,width:w,height:k,fill:a}),n.jsx("rect",{x:S+x,y:v+x,width:f,height:m,fill:c,rx:g,ry:g,mask:`url(#nc-battery-fill-mask-${o})`}),n.jsx("text",{x:S+w/2,y:p-3,fontSize:11,fontWeight:"bold",fill:"var(--nc-battery-text-contrast)",textAnchor:"middle",children:i}),n.jsx("rect",{x:d+b,y:p*.26,width:h,height:p*.48,rx:.8,ry:.8,fill:o===1?c:a}),t==="charging"?n.jsx("g",{transform:`translate(${R}, ${N}) scale(${$})`,fill:c,children:n.jsx("path",{d:"M10 0 L2 11 H8 L5 20 L14 8 H8 L10 0 Z"})}):null]})}function vt({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 wt({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 yt({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(wt,{size:o})}),s&&n.jsx("span",{className:"nc-checkbox-text",style:i?{color:i}:void 0,children:s})]})}function jt({option:e,onChange:t,selected:r,highlighted:s,small:o,renderOption:i,index:c}){const a=l.useRef(null),{t:d}=ee.useTranslation(),p=e.disabled===!0;return l.useEffect(()=>{s&&a.current&&a.current.scrollIntoView({block:"nearest"})},[s]),n.jsx("div",{ref:a,className:`nc-combo-dropdown-option ${o?"nc-small":""} ${s?"nc-highlighted":""} ${p?"nc-disabled":""}`,role:"option",onClick:()=>{p||t(e.value,e.label)},"aria-selected":r,"aria-disabled":p,style:{cursor:p?"default":"pointer",opacity:p?.4:void 0,background:s&&!p?"rgba(59,130,246,0.18)":r&&!p?"rgba(59,130,246,0.12)":void 0},children:i?i(e,c,!!s):n.jsxs(n.Fragment,{children:[e.label,e.default&&n.jsxs("span",{style:{fontSize:"0.85em",color:"var(--nc-text-weak)",marginLeft:6},children:["(",d("common.default"),")"]})]})})}function kt({isOpen:e,options:t,onSelect:r,selectedValue:s,placement:o="bottom",anchorRef:i,small:c,highlightedIndex:a=-1,renderOption:d}){const[p,h]=l.useState({top:0,left:0,width:0}),[b,u]=l.useState(o),{t:x}=ee.useTranslation();if(l.useEffect(()=>{if(e&&i.current){const v=i.current.getBoundingClientRect();let w=o;if(o==="bottom"){const k=window.innerHeight-v.bottom,m=v.top;k<320&&m>k&&(w="top")}u(w),h({top:w==="top"?v.top-4:v.bottom+4,left:v.left,width:v.width})}},[e,i,o]),!e)return null;const S=n.jsx("div",{className:"nc-combo-dropdown",onMouseDown:v=>v.stopPropagation(),style:{position:"fixed",top:b==="top"?void 0:p.top,bottom:b==="top"?window.innerHeight-p.top:void 0,left:p.left,width:p.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:x("common.noResults")}):t.map((v,w)=>n.jsx(jt,{option:v,onChange:r,selected:v.value===s,highlighted:w===a,small:c,renderOption:d,index:w},v.value))});return ve.createPortal(S,document.body)}function Nt({onClick:e,small:t}){return n.jsx("span",{role:"button",tabIndex:0,className:`nc-combo-button nc-combo-clear ${t?"nc-small":""}`,onClick:r=>{r.stopPropagation(),e()},onMouseDown:r=>r.stopPropagation(),onKeyDown:r=>{(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),r.stopPropagation(),e())},"aria-label":"Clear selection",children:"✕"})}function St({open:e,small:t}){return n.jsx("span",{"aria-hidden":!0,className:`nc-combo-button nc-combo-toggle ${t?"nc-small":""} ${e?"nc-open":""}`,children:"▾"})}function At({value:e,onChange:t,placeholder:r="Select…",options:s,candidates:o,renderOption:i,renderSelected:c,selectedOption:a,disabled:d,label:p,clearable:h=!0,allowTyping:b=!1,placement:u="bottom",size:x="default",appearance:S="default",textAlign:v="left",style:w,className:k}){const[m,f]=l.useState(!1),[g,j]=l.useState(""),[y,C]=l.useState(-1),$=l.useRef(null),A=l.useRef(null),R=l.useRef(null),N=x==="small",{t:M}=ee.useTranslation(),T=!!o,z=b||T,[se,K]=l.useState([]),[F,O]=l.useState(()=>{if(s&&e){const E=s.find(B=>B.value===e);return E?E.label:""}return o&&e?e:""});l.useEffect(()=>{if(!e){O("");return}if(s){const E=s.find(B=>B.value===e);E&&O(E.label)}else o&&O(e)},[e,s,o]);const G=(E,B=!1)=>{if(!o)return;R.current&&clearTimeout(R.current);const L=async()=>{try{const V=await o(E);K(V),C(-1)}catch{K([])}};B?L():R.current=setTimeout(L,200)},H=l.useMemo(()=>{if(T)return se;const E=g.toLowerCase();return z?(s||[]).filter(B=>B.label.toLowerCase().includes(E)):s||[]},[s,g,z,T,se]);l.useEffect(()=>{m&&C(-1)},[m,H]),l.useEffect(()=>{if(!h&&!e&&s&&s.length>0&&t){const E=s.find(B=>B.default)||s[0];t(E.value)}},[h,e,s,t]),l.useEffect(()=>{function E(B){var L;B.target instanceof Node&&$.current&&((L=$.current.parentElement)!=null&&L.contains(B.target)||f(!1))}return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[]);const P=a??(s?s.find(E=>E.value===e):e?{label:F,value:e}:void 0),Y=P&&h,oe=!d&&!Y,de=`nc-align-${v}`,fe=!(m&&z)&&!!P,ie=(E,B,L=!1)=>{var V;O(B),t==null||t(E),f(!1),j(""),L&&((V=$.current)==null||V.blur())},he=()=>{t==null||t(void 0),j(""),f(!1)},me=E=>{if(!m){(E.key==="ArrowDown"||E.key==="ArrowUp")&&(f(!0),E.preventDefault());return}const B=(L,V)=>{if(V===1){for(let D=L;D<H.length;D++)if(!H[D].disabled)return D;for(let D=0;D<L;D++)if(!H[D].disabled)return D}else{for(let D=L;D>=0;D--)if(!H[D].disabled)return D;for(let D=H.length-1;D>L;D--)if(!H[D].disabled)return D}return L};switch(E.key){case"ArrowDown":E.preventDefault(),C(L=>{const V=L+1,D=V>=H.length?0:V;return B(D,1)});break;case"ArrowUp":E.preventDefault(),C(L=>{const V=L-1,D=V<0?H.length-1:V;return B(D,-1)});break;case"Enter":E.preventDefault(),y>=0&&y<H.length&&!H[y].disabled&&ie(H[y].value,H[y].label,!0);break;case"Escape":E.preventDefault(),f(!1),j("");break}};return n.jsxs("div",{className:`nc-combo-container ${S==="transparent"?"nc-transparent":""} ${S==="plain"?"nc-plain":""} ${m?"nc-open":""} ${de} ${k||""}`.trim(),style:{position:"relative",...w},children:[p&&n.jsx("span",{className:`nc-label ${N?"nc-small":""}`,children:p}),n.jsxs("div",{ref:A,style:{position:"relative",display:"flex",alignItems:"center"},onMouseDown:E=>{if(d||z&&E.target===$.current)return;const B=!m;if(f(L=>(!L&&z&&P&&j(P.label),!L)),T&&B){const L=z&&P?P.label:"";K([]),setTimeout(()=>G(L,!0),0)}z&&!m&&setTimeout(()=>{var L,V;(L=$.current)==null||L.focus(),(V=$.current)==null||V.select()},0)},children:[n.jsx("input",{ref:$,className:`nc-input ${N?"nc-small":""}`,placeholder:r,onFocus:()=>{if(!d&&z){f(!0);const E=P?P.label:"";P&&(j(E),setTimeout(()=>{var B;return(B=$.current)==null?void 0:B.select()},0)),T&&(K([]),G(E,!0))}},onChange:E=>{const B=E.target.value;z&&(j(B),T&&G(B))},onKeyDown:me,value:m&&z?g:(P==null?void 0:P.label)||"",readOnly:d||!z,style:{width:"100%",paddingRight:oe||Y?N?32:44:12,caretColor:b?void 0:"transparent",cursor:b?void 0:"pointer",userSelect:b?void 0:"none",color:fe?"transparent":"var(--nc-text)"}}),fe&&n.jsx("div",{"aria-hidden":!0,className:`nc-combo-overlay ${de}`,style:{position:"absolute",left:N?8:12,right:oe||Y?N?12:24:N?8:12,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",display:"flex",alignItems:"center",gap:6},children:c&&P?c(P):n.jsxs(n.Fragment,{children:[n.jsx("span",{className:`nc-combo-overlay-text ${N?"nc-small":""}`,children:P==null?void 0:P.label}),(P==null?void 0:P.default)&&n.jsxs("span",{className:`nc-combo-overlay-default ${N?"nc-small":""}`,children:["(",M("common.default"),")"]})]})}),Y&&n.jsx(Nt,{onClick:he,small:N}),oe&&n.jsx(St,{open:m,small:N})]}),n.jsx(kt,{isOpen:m,options:H,onSelect:ie,selectedValue:e,placement:u,anchorRef:A,small:N,highlightedIndex:y,renderOption:i})]})}function Ct({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(q.RefreshIcon,{size:c,className:t?"nc-spinning":""})})}function Re({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(q.CloseIcon,{size:i})})}function Rt({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(q.EditIcon,{size:i})})}function Mt({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(q.TrashIcon,{size:i})})}function It({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 Et({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(),x=c.current.getBoundingClientRect(),S=window.innerHeight,v=window.innerWidth,w=u.bottom+8,k=w+x.height<=S-8;let m=i;(!k&&i==="down"||i==="up"&&k)&&(m="up");let f;m==="down"?f=w:f=u.top-x.height-8;let g=u.left;g+x.width>v-8&&(g=u.right-x.width),d({top:Math.max(8,f),left:Math.max(8,g)})},[e,p,i]),l.useEffect(()=>{if(!e)return;const u=S=>{c.current&&!c.current.contains(S.target)&&p&&!p.contains(S.target)&&t()},x=S=>{S.key==="Escape"&&t()};return document.addEventListener("mousedown",u),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",x)}},[e,t,p]),!e)return null;const h=u=>{u.type!=="separator"&&!u.disabled&&u.onClick&&(u.onClick(),t())},b=r.some(u=>u.icon);return ve.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 x=["nc-context-menu-item",u.variant&&u.variant!=="default"?`nc-${u.variant}`:"",u.disabled?"nc-disabled":"",b&&!u.icon?"nc-indented":""].filter(Boolean).join(" ");return n.jsxs("button",{className:x,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 Ue=l.createContext(null);function qe(){const e=l.useContext(Ue);if(!e)throw new Error("useDialog must be used inside a Dialog component");return e}function ae({children:e,onClick:t,...r}){const{close:s}=qe(),{t:o}=ee.useTranslation(),i=c=>{t==null||t(c),s()};return n.jsx(X,{onClick:i,...r,children:e??o("common.close")})}function $t({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:b,closeOnOverlay:u=!0,primaryDisabled:x=!1,fullScreen:S=!1,hideTitleBar:v=!1,className:w="",onContentHeightChange:k}){const m=l.useRef(null),f=l.useRef(null),{t:g}=ee.useTranslation(),j={close:t},y=A=>{u&&A.target===A.currentTarget&&t()};if(l.useEffect(()=>{e&&m.current&&m.current.focus()},[e]),l.useEffect(()=>{if(!k||!f.current)return;const A=new ResizeObserver(R=>{for(const N of R){const M=N.contentRect.height;k(M)}});return A.observe(f.current),()=>{A.disconnect()}},[k]),!e)return null;const C=()=>{switch(i){case"ok":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(X,{variant:"primary",onClick:a??t,disabled:x,children:g("common.ok")})});case"ok-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:h,children:g("common.cancel")}),n.jsx(X,{variant:"primary",onClick:a??t,disabled:x,children:g("common.ok")})]});case"save-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:h,children:g("common.cancel")}),n.jsx(X,{variant:"primary",onClick:d,disabled:x,children:g("common.save")})]});case"delete-cancel":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:h,children:g("common.cancel")}),n.jsx(X,{variant:"danger",onClick:p,disabled:x,children:g("common.delete")})]});case"connect":return n.jsxs("div",{className:"nc-dialog-footer",children:[n.jsx(ae,{onClick:h,children:g("common.cancel")}),n.jsx(X,{variant:"primary",onClick:b,disabled:x,children:g("common.connect")})]});case"close":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(ae,{variant:"primary"})});case"gotit":return n.jsx("div",{className:"nc-dialog-footer",children:n.jsx(ae,{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}},$=n.jsx(Ue.Provider,{value:j,children:n.jsx("div",{className:`nc-dialog-overlay${S?" nc-fullscreen":""}`,onClick:y,children:n.jsxs("div",{ref:m,className:`nc-dialog-container ${w}`,style:o,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":v?void 0:"nc-dialog-title",children:[!v&&n.jsxs("div",{className:"nc-dialog-header",children:[n.jsx("h3",{id:"nc-dialog-title",className:"nc-dialog-title",children:r}),n.jsx(Re,{onClick:t,"aria-label":"Close dialog"})]}),n.jsx("div",{ref:f,className:"nc-dialog-content",children:s}),C()]})})});return S?ve.createPortal($,document.body):$}function Tt({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 Pt({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(q.EyeHiddenIcon,{size:o}):n.jsx(q.ViewIcon,{size:o})})}function Lt({value:e,defaultValue:t="",onChange:r,onChangeConfirmed:s,onEnter:o,onClear:i,placeholder:c,disabled:a,label:d,clearable:p=!0,type:h="text",className:b="",size:u="default",appearance:x="default",style:S,leadingIcon:v,showPasswordToggle:w=!1,multiline:k=!1,rows:m=3,validator:f,showErrorMessage:g=!0}){const j=l.useRef(null),y=l.useRef(null),C=l.useRef(!1),[$,A]=l.useState(!1),[R,N]=l.useState(!1),[M,T]=l.useState(!1),z=e!==void 0,[se,K]=l.useState(t),F=z?e:se,[O,G]=l.useState(F),H=f?f(F):null,P=!!H,Y=!k&&x==="plain",oe=Y&&R,de=oe?O:F;l.useEffect(()=>{oe||G(F)},[F,oe]);const fe=h==="password",ie=fe&&w&&!a&&!k,he=p&&de&&!a&&(R||M),me=u==="small"?32:44;let E=12;he&&ie?E=me*2:(he||ie)&&(E=me);const L=v?u==="small"?28:34:void 0,V=()=>{if(!Y)return F;const _=O!==F;return z||K(O),_&&(r==null||r(O),s==null||s(O)),O},D=()=>{G(F)},ut=()=>{var _,Q,He;if(Y){G(""),i==null||i(),(_=j.current)==null||_.focus();return}z||K(""),r==null||r(""),i==null||i(),k?(Q=y.current)==null||Q.focus():(He=j.current)==null||He.focus()},Le=_=>{if(Y&&_.key==="Escape"){_.preventDefault(),C.current=!0,D(),_.currentTarget.blur();return}if(_.key==="Enter"&&!k){const Q=Y?V():F;Y&&(_.preventDefault(),C.current=!0,_.currentTarget.blur()),o==null||o(Q)}},Be=_=>{const Q=_.target.value;if(Y){G(Q),r==null||r(Q);return}z||K(Q),r==null||r(Q)},ze=()=>{N(!0),Y&&G(F)},De=()=>{if(Y&&C.current){C.current=!1,N(!1);return}Y&&V(),N(!1)},We=`nc-input ${u==="small"?"nc-small ":""}${!k&&x==="plain"?"nc-plain ":""}${P?"nc-error ":""}${b}`;return n.jsxs("div",{className:"nc-col",style:{position:"relative",flex:1,...S},onMouseEnter:()=>T(!0),onMouseLeave:()=>T(!1),children:[d&&n.jsx("span",{className:"nc-label",children:d}),n.jsxs("div",{style:{position:"relative",display:"flex",alignItems:k?"flex-start":"center"},children:[v&&n.jsx("span",{className:"nc-input-leading-icon",style:{height:k?void 0:"100%",top:k?10:void 0},children:v}),k?n.jsx("textarea",{ref:y,className:We,placeholder:c,value:de,onChange:Be,onKeyDown:Le,onFocus:ze,onBlur:De,readOnly:a,"aria-disabled":a,tabIndex:a?-1:void 0,rows:m,style:{width:"100%",paddingRight:E,...L!==void 0?{paddingLeft:L}:{}}}):n.jsx("input",{ref:j,type:fe&&$?"text":h,className:We,placeholder:c,value:de,onChange:Be,onKeyDown:Le,onFocus:ze,onBlur:De,readOnly:a,"aria-disabled":a,tabIndex:a?-1:void 0,style:{width:"100%",paddingRight:E,...L!==void 0?{paddingLeft:L}:{}}}),he&&n.jsx(Tt,{onClick:ut,size:u,rightOffset:ie?me+4:4}),ie&&n.jsx(Pt,{visible:$,onClick:()=>A(!$),size:u})]}),P&&g&&n.jsx("span",{className:"nc-error-message",children:H})]})}function Bt({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 zt({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 Dt({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(x){!(x.target instanceof Node)||!p.current||p.current.contains(x.target)||c(!1)}return document.addEventListener("mousedown",u),()=>document.removeEventListener("mousedown",u)},[]);const b=u=>{e.includes(u)?t(e.filter(x=>x!==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 x=r.find(S=>S.value===u);return x?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:[x.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:()=>b(u),"aria-label":`Remove ${x.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 x=e.includes(u.value);return n.jsxs("div",{className:"nc-section nc-row",style:{justifyContent:"space-between",cursor:"pointer",padding:12},onMouseDown:()=>b(u.value),children:[n.jsx("span",{children:u.label}),n.jsx("span",{children:x?"✔️":""})]},u.value)}),h.length===0&&n.jsx("div",{className:"nc-section nc-label",children:"No results"})]})]})}function we(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 xe(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 Ve(e){if(!e)return"";const t=xe(e);if(!/^\d{4}-\d{2}$/.test(t))return e;const[r,s]=t.split("-");return`${r}/${s}`}function Fe(){const e=new Date,t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0");return`${t}-${r}`}function Wt({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(""),[b,u]=l.useState(""),[x,S]=l.useState({top:0,left:0,width:0,right:void 0}),v=l.useRef(null),w=l.useRef(null);l.useEffect(()=>{if(a&&v.current){const N=v.current.getBoundingClientRect(),T=Math.max(N.width,400);window.innerWidth-N.left<T&&N.right>=T?S({top:N.bottom+4,left:0,right:window.innerWidth-N.right,width:T}):S({top:N.bottom+4,left:N.left,right:void 0,width:T})}},[a]),l.useEffect(()=>{if(!a)return;const N=M=>{v.current&&!v.current.contains(M.target)&&w.current&&!w.current.contains(M.target)&&d(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[a]);const k=()=>{h(e||Fe()),u(t||Fe()),d(!0)},m=()=>{d(!1)},f=()=>{const N=we(p),M=we(b);if(N||M)return;const T=xe(p),z=xe(b);T&&z&&(r==null||r(T,z)),d(!1)},g=e&&t?`${Ve(e)} - ${Ve(t)}`:"Select month range",j=we(p),y=we(b),C=xe(p),$=xe(b),A=C&&$&&C>$,R=a?ve.createPortal(n.jsx("div",{ref:w,className:"nc-month-range-picker-popup",style:{position:"fixed",top:x.top,...x.right!==void 0?{right:x.right}:{left:x.left},width:x.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 ${j?"nc-error":""}`,value:p,onChange:N=>h(N.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),j&&n.jsx("div",{className:"nc-month-error-text",children:j})]}),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 ${y?"nc-error":""}`,value:b,onChange:N=>u(N.target.value),placeholder:"YY-M(M) or YYYY-M(M)"}),y&&n.jsx("div",{className:"nc-month-error-text",children:y})]})]}),A&&!j&&!y&&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(X,{variant:"primary",onClick:f,disabled:!p||!b||!!j||!!y||!!A,children:"Apply"}),n.jsx(X,{variant:"ghost",onClick:m,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:v,className:`nc-month-range-picker-input${c==="small"?" nc-small":""}`,onClick:k,disabled:i,children:g}),R]})}const Ht=5,Vt=3;function Ft({value:e,onChange:t,min:r,max:s,step:o=1,label:i,disabled:c,className:a="",style:d,size:p="default"}){const h=p==="small",b=l.useRef(null),u=l.useRef(!1),[x,S]=l.useState(!1),v=()=>{const y=e-o;r!==void 0&&y<r||t(parseFloat(y.toFixed(10)))},w=()=>{const y=e+o;s!==void 0&&y>s||t(parseFloat(y.toFixed(10)))},k=y=>{const C=parseFloat(y.target.value);isNaN(C)||r!==void 0&&C<r||s!==void 0&&C>s||t(C)},m=y=>{c||y.button!==0||(u.current=!1,b.current={startY:y.clientY,startValue:e,pointerId:y.pointerId,hasMoved:!1,lastValue:e},y.currentTarget.setPointerCapture(y.pointerId))},f=y=>{const C=b.current;if(!C||C.pointerId!==y.pointerId)return;const $=C.startY-y.clientY;if(Math.abs($)>=Vt&&(C.hasMoved=!0,u.current=!0,S(!0)),!C.hasMoved)return;const A=Math.trunc($/Ht);let R=C.startValue+A*o;r!==void 0&&(R=Math.max(r,R)),s!==void 0&&(R=Math.min(s,R)),R=parseFloat(R.toFixed(10)),R!==C.lastValue&&(C.lastValue=R,t(R))},g=y=>{const C=b.current;!C||C.pointerId!==y.pointerId||(y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),b.current=null,S(!1))},j=y=>C=>{if(u.current){u.current=!1,C.preventDefault();return}y()};return n.jsxs("div",{className:`nc-col nc-number-input-col ${h?"nc-small":""}`,children:[i&&n.jsx("span",{className:`nc-label ${h?"nc-small":""}`,children:i}),n.jsxs("div",{className:`nc-number-input-container ${h?"nc-small":""} ${a}`,style:d,children:[n.jsx("input",{className:`nc-input nc-number-input ${h?"nc-small":""}`,type:"number",value:e,onChange:k,min:r,max:s,step:o,disabled:c}),n.jsxs("div",{className:`nc-number-input-spinners ${h?"nc-small":""} ${c?"nc-disabled":""} ${x?"nc-dragging":""}`,children:[n.jsx("button",{className:`nc-number-input-spin nc-number-input-spin-up ${h?"nc-small":""}`,onClick:j(w),onPointerDown:m,onPointerMove:f,onPointerUp:g,onPointerCancel:g,disabled:c||s!==void 0&&e>=s,tabIndex:-1,children:"▲"}),n.jsx("button",{className:`nc-number-input-spin nc-number-input-spin-down ${h?"nc-small":""}`,onClick:j(v),onPointerDown:m,onPointerMove:f,onPointerUp:g,onPointerCancel:g,disabled:c||r!==void 0&&e<=r,tabIndex:-1,children:"▼"})]})]})]})}function Ot({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 x=parseFloat(u.target.value);t(x)},b=(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":`${b}%`}}),a&&n.jsx("span",{style:{color:"var(--nc-text)",fontFamily:"monospace",fontSize:14,minWidth:60,textAlign:"right"},children:d(e)})]})]})}const Gt=({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 Xe({children:e,className:t="",style:r}){return n.jsx("div",{className:`nc-tab-panel ${t}`,style:r,children:e})}function Yt({active:e,children:t,keepMounted:r=!1,className:s="",style:o}){const i=l.Children.toArray(t).filter(a=>l.isValidElement(a)&&(a.type===Xe||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 Kt({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),[b,u]=l.useState(!1),[x,S]=l.useState(!1),v=d==="verticalLeft"||d==="verticalRight",w=l.useRef(!1),k=l.useRef(0),m=l.useRef(0),f=l.useRef(!1);l.useEffect(()=>{const A=()=>{if(h.current)if(v){const{scrollTop:N,scrollHeight:M,clientHeight:T}=h.current;u(N>1),S(N<M-T-1)}else{const{scrollLeft:N,scrollWidth:M,clientWidth:T}=h.current;u(N>1),S(N<M-T-1)}},R=h.current;if(R)return A(),R.addEventListener("scroll",A),window.addEventListener("resize",A),()=>{R.removeEventListener("scroll",A),window.removeEventListener("resize",A)}},[e,v]);const g=A=>{h.current&&(w.current=!0,f.current=!1,k.current=v?A.clientY:A.clientX,m.current=v?h.current.scrollTop:h.current.scrollLeft,h.current.style.cursor="grabbing",h.current.style.userSelect="none")},j=A=>{if(!w.current||!h.current)return;const R=v?A.clientY:A.clientX,N=k.current-R;Math.abs(N)>3&&(f.current=!0),v?h.current.scrollTop=m.current+N:h.current.scrollLeft=m.current+N},y=()=>{h.current&&(w.current=!1,h.current.style.cursor="",h.current.style.userSelect="")},C=()=>{y()};l.useEffect(()=>{const A=h.current;if(!A||v)return;const R=N=>{N.deltaY!==0&&(N.preventDefault(),A.scrollLeft+=N.deltaY*.3)};return A.addEventListener("wheel",R,{passive:!1}),()=>{A.removeEventListener("wheel",R)}},[v]);const $=A=>{f.current||r(A)};return n.jsxs("div",{className:`nc-tab-container ${v?`nc-vertical nc-${d}`:""} ${i||""}`,style:p,children:[n.jsxs("div",{className:"nc-tab-scroll-wrapper",children:[b&&n.jsx("div",{className:`nc-tab-scroll-indicator ${v?"nc-top":"nc-left"}`,children:v?n.jsx(Gt,{size:16}):n.jsx(q.ChevronLeftIcon,{size:16})}),n.jsx("div",{ref:h,className:`nc-tab-scroll ${a?"nc-multiline":""}`,onMouseDown:g,onMouseMove:j,onMouseUp:y,onMouseLeave:C,style:{cursor:"grab"},children:e.map(A=>{const R=typeof A=="string"?A:A.id,N=typeof A=="string"?A:A.label,M=s&&!(o!=null&&o.includes(R));return n.jsxs("div",{className:`nc-tab-item ${t===R?"nc-active":""} ${M?"nc-closable":""}`,onClick:()=>$(R),role:"button",tabIndex:0,onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&r(R)},children:[n.jsx("span",{className:"nc-tab-label",children:v?N:typeof N=="string"?N.toUpperCase():N}),M&&n.jsx("span",{className:"nc-tab-close",role:"button",tabIndex:0,"aria-label":`Close ${typeof N=="string"?N:R}`,onClick:T=>{T.stopPropagation(),s(R)},onKeyDown:T=>{(T.key==="Enter"||T.key===" ")&&(T.stopPropagation(),s(R))},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"})]})})]},R)})}),x&&n.jsx("div",{className:`nc-tab-scroll-indicator ${v?"nc-bottom":"nc-right"}`,children:v?n.jsx(q.ChevronDownIcon,{size:16}):n.jsx(q.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 Oe=["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 Ut(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 qt(e,t,r,s){const o=e.split(`
3
- `),i=Math.max(1,Math.min(t,o.length));let c=0;for(let w=0;w<i-1;w++)c+=o[w].length+1;const d=o[i-1].split(" "),u=Math.max(1,Math.min(r,d.length));for(let w=0;w<u-1;w++)c+=d[w].length+1;const m=Math.max(1,Math.min(s,d[u-1].length+1));return c+=m-1,c}function Xt(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 Jt=l.forwardRef(function({value:t,onChange:r,placeholder:s,className:o,style:i,showLineNumbers:c=!1,onCursorChange:a,highlightLine:d},u){const m=l.useRef(null),w=l.useRef(null),p=l.useRef(null);l.useImperativeHandle(u,()=>({goToLine(g){const h=m.current;if(!h)return;const f=Xt(t,g);h.focus(),h.setSelectionRange(f,f);const b=parseFloat(getComputedStyle(h).lineHeight)||18;h.scrollTop=(Math.max(1,g)-1)*b,N(),x()},goToPosition(g,h,f){const b=m.current;if(!b)return;const A=qt(t,g,h,f);b.focus(),b.setSelectionRange(A,A);const E=parseFloat(getComputedStyle(b).lineHeight)||18;b.scrollTop=(Math.max(1,g)-1)*E,N(),x()}}),[t]);const x=l.useCallback(()=>{if(!a||!m.current)return;const g=Ut(t,m.current.selectionStart);a(g)},[a,t]),N=l.useCallback(()=>{const g=m.current;g&&(w.current&&(w.current.scrollTop=g.scrollTop,w.current.scrollLeft=g.scrollLeft),p.current&&(p.current.scrollTop=g.scrollTop))},[]);l.useEffect(()=>{if(d==null||d<1)return;const g=m.current;if(!g)return;const h=parseFloat(getComputedStyle(g).lineHeight)||18,f=(d-1)*h,b=f+h;(f<g.scrollTop||b>g.scrollTop+g.clientHeight)&&(g.scrollTop=f-g.clientHeight/2+h/2),N()},[d]);const v=l.useMemo(()=>t.split(`
5
- `).length,[t]),y=()=>{const g=[];for(let h=1;h<=v;h++)g.push(n.jsx("div",{className:`nc-csv-line-number ${d===h?"nc-csv-highlight":""}`,children:h},h));return n.jsx("div",{className:"nc-csv-gutter",ref:p,children:g})},j=g=>g?g.split(`
6
- `).map((f,b)=>{const A=f.split(" ");return n.jsxs("div",{className:`nc-csv-line ${d===b+1?"nc-csv-highlight":""}`,children:[A.map((E,C)=>n.jsxs("span",{children:[C>0&&n.jsx("span",{className:"nc-csv-tab-char",children:" "}),n.jsx("span",{style:{color:Oe[C%Oe.length]},children:E})]},C)),f===""&&`
7
- `]},b)}):null;return n.jsxs("div",{className:`nc-csv-textarea-container ${c?"nc-csv-with-gutter":""} ${o??""}`,style:i,children:[c&&y(),n.jsxs("div",{className:"nc-csv-textarea-editor",children:[n.jsx("div",{className:"nc-csv-textarea-backdrop",ref:w,children:n.jsx("pre",{className:"nc-csv-textarea-highlights",children:j(t)})}),n.jsx("textarea",{ref:m,className:"nc-csv-textarea-input",value:t,onChange:g=>{r(g.target.value),requestAnimationFrame(x)},onScroll:N,onSelect:x,onKeyUp:x,onClick:x,placeholder:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off"})]})]})});let ce={notifications:[]};const Ne=new Set,Ge=new Map;function Se(){const e=ce.notifications.slice();for(const t of Array.from(Ne))try{t(e)}catch{}}function Qt(e){Ne.add(e);try{e(ce.notifications.slice())}catch{}return()=>{Ne.delete(e)}}function Zt(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 ce.notifications=[i,...ce.notifications],Se(),i.duration&&i.duration>0&&setTimeout(()=>{Je(t)},i.duration),t}function Je(e){const t=ce.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,Se();const r=window.setTimeout(()=>{ce.notifications=ce.notifications.filter(s=>s.id!==e),Se(),Ge.delete(e)},300);Ge.set(e,r)}function en({type:e}){switch(e){case"success":return n.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:n.jsx("path",{d:"M5 10.5l3.1 3.1L15 6.8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});case"danger":return n.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("circle",{cx:"10",cy:"10",r:"7",stroke:"currentColor",strokeWidth:"2"}),n.jsx("path",{d:"M10 6.5v4.25",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"10",cy:"13.75",r:"1",fill:"currentColor"})]});case"warning":return n.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M10 3.5 16 15H4L10 3.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),n.jsx("path",{d:"M10 7.5v3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"10",cy:"13.25",r:"1",fill:"currentColor"})]});default:return n.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("circle",{cx:"10",cy:"10",r:"7",stroke:"currentColor",strokeWidth:"2"}),n.jsx("path",{d:"M10 9v4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"10",cy:"6.5",r:"1",fill:"currentColor"})]})}}function Qe({notification:e}){const{t}=ee.useTranslation(),r=e.type||"info",s=()=>{if(e.title)return e.title;switch(r){case"success":return t("common.success");case"danger":return t("common.error");case"warning":return t("common.warning");default:return t("common.info")}},o=()=>{Je(e.id)};return n.jsx("div",{className:`nc-notification nc-notification-${r}`,children:n.jsxs("div",{className:"nc-notification-content",children:[n.jsx("div",{className:`nc-notification-icon nc-notification-icon-${r}`,children:n.jsx(en,{type:r})}),n.jsxs("div",{className:"nc-notification-body",children:[n.jsx("div",{className:"nc-notification-title",children:s()}),n.jsx("div",{className:"nc-notification-message",children:e.message})]}),e.dismissible&&n.jsx("button",{className:"nc-notification-dismiss",onClick:o,"aria-label":t("common.close"),children:n.jsx(q.CloseIcon,{size:16})})]})})}function tn(){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(()=>Qt(u=>{const m=new Set(a.current.map(p=>p.id)),w=u.filter(p=>!m.has(p.id)).map(p=>p.id);w.length>0?(t(u),i(new Set(w)),requestAnimationFrame(()=>{requestAnimationFrame(()=>{i(new Set)})})):t(u),a.current=u}),[]),l.useEffect(()=>{if(!c.current)return;const d=new Map;let u=0;const m=c.current.children;e.forEach((w,p)=>{if(d.set(w.id,u),m[p]){const x=m[p].offsetHeight;w.isRemoving||(u+=x+12)}}),s(d)},[e]),n.jsx("div",{style:{position:"fixed",top:"24px",left:"24px",zIndex:9999,pointerEvents:"none",width:"min(340px, calc(100vw - 32px))"},children:n.jsx("div",{ref:c,style:{pointerEvents:"auto",position:"relative",width:"100%"},children:e.map(d=>{const u=o.has(d.id),m=d.isRemoving,w=r.get(d.id)||0;return n.jsx("div",{style:{position:"absolute",top:0,left:0,transform:u?`translate3d(-40px, ${w}px, 0)`:`translate3d(0, ${w}px, 0)`,transition:m?"opacity 300ms ease-out":"transform 300ms ease-out, opacity 300ms ease-out",opacity:m?0:1,width:"100%"},children:n.jsx(Qe,{notification:d})},d.id)})})})}function Ze(e){return Zt(e)}const nn={show:e=>Ze(e)};function rn(e){const t=ht.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 sn{constructor(){te(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 le=new sn,Ye="nc-ui-app-state";class on{constructor(){te(this,"state");te(this,"listeners",new Map);this.state=this.loadState()}loadState(){try{const t=localStorage.getItem(Ye);if(t)return JSON.parse(t)}catch{}return{activeAppId:null}}saveState(){try{localStorage.setItem(Ye,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 J=new on;class an{constructor(){te(this,"apps",[]);te(this,"activeAppId",null);te(this,"listeners",new Set);te(this,"refReadyResolvers",new Map)}async launchApp(t,r){const{launchInBackground:s=!1}=r||{};if(!le.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),J._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),s||(this.activeAppId=t,J._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,J._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(),J._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?le.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 U=new an,Me=l.createContext(null);function et(){const e=l.useContext(Me);if(!e)throw new Error("useApp must be used inside an App");return e}function cn({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 tt({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(cn,{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(Re,{onClick:t,"aria-label":"Close application"})]})]})}class ln 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",{className:"nc-app-error",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 Ie({appId:e,isActive:t,onClose:r}){const{t:s}=ee.useTranslation(),o=le.get(e),[i,c]=l.useState(""),[a,d]=l.useState(null),[u,m]=l.useState(null),[w,p]=l.useState(!1),[x,N]=l.useState(!1);l.useEffect(()=>{o!=null&&o.titleKey&&c(s(o.titleKey))},[o,s]);const v=l.useCallback(S=>{c(S)},[]),y=l.useCallback(S=>{d(()=>S)},[]),j=l.useCallback(()=>{d(null)},[]),g=l.useCallback(S=>{m(S)},[]),h=l.useCallback(()=>{m(null)},[]),f=l.useCallback(S=>{p(S)},[]),b=l.useCallback(S=>{N(S)},[]),A=l.useMemo(()=>({setTitle:v,setBackHandler:y,clearBackHandler:j,setToolbar:g,clearToolbar:h,setHideBackButton:f,setHideTitleBar:b,close:r}),[v,y,j,g,h,f,b,r]);if(!o)return null;const E=o.component,C=!o.hideTitleBar&&!x;return n.jsxs("div",{className:`nc-app-container${t?"":" nc-hidden"}`,children:[C&&n.jsx(tt,{title:i,onClose:r,onBack:a??void 0,toolbar:u,hideBackButton:w}),n.jsx("div",{className:"nc-app-content-wrapper",style:{padding:o.padding,overflowY:C?"auto":void 0},children:n.jsx(Me.Provider,{value:A,children:n.jsx(ln,{appId:e,children:n.jsx(l.Suspense,{fallback:n.jsx("div",{className:"nc-app-loading",children:n.jsx(Ce,{})}),children:n.jsx(E,{})})})})})]})}const ye=768,je=1024,nt={isMobile:!1,isTablet:!1,isDesktop:!0,width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},rt=l.createContext(nt);function dn({children:e}){const[t,r]=l.useState(()=>{if(typeof window>"u")return nt;const s=window.innerWidth,o=window.innerHeight;return{isMobile:s<ye,isTablet:s>=ye&&s<je,isDesktop:s>=je,width:s,height:o}});return l.useEffect(()=>{const s=()=>{const o=window.innerWidth,i=window.innerHeight;r({isMobile:o<ye,isTablet:o>=ye&&o<je,isDesktop:o>=je,width:o,height:i})};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),n.jsx(rt.Provider,{value:t,children:e})}function Ee(){return l.useContext(rt)}const $e="-",un=e=>{const t=fn(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const a=c.split($e);return a[0]===""&&a.length!==1&&a.shift(),st(a,t)||pn(c)},getConflictingClassGroupIds:(c,a)=>{const d=r[c]||[];return a&&s[c]?[...d,...s[c]]:d}}},st=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const r=e[0],s=t.nextPart.get(r),o=s?st(e.slice(1),s):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join($e);return(c=t.validators.find(({validator:a})=>a(i)))==null?void 0:c.classGroupId},Ke=/^\[(.+)\]$/,pn=e=>{if(Ke.test(e)){const t=Ke.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},fn=e=>{const{theme:t,prefix:r}=e,s={nextPart:new Map,validators:[]};return mn(Object.entries(e.classGroups),r).forEach(([i,c])=>{Ae(c,s,i,t)}),s},Ae=(e,t,r,s)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:_e(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(hn(o)){Ae(o(s),t,r,s);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,c])=>{Ae(c,_e(t,i),r,s)})})},_e=(e,t)=>{let r=e;return t.split($e).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},hn=e=>e.isThemeGetter,mn=(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,gn=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)}}},ot="!",bn=e=>{const{separator:t,experimentalParseClassName:r}=e,s=t.length===1,o=t[0],i=t.length,c=a=>{const d=[];let u=0,m=0,w;for(let y=0;y<a.length;y++){let j=a[y];if(u===0){if(j===o&&(s||a.slice(y,y+i)===t)){d.push(a.slice(m,y)),m=y+i;continue}if(j==="/"){w=y;continue}}j==="["?u++:j==="]"&&u--}const p=d.length===0?a:a.substring(m),x=p.startsWith(ot),N=x?p.substring(1):p,v=w&&w>m?w-m:void 0;return{modifiers:d,hasImportantModifier:x,baseClassName:N,maybePostfixModifierPosition:v}};return r?a=>r({className:a,parseClassName:c}):c},xn=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},vn=e=>({cache:gn(e.cacheSize),parseClassName:bn(e),...un(e)}),wn=/\s+/,yn=(e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o}=t,i=[],c=e.trim().split(wn);let a="";for(let d=c.length-1;d>=0;d-=1){const u=c[d],{modifiers:m,hasImportantModifier:w,baseClassName:p,maybePostfixModifierPosition:x}=r(u);let N=!!x,v=s(N?p.substring(0,x):p);if(!v){if(!N){a=u+(a.length>0?" "+a:a);continue}if(v=s(p),!v){a=u+(a.length>0?" "+a:a);continue}N=!1}const y=xn(m).join(":"),j=w?y+ot:y,g=j+v;if(i.includes(g))continue;i.push(g);const h=o(v,N);for(let f=0;f<h.length;++f){const b=h[f];i.push(j+b)}a=u+(a.length>0?" "+a:a)}return a};function jn(){let e=0,t,r,s="";for(;e<arguments.length;)(t=arguments[e++])&&(r=it(t))&&(s&&(s+=" "),s+=r);return s}const it=e=>{if(typeof e=="string")return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=it(e[s]))&&(r&&(r+=" "),r+=t);return r};function kn(e,...t){let r,s,o,i=c;function c(d){const u=t.reduce((m,w)=>w(m),e());return r=vn(u),s=r.cache.get,o=r.cache.set,i=a,a(d)}function a(d){const u=s(d);if(u)return u;const m=yn(d,r);return o(d,m),m}return function(){return i(jn.apply(null,arguments))}}const W=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},at=/^\[(?:([a-z-]+):)?(.+)\]$/i,Nn=/^\d+\/\d+$/,Sn=new Set(["px","full","screen"]),An=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cn=/\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$/,Rn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Mn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,In=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Z=e=>ue(e)||Sn.has(e)||Nn.test(e),ne=e=>pe(e,"length",Dn),ue=e=>!!e&&!Number.isNaN(Number(e)),ke=e=>pe(e,"number",ue),ge=e=>!!e&&Number.isInteger(Number(e)),En=e=>e.endsWith("%")&&ue(e.slice(0,-1)),M=e=>at.test(e),re=e=>An.test(e),$n=new Set(["length","size","percentage"]),Tn=e=>pe(e,$n,ct),Pn=e=>pe(e,"position",ct),Ln=new Set(["image","url"]),Bn=e=>pe(e,Ln,Hn),zn=e=>pe(e,"",Wn),be=()=>!0,pe=(e,t,r)=>{const s=at.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):r(s[2]):!1},Dn=e=>Cn.test(e)&&!Rn.test(e),ct=()=>!1,Wn=e=>Mn.test(e),Hn=e=>In.test(e),Vn=()=>{const e=W("colors"),t=W("spacing"),r=W("blur"),s=W("brightness"),o=W("borderColor"),i=W("borderRadius"),c=W("borderSpacing"),a=W("borderWidth"),d=W("contrast"),u=W("grayscale"),m=W("hueRotate"),w=W("invert"),p=W("gap"),x=W("gradientColorStops"),N=W("gradientColorStopPositions"),v=W("inset"),y=W("margin"),j=W("opacity"),g=W("padding"),h=W("saturate"),f=W("scale"),b=W("sepia"),A=W("skew"),E=W("space"),C=W("translate"),S=()=>["auto","contain","none"],$=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto",M,t],R=()=>[M,t],T=()=>["",Z,ne],z=()=>["auto",ue,M],se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",M],H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[ue,M];return{cacheSize:500,separator:":",theme:{colors:[be],spacing:[Z,ne],blur:["none","",re,M],brightness:P(),borderColor:[e],borderRadius:["none","","full",re,M],borderSpacing:R(),borderWidth:T(),contrast:P(),grayscale:G(),hueRotate:P(),invert:G(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[En,ne],inset:k(),margin:k(),opacity:P(),padding:R(),saturate:P(),scale:P(),sepia:G(),skew:P(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",M]}],container:["container"],columns:[{columns:[re]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"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:[...se(),M]}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:S()}],"overscroll-x":[{"overscroll-x":S()}],"overscroll-y":[{"overscroll-y":S()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ge,M]}],basis:[{basis:k()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",M]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",ge,M]}],"grid-cols":[{"grid-cols":[be]}],"col-start-end":[{col:["auto",{span:["full",ge,M]},M]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[be]}],"row-start-end":[{row:["auto",{span:[ge,M]},M]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",M]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",M]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",M,t]}],"min-w":[{"min-w":[M,t,"min","max","fit"]}],"max-w":[{"max-w":[M,t,"none","full","min","max","fit","prose",{screen:[re]},re]}],h:[{h:[M,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[M,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[M,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[M,t,"auto","min","max","fit"]}],"font-size":[{text:["base",re,ne]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ke]}],"font-family":[{font:[be]}],"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",M]}],"line-clamp":[{"line-clamp":["none",ue,ke]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Z,M]}],"list-image":[{"list-image":["none",M]}],"list-style-type":[{list:["none","disc","decimal",M]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[j]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[j]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Z,ne]}],"underline-offset":[{"underline-offset":["auto",Z,M]}],"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:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",M]}],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",M]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[j]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...se(),Pn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Tn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Bn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[N]}],"gradient-via-pos":[{via:[N]}],"gradient-to-pos":[{to:[N]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],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":[j]}],"border-style":[{border:[...K(),"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":[j]}],"divide-style":[{divide:K()}],"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:["",...K()]}],"outline-offset":[{"outline-offset":[Z,M]}],"outline-w":[{outline:[Z,ne]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[j]}],"ring-offset-w":[{"ring-offset":[Z,ne]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",re,zn]}],"shadow-color":[{shadow:[be]}],opacity:[{opacity:[j]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",re,M]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[m]}],invert:[{invert:[w]}],saturate:[{saturate:[h]}],sepia:[{sepia:[b]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[m]}],"backdrop-invert":[{"backdrop-invert":[w]}],"backdrop-opacity":[{"backdrop-opacity":[j]}],"backdrop-saturate":[{"backdrop-saturate":[h]}],"backdrop-sepia":[{"backdrop-sepia":[b]}],"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",M]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",M]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",M]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[f]}],"scale-x":[{"scale-x":[f]}],"scale-y":[{"scale-y":[f]}],rotate:[{rotate:[ge,M]}],"translate-x":[{"translate-x":[C]}],"translate-y":[{"translate-y":[C]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",M]}],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",M]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"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",M]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Z,ne,ke]}],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"]}}},Fn=kn(Vn);function lt(...e){return Fn(mt.clsx(e))}function On({autoWidth:e=!0,className:t,style:r}){const[s,o]=l.useState(()=>J.getActiveAppId()),[i,c]=l.useState(()=>U.getRunningApps()),{isMobile:a}=Ee();l.useEffect(()=>{const y=J.subscribe("activeAppId",j=>{o(j)});return()=>{y()}},[]),l.useEffect(()=>U.subscribe(()=>{c(U.getRunningApps())}),[]),l.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const g=J.getActiveAppId();g&&!U.isRunning(g)&&U.launchApp(g)}},[]);const d=y=>{U.closeApp(y)},u=s?le.get(s):null,w=(u==null?void 0:u.width)??400,p=s!==null,v={...{overflow:"hidden",display:p?"flex":"none",flexDirection:"column",flexShrink:0,...e&&p?{width:a?"100%":w}:{}},...r};return n.jsx("div",{className:lt("nc-app-panel",t),style:v,children:i.map(y=>n.jsx(Ie,{appId:y.appId,isActive:s===y.appId,onClose:()=>d(y.appId)},y.appId))})}function Gn({pinnedAppIds:e,className:t="",showIndicators:r=!0,side:s="left",getBadge:o}){const{t:i}=ee.useTranslation(),{isMobile:c}=Ee(),[a,d]=l.useState(()=>J.getActiveAppId()),[u,m]=l.useState(()=>U.getRunningApps());l.useEffect(()=>{const h=J.subscribe("activeAppId",f=>{d(f)});return()=>{h()}},[]),l.useEffect(()=>U.subscribe(()=>{m(U.getRunningApps())}),[]);const w=h=>{a===h?U.setActiveApp(null):U.launchApp(h)},p=e.map(h=>le.get(h)).filter(h=>!!h),x=u.filter(h=>!e.includes(h.appId)).map(h=>({running:h,def:le.get(h.appId)})).filter(h=>!!h.def),N=h=>u.some(f=>f.appId===h),v=h=>h.titleKey?String(i(h.titleKey)):h.id,y=h=>typeof h=="number"&&h>99?"99+":h,j=(h,f)=>{const b=o==null?void 0:o(h,f);return b?n.jsx("span",{className:`nc-app-taskbar-badge nc-${b.tone??"default"}`,"aria-label":b.ariaLabel,children:y(b.content)}):null},g=c?24:28;return n.jsxs("div",{className:`nc-app-taskbar ${c?"nc-mobile":"nc-desktop"} nc-${s} ${t}`,children:[p.map(h=>{const f=h.icon,b=a===h.id,A=N(h.id),E={isActive:b,isRunning:A,isPinned:!0};return n.jsxs("button",{className:`nc-app-taskbar-button ${b?"nc-active":""} ${A?"nc-running":""}`,onClick:()=>w(h.id),title:v(h),children:[n.jsx(f,{size:g}),j(h,E),r&&A&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},h.id)}),x.length>0&&n.jsx("div",{className:"nc-app-taskbar-separator"}),x.map(({running:h,def:f})=>{const b=f.icon,A=a===h.appId,E={isActive:A,isRunning:!0,isPinned:!1};return n.jsxs("button",{className:`nc-app-taskbar-button ${A?"nc-active":""} nc-running`,onClick:()=>w(h.appId),title:v(f),children:[n.jsx(b,{size:g}),j(f,E),r&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},h.appId)})]})}function Yn({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(Ie,{appId:e,isActive:!0,onClose:r})})});return ve.createPortal(a,document.body)}const Te=l.createContext(null),dt=l.createContext(null);function Kn(){const e=l.useContext(Te);if(!e)throw new Error("useNavStack must be used within a NavStackProvider");return e}function _n(){const e=l.useContext(dt);if(!e)throw new Error("useNavView must be used within NavStack");return e}const Pe=l.createContext(null);function Un({rootView:e,children:t}){const{t:r}=ee.useTranslation(),s=et(),[o,i]=l.useState([e]),[c,a]=l.useState([null]),d=l.useCallback((f,b)=>{a(A=>{const E=[...A];return E[f]=b,E})},[]),u=l.useCallback(f=>{a(b=>{const A=[...b];return A[f]=null,A})},[]),m=l.useCallback(f=>{i(b=>[...b,f]),a(b=>[...b,null])},[]),w=l.useCallback(()=>{i(f=>f.length<=1?f:f.slice(0,-1)),a(f=>f.slice(0,-1))},[]),p=l.useCallback(()=>{i([e]),a([null])},[e]),x=o.length,N=x>1,v=o.length-1,y=o[o.length-1],j=y!=null&&y.titleKey?r(y.titleKey):(y==null?void 0:y.title)??"";l.useEffect(()=>{s.setTitle(j)},[j,s]),l.useEffect(()=>{N?s.setBackHandler(w):s.clearBackHandler()},[N,w,s]),l.useEffect(()=>{const f=c[c.length-1];f?s.setToolbar(f):s.clearToolbar()},[c,s]);const g={push:m,pop:w,reset:p,depth:x,canGoBack:N,currentTitle:j},h={stack:o,toolbarStack:c,updateToolbar:d,clearToolbarAt:u,topIndex:v};return n.jsx(Te.Provider,{value:g,children:n.jsx(Pe.Provider,{value:h,children:t})})}function qn({index:e,children:t}){const r=l.useContext(Pe);if(!r)throw new Error("NavViewProvider must be used within NavStackProvider");const{updateToolbar:s,clearToolbarAt:o,topIndex:i}=r,c=l.useCallback(u=>{e===i&&s(e,u)},[e,i,s]),a=l.useCallback(()=>{e===i&&o(e)},[e,i,o]),d={setToolbar:c,clearToolbar:a};return n.jsx(dt.Provider,{value:d,children:t})}function Xn(){const e=l.useContext(Te),t=l.useContext(Pe);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(qn,{index:o,children:n.jsx("div",{style:{display:i?"flex":"none",flexDirection:"column",height:"100%"},children:s.component})},s.id)})})})}exports.ActivityIndicator=Ce;exports.Alert=bt;exports.AppContainer=Ie;exports.AppContext=Me;exports.AppDialog=Yn;exports.AppPanel=On;exports.AppTaskbar=Gn;exports.AppTitleBar=tt;exports.Battery=xt;exports.Button=X;exports.ButtonGroup=vt;exports.Checkbox=yt;exports.CloseButton=Re;exports.ComboBox=At;exports.ContextMenu=Et;exports.CsvTextArea=Jt;exports.Dialog=$t;exports.DialogClose=ae;exports.EditButton=Rt;exports.Hyperlink=It;exports.Input=Lt;exports.ListGroup=zt;exports.ListGroupItem=Bt;exports.MonthRangePicker=Wt;exports.MultiSelect=Dt;exports.NavStackContainer=Xn;exports.NavStackProvider=Un;exports.Notification=Qe;exports.NotificationContainer=tn;exports.NumberInput=Ft;exports.RefreshButton=Ct;exports.Slider=Ot;exports.TabPanel=Xe;exports.TabPanels=Yt;exports.Tabs=Kt;exports.Toggle=_t;exports.TrashButton=Mt;exports.ViewportProvider=dn;exports.appRegistry=le;exports.appStateStore=J;exports.cn=lt;exports.createAppI18nFactory=rn;exports.notificationManager=nn;exports.runningAppsStore=U;exports.showNotification=Ze;exports.useApp=et;exports.useDialog=qe;exports.useNavStack=Kn;exports.useNavView=_n;exports.useViewport=Ee;
3
+ `),i=Math.max(1,Math.min(t,o.length));let c=0;for(let b=0;b<i-1;b++)c+=o[b].length+1;const d=o[i-1].split(" "),p=Math.max(1,Math.min(r,d.length));for(let b=0;b<p-1;b++)c+=d[b].length+1;const h=Math.max(1,Math.min(s,d[p-1].length+1));return c+=h-1,c}function Xt(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 Jt=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),b=l.useRef(null),u=l.useRef(null);l.useImperativeHandle(p,()=>({goToLine(m){const f=h.current;if(!f)return;const g=Xt(t,m);f.focus(),f.setSelectionRange(g,g);const j=parseFloat(getComputedStyle(f).lineHeight)||18;f.scrollTop=(Math.max(1,m)-1)*j,S(),x()},goToPosition(m,f,g){const j=h.current;if(!j)return;const y=qt(t,m,f,g);j.focus(),j.setSelectionRange(y,y);const C=parseFloat(getComputedStyle(j).lineHeight)||18;j.scrollTop=(Math.max(1,m)-1)*C,S(),x()}}),[t]);const x=l.useCallback(()=>{if(!a||!h.current)return;const m=Ut(t,h.current.selectionStart);a(m)},[a,t]),S=l.useCallback(()=>{const m=h.current;m&&(b.current&&(b.current.scrollTop=m.scrollTop,b.current.scrollLeft=m.scrollLeft),u.current&&(u.current.scrollTop=m.scrollTop))},[]);l.useEffect(()=>{if(d==null||d<1)return;const m=h.current;if(!m)return;const f=parseFloat(getComputedStyle(m).lineHeight)||18,g=(d-1)*f,j=g+f;(g<m.scrollTop||j>m.scrollTop+m.clientHeight)&&(m.scrollTop=g-m.clientHeight/2+f/2),S()},[d]);const v=l.useMemo(()=>t.split(`
5
+ `).length,[t]),w=()=>{const m=[];for(let f=1;f<=v;f++)m.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:m})},k=m=>m?m.split(`
6
+ `).map((g,j)=>{const y=g.split(" ");return n.jsxs("div",{className:`nc-csv-line ${d===j+1?"nc-csv-highlight":""}`,children:[y.map((C,$)=>n.jsxs("span",{children:[$>0&&n.jsx("span",{className:"nc-csv-tab-char",children:" "}),n.jsx("span",{style:{color:Oe[$%Oe.length]},children:C})]},$)),g===""&&`
7
+ `]},j)}):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:b,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:m=>{r(m.target.value),requestAnimationFrame(x)},onScroll:S,onSelect:x,onKeyUp:x,onClick:x,placeholder:s,spellCheck:!1,autoComplete:"off",autoCorrect:"off"})]})]})});let ce={notifications:[]};const Ne=new Set,Ge=new Map;function Se(){const e=ce.notifications.slice();for(const t of Array.from(Ne))try{t(e)}catch{}}function Qt(e){Ne.add(e);try{e(ce.notifications.slice())}catch{}return()=>{Ne.delete(e)}}function Zt(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 ce.notifications=[i,...ce.notifications],Se(),i.duration&&i.duration>0&&setTimeout(()=>{Je(t)},i.duration),t}function Je(e){const t=ce.notifications.find(s=>s.id===e);if(!t)return;t.isRemoving=!0,Se();const r=window.setTimeout(()=>{ce.notifications=ce.notifications.filter(s=>s.id!==e),Se(),Ge.delete(e)},300);Ge.set(e,r)}function en({type:e}){switch(e){case"success":return n.jsx("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:n.jsx("path",{d:"M5 10.5l3.1 3.1L15 6.8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})});case"danger":return n.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("circle",{cx:"10",cy:"10",r:"7",stroke:"currentColor",strokeWidth:"2"}),n.jsx("path",{d:"M10 6.5v4.25",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"10",cy:"13.75",r:"1",fill:"currentColor"})]});case"warning":return n.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("path",{d:"M10 3.5 16 15H4L10 3.5Z",stroke:"currentColor",strokeWidth:"2",strokeLinejoin:"round"}),n.jsx("path",{d:"M10 7.5v3.5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"10",cy:"13.25",r:"1",fill:"currentColor"})]});default:return n.jsxs("svg",{viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",children:[n.jsx("circle",{cx:"10",cy:"10",r:"7",stroke:"currentColor",strokeWidth:"2"}),n.jsx("path",{d:"M10 9v4",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),n.jsx("circle",{cx:"10",cy:"6.5",r:"1",fill:"currentColor"})]})}}function Qe({notification:e}){const{t}=ee.useTranslation(),r=e.type||"info",s=()=>{if(e.title)return e.title;switch(r){case"success":return t("common.success");case"danger":return t("common.error");case"warning":return t("common.warning");default:return t("common.info")}},o=()=>{Je(e.id)};return n.jsx("div",{className:`nc-notification nc-notification-${r}`,children:n.jsxs("div",{className:"nc-notification-content",children:[n.jsx("div",{className:`nc-notification-icon nc-notification-icon-${r}`,children:n.jsx(en,{type:r})}),n.jsxs("div",{className:"nc-notification-body",children:[n.jsx("div",{className:"nc-notification-title",children:s()}),n.jsx("div",{className:"nc-notification-message",children:e.message})]}),e.dismissible&&n.jsx("button",{className:"nc-notification-dismiss",onClick:o,"aria-label":t("common.close"),children:n.jsx(q.CloseIcon,{size:16})})]})})}function tn(){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(()=>Qt(p=>{const h=new Set(a.current.map(u=>u.id)),b=p.filter(u=>!h.has(u.id)).map(u=>u.id);b.length>0?(t(p),i(new Set(b)),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((b,u)=>{if(d.set(b.id,p),h[u]){const x=h[u].offsetHeight;b.isRemoving||(p+=x+12)}}),s(d)},[e]),n.jsx("div",{style:{position:"fixed",top:"24px",left:"24px",zIndex:9999,pointerEvents:"none",width:"min(340px, calc(100vw - 32px))"},children:n.jsx("div",{ref:c,style:{pointerEvents:"auto",position:"relative",width:"100%"},children:e.map(d=>{const p=o.has(d.id),h=d.isRemoving,b=r.get(d.id)||0;return n.jsx("div",{style:{position:"absolute",top:0,left:0,transform:p?`translate3d(-40px, ${b}px, 0)`:`translate3d(0, ${b}px, 0)`,transition:h?"opacity 300ms ease-out":"transform 300ms ease-out, opacity 300ms ease-out",opacity:h?0:1,width:"100%"},children:n.jsx(Qe,{notification:d})},d.id)})})})}function Ze(e){return Zt(e)}const nn={show:e=>Ze(e)};function rn(e){const t=ht.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 sn{constructor(){te(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 le=new sn,Ye="nc-ui-app-state";class on{constructor(){te(this,"state");te(this,"listeners",new Map);this.state=this.loadState()}loadState(){try{const t=localStorage.getItem(Ye);if(t)return JSON.parse(t)}catch{}return{activeAppId:null}}saveState(){try{localStorage.setItem(Ye,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 J=new on;class an{constructor(){te(this,"apps",[]);te(this,"activeAppId",null);te(this,"listeners",new Set);te(this,"refReadyResolvers",new Map)}async launchApp(t,r){const{launchInBackground:s=!1}=r||{};if(!le.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),J._setActiveAppId(t)),o.ref?o:this.waitForRef(t);const i={appId:t,launchedAt:Date.now()};return this.apps.push(i),s||(this.activeAppId=t,J._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,J._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(),J._setActiveAppId(t))}toggleApp(t){this.activeAppId===t?this.setActiveApp(null):this.launchApp(t)}getActiveAppId(){return this.activeAppId}getActiveApp(){return this.activeAppId?le.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 U=new an,Me=l.createContext(null);function et(){const e=l.useContext(Me);if(!e)throw new Error("useApp must be used inside an App");return e}function cn({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 tt({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(cn,{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(Re,{onClick:t,"aria-label":"Close application"})]})]})}class ln 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",{className:"nc-app-error",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 Ie({appId:e,isActive:t,onClose:r}){const{t:s}=ee.useTranslation(),o=le.get(e),[i,c]=l.useState(""),[a,d]=l.useState(null),[p,h]=l.useState(null),[b,u]=l.useState(!1),[x,S]=l.useState(!1);l.useEffect(()=>{o!=null&&o.titleKey&&c(s(o.titleKey))},[o,s]);const v=l.useCallback(A=>{c(A)},[]),w=l.useCallback(A=>{d(()=>A)},[]),k=l.useCallback(()=>{d(null)},[]),m=l.useCallback(A=>{h(A)},[]),f=l.useCallback(()=>{h(null)},[]),g=l.useCallback(A=>{u(A)},[]),j=l.useCallback(A=>{S(A)},[]),y=l.useMemo(()=>({setTitle:v,setBackHandler:w,clearBackHandler:k,setToolbar:m,clearToolbar:f,setHideBackButton:g,setHideTitleBar:j,close:r}),[v,w,k,m,f,g,j,r]);if(!o)return null;const C=o.component,$=!o.hideTitleBar&&!x;return n.jsxs("div",{className:`nc-app-container${t?"":" nc-hidden"}`,children:[$&&n.jsx(tt,{title:i,onClose:r,onBack:a??void 0,toolbar:p,hideBackButton:b}),n.jsx("div",{className:"nc-app-content-wrapper",style:{padding:o.padding,overflowY:$?"auto":void 0},children:n.jsx(Me.Provider,{value:y,children:n.jsx(ln,{appId:e,children:n.jsx(l.Suspense,{fallback:n.jsx("div",{className:"nc-app-loading",children:n.jsx(Ce,{})}),children:n.jsx(C,{})})})})})]})}const ye=768,je=1024,nt={isMobile:!1,isTablet:!1,isDesktop:!0,width:typeof window<"u"?window.innerWidth:1024,height:typeof window<"u"?window.innerHeight:768},rt=l.createContext(nt);function dn({children:e}){const[t,r]=l.useState(()=>{if(typeof window>"u")return nt;const s=window.innerWidth,o=window.innerHeight;return{isMobile:s<ye,isTablet:s>=ye&&s<je,isDesktop:s>=je,width:s,height:o}});return l.useEffect(()=>{const s=()=>{const o=window.innerWidth,i=window.innerHeight;r({isMobile:o<ye,isTablet:o>=ye&&o<je,isDesktop:o>=je,width:o,height:i})};return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[]),n.jsx(rt.Provider,{value:t,children:e})}function Ee(){return l.useContext(rt)}const $e="-",un=e=>{const t=fn(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{const a=c.split($e);return a[0]===""&&a.length!==1&&a.shift(),st(a,t)||pn(c)},getConflictingClassGroupIds:(c,a)=>{const d=r[c]||[];return a&&s[c]?[...d,...s[c]]:d}}},st=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const r=e[0],s=t.nextPart.get(r),o=s?st(e.slice(1),s):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join($e);return(c=t.validators.find(({validator:a})=>a(i)))==null?void 0:c.classGroupId},Ke=/^\[(.+)\]$/,pn=e=>{if(Ke.test(e)){const t=Ke.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},fn=e=>{const{theme:t,prefix:r}=e,s={nextPart:new Map,validators:[]};return mn(Object.entries(e.classGroups),r).forEach(([i,c])=>{Ae(c,s,i,t)}),s},Ae=(e,t,r,s)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:_e(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(hn(o)){Ae(o(s),t,r,s);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,c])=>{Ae(c,_e(t,i),r,s)})})},_e=(e,t)=>{let r=e;return t.split($e).forEach(s=>{r.nextPart.has(s)||r.nextPart.set(s,{nextPart:new Map,validators:[]}),r=r.nextPart.get(s)}),r},hn=e=>e.isThemeGetter,mn=(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,gn=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)}}},ot="!",bn=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,b;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==="/"){b=w;continue}}k==="["?p++:k==="]"&&p--}const u=d.length===0?a:a.substring(h),x=u.startsWith(ot),S=x?u.substring(1):u,v=b&&b>h?b-h:void 0;return{modifiers:d,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:v}};return r?a=>r({className:a,parseClassName:c}):c},xn=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},vn=e=>({cache:gn(e.cacheSize),parseClassName:bn(e),...un(e)}),wn=/\s+/,yn=(e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o}=t,i=[],c=e.trim().split(wn);let a="";for(let d=c.length-1;d>=0;d-=1){const p=c[d],{modifiers:h,hasImportantModifier:b,baseClassName:u,maybePostfixModifierPosition:x}=r(p);let S=!!x,v=s(S?u.substring(0,x):u);if(!v){if(!S){a=p+(a.length>0?" "+a:a);continue}if(v=s(u),!v){a=p+(a.length>0?" "+a:a);continue}S=!1}const w=xn(h).join(":"),k=b?w+ot:w,m=k+v;if(i.includes(m))continue;i.push(m);const f=o(v,S);for(let g=0;g<f.length;++g){const j=f[g];i.push(k+j)}a=p+(a.length>0?" "+a:a)}return a};function jn(){let e=0,t,r,s="";for(;e<arguments.length;)(t=arguments[e++])&&(r=it(t))&&(s&&(s+=" "),s+=r);return s}const it=e=>{if(typeof e=="string")return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=it(e[s]))&&(r&&(r+=" "),r+=t);return r};function kn(e,...t){let r,s,o,i=c;function c(d){const p=t.reduce((h,b)=>b(h),e());return r=vn(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=yn(d,r);return o(d,h),h}return function(){return i(jn.apply(null,arguments))}}const W=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},at=/^\[(?:([a-z-]+):)?(.+)\]$/i,Nn=/^\d+\/\d+$/,Sn=new Set(["px","full","screen"]),An=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Cn=/\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$/,Rn=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Mn=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,In=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Z=e=>ue(e)||Sn.has(e)||Nn.test(e),ne=e=>pe(e,"length",Dn),ue=e=>!!e&&!Number.isNaN(Number(e)),ke=e=>pe(e,"number",ue),ge=e=>!!e&&Number.isInteger(Number(e)),En=e=>e.endsWith("%")&&ue(e.slice(0,-1)),I=e=>at.test(e),re=e=>An.test(e),$n=new Set(["length","size","percentage"]),Tn=e=>pe(e,$n,ct),Pn=e=>pe(e,"position",ct),Ln=new Set(["image","url"]),Bn=e=>pe(e,Ln,Hn),zn=e=>pe(e,"",Wn),be=()=>!0,pe=(e,t,r)=>{const s=at.exec(e);return s?s[1]?typeof t=="string"?s[1]===t:t.has(s[1]):r(s[2]):!1},Dn=e=>Cn.test(e)&&!Rn.test(e),ct=()=>!1,Wn=e=>Mn.test(e),Hn=e=>In.test(e),Vn=()=>{const e=W("colors"),t=W("spacing"),r=W("blur"),s=W("brightness"),o=W("borderColor"),i=W("borderRadius"),c=W("borderSpacing"),a=W("borderWidth"),d=W("contrast"),p=W("grayscale"),h=W("hueRotate"),b=W("invert"),u=W("gap"),x=W("gradientColorStops"),S=W("gradientColorStopPositions"),v=W("inset"),w=W("margin"),k=W("opacity"),m=W("padding"),f=W("saturate"),g=W("scale"),j=W("sepia"),y=W("skew"),C=W("space"),$=W("translate"),A=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",I,t],M=()=>[I,t],T=()=>["",Z,ne],z=()=>["auto",ue,I],se=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",I],H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],P=()=>[ue,I];return{cacheSize:500,separator:":",theme:{colors:[be],spacing:[Z,ne],blur:["none","",re,I],brightness:P(),borderColor:[e],borderRadius:["none","","full",re,I],borderSpacing:M(),borderWidth:T(),contrast:P(),grayscale:G(),hueRotate:P(),invert:G(),gap:M(),gradientColorStops:[e],gradientColorStopPositions:[En,ne],inset:N(),margin:N(),opacity:P(),padding:M(),saturate:P(),scale:P(),sepia:G(),skew:P(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",I]}],container:["container"],columns:[{columns:[re]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"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:[...se(),I]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ge,I]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",I]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",ge,I]}],"grid-cols":[{"grid-cols":[be]}],"col-start-end":[{col:["auto",{span:["full",ge,I]},I]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[be]}],"row-start-end":[{row:["auto",{span:[ge,I]},I]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",I]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",I]}],gap:[{gap:[u]}],"gap-x":[{"gap-x":[u]}],"gap-y":[{"gap-y":[u]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[m]}],px:[{px:[m]}],py:[{py:[m]}],ps:[{ps:[m]}],pe:[{pe:[m]}],pt:[{pt:[m]}],pr:[{pr:[m]}],pb:[{pb:[m]}],pl:[{pl:[m]}],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":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",I,t]}],"min-w":[{"min-w":[I,t,"min","max","fit"]}],"max-w":[{"max-w":[I,t,"none","full","min","max","fit","prose",{screen:[re]},re]}],h:[{h:[I,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[I,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[I,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[I,t,"auto","min","max","fit"]}],"font-size":[{text:["base",re,ne]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ke]}],"font-family":[{font:[be]}],"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",I]}],"line-clamp":[{"line-clamp":["none",ue,ke]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Z,I]}],"list-image":[{"list-image":["none",I]}],"list-style-type":[{list:["none","disc","decimal",I]}],"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:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Z,ne]}],"underline-offset":[{"underline-offset":["auto",Z,I]}],"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:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",I]}],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",I]}],"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:[...se(),Pn]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Tn]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Bn]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[S]}],"gradient-via-pos":[{via:[S]}],"gradient-to-pos":[{to:[S]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],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:[...K(),"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:K()}],"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:["",...K()]}],"outline-offset":[{"outline-offset":[Z,I]}],"outline-w":[{outline:[Z,ne]}],"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":[Z,ne]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",re,zn]}],"shadow-color":[{shadow:[be]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[s]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",re,I]}],grayscale:[{grayscale:[p]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[b]}],saturate:[{saturate:[f]}],sepia:[{sepia:[j]}],"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":[b]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[f]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"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",I]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",I]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",I]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[g]}],"scale-x":[{"scale-x":[g]}],"scale-y":[{"scale-y":[g]}],rotate:[{rotate:[ge,I]}],"translate-x":[{"translate-x":[$]}],"translate-y":[{"translate-y":[$]}],"skew-x":[{"skew-x":[y]}],"skew-y":[{"skew-y":[y]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",I]}],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",I]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"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",I]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Z,ne,ke]}],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"]}}},Fn=kn(Vn);function lt(...e){return Fn(mt.clsx(e))}function On({autoWidth:e=!0,className:t,style:r}){const[s,o]=l.useState(()=>J.getActiveAppId()),[i,c]=l.useState(()=>U.getRunningApps()),{isMobile:a}=Ee();l.useEffect(()=>{const w=J.subscribe("activeAppId",k=>{o(k)});return()=>{w()}},[]),l.useEffect(()=>U.subscribe(()=>{c(U.getRunningApps())}),[]),l.useEffect(()=>{if(!new URLSearchParams(window.location.search).has("app")){const m=J.getActiveAppId();m&&!U.isRunning(m)&&U.launchApp(m)}},[]);const d=w=>{U.closeApp(w)},p=s?le.get(s):null,b=(p==null?void 0:p.width)??400,u=s!==null,v={...{overflow:"hidden",display:u?"flex":"none",flexDirection:"column",flexShrink:0,...e&&u?{width:a?"100%":b}:{}},...r};return n.jsx("div",{className:lt("nc-app-panel",t),style:v,children:i.map(w=>n.jsx(Ie,{appId:w.appId,isActive:s===w.appId,onClose:()=>d(w.appId)},w.appId))})}function Gn({pinnedAppIds:e,className:t="",showIndicators:r=!0,side:s="left",getBadge:o}){const{t:i}=ee.useTranslation(),{isMobile:c}=Ee(),[a,d]=l.useState(()=>J.getActiveAppId()),[p,h]=l.useState(()=>U.getRunningApps());l.useEffect(()=>{const f=J.subscribe("activeAppId",g=>{d(g)});return()=>{f()}},[]),l.useEffect(()=>U.subscribe(()=>{h(U.getRunningApps())}),[]);const b=f=>{a===f?U.setActiveApp(null):U.launchApp(f)},u=e.map(f=>le.get(f)).filter(f=>!!f),x=p.filter(f=>!e.includes(f.appId)).map(f=>({running:f,def:le.get(f.appId)})).filter(f=>!!f.def),S=f=>p.some(g=>g.appId===f),v=f=>f.titleKey?String(i(f.titleKey)):f.id,w=f=>typeof f=="number"&&f>99?"99+":f,k=(f,g)=>{const j=o==null?void 0:o(f,g);return j?n.jsx("span",{className:`nc-app-taskbar-badge nc-${j.tone??"default"}`,"aria-label":j.ariaLabel,children:w(j.content)}):null},m=c?24:28;return n.jsxs("div",{className:`nc-app-taskbar ${c?"nc-mobile":"nc-desktop"} nc-${s} ${t}`,children:[u.map(f=>{const g=f.icon,j=a===f.id,y=S(f.id),C={isActive:j,isRunning:y,isPinned:!0};return n.jsxs("button",{className:`nc-app-taskbar-button ${j?"nc-active":""} ${y?"nc-running":""}`,onClick:()=>b(f.id),title:v(f),children:[n.jsx(g,{size:m}),k(f,C),r&&y&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},f.id)}),x.length>0&&n.jsx("div",{className:"nc-app-taskbar-separator"}),x.map(({running:f,def:g})=>{const j=g.icon,y=a===f.appId,C={isActive:y,isRunning:!0,isPinned:!1};return n.jsxs("button",{className:`nc-app-taskbar-button ${y?"nc-active":""} nc-running`,onClick:()=>b(f.appId),title:v(g),children:[n.jsx(j,{size:m}),k(g,C),r&&n.jsx("span",{className:"nc-app-taskbar-indicator"})]},f.appId)})]})}function Yn({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(Ie,{appId:e,isActive:!0,onClose:r})})});return ve.createPortal(a,document.body)}const Te=l.createContext(null),dt=l.createContext(null);function Kn(){const e=l.useContext(Te);if(!e)throw new Error("useNavStack must be used within a NavStackProvider");return e}function _n(){const e=l.useContext(dt);if(!e)throw new Error("useNavView must be used within NavStack");return e}const Pe=l.createContext(null);function Un({rootView:e,children:t}){const{t:r}=ee.useTranslation(),s=et(),[o,i]=l.useState([e]),[c,a]=l.useState([null]),d=l.useCallback((g,j)=>{a(y=>{const C=[...y];return C[g]=j,C})},[]),p=l.useCallback(g=>{a(j=>{const y=[...j];return y[g]=null,y})},[]),h=l.useCallback(g=>{i(j=>[...j,g]),a(j=>[...j,null])},[]),b=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]),x=o.length,S=x>1,v=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(()=>{S?s.setBackHandler(b):s.clearBackHandler()},[S,b,s]),l.useEffect(()=>{const g=c[c.length-1];g?s.setToolbar(g):s.clearToolbar()},[c,s]);const m={push:h,pop:b,reset:u,depth:x,canGoBack:S,currentTitle:k},f={stack:o,toolbarStack:c,updateToolbar:d,clearToolbarAt:p,topIndex:v};return n.jsx(Te.Provider,{value:m,children:n.jsx(Pe.Provider,{value:f,children:t})})}function qn({index:e,children:t}){const r=l.useContext(Pe);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(dt.Provider,{value:d,children:t})}function Xn(){const e=l.useContext(Te),t=l.useContext(Pe);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(qn,{index:o,children:n.jsx("div",{style:{display:i?"flex":"none",flexDirection:"column",height:"100%"},children:s.component})},s.id)})})})}exports.ActivityIndicator=Ce;exports.Alert=bt;exports.AppContainer=Ie;exports.AppContext=Me;exports.AppDialog=Yn;exports.AppPanel=On;exports.AppTaskbar=Gn;exports.AppTitleBar=tt;exports.Battery=xt;exports.Button=X;exports.ButtonGroup=vt;exports.Checkbox=yt;exports.CloseButton=Re;exports.ComboBox=At;exports.ContextMenu=Et;exports.CsvTextArea=Jt;exports.Dialog=$t;exports.DialogClose=ae;exports.EditButton=Rt;exports.Hyperlink=It;exports.Input=Lt;exports.ListGroup=zt;exports.ListGroupItem=Bt;exports.MonthRangePicker=Wt;exports.MultiSelect=Dt;exports.NavStackContainer=Xn;exports.NavStackProvider=Un;exports.Notification=Qe;exports.NotificationContainer=tn;exports.NumberInput=Ft;exports.RefreshButton=Ct;exports.Slider=Ot;exports.TabPanel=Xe;exports.TabPanels=Yt;exports.Tabs=Kt;exports.Toggle=_t;exports.TrashButton=Mt;exports.ViewportProvider=dn;exports.appRegistry=le;exports.appStateStore=J;exports.cn=lt;exports.createAppI18nFactory=rn;exports.notificationManager=nn;exports.runningAppsStore=U;exports.showNotification=Ze;exports.useApp=et;exports.useDialog=qe;exports.useNavStack=Kn;exports.useNavView=_n;exports.useViewport=Ee;
8
8
  //# sourceMappingURL=index.cjs.map