@mdspl/mds-shared-ui 0.3.4 → 0.3.6

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 d=require("react"),c=require("@chakra-ui/react"),Ue=require("react-dom");var st={exports:{}},Ve={};var cn;function Or(){if(cn)return Ve;cn=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,s){var i=null;if(s!==void 0&&(i=""+s),o.key!==void 0&&(i=""+o.key),"key"in o){s={};for(var l in o)l!=="key"&&(s[l]=o[l])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:i,ref:o!==void 0?o:null,props:s}}return Ve.Fragment=t,Ve.jsx=n,Ve.jsxs=n,Ve}var He={};var un;function Ir(){return un||(un=1,process.env.NODE_ENV!=="production"&&(function(){function e(b){if(b==null)return null;if(typeof b=="function")return b.$$typeof===N?null:b.displayName||b.name||null;if(typeof b=="string")return b;switch(b){case x:return"Fragment";case C:return"Profiler";case y:return"StrictMode";case T:return"Suspense";case j:return"SuspenseList";case P:return"Activity"}if(typeof b=="object")switch(typeof b.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),b.$$typeof){case h:return"Portal";case E:return b.displayName||"Context";case R:return(b._context.displayName||"Context")+".Consumer";case _:var D=b.render;return b=b.displayName,b||(b=D.displayName||D.name||"",b=b!==""?"ForwardRef("+b+")":"ForwardRef"),b;case O:return D=b.displayName||null,D!==null?D:e(b.type)||"Memo";case L:D=b._payload,b=b._init;try{return e(b(D))}catch{}}return null}function t(b){return""+b}function n(b){try{t(b);var D=!1}catch{D=!0}if(D){D=console;var I=D.error,A=typeof Symbol=="function"&&Symbol.toStringTag&&b[Symbol.toStringTag]||b.constructor.name||"Object";return I.call(D,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",A),t(b)}}function r(b){if(b===x)return"<>";if(typeof b=="object"&&b!==null&&b.$$typeof===L)return"<...>";try{var D=e(b);return D?"<"+D+">":"<...>"}catch{return"<...>"}}function o(){var b=U.A;return b===null?null:b.getOwner()}function s(){return Error("react-stack-top-frame")}function i(b){if(q.call(b,"key")){var D=Object.getOwnPropertyDescriptor(b,"key").get;if(D&&D.isReactWarning)return!1}return b.key!==void 0}function l(b,D){function I(){Re||(Re=!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)",D))}I.isReactWarning=!0,Object.defineProperty(b,"key",{get:I,configurable:!0})}function u(){var b=e(this.type);return H[b]||(H[b]=!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.")),b=this.props.ref,b!==void 0?b:null}function f(b,D,I,A,le,Y){var $=I.ref;return b={$$typeof:m,type:b,key:D,props:I,_owner:A},($!==void 0?$:null)!==null?Object.defineProperty(b,"ref",{enumerable:!1,get:u}):Object.defineProperty(b,"ref",{enumerable:!1,value:null}),b._store={},Object.defineProperty(b._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(b,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(b,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:le}),Object.defineProperty(b,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Y}),Object.freeze&&(Object.freeze(b.props),Object.freeze(b)),b}function p(b,D,I,A,le,Y){var $=D.children;if($!==void 0)if(A)if(ne($)){for(A=0;A<$.length;A++)g($[A]);Object.freeze&&Object.freeze($)}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 g($);if(q.call(D,"key")){$=e(b);var G=Object.keys(D).filter(function(M){return M!=="key"});A=0<G.length?"{key: someKey, "+G.join(": ..., ")+": ...}":"{key: someKey}",ve[$+A]||(G=0<G.length?"{"+G.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 f=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 Fr(){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 Br(){return mn||(mn=1,process.env.NODE_ENV!=="production"&&(function(){function e(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===A?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case y:return"Fragment";case T:return"Profiler";case w:return"StrictMode";case _:return"Suspense";case I:return"SuspenseList";case B:return"Activity"}if(typeof m=="object")switch(typeof m.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),m.$$typeof){case g:return"Portal";case O:return m.displayName||"Context";case j:return(m._context.displayName||"Context")+".Consumer";case k:var C=m.render;return m=m.displayName,m||(m=C.displayName||C.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case P:return C=m.displayName||null,C!==null?C:e(m.type)||"Memo";case W:C=m._payload,m=m._init;try{return e(m(C))}catch{}}return null}function t(m){return""+m}function n(m){try{t(m);var C=!1}catch{C=!0}if(C){C=console;var N=C.error,F=typeof Symbol=="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object";return N.call(C,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",F),t(m)}}function r(m){if(m===y)return"<>";if(typeof m=="object"&&m!==null&&m.$$typeof===W)return"<...>";try{var C=e(m);return C?"<"+C+">":"<...>"}catch{return"<...>"}}function o(){var m=K.A;return m===null?null:m.getOwner()}function s(){return Error("react-stack-top-frame")}function a(m){if(ee.call(m,"key")){var C=Object.getOwnPropertyDescriptor(m,"key").get;if(C&&C.isReactWarning)return!1}return m.key!==void 0}function c(m,C){function N(){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))}N.isReactWarning=!0,Object.defineProperty(m,"key",{get:N,configurable:!0})}function d(){var m=e(this.type);return M[m]||(M[m]=!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.")),m=this.props.ref,m!==void 0?m:null}function u(m,C,N,F,U,G){var H=N.ref;return m={$$typeof:b,type:m,key:C,props:N,_owner:F},(H!==void 0?H:null)!==null?Object.defineProperty(m,"ref",{enumerable:!1,get:d}):Object.defineProperty(m,"ref",{enumerable:!1,value:null}),m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(m,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(m,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.defineProperty(m,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m}function p(m,C,N,F,U,G){var H=C.children;if(H!==void 0)if(F)if($(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(m);var X=Object.keys(C).filter(function(Y){return Y!=="key"});F=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",z[H+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} />`,A,$,G,$),ve[$+A]=!0)}if($=null,I!==void 0&&(n(I),$=""+I),i(D)&&(n(D.key),$=""+D.key),"key"in D){I={};for(var J in D)J!=="key"&&(I[J]=D[J])}else I=D;return $&&l(I,typeof b=="function"?b.displayName||b.name||"Unknown":b),f(b,$,I,o(),le,Y)}function g(b){S(b)?b._store&&(b._store.validated=1):typeof b=="object"&&b!==null&&b.$$typeof===L&&(b._payload.status==="fulfilled"?S(b._payload.value)&&b._payload.value._store&&(b._payload.value._store.validated=1):b._store&&(b._store.validated=1))}function S(b){return typeof b=="object"&&b!==null&&b.$$typeof===m}var v=d,m=Symbol.for("react.transitional.element"),h=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),E=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),N=Symbol.for("react.client.reference"),U=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=Object.prototype.hasOwnProperty,ne=Array.isArray,he=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(b){return b()}};var Re,H={},Ee=v.react_stack_bottom_frame.bind(v,s)(),re=he(r(s)),ve={};He.Fragment=x,He.jsx=function(b,D,I){var A=1e4>U.recentlyCreatedOwnerStacks++;return p(b,D,I,!1,A?Error("react-stack-top-frame"):Ee,A?he(r(b)):re)},He.jsxs=function(b,D,I){var A=1e4>U.recentlyCreatedOwnerStacks++;return p(b,D,I,!0,A?Error("react-stack-top-frame"):Ee,A?he(r(b)):re)}})()),He}var dn;function kr(){return dn||(dn=1,process.env.NODE_ENV==="production"?st.exports=Or():st.exports=Ir()),st.exports}var a=kr(),it={exports:{}},Dt={},at={exports:{}},Tt={};var fn;function Mr(){if(fn)return Tt;fn=1;var e=d;function t(g,S){return g===S&&(g!==0||1/g===1/S)||g!==g&&S!==S}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function l(g,S){var v=S(),m=r({inst:{value:v,getSnapshot:S}}),h=m[0].inst,x=m[1];return s(function(){h.value=v,h.getSnapshot=S,u(h)&&x({inst:h})},[g,v,S]),o(function(){return u(h)&&x({inst:h}),g(function(){u(h)&&x({inst:h})})},[g]),i(v),v}function u(g){var S=g.getSnapshot;g=g.value;try{var v=S();return!n(g,v)}catch{return!0}}function f(g,S){return S()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:l;return Tt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Tt}var jt={};var hn;function Ar(){return hn||(hn=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){p||o.startTransition===void 0||(p=!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 h=m();if(!g){var x=m();s(h,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),g=!0)}x=i({inst:{value:h,getSnapshot:m}});var y=x[0].inst,C=x[1];return u(function(){y.value=h,y.getSnapshot=m,n(y)&&C({inst:y})},[v,h,m]),l(function(){return n(y)&&C({inst:y}),v(function(){n(y)&&C({inst:y})})},[v]),f(h),h}function n(v){var m=v.getSnapshot;v=v.value;try{var h=m();return!s(v,h)}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=d,s=typeof Object.is=="function"?Object.is:e,i=o.useState,l=o.useEffect,u=o.useLayoutEffect,f=o.useDebugValue,p=!1,g=!1,S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;jt.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:S,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),jt}var gn;function $n(){return gn||(gn=1,process.env.NODE_ENV==="production"?at.exports=Mr():at.exports=Ar()),at.exports}var pn;function Nr(){if(pn)return Dt;pn=1;var e=d,t=$n();function n(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,l=e.useMemo,u=e.useDebugValue;return Dt.useSyncExternalStoreWithSelector=function(f,p,g,S,v){var m=s(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=l(function(){function y(T){if(!C){if(C=!0,R=T,T=S(T),v!==void 0&&h.hasValue){var j=h.value;if(v(j,T))return E=j}return E=T}if(j=E,r(R,T))return j;var O=S(T);return v!==void 0&&v(j,O)?(R=T,j):(R=T,E=O)}var C=!1,R,E,_=g===void 0?null:g;return[function(){return y(p())},_===null?void 0:function(){return y(_())}]},[p,g,S,v]);var x=o(f,m[0],m[1]);return i(function(){h.hasValue=!0,h.value=x},[x]),u(x),x},Dt}var _t={};var vn;function Lr(){return vn||(vn=1,process.env.NODE_ENV!=="production"&&(function(){function e(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=d,n=$n(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,l=t.useMemo,u=t.useDebugValue;_t.useSyncExternalStoreWithSelector=function(f,p,g,S,v){var m=s(null);if(m.current===null){var h={hasValue:!1,value:null};m.current=h}else h=m.current;m=l(function(){function y(T){if(!C){if(C=!0,R=T,T=S(T),v!==void 0&&h.hasValue){var j=h.value;if(v(j,T))return E=j}return E=T}if(j=E,r(R,T))return j;var O=S(T);return v!==void 0&&v(j,O)?(R=T,j):(R=T,E=O)}var C=!1,R,E,_=g===void 0?null:g;return[function(){return y(p())},_===null?void 0:function(){return y(_())}]},[p,g,S,v]);var x=o(f,m[0],m[1]);return i(function(){h.hasValue=!0,h.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())})()),_t}var bn;function $r(){return bn||(bn=1,process.env.NODE_ENV==="production"?it.exports=Nr():it.exports=Lr()),it.exports}var Pr=$r();const $t=new WeakMap,zr=new WeakMap,ht={current:[]};let Ot=!1;const lt=new Set,mn=new Map;function Pn(e){for(const t of e){if(ht.current.includes(t))continue;ht.current.push(t),t.recompute();const n=zr.get(t);if(n)for(const r of n){const o=$t.get(r);o?.length&&Pn(o)}}}function Fr(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Br(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Vr(e){if(lt.add(e),!Ot)try{for(Ot=!0;lt.size>0;){const t=Array.from(lt);lt.clear();for(const n of t){const r=mn.get(n)??n.prevState;n.prevState=r,Fr(n)}for(const n of t){const r=$t.get(n);r&&(ht.current.push(n),Pn(r))}for(const n of t){const r=$t.get(n);if(r)for(const o of r)Br(o)}}}finally{Ot=!1,ht.current=[],mn.clear()}}function Hr(e){return typeof e=="function"}class zn{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var o,s;this.listeners.add(r);const i=(s=(o=this.options)==null?void 0:o.onSubscribe)==null?void 0:s.call(o,r,this);return()=>{this.listeners.delete(r),i?.()}},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):Hr(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Vr(this)}}function Qe(e,t=r=>r,n={}){const r=n.equal??Yr;return Pr.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Yr(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=xn(e);if(n.length!==xn(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 xn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function Wr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const mt=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 Yt(e){return"nodeType"in e}function K(e){var t,n;return e?Ae(e)?e:Yt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Wt(e){const{Document:t}=K(e);return e instanceof t}function et(e){return Ae(e)?!1:e instanceof K(e).HTMLElement}function Fn(e){return e instanceof K(e).SVGElement}function Ne(e){return e?Ae(e)?e.document:Yt(e)?Wt(e)?e:et(e)||Fn(e)?e.ownerDocument:document:document:document}const fe=mt?d.useLayoutEffect:d.useEffect;function Ut(e){const t=d.useRef(e);return fe(()=>{t.current=e}),d.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 Ur(){const e=d.useRef(null),t=d.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=d.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ke(e,t){t===void 0&&(t=[e]);const n=d.useRef(e);return fe(()=>{n.current!==e&&(n.current=e)},t),n}function tt(e,t){const n=d.useRef();return d.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function gt(e){const t=Ut(e),n=d.useRef(null),r=d.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Pt(e){const t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}let It={};function nt(e,t){return d.useMemo(()=>{if(t)return t;const n=It[e]==null?0:It[e]+1;return It[e]=n,e+"-"+n},[e,t])}function Bn(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,i)=>{const l=Object.entries(i);for(const[u,f]of l){const p=s[u];p!=null&&(s[u]=p+e*f)}return s},{...t})}}const ke=Bn(1),pt=Bn(-1);function Gr(e){return"clientX"in e&&"clientY"in e}function Gt(e){if(!e)return!1;const{KeyboardEvent:t}=K(e.target);return t&&e instanceof t}function Xr(e){if(!e)return!1;const{TouchEvent:t}=K(e.target);return t&&e instanceof t}function zt(e){if(Xr(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 Gr(e)?{x:e.clientX,y:e.clientY}:null}const Me=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[Me.Translate.toString(e),Me.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Sn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function qr(e){return e.matches(Sn)?e:e.querySelector(Sn)}const Kr={display:"none"};function Jr(e){let{id:t,value:n}=e;return d.createElement("div",{id:t,style:Kr},n)}function Zr(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 d.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Qr(){const[e,t]=d.useState("");return{announce:d.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Vn=d.createContext(null);function eo(e){const t=d.useContext(Vn);d.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function to(){const[e]=d.useState(()=>new Set),t=d.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[d.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var l;return(l=i[o])==null?void 0:l.call(i,s)})},[e]),t]}const no={draggable:`
6
+ <%s key={someKey} {...props} />`,F,H,X,H),z[H+F]=!0)}if(H=null,N!==void 0&&(n(N),H=""+N),a(C)&&(n(C.key),H=""+C.key),"key"in C){N={};for(var q in C)q!=="key"&&(N[q]=C[q])}else N=C;return H&&c(N,typeof m=="function"?m.displayName||m.name||"Unknown":m),u(m,H,N,o(),U,G)}function h(m){x(m)?m._store&&(m._store.validated=1):typeof m=="object"&&m!==null&&m.$$typeof===W&&(m._payload.status==="fulfilled"?x(m._payload.value)&&m._payload.value._store&&(m._payload.value._store.validated=1):m._store&&(m._store.validated=1))}function x(m){return typeof m=="object"&&m!==null&&m.$$typeof===b}var v=f,b=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),O=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),I=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),A=Symbol.for("react.client.reference"),K=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=Object.prototype.hasOwnProperty,$=Array.isArray,R=console.createTask?console.createTask:function(){return null};v={react_stack_bottom_frame:function(m){return m()}};var D,M={},E=v.react_stack_bottom_frame.bind(v,s)(),L=R(r(s)),z={};He.Fragment=y,He.jsx=function(m,C,N){var F=1e4>K.recentlyCreatedOwnerStacks++;return p(m,C,N,!1,F?Error("react-stack-top-frame"):E,F?R(r(m)):L)},He.jsxs=function(m,C,N){var F=1e4>K.recentlyCreatedOwnerStacks++;return p(m,C,N,!0,F?Error("react-stack-top-frame"):E,F?R(r(m)):L)}})()),He}var bn;function Hr(){return bn||(bn=1,process.env.NODE_ENV==="production"?st.exports=Fr():st.exports=Br()),st.exports}var i=Hr(),it={exports:{}},kt={},at={exports:{}},$t={};var xn;function Vr(){if(xn)return $t;xn=1;var e=f;function t(h,x){return h===x&&(h!==0||1/h===1/x)||h!==h&&x!==x}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,a=e.useDebugValue;function c(h,x){var v=x(),b=r({inst:{value:v,getSnapshot:x}}),g=b[0].inst,y=b[1];return s(function(){g.value=v,g.getSnapshot=x,d(g)&&y({inst:g})},[h,v,x]),o(function(){return d(g)&&y({inst:g}),h(function(){d(g)&&y({inst:g})})},[h]),a(v),v}function d(h){var x=h.getSnapshot;h=h.value;try{var v=x();return!n(h,v)}catch{return!0}}function u(h,x){return x()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:c;return $t.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,$t}var It={};var yn;function Wr(){return yn||(yn=1,process.env.NODE_ENV!=="production"&&(function(){function e(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}function t(v,b){p||o.startTransition===void 0||(p=!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 g=b();if(!h){var y=b();s(g,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}y=a({inst:{value:g,getSnapshot:b}});var w=y[0].inst,T=y[1];return d(function(){w.value=g,w.getSnapshot=b,n(w)&&T({inst:w})},[v,g,b]),c(function(){return n(w)&&T({inst:w}),v(function(){n(w)&&T({inst:w})})},[v]),u(g),g}function n(v){var b=v.getSnapshot;v=v.value;try{var g=b();return!s(v,g)}catch{return!0}}function r(v,b){return b()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=f,s=typeof Object.is=="function"?Object.is:e,a=o.useState,c=o.useEffect,d=o.useLayoutEffect,u=o.useDebugValue,p=!1,h=!1,x=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;It.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:x,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=Vr():at.exports=Wr()),at.exports}var wn;function Ur(){if(wn)return kt;wn=1;var e=f,t=Xn();function n(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,a=e.useEffect,c=e.useMemo,d=e.useDebugValue;return kt.useSyncExternalStoreWithSelector=function(u,p,h,x,v){var b=s(null);if(b.current===null){var g={hasValue:!1,value:null};b.current=g}else g=b.current;b=c(function(){function w(_){if(!T){if(T=!0,j=_,_=x(_),v!==void 0&&g.hasValue){var I=g.value;if(v(I,_))return O=I}return O=_}if(I=O,r(j,_))return I;var P=x(_);return v!==void 0&&v(I,P)?(j=_,I):(j=_,O=P)}var T=!1,j,O,k=h===void 0?null:h;return[function(){return w(p())},k===null?void 0:function(){return w(k())}]},[p,h,x,v]);var y=o(u,b[0],b[1]);return a(function(){g.hasValue=!0,g.value=y},[y]),d(y),y},kt}var At={};var Dn;function Gr(){return Dn||(Dn=1,process.env.NODE_ENV!=="production"&&(function(){function e(u,p){return u===p&&(u!==0||1/u===1/p)||u!==u&&p!==p}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=f,n=Xn(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,a=t.useEffect,c=t.useMemo,d=t.useDebugValue;At.useSyncExternalStoreWithSelector=function(u,p,h,x,v){var b=s(null);if(b.current===null){var g={hasValue:!1,value:null};b.current=g}else g=b.current;b=c(function(){function w(_){if(!T){if(T=!0,j=_,_=x(_),v!==void 0&&g.hasValue){var I=g.value;if(v(I,_))return O=I}return O=_}if(I=O,r(j,_))return I;var P=x(_);return v!==void 0&&v(I,P)?(j=_,I):(j=_,O=P)}var T=!1,j,O,k=h===void 0?null:h;return[function(){return w(p())},k===null?void 0:function(){return w(k())}]},[p,h,x,v]);var y=o(u,b[0],b[1]);return a(function(){g.hasValue=!0,g.value=y},[y]),d(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),At}var Cn;function Xr(){return Cn||(Cn=1,process.env.NODE_ENV==="production"?it.exports=Ur():it.exports=Gr()),it.exports}var qr=Xr();const Ht=new WeakMap,Kr=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=Kr.get(t);if(n)for(const r of n){const o=Ht.get(r);o?.length&&qn(o)}}}function Jr(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Zr(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Qr(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,Jr(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)Zr(o)}}}finally{Lt=!1,mt.current=[],Rn.clear()}}function eo(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):eo(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Qr(this)}}function Qe(e,t=r=>r,n={}){const r=n.equal??to;return qr.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function to(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 no(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.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 ie(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}=ie(e);return e instanceof t}function et(e){return Ae(e)?!1:e instanceof ie(e).HTMLElement}function Jn(e){return e instanceof ie(e).SVGElement}function Le(e){return e?Ae(e)?e.document:Jt(e)?Zt(e)?e:et(e)||Jn(e)?e.ownerDocument:document:document:document}const be=Dt?f.useLayoutEffect:f.useEffect;function Qt(e){const t=f.useRef(e);return be(()=>{t.current=e}),f.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 ro(){const e=f.useRef(null),t=f.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=f.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ke(e,t){t===void 0&&(t=[e]);const n=f.useRef(e);return be(()=>{n.current!==e&&(n.current=e)},t),n}function tt(e,t){const n=f.useRef();return f.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function bt(e){const t=Qt(e),n=f.useRef(null),r=f.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function Vt(e){const t=f.useRef();return f.useEffect(()=>{t.current=e},[e]),t.current}let Nt={};function nt(e,t){return f.useMemo(()=>{if(t)return t;const n=Nt[e]==null?0:Nt[e]+1;return Nt[e]=n,e+"-"+n},[e,t])}function Zn(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[d,u]of c){const p=s[d];p!=null&&(s[d]=p+e*u)}return s},{...t})}}const $e=Zn(1),xt=Zn(-1);function oo(e){return"clientX"in e&&"clientY"in e}function en(e){if(!e)return!1;const{KeyboardEvent:t}=ie(e.target);return t&&e instanceof t}function so(e){if(!e)return!1;const{TouchEvent:t}=ie(e.target);return t&&e instanceof t}function Wt(e){if(so(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 oo(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 io(e){return e.matches(Tn)?e:e.querySelector(Tn)}const ao={display:"none"};function co(e){let{id:t,value:n}=e;return f.createElement("div",{id:t,style:ao},n)}function lo(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 f.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function uo(){const[e,t]=f.useState("");return{announce:f.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Qn=f.createContext(null);function fo(e){const t=f.useContext(Qn);f.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function ho(){const[e]=f.useState(()=>new Set),t=f.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[f.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 go={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
- `},ro={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 oo(e){let{announcements:t=ro,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=no}=e;const{announce:s,announcement:i}=Qr(),l=nt("DndLiveRegion"),[u,f]=d.useState(!1);if(d.useEffect(()=>{f(!0)},[]),eo(d.useMemo(()=>({onDragStart(g){let{active:S}=g;s(t.onDragStart({active:S}))},onDragMove(g){let{active:S,over:v}=g;t.onDragMove&&s(t.onDragMove({active:S,over:v}))},onDragOver(g){let{active:S,over:v}=g;s(t.onDragOver({active:S,over:v}))},onDragEnd(g){let{active:S,over:v}=g;s(t.onDragEnd({active:S,over:v}))},onDragCancel(g){let{active:S,over:v}=g;s(t.onDragCancel({active:S,over:v}))}}),[s,t])),!u)return null;const p=d.createElement(d.Fragment,null,d.createElement(Jr,{id:r,value:o.draggable}),d.createElement(Zr,{id:l,announcement:i}));return n?Ue.createPortal(p,n):p}var F;(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"})(F||(F={}));function vt(){}function so(e,t){return d.useMemo(()=>({sensor:e,options:{}}),[e,t])}function io(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return d.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const ae=Object.freeze({x:0,y:0});function ao(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function lo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function co(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function uo(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function yn(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 Hn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=yn(t,t.left,t.top),s=[];for(const i of r){const{id:l}=i,u=n.get(l);if(u){const f=ao(yn(u),o);s.push({id:l,data:{droppableContainer:i,value:f}})}}return s.sort(lo)};function fo(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),i=o-r,l=s-n;if(r<o&&n<s){const u=t.width*t.height,f=e.width*e.height,p=i*l,g=p/(u+f-p);return Number(g.toFixed(4))}return 0}const ho=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:i}=s,l=n.get(i);if(l){const u=fo(l,t);u>0&&o.push({id:i,data:{droppableContainer:s,value:u}})}}return o.sort(co)};function go(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Yn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ae}function po(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((i,l)=>({...i,top:i.top+e*l.y,bottom:i.bottom+e*l.y,left:i.left+e*l.x,right:i.right+e*l.x}),{...n})}}const vo=po(1);function bo(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 mo(e,t,n){const r=bo(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:l}=r,u=e.left-i-(1-o)*parseFloat(n),f=e.top-l-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),p=o?e.width/o:e.width,g=s?e.height/s:e.height;return{width:p,height:g,top:f,right:u+p,bottom:f+g,left:u}}const xo={ignoreTransform:!1};function Le(e,t){t===void 0&&(t=xo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:f,transformOrigin:p}=K(e).getComputedStyle(e);f&&(n=mo(n,f,p))}const{top:r,left:o,width:s,height:i,bottom:l,right:u}=n;return{top:r,left:o,width:s,height:i,bottom:l,right:u}}function wn(e){return Le(e,{ignoreTransform:!0})}function So(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function yo(e,t){return t===void 0&&(t=K(e).getComputedStyle(e)),t.position==="fixed"}function wo(e,t){t===void 0&&(t=K(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 Xt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Wt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!et(o)||Fn(o)||n.includes(o))return n;const s=K(e).getComputedStyle(o);return o!==e&&wo(o,s)&&n.push(o),yo(o,s)?n:r(o.parentNode)}return e?r(e):n}function Wn(e){const[t]=Xt(e,1);return t??null}function kt(e){return!mt||!e?null:Ae(e)?e:Yt(e)?Wt(e)||e===Ne(e).scrollingElement?window:et(e)?e:null:null}function Un(e){return Ae(e)?e.scrollX:e.scrollLeft}function Gn(e){return Ae(e)?e.scrollY:e.scrollTop}function Ft(e){return{x:Un(e),y:Gn(e)}}var B;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(B||(B={}));function Xn(e){return!mt||!e?!1:e===document.scrollingElement}function qn(e){const t={x:0,y:0},n=Xn(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,i=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:l,maxScroll:r,minScroll:t}}const Co={x:.2,y:.2};function Ro(e,t,n,r,o){let{top:s,left:i,right:l,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=Co);const{isTop:f,isBottom:p,isLeft:g,isRight:S}=qn(e),v={x:0,y:0},m={x:0,y:0},h={height:t.height*o.y,width:t.width*o.x};return!f&&s<=t.top+h.height?(v.y=B.Backward,m.y=r*Math.abs((t.top+h.height-s)/h.height)):!p&&u>=t.bottom-h.height&&(v.y=B.Forward,m.y=r*Math.abs((t.bottom-h.height-u)/h.height)),!S&&l>=t.right-h.width?(v.x=B.Forward,m.x=r*Math.abs((t.right-h.width-l)/h.width)):!g&&i<=t.left+h.width&&(v.x=B.Backward,m.x=r*Math.abs((t.left+h.width-i)/h.width)),{direction:v,speed:m}}function Eo(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}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 Kn(e){return e.reduce((t,n)=>ke(t,Ft(n)),ae)}function Do(e){return e.reduce((t,n)=>t+Un(n),0)}function To(e){return e.reduce((t,n)=>t+Gn(n),0)}function jo(e,t){if(t===void 0&&(t=Le),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Wn(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const _o=[["x",["left","right"],Do],["y",["top","bottom"],To]];class qt{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=Xt(n),o=Kn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,l]of _o)for(const u of i)Object.defineProperty(this,u,{get:()=>{const f=l(r),p=o[s]-f;return this.rect[u]+p},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 Oo(e){const{EventTarget:t}=K(e);return e instanceof t?e:Ne(e)}function Mt(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 se;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(se||(se={}));function Cn(e){e.preventDefault()}function Io(e){e.stopPropagation()}var k;(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"})(k||(k={}));const Jn={start:[k.Space,k.Enter],cancel:[k.Esc],end:[k.Space,k.Enter,k.Tab]},ko=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case k.Right:return{...n,x:n.x+25};case k.Left:return{...n,x:n.x-25};case k.Down:return{...n,y:n.y+25};case k.Up:return{...n,y:n.y-25}}};class Zn{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(Ne(n)),this.windowListeners=new Ge(K(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(se.Resize,this.handleCancel),this.windowListeners.add(se.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(se.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&jo(r),n(ae)}handleKeyDown(t){if(Gt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=Jn,coordinateGetter:i=ko,scrollBehavior:l="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:f}=r.current,p=f?{x:f.left,y:f.top}:ae;this.referenceCoordinates||(this.referenceCoordinates=p);const g=i(t,{active:n,context:r.current,currentCoordinates:p});if(g){const S=pt(g,p),v={x:0,y:0},{scrollableAncestors:m}=r.current;for(const h of m){const x=t.code,{isTop:y,isRight:C,isLeft:R,isBottom:E,maxScroll:_,minScroll:T}=qn(h),j=Eo(h),O={x:Math.min(x===k.Right?j.right-j.width/2:j.right,Math.max(x===k.Right?j.left:j.left+j.width/2,g.x)),y:Math.min(x===k.Down?j.bottom-j.height/2:j.bottom,Math.max(x===k.Down?j.top:j.top+j.height/2,g.y))},L=x===k.Right&&!C||x===k.Left&&!R,P=x===k.Down&&!E||x===k.Up&&!y;if(L&&O.x!==g.x){const N=h.scrollLeft+S.x,U=x===k.Right&&N<=_.x||x===k.Left&&N>=T.x;if(U&&!S.y){h.scrollTo({left:N,behavior:l});return}U?v.x=h.scrollLeft-N:v.x=x===k.Right?h.scrollLeft-_.x:h.scrollLeft-T.x,v.x&&h.scrollBy({left:-v.x,behavior:l});break}else if(P&&O.y!==g.y){const N=h.scrollTop+S.y,U=x===k.Down&&N<=_.y||x===k.Up&&N>=T.y;if(U&&!S.x){h.scrollTo({top:N,behavior:l});return}U?v.y=h.scrollTop-N:v.y=x===k.Down?h.scrollTop-_.y:h.scrollTop-T.y,v.y&&h.scrollBy({top:-v.y,behavior:l});break}}this.handleMove(t,ke(pt(g,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()}}Zn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Jn,onActivation:o}=t,{active:s}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const l=s.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function Rn(e){return!!(e&&"distance"in e)}function En(e){return!!(e&&"delay"in e)}class Kt{constructor(t,n,r){var o;r===void 0&&(r=Oo(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:i}=s;this.props=t,this.events=n,this.document=Ne(i),this.documentListeners=new Ge(this.document),this.listeners=new Ge(r),this.windowListeners=new Ge(K(i)),this.initialCoordinates=(o=zt(s))!=null?o:ae,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(se.Resize,this.handleCancel),this.windowListeners.add(se.DragStart,Cn),this.windowListeners.add(se.VisibilityChange,this.handleCancel),this.windowListeners.add(se.ContextMenu,Cn),this.documentListeners.add(se.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(En(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Rn(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(se.Click,Io,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(se.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:l}}=s;if(!o)return;const u=(n=zt(t))!=null?n:ae,f=pt(o,u);if(!r&&l){if(Rn(l)){if(l.tolerance!=null&&Mt(f,l.tolerance))return this.handleCancel();if(Mt(f,l.distance))return this.handleStart()}if(En(l)&&Mt(f,l.tolerance))return this.handleCancel();this.handlePending(l,f);return}t.cancelable&&t.preventDefault(),i(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===k.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Mo={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Jt extends Kt{constructor(t){const{event:n}=t,r=Ne(n.target);super(t,Mo,r)}}Jt.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 Ao={move:{name:"mousemove"},end:{name:"mouseup"}};var Bt;(function(e){e[e.RightClick=2]="RightClick"})(Bt||(Bt={}));class No extends Kt{constructor(t){super(t,Ao,Ne(t.event.target))}}No.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Bt.RightClick?!1:(r?.({event:n}),!0)}}];const At={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Lo extends Kt{constructor(t){super(t,At)}static setup(){return window.addEventListener(At.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(At.move.name,t)};function t(){}}}Lo.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 bt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(bt||(bt={}));function $o(e){let{acceleration:t,activator:n=Xe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:l=bt.TreeOrder,pointerCoordinates:u,scrollableAncestors:f,scrollableAncestorRects:p,delta:g,threshold:S}=e;const v=zo({delta:g,disabled:!s}),[m,h]=Ur(),x=d.useRef({x:0,y:0}),y=d.useRef({x:0,y:0}),C=d.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]),R=d.useRef(null),E=d.useCallback(()=>{const T=R.current;if(!T)return;const j=x.current.x*y.current.x,O=x.current.y*y.current.y;T.scrollBy(j,O)},[]),_=d.useMemo(()=>l===bt.TreeOrder?[...f].reverse():f,[l,f]);d.useEffect(()=>{if(!s||!f.length||!C){h();return}for(const T of _){if(r?.(T)===!1)continue;const j=f.indexOf(T),O=p[j];if(!O)continue;const{direction:L,speed:P}=Ro(T,O,C,t,S);for(const N of["x","y"])v[N][L[N]]||(P[N]=0,L[N]=0);if(P.x>0||P.y>0){h(),R.current=T,m(E,i),x.current=P,y.current=L;return}}x.current={x:0,y:0},y.current={x:0,y:0},h()},[t,E,r,h,s,i,JSON.stringify(C),JSON.stringify(v),m,f,_,p,JSON.stringify(S)])}const Po={x:{[B.Backward]:!1,[B.Forward]:!1},y:{[B.Backward]:!1,[B.Forward]:!1}};function zo(e){let{delta:t,disabled:n}=e;const r=Pt(t);return tt(o=>{if(n||!r||!o)return Po;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[B.Backward]:o.x[B.Backward]||s.x===-1,[B.Forward]:o.x[B.Forward]||s.x===1},y:{[B.Backward]:o.y[B.Backward]||s.y===-1,[B.Forward]:o.y[B.Forward]||s.y===1}}},[n,t,r])}function Fo(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 Bo(e,t){return d.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(i=>({eventName:i.eventName,handler:t(i.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 Vt;(function(e){e.Optimized="optimized"})(Vt||(Vt={}));const Dn=new Map;function Vo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=d.useState(null),{frequency:l,measure:u,strategy:f}=o,p=d.useRef(e),g=x(),S=Ke(g),v=d.useCallback(function(y){y===void 0&&(y=[]),!S.current&&i(C=>C===null?y:C.concat(y.filter(R=>!C.includes(R))))},[S]),m=d.useRef(null),h=tt(y=>{if(g&&!n)return Dn;if(!y||y===Dn||p.current!==e||s!=null){const C=new Map;for(let R of e){if(!R)continue;if(s&&s.length>0&&!s.includes(R.id)&&R.rect.current){C.set(R.id,R.rect.current);continue}const E=R.node.current,_=E?new qt(u(E),E):null;R.rect.current=_,_&&C.set(R.id,_)}return C}return y},[e,s,n,g,u]);return d.useEffect(()=>{p.current=e},[e]),d.useEffect(()=>{g||v()},[n,g]),d.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),d.useEffect(()=>{g||typeof l!="number"||m.current!==null||(m.current=setTimeout(()=>{v(),m.current=null},l))},[l,g,v,...r]),{droppableRects:h,measureDroppableContainers:v,measuringScheduled:s!=null};function x(){switch(f){case Je.Always:return!1;case Je.BeforeDragging:return n;default:return!n}}}function Qn(e,t){return tt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Ho(e,t){return Qn(e,t)}function Yo(e){let{callback:t,disabled:n}=e;const r=Ut(t),o=d.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return d.useEffect(()=>()=>o?.disconnect(),[o]),o}function xt(e){let{callback:t,disabled:n}=e;const r=Ut(t),o=d.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return d.useEffect(()=>()=>o?.disconnect(),[o]),o}function Wo(e){return new qt(Le(e),e)}function Tn(e,t,n){t===void 0&&(t=Wo);const[r,o]=d.useState(null);function s(){o(u=>{if(!e)return null;if(e.isConnected===!1){var f;return(f=u??n)!=null?f:null}const p=t(e);return JSON.stringify(u)===JSON.stringify(p)?u:p})}const i=Yo({callback(u){if(e)for(const f of u){const{type:p,target:g}=f;if(p==="childList"&&g instanceof HTMLElement&&g.contains(e)){s();break}}}}),l=xt({callback:s});return fe(()=>{s(),e?(l?.observe(e),i?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),i?.disconnect())},[e]),r}function Uo(e){const t=Qn(e);return Yn(e,t)}const jn=[];function Go(e){const t=d.useRef(e),n=tt(r=>e?r&&r!==jn&&e&&t.current&&e.parentNode===t.current.parentNode?r:Xt(e):jn,[e]);return d.useEffect(()=>{t.current=e},[e]),n}function Xo(e){const[t,n]=d.useState(null),r=d.useRef(e),o=d.useCallback(s=>{const i=kt(s.target);i&&n(l=>l?(l.set(i,Ft(i)),new Map(l)):null)},[]);return d.useEffect(()=>{const s=r.current;if(e!==s){i(s);const l=e.map(u=>{const f=kt(u);return f?(f.addEventListener("scroll",o,{passive:!0}),[f,Ft(f)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),r.current=e}return()=>{i(e),i(s)};function i(l){l.forEach(u=>{const f=kt(u);f?.removeEventListener("scroll",o)})}},[o,e]),d.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>ke(s,i),ae):Kn(e):ae,[e,t])}function _n(e,t){t===void 0&&(t=[]);const n=d.useRef(null);return d.useEffect(()=>{n.current=null},t),d.useEffect(()=>{const r=e!==ae;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?pt(e,n.current):ae}function qo(e){d.useEffect(()=>{if(!mt)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 Ko(e,t){return d.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function er(e){return d.useMemo(()=>e?So(e):null,[e])}const On=[];function Jo(e,t){t===void 0&&(t=Le);const[n]=e,r=er(n?K(n):null),[o,s]=d.useState(On);function i(){s(()=>e.length?e.map(u=>Xn(u)?r:new qt(t(u),u)):On)}const l=xt({callback:i});return fe(()=>{l?.disconnect(),i(),e.forEach(u=>l?.observe(u))},[e]),o}function Zo(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return et(t)?t:e}function Qo(e){let{measure:t}=e;const[n,r]=d.useState(null),o=d.useCallback(f=>{for(const{target:p}of f)if(et(p)){r(g=>{const S=t(p);return g?{...g,width:S.width,height:S.height}:S});break}},[t]),s=xt({callback:o}),i=d.useCallback(f=>{const p=Zo(f);s?.disconnect(),p&&s?.observe(p),r(p?t(p):null)},[t,s]),[l,u]=gt(i);return d.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const es=[{sensor:Jt,options:{}},{sensor:Zn,options:{}}],ts={current:{}},ft={draggable:{measure:wn},droppable:{measure:wn,strategy:Je.WhileDragging,frequency:Vt.Optimized},dragOverlay:{measure:Le}};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 ns={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:vt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ft,measureDroppableContainers:vt,windowRect:null,measuringScheduled:!1},rs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:vt,draggableNodes:new Map,over:null,measureDroppableContainers:vt},St=d.createContext(rs),tr=d.createContext(ns);function os(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new qe}}}function ss(e,t){switch(t.type){case F.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case F.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 F.DragEnd:case F.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case F.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 F.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new qe(e.droppable.containers);return i.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case F.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 is(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=d.useContext(St),s=Pt(r),i=Pt(n?.id);return d.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!Gt(s)||document.activeElement===s.target)return;const l=o.get(i);if(!l)return;const{activatorNode:u,node:f}=l;if(!u.current&&!f.current)return;requestAnimationFrame(()=>{for(const p of[u.current,f.current]){if(!p)continue;const g=qr(p);if(g){g.focus();break}}})}},[r,t,o,i,s]),null}function as(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function ls(e){return d.useMemo(()=>({draggable:{...ft.draggable,...e?.draggable},droppable:{...ft.droppable,...e?.droppable},dragOverlay:{...ft.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function cs(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=d.useRef(!1),{x:i,y:l}=typeof o=="boolean"?{x:o,y:o}:o;fe(()=>{if(!i&&!l||!t){s.current=!1;return}if(s.current||!r)return;const f=t?.node.current;if(!f||f.isConnected===!1)return;const p=n(f),g=Yn(p,r);if(i||(g.x=0),l||(g.y=0),s.current=!0,Math.abs(g.x)>0||Math.abs(g.y)>0){const S=Wn(f);S&&S.scrollBy({top:g.y,left:g.x})}},[t,i,l,r,n])}const nr=d.createContext({...ae,scaleX:1,scaleY:1});var we;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(we||(we={}));const rr=d.memo(function(t){var n,r,o,s;let{id:i,accessibility:l,autoScroll:u=!0,children:f,sensors:p=es,collisionDetection:g=ho,measuring:S,modifiers:v,...m}=t;const h=d.useReducer(ss,void 0,os),[x,y]=h,[C,R]=to(),[E,_]=d.useState(we.Uninitialized),T=E===we.Initialized,{draggable:{active:j,nodes:O,translate:L},droppable:{containers:P}}=x,N=j!=null?O.get(j):null,U=d.useRef({initial:null,translated:null}),q=d.useMemo(()=>{var W;return j!=null?{id:j,data:(W=N?.data)!=null?W:ts,rect:U}:null},[j,N]),ne=d.useRef(null),[he,Re]=d.useState(null),[H,Ee]=d.useState(null),re=Ke(m,Object.values(m)),ve=nt("DndDescribedBy",i),b=d.useMemo(()=>P.getEnabled(),[P]),D=ls(S),{droppableRects:I,measureDroppableContainers:A,measuringScheduled:le}=Vo(b,{dragging:T,dependencies:[L.x,L.y],config:D.droppable}),Y=Fo(O,j),$=d.useMemo(()=>H?zt(H):null,[H]),G=_r(),J=Ho(Y,D.draggable.measure);cs({activeNode:j!=null?O.get(j):null,config:G.layoutShiftCompensation,initialRect:J,measure:D.draggable.measure});const M=Tn(Y,D.draggable.measure,J),$e=Tn(Y?Y.parentElement:null),ce=d.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:O,draggingNode:null,draggingNodeRect:null,droppableContainers:P,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),De=P.getNodeFor((n=ce.current.over)==null?void 0:n.id),ge=Qo({measure:D.dragOverlay.measure}),Te=(r=ge.nodeRef.current)!=null?r:Y,je=T?(o=ge.rect)!=null?o:M:null,en=!!(ge.nodeRef.current&&ge.rect),tn=Uo(en?null:M),Ct=er(Te?K(Te):null),be=Go(T?De??Y:null),rt=Jo(be),ot=as(v,{transform:{x:L.x-tn.x,y:L.y-tn.y,scaleX:1,scaleY:1},activatorEvent:H,active:q,activeNodeRect:M,containerNodeRect:$e,draggingNodeRect:je,over:ce.current.over,overlayNodeRect:ge.rect,scrollableAncestors:be,scrollableAncestorRects:rt,windowRect:Ct}),nn=$?ke($,L):null,rn=Xo(be),wr=_n(rn),Cr=_n(rn,[M]),_e=ke(ot,wr),Oe=je?vo(je,ot):null,Pe=q&&Oe?g({active:q,collisionRect:Oe,droppableRects:I,droppableContainers:b,pointerCoordinates:nn}):null,on=uo(Pe,"id"),[me,sn]=d.useState(null),Rr=en?ot:ke(ot,Cr),Er=go(Rr,(s=me?.rect)!=null?s:null,M),Rt=d.useRef(null),an=d.useCallback((W,Z)=>{let{sensor:Q,options:xe}=Z;if(ne.current==null)return;const oe=O.get(ne.current);if(!oe)return;const ee=W.nativeEvent,ue=new Q({active:ne.current,activeNode:oe,event:ee,options:xe,context:ce,onAbort(V){if(!O.get(V))return;const{onDragAbort:de}=re.current,pe={id:V};de?.(pe),C({type:"onDragAbort",event:pe})},onPending(V,Se,de,pe){if(!O.get(V))return;const{onDragPending:Fe}=re.current,ye={id:V,constraint:Se,initialCoordinates:de,offset:pe};Fe?.(ye),C({type:"onDragPending",event:ye})},onStart(V){const Se=ne.current;if(Se==null)return;const de=O.get(Se);if(!de)return;const{onDragStart:pe}=re.current,ze={activatorEvent:ee,active:{id:Se,data:de.data,rect:U}};Ue.unstable_batchedUpdates(()=>{pe?.(ze),_(we.Initializing),y({type:F.DragStart,initialCoordinates:V,active:Se}),C({type:"onDragStart",event:ze}),Re(Rt.current),Ee(ee)})},onMove(V){y({type:F.DragMove,coordinates:V})},onEnd:Ie(F.DragEnd),onCancel:Ie(F.DragCancel)});Rt.current=ue;function Ie(V){return async function(){const{active:de,collisions:pe,over:ze,scrollAdjustedTranslate:Fe}=ce.current;let ye=null;if(de&&Fe){const{cancelDrop:Be}=re.current;ye={activatorEvent:ee,active:de,collisions:pe,delta:Fe,over:ze},V===F.DragEnd&&typeof Be=="function"&&await Promise.resolve(Be(ye))&&(V=F.DragCancel)}ne.current=null,Ue.unstable_batchedUpdates(()=>{y({type:V}),_(we.Uninitialized),sn(null),Re(null),Ee(null),Rt.current=null;const Be=V===F.DragEnd?"onDragEnd":"onDragCancel";if(ye){const Et=re.current[Be];Et?.(ye),C({type:Be,event:ye})}})}}},[O]),Dr=d.useCallback((W,Z)=>(Q,xe)=>{const oe=Q.nativeEvent,ee=O.get(xe);if(ne.current!==null||!ee||oe.dndKit||oe.defaultPrevented)return;const ue={active:ee};W(Q,Z.options,ue)===!0&&(oe.dndKit={capturedBy:Z.sensor},ne.current=xe,an(Q,Z))},[O,an]),ln=Bo(p,Dr);qo(p),fe(()=>{M&&E===we.Initializing&&_(we.Initialized)},[M,E]),d.useEffect(()=>{const{onDragMove:W}=re.current,{active:Z,activatorEvent:Q,collisions:xe,over:oe}=ce.current;if(!Z||!Q)return;const ee={active:Z,activatorEvent:Q,collisions:xe,delta:{x:_e.x,y:_e.y},over:oe};Ue.unstable_batchedUpdates(()=>{W?.(ee),C({type:"onDragMove",event:ee})})},[_e.x,_e.y]),d.useEffect(()=>{const{active:W,activatorEvent:Z,collisions:Q,droppableContainers:xe,scrollAdjustedTranslate:oe}=ce.current;if(!W||ne.current==null||!Z||!oe)return;const{onDragOver:ee}=re.current,ue=xe.get(on),Ie=ue&&ue.rect.current?{id:ue.id,rect:ue.rect.current,data:ue.data,disabled:ue.disabled}:null,V={active:W,activatorEvent:Z,collisions:Q,delta:{x:oe.x,y:oe.y},over:Ie};Ue.unstable_batchedUpdates(()=>{sn(Ie),ee?.(V),C({type:"onDragOver",event:V})})},[on]),fe(()=>{ce.current={activatorEvent:H,active:q,activeNode:Y,collisionRect:Oe,collisions:Pe,droppableRects:I,draggableNodes:O,draggingNode:Te,draggingNodeRect:je,droppableContainers:P,over:me,scrollableAncestors:be,scrollAdjustedTranslate:_e},U.current={initial:je,translated:Oe}},[q,Y,Pe,Oe,O,Te,je,I,P,me,be,_e]),$o({...G,delta:L,draggingRect:Oe,pointerCoordinates:nn,scrollableAncestors:be,scrollableAncestorRects:rt});const Tr=d.useMemo(()=>({active:q,activeNode:Y,activeNodeRect:M,activatorEvent:H,collisions:Pe,containerNodeRect:$e,dragOverlay:ge,draggableNodes:O,droppableContainers:P,droppableRects:I,over:me,measureDroppableContainers:A,scrollableAncestors:be,scrollableAncestorRects:rt,measuringConfiguration:D,measuringScheduled:le,windowRect:Ct}),[q,Y,M,H,Pe,$e,ge,O,P,I,me,A,be,rt,D,le,Ct]),jr=d.useMemo(()=>({activatorEvent:H,activators:ln,active:q,activeNodeRect:M,ariaDescribedById:{draggable:ve},dispatch:y,draggableNodes:O,over:me,measureDroppableContainers:A}),[H,ln,q,M,y,ve,O,me,A]);return d.createElement(Vn.Provider,{value:R},d.createElement(St.Provider,{value:jr},d.createElement(tr.Provider,{value:Tr},d.createElement(nr.Provider,{value:Er},f)),d.createElement(is,{disabled:l?.restoreFocus===!1})),d.createElement(oo,{...l,hiddenTextDescribedById:ve}));function _r(){const W=he?.autoScrollEnabled===!1,Z=typeof u=="object"?u.enabled===!1:u===!1,Q=T&&!W&&!Z;return typeof u=="object"?{...u,enabled:Q}:{enabled:Q}}}),us=d.createContext(null),In="button",ds="Draggable";function fs(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=nt(ds),{activators:i,activatorEvent:l,active:u,activeNodeRect:f,ariaDescribedById:p,draggableNodes:g,over:S}=d.useContext(St),{role:v=In,roleDescription:m="draggable",tabIndex:h=0}=o??{},x=u?.id===t,y=d.useContext(x?nr:us),[C,R]=gt(),[E,_]=gt(),T=Ko(i,t),j=Ke(n);fe(()=>(g.set(t,{id:t,key:s,node:C,activatorNode:E,data:j}),()=>{const L=g.get(t);L&&L.key===s&&g.delete(t)}),[g,t]);const O=d.useMemo(()=>({role:v,tabIndex:h,"aria-disabled":r,"aria-pressed":x&&v===In?!0:void 0,"aria-roledescription":m,"aria-describedby":p.draggable}),[r,v,h,x,m,p.draggable]);return{active:u,activatorEvent:l,activeNodeRect:f,attributes:O,isDragging:x,listeners:r?void 0:T,node:C,over:S,setNodeRef:R,setActivatorNodeRef:_,transform:y}}function hs(){return d.useContext(tr)}const gs="Droppable",ps={timeout:25};function vs(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=nt(gs),{active:i,dispatch:l,over:u,measureDroppableContainers:f}=d.useContext(St),p=d.useRef({disabled:n}),g=d.useRef(!1),S=d.useRef(null),v=d.useRef(null),{disabled:m,updateMeasurementsFor:h,timeout:x}={...ps,...o},y=Ke(h??r),C=d.useCallback(()=>{if(!g.current){g.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{f(Array.isArray(y.current)?y.current:[y.current]),v.current=null},x)},[x]),R=xt({callback:C,disabled:m||!i}),E=d.useCallback((O,L)=>{R&&(L&&(R.unobserve(L),g.current=!1),O&&R.observe(O))},[R]),[_,T]=gt(E),j=Ke(t);return d.useEffect(()=>{!R||!_.current||(R.disconnect(),g.current=!1,R.observe(_.current))},[_,R]),d.useEffect(()=>(l({type:F.RegisterDroppable,element:{id:r,key:s,disabled:n,node:_,rect:S,data:j}}),()=>l({type:F.UnregisterDroppable,key:s,id:r})),[r]),d.useEffect(()=>{n!==p.current.disabled&&(l({type:F.SetDroppableDisabled,id:r,key:s,disabled:n}),p.current.disabled=n)},[r,s,n,l]),{active:i,rect:S,isOver:u?.id===r,node:_,over:u,setNodeRef:T}}function yt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function bs(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function ct(e){return e!==null&&e>=0}function ms(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 xs(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ut={scaleX:1,scaleY:1},Ss=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:i}=e;const l=(t=n[o])!=null?t:r;if(!l)return null;const u=ys(n,i,o);if(i===o){const f=n[s];return f?{x:o<s?f.left+f.width-(l.left+l.width):f.left-l.left,y:0,...ut}:null}return i>o&&i<=s?{x:-l.width-u,y:0,...ut}:i<o&&i>=s?{x:l.width+u,y:0,...ut}:{x:0,y:0,...ut}};function ys(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 or=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=yt(t,r,n),i=t[o],l=s[o];return!l||!i?null:{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}},dt={scaleX:1,scaleY:1},ws=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:i}=e;const l=(t=s[n])!=null?t:r;if(!l)return null;if(o===n){const f=s[i];return f?{x:0,y:n<i?f.top+f.height-(l.top+l.height):f.top-l.top,...dt}:null}const u=Cs(s,o,n);return o>n&&o<=i?{x:0,y:-l.height-u,...dt}:o<n&&o>=i?{x:0,y:l.height+u,...dt}:{x:0,y:0,...dt}};function Cs(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",ir=d.createContext({activeIndex:-1,containerId:sr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:or,disabled:{draggable:!1,droppable:!1}});function ar(e){let{children:t,id:n,items:r,strategy:o=or,disabled:s=!1}=e;const{active:i,dragOverlay:l,droppableRects:u,over:f,measureDroppableContainers:p}=hs(),g=nt(sr,n),S=l.rect!==null,v=d.useMemo(()=>r.map(T=>typeof T=="object"&&"id"in T?T.id:T),[r]),m=i!=null,h=i?v.indexOf(i.id):-1,x=f?v.indexOf(f.id):-1,y=d.useRef(v),C=!ms(v,y.current),R=x!==-1&&h===-1||C,E=xs(s);fe(()=>{C&&m&&p(v)},[C,v,m,p]),d.useEffect(()=>{y.current=v},[v]);const _=d.useMemo(()=>({activeIndex:h,containerId:g,disabled:E,disableTransforms:R,items:v,overIndex:x,useDragOverlay:S,sortedRects:bs(v,u),strategy:o}),[h,g,E.draggable,E.droppable,R,v,x,u,S,o]);return d.createElement(ir.Provider,{value:_},t)}const Rs=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return yt(n,r,o).indexOf(t)},Es=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:i,previousItems:l,previousContainerId:u,transition:f}=e;return!f||!r||l!==s&&o===i?!1:n?!0:i!==o&&t===u},Ds={duration:200,easing:"ease"},lr="transform",Ts=Me.Transition.toString({property:lr,duration:0,easing:"linear"}),js={roleDescription:"sortable"};function _s(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,i]=d.useState(null),l=d.useRef(n);return fe(()=>{if(!t&&n!==l.current&&r.current){const u=o.current;if(u){const f=Le(r.current,{ignoreTransform:!0}),p={x:u.left-f.left,y:u.top-f.top,scaleX:u.width/f.width,scaleY:u.height/f.height};(p.x||p.y)&&i(p)}}n!==l.current&&(l.current=n)},[t,n,r,o]),d.useEffect(()=>{s&&i(null)},[s]),s}function cr(e){let{animateLayoutChanges:t=Es,attributes:n,disabled:r,data:o,getNewIndex:s=Rs,id:i,strategy:l,resizeObserverConfig:u,transition:f=Ds}=e;const{items:p,containerId:g,activeIndex:S,disabled:v,disableTransforms:m,sortedRects:h,overIndex:x,useDragOverlay:y,strategy:C}=d.useContext(ir),R=Os(r,v),E=p.indexOf(i),_=d.useMemo(()=>({sortable:{containerId:g,index:E,items:p},...o}),[g,o,E,p]),T=d.useMemo(()=>p.slice(p.indexOf(i)),[p,i]),{rect:j,node:O,isOver:L,setNodeRef:P}=vs({id:i,data:_,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:T,...u}}),{active:N,activatorEvent:U,activeNodeRect:q,attributes:ne,setNodeRef:he,listeners:Re,isDragging:H,over:Ee,setActivatorNodeRef:re,transform:ve}=fs({id:i,data:_,attributes:{...js,...n},disabled:R.draggable}),b=Wr(P,he),D=!!N,I=D&&!m&&ct(S)&&ct(x),A=!y&&H,le=A&&I?ve:null,$=I?le??(l??C)({rects:h,activeNodeRect:q,activeIndex:S,overIndex:x,index:E}):null,G=ct(S)&&ct(x)?s({id:i,items:p,activeIndex:S,overIndex:x}):E,J=N?.id,M=d.useRef({activeId:J,items:p,newIndex:G,containerId:g}),$e=p!==M.current.items,ce=t({active:N,containerId:g,isDragging:H,isSorting:D,id:i,index:E,items:p,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:f,wasDragging:M.current.activeId!=null}),De=_s({disabled:!ce,index:E,node:O,rect:j});return d.useEffect(()=>{D&&M.current.newIndex!==G&&(M.current.newIndex=G),g!==M.current.containerId&&(M.current.containerId=g),p!==M.current.items&&(M.current.items=p)},[D,G,g,p]),d.useEffect(()=>{if(J===M.current.activeId)return;if(J!=null&&M.current.activeId==null){M.current.activeId=J;return}const Te=setTimeout(()=>{M.current.activeId=J},50);return()=>clearTimeout(Te)},[J]),{active:N,activeIndex:S,attributes:ne,data:_,rect:j,index:E,newIndex:G,items:p,isOver:L,isSorting:D,isDragging:H,listeners:Re,node:O,overIndex:x,over:Ee,setNodeRef:b,setActivatorNodeRef:re,setDroppableNodeRef:P,setDraggableNodeRef:he,transform:De??$,transition:ge()};function ge(){if(De||$e&&M.current.newIndex===E)return Ts;if(!(A&&!Gt(U)||!f)&&(D||ce))return Me.Transition.toString({...f,property:lr})}}function Os(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}}k.Down,k.Right,k.Up,k.Left;const Is=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ks=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),kn=e=>{const t=ks(e);return t.charAt(0).toUpperCase()+t.slice(1)},ur=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Ms=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var As={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 Ns=d.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...l},u)=>d.createElement("svg",{ref:u,...As,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:ur("lucide",o),...!s&&!Ms(l)&&{"aria-hidden":"true"},...l},[...i.map(([f,p])=>d.createElement(f,p)),...Array.isArray(s)?s:[s]]));const X=(e,t)=>{const n=d.forwardRef(({className:r,...o},s)=>d.createElement(Ns,{ref:s,iconNode:t,className:ur(`lucide-${Is(kn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=kn(e),n};const Ls=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],$s=X("arrow-down",Ls);const Ps=[["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"}]],zs=X("arrow-up-down",Ps);const Fs=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Bs=X("arrow-up",Fs);const Vs=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Hs=X("bookmark",Vs);const Ys=[["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"}]],Mn=X("calendar",Ys);const Ws=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Us=X("chevron-left",Ws);const Gs=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xs=X("chevron-right",Gs);const qs=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Ks=X("columns-2",qs);const Js=[["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"}]],Zs=X("delete",Js);const Qs=[["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"}]],ei=X("ellipsis",Qs);const ti=[["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"}]],ni=X("funnel",ti);const ri=[["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"}]],dr=X("grip-vertical",ri);const oi=[["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"}]],si=X("pen",oi);const ii=[["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"}]],ai=X("refresh-ccw",ii);const li=[["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"}]],ci=X("settings",li);function w(e){return d.forwardRef((t,n)=>{const{children:r,...o}=t;return a.jsx(e,{ref:n,...o,children:r})})}const fr=e=>`table_column_order_v1:${e}`,ui=e=>{const{tableId:t}=te.state;localStorage.setItem(fr(t),JSON.stringify(e.map(n=>n.id))),te.setState(n=>({...n,columnOrder:e})),te.setState(n=>({...n,columnOrder:e}))},di=e=>{te.setState(t=>({...t,visibility:{...t.visibility,[e]:!t.visibility[e]}}))};function fi(e){te.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const te=new zn({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],data:[],sortableColumns:[]});function hr(e,t){const n=e[0]??{},o=(t&&t.length?t:Object.keys(n).map(u=>({id:u,label:u}))).filter(u=>Object.prototype.hasOwnProperty.call(n,u.id)),{tableId:s}=te.state,i=JSON.parse(localStorage.getItem(fr(s))||"[]"),l=[...i.map(u=>o.find(f=>f.id===u)).filter(Boolean),...o.filter(u=>!i.includes(u.id))];te.setState(u=>({...u,data:e,columnOrder:l,visibility:l.reduce((f,p)=>(f[p.id]=!0,f),{}),sortableColumns:l.map(f=>({id:f.id,label:f.label,sortable:!0}))}))}function gr(e){te.setState(t=>({...t,tableId:e}))}const hi=w(c.Menu.Trigger),gi=w(c.Menu.Positioner),pi=w(c.Menu.Content),vi=w(c.Menu.Item),bi=w(c.Checkbox.Label),mi=w(c.Checkbox.HiddenInput),xi=w(c.Checkbox.Control);function Si({visibility:e,onToggle:t}){const{sortableColumns:n}=Qe(te);return a.jsxs(c.Menu.Root,{closeOnSelect:!1,children:[a.jsx(hi,{asChild:!0,children:a.jsx(c.IconButton,{"aria-label":"Toggle columns",variant:"outline",size:"sm",ml:"1",children:a.jsx(Ks,{size:18})})}),a.jsx(c.Portal,{children:a.jsx(gi,{children:a.jsx(pi,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return a.jsx(vi,{value:r.id,closeOnSelect:!1,children:a.jsxs(c.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[a.jsx(mi,{}),a.jsx(xi,{}),a.jsx(bi,{children:r.label})]})},r.id)})})})})]})}function yi({id:e,children:t,onClick:n,cursor:r,borderRight:o,borderRightColor:s,backgroundColor:i}){const{setNodeRef:l,attributes:u,listeners:f,transform:p,transition:g}=cr({id:e});return a.jsx(c.Table.ColumnHeader,{ref:l,onClick:n,backgroundColor:i,w:e==="id"?"80px":void 0,style:{transform:Me.Transform.toString(p),transition:g,cursor:r,borderRight:o,borderRightColor:s},...u,children:a.jsxs(c.HStack,{justify:"space-between",children:[t,a.jsx("span",{...f,children:a.jsx(dr,{size:12})})]})})}function wi(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o}=Qe(te),s=e.map(l=>o.find(u=>u.id===l.id)).filter(l=>l!==void 0).filter(l=>t[l.id]),i=l=>{const{active:u,over:f}=l;if(!f||u.id===f.id)return;const p=e.findIndex(v=>v.id===u.id),g=e.findIndex(v=>v.id===f.id),S=yt(e,p,g);ui(S)};return a.jsx(c.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",children:a.jsx(rr,{collisionDetection:Hn,onDragEnd:i,children:a.jsx(ar,{items:e.map(l=>l.id),strategy:Ss,children:a.jsxs(c.Table.Row,{height:"28px",children:[s.map(l=>{const u=n===l?.id;return a.jsx(yi,{id:l?.id,onClick:()=>l?.sortable&&fi(l?.id),cursor:l?.sortable?"pointer":"default",borderRight:"2px solid #dcdcdc",children:a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[l?.label,l?.sortable&&(u?r==="asc"?a.jsx(Bs,{size:14}):a.jsx($s,{size:14}):a.jsx(zs,{size:14,opacity:.4}))]})},l?.id)}),a.jsx(c.Table.ColumnHeader,{borderRight:"2px solid #dcdcdc",children:"Actions"}),a.jsx(c.Table.ColumnHeader,{boxSize:"0.5",children:a.jsx(Si,{visibility:t,onToggle:di})})]})})})})}const An=c.createListCollection({items:[{label:"10",value:"10"},{label:"20",value:"20"},{label:"50",value:"50"},{label:"100",value:"100"}]}),Ci=w(c.Select.Positioner),Ri=w(c.Select.Content),Ei=w(c.Select.Item),Di=w(c.Pagination.PrevTrigger),Ti=w(c.Pagination.NextTrigger),ji=w(c.Select.HiddenSelect),_i=w(c.Select.Control),Oi=w(c.Select.Trigger),Ii=w(c.Select.ValueText),ki=w(c.Select.IndicatorGroup),Mi=w(c.Select.Indicator);function Ai({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:s=2}){return a.jsx(c.Box,{width:"100%",children:a.jsxs(c.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[a.jsxs(c.HStack,{children:[a.jsx(c.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),a.jsxs(c.Select.Root,{collection:An,size:"sm",width:"60px",onValueChange:i=>o&&o(Number(i.items[0].value)),value:[String(t)],children:[a.jsx(ji,{}),a.jsxs(_i,{children:[a.jsx(Oi,{children:a.jsx(Ii,{placeholder:""})}),a.jsx(ki,{children:a.jsx(Mi,{})})]}),a.jsx(c.Portal,{children:a.jsx(Ci,{children:a.jsx(Ri,{children:An.items.map(i=>a.jsxs(Ei,{item:i.value,children:[i.label,a.jsx(c.Select.ItemIndicator,{})]},i.value))})})})]})]}),a.jsx(c.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:s,onPageChange:i=>r&&r(i.page),children:a.jsxs(c.ButtonGroup,{size:"sm",variant:"ghost",children:[a.jsx(Di,{asChild:!0,children:a.jsx(c.IconButton,{"aria-label":"Previous page",children:a.jsx(Us,{size:18})})}),a.jsx(c.Pagination.Items,{render:i=>a.jsx(c.IconButton,{variant:i.type==="page"&&i.value===n?"outline":"ghost","aria-current":i.type==="page"&&i.value===n?"page":void 0,children:i.type==="page"?i.value:"…"},i.value??i.type)}),a.jsx(Ti,{asChild:!0,children:a.jsx(c.IconButton,{"aria-label":"Next page",children:a.jsx(Xs,{size:18})})})]})})]})})}const Ni=w(c.Menu.Item),Li=w(c.Menu.Content),$i=w(c.Menu.Positioner),Pi=w(c.Menu.Trigger);function zi({data:e=[],actions:t=[]}){const{columnOrder:n,visibility:r}=Qe(te);return a.jsx(c.Table.Body,{children:e.map(o=>a.jsxs(c.Table.Row,{children:[n.filter(s=>r[s.id]).map(s=>a.jsx(c.Table.Cell,{children:o[s.id]},s.id)),a.jsx(c.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:a.jsxs(c.Menu.Root,{children:[a.jsx(Pi,{asChild:!0,children:a.jsx(c.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:a.jsx(ei,{size:16})})}),a.jsx(c.Portal,{children:a.jsx($i,{children:a.jsx(Li,{children:t.map(s=>a.jsxs(Ni,{onClick:()=>s.onClick(o),colorScheme:s.colorScheme,value:s.label,children:[s.icon,s.label]},s.label))})})})]})})]},o.id))})}function Fi({tableId:e,data:t=[],headers:n=[],loading:r=!1,emptyMessage:o="No data",actions:s,page:i=1,pageSize:l=10,onPageChange:u,onPageSizeChange:f,density:p="sm",totalCount:g=0,paginationMode:S="client"}){d.useEffect(()=>{gr(e)},[e]),d.useEffect(()=>{hr(t,n)},[t,n]);const{sortColumn:v,sortDirection:m,data:h}=Qe(te),x=d.useMemo(()=>{const y=[...h];if(v&&y.sort((C,R)=>m==="asc"?String(C[v]).localeCompare(String(R[v])):String(R[v]).localeCompare(String(C[v]))),S==="client"){const C=(i-1)*l;return y.slice(C,C+l)}return y},[h,v,m,i,l,S]);return a.jsxs(c.Box,{h:"100%",display:"flex",flexDirection:"column",p:2,pt:2,minHeight:0,children:[a.jsx(c.Box,{flex:"1",minHeight:0,overflow:"auto",children:r?a.jsx(c.Box,{display:"flex",alignItems:"center",justifyContent:"center",h:"100%",color:"gray.500",children:"Loading..."}):x.length===0?a.jsx(c.Box,{display:"flex",alignItems:"center",justifyContent:"center",h:"100%",color:"gray.500",children:o}):a.jsxs(c.Table.Root,{variant:"outline",w:"100%",size:p,children:[a.jsx(wi,{}),a.jsx(zi,{data:x,actions:s})]})}),a.jsx(c.Box,{mt:.5,children:a.jsx(Ai,{totalCount:g,pageSize:l,currentPage:i,onPageChange:u,onPageSizeChange:y=>{f&&f(y),i>1&&u&&u(1)}})})]})}const Bi=w(c.Checkbox.Root),Vi=w(c.Checkbox.HiddenInput),Hi=w(c.Checkbox.Control),Yi=w(c.Checkbox.Label),pr=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:s,required:i,errorText:l})=>a.jsxs(Bi,{value:e,onChange:t,size:n,children:[a.jsx(Vi,{}),a.jsx(Hi,{disabled:s,required:i,errorText:l,helperText:o}),r&&a.jsx(Yi,{children:r})]}),z=" to ",Nn=10,Ce={DAY_MAX:31,MONTH_MAX:12,YEAR_MIN:1900,YEAR_MAX:2100},Zt=()=>{const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},Ln=()=>{const{year:e,month:t,day:n}=Zt();return`${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}-${e}`},Wi=()=>{const{year:e,month:t,day:n}=Zt();return`${e}-${String(t).padStart(2,"0")}-${String(n).padStart(2,"0")}`},Ui=(e,t)=>{const n=e.length,r=parseInt(e);if(!e||isNaN(r))return t;if(n===4)return r>=Ce.YEAR_MIN&&r<=Ce.YEAR_MAX?r:t;if(n>0&&n<4){const o=t.toString(),s=4-n,i=o.substring(0,s);return parseInt(i+e)}return t},Ye=e=>{if(!e?.trim())return null;const n=e.replace(/[^\d-]/g,"").split("-").filter(f=>f!=="");if(n.length===0)return null;const{year:r,month:o,day:s}=Zt();let i,l,u;return n.length===1?(i=parseInt(n[0])||s,l=o,u=r):n.length===2?(i=parseInt(n[0])||s,l=parseInt(n[1])||o,u=r):(i=parseInt(n[0])||s,l=parseInt(n[1])||o,u=Ui(n[2],r)),l=Math.max(1,Math.min(Ce.MONTH_MAX,l)),i=Math.max(1,Math.min(Ce.DAY_MAX,i)),`${u}-${String(l).padStart(2,"0")}-${String(i).padStart(2,"0")}`},ie=e=>{if(!e)return"";const[t,n,r]=e.split("-");return`${r}-${n}-${t}`},Gi=(e,t)=>{if(e[0]?.length>0){const n=parseInt(e[0]);if(isNaN(n)||n===0||e[0].length===2&&n>Ce.DAY_MAX)return t}if(e[1]?.length>0){const n=parseInt(e[1]);if(isNaN(n)||n===0||e[1].length===2&&n>Ce.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<Ce.YEAR_MIN||n>Ce.YEAR_MAX))return t}return null},We=e=>{let t=e.replace(/[^\d-]/g,"").substring(0,Nn);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,Nn),Gi(n,e)||t},Xi=w(c.Popover.Root),qi=w(c.Popover.Trigger),Ki=w(c.Popover.Content),Ji=w(c.Popover.Positioner);function Zi({value:e,onChange:t,disabled:n=!1}){const[r="",o=""]=e?e.split("|"):[],[s,i]=d.useState(()=>r&&o?`${ie(r)}${z}${ie(o)}`:r?ie(r):""),[l,u]=d.useState(!1),f=d.useRef(null);d.useEffect(()=>{const m=h=>{h.ctrlKey&&h.key==="d"&&!h.shiftKey&&!h.metaKey&&(h.preventDefault(),f.current?.focus())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[]);const p=m=>{let h=m;if(h.includes(z)){const[x,y=""]=h.split(z);h=`${We(x.trim())}${z}${We(y.trim())}`}else if(h.toLowerCase().includes(" to ")){const[x,y=""]=h.split(/\s+to\s+/i);h=`${We(x.trim())} to ${We(y.trim())}`}else h=We(h);i(h)},g=()=>{const m=s.trim();if(!m){t(void 0);return}if(m.includes(z)){const[h,x=""]=m.split(z).map(R=>R.trim()),y=Ye(h),C=x?Ye(x):null;if(y&&C){const[R,E]=C<y?[C,y]:[y,C],_=`${ie(R)}${z}${ie(E)}`;i(_),t(`${R}|${E}`)}else if(y&&!x)i(`${ie(y)}${z}`),t(void 0);else if(y&&x){const R=Wi(),[E,_]=R<y?[R,y]:[y,R],T=`${ie(E)}${z}${ie(_)}`;i(T),t(`${E}|${_}`)}else i(""),t(void 0)}else{const h=Ye(m);h?(i(`${ie(h)}${z}`),t(void 0)):(i(""),t(void 0))}},S=m=>{if(m.key!=="Enter")return;m.preventDefault();const h=f.current?.selectionStart||0,x=s.indexOf(z);if(!s.trim()){i(`${Ln()}${z}`);return}if(x===-1){const C=Ye(s.trim());C&&i(`${ie(C)}${z}`);return}if(h<=x+z.length){const C=s.substring(0,x).trim(),R=s.substring(x+z.length),E=Ye(C);E&&i(`${ie(E)}${z}${R}`);return}if(s.substring(x+z.length).trim())g(),f.current?.blur();else{const C=s.substring(0,x+z.length)+Ln();i(C),setTimeout(()=>{g(),f.current?.blur()},0)}},v=()=>{i(""),t(void 0)};return a.jsx(c.InputGroup,{children:a.jsx(a.Fragment,{children:a.jsxs(c.InputElement,{position:"revert",children:[a.jsxs(Xi,{open:l,onEscapeKeyDown:()=>{u(!1)},children:[a.jsx(qi,{asChild:!0,children:a.jsx(c.IconButton,{size:"sm",variant:"ghost","aria-label":"Date range help",onClick:()=>u(m=>!m),children:a.jsx(Mn,{size:16})})}),a.jsx(c.Portal,{children:a.jsx(Ji,{children:a.jsxs(Ki,{p:4,children:[a.jsx(c.PopoverArrow,{}),a.jsxs(c.VStack,{align:"start",gap:4,children:[a.jsxs(c.HStack,{children:[a.jsx(Mn,{size:16}),a.jsx(c.Text,{fontWeight:"semibold",fontSize:"sm",children:"Date Range Filter"})]}),a.jsxs(c.VStack,{align:"start",gap:1,children:[a.jsx(c.Text,{fontSize:"sm",fontWeight:"medium",children:"Format:"}),a.jsxs(c.Text,{fontSize:"xs",color:"gray.600",children:["DD-MM-YYYY",z,"DD-MM-YYYY"]})]}),a.jsxs(c.VStack,{align:"start",gap:1,children:[a.jsx(c.Text,{fontSize:"sm",fontWeight:"medium",children:"Tips:"}),a.jsx(c.Text,{fontSize:"xs",children:'• "15 to 20" → assumes current month/year'}),a.jsx(c.Text,{fontSize:"xs",children:"• Leave end blank → up to today"}),a.jsx(c.Text,{fontSize:"xs",children:"• Dates auto-swapped if reversed"}),a.jsx(c.Text,{fontSize:"xs",children:"• Press Enter on empty end → fills today"})]}),a.jsxs(c.VStack,{align:"start",gap:1,children:[a.jsx(c.Text,{fontSize:"sm",fontWeight:"medium",children:"Shortcut:"}),a.jsxs(c.HStack,{children:[a.jsx(c.Kbd,{children:"Ctrl"}),a.jsx(c.Text,{children:"+"}),a.jsx(c.Kbd,{children:"D"})]})]})]})]})})})]}),a.jsx(c.Input,{ref:f,placeholder:"15-06-2025 to 20-06-2025",value:s,size:"sm",disabled:n,onChange:m=>p(m.target.value),onBlur:g,onKeyDown:S,pr:s?"10":void 0,w:"100%"}),s&&a.jsx(c.InputElement,{children:a.jsx(c.IconButton,{size:"sm",variant:"ghost","aria-label":"Clear date range",onClick:v,w:"100%"})})]})})})}const Qi=w(c.Field.Root),ea=w(c.Field.Label),ta=w(c.Field.HelperText),na=w(c.Field.ErrorText),Ht=({icon:e,value:t,onChange:n,placeholder:r,size:o="xs",variant:s="outline",width:i="100%",label:l,helperText:u,isDisabled:f=!1,required:p=!1,errorText:g,visible:S})=>a.jsxs(Qi,{width:i,children:[S&&a.jsx(ea,{children:l}),a.jsx(c.InputGroup,{startElement:e,children:a.jsx(c.Input,{value:t,onChange:v=>n?.(v.target.value),placeholder:r,size:o,variant:s,disabled:f,required:p})}),g&&a.jsx(na,{fontSize:"xs",children:g}),u&&a.jsx(ta,{fontSize:"xs",children:u})]}),ra=w(c.Field.Root),oa=w(c.Field.HelperText),sa=w(c.Field.ErrorText),ia=w(c.Select.Root),aa=w(c.Select.Label),la=w(c.Select.Control),ca=w(c.Select.Trigger),ua=w(c.Select.ValueText),da=w(c.Select.IndicatorGroup),fa=w(c.Select.Indicator),ha=w(c.Select.Content),ga=w(c.Select.Item),pa=w(c.Select.ItemIndicator),va=w(c.Select.HiddenSelect),ba=w(c.Select.Positioner),vr=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:s="xs",width:i="100%",variant:l="outline",helperText:u,isDisabled:f,required:p,errorText:g,visible:S})=>{const v=c.createListCollection({items:e});return a.jsxs(ra,{disabled:f,required:p,children:[a.jsxs(ia,{collection:v,variant:l,size:s,width:i,value:n?[n]:[],onValueChange:m=>r?.(m.value[0]),children:[a.jsx(va,{}),S&&a.jsx(aa,{children:t}),a.jsxs(la,{children:[a.jsx(ca,{children:a.jsx(ua,{placeholder:o})}),a.jsx(da,{children:a.jsx(fa,{})})]}),a.jsx(ba,{children:a.jsx(ha,{children:v.items.map(m=>a.jsxs(ga,{item:m,children:[m.label,a.jsx(pa,{})]},m.value))})})]}),u&&a.jsx(oa,{children:u}),g&&a.jsx(sa,{children:g})]})},br=e=>`FILTER_PRESETS_${e??"default"}`;function ma(e){try{return JSON.parse(localStorage.getItem(br(e))||"[]")}catch{return[]}}const Ze=new zn({}),wt=e=>{const t=Ze.state[e];if(t)return t;const n=ma(e);return Ze.setState(r=>({...r,[e]:n})),n},Qt=(e,t)=>{Ze.setState(n=>({...n,[e]:t})),localStorage.setItem(br(e),JSON.stringify(t))},mr=(e,t)=>{const n=wt(e).filter(r=>r.id!==t);Qt(e,n)},xr=(e,t)=>{const n=[t,...wt(e)];Qt(e,n)},xa=w(c.Checkbox.Root),Sa=w(c.Checkbox.HiddenInput),ya=w(c.Checkbox.Control),wa=w(c.Slider.Root),Ca=w(c.Slider.Track),Ra=w(c.Slider.Range),Ea=w(c.Slider.Thumbs),Da=w(c.Slider.Control),Ta=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:i,transition:l}=cr({id:e.id}),u={transform:Me.Transform.toString(i),transition:l};return a.jsxs(c.VStack,{ref:s,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,bg:"white",children:[a.jsxs(c.HStack,{...r,...o,cursor:"grab",userSelect:"none",gap:2,children:[a.jsx(dr,{size:16}),a.jsx(c.Text,{fontWeight:"bold",fontSize:"sm",children:e.label||e.id})]}),a.jsxs(c.HStack,{justify:"space-between",children:[a.jsx(c.Text,{fontSize:"sm",children:"Visible"}),a.jsxs(xa,{checked:e.visible,size:"sm",onCheckedChange:f=>t?.(e.id,!!f.checked),children:[a.jsx(Sa,{}),a.jsx(ya,{})]})]}),a.jsxs(c.VStack,{align:"stretch",gap:1,children:[a.jsx(c.Text,{fontSize:"sm",children:"Size"}),a.jsx(wa,{min:1,max:5,step:.5,value:[e.size??1],onValueChange:f=>n?.(e.id,f.value[0]),children:a.jsxs(Da,{children:[a.jsx(Ca,{children:a.jsx(Ra,{})}),a.jsx(Ea,{})]})})]})]})},ja=w(c.Drawer.Root),_a=w(c.Drawer.Trigger),Oa=w(c.Drawer.Backdrop),Ia=w(c.Drawer.Positioner),ka=w(c.Drawer.Content),Ma=w(c.Drawer.Header),Aa=w(c.Drawer.Title),Na=w(c.Drawer.Body),La=w(c.Drawer.Footer),$a=w(c.Drawer.CloseTrigger),Pa=w(c.Tabs.Root),za=w(c.Tabs.List),Nt=w(c.Tabs.Trigger),Lt=w(c.Tabs.Content),Sr=(e,t)=>{if(e.customComponent)return e.customComponent;switch(e.type){case"text":return a.jsx(Ht,{placeholder:e.label,value:e.value,onChange:e.onChange,label:e.label,visible:t});case"number":return a.jsx(Ht,{label:e.label,value:e.value,onChange:e.onChange});case"checkbox":return a.jsx(pr,{label:e.label,value:e.value,onChange:e.onChange});case"select":return a.jsx(vr,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t});case"date":return a.jsx(Zi,{value:e.value,onChange:e.onChange});default:return null}},Fa=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:s="default",currentFilters:i={},onLoadPreset:l,activePresetName:u,onReorder:f,open:p,onOpenChange:g})=>{const v=Qe(Ze)[s]??wt(s),m=()=>{const h=prompt("Preset name?");h&&xr(s,{id:crypto.randomUUID(),name:h,date:new Date().toISOString(),filters:i})};return a.jsx(c.HStack,{wrap:"wrap",children:a.jsxs(ja,{size:e,open:p,onOpenChange:g,children:[a.jsx(_a,{asChild:!0,children:a.jsxs(c.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[a.jsx(ni,{size:16}),"Filters"]})}),a.jsxs(c.Portal,{children:[a.jsx(Oa,{}),a.jsx(Ia,{children:a.jsxs(ka,{children:[a.jsx(Ma,{children:a.jsx(Aa,{children:"Filters"})}),a.jsx(Na,{overflowY:"auto",pt:1,children:a.jsxs(Pa,{defaultValue:"view",children:[a.jsxs(za,{mb:4,children:[a.jsxs(Nt,{value:"view",children:[a.jsx(si,{size:16}),"Edit"]}),a.jsxs(Nt,{value:"settings",children:[a.jsx(ci,{size:16}),"Settings"]}),a.jsxs(Nt,{value:"presets",children:[a.jsx(Hs,{size:16}),"Presets"]})]}),a.jsx(Lt,{value:"view",children:o.filter(h=>h.visible).map(h=>a.jsx(c.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",flex:h.size??1,minW:`${(h.size??1)*100}px`,rounded:"md",p:3,mb:3,children:Sr(h,p)},h.id))}),a.jsx(Lt,{value:"settings",children:a.jsx(rr,{sensors:io(so(Jt)),collisionDetection:Hn,onDragEnd:({active:h,over:x})=>{if(!x||h.id===x.id)return;const y=o.findIndex(E=>E.id===h.id),C=o.findIndex(E=>E.id===x.id),R=yt(o,y,C);f?.(R)},children:a.jsx(ar,{items:o.map(h=>h.id),strategy:ws,children:o.map(h=>a.jsx(Ta,{filter:h,onVisibilityChange:t,onSizeChange:n},h.id))})})}),a.jsx(Lt,{value:"presets",children:a.jsxs(c.VStack,{align:"stretch",mb:3,children:[a.jsx(c.Button,{size:"sm",colorScheme:"blue",onClick:m,children:"Save Current Filters"}),v.length===0&&a.jsx(c.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),v.map(h=>a.jsxs(c.HStack,{justify:"space-between",border:"1px solid",borderColor:u===h.name?"blue.300":"gray.200",rounded:"md",p:2,children:[a.jsxs(c.VStack,{align:"start",gap:0,children:[a.jsx(c.Text,{fontWeight:"bold",fontSize:"sm",children:h.name}),a.jsx(c.Text,{fontSize:"xs",color:"gray.500",children:new Date(h.date).toLocaleDateString()})]}),a.jsxs(c.HStack,{children:[a.jsx(c.Button,{size:"xs",variant:"ghost",onClick:()=>l?.(h.filters,h.name),children:"Load"}),a.jsx(c.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>mr(s,h.id),children:a.jsx(Zs,{size:14})})]})]},h.id))]})})]})}),a.jsxs(La,{justify:"space-between",children:[a.jsx(c.Button,{size:"sm",variant:"ghost",colorScheme:"red",onClick:()=>r&&r(),children:"Clear All"}),a.jsx($a,{asChild:!0,children:a.jsx(c.CloseButton,{})})]})]})})]})]})})},Ba=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:i,pageKey:l,currentFilters:u,onLoadPreset:f,activePresetName:p,filterDrawerSize:g="sm"})=>{const[S,v]=d.useState(!1);return a.jsxs(c.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,a.jsxs(c.HStack,{gapX:1,children:[t.filter(m=>m.visible!==!1).map(m=>a.jsx(c.HStack,{flex:m.size??1,minW:`${(m.size??1)*100}px`,alignItems:"center",children:Sr(m)},m.id)),a.jsx(Fa,{filterDrawerSize:g,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:i,pageKey:l,filters:t,currentFilters:u,onLoadPreset:f,activePresetName:p,open:S,onOpenChange:m=>{v(m.open)}})]})]})},Va=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},Ha=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}},Ya=({onClick:e,size:t="xs",variant:n="solid",label:r,leftIcon:o,rightIcon:s,isDisabled:i,colorScheme:l,loading:u,loadingText:f,rounded:p,type:g="button"})=>a.jsx(c.Button,{onClick:e,size:t,variant:n,disabled:i,colorPalette:l,loading:u,loadingText:f,rounded:p,type:g,children:a.jsxs(c.HStack,{gap:1,children:[o,r,s]})});function yr({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=d.useState(!1),s=async()=>{o(!0);try{await e()}finally{setTimeout(()=>o(!1),300)}};return a.jsx(c.IconButton,{"aria-label":n,size:"xs",variant:"outline",disabled:t||r,onClick:s,ml:2,children:a.jsx(ai,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}exports.DataTable=Fi;exports.Filters=Ba;exports.MDSButton=Ya;exports.MDSCheckbox=pr;exports.MDSInput=Ht;exports.MDSRefreshButton=yr;exports.MDSSelectBox=vr;exports.RefreshButton=yr;exports.addPreset=xr;exports.deletePreset=mr;exports.getPresets=wt;exports.loadOrder=Ha;exports.presetStore=Ze;exports.saveOrder=Va;exports.savePresets=Qt;exports.setData=hr;exports.setTableId=gr;exports.tableStore=te;exports.withChildren=w;
10
+ `},po={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 vo(e){let{announcements:t=po,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=go}=e;const{announce:s,announcement:a}=uo(),c=nt("DndLiveRegion"),[d,u]=f.useState(!1);if(f.useEffect(()=>{u(!0)},[]),fo(f.useMemo(()=>({onDragStart(h){let{active:x}=h;s(t.onDragStart({active:x}))},onDragMove(h){let{active:x,over:v}=h;t.onDragMove&&s(t.onDragMove({active:x,over:v}))},onDragOver(h){let{active:x,over:v}=h;s(t.onDragOver({active:x,over:v}))},onDragEnd(h){let{active:x,over:v}=h;s(t.onDragEnd({active:x,over:v}))},onDragCancel(h){let{active:x,over:v}=h;s(t.onDragCancel({active:x,over:v}))}}),[s,t])),!d)return null;const p=f.createElement(f.Fragment,null,f.createElement(co,{id:r,value:o.draggable}),f.createElement(lo,{id:c,announcement:a}));return n?Ue.createPortal(p,n):p}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 mo(e,t){return f.useMemo(()=>({sensor:e,options:{}}),[e,t])}function bo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return f.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const pe=Object.freeze({x:0,y:0});function xo(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function yo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function So(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function wo(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 er=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,d=n.get(c);if(d){const u=xo(jn(d),o);s.push({id:c,data:{droppableContainer:a,value:u}})}}return s.sort(yo)};function Do(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 d=t.width*t.height,u=e.width*e.height,p=a*c,h=p/(d+u-p);return Number(h.toFixed(4))}return 0}const Co=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 d=Do(c,t);d>0&&o.push({id:a,data:{droppableContainer:s,value:d}})}}return o.sort(So)};function Ro(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function tr(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:pe}function Eo(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 To=Eo(1);function jo(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 Mo(e,t,n){const r=jo(t);if(!r)return e;const{scaleX:o,scaleY:s,x:a,y:c}=r,d=e.left-a-(1-o)*parseFloat(n),u=e.top-c-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),p=o?e.width/o:e.width,h=s?e.height/s:e.height;return{width:p,height:h,top:u,right:d+p,bottom:u+h,left:d}}const _o={ignoreTransform:!1};function Ne(e,t){t===void 0&&(t=_o);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:p}=ie(e).getComputedStyle(e);u&&(n=Mo(n,u,p))}const{top:r,left:o,width:s,height:a,bottom:c,right:d}=n;return{top:r,left:o,width:s,height:a,bottom:c,right:d}}function Mn(e){return Ne(e,{ignoreTransform:!0})}function Oo(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function ko(e,t){return t===void 0&&(t=ie(e).getComputedStyle(e)),t.position==="fixed"}function $o(e,t){t===void 0&&(t=ie(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)||Jn(o)||n.includes(o))return n;const s=ie(e).getComputedStyle(o);return o!==e&&$o(o,s)&&n.push(o),ko(o,s)?n:r(o.parentNode)}return e?r(e):n}function nr(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 rr(e){return Ae(e)?e.scrollX:e.scrollLeft}function or(e){return Ae(e)?e.scrollY:e.scrollTop}function Ut(e){return{x:rr(e),y:or(e)}}var Q;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Q||(Q={}));function sr(e){return!Dt||!e?!1:e===document.scrollingElement}function ir(e){const t={x:0,y:0},n=sr(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 Io={x:.2,y:.2};function Ao(e,t,n,r,o){let{top:s,left:a,right:c,bottom:d}=n;r===void 0&&(r=10),o===void 0&&(o=Io);const{isTop:u,isBottom:p,isLeft:h,isRight:x}=ir(e),v={x:0,y:0},b={x:0,y:0},g={height:t.height*o.y,width:t.width*o.x};return!u&&s<=t.top+g.height?(v.y=Q.Backward,b.y=r*Math.abs((t.top+g.height-s)/g.height)):!p&&d>=t.bottom-g.height&&(v.y=Q.Forward,b.y=r*Math.abs((t.bottom-g.height-d)/g.height)),!x&&c>=t.right-g.width?(v.x=Q.Forward,b.x=r*Math.abs((t.right-g.width-c)/g.width)):!h&&a<=t.left+g.width&&(v.x=Q.Backward,b.x=r*Math.abs((t.left+g.width-a)/g.width)),{direction:v,speed:b}}function Lo(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 ar(e){return e.reduce((t,n)=>$e(t,Ut(n)),pe)}function No(e){return e.reduce((t,n)=>t+rr(n),0)}function zo(e){return e.reduce((t,n)=>t+or(n),0)}function Po(e,t){if(t===void 0&&(t=Ne),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);nr(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Yo=[["x",["left","right"],No],["y",["top","bottom"],zo]];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=ar(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,c]of Yo)for(const d of a)Object.defineProperty(this,d,{get:()=>{const u=c(r),p=o[s]-u;return this.rect[d]+p},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 Fo(e){const{EventTarget:t}=ie(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 Bo(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 cr={start:[V.Space,V.Enter],cancel:[V.Esc],end:[V.Space,V.Enter,V.Tab]},Ho=(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 lr{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(ie(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&&Po(r),n(pe)}handleKeyDown(t){if(en(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=cr,coordinateGetter:a=Ho,scrollBehavior:c="smooth"}=o,{code:d}=t;if(s.end.includes(d)){this.handleEnd(t);return}if(s.cancel.includes(d)){this.handleCancel(t);return}const{collisionRect:u}=r.current,p=u?{x:u.left,y:u.top}:pe;this.referenceCoordinates||(this.referenceCoordinates=p);const h=a(t,{active:n,context:r.current,currentCoordinates:p});if(h){const x=xt(h,p),v={x:0,y:0},{scrollableAncestors:b}=r.current;for(const g of b){const y=t.code,{isTop:w,isRight:T,isLeft:j,isBottom:O,maxScroll:k,minScroll:_}=ir(g),I=Lo(g),P={x:Math.min(y===V.Right?I.right-I.width/2:I.right,Math.max(y===V.Right?I.left:I.left+I.width/2,h.x)),y:Math.min(y===V.Down?I.bottom-I.height/2:I.bottom,Math.max(y===V.Down?I.top:I.top+I.height/2,h.y))},W=y===V.Right&&!T||y===V.Left&&!j,B=y===V.Down&&!O||y===V.Up&&!w;if(W&&P.x!==h.x){const A=g.scrollLeft+x.x,K=y===V.Right&&A<=k.x||y===V.Left&&A>=_.x;if(K&&!x.y){g.scrollTo({left:A,behavior:c});return}K?v.x=g.scrollLeft-A:v.x=y===V.Right?g.scrollLeft-k.x:g.scrollLeft-_.x,v.x&&g.scrollBy({left:-v.x,behavior:c});break}else if(B&&P.y!==h.y){const A=g.scrollTop+x.y,K=y===V.Down&&A<=k.y||y===V.Up&&A>=_.y;if(K&&!x.x){g.scrollTo({top:A,behavior:c});return}K?v.y=g.scrollTop-A:v.y=y===V.Down?g.scrollTop-k.y:g.scrollTop-_.y,v.y&&g.scrollBy({top:-v.y,behavior:c});break}}this.handleMove(t,$e(xt(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()}}lr.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=cr,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=Fo(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(ie(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,Bo,{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 d=(n=Wt(t))!=null?n:pe,u=xt(o,d);if(!r&&c){if(On(c)){if(c.tolerance!=null&&Pt(u,c.tolerance))return this.handleCancel();if(Pt(u,c.distance))return this.handleStart()}if(kn(c)&&Pt(u,c.tolerance))return this.handleCancel();this.handlePending(c,u);return}t.cancelable&&t.preventDefault(),a(d)}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 Vo={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,Vo,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 Wo={move:{name:"mousemove"},end:{name:"mouseup"}};var Gt;(function(e){e[e.RightClick=2]="RightClick"})(Gt||(Gt={}));class Uo extends rn{constructor(t){super(t,Wo,Le(t.event.target))}}Uo.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 Go 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(){}}}Go.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 Xo(e){let{acceleration:t,activator:n=Xe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:a=5,order:c=St.TreeOrder,pointerCoordinates:d,scrollableAncestors:u,scrollableAncestorRects:p,delta:h,threshold:x}=e;const v=Ko({delta:h,disabled:!s}),[b,g]=ro(),y=f.useRef({x:0,y:0}),w=f.useRef({x:0,y:0}),T=f.useMemo(()=>{switch(n){case Xe.Pointer:return d?{top:d.y,bottom:d.y,left:d.x,right:d.x}:null;case Xe.DraggableRect:return o}},[n,o,d]),j=f.useRef(null),O=f.useCallback(()=>{const _=j.current;if(!_)return;const I=y.current.x*w.current.x,P=y.current.y*w.current.y;_.scrollBy(I,P)},[]),k=f.useMemo(()=>c===St.TreeOrder?[...u].reverse():u,[c,u]);f.useEffect(()=>{if(!s||!u.length||!T){g();return}for(const _ of k){if(r?.(_)===!1)continue;const I=u.indexOf(_),P=p[I];if(!P)continue;const{direction:W,speed:B}=Ao(_,P,T,t,x);for(const A of["x","y"])v[A][W[A]]||(B[A]=0,W[A]=0);if(B.x>0||B.y>0){g(),j.current=_,b(O,a),y.current=B,w.current=W;return}}y.current={x:0,y:0},w.current={x:0,y:0},g()},[t,O,r,g,s,a,JSON.stringify(T),JSON.stringify(v),b,u,k,p,JSON.stringify(x)])}const qo={x:{[Q.Backward]:!1,[Q.Forward]:!1},y:{[Q.Backward]:!1,[Q.Forward]:!1}};function Ko(e){let{delta:t,disabled:n}=e;const r=Vt(t);return tt(o=>{if(n||!r||!o)return qo;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 Jo(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 Zo(e,t){return f.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 Qo(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,a]=f.useState(null),{frequency:c,measure:d,strategy:u}=o,p=f.useRef(e),h=y(),x=Ke(h),v=f.useCallback(function(w){w===void 0&&(w=[]),!x.current&&a(T=>T===null?w:T.concat(w.filter(j=>!T.includes(j))))},[x]),b=f.useRef(null),g=tt(w=>{if(h&&!n)return $n;if(!w||w===$n||p.current!==e||s!=null){const T=new Map;for(let j of e){if(!j)continue;if(s&&s.length>0&&!s.includes(j.id)&&j.rect.current){T.set(j.id,j.rect.current);continue}const O=j.node.current,k=O?new nn(d(O),O):null;j.rect.current=k,k&&T.set(j.id,k)}return T}return w},[e,s,n,h,d]);return f.useEffect(()=>{p.current=e},[e]),f.useEffect(()=>{h||v()},[n,h]),f.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),f.useEffect(()=>{h||typeof c!="number"||b.current!==null||(b.current=setTimeout(()=>{v(),b.current=null},c))},[c,h,v,...r]),{droppableRects:g,measureDroppableContainers:v,measuringScheduled:s!=null};function y(){switch(u){case Je.Always:return!1;case Je.BeforeDragging:return n;default:return!n}}}function ur(e,t){return tt(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function es(e,t){return ur(e,t)}function ts(e){let{callback:t,disabled:n}=e;const r=Qt(t),o=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return f.useEffect(()=>()=>o?.disconnect(),[o]),o}function Ct(e){let{callback:t,disabled:n}=e;const r=Qt(t),o=f.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return f.useEffect(()=>()=>o?.disconnect(),[o]),o}function ns(e){return new nn(Ne(e),e)}function In(e,t,n){t===void 0&&(t=ns);const[r,o]=f.useState(null);function s(){o(d=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=d??n)!=null?u:null}const p=t(e);return JSON.stringify(d)===JSON.stringify(p)?d:p})}const a=ts({callback(d){if(e)for(const u of d){const{type:p,target:h}=u;if(p==="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 rs(e){const t=ur(e);return tr(e,t)}const An=[];function os(e){const t=f.useRef(e),n=tt(r=>e?r&&r!==An&&e&&t.current&&e.parentNode===t.current.parentNode?r:tn(e):An,[e]);return f.useEffect(()=>{t.current=e},[e]),n}function ss(e){const[t,n]=f.useState(null),r=f.useRef(e),o=f.useCallback(s=>{const a=zt(s.target);a&&n(c=>c?(c.set(a,Ut(a)),new Map(c)):null)},[]);return f.useEffect(()=>{const s=r.current;if(e!==s){a(s);const c=e.map(d=>{const u=zt(d);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,Ut(u)]):null}).filter(d=>d!=null);n(c.length?new Map(c):null),r.current=e}return()=>{a(e),a(s)};function a(c){c.forEach(d=>{const u=zt(d);u?.removeEventListener("scroll",o)})}},[o,e]),f.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>$e(s,a),pe):ar(e):pe,[e,t])}function Ln(e,t){t===void 0&&(t=[]);const n=f.useRef(null);return f.useEffect(()=>{n.current=null},t),f.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 is(e){f.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 as(e,t){return f.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=a=>{s(a,t)},n},{}),[e,t])}function dr(e){return f.useMemo(()=>e?Oo(e):null,[e])}const Nn=[];function cs(e,t){t===void 0&&(t=Ne);const[n]=e,r=dr(n?ie(n):null),[o,s]=f.useState(Nn);function a(){s(()=>e.length?e.map(d=>sr(d)?r:new nn(t(d),d)):Nn)}const c=Ct({callback:a});return be(()=>{c?.disconnect(),a(),e.forEach(d=>c?.observe(d))},[e]),o}function ls(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return et(t)?t:e}function us(e){let{measure:t}=e;const[n,r]=f.useState(null),o=f.useCallback(u=>{for(const{target:p}of u)if(et(p)){r(h=>{const x=t(p);return h?{...h,width:x.width,height:x.height}:x});break}},[t]),s=Ct({callback:o}),a=f.useCallback(u=>{const p=ls(u);s?.disconnect(),p&&s?.observe(p),r(p?t(p):null)},[t,s]),[c,d]=bt(a);return f.useMemo(()=>({nodeRef:c,rect:n,setRef:d}),[n,c,d])}const ds=[{sensor:on,options:{}},{sensor:lr,options:{}}],fs={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 hs={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},gs={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:yt,draggableNodes:new Map,over:null,measureDroppableContainers:yt},Rt=f.createContext(gs),fr=f.createContext(hs);function ps(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new qe}}}function vs(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 ms(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=f.useContext(Rt),s=Vt(r),a=Vt(n?.id);return f.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:d,node:u}=c;if(!d.current&&!u.current)return;requestAnimationFrame(()=>{for(const p of[d.current,u.current]){if(!p)continue;const h=io(p);if(h){h.focus();break}}})}},[r,t,o,a,s]),null}function bs(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function xs(e){return f.useMemo(()=>({draggable:{...ft.draggable,...e?.draggable},droppable:{...ft.droppable,...e?.droppable},dragOverlay:{...ft.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function ys(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=f.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 u=t?.node.current;if(!u||u.isConnected===!1)return;const p=n(u),h=tr(p,r);if(a||(h.x=0),c||(h.y=0),s.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const x=nr(u);x&&x.scrollBy({top:h.y,left:h.x})}},[t,a,c,r,n])}const hr=f.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 gr=f.memo(function(t){var n,r,o,s;let{id:a,accessibility:c,autoScroll:d=!0,children:u,sensors:p=ds,collisionDetection:h=Co,measuring:x,modifiers:v,...b}=t;const g=f.useReducer(vs,void 0,ps),[y,w]=g,[T,j]=ho(),[O,k]=f.useState(Ee.Uninitialized),_=O===Ee.Initialized,{draggable:{active:I,nodes:P,translate:W},droppable:{containers:B}}=y,A=I!=null?P.get(I):null,K=f.useRef({initial:null,translated:null}),ee=f.useMemo(()=>{var re;return I!=null?{id:I,data:(re=A?.data)!=null?re:fs,rect:K}:null},[I,A]),$=f.useRef(null),[R,D]=f.useState(null),[M,E]=f.useState(null),L=Ke(b,Object.values(b)),z=nt("DndDescribedBy",a),m=f.useMemo(()=>B.getEnabled(),[B]),C=xs(x),{droppableRects:N,measureDroppableContainers:F,measuringScheduled:U}=Qo(m,{dragging:_,dependencies:[W.x,W.y],config:C.droppable}),G=Jo(P,I),H=f.useMemo(()=>M?Wt(M):null,[M]),X=Yr(),q=es(G,C.draggable.measure);ys({activeNode:I!=null?P.get(I):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=f.useRef({activatorEvent:null,active:null,activeNode:G,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:P,draggingNode:null,draggingNodeRect:null,droppableContainers:B,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=B.getNodeFor((n=ne.current.over)==null?void 0:n.id),xe=us({measure:C.dragOverlay.measure}),je=(r=xe.nodeRef.current)!=null?r:G,Me=_?(o=xe.rect)!=null?o:Y:null,cn=!!(xe.nodeRef.current&&xe.rect),ln=rs(cn?null:Y),Mt=dr(je?ie(je):null),Se=os(_?he??G:null),rt=cs(Se),ot=bs(v,{transform:{x:W.x-ln.x,y:W.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:rt,windowRect:Mt}),un=H?$e(H,W):null,dn=ss(Se),$r=Ln(dn),Ir=Ln(dn,[Y]),_e=$e(ot,$r),Oe=Me?To(Me,ot):null,ze=ee&&Oe?h({active:ee,collisionRect:Oe,droppableRects:N,droppableContainers:m,pointerCoordinates:un}):null,fn=wo(ze,"id"),[we,hn]=f.useState(null),Ar=cn?ot:$e(ot,Ir),Lr=Ro(Ar,(s=we?.rect)!=null?s:null,Y),_t=f.useRef(null),gn=f.useCallback((re,ae)=>{let{sensor:ce,options:De}=ae;if($.current==null)return;const de=P.get($.current);if(!de)return;const le=re.nativeEvent,ve=new ce({active:$.current,activeNode:de,event:le,options:De,context:ne,onAbort(te){if(!P.get(te))return;const{onDragAbort:me}=L.current,ye={id:te};me?.(ye),T({type:"onDragAbort",event:ye})},onPending(te,Ce,me,ye){if(!P.get(te))return;const{onDragPending:Ye}=L.current,Re={id:te,constraint:Ce,initialCoordinates:me,offset:ye};Ye?.(Re),T({type:"onDragPending",event:Re})},onStart(te){const Ce=$.current;if(Ce==null)return;const me=P.get(Ce);if(!me)return;const{onDragStart:ye}=L.current,Pe={activatorEvent:le,active:{id:Ce,data:me.data,rect:K}};Ue.unstable_batchedUpdates(()=>{ye?.(Pe),k(Ee.Initializing),w({type:Z.DragStart,initialCoordinates:te,active:Ce}),T({type:"onDragStart",event:Pe}),D(_t.current),E(le)})},onMove(te){w({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:le,active:me,collisions:ye,delta:Ye,over:Pe},te===Z.DragEnd&&typeof Fe=="function"&&await Promise.resolve(Fe(Re))&&(te=Z.DragCancel)}$.current=null,Ue.unstable_batchedUpdates(()=>{w({type:te}),k(Ee.Uninitialized),hn(null),D(null),E(null),_t.current=null;const Fe=te===Z.DragEnd?"onDragEnd":"onDragCancel";if(Re){const Ot=L.current[Fe];Ot?.(Re),T({type:Fe,event:Re})}})}}},[P]),Nr=f.useCallback((re,ae)=>(ce,De)=>{const de=ce.nativeEvent,le=P.get(De);if($.current!==null||!le||de.dndKit||de.defaultPrevented)return;const ve={active:le};re(ce,ae.options,ve)===!0&&(de.dndKit={capturedBy:ae.sensor},$.current=De,gn(ce,ae))},[P,gn]),pn=Zo(p,Nr);is(p),be(()=>{Y&&O===Ee.Initializing&&k(Ee.Initialized)},[Y,O]),f.useEffect(()=>{const{onDragMove:re}=L.current,{active:ae,activatorEvent:ce,collisions:De,over:de}=ne.current;if(!ae||!ce)return;const le={active:ae,activatorEvent:ce,collisions:De,delta:{x:_e.x,y:_e.y},over:de};Ue.unstable_batchedUpdates(()=>{re?.(le),T({type:"onDragMove",event:le})})},[_e.x,_e.y]),f.useEffect(()=>{const{active:re,activatorEvent:ae,collisions:ce,droppableContainers:De,scrollAdjustedTranslate:de}=ne.current;if(!re||$.current==null||!ae||!de)return;const{onDragOver:le}=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:ae,collisions:ce,delta:{x:de.x,y:de.y},over:ke};Ue.unstable_batchedUpdates(()=>{hn(ke),le?.(te),T({type:"onDragOver",event:te})})},[fn]),be(()=>{ne.current={activatorEvent:M,active:ee,activeNode:G,collisionRect:Oe,collisions:ze,droppableRects:N,draggableNodes:P,draggingNode:je,draggingNodeRect:Me,droppableContainers:B,over:we,scrollableAncestors:Se,scrollAdjustedTranslate:_e},K.current={initial:Me,translated:Oe}},[ee,G,ze,Oe,P,je,Me,N,B,we,Se,_e]),Xo({...X,delta:W,draggingRect:Oe,pointerCoordinates:un,scrollableAncestors:Se,scrollableAncestorRects:rt});const zr=f.useMemo(()=>({active:ee,activeNode:G,activeNodeRect:Y,activatorEvent:M,collisions:ze,containerNodeRect:se,dragOverlay:xe,draggableNodes:P,droppableContainers:B,droppableRects:N,over:we,measureDroppableContainers:F,scrollableAncestors:Se,scrollableAncestorRects:rt,measuringConfiguration:C,measuringScheduled:U,windowRect:Mt}),[ee,G,Y,M,ze,se,xe,P,B,N,we,F,Se,rt,C,U,Mt]),Pr=f.useMemo(()=>({activatorEvent:M,activators:pn,active:ee,activeNodeRect:Y,ariaDescribedById:{draggable:z},dispatch:w,draggableNodes:P,over:we,measureDroppableContainers:F}),[M,pn,ee,Y,w,z,P,we,F]);return f.createElement(Qn.Provider,{value:j},f.createElement(Rt.Provider,{value:Pr},f.createElement(fr.Provider,{value:zr},f.createElement(hr.Provider,{value:Lr},u)),f.createElement(ms,{disabled:c?.restoreFocus===!1})),f.createElement(vo,{...c,hiddenTextDescribedById:z}));function Yr(){const re=R?.autoScrollEnabled===!1,ae=typeof d=="object"?d.enabled===!1:d===!1,ce=_&&!re&&!ae;return typeof d=="object"?{...d,enabled:ce}:{enabled:ce}}}),Ss=f.createContext(null),zn="button",ws="Draggable";function Ds(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=nt(ws),{activators:a,activatorEvent:c,active:d,activeNodeRect:u,ariaDescribedById:p,draggableNodes:h,over:x}=f.useContext(Rt),{role:v=zn,roleDescription:b="draggable",tabIndex:g=0}=o??{},y=d?.id===t,w=f.useContext(y?hr:Ss),[T,j]=bt(),[O,k]=bt(),_=as(a,t),I=Ke(n);be(()=>(h.set(t,{id:t,key:s,node:T,activatorNode:O,data:I}),()=>{const W=h.get(t);W&&W.key===s&&h.delete(t)}),[h,t]);const P=f.useMemo(()=>({role:v,tabIndex:g,"aria-disabled":r,"aria-pressed":y&&v===zn?!0:void 0,"aria-roledescription":b,"aria-describedby":p.draggable}),[r,v,g,y,b,p.draggable]);return{active:d,activatorEvent:c,activeNodeRect:u,attributes:P,isDragging:y,listeners:r?void 0:_,node:T,over:x,setNodeRef:j,setActivatorNodeRef:k,transform:w}}function Cs(){return f.useContext(fr)}const Rs="Droppable",Es={timeout:25};function Ts(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=nt(Rs),{active:a,dispatch:c,over:d,measureDroppableContainers:u}=f.useContext(Rt),p=f.useRef({disabled:n}),h=f.useRef(!1),x=f.useRef(null),v=f.useRef(null),{disabled:b,updateMeasurementsFor:g,timeout:y}={...Es,...o},w=Ke(g??r),T=f.useCallback(()=>{if(!h.current){h.current=!0;return}v.current!=null&&clearTimeout(v.current),v.current=setTimeout(()=>{u(Array.isArray(w.current)?w.current:[w.current]),v.current=null},y)},[y]),j=Ct({callback:T,disabled:b||!a}),O=f.useCallback((P,W)=>{j&&(W&&(j.unobserve(W),h.current=!1),P&&j.observe(P))},[j]),[k,_]=bt(O),I=Ke(t);return f.useEffect(()=>{!j||!k.current||(j.disconnect(),h.current=!1,j.observe(k.current))},[k,j]),f.useEffect(()=>(c({type:Z.RegisterDroppable,element:{id:r,key:s,disabled:n,node:k,rect:x,data:I}}),()=>c({type:Z.UnregisterDroppable,key:s,id:r})),[r]),f.useEffect(()=>{n!==p.current.disabled&&(c({type:Z.SetDroppableDisabled,id:r,key:s,disabled:n}),p.current.disabled=n)},[r,s,n,c]),{active:a,rect:x,isOver:d?.id===r,node:k,over:d,setNodeRef:_}}function Et(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function js(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 Ms(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 _s(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ut={scaleX:1,scaleY:1},Os=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 d=ks(n,a,o);if(a===o){const u=n[s];return u?{x:o<s?u.left+u.width-(c.left+c.width):u.left-c.left,y:0,...ut}:null}return a>o&&a<=s?{x:-c.width-d,y:0,...ut}:a<o&&a>=s?{x:c.width+d,y:0,...ut}:{x:0,y:0,...ut}};function ks(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 pr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=Et(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},$s=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 u=s[a];return u?{x:0,y:n<a?u.top+u.height-(c.top+c.height):u.top-c.top,...dt}:null}const d=Is(s,o,n);return o>n&&o<=a?{x:0,y:-c.height-d,...dt}:o<n&&o>=a?{x:0,y:c.height+d,...dt}:{x:0,y:0,...dt}};function Is(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 vr="Sortable",mr=f.createContext({activeIndex:-1,containerId:vr,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:pr,disabled:{draggable:!1,droppable:!1}});function br(e){let{children:t,id:n,items:r,strategy:o=pr,disabled:s=!1}=e;const{active:a,dragOverlay:c,droppableRects:d,over:u,measureDroppableContainers:p}=Cs(),h=nt(vr,n),x=c.rect!==null,v=f.useMemo(()=>r.map(_=>typeof _=="object"&&"id"in _?_.id:_),[r]),b=a!=null,g=a?v.indexOf(a.id):-1,y=u?v.indexOf(u.id):-1,w=f.useRef(v),T=!Ms(v,w.current),j=y!==-1&&g===-1||T,O=_s(s);be(()=>{T&&b&&p(v)},[T,v,b,p]),f.useEffect(()=>{w.current=v},[v]);const k=f.useMemo(()=>({activeIndex:g,containerId:h,disabled:O,disableTransforms:j,items:v,overIndex:y,useDragOverlay:x,sortedRects:js(v,d),strategy:o}),[g,h,O.draggable,O.droppable,j,v,y,d,x,o]);return f.createElement(mr.Provider,{value:k},t)}const As=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Et(n,r,o).indexOf(t)},Ls=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:a,previousItems:c,previousContainerId:d,transition:u}=e;return!u||!r||c!==s&&o===a?!1:n?!0:a!==o&&t===d},Ns={duration:200,easing:"ease"},xr="transform",zs=Ie.Transition.toString({property:xr,duration:0,easing:"linear"}),Ps={roleDescription:"sortable"};function Ys(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,a]=f.useState(null),c=f.useRef(n);return be(()=>{if(!t&&n!==c.current&&r.current){const d=o.current;if(d){const u=Ne(r.current,{ignoreTransform:!0}),p={x:d.left-u.left,y:d.top-u.top,scaleX:d.width/u.width,scaleY:d.height/u.height};(p.x||p.y)&&a(p)}}n!==c.current&&(c.current=n)},[t,n,r,o]),f.useEffect(()=>{s&&a(null)},[s]),s}function yr(e){let{animateLayoutChanges:t=Ls,attributes:n,disabled:r,data:o,getNewIndex:s=As,id:a,strategy:c,resizeObserverConfig:d,transition:u=Ns}=e;const{items:p,containerId:h,activeIndex:x,disabled:v,disableTransforms:b,sortedRects:g,overIndex:y,useDragOverlay:w,strategy:T}=f.useContext(mr),j=Fs(r,v),O=p.indexOf(a),k=f.useMemo(()=>({sortable:{containerId:h,index:O,items:p},...o}),[h,o,O,p]),_=f.useMemo(()=>p.slice(p.indexOf(a)),[p,a]),{rect:I,node:P,isOver:W,setNodeRef:B}=Ts({id:a,data:k,disabled:j.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...d}}),{active:A,activatorEvent:K,activeNodeRect:ee,attributes:$,setNodeRef:R,listeners:D,isDragging:M,over:E,setActivatorNodeRef:L,transform:z}=Ds({id:a,data:k,attributes:{...Ps,...n},disabled:j.draggable}),m=no(B,R),C=!!A,N=C&&!b&&lt(x)&&lt(y),F=!w&&M,U=F&&N?z:null,H=N?U??(c??T)({rects:g,activeNodeRect:ee,activeIndex:x,overIndex:y,index:O}):null,X=lt(x)&&lt(y)?s({id:a,items:p,activeIndex:x,overIndex:y}):O,q=A?.id,Y=f.useRef({activeId:q,items:p,newIndex:X,containerId:h}),se=p!==Y.current.items,ne=t({active:A,containerId:h,isDragging:M,isSorting:C,id:a,index:O,items:p,newIndex:Y.current.newIndex,previousItems:Y.current.items,previousContainerId:Y.current.containerId,transition:u,wasDragging:Y.current.activeId!=null}),he=Ys({disabled:!ne,index:O,node:P,rect:I});return f.useEffect(()=>{C&&Y.current.newIndex!==X&&(Y.current.newIndex=X),h!==Y.current.containerId&&(Y.current.containerId=h),p!==Y.current.items&&(Y.current.items=p)},[C,X,h,p]),f.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:x,attributes:$,data:k,rect:I,index:O,newIndex:X,items:p,isOver:W,isSorting:C,isDragging:M,listeners:D,node:P,overIndex:y,over:E,setNodeRef:m,setActivatorNodeRef:L,setDroppableNodeRef:B,setDraggableNodeRef:R,transform:he??H,transition:xe()};function xe(){if(he||se&&Y.current.newIndex===O)return zs;if(!(F&&!en(K)||!u)&&(C||ne))return Ie.Transition.toString({...u,property:xr})}}function Fs(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 Bs=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Hs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Pn=e=>{const t=Hs(e);return t.charAt(0).toUpperCase()+t.slice(1)},Sr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Vs=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Ws={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 Us=f.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:a,...c},d)=>f.createElement("svg",{ref:d,...Ws,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Sr("lucide",o),...!s&&!Vs(c)&&{"aria-hidden":"true"},...c},[...a.map(([u,p])=>f.createElement(u,p)),...Array.isArray(s)?s:[s]]));const oe=(e,t)=>{const n=f.forwardRef(({className:r,...o},s)=>f.createElement(Us,{ref:s,iconNode:t,className:Sr(`lucide-${Bs(Pn(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Pn(e),n};const Gs=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Xs=oe("arrow-down",Gs);const qs=[["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"}]],Ks=oe("arrow-up-down",qs);const Js=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Zs=oe("arrow-up",Js);const Qs=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],ei=oe("bookmark",Qs);const ti=[["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",ti);const ni=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],ri=oe("chevron-left",ni);const oi=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],si=oe("chevron-right",oi);const ii=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],ai=oe("columns-2",ii);const ci=[["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"}]],li=oe("delete",ci);const ui=[["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"}]],di=oe("ellipsis",ui);const fi=[["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"}]],hi=oe("funnel",fi);const gi=[["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"}]],wr=oe("grip-vertical",gi);const pi=[["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"}]],vi=oe("pen",pi);const mi=[["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"}]],bi=oe("refresh-ccw",mi);const xi=[["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"}]],yi=oe("settings",xi);const Si=[["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"}]],wi=oe("triangle-alert",Si);function S(e){return f.forwardRef((t,n)=>{const{children:r,...o}=t;return i.jsx(e,{ref:n,...o,children:r})})}const Dr=e=>`table_column_order_v1:${e}`,Di=e=>{const{tableId:t}=ue.state;localStorage.setItem(Dr(t),JSON.stringify(e.map(n=>n.id))),ue.setState(n=>({...n,columnOrder:e})),ue.setState(n=>({...n,columnOrder:e}))},Ci=e=>{ue.setState(t=>({...t,visibility:{...t.visibility,[e]:!t.visibility[e]}}))};function Ri(e){ue.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const ue=new Kn({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],data:[],sortableColumns:[]});function Cr(e,t){const n=e[0]??{},o=(t&&t.length?t:Object.keys(n).map(d=>({id:d,label:d}))).filter(d=>Object.prototype.hasOwnProperty.call(n,d.id)),{tableId:s}=ue.state,a=JSON.parse(localStorage.getItem(Dr(s))||"[]"),c=[...a.map(d=>o.find(u=>u.id===d)).filter(Boolean),...o.filter(d=>!a.includes(d.id))];ue.setState(d=>({...d,data:e,columnOrder:c,visibility:c.reduce((u,p)=>(u[p.id]=!0,u),{}),sortableColumns:c.map(u=>({id:u.id,label:u.label,sortable:!0}))}))}function Rr(e){ue.setState(t=>({...t,tableId:e}))}const Ei=S(l.Menu.Trigger),Ti=S(l.Menu.Positioner),ji=S(l.Menu.Content),Mi=S(l.Menu.Item),_i=S(l.Checkbox.Label),Oi=S(l.Checkbox.HiddenInput),ki=S(l.Checkbox.Control);function $i({visibility:e,onToggle:t}){const{sortableColumns:n}=Qe(ue);return i.jsxs(l.Menu.Root,{closeOnSelect:!1,children:[i.jsx(Ei,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Toggle columns",variant:"outline",size:"sm",ml:"1",children:i.jsx(ai,{size:18})})}),i.jsx(l.Portal,{children:i.jsx(Ti,{children:i.jsx(ji,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return i.jsx(Mi,{value:r.id,closeOnSelect:!1,children:i.jsxs(l.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[i.jsx(Oi,{}),i.jsx(ki,{}),i.jsx(_i,{children:r.label})]})},r.id)})})})})]})}function Ii({id:e,children:t,onClick:n,cursor:r,borderRight:o,borderRightColor:s,backgroundColor:a}){const{setNodeRef:c,attributes:d,listeners:u,transform:p,transition:h}=yr({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(p),transition:h,cursor:r,borderRight:o,borderRightColor:s},...d,children:i.jsxs(l.HStack,{justify:"space-between",children:[t,i.jsx("span",{...u,children:i.jsx(wr,{size:12})})]})})}function Ai(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o}=Qe(ue),s=e.map(c=>o.find(d=>d.id===c.id)).filter(c=>c!==void 0).filter(c=>t[c.id]),a=c=>{const{active:d,over:u}=c;if(!u||d.id===u.id)return;const p=e.findIndex(v=>v.id===d.id),h=e.findIndex(v=>v.id===u.id),x=Et(e,p,h);Di(x)};return i.jsx(l.Table.Header,{background:"blue.200",position:"sticky",top:0,p:"0",children:i.jsx(gr,{collisionDetection:er,onDragEnd:a,children:i.jsx(br,{items:e.map(c=>c.id),strategy:Os,children:i.jsxs(l.Table.Row,{height:"28px",children:[s.map(c=>{const d=n===c?.id;return i.jsx(Ii,{id:c?.id,onClick:()=>c?.sortable&&Ri(c?.id),cursor:c?.sortable?"pointer":"default",borderRight:"2px solid #dcdcdc",children:i.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[c?.label,c?.sortable&&(d?r==="asc"?i.jsx(Zs,{size:14}):i.jsx(Xs,{size:14}):i.jsx(Ks,{size:14,opacity:.4}))]})},c?.id)}),i.jsx(l.Table.ColumnHeader,{borderRight:"2px solid #dcdcdc",children:"Actions"}),i.jsx(l.Table.ColumnHeader,{boxSize:"0.5",children:i.jsx($i,{visibility:t,onToggle:Ci})})]})})})})}const Fn=l.createListCollection({items:[{label:"10",value:"10"},{label:"20",value:"20"},{label:"50",value:"50"},{label:"100",value:"100"}]}),Li=S(l.Select.Positioner),Ni=S(l.Select.Content),zi=S(l.Select.Item),Pi=S(l.Pagination.PrevTrigger),Yi=S(l.Pagination.NextTrigger),Fi=S(l.Select.HiddenSelect),Bi=S(l.Select.Control),Hi=S(l.Select.Trigger),Vi=S(l.Select.ValueText),Wi=S(l.Select.IndicatorGroup),Ui=S(l.Select.Indicator);function Gi({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(Fi,{}),i.jsxs(Bi,{children:[i.jsx(Hi,{children:i.jsx(Vi,{placeholder:""})}),i.jsx(Wi,{children:i.jsx(Ui,{})})]}),i.jsx(l.Portal,{children:i.jsx(Li,{children:i.jsx(Ni,{children:Fn.items.map(a=>i.jsxs(zi,{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(Pi,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Previous page",children:i.jsx(ri,{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(Yi,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Next page",children:i.jsx(si,{size:18})})})]})})]})})}const Xi=S(l.Menu.Item),qi=S(l.Menu.Content),Ki=S(l.Menu.Positioner),Ji=S(l.Menu.Trigger);function Zi({data:e=[],actions:t=[]}){const{columnOrder:n,visibility:r}=Qe(ue);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(Ji,{asChild:!0,children:i.jsx(l.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:i.jsx(di,{size:16})})}),i.jsx(l.Portal,{children:i.jsx(Ki,{children:i.jsx(qi,{children:t.map(s=>i.jsxs(Xi,{onClick:()=>s.onClick(o),colorScheme:s.colorScheme,value:s.label,children:[s.icon,s.label]},s.label))})})})]})})]},o.id))})}function Qi({tableId:e,data:t=[],headers:n=[],loading:r=!1,emptyMessage:o="No data",actions:s,page:a=1,pageSize:c=10,onPageChange:d,onPageSizeChange:u,density:p="sm",totalCount:h=0,paginationMode:x="client"}){f.useEffect(()=>{Rr(e)},[e]),f.useEffect(()=>{Cr(t,n)},[t,n]);const{sortColumn:v,sortDirection:b,data:g}=Qe(ue),y=f.useMemo(()=>{const w=[...g];if(v&&w.sort((T,j)=>b==="asc"?String(T[v]).localeCompare(String(j[v])):String(j[v]).localeCompare(String(T[v]))),x==="client"){const T=(a-1)*c;return w.slice(T,T+c)}return w},[g,v,b,a,c,x]);return 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",children:r?i.jsx(l.Box,{display:"flex",alignItems:"center",justifyContent:"center",h:"100%",color:"gray.500",children:"Loading..."}):y.length===0?i.jsx(l.Box,{display:"flex",alignItems:"center",justifyContent:"center",h:"100%",color:"gray.500",children:o}):i.jsxs(l.Table.Root,{variant:"outline",w:"100%",size:p,children:[i.jsx(Ai,{}),i.jsx(Zi,{data:y,actions:s})]})}),i.jsx(l.Box,{mt:.5,children:i.jsx(Gi,{totalCount:h,pageSize:c,currentPage:a,onPageChange:d,onPageSizeChange:w=>{u&&u(w),a>1&&d&&d(1)}})})]})}const ea=S(l.Checkbox.Root),ta=S(l.Checkbox.HiddenInput),na=S(l.Checkbox.Control),ra=S(l.Checkbox.Label),Er=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:s,required:a,errorText:c})=>i.jsxs(ea,{value:e,onChange:t,size:n,children:[i.jsx(ta,{}),i.jsx(na,{disabled:s,required:a,errorText:c,helperText:o}),r&&i.jsx(ra,{children:r})]}),J=" to ",Bn=10,Te={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}`},oa=()=>{const{year:e,month:t,day:n}=sn();return`${e}-${String(t).padStart(2,"0")}-${String(n).padStart(2,"0")}`},sa=(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(u=>u!=="");if(n.length===0)return null;const{year:r,month:o,day:s}=sn();let a,c,d;return n.length===1?(a=parseInt(n[0])||s,c=o,d=r):n.length===2?(a=parseInt(n[0])||s,c=parseInt(n[1])||o,d=r):(a=parseInt(n[0])||s,c=parseInt(n[1])||o,d=sa(n[2],r)),c=Math.max(1,Math.min(Te.MONTH_MAX,c)),a=Math.max(1,Math.min(Te.DAY_MAX,a)),`${d}-${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}`},ia=(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,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),ia(n,e)||t},aa=S(l.Popover.Root),ca=S(l.Popover.Trigger),la=S(l.Popover.Content),ua=S(l.Popover.Positioner);function da({value:e,onChange:t,disabled:n=!1}){const[r="",o=""]=e?e.split("|"):[],[s,a]=f.useState(()=>r&&o?`${ge(r)}${J}${ge(o)}`:r?ge(r):""),[c,d]=f.useState(!1),u=f.useRef(null);f.useEffect(()=>{const b=g=>{g.ctrlKey&&g.key==="d"&&!g.shiftKey&&!g.metaKey&&(g.preventDefault(),u.current?.focus())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[]);const p=b=>{let g=b;if(g.includes(J)){const[y,w=""]=g.split(J);g=`${We(y.trim())}${J}${We(w.trim())}`}else if(g.toLowerCase().includes(" to ")){const[y,w=""]=g.split(/\s+to\s+/i);g=`${We(y.trim())} to ${We(w.trim())}`}else g=We(g);a(g)},h=()=>{const b=s.trim();if(!b){t(void 0);return}if(b.includes(J)){const[g,y=""]=b.split(J).map(j=>j.trim()),w=Ve(g),T=y?Ve(y):null;if(w&&T){const[j,O]=T<w?[T,w]:[w,T],k=`${ge(j)}${J}${ge(O)}`;a(k),t(`${j}|${O}`)}else if(w&&!y)a(`${ge(w)}${J}`),t(void 0);else if(w&&y){const j=oa(),[O,k]=j<w?[j,w]:[w,j],_=`${ge(O)}${J}${ge(k)}`;a(_),t(`${O}|${k}`)}else a(""),t(void 0)}else{const g=Ve(b);g?(a(`${ge(g)}${J}`),t(void 0)):(a(""),t(void 0))}},x=b=>{if(b.key!=="Enter")return;b.preventDefault();const g=u.current?.selectionStart||0,y=s.indexOf(J);if(!s.trim()){a(`${Hn()}${J}`);return}if(y===-1){const T=Ve(s.trim());T&&a(`${ge(T)}${J}`);return}if(g<=y+J.length){const T=s.substring(0,y).trim(),j=s.substring(y+J.length),O=Ve(T);O&&a(`${ge(O)}${J}${j}`);return}if(s.substring(y+J.length).trim())h(),u.current?.blur();else{const T=s.substring(0,y+J.length)+Hn();a(T),setTimeout(()=>{h(),u.current?.blur()},0)}},v=()=>{a(""),t(void 0)};return i.jsx(l.InputGroup,{children:i.jsx(i.Fragment,{children:i.jsxs(l.InputElement,{position:"revert",children:[i.jsxs(aa,{open:c,onEscapeKeyDown:()=>{d(!1)},children:[i.jsx(ca,{asChild:!0,children:i.jsx(l.IconButton,{size:"sm",variant:"ghost","aria-label":"Date range help",onClick:()=>d(b=>!b),children:i.jsx(Yn,{size:16})})}),i.jsx(l.Portal,{children:i.jsx(ua,{children:i.jsxs(la,{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:u,placeholder:"15-06-2025 to 20-06-2025",value:s,size:"sm",disabled:n,onChange:b=>p(b.target.value),onBlur:h,onKeyDown:x,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:v,w:"100%"})})]})})})}const fa=S(l.Field.Root),ha=S(l.Field.Label),ga=S(l.Field.HelperText),pa=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:d,isDisabled:u=!1,required:p=!1,errorText:h,visible:x})=>i.jsxs(fa,{width:a,children:[x&&i.jsx(ha,{children:c}),i.jsx(l.InputGroup,{startElement:e,children:i.jsx(l.Input,{value:t,onChange:v=>n?.(v.target.value),placeholder:r,size:o,variant:s,disabled:u,required:p})}),h&&i.jsx(pa,{fontSize:"xs",children:h}),d&&i.jsx(ga,{fontSize:"xs",children:d})]}),va=S(l.Field.Root),ma=S(l.Field.HelperText),ba=S(l.Field.ErrorText),xa=S(l.Select.Root),ya=S(l.Select.Label),Sa=S(l.Select.Control),wa=S(l.Select.Trigger),Da=S(l.Select.ValueText),Ca=S(l.Select.IndicatorGroup),Ra=S(l.Select.Indicator),Ea=S(l.Select.Content),Ta=S(l.Select.Item),ja=S(l.Select.ItemIndicator),Ma=S(l.Select.HiddenSelect),_a=S(l.Select.Positioner),Tr=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:s="xs",width:a="100%",variant:c="outline",helperText:d,isDisabled:u,required:p,errorText:h,visible:x})=>{const v=l.createListCollection({items:e});return i.jsxs(va,{disabled:u,required:p,children:[i.jsxs(xa,{collection:v,variant:c,size:s,width:a,value:n?[n]:[],onValueChange:b=>r?.(b.value[0]),children:[i.jsx(Ma,{}),x&&i.jsx(ya,{children:t}),i.jsxs(Sa,{children:[i.jsx(wa,{children:i.jsx(Da,{placeholder:o})}),i.jsx(Ca,{children:i.jsx(Ra,{})})]}),i.jsx(_a,{children:i.jsx(Ea,{children:v.items.map(b=>i.jsxs(Ta,{item:b,children:[b.label,i.jsx(ja,{})]},b.value))})})]}),d&&i.jsx(ma,{children:d}),h&&i.jsx(ba,{children:h})]})},jr=e=>`FILTER_PRESETS_${e??"default"}`;function Oa(e){try{return JSON.parse(localStorage.getItem(jr(e))||"[]")}catch{return[]}}const Ze=new Kn({}),Tt=e=>{const t=Ze.state[e];if(t)return t;const n=Oa(e);return Ze.setState(r=>({...r,[e]:n})),n},an=(e,t)=>{Ze.setState(n=>({...n,[e]:t})),localStorage.setItem(jr(e),JSON.stringify(t))},Mr=(e,t)=>{const n=Tt(e).filter(r=>r.id!==t);an(e,n)},_r=(e,t)=>{const n=[t,...Tt(e)];an(e,n)},ka=S(l.Checkbox.Root),$a=S(l.Checkbox.HiddenInput),Ia=S(l.Checkbox.Control),Aa=S(l.Slider.Root),La=S(l.Slider.Track),Na=S(l.Slider.Range),za=S(l.Slider.Thumbs),Pa=S(l.Slider.Control),Ya=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:a,transition:c}=yr({id:e.id}),d={transform:Ie.Transform.toString(a),transition:c};return i.jsxs(l.VStack,{ref:s,style:d,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(wr,{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(ka,{checked:e.visible,size:"sm",onCheckedChange:u=>t?.(e.id,!!u.checked),children:[i.jsx($a,{}),i.jsx(Ia,{})]})]}),i.jsxs(l.VStack,{align:"stretch",gap:1,children:[i.jsx(l.Text,{fontSize:"sm",children:"Size"}),i.jsx(Aa,{min:1,max:5,step:.5,value:[e.size??1],onValueChange:u=>n?.(e.id,u.value[0]),children:i.jsxs(Pa,{children:[i.jsx(La,{children:i.jsx(Na,{})}),i.jsx(za,{})]})})]})]})},Fa=S(l.Drawer.Root),Ba=S(l.Drawer.Trigger),Ha=S(l.Drawer.Backdrop),Va=S(l.Drawer.Positioner),Wa=S(l.Drawer.Content),Ua=S(l.Drawer.Header),Ga=S(l.Drawer.Title),Xa=S(l.Drawer.Body),qa=S(l.Drawer.Footer),Ka=S(l.Drawer.CloseTrigger),Ja=S(l.Tabs.Root),Za=S(l.Tabs.List),Ft=S(l.Tabs.Trigger),Bt=S(l.Tabs.Content),Or=(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(Er,{label:e.label,value:e.value,onChange:e.onChange});case"select":return i.jsx(Tr,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[],visible:t});case"date":return i.jsx(da,{value:e.value,onChange:e.onChange});default:return null}},Qa=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:s="default",currentFilters:a={},onLoadPreset:c,activePresetName:d,onReorder:u,open:p,onOpenChange:h})=>{const v=Qe(Ze)[s]??Tt(s),b=()=>{const g=prompt("Preset name?");g&&_r(s,{id:crypto.randomUUID(),name:g,date:new Date().toISOString(),filters:a})};return i.jsx(l.HStack,{wrap:"wrap",children:i.jsxs(Fa,{size:e,open:p,onOpenChange:h,children:[i.jsx(Ba,{asChild:!0,children:i.jsxs(l.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[i.jsx(hi,{size:16}),"Filters"]})}),i.jsxs(l.Portal,{children:[i.jsx(Ha,{}),i.jsx(Va,{children:i.jsxs(Wa,{children:[i.jsx(Ua,{children:i.jsx(Ga,{children:"Filters"})}),i.jsx(Xa,{overflowY:"auto",pt:1,children:i.jsxs(Ja,{defaultValue:"view",children:[i.jsxs(Za,{mb:4,children:[i.jsxs(Ft,{value:"view",children:[i.jsx(vi,{size:16}),"Edit"]}),i.jsxs(Ft,{value:"settings",children:[i.jsx(yi,{size:16}),"Settings"]}),i.jsxs(Ft,{value:"presets",children:[i.jsx(ei,{size:16}),"Presets"]})]}),i.jsx(Bt,{value:"view",children:o.filter(g=>g.visible).map(g=>i.jsx(l.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",flex:g.size??1,minW:`${(g.size??1)*100}px`,rounded:"md",p:3,mb:3,children:Or(g,p)},g.id))}),i.jsx(Bt,{value:"settings",children:i.jsx(gr,{sensors:bo(mo(on)),collisionDetection:er,onDragEnd:({active:g,over:y})=>{if(!y||g.id===y.id)return;const w=o.findIndex(O=>O.id===g.id),T=o.findIndex(O=>O.id===y.id),j=Et(o,w,T);u?.(j)},children:i.jsx(br,{items:o.map(g=>g.id),strategy:$s,children:o.map(g=>i.jsx(Ya,{filter:g,onVisibilityChange:t,onSizeChange:n},g.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"}),v.length===0&&i.jsx(l.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),v.map(g=>i.jsxs(l.HStack,{justify:"space-between",border:"1px solid",borderColor:d===g.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:g.name}),i.jsx(l.Text,{fontSize:"xs",color:"gray.500",children:new Date(g.date).toLocaleDateString()})]}),i.jsxs(l.HStack,{children:[i.jsx(l.Button,{size:"xs",variant:"ghost",onClick:()=>c?.(g.filters,g.name),children:"Load"}),i.jsx(l.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>Mr(s,g.id),children:i.jsx(li,{size:14})})]})]},g.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(Ka,{asChild:!0,children:i.jsx(l.CloseButton,{})})]})]})})]})]})})},ec=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:a,pageKey:c,currentFilters:d,onLoadPreset:u,activePresetName:p,filterDrawerSize:h="sm"})=>{const[x,v]=f.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:Or(b)},b.id)),i.jsx(Qa,{filterDrawerSize:h,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:a,pageKey:c,filters:t,currentFilters:d,onLoadPreset:u,activePresetName:p,open:x,onOpenChange:b=>{v(b.open)}})]})]})},tc=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},nc=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}},rc=({onClick:e,size:t="xs",variant:n="solid",label:r,leftIcon:o,rightIcon:s,isDisabled:a,colorScheme:c,loading:d,loadingText:u,rounded:p,type:h="button"})=>i.jsx(l.Button,{onClick:e,size:t,variant:n,disabled:a,colorPalette:c,loading:d,loadingText:u,rounded:p,type:h,children:i.jsxs(l.HStack,{gap:1,children:[o,r,s]})}),oc=S(l.Dialog.Root);S(l.Dialog.Trigger);const sc=S(l.Dialog.Backdrop),ic=S(l.Dialog.Positioner),ac=S(l.Dialog.Content),cc=S(l.Dialog.Header),lc=S(l.Dialog.Body),uc=S(l.Dialog.Footer),dc=S(l.Dialog.Title),fc=S(l.Dialog.CloseTrigger);function hc({open:e,onClose:t,onConfirm:n,title:r="Delete Company",entityName:o,confirmText:s="DELETE",confirmLabel:a="Delete",isLoading:c=!1}){const[d,u]=f.useState(""),p=d===s;return i.jsx(oc,{open:e,placement:"center",onOpenChange:h=>!h.open&&t(),children:i.jsxs(l.Portal,{children:[i.jsx(sc,{}),i.jsx(ic,{children:i.jsxs(ac,{maxW:"520px",children:[i.jsx(cc,{children:i.jsx(dc,{color:"red.600",children:r})}),i.jsx(lc,{children:i.jsxs(l.Stack,{gap: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(wi,{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:d,onChange:h=>u(h.target.value)})]})]})}),i.jsxs(uc,{justifyContent:"flex-end",gap:3,children:[i.jsx(l.Button,{variant:"outline",size:"sm",onClick:t,children:"Cancel"}),i.jsx(l.Button,{size:"sm",colorScheme:"red",disabled:!p,loading:c,onClick:n,children:a})]}),i.jsx(fc,{asChild:!0,children:i.jsx(l.CloseButton,{size:"sm"})})]})})]})})}function kr({refetch:e,isLoading:t=!1,label:n="Refresh"}){const[r,o]=f.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(bi,{size:14,style:{animation:r?"spin 0.6s linear infinite":void 0}})})}var ht={exports:{}},gc=ht.exports,Vn;function pc(){return Vn||(Vn=1,(function(e,t){(function(n,r){e.exports=r()})(gc,(function(){var n=1e3,r=6e4,o=36e5,s="millisecond",a="second",c="minute",d="hour",u="day",p="week",h="month",x="quarter",v="year",b="date",g="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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,T={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($){var R=["th","st","nd","rd"],D=$%100;return"["+$+(R[(D-20)%10]||R[D]||R[0])+"]"}},j=function($,R,D){var M=String($);return!M||M.length>=R?$:""+Array(R+1-M.length).join(D)+$},O={s:j,z:function($){var R=-$.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 $(R,D){if(R.date()<D.date())return-$(D,R);var M=12*(D.year()-R.year())+(D.month()-R.month()),E=R.clone().add(M,h),L=D-E<0,z=R.clone().add(M+(L?-1:1),h);return+(-(M+(D-E)/(L?E-z:z-E))||0)},a:function($){return $<0?Math.ceil($)||0:Math.floor($)},p:function($){return{M:h,y:v,w:p,d:u,D:b,h:d,m:c,s:a,ms:s,Q:x}[$]||String($||"").toLowerCase().replace(/s$/,"")},u:function($){return $===void 0}},k="en",_={};_[k]=T;var I="$isDayjsObject",P=function($){return $ instanceof K||!(!$||!$[I])},W=function $(R,D,M){var E;if(!R)return k;if(typeof R=="string"){var L=R.toLowerCase();_[L]&&(E=L),D&&(_[L]=D,E=L);var z=R.split("-");if(!E&&z.length>1)return $(z[0])}else{var m=R.name;_[m]=R,E=m}return!M&&E&&(k=E),E||!M&&k},B=function($,R){if(P($))return $.clone();var D=typeof R=="object"?R:{};return D.date=$,D.args=arguments,new K(D)},A=O;A.l=W,A.i=P,A.w=function($,R){return B($,{locale:R.$L,utc:R.$u,x:R.$x,$offset:R.$offset})};var K=(function(){function $(D){this.$L=W(D.locale,null,!0),this.parse(D),this.$x=this.$x||D.x||{},this[I]=!0}var R=$.prototype;return R.parse=function(D){this.$d=(function(M){var E=M.date,L=M.utc;if(E===null)return new Date(NaN);if(A.u(E))return new Date;if(E instanceof Date)return new Date(E);if(typeof E=="string"&&!/Z$/i.test(E)){var z=E.match(y);if(z){var m=z[2]-1||0,C=(z[7]||"0").substring(0,3);return L?new Date(Date.UTC(z[1],m,z[3]||1,z[4]||0,z[5]||0,z[6]||0,C)):new Date(z[1],m,z[3]||1,z[4]||0,z[5]||0,z[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 A},R.isValid=function(){return this.$d.toString()!==g},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 A.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,L=!!A.u(M)||M,z=A.p(D),m=function(q,Y){var se=A.w(E.$u?Date.UTC(E.$y,Y,q):new Date(E.$y,Y,q),E);return L?se:se.endOf(u)},C=function(q,Y){return A.w(E.toDate()[q].apply(E.toDate("s"),(L?[0,0,0,0]:[23,59,59,999]).slice(Y)),E)},N=this.$W,F=this.$M,U=this.$D,G="set"+(this.$u?"UTC":"");switch(z){case v:return L?m(1,0):m(31,11);case h:return L?m(1,F):m(0,F+1);case p:var H=this.$locale().weekStart||0,X=(N<H?N+7:N)-H;return m(L?U-X:U+(6-X),F);case u:case b:return C(G+"Hours",0);case d: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,L=A.p(D),z="set"+(this.$u?"UTC":""),m=(E={},E[u]=z+"Date",E[b]=z+"Date",E[h]=z+"Month",E[v]=z+"FullYear",E[d]=z+"Hours",E[c]=z+"Minutes",E[a]=z+"Seconds",E[s]=z+"Milliseconds",E)[L],C=L===u?this.$D+(M-this.$W):M;if(L===h||L===v){var N=this.clone().set(b,1);N.$d[m](C),N.init(),this.$d=N.set(b,Math.min(this.$D,N.daysInMonth())).$d}else m&&this.$d[m](C);return this.init(),this},R.set=function(D,M){return this.clone().$set(D,M)},R.get=function(D){return this[A.p(D)]()},R.add=function(D,M){var E,L=this;D=Number(D);var z=A.p(M),m=function(F){var U=B(L);return A.w(U.date(U.date()+Math.round(F*D)),L)};if(z===h)return this.set(h,this.$M+D);if(z===v)return this.set(v,this.$y+D);if(z===u)return m(1);if(z===p)return m(7);var C=(E={},E[c]=r,E[d]=o,E[a]=n,E)[z]||1,N=this.$d.getTime()+D*C;return A.w(N,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||g;var L=D||"YYYY-MM-DDTHH:mm:ssZ",z=A.z(this),m=this.$H,C=this.$m,N=this.$M,F=E.weekdays,U=E.months,G=E.meridiem,H=function(Y,se,ne,he){return Y&&(Y[se]||Y(M,L))||ne[se].slice(0,he)},X=function(Y){return A.s(m%12||12,Y,"0")},q=G||function(Y,se,ne){var he=Y<12?"AM":"PM";return ne?he.toLowerCase():he};return L.replace(w,(function(Y,se){return se||(function(ne){switch(ne){case"YY":return String(M.$y).slice(-2);case"YYYY":return A.s(M.$y,4,"0");case"M":return N+1;case"MM":return A.s(N+1,2,"0");case"MMM":return H(E.monthsShort,N,U,3);case"MMMM":return H(U,N);case"D":return M.$D;case"DD":return A.s(M.$D,2,"0");case"d":return String(M.$W);case"dd":return H(E.weekdaysMin,M.$W,F,2);case"ddd":return H(E.weekdaysShort,M.$W,F,3);case"dddd":return F[M.$W];case"H":return String(m);case"HH":return A.s(m,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return q(m,C,!0);case"A":return q(m,C,!1);case"m":return String(C);case"mm":return A.s(C,2,"0");case"s":return String(M.$s);case"ss":return A.s(M.$s,2,"0");case"SSS":return A.s(M.$ms,3,"0");case"Z":return z}return null})(Y)||z.replace(":","")}))},R.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},R.diff=function(D,M,E){var L,z=this,m=A.p(M),C=B(D),N=(C.utcOffset()-this.utcOffset())*r,F=this-C,U=function(){return A.m(z,C)};switch(m){case v:L=U()/12;break;case h:L=U();break;case x:L=U()/3;break;case p:L=(F-N)/6048e5;break;case u:L=(F-N)/864e5;break;case d:L=F/o;break;case c:L=F/r;break;case a:L=F/n;break;default:L=F}return E?L:A.a(L)},R.daysInMonth=function(){return this.endOf(h).$D},R.$locale=function(){return _[this.$L]},R.locale=function(D,M){if(!D)return this.$L;var E=this.clone(),L=W(D,M,!0);return L&&(E.$L=L),E},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()},$})(),ee=K.prototype;return B.prototype=ee,[["$ms",s],["$s",a],["$m",c],["$H",d],["$W",u],["$M",h],["$y",v],["$D",b]].forEach((function($){ee[$[1]]=function(R){return this.$g(R,$[0],$[1])}})),B.extend=function($,R){return $.$i||($(R,K,B),$.$i=!0),B},B.locale=W,B.isDayjs=P,B.unix=function($){return B(1e3*$)},B.en=_[k],B.Ls=_,B.p={},B}))})(ht)),ht.exports}var vc=pc();const jt=wt(vc);var gt={exports:{}},mc=gt.exports,Wn;function bc(){return Wn||(Wn=1,(function(e,t){(function(n,r){e.exports=r()})(mc,(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(u,p,h,x){return s.fromToBase(u,p,h,x)}o.en.relativeTime=a,s.fromToBase=function(u,p,h,x,v){for(var b,g,y,w=h.$locale().relativeTime||a,T=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=T.length,O=0;O<j;O+=1){var k=T[O];k.d&&(b=x?o(u).diff(h,k.d,!0):h.diff(u,k.d,!0));var _=(n.rounding||Math.round)(Math.abs(b));if(y=b>0,_<=k.r||!k.r){_<=1&&O>0&&(k=T[O-1]);var I=w[k.l];v&&(_=v(""+_)),g=typeof I=="string"?I.replace("%d",_):I(_,p,k.l,y);break}}if(p)return g;var P=y?w.future:w.past;return typeof P=="function"?P(g):P.replace("%s",g)},s.to=function(u,p){return c(u,p,this,!0)},s.from=function(u,p){return c(u,p,this)};var d=function(u){return u.$u?o.utc():o()};s.toNow=function(u){return this.to(d(this),u)},s.fromNow=function(u){return this.from(d(this),u)}}}))})(gt)),gt.exports}var xc=bc();const yc=wt(xc);var pt={exports:{}},Sc=pt.exports,Un;function wc(){return Un||(Un=1,(function(e,t){(function(n,r){e.exports=r()})(Sc,(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(d){d===void 0&&(d="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,p=(function(h,x){return h.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(v,b,g){var y=g&&g.toUpperCase();return b||x[g]||n[g]||x[y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(w,T,j){return T||j.slice(1)}))}))})(d,u===void 0?{}:u);return c.call(this,p)}}}))})(pt)),pt.exports}var Dc=wc();const Cc=wt(Dc);var vt={exports:{}},Rc=vt.exports,Gn;function Ec(){return Gn||(Gn=1,(function(e,t){(function(n,r){e.exports=r()})(Rc,(function(){return function(n,r){var o=r.prototype,s=o.format;o.format=function(a){var c=this,d=this.$locale();if(!this.isValid())return s.bind(this)(a);var u=this.$utils(),p=(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 d.ordinal(c.$D);case"gggg":return c.weekYear();case"GGGG":return c.isoWeekYear();case"wo":return d.ordinal(c.week(),"W");case"w":case"ww":return u.s(c.week(),h==="w"?1:2,"0");case"W":case"WW":return u.s(c.isoWeek(),h==="W"?1:2,"0");case"k":case"kk":return u.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)(p)}}}))})(vt)),vt.exports}var Tc=Ec();const jc=wt(Tc);jt.extend(yc);jt.extend(Cc);jt.extend(jc);const Mc={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??Mc[t]):r}function _c({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=Qi;exports.Filters=ec;exports.MDSButton=rc;exports.MDSCheckbox=Er;exports.MDSConfirmDeleteDialog=hc;exports.MDSInput=qt;exports.MDSRefreshButton=kr;exports.MDSSelectBox=Tr;exports.RefreshButton=kr;exports.StackedDateTime=_c;exports.addPreset=_r;exports.deletePreset=Mr;exports.formatDateTime=Kt;exports.getPresets=Tt;exports.loadOrder=nc;exports.presetStore=Ze;exports.saveOrder=tc;exports.savePresets=an;exports.setData=Cr;exports.setTableId=Rr;exports.tableStore=ue;exports.withChildren=S;
package/dist/index.d.ts CHANGED
@@ -16,6 +16,17 @@ declare interface Column<T = unknown> {
16
16
  format?: (value: unknown, row: T) => React.ReactNode;
17
17
  }
18
18
 
19
+ export declare interface ConfirmDeleteDialogProps {
20
+ open: boolean;
21
+ onClose: () => void;
22
+ onConfirm: () => void;
23
+ title?: string;
24
+ entityName: string;
25
+ confirmText?: string;
26
+ confirmLabel?: string;
27
+ isLoading?: boolean;
28
+ }
29
+
19
30
  export declare function DataTable<T extends Record<string, unknown>>({ tableId, data: rowData, headers, loading, emptyMessage, actions, page, pageSize, onPageChange, onPageSizeChange, density, totalCount, paginationMode, }: DataTableProps<T>): JSX_2.Element;
20
31
 
21
32
  declare interface DataTableAction<T = unknown> {
@@ -42,12 +53,23 @@ declare interface DataTableProps<T = unknown> {
42
53
  actionHeader?: JSX.Element;
43
54
  }
44
55
 
56
+ export declare type DateTimeVariant = 'date' | 'time' | 'dateTime' | 'full' | 'relative' | 'short';
57
+
45
58
  export declare const deletePreset: (pageKey: string, id: string) => void;
46
59
 
47
60
  declare type DensityType = 'sm' | 'md' | 'lg';
48
61
 
49
62
  export declare const Filters: ({ title, filters, onVisibilityChange, onReorder, onSizeChange, onClear, maxToolbarUnits, pageKey, currentFilters, onLoadPreset, activePresetName, filterDrawerSize, }: IMainFilterType) => JSX_2.Element;
50
63
 
64
+ export declare function formatDateTime({ value, variant, format, fallback, }: FormatDateTimeProps): string;
65
+
66
+ export declare interface FormatDateTimeProps {
67
+ value: string | Date | number | null | undefined;
68
+ variant?: DateTimeVariant;
69
+ format?: string;
70
+ fallback?: string;
71
+ }
72
+
51
73
  export declare const getPresets: (pageKey: string) => PresetItem[];
52
74
 
53
75
  export declare interface IFilterConfig {
@@ -161,6 +183,8 @@ export declare const MDSButton: ({ onClick, size, variant, label, leftIcon, righ
161
183
 
162
184
  export declare const MDSCheckbox: ({ value, onChange, size, label, helperText, isDisabled, required, errorText, }: IMDSCheckboxTypes) => JSX_2.Element;
163
185
 
186
+ export declare function MDSConfirmDeleteDialog({ open, onClose, onConfirm, title, entityName, confirmText, confirmLabel, isLoading, }: ConfirmDeleteDialogProps): JSX_2.Element;
187
+
164
188
  export declare const MDSInput: ({ icon, value, onChange, placeholder, size, variant, width, label, helperText, isDisabled, required, errorText, visible, }: IMDSInputTypes) => JSX_2.Element;
165
189
 
166
190
  export declare const MDSSelectBox: ({ options, label, value, onChange, placeholder, size, width, variant, helperText, isDisabled, required, errorText, visible, }: IMDSSelectBoxTypes) => JSX_2.Element;
@@ -192,6 +216,17 @@ export declare function setData(newData: any[], headers?: Column<any>[]): void;
192
216
 
193
217
  export declare function setTableId(tableId: string): void;
194
218
 
219
+ export declare function StackedDateTime({ value, dateVariant, timeVariant, dateFormat, timeFormat, align, }: StackedDateTimeProps): JSX_2.Element;
220
+
221
+ declare interface StackedDateTimeProps {
222
+ value: string | Date | number | null | undefined;
223
+ dateVariant?: 'date' | 'short' | 'full';
224
+ timeVariant?: 'time';
225
+ dateFormat?: string;
226
+ timeFormat?: string;
227
+ align?: 'start' | 'center' | 'end';
228
+ }
229
+
195
230
  declare interface TableState {
196
231
  tableId: string;
197
232
  sortColumn: string | null;