@object-ui/plugin-kanban 3.0.2 → 3.1.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.
Files changed (45) hide show
  1. package/.turbo/turbo-build.log +9 -9
  2. package/CHANGELOG.md +9 -0
  3. package/dist/{KanbanEnhanced-BPIKjTDv.js → KanbanEnhanced-CXDSLlGR.js} +338 -324
  4. package/dist/KanbanImpl-4dgoNPtI.js +350 -0
  5. package/dist/index-CyNcIIS1.js +1077 -0
  6. package/dist/index.js +9 -4
  7. package/dist/index.umd.cjs +4 -4
  8. package/dist/src/CardTemplates.d.ts +25 -0
  9. package/dist/src/CardTemplates.d.ts.map +1 -0
  10. package/dist/src/InlineQuickAdd.d.ts +29 -0
  11. package/dist/src/InlineQuickAdd.d.ts.map +1 -0
  12. package/dist/src/KanbanEnhanced.d.ts +12 -1
  13. package/dist/src/KanbanEnhanced.d.ts.map +1 -1
  14. package/dist/src/KanbanImpl.d.ts +15 -1
  15. package/dist/src/KanbanImpl.d.ts.map +1 -1
  16. package/dist/src/ObjectKanban.d.ts.map +1 -1
  17. package/dist/src/index.d.ts +22 -1
  18. package/dist/src/index.d.ts.map +1 -1
  19. package/dist/src/types.d.ts +97 -1
  20. package/dist/src/types.d.ts.map +1 -1
  21. package/dist/src/useColumnWidths.d.ts +30 -0
  22. package/dist/src/useColumnWidths.d.ts.map +1 -0
  23. package/dist/src/useCrossSwimlaneMove.d.ts +46 -0
  24. package/dist/src/useCrossSwimlaneMove.d.ts.map +1 -0
  25. package/dist/src/useQuickAddReorder.d.ts +28 -0
  26. package/dist/src/useQuickAddReorder.d.ts.map +1 -0
  27. package/package.json +9 -9
  28. package/src/CardTemplates.tsx +123 -0
  29. package/src/InlineQuickAdd.tsx +189 -0
  30. package/src/KanbanEnhanced.tsx +140 -9
  31. package/src/KanbanImpl.tsx +266 -23
  32. package/src/ObjectKanban.tsx +39 -24
  33. package/src/__tests__/KanbanGrouping.test.tsx +164 -0
  34. package/src/__tests__/KanbanSwimlanes.test.tsx +194 -0
  35. package/src/__tests__/ObjectKanbanTitle.test.tsx +93 -0
  36. package/src/__tests__/SwimlanePersistence.test.tsx +159 -0
  37. package/src/__tests__/performance-benchmark.test.tsx +14 -14
  38. package/src/__tests__/phase13-features.test.tsx +387 -0
  39. package/src/index.tsx +49 -6
  40. package/src/types.ts +106 -1
  41. package/src/useColumnWidths.ts +125 -0
  42. package/src/useCrossSwimlaneMove.ts +116 -0
  43. package/src/useQuickAddReorder.ts +107 -0
  44. package/dist/KanbanImpl-BfOKAnJS.js +0 -194
  45. package/dist/index-CWGTi2xn.js +0 -600
package/dist/index.js CHANGED
@@ -1,11 +1,16 @@
1
- import { K as b, O as m, a as p, k as s } from "./index-CWGTi2xn.js";
1
+ import { a as d, I as t, K as i, O as m, b, k as p, u, d as c, e as k } from "./index-CyNcIIS1.js";
2
2
  import "react";
3
3
  import "@object-ui/core";
4
4
  import "@object-ui/react";
5
5
  import "@object-ui/components";
6
6
  export {
7
- b as KanbanRenderer,
7
+ d as CardTemplates,
8
+ t as InlineQuickAdd,
9
+ i as KanbanRenderer,
8
10
  m as ObjectKanban,
9
- p as ObjectKanbanRenderer,
10
- s as kanbanComponents
11
+ b as ObjectKanbanRenderer,
12
+ p as kanbanComponents,
13
+ u as useColumnWidths,
14
+ c as useCrossSwimlaneMove,
15
+ k as useQuickAddReorder
11
16
  };
