@mdspl/mds-shared-ui 0.4.7 → 0.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),l=require("@chakra-ui/react"),Ue=require("react-dom");function wt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var st={exports:{}},Be={};var vn;function Hr(){if(vn)return Be;vn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:a,ref:o!==void 0?o:null,props:s}}return Be.Fragment=t,Be.jsx=n,Be.jsxs=n,Be}var He={};var mn;function Vr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){function e(v){if(v==null)return null;if(typeof v=="function")return v.$$typeof===A?null:v.displayName||v.name||null;if(typeof v=="string")return v;switch(v){case x:return"Fragment";case _:return"Profiler";case D:return"StrictMode";case M:return"Suspense";case $:return"SuspenseList";case B:return"Activity"}if(typeof v=="object")switch(typeof v.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),v.$$typeof){case p:return"Portal";case O:return v.displayName||"Context";case j:return(v._context.displayName||"Context")+".Consumer";case k:var C=v.render;return v=v.displayName,v||(v=C.displayName||C.name||"",v=v!==""?"ForwardRef("+v+")":"ForwardRef"),v;case N:return C=v.displayName||null,C!==null?C:e(v.type)||"Memo";case W:C=v._payload,v=v._init;try{return e(v(C))}catch{}}return null}function t(v){return""+v}function n(v){try{t(v);var C=!1}catch{C=!0}if(C){C=console;var z=C.error,F=typeof Symbol=="function"&&Symbol.toStringTag&&v[Symbol.toStringTag]||v.constructor.name||"Object";return z.call(C,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",F),t(v)}}function r(v){if(v===x)return"<>";if(typeof v=="object"&&v!==null&&v.$$typeof===W)return"<...>";try{var C=e(v);return C?"<"+C+">":"<...>"}catch{return"<...>"}}function o(){var v=K.A;return v===null?null:v.getOwner()}function s(){return Error("react-stack-top-frame")}function a(v){if(ee.call(v,"key")){var C=Object.getOwnPropertyDescriptor(v,"key").get;if(C&&C.isReactWarning)return!1}return v.key!==void 0}function c(v,C){function z(){w||(w=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",C))}z.isReactWarning=!0,Object.defineProperty(v,"key",{get:z,configurable:!0})}function u(){var v=e(this.type);return E[v]||(E[v]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),v=this.props.ref,v!==void 0?v:null}function d(v,C,z,F,U,G){var H=z.ref;return v={$$typeof:b,type:v,key:C,props:z,_owner:F},(H!==void 0?H:null)!==null?Object.defineProperty(v,"ref",{enumerable:!1,get:u}):Object.defineProperty(v,"ref",{enumerable:!1,value:null}),v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(v,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(v,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.defineProperty(v,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v}function f(v,C,z,F,U,G){var H=C.children;if(H!==void 0)if(F)if(I(H)){for(F=0;F<H.length;F++)h(H[F]);Object.freeze&&Object.freeze(H)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(H);if(ee.call(C,"key")){H=e(v);var X=Object.keys(C).filter(function(Y){return Y!=="key"});F=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",P[H+F]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("react"),u=require("@chakra-ui/react"),Ue=require("react-dom");function Dt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var it={exports:{}},Be={};var vn;function Br(){if(vn)return Be;vn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var a=null;if(s!==void 0&&(a=""+s),o.key!==void 0&&(a=""+o.key),"key"in o){s={};for(var c in o)c!=="key"&&(s[c]=o[c])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:a,ref:o!==void 0?o:null,props:s}}return Be.Fragment=t,Be.jsx=n,Be.jsxs=n,Be}var He={};var mn;function Hr(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){function e(p){if(p==null)return null;if(typeof p=="function")return p.$$typeof===L?null:p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case x:return"Fragment";case _:return"Profiler";case S:return"StrictMode";case T:return"Suspense";case $:return"SuspenseList";case B:return"Activity"}if(typeof p=="object")switch(typeof p.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),p.$$typeof){case b:return"Portal";case O:return p.displayName||"Context";case j:return(p._context.displayName||"Context")+".Consumer";case k:var C=p.render;return p=p.displayName,p||(p=C.displayName||C.name||"",p=p!==""?"ForwardRef("+p+")":"ForwardRef"),p;case A:return C=p.displayName||null,C!==null?C:e(p.type)||"Memo";case H:C=p._payload,p=p._init;try{return e(p(C))}catch{}}return null}function t(p){return""+p}function n(p){try{t(p);var C=!1}catch{C=!0}if(C){C=console;var z=C.error,F=typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object";return z.call(C,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",F),t(p)}}function r(p){if(p===x)return"<>";if(typeof p=="object"&&p!==null&&p.$$typeof===H)return"<...>";try{var C=e(p);return C?"<"+C+">":"<...>"}catch{return"<...>"}}function o(){var p=K.A;return p===null?null:p.getOwner()}function s(){return Error("react-stack-top-frame")}function a(p){if(ee.call(p,"key")){var C=Object.getOwnPropertyDescriptor(p,"key").get;if(C&&C.isReactWarning)return!1}return p.key!==void 0}function c(p,C){function z(){D||(D=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",C))}z.isReactWarning=!0,Object.defineProperty(p,"key",{get:z,configurable:!0})}function l(){var p=e(this.type);return M[p]||(M[p]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),p=this.props.ref,p!==void 0?p:null}function d(p,C,z,F,U,G){var V=z.ref;return p={$$typeof:m,type:p,key:C,props:z,_owner:F},(V!==void 0?V:null)!==null?Object.defineProperty(p,"ref",{enumerable:!1,get:l}):Object.defineProperty(p,"ref",{enumerable:!1,value:null}),p._store={},Object.defineProperty(p._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(p,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(p,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.defineProperty(p,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.freeze&&(Object.freeze(p.props),Object.freeze(p)),p}function f(p,C,z,F,U,G){var V=C.children;if(V!==void 0)if(F)if(I(V)){for(F=0;F<V.length;F++)h(V[F]);Object.freeze&&Object.freeze(V)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(V);if(ee.call(C,"key")){V=e(p);var X=Object.keys(C).filter(function(Y){return Y!=="key"});F=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",P[V+F]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
2
2
  let props = %s;
3
3
  <%s {...props} />
4
4
  React keys must be passed directly to JSX without using spread:
5
5
  let props = %s;
6
- <%s key={someKey} {...props} />`,F,H,X,H),P[H+F]=!0)}if(H=null,z!==void 0&&(n(z),H=""+z),a(C)&&(n(C.key),H=""+C.key),"key"in C){z={};for(var q in C)q!=="key"&&(z[q]=C[q])}else z=C;return H&&c(z,typeof v=="function"?v.displayName||v.name||"Unknown":v),d(v,H,z,o(),U,G)}function h(v){y(v)?v._store&&(v._store.validated=1):typeof v=="object"&&v!==null&&v.$$typeof===W&&(v._payload.status==="fulfilled"?y(v._payload.value)&&v._payload.value._store&&(v._payload.value._store.validated=1):v._store&&(v._store.validated=1))}function y(v){return typeof v=="object"&&v!==null&&v.$$typeof===b}var m=g,b=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),O=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),K=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=Object.prototype.hasOwnProperty,I=Array.isArray,R=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(v){return v()}};var w,E={},T=m.react_stack_bottom_frame.bind(m,s)(),L=R(r(s)),P={};He.Fragment=x,He.jsx=function(v,C,z){var F=1e4>K.recentlyCreatedOwnerStacks++;return f(v,C,z,!1,F?Error("react-stack-top-frame"):T,F?R(r(v)):L)},He.jsxs=function(v,C,z){var F=1e4>K.recentlyCreatedOwnerStacks++;return f(v,C,z,!0,F?Error("react-stack-top-frame"):T,F?R(r(v)):L)}})()),He}var bn;function Wr(){return bn||(bn=1,process.env.NODE_ENV==="production"?st.exports=Hr():st.exports=Vr()),st.exports}var i=Wr(),it={exports:{}},kt={},at={exports:{}},$t={};var xn;function Ur(){if(xn)return $t;xn=1;var e=g;function t(h,y){return h===y&&(h!==0||1/h===1/y)||h!==h&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function c(h,y){var m=y(),b=r({inst:{value:m,getSnapshot:y}}),p=b[0].inst,x=b[1];return s(function(){p.value=m,p.getSnapshot=y,u(p)&&x({inst:p})},[h,m,y]),o(function(){return u(p)&&x({inst:p}),h(function(){u(p)&&x({inst:p})})},[h]),a(m),m}function u(h){var y=h.getSnapshot;h=h.value;try{var m=y();return!n(h,m)}catch{return!0}}function d(h,y){return y()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return $t.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,$t}var It={};var yn;function Gr(){return yn||(yn=1,process.env.NODE_ENV!=="production"&&(function(){function e(m,b){return m===b&&(m!==0||1/m===1/b)||m!==m&&b!==b}function t(m,b){f||o.startTransition===void 0||(f=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=b();if(!h){var x=b();s(p,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}x=a({inst:{value:p,getSnapshot:b}});var D=x[0].inst,_=x[1];return u(function(){D.value=p,D.getSnapshot=b,n(D)&&_({inst:D})},[m,p,b]),c(function(){return n(D)&&_({inst:D}),m(function(){n(D)&&_({inst:D})})},[m]),d(p),p}function n(m){var b=m.getSnapshot;m=m.value;try{var p=b();return!s(m,p)}catch{return!0}}function r(m,b){return b()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=g,s=typeof Object.is=="function"?Object.is:e,a=o.useState,c=o.useEffect,u=o.useLayoutEffect,d=o.useDebugValue,f=!1,h=!1,y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;It.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),It}var Sn;function Xn(){return Sn||(Sn=1,process.env.NODE_ENV==="production"?at.exports=Ur():at.exports=Gr()),at.exports}var wn;function Xr(){if(wn)return kt;wn=1;var e=g,t=Xn();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,c=e.useMemo,u=e.useDebugValue;return kt.useSyncExternalStoreWithSelector=function(d,f,h,y,m){var b=s(null);if(b.current===null){var p={hasValue:!1,value:null};b.current=p}else p=b.current;b=c(function(){function D(M){if(!_){if(_=!0,j=M,M=y(M),m!==void 0&&p.hasValue){var $=p.value;if(m($,M))return O=$}return O=M}if($=O,r(j,M))return $;var N=y(M);return m!==void 0&&m($,N)?(j=M,$):(j=M,O=N)}var _=!1,j,O,k=h===void 0?null:h;return[function(){return D(f())},k===null?void 0:function(){return D(k())}]},[f,h,y,m]);var x=o(d,b[0],b[1]);return a(function(){p.hasValue=!0,p.value=x},[x]),u(x),x},kt}var At={};var Dn;function qr(){return Dn||(Dn=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=g,n=Xn(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,a=t.useEffect,c=t.useMemo,u=t.useDebugValue;At.useSyncExternalStoreWithSelector=function(d,f,h,y,m){var b=s(null);if(b.current===null){var p={hasValue:!1,value:null};b.current=p}else p=b.current;b=c(function(){function D(M){if(!_){if(_=!0,j=M,M=y(M),m!==void 0&&p.hasValue){var $=p.value;if(m($,M))return O=$}return O=M}if($=O,r(j,M))return $;var N=y(M);return m!==void 0&&m($,N)?(j=M,$):(j=M,O=N)}var _=!1,j,O,k=h===void 0?null:h;return[function(){return D(f())},k===null?void 0:function(){return D(k())}]},[f,h,y,m]);var x=o(d,b[0],b[1]);return a(function(){p.hasValue=!0,p.value=x},[x]),u(x),x},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),At}var Cn;function Kr(){return Cn||(Cn=1,process.env.NODE_ENV==="production"?it.exports=Xr():it.exports=qr()),it.exports}var Jr=Kr();const Ht=new WeakMap,Zr=new WeakMap,mt={current:[]};let Lt=!1;const ct=new Set,Rn=new Map;function qn(e){for(const t of e){if(mt.current.includes(t))continue;mt.current.push(t),t.recompute();const n=Zr.get(t);if(n)for(const r of n){const o=Ht.get(r);o?.length&&qn(o)}}}function Qr(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function eo(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function to(e){if(ct.add(e),!Lt)try{for(Lt=!0;ct.size>0;){const t=Array.from(ct);ct.clear();for(const n of t){const r=Rn.get(n)??n.prevState;n.prevState=r,Qr(n)}for(const n of t){const r=Ht.get(n);r&&(mt.current.push(n),qn(r))}for(const n of t){const r=Ht.get(n);if(r)for(const o of r)eo(o)}}}finally{Lt=!1,mt.current=[],Rn.clear()}}function no(e){return typeof e=="function"}class Kn{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,s;this.listeners.add(r);const a=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.call(o,r,this);return()=>{this.listeners.delete(r),a?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):no(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),to(this)}}function Qe(e,t=r=>r,n={}){const r=n.equal??ro;return Jr.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function ro(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=Tn(e);if(n.length!==Tn(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function Tn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}const se=new Kn({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],data:[],sortableColumns:[],actionsConfig:{showActionColumn:!0,showColumnVisibilityMenu:!0,children:"Actions",width:"100px"}});function Jn(e,t){const n=e[0]??{},o=(t&&t.length?t:Object.keys(n).map(f=>({id:f,label:f}))).filter(f=>Object.prototype.hasOwnProperty.call(n,f.id)),{tableId:s,visibility:a}=se.state,c=JSON.parse(localStorage.getItem(er(s))||"[]"),u=[...c.map(f=>o.find(h=>h.id===f)).filter(Boolean),...o.filter(f=>!c.includes(f.id))],d=u.reduce((f,h)=>(f[h.id]=a[h.id]??!0,f),{});se.setState(f=>({...f,data:e,columnOrder:u,visibility:d,sortableColumns:u.map(h=>({id:h.id,label:h.label,sortable:!0,backgroundColor:h.backgroundColor}))}))}function Zn(e){se.setState(t=>({...t,tableId:e}))}const Qn=e=>{se.setState(t=>({...t,actionsConfig:e}))},er=e=>`table_column_order_v1:${e}`,tr=e=>`table_column_visibility_v1:${e}`,oo=e=>{const{tableId:t}=se.state;localStorage.setItem(er(t),JSON.stringify(e.map(n=>n.id))),se.setState(n=>({...n,columnOrder:e})),se.setState(n=>({...n,columnOrder:e}))};function so(e){se.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const io=e=>{se.setState(t=>{const n={...t.visibility,[e]:!t.visibility[e]};return t.tableId&&localStorage.setItem(tr(t.tableId),JSON.stringify(n)),{...t,visibility:n}})},ao=e=>{if(!e)return;const t=localStorage.getItem(tr(e));if(t)try{const n=JSON.parse(t);se.setState(r=>({...r,visibility:n}))}catch{}};function co(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Dt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ae(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Jt(e){return"nodeType"in e}function ae(e){var t,n;return e?Ae(e)?e:Jt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Zt(e){const{Document:t}=ae(e);return e instanceof t}function et(e){return Ae(e)?!1:e instanceof ae(e).HTMLElement}function nr(e){return e instanceof ae(e).SVGElement}function Le(e){return e?Ae(e)?e.document:Jt(e)?Zt(e)?e:et(e)||nr(e)?e.ownerDocument:document:document:document}const be=Dt?g.useLayoutEffect:g.useEffect;function Qt(e){const t=g.useRef(e);return be(()=>{t.current=e}),g.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function lo(){const e=g.useRef(null),t=g.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ke(e,t){t===void 0&&(t=[e]);const n=g.useRef(e);return be(()=>{n.current!==e&&(n.current=e)},t),n}function tt(e,t){const n=g.useRef();return g.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function bt(e){const t=Qt(e),n=g.useRef(null),r=g.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Vt(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let Nt={};function nt(e,t){return g.useMemo(()=>{if(t)return t;const n=Nt[e]==null?0:Nt[e]+1;return Nt[e]=n,e+"-"+n},[e,t])}function rr(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,a)=>{const c=Object.entries(a);for(const[u,d]of c){const f=s[u];f!=null&&(s[u]=f+e*d)}return s},{...t})}}const $e=rr(1),xt=rr(-1);function uo(e){return"clientX"in e&&"clientY"in e}function en(e){if(!e)return!1;const{KeyboardEvent:t}=ae(e.target);return t&&e instanceof t}function fo(e){if(!e)return!1;const{TouchEvent:t}=ae(e.target);return t&&e instanceof t}function Wt(e){if(fo(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return uo(e)?{x:e.clientX,y:e.clientY}:null}const Ie=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ie.Translate.toString(e),Ie.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),En="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ho(e){return e.matches(En)?e:e.querySelector(En)}const go={display:"none"};function po(e){let{id:t,value:n}=e;return g.createElement("div",{id:t,style:go},n)}function vo(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return g.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function mo(){const[e,t]=g.useState("");return{announce:g.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const or=g.createContext(null);function bo(e){const t=g.useContext(or);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function xo(){const[e]=g.useState(()=>new Set),t=g.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[g.useCallback(r=>{let{type:o,event:s}=r;e.forEach(a=>{var c;return(c=a[o])==null?void 0:c.call(a,s)})},[e]),t]}const yo={draggable:`
6
+ <%s key={someKey} {...props} />`,F,V,X,V),P[V+F]=!0)}if(V=null,z!==void 0&&(n(z),V=""+z),a(C)&&(n(C.key),V=""+C.key),"key"in C){z={};for(var q in C)q!=="key"&&(z[q]=C[q])}else z=C;return V&&c(z,typeof p=="function"?p.displayName||p.name||"Unknown":p),d(p,V,z,o(),U,G)}function h(p){y(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===H&&(p._payload.status==="fulfilled"?y(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function y(p){return typeof p=="object"&&p!==null&&p.$$typeof===m}var v=g,m=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),O=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),L=Symbol.for("react.client.reference"),K=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=Object.prototype.hasOwnProperty,I=Array.isArray,R=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(p){return p()}};var D,M={},E=v.react_stack_bottom_frame.bind(v,s)(),N=R(r(s)),P={};He.Fragment=x,He.jsx=function(p,C,z){var F=1e4>K.recentlyCreatedOwnerStacks++;return f(p,C,z,!1,F?Error("react-stack-top-frame"):E,F?R(r(p)):N)},He.jsxs=function(p,C,z){var F=1e4>K.recentlyCreatedOwnerStacks++;return f(p,C,z,!0,F?Error("react-stack-top-frame"):E,F?R(r(p)):N)}})()),He}var bn;function Vr(){return bn||(bn=1,process.env.NODE_ENV==="production"?it.exports=Br():it.exports=Hr()),it.exports}var i=Vr(),at={exports:{}},$t={},ct={exports:{}},It={};var xn;function Wr(){if(xn)return It;xn=1;var e=g;function t(h,y){return h===y&&(h!==0||1/h===1/y)||h!==h&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function c(h,y){var v=y(),m=r({inst:{value:v,getSnapshot:y}}),b=m[0].inst,x=m[1];return s(function(){b.value=v,b.getSnapshot=y,l(b)&&x({inst:b})},[h,v,y]),o(function(){return l(b)&&x({inst:b}),h(function(){l(b)&&x({inst:b})})},[h]),a(v),v}function l(h){var y=h.getSnapshot;h=h.value;try{var v=y();return!n(h,v)}catch{return!0}}function d(h,y){return y()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return It.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,It}var At={};var yn;function Ur(){return yn||(yn=1,process.env.NODE_ENV!=="production"&&(function(){function e(v,m){return v===m&&(v!==0||1/v===1/m)||v!==v&&m!==m}function t(v,m){f||o.startTransition===void 0||(f=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var b=m();if(!h){var x=m();s(b,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}x=a({inst:{value:b,getSnapshot:m}});var S=x[0].inst,_=x[1];return l(function(){S.value=b,S.getSnapshot=m,n(S)&&_({inst:S})},[v,b,m]),c(function(){return n(S)&&_({inst:S}),v(function(){n(S)&&_({inst:S})})},[v]),d(b),b}function n(v){var m=v.getSnapshot;v=v.value;try{var b=m();return!s(v,b)}catch{return!0}}function r(v,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=g,s=typeof Object.is=="function"?Object.is:e,a=o.useState,c=o.useEffect,l=o.useLayoutEffect,d=o.useDebugValue,f=!1,h=!1,y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;At.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:y,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),At}var Sn;function Gn(){return Sn||(Sn=1,process.env.NODE_ENV==="production"?ct.exports=Wr():ct.exports=Ur()),ct.exports}var wn;function Gr(){if(wn)return $t;wn=1;var e=g,t=Gn();function n(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,c=e.useMemo,l=e.useDebugValue;return $t.useSyncExternalStoreWithSelector=function(d,f,h,y,v){var m=s(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=c(function(){function S(T){if(!_){if(_=!0,j=T,T=y(T),v!==void 0&&b.hasValue){var $=b.value;if(v($,T))return O=$}return O=T}if($=O,r(j,T))return $;var A=y(T);return v!==void 0&&v($,A)?(j=T,$):(j=T,O=A)}var _=!1,j,O,k=h===void 0?null:h;return[function(){return S(f())},k===null?void 0:function(){return S(k())}]},[f,h,y,v]);var x=o(d,m[0],m[1]);return a(function(){b.hasValue=!0,b.value=x},[x]),l(x),x},$t}var Lt={};var Dn;function Xr(){return Dn||(Dn=1,process.env.NODE_ENV!=="production"&&(function(){function e(d,f){return d===f&&(d!==0||1/d===1/f)||d!==d&&f!==f}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=g,n=Gn(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,a=t.useEffect,c=t.useMemo,l=t.useDebugValue;Lt.useSyncExternalStoreWithSelector=function(d,f,h,y,v){var m=s(null);if(m.current===null){var b={hasValue:!1,value:null};m.current=b}else b=m.current;m=c(function(){function S(T){if(!_){if(_=!0,j=T,T=y(T),v!==void 0&&b.hasValue){var $=b.value;if(v($,T))return O=$}return O=T}if($=O,r(j,T))return $;var A=y(T);return v!==void 0&&v($,A)?(j=T,$):(j=T,O=A)}var _=!1,j,O,k=h===void 0?null:h;return[function(){return S(f())},k===null?void 0:function(){return S(k())}]},[f,h,y,v]);var x=o(d,m[0],m[1]);return a(function(){b.hasValue=!0,b.value=x},[x]),l(x),x},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Lt}var Cn;function qr(){return Cn||(Cn=1,process.env.NODE_ENV==="production"?at.exports=Gr():at.exports=Xr()),at.exports}var Kr=qr();const Vt=new WeakMap,Jr=new WeakMap,bt={current:[]};let Nt=!1;const lt=new Set,Rn=new Map;function Xn(e){for(const t of e){if(bt.current.includes(t))continue;bt.current.push(t),t.recompute();const n=Jr.get(t);if(n)for(const r of n){const o=Vt.get(r);o?.length&&Xn(o)}}}function Zr(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Qr(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function eo(e){if(lt.add(e),!Nt)try{for(Nt=!0;lt.size>0;){const t=Array.from(lt);lt.clear();for(const n of t){const r=Rn.get(n)??n.prevState;n.prevState=r,Zr(n)}for(const n of t){const r=Vt.get(n);r&&(bt.current.push(n),Xn(r))}for(const n of t){const r=Vt.get(n);if(r)for(const o of r)Qr(o)}}}finally{Nt=!1,bt.current=[],Rn.clear()}}function to(e){return typeof e=="function"}class qn{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,s;this.listeners.add(r);const a=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.call(o,r,this);return()=>{this.listeners.delete(r),a?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,o;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):to(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),eo(this)}}function Qe(e,t=r=>r,n={}){const r=n.equal??no;return Kr.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function no(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!t.has(r)||!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=En(e);if(n.length!==En(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function En(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function ro(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Ct=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ae(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Zt(e){return"nodeType"in e}function ae(e){var t,n;return e?Ae(e)?e:Zt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Qt(e){const{Document:t}=ae(e);return e instanceof t}function et(e){return Ae(e)?!1:e instanceof ae(e).HTMLElement}function Kn(e){return e instanceof ae(e).SVGElement}function Le(e){return e?Ae(e)?e.document:Zt(e)?Qt(e)?e:et(e)||Kn(e)?e.ownerDocument:document:document:document}const be=Ct?g.useLayoutEffect:g.useEffect;function en(e){const t=g.useRef(e);return be(()=>{t.current=e}),g.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function oo(){const e=g.useRef(null),t=g.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=g.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ke(e,t){t===void 0&&(t=[e]);const n=g.useRef(e);return be(()=>{n.current!==e&&(n.current=e)},t),n}function tt(e,t){const n=g.useRef();return g.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function xt(e){const t=en(e),n=g.useRef(null),r=g.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Wt(e){const t=g.useRef();return g.useEffect(()=>{t.current=e},[e]),t.current}let zt={};function nt(e,t){return g.useMemo(()=>{if(t)return t;const n=zt[e]==null?0:zt[e]+1;return zt[e]=n,e+"-"+n},[e,t])}function Jn(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,a)=>{const c=Object.entries(a);for(const[l,d]of c){const f=s[l];f!=null&&(s[l]=f+e*d)}return s},{...t})}}const $e=Jn(1),yt=Jn(-1);function so(e){return"clientX"in e&&"clientY"in e}function tn(e){if(!e)return!1;const{KeyboardEvent:t}=ae(e.target);return t&&e instanceof t}function io(e){if(!e)return!1;const{TouchEvent:t}=ae(e.target);return t&&e instanceof t}function Ut(e){if(io(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return so(e)?{x:e.clientX,y:e.clientY}:null}const Ie=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Ie.Translate.toString(e),Ie.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Tn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function ao(e){return e.matches(Tn)?e:e.querySelector(Tn)}const co={display:"none"};function lo(e){let{id:t,value:n}=e;return g.createElement("div",{id:t,style:co},n)}function uo(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return g.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function fo(){const[e,t]=g.useState("");return{announce:g.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Zn=g.createContext(null);function ho(e){const t=g.useContext(Zn);g.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function go(){const[e]=g.useState(()=>new Set),t=g.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[g.useCallback(r=>{let{type:o,event:s}=r;e.forEach(a=>{var c;return(c=a[o])==null?void 0:c.call(a,s)})},[e]),t]}const po={draggable:`
7
7
  To pick up a draggable item, press the space bar.
8
8
  While dragging, use the arrow keys to move the item.
9
9
  Press space again to drop the item in its new position, or press escape to cancel.
10
- `},So={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function wo(e){let{announcements:t=So,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=yo}=e;const{announce:s,announcement:a}=mo(),c=nt("DndLiveRegion"),[u,d]=g.useState(!1);if(g.useEffect(()=>{d(!0)},[]),bo(g.useMemo(()=>({onDragStart(h){let{active:y}=h;s(t.onDragStart({active:y}))},onDragMove(h){let{active:y,over:m}=h;t.onDragMove&&s(t.onDragMove({active:y,over:m}))},onDragOver(h){let{active:y,over:m}=h;s(t.onDragOver({active:y,over:m}))},onDragEnd(h){let{active:y,over:m}=h;s(t.onDragEnd({active:y,over:m}))},onDragCancel(h){let{active:y,over:m}=h;s(t.onDragCancel({active:y,over:m}))}}),[s,t])),!u)return null;const f=g.createElement(g.Fragment,null,g.createElement(po,{id:r,value:o.draggable}),g.createElement(vo,{id:c,announcement:a}));return n?Ue.createPortal(f,n):f}var Z;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Z||(Z={}));function yt(){}function Do(e,t){return g.useMemo(()=>({sensor:e,options:{}}),[e,t])}function Co(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const pe=Object.freeze({x:0,y:0});function Ro(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function To(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Eo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function jo(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function jn(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const sr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=jn(t,t.left,t.top),s=[];for(const a of r){const{id:c}=a,u=n.get(c);if(u){const d=Ro(jn(u),o);s.push({id:c,data:{droppableContainer:a,value:d}})}}return s.sort(To)};function Mo(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=o-r,c=s-n;if(r<o&&n<s){const u=t.width*t.height,d=e.width*e.height,f=a*c,h=f/(u+d-f);return Number(h.toFixed(4))}return 0}const _o=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:a}=s,c=n.get(a);if(c){const u=Mo(c,t);u>0&&o.push({id:a,data:{droppableContainer:s,value:u}})}}return o.sort(Eo)};function Oo(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function ir(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pe}function ko(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((a,c)=>({...a,top:a.top+e*c.y,bottom:a.bottom+e*c.y,left:a.left+e*c.x,right:a.right+e*c.x}),{...n})}}const $o=ko(1);function Io(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function Ao(e,t,n){const r=Io(t);if(!r)return e;const{scaleX:o,scaleY:s,x:a,y:c}=r,u=e.left-a-(1-o)*parseFloat(n),d=e.top-c-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,h=s?e.height/s:e.height;return{width:f,height:h,top:d,right:u+f,bottom:d+h,left:u}}const Lo={ignoreTransform:!1};function Ne(e,t){t===void 0&&(t=Lo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:f}=ae(e).getComputedStyle(e);d&&(n=Ao(n,d,f))}const{top:r,left:o,width:s,height:a,bottom:c,right:u}=n;return{top:r,left:o,width:s,height:a,bottom:c,right:u}}function Mn(e){return Ne(e,{ignoreTransform:!0})}function No(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function zo(e,t){return t===void 0&&(t=ae(e).getComputedStyle(e)),t.position==="fixed"}function Po(e,t){t===void 0&&(t=ae(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function tn(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Zt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!et(o)||nr(o)||n.includes(o))return n;const s=ae(e).getComputedStyle(o);return o!==e&&Po(o,s)&&n.push(o),zo(o,s)?n:r(o.parentNode)}return e?r(e):n}function ar(e){const[t]=tn(e,1);return t??null}function zt(e){return!Dt||!e?null:Ae(e)?e:Jt(e)?Zt(e)||e===Le(e).scrollingElement?window:et(e)?e:null:null}function cr(e){return Ae(e)?e.scrollX:e.scrollLeft}function lr(e){return Ae(e)?e.scrollY:e.scrollTop}function Ut(e){return{x:cr(e),y:lr(e)}}var Q;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Q||(Q={}));function ur(e){return!Dt||!e?!1:e===document.scrollingElement}function dr(e){const t={x:0,y:0},n=ur(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:a,isRight:c,maxScroll:r,minScroll:t}}const Yo={x:.2,y:.2};function Fo(e,t,n,r,o){let{top:s,left:a,right:c,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=Yo);const{isTop:d,isBottom:f,isLeft:h,isRight:y}=dr(e),m={x:0,y:0},b={x:0,y:0},p={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+p.height?(m.y=Q.Backward,b.y=r*Math.abs((t.top+p.height-s)/p.height)):!f&&u>=t.bottom-p.height&&(m.y=Q.Forward,b.y=r*Math.abs((t.bottom-p.height-u)/p.height)),!y&&c>=t.right-p.width?(m.x=Q.Forward,b.x=r*Math.abs((t.right-p.width-c)/p.width)):!h&&a<=t.left+p.width&&(m.x=Q.Backward,b.x=r*Math.abs((t.left+p.width-a)/p.width)),{direction:m,speed:b}}function Bo(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function fr(e){return e.reduce((t,n)=>$e(t,Ut(n)),pe)}function Ho(e){return e.reduce((t,n)=>t+cr(n),0)}function Vo(e){return e.reduce((t,n)=>t+lr(n),0)}function Wo(e,t){if(t===void 0&&(t=Ne),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);ar(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Uo=[["x",["left","right"],Ho],["y",["top","bottom"],Vo]];class nn{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=tn(n),o=fr(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,c]of Uo)for(const u of a)Object.defineProperty(this,u,{get:()=>{const d=c(r),f=o[s]-d;return this.rect[u]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ge{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Go(e){const{EventTarget:t}=ae(e);return e instanceof t?e:Le(e)}function Pt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var fe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(fe||(fe={}));function _n(e){e.preventDefault()}function Xo(e){e.stopPropagation()}var V;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(V||(V={}));const hr={start:[V.Space,V.Enter],cancel:[V.Esc],end:[V.Space,V.Enter,V.Tab]},qo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case V.Right:return{...n,x:n.x+25};case V.Left:return{...n,x:n.x-25};case V.Down:return{...n,y:n.y+25};case V.Up:return{...n,y:n.y-25}}};class gr{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ge(Le(n)),this.windowListeners=new Ge(ae(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Wo(r),n(pe)}handleKeyDown(t){if(en(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=hr,coordinateGetter:a=qo,scrollBehavior:c="smooth"}=o,{code:u}=t;if(s.end.includes(u)){this.handleEnd(t);return}if(s.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:d}=r.current,f=d?{x:d.left,y:d.top}:pe;this.referenceCoordinates||(this.referenceCoordinates=f);const h=a(t,{active:n,context:r.current,currentCoordinates:f});if(h){const y=xt(h,f),m={x:0,y:0},{scrollableAncestors:b}=r.current;for(const p of b){const x=t.code,{isTop:D,isRight:_,isLeft:j,isBottom:O,maxScroll:k,minScroll:M}=dr(p),$=Bo(p),N={x:Math.min(x===V.Right?$.right-$.width/2:$.right,Math.max(x===V.Right?$.left:$.left+$.width/2,h.x)),y:Math.min(x===V.Down?$.bottom-$.height/2:$.bottom,Math.max(x===V.Down?$.top:$.top+$.height/2,h.y))},W=x===V.Right&&!_||x===V.Left&&!j,B=x===V.Down&&!O||x===V.Up&&!D;if(W&&N.x!==h.x){const A=p.scrollLeft+y.x,K=x===V.Right&&A<=k.x||x===V.Left&&A>=M.x;if(K&&!y.y){p.scrollTo({left:A,behavior:c});return}K?m.x=p.scrollLeft-A:m.x=x===V.Right?p.scrollLeft-k.x:p.scrollLeft-M.x,m.x&&p.scrollBy({left:-m.x,behavior:c});break}else if(B&&N.y!==h.y){const A=p.scrollTop+y.y,K=x===V.Down&&A<=k.y||x===V.Up&&A>=M.y;if(K&&!y.x){p.scrollTo({top:A,behavior:c});return}K?m.y=p.scrollTop-A:m.y=x===V.Down?p.scrollTop-k.y:p.scrollTop-M.y,m.y&&p.scrollBy({top:-m.y,behavior:c});break}}this.handleMove(t,$e(xt(h,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}gr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=hr,onActivation:o}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const c=s.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function On(e){return!!(e&&"distance"in e)}function kn(e){return!!(e&&"delay"in e)}class rn{constructor(t,n,r){var o;r===void 0&&(r=Go(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:a}=s;this.props=t,this.events=n,this.document=Le(a),this.documentListeners=new Ge(this.document),this.listeners=new Ge(r),this.windowListeners=new Ge(ae(a)),this.initialCoordinates=(o=Wt(s))!=null?o:pe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.DragStart,_n),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),this.windowListeners.add(fe.ContextMenu,_n),this.documentListeners.add(fe.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(kn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(On(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(fe.Click,Xo,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fe.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:a,options:{activationConstraint:c}}=s;if(!o)return;const u=(n=Wt(t))!=null?n:pe,d=xt(o,u);if(!r&&c){if(On(c)){if(c.tolerance!=null&&Pt(d,c.tolerance))return this.handleCancel();if(Pt(d,c.distance))return this.handleStart()}if(kn(c)&&Pt(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}t.cancelable&&t.preventDefault(),a(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===V.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Ko={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class on extends rn{constructor(t){const{event:n}=t,r=Le(n.target);super(t,Ko,r)}}on.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Jo={move:{name:"mousemove"},end:{name:"mouseup"}};var Gt;(function(e){e[e.RightClick=2]="RightClick"})(Gt||(Gt={}));class Zo extends rn{constructor(t){super(t,Jo,Le(t.event.target))}}Zo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Gt.RightClick?!1:(r?.({event:n}),!0)}}];const Yt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Qo extends rn{constructor(t){super(t,Yt)}static setup(){return window.addEventListener(Yt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Yt.move.name,t)};function t(){}}}Qo.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var Xe;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Xe||(Xe={}));var St;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(St||(St={}));function es(e){let{acceleration:t,activator:n=Xe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:a=5,order:c=St.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:f,delta:h,threshold:y}=e;const m=ns({delta:h,disabled:!s}),[b,p]=lo(),x=g.useRef({x:0,y:0}),D=g.useRef({x:0,y:0}),_=g.useMemo(()=>{switch(n){case Xe.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Xe.DraggableRect:return o}},[n,o,u]),j=g.useRef(null),O=g.useCallback(()=>{const M=j.current;if(!M)return;const $=x.current.x*D.current.x,N=x.current.y*D.current.y;M.scrollBy($,N)},[]),k=g.useMemo(()=>c===St.TreeOrder?[...d].reverse():d,[c,d]);g.useEffect(()=>{if(!s||!d.length||!_){p();return}for(const M of k){if(r?.(M)===!1)continue;const $=d.indexOf(M),N=f[$];if(!N)continue;const{direction:W,speed:B}=Fo(M,N,_,t,y);for(const A of["x","y"])m[A][W[A]]||(B[A]=0,W[A]=0);if(B.x>0||B.y>0){p(),j.current=M,b(O,a),x.current=B,D.current=W;return}}x.current={x:0,y:0},D.current={x:0,y:0},p()},[t,O,r,p,s,a,JSON.stringify(_),JSON.stringify(m),b,d,k,f,JSON.stringify(y)])}const ts={x:{[Q.Backward]:!1,[Q.Forward]:!1},y:{[Q.Backward]:!1,[Q.Forward]:!1}};function ns(e){let{delta:t,disabled:n}=e;const r=Vt(t);return tt(o=>{if(n||!r||!o)return ts;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Q.Backward]:o.x[Q.Backward]||s.x===-1,[Q.Forward]:o.x[Q.Forward]||s.x===1},y:{[Q.Backward]:o.y[Q.Backward]||s.y===-1,[Q.Forward]:o.y[Q.Forward]||s.y===1}}},[n,t,r])}function rs(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return tt(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function os(e,t){return g.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...s]},[]),[e,t])}var Je;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Je||(Je={}));var Xt;(function(e){e.Optimized="optimized"})(Xt||(Xt={}));const $n=new Map;function ss(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,a]=g.useState(null),{frequency:c,measure:u,strategy:d}=o,f=g.useRef(e),h=x(),y=Ke(h),m=g.useCallback(function(D){D===void 0&&(D=[]),!y.current&&a(_=>_===null?D:_.concat(D.filter(j=>!_.includes(j))))},[y]),b=g.useRef(null),p=tt(D=>{if(h&&!n)return $n;if(!D||D===$n||f.current!==e||s!=null){const _=new Map;for(let j of e){if(!j)continue;if(s&&s.length>0&&!s.includes(j.id)&&j.rect.current){_.set(j.id,j.rect.current);continue}const O=j.node.current,k=O?new nn(u(O),O):null;j.rect.current=k,k&&_.set(j.id,k)}return _}return D},[e,s,n,h,u]);return g.useEffect(()=>{f.current=e},[e]),g.useEffect(()=>{h||m()},[n,h]),g.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),g.useEffect(()=>{h||typeof c!="number"||b.current!==null||(b.current=setTimeout(()=>{m(),b.current=null},c))},[c,h,m,...r]),{droppableRects:p,measureDroppableContainers:m,measuringScheduled:s!=null};function x(){switch(d){case Je.Always:return!1;case Je.BeforeDragging:return n;default:return!n}}}function pr(e,t){return tt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function is(e,t){return pr(e,t)}function as(e){let{callback:t,disabled:n}=e;const r=Qt(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return g.useEffect(()=>()=>o?.disconnect(),[o]),o}function Ct(e){let{callback:t,disabled:n}=e;const r=Qt(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return g.useEffect(()=>()=>o?.disconnect(),[o]),o}function cs(e){return new nn(Ne(e),e)}function In(e,t,n){t===void 0&&(t=cs);const[r,o]=g.useState(null);function s(){o(u=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=u??n)!=null?d:null}const f=t(e);return JSON.stringify(u)===JSON.stringify(f)?u:f})}const a=as({callback(u){if(e)for(const d of u){const{type:f,target:h}=d;if(f==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),c=Ct({callback:s});return be(()=>{s(),e?(c?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),a?.disconnect())},[e]),r}function ls(e){const t=pr(e);return ir(e,t)}const An=[];function us(e){const t=g.useRef(e),n=tt(r=>e?r&&r!==An&&e&&t.current&&e.parentNode===t.current.parentNode?r:tn(e):An,[e]);return g.useEffect(()=>{t.current=e},[e]),n}function ds(e){const[t,n]=g.useState(null),r=g.useRef(e),o=g.useCallback(s=>{const a=zt(s.target);a&&n(c=>c?(c.set(a,Ut(a)),new Map(c)):null)},[]);return g.useEffect(()=>{const s=r.current;if(e!==s){a(s);const c=e.map(u=>{const d=zt(u);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Ut(d)]):null}).filter(u=>u!=null);n(c.length?new Map(c):null),r.current=e}return()=>{a(e),a(s)};function a(c){c.forEach(u=>{const d=zt(u);d?.removeEventListener("scroll",o)})}},[o,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>$e(s,a),pe):fr(e):pe,[e,t])}function Ln(e,t){t===void 0&&(t=[]);const n=g.useRef(null);return g.useEffect(()=>{n.current=null},t),g.useEffect(()=>{const r=e!==pe;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?xt(e,n.current):pe}function fs(e){g.useEffect(()=>{if(!Dt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function hs(e,t){return g.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=a=>{s(a,t)},n},{}),[e,t])}function vr(e){return g.useMemo(()=>e?No(e):null,[e])}const Nn=[];function gs(e,t){t===void 0&&(t=Ne);const[n]=e,r=vr(n?ae(n):null),[o,s]=g.useState(Nn);function a(){s(()=>e.length?e.map(u=>ur(u)?r:new nn(t(u),u)):Nn)}const c=Ct({callback:a});return be(()=>{c?.disconnect(),a(),e.forEach(u=>c?.observe(u))},[e]),o}function ps(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return et(t)?t:e}function vs(e){let{measure:t}=e;const[n,r]=g.useState(null),o=g.useCallback(d=>{for(const{target:f}of d)if(et(f)){r(h=>{const y=t(f);return h?{...h,width:y.width,height:y.height}:y});break}},[t]),s=Ct({callback:o}),a=g.useCallback(d=>{const f=ps(d);s?.disconnect(),f&&s?.observe(f),r(f?t(f):null)},[t,s]),[c,u]=bt(a);return g.useMemo(()=>({nodeRef:c,rect:n,setRef:u}),[n,c,u])}const ms=[{sensor:on,options:{}},{sensor:gr,options:{}}],bs={current:{}},ft={draggable:{measure:Mn},droppable:{measure:Mn,strategy:Je.WhileDragging,frequency:Xt.Optimized},dragOverlay:{measure:Ne}};class qe extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const xs={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new qe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:yt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ft,measureDroppableContainers:yt,windowRect:null,measuringScheduled:!1},ys={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yt,draggableNodes:new Map,over:null,measureDroppableContainers:yt},Rt=g.createContext(ys),mr=g.createContext(xs);function Ss(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new qe}}}function ws(e,t){switch(t.type){case Z.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Z.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Z.DragEnd:case Z.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Z.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new qe(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Z.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new qe(e.droppable.containers);return a.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Z.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new qe(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Ds(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=g.useContext(Rt),s=Vt(r),a=Vt(n?.id);return g.useEffect(()=>{if(!t&&!r&&s&&a!=null){if(!en(s)||document.activeElement===s.target)return;const c=o.get(a);if(!c)return;const{activatorNode:u,node:d}=c;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[u.current,d.current]){if(!f)continue;const h=ho(f);if(h){h.focus();break}}})}},[r,t,o,a,s]),null}function Cs(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function Rs(e){return g.useMemo(()=>({draggable:{...ft.draggable,...e?.draggable},droppable:{...ft.droppable,...e?.droppable},dragOverlay:{...ft.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Ts(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=g.useRef(!1),{x:a,y:c}=typeof o=="boolean"?{x:o,y:o}:o;be(()=>{if(!a&&!c||!t){s.current=!1;return}if(s.current||!r)return;const d=t?.node.current;if(!d||d.isConnected===!1)return;const f=n(d),h=ir(f,r);if(a||(h.x=0),c||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const y=ar(d);y&&y.scrollBy({top:h.y,left:h.x})}},[t,a,c,r,n])}const br=g.createContext({...pe,scaleX:1,scaleY:1});var Te;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Te||(Te={}));const xr=g.memo(function(t){var n,r,o,s;let{id:a,accessibility:c,autoScroll:u=!0,children:d,sensors:f=ms,collisionDetection:h=_o,measuring:y,modifiers:m,...b}=t;const p=g.useReducer(ws,void 0,Ss),[x,D]=p,[_,j]=xo(),[O,k]=g.useState(Te.Uninitialized),M=O===Te.Initialized,{draggable:{active:$,nodes:N,translate:W},droppable:{containers:B}}=x,A=$!=null?N.get($):null,K=g.useRef({initial:null,translated:null}),ee=g.useMemo(()=>{var re;return $!=null?{id:$,data:(re=A?.data)!=null?re:bs,rect:K}:null},[$,A]),I=g.useRef(null),[R,w]=g.useState(null),[E,T]=g.useState(null),L=Ke(b,Object.values(b)),P=nt("DndDescribedBy",a),v=g.useMemo(()=>B.getEnabled(),[B]),C=Rs(y),{droppableRects:z,measureDroppableContainers:F,measuringScheduled:U}=ss(v,{dragging:M,dependencies:[W.x,W.y],config:C.droppable}),G=rs(N,$),H=g.useMemo(()=>E?Wt(E):null,[E]),X=Br(),q=is(G,C.draggable.measure);Ts({activeNode:$!=null?N.get($):null,config:X.layoutShiftCompensation,initialRect:q,measure:C.draggable.measure});const Y=In(G,C.draggable.measure,q),ie=In(G?G.parentElement:null),ne=g.useRef({activatorEvent:null,active:null,activeNode:G,collisionRect:null,collisions:null,droppableRects:z,draggableNodes:N,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=B.getNodeFor((n=ne.current.over)==null?void 0:n.id),xe=vs({measure:C.dragOverlay.measure}),je=(r=xe.nodeRef.current)!=null?r:G,Me=M?(o=xe.rect)!=null?o:Y:null,cn=!!(xe.nodeRef.current&&xe.rect),ln=ls(cn?null:Y),Mt=vr(je?ae(je):null),Se=us(M?he??G:null),rt=gs(Se),ot=Cs(m,{transform:{x:W.x-ln.x,y:W.y-ln.y,scaleX:1,scaleY:1},activatorEvent:E,active:ee,activeNodeRect:Y,containerNodeRect:ie,draggingNodeRect:Me,over:ne.current.over,overlayNodeRect:xe.rect,scrollableAncestors:Se,scrollableAncestorRects:rt,windowRect:Mt}),un=H?$e(H,W):null,dn=ds(Se),Ar=Ln(dn),Lr=Ln(dn,[Y]),_e=$e(ot,Ar),Oe=Me?$o(Me,ot):null,ze=ee&&Oe?h({active:ee,collisionRect:Oe,droppableRects:z,droppableContainers:v,pointerCoordinates:un}):null,fn=jo(ze,"id"),[we,hn]=g.useState(null),Nr=cn?ot:$e(ot,Lr),zr=Oo(Nr,(s=we?.rect)!=null?s:null,Y),_t=g.useRef(null),gn=g.useCallback((re,ce)=>{let{sensor:le,options:De}=ce;if(I.current==null)return;const de=N.get(I.current);if(!de)return;const ue=re.nativeEvent,ve=new le({active:I.current,activeNode:de,event:ue,options:De,context:ne,onAbort(te){if(!N.get(te))return;const{onDragAbort:me}=L.current,ye={id:te};me?.(ye),_({type:"onDragAbort",event:ye})},onPending(te,Ce,me,ye){if(!N.get(te))return;const{onDragPending:Ye}=L.current,Re={id:te,constraint:Ce,initialCoordinates:me,offset:ye};Ye?.(Re),_({type:"onDragPending",event:Re})},onStart(te){const Ce=I.current;if(Ce==null)return;const me=N.get(Ce);if(!me)return;const{onDragStart:ye}=L.current,Pe={activatorEvent:ue,active:{id:Ce,data:me.data,rect:K}};Ue.unstable_batchedUpdates(()=>{ye?.(Pe),k(Te.Initializing),D({type:Z.DragStart,initialCoordinates:te,active:Ce}),_({type:"onDragStart",event:Pe}),w(_t.current),T(ue)})},onMove(te){D({type:Z.DragMove,coordinates:te})},onEnd:ke(Z.DragEnd),onCancel:ke(Z.DragCancel)});_t.current=ve;function ke(te){return async function(){const{active:me,collisions:ye,over:Pe,scrollAdjustedTranslate:Ye}=ne.current;let Re=null;if(me&&Ye){const{cancelDrop:Fe}=L.current;Re={activatorEvent:ue,active:me,collisions:ye,delta:Ye,over:Pe},te===Z.DragEnd&&typeof Fe=="function"&&await Promise.resolve(Fe(Re))&&(te=Z.DragCancel)}I.current=null,Ue.unstable_batchedUpdates(()=>{D({type:te}),k(Te.Uninitialized),hn(null),w(null),T(null),_t.current=null;const Fe=te===Z.DragEnd?"onDragEnd":"onDragCancel";if(Re){const Ot=L.current[Fe];Ot?.(Re),_({type:Fe,event:Re})}})}}},[N]),Pr=g.useCallback((re,ce)=>(le,De)=>{const de=le.nativeEvent,ue=N.get(De);if(I.current!==null||!ue||de.dndKit||de.defaultPrevented)return;const ve={active:ue};re(le,ce.options,ve)===!0&&(de.dndKit={capturedBy:ce.sensor},I.current=De,gn(le,ce))},[N,gn]),pn=os(f,Pr);fs(f),be(()=>{Y&&O===Te.Initializing&&k(Te.Initialized)},[Y,O]),g.useEffect(()=>{const{onDragMove:re}=L.current,{active:ce,activatorEvent:le,collisions:De,over:de}=ne.current;if(!ce||!le)return;const ue={active:ce,activatorEvent:le,collisions:De,delta:{x:_e.x,y:_e.y},over:de};Ue.unstable_batchedUpdates(()=>{re?.(ue),_({type:"onDragMove",event:ue})})},[_e.x,_e.y]),g.useEffect(()=>{const{active:re,activatorEvent:ce,collisions:le,droppableContainers:De,scrollAdjustedTranslate:de}=ne.current;if(!re||I.current==null||!ce||!de)return;const{onDragOver:ue}=L.current,ve=De.get(fn),ke=ve&&ve.rect.current?{id:ve.id,rect:ve.rect.current,data:ve.data,disabled:ve.disabled}:null,te={active:re,activatorEvent:ce,collisions:le,delta:{x:de.x,y:de.y},over:ke};Ue.unstable_batchedUpdates(()=>{hn(ke),ue?.(te),_({type:"onDragOver",event:te})})},[fn]),be(()=>{ne.current={activatorEvent:E,active:ee,activeNode:G,collisionRect:Oe,collisions:ze,droppableRects:z,draggableNodes:N,draggingNode:je,draggingNodeRect:Me,droppableContainers:B,over:we,scrollableAncestors:Se,scrollAdjustedTranslate:_e},K.current={initial:Me,translated:Oe}},[ee,G,ze,Oe,N,je,Me,z,B,we,Se,_e]),es({...X,delta:W,draggingRect:Oe,pointerCoordinates:un,scrollableAncestors:Se,scrollableAncestorRects:rt});const Yr=g.useMemo(()=>({active:ee,activeNode:G,activeNodeRect:Y,activatorEvent:E,collisions:ze,containerNodeRect:ie,dragOverlay:xe,draggableNodes:N,droppableContainers:B,droppableRects:z,over:we,measureDroppableContainers:F,scrollableAncestors:Se,scrollableAncestorRects:rt,measuringConfiguration:C,measuringScheduled:U,windowRect:Mt}),[ee,G,Y,E,ze,ie,xe,N,B,z,we,F,Se,rt,C,U,Mt]),Fr=g.useMemo(()=>({activatorEvent:E,activators:pn,active:ee,activeNodeRect:Y,ariaDescribedById:{draggable:P},dispatch:D,draggableNodes:N,over:we,measureDroppableContainers:F}),[E,pn,ee,Y,D,P,N,we,F]);return g.createElement(or.Provider,{value:j},g.createElement(Rt.Provider,{value:Fr},g.createElement(mr.Provider,{value:Yr},g.createElement(br.Provider,{value:zr},d)),g.createElement(Ds,{disabled:c?.restoreFocus===!1})),g.createElement(wo,{...c,hiddenTextDescribedById:P}));function Br(){const re=R?.autoScrollEnabled===!1,ce=typeof u=="object"?u.enabled===!1:u===!1,le=M&&!re&&!ce;return typeof u=="object"?{...u,enabled:le}:{enabled:le}}}),Es=g.createContext(null),zn="button",js="Draggable";function Ms(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=nt(js),{activators:a,activatorEvent:c,active:u,activeNodeRect:d,ariaDescribedById:f,draggableNodes:h,over:y}=g.useContext(Rt),{role:m=zn,roleDescription:b="draggable",tabIndex:p=0}=o??{},x=u?.id===t,D=g.useContext(x?br:Es),[_,j]=bt(),[O,k]=bt(),M=hs(a,t),$=Ke(n);be(()=>(h.set(t,{id:t,key:s,node:_,activatorNode:O,data:$}),()=>{const W=h.get(t);W&&W.key===s&&h.delete(t)}),[h,t]);const N=g.useMemo(()=>({role:m,tabIndex:p,"aria-disabled":r,"aria-pressed":x&&m===zn?!0:void 0,"aria-roledescription":b,"aria-describedby":f.draggable}),[r,m,p,x,b,f.draggable]);return{active:u,activatorEvent:c,activeNodeRect:d,attributes:N,isDragging:x,listeners:r?void 0:M,node:_,over:y,setNodeRef:j,setActivatorNodeRef:k,transform:D}}function _s(){return g.useContext(mr)}const Os="Droppable",ks={timeout:25};function $s(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=nt(Os),{active:a,dispatch:c,over:u,measureDroppableContainers:d}=g.useContext(Rt),f=g.useRef({disabled:n}),h=g.useRef(!1),y=g.useRef(null),m=g.useRef(null),{disabled:b,updateMeasurementsFor:p,timeout:x}={...ks,...o},D=Ke(p??r),_=g.useCallback(()=>{if(!h.current){h.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{d(Array.isArray(D.current)?D.current:[D.current]),m.current=null},x)},[x]),j=Ct({callback:_,disabled:b||!a}),O=g.useCallback((N,W)=>{j&&(W&&(j.unobserve(W),h.current=!1),N&&j.observe(N))},[j]),[k,M]=bt(O),$=Ke(t);return g.useEffect(()=>{!j||!k.current||(j.disconnect(),h.current=!1,j.observe(k.current))},[k,j]),g.useEffect(()=>(c({type:Z.RegisterDroppable,element:{id:r,key:s,disabled:n,node:k,rect:y,data:$}}),()=>c({type:Z.UnregisterDroppable,key:s,id:r})),[r]),g.useEffect(()=>{n!==f.current.disabled&&(c({type:Z.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)},[r,s,n,c]),{active:a,rect:y,isOver:u?.id===r,node:k,over:u,setNodeRef:M}}function Tt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Is(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function lt(e){return e!==null&&e>=0}function As(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Ls(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ut={scaleX:1,scaleY:1},Ns=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:a}=e;const c=(t=n[o])!=null?t:r;if(!c)return null;const u=zs(n,a,o);if(a===o){const d=n[s];return d?{x:o<s?d.left+d.width-(c.left+c.width):d.left-c.left,y:0,...ut}:null}return a>o&&a<=s?{x:-c.width-u,y:0,...ut}:a<o&&a>=s?{x:c.width+u,y:0,...ut}:{x:0,y:0,...ut}};function zs(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return!r||!o&&!s?0:n<t?o?r.left-(o.left+o.width):s.left-(r.left+r.width):s?s.left-(r.left+r.width):r.left-(o.left+o.width)}const yr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=Tt(t,r,n),a=t[o],c=s[o];return!c||!a?null:{x:c.left-a.left,y:c.top-a.top,scaleX:c.width/a.width,scaleY:c.height/a.height}},dt={scaleX:1,scaleY:1},Ps=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:a}=e;const c=(t=s[n])!=null?t:r;if(!c)return null;if(o===n){const d=s[a];return d?{x:0,y:n<a?d.top+d.height-(c.top+c.height):d.top-c.top,...dt}:null}const u=Ys(s,o,n);return o>n&&o<=a?{x:0,y:-c.height-u,...dt}:o<n&&o>=a?{x:0,y:c.height+u,...dt}:{x:0,y:0,...dt}};function Ys(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const Sr="Sortable",wr=g.createContext({activeIndex:-1,containerId:Sr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:yr,disabled:{draggable:!1,droppable:!1}});function Dr(e){let{children:t,id:n,items:r,strategy:o=yr,disabled:s=!1}=e;const{active:a,dragOverlay:c,droppableRects:u,over:d,measureDroppableContainers:f}=_s(),h=nt(Sr,n),y=c.rect!==null,m=g.useMemo(()=>r.map(M=>typeof M=="object"&&"id"in M?M.id:M),[r]),b=a!=null,p=a?m.indexOf(a.id):-1,x=d?m.indexOf(d.id):-1,D=g.useRef(m),_=!As(m,D.current),j=x!==-1&&p===-1||_,O=Ls(s);be(()=>{_&&b&&f(m)},[_,m,b,f]),g.useEffect(()=>{D.current=m},[m]);const k=g.useMemo(()=>({activeIndex:p,containerId:h,disabled:O,disableTransforms:j,items:m,overIndex:x,useDragOverlay:y,sortedRects:Is(m,u),strategy:o}),[p,h,O.draggable,O.droppable,j,m,x,u,y,o]);return g.createElement(wr.Provider,{value:k},t)}const Fs=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Tt(n,r,o).indexOf(t)},Bs=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:a,previousItems:c,previousContainerId:u,transition:d}=e;return!d||!r||c!==s&&o===a?!1:n?!0:a!==o&&t===u},Hs={duration:200,easing:"ease"},Cr="transform",Vs=Ie.Transition.toString({property:Cr,duration:0,easing:"linear"}),Ws={roleDescription:"sortable"};function Us(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,a]=g.useState(null),c=g.useRef(n);return be(()=>{if(!t&&n!==c.current&&r.current){const u=o.current;if(u){const d=Ne(r.current,{ignoreTransform:!0}),f={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(f.x||f.y)&&a(f)}}n!==c.current&&(c.current=n)},[t,n,r,o]),g.useEffect(()=>{s&&a(null)},[s]),s}function Rr(e){let{animateLayoutChanges:t=Bs,attributes:n,disabled:r,data:o,getNewIndex:s=Fs,id:a,strategy:c,resizeObserverConfig:u,transition:d=Hs}=e;const{items:f,containerId:h,activeIndex:y,disabled:m,disableTransforms:b,sortedRects:p,overIndex:x,useDragOverlay:D,strategy:_}=g.useContext(wr),j=Gs(r,m),O=f.indexOf(a),k=g.useMemo(()=>({sortable:{containerId:h,index:O,items:f},...o}),[h,o,O,f]),M=g.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:$,node:N,isOver:W,setNodeRef:B}=$s({id:a,data:k,disabled:j.droppable,resizeObserverConfig:{updateMeasurementsFor:M,...u}}),{active:A,activatorEvent:K,activeNodeRect:ee,attributes:I,setNodeRef:R,listeners:w,isDragging:E,over:T,setActivatorNodeRef:L,transform:P}=Ms({id:a,data:k,attributes:{...Ws,...n},disabled:j.draggable}),v=co(B,R),C=!!A,z=C&&!b&&lt(y)&&lt(x),F=!D&&E,U=F&&z?P:null,H=z?U??(c??_)({rects:p,activeNodeRect:ee,activeIndex:y,overIndex:x,index:O}):null,X=lt(y)&&lt(x)?s({id:a,items:f,activeIndex:y,overIndex:x}):O,q=A?.id,Y=g.useRef({activeId:q,items:f,newIndex:X,containerId:h}),ie=f!==Y.current.items,ne=t({active:A,containerId:h,isDragging:E,isSorting:C,id:a,index:O,items:f,newIndex:Y.current.newIndex,previousItems:Y.current.items,previousContainerId:Y.current.containerId,transition:d,wasDragging:Y.current.activeId!=null}),he=Us({disabled:!ne,index:O,node:N,rect:$});return g.useEffect(()=>{C&&Y.current.newIndex!==X&&(Y.current.newIndex=X),h!==Y.current.containerId&&(Y.current.containerId=h),f!==Y.current.items&&(Y.current.items=f)},[C,X,h,f]),g.useEffect(()=>{if(q===Y.current.activeId)return;if(q!=null&&Y.current.activeId==null){Y.current.activeId=q;return}const je=setTimeout(()=>{Y.current.activeId=q},50);return()=>clearTimeout(je)},[q]),{active:A,activeIndex:y,attributes:I,data:k,rect:$,index:O,newIndex:X,items:f,isOver:W,isSorting:C,isDragging:E,listeners:w,node:N,overIndex:x,over:T,setNodeRef:v,setActivatorNodeRef:L,setDroppableNodeRef:B,setDraggableNodeRef:R,transform:he??H,transition:xe()};function xe(){if(he||ie&&Y.current.newIndex===O)return Vs;if(!(F&&!en(K)||!d)&&(C||ne))return Ie.Transition.toString({...d,property:Cr})}}function Gs(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}V.Down,V.Right,V.Up,V.Left;const Xs=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Pn=e=>{const t=qs(e);return t.charAt(0).toUpperCase()+t.slice(1)},Tr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Ks=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Js={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Zs=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...c},u)=>g.createElement("svg",{ref:u,...Js,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Tr("lucide",o),...!s&&!Ks(c)&&{"aria-hidden":"true"},...c},[...a.map(([d,f])=>g.createElement(d,f)),...Array.isArray(s)?s:[s]]));const oe=(e,t)=>{const n=g.forwardRef(({className:r,...o},s)=>g.createElement(Zs,{ref:s,iconNode:t,className:Tr(`lucide-${Xs(Pn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Pn(e),n};const Qs=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],ei=oe("arrow-down",Qs);const ti=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],ni=oe("arrow-up-down",ti);const ri=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],oi=oe("arrow-up",ri);const si=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],ii=oe("bookmark",si);const ai=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Yn=oe("calendar",ai);const ci=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],li=oe("chevron-left",ci);const ui=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],di=oe("chevron-right",ui);const fi=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],hi=oe("columns-2",fi);const gi=[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]],pi=oe("delete",gi);const vi=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],mi=oe("ellipsis",vi);const bi=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],xi=oe("funnel",bi);const yi=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Er=oe("grip-vertical",yi);const Si=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],wi=oe("pen",Si);const Di=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],Ci=oe("refresh-ccw",Di);const Ri=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Ti=oe("settings",Ri);const Ei=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ji=oe("triangle-alert",Ei);function S(e){return g.forwardRef((t,n)=>{const{children:r,...o}=t;return i.jsx(e,{ref:n,...o,children:r})})}const Mi=S(l.Menu.Trigger),_i=S(l.Menu.Positioner),Oi=S(l.Menu.Content),ki=S(l.Menu.Item),$i=S(l.Checkbox.Label),Ii=S(l.Checkbox.HiddenInput),Ai=S(l.Checkbox.Control);function Li({visibility:e,onToggle:t}){const{sortableColumns:n}=Qe(se);return i.jsxs(l.Menu.Root,{closeOnSelect:!1,children:[i.jsx(Mi,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Toggle columns",variant:"ghost",ml:"1",size:"xs",children:i.jsx(hi,{size:18})})}),i.jsx(l.Portal,{children:i.jsx(_i,{children:i.jsx(Oi,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return i.jsx(ki,{value:r.id,closeOnSelect:!1,children:i.jsxs(l.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[i.jsx(Ii,{}),i.jsx(Ai,{}),i.jsx($i,{children:r.label})]})},r.id)})})})})]})}function Ni({id:e,children:t,onClick:n,cursor:r,borderRight:o,borderRightColor:s,backgroundColor:a}){const{setNodeRef:c,attributes:u,listeners:d,transform:f,transition:h}=Rr({id:e});return i.jsx(l.Table.ColumnHeader,{ref:c,onClick:n,backgroundColor:a,w:e==="id"?"80px":void 0,style:{transform:Ie.Transform.toString(f),transition:h,cursor:r,borderRight:o,borderRightColor:s},...u,children:i.jsxs(l.HStack,{justify:"space-between",children:[t,i.jsx("span",{...d,children:i.jsx(Er,{size:12})})]})})}function zi(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o,actionsConfig:s}=Qe(se),a=e.map(u=>o.find(d=>d.id===u.id)).filter(u=>u!==void 0).filter(u=>t[u.id]),c=u=>{const{active:d,over:f}=u;if(!f||d.id===f.id)return;const h=e.findIndex(b=>b.id===d.id),y=e.findIndex(b=>b.id===f.id),m=Tt(e,h,y);oo(m)};return i.jsx(l.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",zIndex:1,children:i.jsx(xr,{collisionDetection:sr,onDragEnd:c,children:i.jsx(Dr,{items:e.map(u=>u.id),strategy:Ns,children:i.jsxs(l.Table.Row,{height:"28px",children:[a.map(u=>{const d=n===u?.id;return i.jsx(Ni,{id:u?.id,onClick:()=>u?.sortable&&so(u?.id),cursor:u?.sortable?"pointer":"default",borderRight:"2px solid #dcdcdc",backgroundColor:u?.backgroundColor,children:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[u?.label,u?.sortable&&(d?r==="asc"?i.jsx(oi,{size:14}):i.jsx(ei,{size:14}):i.jsx(ni,{size:14,opacity:.4}))]})},u?.id)}),s?.showActionColumn&&i.jsx(l.Table.ColumnHeader,{width:s.width,backgroundColor:s.backgroundColor,borderRight:"2px solid #dcdcdc",children:s.children}),s?.showColumnVisibilityMenu&&i.jsx(l.Table.ColumnHeader,{boxSize:"0.5",backgroundColor:s.backgroundColorColumnVisibilityMenu,children:i.jsx(Li,{visibility:t,onToggle:io})})]})})})})}const Fn=l.createListCollection({items:[{label:"10",value:"10"},{label:"20",value:"20"},{label:"50",value:"50"},{label:"100",value:"100"}]}),Pi=S(l.Select.Positioner),Yi=S(l.Select.Content),Fi=S(l.Select.Item),Bi=S(l.Pagination.PrevTrigger),Hi=S(l.Pagination.NextTrigger),Vi=S(l.Select.HiddenSelect),Wi=S(l.Select.Control),Ui=S(l.Select.Trigger),Gi=S(l.Select.ValueText),Xi=S(l.Select.IndicatorGroup),qi=S(l.Select.Indicator);function Ki({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:s=2}){return i.jsx(l.Box,{width:"100%",children:i.jsxs(l.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[i.jsxs(l.HStack,{children:[i.jsx(l.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),i.jsxs(l.Select.Root,{collection:Fn,size:"sm",width:"60px",onValueChange:a=>o&&o(Number(a.items[0].value)),value:[String(t)],children:[i.jsx(Vi,{}),i.jsxs(Wi,{children:[i.jsx(Ui,{children:i.jsx(Gi,{placeholder:""})}),i.jsx(Xi,{children:i.jsx(qi,{})})]}),i.jsx(l.Portal,{children:i.jsx(Pi,{children:i.jsx(Yi,{children:Fn.items.map(a=>i.jsxs(Fi,{item:a.value,children:[a.label,i.jsx(l.Select.ItemIndicator,{})]},a.value))})})})]})]}),i.jsx(l.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:s,onPageChange:a=>r&&r(a.page),children:i.jsxs(l.ButtonGroup,{size:"sm",variant:"ghost",children:[i.jsx(Bi,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Previous page",children:i.jsx(li,{size:18})})}),i.jsx(l.Pagination.Items,{render:a=>i.jsx(l.IconButton,{variant:a.type==="page"&&a.value===n?"outline":"ghost","aria-current":a.type==="page"&&a.value===n?"page":void 0,children:a.type==="page"?a.value:"…"},a.value??a.type)}),i.jsx(Hi,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Next page",children:i.jsx(di,{size:18})})})]})})]})})}const Ji=S(l.Menu.Item),Zi=S(l.Menu.Content),Qi=S(l.Menu.Positioner),ea=S(l.Menu.Trigger);function ta({data:e=[],actions:t=[]}){const{columnOrder:n,visibility:r}=Qe(se);return i.jsx(l.Table.Body,{children:e.map(o=>i.jsxs(l.Table.Row,{children:[n.filter(s=>r[s.id]).map(s=>i.jsx(l.Table.Cell,{children:o[s.id]},s.id)),i.jsx(l.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:i.jsxs(l.Menu.Root,{children:[i.jsx(ea,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:i.jsx(mi,{size:16})})}),i.jsx(l.Portal,{children:i.jsx(Qi,{children:i.jsx(Zi,{children:t.map(s=>i.jsxs(Ji,{onClick:()=>s.onClick(o),colorScheme:s.colorScheme,value:s.label,children:[s.icon,s.label]},s.label))})})})]})})]},o.id))})}function na({rows:e=6,columns:t}){return i.jsx(l.Table.Body,{children:Array.from({length:e}).map((n,r)=>i.jsx(l.Table.Row,{children:Array.from({length:t}).map((o,s)=>i.jsx(l.Table.Cell,{children:i.jsx(l.Skeleton,{height:"25px"})},s))},r))})}function ra({tableId:e,data:t=[],headers:n=[],loading:r=!1,loadingChildren:o,skeletonLoading:s=!1,emptyMessage:a="No data",actions:c,page:u=1,pageSize:d=10,onPageChange:f,onPageSizeChange:h,density:y="sm",totalCount:m=0,paginationMode:b="client",actionConfig:p}){g.useEffect(()=>{Zn(e),ao(e)},[e]),g.useEffect(()=>{Jn(t,n)},[t,n]),g.useEffect(()=>{p&&Qn(p)},[p]);const{sortColumn:x,sortDirection:D,data:_,columnOrder:j}=Qe(se),O=g.useMemo(()=>{const k=[..._],M=Math.max(1,u||1);if(x&&k.sort(($,N)=>D==="asc"?String($[x]).localeCompare(String(N[x])):String(N[x]).localeCompare(String($[x]))),b==="client"){const $=(M-1)*d;return k.slice($,$+d)}return k},[_,x,D,u,d,b]);return g.useEffect(()=>{u<1&&f&&f(1)},[u,f]),i.jsxs(l.Box,{h:"100%",display:"flex",flexDirection:"column",p:2,pt:2,minHeight:0,children:[i.jsx(l.Box,{flex:"1",minHeight:0,overflow:"auto",h:"100%",children:i.jsxs(l.Table.Root,{variant:"outline",w:"100%",size:y,h:"100%",children:[i.jsx(zi,{}),r?i.jsx(l.Table.Body,{children:i.jsx(l.Table.Row,{children:i.jsx(l.Table.Cell,{colSpan:j.length+(c?1:0),children:i.jsx(l.Box,{display:"flex",alignItems:"center",justifyContent:"center",h:"100%",w:"100%",children:o??"Loading..."})})})}):s?i.jsx(na,{rows:d,columns:n.length+(c?2:0)}):O.length===0?i.jsx(l.Table.Body,{children:i.jsx(l.Table.Row,{children:i.jsx(l.Table.Cell,{colSpan:n.length+(c?1:0),children:i.jsx(l.Box,{display:"flex",alignItems:"center",justifyContent:"center",minH:"200px",color:"gray.500",children:a})})})}):i.jsx(ta,{data:O,actions:c})]})}),i.jsx(l.Box,{mt:.5,children:i.jsx(Ki,{totalCount:m,pageSize:d,currentPage:u,onPageChange:f,onPageSizeChange:k=>{h&&h(k),u>1&&f&&f(1)}})})]})}const oa=S(l.Checkbox.Root),sa=S(l.Checkbox.HiddenInput),ia=S(l.Checkbox.Control),aa=S(l.Checkbox.Label),jr=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:s,required:a,errorText:c})=>i.jsxs(oa,{value:e,onChange:t,size:n,children:[i.jsx(sa,{}),i.jsx(ia,{disabled:s,required:a,errorText:c,helperText:o}),r&&i.jsx(aa,{children:r})]}),J=" to ",Bn=10,Ee={DAY_MAX:31,MONTH_MAX:12,YEAR_MIN:1900,YEAR_MAX:2100},sn=()=>{const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},Hn=()=>{const{year:e,month:t,day:n}=sn();return`${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}-${e}`},ca=()=>{const{year:e,month:t,day:n}=sn();return`${e}-${String(t).padStart(2,"0")}-${String(n).padStart(2,"0")}`},la=(e,t)=>{const n=e.length,r=parseInt(e);if(!e||isNaN(r))return t;if(n===4)return r>=Ee.YEAR_MIN&&r<=Ee.YEAR_MAX?r:t;if(n>0&&n<4){const o=t.toString(),s=4-n,a=o.substring(0,s);return parseInt(a+e)}return t},Ve=e=>{if(!e?.trim())return null;const n=e.replace(/[^\d-]/g,"").split("-").filter(d=>d!=="");if(n.length===0)return null;const{year:r,month:o,day:s}=sn();let a,c,u;return n.length===1?(a=parseInt(n[0])||s,c=o,u=r):n.length===2?(a=parseInt(n[0])||s,c=parseInt(n[1])||o,u=r):(a=parseInt(n[0])||s,c=parseInt(n[1])||o,u=la(n[2],r)),c=Math.max(1,Math.min(Ee.MONTH_MAX,c)),a=Math.max(1,Math.min(Ee.DAY_MAX,a)),`${u}-${String(c).padStart(2,"0")}-${String(a).padStart(2,"0")}`},ge=e=>{if(!e)return"";const[t,n,r]=e.split("-");return`${r}-${n}-${t}`},ua=(e,t)=>{if(e[0]?.length>0){const n=parseInt(e[0]);if(isNaN(n)||n===0||e[0].length===2&&n>Ee.DAY_MAX)return t}if(e[1]?.length>0){const n=parseInt(e[1]);if(isNaN(n)||n===0||e[1].length===2&&n>Ee.MONTH_MAX)return t}if(e[2]?.length>0){const n=parseInt(e[2]),r=e[2].length===4;if(isNaN(n)||n===0||r&&(n<Ee.YEAR_MIN||n>Ee.YEAR_MAX))return t}return null},We=e=>{let t=e.replace(/[^\d-]/g,"").substring(0,Bn);if(t.length>=3&&t[2]!=="-"&&(t=t.substring(0,2)+"-"+t.substring(2).replace(/-/g,"")),t.length>=6&&t[5]!=="-"){const o=t.split("-");o.length>=2&&(t=`${o[0]}-${o[1].substring(0,2)}-${o[1].substring(2)}${o[2]||""}`)}const n=t.split("-");return n[0]=n[0]?.substring(0,2)||"",n[1]=n[1]?.substring(0,2)||"",n[2]=n[2]?.substring(0,4)||"",t=n.filter(o=>o!=="").join("-"),t=t.substring(0,Bn),ua(n,e)||t},da=S(l.Popover.Root),fa=S(l.Popover.Trigger),ha=S(l.Popover.Content),ga=S(l.Popover.Positioner);function pa({value:e,onChange:t,disabled:n=!1}){const[r="",o=""]=e?e.split("|"):[],[s,a]=g.useState(()=>r&&o?`${ge(r)}${J}${ge(o)}`:r?ge(r):""),[c,u]=g.useState(!1),d=g.useRef(null);g.useEffect(()=>{const b=p=>{p.ctrlKey&&p.key==="d"&&!p.shiftKey&&!p.metaKey&&(p.preventDefault(),d.current?.focus())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]);const f=b=>{let p=b;if(p.includes(J)){const[x,D=""]=p.split(J);p=`${We(x.trim())}${J}${We(D.trim())}`}else if(p.toLowerCase().includes(" to ")){const[x,D=""]=p.split(/\s+to\s+/i);p=`${We(x.trim())} to ${We(D.trim())}`}else p=We(p);a(p)},h=()=>{const b=s.trim();if(!b){t(void 0);return}if(b.includes(J)){const[p,x=""]=b.split(J).map(j=>j.trim()),D=Ve(p),_=x?Ve(x):null;if(D&&_){const[j,O]=_<D?[_,D]:[D,_],k=`${ge(j)}${J}${ge(O)}`;a(k),t(`${j}|${O}`)}else if(D&&!x)a(`${ge(D)}${J}`),t(void 0);else if(D&&x){const j=ca(),[O,k]=j<D?[j,D]:[D,j],M=`${ge(O)}${J}${ge(k)}`;a(M),t(`${O}|${k}`)}else a(""),t(void 0)}else{const p=Ve(b);p?(a(`${ge(p)}${J}`),t(void 0)):(a(""),t(void 0))}},y=b=>{if(b.key!=="Enter")return;b.preventDefault();const p=d.current?.selectionStart||0,x=s.indexOf(J);if(!s.trim()){a(`${Hn()}${J}`);return}if(x===-1){const _=Ve(s.trim());_&&a(`${ge(_)}${J}`);return}if(p<=x+J.length){const _=s.substring(0,x).trim(),j=s.substring(x+J.length),O=Ve(_);O&&a(`${ge(O)}${J}${j}`);return}if(s.substring(x+J.length).trim())h(),d.current?.blur();else{const _=s.substring(0,x+J.length)+Hn();a(_),setTimeout(()=>{h(),d.current?.blur()},0)}},m=()=>{a(""),t(void 0)};return i.jsx(l.InputGroup,{children:i.jsx(i.Fragment,{children:i.jsxs(l.InputElement,{position:"revert",children:[i.jsxs(da,{open:c,onEscapeKeyDown:()=>{u(!1)},children:[i.jsx(fa,{asChild:!0,children:i.jsx(l.IconButton,{size:"sm",variant:"ghost","aria-label":"Date range help",onClick:()=>u(b=>!b),children:i.jsx(Yn,{size:16})})}),i.jsx(l.Portal,{children:i.jsx(ga,{children:i.jsxs(ha,{p:4,children:[i.jsx(l.PopoverArrow,{}),i.jsxs(l.VStack,{align:"start",gap:4,children:[i.jsxs(l.HStack,{children:[i.jsx(Yn,{size:16}),i.jsx(l.Text,{fontWeight:"semibold",fontSize:"sm",children:"Date Range Filter"})]}),i.jsxs(l.VStack,{align:"start",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",fontWeight:"medium",children:"Format:"}),i.jsxs(l.Text,{fontSize:"xs",color:"gray.600",children:["DD-MM-YYYY",J,"DD-MM-YYYY"]})]}),i.jsxs(l.VStack,{align:"start",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",fontWeight:"medium",children:"Tips:"}),i.jsx(l.Text,{fontSize:"xs",children:'• "15 to 20" → assumes current month/year'}),i.jsx(l.Text,{fontSize:"xs",children:"• Leave end blank → up to today"}),i.jsx(l.Text,{fontSize:"xs",children:"• Dates auto-swapped if reversed"}),i.jsx(l.Text,{fontSize:"xs",children:"• Press Enter on empty end → fills today"})]}),i.jsxs(l.VStack,{align:"start",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",fontWeight:"medium",children:"Shortcut:"}),i.jsxs(l.HStack,{children:[i.jsx(l.Kbd,{children:"Ctrl"}),i.jsx(l.Text,{children:"+"}),i.jsx(l.Kbd,{children:"D"})]})]})]})]})})})]}),i.jsx(l.Input,{ref:d,placeholder:"15-06-2025 to 20-06-2025",value:s,size:"sm",disabled:n,onChange:b=>f(b.target.value),onBlur:h,onKeyDown:y,pr:s?"10":void 0,w:"100%"}),s&&i.jsx(l.InputElement,{children:i.jsx(l.IconButton,{size:"sm",variant:"ghost","aria-label":"Clear date range",onClick:m,w:"100%"})})]})})})}const va=S(l.Field.Root),ma=S(l.Field.Label),ba=S(l.Field.HelperText),xa=S(l.Field.ErrorText),qt=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:s="outline",width:a="100%",label:c,helperText:u,isDisabled:d=!1,required:f=!1,errorText:h,visible:y})=>i.jsxs(va,{width:a,children:[y&&i.jsx(ma,{children:c}),i.jsx(l.InputGroup,{startElement:e,children:i.jsx(l.Input,{value:t,onChange:m=>n?.(m.target.value),placeholder:r,size:o,variant:s,disabled:d,required:f})}),h&&i.jsx(xa,{fontSize:"xs",children:h}),u&&i.jsx(ba,{fontSize:"xs",children:u})]}),ya=S(l.Field.Root),Sa=S(l.Field.HelperText),wa=S(l.Field.ErrorText),Da=S(l.Select.Root),Ca=S(l.Select.Label),Ra=S(l.Select.Control),Ta=S(l.Select.Trigger),Ea=S(l.Select.ValueText),ja=S(l.Select.IndicatorGroup),Ma=S(l.Select.Indicator),_a=S(l.Select.Content),Oa=S(l.Select.Item),ka=S(l.Select.ItemIndicator),$a=S(l.Select.HiddenSelect),Ia=S(l.Select.Positioner),Mr=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:s="xs",width:a="100%",variant:c="outline",helperText:u,isDisabled:d,required:f,errorText:h,visible:y})=>{const m=l.createListCollection({items:e});return i.jsxs(ya,{disabled:d,required:f,children:[i.jsxs(Da,{collection:m,variant:c,size:s,width:a,value:n?[n]:[],onValueChange:b=>r?.(b.value[0]),children:[i.jsx($a,{}),y&&i.jsx(Ca,{children:t}),i.jsxs(Ra,{children:[i.jsx(Ta,{children:i.jsx(Ea,{placeholder:o})}),i.jsx(ja,{children:i.jsx(Ma,{})})]}),i.jsx(Ia,{children:i.jsx(_a,{children:m.items.map(b=>i.jsxs(Oa,{item:b,children:[b.label,i.jsx(ka,{})]},b.value))})})]}),u&&i.jsx(Sa,{children:u}),h&&i.jsx(wa,{children:h})]})},_r=e=>`FILTER_PRESETS_${e??"default"}`;function Aa(e){try{return JSON.parse(localStorage.getItem(_r(e))||"[]")}catch{return[]}}const Ze=new Kn({}),Et=e=>{const t=Ze.state[e];if(t)return t;const n=Aa(e);return Ze.setState(r=>({...r,[e]:n})),n},an=(e,t)=>{Ze.setState(n=>({...n,[e]:t})),localStorage.setItem(_r(e),JSON.stringify(t))},Or=(e,t)=>{const n=Et(e).filter(r=>r.id!==t);an(e,n)},kr=(e,t)=>{const n=[t,...Et(e)];an(e,n)},La=S(l.Checkbox.Root),Na=S(l.Checkbox.HiddenInput),za=S(l.Checkbox.Control),Pa=S(l.Slider.Root),Ya=S(l.Slider.Track),Fa=S(l.Slider.Range),Ba=S(l.Slider.Thumbs),Ha=S(l.Slider.Control),Va=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:a,transition:c}=Rr({id:e.id}),u={transform:Ie.Transform.toString(a),transition:c};return i.jsxs(l.VStack,{ref:s,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[i.jsxs(l.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[i.jsx(Er,{size:16}),i.jsx(l.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),i.jsxs(l.HStack,{justify:"space-between",children:[i.jsx(l.Text,{fontSize:"sm",children:"Visible"}),i.jsxs(La,{checked:e.visible,size:"sm",onCheckedChange:d=>t?.(e.id,!!d.checked),children:[i.jsx(Na,{}),i.jsx(za,{})]})]}),i.jsxs(l.VStack,{align:"stretch",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",children:"Size"}),i.jsx(Pa,{min:1,max:5,step:.5,value:[e.size??1],onValueChange:d=>n?.(e.id,d.value[0]),children:i.jsxs(Ha,{children:[i.jsx(Ya,{children:i.jsx(Fa,{})}),i.jsx(Ba,{})]})})]})]})},Wa=S(l.Drawer.Root),Ua=S(l.Drawer.Trigger),Ga=S(l.Drawer.Backdrop),Xa=S(l.Drawer.Positioner),qa=S(l.Drawer.Content),Ka=S(l.Drawer.Header),Ja=S(l.Drawer.Title),Za=S(l.Drawer.Body),Qa=S(l.Drawer.Footer),ec=S(l.Drawer.CloseTrigger),tc=S(l.Tabs.Root),nc=S(l.Tabs.List),Ft=S(l.Tabs.Trigger),Bt=S(l.Tabs.Content),$r=(e,t)=>{if(e.customComponent)return e.customComponent;switch(e.type){case"text":return i.jsx(qt,{placeholder:e.label,value:e.value,onChange:e.onChange,label:e.label,visible:t});case"number":return i.jsx(qt,{label:e.label,value:e.value,onChange:e.onChange});case"checkbox":return i.jsx(jr,{label:e.label,value:e.value,onChange:e.onChange});case"select":return i.jsx(Mr,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t});case"date":return i.jsx(pa,{value:e.value,onChange:e.onChange});default:return null}},rc=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:s="default",currentFilters:a={},onLoadPreset:c,activePresetName:u,onReorder:d,open:f,onOpenChange:h})=>{const m=Qe(Ze)[s]??Et(s),b=()=>{const p=prompt("Preset name?");p&&kr(s,{id:crypto.randomUUID(),name:p,date:new Date().toISOString(),filters:a})};return i.jsx(l.HStack,{wrap:"wrap",children:i.jsxs(Wa,{size:e,open:f,onOpenChange:h,children:[i.jsx(Ua,{asChild:!0,children:i.jsxs(l.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[i.jsx(xi,{size:16}),"Filters"]})}),i.jsxs(l.Portal,{children:[i.jsx(Ga,{}),i.jsx(Xa,{children:i.jsxs(qa,{children:[i.jsx(Ka,{children:i.jsx(Ja,{children:"Filters"})}),i.jsx(Za,{overflowY:"auto",pt:1,children:i.jsxs(tc,{defaultValue:"view",children:[i.jsxs(nc,{mb:4,children:[i.jsxs(Ft,{value:"view",children:[i.jsx(wi,{size:16}),"Edit"]}),i.jsxs(Ft,{value:"settings",children:[i.jsx(Ti,{size:16}),"Settings"]}),i.jsxs(Ft,{value:"presets",children:[i.jsx(ii,{size:16}),"Presets"]})]}),i.jsx(Bt,{value:"view",children:o.filter(p=>p.visible).map(p=>i.jsx(l.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",flex:p.size??1,minW:`${(p.size??1)*100}px`,rounded:"md",p:3,mb:3,children:$r(p,f)},p.id))}),i.jsx(Bt,{value:"settings",children:i.jsx(xr,{sensors:Co(Do(on)),collisionDetection:sr,onDragEnd:({active:p,over:x})=>{if(!x||p.id===x.id)return;const D=o.findIndex(O=>O.id===p.id),_=o.findIndex(O=>O.id===x.id),j=Tt(o,D,_);d?.(j)},children:i.jsx(Dr,{items:o.map(p=>p.id),strategy:Ps,children:o.map(p=>i.jsx(Va,{filter:p,onVisibilityChange:t,onSizeChange:n},p.id))})})}),i.jsx(Bt,{value:"presets",children:i.jsxs(l.VStack,{align:"stretch",mb:3,children:[i.jsx(l.Button,{size:"sm",colorScheme:"blue",onClick:b,children:"Save Current Filters"}),m.length===0&&i.jsx(l.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),m.map(p=>i.jsxs(l.HStack,{justify:"space-between",border:"1px solid",borderColor:u===p.name?"blue.300":"gray.200",rounded:"md",p:2,children:[i.jsxs(l.VStack,{align:"start",gap:0,children:[i.jsx(l.Text,{fontWeight:"bold",fontSize:"sm",children:p.name}),i.jsx(l.Text,{fontSize:"xs",color:"gray.500",children:new Date(p.date).toLocaleDateString()})]}),i.jsxs(l.HStack,{children:[i.jsx(l.Button,{size:"xs",variant:"ghost",onClick:()=>c?.(p.filters,p.name),children:"Load"}),i.jsx(l.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>Or(s,p.id),children:i.jsx(pi,{size:14})})]})]},p.id))]})})]})}),i.jsxs(Qa,{justify:"space-between",children:[i.jsx(l.Button,{size:"sm",variant:"ghost",colorScheme:"red",onClick:()=>r&&r(),children:"Clear All"}),i.jsx(ec,{asChild:!0,children:i.jsx(l.CloseButton,{})})]})]})})]})]})})},oc=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:a,pageKey:c,currentFilters:u,onLoadPreset:d,activePresetName:f,filterDrawerSize:h="sm"})=>{const[y,m]=g.useState(!1);return i.jsxs(l.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,i.jsxs(l.HStack,{gapX:1,children:[t.filter(b=>b.visible!==!1).map(b=>i.jsx(l.HStack,{flex:b.size??1,minW:`${(b.size??1)*100}px`,alignItems:"center",children:$r(b)},b.id)),i.jsx(rc,{filterDrawerSize:h,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:a,pageKey:c,filters:t,currentFilters:u,onLoadPreset:d,activePresetName:f,open:y,onOpenChange:b=>{m(b.open)}})]})]})},sc=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},ic=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}},ac=({onClick:e,size:t="xs",variant:n="solid",label:r,leftIcon:o,rightIcon:s,isDisabled:a,colorScheme:c,loading:u,loadingText:d,rounded:f,type:h="button"})=>i.jsx(l.Button,{onClick:e,size:t,variant:n,disabled:a,colorPalette:c,loading:u,loadingText:d,rounded:f,type:h,children:i.jsxs(l.HStack,{gap:1,children:[o,r,s]})}),cc=S(l.Dialog.Root),lc=S(l.Dialog.Backdrop),uc=S(l.Dialog.Positioner),dc=S(l.Dialog.Content),fc=S(l.Dialog.Header),hc=S(l.Dialog.Body),gc=S(l.Dialog.Footer),pc=S(l.Dialog.Title),vc=S(l.Dialog.CloseTrigger);function mc({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:s="DELETE",confirmLabel:a="Delete",isLoading:c=!1}){const[u,d]=g.useState("");return i.jsx(cc,{open:e,placement:"center",onOpenChange:f=>!f.open&&t(),children:i.jsxs(l.Portal,{children:[i.jsx(lc,{}),i.jsx(uc,{children:i.jsxs(dc,{maxW:"520px",children:[i.jsx(fc,{borderBottom:"1px solid",borderColor:"red.200",boxShadow:"sm",children:i.jsx(pc,{color:"red.600",children:r})}),i.jsx(hc,{children:i.jsxs(l.Stack,{gap:4,boxShadow:"lg",border:"1px solid gray.200",borderRadius:"md",p:4,children:[i.jsx(l.Box,{border:"1px solid",borderColor:"red.200",bg:"red.50",borderRadius:"md",p:4,children:i.jsxs(l.Stack,{direction:"row",gap:3,align:"flex-start",children:[i.jsx(l.Box,{color:"red.600",mt:"2px",children:i.jsx(ji,{size:20})}),i.jsxs(l.Box,{children:[i.jsx(l.Text,{fontWeight:"semibold",color:"red.700",children:"Are you sure?"}),i.jsxs(l.Text,{fontSize:"sm",color:"red.600",children:["All the data of ",i.jsx("b",{children:o})," will permanently be deleted."]})]})]})}),i.jsx(l.Text,{fontSize:"sm",color:"gray.600",children:"You can’t undo this action afterwards."}),i.jsxs(l.Box,{children:[i.jsxs(l.Text,{fontSize:"sm",mb:1,children:["Type ",i.jsx("b",{children:s})," to continue"]}),i.jsx(l.Input,{placeholder:`Type ${s} here`,value:u,onChange:f=>d(f.target.value),size:"xs"})]})]})}),i.jsxs(gc,{justifyContent:"flex-end",gap:3,borderTop:"1px solid",borderColor:"red.200",boxShadow:"lg",children:[i.jsx(l.Button,{variant:"outline",size:"sm",onClick:t,children:"Cancel"}),i.jsx(l.Button,{size:"sm",style:{backgroundColor:"#FF0000"},loading:c,onClick:n,children:a})]}),i.jsx(vc,{asChild:!0,children:i.jsx(l.CloseButton,{size:"sm"})})]})})]})})}function Ir({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=g.useState(!1),s=async()=>{o(!0);try{await e()}finally{setTimeout(()=>o(!1),300)}};return i.jsx(l.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:s,ml:2,children:i.jsx(Ci,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var ht={exports:{}},bc=ht.exports,Vn;function xc(){return Vn||(Vn=1,(function(e,t){(function(n,r){e.exports=r()})(bc,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",a="second",c="minute",u="hour",d="day",f="week",h="month",y="quarter",m="year",b="date",p="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,D=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(I){var R=["th","st","nd","rd"],w=I%100;return"["+I+(R[(w-20)%10]||R[w]||R[0])+"]"}},j=function(I,R,w){var E=String(I);return!E||E.length>=R?I:""+Array(R+1-E.length).join(w)+I},O={s:j,z:function(I){var R=-I.utcOffset(),w=Math.abs(R),E=Math.floor(w/60),T=w%60;return(R<=0?"+":"-")+j(E,2,"0")+":"+j(T,2,"0")},m:function I(R,w){if(R.date()<w.date())return-I(w,R);var E=12*(w.year()-R.year())+(w.month()-R.month()),T=R.clone().add(E,h),L=w-T<0,P=R.clone().add(E+(L?-1:1),h);return+(-(E+(w-T)/(L?T-P:P-T))||0)},a:function(I){return I<0?Math.ceil(I)||0:Math.floor(I)},p:function(I){return{M:h,y:m,w:f,d,D:b,h:u,m:c,s:a,ms:s,Q:y}[I]||String(I||"").toLowerCase().replace(/s$/,"")},u:function(I){return I===void 0}},k="en",M={};M[k]=_;var $="$isDayjsObject",N=function(I){return I instanceof K||!(!I||!I[$])},W=function I(R,w,E){var T;if(!R)return k;if(typeof R=="string"){var L=R.toLowerCase();M[L]&&(T=L),w&&(M[L]=w,T=L);var P=R.split("-");if(!T&&P.length>1)return I(P[0])}else{var v=R.name;M[v]=R,T=v}return!E&&T&&(k=T),T||!E&&k},B=function(I,R){if(N(I))return I.clone();var w=typeof R=="object"?R:{};return w.date=I,w.args=arguments,new K(w)},A=O;A.l=W,A.i=N,A.w=function(I,R){return B(I,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var K=(function(){function I(w){this.$L=W(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[$]=!0}var R=I.prototype;return R.parse=function(w){this.$d=(function(E){var T=E.date,L=E.utc;if(T===null)return new Date(NaN);if(A.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var P=T.match(x);if(P){var v=P[2]-1||0,C=(P[7]||"0").substring(0,3);return L?new Date(Date.UTC(P[1],v,P[3]||1,P[4]||0,P[5]||0,P[6]||0,C)):new Date(P[1],v,P[3]||1,P[4]||0,P[5]||0,P[6]||0,C)}}return new Date(T)})(w),this.init()},R.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},R.$utils=function(){return A},R.isValid=function(){return this.$d.toString()!==p},R.isSame=function(w,E){var T=B(w);return this.startOf(E)<=T&&T<=this.endOf(E)},R.isAfter=function(w,E){return B(w)<this.startOf(E)},R.isBefore=function(w,E){return this.endOf(E)<B(w)},R.$g=function(w,E,T){return A.u(w)?this[E]:this.set(T,w)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(w,E){var T=this,L=!!A.u(E)||E,P=A.p(w),v=function(q,Y){var ie=A.w(T.$u?Date.UTC(T.$y,Y,q):new Date(T.$y,Y,q),T);return L?ie:ie.endOf(d)},C=function(q,Y){return A.w(T.toDate()[q].apply(T.toDate("s"),(L?[0,0,0,0]:[23,59,59,999]).slice(Y)),T)},z=this.$W,F=this.$M,U=this.$D,G="set"+(this.$u?"UTC":"");switch(P){case m:return L?v(1,0):v(31,11);case h:return L?v(1,F):v(0,F+1);case f:var H=this.$locale().weekStart||0,X=(z<H?z+7:z)-H;return v(L?U-X:U+(6-X),F);case d:case b:return C(G+"Hours",0);case u:return C(G+"Minutes",1);case c:return C(G+"Seconds",2);case a:return C(G+"Milliseconds",3);default:return this.clone()}},R.endOf=function(w){return this.startOf(w,!1)},R.$set=function(w,E){var T,L=A.p(w),P="set"+(this.$u?"UTC":""),v=(T={},T[d]=P+"Date",T[b]=P+"Date",T[h]=P+"Month",T[m]=P+"FullYear",T[u]=P+"Hours",T[c]=P+"Minutes",T[a]=P+"Seconds",T[s]=P+"Milliseconds",T)[L],C=L===d?this.$D+(E-this.$W):E;if(L===h||L===m){var z=this.clone().set(b,1);z.$d[v](C),z.init(),this.$d=z.set(b,Math.min(this.$D,z.daysInMonth())).$d}else v&&this.$d[v](C);return this.init(),this},R.set=function(w,E){return this.clone().$set(w,E)},R.get=function(w){return this[A.p(w)]()},R.add=function(w,E){var T,L=this;w=Number(w);var P=A.p(E),v=function(F){var U=B(L);return A.w(U.date(U.date()+Math.round(F*w)),L)};if(P===h)return this.set(h,this.$M+w);if(P===m)return this.set(m,this.$y+w);if(P===d)return v(1);if(P===f)return v(7);var C=(T={},T[c]=r,T[u]=o,T[a]=n,T)[P]||1,z=this.$d.getTime()+w*C;return A.w(z,this)},R.subtract=function(w,E){return this.add(-1*w,E)},R.format=function(w){var E=this,T=this.$locale();if(!this.isValid())return T.invalidDate||p;var L=w||"YYYY-MM-DDTHH:mm:ssZ",P=A.z(this),v=this.$H,C=this.$m,z=this.$M,F=T.weekdays,U=T.months,G=T.meridiem,H=function(Y,ie,ne,he){return Y&&(Y[ie]||Y(E,L))||ne[ie].slice(0,he)},X=function(Y){return A.s(v%12||12,Y,"0")},q=G||function(Y,ie,ne){var he=Y<12?"AM":"PM";return ne?he.toLowerCase():he};return L.replace(D,(function(Y,ie){return ie||(function(ne){switch(ne){case"YY":return String(E.$y).slice(-2);case"YYYY":return A.s(E.$y,4,"0");case"M":return z+1;case"MM":return A.s(z+1,2,"0");case"MMM":return H(T.monthsShort,z,U,3);case"MMMM":return H(U,z);case"D":return E.$D;case"DD":return A.s(E.$D,2,"0");case"d":return String(E.$W);case"dd":return H(T.weekdaysMin,E.$W,F,2);case"ddd":return H(T.weekdaysShort,E.$W,F,3);case"dddd":return F[E.$W];case"H":return String(v);case"HH":return A.s(v,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return q(v,C,!0);case"A":return q(v,C,!1);case"m":return String(C);case"mm":return A.s(C,2,"0");case"s":return String(E.$s);case"ss":return A.s(E.$s,2,"0");case"SSS":return A.s(E.$ms,3,"0");case"Z":return P}return null})(Y)||P.replace(":","")}))},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(w,E,T){var L,P=this,v=A.p(E),C=B(w),z=(C.utcOffset()-this.utcOffset())*r,F=this-C,U=function(){return A.m(P,C)};switch(v){case m:L=U()/12;break;case h:L=U();break;case y:L=U()/3;break;case f:L=(F-z)/6048e5;break;case d:L=(F-z)/864e5;break;case u:L=F/o;break;case c:L=F/r;break;case a:L=F/n;break;default:L=F}return T?L:A.a(L)},R.daysInMonth=function(){return this.endOf(h).$D},R.$locale=function(){return M[this.$L]},R.locale=function(w,E){if(!w)return this.$L;var T=this.clone(),L=W(w,E,!0);return L&&(T.$L=L),T},R.clone=function(){return A.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},I})(),ee=K.prototype;return B.prototype=ee,[["$ms",s],["$s",a],["$m",c],["$H",u],["$W",d],["$M",h],["$y",m],["$D",b]].forEach((function(I){ee[I[1]]=function(R){return this.$g(R,I[0],I[1])}})),B.extend=function(I,R){return I.$i||(I(R,K,B),I.$i=!0),B},B.locale=W,B.isDayjs=N,B.unix=function(I){return B(1e3*I)},B.en=M[k],B.Ls=M,B.p={},B}))})(ht)),ht.exports}var yc=xc();const jt=wt(yc);var gt={exports:{}},Sc=gt.exports,Wn;function wc(){return Wn||(Wn=1,(function(e,t){(function(n,r){e.exports=r()})(Sc,(function(){return function(n,r,o){n=n||{};var s=r.prototype,a={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function c(d,f,h,y){return s.fromToBase(d,f,h,y)}o.en.relativeTime=a,s.fromToBase=function(d,f,h,y,m){for(var b,p,x,D=h.$locale().relativeTime||a,_=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],j=_.length,O=0;O<j;O+=1){var k=_[O];k.d&&(b=y?o(d).diff(h,k.d,!0):h.diff(d,k.d,!0));var M=(n.rounding||Math.round)(Math.abs(b));if(x=b>0,M<=k.r||!k.r){M<=1&&O>0&&(k=_[O-1]);var $=D[k.l];m&&(M=m(""+M)),p=typeof $=="string"?$.replace("%d",M):$(M,f,k.l,x);break}}if(f)return p;var N=x?D.future:D.past;return typeof N=="function"?N(p):N.replace("%s",p)},s.to=function(d,f){return c(d,f,this,!0)},s.from=function(d,f){return c(d,f,this)};var u=function(d){return d.$u?o.utc():o()};s.toNow=function(d){return this.to(u(this),d)},s.fromNow=function(d){return this.from(u(this),d)}}}))})(gt)),gt.exports}var Dc=wc();const Cc=wt(Dc);var pt={exports:{}},Rc=pt.exports,Un;function Tc(){return Un||(Un=1,(function(e,t){(function(n,r){e.exports=r()})(Rc,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,s){var a=o.prototype,c=a.format;s.en.formats=n,a.format=function(u){u===void 0&&(u="YYYY-MM-DDTHH:mm:ssZ");var d=this.$locale().formats,f=(function(h,y){return h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(m,b,p){var x=p&&p.toUpperCase();return b||y[p]||n[p]||y[x].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(D,_,j){return _||j.slice(1)}))}))})(u,d===void 0?{}:d);return c.call(this,f)}}}))})(pt)),pt.exports}var Ec=Tc();const jc=wt(Ec);var vt={exports:{}},Mc=vt.exports,Gn;function _c(){return Gn||(Gn=1,(function(e,t){(function(n,r){e.exports=r()})(Mc,(function(){return function(n,r){var o=r.prototype,s=o.format;o.format=function(a){var c=this,u=this.$locale();if(!this.isValid())return s.bind(this)(a);var d=this.$utils(),f=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(h){switch(h){case"Q":return Math.ceil((c.$M+1)/3);case"Do":return u.ordinal(c.$D);case"gggg":return c.weekYear();case"GGGG":return c.isoWeekYear();case"wo":return u.ordinal(c.week(),"W");case"w":case"ww":return d.s(c.week(),h==="w"?1:2,"0");case"W":case"WW":return d.s(c.isoWeek(),h==="W"?1:2,"0");case"k":case"kk":return d.s(String(c.$H===0?24:c.$H),h==="k"?1:2,"0");case"X":return Math.floor(c.$d.getTime()/1e3);case"x":return c.$d.getTime();case"z":return"["+c.offsetName()+"]";case"zzz":return"["+c.offsetName("long")+"]";default:return h}}));return s.bind(this)(f)}}}))})(vt)),vt.exports}var Oc=_c();const kc=wt(Oc);jt.extend(Cc);jt.extend(jc);jt.extend(kc);const $c={date:"DD MMM YYYY",time:"hh:mm A",dateTime:"DD MMM YYYY, hh:mm A",full:"dddd, DD MMM YYYY, hh:mm A",short:"DD/MM/YY",relative:""};function Kt({value:e,variant:t="dateTime",format:n,fallback:r="--"}){if(!e)return r;const o=jt(e);return o.isValid()?t==="relative"?o.fromNow():o.format(n??$c[t]):r}function Ic({value:e,dateVariant:t="date",timeVariant:n="time",dateFormat:r,timeFormat:o,align:s="start"}){return i.jsxs(l.Stack,{gap:.5,align:s,children:[i.jsx(l.Text,{fontSize:"sm",fontWeight:"500",children:Kt({value:e,variant:t,format:r})}),i.jsx(l.Text,{fontSize:"xs",color:"gray.500",children:Kt({value:e,variant:n,format:o})})]})}exports.DataTable=ra;exports.Filters=oc;exports.MDSButton=ac;exports.MDSCheckbox=jr;exports.MDSConfirmDeleteDialog=mc;exports.MDSInput=qt;exports.MDSRefreshButton=Ir;exports.MDSSelectBox=Mr;exports.RefreshButton=Ir;exports.StackedDateTime=Ic;exports.addPreset=kr;exports.deletePreset=Or;exports.formatDateTime=Kt;exports.getPresets=Et;exports.loadOrder=ic;exports.presetStore=Ze;exports.saveOrder=sc;exports.savePresets=an;exports.setActionsConfig=Qn;exports.setData=Jn;exports.setTableId=Zn;exports.tableStore=se;exports.withChildren=S;
10
+ `},vo={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function mo(e){let{announcements:t=vo,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=po}=e;const{announce:s,announcement:a}=fo(),c=nt("DndLiveRegion"),[l,d]=g.useState(!1);if(g.useEffect(()=>{d(!0)},[]),ho(g.useMemo(()=>({onDragStart(h){let{active:y}=h;s(t.onDragStart({active:y}))},onDragMove(h){let{active:y,over:v}=h;t.onDragMove&&s(t.onDragMove({active:y,over:v}))},onDragOver(h){let{active:y,over:v}=h;s(t.onDragOver({active:y,over:v}))},onDragEnd(h){let{active:y,over:v}=h;s(t.onDragEnd({active:y,over:v}))},onDragCancel(h){let{active:y,over:v}=h;s(t.onDragCancel({active:y,over:v}))}}),[s,t])),!l)return null;const f=g.createElement(g.Fragment,null,g.createElement(lo,{id:r,value:o.draggable}),g.createElement(uo,{id:c,announcement:a}));return n?Ue.createPortal(f,n):f}var Z;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Z||(Z={}));function St(){}function bo(e,t){return g.useMemo(()=>({sensor:e,options:{}}),[e,t])}function xo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const pe=Object.freeze({x:0,y:0});function yo(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function So(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function wo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Do(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function jn(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Qn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=jn(t,t.left,t.top),s=[];for(const a of r){const{id:c}=a,l=n.get(c);if(l){const d=yo(jn(l),o);s.push({id:c,data:{droppableContainer:a,value:d}})}}return s.sort(So)};function Co(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),a=o-r,c=s-n;if(r<o&&n<s){const l=t.width*t.height,d=e.width*e.height,f=a*c,h=f/(l+d-f);return Number(h.toFixed(4))}return 0}const Ro=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:a}=s,c=n.get(a);if(c){const l=Co(c,t);l>0&&o.push({id:a,data:{droppableContainer:s,value:l}})}}return o.sort(wo)};function Eo(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function er(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pe}function To(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((a,c)=>({...a,top:a.top+e*c.y,bottom:a.bottom+e*c.y,left:a.left+e*c.x,right:a.right+e*c.x}),{...n})}}const jo=To(1);function Mo(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function _o(e,t,n){const r=Mo(t);if(!r)return e;const{scaleX:o,scaleY:s,x:a,y:c}=r,l=e.left-a-(1-o)*parseFloat(n),d=e.top-c-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,h=s?e.height/s:e.height;return{width:f,height:h,top:d,right:l+f,bottom:d+h,left:l}}const Oo={ignoreTransform:!1};function Ne(e,t){t===void 0&&(t=Oo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:f}=ae(e).getComputedStyle(e);d&&(n=_o(n,d,f))}const{top:r,left:o,width:s,height:a,bottom:c,right:l}=n;return{top:r,left:o,width:s,height:a,bottom:c,right:l}}function Mn(e){return Ne(e,{ignoreTransform:!0})}function ko(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function $o(e,t){return t===void 0&&(t=ae(e).getComputedStyle(e)),t.position==="fixed"}function Io(e,t){t===void 0&&(t=ae(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function nn(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Qt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!et(o)||Kn(o)||n.includes(o))return n;const s=ae(e).getComputedStyle(o);return o!==e&&Io(o,s)&&n.push(o),$o(o,s)?n:r(o.parentNode)}return e?r(e):n}function tr(e){const[t]=nn(e,1);return t??null}function Pt(e){return!Ct||!e?null:Ae(e)?e:Zt(e)?Qt(e)||e===Le(e).scrollingElement?window:et(e)?e:null:null}function nr(e){return Ae(e)?e.scrollX:e.scrollLeft}function rr(e){return Ae(e)?e.scrollY:e.scrollTop}function Gt(e){return{x:nr(e),y:rr(e)}}var Q;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Q||(Q={}));function or(e){return!Ct||!e?!1:e===document.scrollingElement}function sr(e){const t={x:0,y:0},n=or(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:a,isRight:c,maxScroll:r,minScroll:t}}const Ao={x:.2,y:.2};function Lo(e,t,n,r,o){let{top:s,left:a,right:c,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=Ao);const{isTop:d,isBottom:f,isLeft:h,isRight:y}=sr(e),v={x:0,y:0},m={x:0,y:0},b={height:t.height*o.y,width:t.width*o.x};return!d&&s<=t.top+b.height?(v.y=Q.Backward,m.y=r*Math.abs((t.top+b.height-s)/b.height)):!f&&l>=t.bottom-b.height&&(v.y=Q.Forward,m.y=r*Math.abs((t.bottom-b.height-l)/b.height)),!y&&c>=t.right-b.width?(v.x=Q.Forward,m.x=r*Math.abs((t.right-b.width-c)/b.width)):!h&&a<=t.left+b.width&&(v.x=Q.Backward,m.x=r*Math.abs((t.left+b.width-a)/b.width)),{direction:v,speed:m}}function No(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:a}=window;return{top:0,left:0,right:s,bottom:a,width:s,height:a}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function ir(e){return e.reduce((t,n)=>$e(t,Gt(n)),pe)}function zo(e){return e.reduce((t,n)=>t+nr(n),0)}function Po(e){return e.reduce((t,n)=>t+rr(n),0)}function Yo(e,t){if(t===void 0&&(t=Ne),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);tr(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Fo=[["x",["left","right"],zo],["y",["top","bottom"],Po]];class rn{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=nn(n),o=ir(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,c]of Fo)for(const l of a)Object.defineProperty(this,l,{get:()=>{const d=c(r),f=o[s]-d;return this.rect[l]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ge{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function Bo(e){const{EventTarget:t}=ae(e);return e instanceof t?e:Le(e)}function Yt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var fe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(fe||(fe={}));function _n(e){e.preventDefault()}function Ho(e){e.stopPropagation()}var W;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(W||(W={}));const ar={start:[W.Space,W.Enter],cancel:[W.Esc],end:[W.Space,W.Enter,W.Tab]},Vo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case W.Right:return{...n,x:n.x+25};case W.Left:return{...n,x:n.x-25};case W.Down:return{...n,y:n.y+25};case W.Up:return{...n,y:n.y-25}}};class cr{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ge(Le(n)),this.windowListeners=new Ge(ae(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(fe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Yo(r),n(pe)}handleKeyDown(t){if(tn(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=ar,coordinateGetter:a=Vo,scrollBehavior:c="smooth"}=o,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:d}=r.current,f=d?{x:d.left,y:d.top}:pe;this.referenceCoordinates||(this.referenceCoordinates=f);const h=a(t,{active:n,context:r.current,currentCoordinates:f});if(h){const y=yt(h,f),v={x:0,y:0},{scrollableAncestors:m}=r.current;for(const b of m){const x=t.code,{isTop:S,isRight:_,isLeft:j,isBottom:O,maxScroll:k,minScroll:T}=sr(b),$=No(b),A={x:Math.min(x===W.Right?$.right-$.width/2:$.right,Math.max(x===W.Right?$.left:$.left+$.width/2,h.x)),y:Math.min(x===W.Down?$.bottom-$.height/2:$.bottom,Math.max(x===W.Down?$.top:$.top+$.height/2,h.y))},H=x===W.Right&&!_||x===W.Left&&!j,B=x===W.Down&&!O||x===W.Up&&!S;if(H&&A.x!==h.x){const L=b.scrollLeft+y.x,K=x===W.Right&&L<=k.x||x===W.Left&&L>=T.x;if(K&&!y.y){b.scrollTo({left:L,behavior:c});return}K?v.x=b.scrollLeft-L:v.x=x===W.Right?b.scrollLeft-k.x:b.scrollLeft-T.x,v.x&&b.scrollBy({left:-v.x,behavior:c});break}else if(B&&A.y!==h.y){const L=b.scrollTop+y.y,K=x===W.Down&&L<=k.y||x===W.Up&&L>=T.y;if(K&&!y.x){b.scrollTo({top:L,behavior:c});return}K?v.y=b.scrollTop-L:v.y=x===W.Down?b.scrollTop-k.y:b.scrollTop-T.y,v.y&&b.scrollBy({top:-v.y,behavior:c});break}}this.handleMove(t,$e(yt(h,this.referenceCoordinates),v))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}cr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=ar,onActivation:o}=t,{active:s}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const c=s.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function On(e){return!!(e&&"distance"in e)}function kn(e){return!!(e&&"delay"in e)}class on{constructor(t,n,r){var o;r===void 0&&(r=Bo(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:a}=s;this.props=t,this.events=n,this.document=Le(a),this.documentListeners=new Ge(this.document),this.listeners=new Ge(r),this.windowListeners=new Ge(ae(a)),this.initialCoordinates=(o=Ut(s))!=null?o:pe,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(fe.Resize,this.handleCancel),this.windowListeners.add(fe.DragStart,_n),this.windowListeners.add(fe.VisibilityChange,this.handleCancel),this.windowListeners.add(fe.ContextMenu,_n),this.documentListeners.add(fe.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(kn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(On(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(fe.Click,Ho,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(fe.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:a,options:{activationConstraint:c}}=s;if(!o)return;const l=(n=Ut(t))!=null?n:pe,d=yt(o,l);if(!r&&c){if(On(c)){if(c.tolerance!=null&&Yt(d,c.tolerance))return this.handleCancel();if(Yt(d,c.distance))return this.handleStart()}if(kn(c)&&Yt(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===W.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Wo={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class sn extends on{constructor(t){const{event:n}=t,r=Le(n.target);super(t,Wo,r)}}sn.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const Uo={move:{name:"mousemove"},end:{name:"mouseup"}};var Xt;(function(e){e[e.RightClick=2]="RightClick"})(Xt||(Xt={}));class Go extends on{constructor(t){super(t,Uo,Le(t.event.target))}}Go.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Xt.RightClick?!1:(r?.({event:n}),!0)}}];const Ft={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Xo extends on{constructor(t){super(t,Ft)}static setup(){return window.addEventListener(Ft.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ft.move.name,t)};function t(){}}}Xo.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r?.({event:n}),!0)}}];var Xe;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Xe||(Xe={}));var wt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(wt||(wt={}));function qo(e){let{acceleration:t,activator:n=Xe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:a=5,order:c=wt.TreeOrder,pointerCoordinates:l,scrollableAncestors:d,scrollableAncestorRects:f,delta:h,threshold:y}=e;const v=Jo({delta:h,disabled:!s}),[m,b]=oo(),x=g.useRef({x:0,y:0}),S=g.useRef({x:0,y:0}),_=g.useMemo(()=>{switch(n){case Xe.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Xe.DraggableRect:return o}},[n,o,l]),j=g.useRef(null),O=g.useCallback(()=>{const T=j.current;if(!T)return;const $=x.current.x*S.current.x,A=x.current.y*S.current.y;T.scrollBy($,A)},[]),k=g.useMemo(()=>c===wt.TreeOrder?[...d].reverse():d,[c,d]);g.useEffect(()=>{if(!s||!d.length||!_){b();return}for(const T of k){if(r?.(T)===!1)continue;const $=d.indexOf(T),A=f[$];if(!A)continue;const{direction:H,speed:B}=Lo(T,A,_,t,y);for(const L of["x","y"])v[L][H[L]]||(B[L]=0,H[L]=0);if(B.x>0||B.y>0){b(),j.current=T,m(O,a),x.current=B,S.current=H;return}}x.current={x:0,y:0},S.current={x:0,y:0},b()},[t,O,r,b,s,a,JSON.stringify(_),JSON.stringify(v),m,d,k,f,JSON.stringify(y)])}const Ko={x:{[Q.Backward]:!1,[Q.Forward]:!1},y:{[Q.Backward]:!1,[Q.Forward]:!1}};function Jo(e){let{delta:t,disabled:n}=e;const r=Wt(t);return tt(o=>{if(n||!r||!o)return Ko;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Q.Backward]:o.x[Q.Backward]||s.x===-1,[Q.Forward]:o.x[Q.Forward]||s.x===1},y:{[Q.Backward]:o.y[Q.Backward]||s.y===-1,[Q.Forward]:o.y[Q.Forward]||s.y===1}}},[n,t,r])}function Zo(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return tt(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Qo(e,t){return g.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...s]},[]),[e,t])}var Je;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Je||(Je={}));var qt;(function(e){e.Optimized="optimized"})(qt||(qt={}));const $n=new Map;function es(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,a]=g.useState(null),{frequency:c,measure:l,strategy:d}=o,f=g.useRef(e),h=x(),y=Ke(h),v=g.useCallback(function(S){S===void 0&&(S=[]),!y.current&&a(_=>_===null?S:_.concat(S.filter(j=>!_.includes(j))))},[y]),m=g.useRef(null),b=tt(S=>{if(h&&!n)return $n;if(!S||S===$n||f.current!==e||s!=null){const _=new Map;for(let j of e){if(!j)continue;if(s&&s.length>0&&!s.includes(j.id)&&j.rect.current){_.set(j.id,j.rect.current);continue}const O=j.node.current,k=O?new rn(l(O),O):null;j.rect.current=k,k&&_.set(j.id,k)}return _}return S},[e,s,n,h,l]);return g.useEffect(()=>{f.current=e},[e]),g.useEffect(()=>{h||v()},[n,h]),g.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),g.useEffect(()=>{h||typeof c!="number"||m.current!==null||(m.current=setTimeout(()=>{v(),m.current=null},c))},[c,h,v,...r]),{droppableRects:b,measureDroppableContainers:v,measuringScheduled:s!=null};function x(){switch(d){case Je.Always:return!1;case Je.BeforeDragging:return n;default:return!n}}}function lr(e,t){return tt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function ts(e,t){return lr(e,t)}function ns(e){let{callback:t,disabled:n}=e;const r=en(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return g.useEffect(()=>()=>o?.disconnect(),[o]),o}function Rt(e){let{callback:t,disabled:n}=e;const r=en(t),o=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return g.useEffect(()=>()=>o?.disconnect(),[o]),o}function rs(e){return new rn(Ne(e),e)}function In(e,t,n){t===void 0&&(t=rs);const[r,o]=g.useState(null);function s(){o(l=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=l??n)!=null?d:null}const f=t(e);return JSON.stringify(l)===JSON.stringify(f)?l:f})}const a=ns({callback(l){if(e)for(const d of l){const{type:f,target:h}=d;if(f==="childList"&&h instanceof HTMLElement&&h.contains(e)){s();break}}}}),c=Rt({callback:s});return be(()=>{s(),e?(c?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(c?.disconnect(),a?.disconnect())},[e]),r}function os(e){const t=lr(e);return er(e,t)}const An=[];function ss(e){const t=g.useRef(e),n=tt(r=>e?r&&r!==An&&e&&t.current&&e.parentNode===t.current.parentNode?r:nn(e):An,[e]);return g.useEffect(()=>{t.current=e},[e]),n}function is(e){const[t,n]=g.useState(null),r=g.useRef(e),o=g.useCallback(s=>{const a=Pt(s.target);a&&n(c=>c?(c.set(a,Gt(a)),new Map(c)):null)},[]);return g.useEffect(()=>{const s=r.current;if(e!==s){a(s);const c=e.map(l=>{const d=Pt(l);return d?(d.addEventListener("scroll",o,{passive:!0}),[d,Gt(d)]):null}).filter(l=>l!=null);n(c.length?new Map(c):null),r.current=e}return()=>{a(e),a(s)};function a(c){c.forEach(l=>{const d=Pt(l);d?.removeEventListener("scroll",o)})}},[o,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>$e(s,a),pe):ir(e):pe,[e,t])}function Ln(e,t){t===void 0&&(t=[]);const n=g.useRef(null);return g.useEffect(()=>{n.current=null},t),g.useEffect(()=>{const r=e!==pe;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?yt(e,n.current):pe}function as(e){g.useEffect(()=>{if(!Ct)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function cs(e,t){return g.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=a=>{s(a,t)},n},{}),[e,t])}function ur(e){return g.useMemo(()=>e?ko(e):null,[e])}const Nn=[];function ls(e,t){t===void 0&&(t=Ne);const[n]=e,r=ur(n?ae(n):null),[o,s]=g.useState(Nn);function a(){s(()=>e.length?e.map(l=>or(l)?r:new rn(t(l),l)):Nn)}const c=Rt({callback:a});return be(()=>{c?.disconnect(),a(),e.forEach(l=>c?.observe(l))},[e]),o}function us(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return et(t)?t:e}function ds(e){let{measure:t}=e;const[n,r]=g.useState(null),o=g.useCallback(d=>{for(const{target:f}of d)if(et(f)){r(h=>{const y=t(f);return h?{...h,width:y.width,height:y.height}:y});break}},[t]),s=Rt({callback:o}),a=g.useCallback(d=>{const f=us(d);s?.disconnect(),f&&s?.observe(f),r(f?t(f):null)},[t,s]),[c,l]=xt(a);return g.useMemo(()=>({nodeRef:c,rect:n,setRef:l}),[n,c,l])}const fs=[{sensor:sn,options:{}},{sensor:cr,options:{}}],hs={current:{}},ht={draggable:{measure:Mn},droppable:{measure:Mn,strategy:Je.WhileDragging,frequency:qt.Optimized},dragOverlay:{measure:Ne}};class qe extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const gs={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new qe,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:St},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ht,measureDroppableContainers:St,windowRect:null,measuringScheduled:!1},ps={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:St,draggableNodes:new Map,over:null,measureDroppableContainers:St},Et=g.createContext(ps),dr=g.createContext(gs);function vs(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new qe}}}function ms(e,t){switch(t.type){case Z.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Z.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Z.DragEnd:case Z.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Z.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new qe(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case Z.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const a=new qe(e.droppable.containers);return a.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:a}}}case Z.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new qe(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function bs(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=g.useContext(Et),s=Wt(r),a=Wt(n?.id);return g.useEffect(()=>{if(!t&&!r&&s&&a!=null){if(!tn(s)||document.activeElement===s.target)return;const c=o.get(a);if(!c)return;const{activatorNode:l,node:d}=c;if(!l.current&&!d.current)return;requestAnimationFrame(()=>{for(const f of[l.current,d.current]){if(!f)continue;const h=ao(f);if(h){h.focus();break}}})}},[r,t,o,a,s]),null}function xs(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function ys(e){return g.useMemo(()=>({draggable:{...ht.draggable,...e?.draggable},droppable:{...ht.droppable,...e?.droppable},dragOverlay:{...ht.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Ss(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=g.useRef(!1),{x:a,y:c}=typeof o=="boolean"?{x:o,y:o}:o;be(()=>{if(!a&&!c||!t){s.current=!1;return}if(s.current||!r)return;const d=t?.node.current;if(!d||d.isConnected===!1)return;const f=n(d),h=er(f,r);if(a||(h.x=0),c||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const y=tr(d);y&&y.scrollBy({top:h.y,left:h.x})}},[t,a,c,r,n])}const fr=g.createContext({...pe,scaleX:1,scaleY:1});var Ee;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Ee||(Ee={}));const hr=g.memo(function(t){var n,r,o,s;let{id:a,accessibility:c,autoScroll:l=!0,children:d,sensors:f=fs,collisionDetection:h=Ro,measuring:y,modifiers:v,...m}=t;const b=g.useReducer(ms,void 0,vs),[x,S]=b,[_,j]=go(),[O,k]=g.useState(Ee.Uninitialized),T=O===Ee.Initialized,{draggable:{active:$,nodes:A,translate:H},droppable:{containers:B}}=x,L=$!=null?A.get($):null,K=g.useRef({initial:null,translated:null}),ee=g.useMemo(()=>{var re;return $!=null?{id:$,data:(re=L?.data)!=null?re:hs,rect:K}:null},[$,L]),I=g.useRef(null),[R,D]=g.useState(null),[M,E]=g.useState(null),N=Ke(m,Object.values(m)),P=nt("DndDescribedBy",a),p=g.useMemo(()=>B.getEnabled(),[B]),C=ys(y),{droppableRects:z,measureDroppableContainers:F,measuringScheduled:U}=es(p,{dragging:T,dependencies:[H.x,H.y],config:C.droppable}),G=Zo(A,$),V=g.useMemo(()=>M?Ut(M):null,[M]),X=Fr(),q=ts(G,C.draggable.measure);Ss({activeNode:$!=null?A.get($):null,config:X.layoutShiftCompensation,initialRect:q,measure:C.draggable.measure});const Y=In(G,C.draggable.measure,q),se=In(G?G.parentElement:null),ne=g.useRef({activatorEvent:null,active:null,activeNode:G,collisionRect:null,collisions:null,droppableRects:z,draggableNodes:A,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=B.getNodeFor((n=ne.current.over)==null?void 0:n.id),xe=ds({measure:C.dragOverlay.measure}),je=(r=xe.nodeRef.current)!=null?r:G,Me=T?(o=xe.rect)!=null?o:Y:null,cn=!!(xe.nodeRef.current&&xe.rect),ln=os(cn?null:Y),_t=ur(je?ae(je):null),Se=ss(T?he??G:null),ot=ls(Se),st=xs(v,{transform:{x:H.x-ln.x,y:H.y-ln.y,scaleX:1,scaleY:1},activatorEvent:M,active:ee,activeNodeRect:Y,containerNodeRect:se,draggingNodeRect:Me,over:ne.current.over,overlayNodeRect:xe.rect,scrollableAncestors:Se,scrollableAncestorRects:ot,windowRect:_t}),un=V?$e(V,H):null,dn=is(Se),Ir=Ln(dn),Ar=Ln(dn,[Y]),_e=$e(st,Ir),Oe=Me?jo(Me,st):null,ze=ee&&Oe?h({active:ee,collisionRect:Oe,droppableRects:z,droppableContainers:p,pointerCoordinates:un}):null,fn=Do(ze,"id"),[we,hn]=g.useState(null),Lr=cn?st:$e(st,Ar),Nr=Eo(Lr,(s=we?.rect)!=null?s:null,Y),Ot=g.useRef(null),gn=g.useCallback((re,ce)=>{let{sensor:le,options:De}=ce;if(I.current==null)return;const de=A.get(I.current);if(!de)return;const ue=re.nativeEvent,ve=new le({active:I.current,activeNode:de,event:ue,options:De,context:ne,onAbort(te){if(!A.get(te))return;const{onDragAbort:me}=N.current,ye={id:te};me?.(ye),_({type:"onDragAbort",event:ye})},onPending(te,Ce,me,ye){if(!A.get(te))return;const{onDragPending:Ye}=N.current,Re={id:te,constraint:Ce,initialCoordinates:me,offset:ye};Ye?.(Re),_({type:"onDragPending",event:Re})},onStart(te){const Ce=I.current;if(Ce==null)return;const me=A.get(Ce);if(!me)return;const{onDragStart:ye}=N.current,Pe={activatorEvent:ue,active:{id:Ce,data:me.data,rect:K}};Ue.unstable_batchedUpdates(()=>{ye?.(Pe),k(Ee.Initializing),S({type:Z.DragStart,initialCoordinates:te,active:Ce}),_({type:"onDragStart",event:Pe}),D(Ot.current),E(ue)})},onMove(te){S({type:Z.DragMove,coordinates:te})},onEnd:ke(Z.DragEnd),onCancel:ke(Z.DragCancel)});Ot.current=ve;function ke(te){return async function(){const{active:me,collisions:ye,over:Pe,scrollAdjustedTranslate:Ye}=ne.current;let Re=null;if(me&&Ye){const{cancelDrop:Fe}=N.current;Re={activatorEvent:ue,active:me,collisions:ye,delta:Ye,over:Pe},te===Z.DragEnd&&typeof Fe=="function"&&await Promise.resolve(Fe(Re))&&(te=Z.DragCancel)}I.current=null,Ue.unstable_batchedUpdates(()=>{S({type:te}),k(Ee.Uninitialized),hn(null),D(null),E(null),Ot.current=null;const Fe=te===Z.DragEnd?"onDragEnd":"onDragCancel";if(Re){const kt=N.current[Fe];kt?.(Re),_({type:Fe,event:Re})}})}}},[A]),zr=g.useCallback((re,ce)=>(le,De)=>{const de=le.nativeEvent,ue=A.get(De);if(I.current!==null||!ue||de.dndKit||de.defaultPrevented)return;const ve={active:ue};re(le,ce.options,ve)===!0&&(de.dndKit={capturedBy:ce.sensor},I.current=De,gn(le,ce))},[A,gn]),pn=Qo(f,zr);as(f),be(()=>{Y&&O===Ee.Initializing&&k(Ee.Initialized)},[Y,O]),g.useEffect(()=>{const{onDragMove:re}=N.current,{active:ce,activatorEvent:le,collisions:De,over:de}=ne.current;if(!ce||!le)return;const ue={active:ce,activatorEvent:le,collisions:De,delta:{x:_e.x,y:_e.y},over:de};Ue.unstable_batchedUpdates(()=>{re?.(ue),_({type:"onDragMove",event:ue})})},[_e.x,_e.y]),g.useEffect(()=>{const{active:re,activatorEvent:ce,collisions:le,droppableContainers:De,scrollAdjustedTranslate:de}=ne.current;if(!re||I.current==null||!ce||!de)return;const{onDragOver:ue}=N.current,ve=De.get(fn),ke=ve&&ve.rect.current?{id:ve.id,rect:ve.rect.current,data:ve.data,disabled:ve.disabled}:null,te={active:re,activatorEvent:ce,collisions:le,delta:{x:de.x,y:de.y},over:ke};Ue.unstable_batchedUpdates(()=>{hn(ke),ue?.(te),_({type:"onDragOver",event:te})})},[fn]),be(()=>{ne.current={activatorEvent:M,active:ee,activeNode:G,collisionRect:Oe,collisions:ze,droppableRects:z,draggableNodes:A,draggingNode:je,draggingNodeRect:Me,droppableContainers:B,over:we,scrollableAncestors:Se,scrollAdjustedTranslate:_e},K.current={initial:Me,translated:Oe}},[ee,G,ze,Oe,A,je,Me,z,B,we,Se,_e]),qo({...X,delta:H,draggingRect:Oe,pointerCoordinates:un,scrollableAncestors:Se,scrollableAncestorRects:ot});const Pr=g.useMemo(()=>({active:ee,activeNode:G,activeNodeRect:Y,activatorEvent:M,collisions:ze,containerNodeRect:se,dragOverlay:xe,draggableNodes:A,droppableContainers:B,droppableRects:z,over:we,measureDroppableContainers:F,scrollableAncestors:Se,scrollableAncestorRects:ot,measuringConfiguration:C,measuringScheduled:U,windowRect:_t}),[ee,G,Y,M,ze,se,xe,A,B,z,we,F,Se,ot,C,U,_t]),Yr=g.useMemo(()=>({activatorEvent:M,activators:pn,active:ee,activeNodeRect:Y,ariaDescribedById:{draggable:P},dispatch:S,draggableNodes:A,over:we,measureDroppableContainers:F}),[M,pn,ee,Y,S,P,A,we,F]);return g.createElement(Zn.Provider,{value:j},g.createElement(Et.Provider,{value:Yr},g.createElement(dr.Provider,{value:Pr},g.createElement(fr.Provider,{value:Nr},d)),g.createElement(bs,{disabled:c?.restoreFocus===!1})),g.createElement(mo,{...c,hiddenTextDescribedById:P}));function Fr(){const re=R?.autoScrollEnabled===!1,ce=typeof l=="object"?l.enabled===!1:l===!1,le=T&&!re&&!ce;return typeof l=="object"?{...l,enabled:le}:{enabled:le}}}),ws=g.createContext(null),zn="button",Ds="Draggable";function Cs(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=nt(Ds),{activators:a,activatorEvent:c,active:l,activeNodeRect:d,ariaDescribedById:f,draggableNodes:h,over:y}=g.useContext(Et),{role:v=zn,roleDescription:m="draggable",tabIndex:b=0}=o??{},x=l?.id===t,S=g.useContext(x?fr:ws),[_,j]=xt(),[O,k]=xt(),T=cs(a,t),$=Ke(n);be(()=>(h.set(t,{id:t,key:s,node:_,activatorNode:O,data:$}),()=>{const H=h.get(t);H&&H.key===s&&h.delete(t)}),[h,t]);const A=g.useMemo(()=>({role:v,tabIndex:b,"aria-disabled":r,"aria-pressed":x&&v===zn?!0:void 0,"aria-roledescription":m,"aria-describedby":f.draggable}),[r,v,b,x,m,f.draggable]);return{active:l,activatorEvent:c,activeNodeRect:d,attributes:A,isDragging:x,listeners:r?void 0:T,node:_,over:y,setNodeRef:j,setActivatorNodeRef:k,transform:S}}function Rs(){return g.useContext(dr)}const Es="Droppable",Ts={timeout:25};function js(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=nt(Es),{active:a,dispatch:c,over:l,measureDroppableContainers:d}=g.useContext(Et),f=g.useRef({disabled:n}),h=g.useRef(!1),y=g.useRef(null),v=g.useRef(null),{disabled:m,updateMeasurementsFor:b,timeout:x}={...Ts,...o},S=Ke(b??r),_=g.useCallback(()=>{if(!h.current){h.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{d(Array.isArray(S.current)?S.current:[S.current]),v.current=null},x)},[x]),j=Rt({callback:_,disabled:m||!a}),O=g.useCallback((A,H)=>{j&&(H&&(j.unobserve(H),h.current=!1),A&&j.observe(A))},[j]),[k,T]=xt(O),$=Ke(t);return g.useEffect(()=>{!j||!k.current||(j.disconnect(),h.current=!1,j.observe(k.current))},[k,j]),g.useEffect(()=>(c({type:Z.RegisterDroppable,element:{id:r,key:s,disabled:n,node:k,rect:y,data:$}}),()=>c({type:Z.UnregisterDroppable,key:s,id:r})),[r]),g.useEffect(()=>{n!==f.current.disabled&&(c({type:Z.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)},[r,s,n,c]),{active:a,rect:y,isOver:l?.id===r,node:k,over:l,setNodeRef:T}}function Tt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Ms(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function ut(e){return e!==null&&e>=0}function _s(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Os(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const dt={scaleX:1,scaleY:1},ks=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:a}=e;const c=(t=n[o])!=null?t:r;if(!c)return null;const l=$s(n,a,o);if(a===o){const d=n[s];return d?{x:o<s?d.left+d.width-(c.left+c.width):d.left-c.left,y:0,...dt}:null}return a>o&&a<=s?{x:-c.width-l,y:0,...dt}:a<o&&a>=s?{x:c.width+l,y:0,...dt}:{x:0,y:0,...dt}};function $s(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return!r||!o&&!s?0:n<t?o?r.left-(o.left+o.width):s.left-(r.left+r.width):s?s.left-(r.left+r.width):r.left-(o.left+o.width)}const gr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=Tt(t,r,n),a=t[o],c=s[o];return!c||!a?null:{x:c.left-a.left,y:c.top-a.top,scaleX:c.width/a.width,scaleY:c.height/a.height}},ft={scaleX:1,scaleY:1},Is=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:a}=e;const c=(t=s[n])!=null?t:r;if(!c)return null;if(o===n){const d=s[a];return d?{x:0,y:n<a?d.top+d.height-(c.top+c.height):d.top-c.top,...ft}:null}const l=As(s,o,n);return o>n&&o<=a?{x:0,y:-c.height-l,...ft}:o<n&&o>=a?{x:0,y:c.height+l,...ft}:{x:0,y:0,...ft}};function As(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const pr="Sortable",vr=g.createContext({activeIndex:-1,containerId:pr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:gr,disabled:{draggable:!1,droppable:!1}});function mr(e){let{children:t,id:n,items:r,strategy:o=gr,disabled:s=!1}=e;const{active:a,dragOverlay:c,droppableRects:l,over:d,measureDroppableContainers:f}=Rs(),h=nt(pr,n),y=c.rect!==null,v=g.useMemo(()=>r.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),m=a!=null,b=a?v.indexOf(a.id):-1,x=d?v.indexOf(d.id):-1,S=g.useRef(v),_=!_s(v,S.current),j=x!==-1&&b===-1||_,O=Os(s);be(()=>{_&&m&&f(v)},[_,v,m,f]),g.useEffect(()=>{S.current=v},[v]);const k=g.useMemo(()=>({activeIndex:b,containerId:h,disabled:O,disableTransforms:j,items:v,overIndex:x,useDragOverlay:y,sortedRects:Ms(v,l),strategy:o}),[b,h,O.draggable,O.droppable,j,v,x,l,y,o]);return g.createElement(vr.Provider,{value:k},t)}const Ls=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Tt(n,r,o).indexOf(t)},Ns=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:a,previousItems:c,previousContainerId:l,transition:d}=e;return!d||!r||c!==s&&o===a?!1:n?!0:a!==o&&t===l},zs={duration:200,easing:"ease"},br="transform",Ps=Ie.Transition.toString({property:br,duration:0,easing:"linear"}),Ys={roleDescription:"sortable"};function Fs(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,a]=g.useState(null),c=g.useRef(n);return be(()=>{if(!t&&n!==c.current&&r.current){const l=o.current;if(l){const d=Ne(r.current,{ignoreTransform:!0}),f={x:l.left-d.left,y:l.top-d.top,scaleX:l.width/d.width,scaleY:l.height/d.height};(f.x||f.y)&&a(f)}}n!==c.current&&(c.current=n)},[t,n,r,o]),g.useEffect(()=>{s&&a(null)},[s]),s}function xr(e){let{animateLayoutChanges:t=Ns,attributes:n,disabled:r,data:o,getNewIndex:s=Ls,id:a,strategy:c,resizeObserverConfig:l,transition:d=zs}=e;const{items:f,containerId:h,activeIndex:y,disabled:v,disableTransforms:m,sortedRects:b,overIndex:x,useDragOverlay:S,strategy:_}=g.useContext(vr),j=Bs(r,v),O=f.indexOf(a),k=g.useMemo(()=>({sortable:{containerId:h,index:O,items:f},...o}),[h,o,O,f]),T=g.useMemo(()=>f.slice(f.indexOf(a)),[f,a]),{rect:$,node:A,isOver:H,setNodeRef:B}=js({id:a,data:k,disabled:j.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...l}}),{active:L,activatorEvent:K,activeNodeRect:ee,attributes:I,setNodeRef:R,listeners:D,isDragging:M,over:E,setActivatorNodeRef:N,transform:P}=Cs({id:a,data:k,attributes:{...Ys,...n},disabled:j.draggable}),p=ro(B,R),C=!!L,z=C&&!m&&ut(y)&&ut(x),F=!S&&M,U=F&&z?P:null,V=z?U??(c??_)({rects:b,activeNodeRect:ee,activeIndex:y,overIndex:x,index:O}):null,X=ut(y)&&ut(x)?s({id:a,items:f,activeIndex:y,overIndex:x}):O,q=L?.id,Y=g.useRef({activeId:q,items:f,newIndex:X,containerId:h}),se=f!==Y.current.items,ne=t({active:L,containerId:h,isDragging:M,isSorting:C,id:a,index:O,items:f,newIndex:Y.current.newIndex,previousItems:Y.current.items,previousContainerId:Y.current.containerId,transition:d,wasDragging:Y.current.activeId!=null}),he=Fs({disabled:!ne,index:O,node:A,rect:$});return g.useEffect(()=>{C&&Y.current.newIndex!==X&&(Y.current.newIndex=X),h!==Y.current.containerId&&(Y.current.containerId=h),f!==Y.current.items&&(Y.current.items=f)},[C,X,h,f]),g.useEffect(()=>{if(q===Y.current.activeId)return;if(q!=null&&Y.current.activeId==null){Y.current.activeId=q;return}const je=setTimeout(()=>{Y.current.activeId=q},50);return()=>clearTimeout(je)},[q]),{active:L,activeIndex:y,attributes:I,data:k,rect:$,index:O,newIndex:X,items:f,isOver:H,isSorting:C,isDragging:M,listeners:D,node:A,overIndex:x,over:E,setNodeRef:p,setActivatorNodeRef:N,setDroppableNodeRef:B,setDraggableNodeRef:R,transform:he??V,transition:xe()};function xe(){if(he||se&&Y.current.newIndex===O)return Ps;if(!(F&&!tn(K)||!d)&&(C||ne))return Ie.Transition.toString({...d,property:br})}}function Bs(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}W.Down,W.Right,W.Up,W.Left;const Hs=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Vs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Pn=e=>{const t=Vs(e);return t.charAt(0).toUpperCase()+t.slice(1)},yr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Ws=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Us={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Gs=g.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...c},l)=>g.createElement("svg",{ref:l,...Us,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:yr("lucide",o),...!s&&!Ws(c)&&{"aria-hidden":"true"},...c},[...a.map(([d,f])=>g.createElement(d,f)),...Array.isArray(s)?s:[s]]));const oe=(e,t)=>{const n=g.forwardRef(({className:r,...o},s)=>g.createElement(Gs,{ref:s,iconNode:t,className:yr(`lucide-${Hs(Pn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Pn(e),n};const Xs=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],qs=oe("arrow-down",Xs);const Ks=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],Js=oe("arrow-up-down",Ks);const Zs=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Qs=oe("arrow-up",Zs);const ei=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],ti=oe("bookmark",ei);const ni=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],Yn=oe("calendar",ni);const ri=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],oi=oe("chevron-left",ri);const si=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],ii=oe("chevron-right",si);const ai=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],ci=oe("columns-2",ai);const li=[["path",{d:"M10 5a2 2 0 0 0-1.344.519l-6.328 5.74a1 1 0 0 0 0 1.481l6.328 5.741A2 2 0 0 0 10 19h10a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2z",key:"1yo7s0"}],["path",{d:"m12 9 6 6",key:"anjzzh"}],["path",{d:"m18 9-6 6",key:"1fp51s"}]],ui=oe("delete",li);const di=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],fi=oe("ellipsis",di);const hi=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],gi=oe("funnel",hi);const pi=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Sr=oe("grip-vertical",pi);const vi=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],mi=oe("pen",vi);const bi=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],xi=oe("refresh-ccw",bi);const yi=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Si=oe("settings",yi);const wi=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Di=oe("triangle-alert",wi);function w(e){return g.forwardRef((t,n)=>{const{children:r,...o}=t;return i.jsx(e,{ref:n,...o,children:r})})}const wr=e=>`table_column_order_v1:${e}`,Dr=e=>`table_column_visibility_v1:${e}`,Ci=e=>{const{tableId:t}=ie.state;localStorage.setItem(wr(t),JSON.stringify(e.map(n=>n.id))),ie.setState(n=>({...n,columnOrder:e})),ie.setState(n=>({...n,columnOrder:e}))};function Ri(e){ie.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const Ei=e=>{ie.setState(t=>{const n={...t.visibility,[e]:!t.visibility[e]};return t.tableId&&localStorage.setItem(Dr(t.tableId),JSON.stringify(n)),{...t,visibility:n}})},ie=new qn({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],data:[],sortableColumns:[],actionsConfig:{showActionColumn:!0,showColumnVisibilityMenu:!0,children:"Actions",width:"100px"}});function Cr(e,t){const n=e[0]??{},o=(t&&t.length?t:Object.keys(n).map(f=>({id:f,label:f}))).filter(f=>Object.prototype.hasOwnProperty.call(n,f.id)),{tableId:s}=ie.state,a=JSON.parse(localStorage.getItem(wr(s))||"[]"),c=[...a.map(f=>o.find(h=>h.id===f)).filter(Boolean),...o.filter(f=>!a.includes(f.id))],l=JSON.parse(localStorage.getItem(Dr(s))||"{}"),d=c.reduce((f,h)=>(f[h.id]=l[h.id]??!0,f),{});ie.setState(f=>({...f,data:e,columnOrder:c,visibility:d,sortableColumns:c.map(h=>({id:h.id,label:h.label,sortable:!0,backgroundColor:h.backgroundColor}))}))}function Rr(e){ie.setState(t=>({...t,tableId:e}))}const Er=e=>{ie.setState(t=>({...t,actionsConfig:e}))},Ti=w(u.Menu.Trigger),ji=w(u.Menu.Positioner),Mi=w(u.Menu.Content),_i=w(u.Menu.Item),Oi=w(u.Checkbox.Label),ki=w(u.Checkbox.HiddenInput),$i=w(u.Checkbox.Control);function Ii({visibility:e,onToggle:t}){const{sortableColumns:n}=Qe(ie);return i.jsxs(u.Menu.Root,{closeOnSelect:!1,children:[i.jsx(Ti,{asChild:!0,children:i.jsx(u.IconButton,{"aria-label":"Toggle columns",variant:"ghost",ml:"1",size:"xs",children:i.jsx(ci,{size:18})})}),i.jsx(u.Portal,{children:i.jsx(ji,{children:i.jsx(Mi,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return i.jsx(_i,{value:r.id,closeOnSelect:!1,children:i.jsxs(u.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[i.jsx(ki,{}),i.jsx($i,{}),i.jsx(Oi,{children:r.label})]})},r.id)})})})})]})}function Ai({id:e,children:t,onClick:n,cursor:r,borderRight:o,borderRightColor:s,backgroundColor:a}){const{setNodeRef:c,attributes:l,listeners:d,transform:f,transition:h}=xr({id:e});return i.jsx(u.Table.ColumnHeader,{ref:c,onClick:n,backgroundColor:a,w:e==="id"?"80px":void 0,style:{transform:Ie.Transform.toString(f),transition:h,cursor:r,borderRight:o,borderRightColor:s},...l,children:i.jsxs(u.HStack,{justify:"space-between",children:[t,i.jsx("span",{...d,children:i.jsx(Sr,{size:12})})]})})}function Li(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o,actionsConfig:s}=Qe(ie),a=e.map(l=>o.find(d=>d.id===l.id)).filter(l=>l!==void 0).filter(l=>t[l.id]),c=l=>{const{active:d,over:f}=l;if(!f||d.id===f.id)return;const h=e.findIndex(m=>m.id===d.id),y=e.findIndex(m=>m.id===f.id),v=Tt(e,h,y);Ci(v)};return i.jsx(u.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",zIndex:1,children:i.jsx(hr,{collisionDetection:Qn,onDragEnd:c,children:i.jsx(mr,{items:e.map(l=>l.id),strategy:ks,children:i.jsxs(u.Table.Row,{height:"28px",children:[a.map(l=>{const d=n===l?.id;return i.jsx(Ai,{id:l?.id,onClick:()=>l?.sortable&&Ri(l?.id),cursor:l?.sortable?"pointer":"default",borderRight:"2px solid #dcdcdc",backgroundColor:l?.backgroundColor,children:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[l?.label,l?.sortable&&(d?r==="asc"?i.jsx(Qs,{size:14}):i.jsx(qs,{size:14}):i.jsx(Js,{size:14,opacity:.4}))]})},l?.id)}),s?.showActionColumn&&i.jsx(u.Table.ColumnHeader,{width:s.width,backgroundColor:s.backgroundColor,borderRight:"2px solid #dcdcdc",children:s.children}),s?.showColumnVisibilityMenu&&i.jsx(u.Table.ColumnHeader,{boxSize:"0.5",backgroundColor:s.backgroundColorColumnVisibilityMenu,children:i.jsx(Ii,{visibility:t,onToggle:Ei})})]})})})})}const Ni=[10,20,50,100],zi=w(u.Select.Positioner),Pi=w(u.Select.Content),Yi=w(u.Select.Item),Fi=w(u.Pagination.PrevTrigger),Bi=w(u.Pagination.NextTrigger),Hi=w(u.Select.HiddenSelect),Vi=w(u.Select.Control),Wi=w(u.Select.Trigger),Ui=w(u.Select.ValueText),Gi=w(u.Select.IndicatorGroup),Xi=w(u.Select.Indicator);function qi({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:s=2,pageSizeOptions:a=Ni}){const c=u.createListCollection({items:a.map(l=>({label:String(l),value:String(l)}))});return i.jsx(u.Box,{width:"100%",children:i.jsxs(u.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[i.jsxs(u.HStack,{children:[i.jsx(u.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),i.jsxs(u.Select.Root,{collection:c,size:"sm",width:"60px",onValueChange:l=>o?.(Number(l.items[0].value)),value:[String(t)],children:[i.jsx(Hi,{}),i.jsxs(Vi,{children:[i.jsx(Wi,{children:i.jsx(Ui,{placeholder:""})}),i.jsx(Gi,{children:i.jsx(Xi,{})})]}),i.jsx(u.Portal,{children:i.jsx(zi,{children:i.jsx(Pi,{children:c.items.map(l=>i.jsxs(Yi,{item:l.value,children:[l.label,i.jsx(u.Select.ItemIndicator,{})]},l.value))})})})]})]}),i.jsx(u.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:s,onPageChange:l=>r&&r(l.page),children:i.jsxs(u.ButtonGroup,{size:"sm",variant:"ghost",children:[i.jsx(Fi,{asChild:!0,children:i.jsx(u.IconButton,{"aria-label":"Previous page",children:i.jsx(oi,{size:18})})}),i.jsx(u.Pagination.Items,{render:l=>i.jsx(u.IconButton,{variant:l.type==="page"&&l.value===n?"outline":"ghost","aria-current":l.type==="page"&&l.value===n?"page":void 0,children:l.type==="page"?l.value:"…"},l.value??l.type)}),i.jsx(Bi,{asChild:!0,children:i.jsx(u.IconButton,{"aria-label":"Next page",children:i.jsx(ii,{size:18})})})]})})]})})}const Ki=w(u.Menu.Item),Ji=w(u.Menu.Content),Zi=w(u.Menu.Positioner),Qi=w(u.Menu.Trigger);function ea({data:e=[],actions:t=[]}){const{columnOrder:n,visibility:r}=Qe(ie);return i.jsx(u.Table.Body,{children:e.map(o=>i.jsxs(u.Table.Row,{children:[n.filter(s=>r[s.id]).map(s=>i.jsx(u.Table.Cell,{children:o[s.id]},s.id)),i.jsx(u.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:i.jsxs(u.Menu.Root,{children:[i.jsx(Qi,{asChild:!0,children:i.jsx(u.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:i.jsx(fi,{size:16})})}),i.jsx(u.Portal,{children:i.jsx(Zi,{children:i.jsx(Ji,{children:t.map(s=>i.jsxs(Ki,{onClick:()=>s.onClick(o),colorScheme:s.colorScheme,value:s.label,children:[s.icon,s.label]},s.label))})})})]})})]},o.id))})}function ta({rows:e=6,columns:t}){return i.jsx(u.Table.Body,{children:Array.from({length:e}).map((n,r)=>i.jsx(u.Table.Row,{children:Array.from({length:t}).map((o,s)=>i.jsx(u.Table.Cell,{children:i.jsx(u.Skeleton,{height:"25px"})},s))},r))})}function na({tableId:e,data:t=[],headers:n=[],loading:r=!1,loadingChildren:o,skeletonLoading:s=!1,emptyMessage:a="No data",actions:c,page:l=1,pageSize:d=10,onPageChange:f,onPageSizeChange:h,density:y="sm",totalCount:v=0,paginationMode:m="client",actionConfig:b,pageSizeOptions:x}){g.useEffect(()=>{Rr(e)},[e]),g.useEffect(()=>{Cr(t,n)},[t,n]),g.useEffect(()=>{b&&Er(b)},[b]);const{sortColumn:S,sortDirection:_,data:j,columnOrder:O}=Qe(ie),k=g.useMemo(()=>{const T=[...j],$=Math.max(1,l||1);if(S&&T.sort((A,H)=>_==="asc"?String(A[S]).localeCompare(String(H[S])):String(H[S]).localeCompare(String(A[S]))),m==="client"){const A=($-1)*d;return T.slice(A,A+d)}return T},[j,S,_,l,d,m]);return g.useEffect(()=>{l<1&&f&&f(1)},[l,f]),i.jsxs(u.Box,{h:"100%",display:"flex",flexDirection:"column",p:2,pt:2,minHeight:0,children:[i.jsx(u.Box,{flex:"1",minHeight:0,overflow:"auto",h:"100%",children:i.jsxs(u.Table.Root,{variant:"outline",w:"100%",size:y,children:[i.jsx(Li,{}),r?i.jsx(u.Table.Body,{children:i.jsx(u.Table.Row,{children:i.jsx(u.Table.Cell,{colSpan:O.length+(c?1:0),children:i.jsx(u.Box,{display:"flex",alignItems:"center",justifyContent:"center",h:"83vh",w:"100%",children:o??"Loading..."})})})}):s?i.jsx(ta,{rows:d,columns:n.length+(c?2:0)}):k.length===0?i.jsx(u.Table.Body,{children:i.jsx(u.Table.Row,{children:i.jsx(u.Table.Cell,{colSpan:n.length+(c?1:0),children:i.jsx(u.Box,{display:"flex",alignItems:"center",justifyContent:"center",minH:"200px",color:"gray.500",children:a})})})}):i.jsx(ea,{data:k,actions:c})]})}),i.jsx(u.Box,{mt:.5,children:i.jsx(qi,{totalCount:v,pageSize:d,currentPage:l,onPageChange:f,onPageSizeChange:T=>{h&&h(T),l>1&&f&&f(1)},pageSizeOptions:x})})]})}const ra=w(u.Checkbox.Root),oa=w(u.Checkbox.HiddenInput),sa=w(u.Checkbox.Control),ia=w(u.Checkbox.Label),Tr=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:s,required:a,errorText:c})=>i.jsxs(ra,{value:e,onChange:t,size:n,children:[i.jsx(oa,{}),i.jsx(sa,{disabled:s,required:a,errorText:c,helperText:o}),r&&i.jsx(ia,{children:r})]}),J=" to ",Fn=10,Te={DAY_MAX:31,MONTH_MAX:12,YEAR_MIN:1900,YEAR_MAX:2100},an=()=>{const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},Bn=()=>{const{year:e,month:t,day:n}=an();return`${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}-${e}`},aa=()=>{const{year:e,month:t,day:n}=an();return`${e}-${String(t).padStart(2,"0")}-${String(n).padStart(2,"0")}`},ca=(e,t)=>{const n=e.length,r=parseInt(e);if(!e||isNaN(r))return t;if(n===4)return r>=Te.YEAR_MIN&&r<=Te.YEAR_MAX?r:t;if(n>0&&n<4){const o=t.toString(),s=4-n,a=o.substring(0,s);return parseInt(a+e)}return t},Ve=e=>{if(!e?.trim())return null;const n=e.replace(/[^\d-]/g,"").split("-").filter(d=>d!=="");if(n.length===0)return null;const{year:r,month:o,day:s}=an();let a,c,l;return n.length===1?(a=parseInt(n[0])||s,c=o,l=r):n.length===2?(a=parseInt(n[0])||s,c=parseInt(n[1])||o,l=r):(a=parseInt(n[0])||s,c=parseInt(n[1])||o,l=ca(n[2],r)),c=Math.max(1,Math.min(Te.MONTH_MAX,c)),a=Math.max(1,Math.min(Te.DAY_MAX,a)),`${l}-${String(c).padStart(2,"0")}-${String(a).padStart(2,"0")}`},ge=e=>{if(!e)return"";const[t,n,r]=e.split("-");return`${r}-${n}-${t}`},la=(e,t)=>{if(e[0]?.length>0){const n=parseInt(e[0]);if(isNaN(n)||n===0||e[0].length===2&&n>Te.DAY_MAX)return t}if(e[1]?.length>0){const n=parseInt(e[1]);if(isNaN(n)||n===0||e[1].length===2&&n>Te.MONTH_MAX)return t}if(e[2]?.length>0){const n=parseInt(e[2]),r=e[2].length===4;if(isNaN(n)||n===0||r&&(n<Te.YEAR_MIN||n>Te.YEAR_MAX))return t}return null},We=e=>{let t=e.replace(/[^\d-]/g,"").substring(0,Fn);if(t.length>=3&&t[2]!=="-"&&(t=t.substring(0,2)+"-"+t.substring(2).replace(/-/g,"")),t.length>=6&&t[5]!=="-"){const o=t.split("-");o.length>=2&&(t=`${o[0]}-${o[1].substring(0,2)}-${o[1].substring(2)}${o[2]||""}`)}const n=t.split("-");return n[0]=n[0]?.substring(0,2)||"",n[1]=n[1]?.substring(0,2)||"",n[2]=n[2]?.substring(0,4)||"",t=n.filter(o=>o!=="").join("-"),t=t.substring(0,Fn),la(n,e)||t},ua=w(u.Popover.Root),da=w(u.Popover.Trigger),fa=w(u.Popover.Content),ha=w(u.Popover.Positioner);function ga({value:e,onChange:t,disabled:n=!1}){const[r="",o=""]=e?e.split("|"):[],[s,a]=g.useState(()=>r&&o?`${ge(r)}${J}${ge(o)}`:r?ge(r):""),[c,l]=g.useState(!1),d=g.useRef(null);g.useEffect(()=>{const m=b=>{b.ctrlKey&&b.key==="d"&&!b.shiftKey&&!b.metaKey&&(b.preventDefault(),d.current?.focus())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[]);const f=m=>{let b=m;if(b.includes(J)){const[x,S=""]=b.split(J);b=`${We(x.trim())}${J}${We(S.trim())}`}else if(b.toLowerCase().includes(" to ")){const[x,S=""]=b.split(/\s+to\s+/i);b=`${We(x.trim())} to ${We(S.trim())}`}else b=We(b);a(b)},h=()=>{const m=s.trim();if(!m){t(void 0);return}if(m.includes(J)){const[b,x=""]=m.split(J).map(j=>j.trim()),S=Ve(b),_=x?Ve(x):null;if(S&&_){const[j,O]=_<S?[_,S]:[S,_],k=`${ge(j)}${J}${ge(O)}`;a(k),t(`${j}|${O}`)}else if(S&&!x)a(`${ge(S)}${J}`),t(void 0);else if(S&&x){const j=aa(),[O,k]=j<S?[j,S]:[S,j],T=`${ge(O)}${J}${ge(k)}`;a(T),t(`${O}|${k}`)}else a(""),t(void 0)}else{const b=Ve(m);b?(a(`${ge(b)}${J}`),t(void 0)):(a(""),t(void 0))}},y=m=>{if(m.key!=="Enter")return;m.preventDefault();const b=d.current?.selectionStart||0,x=s.indexOf(J);if(!s.trim()){a(`${Bn()}${J}`);return}if(x===-1){const _=Ve(s.trim());_&&a(`${ge(_)}${J}`);return}if(b<=x+J.length){const _=s.substring(0,x).trim(),j=s.substring(x+J.length),O=Ve(_);O&&a(`${ge(O)}${J}${j}`);return}if(s.substring(x+J.length).trim())h(),d.current?.blur();else{const _=s.substring(0,x+J.length)+Bn();a(_),setTimeout(()=>{h(),d.current?.blur()},0)}},v=()=>{a(""),t(void 0)};return i.jsx(u.InputGroup,{children:i.jsx(i.Fragment,{children:i.jsxs(u.InputElement,{position:"revert",children:[i.jsxs(ua,{open:c,onEscapeKeyDown:()=>{l(!1)},children:[i.jsx(da,{asChild:!0,children:i.jsx(u.IconButton,{size:"sm",variant:"ghost","aria-label":"Date range help",onClick:()=>l(m=>!m),children:i.jsx(Yn,{size:16})})}),i.jsx(u.Portal,{children:i.jsx(ha,{children:i.jsxs(fa,{p:4,children:[i.jsx(u.PopoverArrow,{}),i.jsxs(u.VStack,{align:"start",gap:4,children:[i.jsxs(u.HStack,{children:[i.jsx(Yn,{size:16}),i.jsx(u.Text,{fontWeight:"semibold",fontSize:"sm",children:"Date Range Filter"})]}),i.jsxs(u.VStack,{align:"start",gap:1,children:[i.jsx(u.Text,{fontSize:"sm",fontWeight:"medium",children:"Format:"}),i.jsxs(u.Text,{fontSize:"xs",color:"gray.600",children:["DD-MM-YYYY",J,"DD-MM-YYYY"]})]}),i.jsxs(u.VStack,{align:"start",gap:1,children:[i.jsx(u.Text,{fontSize:"sm",fontWeight:"medium",children:"Tips:"}),i.jsx(u.Text,{fontSize:"xs",children:'• "15 to 20" → assumes current month/year'}),i.jsx(u.Text,{fontSize:"xs",children:"• Leave end blank → up to today"}),i.jsx(u.Text,{fontSize:"xs",children:"• Dates auto-swapped if reversed"}),i.jsx(u.Text,{fontSize:"xs",children:"• Press Enter on empty end → fills today"})]}),i.jsxs(u.VStack,{align:"start",gap:1,children:[i.jsx(u.Text,{fontSize:"sm",fontWeight:"medium",children:"Shortcut:"}),i.jsxs(u.HStack,{children:[i.jsx(u.Kbd,{children:"Ctrl"}),i.jsx(u.Text,{children:"+"}),i.jsx(u.Kbd,{children:"D"})]})]})]})]})})})]}),i.jsx(u.Input,{ref:d,placeholder:"15-06-2025 to 20-06-2025",value:s,size:"sm",disabled:n,onChange:m=>f(m.target.value),onBlur:h,onKeyDown:y,pr:s?"10":void 0,w:"100%"}),s&&i.jsx(u.InputElement,{children:i.jsx(u.IconButton,{size:"sm",variant:"ghost","aria-label":"Clear date range",onClick:v,w:"100%"})})]})})})}const pa=w(u.Field.Root),va=w(u.Field.Label),ma=w(u.Field.HelperText),ba=w(u.Field.ErrorText),Kt=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:s="outline",width:a="100%",label:c,helperText:l,isDisabled:d=!1,required:f=!1,errorText:h,visible:y})=>i.jsxs(pa,{width:a,children:[y&&i.jsx(va,{children:c}),i.jsx(u.InputGroup,{startElement:e,children:i.jsx(u.Input,{value:t,onChange:v=>n?.(v.target.value),placeholder:r,size:o,variant:s,disabled:d,required:f})}),h&&i.jsx(ba,{fontSize:"xs",children:h}),l&&i.jsx(ma,{fontSize:"xs",children:l})]}),xa=w(u.Field.Root),ya=w(u.Field.HelperText),Sa=w(u.Field.ErrorText),wa=w(u.Select.Root),Da=w(u.Select.Label),Ca=w(u.Select.Control),Ra=w(u.Select.Trigger),Ea=w(u.Select.ValueText),Ta=w(u.Select.IndicatorGroup),ja=w(u.Select.Indicator),Ma=w(u.Select.Content),_a=w(u.Select.Item),Oa=w(u.Select.ItemIndicator),ka=w(u.Select.HiddenSelect),$a=w(u.Select.Positioner),jr=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:s="xs",width:a="100%",variant:c="outline",helperText:l,isDisabled:d,required:f,errorText:h,visible:y})=>{const v=u.createListCollection({items:e});return i.jsxs(xa,{disabled:d,required:f,children:[i.jsxs(wa,{collection:v,variant:c,size:s,width:a,value:n?[n]:[],onValueChange:m=>r?.(m.value[0]),children:[i.jsx(ka,{}),y&&i.jsx(Da,{children:t}),i.jsxs(Ca,{children:[i.jsx(Ra,{children:i.jsx(Ea,{placeholder:o})}),i.jsx(Ta,{children:i.jsx(ja,{})})]}),i.jsx($a,{children:i.jsx(Ma,{children:v.items.map(m=>i.jsxs(_a,{item:m,children:[m.label,i.jsx(Oa,{})]},m.value))})})]}),l&&i.jsx(ya,{children:l}),h&&i.jsx(Sa,{children:h})]})},Mr=(e="default")=>`FILTER_PRESETS_${e}`,Ia=e=>{if(!e)return[];try{return JSON.parse(e)}catch{return[]}},Aa=e=>typeof window>"u"?[]:Ia(localStorage.getItem(Mr(e))),Ze=new qn({}),rt=e=>{const t=Ze.state;if(e in t)return t[e];const n=Aa(e);return Ze.setState(r=>({...r,[e]:n})),n},jt=(e,t)=>{Ze.setState(n=>({...n,[e]:t})),typeof window<"u"&&localStorage.setItem(Mr(e),JSON.stringify(t))},_r=(e,t)=>{const n=[t,...rt(e)];jt(e,n)},Or=(e,t)=>{const n=rt(e).filter(r=>r.id!==t);jt(e,n)},La=(e,t,n)=>{const r=rt(e).map(o=>o.id===t?n(o):o);jt(e,r)},Na=w(u.Checkbox.Root),za=w(u.Checkbox.HiddenInput),Pa=w(u.Checkbox.Control),Ya=w(u.Slider.Root),Fa=w(u.Slider.Track),Ba=w(u.Slider.Range),Ha=w(u.Slider.Thumbs),Va=w(u.Slider.Control),Wa=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:a,transition:c}=xr({id:e.id}),l={transform:Ie.Transform.toString(a),transition:c};return i.jsxs(u.VStack,{ref:s,style:l,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[i.jsxs(u.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[i.jsx(Sr,{size:16}),i.jsx(u.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),i.jsxs(u.HStack,{justify:"space-between",children:[i.jsx(u.Text,{fontSize:"sm",children:"Visible"}),i.jsxs(Na,{checked:e.visible,size:"sm",onCheckedChange:d=>t?.(e.id,!!d.checked),children:[i.jsx(za,{}),i.jsx(Pa,{})]})]}),i.jsxs(u.VStack,{align:"stretch",gap:1,children:[i.jsx(u.Text,{fontSize:"sm",children:"Size"}),i.jsx(Ya,{min:1,max:5,step:.5,value:[e.size??1],onValueChange:d=>n?.(e.id,d.value[0]),children:i.jsxs(Va,{children:[i.jsx(Fa,{children:i.jsx(Ba,{})}),i.jsx(Ha,{})]})})]})]})},Ua=w(u.Drawer.Root),Ga=w(u.Drawer.Trigger),Xa=w(u.Drawer.Backdrop),qa=w(u.Drawer.Positioner),Ka=w(u.Drawer.Content),Ja=w(u.Drawer.Header),Za=w(u.Drawer.Title),Qa=w(u.Drawer.Body),ec=w(u.Drawer.Footer),tc=w(u.Drawer.CloseTrigger),nc=w(u.Tabs.Root),rc=w(u.Tabs.List),Bt=w(u.Tabs.Trigger),Ht=w(u.Tabs.Content),kr=(e,t)=>{if(e.customComponent)return e.customComponent;switch(e.type){case"text":return i.jsx(Kt,{placeholder:e.label,value:e.value,onChange:e.onChange,label:e.label,visible:t});case"number":return i.jsx(Kt,{label:e.label,value:e.value,onChange:e.onChange});case"checkbox":return i.jsx(Tr,{label:e.label,value:e.value,onChange:e.onChange});case"select":return i.jsx(jr,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t});case"date":return i.jsx(ga,{value:e.value,onChange:e.onChange});default:return null}},oc=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:s="default",onLoadPreset:a,activePresetName:c,onReorder:l,open:d,onOpenChange:f})=>{const y=Qe(Ze)[s]??rt(s),v=()=>{const m=prompt("Preset name?");if(!m)return;const b=o.reduce((x,S)=>(x[S.id]=S.value,x),{});_r(s,{id:crypto.randomUUID(),name:m,date:new Date().toISOString(),values:b})};return i.jsx(u.HStack,{wrap:"wrap",children:i.jsxs(Ua,{size:e,open:d,onOpenChange:f,children:[i.jsx(Ga,{asChild:!0,children:i.jsxs(u.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[i.jsx(gi,{size:16}),"Filters"]})}),i.jsxs(u.Portal,{children:[i.jsx(Xa,{}),i.jsx(qa,{children:i.jsxs(Ka,{children:[i.jsx(Ja,{children:i.jsx(Za,{children:"Filters"})}),i.jsx(Qa,{overflowY:"auto",pt:1,children:i.jsxs(nc,{defaultValue:"view",children:[i.jsxs(rc,{mb:4,children:[i.jsxs(Bt,{value:"view",children:[i.jsx(mi,{size:16}),"Edit"]}),i.jsxs(Bt,{value:"settings",children:[i.jsx(Si,{size:16}),"Settings"]}),i.jsxs(Bt,{value:"presets",children:[i.jsx(ti,{size:16}),"Presets"]})]}),i.jsx(Ht,{value:"view",children:o.filter(m=>m.visible).map(m=>i.jsx(u.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",flex:m.size??1,minW:`${(m.size??1)*100}px`,rounded:"md",p:3,mb:3,children:kr(m,d)},m.id))}),i.jsx(Ht,{value:"settings",children:i.jsx(hr,{sensors:xo(bo(sn)),collisionDetection:Qn,onDragEnd:({active:m,over:b})=>{if(!b||m.id===b.id)return;const x=o.findIndex(j=>j.id===m.id),S=o.findIndex(j=>j.id===b.id),_=Tt(o,x,S);l?.(_)},children:i.jsx(mr,{items:o.map(m=>m.id),strategy:Is,children:o.map(m=>i.jsx(Wa,{filter:m,onVisibilityChange:t,onSizeChange:n},m.id))})})}),i.jsx(Ht,{value:"presets",children:i.jsxs(u.VStack,{align:"stretch",mb:3,children:[y.length===0&&i.jsx(u.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),y.map(m=>i.jsxs(u.HStack,{justify:"space-between",border:"1px solid",borderColor:c===m.name?"blue.300":"gray.200",rounded:"md",p:2,children:[i.jsxs(u.VStack,{align:"start",gap:0,children:[i.jsx(u.Text,{fontWeight:"bold",fontSize:"sm",children:m.name}),i.jsx(u.Text,{fontSize:"xs",color:"gray.500",children:new Date(m.date).toLocaleDateString()})]}),i.jsxs(u.HStack,{children:[i.jsx(u.Button,{size:"xs",variant:"ghost",onClick:()=>{const b=o.map(x=>({...x,value:m.values[x.id]??x.value}));a?.(b,m.name)},children:"Load"}),i.jsx(u.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>Or(s,m.id),children:i.jsx(ui,{size:14})})]})]},m.id)),i.jsx(u.Button,{size:"sm",colorScheme:"blue",onClick:v,children:"Save Current Filters"})]})})]})}),i.jsx(ec,{justify:"space-between",children:i.jsx(tc,{asChild:!0,children:i.jsx(u.CloseButton,{})})})]})})]})]})})},sc=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:a,pageKey:c,onLoadPreset:l,activePresetName:d,filterDrawerSize:f="sm"})=>{const[h,y]=g.useState(!1);return i.jsxs(u.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,i.jsxs(u.HStack,{gapX:1,children:[t.filter(v=>v.visible!==!1).map(v=>i.jsx(u.HStack,{flex:v.size??1,minW:`${(v.size??1)*100}px`,alignItems:"center",children:kr(v)},v.id)),i.jsx(oc,{filterDrawerSize:f,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:a,pageKey:c,filters:t,onLoadPreset:l,activePresetName:d,open:h,onOpenChange:v=>{y(v.open)}})]})]})},ic=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},ac=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}},cc=({onClick:e,size:t="xs",variant:n="solid",label:r,leftIcon:o,rightIcon:s,isDisabled:a,colorScheme:c,loading:l,loadingText:d,rounded:f,type:h="button"})=>i.jsx(u.Button,{onClick:e,size:t,variant:n,disabled:a,colorPalette:c,loading:l,loadingText:d,rounded:f,type:h,children:i.jsxs(u.HStack,{gap:1,children:[o,r,s]})}),lc=w(u.Dialog.Root),uc=w(u.Dialog.Backdrop),dc=w(u.Dialog.Positioner),fc=w(u.Dialog.Content),hc=w(u.Dialog.Header),gc=w(u.Dialog.Body),pc=w(u.Dialog.Footer),vc=w(u.Dialog.Title),mc=w(u.Dialog.CloseTrigger);function bc({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:s="DELETE",confirmLabel:a="Delete",isLoading:c=!1}){const[l,d]=g.useState("");return i.jsx(lc,{open:e,placement:"center",onOpenChange:f=>!f.open&&t(),children:i.jsxs(u.Portal,{children:[i.jsx(uc,{}),i.jsx(dc,{children:i.jsxs(fc,{maxW:"520px",children:[i.jsx(hc,{borderBottom:"1px solid",borderColor:"red.200",boxShadow:"sm",children:i.jsx(vc,{color:"red.600",children:r})}),i.jsx(gc,{children:i.jsxs(u.Stack,{gap:4,boxShadow:"lg",border:"1px solid gray.200",borderRadius:"md",p:4,children:[i.jsx(u.Box,{border:"1px solid",borderColor:"red.200",bg:"red.50",borderRadius:"md",p:4,children:i.jsxs(u.Stack,{direction:"row",gap:3,align:"flex-start",children:[i.jsx(u.Box,{color:"red.600",mt:"2px",children:i.jsx(Di,{size:20})}),i.jsxs(u.Box,{children:[i.jsx(u.Text,{fontWeight:"semibold",color:"red.700",children:"Are you sure?"}),i.jsxs(u.Text,{fontSize:"sm",color:"red.600",children:["All the data of ",i.jsx("b",{children:o})," will permanently be deleted."]})]})]})}),i.jsx(u.Text,{fontSize:"sm",color:"gray.600",children:"You can’t undo this action afterwards."}),i.jsxs(u.Box,{children:[i.jsxs(u.Text,{fontSize:"sm",mb:1,children:["Type ",i.jsx("b",{children:s})," to continue"]}),i.jsx(u.Input,{placeholder:`Type ${s} here`,value:l,onChange:f=>d(f.target.value),size:"xs"})]})]})}),i.jsxs(pc,{justifyContent:"flex-end",gap:3,borderTop:"1px solid",borderColor:"red.200",boxShadow:"lg",children:[i.jsx(u.Button,{variant:"outline",size:"sm",onClick:t,children:"Cancel"}),i.jsx(u.Button,{size:"sm",style:{backgroundColor:"#FF0000"},loading:c,onClick:n,children:a})]}),i.jsx(mc,{asChild:!0,children:i.jsx(u.CloseButton,{size:"sm"})})]})})]})})}function $r({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=g.useState(!1),s=async()=>{o(!0);try{await e()}finally{setTimeout(()=>o(!1),300)}};return i.jsx(u.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:s,ml:2,children:i.jsx(xi,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var gt={exports:{}},xc=gt.exports,Hn;function yc(){return Hn||(Hn=1,(function(e,t){(function(n,r){e.exports=r()})(xc,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",a="second",c="minute",l="hour",d="day",f="week",h="month",y="quarter",v="year",m="date",b="Invalid Date",x=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(I){var R=["th","st","nd","rd"],D=I%100;return"["+I+(R[(D-20)%10]||R[D]||R[0])+"]"}},j=function(I,R,D){var M=String(I);return!M||M.length>=R?I:""+Array(R+1-M.length).join(D)+I},O={s:j,z:function(I){var R=-I.utcOffset(),D=Math.abs(R),M=Math.floor(D/60),E=D%60;return(R<=0?"+":"-")+j(M,2,"0")+":"+j(E,2,"0")},m:function I(R,D){if(R.date()<D.date())return-I(D,R);var M=12*(D.year()-R.year())+(D.month()-R.month()),E=R.clone().add(M,h),N=D-E<0,P=R.clone().add(M+(N?-1:1),h);return+(-(M+(D-E)/(N?E-P:P-E))||0)},a:function(I){return I<0?Math.ceil(I)||0:Math.floor(I)},p:function(I){return{M:h,y:v,w:f,d,D:m,h:l,m:c,s:a,ms:s,Q:y}[I]||String(I||"").toLowerCase().replace(/s$/,"")},u:function(I){return I===void 0}},k="en",T={};T[k]=_;var $="$isDayjsObject",A=function(I){return I instanceof K||!(!I||!I[$])},H=function I(R,D,M){var E;if(!R)return k;if(typeof R=="string"){var N=R.toLowerCase();T[N]&&(E=N),D&&(T[N]=D,E=N);var P=R.split("-");if(!E&&P.length>1)return I(P[0])}else{var p=R.name;T[p]=R,E=p}return!M&&E&&(k=E),E||!M&&k},B=function(I,R){if(A(I))return I.clone();var D=typeof R=="object"?R:{};return D.date=I,D.args=arguments,new K(D)},L=O;L.l=H,L.i=A,L.w=function(I,R){return B(I,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var K=(function(){function I(D){this.$L=H(D.locale,null,!0),this.parse(D),this.$x=this.$x||D.x||{},this[$]=!0}var R=I.prototype;return R.parse=function(D){this.$d=(function(M){var E=M.date,N=M.utc;if(E===null)return new Date(NaN);if(L.u(E))return new Date;if(E instanceof Date)return new Date(E);if(typeof E=="string"&&!/Z$/i.test(E)){var P=E.match(x);if(P){var p=P[2]-1||0,C=(P[7]||"0").substring(0,3);return N?new Date(Date.UTC(P[1],p,P[3]||1,P[4]||0,P[5]||0,P[6]||0,C)):new Date(P[1],p,P[3]||1,P[4]||0,P[5]||0,P[6]||0,C)}}return new Date(E)})(D),this.init()},R.init=function(){var D=this.$d;this.$y=D.getFullYear(),this.$M=D.getMonth(),this.$D=D.getDate(),this.$W=D.getDay(),this.$H=D.getHours(),this.$m=D.getMinutes(),this.$s=D.getSeconds(),this.$ms=D.getMilliseconds()},R.$utils=function(){return L},R.isValid=function(){return this.$d.toString()!==b},R.isSame=function(D,M){var E=B(D);return this.startOf(M)<=E&&E<=this.endOf(M)},R.isAfter=function(D,M){return B(D)<this.startOf(M)},R.isBefore=function(D,M){return this.endOf(M)<B(D)},R.$g=function(D,M,E){return L.u(D)?this[M]:this.set(E,D)},R.unix=function(){return Math.floor(this.valueOf()/1e3)},R.valueOf=function(){return this.$d.getTime()},R.startOf=function(D,M){var E=this,N=!!L.u(M)||M,P=L.p(D),p=function(q,Y){var se=L.w(E.$u?Date.UTC(E.$y,Y,q):new Date(E.$y,Y,q),E);return N?se:se.endOf(d)},C=function(q,Y){return L.w(E.toDate()[q].apply(E.toDate("s"),(N?[0,0,0,0]:[23,59,59,999]).slice(Y)),E)},z=this.$W,F=this.$M,U=this.$D,G="set"+(this.$u?"UTC":"");switch(P){case v:return N?p(1,0):p(31,11);case h:return N?p(1,F):p(0,F+1);case f:var V=this.$locale().weekStart||0,X=(z<V?z+7:z)-V;return p(N?U-X:U+(6-X),F);case d:case m:return C(G+"Hours",0);case l:return C(G+"Minutes",1);case c:return C(G+"Seconds",2);case a:return C(G+"Milliseconds",3);default:return this.clone()}},R.endOf=function(D){return this.startOf(D,!1)},R.$set=function(D,M){var E,N=L.p(D),P="set"+(this.$u?"UTC":""),p=(E={},E[d]=P+"Date",E[m]=P+"Date",E[h]=P+"Month",E[v]=P+"FullYear",E[l]=P+"Hours",E[c]=P+"Minutes",E[a]=P+"Seconds",E[s]=P+"Milliseconds",E)[N],C=N===d?this.$D+(M-this.$W):M;if(N===h||N===v){var z=this.clone().set(m,1);z.$d[p](C),z.init(),this.$d=z.set(m,Math.min(this.$D,z.daysInMonth())).$d}else p&&this.$d[p](C);return this.init(),this},R.set=function(D,M){return this.clone().$set(D,M)},R.get=function(D){return this[L.p(D)]()},R.add=function(D,M){var E,N=this;D=Number(D);var P=L.p(M),p=function(F){var U=B(N);return L.w(U.date(U.date()+Math.round(F*D)),N)};if(P===h)return this.set(h,this.$M+D);if(P===v)return this.set(v,this.$y+D);if(P===d)return p(1);if(P===f)return p(7);var C=(E={},E[c]=r,E[l]=o,E[a]=n,E)[P]||1,z=this.$d.getTime()+D*C;return L.w(z,this)},R.subtract=function(D,M){return this.add(-1*D,M)},R.format=function(D){var M=this,E=this.$locale();if(!this.isValid())return E.invalidDate||b;var N=D||"YYYY-MM-DDTHH:mm:ssZ",P=L.z(this),p=this.$H,C=this.$m,z=this.$M,F=E.weekdays,U=E.months,G=E.meridiem,V=function(Y,se,ne,he){return Y&&(Y[se]||Y(M,N))||ne[se].slice(0,he)},X=function(Y){return L.s(p%12||12,Y,"0")},q=G||function(Y,se,ne){var he=Y<12?"AM":"PM";return ne?he.toLowerCase():he};return N.replace(S,(function(Y,se){return se||(function(ne){switch(ne){case"YY":return String(M.$y).slice(-2);case"YYYY":return L.s(M.$y,4,"0");case"M":return z+1;case"MM":return L.s(z+1,2,"0");case"MMM":return V(E.monthsShort,z,U,3);case"MMMM":return V(U,z);case"D":return M.$D;case"DD":return L.s(M.$D,2,"0");case"d":return String(M.$W);case"dd":return V(E.weekdaysMin,M.$W,F,2);case"ddd":return V(E.weekdaysShort,M.$W,F,3);case"dddd":return F[M.$W];case"H":return String(p);case"HH":return L.s(p,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return q(p,C,!0);case"A":return q(p,C,!1);case"m":return String(C);case"mm":return L.s(C,2,"0");case"s":return String(M.$s);case"ss":return L.s(M.$s,2,"0");case"SSS":return L.s(M.$ms,3,"0");case"Z":return P}return null})(Y)||P.replace(":","")}))},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(D,M,E){var N,P=this,p=L.p(M),C=B(D),z=(C.utcOffset()-this.utcOffset())*r,F=this-C,U=function(){return L.m(P,C)};switch(p){case v:N=U()/12;break;case h:N=U();break;case y:N=U()/3;break;case f:N=(F-z)/6048e5;break;case d:N=(F-z)/864e5;break;case l:N=F/o;break;case c:N=F/r;break;case a:N=F/n;break;default:N=F}return E?N:L.a(N)},R.daysInMonth=function(){return this.endOf(h).$D},R.$locale=function(){return T[this.$L]},R.locale=function(D,M){if(!D)return this.$L;var E=this.clone(),N=H(D,M,!0);return N&&(E.$L=N),E},R.clone=function(){return L.w(this.$d,this)},R.toDate=function(){return new Date(this.valueOf())},R.toJSON=function(){return this.isValid()?this.toISOString():null},R.toISOString=function(){return this.$d.toISOString()},R.toString=function(){return this.$d.toUTCString()},I})(),ee=K.prototype;return B.prototype=ee,[["$ms",s],["$s",a],["$m",c],["$H",l],["$W",d],["$M",h],["$y",v],["$D",m]].forEach((function(I){ee[I[1]]=function(R){return this.$g(R,I[0],I[1])}})),B.extend=function(I,R){return I.$i||(I(R,K,B),I.$i=!0),B},B.locale=H,B.isDayjs=A,B.unix=function(I){return B(1e3*I)},B.en=T[k],B.Ls=T,B.p={},B}))})(gt)),gt.exports}var Sc=yc();const Mt=Dt(Sc);var pt={exports:{}},wc=pt.exports,Vn;function Dc(){return Vn||(Vn=1,(function(e,t){(function(n,r){e.exports=r()})(wc,(function(){return function(n,r,o){n=n||{};var s=r.prototype,a={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function c(d,f,h,y){return s.fromToBase(d,f,h,y)}o.en.relativeTime=a,s.fromToBase=function(d,f,h,y,v){for(var m,b,x,S=h.$locale().relativeTime||a,_=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],j=_.length,O=0;O<j;O+=1){var k=_[O];k.d&&(m=y?o(d).diff(h,k.d,!0):h.diff(d,k.d,!0));var T=(n.rounding||Math.round)(Math.abs(m));if(x=m>0,T<=k.r||!k.r){T<=1&&O>0&&(k=_[O-1]);var $=S[k.l];v&&(T=v(""+T)),b=typeof $=="string"?$.replace("%d",T):$(T,f,k.l,x);break}}if(f)return b;var A=x?S.future:S.past;return typeof A=="function"?A(b):A.replace("%s",b)},s.to=function(d,f){return c(d,f,this,!0)},s.from=function(d,f){return c(d,f,this)};var l=function(d){return d.$u?o.utc():o()};s.toNow=function(d){return this.to(l(this),d)},s.fromNow=function(d){return this.from(l(this),d)}}}))})(pt)),pt.exports}var Cc=Dc();const Rc=Dt(Cc);var vt={exports:{}},Ec=vt.exports,Wn;function Tc(){return Wn||(Wn=1,(function(e,t){(function(n,r){e.exports=r()})(Ec,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,s){var a=o.prototype,c=a.format;s.en.formats=n,a.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var d=this.$locale().formats,f=(function(h,y){return h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(v,m,b){var x=b&&b.toUpperCase();return m||y[b]||n[b]||y[x].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,_,j){return _||j.slice(1)}))}))})(l,d===void 0?{}:d);return c.call(this,f)}}}))})(vt)),vt.exports}var jc=Tc();const Mc=Dt(jc);var mt={exports:{}},_c=mt.exports,Un;function Oc(){return Un||(Un=1,(function(e,t){(function(n,r){e.exports=r()})(_c,(function(){return function(n,r){var o=r.prototype,s=o.format;o.format=function(a){var c=this,l=this.$locale();if(!this.isValid())return s.bind(this)(a);var d=this.$utils(),f=(a||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(h){switch(h){case"Q":return Math.ceil((c.$M+1)/3);case"Do":return l.ordinal(c.$D);case"gggg":return c.weekYear();case"GGGG":return c.isoWeekYear();case"wo":return l.ordinal(c.week(),"W");case"w":case"ww":return d.s(c.week(),h==="w"?1:2,"0");case"W":case"WW":return d.s(c.isoWeek(),h==="W"?1:2,"0");case"k":case"kk":return d.s(String(c.$H===0?24:c.$H),h==="k"?1:2,"0");case"X":return Math.floor(c.$d.getTime()/1e3);case"x":return c.$d.getTime();case"z":return"["+c.offsetName()+"]";case"zzz":return"["+c.offsetName("long")+"]";default:return h}}));return s.bind(this)(f)}}}))})(mt)),mt.exports}var kc=Oc();const $c=Dt(kc);Mt.extend(Rc);Mt.extend(Mc);Mt.extend($c);const Ic={date:"DD MMM YYYY",time:"hh:mm A",dateTime:"DD MMM YYYY, hh:mm A",full:"dddd, DD MMM YYYY, hh:mm A",short:"DD/MM/YY",relative:""};function Jt({value:e,variant:t="dateTime",format:n,fallback:r="--"}){if(!e)return r;const o=Mt(e);return o.isValid()?t==="relative"?o.fromNow():o.format(n??Ic[t]):r}function Ac({value:e,dateVariant:t="date",timeVariant:n="time",dateFormat:r,timeFormat:o,align:s="start"}){return i.jsxs(u.Stack,{gap:.5,align:s,children:[i.jsx(u.Text,{fontSize:"sm",fontWeight:"500",children:Jt({value:e,variant:t,format:r})}),i.jsx(u.Text,{fontSize:"xs",color:"gray.500",children:Jt({value:e,variant:n,format:o})})]})}exports.DataTable=na;exports.Filters=sc;exports.MDSButton=cc;exports.MDSCheckbox=Tr;exports.MDSConfirmDeleteDialog=bc;exports.MDSInput=Kt;exports.MDSRefreshButton=$r;exports.MDSSelectBox=jr;exports.RefreshButton=$r;exports.StackedDateTime=Ac;exports.addPreset=_r;exports.deletePreset=Or;exports.formatDateTime=Jt;exports.getPresets=rt;exports.loadOrder=ac;exports.presetStore=Ze;exports.saveOrder=ic;exports.savePresets=jt;exports.setActionsConfig=Er;exports.setData=Cr;exports.setTableId=Rr;exports.tableStore=ie;exports.updatePreset=La;exports.withChildren=w;
package/dist/index.d.ts CHANGED
@@ -37,7 +37,7 @@ export declare interface ConfirmDeleteDialogProps {
37
37
  isLoading?: boolean;
38
38
  }
39
39
 
40
- export declare function DataTable<T extends Record<string, unknown>>({ tableId, data: rowData, headers, loading, loadingChildren, skeletonLoading, emptyMessage, actions, page, pageSize, onPageChange, onPageSizeChange, density, totalCount, paginationMode, actionConfig, }: DataTableProps<T>): JSX_2.Element;
40
+ export declare function DataTable<T extends Record<string, unknown>>({ tableId, data: rowData, headers, loading, loadingChildren, skeletonLoading, emptyMessage, actions, page, pageSize, onPageChange, onPageSizeChange, density, totalCount, paginationMode, actionConfig, pageSizeOptions, }: DataTableProps<T>): JSX_2.Element;
41
41
 
42
42
  export declare interface DataTableAction<T = unknown> {
43
43
  icon: JSX.Element;
@@ -63,6 +63,7 @@ export declare interface DataTableProps<T = unknown> {
63
63
  actionConfig?: ActionHeaderProps;
64
64
  loadingChildren?: JSX.Element;
65
65
  skeletonLoading?: boolean;
66
+ pageSizeOptions?: number[];
66
67
  }
67
68
 
68
69
  export declare type DateTimeVariant = 'date' | 'time' | 'dateTime' | 'full' | 'relative' | 'short';
@@ -71,7 +72,7 @@ export declare const deletePreset: (pageKey: string, id: string) => void;
71
72
 
72
73
  export declare type DensityType = 'sm' | 'md' | 'lg';
73
74
 
74
- export declare const Filters: ({ title, filters, onVisibilityChange, onReorder, onSizeChange, onClear, maxToolbarUnits, pageKey, currentFilters, onLoadPreset, activePresetName, filterDrawerSize, }: IMainFilterType) => JSX_2.Element;
75
+ export declare const Filters: ({ title, filters, onVisibilityChange, onReorder, onSizeChange, onClear, maxToolbarUnits, pageKey, onLoadPreset, activePresetName, filterDrawerSize, }: IMainFilterType) => JSX_2.Element;
75
76
 
76
77
  export declare function formatDateTime({ value, variant, format, fallback, }: FormatDateTimeProps): string;
77
78
 
@@ -82,6 +83,10 @@ export declare interface FormatDateTimeProps {
82
83
  fallback?: string;
83
84
  }
84
85
 
86
+ /**
87
+ * Get presets for a page.
88
+ * Loads once from localStorage and caches in store.
89
+ */
85
90
  export declare const getPresets: (pageKey: string) => PresetItem[];
86
91
 
87
92
  export declare interface IFilterConfig {
@@ -108,8 +113,7 @@ export declare interface IFilterDrawerProps {
108
113
  maxToolbarUnits?: number;
109
114
  filterDrawerSize?: 'md' | 'lg' | 'sm';
110
115
  pageKey?: string;
111
- currentFilters?: Record<string, unknown>;
112
- onLoadPreset?: (filters: Record<string, unknown>, name: string) => void;
116
+ onLoadPreset?: (filters: IFilterConfig[], presetName?: string) => void;
113
117
  activePresetName?: string | null;
114
118
  }
115
119
 
@@ -124,7 +128,7 @@ export declare interface IMainFilterType {
124
128
  filterDrawerSize?: 'md' | 'lg' | 'sm';
125
129
  pageKey?: string;
126
130
  currentFilters?: Record<string, unknown>;
127
- onLoadPreset?: (filters: Record<string, unknown>, name: string) => void;
131
+ onLoadPreset?: (filters: IFilterConfig[], presetName?: string) => void;
128
132
  activePresetName?: string | null;
129
133
  }
130
134
 
@@ -205,10 +209,12 @@ export declare interface PresetItem {
205
209
  id: string;
206
210
  name: string;
207
211
  date: string;
208
- filters: any;
212
+ values: Record<string, any>;
209
213
  }
210
214
 
211
- export declare const presetStore: Store<Record<string, PresetItem[]>, (cb: Record<string, PresetItem[]>) => Record<string, PresetItem[]>>;
215
+ declare type PresetState = Record<string, PresetItem[]>;
216
+
217
+ export declare const presetStore: Store<PresetState, (cb: PresetState) => PresetState>;
212
218
 
213
219
  declare function RefreshButton({ refetch, isLoading, label, }: RefreshButtonProps): JSX_2.Element;
214
220
  export { RefreshButton as MDSRefreshButton }
@@ -261,6 +267,8 @@ declare interface TableState {
261
267
 
262
268
  export declare const tableStore: Store<TableState, (cb: TableState) => TableState>;
263
269
 
270
+ export declare const updatePreset: (pageKey: string, id: string, updater: (preset: PresetItem) => PresetItem) => void;
271
+
264
272
  /**
265
273
  * Chakra v3 / Ark UI slot components do NOT expose `children` in their typings.
266
274
  * This wrapper intentionally loosens typing to make them library-safe.