forge-openclaw-plugin 0.2.26 → 0.2.27

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 (108) hide show
  1. package/README.md +59 -3
  2. package/dist/assets/{board-ta0rUHOf.js → board-C6jCchjI.js} +2 -2
  3. package/dist/assets/{board-ta0rUHOf.js.map → board-C6jCchjI.js.map} +1 -1
  4. package/dist/assets/index-DVvS8iiU.css +1 -0
  5. package/dist/assets/index-zYB-9Dfo.js +85 -0
  6. package/dist/assets/index-zYB-9Dfo.js.map +1 -0
  7. package/dist/assets/knowledge-graph-layout.worker-DRvzPxhP.js +2 -0
  8. package/dist/assets/knowledge-graph-layout.worker-DRvzPxhP.js.map +1 -0
  9. package/dist/assets/{motion-fBKPB6yw.js → motion-DFHrH2rd.js} +2 -2
  10. package/dist/assets/{motion-fBKPB6yw.js.map → motion-DFHrH2rd.js.map} +1 -1
  11. package/dist/assets/{table-C-IGTQni.js → table-ZL7Di_u3.js} +2 -2
  12. package/dist/assets/{table-C-IGTQni.js.map → table-ZL7Di_u3.js.map} +1 -1
  13. package/dist/assets/{ui-DInOpaYF.js → ui-CKNPpz7q.js} +2 -2
  14. package/dist/assets/{ui-DInOpaYF.js.map → ui-CKNPpz7q.js.map} +1 -1
  15. package/dist/assets/vendor-DoNZuFhn.js +1247 -0
  16. package/dist/assets/vendor-DoNZuFhn.js.map +1 -0
  17. package/dist/index.html +7 -7
  18. package/dist/openclaw/local-runtime.js +16 -0
  19. package/dist/openclaw/routes.d.ts +27 -0
  20. package/dist/openclaw/routes.js +16 -12
  21. package/dist/server/server/migrations/037_workbench_public_inputs_and_run_inputs.sql +5 -0
  22. package/dist/server/server/migrations/038_data_management_settings.sql +11 -0
  23. package/dist/server/server/migrations/039_life_force_and_action_points.sql +114 -0
  24. package/dist/server/server/migrations/040_screen_time_domain.sql +89 -0
  25. package/dist/server/server/migrations/041_companion_source_states.sql +21 -0
  26. package/dist/server/server/migrations/042_movement_boxes.sql +47 -0
  27. package/dist/server/server/migrations/043_movement_box_overlap_overrides.sql +26 -0
  28. package/dist/server/server/src/app.js +1684 -117
  29. package/dist/server/server/src/connectors/box-registry.js +44 -9
  30. package/dist/server/server/src/data-management-types.js +107 -0
  31. package/dist/server/server/src/db.js +68 -4
  32. package/dist/server/server/src/demo-data.js +2 -2
  33. package/dist/server/server/src/health.js +702 -18
  34. package/dist/server/server/src/managers/platform/llm-manager.js +7 -4
  35. package/dist/server/server/src/managers/platform/mock-workbench-provider.js +149 -0
  36. package/dist/server/server/src/managers/platform/secrets-manager.js +18 -1
  37. package/dist/server/server/src/managers/runtime.js +9 -0
  38. package/dist/server/server/src/movement.js +1971 -112
  39. package/dist/server/server/src/openapi.js +489 -1
  40. package/dist/server/server/src/psyche-types.js +9 -1
  41. package/dist/server/server/src/repositories/activity-events.js +8 -0
  42. package/dist/server/server/src/repositories/ai-connectors.js +522 -74
  43. package/dist/server/server/src/repositories/habits.js +37 -1
  44. package/dist/server/server/src/repositories/model-settings.js +13 -3
  45. package/dist/server/server/src/repositories/notes.js +3 -0
  46. package/dist/server/server/src/repositories/settings.js +380 -18
  47. package/dist/server/server/src/repositories/tasks.js +170 -10
  48. package/dist/server/server/src/runtime-data-root.js +82 -0
  49. package/dist/server/server/src/screen-time.js +802 -0
  50. package/dist/server/server/src/services/data-management.js +788 -0
  51. package/dist/server/server/src/services/entity-crud.js +205 -2
  52. package/dist/server/server/src/services/knowledge-graph.js +1455 -0
  53. package/dist/server/server/src/services/life-force-model.js +197 -0
  54. package/dist/server/server/src/services/life-force.js +1270 -0
  55. package/dist/server/server/src/services/psyche-observation-calendar.js +383 -16
  56. package/dist/server/server/src/types.js +286 -13
  57. package/dist/server/server/src/web.js +228 -13
  58. package/dist/server/src/components/customization/utility-widgets.js +136 -27
  59. package/dist/server/src/components/ui/info-tooltip.js +25 -0
  60. package/dist/server/src/components/workbench-boxes/calendar/calendar-boxes.js +78 -0
  61. package/dist/server/src/components/workbench-boxes/goals/goals-boxes.js +62 -0
  62. package/dist/server/src/components/workbench-boxes/habits/habits-boxes.js +62 -0
  63. package/dist/server/src/components/workbench-boxes/health/health-boxes.js +63 -8
  64. package/dist/server/src/components/workbench-boxes/insights/insights-boxes.js +50 -0
  65. package/dist/server/src/components/workbench-boxes/kanban/kanban-boxes.js +62 -54
  66. package/dist/server/src/components/workbench-boxes/movement/movement-boxes.js +18 -8
  67. package/dist/server/src/components/workbench-boxes/notes/notes-boxes.js +56 -38
  68. package/dist/server/src/components/workbench-boxes/overview/overview-boxes.js +65 -0
  69. package/dist/server/src/components/workbench-boxes/preferences/preferences-boxes.js +78 -0
  70. package/dist/server/src/components/workbench-boxes/projects/projects-boxes.js +35 -30
  71. package/dist/server/src/components/workbench-boxes/psyche/psyche-boxes.js +88 -0
  72. package/dist/server/src/components/workbench-boxes/questionnaires/questionnaires-boxes.js +61 -0
  73. package/dist/server/src/components/workbench-boxes/review/review-boxes.js +53 -0
  74. package/dist/server/src/components/workbench-boxes/shared/define-workbench-box.js +3 -1
  75. package/dist/server/src/components/workbench-boxes/shared/generic-node-view.js +39 -3
  76. package/dist/server/src/components/workbench-boxes/strategies/strategies-boxes.js +62 -0
  77. package/dist/server/src/components/workbench-boxes/tasks/tasks-boxes.js +76 -0
  78. package/dist/server/src/components/workbench-boxes/today/today-boxes.js +47 -32
  79. package/dist/server/src/components/workbench-boxes/wiki/wiki-boxes.js +60 -0
  80. package/dist/server/src/lib/api.js +280 -21
  81. package/dist/server/src/lib/data-management-types.js +1 -0
  82. package/dist/server/src/lib/entity-visuals.js +279 -0
  83. package/dist/server/src/lib/knowledge-graph-types.js +276 -0
  84. package/dist/server/src/lib/knowledge-graph.js +470 -0
  85. package/dist/server/src/lib/schemas.js +4 -0
  86. package/dist/server/src/lib/snapshot-normalizer.js +43 -1
  87. package/dist/server/src/lib/workbench/contracts.js +229 -0
  88. package/dist/server/src/lib/workbench/nodes.js +200 -0
  89. package/dist/server/src/lib/workbench/registry.js +52 -5
  90. package/dist/server/src/lib/workbench/runtime.js +254 -38
  91. package/dist/server/src/lib/workbench/tool-catalog.js +68 -0
  92. package/openclaw.plugin.json +1 -1
  93. package/package.json +1 -1
  94. package/server/migrations/037_workbench_public_inputs_and_run_inputs.sql +5 -0
  95. package/server/migrations/038_data_management_settings.sql +11 -0
  96. package/server/migrations/039_life_force_and_action_points.sql +114 -0
  97. package/server/migrations/040_screen_time_domain.sql +89 -0
  98. package/server/migrations/041_companion_source_states.sql +21 -0
  99. package/server/migrations/042_movement_boxes.sql +47 -0
  100. package/server/migrations/043_movement_box_overlap_overrides.sql +26 -0
  101. package/skills/forge-openclaw/SKILL.md +24 -11
  102. package/skills/forge-openclaw/entity_conversation_playbooks.md +210 -34
  103. package/skills/forge-openclaw/psyche_entity_playbooks.md +113 -17
  104. package/dist/assets/index-Ro0ZF_az.css +0 -1
  105. package/dist/assets/index-ytlpSj23.js +0 -79
  106. package/dist/assets/index-ytlpSj23.js.map +0 -1
  107. package/dist/assets/vendor-lE3tZJcC.js +0 -876
  108. package/dist/assets/vendor-lE3tZJcC.js.map +0 -1