@@ -1,13 +1,13 @@
1
- (function(G,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react"),require("@object-ui/core"),require("@object-ui/react"),require("@object-ui/components"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@object-ui/core","@object-ui/react","@object-ui/components","react-dom"],c):(G=typeof globalThis<"u"?globalThis:G||self,c(G.ObjectUIPluginKanban={},G.React,G.ObjectUICore,G.ObjectUIReact,G.ObjectUIComponents,G.ReactDOM))})(this,(function(G,c,Ze,Re,$,Se){"use strict";function rr(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const B=rr(c);var Qe={exports:{}},ze={};var Wt;function sr(){if(Wt)return ze;Wt=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,i){var a=null;if(i!==void 0&&(a=""+i),s.key!==void 0&&(a=""+s.key),"key"in s){i={};for(var o in s)o!=="key"&&(i[o]=s[o])}else i=s;return s=i.ref,{$$typeof:e,type:r,key:a,ref:s!==void 0?s:null,props:i}}return ze.Fragment=n,ze.jsx=t,ze.jsxs=t,ze}var Le={};var Vt;function ir(){return Vt||(Vt=1,process.env.NODE_ENV!=="production"&&(function(){function e(h){if(h==null)return null;if(typeof h=="function")return h.$$typeof===j?null:h.displayName||h.name||null;if(typeof h=="string")return h;switch(h){case y:return"Fragment";case v:return"Profiler";case D:return"StrictMode";case E:return"Suspense";case x:return"SuspenseList";case M:return"Activity"}if(typeof h=="object")switch(typeof h.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),h.$$typeof){case w:return"Portal";case S:return h.displayName||"Context";case C:return(h._context.displayName||"Context")+".Consumer";case b:var T=h.render;return h=h.displayName,h||(h=T.displayName||T.name||"",h=h!==""?"ForwardRef("+h+")":"ForwardRef"),h;case O:return T=h.displayName||null,T!==null?T:e(h.type)||"Memo";case A:T=h._payload,h=h._init;try{return e(h(T))}catch{}}return null}function n(h){return""+h}function t(h){try{n(h);var T=!1}catch{T=!0}if(T){T=console;var I=T.error,z=typeof Symbol=="function"&&Symbol.toStringTag&&h[Symbol.toStringTag]||h.constructor.name||"Object";return I.call(T,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",z),n(h)}}function r(h){if(h===y)return"<>";if(typeof h=="object"&&h!==null&&h.$$typeof===A)return"<...>";try{var T=e(h);return T?"<"+T+">":"<...>"}catch{return"<...>"}}function s(){var h=L.A;return h===null?null:h.getOwner()}function i(){return Error("react-stack-top-frame")}function a(h){if(R.call(h,"key")){var T=Object.getOwnPropertyDescriptor(h,"key").get;if(T&&T.isReactWarning)return!1}return h.key!==void 0}function o(h,T){function I(){Z||(Z=!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)",T))}I.isReactWarning=!0,Object.defineProperty(h,"key",{get:I,configurable:!0})}function l(){var h=e(this.type);return Y[h]||(Y[h]=!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.")),h=this.props.ref,h!==void 0?h:null}function u(h,T,I,z,le,U){var F=I.ref;return h={$$typeof:N,type:h,key:T,props:I,_owner:z},(F!==void 0?F:null)!==null?Object.defineProperty(h,"ref",{enumerable:!1,get:l}):Object.defineProperty(h,"ref",{enumerable:!1,value:null}),h._store={},Object.defineProperty(h._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(h,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(h,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:le}),Object.defineProperty(h,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.freeze&&(Object.freeze(h.props),Object.freeze(h)),h}function d(h,T,I,z,le,U){var F=T.children;if(F!==void 0)if(z)if(P(F)){for(z=0;z<F.length;z++)f(F[z]);Object.freeze&&Object.freeze(F)}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 f(F);if(R.call(T,"key")){F=e(h);var J=Object.keys(T).filter(function(_){return _!=="key"});z=0<J.length?"{key: someKey, "+J.join(": ..., ")+": ...}":"{key: someKey}",me[F+z]||(J=0<J.length?"{"+J.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
1
+ (function(U,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("react"),require("@object-ui/core"),require("@object-ui/react"),require("@object-ui/components"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@object-ui/core","@object-ui/react","@object-ui/components","react-dom"],u):(U=typeof globalThis<"u"?globalThis:U||self,u(U.ObjectUIPluginKanban={},U.React,U.ObjectUICore,U.ObjectUIReact,U.ObjectUIComponents,U.ReactDOM))})(this,(function(U,u,Ee,Re,F,Ne){"use strict";function ar(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const _=ar(u);var et={exports:{}},Pe={};var Xt;function lr(){if(Xt)return Pe;Xt=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function t(r,s,o){var i=null;if(o!==void 0&&(i=""+o),s.key!==void 0&&(i=""+s.key),"key"in s){o={};for(var a in s)a!=="key"&&(o[a]=s[a])}else o=s;return s=o.ref,{$$typeof:e,type:r,key:i,ref:s!==void 0?s:null,props:o}}return Pe.Fragment=n,Pe.jsx=t,Pe.jsxs=t,Pe}var Fe={};var Ht;function cr(){return Ht||(Ht=1,process.env.NODE_ENV!=="production"&&(function(){function e(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===D?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case v:return"Fragment";case j:return"Profiler";case k:return"StrictMode";case x:return"Suspense";case C:return"SuspenseList";case w:return"Activity"}if(typeof m=="object")switch(typeof m.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),m.$$typeof){case b:return"Portal";case A:return m.displayName||"Context";case T:return(m._context.displayName||"Context")+".Consumer";case S:var N=m.render;return m=m.displayName,m||(m=N.displayName||N.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case y:return N=m.displayName||null,N!==null?N:e(m.type)||"Memo";case I:N=m._payload,m=m._init;try{return e(m(N))}catch{}}return null}function n(m){return""+m}function t(m){try{n(m);var N=!1}catch{N=!0}if(N){N=console;var z=N.error,L=typeof Symbol=="function"&&Symbol.toStringTag&&m[Symbol.toStringTag]||m.constructor.name||"Object";return z.call(N,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",L),n(m)}}function r(m){if(m===v)return"<>";if(typeof m=="object"&&m!==null&&m.$$typeof===I)return"<...>";try{var N=e(m);return N?"<"+N+">":"<...>"}catch{return"<...>"}}function s(){var m=O.A;return m===null?null:m.getOwner()}function o(){return Error("react-stack-top-frame")}function i(m){if(M.call(m,"key")){var N=Object.getOwnPropertyDescriptor(m,"key").get;if(N&&N.isReactWarning)return!1}return m.key!==void 0}function a(m,N){function z(){K||(K=!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)",N))}z.isReactWarning=!0,Object.defineProperty(m,"key",{get:z,configurable:!0})}function l(){var m=e(this.type);return $[m]||($[m]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),m=this.props.ref,m!==void 0?m:null}function c(m,N,z,L,ue,G){var W=z.ref;return m={$$typeof:E,type:m,key:N,props:z,_owner:L},(W!==void 0?W:null)!==null?Object.defineProperty(m,"ref",{enumerable:!1,get:l}):Object.defineProperty(m,"ref",{enumerable:!1,value:null}),m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(m,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(m,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ue}),Object.defineProperty(m,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:G}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m}function d(m,N,z,L,ue,G){var W=N.children;if(W!==void 0)if(L)if(V(W)){for(L=0;L<W.length;L++)f(W[L]);Object.freeze&&Object.freeze(W)}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 f(W);if(M.call(N,"key")){W=e(m);var ee=Object.keys(N).filter(function(B){return B!=="key"});L=0<ee.length?"{key: someKey, "+ee.join(": ..., ")+": ...}":"{key: someKey}",ce[W+L]||(ee=0<ee.length?"{"+ee.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} />`,z,F,J,F),me[F+z]=!0)}if(F=null,I!==void 0&&(t(I),F=""+I),a(T)&&(t(T.key),F=""+T.key),"key"in T){I={};for(var Q in T)Q!=="key"&&(I[Q]=T[Q])}else I=T;return F&&o(I,typeof h=="function"?h.displayName||h.name||"Unknown":h),u(h,F,I,s(),le,U)}function f(h){g(h)?h._store&&(h._store.validated=1):typeof h=="object"&&h!==null&&h.$$typeof===A&&(h._payload.status==="fulfilled"?g(h._payload.value)&&h._payload.value._store&&(h._payload.value._store.validated=1):h._store&&(h._store.validated=1))}function g(h){return typeof h=="object"&&h!==null&&h.$$typeof===N}var p=c,N=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),y=Symbol.for("react.fragment"),D=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),S=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),j=Symbol.for("react.client.reference"),L=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=Object.prototype.hasOwnProperty,P=Array.isArray,H=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(h){return h()}};var Z,Y={},Ce=p.react_stack_bottom_frame.bind(p,i)(),se=H(r(i)),me={};Le.Fragment=y,Le.jsx=function(h,T,I){var z=1e4>L.recentlyCreatedOwnerStacks++;return d(h,T,I,!1,z?Error("react-stack-top-frame"):Ce,z?H(r(h)):se)},Le.jsxs=function(h,T,I){var z=1e4>L.recentlyCreatedOwnerStacks++;return d(h,T,I,!0,z?Error("react-stack-top-frame"):Ce,z?H(r(h)):se)}})()),Le}var Kt;function or(){return Kt||(Kt=1,process.env.NODE_ENV==="production"?Qe.exports=sr():Qe.exports=ir()),Qe.exports}var m=or();const xt=({schema:e,dataSource:n,className:t,onRowClick:r,onCardClick:s,...i})=>{const[a,o]=c.useState([]),[l,u]=c.useState(null),[d,f]=c.useState(!1),[g,p]=c.useState(null),N=Re.useDataScope(e.bind);c.useEffect(()=>{let b=!0;return(async()=>{if(!(!n||!e.objectName))try{const x=await n.getObjectSchema(e.objectName);b&&u(x)}catch(x){console.warn("Failed to fetch object def",x)}})(),()=>{b=!1}},[e.objectName,n]),c.useEffect(()=>{let b=!0;const E=async()=>{if(!(!n||!e.objectName)){b&&f(!0);try{const x=await n.find(e.objectName,{options:{$top:100},$filter:e.filter});let O=[];Array.isArray(x)?O=x:x&&typeof x=="object"&&(Array.isArray(x.value)?O=x.value:Array.isArray(x.data)&&(O=x.data)),console.log(`[ObjectKanban] Extracted data (length: ${O.length})`),b&&o(O)}catch(x){console.error("[ObjectKanban] Fetch error:",x),b&&p(x)}finally{b&&f(!1)}}};return e.objectName&&!N&&!e.data&&!i.data&&E(),()=>{b=!1}},[e.objectName,n,N,e.data,e.filter,i.data]);const w=i.data||N||e.data||a,y=c.useMemo(()=>{if(!Array.isArray(w))return[];let b=e.cardTitle||e.titleField;if(!b&&l){if(l.titleFormat){const x=/\{(.+?)\}/.exec(l.titleFormat);x&&(b=x[1])}!b&&l.NAME_FIELD_KEY&&(b=l.NAME_FIELD_KEY)}const E=b||"name";return w.map(x=>({...x,id:x.id||x._id,title:x[E]||x.title||"Untitled"}))},[w,e,l]),D=c.useMemo(()=>{if(e.columns&&e.columns.length>0)if(typeof e.columns[0]=="string"){if(!e.groupBy)return e.columns.map(b=>({id:b,title:b}))}else return e.columns;if(e.groupBy&&l?.fields?.[e.groupBy]?.options)return l.fields[e.groupBy].options.map(b=>({id:b.value,title:b.label}));if(e.groupBy&&y.length>0){const b=new Set(y.map(E=>E[e.groupBy]));return Array.from(b).map(E=>({id:String(E),title:String(E)}))}return[]},[e.columns,e.groupBy,y,l]),v={...e,data:y,columns:D,className:t||e.className},C=Re.useNavigationOverlay({navigation:e.navigation,objectName:e.objectName,onRowClick:r??s});if(g)return m.jsxs("div",{className:"p-4 border border-destructive/50 rounded bg-destructive/10 text-destructive",children:["Error loading kanban data: ",g.message]});const S=e.objectName?`${e.objectName.charAt(0).toUpperCase()+e.objectName.slice(1).replace(/_/g," ")} Detail`:"Card Details";return m.jsxs(m.Fragment,{children:[m.jsx(et,{schema:{...v,onCardClick:b=>{C.handleClick(b),s?.(b)}}}),C.isOverlay&&m.jsx($.NavigationOverlay,{...C,title:S,children:b=>m.jsx("div",{className:"space-y-3",children:Object.entries(b).map(([E,x])=>m.jsxs("div",{className:"flex flex-col",children:[m.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:E.replace(/_/g," ")}),m.jsx("span",{className:"text-sm",children:String(x??"—")})]},E))})})]})},ar=c.lazy(()=>Promise.resolve().then(()=>Js)),Yt=c.lazy(()=>Promise.resolve().then(()=>yi)),et=({schema:e})=>{const n=c.useMemo(()=>{const{columns:t=[],data:r,groupBy:s}=e;if(r&&s&&Array.isArray(r)){const i={};t.forEach(o=>{o.id&&(i[String(o.id).toLowerCase()]=o.id),o.title&&(i[String(o.title).toLowerCase()]=o.id)});const a=r.reduce((o,l)=>{const u=String(l[s]??""),d=i[u.toLowerCase()]??u;return o[d]||(o[d]=[]),o[d].push(l),o},{});return t.map(o=>({...o,cards:[...o.cards||[],...a[o.id]||[]]}))}return t},[e]);return m.jsx(c.Suspense,{fallback:m.jsx($.Skeleton,{className:"w-full h-[600px]"}),children:m.jsx(ar,{columns:n,onCardMove:e.onCardMove,onCardClick:e.onCardClick,className:e.className})})};Ze.ComponentRegistry.register("kanban-ui",et,{namespace:"plugin-kanban",label:"Kanban Board",icon:"LayoutDashboard",category:"plugin",inputs:[{name:"columns",type:"array",label:"Columns",description:"Array of { id, title, cards, limit, className }",required:!0},{name:"onCardMove",type:"code",label:"On Card Move",description:"Callback when a card is moved",advanced:!0},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{columns:[{id:"todo",title:"To Do",cards:[{id:"card-1",title:"Task 1",description:"This is the first task",badges:[{label:"High Priority",variant:"destructive"},{label:"Feature",variant:"default"}]},{id:"card-2",title:"Task 2",description:"This is the second task",badges:[{label:"Bug",variant:"destructive"}]}]},{id:"in-progress",title:"In Progress",limit:3,cards:[{id:"card-3",title:"Task 3",description:"Currently working on this",badges:[{label:"In Progress",variant:"default"}]}]},{id:"done",title:"Done",cards:[{id:"card-4",title:"Task 4",description:"This task is completed",badges:[{label:"Completed",variant:"outline"}]},{id:"card-5",title:"Task 5",description:"Another completed task",badges:[{label:"Completed",variant:"outline"}]}]}],className:"w-full"}});const lr={kanban:et,"kanban-enhanced":Yt,"object-kanban":xt};Ze.ComponentRegistry.register("kanban-enhanced",({schema:e})=>{const n=c.useMemo(()=>{const{columns:t=[],data:r,groupBy:s}=e;if(r&&s&&Array.isArray(r)){const i=r.reduce((a,o)=>{const l=o[s];return a[l]||(a[l]=[]),a[l].push(o),a},{});return t.map(a=>({...a,cards:[...a.cards||[],...i[a.id]||[]]}))}return t},[e]);return m.jsx(c.Suspense,{fallback:m.jsx($.Skeleton,{className:"w-full h-[600px]"}),children:m.jsx(Yt,{columns:n,onCardMove:e.onCardMove,onColumnToggle:e.onColumnToggle,enableVirtualScrolling:e.enableVirtualScrolling,virtualScrollThreshold:e.virtualScrollThreshold,className:e.className})})},{namespace:"plugin-kanban",label:"Kanban Board (Enhanced)",icon:"LayoutGrid",category:"plugin",inputs:[{name:"columns",type:"array",label:"Columns",required:!0},{name:"enableVirtualScrolling",type:"boolean",label:"Virtual Scrolling",defaultValue:!1},{name:"virtualScrollThreshold",type:"number",label:"Virtual Scroll Threshold",defaultValue:50},{name:"onCardMove",type:"code",label:"On Card Move",advanced:!0},{name:"onColumnToggle",type:"code",label:"On Column Toggle",advanced:!0},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{columns:[],enableVirtualScrolling:!1,virtualScrollThreshold:50,className:"w-full"}});const wt=({schema:e,...n})=>{const{dataSource:t}=Re.useSchemaContext()||{};return m.jsx(xt,{schema:e,dataSource:t,...n})};Ze.ComponentRegistry.register("object-kanban",wt,{namespace:"plugin-kanban",label:"Object Kanban",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"columns",type:"array",label:"Columns"}]}),Ze.ComponentRegistry.register("kanban",wt,{namespace:"view",label:"Kanban Board",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"columns",type:"array",label:"Columns"}]});function cr(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return c.useMemo(()=>r=>{n.forEach(s=>s(r))},n)}const tt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ee(e){const n=Object.prototype.toString.call(e);return n==="[object Window]"||n==="[object global]"}function Ct(e){return"nodeType"in e}function X(e){var n,t;return e?Ee(e)?e:Ct(e)&&(n=(t=e.ownerDocument)==null?void 0:t.defaultView)!=null?n:window:window}function St(e){const{Document:n}=X(e);return e instanceof n}function Pe(e){return Ee(e)?!1:e instanceof X(e).HTMLElement}function Ut(e){return e instanceof X(e).SVGElement}function De(e){return e?Ee(e)?e.document:Ct(e)?St(e)?e:Pe(e)||Ut(e)?e.ownerDocument:document:document:document}const oe=tt?c.useLayoutEffect:c.useEffect;function nt(e){const n=c.useRef(e);return oe(()=>{n.current=e}),c.useCallback(function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];return n.current==null?void 0:n.current(...r)},[])}function ur(){const e=c.useRef(null),n=c.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),t=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[n,t]}function Fe(e,n){n===void 0&&(n=[e]);const t=c.useRef(e);return oe(()=>{t.current!==e&&(t.current=e)},n),t}function $e(e,n){const t=c.useRef();return c.useMemo(()=>{const r=e(t.current);return t.current=r,r},[...n])}function rt(e){const n=nt(e),t=c.useRef(null),r=c.useCallback(s=>{s!==t.current&&n?.(s,t.current),t.current=s},[]);return[t,r]}function st(e){const n=c.useRef();return c.useEffect(()=>{n.current=e},[e]),n.current}let Et={};function Be(e,n){return c.useMemo(()=>{if(n)return n;const t=Et[e]==null?0:Et[e]+1;return Et[e]=t,e+"-"+t},[e,n])}function qt(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return r.reduce((i,a)=>{const o=Object.entries(a);for(const[l,u]of o){const d=i[l];d!=null&&(i[l]=d+e*u)}return i},{...n})}}const Oe=qt(1),it=qt(-1);function dr(e){return"clientX"in e&&"clientY"in e}function ot(e){if(!e)return!1;const{KeyboardEvent:n}=X(e.target);return n&&e instanceof n}function fr(e){if(!e)return!1;const{TouchEvent:n}=X(e.target);return n&&e instanceof n}function at(e){if(fr(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:t}=e.touches[0];return{x:n,y:t}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:t}=e.changedTouches[0];return{x:n,y:t}}}return dr(e)?{x:e.clientX,y:e.clientY}:null}const fe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:n,y:t}=e;return"translate3d("+(n?Math.round(n):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:n,scaleY:t}=e;return"scaleX("+n+") scaleY("+t+")"}},Transform:{toString(e){if(e)return[fe.Translate.toString(e),fe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:t,easing:r}=e;return n+" "+t+"ms "+r}}}),Xt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function hr(e){return e.matches(Xt)?e:e.querySelector(Xt)}const gr={display:"none"};function pr(e){let{id:n,value:t}=e;return c.createElement("div",{id:n,style:gr},t)}function mr(e){let{id:n,announcement:t,ariaLiveType:r="assertive"}=e;const s={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:n,style:s,role:"status","aria-live":r,"aria-atomic":!0},t)}function vr(){const[e,n]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&n(r)},[]),announcement:e}}const Ht=c.createContext(null);function br(e){const n=c.useContext(Ht);c.useEffect(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(e)},[e,n])}function yr(){const[e]=c.useState(()=>new Set),n=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:s,event:i}=r;e.forEach(a=>{var o;return(o=a[s])==null?void 0:o.call(a,i)})},[e]),n]}const xr={draggable:`
6
+ <%s key={someKey} {...props} />`,L,W,ee,W),ce[W+L]=!0)}if(W=null,z!==void 0&&(t(z),W=""+z),i(N)&&(t(N.key),W=""+N.key),"key"in N){z={};for(var te in N)te!=="key"&&(z[te]=N[te])}else z=N;return W&&a(z,typeof m=="function"?m.displayName||m.name||"Unknown":m),c(m,W,z,s(),ue,G)}function f(m){h(m)?m._store&&(m._store.validated=1):typeof m=="object"&&m!==null&&m.$$typeof===I&&(m._payload.status==="fulfilled"?h(m._payload.value)&&m._payload.value._store&&(m._payload.value._store.validated=1):m._store&&(m._store.validated=1))}function h(m){return typeof m=="object"&&m!==null&&m.$$typeof===E}var p=u,E=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),j=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),A=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),C=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),D=Symbol.for("react.client.reference"),O=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,V=Array.isArray,P=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(m){return m()}};var K,$={},q=p.react_stack_bottom_frame.bind(p,o)(),Y=P(r(o)),ce={};Fe.Fragment=v,Fe.jsx=function(m,N,z){var L=1e4>O.recentlyCreatedOwnerStacks++;return d(m,N,z,!1,L?Error("react-stack-top-frame"):q,L?P(r(m)):Y)},Fe.jsxs=function(m,N,z){var L=1e4>O.recentlyCreatedOwnerStacks++;return d(m,N,z,!0,L?Error("react-stack-top-frame"):q,L?P(r(m)):Y)}})()),Fe}var Jt;function ur(){return Jt||(Jt=1,process.env.NODE_ENV==="production"?et.exports=lr():et.exports=cr()),et.exports}var g=ur();const St=({schema:e,dataSource:n,className:t,onRowClick:r,onCardClick:s,...o})=>{const[i,a]=u.useState([]),[l,c]=u.useState(null),[d,f]=u.useState(!1),[h,p]=u.useState(null),E=Re.useDataScope(e.bind);u.useEffect(()=>{let x=!0;return(async()=>{if(!(!n||!e.objectName))try{const y=await n.getObjectSchema(e.objectName);x&&c(y)}catch(y){console.warn("Failed to fetch object def",y)}})(),()=>{x=!1}},[e.objectName,n]),u.useEffect(()=>{let x=!0;const C=async()=>{if(!(!n||typeof n.find!="function"||!e.objectName)){x&&f(!0);try{const y=Ee.buildExpandFields(l?.fields),I=await n.find(e.objectName,{options:{$top:100},$filter:e.filter,...y.length>0?{$expand:y}:{}}),w=Ee.extractRecords(I);console.log(`[ObjectKanban] Extracted data (length: ${w.length})`),x&&a(w)}catch(y){console.error("[ObjectKanban] Fetch error:",y),x&&p(y)}finally{x&&f(!1)}}};return e.objectName&&!E&&!e.data&&!o.data&&C(),()=>{x=!1}},[e.objectName,n,E,e.data,e.filter,o.data,l]);const b=o.data||E||e.data||i,v=u.useMemo(()=>{if(!Array.isArray(b))return[];let x=e.cardTitle||e.titleField;if(!x&&l){if(l.titleFormat){const y=/\{(.+?)\}/.exec(l.titleFormat);y&&(x=y[1])}!x&&l.NAME_FIELD_KEY&&(x=l.NAME_FIELD_KEY)}const C=["name","title","subject","label","display_name"];return b.map(y=>{let I=x?y[x]:void 0;if(!I){for(const w of C)if(y[w]){I=y[w];break}}return{...y,id:y.id||y._id,title:I||"Untitled"}})},[b,e,l]),k=u.useMemo(()=>{if(e.columns&&e.columns.length>0)if(typeof e.columns[0]=="string"){if(!e.groupBy)return e.columns.map(x=>({id:x,title:x}))}else return e.columns;if(e.groupBy&&l?.fields?.[e.groupBy]?.options)return l.fields[e.groupBy].options.map(x=>({id:x.value,title:x.label}));if(e.groupBy&&v.length>0){const x=new Set(v.map(C=>C[e.groupBy]));return Array.from(x).map(C=>({id:String(C),title:String(C)}))}return[]},[e.columns,e.groupBy,v,l]),j=e.swimlaneField||e.grouping?.fields?.[0]?.field,T={...e,data:v,columns:k,className:t||e.className,...j?{swimlaneField:j}:{}},A=Re.useNavigationOverlay({navigation:e.navigation,objectName:e.objectName,onRowClick:r??s});if(h)return g.jsxs("div",{className:"p-4 border border-destructive/50 rounded bg-destructive/10 text-destructive",children:["Error loading kanban data: ",h.message]});const S=e.objectName?`${e.objectName.charAt(0).toUpperCase()+e.objectName.slice(1).replace(/_/g," ")} Detail`:"Card Details";return g.jsxs(g.Fragment,{children:[g.jsx(nt,{schema:{...T,onCardClick:x=>{A.handleClick(x),s?.(x)}}}),A.isOverlay&&g.jsx(F.NavigationOverlay,{...A,title:S,children:x=>g.jsx("div",{className:"space-y-3",children:Object.entries(x).map(([C,y])=>g.jsxs("div",{className:"flex flex-col",children:[g.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:C.replace(/_/g," ")}),g.jsx("span",{className:"text-sm",children:String(y??"—")})]},C))})})]})};const Gt=(...e)=>e.filter((n,t,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===t).join(" ").trim();const dr=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const fr=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase());const Qt=e=>{const n=fr(e);return n.charAt(0).toUpperCase()+n.slice(1)};var hr={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 gr=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const mr=u.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:i,...a},l)=>u.createElement("svg",{ref:l,...hr,width:n,height:n,stroke:e,strokeWidth:r?Number(t)*24/Number(n):t,className:Gt("lucide",s),...!o&&!gr(a)&&{"aria-hidden":"true"},...a},[...i.map(([c,d])=>u.createElement(c,d)),...Array.isArray(o)?o:[o]]));const Se=(e,n)=>{const t=u.forwardRef(({className:r,...s},o)=>u.createElement(mr,{ref:o,iconNode:n,className:Gt(`lucide-${dr(Qt(e))}`,`lucide-${e}`,r),...s}));return t.displayName=Qt(e),t};const pr=Se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Zt=Se("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const vr=Se("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const br=Se("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const tt=Se("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const xr=Se("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const yr=Se("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),wr=(...e)=>e.filter(Boolean).join(" "),Cr=({columnId:e,fields:n,onSubmit:t,onCancel:r,defaultValues:s})=>{const[o,i]=_.useState(()=>{const f={};for(const h of n)f[h.name]=s?.[h.name]??h.defaultValue??"";return f}),a=_.useRef(null);_.useEffect(()=>{const f=setTimeout(()=>a.current?.focus(),0);return()=>clearTimeout(f)},[]);const l=_.useCallback((f,h)=>{i(p=>({...p,[f]:h}))},[]),c=_.useCallback(()=>{Object.values(o).some(h=>typeof h=="string"?h.trim().length>0:h!=null)&&t(e,o)},[e,o,t]),d=_.useCallback(f=>{f.key==="Enter"?(f.preventDefault(),c()):f.key==="Escape"&&(f.preventDefault(),r())},[c,r]);return g.jsxs("div",{className:"mt-2 rounded-lg border border-primary/30 bg-card p-3 space-y-2 shadow-sm",onKeyDown:d,role:"form","aria-label":"Quick add card",children:[n.map((f,h)=>g.jsxs("div",{className:"space-y-1",children:[g.jsx("label",{htmlFor:`qa-${e}-${f.name}`,className:"text-xs font-mono text-muted-foreground",children:f.label??f.name}),Sr(f,o[f.name],l,h===0?a:void 0,`qa-${e}-${f.name}`)]},f.name)),g.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[g.jsxs(F.Button,{type:"button",size:"sm",className:"h-7 text-xs gap-1",onClick:c,children:[g.jsx(pr,{className:"h-3 w-3"}),"Save"]}),g.jsxs(F.Button,{type:"button",variant:"ghost",size:"sm",className:"h-7 text-xs gap-1",onClick:r,children:[g.jsx(yr,{className:"h-3 w-3"}),"Cancel"]})]})]})};function Sr(e,n,t,r,s){const o="text-sm h-8";switch(e.type){case"select":return g.jsxs("select",{ref:r,id:s,value:n??"",onChange:i=>t(e.name,i.target.value),className:wr(o,"w-full rounded-md border border-input bg-background px-2 py-1 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),children:[g.jsx("option",{value:"",children:e.placeholder??`Select ${e.label??e.name}...`}),(e.options??[]).map(i=>g.jsx("option",{value:i.value,children:i.label},i.value))]});case"number":return g.jsx(F.Input,{ref:r,id:s,type:"number",value:n??"",onChange:i=>t(e.name,i.target.value===""?"":Number(i.target.value)),placeholder:e.placeholder??`Enter ${e.label??e.name}...`,className:o});default:return g.jsx(F.Input,{ref:r,id:s,type:"text",value:n??"",onChange:i=>t(e.name,i.target.value),placeholder:e.placeholder??`Enter ${e.label??e.name}...`,className:o})}}const Er=(...e)=>e.filter(Boolean).join(" "),Nr=({templates:e,onSelect:n,columnId:t})=>{const[r,s]=_.useState(!1),o=_.useRef(null);_.useEffect(()=>{if(!r)return;const a=l=>{o.current&&!o.current.contains(l.target)&&s(!1)};return document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)},[r]);const i=_.useCallback(a=>{a.key==="Escape"&&s(!1)},[]);return g.jsxs("div",{ref:o,className:"relative",onKeyDown:i,children:[g.jsxs(F.Button,{variant:"ghost",size:"sm",className:"w-full mt-2 text-muted-foreground hover:text-foreground gap-1",onClick:()=>s(a=>!a),"aria-haspopup":"listbox","aria-expanded":r,"aria-label":`Add card to ${t}`,children:[g.jsx(tt,{className:"h-4 w-4"}),"Add Card",g.jsx(Zt,{className:Er("h-3 w-3 transition-transform",r?"rotate-180":"")})]}),r&&g.jsxs("div",{className:"absolute z-50 mt-1 w-full rounded-md border border-border bg-popover p-1 shadow-md",role:"listbox","aria-label":"Card templates",children:[g.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground transition-colors",role:"option","aria-selected":!1,onClick:()=>{n(null),s(!1)},children:[g.jsx(tt,{className:"h-4 w-4 text-muted-foreground"}),g.jsx("span",{className:"font-mono text-xs",children:"Custom"})]}),e.length>0&&g.jsx("div",{className:"my-1 h-px bg-border",role:"separator"}),e.map(a=>g.jsxs("button",{type:"button",className:"flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground transition-colors",role:"option","aria-selected":!1,onClick:()=>{n(a),s(!1)},children:[g.jsx(br,{className:"h-4 w-4 text-muted-foreground"}),g.jsx("span",{className:"font-mono text-xs truncate",children:a.name})]},a.id))]})]})},en="objectui:kanban-column-widths";function Dr(e){try{const n=localStorage.getItem(e);if(n){const t=JSON.parse(n);if(t&&typeof t=="object"&&!Array.isArray(t))return t}}catch{}return{}}function jr(e,n){try{localStorage.setItem(e,JSON.stringify(n))}catch{}}function kr({columns:e,defaultWidth:n=320,minWidth:t=200,maxWidth:r=600,storageKey:s}){const o=s?`${en}:${s}`:en,[i,a]=u.useState(()=>Dr(o)),l=u.useCallback(p=>Math.max(t,Math.min(r,p)),[t,r]),c=u.useCallback(p=>{const E=i[p];return E!=null?l(E):n},[i,n,l]),d=u.useCallback((p,E)=>{const b=l(E);a(v=>{const k={...v,[p]:b};return jr(o,k),k})},[l,o]),f=u.useCallback(()=>{a({});try{localStorage.removeItem(o)}catch{}},[o]),h=u.useMemo(()=>({defaultWidth:n,minWidth:t,maxWidth:r,overrides:{...i}}),[n,t,r,i]);return{getColumnWidth:c,setColumnWidth:d,resetWidths:f,config:h}}function Or({swimlanes:e,onCardMove:n}){const[t,r]=u.useState(null),s=u.useMemo(()=>{const d=new Map;for(const f of e)d.set(f.id,f);return d},[e]),o=u.useCallback((d,f)=>{if(d===f)return!0;const h=s.get(f);return h?h.acceptFrom?h.acceptFrom.includes(d):!0:!1},[s]),i=u.useCallback((d,f,h,p)=>o(f,h)?(n?.({cardId:d,fromSwimlane:f,toSwimlane:h,columnId:p}),r(null),!0):!1,[o,n]),a=u.useCallback(d=>{r(d)},[]),l=u.useCallback(()=>{r(null)},[]);return{handleCrossSwimlaneMove:i,isDraggingAcrossSwimlanes:t!==null,startCrossSwimlaneDrag:a,endCrossSwimlaneDrag:l,canMoveTo:o}}function Ar({cards:e,onReorderComplete:n}){const[t,r]=u.useState(e),[s,o]=u.useState(!1);!Tr(t,e)&&!s&&r(e);const i=u.useCallback(()=>{r(e),o(!1)},[e]),a=u.useCallback((d,f)=>{r(h=>{if(d<0||f<0||d>=h.length||f>=h.length)return h;const p=[...h],[E]=p.splice(d,1);return p.splice(f,0,E),p})},[]),l=u.useCallback(()=>{o(!0)},[]),c=u.useCallback(()=>{o(!1),r(d=>(n?.(d),d))},[n]);return{reorderedCards:t,onReorder:a,isDragging:s,startDrag:l,endDrag:c,reset:i}}function Tr(e,n){if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t].id!==n[t].id)return!1;return!0}const Ir=u.lazy(()=>Promise.resolve().then(()=>Eo)),tn=u.lazy(()=>Promise.resolve().then(()=>Bo)),nt=({schema:e})=>{const n=u.useMemo(()=>{const{columns:t=[],data:r,groupBy:s,coverImageField:o}=e,i=a=>{if(!o)return a;const l=a[o];if(!l)return a;const c=typeof l=="string"?l:l?.url;return c?{...a,coverImage:c}:a};if(r&&s&&Array.isArray(r)){const a={};t.forEach(c=>{c.id&&(a[String(c.id).toLowerCase()]=c.id),c.title&&(a[String(c.title).toLowerCase()]=c.id)});const l=r.reduce((c,d)=>{const f=String(d[s]??""),h=a[f.toLowerCase()]??f;return c[h]||(c[h]=[]),c[h].push(i(d)),c},{});return t.map(c=>({...c,cards:[...(c.cards||[]).map(i),...l[c.id]||[]]}))}return t.map(a=>({...a,cards:(a.cards||[]).map(i)}))},[e]);return g.jsx(u.Suspense,{fallback:g.jsx(F.Skeleton,{className:"w-full h-[600px]"}),children:g.jsx(Ir,{columns:n,onCardMove:e.onCardMove,onCardClick:e.onCardClick,className:e.className,quickAdd:e.quickAdd,onQuickAdd:e.onQuickAdd,coverImageField:e.coverImageField,conditionalFormatting:e.conditionalFormatting,swimlaneField:e.swimlaneField})})};Ee.ComponentRegistry.register("kanban-ui",nt,{namespace:"plugin-kanban",label:"Kanban Board",icon:"LayoutDashboard",category:"plugin",inputs:[{name:"columns",type:"array",label:"Columns",description:"Array of { id, title, cards, limit, className }",required:!0},{name:"onCardMove",type:"code",label:"On Card Move",description:"Callback when a card is moved",advanced:!0},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{columns:[{id:"todo",title:"To Do",cards:[{id:"card-1",title:"Task 1",description:"This is the first task",badges:[{label:"High Priority",variant:"destructive"},{label:"Feature",variant:"default"}]},{id:"card-2",title:"Task 2",description:"This is the second task",badges:[{label:"Bug",variant:"destructive"}]}]},{id:"in-progress",title:"In Progress",limit:3,cards:[{id:"card-3",title:"Task 3",description:"Currently working on this",badges:[{label:"In Progress",variant:"default"}]}]},{id:"done",title:"Done",cards:[{id:"card-4",title:"Task 4",description:"This task is completed",badges:[{label:"Completed",variant:"outline"}]},{id:"card-5",title:"Task 5",description:"Another completed task",badges:[{label:"Completed",variant:"outline"}]}]}],className:"w-full"}});const Mr={kanban:nt,"kanban-enhanced":tn,"object-kanban":St};Ee.ComponentRegistry.register("kanban-enhanced",({schema:e})=>{const n=u.useMemo(()=>{const{columns:t=[],data:r,groupBy:s}=e;if(r&&s&&Array.isArray(r)){const o=r.reduce((i,a)=>{const l=a[s];return i[l]||(i[l]=[]),i[l].push(a),i},{});return t.map(i=>({...i,cards:[...i.cards||[],...o[i.id]||[]]}))}return t},[e]);return g.jsx(u.Suspense,{fallback:g.jsx(F.Skeleton,{className:"w-full h-[600px]"}),children:g.jsx(tn,{columns:n,onCardMove:e.onCardMove,onColumnToggle:e.onColumnToggle,enableVirtualScrolling:e.enableVirtualScrolling,virtualScrollThreshold:e.virtualScrollThreshold,className:e.className,quickAdd:e.quickAdd,onQuickAdd:e.onQuickAdd,conditionalFormatting:e.conditionalFormatting})})},{namespace:"plugin-kanban",label:"Kanban Board (Enhanced)",icon:"LayoutGrid",category:"plugin",inputs:[{name:"columns",type:"array",label:"Columns",required:!0},{name:"enableVirtualScrolling",type:"boolean",label:"Virtual Scrolling",defaultValue:!1},{name:"virtualScrollThreshold",type:"number",label:"Virtual Scroll Threshold",defaultValue:50},{name:"onCardMove",type:"code",label:"On Card Move",advanced:!0},{name:"onColumnToggle",type:"code",label:"On Column Toggle",advanced:!0},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{columns:[],enableVirtualScrolling:!1,virtualScrollThreshold:50,className:"w-full"}});const Et=({schema:e,...n})=>{const{dataSource:t}=Re.useSchemaContext()||{};return g.jsx(St,{schema:e,dataSource:t,...n})};Ee.ComponentRegistry.register("object-kanban",Et,{namespace:"plugin-kanban",label:"Object Kanban",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"columns",type:"array",label:"Columns"}]}),Ee.ComponentRegistry.register("kanban",Et,{namespace:"view",label:"Kanban Board",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"columns",type:"array",label:"Columns"}]});function _r(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return u.useMemo(()=>r=>{n.forEach(s=>s(r))},n)}const rt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function De(e){const n=Object.prototype.toString.call(e);return n==="[object Window]"||n==="[object global]"}function Nt(e){return"nodeType"in e}function Z(e){var n,t;return e?De(e)?e:Nt(e)&&(n=(t=e.ownerDocument)==null?void 0:t.defaultView)!=null?n:window:window}function Dt(e){const{Document:n}=Z(e);return e instanceof n}function $e(e){return De(e)?!1:e instanceof Z(e).HTMLElement}function nn(e){return e instanceof Z(e).SVGElement}function je(e){return e?De(e)?e.document:Nt(e)?Dt(e)?e:$e(e)||nn(e)?e.ownerDocument:document:document:document}const ae=rt?u.useLayoutEffect:u.useEffect;function st(e){const n=u.useRef(e);return ae(()=>{n.current=e}),u.useCallback(function(){for(var t=arguments.length,r=new Array(t),s=0;s<t;s++)r[s]=arguments[s];return n.current==null?void 0:n.current(...r)},[])}function zr(){const e=u.useRef(null),n=u.useCallback((r,s)=>{e.current=setInterval(r,s)},[]),t=u.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[n,t]}function Be(e,n){n===void 0&&(n=[e]);const t=u.useRef(e);return ae(()=>{t.current!==e&&(t.current=e)},n),t}function Ve(e,n){const t=u.useRef();return u.useMemo(()=>{const r=e(t.current);return t.current=r,r},[...n])}function ot(e){const n=st(e),t=u.useRef(null),r=u.useCallback(s=>{s!==t.current&&n?.(s,t.current),t.current=s},[]);return[t,r]}function it(e){const n=u.useRef();return u.useEffect(()=>{n.current=e},[e]),n.current}let jt={};function Ke(e,n){return u.useMemo(()=>{if(n)return n;const t=jt[e]==null?0:jt[e]+1;return jt[e]=t,e+"-"+t},[e,n])}function rn(e){return function(n){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s<t;s++)r[s-1]=arguments[s];return r.reduce((o,i)=>{const a=Object.entries(i);for(const[l,c]of a){const d=o[l];d!=null&&(o[l]=d+e*c)}return o},{...n})}}const ke=rn(1),at=rn(-1);function Lr(e){return"clientX"in e&&"clientY"in e}function lt(e){if(!e)return!1;const{KeyboardEvent:n}=Z(e.target);return n&&e instanceof n}function Rr(e){if(!e)return!1;const{TouchEvent:n}=Z(e.target);return n&&e instanceof n}function ct(e){if(Rr(e)){if(e.touches&&e.touches.length){const{clientX:n,clientY:t}=e.touches[0];return{x:n,y:t}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:n,clientY:t}=e.changedTouches[0];return{x:n,y:t}}}return Lr(e)?{x:e.clientX,y:e.clientY}:null}const ge=Object.freeze({Translate:{toString(e){if(!e)return;const{x:n,y:t}=e;return"translate3d("+(n?Math.round(n):0)+"px, "+(t?Math.round(t):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:n,scaleY:t}=e;return"scaleX("+n+") scaleY("+t+")"}},Transform:{toString(e){if(e)return[ge.Translate.toString(e),ge.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:n,duration:t,easing:r}=e;return n+" "+t+"ms "+r}}}),sn="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Pr(e){return e.matches(sn)?e:e.querySelector(sn)}const Fr={display:"none"};function $r(e){let{id:n,value:t}=e;return u.createElement("div",{id:n,style:Fr},t)}function Br(e){let{id:n,announcement:t,ariaLiveType:r="assertive"}=e;const s={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 u.createElement("div",{id:n,style:s,role:"status","aria-live":r,"aria-atomic":!0},t)}function Vr(){const[e,n]=u.useState("");return{announce:u.useCallback(r=>{r!=null&&n(r)},[]),announcement:e}}const on=u.createContext(null);function Kr(e){const n=u.useContext(on);u.useEffect(()=>{if(!n)throw new Error("useDndMonitor must be used within a children of <DndContext>");return n(e)},[e,n])}function Wr(){const[e]=u.useState(()=>new Set),n=u.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[u.useCallback(r=>{let{type:s,event:o}=r;e.forEach(i=>{var a;return(a=i[s])==null?void 0:a.call(i,o)})},[e]),n]}const Yr={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
- `},wr={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was moved over droppable area "+t.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was dropped over droppable area "+t.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function Cr(e){let{announcements:n=wr,container:t,hiddenTextDescribedById:r,screenReaderInstructions:s=xr}=e;const{announce:i,announcement:a}=vr(),o=Be("DndLiveRegion"),[l,u]=c.useState(!1);if(c.useEffect(()=>{u(!0)},[]),br(c.useMemo(()=>({onDragStart(f){let{active:g}=f;i(n.onDragStart({active:g}))},onDragMove(f){let{active:g,over:p}=f;n.onDragMove&&i(n.onDragMove({active:g,over:p}))},onDragOver(f){let{active:g,over:p}=f;i(n.onDragOver({active:g,over:p}))},onDragEnd(f){let{active:g,over:p}=f;i(n.onDragEnd({active:g,over:p}))},onDragCancel(f){let{active:g,over:p}=f;i(n.onDragCancel({active:g,over:p}))}}),[i,n])),!l)return null;const d=c.createElement(c.Fragment,null,c.createElement(pr,{id:r,value:s.draggable}),c.createElement(mr,{id:o,announcement:a}));return t?Se.createPortal(d,t):d}var W;(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"})(W||(W={}));function lt(){}function Dt(e,n){return c.useMemo(()=>({sensor:e,options:n??{}}),[e,n])}function Jt(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return c.useMemo(()=>[...n].filter(r=>r!=null),[...n])}const ae=Object.freeze({x:0,y:0});function Sr(e,n){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Er(e,n){const t=at(e);if(!t)return"0 0";const r={x:(t.x-n.left)/n.width*100,y:(t.y-n.top)/n.height*100};return r.x+"% "+r.y+"%"}function Dr(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return t-r}function Or(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return r-t}function Gt(e){let{left:n,top:t,height:r,width:s}=e;return[{x:n,y:t},{x:n+s,y:t},{x:n,y:t+r},{x:n+s,y:t+r}]}function Nr(e,n){if(!e||e.length===0)return null;const[t]=e;return t[n]}const Zt=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const s=Gt(n),i=[];for(const a of r){const{id:o}=a,l=t.get(o);if(l){const u=Gt(l),d=s.reduce((g,p,N)=>g+Sr(u[N],p),0),f=Number((d/4).toFixed(4));i.push({id:o,data:{droppableContainer:a,value:f}})}}return i.sort(Dr)};function Tr(e,n){const t=Math.max(n.top,e.top),r=Math.max(n.left,e.left),s=Math.min(n.left+n.width,e.left+e.width),i=Math.min(n.top+n.height,e.top+e.height),a=s-r,o=i-t;if(r<s&&t<i){const l=n.width*n.height,u=e.width*e.height,d=a*o,f=d/(l+u-d);return Number(f.toFixed(4))}return 0}const jr=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const s=[];for(const i of r){const{id:a}=i,o=t.get(a);if(o){const l=Tr(o,n);l>0&&s.push({id:a,data:{droppableContainer:i,value:l}})}}return s.sort(Or)};function Ar(e,n,t){return{...e,scaleX:n&&t?n.width/t.width:1,scaleY:n&&t?n.height/t.height:1}}function Qt(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:ae}function Mr(e){return function(t){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((a,o)=>({...a,top:a.top+e*o.y,bottom:a.bottom+e*o.y,left:a.left+e*o.x,right:a.right+e*o.x}),{...t})}}const Ir=Mr(1);function en(e){if(e.startsWith("matrix3d(")){const n=e.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(e.startsWith("matrix(")){const n=e.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function kr(e,n,t){const r=en(n);if(!r)return e;const{scaleX:s,scaleY:i,x:a,y:o}=r,l=e.left-a-(1-s)*parseFloat(t),u=e.top-o-(1-i)*parseFloat(t.slice(t.indexOf(" ")+1)),d=s?e.width/s:e.width,f=i?e.height/i:e.height;return{width:d,height:f,top:u,right:l+d,bottom:u+f,left:l}}const _r={ignoreTransform:!1};function Ne(e,n){n===void 0&&(n=_r);let t=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:u,transformOrigin:d}=X(e).getComputedStyle(e);u&&(t=kr(t,u,d))}const{top:r,left:s,width:i,height:a,bottom:o,right:l}=t;return{top:r,left:s,width:i,height:a,bottom:o,right:l}}function tn(e){return Ne(e,{ignoreTransform:!0})}function Rr(e){const n=e.innerWidth,t=e.innerHeight;return{top:0,left:0,right:n,bottom:t,width:n,height:t}}function zr(e,n){return n===void 0&&(n=X(e).getComputedStyle(e)),n.position==="fixed"}function Lr(e,n){n===void 0&&(n=X(e).getComputedStyle(e));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=n[s];return typeof i=="string"?t.test(i):!1})}function Ot(e,n){const t=[];function r(s){if(n!=null&&t.length>=n||!s)return t;if(St(s)&&s.scrollingElement!=null&&!t.includes(s.scrollingElement))return t.push(s.scrollingElement),t;if(!Pe(s)||Ut(s)||t.includes(s))return t;const i=X(e).getComputedStyle(s);return s!==e&&Lr(s,i)&&t.push(s),zr(s,i)?t:r(s.parentNode)}return e?r(e):t}function nn(e){const[n]=Ot(e,1);return n??null}function Nt(e){return!tt||!e?null:Ee(e)?e:Ct(e)?St(e)||e===De(e).scrollingElement?window:Pe(e)?e:null:null}function rn(e){return Ee(e)?e.scrollX:e.scrollLeft}function sn(e){return Ee(e)?e.scrollY:e.scrollTop}function Tt(e){return{x:rn(e),y:sn(e)}}var V;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(V||(V={}));function on(e){return!tt||!e?!1:e===document.scrollingElement}function an(e){const n={x:0,y:0},t=on(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-t.width,y:e.scrollHeight-t.height},s=e.scrollTop<=n.y,i=e.scrollLeft<=n.x,a=e.scrollTop>=r.y,o=e.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:a,isRight:o,maxScroll:r,minScroll:n}}const Pr={x:.2,y:.2};function Fr(e,n,t,r,s){let{top:i,left:a,right:o,bottom:l}=t;r===void 0&&(r=10),s===void 0&&(s=Pr);const{isTop:u,isBottom:d,isLeft:f,isRight:g}=an(e),p={x:0,y:0},N={x:0,y:0},w={height:n.height*s.y,width:n.width*s.x};return!u&&i<=n.top+w.height?(p.y=V.Backward,N.y=r*Math.abs((n.top+w.height-i)/w.height)):!d&&l>=n.bottom-w.height&&(p.y=V.Forward,N.y=r*Math.abs((n.bottom-w.height-l)/w.height)),!g&&o>=n.right-w.width?(p.x=V.Forward,N.x=r*Math.abs((n.right-w.width-o)/w.width)):!f&&a<=n.left+w.width&&(p.x=V.Backward,N.x=r*Math.abs((n.left+w.width-a)/w.width)),{direction:p,speed:N}}function $r(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}const{top:n,left:t,right:r,bottom:s}=e.getBoundingClientRect();return{top:n,left:t,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function ln(e){return e.reduce((n,t)=>Oe(n,Tt(t)),ae)}function Br(e){return e.reduce((n,t)=>n+rn(t),0)}function Wr(e){return e.reduce((n,t)=>n+sn(t),0)}function cn(e,n){if(n===void 0&&(n=Ne),!e)return;const{top:t,left:r,bottom:s,right:i}=n(e);nn(e)&&(s<=0||i<=0||t>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Vr=[["x",["left","right"],Br],["y",["top","bottom"],Wr]];class jt{constructor(n,t){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=Ot(t),s=ln(r);this.rect={...n},this.width=n.width,this.height=n.height;for(const[i,a,o]of Vr)for(const l of a)Object.defineProperty(this,l,{get:()=>{const u=o(r),d=s[i]-u;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class We{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(t=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...t)})},this.target=n}add(n,t,r){var s;(s=this.target)==null||s.addEventListener(n,t,r),this.listeners.push([n,t,r])}}function Kr(e){const{EventTarget:n}=X(e);return e instanceof n?e:De(e)}function At(e,n){const t=Math.abs(e.x),r=Math.abs(e.y);return typeof n=="number"?Math.sqrt(t**2+r**2)>n:"x"in n&&"y"in n?t>n.x&&r>n.y:"x"in n?t>n.x:"y"in n?r>n.y:!1}var re;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(re||(re={}));function un(e){e.preventDefault()}function Yr(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 dn={start:[k.Space,k.Enter],cancel:[k.Esc],end:[k.Space,k.Enter,k.Tab]},Ur=(e,n)=>{let{currentCoordinates:t}=n;switch(e.code){case k.Right:return{...t,x:t.x+25};case k.Left:return{...t,x:t.x-25};case k.Down:return{...t,y:t.y+25};case k.Up:return{...t,y:t.y-25}}};class fn{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:t}}=n;this.props=n,this.listeners=new We(De(t)),this.windowListeners=new We(X(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(re.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:n,onStart:t}=this.props,r=n.node.current;r&&cn(r),t(ae)}handleKeyDown(n){if(ot(n)){const{active:t,context:r,options:s}=this.props,{keyboardCodes:i=dn,coordinateGetter:a=Ur,scrollBehavior:o="smooth"}=s,{code:l}=n;if(i.end.includes(l)){this.handleEnd(n);return}if(i.cancel.includes(l)){this.handleCancel(n);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:ae;this.referenceCoordinates||(this.referenceCoordinates=d);const f=a(n,{active:t,context:r.current,currentCoordinates:d});if(f){const g=it(f,d),p={x:0,y:0},{scrollableAncestors:N}=r.current;for(const w of N){const y=n.code,{isTop:D,isRight:v,isLeft:C,isBottom:S,maxScroll:b,minScroll:E}=an(w),x=$r(w),O={x:Math.min(y===k.Right?x.right-x.width/2:x.right,Math.max(y===k.Right?x.left:x.left+x.width/2,f.x)),y:Math.min(y===k.Down?x.bottom-x.height/2:x.bottom,Math.max(y===k.Down?x.top:x.top+x.height/2,f.y))},A=y===k.Right&&!v||y===k.Left&&!C,M=y===k.Down&&!S||y===k.Up&&!D;if(A&&O.x!==f.x){const j=w.scrollLeft+g.x,L=y===k.Right&&j<=b.x||y===k.Left&&j>=E.x;if(L&&!g.y){w.scrollTo({left:j,behavior:o});return}L?p.x=w.scrollLeft-j:p.x=y===k.Right?w.scrollLeft-b.x:w.scrollLeft-E.x,p.x&&w.scrollBy({left:-p.x,behavior:o});break}else if(M&&O.y!==f.y){const j=w.scrollTop+g.y,L=y===k.Down&&j<=b.y||y===k.Up&&j>=E.y;if(L&&!g.x){w.scrollTo({top:j,behavior:o});return}L?p.y=w.scrollTop-j:p.y=y===k.Down?w.scrollTop-b.y:w.scrollTop-E.y,p.y&&w.scrollBy({top:-p.y,behavior:o});break}}this.handleMove(n,Oe(it(f,this.referenceCoordinates),p))}}}handleMove(n,t){const{onMove:r}=this.props;n.preventDefault(),r(t)}handleEnd(n){const{onEnd:t}=this.props;n.preventDefault(),this.detach(),t()}handleCancel(n){const{onCancel:t}=this.props;n.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}fn.activators=[{eventName:"onKeyDown",handler:(e,n,t)=>{let{keyboardCodes:r=dn,onActivation:s}=n,{active:i}=t;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const o=i.activatorNode.current;return o&&e.target!==o?!1:(e.preventDefault(),s?.({event:e.nativeEvent}),!0)}return!1}}];function hn(e){return!!(e&&"distance"in e)}function gn(e){return!!(e&&"delay"in e)}class Mt{constructor(n,t,r){var s;r===void 0&&(r=Kr(n.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=n,this.events=t;const{event:i}=n,{target:a}=i;this.props=n,this.events=t,this.document=De(a),this.documentListeners=new We(this.document),this.listeners=new We(r),this.windowListeners=new We(X(a)),this.initialCoordinates=(s=at(i))!=null?s: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:n,props:{options:{activationConstraint:t,bypassActivationConstraint:r}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(re.Resize,this.handleCancel),this.windowListeners.add(re.DragStart,un),this.windowListeners.add(re.VisibilityChange,this.handleCancel),this.windowListeners.add(re.ContextMenu,un),this.documentListeners.add(re.Keydown,this.handleKeydown),t){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(gn(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(hn(t)){this.handlePending(t);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(n,t){const{active:r,onPending:s}=this.props;s(r,n,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:n}=this,{onStart:t}=this.props;n&&(this.activated=!0,this.documentListeners.add(re.Click,Yr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(re.SelectionChange,this.removeTextSelection),t(n))}handleMove(n){var t;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:a,options:{activationConstraint:o}}=i;if(!s)return;const l=(t=at(n))!=null?t:ae,u=it(s,l);if(!r&&o){if(hn(o)){if(o.tolerance!=null&&At(u,o.tolerance))return this.handleCancel();if(At(u,o.distance))return this.handleStart()}if(gn(o)&&At(u,o.tolerance))return this.handleCancel();this.handlePending(o,u);return}n.cancelable&&n.preventDefault(),a(l)}handleEnd(){const{onAbort:n,onEnd:t}=this.props;this.detach(),this.activated||n(this.props.active),t()}handleCancel(){const{onAbort:n,onCancel:t}=this.props;this.detach(),this.activated||n(this.props.active),t()}handleKeydown(n){n.code===k.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const qr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ct extends Mt{constructor(n){const{event:t}=n,r=De(t.target);super(n,qr,r)}}ct.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return!t.isPrimary||t.button!==0?!1:(r?.({event:t}),!0)}}];const Xr={move:{name:"mousemove"},end:{name:"mouseup"}};var It;(function(e){e[e.RightClick=2]="RightClick"})(It||(It={}));class Hr extends Mt{constructor(n){super(n,Xr,De(n.event.target))}}Hr.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return t.button===It.RightClick?!1:(r?.({event:t}),!0)}}];const kt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class pn extends Mt{constructor(n){super(n,kt)}static setup(){return window.addEventListener(kt.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(kt.move.name,n)};function n(){}}}pn.activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;const{touches:s}=t;return s.length>1?!1:(r?.({event:t}),!0)}}];var Ve;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ve||(Ve={}));var ut;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ut||(ut={}));function Jr(e){let{acceleration:n,activator:t=Ve.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:a=5,order:o=ut.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:g}=e;const p=Zr({delta:f,disabled:!i}),[N,w]=ur(),y=c.useRef({x:0,y:0}),D=c.useRef({x:0,y:0}),v=c.useMemo(()=>{switch(t){case Ve.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Ve.DraggableRect:return s}},[t,s,l]),C=c.useRef(null),S=c.useCallback(()=>{const E=C.current;if(!E)return;const x=y.current.x*D.current.x,O=y.current.y*D.current.y;E.scrollBy(x,O)},[]),b=c.useMemo(()=>o===ut.TreeOrder?[...u].reverse():u,[o,u]);c.useEffect(()=>{if(!i||!u.length||!v){w();return}for(const E of b){if(r?.(E)===!1)continue;const x=u.indexOf(E),O=d[x];if(!O)continue;const{direction:A,speed:M}=Fr(E,O,v,n,g);for(const j of["x","y"])p[j][A[j]]||(M[j]=0,A[j]=0);if(M.x>0||M.y>0){w(),C.current=E,N(S,a),y.current=M,D.current=A;return}}y.current={x:0,y:0},D.current={x:0,y:0},w()},[n,S,r,w,i,a,JSON.stringify(v),JSON.stringify(p),N,u,b,d,JSON.stringify(g)])}const Gr={x:{[V.Backward]:!1,[V.Forward]:!1},y:{[V.Backward]:!1,[V.Forward]:!1}};function Zr(e){let{delta:n,disabled:t}=e;const r=st(n);return $e(s=>{if(t||!r||!s)return Gr;const i={x:Math.sign(n.x-r.x),y:Math.sign(n.y-r.y)};return{x:{[V.Backward]:s.x[V.Backward]||i.x===-1,[V.Forward]:s.x[V.Forward]||i.x===1},y:{[V.Backward]:s.y[V.Backward]||i.y===-1,[V.Forward]:s.y[V.Forward]||i.y===1}}},[t,n,r])}function Qr(e,n){const t=n!=null?e.get(n):void 0,r=t?t.node.current:null;return $e(s=>{var i;return n==null?null:(i=r??s)!=null?i:null},[r,n])}function es(e,n){return c.useMemo(()=>e.reduce((t,r)=>{const{sensor:s}=r,i=s.activators.map(a=>({eventName:a.eventName,handler:n(a.handler,r)}));return[...t,...i]},[]),[e,n])}var Ke;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ke||(Ke={}));var _t;(function(e){e.Optimized="optimized"})(_t||(_t={}));const mn=new Map;function ts(e,n){let{dragging:t,dependencies:r,config:s}=n;const[i,a]=c.useState(null),{frequency:o,measure:l,strategy:u}=s,d=c.useRef(e),f=y(),g=Fe(f),p=c.useCallback(function(D){D===void 0&&(D=[]),!g.current&&a(v=>v===null?D:v.concat(D.filter(C=>!v.includes(C))))},[g]),N=c.useRef(null),w=$e(D=>{if(f&&!t)return mn;if(!D||D===mn||d.current!==e||i!=null){const v=new Map;for(let C of e){if(!C)continue;if(i&&i.length>0&&!i.includes(C.id)&&C.rect.current){v.set(C.id,C.rect.current);continue}const S=C.node.current,b=S?new jt(l(S),S):null;C.rect.current=b,b&&v.set(C.id,b)}return v}return D},[e,i,t,f,l]);return c.useEffect(()=>{d.current=e},[e]),c.useEffect(()=>{f||p()},[t,f]),c.useEffect(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),c.useEffect(()=>{f||typeof o!="number"||N.current!==null||(N.current=setTimeout(()=>{p(),N.current=null},o))},[o,f,p,...r]),{droppableRects:w,measureDroppableContainers:p,measuringScheduled:i!=null};function y(){switch(u){case Ke.Always:return!1;case Ke.BeforeDragging:return t;default:return!t}}}function Rt(e,n){return $e(t=>e?t||(typeof n=="function"?n(e):e):null,[n,e])}function ns(e,n){return Rt(e,n)}function rs(e){let{callback:n,disabled:t}=e;const r=nt(n),s=c.useMemo(()=>{if(t||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,t]);return c.useEffect(()=>()=>s?.disconnect(),[s]),s}function dt(e){let{callback:n,disabled:t}=e;const r=nt(n),s=c.useMemo(()=>{if(t||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[t]);return c.useEffect(()=>()=>s?.disconnect(),[s]),s}function ss(e){return new jt(Ne(e),e)}function vn(e,n,t){n===void 0&&(n=ss);const[r,s]=c.useState(null);function i(){s(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??t)!=null?u:null}const d=n(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const a=rs({callback(l){if(e)for(const u of l){const{type:d,target:f}=u;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),o=dt({callback:i});return oe(()=>{i(),e?(o?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(o?.disconnect(),a?.disconnect())},[e]),r}function is(e){const n=Rt(e);return Qt(e,n)}const bn=[];function os(e){const n=c.useRef(e),t=$e(r=>e?r&&r!==bn&&e&&n.current&&e.parentNode===n.current.parentNode?r:Ot(e):bn,[e]);return c.useEffect(()=>{n.current=e},[e]),t}function as(e){const[n,t]=c.useState(null),r=c.useRef(e),s=c.useCallback(i=>{const a=Nt(i.target);a&&t(o=>o?(o.set(a,Tt(a)),new Map(o)):null)},[]);return c.useEffect(()=>{const i=r.current;if(e!==i){a(i);const o=e.map(l=>{const u=Nt(l);return u?(u.addEventListener("scroll",s,{passive:!0}),[u,Tt(u)]):null}).filter(l=>l!=null);t(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(i)};function a(o){o.forEach(l=>{const u=Nt(l);u?.removeEventListener("scroll",s)})}},[s,e]),c.useMemo(()=>e.length?n?Array.from(n.values()).reduce((i,a)=>Oe(i,a),ae):ln(e):ae,[e,n])}function yn(e,n){n===void 0&&(n=[]);const t=c.useRef(null);return c.useEffect(()=>{t.current=null},n),c.useEffect(()=>{const r=e!==ae;r&&!t.current&&(t.current=e),!r&&t.current&&(t.current=null)},[e]),t.current?it(e,t.current):ae}function ls(e){c.useEffect(()=>{if(!tt)return;const n=e.map(t=>{let{sensor:r}=t;return r.setup==null?void 0:r.setup()});return()=>{for(const t of n)t?.()}},e.map(n=>{let{sensor:t}=n;return t}))}function cs(e,n){return c.useMemo(()=>e.reduce((t,r)=>{let{eventName:s,handler:i}=r;return t[s]=a=>{i(a,n)},t},{}),[e,n])}function xn(e){return c.useMemo(()=>e?Rr(e):null,[e])}const wn=[];function us(e,n){n===void 0&&(n=Ne);const[t]=e,r=xn(t?X(t):null),[s,i]=c.useState(wn);function a(){i(()=>e.length?e.map(l=>on(l)?r:new jt(n(l),l)):wn)}const o=dt({callback:a});return oe(()=>{o?.disconnect(),a(),e.forEach(l=>o?.observe(l))},[e]),s}function Cn(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return Pe(n)?n:e}function ds(e){let{measure:n}=e;const[t,r]=c.useState(null),s=c.useCallback(u=>{for(const{target:d}of u)if(Pe(d)){r(f=>{const g=n(d);return f?{...f,width:g.width,height:g.height}:g});break}},[n]),i=dt({callback:s}),a=c.useCallback(u=>{const d=Cn(u);i?.disconnect(),d&&i?.observe(d),r(d?n(d):null)},[n,i]),[o,l]=rt(a);return c.useMemo(()=>({nodeRef:o,rect:t,setRef:l}),[t,o,l])}const fs=[{sensor:ct,options:{}},{sensor:fn,options:{}}],hs={current:{}},ft={draggable:{measure:tn},droppable:{measure:tn,strategy:Ke.WhileDragging,frequency:_t.Optimized},dragOverlay:{measure:Ne}};class Ye extends Map{get(n){var t;return n!=null&&(t=super.get(n))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:t}=n;return!t})}getNodeFor(n){var t,r;return(t=(r=this.get(n))==null?void 0:r.node.current)!=null?t:void 0}}const gs={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ye,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:lt},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ft,measureDroppableContainers:lt,windowRect:null,measuringScheduled:!1},Sn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:lt,draggableNodes:new Map,over:null,measureDroppableContainers:lt},Ue=c.createContext(Sn),En=c.createContext(gs);function ps(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ye}}}function ms(e,n){switch(n.type){case W.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case W.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case W.DragEnd:case W.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case W.RegisterDroppable:{const{element:t}=n,{id:r}=t,s=new Ye(e.droppable.containers);return s.set(r,t),{...e,droppable:{...e.droppable,containers:s}}}case W.SetDroppableDisabled:{const{id:t,key:r,disabled:s}=n,i=e.droppable.containers.get(t);if(!i||r!==i.key)return e;const a=new Ye(e.droppable.containers);return a.set(t,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:a}}}case W.UnregisterDroppable:{const{id:t,key:r}=n,s=e.droppable.containers.get(t);if(!s||r!==s.key)return e;const i=new Ye(e.droppable.containers);return i.delete(t),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function vs(e){let{disabled:n}=e;const{active:t,activatorEvent:r,draggableNodes:s}=c.useContext(Ue),i=st(r),a=st(t?.id);return c.useEffect(()=>{if(!n&&!r&&i&&a!=null){if(!ot(i)||document.activeElement===i.target)return;const o=s.get(a);if(!o)return;const{activatorNode:l,node:u}=o;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[l.current,u.current]){if(!d)continue;const f=hr(d);if(f){f.focus();break}}})}},[r,n,s,a,i]),null}function Dn(e,n){let{transform:t,...r}=n;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),t):t}function bs(e){return c.useMemo(()=>({draggable:{...ft.draggable,...e?.draggable},droppable:{...ft.droppable,...e?.droppable},dragOverlay:{...ft.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function ys(e){let{activeNode:n,measure:t,initialRect:r,config:s=!0}=e;const i=c.useRef(!1),{x:a,y:o}=typeof s=="boolean"?{x:s,y:s}:s;oe(()=>{if(!a&&!o||!n){i.current=!1;return}if(i.current||!r)return;const u=n?.node.current;if(!u||u.isConnected===!1)return;const d=t(u),f=Qt(d,r);if(a||(f.x=0),o||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const g=nn(u);g&&g.scrollBy({top:f.y,left:f.x})}},[n,a,o,r,t])}const ht=c.createContext({...ae,scaleX:1,scaleY:1});var pe;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(pe||(pe={}));const On=c.memo(function(n){var t,r,s,i;let{id:a,accessibility:o,autoScroll:l=!0,children:u,sensors:d=fs,collisionDetection:f=jr,measuring:g,modifiers:p,...N}=n;const w=c.useReducer(ms,void 0,ps),[y,D]=w,[v,C]=yr(),[S,b]=c.useState(pe.Uninitialized),E=S===pe.Initialized,{draggable:{active:x,nodes:O,translate:A},droppable:{containers:M}}=y,j=x!=null?O.get(x):null,L=c.useRef({initial:null,translated:null}),R=c.useMemo(()=>{var q;return x!=null?{id:x,data:(q=j?.data)!=null?q:hs,rect:L}:null},[x,j]),P=c.useRef(null),[H,Z]=c.useState(null),[Y,Ce]=c.useState(null),se=Fe(N,Object.values(N)),me=Be("DndDescribedBy",a),h=c.useMemo(()=>M.getEnabled(),[M]),T=bs(g),{droppableRects:I,measureDroppableContainers:z,measuringScheduled:le}=ts(h,{dragging:E,dependencies:[A.x,A.y],config:T.droppable}),U=Qr(O,x),F=c.useMemo(()=>Y?at(Y):null,[Y]),J=Ni(),Q=ns(U,T.draggable.measure);ys({activeNode:x!=null?O.get(x):null,config:J.layoutShiftCompensation,initialRect:Q,measure:T.draggable.measure});const _=vn(U,T.draggable.measure,Q),qe=vn(U?U.parentElement:null),ce=c.useRef({activatorEvent:null,active:null,activeNode:U,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:O,draggingNode:null,draggingNodeRect:null,droppableContainers:M,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),je=M.getNodeFor((t=ce.current.over)==null?void 0:t.id),he=ds({measure:T.dragOverlay.measure}),Ae=(r=he.nodeRef.current)!=null?r:U,Me=E?(s=he.rect)!=null?s:_:null,Hn=!!(he.nodeRef.current&&he.rect),Jn=is(Hn?null:_),Ft=xn(Ae?X(Ae):null),ve=os(E?je??U:null),bt=us(ve),yt=Dn(p,{transform:{x:A.x-Jn.x,y:A.y-Jn.y,scaleX:1,scaleY:1},activatorEvent:Y,active:R,activeNodeRect:_,containerNodeRect:qe,draggingNodeRect:Me,over:ce.current.over,overlayNodeRect:he.rect,scrollableAncestors:ve,scrollableAncestorRects:bt,windowRect:Ft}),Gn=F?Oe(F,A):null,Zn=as(ve),xi=yn(Zn),wi=yn(Zn,[_]),Ie=Oe(yt,xi),ke=Me?Ir(Me,yt):null,Xe=R&&ke?f({active:R,collisionRect:ke,droppableRects:I,droppableContainers:h,pointerCoordinates:Gn}):null,Qn=Nr(Xe,"id"),[be,er]=c.useState(null),Ci=Hn?yt:Oe(yt,wi),Si=Ar(Ci,(i=be?.rect)!=null?i:null,_),$t=c.useRef(null),tr=c.useCallback((q,ee)=>{let{sensor:te,options:ye}=ee;if(P.current==null)return;const ie=O.get(P.current);if(!ie)return;const ne=q.nativeEvent,ue=new te({active:P.current,activeNode:ie,event:ne,options:ye,context:ce,onAbort(K){if(!O.get(K))return;const{onDragAbort:de}=se.current,ge={id:K};de?.(ge),v({type:"onDragAbort",event:ge})},onPending(K,xe,de,ge){if(!O.get(K))return;const{onDragPending:Je}=se.current,we={id:K,constraint:xe,initialCoordinates:de,offset:ge};Je?.(we),v({type:"onDragPending",event:we})},onStart(K){const xe=P.current;if(xe==null)return;const de=O.get(xe);if(!de)return;const{onDragStart:ge}=se.current,He={activatorEvent:ne,active:{id:xe,data:de.data,rect:L}};Se.unstable_batchedUpdates(()=>{ge?.(He),b(pe.Initializing),D({type:W.DragStart,initialCoordinates:K,active:xe}),v({type:"onDragStart",event:He}),Z($t.current),Ce(ne)})},onMove(K){D({type:W.DragMove,coordinates:K})},onEnd:_e(W.DragEnd),onCancel:_e(W.DragCancel)});$t.current=ue;function _e(K){return async function(){const{active:de,collisions:ge,over:He,scrollAdjustedTranslate:Je}=ce.current;let we=null;if(de&&Je){const{cancelDrop:Ge}=se.current;we={activatorEvent:ne,active:de,collisions:ge,delta:Je,over:He},K===W.DragEnd&&typeof Ge=="function"&&await Promise.resolve(Ge(we))&&(K=W.DragCancel)}P.current=null,Se.unstable_batchedUpdates(()=>{D({type:K}),b(pe.Uninitialized),er(null),Z(null),Ce(null),$t.current=null;const Ge=K===W.DragEnd?"onDragEnd":"onDragCancel";if(we){const Bt=se.current[Ge];Bt?.(we),v({type:Ge,event:we})}})}}},[O]),Ei=c.useCallback((q,ee)=>(te,ye)=>{const ie=te.nativeEvent,ne=O.get(ye);if(P.current!==null||!ne||ie.dndKit||ie.defaultPrevented)return;const ue={active:ne};q(te,ee.options,ue)===!0&&(ie.dndKit={capturedBy:ee.sensor},P.current=ye,tr(te,ee))},[O,tr]),nr=es(d,Ei);ls(d),oe(()=>{_&&S===pe.Initializing&&b(pe.Initialized)},[_,S]),c.useEffect(()=>{const{onDragMove:q}=se.current,{active:ee,activatorEvent:te,collisions:ye,over:ie}=ce.current;if(!ee||!te)return;const ne={active:ee,activatorEvent:te,collisions:ye,delta:{x:Ie.x,y:Ie.y},over:ie};Se.unstable_batchedUpdates(()=>{q?.(ne),v({type:"onDragMove",event:ne})})},[Ie.x,Ie.y]),c.useEffect(()=>{const{active:q,activatorEvent:ee,collisions:te,droppableContainers:ye,scrollAdjustedTranslate:ie}=ce.current;if(!q||P.current==null||!ee||!ie)return;const{onDragOver:ne}=se.current,ue=ye.get(Qn),_e=ue&&ue.rect.current?{id:ue.id,rect:ue.rect.current,data:ue.data,disabled:ue.disabled}:null,K={active:q,activatorEvent:ee,collisions:te,delta:{x:ie.x,y:ie.y},over:_e};Se.unstable_batchedUpdates(()=>{er(_e),ne?.(K),v({type:"onDragOver",event:K})})},[Qn]),oe(()=>{ce.current={activatorEvent:Y,active:R,activeNode:U,collisionRect:ke,collisions:Xe,droppableRects:I,draggableNodes:O,draggingNode:Ae,draggingNodeRect:Me,droppableContainers:M,over:be,scrollableAncestors:ve,scrollAdjustedTranslate:Ie},L.current={initial:Me,translated:ke}},[R,U,Xe,ke,O,Ae,Me,I,M,be,ve,Ie]),Jr({...J,delta:A,draggingRect:ke,pointerCoordinates:Gn,scrollableAncestors:ve,scrollableAncestorRects:bt});const Di=c.useMemo(()=>({active:R,activeNode:U,activeNodeRect:_,activatorEvent:Y,collisions:Xe,containerNodeRect:qe,dragOverlay:he,draggableNodes:O,droppableContainers:M,droppableRects:I,over:be,measureDroppableContainers:z,scrollableAncestors:ve,scrollableAncestorRects:bt,measuringConfiguration:T,measuringScheduled:le,windowRect:Ft}),[R,U,_,Y,Xe,qe,he,O,M,I,be,z,ve,bt,T,le,Ft]),Oi=c.useMemo(()=>({activatorEvent:Y,activators:nr,active:R,activeNodeRect:_,ariaDescribedById:{draggable:me},dispatch:D,draggableNodes:O,over:be,measureDroppableContainers:z}),[Y,nr,R,_,D,me,O,be,z]);return c.createElement(Ht.Provider,{value:C},c.createElement(Ue.Provider,{value:Oi},c.createElement(En.Provider,{value:Di},c.createElement(ht.Provider,{value:Si},u)),c.createElement(vs,{disabled:o?.restoreFocus===!1})),c.createElement(Cr,{...o,hiddenTextDescribedById:me}));function Ni(){const q=H?.autoScrollEnabled===!1,ee=typeof l=="object"?l.enabled===!1:l===!1,te=E&&!q&&!ee;return typeof l=="object"?{...l,enabled:te}:{enabled:te}}}),xs=c.createContext(null),Nn="button",ws="Draggable";function Cs(e){let{id:n,data:t,disabled:r=!1,attributes:s}=e;const i=Be(ws),{activators:a,activatorEvent:o,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:g}=c.useContext(Ue),{role:p=Nn,roleDescription:N="draggable",tabIndex:w=0}=s??{},y=l?.id===n,D=c.useContext(y?ht:xs),[v,C]=rt(),[S,b]=rt(),E=cs(a,n),x=Fe(t);oe(()=>(f.set(n,{id:n,key:i,node:v,activatorNode:S,data:x}),()=>{const A=f.get(n);A&&A.key===i&&f.delete(n)}),[f,n]);const O=c.useMemo(()=>({role:p,tabIndex:w,"aria-disabled":r,"aria-pressed":y&&p===Nn?!0:void 0,"aria-roledescription":N,"aria-describedby":d.draggable}),[r,p,w,y,N,d.draggable]);return{active:l,activatorEvent:o,activeNodeRect:u,attributes:O,isDragging:y,listeners:r?void 0:E,node:v,over:g,setNodeRef:C,setActivatorNodeRef:b,transform:D}}function Tn(){return c.useContext(En)}const Ss="Droppable",Es={timeout:25};function Ds(e){let{data:n,disabled:t=!1,id:r,resizeObserverConfig:s}=e;const i=Be(Ss),{active:a,dispatch:o,over:l,measureDroppableContainers:u}=c.useContext(Ue),d=c.useRef({disabled:t}),f=c.useRef(!1),g=c.useRef(null),p=c.useRef(null),{disabled:N,updateMeasurementsFor:w,timeout:y}={...Es,...s},D=Fe(w??r),v=c.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(D.current)?D.current:[D.current]),p.current=null},y)},[y]),C=dt({callback:v,disabled:N||!a}),S=c.useCallback((O,A)=>{C&&(A&&(C.unobserve(A),f.current=!1),O&&C.observe(O))},[C]),[b,E]=rt(S),x=Fe(n);return c.useEffect(()=>{!C||!b.current||(C.disconnect(),f.current=!1,C.observe(b.current))},[b,C]),c.useEffect(()=>(o({type:W.RegisterDroppable,element:{id:r,key:i,disabled:t,node:b,rect:g,data:x}}),()=>o({type:W.UnregisterDroppable,key:i,id:r})),[r]),c.useEffect(()=>{t!==d.current.disabled&&(o({type:W.SetDroppableDisabled,id:r,key:i,disabled:t}),d.current.disabled=t)},[r,i,t,o]),{active:a,rect:g,isOver:l?.id===r,node:b,over:l,setNodeRef:E}}function Os(e){let{animation:n,children:t}=e;const[r,s]=c.useState(null),[i,a]=c.useState(null),o=st(t);return!t&&!r&&o&&s(o),oe(()=>{if(!i)return;const l=r?.key,u=r?.props.id;if(l==null||u==null){s(null);return}Promise.resolve(n(u,i)).then(()=>{s(null)})},[n,r,i]),c.createElement(c.Fragment,null,t,r?c.cloneElement(r,{ref:a}):null)}const Ns={x:0,y:0,scaleX:1,scaleY:1};function Ts(e){let{children:n}=e;return c.createElement(Ue.Provider,{value:Sn},c.createElement(ht.Provider,{value:Ns},n))}const js={position:"fixed",touchAction:"none"},As=e=>ot(e)?"transform 250ms ease":void 0,Ms=c.forwardRef((e,n)=>{let{as:t,activatorEvent:r,adjustScale:s,children:i,className:a,rect:o,style:l,transform:u,transition:d=As}=e;if(!o)return null;const f=s?u:{...u,scaleX:1,scaleY:1},g={...js,width:o.width,height:o.height,top:o.top,left:o.left,transform:fe.Transform.toString(f),transformOrigin:s&&r?Er(r,o):void 0,transition:typeof d=="function"?d(r):d,...l};return c.createElement(t,{className:a,style:g,ref:n},i)}),Is={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:n,final:t}}=e;return[{transform:fe.Transform.toString(n)},{transform:fe.Transform.toString(t)}]},sideEffects:(e=>n=>{let{active:t,dragOverlay:r}=n;const s={},{styles:i,className:a}=e;if(i!=null&&i.active)for(const[o,l]of Object.entries(i.active))l!==void 0&&(s[o]=t.node.style.getPropertyValue(o),t.node.style.setProperty(o,l));if(i!=null&&i.dragOverlay)for(const[o,l]of Object.entries(i.dragOverlay))l!==void 0&&r.node.style.setProperty(o,l);return a!=null&&a.active&&t.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[l,u]of Object.entries(s))t.node.style.setProperty(l,u);a!=null&&a.active&&t.node.classList.remove(a.active)}})({styles:{active:{opacity:"0"}}})};function ks(e){let{config:n,draggableNodes:t,droppableContainers:r,measuringConfiguration:s}=e;return nt((i,a)=>{if(n===null)return;const o=t.get(i);if(!o)return;const l=o.node.current;if(!l)return;const u=Cn(a);if(!u)return;const{transform:d}=X(a).getComputedStyle(a),f=en(d);if(!f)return;const g=typeof n=="function"?n:_s(n);return cn(l,s.draggable.measure),g({active:{id:i,data:o.data,node:l,rect:s.draggable.measure(l)},draggableNodes:t,dragOverlay:{node:a,rect:s.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:s,transform:f})})}function _s(e){const{duration:n,easing:t,sideEffects:r,keyframes:s}={...Is,...e};return i=>{let{active:a,dragOverlay:o,transform:l,...u}=i;if(!n)return;const d={x:o.rect.left-a.rect.left,y:o.rect.top-a.rect.top},f={scaleX:l.scaleX!==1?a.rect.width*l.scaleX/o.rect.width:1,scaleY:l.scaleY!==1?a.rect.height*l.scaleY/o.rect.height:1},g={x:l.x-d.x,y:l.y-d.y,...f},p=s({...u,active:a,dragOverlay:o,transform:{initial:l,final:g}}),[N]=p,w=p[p.length-1];if(JSON.stringify(N)===JSON.stringify(w))return;const y=r?.({active:a,dragOverlay:o,...u}),D=o.node.animate(p,{duration:n,easing:t,fill:"forwards"});return new Promise(v=>{D.onfinish=()=>{y?.(),v()}})}}let jn=0;function Rs(e){return c.useMemo(()=>{if(e!=null)return jn++,jn},[e])}const An=c.memo(e=>{let{adjustScale:n=!1,children:t,dropAnimation:r,style:s,transition:i,modifiers:a,wrapperElement:o="div",className:l,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:g,containerNodeRect:p,draggableNodes:N,droppableContainers:w,dragOverlay:y,over:D,measuringConfiguration:v,scrollableAncestors:C,scrollableAncestorRects:S,windowRect:b}=Tn(),E=c.useContext(ht),x=Rs(f?.id),O=Dn(a,{activatorEvent:d,active:f,activeNodeRect:g,containerNodeRect:p,draggingNodeRect:y.rect,over:D,overlayNodeRect:y.rect,scrollableAncestors:C,scrollableAncestorRects:S,transform:E,windowRect:b}),A=Rt(g),M=ks({config:r,draggableNodes:N,droppableContainers:w,measuringConfiguration:v}),j=A?y.setRef:void 0;return c.createElement(Ts,null,c.createElement(Os,{animation:M},f&&x?c.createElement(Ms,{key:x,id:f.id,ref:j,as:o,activatorEvent:d,adjustScale:n,className:l,transition:i,rect:A,style:{zIndex:u,...s},transform:O},t):null))});function gt(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function zs(e,n){return e.reduce((t,r,s)=>{const i=n.get(r);return i&&(t[s]=i),t},Array(e.length))}function pt(e){return e!==null&&e>=0}function Ls(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function Ps(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Mn=e=>{let{rects:n,activeIndex:t,overIndex:r,index:s}=e;const i=gt(n,r,t),a=n[s],o=i[s];return!o||!a?null:{x:o.left-a.left,y:o.top-a.top,scaleX:o.width/a.width,scaleY:o.height/a.height}},mt={scaleX:1,scaleY:1},In=e=>{var n;let{activeIndex:t,activeNodeRect:r,index:s,rects:i,overIndex:a}=e;const o=(n=i[t])!=null?n:r;if(!o)return null;if(s===t){const u=i[a];return u?{x:0,y:t<a?u.top+u.height-(o.top+o.height):u.top-o.top,...mt}:null}const l=Fs(i,s,t);return s>t&&s<=a?{x:0,y:-o.height-l,...mt}:s<t&&s>=a?{x:0,y:o.height+l,...mt}:{x:0,y:0,...mt}};function Fs(e,n,t){const r=e[n],s=e[n-1],i=e[n+1];return r?t<n?s?r.top-(s.top+s.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const kn="Sortable",_n=c.createContext({activeIndex:-1,containerId:kn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mn,disabled:{draggable:!1,droppable:!1}});function Rn(e){let{children:n,id:t,items:r,strategy:s=Mn,disabled:i=!1}=e;const{active:a,dragOverlay:o,droppableRects:l,over:u,measureDroppableContainers:d}=Tn(),f=Be(kn,t),g=o.rect!==null,p=c.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),N=a!=null,w=a?p.indexOf(a.id):-1,y=u?p.indexOf(u.id):-1,D=c.useRef(p),v=!Ls(p,D.current),C=y!==-1&&w===-1||v,S=Ps(i);oe(()=>{v&&N&&d(p)},[v,p,N,d]),c.useEffect(()=>{D.current=p},[p]);const b=c.useMemo(()=>({activeIndex:w,containerId:f,disabled:S,disableTransforms:C,items:p,overIndex:y,useDragOverlay:g,sortedRects:zs(p,l),strategy:s}),[w,f,S.draggable,S.droppable,C,p,y,l,g,s]);return c.createElement(_n.Provider,{value:b},n)}const $s=e=>{let{id:n,items:t,activeIndex:r,overIndex:s}=e;return gt(t,r,s).indexOf(n)},Bs=e=>{let{containerId:n,isSorting:t,wasDragging:r,index:s,items:i,newIndex:a,previousItems:o,previousContainerId:l,transition:u}=e;return!u||!r||o!==i&&s===a?!1:t?!0:a!==s&&n===l},Ws={duration:200,easing:"ease"},zn="transform",Vs=fe.Transition.toString({property:zn,duration:0,easing:"linear"}),Ks={roleDescription:"sortable"};function Ys(e){let{disabled:n,index:t,node:r,rect:s}=e;const[i,a]=c.useState(null),o=c.useRef(t);return oe(()=>{if(!n&&t!==o.current&&r.current){const l=s.current;if(l){const u=Ne(r.current,{ignoreTransform:!0}),d={x:l.left-u.left,y:l.top-u.top,scaleX:l.width/u.width,scaleY:l.height/u.height};(d.x||d.y)&&a(d)}}t!==o.current&&(o.current=t)},[n,t,r,s]),c.useEffect(()=>{i&&a(null)},[i]),i}function vt(e){let{animateLayoutChanges:n=Bs,attributes:t,disabled:r,data:s,getNewIndex:i=$s,id:a,strategy:o,resizeObserverConfig:l,transition:u=Ws}=e;const{items:d,containerId:f,activeIndex:g,disabled:p,disableTransforms:N,sortedRects:w,overIndex:y,useDragOverlay:D,strategy:v}=c.useContext(_n),C=Us(r,p),S=d.indexOf(a),b=c.useMemo(()=>({sortable:{containerId:f,index:S,items:d},...s}),[f,s,S,d]),E=c.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:x,node:O,isOver:A,setNodeRef:M}=Ds({id:a,data:b,disabled:C.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...l}}),{active:j,activatorEvent:L,activeNodeRect:R,attributes:P,setNodeRef:H,listeners:Z,isDragging:Y,over:Ce,setActivatorNodeRef:se,transform:me}=Cs({id:a,data:b,attributes:{...Ks,...t},disabled:C.draggable}),h=cr(M,H),T=!!j,I=T&&!N&&pt(g)&&pt(y),z=!D&&Y,le=z&&I?me:null,F=I?le??(o??v)({rects:w,activeNodeRect:R,activeIndex:g,overIndex:y,index:S}):null,J=pt(g)&&pt(y)?i({id:a,items:d,activeIndex:g,overIndex:y}):S,Q=j?.id,_=c.useRef({activeId:Q,items:d,newIndex:J,containerId:f}),qe=d!==_.current.items,ce=n({active:j,containerId:f,isDragging:Y,isSorting:T,id:a,index:S,items:d,newIndex:_.current.newIndex,previousItems:_.current.items,previousContainerId:_.current.containerId,transition:u,wasDragging:_.current.activeId!=null}),je=Ys({disabled:!ce,index:S,node:O,rect:x});return c.useEffect(()=>{T&&_.current.newIndex!==J&&(_.current.newIndex=J),f!==_.current.containerId&&(_.current.containerId=f),d!==_.current.items&&(_.current.items=d)},[T,J,f,d]),c.useEffect(()=>{if(Q===_.current.activeId)return;if(Q!=null&&_.current.activeId==null){_.current.activeId=Q;return}const Ae=setTimeout(()=>{_.current.activeId=Q},50);return()=>clearTimeout(Ae)},[Q]),{active:j,activeIndex:g,attributes:P,data:b,rect:x,index:S,newIndex:J,items:d,isOver:A,isSorting:T,isDragging:Y,listeners:Z,node:O,overIndex:y,over:Ce,setNodeRef:h,setActivatorNodeRef:se,setDroppableNodeRef:M,setDraggableNodeRef:H,transform:je??F,transition:he()};function he(){if(je||qe&&_.current.newIndex===S)return Vs;if(!(z&&!ot(L)||!u)&&(T||ce))return fe.Transition.toString({...u,property:zn})}}function Us(e,n){var t,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(t=e?.draggable)!=null?t:n.draggable,droppable:(r=e?.droppable)!=null?r:n.droppable}}k.Down,k.Right,k.Up,k.Left;const Ln=(...e)=>e.filter(Boolean).join(" ");function Pn({card:e,onCardClick:n}){const{attributes:t,listeners:r,setNodeRef:s,transform:i,transition:a,isDragging:o}=vt({id:e.id}),l={transform:fe.Transform.toString(i),transition:a,opacity:o?.5:void 0};return m.jsx("div",{ref:s,style:l,...t,...r,role:"listitem","aria-label":e.title,onClick:()=>n?.(e),children:m.jsxs($.Card,{className:"mb-2 cursor-grab active:cursor-grabbing border-border bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group touch-manipulation",children:[m.jsxs($.CardHeader,{className:"p-2 sm:p-4",children:[m.jsx($.CardTitle,{className:"text-xs sm:text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors",children:e.title}),e.description&&m.jsx($.CardDescription,{className:"text-xs text-muted-foreground font-mono line-clamp-2 sm:line-clamp-none",children:e.description})]}),e.badges&&e.badges.length>0&&m.jsx($.CardContent,{className:"p-2 sm:p-4 pt-0",children:m.jsx("div",{className:"flex flex-wrap gap-1",children:e.badges.map((u,d)=>m.jsx($.Badge,{variant:u.variant||"default",className:"text-xs",children:u.label},d))})})]})})}function qs({column:e,cards:n,onCardClick:t}){const r=n||[],{setNodeRef:s}=vt({id:e.id,data:{type:"column"}}),i=e.limit&&r.length>=e.limit;return m.jsxs("div",{ref:s,role:"group","aria-label":e.title,className:Ln("flex flex-col w-[85vw] sm:w-80 flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl snap-start",e.className),children:[m.jsx("div",{className:"p-3 sm:p-4 border-b border-border/50 bg-muted/20",children:m.jsxs("div",{className:"flex items-center justify-between",children:[m.jsx("h3",{id:`kanban-col-${e.id}`,className:"font-mono text-xs sm:text-sm font-semibold tracking-wider text-primary/90 uppercase truncate",children:e.title}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("span",{className:"font-mono text-xs text-muted-foreground","aria-label":`${r.length} cards${e.limit?` of ${e.limit} maximum`:""}`,children:[r.length,e.limit&&` / ${e.limit}`]}),i&&m.jsx($.Badge,{variant:"destructive",className:"text-xs",children:"Full"})]})]})}),m.jsx($.ScrollArea,{className:"flex-1 p-4",children:m.jsx(Rn,{items:r.map(a=>a.id),strategy:In,children:m.jsx("div",{className:"space-y-2",role:"list","aria-label":`${e.title} cards`,children:r.map(a=>m.jsx(Pn,{card:a,onCardClick:t},a.id))})})})]})}function Xs({children:e}){const n=Re.useDnd();return m.jsx(m.Fragment,{children:e(n)})}function Hs({columns:e,onCardMove:n,onCardClick:t,className:r}){return Re.useHasDndProvider()?m.jsx(Xs,{children:i=>m.jsx(Fn,{columns:e,onCardMove:n,onCardClick:t,className:r,dnd:i})}):m.jsx(Fn,{columns:e,onCardMove:n,onCardClick:t,className:r,dnd:null})}function Fn({columns:e,onCardMove:n,onCardClick:t,className:r,dnd:s}){const[i,a]=B.useState(null),o=B.useMemo(()=>(e||[]).map(y=>({...y,cards:y.cards||[]})),[e]),[l,u]=B.useState(o);B.useEffect(()=>{u(o)},[o]);const d=Jt(Dt(ct,{activationConstraint:{distance:5}}),Dt(pn,{activationConstraint:{delay:200,tolerance:5}})),f=y=>{const{active:D}=y,v=p(D.id);if(a(v),s&&v){const C=N(v.id);C&&s.startDrag({id:v.id,type:"kanban-card",data:v,sourceId:C.id})}},g=y=>{const{active:D,over:v}=y;if(a(null),!v){s&&s.endDrag();return}const C=D.id,S=v.id;if(C===S){s&&s.endDrag();return}const b=N(C),E=N(S)||w(S);if(!b||!E){s&&s.endDrag();return}if(b.id===E.id){const x=[...b.cards],O=x.findIndex(j=>j.id===C),A=x.findIndex(j=>j.id===S),M=gt(x,O,A);u(j=>j.map(L=>L.id===b.id?{...L,cards:M}:L))}else{const x=[...b.cards],O=[...E.cards],A=x.findIndex(R=>R.id===C),j=S===E.id?O.length:O.findIndex(R=>R.id===S),[L]=x.splice(A,1);O.splice(j,0,L),u(R=>R.map(P=>P.id===b.id?{...P,cards:x}:P.id===E.id?{...P,cards:O}:P)),n&&n(C,b.id,E.id,j)}s&&s.endDrag(E.id)},p=B.useCallback(y=>{for(const D of l){const v=D.cards.find(C=>C.id===y);if(v)return v}return null},[l]),N=B.useCallback(y=>l.find(D=>D.cards.some(v=>v.id===y))||null,[l]),w=B.useCallback(y=>l.find(D=>D.id===y)||null,[l]);return m.jsxs(On,{sensors:d,collisionDetection:Zt,onDragStart:f,onDragEnd:g,children:[m.jsxs("div",{className:"flex sm:hidden items-center justify-between px-3 pb-2 text-xs text-muted-foreground",children:[m.jsxs("span",{children:[l.length," columns"]}),m.jsx("span",{children:"← Swipe to navigate →"})]}),m.jsx("div",{className:Ln("flex gap-3 sm:gap-4 overflow-x-auto snap-x snap-mandatory p-2 sm:p-4 [-webkit-overflow-scrolling:touch]",r),role:"region","aria-label":"Kanban board",children:l.map(y=>m.jsx(qs,{column:y,cards:y.cards,onCardClick:t},y.id))}),m.jsx(An,{children:m.jsx("div",{"aria-live":"assertive","aria-label":i?`Dragging ${i.title}`:void 0,children:i?m.jsx(Pn,{card:i}):null})})]})}const Js=Object.freeze(Object.defineProperty({__proto__:null,default:Hs},Symbol.toStringTag,{value:"Module"}));function Te(e,n,t){let r=t.initialDeps??[],s,i=!0;function a(){var o,l,u;let d;t.key&&((o=t.debug)!=null&&o.call(t))&&(d=Date.now());const f=e();if(!(f.length!==r.length||f.some((N,w)=>r[w]!==N)))return s;r=f;let p;if(t.key&&((l=t.debug)!=null&&l.call(t))&&(p=Date.now()),s=n(...f),t.key&&((u=t.debug)!=null&&u.call(t))){const N=Math.round((Date.now()-d)*100)/100,w=Math.round((Date.now()-p)*100)/100,y=w/16,D=(v,C)=>{for(v=String(v);v.length<C;)v=" "+v;return v};console.info(`%c⏱ ${D(w,5)} /${D(N,5)} ms`,`
10
+ `},qr={onDragStart(e){let{active:n}=e;return"Picked up draggable item "+n.id+"."},onDragOver(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was moved over droppable area "+t.id+".":"Draggable item "+n.id+" is no longer over a droppable area."},onDragEnd(e){let{active:n,over:t}=e;return t?"Draggable item "+n.id+" was dropped over droppable area "+t.id:"Draggable item "+n.id+" was dropped."},onDragCancel(e){let{active:n}=e;return"Dragging was cancelled. Draggable item "+n.id+" was dropped."}};function Ur(e){let{announcements:n=qr,container:t,hiddenTextDescribedById:r,screenReaderInstructions:s=Yr}=e;const{announce:o,announcement:i}=Vr(),a=Ke("DndLiveRegion"),[l,c]=u.useState(!1);if(u.useEffect(()=>{c(!0)},[]),Kr(u.useMemo(()=>({onDragStart(f){let{active:h}=f;o(n.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;n.onDragMove&&o(n.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;o(n.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;o(n.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;o(n.onDragCancel({active:h,over:p}))}}),[o,n])),!l)return null;const d=u.createElement(u.Fragment,null,u.createElement($r,{id:r,value:s.draggable}),u.createElement(Br,{id:a,announcement:i}));return t?Ne.createPortal(d,t):d}var X;(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"})(X||(X={}));function ut(){}function kt(e,n){return u.useMemo(()=>({sensor:e,options:n??{}}),[e,n])}function an(){for(var e=arguments.length,n=new Array(e),t=0;t<e;t++)n[t]=arguments[t];return u.useMemo(()=>[...n].filter(r=>r!=null),[...n])}const le=Object.freeze({x:0,y:0});function Xr(e,n){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Hr(e,n){const t=ct(e);if(!t)return"0 0";const r={x:(t.x-n.left)/n.width*100,y:(t.y-n.top)/n.height*100};return r.x+"% "+r.y+"%"}function Jr(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return t-r}function Gr(e,n){let{data:{value:t}}=e,{data:{value:r}}=n;return r-t}function ln(e){let{left:n,top:t,height:r,width:s}=e;return[{x:n,y:t},{x:n+s,y:t},{x:n,y:t+r},{x:n+s,y:t+r}]}function Qr(e,n){if(!e||e.length===0)return null;const[t]=e;return t[n]}const cn=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const s=ln(n),o=[];for(const i of r){const{id:a}=i,l=t.get(a);if(l){const c=ln(l),d=s.reduce((h,p,E)=>h+Xr(c[E],p),0),f=Number((d/4).toFixed(4));o.push({id:a,data:{droppableContainer:i,value:f}})}}return o.sort(Jr)};function Zr(e,n){const t=Math.max(n.top,e.top),r=Math.max(n.left,e.left),s=Math.min(n.left+n.width,e.left+e.width),o=Math.min(n.top+n.height,e.top+e.height),i=s-r,a=o-t;if(r<s&&t<o){const l=n.width*n.height,c=e.width*e.height,d=i*a,f=d/(l+c-d);return Number(f.toFixed(4))}return 0}const es=e=>{let{collisionRect:n,droppableRects:t,droppableContainers:r}=e;const s=[];for(const o of r){const{id:i}=o,a=t.get(i);if(a){const l=Zr(a,n);l>0&&s.push({id:i,data:{droppableContainer:o,value:l}})}}return s.sort(Gr)};function ts(e,n,t){return{...e,scaleX:n&&t?n.width/t.width:1,scaleY:n&&t?n.height/t.height:1}}function un(e,n){return e&&n?{x:e.left-n.left,y:e.top-n.top}:le}function ns(e){return function(t){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o<r;o++)s[o-1]=arguments[o];return s.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}),{...t})}}const rs=ns(1);function dn(e){if(e.startsWith("matrix3d(")){const n=e.slice(9,-1).split(/, /);return{x:+n[12],y:+n[13],scaleX:+n[0],scaleY:+n[5]}}else if(e.startsWith("matrix(")){const n=e.slice(7,-1).split(/, /);return{x:+n[4],y:+n[5],scaleX:+n[0],scaleY:+n[3]}}return null}function ss(e,n,t){const r=dn(n);if(!r)return e;const{scaleX:s,scaleY:o,x:i,y:a}=r,l=e.left-i-(1-s)*parseFloat(t),c=e.top-a-(1-o)*parseFloat(t.slice(t.indexOf(" ")+1)),d=s?e.width/s:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:c,right:l+d,bottom:c+f,left:l}}const os={ignoreTransform:!1};function Oe(e,n){n===void 0&&(n=os);let t=e.getBoundingClientRect();if(n.ignoreTransform){const{transform:c,transformOrigin:d}=Z(e).getComputedStyle(e);c&&(t=ss(t,c,d))}const{top:r,left:s,width:o,height:i,bottom:a,right:l}=t;return{top:r,left:s,width:o,height:i,bottom:a,right:l}}function fn(e){return Oe(e,{ignoreTransform:!0})}function is(e){const n=e.innerWidth,t=e.innerHeight;return{top:0,left:0,right:n,bottom:t,width:n,height:t}}function as(e,n){return n===void 0&&(n=Z(e).getComputedStyle(e)),n.position==="fixed"}function ls(e,n){n===void 0&&(n=Z(e).getComputedStyle(e));const t=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const o=n[s];return typeof o=="string"?t.test(o):!1})}function Ot(e,n){const t=[];function r(s){if(n!=null&&t.length>=n||!s)return t;if(Dt(s)&&s.scrollingElement!=null&&!t.includes(s.scrollingElement))return t.push(s.scrollingElement),t;if(!$e(s)||nn(s)||t.includes(s))return t;const o=Z(e).getComputedStyle(s);return s!==e&&ls(s,o)&&t.push(s),as(s,o)?t:r(s.parentNode)}return e?r(e):t}function hn(e){const[n]=Ot(e,1);return n??null}function At(e){return!rt||!e?null:De(e)?e:Nt(e)?Dt(e)||e===je(e).scrollingElement?window:$e(e)?e:null:null}function gn(e){return De(e)?e.scrollX:e.scrollLeft}function mn(e){return De(e)?e.scrollY:e.scrollTop}function Tt(e){return{x:gn(e),y:mn(e)}}var H;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(H||(H={}));function pn(e){return!rt||!e?!1:e===document.scrollingElement}function vn(e){const n={x:0,y:0},t=pn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-t.width,y:e.scrollHeight-t.height},s=e.scrollTop<=n.y,o=e.scrollLeft<=n.x,i=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:s,isLeft:o,isBottom:i,isRight:a,maxScroll:r,minScroll:n}}const cs={x:.2,y:.2};function us(e,n,t,r,s){let{top:o,left:i,right:a,bottom:l}=t;r===void 0&&(r=10),s===void 0&&(s=cs);const{isTop:c,isBottom:d,isLeft:f,isRight:h}=vn(e),p={x:0,y:0},E={x:0,y:0},b={height:n.height*s.y,width:n.width*s.x};return!c&&o<=n.top+b.height?(p.y=H.Backward,E.y=r*Math.abs((n.top+b.height-o)/b.height)):!d&&l>=n.bottom-b.height&&(p.y=H.Forward,E.y=r*Math.abs((n.bottom-b.height-l)/b.height)),!h&&a>=n.right-b.width?(p.x=H.Forward,E.x=r*Math.abs((n.right-b.width-a)/b.width)):!f&&i<=n.left+b.width&&(p.x=H.Backward,E.x=r*Math.abs((n.left+b.width-i)/b.width)),{direction:p,speed:E}}function ds(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:i}=window;return{top:0,left:0,right:o,bottom:i,width:o,height:i}}const{top:n,left:t,right:r,bottom:s}=e.getBoundingClientRect();return{top:n,left:t,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function bn(e){return e.reduce((n,t)=>ke(n,Tt(t)),le)}function fs(e){return e.reduce((n,t)=>n+gn(t),0)}function hs(e){return e.reduce((n,t)=>n+mn(t),0)}function xn(e,n){if(n===void 0&&(n=Oe),!e)return;const{top:t,left:r,bottom:s,right:o}=n(e);hn(e)&&(s<=0||o<=0||t>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const gs=[["x",["left","right"],fs],["y",["top","bottom"],hs]];class It{constructor(n,t){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=Ot(t),s=bn(r);this.rect={...n},this.width=n.width,this.height=n.height;for(const[o,i,a]of gs)for(const l of i)Object.defineProperty(this,l,{get:()=>{const c=a(r),d=s[o]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class We{constructor(n){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(t=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...t)})},this.target=n}add(n,t,r){var s;(s=this.target)==null||s.addEventListener(n,t,r),this.listeners.push([n,t,r])}}function ms(e){const{EventTarget:n}=Z(e);return e instanceof n?e:je(e)}function Mt(e,n){const t=Math.abs(e.x),r=Math.abs(e.y);return typeof n=="number"?Math.sqrt(t**2+r**2)>n:"x"in n&&"y"in n?t>n.x&&r>n.y:"x"in n?t>n.x:"y"in n?r>n.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 yn(e){e.preventDefault()}function ps(e){e.stopPropagation()}var R;(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"})(R||(R={}));const wn={start:[R.Space,R.Enter],cancel:[R.Esc],end:[R.Space,R.Enter,R.Tab]},vs=(e,n)=>{let{currentCoordinates:t}=n;switch(e.code){case R.Right:return{...t,x:t.x+25};case R.Left:return{...t,x:t.x-25};case R.Down:return{...t,y:t.y+25};case R.Up:return{...t,y:t.y-25}}};class Cn{constructor(n){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=n;const{event:{target:t}}=n;this.props=n,this.listeners=new We(je(t)),this.windowListeners=new We(Z(t)),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:n,onStart:t}=this.props,r=n.node.current;r&&xn(r),t(le)}handleKeyDown(n){if(lt(n)){const{active:t,context:r,options:s}=this.props,{keyboardCodes:o=wn,coordinateGetter:i=vs,scrollBehavior:a="smooth"}=s,{code:l}=n;if(o.end.includes(l)){this.handleEnd(n);return}if(o.cancel.includes(l)){this.handleCancel(n);return}const{collisionRect:c}=r.current,d=c?{x:c.left,y:c.top}:le;this.referenceCoordinates||(this.referenceCoordinates=d);const f=i(n,{active:t,context:r.current,currentCoordinates:d});if(f){const h=at(f,d),p={x:0,y:0},{scrollableAncestors:E}=r.current;for(const b of E){const v=n.code,{isTop:k,isRight:j,isLeft:T,isBottom:A,maxScroll:S,minScroll:x}=vn(b),C=ds(b),y={x:Math.min(v===R.Right?C.right-C.width/2:C.right,Math.max(v===R.Right?C.left:C.left+C.width/2,f.x)),y:Math.min(v===R.Down?C.bottom-C.height/2:C.bottom,Math.max(v===R.Down?C.top:C.top+C.height/2,f.y))},I=v===R.Right&&!j||v===R.Left&&!T,w=v===R.Down&&!A||v===R.Up&&!k;if(I&&y.x!==f.x){const D=b.scrollLeft+h.x,O=v===R.Right&&D<=S.x||v===R.Left&&D>=x.x;if(O&&!h.y){b.scrollTo({left:D,behavior:a});return}O?p.x=b.scrollLeft-D:p.x=v===R.Right?b.scrollLeft-S.x:b.scrollLeft-x.x,p.x&&b.scrollBy({left:-p.x,behavior:a});break}else if(w&&y.y!==f.y){const D=b.scrollTop+h.y,O=v===R.Down&&D<=S.y||v===R.Up&&D>=x.y;if(O&&!h.x){b.scrollTo({top:D,behavior:a});return}O?p.y=b.scrollTop-D:p.y=v===R.Down?b.scrollTop-S.y:b.scrollTop-x.y,p.y&&b.scrollBy({top:-p.y,behavior:a});break}}this.handleMove(n,ke(at(f,this.referenceCoordinates),p))}}}handleMove(n,t){const{onMove:r}=this.props;n.preventDefault(),r(t)}handleEnd(n){const{onEnd:t}=this.props;n.preventDefault(),this.detach(),t()}handleCancel(n){const{onCancel:t}=this.props;n.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Cn.activators=[{eventName:"onKeyDown",handler:(e,n,t)=>{let{keyboardCodes:r=wn,onActivation:s}=n,{active:o}=t;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const a=o.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),s?.({event:e.nativeEvent}),!0)}return!1}}];function Sn(e){return!!(e&&"distance"in e)}function En(e){return!!(e&&"delay"in e)}class _t{constructor(n,t,r){var s;r===void 0&&(r=ms(n.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=n,this.events=t;const{event:o}=n,{target:i}=o;this.props=n,this.events=t,this.document=je(i),this.documentListeners=new We(this.document),this.listeners=new We(r),this.windowListeners=new We(Z(i)),this.initialCoordinates=(s=ct(o))!=null?s:le,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:n,props:{options:{activationConstraint:t,bypassActivationConstraint:r}}}=this;if(this.listeners.add(n.move.name,this.handleMove,{passive:!1}),this.listeners.add(n.end.name,this.handleEnd),n.cancel&&this.listeners.add(n.cancel.name,this.handleCancel),this.windowListeners.add(oe.Resize,this.handleCancel),this.windowListeners.add(oe.DragStart,yn),this.windowListeners.add(oe.VisibilityChange,this.handleCancel),this.windowListeners.add(oe.ContextMenu,yn),this.documentListeners.add(oe.Keydown,this.handleKeydown),t){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(En(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(Sn(t)){this.handlePending(t);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(n,t){const{active:r,onPending:s}=this.props;s(r,n,this.initialCoordinates,t)}handleStart(){const{initialCoordinates:n}=this,{onStart:t}=this.props;n&&(this.activated=!0,this.documentListeners.add(oe.Click,ps,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oe.SelectionChange,this.removeTextSelection),t(n))}handleMove(n){var t;const{activated:r,initialCoordinates:s,props:o}=this,{onMove:i,options:{activationConstraint:a}}=o;if(!s)return;const l=(t=ct(n))!=null?t:le,c=at(s,l);if(!r&&a){if(Sn(a)){if(a.tolerance!=null&&Mt(c,a.tolerance))return this.handleCancel();if(Mt(c,a.distance))return this.handleStart()}if(En(a)&&Mt(c,a.tolerance))return this.handleCancel();this.handlePending(a,c);return}n.cancelable&&n.preventDefault(),i(l)}handleEnd(){const{onAbort:n,onEnd:t}=this.props;this.detach(),this.activated||n(this.props.active),t()}handleCancel(){const{onAbort:n,onCancel:t}=this.props;this.detach(),this.activated||n(this.props.active),t()}handleKeydown(n){n.code===R.Esc&&this.handleCancel()}removeTextSelection(){var n;(n=this.document.getSelection())==null||n.removeAllRanges()}}const bs={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class dt extends _t{constructor(n){const{event:t}=n,r=je(t.target);super(n,bs,r)}}dt.activators=[{eventName:"onPointerDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return!t.isPrimary||t.button!==0?!1:(r?.({event:t}),!0)}}];const xs={move:{name:"mousemove"},end:{name:"mouseup"}};var zt;(function(e){e[e.RightClick=2]="RightClick"})(zt||(zt={}));class ys extends _t{constructor(n){super(n,xs,je(n.event.target))}}ys.activators=[{eventName:"onMouseDown",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;return t.button===zt.RightClick?!1:(r?.({event:t}),!0)}}];const Lt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Nn extends _t{constructor(n){super(n,Lt)}static setup(){return window.addEventListener(Lt.move.name,n,{capture:!1,passive:!1}),function(){window.removeEventListener(Lt.move.name,n)};function n(){}}}Nn.activators=[{eventName:"onTouchStart",handler:(e,n)=>{let{nativeEvent:t}=e,{onActivation:r}=n;const{touches:s}=t;return s.length>1?!1:(r?.({event:t}),!0)}}];var Ye;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ye||(Ye={}));var ft;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(ft||(ft={}));function ws(e){let{acceleration:n,activator:t=Ye.Pointer,canScroll:r,draggingRect:s,enabled:o,interval:i=5,order:a=ft.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:f,threshold:h}=e;const p=Ss({delta:f,disabled:!o}),[E,b]=zr(),v=u.useRef({x:0,y:0}),k=u.useRef({x:0,y:0}),j=u.useMemo(()=>{switch(t){case Ye.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Ye.DraggableRect:return s}},[t,s,l]),T=u.useRef(null),A=u.useCallback(()=>{const x=T.current;if(!x)return;const C=v.current.x*k.current.x,y=v.current.y*k.current.y;x.scrollBy(C,y)},[]),S=u.useMemo(()=>a===ft.TreeOrder?[...c].reverse():c,[a,c]);u.useEffect(()=>{if(!o||!c.length||!j){b();return}for(const x of S){if(r?.(x)===!1)continue;const C=c.indexOf(x),y=d[C];if(!y)continue;const{direction:I,speed:w}=us(x,y,j,n,h);for(const D of["x","y"])p[D][I[D]]||(w[D]=0,I[D]=0);if(w.x>0||w.y>0){b(),T.current=x,E(A,i),v.current=w,k.current=I;return}}v.current={x:0,y:0},k.current={x:0,y:0},b()},[n,A,r,b,o,i,JSON.stringify(j),JSON.stringify(p),E,c,S,d,JSON.stringify(h)])}const Cs={x:{[H.Backward]:!1,[H.Forward]:!1},y:{[H.Backward]:!1,[H.Forward]:!1}};function Ss(e){let{delta:n,disabled:t}=e;const r=it(n);return Ve(s=>{if(t||!r||!s)return Cs;const o={x:Math.sign(n.x-r.x),y:Math.sign(n.y-r.y)};return{x:{[H.Backward]:s.x[H.Backward]||o.x===-1,[H.Forward]:s.x[H.Forward]||o.x===1},y:{[H.Backward]:s.y[H.Backward]||o.y===-1,[H.Forward]:s.y[H.Forward]||o.y===1}}},[t,n,r])}function Es(e,n){const t=n!=null?e.get(n):void 0,r=t?t.node.current:null;return Ve(s=>{var o;return n==null?null:(o=r??s)!=null?o:null},[r,n])}function Ns(e,n){return u.useMemo(()=>e.reduce((t,r)=>{const{sensor:s}=r,o=s.activators.map(i=>({eventName:i.eventName,handler:n(i.handler,r)}));return[...t,...o]},[]),[e,n])}var qe;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(qe||(qe={}));var Rt;(function(e){e.Optimized="optimized"})(Rt||(Rt={}));const Dn=new Map;function Ds(e,n){let{dragging:t,dependencies:r,config:s}=n;const[o,i]=u.useState(null),{frequency:a,measure:l,strategy:c}=s,d=u.useRef(e),f=v(),h=Be(f),p=u.useCallback(function(k){k===void 0&&(k=[]),!h.current&&i(j=>j===null?k:j.concat(k.filter(T=>!j.includes(T))))},[h]),E=u.useRef(null),b=Ve(k=>{if(f&&!t)return Dn;if(!k||k===Dn||d.current!==e||o!=null){const j=new Map;for(let T of e){if(!T)continue;if(o&&o.length>0&&!o.includes(T.id)&&T.rect.current){j.set(T.id,T.rect.current);continue}const A=T.node.current,S=A?new It(l(A),A):null;T.rect.current=S,S&&j.set(T.id,S)}return j}return k},[e,o,t,f,l]);return u.useEffect(()=>{d.current=e},[e]),u.useEffect(()=>{f||p()},[t,f]),u.useEffect(()=>{o&&o.length>0&&i(null)},[JSON.stringify(o)]),u.useEffect(()=>{f||typeof a!="number"||E.current!==null||(E.current=setTimeout(()=>{p(),E.current=null},a))},[a,f,p,...r]),{droppableRects:b,measureDroppableContainers:p,measuringScheduled:o!=null};function v(){switch(c){case qe.Always:return!1;case qe.BeforeDragging:return t;default:return!t}}}function Pt(e,n){return Ve(t=>e?t||(typeof n=="function"?n(e):e):null,[n,e])}function js(e,n){return Pt(e,n)}function ks(e){let{callback:n,disabled:t}=e;const r=st(n),s=u.useMemo(()=>{if(t||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,t]);return u.useEffect(()=>()=>s?.disconnect(),[s]),s}function ht(e){let{callback:n,disabled:t}=e;const r=st(n),s=u.useMemo(()=>{if(t||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[t]);return u.useEffect(()=>()=>s?.disconnect(),[s]),s}function Os(e){return new It(Oe(e),e)}function jn(e,n,t){n===void 0&&(n=Os);const[r,s]=u.useState(null);function o(){s(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??t)!=null?c:null}const d=n(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const i=ks({callback(l){if(e)for(const c of l){const{type:d,target:f}=c;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),a=ht({callback:o});return ae(()=>{o(),e?(a?.observe(e),i?.observe(document.body,{childList:!0,subtree:!0})):(a?.disconnect(),i?.disconnect())},[e]),r}function As(e){const n=Pt(e);return un(e,n)}const kn=[];function Ts(e){const n=u.useRef(e),t=Ve(r=>e?r&&r!==kn&&e&&n.current&&e.parentNode===n.current.parentNode?r:Ot(e):kn,[e]);return u.useEffect(()=>{n.current=e},[e]),t}function Is(e){const[n,t]=u.useState(null),r=u.useRef(e),s=u.useCallback(o=>{const i=At(o.target);i&&t(a=>a?(a.set(i,Tt(i)),new Map(a)):null)},[]);return u.useEffect(()=>{const o=r.current;if(e!==o){i(o);const a=e.map(l=>{const c=At(l);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,Tt(c)]):null}).filter(l=>l!=null);t(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(o)};function i(a){a.forEach(l=>{const c=At(l);c?.removeEventListener("scroll",s)})}},[s,e]),u.useMemo(()=>e.length?n?Array.from(n.values()).reduce((o,i)=>ke(o,i),le):bn(e):le,[e,n])}function On(e,n){n===void 0&&(n=[]);const t=u.useRef(null);return u.useEffect(()=>{t.current=null},n),u.useEffect(()=>{const r=e!==le;r&&!t.current&&(t.current=e),!r&&t.current&&(t.current=null)},[e]),t.current?at(e,t.current):le}function Ms(e){u.useEffect(()=>{if(!rt)return;const n=e.map(t=>{let{sensor:r}=t;return r.setup==null?void 0:r.setup()});return()=>{for(const t of n)t?.()}},e.map(n=>{let{sensor:t}=n;return t}))}function _s(e,n){return u.useMemo(()=>e.reduce((t,r)=>{let{eventName:s,handler:o}=r;return t[s]=i=>{o(i,n)},t},{}),[e,n])}function An(e){return u.useMemo(()=>e?is(e):null,[e])}const Tn=[];function zs(e,n){n===void 0&&(n=Oe);const[t]=e,r=An(t?Z(t):null),[s,o]=u.useState(Tn);function i(){o(()=>e.length?e.map(l=>pn(l)?r:new It(n(l),l)):Tn)}const a=ht({callback:i});return ae(()=>{a?.disconnect(),i(),e.forEach(l=>a?.observe(l))},[e]),s}function In(e){if(!e)return null;if(e.children.length>1)return e;const n=e.children[0];return $e(n)?n:e}function Ls(e){let{measure:n}=e;const[t,r]=u.useState(null),s=u.useCallback(c=>{for(const{target:d}of c)if($e(d)){r(f=>{const h=n(d);return f?{...f,width:h.width,height:h.height}:h});break}},[n]),o=ht({callback:s}),i=u.useCallback(c=>{const d=In(c);o?.disconnect(),d&&o?.observe(d),r(d?n(d):null)},[n,o]),[a,l]=ot(i);return u.useMemo(()=>({nodeRef:a,rect:t,setRef:l}),[t,a,l])}const Rs=[{sensor:dt,options:{}},{sensor:Cn,options:{}}],Ps={current:{}},gt={draggable:{measure:fn},droppable:{measure:fn,strategy:qe.WhileDragging,frequency:Rt.Optimized},dragOverlay:{measure:Oe}};class Ue extends Map{get(n){var t;return n!=null&&(t=super.get(n))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(n=>{let{disabled:t}=n;return!t})}getNodeFor(n){var t,r;return(t=(r=this.get(n))==null?void 0:r.node.current)!=null?t:void 0}}const Fs={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Ue,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ut},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:gt,measureDroppableContainers:ut,windowRect:null,measuringScheduled:!1},Mn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ut,draggableNodes:new Map,over:null,measureDroppableContainers:ut},Xe=u.createContext(Mn),_n=u.createContext(Fs);function $s(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Ue}}}function Bs(e,n){switch(n.type){case X.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:n.initialCoordinates,active:n.active}};case X.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:n.coordinates.x-e.draggable.initialCoordinates.x,y:n.coordinates.y-e.draggable.initialCoordinates.y}}};case X.DragEnd:case X.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case X.RegisterDroppable:{const{element:t}=n,{id:r}=t,s=new Ue(e.droppable.containers);return s.set(r,t),{...e,droppable:{...e.droppable,containers:s}}}case X.SetDroppableDisabled:{const{id:t,key:r,disabled:s}=n,o=e.droppable.containers.get(t);if(!o||r!==o.key)return e;const i=new Ue(e.droppable.containers);return i.set(t,{...o,disabled:s}),{...e,droppable:{...e.droppable,containers:i}}}case X.UnregisterDroppable:{const{id:t,key:r}=n,s=e.droppable.containers.get(t);if(!s||r!==s.key)return e;const o=new Ue(e.droppable.containers);return o.delete(t),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Vs(e){let{disabled:n}=e;const{active:t,activatorEvent:r,draggableNodes:s}=u.useContext(Xe),o=it(r),i=it(t?.id);return u.useEffect(()=>{if(!n&&!r&&o&&i!=null){if(!lt(o)||document.activeElement===o.target)return;const a=s.get(i);if(!a)return;const{activatorNode:l,node:c}=a;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const f=Pr(d);if(f){f.focus();break}}})}},[r,n,s,i,o]),null}function zn(e,n){let{transform:t,...r}=n;return e!=null&&e.length?e.reduce((s,o)=>o({transform:s,...r}),t):t}function Ks(e){return u.useMemo(()=>({draggable:{...gt.draggable,...e?.draggable},droppable:{...gt.droppable,...e?.droppable},dragOverlay:{...gt.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Ws(e){let{activeNode:n,measure:t,initialRect:r,config:s=!0}=e;const o=u.useRef(!1),{x:i,y:a}=typeof s=="boolean"?{x:s,y:s}:s;ae(()=>{if(!i&&!a||!n){o.current=!1;return}if(o.current||!r)return;const c=n?.node.current;if(!c||c.isConnected===!1)return;const d=t(c),f=un(d,r);if(i||(f.x=0),a||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=hn(c);h&&h.scrollBy({top:f.y,left:f.x})}},[n,i,a,r,t])}const mt=u.createContext({...le,scaleX:1,scaleY:1});var ve;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ve||(ve={}));const Ln=u.memo(function(n){var t,r,s,o;let{id:i,accessibility:a,autoScroll:l=!0,children:c,sensors:d=Rs,collisionDetection:f=es,measuring:h,modifiers:p,...E}=n;const b=u.useReducer(Bs,void 0,$s),[v,k]=b,[j,T]=Wr(),[A,S]=u.useState(ve.Uninitialized),x=A===ve.Initialized,{draggable:{active:C,nodes:y,translate:I},droppable:{containers:w}}=v,D=C!=null?y.get(C):null,O=u.useRef({initial:null,translated:null}),M=u.useMemo(()=>{var Q;return C!=null?{id:C,data:(Q=D?.data)!=null?Q:Ps,rect:O}:null},[C,D]),V=u.useRef(null),[P,K]=u.useState(null),[$,q]=u.useState(null),Y=Be(E,Object.values(E)),ce=Ke("DndDescribedBy",i),m=u.useMemo(()=>w.getEnabled(),[w]),N=Ks(h),{droppableRects:z,measureDroppableContainers:L,measuringScheduled:ue}=Ds(m,{dragging:x,dependencies:[I.x,I.y],config:N.droppable}),G=Es(y,C),W=u.useMemo(()=>$?ct($):null,[$]),ee=Ho(),te=js(G,N.draggable.measure);Ws({activeNode:C!=null?y.get(C):null,config:ee.layoutShiftCompensation,initialRect:te,measure:N.draggable.measure});const B=jn(G,N.draggable.measure,te),He=jn(G?G.parentElement:null),de=u.useRef({activatorEvent:null,active:null,activeNode:G,collisionRect:null,collisions:null,droppableRects:z,draggableNodes:y,draggingNode:null,draggingNodeRect:null,droppableContainers:w,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Te=w.getNodeFor((t=de.current.over)==null?void 0:t.id),me=Ls({measure:N.dragOverlay.measure}),Ie=(r=me.nodeRef.current)!=null?r:G,Me=x?(s=me.rect)!=null?s:B:null,Zn=!!(me.nodeRef.current&&me.rect),er=As(Zn?null:B),Yt=An(Ie?Z(Ie):null),be=Ts(x?Te??G:null),wt=zs(be),Ct=zn(p,{transform:{x:I.x-er.x,y:I.y-er.y,scaleX:1,scaleY:1},activatorEvent:$,active:M,activeNodeRect:B,containerNodeRect:He,draggingNodeRect:Me,over:de.current.over,overlayNodeRect:me.rect,scrollableAncestors:be,scrollableAncestorRects:wt,windowRect:Yt}),tr=W?ke(W,I):null,nr=Is(be),Vo=On(nr),Ko=On(nr,[B]),_e=ke(Ct,Vo),ze=Me?rs(Me,Ct):null,Je=M&&ze?f({active:M,collisionRect:ze,droppableRects:z,droppableContainers:m,pointerCoordinates:tr}):null,rr=Qr(Je,"id"),[xe,sr]=u.useState(null),Wo=Zn?Ct:ke(Ct,Ko),Yo=ts(Wo,(o=xe?.rect)!=null?o:null,B),qt=u.useRef(null),or=u.useCallback((Q,ne)=>{let{sensor:re,options:ye}=ne;if(V.current==null)return;const ie=y.get(V.current);if(!ie)return;const se=Q.nativeEvent,fe=new re({active:V.current,activeNode:ie,event:se,options:ye,context:de,onAbort(J){if(!y.get(J))return;const{onDragAbort:he}=Y.current,pe={id:J};he?.(pe),j({type:"onDragAbort",event:pe})},onPending(J,we,he,pe){if(!y.get(J))return;const{onDragPending:Qe}=Y.current,Ce={id:J,constraint:we,initialCoordinates:he,offset:pe};Qe?.(Ce),j({type:"onDragPending",event:Ce})},onStart(J){const we=V.current;if(we==null)return;const he=y.get(we);if(!he)return;const{onDragStart:pe}=Y.current,Ge={activatorEvent:se,active:{id:we,data:he.data,rect:O}};Ne.unstable_batchedUpdates(()=>{pe?.(Ge),S(ve.Initializing),k({type:X.DragStart,initialCoordinates:J,active:we}),j({type:"onDragStart",event:Ge}),K(qt.current),q(se)})},onMove(J){k({type:X.DragMove,coordinates:J})},onEnd:Le(X.DragEnd),onCancel:Le(X.DragCancel)});qt.current=fe;function Le(J){return async function(){const{active:he,collisions:pe,over:Ge,scrollAdjustedTranslate:Qe}=de.current;let Ce=null;if(he&&Qe){const{cancelDrop:Ze}=Y.current;Ce={activatorEvent:se,active:he,collisions:pe,delta:Qe,over:Ge},J===X.DragEnd&&typeof Ze=="function"&&await Promise.resolve(Ze(Ce))&&(J=X.DragCancel)}V.current=null,Ne.unstable_batchedUpdates(()=>{k({type:J}),S(ve.Uninitialized),sr(null),K(null),q(null),qt.current=null;const Ze=J===X.DragEnd?"onDragEnd":"onDragCancel";if(Ce){const Ut=Y.current[Ze];Ut?.(Ce),j({type:Ze,event:Ce})}})}}},[y]),qo=u.useCallback((Q,ne)=>(re,ye)=>{const ie=re.nativeEvent,se=y.get(ye);if(V.current!==null||!se||ie.dndKit||ie.defaultPrevented)return;const fe={active:se};Q(re,ne.options,fe)===!0&&(ie.dndKit={capturedBy:ne.sensor},V.current=ye,or(re,ne))},[y,or]),ir=Ns(d,qo);Ms(d),ae(()=>{B&&A===ve.Initializing&&S(ve.Initialized)},[B,A]),u.useEffect(()=>{const{onDragMove:Q}=Y.current,{active:ne,activatorEvent:re,collisions:ye,over:ie}=de.current;if(!ne||!re)return;const se={active:ne,activatorEvent:re,collisions:ye,delta:{x:_e.x,y:_e.y},over:ie};Ne.unstable_batchedUpdates(()=>{Q?.(se),j({type:"onDragMove",event:se})})},[_e.x,_e.y]),u.useEffect(()=>{const{active:Q,activatorEvent:ne,collisions:re,droppableContainers:ye,scrollAdjustedTranslate:ie}=de.current;if(!Q||V.current==null||!ne||!ie)return;const{onDragOver:se}=Y.current,fe=ye.get(rr),Le=fe&&fe.rect.current?{id:fe.id,rect:fe.rect.current,data:fe.data,disabled:fe.disabled}:null,J={active:Q,activatorEvent:ne,collisions:re,delta:{x:ie.x,y:ie.y},over:Le};Ne.unstable_batchedUpdates(()=>{sr(Le),se?.(J),j({type:"onDragOver",event:J})})},[rr]),ae(()=>{de.current={activatorEvent:$,active:M,activeNode:G,collisionRect:ze,collisions:Je,droppableRects:z,draggableNodes:y,draggingNode:Ie,draggingNodeRect:Me,droppableContainers:w,over:xe,scrollableAncestors:be,scrollAdjustedTranslate:_e},O.current={initial:Me,translated:ze}},[M,G,Je,ze,y,Ie,Me,z,w,xe,be,_e]),ws({...ee,delta:I,draggingRect:ze,pointerCoordinates:tr,scrollableAncestors:be,scrollableAncestorRects:wt});const Uo=u.useMemo(()=>({active:M,activeNode:G,activeNodeRect:B,activatorEvent:$,collisions:Je,containerNodeRect:He,dragOverlay:me,draggableNodes:y,droppableContainers:w,droppableRects:z,over:xe,measureDroppableContainers:L,scrollableAncestors:be,scrollableAncestorRects:wt,measuringConfiguration:N,measuringScheduled:ue,windowRect:Yt}),[M,G,B,$,Je,He,me,y,w,z,xe,L,be,wt,N,ue,Yt]),Xo=u.useMemo(()=>({activatorEvent:$,activators:ir,active:M,activeNodeRect:B,ariaDescribedById:{draggable:ce},dispatch:k,draggableNodes:y,over:xe,measureDroppableContainers:L}),[$,ir,M,B,k,ce,y,xe,L]);return u.createElement(on.Provider,{value:T},u.createElement(Xe.Provider,{value:Xo},u.createElement(_n.Provider,{value:Uo},u.createElement(mt.Provider,{value:Yo},c)),u.createElement(Vs,{disabled:a?.restoreFocus===!1})),u.createElement(Ur,{...a,hiddenTextDescribedById:ce}));function Ho(){const Q=P?.autoScrollEnabled===!1,ne=typeof l=="object"?l.enabled===!1:l===!1,re=x&&!Q&&!ne;return typeof l=="object"?{...l,enabled:re}:{enabled:re}}}),Ys=u.createContext(null),Rn="button",qs="Draggable";function Us(e){let{id:n,data:t,disabled:r=!1,attributes:s}=e;const o=Ke(qs),{activators:i,activatorEvent:a,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:f,over:h}=u.useContext(Xe),{role:p=Rn,roleDescription:E="draggable",tabIndex:b=0}=s??{},v=l?.id===n,k=u.useContext(v?mt:Ys),[j,T]=ot(),[A,S]=ot(),x=_s(i,n),C=Be(t);ae(()=>(f.set(n,{id:n,key:o,node:j,activatorNode:A,data:C}),()=>{const I=f.get(n);I&&I.key===o&&f.delete(n)}),[f,n]);const y=u.useMemo(()=>({role:p,tabIndex:b,"aria-disabled":r,"aria-pressed":v&&p===Rn?!0:void 0,"aria-roledescription":E,"aria-describedby":d.draggable}),[r,p,b,v,E,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:c,attributes:y,isDragging:v,listeners:r?void 0:x,node:j,over:h,setNodeRef:T,setActivatorNodeRef:S,transform:k}}function Pn(){return u.useContext(_n)}const Xs="Droppable",Hs={timeout:25};function Js(e){let{data:n,disabled:t=!1,id:r,resizeObserverConfig:s}=e;const o=Ke(Xs),{active:i,dispatch:a,over:l,measureDroppableContainers:c}=u.useContext(Xe),d=u.useRef({disabled:t}),f=u.useRef(!1),h=u.useRef(null),p=u.useRef(null),{disabled:E,updateMeasurementsFor:b,timeout:v}={...Hs,...s},k=Be(b??r),j=u.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(k.current)?k.current:[k.current]),p.current=null},v)},[v]),T=ht({callback:j,disabled:E||!i}),A=u.useCallback((y,I)=>{T&&(I&&(T.unobserve(I),f.current=!1),y&&T.observe(y))},[T]),[S,x]=ot(A),C=Be(n);return u.useEffect(()=>{!T||!S.current||(T.disconnect(),f.current=!1,T.observe(S.current))},[S,T]),u.useEffect(()=>(a({type:X.RegisterDroppable,element:{id:r,key:o,disabled:t,node:S,rect:h,data:C}}),()=>a({type:X.UnregisterDroppable,key:o,id:r})),[r]),u.useEffect(()=>{t!==d.current.disabled&&(a({type:X.SetDroppableDisabled,id:r,key:o,disabled:t}),d.current.disabled=t)},[r,o,t,a]),{active:i,rect:h,isOver:l?.id===r,node:S,over:l,setNodeRef:x}}function Gs(e){let{animation:n,children:t}=e;const[r,s]=u.useState(null),[o,i]=u.useState(null),a=it(t);return!t&&!r&&a&&s(a),ae(()=>{if(!o)return;const l=r?.key,c=r?.props.id;if(l==null||c==null){s(null);return}Promise.resolve(n(c,o)).then(()=>{s(null)})},[n,r,o]),u.createElement(u.Fragment,null,t,r?u.cloneElement(r,{ref:i}):null)}const Qs={x:0,y:0,scaleX:1,scaleY:1};function Zs(e){let{children:n}=e;return u.createElement(Xe.Provider,{value:Mn},u.createElement(mt.Provider,{value:Qs},n))}const eo={position:"fixed",touchAction:"none"},to=e=>lt(e)?"transform 250ms ease":void 0,no=u.forwardRef((e,n)=>{let{as:t,activatorEvent:r,adjustScale:s,children:o,className:i,rect:a,style:l,transform:c,transition:d=to}=e;if(!a)return null;const f=s?c:{...c,scaleX:1,scaleY:1},h={...eo,width:a.width,height:a.height,top:a.top,left:a.left,transform:ge.Transform.toString(f),transformOrigin:s&&r?Hr(r,a):void 0,transition:typeof d=="function"?d(r):d,...l};return u.createElement(t,{className:i,style:h,ref:n},o)}),ro={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:n,final:t}}=e;return[{transform:ge.Transform.toString(n)},{transform:ge.Transform.toString(t)}]},sideEffects:(e=>n=>{let{active:t,dragOverlay:r}=n;const s={},{styles:o,className:i}=e;if(o!=null&&o.active)for(const[a,l]of Object.entries(o.active))l!==void 0&&(s[a]=t.node.style.getPropertyValue(a),t.node.style.setProperty(a,l));if(o!=null&&o.dragOverlay)for(const[a,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return i!=null&&i.active&&t.node.classList.add(i.active),i!=null&&i.dragOverlay&&r.node.classList.add(i.dragOverlay),function(){for(const[l,c]of Object.entries(s))t.node.style.setProperty(l,c);i!=null&&i.active&&t.node.classList.remove(i.active)}})({styles:{active:{opacity:"0"}}})};function so(e){let{config:n,draggableNodes:t,droppableContainers:r,measuringConfiguration:s}=e;return st((o,i)=>{if(n===null)return;const a=t.get(o);if(!a)return;const l=a.node.current;if(!l)return;const c=In(i);if(!c)return;const{transform:d}=Z(i).getComputedStyle(i),f=dn(d);if(!f)return;const h=typeof n=="function"?n:oo(n);return xn(l,s.draggable.measure),h({active:{id:o,data:a.data,node:l,rect:s.draggable.measure(l)},draggableNodes:t,dragOverlay:{node:i,rect:s.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:s,transform:f})})}function oo(e){const{duration:n,easing:t,sideEffects:r,keyframes:s}={...ro,...e};return o=>{let{active:i,dragOverlay:a,transform:l,...c}=o;if(!n)return;const d={x:a.rect.left-i.rect.left,y:a.rect.top-i.rect.top},f={scaleX:l.scaleX!==1?i.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?i.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-d.x,y:l.y-d.y,...f},p=s({...c,active:i,dragOverlay:a,transform:{initial:l,final:h}}),[E]=p,b=p[p.length-1];if(JSON.stringify(E)===JSON.stringify(b))return;const v=r?.({active:i,dragOverlay:a,...c}),k=a.node.animate(p,{duration:n,easing:t,fill:"forwards"});return new Promise(j=>{k.onfinish=()=>{v?.(),j()}})}}let Fn=0;function io(e){return u.useMemo(()=>{if(e!=null)return Fn++,Fn},[e])}const $n=u.memo(e=>{let{adjustScale:n=!1,children:t,dropAnimation:r,style:s,transition:o,modifiers:i,wrapperElement:a="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:p,draggableNodes:E,droppableContainers:b,dragOverlay:v,over:k,measuringConfiguration:j,scrollableAncestors:T,scrollableAncestorRects:A,windowRect:S}=Pn(),x=u.useContext(mt),C=io(f?.id),y=zn(i,{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:v.rect,over:k,overlayNodeRect:v.rect,scrollableAncestors:T,scrollableAncestorRects:A,transform:x,windowRect:S}),I=Pt(h),w=so({config:r,draggableNodes:E,droppableContainers:b,measuringConfiguration:j}),D=I?v.setRef:void 0;return u.createElement(Zs,null,u.createElement(Gs,{animation:w},f&&C?u.createElement(no,{key:C,id:f.id,ref:D,as:a,activatorEvent:d,adjustScale:n,className:l,transition:o,rect:I,style:{zIndex:c,...s},transform:y},t):null))});function pt(e,n,t){const r=e.slice();return r.splice(t<0?r.length+t:t,0,r.splice(n,1)[0]),r}function ao(e,n){return e.reduce((t,r,s)=>{const o=n.get(r);return o&&(t[s]=o),t},Array(e.length))}function vt(e){return e!==null&&e>=0}function lo(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let t=0;t<e.length;t++)if(e[t]!==n[t])return!1;return!0}function co(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const Bn=e=>{let{rects:n,activeIndex:t,overIndex:r,index:s}=e;const o=pt(n,r,t),i=n[s],a=o[s];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}},bt={scaleX:1,scaleY:1},Ft=e=>{var n;let{activeIndex:t,activeNodeRect:r,index:s,rects:o,overIndex:i}=e;const a=(n=o[t])!=null?n:r;if(!a)return null;if(s===t){const c=o[i];return c?{x:0,y:t<i?c.top+c.height-(a.top+a.height):c.top-a.top,...bt}:null}const l=uo(o,s,t);return s>t&&s<=i?{x:0,y:-a.height-l,...bt}:s<t&&s>=i?{x:0,y:a.height+l,...bt}:{x:0,y:0,...bt}};function uo(e,n,t){const r=e[n],s=e[n-1],o=e[n+1];return r?t<n?s?r.top-(s.top+s.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):s?r.top-(s.top+s.height):0:0}const Vn="Sortable",Kn=u.createContext({activeIndex:-1,containerId:Vn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Bn,disabled:{draggable:!1,droppable:!1}});function $t(e){let{children:n,id:t,items:r,strategy:s=Bn,disabled:o=!1}=e;const{active:i,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:d}=Pn(),f=Ke(Vn,t),h=a.rect!==null,p=u.useMemo(()=>r.map(x=>typeof x=="object"&&"id"in x?x.id:x),[r]),E=i!=null,b=i?p.indexOf(i.id):-1,v=c?p.indexOf(c.id):-1,k=u.useRef(p),j=!lo(p,k.current),T=v!==-1&&b===-1||j,A=co(o);ae(()=>{j&&E&&d(p)},[j,p,E,d]),u.useEffect(()=>{k.current=p},[p]);const S=u.useMemo(()=>({activeIndex:b,containerId:f,disabled:A,disableTransforms:T,items:p,overIndex:v,useDragOverlay:h,sortedRects:ao(p,l),strategy:s}),[b,f,A.draggable,A.droppable,T,p,v,l,h,s]);return u.createElement(Kn.Provider,{value:S},n)}const fo=e=>{let{id:n,items:t,activeIndex:r,overIndex:s}=e;return pt(t,r,s).indexOf(n)},ho=e=>{let{containerId:n,isSorting:t,wasDragging:r,index:s,items:o,newIndex:i,previousItems:a,previousContainerId:l,transition:c}=e;return!c||!r||a!==o&&s===i?!1:t?!0:i!==s&&n===l},go={duration:200,easing:"ease"},Wn="transform",mo=ge.Transition.toString({property:Wn,duration:0,easing:"linear"}),po={roleDescription:"sortable"};function vo(e){let{disabled:n,index:t,node:r,rect:s}=e;const[o,i]=u.useState(null),a=u.useRef(t);return ae(()=>{if(!n&&t!==a.current&&r.current){const l=s.current;if(l){const c=Oe(r.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&i(d)}}t!==a.current&&(a.current=t)},[n,t,r,s]),u.useEffect(()=>{o&&i(null)},[o]),o}function xt(e){let{animateLayoutChanges:n=ho,attributes:t,disabled:r,data:s,getNewIndex:o=fo,id:i,strategy:a,resizeObserverConfig:l,transition:c=go}=e;const{items:d,containerId:f,activeIndex:h,disabled:p,disableTransforms:E,sortedRects:b,overIndex:v,useDragOverlay:k,strategy:j}=u.useContext(Kn),T=bo(r,p),A=d.indexOf(i),S=u.useMemo(()=>({sortable:{containerId:f,index:A,items:d},...s}),[f,s,A,d]),x=u.useMemo(()=>d.slice(d.indexOf(i)),[d,i]),{rect:C,node:y,isOver:I,setNodeRef:w}=Js({id:i,data:S,disabled:T.droppable,resizeObserverConfig:{updateMeasurementsFor:x,...l}}),{active:D,activatorEvent:O,activeNodeRect:M,attributes:V,setNodeRef:P,listeners:K,isDragging:$,over:q,setActivatorNodeRef:Y,transform:ce}=Us({id:i,data:S,attributes:{...po,...t},disabled:T.draggable}),m=_r(w,P),N=!!D,z=N&&!E&&vt(h)&&vt(v),L=!k&&$,ue=L&&z?ce:null,W=z?ue??(a??j)({rects:b,activeNodeRect:M,activeIndex:h,overIndex:v,index:A}):null,ee=vt(h)&&vt(v)?o({id:i,items:d,activeIndex:h,overIndex:v}):A,te=D?.id,B=u.useRef({activeId:te,items:d,newIndex:ee,containerId:f}),He=d!==B.current.items,de=n({active:D,containerId:f,isDragging:$,isSorting:N,id:i,index:A,items:d,newIndex:B.current.newIndex,previousItems:B.current.items,previousContainerId:B.current.containerId,transition:c,wasDragging:B.current.activeId!=null}),Te=vo({disabled:!de,index:A,node:y,rect:C});return u.useEffect(()=>{N&&B.current.newIndex!==ee&&(B.current.newIndex=ee),f!==B.current.containerId&&(B.current.containerId=f),d!==B.current.items&&(B.current.items=d)},[N,ee,f,d]),u.useEffect(()=>{if(te===B.current.activeId)return;if(te!=null&&B.current.activeId==null){B.current.activeId=te;return}const Ie=setTimeout(()=>{B.current.activeId=te},50);return()=>clearTimeout(Ie)},[te]),{active:D,activeIndex:h,attributes:V,data:S,rect:C,index:A,newIndex:ee,items:d,isOver:I,isSorting:N,isDragging:$,listeners:K,node:y,overIndex:v,over:q,setNodeRef:m,setActivatorNodeRef:Y,setDroppableNodeRef:w,setDraggableNodeRef:P,transform:Te??W,transition:me()};function me(){if(Te||He&&B.current.newIndex===A)return mo;if(!(L&&!lt(O)||!c)&&(N||de))return ge.Transition.toString({...c,property:Wn})}}function bo(e,n){var t,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(t=e?.draggable)!=null?t:n.draggable,droppable:(r=e?.droppable)!=null?r:n.droppable}}R.Down,R.Right,R.Up,R.Left;const yt=(...e)=>e.filter(Boolean).join(" "),Bt="Uncategorized";function xo(e,n){if(!n||n.length===0)return{};for(const t of n){const r=e[t.field];if(r==null)continue;let s=!1;const o=String(r);switch(t.operator){case"equals":s=o===String(t.value);break;case"not_equals":s=o!==String(t.value);break;case"contains":s=o.toLowerCase().includes(String(t.value).toLowerCase());break;case"in":s=Array.isArray(t.value)&&t.value.includes(o);break}if(s)return{...t.backgroundColor?{backgroundColor:t.backgroundColor}:{},...t.borderColor?{borderColor:t.borderColor}:{}}}return{}}function Vt({card:e,onCardClick:n,conditionalFormatting:t}){const{attributes:r,listeners:s,setNodeRef:o,transform:i,transition:a,isDragging:l}=xt({id:e.id}),c={transform:ge.Transform.toString(i),transition:a,opacity:l?.5:void 0},d=xo(e,t);return g.jsx("div",{ref:o,style:c,...r,...s,role:"listitem","aria-label":e.title,onClick:()=>n?.(e),children:g.jsxs(F.Card,{className:"mb-2 cursor-grab active:cursor-grabbing border-border border-l-4 border-l-primary/40 bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group touch-manipulation",style:d,children:[e.coverImage&&g.jsx("div",{className:"w-full h-32 overflow-hidden rounded-t-lg",children:g.jsx("img",{src:e.coverImage,alt:"",className:"w-full h-full object-cover",loading:"lazy"})}),g.jsxs(F.CardHeader,{className:"p-2 sm:p-4",children:[g.jsx(F.CardTitle,{className:"text-xs sm:text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors",children:e.title}),e.description&&g.jsx(F.CardDescription,{className:"text-xs text-muted-foreground font-mono line-clamp-2 sm:line-clamp-none",children:e.description})]}),e.badges&&e.badges.length>0&&g.jsx(F.CardContent,{className:"p-2 sm:p-4 pt-0",children:g.jsx("div",{className:"flex flex-wrap gap-1",children:e.badges.map((f,h)=>g.jsx(F.Badge,{variant:f.variant||"default",className:"text-xs",children:f.label},h))})})]})})}function yo({columnId:e,onAdd:n}){const[t,r]=_.useState(!1),[s,o]=_.useState(""),i=_.useRef(null),a=()=>{const c=s.trim();c&&(n(e,c),o("")),r(!1)},l=c=>{c.key==="Enter"?(c.preventDefault(),a()):c.key==="Escape"&&(o(""),r(!1))};return t?g.jsx("div",{className:"mt-2 space-y-2",children:g.jsx(F.Input,{ref:i,value:s,onChange:c=>o(c.target.value),onKeyDown:l,onBlur:a,placeholder:"Enter card title...",className:"text-sm",autoFocus:!0})}):g.jsxs(F.Button,{variant:"ghost",size:"sm",className:"w-full mt-2 text-muted-foreground hover:text-foreground",onClick:()=>{r(!0),setTimeout(()=>i.current?.focus(),0)},children:[g.jsx(tt,{className:"h-4 w-4 mr-1"}),"Add Card"]})}function wo({column:e,cards:n,onCardClick:t,quickAdd:r,onQuickAdd:s,conditionalFormatting:o}){const i=n||[],{setNodeRef:a}=xt({id:e.id,data:{type:"column"}}),l=e.limit&&i.length>=e.limit;return g.jsxs("div",{ref:a,role:"group","aria-label":e.title,className:yt("flex flex-col w-[85vw] sm:w-80 flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl snap-start",e.className),children:[g.jsx("div",{className:"p-3 sm:p-4 border-b border-border/50 bg-muted/30 rounded-t-lg",children:g.jsxs("div",{className:"flex items-center justify-between",children:[g.jsx("h3",{id:`kanban-col-${e.id}`,className:"font-mono text-xs sm:text-sm font-semibold tracking-wider text-primary/90 uppercase truncate",children:e.title}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs(F.Badge,{variant:"secondary",className:"text-xs font-mono tabular-nums",children:[i.length,e.limit&&` / ${e.limit}`]}),l&&g.jsx(F.Badge,{variant:"destructive",className:"text-xs",children:"Full"})]})]})}),g.jsxs(F.ScrollArea,{className:"flex-1 p-4",children:[g.jsx($t,{items:i.map(c=>c.id),strategy:Ft,children:g.jsxs("div",{className:"space-y-2",role:"list","aria-label":`${e.title} cards`,children:[i.length===0&&g.jsx("div",{className:"flex flex-col items-center justify-center py-8 text-muted-foreground/50",children:g.jsx("span",{className:"text-xs font-mono",children:"No cards"})}),i.map(c=>g.jsx(Vt,{card:c,onCardClick:t,conditionalFormatting:o},c.id))]})}),r&&s&&g.jsx(yo,{columnId:e.id,onAdd:s})]})]})}function Co({children:e}){const n=Re.useDnd();return g.jsx(g.Fragment,{children:e(n)})}function So({columns:e,onCardMove:n,onCardClick:t,className:r,quickAdd:s,onQuickAdd:o,coverImageField:i,conditionalFormatting:a,swimlaneField:l}){return Re.useHasDndProvider()?g.jsx(Co,{children:d=>g.jsx(Yn,{columns:e,onCardMove:n,onCardClick:t,className:r,dnd:d,quickAdd:s,onQuickAdd:o,coverImageField:i,conditionalFormatting:a,swimlaneField:l})}):g.jsx(Yn,{columns:e,onCardMove:n,onCardClick:t,className:r,dnd:null,quickAdd:s,onQuickAdd:o,coverImageField:i,conditionalFormatting:a,swimlaneField:l})}function Yn({columns:e,onCardMove:n,onCardClick:t,className:r,dnd:s,quickAdd:o,onQuickAdd:i,coverImageField:a,conditionalFormatting:l,swimlaneField:c}){const[d,f]=_.useState(null),h=c?`objectui:kanban-collapsed:${c}`:null,[p,E]=_.useState(()=>{if(!h)return new Set;try{const w=localStorage.getItem(h);if(w){const D=JSON.parse(w);if(Array.isArray(D))return new Set(D.filter(O=>typeof O=="string"))}}catch{}return new Set}),b=_.useMemo(()=>(e||[]).map(w=>({...w,cards:w.cards||[]})),[e]),[v,k]=_.useState(b);_.useEffect(()=>{k(b)},[b]);const j=_.useMemo(()=>{if(!c)return null;const w=v.flatMap(O=>O.cards),D=new Set;return w.forEach(O=>{const M=O[c];D.add(M!=null?String(M):Bt)}),Array.from(D).sort()},[v,c]),T=_.useCallback(w=>{E(D=>{const O=new Set(D);if(O.has(w)?O.delete(w):O.add(w),h)try{localStorage.setItem(h,JSON.stringify([...O]))}catch{}return O})},[h]),A=an(kt(dt,{activationConstraint:{distance:5}}),kt(Nn,{activationConstraint:{delay:200,tolerance:5}})),S=w=>{const{active:D}=w,O=C(D.id);if(f(O),s&&O){const M=y(O.id);M&&s.startDrag({id:O.id,type:"kanban-card",data:O,sourceId:M.id})}},x=w=>{const{active:D,over:O}=w;if(f(null),!O){s&&s.endDrag();return}const M=D.id,V=O.id;if(M===V){s&&s.endDrag();return}const P=y(M),K=y(V)||I(V);if(!P||!K){s&&s.endDrag();return}if(P.id===K.id){const $=[...P.cards],q=$.findIndex(m=>m.id===M),Y=$.findIndex(m=>m.id===V),ce=pt($,q,Y);k(m=>m.map(N=>N.id===P.id?{...N,cards:ce}:N))}else{const $=[...P.cards],q=[...K.cards],Y=$.findIndex(z=>z.id===M),m=V===K.id?q.length:q.findIndex(z=>z.id===V),[N]=$.splice(Y,1);q.splice(m,0,N),k(z=>z.map(L=>L.id===P.id?{...L,cards:$}:L.id===K.id?{...L,cards:q}:L)),n&&n(M,P.id,K.id,m)}s&&s.endDrag(K.id)},C=_.useCallback(w=>{for(const D of v){const O=D.cards.find(M=>M.id===w);if(O)return O}return null},[v]),y=_.useCallback(w=>v.find(D=>D.cards.some(O=>O.id===w))||null,[v]),I=_.useCallback(w=>v.find(D=>D.id===w)||null,[v]);return g.jsxs(Ln,{sensors:A,collisionDetection:cn,onDragStart:S,onDragEnd:x,children:[g.jsxs("div",{className:"flex sm:hidden items-center justify-between px-3 pb-2 text-xs text-muted-foreground",children:[g.jsxs("span",{children:[v.length," columns"]}),g.jsx("span",{children:"← Swipe to navigate →"})]}),j?g.jsxs("div",{className:yt("flex flex-col gap-1 p-2 sm:p-4 min-w-0 overflow-hidden",r),role:"region","aria-label":"Kanban board with swimlanes",children:[g.jsx("div",{className:"flex gap-3 sm:gap-4 pl-36 sm:pl-44 overflow-x-auto",children:v.map(w=>g.jsxs("div",{className:"w-[85vw] sm:w-80 flex-shrink-0 text-center",children:[g.jsx("span",{className:"font-mono text-xs sm:text-sm font-semibold tracking-wider text-primary/90 uppercase",children:w.title}),g.jsxs("span",{className:"ml-2 font-mono text-xs text-muted-foreground",children:["(",w.cards.length,")"]})]},w.id))}),j.map(w=>{const D=p.has(w),O=v.reduce((M,V)=>M+V.cards.filter(P=>(P[c]!=null?String(P[c]):Bt)===w).length,0);return g.jsxs("div",{className:"border rounded-lg bg-muted/10",children:[g.jsxs("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-muted/30 transition-colors",onClick:()=>T(w),"aria-expanded":!D,children:[g.jsx("span",{className:yt("transition-transform text-xs",D?"":"rotate-90"),children:"▶"}),g.jsx("span",{className:"font-mono text-xs font-semibold text-muted-foreground uppercase tracking-wider",children:w}),g.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["(",O,")"]})]}),!D&&g.jsx("div",{className:"flex gap-3 sm:gap-4 overflow-x-auto px-2 pb-3 pl-36 sm:pl-44",children:v.map(M=>{const V=M.cards.filter(P=>(P[c]!=null?String(P[c]):Bt)===w);return g.jsx("div",{className:"w-[85vw] sm:w-80 flex-shrink-0 min-h-[60px] rounded-md bg-card/20 p-2",children:g.jsx($t,{items:V.map(P=>P.id),strategy:Ft,children:g.jsx("div",{className:"space-y-2",role:"list","aria-label":`${M.title} - ${w} cards`,children:V.map(P=>g.jsx(Vt,{card:P,onCardClick:t,conditionalFormatting:l},P.id))})})},M.id)})})]},w)})]}):g.jsx("div",{className:yt("flex gap-3 sm:gap-4 overflow-x-auto snap-x snap-mandatory p-2 sm:p-4 bg-muted/10 rounded-lg [-webkit-overflow-scrolling:touch] min-w-0",r),role:"region","aria-label":"Kanban board",children:v.map(w=>g.jsx(wo,{column:w,cards:w.cards,onCardClick:t,quickAdd:o,onQuickAdd:i,conditionalFormatting:l},w.id))}),g.jsx($n,{children:g.jsx("div",{"aria-live":"assertive","aria-label":d?`Dragging ${d.title}`:void 0,children:d?g.jsx(Vt,{card:d,conditionalFormatting:l}):null})})]})}const Eo=Object.freeze(Object.defineProperty({__proto__:null,default:So},Symbol.toStringTag,{value:"Module"}));function Ae(e,n,t){let r=t.initialDeps??[],s,o=!0;function i(){var a,l,c;let d;t.key&&((a=t.debug)!=null&&a.call(t))&&(d=Date.now());const f=e();if(!(f.length!==r.length||f.some((E,b)=>r[b]!==E)))return s;r=f;let p;if(t.key&&((l=t.debug)!=null&&l.call(t))&&(p=Date.now()),s=n(...f),t.key&&((c=t.debug)!=null&&c.call(t))){const E=Math.round((Date.now()-d)*100)/100,b=Math.round((Date.now()-p)*100)/100,v=b/16,k=(j,T)=>{for(j=String(j);j.length<T;)j=" "+j;return j};console.info(`%c⏱ ${k(b,5)} /${k(E,5)} ms`,`
11
11
  font-size: .6rem;
12
12
  font-weight: bold;
13
- color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(i&&t.skipInitialOnChange)&&t.onChange(s),i=!1,s}return a.updateDeps=o=>{r=o},a}function $n(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Gs=(e,n)=>Math.abs(e-n)<1.01,Zs=(e,n,t)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)}},Bn=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},Qs=e=>e,ei=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let s=n;s<=t;s++)r.push(s);return r},ti=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=a=>{const{width:o,height:l}=a;n({width:Math.round(o),height:Math.round(l)})};if(s(Bn(t)),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(a=>{const o=()=>{const l=a[0];if(l?.borderBoxSize){const u=l.borderBoxSize[0];if(u){s({width:u.inlineSize,height:u.blockSize});return}}s(Bn(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},Wn={passive:!0},Vn=typeof window>"u"?!0:"onscrollend"in window,ni=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;let s=0;const i=e.options.useScrollendEvent&&Vn?()=>{}:Zs(r,()=>{n(s,!1)},e.options.isScrollingResetDelay),a=d=>()=>{const{horizontal:f,isRtl:g}=e.options;s=f?t.scrollLeft*(g&&-1||1):t.scrollTop,i(),n(s,d)},o=a(!0),l=a(!1);t.addEventListener("scroll",o,Wn);const u=e.options.useScrollendEvent&&Vn;return u&&t.addEventListener("scrollend",l,Wn),()=>{t.removeEventListener("scroll",o),u&&t.removeEventListener("scrollend",l)}},ri=(e,n,t)=>{if(n?.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},si=(e,{adjustments:n=0,behavior:t},r)=>{var s,i;const a=e+n;(i=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||i.call(s,{[r.options.horizontal?"left":"top"]:a,behavior:t})};class ii{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(i=>{const a=()=>{this._measureElement(i.target,i)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var i;return(i=r())==null?void 0:i.observe(s,{box:"border-box"})},unobserve:s=>{var i;return(i=r())==null?void 0:i.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,s])=>{typeof s>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Qs,rangeExtractor:ei,onChange:()=>{},measureElement:ri,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Te(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=i,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const s=new Map,i=new Map;for(let a=r-1;a>=0;a--){const o=t[a];if(s.has(o.lane))continue;const l=i.get(o.lane);if(l==null||o.end>l.end?i.set(o.lane,o):o.end<l.end&&s.set(o.lane,!0),s.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((a,o)=>a.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurementOptions=Te(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(t,r,s,i,a,o)=>(this.prevLanes!==void 0&&this.prevLanes!==o&&(this.lanesChangedFlag=!0),this.prevLanes=o,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o}),{key:!1}),this.getMeasurements=Te(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:s,getItemKey:i,enabled:a,lanes:o},l)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const g of this.laneAssignments.keys())g>=t&&this.laneAssignments.delete(g);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(g=>{this.itemSizeCache.set(g.key,g.size)}));const u=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const d=this.measurementsCache.slice(0,u),f=new Array(o).fill(void 0);for(let g=0;g<u;g++){const p=d[g];p&&(f[p.lane]=g)}for(let g=u;g<t;g++){const p=i(g),N=this.laneAssignments.get(g);let w,y;if(N!==void 0&&this.options.lanes>1){w=N;const S=f[w],b=S!==void 0?d[S]:void 0;y=b?b.end+this.options.gap:r+s}else{const S=this.options.lanes===1?d[g-1]:this.getFurthestMeasurement(d,g);y=S?S.end+this.options.gap:r+s,w=S?S.lane:g%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(g,w)}const D=l.get(p),v=typeof D=="number"?D:this.options.estimateSize(g),C=y+v;d[g]={index:g,start:y,size:v,end:C,key:p,lane:w},f[w]=g}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Te(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,i)=>this.range=t.length>0&&r>0?oi({measurements:t,outerSize:r,scrollOffset:s,lanes:i}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Te(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,i,a)=>i===null||a===null?[]:t({startIndex:i,endIndex:a,overscan:r,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const s=this.indexFromElement(t),i=this.measurementsCache[s];if(!i)return;const a=i.key,o=this.elementsCache.get(a);o!==t&&(o&&this.observer.unobserve(o),this.observer.observe(t),this.elementsCache.set(a,t)),t.isConnected&&this.resizeItem(s,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const s=this.measurementsCache[t];if(!s)return;const i=this.itemSizeCache.get(s.key)??s.size,a=r-i;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,a,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",a),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(t,void 0)},this.getVirtualItems=Te(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let i=0,a=t.length;i<a;i++){const o=t[i],l=r[o];s.push(l)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return $n(r[Kn(0,r.length-1,s=>$n(r[s]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const i=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=t>=a+i?"end":"start"),r==="center"?t+=(s-i)/2:r==="end"&&(t-=i);const o=this.getMaxScrollOffset();return Math.max(Math.min(o,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.measurementsCache[t];if(!s)return;const i=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(s.end>=a+i-this.options.scrollPaddingEnd)r="end";else if(s.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const o=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(o,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1)),this.currentScrollToIndex=t;let i=0;const a=10,o=u=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(t,u);if(!d){console.warn("Failed to get offset for index:",t);return}const[f,g]=d;this._scrollToOffset(f,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const p=()=>{if(this.currentScrollToIndex!==t)return;const N=this.getScrollOffset(),w=this.getOffsetForIndex(t,g);if(!w){console.warn("Failed to get offset for index:",t);return}Gs(w[0],N)||l(g)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(p):p()})},l=u=>{this.targetWindow&&this.currentScrollToIndex===t&&(i++,i<a?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",i,a),this.targetWindow.requestAnimationFrame(()=>o(u))):console.warn(`Failed to scroll to index ${t} after ${a} attempts.`))};o(r)},this.scrollBy=(t,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((t=r[r.length-1])==null?void 0:t.end)??0;else{const i=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&i.some(o=>o===null);){const o=r[a];i[o.lane]===null&&(i[o.lane]=o.end),a--}s=Math.max(...i.filter(o=>o!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(n)}}const Kn=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,i=t(s);if(i<r)e=s+1;else if(i>r)n=s-1;else return s}return e>0?e-1:0};function oi({measurements:e,outerSize:n,scrollOffset:t,lanes:r}){const s=e.length-1,i=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:s};let a=Kn(0,s,i,t),o=a;if(r===1)for(;o<s&&e[o].end<t+n;)o++;else if(r>1){const l=Array(r).fill(0);for(;o<s&&l.some(d=>d<t+n);){const d=e[o];l[d.lane]=d.end,o++}const u=Array(r).fill(t+n);for(;a>=0&&u.some(d=>d>=t);){const d=e[a];u[d.lane]=d.start,a--}a=Math.max(0,a-a%r),o=Math.min(s,o+(r-1-o%r))}return{startIndex:a,endIndex:o}}const Yn=typeof document<"u"?B.useLayoutEffect:B.useEffect;function ai({useFlushSync:e=!0,...n}){const t=B.useReducer(()=>({}),{})[1],r={...n,onChange:(i,a)=>{var o;e&&a?Se.flushSync(t):t(),(o=n.onChange)==null||o.call(n,i,a)}},[s]=B.useState(()=>new ii(r));return s.setOptions(r),Yn(()=>s._didMount(),[]),Yn(()=>s._willUpdate()),s}function li(e){return ai({observeElementRect:ti,observeElementOffset:ni,scrollToFn:si,...e})}const Un=(...e)=>e.filter((n,t,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===t).join(" ").trim();const ci=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const ui=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,t,r)=>r?r.toUpperCase():t.toLowerCase());const qn=e=>{const n=ui(e);return n.charAt(0).toUpperCase()+n.slice(1)};var di={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 fi=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1};const hi=c.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:a,...o},l)=>c.createElement("svg",{ref:l,...di,width:n,height:n,stroke:e,strokeWidth:r?Number(t)*24/Number(n):t,className:Un("lucide",s),...!i&&!fi(o)&&{"aria-hidden":"true"},...o},[...a.map(([u,d])=>c.createElement(u,d)),...Array.isArray(i)?i:[i]]));const zt=(e,n)=>{const t=c.forwardRef(({className:r,...s},i)=>c.createElement(hi,{ref:i,iconNode:n,className:Un(`lucide-${ci(qn(e))}`,`lucide-${e}`,r),...s}));return t.displayName=qn(e),t};const gi=zt("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const pi=zt("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const mi=zt("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Lt=(...e)=>e.filter(Boolean).join(" ");function Pt({card:e}){const{attributes:n,listeners:t,setNodeRef:r,transform:s,transition:i,isDragging:a}=vt({id:e.id}),o={transform:fe.Transform.toString(s),transition:i,opacity:a?.5:void 0};return m.jsx("div",{ref:r,style:o,...n,...t,children:m.jsxs($.Card,{className:"mb-2 cursor-grab active:cursor-grabbing border-border bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group",children:[m.jsxs($.CardHeader,{className:"p-4",children:[m.jsx($.CardTitle,{className:"text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors",children:e.title}),e.description&&m.jsx($.CardDescription,{className:"text-xs text-muted-foreground font-mono",children:e.description})]}),e.badges&&e.badges.length>0&&m.jsx($.CardContent,{className:"p-4 pt-0",children:m.jsx("div",{className:"flex flex-wrap gap-1",children:e.badges.map((l,u)=>m.jsx($.Badge,{variant:l.variant||"default",className:"text-xs",children:l.label},u))})})]})})}function vi({cards:e,parentRef:n}){const t=li({count:e.length,getScrollElement:()=>n.current,estimateSize:()=>120,overscan:5});return m.jsx("div",{style:{height:`${t.getTotalSize()}px`,width:"100%",position:"relative"},children:t.getVirtualItems().map(r=>{const s=e[r.index];return m.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${r.start}px)`},children:m.jsx(Pt,{card:s})},s.id)})})}function bi({column:e,cards:n,onToggle:t,enableVirtual:r}){const s=n||[],i=B.useRef(null),{setNodeRef:a}=vt({id:e.id,data:{type:"column"}}),o=e.limit&&s.length>=e.limit,l=e.limit&&s.length>=e.limit*.8;return m.jsxs("div",{ref:a,className:Lt("flex flex-col flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl transition-all",e.collapsed?"w-16":"w-80",e.className),children:[m.jsxs("div",{className:"p-4 border-b border-border/50 bg-muted/20 flex items-center justify-between",children:[m.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[m.jsx($.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>t(!e.collapsed),children:e.collapsed?m.jsx(pi,{className:"h-4 w-4"}):m.jsx(gi,{className:"h-4 w-4"})}),!e.collapsed&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{className:"font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase truncate",children:e.title}),m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("span",{className:Lt("font-mono text-xs",o?"text-destructive":l?"text-yellow-500":"text-muted-foreground"),children:[s.length,e.limit&&` / ${e.limit}`]}),o&&m.jsx($.Badge,{variant:"destructive",className:"text-xs",children:"Full"}),l&&!o&&m.jsx(mi,{className:"h-3 w-3 text-yellow-500"})]})]})]}),e.collapsed&&m.jsxs("div",{className:"flex flex-col items-center gap-1",children:[m.jsx("span",{className:"font-mono text-xs font-bold text-primary/90 [writing-mode:vertical-rl] rotate-180",children:e.title}),m.jsx($.Badge,{variant:"secondary",className:"text-xs",children:s.length})]})]}),!e.collapsed&&m.jsx("div",{ref:i,className:"flex-1 p-4 overflow-y-auto",style:{maxHeight:"600px"},children:m.jsx(Rn,{items:s.map(u=>u.id),strategy:In,children:r?m.jsx(vi,{cards:s,parentRef:i}):m.jsx("div",{className:"space-y-2",children:s.map(u=>m.jsx(Pt,{card:u},u.id))})})})]})}function Xn({columns:e,onCardMove:n,onColumnToggle:t,enableVirtualScrolling:r=!1,virtualScrollThreshold:s=50,className:i}){const[a,o]=B.useState(null),l=B.useMemo(()=>(e||[]).map(v=>({...v,cards:v.cards||[]})),[e]),[u,d]=B.useState(l);B.useEffect(()=>{d(l)},[l]);const f=Jt(Dt(ct,{activationConstraint:{distance:8}})),g=v=>{const{active:C}=v,S=N(C.id);o(S)},p=v=>{const{active:C,over:S}=v;if(o(null),!S)return;const b=C.id,E=S.id;if(b===E)return;const x=w(b),O=w(E)||y(E);if(!(!x||!O))if(x.id===O.id){const A=[...x.cards],M=A.findIndex(R=>R.id===b),j=A.findIndex(R=>R.id===E),L=gt(A,M,j);d(R=>R.map(P=>P.id===x.id?{...P,cards:L}:P))}else{const A=[...x.cards],M=[...O.cards],j=A.findIndex(H=>H.id===b),R=E===O.id?M.length:M.findIndex(H=>H.id===E),[P]=A.splice(j,1);M.splice(R,0,P),d(H=>H.map(Z=>Z.id===x.id?{...Z,cards:A}:Z.id===O.id?{...Z,cards:M}:Z)),n&&n(b,x.id,O.id,R)}},N=B.useCallback(v=>{for(const C of u){const S=C.cards.find(b=>b.id===v);if(S)return S}return null},[u]),w=B.useCallback(v=>u.find(C=>C.cards.some(S=>S.id===v))||null,[u]),y=B.useCallback(v=>u.find(C=>C.id===v)||null,[u]),D=B.useCallback((v,C)=>{d(S=>S.map(b=>b.id===v?{...b,collapsed:C}:b)),t?.(v,C)},[t]);return m.jsxs(On,{sensors:f,collisionDetection:Zt,onDragStart:g,onDragEnd:p,children:[m.jsx("div",{className:Lt("flex gap-4 overflow-x-auto p-4",i),children:u.map(v=>{const C=r&&v.cards.length>s;return m.jsx(bi,{column:v,cards:v.cards,onToggle:S=>D(v.id,S),enableVirtual:C},v.id)})}),m.jsx(An,{children:a?m.jsx(Pt,{card:a}):null})]})}const yi=Object.freeze(Object.defineProperty({__proto__:null,KanbanEnhanced:Xn,default:Xn},Symbol.toStringTag,{value:"Module"}));G.KanbanRenderer=et,G.ObjectKanban=xt,G.ObjectKanbanRenderer=wt,G.kanbanComponents=lr,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})}));
13
+ color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,t?.key)}return t?.onChange&&!(o&&t.skipInitialOnChange)&&t.onChange(s),o=!1,s}return i.updateDeps=a=>{r=a},i}function qn(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const No=(e,n)=>Math.abs(e-n)<1.01,Do=(e,n,t)=>{let r;return function(...s){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,s),t)}},Un=e=>{const{offsetWidth:n,offsetHeight:t}=e;return{width:n,height:t}},jo=e=>e,ko=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let s=n;s<=t;s++)r.push(s);return r},Oo=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const s=i=>{const{width:a,height:l}=i;n({width:Math.round(a),height:Math.round(l)})};if(s(Un(t)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(i=>{const a=()=>{const l=i[0];if(l?.borderBoxSize){const c=l.borderBoxSize[0];if(c){s({width:c.inlineSize,height:c.blockSize});return}}s(Un(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return o.observe(t,{box:"border-box"}),()=>{o.unobserve(t)}},Xn={passive:!0},Hn=typeof window>"u"?!0:"onscrollend"in window,Ao=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;let s=0;const o=e.options.useScrollendEvent&&Hn?()=>{}:Do(r,()=>{n(s,!1)},e.options.isScrollingResetDelay),i=d=>()=>{const{horizontal:f,isRtl:h}=e.options;s=f?t.scrollLeft*(h&&-1||1):t.scrollTop,o(),n(s,d)},a=i(!0),l=i(!1);t.addEventListener("scroll",a,Xn);const c=e.options.useScrollendEvent&&Hn;return c&&t.addEventListener("scrollend",l,Xn),()=>{t.removeEventListener("scroll",a),c&&t.removeEventListener("scrollend",l)}},To=(e,n,t)=>{if(n?.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},Io=(e,{adjustments:n=0,behavior:t},r)=>{var s,o;const i=e+n;(o=(s=r.scrollElement)==null?void 0:s.scrollTo)==null||o.call(s,{[r.options.horizontal?"left":"top"]:i,behavior:t})};class Mo{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.laneAssignments=new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(s=>{s.forEach(o=>{const i=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var s;(s=r())==null||s.disconnect(),t=null},observe:s=>{var o;return(o=r())==null?void 0:o.observe(s,{box:"border-box"})},unobserve:s=>{var o;return(o=r())==null?void 0:o.unobserve(s)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,s])=>{typeof s>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:jo,rangeExtractor:ko,onChange:()=>{},measureElement:To,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...t}},this.notify=t=>{var r,s;(s=(r=this.options).onChange)==null||s.call(r,this,t)},this.maybeNotify=Ae(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:process.env.NODE_ENV!=="production"&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=o,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const s=new Map,o=new Map;for(let i=r-1;i>=0;i--){const a=t[i];if(s.has(a.lane))continue;const l=o.get(a.lane);if(l==null||a.end>l.end?o.set(a.lane,a):a.end<l.end&&s.set(a.lane,!0),s.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((i,a)=>i.end===a.end?i.index-a.index:i.end-a.end)[0]:void 0},this.getMeasurementOptions=Ae(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(t,r,s,o,i,a)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:a}),{key:!1}),this.getMeasurements=Ae(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:s,getItemKey:o,enabled:i,lanes:a},l)=>{if(!i)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const h of this.laneAssignments.keys())h>=t&&this.laneAssignments.delete(h);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const c=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1);const d=this.measurementsCache.slice(0,c),f=new Array(a).fill(void 0);for(let h=0;h<c;h++){const p=d[h];p&&(f[p.lane]=h)}for(let h=c;h<t;h++){const p=o(h),E=this.laneAssignments.get(h);let b,v;if(E!==void 0&&this.options.lanes>1){b=E;const A=f[b],S=A!==void 0?d[A]:void 0;v=S?S.end+this.options.gap:r+s}else{const A=this.options.lanes===1?d[h-1]:this.getFurthestMeasurement(d,h);v=A?A.end+this.options.gap:r+s,b=A?A.lane:h%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(h,b)}const k=l.get(p),j=typeof k=="number"?k:this.options.estimateSize(h),T=v+j;d[h]={index:h,start:v,size:j,end:T,key:p,lane:b},f[b]=h}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Ae(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,r,s,o)=>this.range=t.length>0&&r>0?_o({measurements:t,outerSize:r,scrollOffset:s,lanes:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=Ae(()=>{let t=null,r=null;const s=this.calculateRange();return s&&(t=s.startIndex,r=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,r]},(t,r,s,o,i)=>o===null||i===null?[]:t({startIndex:o,endIndex:i,overscan:r,count:s}),{key:process.env.NODE_ENV!=="production"&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,s=t.getAttribute(r);return s?parseInt(s,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const s=this.indexFromElement(t),o=this.measurementsCache[s];if(!o)return;const i=o.key,a=this.elementsCache.get(i);a!==t&&(a&&this.observer.unobserve(a),this.observer.observe(t),this.elementsCache.set(i,t)),t.isConnected&&this.resizeItem(s,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const s=this.measurementsCache[t];if(!s)return;const o=this.itemSizeCache.get(s.key)??s.size,i=r-o;i!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,i,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",i),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=i,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,r)),this.notify(!1))},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,s)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(s))});return}this._measureElement(t,void 0)},this.getVirtualItems=Ae(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,r)=>{const s=[];for(let o=0,i=t.length;o<i;o++){const a=t[o],l=r[a];s.push(l)}return s},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return qn(r[Jn(0,r.length-1,s=>qn(r[s]).start,t)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(t,r,s=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=t>=i+o?"end":"start"),r==="center"?t+=(s-o)/2:r==="end"&&(t-=o);const a=this.getMaxScrollOffset();return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.measurementsCache[t];if(!s)return;const o=this.getSize(),i=this.getScrollOffset();if(r==="auto")if(s.end>=i+o-this.options.scrollPaddingEnd)r="end";else if(s.start<=i+this.options.scrollPaddingStart)r="start";else return[i,r];if(r==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),r];const a=r==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,s.size),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(t,{align:r="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:s})},this.scrollToIndex=(t,{align:r="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),t=Math.max(0,Math.min(t,this.options.count-1)),this.currentScrollToIndex=t;let o=0;const i=10,a=c=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(t,c);if(!d){console.warn("Failed to get offset for index:",t);return}const[f,h]=d;this._scrollToOffset(f,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{if(!this.targetWindow)return;const p=()=>{if(this.currentScrollToIndex!==t)return;const E=this.getScrollOffset(),b=this.getOffsetForIndex(t,h);if(!b){console.warn("Failed to get offset for index:",t);return}No(b[0],E)||l(h)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(p):p()})},l=c=>{this.targetWindow&&this.currentScrollToIndex===t&&(o++,o<i?(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("Schedule retry",o,i),this.targetWindow.requestAnimationFrame(()=>a(c))):console.warn(`Failed to scroll to index ${t} after ${i} attempts.`))};a(r)},this.scrollBy=(t,{behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let s;if(r.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((t=r[r.length-1])==null?void 0:t.end)??0;else{const o=Array(this.options.lanes).fill(null);let i=r.length-1;for(;i>=0&&o.some(a=>a===null);){const a=r[i];o[a.lane]===null&&(o[a.lane]=a.end),i--}s=Math.max(...o.filter(a=>a!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(t,{adjustments:r,behavior:s})=>{this.options.scrollToFn(t,{behavior:s,adjustments:r},this)},this.measure=()=>{this.itemSizeCache=new Map,this.laneAssignments=new Map,this.notify(!1)},this.setOptions(n)}}const Jn=(e,n,t,r)=>{for(;e<=n;){const s=(e+n)/2|0,o=t(s);if(o<r)e=s+1;else if(o>r)n=s-1;else return s}return e>0?e-1:0};function _o({measurements:e,outerSize:n,scrollOffset:t,lanes:r}){const s=e.length-1,o=l=>e[l].start;if(e.length<=r)return{startIndex:0,endIndex:s};let i=Jn(0,s,o,t),a=i;if(r===1)for(;a<s&&e[a].end<t+n;)a++;else if(r>1){const l=Array(r).fill(0);for(;a<s&&l.some(d=>d<t+n);){const d=e[a];l[d.lane]=d.end,a++}const c=Array(r).fill(t+n);for(;i>=0&&c.some(d=>d>=t);){const d=e[i];c[d.lane]=d.start,i--}i=Math.max(0,i-i%r),a=Math.min(s,a+(r-1-a%r))}return{startIndex:i,endIndex:a}}const Gn=typeof document<"u"?_.useLayoutEffect:_.useEffect;function zo({useFlushSync:e=!0,...n}){const t=_.useReducer(()=>({}),{})[1],r={...n,onChange:(o,i)=>{var a;e&&i?Ne.flushSync(t):t(),(a=n.onChange)==null||a.call(n,o,i)}},[s]=_.useState(()=>new Mo(r));return s.setOptions(r),Gn(()=>s._didMount(),[]),Gn(()=>s._willUpdate()),s}function Lo(e){return zo({observeElementRect:Oo,observeElementOffset:Ao,scrollToFn:Io,...e})}const Kt=(...e)=>e.filter(Boolean).join(" ");function Ro(e,n){if(!n||n.length===0)return{};for(const t of n){const r=e[t.field];if(r==null)continue;let s=!1;const o=String(r);switch(t.operator){case"equals":s=o===String(t.value);break;case"not_equals":s=o!==String(t.value);break;case"contains":s=o.toLowerCase().includes(String(t.value).toLowerCase());break;case"in":s=Array.isArray(t.value)&&t.value.includes(o);break}if(s)return{...t.backgroundColor?{backgroundColor:t.backgroundColor}:{},...t.borderColor?{borderColor:t.borderColor}:{}}}return{}}function Wt({card:e,conditionalFormatting:n}){const{attributes:t,listeners:r,setNodeRef:s,transform:o,transition:i,isDragging:a}=xt({id:e.id}),l={transform:ge.Transform.toString(o),transition:i,opacity:a?.5:void 0},c=Ro(e,n);return g.jsx("div",{ref:s,style:l,...t,...r,children:g.jsxs(F.Card,{className:"mb-2 cursor-grab active:cursor-grabbing border-border bg-card/60 hover:border-primary/40 hover:shadow-lg hover:shadow-primary/10 transition-all duration-300 group",style:c,children:[e.coverImage&&g.jsx("div",{className:"w-full h-32 overflow-hidden rounded-t-lg",children:g.jsx("img",{src:e.coverImage,alt:"",className:"w-full h-full object-cover",loading:"lazy"})}),g.jsxs(F.CardHeader,{className:"p-4",children:[g.jsx(F.CardTitle,{className:"text-sm font-medium font-mono tracking-tight text-foreground group-hover:text-primary transition-colors",children:e.title}),e.description&&g.jsx(F.CardDescription,{className:"text-xs text-muted-foreground font-mono",children:e.description})]}),e.badges&&e.badges.length>0&&g.jsx(F.CardContent,{className:"p-4 pt-0",children:g.jsx("div",{className:"flex flex-wrap gap-1",children:e.badges.map((d,f)=>g.jsx(F.Badge,{variant:d.variant||"default",className:"text-xs",children:d.label},f))})})]})})}function Po({cards:e,parentRef:n,conditionalFormatting:t}){const r=Lo({count:e.length,getScrollElement:()=>n.current,estimateSize:()=>120,overscan:5});return g.jsx("div",{style:{height:`${r.getTotalSize()}px`,width:"100%",position:"relative"},children:r.getVirtualItems().map(s=>{const o=e[s.index];return g.jsx("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${s.start}px)`},children:g.jsx(Wt,{card:o,conditionalFormatting:t})},o.id)})})}function Fo({columnId:e,onAdd:n}){const[t,r]=_.useState(!1),[s,o]=_.useState(""),i=_.useRef(null),a=()=>{const c=s.trim();c&&(n(e,c),o("")),r(!1)},l=c=>{c.key==="Enter"?(c.preventDefault(),a()):c.key==="Escape"&&(o(""),r(!1))};return t?g.jsx("div",{className:"mt-2 space-y-2",children:g.jsx(F.Input,{ref:i,value:s,onChange:c=>o(c.target.value),onKeyDown:l,onBlur:a,placeholder:"Enter card title...",className:"text-sm",autoFocus:!0})}):g.jsxs(F.Button,{variant:"ghost",size:"sm",className:"w-full mt-2 text-muted-foreground hover:text-foreground",onClick:()=>{r(!0),setTimeout(()=>i.current?.focus(),0)},children:[g.jsx(tt,{className:"h-4 w-4 mr-1"}),"Add Card"]})}function $o({column:e,cards:n,onToggle:t,enableVirtual:r,quickAdd:s,onQuickAdd:o,conditionalFormatting:i}){const a=n||[],l=_.useRef(null),{setNodeRef:c}=xt({id:e.id,data:{type:"column"}}),d=e.limit&&a.length>=e.limit,f=e.limit&&a.length>=e.limit*.8;return g.jsxs("div",{ref:c,className:Kt("flex flex-col flex-shrink-0 rounded-lg border border-border bg-card/20 backdrop-blur-sm shadow-xl transition-all",e.collapsed?"w-16":"w-80",e.className),children:[g.jsxs("div",{className:"p-4 border-b border-border/50 bg-muted/20 flex items-center justify-between",children:[g.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[g.jsx(F.Button,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>t(!e.collapsed),children:e.collapsed?g.jsx(vr,{className:"h-4 w-4"}):g.jsx(Zt,{className:"h-4 w-4"})}),!e.collapsed&&g.jsxs(g.Fragment,{children:[g.jsx("h3",{className:"font-mono text-sm font-semibold tracking-wider text-primary/90 uppercase truncate",children:e.title}),g.jsxs("div",{className:"flex items-center gap-2",children:[g.jsxs("span",{className:Kt("font-mono text-xs",d?"text-destructive":f?"text-yellow-500":"text-muted-foreground"),children:[a.length,e.limit&&` / ${e.limit}`]}),d&&g.jsx(F.Badge,{variant:"destructive",className:"text-xs",children:"Full"}),f&&!d&&g.jsx(xr,{className:"h-3 w-3 text-yellow-500"})]})]})]}),e.collapsed&&g.jsxs("div",{className:"flex flex-col items-center gap-1",children:[g.jsx("span",{className:"font-mono text-xs font-bold text-primary/90 [writing-mode:vertical-rl] rotate-180",children:e.title}),g.jsx(F.Badge,{variant:"secondary",className:"text-xs",children:a.length})]})]}),!e.collapsed&&g.jsxs("div",{ref:l,className:"flex-1 p-4 overflow-y-auto",style:{maxHeight:"600px"},children:[g.jsx($t,{items:a.map(h=>h.id),strategy:Ft,children:r?g.jsx(Po,{cards:a,parentRef:l,conditionalFormatting:i}):g.jsx("div",{className:"space-y-2",children:a.map(h=>g.jsx(Wt,{card:h,conditionalFormatting:i},h.id))})}),s&&o&&g.jsx(Fo,{columnId:e.id,onAdd:o})]})]})}function Qn({columns:e,onCardMove:n,onColumnToggle:t,enableVirtualScrolling:r=!1,virtualScrollThreshold:s=50,className:o,quickAdd:i,onQuickAdd:a,conditionalFormatting:l}){const[c,d]=_.useState(null),f=_.useMemo(()=>(e||[]).map(S=>({...S,cards:S.cards||[]})),[e]),[h,p]=_.useState(f);_.useEffect(()=>{p(f)},[f]);const E=an(kt(dt,{activationConstraint:{distance:8}})),b=S=>{const{active:x}=S,C=k(x.id);d(C)},v=S=>{const{active:x,over:C}=S;if(d(null),!C)return;const y=x.id,I=C.id;if(y===I)return;const w=j(y),D=j(I)||T(I);if(!(!w||!D))if(w.id===D.id){const O=[...w.cards],M=O.findIndex(K=>K.id===y),V=O.findIndex(K=>K.id===I),P=pt(O,M,V);p(K=>K.map($=>$.id===w.id?{...$,cards:P}:$))}else{const O=[...w.cards],M=[...D.cards],V=O.findIndex(q=>q.id===y),K=I===D.id?M.length:M.findIndex(q=>q.id===I),[$]=O.splice(V,1);M.splice(K,0,$),p(q=>q.map(Y=>Y.id===w.id?{...Y,cards:O}:Y.id===D.id?{...Y,cards:M}:Y)),n&&n(y,w.id,D.id,K)}},k=_.useCallback(S=>{for(const x of h){const C=x.cards.find(y=>y.id===S);if(C)return C}return null},[h]),j=_.useCallback(S=>h.find(x=>x.cards.some(C=>C.id===S))||null,[h]),T=_.useCallback(S=>h.find(x=>x.id===S)||null,[h]),A=_.useCallback((S,x)=>{p(C=>C.map(y=>y.id===S?{...y,collapsed:x}:y)),t?.(S,x)},[t]);return g.jsxs(Ln,{sensors:E,collisionDetection:cn,onDragStart:b,onDragEnd:v,children:[g.jsx("div",{className:Kt("flex gap-4 overflow-x-auto p-4",o),children:h.map(S=>{const x=r&&S.cards.length>s;return g.jsx($o,{column:S,cards:S.cards,onToggle:C=>A(S.id,C),enableVirtual:x,quickAdd:i,onQuickAdd:a,conditionalFormatting:l},S.id)})}),g.jsx($n,{children:c?g.jsx(Wt,{card:c,conditionalFormatting:l}):null})]})}const Bo=Object.freeze(Object.defineProperty({__proto__:null,KanbanEnhanced:Qn,default:Qn},Symbol.toStringTag,{value:"Module"}));U.CardTemplates=Nr,U.InlineQuickAdd=Cr,U.KanbanRenderer=nt,U.ObjectKanban=St,U.ObjectKanbanRenderer=Et,U.kanbanComponents=Mr,U.useColumnWidths=kr,U.useCrossSwimlaneMove=Or,U.useQuickAddReorder=Ar,Object.defineProperty(U,Symbol.toStringTag,{value:"Module"})}));
@@ -0,0 +1,25 @@
1
+ import { CardTemplate } from './types';
2
+ /**
3
+ * ObjectUI
4
+ * Copyright (c) 2024-present ObjectStack Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import * as React from "react";
10
+ export interface CardTemplatesProps {
11
+ /** Available card templates */
12
+ templates: CardTemplate[];
13
+ /** Called when a template (or "Custom") is selected */
14
+ onSelect: (template: CardTemplate | null) => void;
15
+ /** Column the template applies to */
16
+ columnId: string;
17
+ }
18
+ /**
19
+ * CardTemplates renders a dropdown button that lets users pick a
20
+ * predefined card template or start with a blank ("Custom") card.
21
+ * The selected template pre-fills the quick-add form values.
22
+ */
23
+ export declare const CardTemplates: React.FC<CardTemplatesProps>;
24
+ export default CardTemplates;
25
+ //# sourceMappingURL=CardTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CardTemplates.d.ts","sourceRoot":"","sources":["../../src/CardTemplates.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAI3C,MAAM,WAAW,kBAAkB;IACjC,+BAA+B;IAC/B,SAAS,EAAE,YAAY,EAAE,CAAA;IACzB,uDAAuD;IACvD,QAAQ,EAAE,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,KAAK,IAAI,CAAA;IACjD,qCAAqC;IACrC,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;;;GAIG;AACH,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CA2FtD,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -0,0 +1,29 @@
1
+ import { InlineFieldDefinition } from './types';
2
+ /**
3
+ * ObjectUI
4
+ * Copyright (c) 2024-present ObjectStack Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */
9
+ import * as React from "react";
10
+ export interface InlineQuickAddProps {
11
+ /** Column where the card will be added */
12
+ columnId: string;
13
+ /** Field definitions for inline editing */
14
+ fields: InlineFieldDefinition[];
15
+ /** Called with field values when the form is submitted */
16
+ onSubmit: (columnId: string, values: Record<string, any>) => void;
17
+ /** Called when the form is cancelled */
18
+ onCancel: () => void;
19
+ /** Pre-filled values (e.g. from a card template) */
20
+ defaultValues?: Record<string, any>;
21
+ }
22
+ /**
23
+ * InlineQuickAdd renders form fields directly inside the kanban column
24
+ * without opening a dialog or modal. Submit with Enter or the Save button;
25
+ * cancel with Escape or the Cancel button.
26
+ */
27
+ export declare const InlineQuickAdd: React.FC<InlineQuickAddProps>;
28
+ export default InlineQuickAdd;
29
+ //# sourceMappingURL=InlineQuickAdd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineQuickAdd.d.ts","sourceRoot":"","sources":["../../src/InlineQuickAdd.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAIpD,MAAM,WAAW,mBAAmB;IAClC,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAA;IAChB,2CAA2C;IAC3C,MAAM,EAAE,qBAAqB,EAAE,CAAA;IAC/B,0DAA0D;IAC1D,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,IAAI,CAAA;IACjE,wCAAwC;IACxC,QAAQ,EAAE,MAAM,IAAI,CAAA;IACpB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACpC;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA2FxD,CAAA;AAgED,eAAe,cAAc,CAAA"}