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