package/README.md CHANGED
@@ -24,14 +24,19 @@ For a normal local install, the Forge UI address is usually:
24
24
  http://127.0.0.1:4317/forge/
25
25
  ```
26
26
 
27
+ That `4317` backend URL is the stable entrypoint. If Forge is running in a local
28
+ development checkout, the backend can proxy and supervise the hot-reloading Vite
29
+ frontend behind that same `/forge/` URL. Shared routes such as Tailscale should
30
+ still target `http://127.0.0.1:4317/forge/`, not `3027` directly.
31
+
27
32
  You can also ask the agent to call the UI entry tool and return the exact current address.
28
33
 
29
- If you want Forge to use a specific local data folder, set `dataRoot` in the plugin config. The local runtime will then store its database under `data/forge.sqlite` inside that folder instead of using the runtime working directory.
34
+ If you want Forge to use a specific local data folder, set `dataRoot` in the plugin config. The local runtime will then store its database as `forge.sqlite` directly inside that folder instead of using the runtime working directory.
30
35
 
31
36
  Default data path:
32
37
 
33
- - normal npm/OpenClaw install: usually `~/.openclaw/extensions/forge-openclaw-plugin/data/forge.sqlite`
34
- - linked repo-local install: usually `<your-repo>/openclaw-plugin/data/forge.sqlite`
38
+ - normal npm/OpenClaw install: usually `~/.openclaw/extensions/forge-openclaw-plugin/forge.sqlite`
39
+ - linked repo-local install: usually `<your-repo>/openclaw-plugin/forge.sqlite`
35
40
 
36
41
  If you want the data to live somewhere else for persistence or backup reasons, set `dataRoot` explicitly in the plugin config and restart the gateway.
37
42
 
@@ -268,6 +273,32 @@ If you want to move the data folder, edit the same config entry and set:
268
273
  }
269
274
  ```
270
275
 
276
+ ## Doctor And Runtime Config
277
+
278
+ Forge now maintains a runtime settings mirror at `<dataRoot>/forge.json`.
279
+ This is separate from the OpenClaw plugin config in `~/.openclaw/openclaw.json`.
280
+
281
+ The distinction is:
282
+
283
+ - OpenClaw plugin config decides how OpenClaw reaches Forge
284
+ - `forge.json` inside the Forge data root decides what Forge's effective settings are
285
+
286
+ Operational behavior:
287
+
288
+ - if `forge.json` does not exist, Forge exports it on startup
289
+ - UI and API settings changes update both the SQLite store and `forge.json`
290
+ - valid values in `forge.json` take precedence over persisted DB values
291
+ - the file is then rewritten as a full mirrored snapshot so the runtime converges again
292
+
293
+ Diagnostic entrypoints:
294
+
295
+ ```bash
296
+ openclaw forge doctor
297
+ npm run doctor --prefix ./projects/forge
298
+ ```
299
+
300
+ The doctor output now includes `settingsFile` details such as the resolved path, validity, sync state, parse errors, and which override keys were applied from `forge.json`.
301
+
271
302
  Then restart the gateway:
272
303
 
273
304
  ```bash
@@ -411,6 +442,31 @@ The reliable publication path for the Forge plugin is:
411
442
  2. verify `openclaw plugins install forge-openclaw-plugin`
412
443
  3. add Forge to the OpenClaw community plugin listing with the npm package and GitHub repo
413
444
 
445
+ The repo now supports a tag-driven GitHub Actions release path for step 1. The normal
446
+ prep flow from a clean checkout on `main` is:
447
+
448
+ ```bash
449
+ FORGE_RELEASE_MODE=prepare ./scripts/release-forge-openclaw-plugin.sh patch
450
+ ```
451
+
452
+ That command bumps the aligned plugin versions, runs the verification suite, commits
453
+ the release, and pushes `main` plus a matching tag like `v0.2.27`. The
454
+ `.github/workflows/release-openclaw-plugin.yml` workflow then publishes the package
455
+ from that tag.
456
+
457
+ One-time npm setup for CI:
458
+
459
+ - configure npm Trusted Publishing for this GitHub repository and the
460
+ `release-openclaw-plugin.yml` workflow
461
+ - keep using GitHub-hosted runners for the publish job, because npm Trusted Publishing
462
+ does not support self-hosted runners yet
463
+
464
+ If you explicitly want the old laptop-driven publish path, run the same script without
465
+ `FORGE_RELEASE_MODE=prepare` and it will still publish directly after pushing.
466
+
467
+ For the exact prerequisites, tags, and GitHub secret names, use
468
+ `docs/release-cheat-sheet.md`.
469
+
414
470
  ClawHub note:
415
471
 
416
472
  - OpenClaw's public docs clearly position ClawHub as the skills registry.
