@mdspl/mds-shared-ui 0.1.8 → 0.2.0
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 +3 -3
- package/dist/index.d.ts +43 -50
- package/dist/index.js +2300 -1931
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),c=require("@chakra-ui/react"),Ue=require("react-dom");var ot={exports:{}},Be={};var an;function wr(){if(an)return Be;an=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 Be.Fragment=t,Be.jsx=n,Be.jsxs=n,Be}var He={};var ln;function Cr(){return ln||(ln=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 y:return"Fragment";case C:return"Profiler";case S:return"StrictMode";case D: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 v:return"Portal";case T:return b.displayName||"Context";case R:return(b._context.displayName||"Context")+".Consumer";case _:var E=b.render;return b=b.displayName,b||(b=E.displayName||E.name||"",b=b!==""?"ForwardRef("+b+")":"ForwardRef"),b;case O:return E=b.displayName||null,E!==null?E:e(b.type)||"Memo";case L:E=b._payload,b=b._init;try{return e(b(E))}catch{}}return null}function t(b){return""+b}function n(b){try{t(b);var E=!1}catch{E=!0}if(E){E=console;var I=E.error,A=typeof Symbol=="function"&&Symbol.toStringTag&&b[Symbol.toStringTag]||b.constructor.name||"Object";return I.call(E,"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===y)return"<>";if(typeof b=="object"&&b!==null&&b.$$typeof===L)return"<...>";try{var E=e(b);return E?"<"+E+">":"<...>"}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(X.call(b,"key")){var E=Object.getOwnPropertyDescriptor(b,"key").get;if(E&&E.isReactWarning)return!1}return b.key!==void 0}function l(b,E){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)",E))}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,E,I,A,le,Y){var $=I.ref;return b={$$typeof:x,type:b,key:E,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,E,I,A,le,Y){var $=E.children;if($!==void 0)if(A)if(te($)){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(X.call(E,"key")){$=e(b);var G=Object.keys(E).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:
|
|
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} />`,M,P,Y,P),ve[P+M]=!0)}if(P=null,k!==void 0&&(n(k),P=""+k),i(S)&&(n(S.key),P=""+S.key),"key"in S){k={};for(var X in S)X!=="key"&&(k[X]=S[X])}else k=S;return P&&a(k,typeof p=="function"?p.displayName||p.name||"Unknown":p),u(p,P,k,o(),ie,H)}function v(p){b(p)?p._store&&(p._store.validated=1):typeof p=="object"&&p!==null&&p.$$typeof===L&&(p._payload.status==="fulfilled"?b(p._payload.value)&&p._payload.value._store&&(p._payload.value._store.validated=1):p._store&&(p._store.validated=1))}function b(p){return typeof p=="object"&&p!==null&&p.$$typeof===y}var f=c,y=Symbol.for("react.transitional.element"),m=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),O=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),N=Symbol.for("react.client.reference"),U=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=Object.prototype.hasOwnProperty,te=Array.isArray,de=console.createTask?console.createTask:function(){return null};f={react_stack_bottom_frame:function(p){return p()}};var we,F={},Se=f.react_stack_bottom_frame.bind(f,s)(),ne=de(r(s)),ve={};Ve.Fragment=x,Ve.jsx=function(p,S,k){var M=1e4>U.recentlyCreatedOwnerStacks++;return h(p,S,k,!1,M?Error("react-stack-top-frame"):Se,M?de(r(p)):ne)},Ve.jsxs=function(p,S,k){var M=1e4>U.recentlyCreatedOwnerStacks++;return h(p,S,k,!0,M?Error("react-stack-top-frame"):Se,M?de(r(p)):ne)}})()),Ve}var rn;function br(){return rn||(rn=1,process.env.NODE_ENV==="production"?et.exports=gr():et.exports=pr()),et.exports}var d=br(),tt={exports:{}},wt={},nt={exports:{}},St={};var on;function mr(){if(on)return St;on=1;var e=c;function t(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(v,b){var f=b(),y=r({inst:{value:f,getSnapshot:b}}),m=y[0].inst,x=y[1];return s(function(){m.value=f,m.getSnapshot=b,l(m)&&x({inst:m})},[v,f,b]),o(function(){return l(m)&&x({inst:m}),v(function(){l(m)&&x({inst:m})})},[v]),i(f),f}function l(v){var b=v.getSnapshot;v=v.value;try{var f=b();return!n(v,f)}catch{return!0}}function u(v,b){return b()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:a;return St.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,St}var Ct={};var sn;function xr(){return sn||(sn=1,process.env.NODE_ENV!=="production"&&(function(){function e(f,y){return f===y&&(f!==0||1/f===1/y)||f!==f&&y!==y}function t(f,y){h||o.startTransition===void 0||(h=!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 m=y();if(!v){var x=y();s(m,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),v=!0)}x=i({inst:{value:m,getSnapshot:y}});var w=x[0].inst,C=x[1];return l(function(){w.value=m,w.getSnapshot=y,n(w)&&C({inst:w})},[f,m,y]),a(function(){return n(w)&&C({inst:w}),f(function(){n(w)&&C({inst:w})})},[f]),u(m),m}function n(f){var y=f.getSnapshot;f=f.value;try{var m=y();return!s(f,m)}catch{return!0}}function r(f,y){return y()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=c,s=typeof Object.is=="function"?Object.is:e,i=o.useState,a=o.useEffect,l=o.useLayoutEffect,u=o.useDebugValue,h=!1,v=!1,b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Ct.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:b,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Ct}var an;function _n(){return an||(an=1,process.env.NODE_ENV==="production"?nt.exports=mr():nt.exports=xr()),nt.exports}var cn;function yr(){if(cn)return wt;cn=1;var e=c,t=_n();function n(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var r=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,l=e.useDebugValue;return wt.useSyncExternalStoreWithSelector=function(u,h,v,b,f){var y=s(null);if(y.current===null){var m={hasValue:!1,value:null};y.current=m}else m=y.current;y=a(function(){function w(R){if(!C){if(C=!0,E=R,R=b(R),f!==void 0&&m.hasValue){var D=m.value;if(f(D,R))return O=D}return O=R}if(D=O,r(E,R))return D;var T=b(R);return f!==void 0&&f(D,T)?(E=R,D):(E=R,O=T)}var C=!1,E,O,j=v===void 0?null:v;return[function(){return w(h())},j===null?void 0:function(){return w(j())}]},[h,v,b,f]);var x=o(u,y[0],y[1]);return i(function(){m.hasValue=!0,m.value=x},[x]),l(x),x},wt}var Rt={};var ln;function wr(){return ln||(ln=1,process.env.NODE_ENV!=="production"&&(function(){function e(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=c,n=_n(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,a=t.useMemo,l=t.useDebugValue;Rt.useSyncExternalStoreWithSelector=function(u,h,v,b,f){var y=s(null);if(y.current===null){var m={hasValue:!1,value:null};y.current=m}else m=y.current;y=a(function(){function w(R){if(!C){if(C=!0,E=R,R=b(R),f!==void 0&&m.hasValue){var D=m.value;if(f(D,R))return O=D}return O=R}if(D=O,r(E,R))return D;var T=b(R);return f!==void 0&&f(D,T)?(E=R,D):(E=R,O=T)}var C=!1,E,O,j=v===void 0?null:v;return[function(){return w(h())},j===null?void 0:function(){return w(j())}]},[h,v,b,f]);var x=o(u,y[0],y[1]);return i(function(){m.hasValue=!0,m.value=x},[x]),l(x),x},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Rt}var un;function Sr(){return un||(un=1,process.env.NODE_ENV==="production"?tt.exports=yr():tt.exports=wr()),tt.exports}var Cr=Sr();const It=new WeakMap,Rr=new WeakMap,ct={current:[]};let Et=!1;const rt=new Set,dn=new Map;function On(e){for(const t of e){if(ct.current.includes(t))continue;ct.current.push(t),t.recompute();const n=Rr.get(t);if(n)for(const r of n){const o=It.get(r);o?.length&&On(o)}}}function Er(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Dr(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function _r(e){if(rt.add(e),!Et)try{for(Et=!0;rt.size>0;){const t=Array.from(rt);rt.clear();for(const n of t){const r=dn.get(n)??n.prevState;n.prevState=r,Er(n)}for(const n of t){const r=It.get(n);r&&(ct.current.push(n),On(r))}for(const n of t){const r=It.get(n);if(r)for(const o of r)Dr(o)}}}finally{Et=!1,ct.current=[],dn.clear()}}function Or(e){return typeof e=="function"}class Tn{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):Or(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),_r(this)}}function qe(e,t=r=>r,n={}){const r=n.equal??Tr;return Cr.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Tr(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=fn(e);if(n.length!==fn(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 fn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function jr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const ht=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ke(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function zt(e){return"nodeType"in e}function q(e){var t,n;return e?ke(e)?e:zt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function $t(e){const{Document:t}=q(e);return e instanceof t}function Xe(e){return ke(e)?!1:e instanceof q(e).HTMLElement}function jn(e){return e instanceof q(e).SVGElement}function Ie(e){return e?ke(e)?e.document:zt(e)?$t(e)?e:Xe(e)||jn(e)?e.ownerDocument:document:document:document}const ue=ht?c.useLayoutEffect:c.useEffect;function Vt(e){const t=c.useRef(e);return ue(()=>{t.current=e}),c.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 kr(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ue(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return ue(()=>{n.current!==e&&(n.current=e)},t),n}function Je(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function lt(e){const t=Vt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function At(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let Dt={};function Ke(e,t){return c.useMemo(()=>{if(t)return t;const n=Dt[e]==null?0:Dt[e]+1;return Dt[e]=n,e+"-"+n},[e,t])}function kn(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 a=Object.entries(i);for(const[l,u]of a){const h=s[l];h!=null&&(s[l]=h+e*u)}return s},{...t})}}const Te=kn(1),ut=kn(-1);function Ir(e){return"clientX"in e&&"clientY"in e}function Bt(e){if(!e)return!1;const{KeyboardEvent:t}=q(e.target);return t&&e instanceof t}function Ar(e){if(!e)return!1;const{TouchEvent:t}=q(e.target);return t&&e instanceof t}function Mt(e){if(Ar(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 Ir(e)?{x:e.clientX,y:e.clientY}:null}const je=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[je.Translate.toString(e),je.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),hn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Mr(e){return e.matches(hn)?e:e.querySelector(hn)}const Nr={display:"none"};function Lr(e){let{id:t,value:n}=e;return c.createElement("div",{id:t,style:Nr},n)}function Pr(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 c.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function zr(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const In=c.createContext(null);function $r(e){const t=c.useContext(In);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Vr(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var a;return(a=i[o])==null?void 0:a.call(i,s)})},[e]),t]}const Br={draggable:`
|
|
6
|
+
<%s key={someKey} {...props} />`,A,$,G,$),ve[$+A]=!0)}if($=null,I!==void 0&&(n(I),$=""+I),i(E)&&(n(E.key),$=""+E.key),"key"in E){I={};for(var J in E)J!=="key"&&(I[J]=E[J])}else I=E;return $&&l(I,typeof b=="function"?b.displayName||b.name||"Unknown":b),f(b,$,I,o(),le,Y)}function g(b){m(b)?b._store&&(b._store.validated=1):typeof b=="object"&&b!==null&&b.$$typeof===L&&(b._payload.status==="fulfilled"?m(b._payload.value)&&b._payload.value._store&&(b._payload.value._store.validated=1):b._store&&(b._store.validated=1))}function m(b){return typeof b=="object"&&b!==null&&b.$$typeof===x}var h=d,x=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),T=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),D=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=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.prototype.hasOwnProperty,te=Array.isArray,he=console.createTask?console.createTask:function(){return null};h={react_stack_bottom_frame:function(b){return b()}};var Re,H={},Ee=h.react_stack_bottom_frame.bind(h,s)(),ne=he(r(s)),ve={};He.Fragment=y,He.jsx=function(b,E,I){var A=1e4>U.recentlyCreatedOwnerStacks++;return p(b,E,I,!1,A?Error("react-stack-top-frame"):Ee,A?he(r(b)):ne)},He.jsxs=function(b,E,I){var A=1e4>U.recentlyCreatedOwnerStacks++;return p(b,E,I,!0,A?Error("react-stack-top-frame"):Ee,A?he(r(b)):ne)}})()),He}var cn;function Rr(){return cn||(cn=1,process.env.NODE_ENV==="production"?ot.exports=wr():ot.exports=Cr()),ot.exports}var a=Rr(),st={exports:{}},Et={},it={exports:{}},Dt={};var un;function Er(){if(un)return Dt;un=1;var e=d;function t(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,o=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function l(g,m){var h=m(),x=r({inst:{value:h,getSnapshot:m}}),v=x[0].inst,y=x[1];return s(function(){v.value=h,v.getSnapshot=m,u(v)&&y({inst:v})},[g,h,m]),o(function(){return u(v)&&y({inst:v}),g(function(){u(v)&&y({inst:v})})},[g]),i(h),h}function u(g){var m=g.getSnapshot;g=g.value;try{var h=m();return!n(g,h)}catch{return!0}}function f(g,m){return m()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:l;return Dt.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Dt}var Tt={};var dn;function Dr(){return dn||(dn=1,process.env.NODE_ENV!=="production"&&(function(){function e(h,x){return h===x&&(h!==0||1/h===1/x)||h!==h&&x!==x}function t(h,x){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 v=x();if(!g){var y=x();s(v,y)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),g=!0)}y=i({inst:{value:v,getSnapshot:x}});var S=y[0].inst,C=y[1];return u(function(){S.value=v,S.getSnapshot=x,n(S)&&C({inst:S})},[h,v,x]),l(function(){return n(S)&&C({inst:S}),h(function(){n(S)&&C({inst:S})})},[h]),f(v),v}function n(h){var x=h.getSnapshot;h=h.value;try{var v=x();return!s(h,v)}catch{return!0}}function r(h,x){return x()}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,m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;Tt.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:m,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),Tt}var fn;function Ln(){return fn||(fn=1,process.env.NODE_ENV==="production"?it.exports=Er():it.exports=Dr()),it.exports}var hn;function Tr(){if(hn)return Et;hn=1;var e=d,t=Ln();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 Et.useSyncExternalStoreWithSelector=function(f,p,g,m,h){var x=s(null);if(x.current===null){var v={hasValue:!1,value:null};x.current=v}else v=x.current;x=l(function(){function S(D){if(!C){if(C=!0,R=D,D=m(D),h!==void 0&&v.hasValue){var j=v.value;if(h(j,D))return T=j}return T=D}if(j=T,r(R,D))return j;var O=m(D);return h!==void 0&&h(j,O)?(R=D,j):(R=D,T=O)}var C=!1,R,T,_=g===void 0?null:g;return[function(){return S(p())},_===null?void 0:function(){return S(_())}]},[p,g,m,h]);var y=o(f,x[0],x[1]);return i(function(){v.hasValue=!0,v.value=y},[y]),u(y),y},Et}var jt={};var gn;function jr(){return gn||(gn=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=Ln(),r=typeof Object.is=="function"?Object.is:e,o=n.useSyncExternalStore,s=t.useRef,i=t.useEffect,l=t.useMemo,u=t.useDebugValue;jt.useSyncExternalStoreWithSelector=function(f,p,g,m,h){var x=s(null);if(x.current===null){var v={hasValue:!1,value:null};x.current=v}else v=x.current;x=l(function(){function S(D){if(!C){if(C=!0,R=D,D=m(D),h!==void 0&&v.hasValue){var j=v.value;if(h(j,D))return T=j}return T=D}if(j=T,r(R,D))return j;var O=m(D);return h!==void 0&&h(j,O)?(R=D,j):(R=D,T=O)}var C=!1,R,T,_=g===void 0?null:g;return[function(){return S(p())},_===null?void 0:function(){return S(_())}]},[p,g,m,h]);var y=o(f,x[0],x[1]);return i(function(){v.hasValue=!0,v.value=y},[y]),u(y),y},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),jt}var pn;function _r(){return pn||(pn=1,process.env.NODE_ENV==="production"?st.exports=Tr():st.exports=jr()),st.exports}var Or=_r();const Lt=new WeakMap,Ir=new WeakMap,ft={current:[]};let _t=!1;const at=new Set,vn=new Map;function $n(e){for(const t of e){if(ft.current.includes(t))continue;ft.current.push(t),t.recompute();const n=Ir.get(t);if(n)for(const r of n){const o=Lt.get(r);o?.length&&$n(o)}}}function kr(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Mr(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function Ar(e){if(at.add(e),!_t)try{for(_t=!0;at.size>0;){const t=Array.from(at);at.clear();for(const n of t){const r=vn.get(n)??n.prevState;n.prevState=r,kr(n)}for(const n of t){const r=Lt.get(n);r&&(ft.current.push(n),$n(r))}for(const n of t){const r=Lt.get(n);if(r)for(const o of r)Mr(o)}}}finally{_t=!1,ft.current=[],vn.clear()}}function Nr(e){return typeof e=="function"}class Pn{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):Nr(t)?this.state=t(this.prevState):this.state=t,(o=(r=this.options)==null?void 0:r.onUpdate)==null||o.call(r),Ar(this)}}function Ze(e,t=r=>r,n={}){const r=n.equal??Lr;return Or.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function Lr(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=bn(e);if(n.length!==bn(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 bn(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function $r(){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 Bt(e){return"nodeType"in e}function q(e){var t,n;return e?Ae(e)?e:Bt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Ht(e){const{Document:t}=q(e);return e instanceof t}function Qe(e){return Ae(e)?!1:e instanceof q(e).HTMLElement}function zn(e){return e instanceof q(e).SVGElement}function Ne(e){return e?Ae(e)?e.document:Bt(e)?Ht(e)?e:Qe(e)||zn(e)?e.ownerDocument:document:document:document}const fe=mt?d.useLayoutEffect:d.useEffect;function Yt(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 Pr(){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 et(e,t){const n=d.useRef();return d.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function ht(e){const t=Yt(e),n=d.useRef(null),r=d.useCallback(o=>{o!==n.current&&t?.(o,n.current),n.current=o},[]);return[n,r]}function $t(e){const t=d.useRef();return d.useEffect(()=>{t.current=e},[e]),t.current}let Ot={};function tt(e,t){return d.useMemo(()=>{if(t)return t;const n=Ot[e]==null?0:Ot[e]+1;return Ot[e]=n,e+"-"+n},[e,t])}function Fn(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=Fn(1),gt=Fn(-1);function zr(e){return"clientX"in e&&"clientY"in e}function Wt(e){if(!e)return!1;const{KeyboardEvent:t}=q(e.target);return t&&e instanceof t}function Fr(e){if(!e)return!1;const{TouchEvent:t}=q(e.target);return t&&e instanceof t}function Pt(e){if(Fr(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 zr(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}}}),mn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Vr(e){return e.matches(mn)?e:e.querySelector(mn)}const Br={display:"none"};function Hr(e){let{id:t,value:n}=e;return d.createElement("div",{id:t,style:Br},n)}function Yr(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 Wr(){const[e,t]=d.useState("");return{announce:d.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Vn=d.createContext(null);function Ur(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 Gr(){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 Xr={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
|
-
`},Fr={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 Hr(e){let{announcements:t=Fr,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Br}=e;const{announce:s,announcement:i}=zr(),a=Ke("DndLiveRegion"),[l,u]=c.useState(!1);if(c.useEffect(()=>{u(!0)},[]),$r(c.useMemo(()=>({onDragStart(v){let{active:b}=v;s(t.onDragStart({active:b}))},onDragMove(v){let{active:b,over:f}=v;t.onDragMove&&s(t.onDragMove({active:b,over:f}))},onDragOver(v){let{active:b,over:f}=v;s(t.onDragOver({active:b,over:f}))},onDragEnd(v){let{active:b,over:f}=v;s(t.onDragEnd({active:b,over:f}))},onDragCancel(v){let{active:b,over:f}=v;s(t.onDragCancel({active:b,over:f}))}}),[s,t])),!l)return null;const h=c.createElement(c.Fragment,null,c.createElement(Lr,{id:r,value:o.draggable}),c.createElement(Pr,{id:a,announcement:i}));return n?Be.createPortal(h,n):h}var $;(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"})($||($={}));function dt(){}function Wr(e,t){return c.useMemo(()=>({sensor:e,options:{}}),[e,t])}function Ur(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const se=Object.freeze({x:0,y:0});function Yr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Gr(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function qr(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Xr(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function vn(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 An=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=vn(t,t.left,t.top),s=[];for(const i of r){const{id:a}=i,l=n.get(a);if(l){const u=Yr(vn(l),o);s.push({id:a,data:{droppableContainer:i,value:u}})}}return s.sort(Gr)};function Jr(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,a=s-n;if(r<o&&n<s){const l=t.width*t.height,u=e.width*e.height,h=i*a,v=h/(l+u-h);return Number(v.toFixed(4))}return 0}const Kr=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:i}=s,a=n.get(i);if(a){const l=Jr(a,t);l>0&&o.push({id:i,data:{droppableContainer:s,value:l}})}}return o.sort(qr)};function Zr(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Mn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:se}function Qr(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,a)=>({...i,top:i.top+e*a.y,bottom:i.bottom+e*a.y,left:i.left+e*a.x,right:i.right+e*a.x}),{...n})}}const eo=Qr(1);function to(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 no(e,t,n){const r=to(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:a}=r,l=e.left-i-(1-o)*parseFloat(n),u=e.top-a-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),h=o?e.width/o:e.width,v=s?e.height/s:e.height;return{width:h,height:v,top:u,right:l+h,bottom:u+v,left:l}}const ro={ignoreTransform:!1};function Ae(e,t){t===void 0&&(t=ro);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:h}=q(e).getComputedStyle(e);u&&(n=no(n,u,h))}const{top:r,left:o,width:s,height:i,bottom:a,right:l}=n;return{top:r,left:o,width:s,height:i,bottom:a,right:l}}function gn(e){return Ae(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 so(e,t){return t===void 0&&(t=q(e).getComputedStyle(e)),t.position==="fixed"}function io(e,t){t===void 0&&(t=q(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 Ft(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if($t(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Xe(o)||jn(o)||n.includes(o))return n;const s=q(e).getComputedStyle(o);return o!==e&&io(o,s)&&n.push(o),so(o,s)?n:r(o.parentNode)}return e?r(e):n}function Nn(e){const[t]=Ft(e,1);return t??null}function _t(e){return!ht||!e?null:ke(e)?e:zt(e)?$t(e)||e===Ie(e).scrollingElement?window:Xe(e)?e:null:null}function Ln(e){return ke(e)?e.scrollX:e.scrollLeft}function Pn(e){return ke(e)?e.scrollY:e.scrollTop}function Nt(e){return{x:Ln(e),y:Pn(e)}}var V;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(V||(V={}));function zn(e){return!ht||!e?!1:e===document.scrollingElement}function $n(e){const t={x:0,y:0},n=zn(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,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:a,maxScroll:r,minScroll:t}}const ao={x:.2,y:.2};function co(e,t,n,r,o){let{top:s,left:i,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=ao);const{isTop:u,isBottom:h,isLeft:v,isRight:b}=$n(e),f={x:0,y:0},y={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!u&&s<=t.top+m.height?(f.y=V.Backward,y.y=r*Math.abs((t.top+m.height-s)/m.height)):!h&&l>=t.bottom-m.height&&(f.y=V.Forward,y.y=r*Math.abs((t.bottom-m.height-l)/m.height)),!b&&a>=t.right-m.width?(f.x=V.Forward,y.x=r*Math.abs((t.right-m.width-a)/m.width)):!v&&i<=t.left+m.width&&(f.x=V.Backward,y.x=r*Math.abs((t.left+m.width-i)/m.width)),{direction:f,speed:y}}function lo(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 Vn(e){return e.reduce((t,n)=>Te(t,Nt(n)),se)}function uo(e){return e.reduce((t,n)=>t+Ln(n),0)}function fo(e){return e.reduce((t,n)=>t+Pn(n),0)}function ho(e,t){if(t===void 0&&(t=Ae),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Nn(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const vo=[["x",["left","right"],uo],["y",["top","bottom"],fo]];class Ht{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=Ft(n),o=Vn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,a]of vo)for(const l of i)Object.defineProperty(this,l,{get:()=>{const u=a(r),h=o[s]-u;return this.rect[l]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Fe{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function go(e){const{EventTarget:t}=q(e);return e instanceof t?e:Ie(e)}function Ot(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 oe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(oe||(oe={}));function pn(e){e.preventDefault()}function po(e){e.stopPropagation()}var I;(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"})(I||(I={}));const Bn={start:[I.Space,I.Enter],cancel:[I.Esc],end:[I.Space,I.Enter,I.Tab]},bo=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case I.Right:return{...n,x:n.x+25};case I.Left:return{...n,x:n.x-25};case I.Down:return{...n,y:n.y+25};case I.Up:return{...n,y:n.y-25}}};class Fn{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 Fe(Ie(n)),this.windowListeners=new Fe(q(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(oe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&ho(r),n(se)}handleKeyDown(t){if(Bt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=Bn,coordinateGetter:i=bo,scrollBehavior:a="smooth"}=o,{code:l}=t;if(s.end.includes(l)){this.handleEnd(t);return}if(s.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,h=u?{x:u.left,y:u.top}:se;this.referenceCoordinates||(this.referenceCoordinates=h);const v=i(t,{active:n,context:r.current,currentCoordinates:h});if(v){const b=ut(v,h),f={x:0,y:0},{scrollableAncestors:y}=r.current;for(const m of y){const x=t.code,{isTop:w,isRight:C,isLeft:E,isBottom:O,maxScroll:j,minScroll:R}=$n(m),D=lo(m),T={x:Math.min(x===I.Right?D.right-D.width/2:D.right,Math.max(x===I.Right?D.left:D.left+D.width/2,v.x)),y:Math.min(x===I.Down?D.bottom-D.height/2:D.bottom,Math.max(x===I.Down?D.top:D.top+D.height/2,v.y))},L=x===I.Right&&!C||x===I.Left&&!E,z=x===I.Down&&!O||x===I.Up&&!w;if(L&&T.x!==v.x){const N=m.scrollLeft+b.x,U=x===I.Right&&N<=j.x||x===I.Left&&N>=R.x;if(U&&!b.y){m.scrollTo({left:N,behavior:a});return}U?f.x=m.scrollLeft-N:f.x=x===I.Right?m.scrollLeft-j.x:m.scrollLeft-R.x,f.x&&m.scrollBy({left:-f.x,behavior:a});break}else if(z&&T.y!==v.y){const N=m.scrollTop+b.y,U=x===I.Down&&N<=j.y||x===I.Up&&N>=R.y;if(U&&!b.x){m.scrollTo({top:N,behavior:a});return}U?f.y=m.scrollTop-N:f.y=x===I.Down?m.scrollTop-j.y:m.scrollTop-R.y,f.y&&m.scrollBy({top:-f.y,behavior:a});break}}this.handleMove(t,Te(ut(v,this.referenceCoordinates),f))}}}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()}}Fn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Bn,onActivation:o}=t,{active:s}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const a=s.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o?.({event:e.nativeEvent}),!0)}return!1}}];function bn(e){return!!(e&&"distance"in e)}function mn(e){return!!(e&&"delay"in e)}class Wt{constructor(t,n,r){var o;r===void 0&&(r=go(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:i}=s;this.props=t,this.events=n,this.document=Ie(i),this.documentListeners=new Fe(this.document),this.listeners=new Fe(r),this.windowListeners=new Fe(q(i)),this.initialCoordinates=(o=Mt(s))!=null?o:se,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(oe.Resize,this.handleCancel),this.windowListeners.add(oe.DragStart,pn),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,pn),this.documentListeners.add(oe.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(mn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(bn(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(oe.Click,po,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:a}}=s;if(!o)return;const l=(n=Mt(t))!=null?n:se,u=ut(o,l);if(!r&&a){if(bn(a)){if(a.tolerance!=null&&Ot(u,a.tolerance))return this.handleCancel();if(Ot(u,a.distance))return this.handleStart()}if(mn(a)&&Ot(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),i(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===I.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 Ut extends Wt{constructor(t){const{event:n}=t,r=Ie(n.target);super(t,mo,r)}}Ut.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 xo={move:{name:"mousemove"},end:{name:"mouseup"}};var Lt;(function(e){e[e.RightClick=2]="RightClick"})(Lt||(Lt={}));class yo extends Wt{constructor(t){super(t,xo,Ie(t.event.target))}}yo.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Lt.RightClick?!1:(r?.({event:n}),!0)}}];const Tt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class wo extends Wt{constructor(t){super(t,Tt)}static setup(){return window.addEventListener(Tt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Tt.move.name,t)};function t(){}}}wo.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 He;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(He||(He={}));var ft;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ft||(ft={}));function So(e){let{acceleration:t,activator:n=He.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:a=ft.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:h,delta:v,threshold:b}=e;const f=Ro({delta:v,disabled:!s}),[y,m]=kr(),x=c.useRef({x:0,y:0}),w=c.useRef({x:0,y:0}),C=c.useMemo(()=>{switch(n){case He.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case He.DraggableRect:return o}},[n,o,l]),E=c.useRef(null),O=c.useCallback(()=>{const R=E.current;if(!R)return;const D=x.current.x*w.current.x,T=x.current.y*w.current.y;R.scrollBy(D,T)},[]),j=c.useMemo(()=>a===ft.TreeOrder?[...u].reverse():u,[a,u]);c.useEffect(()=>{if(!s||!u.length||!C){m();return}for(const R of j){if(r?.(R)===!1)continue;const D=u.indexOf(R),T=h[D];if(!T)continue;const{direction:L,speed:z}=co(R,T,C,t,b);for(const N of["x","y"])f[N][L[N]]||(z[N]=0,L[N]=0);if(z.x>0||z.y>0){m(),E.current=R,y(O,i),x.current=z,w.current=L;return}}x.current={x:0,y:0},w.current={x:0,y:0},m()},[t,O,r,m,s,i,JSON.stringify(C),JSON.stringify(f),y,u,j,h,JSON.stringify(b)])}const Co={x:{[V.Backward]:!1,[V.Forward]:!1},y:{[V.Backward]:!1,[V.Forward]:!1}};function Ro(e){let{delta:t,disabled:n}=e;const r=At(t);return Je(o=>{if(n||!r||!o)return Co;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[V.Backward]:o.x[V.Backward]||s.x===-1,[V.Forward]:o.x[V.Forward]||s.x===1},y:{[V.Backward]:o.y[V.Backward]||s.y===-1,[V.Forward]:o.y[V.Forward]||s.y===1}}},[n,t,r])}function Eo(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Je(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Do(e,t){return c.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 Ye;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ye||(Ye={}));var Pt;(function(e){e.Optimized="optimized"})(Pt||(Pt={}));const xn=new Map;function _o(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=c.useState(null),{frequency:a,measure:l,strategy:u}=o,h=c.useRef(e),v=x(),b=Ue(v),f=c.useCallback(function(w){w===void 0&&(w=[]),!b.current&&i(C=>C===null?w:C.concat(w.filter(E=>!C.includes(E))))},[b]),y=c.useRef(null),m=Je(w=>{if(v&&!n)return xn;if(!w||w===xn||h.current!==e||s!=null){const C=new Map;for(let E of e){if(!E)continue;if(s&&s.length>0&&!s.includes(E.id)&&E.rect.current){C.set(E.id,E.rect.current);continue}const O=E.node.current,j=O?new Ht(l(O),O):null;E.rect.current=j,j&&C.set(E.id,j)}return C}return w},[e,s,n,v,l]);return c.useEffect(()=>{h.current=e},[e]),c.useEffect(()=>{v||f()},[n,v]),c.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),c.useEffect(()=>{v||typeof a!="number"||y.current!==null||(y.current=setTimeout(()=>{f(),y.current=null},a))},[a,v,f,...r]),{droppableRects:m,measureDroppableContainers:f,measuringScheduled:s!=null};function x(){switch(u){case Ye.Always:return!1;case Ye.BeforeDragging:return n;default:return!n}}}function Hn(e,t){return Je(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function Oo(e,t){return Hn(e,t)}function To(e){let{callback:t,disabled:n}=e;const r=Vt(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function vt(e){let{callback:t,disabled:n}=e;const r=Vt(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return c.useEffect(()=>()=>o?.disconnect(),[o]),o}function jo(e){return new Ht(Ae(e),e)}function yn(e,t,n){t===void 0&&(t=jo);const[r,o]=c.useState(null);function s(){o(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const h=t(e);return JSON.stringify(l)===JSON.stringify(h)?l:h})}const i=To({callback(l){if(e)for(const u of l){const{type:h,target:v}=u;if(h==="childList"&&v instanceof HTMLElement&&v.contains(e)){s();break}}}}),a=vt({callback:s});return ue(()=>{s(),e?(a?.observe(e),i?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),i?.disconnect())},[e]),r}function ko(e){const t=Hn(e);return Mn(e,t)}const wn=[];function Io(e){const t=c.useRef(e),n=Je(r=>e?r&&r!==wn&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ft(e):wn,[e]);return c.useEffect(()=>{t.current=e},[e]),n}function Ao(e){const[t,n]=c.useState(null),r=c.useRef(e),o=c.useCallback(s=>{const i=_t(s.target);i&&n(a=>a?(a.set(i,Nt(i)),new Map(a)):null)},[]);return c.useEffect(()=>{const s=r.current;if(e!==s){i(s);const a=e.map(l=>{const u=_t(l);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,Nt(u)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(s)};function i(a){a.forEach(l=>{const u=_t(l);u?.removeEventListener("scroll",o)})}},[o,e]),c.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>Te(s,i),se):Vn(e):se,[e,t])}function Sn(e,t){t===void 0&&(t=[]);const n=c.useRef(null);return c.useEffect(()=>{n.current=null},t),c.useEffect(()=>{const r=e!==se;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?ut(e,n.current):se}function Mo(e){c.useEffect(()=>{if(!ht)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 No(e,t){return c.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function Wn(e){return c.useMemo(()=>e?oo(e):null,[e])}const Cn=[];function Lo(e,t){t===void 0&&(t=Ae);const[n]=e,r=Wn(n?q(n):null),[o,s]=c.useState(Cn);function i(){s(()=>e.length?e.map(l=>zn(l)?r:new Ht(t(l),l)):Cn)}const a=vt({callback:i});return ue(()=>{a?.disconnect(),i(),e.forEach(l=>a?.observe(l))},[e]),o}function Po(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Xe(t)?t:e}function zo(e){let{measure:t}=e;const[n,r]=c.useState(null),o=c.useCallback(u=>{for(const{target:h}of u)if(Xe(h)){r(v=>{const b=t(h);return v?{...v,width:b.width,height:b.height}:b});break}},[t]),s=vt({callback:o}),i=c.useCallback(u=>{const h=Po(u);s?.disconnect(),h&&s?.observe(h),r(h?t(h):null)},[t,s]),[a,l]=lt(i);return c.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const $o=[{sensor:Ut,options:{}},{sensor:Fn,options:{}}],Vo={current:{}},at={draggable:{measure:gn},droppable:{measure:gn,strategy:Ye.WhileDragging,frequency:Pt.Optimized},dragOverlay:{measure:Ae}};class We 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 Bo={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new We,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:dt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:at,measureDroppableContainers:dt,windowRect:null,measuringScheduled:!1},Fo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:dt,draggableNodes:new Map,over:null,measureDroppableContainers:dt},gt=c.createContext(Fo),Un=c.createContext(Bo);function Ho(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new We}}}function Wo(e,t){switch(t.type){case $.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case $.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 $.DragEnd:case $.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case $.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new We(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case $.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 We(e.droppable.containers);return i.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case $.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new We(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Uo(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=c.useContext(gt),s=At(r),i=At(n?.id);return c.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!Bt(s)||document.activeElement===s.target)return;const a=o.get(i);if(!a)return;const{activatorNode:l,node:u}=a;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const h of[l.current,u.current]){if(!h)continue;const v=Mr(h);if(v){v.focus();break}}})}},[r,t,o,i,s]),null}function Yo(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function Go(e){return c.useMemo(()=>({draggable:{...at.draggable,...e?.draggable},droppable:{...at.droppable,...e?.droppable},dragOverlay:{...at.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function qo(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=c.useRef(!1),{x:i,y:a}=typeof o=="boolean"?{x:o,y:o}:o;ue(()=>{if(!i&&!a||!t){s.current=!1;return}if(s.current||!r)return;const u=t?.node.current;if(!u||u.isConnected===!1)return;const h=n(u),v=Mn(h,r);if(i||(v.x=0),a||(v.y=0),s.current=!0,Math.abs(v.x)>0||Math.abs(v.y)>0){const b=Nn(u);b&&b.scrollBy({top:v.y,left:v.x})}},[t,i,a,r,n])}const Yn=c.createContext({...se,scaleX:1,scaleY:1});var ye;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ye||(ye={}));const Gn=c.memo(function(t){var n,r,o,s;let{id:i,accessibility:a,autoScroll:l=!0,children:u,sensors:h=$o,collisionDetection:v=Kr,measuring:b,modifiers:f,...y}=t;const m=c.useReducer(Wo,void 0,Ho),[x,w]=m,[C,E]=Vr(),[O,j]=c.useState(ye.Uninitialized),R=O===ye.Initialized,{draggable:{active:D,nodes:T,translate:L},droppable:{containers:z}}=x,N=D!=null?T.get(D):null,U=c.useRef({initial:null,translated:null}),G=c.useMemo(()=>{var W;return D!=null?{id:D,data:(W=N?.data)!=null?W:Vo,rect:U}:null},[D,N]),te=c.useRef(null),[de,we]=c.useState(null),[F,Se]=c.useState(null),ne=Ue(y,Object.values(y)),ve=Ke("DndDescribedBy",i),p=c.useMemo(()=>z.getEnabled(),[z]),S=Go(b),{droppableRects:k,measureDroppableContainers:M,measuringScheduled:ie}=_o(p,{dragging:R,dependencies:[L.x,L.y],config:S.droppable}),H=Eo(T,D),P=c.useMemo(()=>F?Mt(F):null,[F]),Y=vr(),X=Oo(H,S.draggable.measure);qo({activeNode:D!=null?T.get(D):null,config:Y.layoutShiftCompensation,initialRect:X,measure:S.draggable.measure});const A=yn(H,S.draggable.measure,X),Me=yn(H?H.parentElement:null),ae=c.useRef({activatorEvent:null,active:null,activeNode:H,collisionRect:null,collisions:null,droppableRects:k,draggableNodes:T,draggingNode:null,draggingNodeRect:null,droppableContainers:z,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ce=z.getNodeFor((n=ae.current.over)==null?void 0:n.id),fe=zo({measure:S.dragOverlay.measure}),Re=(r=fe.nodeRef.current)!=null?r:H,Ee=R?(o=fe.rect)!=null?o:A:null,Gt=!!(fe.nodeRef.current&&fe.rect),qt=ko(Gt?null:A),mt=Wn(Re?q(Re):null),ge=Io(R?Ce??H:null),Ze=Lo(ge),Qe=Yo(f,{transform:{x:L.x-qt.x,y:L.y-qt.y,scaleX:1,scaleY:1},activatorEvent:F,active:G,activeNodeRect:A,containerNodeRect:Me,draggingNodeRect:Ee,over:ae.current.over,overlayNodeRect:fe.rect,scrollableAncestors:ge,scrollableAncestorRects:Ze,windowRect:mt}),Xt=P?Te(P,L):null,Jt=Ao(ge),ar=Sn(Jt),cr=Sn(Jt,[A]),De=Te(Qe,ar),_e=Ee?eo(Ee,Qe):null,Ne=G&&_e?v({active:G,collisionRect:_e,droppableRects:k,droppableContainers:p,pointerCoordinates:Xt}):null,Kt=Xr(Ne,"id"),[pe,Zt]=c.useState(null),lr=Gt?Qe:Te(Qe,cr),ur=Zr(lr,(s=pe?.rect)!=null?s:null,A),xt=c.useRef(null),Qt=c.useCallback((W,J)=>{let{sensor:K,options:be}=J;if(te.current==null)return;const re=T.get(te.current);if(!re)return;const Z=W.nativeEvent,ce=new K({active:te.current,activeNode:re,event:Z,options:be,context:ae,onAbort(B){if(!T.get(B))return;const{onDragAbort:le}=ne.current,he={id:B};le?.(he),C({type:"onDragAbort",event:he})},onPending(B,me,le,he){if(!T.get(B))return;const{onDragPending:Pe}=ne.current,xe={id:B,constraint:me,initialCoordinates:le,offset:he};Pe?.(xe),C({type:"onDragPending",event:xe})},onStart(B){const me=te.current;if(me==null)return;const le=T.get(me);if(!le)return;const{onDragStart:he}=ne.current,Le={activatorEvent:Z,active:{id:me,data:le.data,rect:U}};Be.unstable_batchedUpdates(()=>{he?.(Le),j(ye.Initializing),w({type:$.DragStart,initialCoordinates:B,active:me}),C({type:"onDragStart",event:Le}),we(xt.current),Se(Z)})},onMove(B){w({type:$.DragMove,coordinates:B})},onEnd:Oe($.DragEnd),onCancel:Oe($.DragCancel)});xt.current=ce;function Oe(B){return async function(){const{active:le,collisions:he,over:Le,scrollAdjustedTranslate:Pe}=ae.current;let xe=null;if(le&&Pe){const{cancelDrop:ze}=ne.current;xe={activatorEvent:Z,active:le,collisions:he,delta:Pe,over:Le},B===$.DragEnd&&typeof ze=="function"&&await Promise.resolve(ze(xe))&&(B=$.DragCancel)}te.current=null,Be.unstable_batchedUpdates(()=>{w({type:B}),j(ye.Uninitialized),Zt(null),we(null),Se(null),xt.current=null;const ze=B===$.DragEnd?"onDragEnd":"onDragCancel";if(xe){const yt=ne.current[ze];yt?.(xe),C({type:ze,event:xe})}})}}},[T]),dr=c.useCallback((W,J)=>(K,be)=>{const re=K.nativeEvent,Z=T.get(be);if(te.current!==null||!Z||re.dndKit||re.defaultPrevented)return;const ce={active:Z};W(K,J.options,ce)===!0&&(re.dndKit={capturedBy:J.sensor},te.current=be,Qt(K,J))},[T,Qt]),en=Do(h,dr);Mo(h),ue(()=>{A&&O===ye.Initializing&&j(ye.Initialized)},[A,O]),c.useEffect(()=>{const{onDragMove:W}=ne.current,{active:J,activatorEvent:K,collisions:be,over:re}=ae.current;if(!J||!K)return;const Z={active:J,activatorEvent:K,collisions:be,delta:{x:De.x,y:De.y},over:re};Be.unstable_batchedUpdates(()=>{W?.(Z),C({type:"onDragMove",event:Z})})},[De.x,De.y]),c.useEffect(()=>{const{active:W,activatorEvent:J,collisions:K,droppableContainers:be,scrollAdjustedTranslate:re}=ae.current;if(!W||te.current==null||!J||!re)return;const{onDragOver:Z}=ne.current,ce=be.get(Kt),Oe=ce&&ce.rect.current?{id:ce.id,rect:ce.rect.current,data:ce.data,disabled:ce.disabled}:null,B={active:W,activatorEvent:J,collisions:K,delta:{x:re.x,y:re.y},over:Oe};Be.unstable_batchedUpdates(()=>{Zt(Oe),Z?.(B),C({type:"onDragOver",event:B})})},[Kt]),ue(()=>{ae.current={activatorEvent:F,active:G,activeNode:H,collisionRect:_e,collisions:Ne,droppableRects:k,draggableNodes:T,draggingNode:Re,draggingNodeRect:Ee,droppableContainers:z,over:pe,scrollableAncestors:ge,scrollAdjustedTranslate:De},U.current={initial:Ee,translated:_e}},[G,H,Ne,_e,T,Re,Ee,k,z,pe,ge,De]),So({...Y,delta:L,draggingRect:_e,pointerCoordinates:Xt,scrollableAncestors:ge,scrollableAncestorRects:Ze});const fr=c.useMemo(()=>({active:G,activeNode:H,activeNodeRect:A,activatorEvent:F,collisions:Ne,containerNodeRect:Me,dragOverlay:fe,draggableNodes:T,droppableContainers:z,droppableRects:k,over:pe,measureDroppableContainers:M,scrollableAncestors:ge,scrollableAncestorRects:Ze,measuringConfiguration:S,measuringScheduled:ie,windowRect:mt}),[G,H,A,F,Ne,Me,fe,T,z,k,pe,M,ge,Ze,S,ie,mt]),hr=c.useMemo(()=>({activatorEvent:F,activators:en,active:G,activeNodeRect:A,ariaDescribedById:{draggable:ve},dispatch:w,draggableNodes:T,over:pe,measureDroppableContainers:M}),[F,en,G,A,w,ve,T,pe,M]);return c.createElement(In.Provider,{value:E},c.createElement(gt.Provider,{value:hr},c.createElement(Un.Provider,{value:fr},c.createElement(Yn.Provider,{value:ur},u)),c.createElement(Uo,{disabled:a?.restoreFocus===!1})),c.createElement(Hr,{...a,hiddenTextDescribedById:ve}));function vr(){const W=de?.autoScrollEnabled===!1,J=typeof l=="object"?l.enabled===!1:l===!1,K=R&&!W&&!J;return typeof l=="object"?{...l,enabled:K}:{enabled:K}}}),Xo=c.createContext(null),Rn="button",Jo="Draggable";function Ko(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=Ke(Jo),{activators:i,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:h,draggableNodes:v,over:b}=c.useContext(gt),{role:f=Rn,roleDescription:y="draggable",tabIndex:m=0}=o??{},x=l?.id===t,w=c.useContext(x?Yn:Xo),[C,E]=lt(),[O,j]=lt(),R=No(i,t),D=Ue(n);ue(()=>(v.set(t,{id:t,key:s,node:C,activatorNode:O,data:D}),()=>{const L=v.get(t);L&&L.key===s&&v.delete(t)}),[v,t]);const T=c.useMemo(()=>({role:f,tabIndex:m,"aria-disabled":r,"aria-pressed":x&&f===Rn?!0:void 0,"aria-roledescription":y,"aria-describedby":h.draggable}),[r,f,m,x,y,h.draggable]);return{active:l,activatorEvent:a,activeNodeRect:u,attributes:T,isDragging:x,listeners:r?void 0:R,node:C,over:b,setNodeRef:E,setActivatorNodeRef:j,transform:w}}function Zo(){return c.useContext(Un)}const Qo="Droppable",es={timeout:25};function ts(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=Ke(Qo),{active:i,dispatch:a,over:l,measureDroppableContainers:u}=c.useContext(gt),h=c.useRef({disabled:n}),v=c.useRef(!1),b=c.useRef(null),f=c.useRef(null),{disabled:y,updateMeasurementsFor:m,timeout:x}={...es,...o},w=Ue(m??r),C=c.useCallback(()=>{if(!v.current){v.current=!0;return}f.current!=null&&clearTimeout(f.current),f.current=setTimeout(()=>{u(Array.isArray(w.current)?w.current:[w.current]),f.current=null},x)},[x]),E=vt({callback:C,disabled:y||!i}),O=c.useCallback((T,L)=>{E&&(L&&(E.unobserve(L),v.current=!1),T&&E.observe(T))},[E]),[j,R]=lt(O),D=Ue(t);return c.useEffect(()=>{!E||!j.current||(E.disconnect(),v.current=!1,E.observe(j.current))},[j,E]),c.useEffect(()=>(a({type:$.RegisterDroppable,element:{id:r,key:s,disabled:n,node:j,rect:b,data:D}}),()=>a({type:$.UnregisterDroppable,key:s,id:r})),[r]),c.useEffect(()=>{n!==h.current.disabled&&(a({type:$.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)},[r,s,n,a]),{active:i,rect:b,isOver:l?.id===r,node:j,over:l,setNodeRef:R}}function pt(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function ns(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function ot(e){return e!==null&&e>=0}function rs(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function os(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const st={scaleX:1,scaleY:1},ss=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:s,index:i}=e;const a=(t=n[o])!=null?t:r;if(!a)return null;const l=is(n,i,o);if(i===o){const u=n[s];return u?{x:o<s?u.left+u.width-(a.left+a.width):u.left-a.left,y:0,...st}:null}return i>o&&i<=s?{x:-a.width-l,y:0,...st}:i<o&&i>=s?{x:a.width+l,y:0,...st}:{x:0,y:0,...st}};function is(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 qn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=pt(t,r,n),i=t[o],a=s[o];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},it={scaleX:1,scaleY:1},as=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:i}=e;const a=(t=s[n])!=null?t:r;if(!a)return null;if(o===n){const u=s[i];return u?{x:0,y:n<i?u.top+u.height-(a.top+a.height):u.top-a.top,...it}:null}const l=cs(s,o,n);return o>n&&o<=i?{x:0,y:-a.height-l,...it}:o<n&&o>=i?{x:0,y:a.height+l,...it}:{x:0,y:0,...it}};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 Xn="Sortable",Jn=c.createContext({activeIndex:-1,containerId:Xn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:qn,disabled:{draggable:!1,droppable:!1}});function Kn(e){let{children:t,id:n,items:r,strategy:o=qn,disabled:s=!1}=e;const{active:i,dragOverlay:a,droppableRects:l,over:u,measureDroppableContainers:h}=Zo(),v=Ke(Xn,n),b=a.rect!==null,f=c.useMemo(()=>r.map(R=>typeof R=="object"&&"id"in R?R.id:R),[r]),y=i!=null,m=i?f.indexOf(i.id):-1,x=u?f.indexOf(u.id):-1,w=c.useRef(f),C=!rs(f,w.current),E=x!==-1&&m===-1||C,O=os(s);ue(()=>{C&&y&&h(f)},[C,f,y,h]),c.useEffect(()=>{w.current=f},[f]);const j=c.useMemo(()=>({activeIndex:m,containerId:v,disabled:O,disableTransforms:E,items:f,overIndex:x,useDragOverlay:b,sortedRects:ns(f,l),strategy:o}),[m,v,O.draggable,O.droppable,E,f,x,l,b,o]);return c.createElement(Jn.Provider,{value:j},t)}const ls=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return pt(n,r,o).indexOf(t)},us=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:i,previousItems:a,previousContainerId:l,transition:u}=e;return!u||!r||a!==s&&o===i?!1:n?!0:i!==o&&t===l},ds={duration:200,easing:"ease"},Zn="transform",fs=je.Transition.toString({property:Zn,duration:0,easing:"linear"}),hs={roleDescription:"sortable"};function vs(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,i]=c.useState(null),a=c.useRef(n);return ue(()=>{if(!t&&n!==a.current&&r.current){const l=o.current;if(l){const u=Ae(r.current,{ignoreTransform:!0}),h={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(h.x||h.y)&&i(h)}}n!==a.current&&(a.current=n)},[t,n,r,o]),c.useEffect(()=>{s&&i(null)},[s]),s}function Qn(e){let{animateLayoutChanges:t=us,attributes:n,disabled:r,data:o,getNewIndex:s=ls,id:i,strategy:a,resizeObserverConfig:l,transition:u=ds}=e;const{items:h,containerId:v,activeIndex:b,disabled:f,disableTransforms:y,sortedRects:m,overIndex:x,useDragOverlay:w,strategy:C}=c.useContext(Jn),E=gs(r,f),O=h.indexOf(i),j=c.useMemo(()=>({sortable:{containerId:v,index:O,items:h},...o}),[v,o,O,h]),R=c.useMemo(()=>h.slice(h.indexOf(i)),[h,i]),{rect:D,node:T,isOver:L,setNodeRef:z}=ts({id:i,data:j,disabled:E.droppable,resizeObserverConfig:{updateMeasurementsFor:R,...l}}),{active:N,activatorEvent:U,activeNodeRect:G,attributes:te,setNodeRef:de,listeners:we,isDragging:F,over:Se,setActivatorNodeRef:ne,transform:ve}=Ko({id:i,data:j,attributes:{...hs,...n},disabled:E.draggable}),p=jr(z,de),S=!!N,k=S&&!y&&ot(b)&&ot(x),M=!w&&F,ie=M&&k?ve:null,P=k?ie??(a??C)({rects:m,activeNodeRect:G,activeIndex:b,overIndex:x,index:O}):null,Y=ot(b)&&ot(x)?s({id:i,items:h,activeIndex:b,overIndex:x}):O,X=N?.id,A=c.useRef({activeId:X,items:h,newIndex:Y,containerId:v}),Me=h!==A.current.items,ae=t({active:N,containerId:v,isDragging:F,isSorting:S,id:i,index:O,items:h,newIndex:A.current.newIndex,previousItems:A.current.items,previousContainerId:A.current.containerId,transition:u,wasDragging:A.current.activeId!=null}),Ce=vs({disabled:!ae,index:O,node:T,rect:D});return c.useEffect(()=>{S&&A.current.newIndex!==Y&&(A.current.newIndex=Y),v!==A.current.containerId&&(A.current.containerId=v),h!==A.current.items&&(A.current.items=h)},[S,Y,v,h]),c.useEffect(()=>{if(X===A.current.activeId)return;if(X!=null&&A.current.activeId==null){A.current.activeId=X;return}const Re=setTimeout(()=>{A.current.activeId=X},50);return()=>clearTimeout(Re)},[X]),{active:N,activeIndex:b,attributes:te,data:j,rect:D,index:O,newIndex:Y,items:h,isOver:L,isSorting:S,isDragging:F,listeners:we,node:T,overIndex:x,over:Se,setNodeRef:p,setActivatorNodeRef:ne,setDroppableNodeRef:z,setDraggableNodeRef:de,transform:Ce??P,transition:fe()};function fe(){if(Ce||Me&&A.current.newIndex===O)return fs;if(!(M&&!Bt(U)||!u)&&(S||ae))return je.Transition.toString({...u,property:Zn})}}function gs(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(r=e?.droppable)!=null?r:t.droppable}}I.Down,I.Right,I.Up,I.Left;const ps=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),En=e=>{const t=bs(e);return t.charAt(0).toUpperCase()+t.slice(1)},er=(...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 xs={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 ys=c.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:i,...a},l)=>c.createElement("svg",{ref:l,...xs,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:er("lucide",o),...!s&&!ms(a)&&{"aria-hidden":"true"},...a},[...i.map(([u,h])=>c.createElement(u,h)),...Array.isArray(s)?s:[s]]));const ee=(e,t)=>{const n=c.forwardRef(({className:r,...o},s)=>c.createElement(ys,{ref:s,iconNode:t,className:er(`lucide-${ps(En(e))}`,`lucide-${e}`,r),...o}));return n.displayName=En(e),n};const ws=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Ss=ee("arrow-down",ws);const Cs=[["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"}]],Rs=ee("arrow-up-down",Cs);const Es=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Ds=ee("arrow-up",Es);const _s=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Os=ee("bookmark",_s);const Ts=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],js=ee("chevron-left",Ts);const ks=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Is=ee("chevron-right",ks);const As=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Ms=ee("columns-2",As);const Ns=[["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"}]],Ls=ee("delete",Ns);const Ps=[["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"}]],zs=ee("ellipsis",Ps);const $s=[["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"}]],Vs=ee("funnel",$s);const Bs=[["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"}]],Fs=ee("grip-vertical",Bs);const Hs=[["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"}]],Ws=ee("pen",Hs);const Us=[["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"}]],Ys=ee("settings",Us);function _(e){return c.forwardRef((t,n)=>{const{children:r,...o}=t;return d.jsx(e,{ref:n,...o,children:r})})}const tr=e=>`table_column_order_v1:${e}`,Gs=e=>{const{tableId:t}=Q.state;localStorage.setItem(tr(t),JSON.stringify(e.map(n=>n.id))),Q.setState(n=>({...n,columnOrder:e})),Q.setState(n=>({...n,columnOrder:e}))},qs=e=>{Q.setState(t=>({...t,visibility:{...t.visibility,[e]:!t.visibility[e]}}))};function Xs(e){Q.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const Q=new Tn({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],data:[],sortableColumns:[]});function nr(e,t){const n=e[0]??{},o=(t&&t.length?t:Object.keys(n).map(l=>({id:l,label:l}))).filter(l=>Object.prototype.hasOwnProperty.call(n,l.id)),{tableId:s}=Q.state,i=JSON.parse(localStorage.getItem(tr(s))||"[]"),a=[...i.map(l=>o.find(u=>u.id===l)).filter(Boolean),...o.filter(l=>!i.includes(l.id))];Q.setState(l=>({...l,data:e,columnOrder:a,visibility:a.reduce((u,h)=>(u[h.id]=!0,u),{}),sortableColumns:a.map(u=>({id:u.id,label:u.label,sortable:!0}))}))}function rr(e){Q.setState(t=>({...t,tableId:e}))}const Js=_(g.Menu.Trigger),Ks=_(g.Menu.Positioner),Zs=_(g.Menu.Content),Qs=_(g.Menu.Item),ei=_(g.Checkbox.Label),ti=_(g.Checkbox.HiddenInput),ni=_(g.Checkbox.Control);function ri({visibility:e,onToggle:t}){const{sortableColumns:n}=qe(Q);return d.jsxs(g.Menu.Root,{closeOnSelect:!1,children:[d.jsx(Js,{asChild:!0,children:d.jsx(g.IconButton,{"aria-label":"Toggle columns",variant:"outline",size:"sm",ml:"1",children:d.jsx(Ms,{size:18})})}),d.jsx(g.Portal,{children:d.jsx(Ks,{children:d.jsx(Zs,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return d.jsx(Qs,{value:r.id,closeOnSelect:!1,children:d.jsxs(g.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[d.jsx(ti,{}),d.jsx(ni,{}),d.jsx(ei,{children:r.label})]})},r.id)})})})})]})}function oi({id:e,children:t,onClick:n,cursor:r,borderRight:o,borderRightColor:s}){const{setNodeRef:i,attributes:a,listeners:l,transform:u,transition:h}=Qn({id:e});return d.jsx(g.Table.ColumnHeader,{ref:i,onClick:n,w:e==="id"?"80px":void 0,style:{transform:je.Transform.toString(u),transition:h,cursor:r,borderRight:o,borderRightColor:s},...a,children:d.jsxs(g.HStack,{justify:"space-between",children:[t,d.jsx("span",{...l,children:d.jsx(Fs,{size:12})})]})})}function si(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o}=qe(Q),s=e.map(a=>o.find(l=>l.id===a.id)).filter(a=>a!==void 0).filter(a=>t[a.id]),i=a=>{const{active:l,over:u}=a;if(!u||l.id===u.id)return;const h=e.findIndex(f=>f.id===l.id),v=e.findIndex(f=>f.id===u.id),b=pt(e,h,v);Gs(b)};return d.jsx(g.Table.Header,{background:"gray.100",position:"sticky",top:0,p:"0",children:d.jsx(Gn,{collisionDetection:An,onDragEnd:i,children:d.jsx(Kn,{items:e.map(a=>a.id),strategy:ss,children:d.jsxs(g.Table.Row,{height:"28px",children:[s.map((a,l)=>{const u=n===a?.id;return d.jsx(oi,{id:a?.id,onClick:()=>a?.sortable&&Xs(a?.id),cursor:a?.sortable?"pointer":"default",borderRight:"2px solid #dcdcdc",children:d.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,userSelect:"none"},children:[a?.label,a?.sortable&&(u?r==="asc"?d.jsx(Ds,{size:14}):d.jsx(Ss,{size:14}):d.jsx(Rs,{size:14,opacity:.4}))]})},a?.id)}),d.jsx(g.Table.ColumnHeader,{borderRight:"2px solid #dcdcdc",children:"Actions"}),d.jsx(g.Table.ColumnHeader,{boxSize:"0.5",children:d.jsx(ri,{visibility:t,onToggle:qs})})]})})})})}const Dn=g.createListCollection({items:[{label:"10",value:"10"},{label:"20",value:"20"},{label:"50",value:"50"},{label:"100",value:"100"}]}),ii=_(g.Select.Positioner),ai=_(g.Select.Content),ci=_(g.Select.Item),li=_(g.Pagination.PrevTrigger),ui=_(g.Pagination.NextTrigger),di=_(g.Select.HiddenSelect),fi=_(g.Select.Control),hi=_(g.Select.Trigger),vi=_(g.Select.ValueText),gi=_(g.Select.IndicatorGroup),pi=_(g.Select.Indicator);function bi({totalCount:e,pageSize:t,currentPage:n,onPageChange:r,onPageSizeChange:o,siblingCount:s=2}){return d.jsx(g.Box,{width:"100%",children:d.jsxs(g.HStack,{justify:"space-between",mx:"auto",flexWrap:"wrap",children:[d.jsxs(g.HStack,{children:[d.jsx(g.Text,{fontSize:"sm",color:"gray.600",_dark:{color:"gray.400"},children:"Rows per page:"}),d.jsxs(g.Select.Root,{collection:Dn,size:"sm",width:"60px",onValueChange:i=>o&&o(Number(i.items[0].value)),value:[String(t)],children:[d.jsx(di,{}),d.jsxs(fi,{children:[d.jsx(hi,{children:d.jsx(vi,{placeholder:""})}),d.jsx(gi,{children:d.jsx(pi,{})})]}),d.jsx(g.Portal,{children:d.jsx(ii,{children:d.jsx(ai,{children:Dn.items.map(i=>d.jsxs(ci,{item:i.value,children:[i.label,d.jsx(g.Select.ItemIndicator,{})]},i.value))})})})]})]}),d.jsx(g.Pagination.Root,{count:e,pageSize:t,page:n,siblingCount:s,onPageChange:i=>r&&r(i.page),children:d.jsxs(g.ButtonGroup,{size:"sm",variant:"ghost",children:[d.jsx(li,{asChild:!0,children:d.jsx(g.IconButton,{"aria-label":"Previous page",children:d.jsx(js,{size:18})})}),d.jsx(g.Pagination.Items,{render:i=>d.jsx(g.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)}),d.jsx(ui,{asChild:!0,children:d.jsx(g.IconButton,{"aria-label":"Next page",children:d.jsx(Is,{size:18})})})]})})]})})}const mi=_(g.Menu.Item),xi=_(g.Menu.Content),yi=_(g.Menu.Positioner),wi=_(g.Menu.Trigger);function Si({data:e=[],actions:t=[]}){const{columnOrder:n,visibility:r}=qe(Q);return d.jsx(g.Table.Body,{children:e.map(o=>d.jsxs(g.Table.Row,{children:[n.filter(s=>r[s.id]).map(s=>d.jsx(g.Table.Cell,{children:o[s.id]},s.id)),d.jsx(g.Table.Cell,{textAlign:"center",display:"flex",gap:2,children:d.jsxs(g.Menu.Root,{children:[d.jsx(wi,{asChild:!0,children:d.jsx(g.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:d.jsx(zs,{size:16})})}),d.jsx(g.Portal,{children:d.jsx(yi,{children:d.jsx(xi,{children:t.map(s=>d.jsxs(mi,{onClick:()=>s.onClick(o),colorScheme:s.colorScheme,value:s.label,children:[s.icon,s.label]},s.label))})})})]})})]},o.id))})}function Ci({tableId:e,data:t=[],headers:n=[],loading:r=!1,emptyMessage:o="No data",actions:s,page:i=1,pageSize:a=10,onPageChange:l,onPageSizeChange:u,density:h="sm",totalCount:v=0}){c.useEffect(()=>{rr(e)},[e]),c.useEffect(()=>{console.log("useEffect",i,a),nr(t,n)},[t,n,i,a]);const{sortColumn:b,sortDirection:f,data:y}=qe(Q),m=c.useMemo(()=>{const x=[...y];b&&x.sort((C,E)=>f==="asc"?String(C[b]).localeCompare(String(E[b])):String(E[b]).localeCompare(String(C[b])));const w=(i-1)*a;return x.slice(w,w+a)},[i,a,b,f,y]);return d.jsxs(g.Box,{h:"100%",display:"flex",flexDirection:"column",p:2,pt:2,minHeight:0,children:[d.jsx(g.Box,{flex:"1",minHeight:0,overflow:"auto",children:r?d.jsx(g.Box,{display:"flex",alignItems:"center",justifyContent:"center",h:"100%",color:"gray.500",children:"Loading..."}):m.length===0?d.jsx(g.Box,{display:"flex",alignItems:"center",justifyContent:"center",h:"100%",color:"gray.500",children:o}):d.jsxs(g.Table.Root,{variant:"outline",w:"100%",size:h,children:[d.jsx(si,{}),d.jsx(Si,{data:m,actions:s})]})}),d.jsx(g.Box,{mt:.5,children:d.jsx(bi,{totalCount:v,pageSize:a,currentPage:i,onPageChange:l,onPageSizeChange:x=>{u&&u(x),i>1&&l&&l(1)}})})]})}const or=e=>`FILTER_PRESETS_${e??"default"}`;function Ri(e){try{return JSON.parse(localStorage.getItem(or(e))||"[]")}catch{return[]}}const Ge=new Tn({}),bt=e=>{const t=Ge.state[e];if(t)return t;const n=Ri(e);return Ge.setState(r=>({...r,[e]:n})),n},Yt=(e,t)=>{Ge.setState(n=>({...n,[e]:t})),localStorage.setItem(or(e),JSON.stringify(t))},sr=(e,t)=>{const n=bt(e).filter(r=>r.id!==t);Yt(e,n)},ir=(e,t)=>{const n=[t,...bt(e)];Yt(e,n)},Ei=_(g.Checkbox.Root),Di=_(g.Checkbox.HiddenInput),_i=_(g.Checkbox.Control),Oi=_(g.Slider.Root),Ti=_(g.Slider.Track),ji=_(g.Slider.Range),ki=_(g.Slider.Thumbs),Ii=_(g.Slider.Control),Ai=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:i,transition:a}=Qn({id:e.id}),l={transform:je.Transform.toString(i),transition:a,cursor:"grab"};return d.jsxs(g.VStack,{ref:s,style:l,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,...r,...o,children:[d.jsx(g.Text,{fontWeight:"bold",children:e.label}),d.jsxs(g.HStack,{justify:"space-between",children:[d.jsx(g.Text,{fontSize:"sm",children:"Visible"}),d.jsxs(Ei,{checked:e.visible,onCheckedChange:u=>t&&t(e.id,!!u),size:"sm",children:[d.jsx(Di,{}),d.jsx(_i,{})]})]}),d.jsxs(g.VStack,{align:"stretch",gap:1,children:[d.jsx(g.Text,{fontSize:"sm",children:"Size"}),d.jsx(Oi,{width:"200px",min:1,max:5,step:.5,value:[e.size??1],onChange:u=>n&&n(e.id,u[0]),children:d.jsxs(Ii,{children:[d.jsx(Ti,{children:d.jsx(ji,{})}),d.jsx(ki,{})]})})]})]})},Mi=_(g.Drawer.Root),Ni=_(g.Drawer.Trigger),Li=_(g.Drawer.Backdrop),Pi=_(g.Drawer.Positioner),zi=_(g.Drawer.Content),$i=_(g.Drawer.Header),Vi=_(g.Drawer.Title),Bi=_(g.Drawer.Body),Fi=_(g.Drawer.Footer),Hi=_(g.Drawer.CloseTrigger),Wi=_(g.Tabs.Root),Ui=_(g.Tabs.List),jt=_(g.Tabs.Trigger),kt=_(g.Tabs.Content),Yi=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:s="default",currentFilters:i={},onLoadPreset:a,activePresetName:l,onReorder:u})=>{const v=qe(Ge)[s]??bt(s),b=()=>{const f=prompt("Preset name?");f&&ir(s,{id:crypto.randomUUID(),name:f,date:new Date().toISOString(),filters:i})};return d.jsx(g.HStack,{wrap:"wrap",children:d.jsxs(Mi,{size:e,children:[d.jsx(Ni,{asChild:!0,children:d.jsxs(g.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[d.jsx(Vs,{size:16}),"Filters"]})}),d.jsxs(g.Portal,{children:[d.jsx(Li,{}),d.jsx(Pi,{children:d.jsxs(zi,{children:[d.jsx($i,{children:d.jsx(Vi,{children:"Filters"})}),d.jsx(Bi,{overflowY:"auto",pt:1,children:d.jsxs(Wi,{defaultValue:"view",children:[d.jsxs(Ui,{mb:4,children:[d.jsxs(jt,{value:"view",children:[d.jsx(Ws,{size:16}),"Edit"]}),d.jsxs(jt,{value:"settings",children:[d.jsx(Ys,{size:16}),"Settings"]}),d.jsxs(jt,{value:"presets",children:[d.jsx(Os,{size:16}),"Presets"]})]}),d.jsx(kt,{value:"view",children:o.filter(f=>f.visible).map(f=>d.jsxs(g.VStack,{align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,children:[d.jsx(g.Text,{fontWeight:"bold",children:f.label}),f.customComponent]},f.id))}),d.jsx(kt,{value:"settings",children:d.jsx(Gn,{sensors:Ur(Wr(Ut)),collisionDetection:An,onDragEnd:({active:f,over:y})=>{if(!y||f.id===y.id)return;const m=o.findIndex(C=>C.id===f.id),x=o.findIndex(C=>C.id===y.id),w=pt(o,m,x);console.log(w),u?.(w)},children:d.jsx(Kn,{items:o.map(f=>f.id),strategy:as,children:o.map(f=>d.jsx(Ai,{filter:f,onVisibilityChange:t,onSizeChange:n},f.id))})})}),d.jsx(kt,{value:"presets",children:d.jsxs(g.VStack,{align:"stretch",mb:3,children:[d.jsx(g.Button,{size:"sm",colorScheme:"blue",onClick:b,children:"Save Current Filters"}),v.length===0&&d.jsx(g.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),v.map(f=>d.jsxs(g.HStack,{justify:"space-between",border:"1px solid",borderColor:l===f.name?"blue.300":"gray.200",rounded:"md",p:2,children:[d.jsxs(g.VStack,{align:"start",gap:0,children:[d.jsx(g.Text,{fontWeight:"bold",fontSize:"sm",children:f.name}),d.jsx(g.Text,{fontSize:"xs",color:"gray.500",children:new Date(f.date).toLocaleDateString()})]}),d.jsxs(g.HStack,{children:[d.jsx(g.Button,{size:"xs",variant:"ghost",onClick:()=>a?.(f.filters,f.name),children:"Load"}),d.jsx(g.IconButton,{size:"xs","aria-label":"Delete preset",variant:"ghost",onClick:()=>sr(s,f.id),children:d.jsx(Ls,{size:14})})]})]},f.id))]})})]})}),d.jsxs(Fi,{justify:"space-between",children:[d.jsx(g.Button,{size:"sm",variant:"ghost",colorScheme:"red",onClick:()=>r&&r(),children:"Clear All"}),d.jsx(Hi,{asChild:!0,children:d.jsx(g.CloseButton,{})})]})]})})]})]})})},Gi=({title:e,filters:t,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:i,pageKey:a,currentFilters:l,onLoadPreset:u,activePresetName:h,filterDrawerSize:v="sm"})=>d.jsxs(g.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,d.jsxs(g.HStack,{children:[t.length>0&&t.filter(b=>b.visible).map(b=>d.jsx(g.HStack,{children:b.customComponent},b.id)),d.jsx(Yi,{filterDrawerSize:v,onVisibilityChange:n?(b,f)=>n(b,f):void 0,onReorder:r,onSizeChange:o?(b,f)=>o(b,f):void 0,onClear:s,maxToolbarUnits:i,pageKey:a,filters:t,currentFilters:l,onLoadPreset:u,activePresetName:h})]})]}),qi=(e,t)=>{localStorage.setItem(`FILTER_ORDER_${e}`,JSON.stringify(t))},Xi=e=>{try{return JSON.parse(localStorage.getItem(`FILTER_ORDER_${e}`)||"[]")}catch{return[]}};exports.DataTable=Ci;exports.Filters=Gi;exports.addPreset=ir;exports.deletePreset=sr;exports.getPresets=bt;exports.loadOrder=Xi;exports.presetStore=Ge;exports.saveOrder=qi;exports.savePresets=Yt;exports.setData=nr;exports.setTableId=rr;exports.tableStore=Q;exports.withChildren=_;
|
|
10
|
+
`},qr={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 Kr(e){let{announcements:t=qr,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Xr}=e;const{announce:s,announcement:i}=Wr(),l=tt("DndLiveRegion"),[u,f]=d.useState(!1);if(d.useEffect(()=>{f(!0)},[]),Ur(d.useMemo(()=>({onDragStart(g){let{active:m}=g;s(t.onDragStart({active:m}))},onDragMove(g){let{active:m,over:h}=g;t.onDragMove&&s(t.onDragMove({active:m,over:h}))},onDragOver(g){let{active:m,over:h}=g;s(t.onDragOver({active:m,over:h}))},onDragEnd(g){let{active:m,over:h}=g;s(t.onDragEnd({active:m,over:h}))},onDragCancel(g){let{active:m,over:h}=g;s(t.onDragCancel({active:m,over:h}))}}),[s,t])),!u)return null;const p=d.createElement(d.Fragment,null,d.createElement(Hr,{id:r,value:o.draggable}),d.createElement(Yr,{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 pt(){}function Jr(e,t){return d.useMemo(()=>({sensor:e,options:{}}),[e,t])}function Zr(){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 Qr(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function eo(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function to(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function no(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function xn(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 Bn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=xn(t,t.left,t.top),s=[];for(const i of r){const{id:l}=i,u=n.get(l);if(u){const f=Qr(xn(u),o);s.push({id:l,data:{droppableContainer:i,value:f}})}}return s.sort(eo)};function ro(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 oo=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=ro(l,t);u>0&&o.push({id:i,data:{droppableContainer:s,value:u}})}}return o.sort(to)};function so(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Hn(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ae}function io(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 ao=io(1);function lo(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 co(e,t,n){const r=lo(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 uo={ignoreTransform:!1};function Le(e,t){t===void 0&&(t=uo);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:f,transformOrigin:p}=q(e).getComputedStyle(e);f&&(n=co(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 yn(e){return Le(e,{ignoreTransform:!0})}function fo(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function ho(e,t){return t===void 0&&(t=q(e).getComputedStyle(e)),t.position==="fixed"}function go(e,t){t===void 0&&(t=q(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 Ut(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Ht(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Qe(o)||zn(o)||n.includes(o))return n;const s=q(e).getComputedStyle(o);return o!==e&&go(o,s)&&n.push(o),ho(o,s)?n:r(o.parentNode)}return e?r(e):n}function Yn(e){const[t]=Ut(e,1);return t??null}function It(e){return!mt||!e?null:Ae(e)?e:Bt(e)?Ht(e)||e===Ne(e).scrollingElement?window:Qe(e)?e:null:null}function Wn(e){return Ae(e)?e.scrollX:e.scrollLeft}function Un(e){return Ae(e)?e.scrollY:e.scrollTop}function zt(e){return{x:Wn(e),y:Un(e)}}var V;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(V||(V={}));function Gn(e){return!mt||!e?!1:e===document.scrollingElement}function Xn(e){const t={x:0,y:0},n=Gn(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 po={x:.2,y:.2};function vo(e,t,n,r,o){let{top:s,left:i,right:l,bottom:u}=n;r===void 0&&(r=10),o===void 0&&(o=po);const{isTop:f,isBottom:p,isLeft:g,isRight:m}=Xn(e),h={x:0,y:0},x={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!f&&s<=t.top+v.height?(h.y=V.Backward,x.y=r*Math.abs((t.top+v.height-s)/v.height)):!p&&u>=t.bottom-v.height&&(h.y=V.Forward,x.y=r*Math.abs((t.bottom-v.height-u)/v.height)),!m&&l>=t.right-v.width?(h.x=V.Forward,x.x=r*Math.abs((t.right-v.width-l)/v.width)):!g&&i<=t.left+v.width&&(h.x=V.Backward,x.x=r*Math.abs((t.left+v.width-i)/v.width)),{direction:h,speed:x}}function bo(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 qn(e){return e.reduce((t,n)=>ke(t,zt(n)),ae)}function mo(e){return e.reduce((t,n)=>t+Wn(n),0)}function xo(e){return e.reduce((t,n)=>t+Un(n),0)}function yo(e,t){if(t===void 0&&(t=Le),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);Yn(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const So=[["x",["left","right"],mo],["y",["top","bottom"],xo]];class Gt{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=Ut(n),o=qn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,l]of So)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 wo(e){const{EventTarget:t}=q(e);return e instanceof t?e:Ne(e)}function kt(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 oe;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(oe||(oe={}));function Sn(e){e.preventDefault()}function Co(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 Kn={start:[k.Space,k.Enter],cancel:[k.Esc],end:[k.Space,k.Enter,k.Tab]},Ro=(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 Jn{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(q(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(oe.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&yo(r),n(ae)}handleKeyDown(t){if(Wt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=Kn,coordinateGetter:i=Ro,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 m=gt(g,p),h={x:0,y:0},{scrollableAncestors:x}=r.current;for(const v of x){const y=t.code,{isTop:S,isRight:C,isLeft:R,isBottom:T,maxScroll:_,minScroll:D}=Xn(v),j=bo(v),O={x:Math.min(y===k.Right?j.right-j.width/2:j.right,Math.max(y===k.Right?j.left:j.left+j.width/2,g.x)),y:Math.min(y===k.Down?j.bottom-j.height/2:j.bottom,Math.max(y===k.Down?j.top:j.top+j.height/2,g.y))},L=y===k.Right&&!C||y===k.Left&&!R,P=y===k.Down&&!T||y===k.Up&&!S;if(L&&O.x!==g.x){const N=v.scrollLeft+m.x,U=y===k.Right&&N<=_.x||y===k.Left&&N>=D.x;if(U&&!m.y){v.scrollTo({left:N,behavior:l});return}U?h.x=v.scrollLeft-N:h.x=y===k.Right?v.scrollLeft-_.x:v.scrollLeft-D.x,h.x&&v.scrollBy({left:-h.x,behavior:l});break}else if(P&&O.y!==g.y){const N=v.scrollTop+m.y,U=y===k.Down&&N<=_.y||y===k.Up&&N>=D.y;if(U&&!m.x){v.scrollTo({top:N,behavior:l});return}U?h.y=v.scrollTop-N:h.y=y===k.Down?v.scrollTop-_.y:v.scrollTop-D.y,h.y&&v.scrollBy({top:-h.y,behavior:l});break}}this.handleMove(t,ke(gt(g,this.referenceCoordinates),h))}}}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()}}Jn.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Kn,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 wn(e){return!!(e&&"distance"in e)}function Cn(e){return!!(e&&"delay"in e)}class Xt{constructor(t,n,r){var o;r===void 0&&(r=wo(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(q(i)),this.initialCoordinates=(o=Pt(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(oe.Resize,this.handleCancel),this.windowListeners.add(oe.DragStart,Sn),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,Sn),this.documentListeners.add(oe.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Cn(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(wn(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(oe.Click,Co,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.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=Pt(t))!=null?n:ae,f=gt(o,u);if(!r&&l){if(wn(l)){if(l.tolerance!=null&&kt(f,l.tolerance))return this.handleCancel();if(kt(f,l.distance))return this.handleStart()}if(Cn(l)&&kt(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 Eo={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class qt extends Xt{constructor(t){const{event:n}=t,r=Ne(n.target);super(t,Eo,r)}}qt.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 Do={move:{name:"mousemove"},end:{name:"mouseup"}};var Ft;(function(e){e[e.RightClick=2]="RightClick"})(Ft||(Ft={}));class To extends Xt{constructor(t){super(t,Do,Ne(t.event.target))}}To.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Ft.RightClick?!1:(r?.({event:n}),!0)}}];const Mt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class jo extends Xt{constructor(t){super(t,Mt)}static setup(){return window.addEventListener(Mt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Mt.move.name,t)};function t(){}}}jo.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 vt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(vt||(vt={}));function _o(e){let{acceleration:t,activator:n=Xe.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:l=vt.TreeOrder,pointerCoordinates:u,scrollableAncestors:f,scrollableAncestorRects:p,delta:g,threshold:m}=e;const h=Io({delta:g,disabled:!s}),[x,v]=Pr(),y=d.useRef({x:0,y:0}),S=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),T=d.useCallback(()=>{const D=R.current;if(!D)return;const j=y.current.x*S.current.x,O=y.current.y*S.current.y;D.scrollBy(j,O)},[]),_=d.useMemo(()=>l===vt.TreeOrder?[...f].reverse():f,[l,f]);d.useEffect(()=>{if(!s||!f.length||!C){v();return}for(const D of _){if(r?.(D)===!1)continue;const j=f.indexOf(D),O=p[j];if(!O)continue;const{direction:L,speed:P}=vo(D,O,C,t,m);for(const N of["x","y"])h[N][L[N]]||(P[N]=0,L[N]=0);if(P.x>0||P.y>0){v(),R.current=D,x(T,i),y.current=P,S.current=L;return}}y.current={x:0,y:0},S.current={x:0,y:0},v()},[t,T,r,v,s,i,JSON.stringify(C),JSON.stringify(h),x,f,_,p,JSON.stringify(m)])}const Oo={x:{[V.Backward]:!1,[V.Forward]:!1},y:{[V.Backward]:!1,[V.Forward]:!1}};function Io(e){let{delta:t,disabled:n}=e;const r=$t(t);return et(o=>{if(n||!r||!o)return Oo;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[V.Backward]:o.x[V.Backward]||s.x===-1,[V.Forward]:o.x[V.Forward]||s.x===1},y:{[V.Backward]:o.y[V.Backward]||s.y===-1,[V.Forward]:o.y[V.Forward]||s.y===1}}},[n,t,r])}function ko(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return et(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Mo(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 Rn=new Map;function Ao(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=y(),m=Ke(g),h=d.useCallback(function(S){S===void 0&&(S=[]),!m.current&&i(C=>C===null?S:C.concat(S.filter(R=>!C.includes(R))))},[m]),x=d.useRef(null),v=et(S=>{if(g&&!n)return Rn;if(!S||S===Rn||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 T=R.node.current,_=T?new Gt(u(T),T):null;R.rect.current=_,_&&C.set(R.id,_)}return C}return S},[e,s,n,g,u]);return d.useEffect(()=>{p.current=e},[e]),d.useEffect(()=>{g||h()},[n,g]),d.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),d.useEffect(()=>{g||typeof l!="number"||x.current!==null||(x.current=setTimeout(()=>{h(),x.current=null},l))},[l,g,h,...r]),{droppableRects:v,measureDroppableContainers:h,measuringScheduled:s!=null};function y(){switch(f){case Je.Always:return!1;case Je.BeforeDragging:return n;default:return!n}}}function Zn(e,t){return et(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function No(e,t){return Zn(e,t)}function Lo(e){let{callback:t,disabled:n}=e;const r=Yt(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=Yt(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 $o(e){return new Gt(Le(e),e)}function En(e,t,n){t===void 0&&(t=$o);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=Lo({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 Po(e){const t=Zn(e);return Hn(e,t)}const Dn=[];function zo(e){const t=d.useRef(e),n=et(r=>e?r&&r!==Dn&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ut(e):Dn,[e]);return d.useEffect(()=>{t.current=e},[e]),n}function Fo(e){const[t,n]=d.useState(null),r=d.useRef(e),o=d.useCallback(s=>{const i=It(s.target);i&&n(l=>l?(l.set(i,zt(i)),new Map(l)):null)},[]);return d.useEffect(()=>{const s=r.current;if(e!==s){i(s);const l=e.map(u=>{const f=It(u);return f?(f.addEventListener("scroll",o,{passive:!0}),[f,zt(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=It(u);f?.removeEventListener("scroll",o)})}},[o,e]),d.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>ke(s,i),ae):qn(e):ae,[e,t])}function Tn(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?gt(e,n.current):ae}function Vo(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 Bo(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 Qn(e){return d.useMemo(()=>e?fo(e):null,[e])}const jn=[];function Ho(e,t){t===void 0&&(t=Le);const[n]=e,r=Qn(n?q(n):null),[o,s]=d.useState(jn);function i(){s(()=>e.length?e.map(u=>Gn(u)?r:new Gt(t(u),u)):jn)}const l=xt({callback:i});return fe(()=>{l?.disconnect(),i(),e.forEach(u=>l?.observe(u))},[e]),o}function Yo(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Qe(t)?t:e}function Wo(e){let{measure:t}=e;const[n,r]=d.useState(null),o=d.useCallback(f=>{for(const{target:p}of f)if(Qe(p)){r(g=>{const m=t(p);return g?{...g,width:m.width,height:m.height}:m});break}},[t]),s=xt({callback:o}),i=d.useCallback(f=>{const p=Yo(f);s?.disconnect(),p&&s?.observe(p),r(p?t(p):null)},[t,s]),[l,u]=ht(i);return d.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const Uo=[{sensor:qt,options:{}},{sensor:Jn,options:{}}],Go={current:{}},dt={draggable:{measure:yn},droppable:{measure:yn,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 Xo={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:pt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:dt,measureDroppableContainers:pt,windowRect:null,measuringScheduled:!1},qo={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:pt,draggableNodes:new Map,over:null,measureDroppableContainers:pt},yt=d.createContext(qo),er=d.createContext(Xo);function Ko(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new qe}}}function Jo(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 Zo(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=d.useContext(yt),s=$t(r),i=$t(n?.id);return d.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!Wt(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=Vr(p);if(g){g.focus();break}}})}},[r,t,o,i,s]),null}function Qo(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function es(e){return d.useMemo(()=>({draggable:{...dt.draggable,...e?.draggable},droppable:{...dt.droppable,...e?.droppable},dragOverlay:{...dt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function ts(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=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=Hn(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 m=Yn(f);m&&m.scrollBy({top:g.y,left:g.x})}},[t,i,l,r,n])}const tr=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 nr=d.memo(function(t){var n,r,o,s;let{id:i,accessibility:l,autoScroll:u=!0,children:f,sensors:p=Uo,collisionDetection:g=oo,measuring:m,modifiers:h,...x}=t;const v=d.useReducer(Jo,void 0,Ko),[y,S]=v,[C,R]=Gr(),[T,_]=d.useState(we.Uninitialized),D=T===we.Initialized,{draggable:{active:j,nodes:O,translate:L},droppable:{containers:P}}=y,N=j!=null?O.get(j):null,U=d.useRef({initial:null,translated:null}),X=d.useMemo(()=>{var W;return j!=null?{id:j,data:(W=N?.data)!=null?W:Go,rect:U}:null},[j,N]),te=d.useRef(null),[he,Re]=d.useState(null),[H,Ee]=d.useState(null),ne=Ke(x,Object.values(x)),ve=tt("DndDescribedBy",i),b=d.useMemo(()=>P.getEnabled(),[P]),E=es(m),{droppableRects:I,measureDroppableContainers:A,measuringScheduled:le}=Ao(b,{dragging:D,dependencies:[L.x,L.y],config:E.droppable}),Y=ko(O,j),$=d.useMemo(()=>H?Pt(H):null,[H]),G=Sr(),J=No(Y,E.draggable.measure);ts({activeNode:j!=null?O.get(j):null,config:G.layoutShiftCompensation,initialRect:J,measure:E.draggable.measure});const M=En(Y,E.draggable.measure,J),$e=En(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=Wo({measure:E.dragOverlay.measure}),Te=(r=ge.nodeRef.current)!=null?r:Y,je=D?(o=ge.rect)!=null?o:M:null,Zt=!!(ge.nodeRef.current&&ge.rect),Qt=Po(Zt?null:M),wt=Qn(Te?q(Te):null),be=zo(D?De??Y:null),nt=Ho(be),rt=Qo(h,{transform:{x:L.x-Qt.x,y:L.y-Qt.y,scaleX:1,scaleY:1},activatorEvent:H,active:X,activeNodeRect:M,containerNodeRect:$e,draggingNodeRect:je,over:ce.current.over,overlayNodeRect:ge.rect,scrollableAncestors:be,scrollableAncestorRects:nt,windowRect:wt}),en=$?ke($,L):null,tn=Fo(be),gr=Tn(tn),pr=Tn(tn,[M]),_e=ke(rt,gr),Oe=je?ao(je,rt):null,Pe=X&&Oe?g({active:X,collisionRect:Oe,droppableRects:I,droppableContainers:b,pointerCoordinates:en}):null,nn=no(Pe,"id"),[me,rn]=d.useState(null),vr=Zt?rt:ke(rt,pr),br=so(vr,(s=me?.rect)!=null?s:null,M),Ct=d.useRef(null),on=d.useCallback((W,Z)=>{let{sensor:Q,options:xe}=Z;if(te.current==null)return;const re=O.get(te.current);if(!re)return;const ee=W.nativeEvent,ue=new Q({active:te.current,activeNode:re,event:ee,options:xe,context:ce,onAbort(B){if(!O.get(B))return;const{onDragAbort:de}=ne.current,pe={id:B};de?.(pe),C({type:"onDragAbort",event:pe})},onPending(B,ye,de,pe){if(!O.get(B))return;const{onDragPending:Fe}=ne.current,Se={id:B,constraint:ye,initialCoordinates:de,offset:pe};Fe?.(Se),C({type:"onDragPending",event:Se})},onStart(B){const ye=te.current;if(ye==null)return;const de=O.get(ye);if(!de)return;const{onDragStart:pe}=ne.current,ze={activatorEvent:ee,active:{id:ye,data:de.data,rect:U}};Ue.unstable_batchedUpdates(()=>{pe?.(ze),_(we.Initializing),S({type:F.DragStart,initialCoordinates:B,active:ye}),C({type:"onDragStart",event:ze}),Re(Ct.current),Ee(ee)})},onMove(B){S({type:F.DragMove,coordinates:B})},onEnd:Ie(F.DragEnd),onCancel:Ie(F.DragCancel)});Ct.current=ue;function Ie(B){return async function(){const{active:de,collisions:pe,over:ze,scrollAdjustedTranslate:Fe}=ce.current;let Se=null;if(de&&Fe){const{cancelDrop:Ve}=ne.current;Se={activatorEvent:ee,active:de,collisions:pe,delta:Fe,over:ze},B===F.DragEnd&&typeof Ve=="function"&&await Promise.resolve(Ve(Se))&&(B=F.DragCancel)}te.current=null,Ue.unstable_batchedUpdates(()=>{S({type:B}),_(we.Uninitialized),rn(null),Re(null),Ee(null),Ct.current=null;const Ve=B===F.DragEnd?"onDragEnd":"onDragCancel";if(Se){const Rt=ne.current[Ve];Rt?.(Se),C({type:Ve,event:Se})}})}}},[O]),mr=d.useCallback((W,Z)=>(Q,xe)=>{const re=Q.nativeEvent,ee=O.get(xe);if(te.current!==null||!ee||re.dndKit||re.defaultPrevented)return;const ue={active:ee};W(Q,Z.options,ue)===!0&&(re.dndKit={capturedBy:Z.sensor},te.current=xe,on(Q,Z))},[O,on]),sn=Mo(p,mr);Vo(p),fe(()=>{M&&T===we.Initializing&&_(we.Initialized)},[M,T]),d.useEffect(()=>{const{onDragMove:W}=ne.current,{active:Z,activatorEvent:Q,collisions:xe,over:re}=ce.current;if(!Z||!Q)return;const ee={active:Z,activatorEvent:Q,collisions:xe,delta:{x:_e.x,y:_e.y},over:re};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:re}=ce.current;if(!W||te.current==null||!Z||!re)return;const{onDragOver:ee}=ne.current,ue=xe.get(nn),Ie=ue&&ue.rect.current?{id:ue.id,rect:ue.rect.current,data:ue.data,disabled:ue.disabled}:null,B={active:W,activatorEvent:Z,collisions:Q,delta:{x:re.x,y:re.y},over:Ie};Ue.unstable_batchedUpdates(()=>{rn(Ie),ee?.(B),C({type:"onDragOver",event:B})})},[nn]),fe(()=>{ce.current={activatorEvent:H,active:X,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}},[X,Y,Pe,Oe,O,Te,je,I,P,me,be,_e]),_o({...G,delta:L,draggingRect:Oe,pointerCoordinates:en,scrollableAncestors:be,scrollableAncestorRects:nt});const xr=d.useMemo(()=>({active:X,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:nt,measuringConfiguration:E,measuringScheduled:le,windowRect:wt}),[X,Y,M,H,Pe,$e,ge,O,P,I,me,A,be,nt,E,le,wt]),yr=d.useMemo(()=>({activatorEvent:H,activators:sn,active:X,activeNodeRect:M,ariaDescribedById:{draggable:ve},dispatch:S,draggableNodes:O,over:me,measureDroppableContainers:A}),[H,sn,X,M,S,ve,O,me,A]);return d.createElement(Vn.Provider,{value:R},d.createElement(yt.Provider,{value:yr},d.createElement(er.Provider,{value:xr},d.createElement(tr.Provider,{value:br},f)),d.createElement(Zo,{disabled:l?.restoreFocus===!1})),d.createElement(Kr,{...l,hiddenTextDescribedById:ve}));function Sr(){const W=he?.autoScrollEnabled===!1,Z=typeof u=="object"?u.enabled===!1:u===!1,Q=D&&!W&&!Z;return typeof u=="object"?{...u,enabled:Q}:{enabled:Q}}}),ns=d.createContext(null),_n="button",rs="Draggable";function os(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=tt(rs),{activators:i,activatorEvent:l,active:u,activeNodeRect:f,ariaDescribedById:p,draggableNodes:g,over:m}=d.useContext(yt),{role:h=_n,roleDescription:x="draggable",tabIndex:v=0}=o??{},y=u?.id===t,S=d.useContext(y?tr:ns),[C,R]=ht(),[T,_]=ht(),D=Bo(i,t),j=Ke(n);fe(()=>(g.set(t,{id:t,key:s,node:C,activatorNode:T,data:j}),()=>{const L=g.get(t);L&&L.key===s&&g.delete(t)}),[g,t]);const O=d.useMemo(()=>({role:h,tabIndex:v,"aria-disabled":r,"aria-pressed":y&&h===_n?!0:void 0,"aria-roledescription":x,"aria-describedby":p.draggable}),[r,h,v,y,x,p.draggable]);return{active:u,activatorEvent:l,activeNodeRect:f,attributes:O,isDragging:y,listeners:r?void 0:D,node:C,over:m,setNodeRef:R,setActivatorNodeRef:_,transform:S}}function ss(){return d.useContext(er)}const is="Droppable",as={timeout:25};function ls(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=tt(is),{active:i,dispatch:l,over:u,measureDroppableContainers:f}=d.useContext(yt),p=d.useRef({disabled:n}),g=d.useRef(!1),m=d.useRef(null),h=d.useRef(null),{disabled:x,updateMeasurementsFor:v,timeout:y}={...as,...o},S=Ke(v??r),C=d.useCallback(()=>{if(!g.current){g.current=!0;return}h.current!=null&&clearTimeout(h.current),h.current=setTimeout(()=>{f(Array.isArray(S.current)?S.current:[S.current]),h.current=null},y)},[y]),R=xt({callback:C,disabled:x||!i}),T=d.useCallback((O,L)=>{R&&(L&&(R.unobserve(L),g.current=!1),O&&R.observe(O))},[R]),[_,D]=ht(T),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:m,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:m,isOver:u?.id===r,node:_,over:u,setNodeRef:D}}function St(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function cs(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 us(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 ds(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const ct={scaleX:1,scaleY:1},fs=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=hs(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,...ct}:null}return i>o&&i<=s?{x:-l.width-u,y:0,...ct}:i<o&&i>=s?{x:l.width+u,y:0,...ct}:{x:0,y:0,...ct}};function hs(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 rr=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=St(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}},ut={scaleX:1,scaleY:1},gs=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,...ut}:null}const u=ps(s,o,n);return o>n&&o<=i?{x:0,y:-l.height-u,...ut}:o<n&&o>=i?{x:0,y:l.height+u,...ut}:{x:0,y:0,...ut}};function ps(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 or="Sortable",sr=d.createContext({activeIndex:-1,containerId:or,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:rr,disabled:{draggable:!1,droppable:!1}});function ir(e){let{children:t,id:n,items:r,strategy:o=rr,disabled:s=!1}=e;const{active:i,dragOverlay:l,droppableRects:u,over:f,measureDroppableContainers:p}=ss(),g=tt(or,n),m=l.rect!==null,h=d.useMemo(()=>r.map(D=>typeof D=="object"&&"id"in D?D.id:D),[r]),x=i!=null,v=i?h.indexOf(i.id):-1,y=f?h.indexOf(f.id):-1,S=d.useRef(h),C=!us(h,S.current),R=y!==-1&&v===-1||C,T=ds(s);fe(()=>{C&&x&&p(h)},[C,h,x,p]),d.useEffect(()=>{S.current=h},[h]);const _=d.useMemo(()=>({activeIndex:v,containerId:g,disabled:T,disableTransforms:R,items:h,overIndex:y,useDragOverlay:m,sortedRects:cs(h,u),strategy:o}),[v,g,T.draggable,T.droppable,R,h,y,u,m,o]);return d.createElement(sr.Provider,{value:_},t)}const vs=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return St(n,r,o).indexOf(t)},bs=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},ms={duration:200,easing:"ease"},ar="transform",xs=Me.Transition.toString({property:ar,duration:0,easing:"linear"}),ys={roleDescription:"sortable"};function Ss(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 lr(e){let{animateLayoutChanges:t=bs,attributes:n,disabled:r,data:o,getNewIndex:s=vs,id:i,strategy:l,resizeObserverConfig:u,transition:f=ms}=e;const{items:p,containerId:g,activeIndex:m,disabled:h,disableTransforms:x,sortedRects:v,overIndex:y,useDragOverlay:S,strategy:C}=d.useContext(sr),R=ws(r,h),T=p.indexOf(i),_=d.useMemo(()=>({sortable:{containerId:g,index:T,items:p},...o}),[g,o,T,p]),D=d.useMemo(()=>p.slice(p.indexOf(i)),[p,i]),{rect:j,node:O,isOver:L,setNodeRef:P}=ls({id:i,data:_,disabled:R.droppable,resizeObserverConfig:{updateMeasurementsFor:D,...u}}),{active:N,activatorEvent:U,activeNodeRect:X,attributes:te,setNodeRef:he,listeners:Re,isDragging:H,over:Ee,setActivatorNodeRef:ne,transform:ve}=os({id:i,data:_,attributes:{...ys,...n},disabled:R.draggable}),b=$r(P,he),E=!!N,I=E&&!x&<(m)&<(y),A=!S&&H,le=A&&I?ve:null,$=I?le??(l??C)({rects:v,activeNodeRect:X,activeIndex:m,overIndex:y,index:T}):null,G=lt(m)&<(y)?s({id:i,items:p,activeIndex:m,overIndex:y}):T,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:E,id:i,index:T,items:p,newIndex:M.current.newIndex,previousItems:M.current.items,previousContainerId:M.current.containerId,transition:f,wasDragging:M.current.activeId!=null}),De=Ss({disabled:!ce,index:T,node:O,rect:j});return d.useEffect(()=>{E&&M.current.newIndex!==G&&(M.current.newIndex=G),g!==M.current.containerId&&(M.current.containerId=g),p!==M.current.items&&(M.current.items=p)},[E,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:m,attributes:te,data:_,rect:j,index:T,newIndex:G,items:p,isOver:L,isSorting:E,isDragging:H,listeners:Re,node:O,overIndex:y,over:Ee,setNodeRef:b,setActivatorNodeRef:ne,setDroppableNodeRef:P,setDraggableNodeRef:he,transform:De??$,transition:ge()};function ge(){if(De||$e&&M.current.newIndex===T)return xs;if(!(A&&!Wt(U)||!f)&&(E||ce))return Me.Transition.toString({...f,property:ar})}}function ws(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 Cs=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Rs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),On=e=>{const t=Rs(e);return t.charAt(0).toUpperCase()+t.slice(1)},cr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Es=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Ds={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 Ts=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,...Ds,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:cr("lucide",o),...!s&&!Es(l)&&{"aria-hidden":"true"},...l},[...i.map(([f,p])=>d.createElement(f,p)),...Array.isArray(s)?s:[s]]));const K=(e,t)=>{const n=d.forwardRef(({className:r,...o},s)=>d.createElement(Ts,{ref:s,iconNode:t,className:cr(`lucide-${Cs(On(e))}`,`lucide-${e}`,r),...o}));return n.displayName=On(e),n};const js=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],_s=K("arrow-down",js);const Os=[["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"}]],Is=K("arrow-up-down",Os);const ks=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Ms=K("arrow-up",ks);const As=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Ns=K("bookmark",As);const Ls=[["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"}]],In=K("calendar",Ls);const $s=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ps=K("chevron-left",$s);const zs=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Fs=K("chevron-right",zs);const Vs=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]],Bs=K("columns-2",Vs);const Hs=[["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"}]],Ys=K("delete",Hs);const Ws=[["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"}]],Us=K("ellipsis",Ws);const Gs=[["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"}]],Xs=K("funnel",Gs);const qs=[["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"}]],Ks=K("grip-vertical",qs);const Js=[["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"}]],Zs=K("pen",Js);const Qs=[["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"}]],ei=K("settings",Qs);function w(e){return d.forwardRef((t,n)=>{const{children:r,...o}=t;return a.jsx(e,{ref:n,...o,children:r})})}const ti=Object.freeze(Object.defineProperty({__proto__:null,withChildren:w},Symbol.toStringTag,{value:"Module"})),ur=e=>`table_column_order_v1:${e}`,ni=e=>{const{tableId:t}=se.state;localStorage.setItem(ur(t),JSON.stringify(e.map(n=>n.id))),se.setState(n=>({...n,columnOrder:e})),se.setState(n=>({...n,columnOrder:e}))},ri=e=>{se.setState(t=>({...t,visibility:{...t.visibility,[e]:!t.visibility[e]}}))};function oi(e){se.setState(t=>t.sortColumn===e?{...t,sortDirection:t.sortDirection==="asc"?"desc":"asc"}:{...t,sortColumn:e,sortDirection:"asc"})}const se=new Pn({tableId:"",sortColumn:null,sortDirection:"asc",visibility:{},columnOrder:[],data:[],sortableColumns:[]});function si(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}=se.state,i=JSON.parse(localStorage.getItem(ur(s))||"[]"),l=[...i.map(u=>o.find(f=>f.id===u)).filter(Boolean),...o.filter(u=>!i.includes(u.id))];se.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 ii(e){se.setState(t=>({...t,tableId:e}))}const ai=w(c.Menu.Trigger),li=w(c.Menu.Positioner),ci=w(c.Menu.Content),ui=w(c.Menu.Item),di=w(c.Checkbox.Label),fi=w(c.Checkbox.HiddenInput),hi=w(c.Checkbox.Control);function gi({visibility:e,onToggle:t}){const{sortableColumns:n}=Ze(se);return a.jsxs(c.Menu.Root,{closeOnSelect:!1,children:[a.jsx(ai,{asChild:!0,children:a.jsx(c.IconButton,{"aria-label":"Toggle columns",variant:"outline",size:"sm",ml:"1",children:a.jsx(Bs,{size:18})})}),a.jsx(c.Portal,{children:a.jsx(li,{children:a.jsx(ci,{minW:"220px",children:n.map(r=>{const o=!!e[r.id];return a.jsx(ui,{value:r.id,closeOnSelect:!1,children:a.jsxs(c.Checkbox.Root,{checked:o,onCheckedChange:()=>t(r.id),children:[a.jsx(fi,{}),a.jsx(hi,{}),a.jsx(di,{children:r.label})]})},r.id)})})})})]})}function pi({id:e,children:t,onClick:n,cursor:r,borderRight:o,borderRightColor:s}){const{setNodeRef:i,attributes:l,listeners:u,transform:f,transition:p}=lr({id:e});return a.jsx(c.Table.ColumnHeader,{ref:i,onClick:n,w:e==="id"?"80px":void 0,style:{transform:Me.Transform.toString(f),transition:p,cursor:r,borderRight:o,borderRightColor:s},...l,children:a.jsxs(c.HStack,{justify:"space-between",children:[t,a.jsx("span",{...u,children:a.jsx(Ks,{size:12})})]})})}function vi(){const{columnOrder:e,visibility:t,sortColumn:n,sortDirection:r,sortableColumns:o}=Ze(se),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(h=>h.id===u.id),g=e.findIndex(h=>h.id===f.id),m=St(e,p,g);ni(m)};return a.jsx(c.Table.Header,{background:"gray.100",position:"sticky",top:0,p:"0",children:a.jsx(nr,{collisionDetection:Bn,onDragEnd:i,children:a.jsx(ir,{items:e.map(l=>l.id),strategy:fs,children:a.jsxs(c.Table.Row,{height:"28px",children:[s.map((l,u)=>{const f=n===l?.id;return a.jsx(pi,{id:l?.id,onClick:()=>l?.sortable&&oi(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&&(f?r==="asc"?a.jsx(Ms,{size:14}):a.jsx(_s,{size:14}):a.jsx(Is,{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(gi,{visibility:t,onToggle:ri})})]})})})})}const kn=c.createListCollection({items:[{label:"10",value:"10"},{label:"20",value:"20"},{label:"50",value:"50"},{label:"100",value:"100"}]}),bi=w(c.Select.Positioner),mi=w(c.Select.Content),xi=w(c.Select.Item),yi=w(c.Pagination.PrevTrigger),Si=w(c.Pagination.NextTrigger),wi=w(c.Select.HiddenSelect),Ci=w(c.Select.Control),Ri=w(c.Select.Trigger),Ei=w(c.Select.ValueText),Di=w(c.Select.IndicatorGroup),Ti=w(c.Select.Indicator);function ji({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:kn,size:"sm",width:"60px",onValueChange:i=>o&&o(Number(i.items[0].value)),value:[String(t)],children:[a.jsx(wi,{}),a.jsxs(Ci,{children:[a.jsx(Ri,{children:a.jsx(Ei,{placeholder:""})}),a.jsx(Di,{children:a.jsx(Ti,{})})]}),a.jsx(c.Portal,{children:a.jsx(bi,{children:a.jsx(mi,{children:kn.items.map(i=>a.jsxs(xi,{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(yi,{asChild:!0,children:a.jsx(c.IconButton,{"aria-label":"Previous page",children:a.jsx(Ps,{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(Si,{asChild:!0,children:a.jsx(c.IconButton,{"aria-label":"Next page",children:a.jsx(Fs,{size:18})})})]})})]})})}const _i=w(c.Menu.Item),Oi=w(c.Menu.Content),Ii=w(c.Menu.Positioner),ki=w(c.Menu.Trigger);function Mi({data:e=[],actions:t=[]}){const{columnOrder:n,visibility:r}=Ze(se);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(ki,{asChild:!0,children:a.jsx(c.IconButton,{"aria-label":"Open",variant:"ghost",size:"sm",children:a.jsx(Us,{size:16})})}),a.jsx(c.Portal,{children:a.jsx(Ii,{children:a.jsx(Oi,{children:t.map(s=>a.jsxs(_i,{onClick:()=>s.onClick(o),colorScheme:s.colorScheme,value:s.label,children:[s.icon,s.label]},s.label))})})})]})})]},o.id))})}function Ai({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:m="client"}){d.useEffect(()=>{ii(e)},[e]),d.useEffect(()=>{si(t,n)},[t,n]);const{sortColumn:h,sortDirection:x,data:v}=Ze(se),y=d.useMemo(()=>{const S=[...v];if(h&&S.sort((C,R)=>x==="asc"?String(C[h]).localeCompare(String(R[h])):String(R[h]).localeCompare(String(C[h]))),m==="client"){const C=i*l;return S.slice(C,C+l)}return S},[v,h,x,i,l,m]);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..."}):y.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(vi,{}),a.jsx(Mi,{data:y,actions:s})]})}),a.jsx(c.Box,{mt:.5,children:a.jsx(ji,{totalCount:g,pageSize:l,currentPage:i,onPageChange:u,onPageSizeChange:S=>{f&&f(S),i>1&&u&&u(1)}})})]})}const Ni=Object.freeze(Object.defineProperty({__proto__:null,DataTable:Ai},Symbol.toStringTag,{value:"Module"})),Li=w(c.Checkbox.Root),$i=w(c.Checkbox.HiddenInput),Pi=w(c.Checkbox.Control),zi=w(c.Checkbox.Label),Fi=({value:e,onChange:t,size:n="sm",label:r,helperText:o,isDisabled:s,required:i,errorText:l})=>a.jsxs(Li,{value:e,onChange:t,size:n,children:[a.jsx($i,{}),a.jsx(Pi,{disabled:s,required:i,errorText:l,helperText:o}),r&&a.jsx(zi,{children:r})]}),z=" to ",Mn=10,Ce={DAY_MAX:31,MONTH_MAX:12,YEAR_MIN:1900,YEAR_MAX:2100},Kt=()=>{const e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}},An=()=>{const{year:e,month:t,day:n}=Kt();return`${String(n).padStart(2,"0")}-${String(t).padStart(2,"0")}-${e}`},Vi=()=>{const{year:e,month:t,day:n}=Kt();return`${e}-${String(t).padStart(2,"0")}-${String(n).padStart(2,"0")}`},Bi=(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}=Kt();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=Bi(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}`},Hi=(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,Mn);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,Mn),Hi(n,e)||t},Yi=w(c.Popover.Root),Wi=w(c.Popover.Trigger),Ui=w(c.Popover.Content),Gi=w(c.Popover.Positioner);function Xi({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 x=v=>{v.ctrlKey&&v.key==="d"&&!v.shiftKey&&!v.metaKey&&(v.preventDefault(),f.current?.focus())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[]);const p=x=>{let v=x;if(v.includes(z)){const[y,S=""]=v.split(z);v=`${We(y.trim())}${z}${We(S.trim())}`}else if(v.toLowerCase().includes(" to ")){const[y,S=""]=v.split(/\s+to\s+/i);v=`${We(y.trim())} to ${We(S.trim())}`}else v=We(v);i(v)},g=()=>{const x=s.trim();if(!x){t(void 0);return}if(x.includes(z)){const[v,y=""]=x.split(z).map(R=>R.trim()),S=Ye(v),C=y?Ye(y):null;if(S&&C){const[R,T]=C<S?[C,S]:[S,C],_=`${ie(R)}${z}${ie(T)}`;i(_),t(`${R}|${T}`)}else if(S&&!y)i(`${ie(S)}${z}`),t(void 0);else if(S&&y){const R=Vi(),[T,_]=R<S?[R,S]:[S,R],D=`${ie(T)}${z}${ie(_)}`;i(D),t(`${T}|${_}`)}else i(""),t(void 0)}else{const v=Ye(x);v?(i(`${ie(v)}${z}`),t(void 0)):(i(""),t(void 0))}},m=x=>{if(x.key!=="Enter")return;x.preventDefault();const v=f.current?.selectionStart||0,y=s.indexOf(z);if(!s.trim()){i(`${An()}${z}`);return}if(y===-1){const C=Ye(s.trim());C&&i(`${ie(C)}${z}`);return}if(v<=y+z.length){const C=s.substring(0,y).trim(),R=s.substring(y+z.length),T=Ye(C);T&&i(`${ie(T)}${z}${R}`);return}if(s.substring(y+z.length).trim())g(),f.current?.blur();else{const C=s.substring(0,y+z.length)+An();i(C),setTimeout(()=>{g(),f.current?.blur()},0)}},h=()=>{i(""),t(void 0)};return a.jsx(c.InputGroup,{children:a.jsx(a.Fragment,{children:a.jsxs(c.InputElement,{position:"revert",children:[a.jsxs(Yi,{open:l,onEscapeKeyDown:()=>{u(!1)},children:[a.jsx(Wi,{asChild:!0,children:a.jsx(c.IconButton,{size:"sm",variant:"ghost","aria-label":"Date range help",onClick:()=>u(x=>!x),children:a.jsx(In,{size:16})})}),a.jsx(c.Portal,{children:a.jsx(Gi,{children:a.jsxs(Ui,{p:4,children:[a.jsx(c.PopoverArrow,{}),a.jsxs(c.VStack,{align:"start",gap:4,children:[a.jsxs(c.HStack,{children:[a.jsx(In,{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:x=>p(x.target.value),onBlur:g,onKeyDown:m,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:h,w:"100%"})})]})})})}const qi=w(c.Field.Root),Ki=w(c.Field.Label),Ji=w(c.Field.HelperText),Zi=w(c.Field.ErrorText),Nn=({icon:e,value:t,onChange:n,placeholder:r,size:o="sm",variant:s="outline",width:i="100%",label:l,helperText:u,isDisabled:f=!1,required:p=!1,errorText:g})=>a.jsxs(qi,{children:[l&&a.jsx(Ki,{children:l}),a.jsx(c.InputGroup,{startElement:e,children:a.jsx(c.Input,{value:t,onChange:m=>n&&n(m.target.value),placeholder:r,size:o,variant:s,width:i,disabled:f,required:p})}),a.jsx(Ji,{children:u}),g&&a.jsx(Zi,{children:g})]}),Qi=w(c.Field.Root),ea=w(c.Field.HelperText),ta=w(c.Field.ErrorText),na=w(c.Select.Root),ra=w(c.Select.Label),oa=w(c.Select.Control),sa=w(c.Select.Trigger),ia=w(c.Select.ValueText),aa=w(c.Select.IndicatorGroup),la=w(c.Select.Indicator),ca=w(c.Select.Content),ua=w(c.Select.Item),da=w(c.Select.ItemIndicator),fa=w(c.Select.HiddenSelect),ha=w(c.Select.Positioner),ga=({options:e=[],label:t,value:n,onChange:r,placeholder:o,size:s="sm",width:i="100%",variant:l="outline",helperText:u,isDisabled:f,required:p,errorText:g})=>{const m=c.createListCollection({items:e});return a.jsxs(Qi,{disabled:f,required:p,children:[a.jsxs(na,{collection:m,variant:l,size:s,width:i,value:n?[n]:[],onValueChange:h=>r?.(h.value[0]),children:[a.jsx(fa,{}),t&&a.jsx(ra,{children:t}),a.jsxs(oa,{children:[a.jsx(sa,{children:a.jsx(ia,{placeholder:o})}),a.jsx(aa,{children:a.jsx(la,{})})]}),a.jsx(ha,{children:a.jsx(ca,{children:m.items.map(h=>a.jsxs(ua,{item:h,children:[h.label,a.jsx(da,{})]},h.value))})})]}),u&&a.jsx(ea,{children:u}),g&&a.jsx(ta,{children:g})]})},dr=e=>`FILTER_PRESETS_${e??"default"}`;function pa(e){try{return JSON.parse(localStorage.getItem(dr(e))||"[]")}catch{return[]}}const bt=new Pn({}),Jt=e=>{const t=bt.state[e];if(t)return t;const n=pa(e);return bt.setState(r=>({...r,[e]:n})),n},fr=(e,t)=>{bt.setState(n=>({...n,[e]:t})),localStorage.setItem(dr(e),JSON.stringify(t))},va=(e,t)=>{const n=Jt(e).filter(r=>r.id!==t);fr(e,n)},ba=(e,t)=>{const n=[t,...Jt(e)];fr(e,n)},ma=w(c.Checkbox.Root),xa=w(c.Checkbox.HiddenInput),ya=w(c.Checkbox.Control),Sa=w(c.Slider.Root),wa=w(c.Slider.Track),Ca=w(c.Slider.Range),Ra=w(c.Slider.Thumbs),Ea=w(c.Slider.Control),Da=({filter:e,onVisibilityChange:t,onSizeChange:n})=>{const{attributes:r,listeners:o,setNodeRef:s,transform:i,transition:l}=lr({id:e.id}),u={transform:Me.Transform.toString(i),transition:l,cursor:"grab"};return a.jsxs(c.VStack,{ref:s,style:u,align:"stretch",border:"1px solid",borderColor:"gray.200",rounded:"md",p:3,mb:3,...r,...o,children:[a.jsx(c.Text,{fontWeight:"bold",children:e.label}),a.jsxs(c.HStack,{justify:"space-between",children:[a.jsx(c.Text,{fontSize:"sm",children:"Visible"}),a.jsxs(ma,{checked:e.visible,onCheckedChange:f=>t&&t(e.id,!!f),size:"sm",children:[a.jsx(xa,{}),a.jsx(ya,{})]})]}),a.jsxs(c.VStack,{align:"stretch",gap:1,children:[a.jsx(c.Text,{fontSize:"sm",children:"Size"}),a.jsx(Sa,{width:"200px",min:1,max:5,step:.5,value:[e.size??1],onChange:f=>n&&n(e.id,f[0]),children:a.jsxs(Ea,{children:[a.jsx(wa,{children:a.jsx(Ca,{})}),a.jsx(Ra,{})]})})]})]})},Ta=w(c.Drawer.Root),ja=w(c.Drawer.Trigger),_a=w(c.Drawer.Backdrop),Oa=w(c.Drawer.Positioner),Ia=w(c.Drawer.Content),ka=w(c.Drawer.Header),Ma=w(c.Drawer.Title),Aa=w(c.Drawer.Body),Na=w(c.Drawer.Footer),La=w(c.Drawer.CloseTrigger),$a=w(c.Tabs.Root),Pa=w(c.Tabs.List),At=w(c.Tabs.Trigger),Nt=w(c.Tabs.Content),hr=e=>{if(console.log(e),e.customComponent)return e.customComponent;switch(e.type){case"text":return a.jsx(Nn,{placeholder:e.label,value:e.value,onChange:e.onChange,label:""});case"number":return a.jsx(Nn,{label:e.label,value:e.value,onChange:e.onChange});case"checkbox":return a.jsx(Fi,{label:e.label,value:e.value,onChange:e.onChange});case"select":return a.jsx(ga,{label:e.label,value:e.value,onChange:e.onChange,options:e.options??[]});case"date":return a.jsx(Xi,{value:e.value,onChange:e.onChange});default:return null}},za=({filterDrawerSize:e="sm",onVisibilityChange:t,onSizeChange:n,onClear:r,filters:o,pageKey:s="default",currentFilters:i={},onLoadPreset:l,activePresetName:u,onReorder:f})=>{const g=Ze(bt)[s]??Jt(s),m=()=>{const h=prompt("Preset name?");h&&ba(s,{id:crypto.randomUUID(),name:h,date:new Date().toISOString(),filters:i})};return a.jsx(c.HStack,{wrap:"wrap",children:a.jsxs(Ta,{size:e,children:[a.jsx(ja,{asChild:!0,children:a.jsxs(c.IconButton,{"aria-label":"Open filters",variant:"outline",size:"xs",ml:2,p:2,children:[a.jsx(Xs,{size:16}),"Filters"]})}),a.jsxs(c.Portal,{children:[a.jsx(_a,{}),a.jsx(Oa,{children:a.jsxs(Ia,{children:[a.jsx(ka,{children:a.jsx(Ma,{children:"Filters"})}),a.jsx(Aa,{overflowY:"auto",pt:1,children:a.jsxs($a,{defaultValue:"view",children:[a.jsxs(Pa,{mb:4,children:[a.jsxs(At,{value:"view",children:[a.jsx(Zs,{size:16}),"Edit"]}),a.jsxs(At,{value:"settings",children:[a.jsx(ei,{size:16}),"Settings"]}),a.jsxs(At,{value:"presets",children:[a.jsx(Ns,{size:16}),"Presets"]})]}),a.jsx(Nt,{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:hr(h)},h.id))}),a.jsx(Nt,{value:"settings",children:a.jsx(nr,{sensors:Zr(Jr(qt)),collisionDetection:Bn,onDragEnd:({active:h,over:x})=>{if(!x||h.id===x.id)return;const v=o.findIndex(C=>C.id===h.id),y=o.findIndex(C=>C.id===x.id),S=St(o,v,y);f?.(S)},children:a.jsx(ir,{items:o.map(h=>h.id),strategy:gs,children:o.map(h=>a.jsx(Da,{filter:h,onVisibilityChange:t,onSizeChange:n},h.id))})})}),a.jsx(Nt,{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"}),g.length===0&&a.jsx(c.Text,{fontSize:"xs",color:"gray.500",children:"No presets saved yet."}),g.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:()=>va(s,h.id),children:a.jsx(Ys,{size:14})})]})]},h.id))]})})]})}),a.jsxs(Na,{justify:"space-between",children:[a.jsx(c.Button,{size:"sm",variant:"ghost",colorScheme:"red",onClick:()=>r&&r(),children:"Clear All"}),a.jsx(La,{asChild:!0,children:a.jsx(c.CloseButton,{})})]})]})})]})]})})},Fa=({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"})=>a.jsxs(c.HStack,{wrap:"wrap",pl:2,pr:2,width:"100%",justify:"space-between",children:[e,a.jsxs(c.HStack,{gap:2,children:[t.filter(m=>m.visible!==!1).map(m=>a.jsx(c.HStack,{flex:m.size??1,minW:`${(m.size??1)*100}px`,children:hr(m)},m.id)),a.jsx(za,{filterDrawerSize:g,onVisibilityChange:n,onReorder:r,onSizeChange:o,onClear:s,maxToolbarUnits:i,pageKey:l,filters:t,currentFilters:u,onLoadPreset:f,activePresetName:p})]})]}),Va=Object.freeze(Object.defineProperty({__proto__:null,FilterToolBar:Fa},Symbol.toStringTag,{value:"Module"})),Ba=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));exports.ChakraSlot=ti;exports.DataTable=Ni;exports.Filters=Va;exports.MdsSharedUi=Ba;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { ConditionalValue } from '@chakra-ui/react';
|
|
2
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
2
3
|
import { JSX } from 'react';
|
|
3
4
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
4
|
-
import
|
|
5
|
-
import { Store } from '@tanstack/store';
|
|
5
|
+
import { RefAttributes } from 'react';
|
|
6
6
|
|
|
7
|
-
export declare
|
|
7
|
+
export declare namespace ChakraSlot {
|
|
8
|
+
export {
|
|
9
|
+
withChildren
|
|
10
|
+
}
|
|
11
|
+
}
|
|
8
12
|
|
|
9
13
|
declare interface Column<T = unknown> {
|
|
10
14
|
id: string;
|
|
@@ -15,7 +19,17 @@ declare interface Column<T = unknown> {
|
|
|
15
19
|
format?: (value: unknown, row: T) => React.ReactNode;
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
export declare
|
|
22
|
+
export declare namespace DataTable {
|
|
23
|
+
export {
|
|
24
|
+
DataTable_2 as DataTable,
|
|
25
|
+
Column,
|
|
26
|
+
DataTableAction,
|
|
27
|
+
DataTableProps,
|
|
28
|
+
DensityType
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare function DataTable_2<T extends Record<string, unknown>>({ tableId, data: rowData, headers, loading, emptyMessage, actions, page, pageSize, onPageChange, onPageSizeChange, density, totalCount, paginationMode, }: DataTableProps<T>): JSX_2.Element;
|
|
19
33
|
|
|
20
34
|
declare interface DataTableAction<T = unknown> {
|
|
21
35
|
icon: JSX.Element;
|
|
@@ -37,17 +51,23 @@ declare interface DataTableProps<T = unknown> {
|
|
|
37
51
|
onPageSizeChange?: (size: number) => void | undefined;
|
|
38
52
|
density?: DensityType;
|
|
39
53
|
totalCount?: number;
|
|
54
|
+
paginationMode?: 'server' | 'client';
|
|
40
55
|
}
|
|
41
56
|
|
|
42
|
-
export declare const deletePreset: (pageKey: string, id: string) => void;
|
|
43
|
-
|
|
44
57
|
declare type DensityType = 'sm' | 'md' | 'lg';
|
|
45
58
|
|
|
46
|
-
export declare
|
|
59
|
+
export declare namespace Filters {
|
|
60
|
+
export {
|
|
61
|
+
FiltersToolBar as FilterToolBar,
|
|
62
|
+
IFilterConfig,
|
|
63
|
+
IFilterDrawerProps,
|
|
64
|
+
IMainFilterType
|
|
65
|
+
}
|
|
66
|
+
}
|
|
47
67
|
|
|
48
|
-
|
|
68
|
+
declare const FiltersToolBar: ({ title, filters, onVisibilityChange, onReorder, onSizeChange, onClear, maxToolbarUnits, pageKey, currentFilters, onLoadPreset, activePresetName, filterDrawerSize, }: IMainFilterType) => JSX_2.Element;
|
|
49
69
|
|
|
50
|
-
|
|
70
|
+
declare interface IFilterConfig {
|
|
51
71
|
id: string;
|
|
52
72
|
label: string;
|
|
53
73
|
type?: 'date' | 'text' | 'select' | 'checkbox' | 'radio' | 'number';
|
|
@@ -57,12 +77,12 @@ export declare interface IFilterConfig {
|
|
|
57
77
|
value: string;
|
|
58
78
|
}[];
|
|
59
79
|
onChange?: (value: string | number | boolean | undefined) => void;
|
|
60
|
-
visible
|
|
80
|
+
visible: boolean;
|
|
61
81
|
size?: 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 3.5 | 4 | 4.5 | 5;
|
|
62
82
|
customComponent?: JSX.Element;
|
|
63
83
|
}
|
|
64
84
|
|
|
65
|
-
|
|
85
|
+
declare interface IFilterDrawerProps {
|
|
66
86
|
filters: IFilterConfig[];
|
|
67
87
|
onVisibilityChange?: (id: string, visible: boolean) => void;
|
|
68
88
|
onReorder?: (newOrder: IFilterConfig[]) => void;
|
|
@@ -76,7 +96,7 @@ export declare interface IFilterDrawerProps {
|
|
|
76
96
|
activePresetName?: string | null;
|
|
77
97
|
}
|
|
78
98
|
|
|
79
|
-
|
|
99
|
+
declare interface IMainFilterType {
|
|
80
100
|
title: JSX.Element;
|
|
81
101
|
filters: IFilterConfig[];
|
|
82
102
|
onVisibilityChange?: (id: string, visible: boolean) => void;
|
|
@@ -91,7 +111,7 @@ export declare interface IMainFilterType {
|
|
|
91
111
|
activePresetName?: string | null;
|
|
92
112
|
}
|
|
93
113
|
|
|
94
|
-
|
|
114
|
+
declare interface IMDSCheckboxTypes {
|
|
95
115
|
value?: boolean;
|
|
96
116
|
onChange?: (value: boolean) => void;
|
|
97
117
|
size?: 'sm' | 'md' | 'lg';
|
|
@@ -102,9 +122,9 @@ export declare interface IMDSCheckboxTypes {
|
|
|
102
122
|
errorText?: string;
|
|
103
123
|
}
|
|
104
124
|
|
|
105
|
-
|
|
125
|
+
declare interface IMDSInputTypes {
|
|
106
126
|
icon?: React.ReactNode;
|
|
107
|
-
value?: string;
|
|
127
|
+
value?: string | number;
|
|
108
128
|
onChange?: (value: string) => void;
|
|
109
129
|
placeholder?: string;
|
|
110
130
|
size?: 'sm' | 'md' | 'lg';
|
|
@@ -117,7 +137,7 @@ export declare interface IMDSInputTypes {
|
|
|
117
137
|
errorText?: string;
|
|
118
138
|
}
|
|
119
139
|
|
|
120
|
-
|
|
140
|
+
declare interface IMDSSelectBoxTypes {
|
|
121
141
|
options: {
|
|
122
142
|
label: string;
|
|
123
143
|
value: string;
|
|
@@ -135,45 +155,18 @@ export declare interface IMDSSelectBoxTypes {
|
|
|
135
155
|
errorText?: string;
|
|
136
156
|
}
|
|
137
157
|
|
|
138
|
-
export declare
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
filters: any;
|
|
158
|
+
export declare namespace MdsSharedUi {
|
|
159
|
+
export {
|
|
160
|
+
IMDSCheckboxTypes,
|
|
161
|
+
IMDSInputTypes,
|
|
162
|
+
IMDSSelectBoxTypes
|
|
163
|
+
}
|
|
145
164
|
}
|
|
146
165
|
|
|
147
|
-
export declare const presetStore: Store<Record<string, PresetItem[]>, (cb: Record<string, PresetItem[]>) => Record<string, PresetItem[]>>;
|
|
148
|
-
|
|
149
|
-
export declare const saveOrder: (pageKey: string, filters: string[]) => void;
|
|
150
|
-
|
|
151
|
-
export declare const savePresets: (pageKey: string, items: PresetItem[]) => void;
|
|
152
|
-
|
|
153
|
-
export declare function setData(newData: any[], headers?: Column<any>[]): void;
|
|
154
|
-
|
|
155
|
-
export declare function setTableId(tableId: string): void;
|
|
156
|
-
|
|
157
|
-
declare interface TableState {
|
|
158
|
-
tableId: string;
|
|
159
|
-
sortColumn: string | null;
|
|
160
|
-
sortDirection: 'asc' | 'desc';
|
|
161
|
-
visibility: Record<string, boolean>;
|
|
162
|
-
columnOrder: Column<any>[];
|
|
163
|
-
data: any[];
|
|
164
|
-
sortableColumns: {
|
|
165
|
-
id: string;
|
|
166
|
-
label: string;
|
|
167
|
-
sortable: boolean;
|
|
168
|
-
}[];
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export declare const tableStore: Store<TableState, (cb: TableState) => TableState>;
|
|
172
|
-
|
|
173
166
|
/**
|
|
174
167
|
* Chakra v3 / Ark UI slot components do NOT expose `children` in their typings.
|
|
175
168
|
* This wrapper intentionally loosens typing to make them library-safe.
|
|
176
169
|
*/
|
|
177
|
-
|
|
170
|
+
declare function withChildren(Component: any): ForwardRefExoticComponent<Omit<any, "ref"> & RefAttributes<any>>;
|
|
178
171
|
|
|
179
172
|
export { }
|