@@ -1,6 +1,6 @@
1
- import{r as c,R as I,a as Ne}from"./vendor-lE3tZJcC.js";function Mn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const nt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function we(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function mt(e){return"nodeType"in e}function z(e){var t,n;return e?we(e)?e:mt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function yt(e){const{Document:t}=z(e);return e instanceof t}function Be(e){return we(e)?!1:e instanceof z(e).HTMLElement}function Vt(e){return e instanceof z(e).SVGElement}function xe(e){return e?we(e)?e.document:mt(e)?yt(e)?e:Be(e)||Vt(e)?e.ownerDocument:document:document:document}const V=nt?c.useLayoutEffect:c.useEffect;function rt(e){const t=c.useRef(e);return V(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function On(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Pe(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return V(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Je(e){const t=rt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function _e(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ut={};function $e(e,t){return c.useMemo(()=>{if(t)return t;const n=ut[e]==null?0:ut[e]+1;return ut[e]=n,e+"-"+n},[e,t])}function qt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const d=i[l];d!=null&&(i[l]=d+e*u)}return i},{...t})}}const ye=qt(1),Qe=qt(-1);function In(e){return"clientX"in e&&"clientY"in e}function ot(e){if(!e)return!1;const{KeyboardEvent:t}=z(e.target);return t&&e instanceof t}function Nn(e){if(!e)return!1;const{TouchEvent:t}=z(e.target);return t&&e instanceof t}function Ze(e){if(Nn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return In(e)?{x:e.clientX,y:e.clientY}:null}const fe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[fe.Translate.toString(e),fe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),kt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Tn(e){return e.matches(kt)?e:e.querySelector(kt)}const Ln={display:"none"};function kn(e){let{id:t,value:n}=e;return I.createElement("div",{id:t,style:Ln},n)}function Pn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return I.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function zn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Gt=c.createContext(null);function Bn(e){const t=c.useContext(Gt);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Fn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const $n={draggable:`
1
+ import{r as c,R as I,a as Ne}from"./vendor-DoNZuFhn.js";function Mn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const nt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function we(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function mt(e){return"nodeType"in e}function z(e){var t,n;return e?we(e)?e:mt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function yt(e){const{Document:t}=z(e);return e instanceof t}function Be(e){return we(e)?!1:e instanceof z(e).HTMLElement}function Vt(e){return e instanceof z(e).SVGElement}function xe(e){return e?we(e)?e.document:mt(e)?yt(e)?e:Be(e)||Vt(e)?e.ownerDocument:document:document:document}const V=nt?c.useLayoutEffect:c.useEffect;function rt(e){const t=c.useRef(e);return V(()=>{t.current=e}),c.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function On(){const e=c.useRef(null),t=c.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=c.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Pe(e,t){t===void 0&&(t=[e]);const n=c.useRef(e);return V(()=>{n.current!==e&&(n.current=e)},t),n}function Fe(e,t){const n=c.useRef();return c.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Je(e){const t=rt(e),n=c.useRef(null),r=c.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function _e(e){const t=c.useRef();return c.useEffect(()=>{t.current=e},[e]),t.current}let ut={};function $e(e,t){return c.useMemo(()=>{if(t)return t;const n=ut[e]==null?0:ut[e]+1;return ut[e]=n,e+"-"+n},[e,t])}function qt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const a=Object.entries(s);for(const[l,u]of a){const d=i[l];d!=null&&(i[l]=d+e*u)}return i},{...t})}}const ye=qt(1),Qe=qt(-1);function In(e){return"clientX"in e&&"clientY"in e}function ot(e){if(!e)return!1;const{KeyboardEvent:t}=z(e.target);return t&&e instanceof t}function Nn(e){if(!e)return!1;const{TouchEvent:t}=z(e.target);return t&&e instanceof t}function Ze(e){if(Nn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return In(e)?{x:e.clientX,y:e.clientY}:null}const fe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[fe.Translate.toString(e),fe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),kt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Tn(e){return e.matches(kt)?e:e.querySelector(kt)}const Ln={display:"none"};function kn(e){let{id:t,value:n}=e;return I.createElement("div",{id:t,style:Ln},n)}function Pn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return I.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function zn(){const[e,t]=c.useState("");return{announce:c.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Gt=c.createContext(null);function Bn(e){const t=c.useContext(Gt);c.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Fn(){const[e]=c.useState(()=>new Set),t=c.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[c.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var a;return(a=s[o])==null?void 0:a.call(s,i)})},[e]),t]}const $n={draggable:`
2
2
  To pick up a draggable item, press the space bar.
3
3
  While dragging, use the arrow keys to move the item.
4
4
  Press space again to drop the item in its new position, or press escape to cancel.
5
5
  `},Xn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function jn(e){let{announcements:t=Xn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=$n}=e;const{announce:i,announcement:s}=zn(),a=$e("DndLiveRegion"),[l,u]=c.useState(!1);if(c.useEffect(()=>{u(!0)},[]),Bn(c.useMemo(()=>({onDragStart(f){let{active:h}=f;i(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:g}=f;t.onDragMove&&i(t.onDragMove({active:h,over:g}))},onDragOver(f){let{active:h,over:g}=f;i(t.onDragOver({active:h,over:g}))},onDragEnd(f){let{active:h,over:g}=f;i(t.onDragEnd({active:h,over:g}))},onDragCancel(f){let{active:h,over:g}=f;i(t.onDragCancel({active:h,over:g}))}}),[i,t])),!l)return null;const d=I.createElement(I.Fragment,null,I.createElement(kn,{id:r,value:o.draggable}),I.createElement(Pn,{id:a,announcement:s}));return n?Ne.createPortal(d,n):d}var T;(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"})(T||(T={}));function et(){}function po(e,t){return c.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function bo(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return c.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const q=Object.freeze({x:0,y:0});function wt(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function Yn(e,t){const n=Ze(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function xt(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Kn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function ht(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function Wn(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Pt(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const mo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Pt(t,t.left,t.top),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const u=wt(Pt(l),o);i.push({id:a,data:{droppableContainer:s,value:u}})}}return i.sort(xt)},yo=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=ht(t),i=[];for(const s of r){const{id:a}=s,l=n.get(a);if(l){const u=ht(l),d=o.reduce((h,g,C)=>h+wt(u[C],g),0),f=Number((d/4).toFixed(4));i.push({id:a,data:{droppableContainer:s,value:f}})}}return i.sort(xt)};function Un(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,a=i-n;if(r<o&&n<i){const l=t.width*t.height,u=e.width*e.height,d=s*a,f=d/(l+u-d);return Number(f.toFixed(4))}return 0}const Hn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,a=n.get(s);if(a){const l=Un(a,t);l>0&&o.push({id:s,data:{droppableContainer:i,value:l}})}}return o.sort(Kn)};function Vn(e,t){const{top:n,left:r,bottom:o,right:i}=t;return n<=e.y&&e.y<=o&&r<=e.x&&e.x<=i}const wo=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(!r)return[];const o=[];for(const i of t){const{id:s}=i,a=n.get(s);if(a&&Vn(r,a)){const u=ht(a).reduce((f,h)=>f+wt(r,h),0),d=Number((u/4).toFixed(4));o.push({id:s,data:{droppableContainer:i,value:d}})}}return o.sort(xt)};function qn(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function Jt(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:q}function Gn(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,a)=>({...s,top:s.top+e*a.y,bottom:s.bottom+e*a.y,left:s.left+e*a.x,right:s.right+e*a.x}),{...n})}}const Jn=Gn(1);function _t(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function _n(e,t,n){const r=_t(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:a}=r,l=e.left-s-(1-o)*parseFloat(n),u=e.top-a-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=o?e.width/o: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 Qn={ignoreTransform:!1};function Ce(e,t){t===void 0&&(t=Qn);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:d}=z(e).getComputedStyle(e);u&&(n=_n(n,u,d))}const{top:r,left:o,width:i,height:s,bottom:a,right:l}=n;return{top:r,left:o,width:i,height:s,bottom:a,right:l}}function zt(e){return Ce(e,{ignoreTransform:!0})}function Zn(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function er(e,t){return t===void 0&&(t=z(e).getComputedStyle(e)),t.position==="fixed"}function tr(e,t){t===void 0&&(t=z(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function Ct(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(yt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Be(o)||Vt(o)||n.includes(o))return n;const i=z(e).getComputedStyle(o);return o!==e&&tr(o,i)&&n.push(o),er(o,i)?n:r(o.parentNode)}return e?r(e):n}function Qt(e){const[t]=Ct(e,1);return t??null}function dt(e){return!nt||!e?null:we(e)?e:mt(e)?yt(e)||e===xe(e).scrollingElement?window:Be(e)?e:null:null}function Zt(e){return we(e)?e.scrollX:e.scrollLeft}function en(e){return we(e)?e.scrollY:e.scrollTop}function vt(e){return{x:Zt(e),y:en(e)}}var L;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(L||(L={}));function tn(e){return!nt||!e?!1:e===document.scrollingElement}function nn(e){const t={x:0,y:0},n=tn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,a=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:a,maxScroll:r,minScroll:t}}const nr={x:.2,y:.2};function rr(e,t,n,r,o){let{top:i,left:s,right:a,bottom:l}=n;r===void 0&&(r=10),o===void 0&&(o=nr);const{isTop:u,isBottom:d,isLeft:f,isRight:h}=nn(e),g={x:0,y:0},C={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+v.height?(g.y=L.Backward,C.y=r*Math.abs((t.top+v.height-i)/v.height)):!d&&l>=t.bottom-v.height&&(g.y=L.Forward,C.y=r*Math.abs((t.bottom-v.height-l)/v.height)),!h&&a>=t.right-v.width?(g.x=L.Forward,C.x=r*Math.abs((t.right-v.width-a)/v.width)):!f&&s<=t.left+v.width&&(g.x=L.Backward,C.x=r*Math.abs((t.left+v.width-s)/v.width)),{direction:g,speed:C}}function or(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function rn(e){return e.reduce((t,n)=>ye(t,vt(n)),q)}function ir(e){return e.reduce((t,n)=>t+Zt(n),0)}function sr(e){return e.reduce((t,n)=>t+en(n),0)}function on(e,t){if(t===void 0&&(t=Ce),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);Qt(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const ar=[["x",["left","right"],ir],["y",["top","bottom"],sr]];class Dt{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Ct(n),o=rn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,a]of ar)for(const l of s)Object.defineProperty(this,l,{get:()=>{const u=a(r),d=o[i]-u;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Te{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function cr(e){const{EventTarget:t}=z(e);return e instanceof t?e:xe(e)}function ft(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var W;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(W||(W={}));function Bt(e){e.preventDefault()}function lr(e){e.stopPropagation()}var S;(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"})(S||(S={}));const sn={start:[S.Space,S.Enter],cancel:[S.Esc],end:[S.Space,S.Enter,S.Tab]},ur=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case S.Right:return{...n,x:n.x+25};case S.Left:return{...n,x:n.x-25};case S.Down:return{...n,y:n.y+25};case S.Up:return{...n,y:n.y-25}}};class an{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Te(xe(n)),this.windowListeners=new Te(z(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(W.Resize,this.handleCancel),this.windowListeners.add(W.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(W.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&on(r),n(q)}handleKeyDown(t){if(ot(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=sn,coordinateGetter:s=ur,scrollBehavior:a="smooth"}=o,{code:l}=t;if(i.end.includes(l)){this.handleEnd(t);return}if(i.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:u}=r.current,d=u?{x:u.left,y:u.top}:q;this.referenceCoordinates||(this.referenceCoordinates=d);const f=s(t,{active:n,context:r.current,currentCoordinates:d});if(f){const h=Qe(f,d),g={x:0,y:0},{scrollableAncestors:C}=r.current;for(const v of C){const p=t.code,{isTop:b,isRight:y,isLeft:m,isBottom:D,maxScroll:R,minScroll:E}=nn(v),w=or(v),x={x:Math.min(p===S.Right?w.right-w.width/2:w.right,Math.max(p===S.Right?w.left:w.left+w.width/2,f.x)),y:Math.min(p===S.Down?w.bottom-w.height/2:w.bottom,Math.max(p===S.Down?w.top:w.top+w.height/2,f.y))},O=p===S.Right&&!y||p===S.Left&&!m,N=p===S.Down&&!D||p===S.Up&&!b;if(O&&x.x!==f.x){const M=v.scrollLeft+h.x,U=p===S.Right&&M<=R.x||p===S.Left&&M>=E.x;if(U&&!h.y){v.scrollTo({left:M,behavior:a});return}U?g.x=v.scrollLeft-M:g.x=p===S.Right?v.scrollLeft-R.x:v.scrollLeft-E.x,g.x&&v.scrollBy({left:-g.x,behavior:a});break}else if(N&&x.y!==f.y){const M=v.scrollTop+h.y,U=p===S.Down&&M<=R.y||p===S.Up&&M>=E.y;if(U&&!h.x){v.scrollTo({top:M,behavior:a});return}U?g.y=v.scrollTop-M:g.y=p===S.Down?v.scrollTop-R.y:v.scrollTop-E.y,g.y&&v.scrollBy({top:-g.y,behavior:a});break}}this.handleMove(t,ye(Qe(f,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}an.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=sn,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const a=i.activatorNode.current;return a&&e.target!==a?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Ft(e){return!!(e&&"distance"in e)}function $t(e){return!!(e&&"delay"in e)}class Rt{constructor(t,n,r){var o;r===void 0&&(r=cr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=xe(s),this.documentListeners=new Te(this.document),this.listeners=new Te(r),this.windowListeners=new Te(z(s)),this.initialCoordinates=(o=Ze(i))!=null?o:q,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(W.Resize,this.handleCancel),this.windowListeners.add(W.DragStart,Bt),this.windowListeners.add(W.VisibilityChange,this.handleCancel),this.windowListeners.add(W.ContextMenu,Bt),this.documentListeners.add(W.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if($t(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Ft(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(W.Click,lr,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(W.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:a}}=i;if(!o)return;const l=(n=Ze(t))!=null?n:q,u=Qe(o,l);if(!r&&a){if(Ft(a)){if(a.tolerance!=null&&ft(u,a.tolerance))return this.handleCancel();if(ft(u,a.distance))return this.handleStart()}if($t(a)&&ft(u,a.tolerance))return this.handleCancel();this.handlePending(a,u);return}t.cancelable&&t.preventDefault(),s(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===S.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const dr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class cn extends Rt{constructor(t){const{event:n}=t,r=xe(n.target);super(t,dr,r)}}cn.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const fr={move:{name:"mousemove"},end:{name:"mouseup"}};var pt;(function(e){e[e.RightClick=2]="RightClick"})(pt||(pt={}));class gr extends Rt{constructor(t){super(t,fr,xe(t.event.target))}}gr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===pt.RightClick?!1:(r==null||r({event:n}),!0)}}];const gt={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class hr extends Rt{constructor(t){super(t,gt)}static setup(){return window.addEventListener(gt.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(gt.move.name,t)};function t(){}}}hr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Le;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Le||(Le={}));var tt;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(tt||(tt={}));function vr(e){let{acceleration:t,activator:n=Le.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:a=tt.TreeOrder,pointerCoordinates:l,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:h}=e;const g=br({delta:f,disabled:!i}),[C,v]=On(),p=c.useRef({x:0,y:0}),b=c.useRef({x:0,y:0}),y=c.useMemo(()=>{switch(n){case Le.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Le.DraggableRect:return o}},[n,o,l]),m=c.useRef(null),D=c.useCallback(()=>{const E=m.current;if(!E)return;const w=p.current.x*b.current.x,x=p.current.y*b.current.y;E.scrollBy(w,x)},[]),R=c.useMemo(()=>a===tt.TreeOrder?[...u].reverse():u,[a,u]);c.useEffect(()=>{if(!i||!u.length||!y){v();return}for(const E of R){if((r==null?void 0:r(E))===!1)continue;const w=u.indexOf(E),x=d[w];if(!x)continue;const{direction:O,speed:N}=rr(E,x,y,t,h);for(const M of["x","y"])g[M][O[M]]||(N[M]=0,O[M]=0);if(N.x>0||N.y>0){v(),m.current=E,C(D,s),p.current=N,b.current=O;return}}p.current={x:0,y:0},b.current={x:0,y:0},v()},[t,D,r,v,i,s,JSON.stringify(y),JSON.stringify(g),C,u,R,d,JSON.stringify(h)])}const pr={x:{[L.Backward]:!1,[L.Forward]:!1},y:{[L.Backward]:!1,[L.Forward]:!1}};function br(e){let{delta:t,disabled:n}=e;const r=_e(t);return Fe(o=>{if(n||!r||!o)return pr;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[L.Backward]:o.x[L.Backward]||i.x===-1,[L.Forward]:o.x[L.Forward]||i.x===1},y:{[L.Backward]:o.y[L.Backward]||i.y===-1,[L.Forward]:o.y[L.Forward]||i.y===1}}},[n,t,r])}function mr(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Fe(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function yr(e,t){return c.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var ze;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(ze||(ze={}));var bt;(function(e){e.Optimized="optimized"})(bt||(bt={}));const Xt=new Map;function wr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=c.useState(null),{frequency:a,measure:l,strategy:u}=o,d=c.useRef(e),f=p(),h=Pe(f),g=c.useCallback(function(b){b===void 0&&(b=[]),!h.current&&s(y=>y===null?b:y.concat(b.filter(m=>!y.includes(m))))},[h]),C=c.useRef(null),v=Fe(b=>{if(f&&!n)return Xt;if(!b||b===Xt||d.current!==e||i!=null){const y=new Map;for(let m of e){if(!m)continue;if(i&&i.length>0&&!i.includes(m.id)&&m.rect.current){y.set(m.id,m.rect.current);continue}const D=m.node.current,R=D?new Dt(l(D),D):null;m.rect.current=R,R&&y.set(m.id,R)}return y}return b},[e,i,n,f,l]);return c.useEffect(()=>{d.current=e},[e]),c.useEffect(()=>{f||g()},[n,f]),c.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),c.useEffect(()=>{f||typeof a!="number"||C.current!==null||(C.current=setTimeout(()=>{g(),C.current=null},a))},[a,f,g,...r]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:i!=null};function p(){switch(u){case ze.Always:return!1;case ze.BeforeDragging:return n;default:return!n}}}function St(e,t){return Fe(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function xr(e,t){return St(e,t)}function Cr(e){let{callback:t,disabled:n}=e;const r=rt(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return c.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function it(e){let{callback:t,disabled:n}=e;const r=rt(t),o=c.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return c.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Dr(e){return new Dt(Ce(e),e)}function jt(e,t,n){t===void 0&&(t=Dr);const[r,o]=c.useState(null);function i(){o(l=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=l??n)!=null?u:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const s=Cr({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}}}}),a=it({callback:i});return V(()=>{i(),e?(a==null||a.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(a==null||a.disconnect(),s==null||s.disconnect())},[e]),r}function Rr(e){const t=St(e);return Jt(e,t)}const Yt=[];function Sr(e){const t=c.useRef(e),n=Fe(r=>e?r&&r!==Yt&&e&&t.current&&e.parentNode===t.current.parentNode?r:Ct(e):Yt,[e]);return c.useEffect(()=>{t.current=e},[e]),n}function Er(e){const[t,n]=c.useState(null),r=c.useRef(e),o=c.useCallback(i=>{const s=dt(i.target);s&&n(a=>a?(a.set(s,vt(s)),new Map(a)):null)},[]);return c.useEffect(()=>{const i=r.current;if(e!==i){s(i);const a=e.map(l=>{const u=dt(l);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,vt(u)]):null}).filter(l=>l!=null);n(a.length?new Map(a):null),r.current=e}return()=>{s(e),s(i)};function s(a){a.forEach(l=>{const u=dt(l);u==null||u.removeEventListener("scroll",o)})}},[o,e]),c.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>ye(i,s),q):rn(e):q,[e,t])}function Kt(e,t){t===void 0&&(t=[]);const n=c.useRef(null);return c.useEffect(()=>{n.current=null},t),c.useEffect(()=>{const r=e!==q;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Qe(e,n.current):q}function Ar(e){c.useEffect(()=>{if(!nt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Mr(e,t){return c.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function ln(e){return c.useMemo(()=>e?Zn(e):null,[e])}const Wt=[];function Or(e,t){t===void 0&&(t=Ce);const[n]=e,r=ln(n?z(n):null),[o,i]=c.useState(Wt);function s(){i(()=>e.length?e.map(l=>tn(l)?r:new Dt(t(l),l)):Wt)}const a=it({callback:s});return V(()=>{a==null||a.disconnect(),s(),e.forEach(l=>a==null?void 0:a.observe(l))},[e]),o}function un(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Be(t)?t:e}function Ir(e){let{measure:t}=e;const[n,r]=c.useState(null),o=c.useCallback(u=>{for(const{target:d}of u)if(Be(d)){r(f=>{const h=t(d);return f?{...f,width:h.width,height:h.height}:h});break}},[t]),i=it({callback:o}),s=c.useCallback(u=>{const d=un(u);i==null||i.disconnect(),d&&(i==null||i.observe(d)),r(d?t(d):null)},[t,i]),[a,l]=Je(s);return c.useMemo(()=>({nodeRef:a,rect:n,setRef:l}),[n,a,l])}const Nr=[{sensor:cn,options:{}},{sensor:an,options:{}}],Tr={current:{}},Ge={draggable:{measure:zt},droppable:{measure:zt,strategy:ze.WhileDragging,frequency:bt.Optimized},dragOverlay:{measure:Ce}};class ke extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Lr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ke,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:et},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ge,measureDroppableContainers:et,windowRect:null,measuringScheduled:!1},dn={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:et,draggableNodes:new Map,over:null,measureDroppableContainers:et},Xe=c.createContext(dn),fn=c.createContext(Lr);function kr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ke}}}function Pr(e,t){switch(t.type){case T.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case T.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case T.DragEnd:case T.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case T.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new ke(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case T.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new ke(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case T.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new ke(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function zr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=c.useContext(Xe),i=_e(r),s=_e(n==null?void 0:n.id);return c.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!ot(i)||document.activeElement===i.target)return;const a=o.get(s);if(!a)return;const{activatorNode:l,node:u}=a;if(!l.current&&!u.current)return;requestAnimationFrame(()=>{for(const d of[l.current,u.current]){if(!d)continue;const f=Tn(d);if(f){f.focus();break}}})}},[r,t,o,s,i]),null}function gn(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function Br(e){return c.useMemo(()=>({draggable:{...Ge.draggable,...e==null?void 0:e.draggable},droppable:{...Ge.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ge.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Fr(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=c.useRef(!1),{x:s,y:a}=typeof o=="boolean"?{x:o,y:o}:o;V(()=>{if(!s&&!a||!t){i.current=!1;return}if(i.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const d=n(u),f=Jt(d,r);if(s||(f.x=0),a||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=Qt(u);h&&h.scrollBy({top:f.y,left:f.x})}},[t,s,a,r,n])}const st=c.createContext({...q,scaleX:1,scaleY:1});var ue;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ue||(ue={}));const xo=c.memo(function(t){var n,r,o,i;let{id:s,accessibility:a,autoScroll:l=!0,children:u,sensors:d=Nr,collisionDetection:f=Hn,measuring:h,modifiers:g,...C}=t;const v=c.useReducer(Pr,void 0,kr),[p,b]=v,[y,m]=Fn(),[D,R]=c.useState(ue.Uninitialized),E=D===ue.Initialized,{draggable:{active:w,nodes:x,translate:O},droppable:{containers:N}}=p,M=w!=null?x.get(w):null,U=c.useRef({initial:null,translated:null}),H=c.useMemo(()=>{var P;return w!=null?{id:w,data:(P=M==null?void 0:M.data)!=null?P:Tr,rect:U}:null},[w,M]),G=c.useRef(null),[De,je]=c.useState(null),[F,Ye]=c.useState(null),Z=Pe(C,Object.values(C)),Re=$e("DndDescribedBy",s),Ke=c.useMemo(()=>N.getEnabled(),[N]),B=Br(h),{droppableRects:ee,measureDroppableContainers:de,measuringScheduled:Se}=wr(Ke,{dragging:E,dependencies:[O.x,O.y],config:B.droppable}),Y=mr(x,w),We=c.useMemo(()=>F?Ze(F):null,[F]),oe=An(),te=xr(Y,B.draggable.measure);Fr({activeNode:w!=null?x.get(w):null,config:oe.layoutShiftCompensation,initialRect:te,measure:B.draggable.measure});const A=jt(Y,B.draggable.measure,te),Ee=jt(Y?Y.parentElement:null),J=c.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:ee,draggableNodes:x,draggingNode:null,draggingNodeRect:null,droppableContainers:N,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ge=N.getNodeFor((n=J.current.over)==null?void 0:n.id),ne=Ir({measure:B.dragOverlay.measure}),he=(r=ne.nodeRef.current)!=null?r:Y,ve=E?(o=ne.rect)!=null?o:A:null,Et=!!(ne.nodeRef.current&&ne.rect),At=Rr(Et?null:A),at=ln(he?z(he):null),ie=Sr(E?ge??Y:null),Ue=Or(ie),He=gn(g,{transform:{x:O.x-At.x,y:O.y-At.y,scaleX:1,scaleY:1},activatorEvent:F,active:H,activeNodeRect:A,containerNodeRect:Ee,draggingNodeRect:ve,over:J.current.over,overlayNodeRect:ne.rect,scrollableAncestors:ie,scrollableAncestorRects:Ue,windowRect:at}),Mt=We?ye(We,O):null,Ot=Er(ie),wn=Kt(Ot),xn=Kt(Ot,[A]),pe=ye(He,wn),be=ve?Jn(ve,He):null,Ae=H&&be?f({active:H,collisionRect:be,droppableRects:ee,droppableContainers:Ke,pointerCoordinates:Mt}):null,It=Wn(Ae,"id"),[se,Nt]=c.useState(null),Cn=Et?He:ye(He,xn),Dn=qn(Cn,(i=se==null?void 0:se.rect)!=null?i:null,A),ct=c.useRef(null),Tt=c.useCallback((P,$)=>{let{sensor:X,options:ae}=$;if(G.current==null)return;const K=x.get(G.current);if(!K)return;const j=P.nativeEvent,_=new X({active:G.current,activeNode:K,event:j,options:ae,context:J,onAbort(k){if(!x.get(k))return;const{onDragAbort:Q}=Z.current,re={id:k};Q==null||Q(re),y({type:"onDragAbort",event:re})},onPending(k,ce,Q,re){if(!x.get(k))return;const{onDragPending:Oe}=Z.current,le={id:k,constraint:ce,initialCoordinates:Q,offset:re};Oe==null||Oe(le),y({type:"onDragPending",event:le})},onStart(k){const ce=G.current;if(ce==null)return;const Q=x.get(ce);if(!Q)return;const{onDragStart:re}=Z.current,Me={activatorEvent:j,active:{id:ce,data:Q.data,rect:U}};Ne.unstable_batchedUpdates(()=>{re==null||re(Me),R(ue.Initializing),b({type:T.DragStart,initialCoordinates:k,active:ce}),y({type:"onDragStart",event:Me}),je(ct.current),Ye(j)})},onMove(k){b({type:T.DragMove,coordinates:k})},onEnd:me(T.DragEnd),onCancel:me(T.DragCancel)});ct.current=_;function me(k){return async function(){const{active:Q,collisions:re,over:Me,scrollAdjustedTranslate:Oe}=J.current;let le=null;if(Q&&Oe){const{cancelDrop:Ie}=Z.current;le={activatorEvent:j,active:Q,collisions:re,delta:Oe,over:Me},k===T.DragEnd&&typeof Ie=="function"&&await Promise.resolve(Ie(le))&&(k=T.DragCancel)}G.current=null,Ne.unstable_batchedUpdates(()=>{b({type:k}),R(ue.Uninitialized),Nt(null),je(null),Ye(null),ct.current=null;const Ie=k===T.DragEnd?"onDragEnd":"onDragCancel";if(le){const lt=Z.current[Ie];lt==null||lt(le),y({type:Ie,event:le})}})}}},[x]),Rn=c.useCallback((P,$)=>(X,ae)=>{const K=X.nativeEvent,j=x.get(ae);if(G.current!==null||!j||K.dndKit||K.defaultPrevented)return;const _={active:j};P(X,$.options,_)===!0&&(K.dndKit={capturedBy:$.sensor},G.current=ae,Tt(X,$))},[x,Tt]),Lt=yr(d,Rn);Ar(d),V(()=>{A&&D===ue.Initializing&&R(ue.Initialized)},[A,D]),c.useEffect(()=>{const{onDragMove:P}=Z.current,{active:$,activatorEvent:X,collisions:ae,over:K}=J.current;if(!$||!X)return;const j={active:$,activatorEvent:X,collisions:ae,delta:{x:pe.x,y:pe.y},over:K};Ne.unstable_batchedUpdates(()=>{P==null||P(j),y({type:"onDragMove",event:j})})},[pe.x,pe.y]),c.useEffect(()=>{const{active:P,activatorEvent:$,collisions:X,droppableContainers:ae,scrollAdjustedTranslate:K}=J.current;if(!P||G.current==null||!$||!K)return;const{onDragOver:j}=Z.current,_=ae.get(It),me=_&&_.rect.current?{id:_.id,rect:_.rect.current,data:_.data,disabled:_.disabled}:null,k={active:P,activatorEvent:$,collisions:X,delta:{x:K.x,y:K.y},over:me};Ne.unstable_batchedUpdates(()=>{Nt(me),j==null||j(k),y({type:"onDragOver",event:k})})},[It]),V(()=>{J.current={activatorEvent:F,active:H,activeNode:Y,collisionRect:be,collisions:Ae,droppableRects:ee,draggableNodes:x,draggingNode:he,draggingNodeRect:ve,droppableContainers:N,over:se,scrollableAncestors:ie,scrollAdjustedTranslate:pe},U.current={initial:ve,translated:be}},[H,Y,Ae,be,x,he,ve,ee,N,se,ie,pe]),vr({...oe,delta:O,draggingRect:be,pointerCoordinates:Mt,scrollableAncestors:ie,scrollableAncestorRects:Ue});const Sn=c.useMemo(()=>({active:H,activeNode:Y,activeNodeRect:A,activatorEvent:F,collisions:Ae,containerNodeRect:Ee,dragOverlay:ne,draggableNodes:x,droppableContainers:N,droppableRects:ee,over:se,measureDroppableContainers:de,scrollableAncestors:ie,scrollableAncestorRects:Ue,measuringConfiguration:B,measuringScheduled:Se,windowRect:at}),[H,Y,A,F,Ae,Ee,ne,x,N,ee,se,de,ie,Ue,B,Se,at]),En=c.useMemo(()=>({activatorEvent:F,activators:Lt,active:H,activeNodeRect:A,ariaDescribedById:{draggable:Re},dispatch:b,draggableNodes:x,over:se,measureDroppableContainers:de}),[F,Lt,H,A,b,Re,x,se,de]);return I.createElement(Gt.Provider,{value:m},I.createElement(Xe.Provider,{value:En},I.createElement(fn.Provider,{value:Sn},I.createElement(st.Provider,{value:Dn},u)),I.createElement(zr,{disabled:(a==null?void 0:a.restoreFocus)===!1})),I.createElement(jn,{...a,hiddenTextDescribedById:Re}));function An(){const P=(De==null?void 0:De.autoScrollEnabled)===!1,$=typeof l=="object"?l.enabled===!1:l===!1,X=E&&!P&&!$;return typeof l=="object"?{...l,enabled:X}:{enabled:X}}}),$r=c.createContext(null),Ut="button",Xr="Draggable";function jr(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=$e(Xr),{activators:s,activatorEvent:a,active:l,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:h}=c.useContext(Xe),{role:g=Ut,roleDescription:C="draggable",tabIndex:v=0}=o??{},p=(l==null?void 0:l.id)===t,b=c.useContext(p?st:$r),[y,m]=Je(),[D,R]=Je(),E=Mr(s,t),w=Pe(n);V(()=>(f.set(t,{id:t,key:i,node:y,activatorNode:D,data:w}),()=>{const O=f.get(t);O&&O.key===i&&f.delete(t)}),[f,t]);const x=c.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":p&&g===Ut?!0:void 0,"aria-roledescription":C,"aria-describedby":d.draggable}),[r,g,v,p,C,d.draggable]);return{active:l,activatorEvent:a,activeNodeRect:u,attributes:x,isDragging:p,listeners:r?void 0:E,node:y,over:h,setNodeRef:m,setActivatorNodeRef:R,transform:b}}function hn(){return c.useContext(fn)}const Yr="Droppable",Kr={timeout:25};function Wr(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=$e(Yr),{active:s,dispatch:a,over:l,measureDroppableContainers:u}=c.useContext(Xe),d=c.useRef({disabled:n}),f=c.useRef(!1),h=c.useRef(null),g=c.useRef(null),{disabled:C,updateMeasurementsFor:v,timeout:p}={...Kr,...o},b=Pe(v??r),y=c.useCallback(()=>{if(!f.current){f.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(b.current)?b.current:[b.current]),g.current=null},p)},[p]),m=it({callback:y,disabled:C||!s}),D=c.useCallback((x,O)=>{m&&(O&&(m.unobserve(O),f.current=!1),x&&m.observe(x))},[m]),[R,E]=Je(D),w=Pe(t);return c.useEffect(()=>{!m||!R.current||(m.disconnect(),f.current=!1,m.observe(R.current))},[R,m]),c.useEffect(()=>(a({type:T.RegisterDroppable,element:{id:r,key:i,disabled:n,node:R,rect:h,data:w}}),()=>a({type:T.UnregisterDroppable,key:i,id:r})),[r]),c.useEffect(()=>{n!==d.current.disabled&&(a({type:T.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,a]),{active:s,rect:h,isOver:(l==null?void 0:l.id)===r,node:R,over:l,setNodeRef:E}}function Ur(e){let{animation:t,children:n}=e;const[r,o]=c.useState(null),[i,s]=c.useState(null),a=_e(n);return!n&&!r&&a&&o(a),V(()=>{if(!i)return;const l=r==null?void 0:r.key,u=r==null?void 0:r.props.id;if(l==null||u==null){o(null);return}Promise.resolve(t(u,i)).then(()=>{o(null)})},[t,r,i]),I.createElement(I.Fragment,null,n,r?c.cloneElement(r,{ref:s}):null)}const Hr={x:0,y:0,scaleX:1,scaleY:1};function Vr(e){let{children:t}=e;return I.createElement(Xe.Provider,{value:dn},I.createElement(st.Provider,{value:Hr},t))}const qr={position:"fixed",touchAction:"none"},Gr=e=>ot(e)?"transform 250ms ease":void 0,Jr=c.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:o,children:i,className:s,rect:a,style:l,transform:u,transition:d=Gr}=e;if(!a)return null;const f=o?u:{...u,scaleX:1,scaleY:1},h={...qr,width:a.width,height:a.height,top:a.top,left:a.left,transform:fe.Transform.toString(f),transformOrigin:o&&r?Yn(r,a):void 0,transition:typeof d=="function"?d(r):d,...l};return I.createElement(n,{className:s,style:h,ref:t},i)}),_r=e=>t=>{let{active:n,dragOverlay:r}=t;const o={},{styles:i,className:s}=e;if(i!=null&&i.active)for(const[a,l]of Object.entries(i.active))l!==void 0&&(o[a]=n.node.style.getPropertyValue(a),n.node.style.setProperty(a,l));if(i!=null&&i.dragOverlay)for(const[a,l]of Object.entries(i.dragOverlay))l!==void 0&&r.node.style.setProperty(a,l);return s!=null&&s.active&&n.node.classList.add(s.active),s!=null&&s.dragOverlay&&r.node.classList.add(s.dragOverlay),function(){for(const[l,u]of Object.entries(o))n.node.style.setProperty(l,u);s!=null&&s.active&&n.node.classList.remove(s.active)}},Qr=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:fe.Transform.toString(t)},{transform:fe.Transform.toString(n)}]},Zr={duration:250,easing:"ease",keyframes:Qr,sideEffects:_r({styles:{active:{opacity:"0"}}})};function eo(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:o}=e;return rt((i,s)=>{if(t===null)return;const a=n.get(i);if(!a)return;const l=a.node.current;if(!l)return;const u=un(s);if(!u)return;const{transform:d}=z(s).getComputedStyle(s),f=_t(d);if(!f)return;const h=typeof t=="function"?t:to(t);return on(l,o.draggable.measure),h({active:{id:i,data:a.data,node:l,rect:o.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:s,rect:o.dragOverlay.measure(u)},droppableContainers:r,measuringConfiguration:o,transform:f})})}function to(e){const{duration:t,easing:n,sideEffects:r,keyframes:o}={...Zr,...e};return i=>{let{active:s,dragOverlay:a,transform:l,...u}=i;if(!t)return;const d={x:a.rect.left-s.rect.left,y:a.rect.top-s.rect.top},f={scaleX:l.scaleX!==1?s.rect.width*l.scaleX/a.rect.width:1,scaleY:l.scaleY!==1?s.rect.height*l.scaleY/a.rect.height:1},h={x:l.x-d.x,y:l.y-d.y,...f},g=o({...u,active:s,dragOverlay:a,transform:{initial:l,final:h}}),[C]=g,v=g[g.length-1];if(JSON.stringify(C)===JSON.stringify(v))return;const p=r==null?void 0:r({active:s,dragOverlay:a,...u}),b=a.node.animate(g,{duration:t,easing:n,fill:"forwards"});return new Promise(y=>{b.onfinish=()=>{p==null||p(),y()}})}}let Ht=0;function no(e){return c.useMemo(()=>{if(e!=null)return Ht++,Ht},[e])}const Co=I.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:o,transition:i,modifiers:s,wrapperElement:a="div",className:l,zIndex:u=999}=e;const{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:g,draggableNodes:C,droppableContainers:v,dragOverlay:p,over:b,measuringConfiguration:y,scrollableAncestors:m,scrollableAncestorRects:D,windowRect:R}=hn(),E=c.useContext(st),w=no(f==null?void 0:f.id),x=gn(s,{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:g,draggingNodeRect:p.rect,over:b,overlayNodeRect:p.rect,scrollableAncestors:m,scrollableAncestorRects:D,transform:E,windowRect:R}),O=St(h),N=eo({config:r,draggableNodes:C,droppableContainers:v,measuringConfiguration:y}),M=O?p.setRef:void 0;return I.createElement(Vr,null,I.createElement(Ur,{animation:N},f&&w?I.createElement(Jr,{key:w,id:f.id,ref:M,as:a,activatorEvent:d,adjustScale:t,className:l,transition:i,rect:O,style:{zIndex:u,...o},transform:x},n):null))});function vn(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function ro(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function Ve(e){return e!==null&&e>=0}function oo(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function io(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const pn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=vn(t,r,n),s=t[o],a=i[o];return!a||!s?null:{x:a.left-s.left,y:a.top-s.top,scaleX:a.width/s.width,scaleY:a.height/s.height}},qe={scaleX:1,scaleY:1},Do=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const a=(t=i[n])!=null?t:r;if(!a)return null;if(o===n){const u=i[s];return u?{x:0,y:n<s?u.top+u.height-(a.top+a.height):u.top-a.top,...qe}:null}const l=so(i,o,n);return o>n&&o<=s?{x:0,y:-a.height-l,...qe}:o<n&&o>=s?{x:0,y:a.height+l,...qe}:{x:0,y:0,...qe}};function so(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const bn="Sortable",mn=I.createContext({activeIndex:-1,containerId:bn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:pn,disabled:{draggable:!1,droppable:!1}});function Ro(e){let{children:t,id:n,items:r,strategy:o=pn,disabled:i=!1}=e;const{active:s,dragOverlay:a,droppableRects:l,over:u,measureDroppableContainers:d}=hn(),f=$e(bn,n),h=a.rect!==null,g=c.useMemo(()=>r.map(E=>typeof E=="object"&&"id"in E?E.id:E),[r]),C=s!=null,v=s?g.indexOf(s.id):-1,p=u?g.indexOf(u.id):-1,b=c.useRef(g),y=!oo(g,b.current),m=p!==-1&&v===-1||y,D=io(i);V(()=>{y&&C&&d(g)},[y,g,C,d]),c.useEffect(()=>{b.current=g},[g]);const R=c.useMemo(()=>({activeIndex:v,containerId:f,disabled:D,disableTransforms:m,items:g,overIndex:p,useDragOverlay:h,sortedRects:ro(g,l),strategy:o}),[v,f,D.draggable,D.droppable,m,g,p,l,h,o]);return I.createElement(mn.Provider,{value:R},t)}const ao=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return vn(n,r,o).indexOf(t)},co=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:a,previousContainerId:l,transition:u}=e;return!u||!r||a!==i&&o===s?!1:n?!0:s!==o&&t===l},lo={duration:200,easing:"ease"},yn="transform",uo=fe.Transition.toString({property:yn,duration:0,easing:"linear"}),fo={roleDescription:"sortable"};function go(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=c.useState(null),a=c.useRef(n);return V(()=>{if(!t&&n!==a.current&&r.current){const l=o.current;if(l){const u=Ce(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)&&s(d)}}n!==a.current&&(a.current=n)},[t,n,r,o]),c.useEffect(()=>{i&&s(null)},[i]),i}function So(e){let{animateLayoutChanges:t=co,attributes:n,disabled:r,data:o,getNewIndex:i=ao,id:s,strategy:a,resizeObserverConfig:l,transition:u=lo}=e;const{items:d,containerId:f,activeIndex:h,disabled:g,disableTransforms:C,sortedRects:v,overIndex:p,useDragOverlay:b,strategy:y}=c.useContext(mn),m=ho(r,g),D=d.indexOf(s),R=c.useMemo(()=>({sortable:{containerId:f,index:D,items:d},...o}),[f,o,D,d]),E=c.useMemo(()=>d.slice(d.indexOf(s)),[d,s]),{rect:w,node:x,isOver:O,setNodeRef:N}=Wr({id:s,data:R,disabled:m.droppable,resizeObserverConfig:{updateMeasurementsFor:E,...l}}),{active:M,activatorEvent:U,activeNodeRect:H,attributes:G,setNodeRef:De,listeners:je,isDragging:F,over:Ye,setActivatorNodeRef:Z,transform:Re}=jr({id:s,data:R,attributes:{...fo,...n},disabled:m.draggable}),Ke=Mn(N,De),B=!!M,ee=B&&!C&&Ve(h)&&Ve(p),de=!b&&F,Se=de&&ee?Re:null,We=ee?Se??(a??y)({rects:v,activeNodeRect:H,activeIndex:h,overIndex:p,index:D}):null,oe=Ve(h)&&Ve(p)?i({id:s,items:d,activeIndex:h,overIndex:p}):D,te=M==null?void 0:M.id,A=c.useRef({activeId:te,items:d,newIndex:oe,containerId:f}),Ee=d!==A.current.items,J=t({active:M,containerId:f,isDragging:F,isSorting:B,id:s,index:D,items:d,newIndex:A.current.newIndex,previousItems:A.current.items,previousContainerId:A.current.containerId,transition:u,wasDragging:A.current.activeId!=null}),ge=go({disabled:!J,index:D,node:x,rect:w});return c.useEffect(()=>{B&&A.current.newIndex!==oe&&(A.current.newIndex=oe),f!==A.current.containerId&&(A.current.containerId=f),d!==A.current.items&&(A.current.items=d)},[B,oe,f,d]),c.useEffect(()=>{if(te===A.current.activeId)return;if(te!=null&&A.current.activeId==null){A.current.activeId=te;return}const he=setTimeout(()=>{A.current.activeId=te},50);return()=>clearTimeout(he)},[te]),{active:M,activeIndex:h,attributes:G,data:R,rect:w,index:D,newIndex:oe,items:d,isOver:O,isSorting:B,isDragging:F,listeners:je,node:x,overIndex:p,over:Ye,setNodeRef:Ke,setActivatorNodeRef:Z,setDroppableNodeRef:N,setDraggableNodeRef:De,transform:ge??We,transition:ne()};function ne(){if(ge||Ee&&A.current.newIndex===D)return uo;if(!(de&&!ot(U)||!u)&&(B||J))return fe.Transition.toString({...u,property:yn})}}function ho(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}S.Down,S.Right,S.Up,S.Left;export{fe as C,xo as D,cn as P,Ro as S,po as a,So as b,mo as c,vn as d,Co as e,yo as f,Wr as g,wo as p,bo as u,Do as v};
6
- //# sourceMappingURL=board-ta0rUHOf.js.map
6
+ //# sourceMappingURL=board-C6jCchjI.js.map