@middag-io/react 0.18.0 → 0.19.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 (229) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +12 -1
  3. package/dist-lib/{MarkdownContent-Bt6q-Y_1.js → MarkdownContent-NiKKjJ9H.js} +4812 -1554
  4. package/dist-lib/app/ContractPage.d.ts +1 -1
  5. package/dist-lib/app/ContractPage.d.ts.map +1 -1
  6. package/dist-lib/app/HostSlot.d.ts +2 -2
  7. package/dist-lib/app/providers/locales/pt-BR.d.ts +1 -1
  8. package/dist-lib/app/register-defaults.d.ts +6 -6
  9. package/dist-lib/app/register-defaults.d.ts.map +1 -1
  10. package/dist-lib/app/registries.d.ts +4 -4
  11. package/dist-lib/app/registries.d.ts.map +1 -1
  12. package/dist-lib/base/blocks/ActionGridBlock.d.ts.map +1 -1
  13. package/dist-lib/base/blocks/DenseTableBlock.d.ts.map +1 -1
  14. package/dist-lib/base/blocks/DetailPanelBlock.d.ts.map +1 -1
  15. package/dist-lib/base/blocks/EmptyStateBlock.d.ts.map +1 -1
  16. package/dist-lib/base/blocks/MarkdownPanelBlock.d.ts.map +1 -1
  17. package/dist-lib/base/hooks/usePolling.d.ts.map +1 -1
  18. package/dist-lib/base/layout/DashboardLayout.d.ts.map +1 -1
  19. package/dist-lib/base/partials/ActionBar/index.d.ts.map +1 -1
  20. package/dist-lib/base/partials/DataTable/index.d.ts.map +1 -1
  21. package/dist-lib/base/shell/ImmersiveShell.d.ts.map +1 -1
  22. package/dist-lib/base/shell/partials/InspectorContext.d.ts +2 -15
  23. package/dist-lib/base/shell/partials/InspectorContext.d.ts.map +1 -1
  24. package/dist-lib/base/shell/partials/PageActionButton.d.ts +5 -1
  25. package/dist-lib/base/shell/partials/PageActionButton.d.ts.map +1 -1
  26. package/dist-lib/components/reui/accordion.d.ts +8 -0
  27. package/dist-lib/components/reui/accordion.d.ts.map +1 -0
  28. package/dist-lib/components/reui/alert-dialog.d.ts +19 -0
  29. package/dist-lib/components/reui/alert-dialog.d.ts.map +1 -0
  30. package/dist-lib/components/reui/alert.d.ts +1 -1
  31. package/dist-lib/components/reui/aspect-ratio.d.ts +4 -0
  32. package/dist-lib/components/reui/aspect-ratio.d.ts.map +1 -0
  33. package/dist-lib/components/reui/autocomplete.d.ts +41 -0
  34. package/dist-lib/components/reui/autocomplete.d.ts.map +1 -0
  35. package/dist-lib/components/reui/badge.d.ts +1 -1
  36. package/dist-lib/components/reui/breadcrumb.d.ts +12 -0
  37. package/dist-lib/components/reui/breadcrumb.d.ts.map +1 -0
  38. package/dist-lib/components/reui/button-group.d.ts +12 -0
  39. package/dist-lib/components/reui/button-group.d.ts.map +1 -0
  40. package/dist-lib/components/reui/button.d.ts +1 -1
  41. package/dist-lib/components/reui/carousel.d.ts +20 -0
  42. package/dist-lib/components/reui/carousel.d.ts.map +1 -0
  43. package/dist-lib/components/reui/collapsible.d.ts +6 -0
  44. package/dist-lib/components/reui/collapsible.d.ts.map +1 -0
  45. package/dist-lib/components/reui/command.d.ts +19 -0
  46. package/dist-lib/components/reui/command.d.ts.map +1 -0
  47. package/dist-lib/components/reui/context-menu.d.ts +26 -0
  48. package/dist-lib/components/reui/context-menu.d.ts.map +1 -0
  49. package/dist-lib/components/reui/data-grid/data-grid-column-filter.d.ts +15 -0
  50. package/dist-lib/components/reui/data-grid/data-grid-column-filter.d.ts.map +1 -0
  51. package/dist-lib/components/reui/data-grid/data-grid-column-header.d.ts +15 -0
  52. package/dist-lib/components/reui/data-grid/data-grid-column-header.d.ts.map +1 -0
  53. package/dist-lib/components/reui/data-grid/data-grid-column-visibility.d.ts +8 -0
  54. package/dist-lib/components/reui/data-grid/data-grid-column-visibility.d.ts.map +1 -0
  55. package/dist-lib/components/reui/data-grid/data-grid-pagination.d.ts +20 -0
  56. package/dist-lib/components/reui/data-grid/data-grid-pagination.d.ts.map +1 -0
  57. package/dist-lib/components/reui/data-grid/data-grid-scroll-area.d.ts +11 -0
  58. package/dist-lib/components/reui/data-grid/data-grid-scroll-area.d.ts.map +1 -0
  59. package/dist-lib/components/reui/data-grid/data-grid-table-dnd-rows.d.ts +12 -0
  60. package/dist-lib/components/reui/data-grid/data-grid-table-dnd-rows.d.ts.map +1 -0
  61. package/dist-lib/components/reui/data-grid/data-grid-table-dnd.d.ts +8 -0
  62. package/dist-lib/components/reui/data-grid/data-grid-table-dnd.d.ts.map +1 -0
  63. package/dist-lib/components/reui/data-grid/data-grid-table-virtual.d.ts +28 -0
  64. package/dist-lib/components/reui/data-grid/data-grid-table-virtual.d.ts.map +1 -0
  65. package/dist-lib/components/reui/data-grid/data-grid-table.d.ts +98 -0
  66. package/dist-lib/components/reui/data-grid/data-grid-table.d.ts.map +1 -0
  67. package/dist-lib/components/reui/data-grid/data-grid.d.ts +94 -0
  68. package/dist-lib/components/reui/data-grid/data-grid.d.ts.map +1 -0
  69. package/dist-lib/components/reui/data-grid-pagination.d.ts +20 -0
  70. package/dist-lib/components/reui/data-grid-pagination.d.ts.map +1 -0
  71. package/dist-lib/components/reui/drawer.d.ts +14 -0
  72. package/dist-lib/components/reui/drawer.d.ts.map +1 -0
  73. package/dist-lib/components/reui/empty.d.ts +12 -0
  74. package/dist-lib/components/reui/empty.d.ts.map +1 -0
  75. package/dist-lib/components/reui/field.d.ts +25 -0
  76. package/dist-lib/components/reui/field.d.ts.map +1 -0
  77. package/dist-lib/components/reui/filters.d.ts +165 -0
  78. package/dist-lib/components/reui/filters.d.ts.map +1 -0
  79. package/dist-lib/components/reui/frame.d.ts +1 -1
  80. package/dist-lib/components/reui/hover-card.d.ts +7 -0
  81. package/dist-lib/components/reui/hover-card.d.ts.map +1 -0
  82. package/dist-lib/components/reui/icon-placeholder.d.ts +18 -0
  83. package/dist-lib/components/reui/icon-placeholder.d.ts.map +1 -0
  84. package/dist-lib/components/reui/input-otp.d.ts +12 -0
  85. package/dist-lib/components/reui/input-otp.d.ts.map +1 -0
  86. package/dist-lib/components/reui/item.d.ts +24 -0
  87. package/dist-lib/components/reui/item.d.ts.map +1 -0
  88. package/dist-lib/components/reui/kbd.d.ts +4 -0
  89. package/dist-lib/components/reui/kbd.d.ts.map +1 -0
  90. package/dist-lib/components/reui/menubar.d.ts +27 -0
  91. package/dist-lib/components/reui/menubar.d.ts.map +1 -0
  92. package/dist-lib/components/reui/native-select.d.ts +8 -0
  93. package/dist-lib/components/reui/native-select.d.ts.map +1 -0
  94. package/dist-lib/components/reui/navigation-menu.d.ts +15 -0
  95. package/dist-lib/components/reui/navigation-menu.d.ts.map +1 -0
  96. package/dist-lib/components/reui/pagination.d.ts +14 -0
  97. package/dist-lib/components/reui/pagination.d.ts.map +1 -0
  98. package/dist-lib/components/reui/progress.d.ts +5 -0
  99. package/dist-lib/components/reui/progress.d.ts.map +1 -0
  100. package/dist-lib/components/reui/resizable.d.ts +8 -0
  101. package/dist-lib/components/reui/resizable.d.ts.map +1 -0
  102. package/dist-lib/components/reui/scrollspy.d.ts +15 -0
  103. package/dist-lib/components/reui/scrollspy.d.ts.map +1 -0
  104. package/dist-lib/components/reui/slider.d.ts +5 -0
  105. package/dist-lib/components/reui/slider.d.ts.map +1 -0
  106. package/dist-lib/components/reui/sortable.d.ts +39 -0
  107. package/dist-lib/components/reui/sortable.d.ts.map +1 -0
  108. package/dist-lib/components/reui/svgs/claudeAiIcon.d.ts +4 -0
  109. package/dist-lib/components/reui/svgs/claudeAiIcon.d.ts.map +1 -0
  110. package/dist-lib/components/reui/svgs/gemini.d.ts +4 -0
  111. package/dist-lib/components/reui/svgs/gemini.d.ts.map +1 -0
  112. package/dist-lib/components/reui/svgs/openai.d.ts +4 -0
  113. package/dist-lib/components/reui/svgs/openai.d.ts.map +1 -0
  114. package/dist-lib/components/reui/svgs/openaiDark.d.ts +4 -0
  115. package/dist-lib/components/reui/svgs/openaiDark.d.ts.map +1 -0
  116. package/dist-lib/components/reui/table.d.ts +11 -0
  117. package/dist-lib/components/reui/table.d.ts.map +1 -0
  118. package/dist-lib/components/reui/timeline.d.ts +26 -0
  119. package/dist-lib/components/reui/timeline.d.ts.map +1 -0
  120. package/dist-lib/components/reui/toggle-group.d.ts +10 -0
  121. package/dist-lib/components/reui/toggle-group.d.ts.map +1 -0
  122. package/dist-lib/components/reui/toggle.d.ts +10 -0
  123. package/dist-lib/components/reui/toggle.d.ts.map +1 -0
  124. package/dist-lib/components/reui/tree.d.ts +24 -0
  125. package/dist-lib/components/reui/tree.d.ts.map +1 -0
  126. package/dist-lib/contracts/block-data/actions.d.ts +32 -31
  127. package/dist-lib/contracts/block-data/actions.d.ts.map +1 -1
  128. package/dist-lib/contracts/block-data/data-display.d.ts +0 -25
  129. package/dist-lib/contracts/block-data/data-display.d.ts.map +1 -1
  130. package/dist-lib/contracts/block-data/form.d.ts +0 -15
  131. package/dist-lib/contracts/block-data/form.d.ts.map +1 -1
  132. package/dist-lib/contracts/block-data/interactive.d.ts +11 -114
  133. package/dist-lib/contracts/block-data/interactive.d.ts.map +1 -1
  134. package/dist-lib/contracts/generated/contract-schema.d.ts +182 -0
  135. package/dist-lib/contracts/generated/contract-schema.d.ts.map +1 -0
  136. package/dist-lib/contracts/generated/contract-types.d.ts +278 -0
  137. package/dist-lib/contracts/generated/contract-types.d.ts.map +1 -0
  138. package/dist-lib/contracts/generated/index.d.ts +16 -0
  139. package/dist-lib/contracts/generated/index.d.ts.map +1 -0
  140. package/dist-lib/contracts/page-contract-schema.d.ts +81 -33
  141. package/dist-lib/contracts/page-contract-schema.d.ts.map +1 -1
  142. package/dist-lib/contracts/page-contract.d.ts +26 -168
  143. package/dist-lib/contracts/page-contract.d.ts.map +1 -1
  144. package/dist-lib/index.d.ts +3 -14
  145. package/dist-lib/index.d.ts.map +1 -1
  146. package/dist-lib/lib/actions/resolve-action-target.d.ts +76 -0
  147. package/dist-lib/lib/actions/resolve-action-target.d.ts.map +1 -0
  148. package/dist-lib/lib/i18n/render-label.d.ts +31 -0
  149. package/dist-lib/lib/i18n/render-label.d.ts.map +1 -0
  150. package/dist-lib/middag-react.css +1 -1
  151. package/dist-lib/middag-react.js +23960 -8210
  152. package/package.json +9 -10
  153. package/dist-lib/ChartPanelBlock-CSQd3YU7.js +0 -18005
  154. package/dist-lib/ConditionTreeBlock-BX_2p3Yz.js +0 -86
  155. package/dist-lib/DateField-BxYJUlk4.js +0 -121
  156. package/dist-lib/DateRangeField-DK02BwDy.js +0 -663
  157. package/dist-lib/DocumentField-Mc-FrWZt.js +0 -221
  158. package/dist-lib/FlowEditorBlock-NrPOi3mS.js +0 -7180
  159. package/dist-lib/FormBuilderBlock-Yzy7KaAI.js +0 -240
  160. package/dist-lib/FormPanelBlock-C9facP0m.js +0 -8827
  161. package/dist-lib/FormPanelBlock-ulvxaRzJ.js +0 -2
  162. package/dist-lib/HugeiconsIcon-Bh8XgTFo.js +0 -1346
  163. package/dist-lib/KanbanBoardBlock-DhiQZzqL.js +0 -399
  164. package/dist-lib/PhoneField-B1EDgorM.js +0 -18585
  165. package/dist-lib/SentenceBuilderBlock--JBOCkXI.js +0 -91
  166. package/dist-lib/badge-AMZPvmLD.js +0 -63
  167. package/dist-lib/base/blocks/ChartPanelBlock.d.ts +0 -11
  168. package/dist-lib/base/blocks/ChartPanelBlock.d.ts.map +0 -1
  169. package/dist-lib/base/blocks/ConditionTreeBlock.d.ts +0 -13
  170. package/dist-lib/base/blocks/ConditionTreeBlock.d.ts.map +0 -1
  171. package/dist-lib/base/blocks/FlowEditorBlock.d.ts +0 -15
  172. package/dist-lib/base/blocks/FlowEditorBlock.d.ts.map +0 -1
  173. package/dist-lib/base/blocks/FormBuilderBlock.d.ts +0 -17
  174. package/dist-lib/base/blocks/FormBuilderBlock.d.ts.map +0 -1
  175. package/dist-lib/base/blocks/FormPanelBlock.d.ts +0 -18
  176. package/dist-lib/base/blocks/FormPanelBlock.d.ts.map +0 -1
  177. package/dist-lib/base/blocks/KanbanBoardBlock.d.ts +0 -11
  178. package/dist-lib/base/blocks/KanbanBoardBlock.d.ts.map +0 -1
  179. package/dist-lib/base/blocks/SentenceBuilderBlock.d.ts +0 -15
  180. package/dist-lib/base/blocks/SentenceBuilderBlock.d.ts.map +0 -1
  181. package/dist-lib/base/form/form-schema-builder.d.ts +0 -27
  182. package/dist-lib/base/form/form-schema-builder.d.ts.map +0 -1
  183. package/dist-lib/base/shell/ProductShell.d.ts +0 -34
  184. package/dist-lib/base/shell/ProductShell.d.ts.map +0 -1
  185. package/dist-lib/base/shell/partials/AdminTabBar.d.ts +0 -12
  186. package/dist-lib/base/shell/partials/AdminTabBar.d.ts.map +0 -1
  187. package/dist-lib/base/shell/partials/AppearanceToggle.d.ts +0 -8
  188. package/dist-lib/base/shell/partials/AppearanceToggle.d.ts.map +0 -1
  189. package/dist-lib/base/shell/partials/BoostSearchBar.d.ts +0 -32
  190. package/dist-lib/base/shell/partials/BoostSearchBar.d.ts.map +0 -1
  191. package/dist-lib/base/shell/partials/CommandPalette.d.ts +0 -24
  192. package/dist-lib/base/shell/partials/CommandPalette.d.ts.map +0 -1
  193. package/dist-lib/base/shell/partials/HelpContext.d.ts +0 -15
  194. package/dist-lib/base/shell/partials/HelpContext.d.ts.map +0 -1
  195. package/dist-lib/base/shell/partials/HelpPanel.d.ts +0 -15
  196. package/dist-lib/base/shell/partials/HelpPanel.d.ts.map +0 -1
  197. package/dist-lib/base/shell/partials/InlineInspector.d.ts +0 -16
  198. package/dist-lib/base/shell/partials/InlineInspector.d.ts.map +0 -1
  199. package/dist-lib/base/shell/partials/PageFilterTabs.d.ts +0 -22
  200. package/dist-lib/base/shell/partials/PageFilterTabs.d.ts.map +0 -1
  201. package/dist-lib/base/shell/partials/PageHeader.d.ts +0 -22
  202. package/dist-lib/base/shell/partials/PageHeader.d.ts.map +0 -1
  203. package/dist-lib/base/shell/partials/SidebarNav.d.ts +0 -17
  204. package/dist-lib/base/shell/partials/SidebarNav.d.ts.map +0 -1
  205. package/dist-lib/button-D5Y6A1RJ.js +0 -242
  206. package/dist-lib/calendar-bwe48kor.js +0 -4503
  207. package/dist-lib/chevron-right-C6BILigO.js +0 -7
  208. package/dist-lib/chunk-DeC0fbbY.js +0 -22
  209. package/dist-lib/combobox-BDHFCl2n.js +0 -5303
  210. package/dist-lib/contracts/page-contract-data.d.ts +0 -63
  211. package/dist-lib/contracts/page-contract-data.d.ts.map +0 -1
  212. package/dist-lib/dist-BpzJKgoL.js +0 -1196
  213. package/dist-lib/dist-DkjgjvZx.js +0 -123
  214. package/dist-lib/dist-FCfSQ65-.js +0 -15
  215. package/dist-lib/dist-a1sZXfE3.js +0 -54
  216. package/dist-lib/dist-igfsCvSN.js +0 -235
  217. package/dist-lib/document-validation-DfjoJeek.js +0 -1249
  218. package/dist-lib/floating-ui.react-dom-62M1nRNP.js +0 -1089
  219. package/dist-lib/i18n-BMTYOmLT.js +0 -329
  220. package/dist-lib/input-DzdJK5AV.js +0 -14
  221. package/dist-lib/popover-DmaFo0PE.js +0 -242
  222. package/dist-lib/scroll-area-f_LkBXTB.js +0 -557
  223. package/dist-lib/skeleton-DzfTvSIA.js +0 -12
  224. package/dist-lib/sortable.esm-DsdSKGdv.js +0 -2499
  225. package/dist-lib/use-mobile-BADA7dx5.js +0 -205
  226. package/dist-lib/utils-CpaZ5_iF.js +0 -1692
  227. package/dist-lib/value-PnGnjGbr.js +0 -413
  228. package/dist-lib/with-selector-t6tzmyqE.js +0 -185
  229. /package/dist-lib/{dist-DEukRl4M.js → dist-CK9PErDU.js} +0 -0
@@ -1,2499 +0,0 @@
1
- import e, { cloneElement as t, createContext as n, forwardRef as r, memo as i, useCallback as a, useContext as o, useEffect as s, useLayoutEffect as c, useMemo as l, useReducer as u, useRef as d, useState as f } from "react";
2
- import { createPortal as p, unstable_batchedUpdates as m } from "react-dom";
3
- //#region node_modules/@dnd-kit/utilities/dist/utilities.esm.js
4
- function h() {
5
- var e = [...arguments];
6
- return l(() => (t) => {
7
- e.forEach((e) => e(t));
8
- }, e);
9
- }
10
- var g = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
11
- function _(e) {
12
- let t = Object.prototype.toString.call(e);
13
- return t === "[object Window]" || t === "[object global]";
14
- }
15
- function v(e) {
16
- return "nodeType" in e;
17
- }
18
- function y(e) {
19
- return e ? _(e) ? e : v(e) ? e.ownerDocument?.defaultView ?? window : window : window;
20
- }
21
- function b(e) {
22
- let { Document: t } = y(e);
23
- return e instanceof t;
24
- }
25
- function x(e) {
26
- return _(e) ? !1 : e instanceof y(e).HTMLElement;
27
- }
28
- function S(e) {
29
- return e instanceof y(e).SVGElement;
30
- }
31
- function C(e) {
32
- return e ? _(e) ? e.document : v(e) ? b(e) ? e : x(e) || S(e) ? e.ownerDocument : document : document : document;
33
- }
34
- var w = g ? c : s;
35
- function T(e) {
36
- let t = d(e);
37
- return w(() => {
38
- t.current = e;
39
- }), a(function() {
40
- var e = [...arguments];
41
- return t.current == null ? void 0 : t.current(...e);
42
- }, []);
43
- }
44
- function E() {
45
- let e = d(null);
46
- return [a((t, n) => {
47
- e.current = setInterval(t, n);
48
- }, []), a(() => {
49
- e.current !== null && (clearInterval(e.current), e.current = null);
50
- }, [])];
51
- }
52
- function ee(e, t) {
53
- t === void 0 && (t = [e]);
54
- let n = d(e);
55
- return w(() => {
56
- n.current !== e && (n.current = e);
57
- }, t), n;
58
- }
59
- function D(e, t) {
60
- let n = d();
61
- return l(() => {
62
- let t = e(n.current);
63
- return n.current = t, t;
64
- }, [...t]);
65
- }
66
- function O(e) {
67
- let t = T(e), n = d(null);
68
- return [n, a((e) => {
69
- e !== n.current && t?.(e, n.current), n.current = e;
70
- }, [])];
71
- }
72
- function k(e) {
73
- let t = d();
74
- return s(() => {
75
- t.current = e;
76
- }, [e]), t.current;
77
- }
78
- var A = {};
79
- function j(e, t) {
80
- return l(() => {
81
- if (t) return t;
82
- let n = A[e] == null ? 0 : A[e] + 1;
83
- return A[e] = n, e + "-" + n;
84
- }, [e, t]);
85
- }
86
- function te(e) {
87
- return function(t) {
88
- return [...arguments].slice(1).reduce((t, n) => {
89
- let r = Object.entries(n);
90
- for (let [n, i] of r) {
91
- let r = t[n];
92
- r != null && (t[n] = r + e * i);
93
- }
94
- return t;
95
- }, { ...t });
96
- };
97
- }
98
- var ne = /* @__PURE__ */ te(1), M = /* @__PURE__ */ te(-1);
99
- function N(e) {
100
- return "clientX" in e && "clientY" in e;
101
- }
102
- function P(e) {
103
- if (!e) return !1;
104
- let { KeyboardEvent: t } = y(e.target);
105
- return t && e instanceof t;
106
- }
107
- function re(e) {
108
- if (!e) return !1;
109
- let { TouchEvent: t } = y(e.target);
110
- return t && e instanceof t;
111
- }
112
- function ie(e) {
113
- if (re(e)) {
114
- if (e.touches && e.touches.length) {
115
- let { clientX: t, clientY: n } = e.touches[0];
116
- return {
117
- x: t,
118
- y: n
119
- };
120
- } else if (e.changedTouches && e.changedTouches.length) {
121
- let { clientX: t, clientY: n } = e.changedTouches[0];
122
- return {
123
- x: t,
124
- y: n
125
- };
126
- }
127
- }
128
- return N(e) ? {
129
- x: e.clientX,
130
- y: e.clientY
131
- } : null;
132
- }
133
- var F = /* @__PURE__ */ Object.freeze({
134
- Translate: { toString(e) {
135
- if (!e) return;
136
- let { x: t, y: n } = e;
137
- return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (n ? Math.round(n) : 0) + "px, 0)";
138
- } },
139
- Scale: { toString(e) {
140
- if (!e) return;
141
- let { scaleX: t, scaleY: n } = e;
142
- return "scaleX(" + t + ") scaleY(" + n + ")";
143
- } },
144
- Transform: { toString(e) {
145
- if (e) return [F.Translate.toString(e), F.Scale.toString(e)].join(" ");
146
- } },
147
- Transition: { toString(e) {
148
- let { property: t, duration: n, easing: r } = e;
149
- return t + " " + n + "ms " + r;
150
- } }
151
- }), I = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
152
- function ae(e) {
153
- return e.matches(I) ? e : e.querySelector(I);
154
- }
155
- //#endregion
156
- //#region node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js
157
- var L = { display: "none" };
158
- function oe(t) {
159
- let { id: n, value: r } = t;
160
- return e.createElement("div", {
161
- id: n,
162
- style: L
163
- }, r);
164
- }
165
- function R(t) {
166
- let { id: n, announcement: r, ariaLiveType: i = "assertive" } = t;
167
- return e.createElement("div", {
168
- id: n,
169
- style: {
170
- position: "fixed",
171
- top: 0,
172
- left: 0,
173
- width: 1,
174
- height: 1,
175
- margin: -1,
176
- border: 0,
177
- padding: 0,
178
- overflow: "hidden",
179
- clip: "rect(0 0 0 0)",
180
- clipPath: "inset(100%)",
181
- whiteSpace: "nowrap"
182
- },
183
- role: "status",
184
- "aria-live": i,
185
- "aria-atomic": !0
186
- }, r);
187
- }
188
- function z() {
189
- let [e, t] = f("");
190
- return {
191
- announce: a((e) => {
192
- e != null && t(e);
193
- }, []),
194
- announcement: e
195
- };
196
- }
197
- //#endregion
198
- //#region node_modules/@dnd-kit/core/dist/core.esm.js
199
- var se = /* @__PURE__ */ n(null);
200
- function ce(e) {
201
- let t = o(se);
202
- s(() => {
203
- if (!t) throw Error("useDndMonitor must be used within a children of <DndContext>");
204
- return t(e);
205
- }, [e, t]);
206
- }
207
- function le() {
208
- let [e] = f(() => /* @__PURE__ */ new Set()), t = a((t) => (e.add(t), () => e.delete(t)), [e]);
209
- return [a((t) => {
210
- let { type: n, event: r } = t;
211
- e.forEach((e) => e[n]?.call(e, r));
212
- }, [e]), t];
213
- }
214
- var B = { draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " }, V = {
215
- onDragStart(e) {
216
- let { active: t } = e;
217
- return "Picked up draggable item " + t.id + ".";
218
- },
219
- onDragOver(e) {
220
- let { active: t, over: n } = e;
221
- return n ? "Draggable item " + t.id + " was moved over droppable area " + n.id + "." : "Draggable item " + t.id + " is no longer over a droppable area.";
222
- },
223
- onDragEnd(e) {
224
- let { active: t, over: n } = e;
225
- return n ? "Draggable item " + t.id + " was dropped over droppable area " + n.id : "Draggable item " + t.id + " was dropped.";
226
- },
227
- onDragCancel(e) {
228
- let { active: t } = e;
229
- return "Dragging was cancelled. Draggable item " + t.id + " was dropped.";
230
- }
231
- };
232
- function ue(t) {
233
- let { announcements: n = V, container: r, hiddenTextDescribedById: i, screenReaderInstructions: a = B } = t, { announce: o, announcement: c } = z(), u = j("DndLiveRegion"), [d, m] = f(!1);
234
- if (s(() => {
235
- m(!0);
236
- }, []), ce(l(() => ({
237
- onDragStart(e) {
238
- let { active: t } = e;
239
- o(n.onDragStart({ active: t }));
240
- },
241
- onDragMove(e) {
242
- let { active: t, over: r } = e;
243
- n.onDragMove && o(n.onDragMove({
244
- active: t,
245
- over: r
246
- }));
247
- },
248
- onDragOver(e) {
249
- let { active: t, over: r } = e;
250
- o(n.onDragOver({
251
- active: t,
252
- over: r
253
- }));
254
- },
255
- onDragEnd(e) {
256
- let { active: t, over: r } = e;
257
- o(n.onDragEnd({
258
- active: t,
259
- over: r
260
- }));
261
- },
262
- onDragCancel(e) {
263
- let { active: t, over: r } = e;
264
- o(n.onDragCancel({
265
- active: t,
266
- over: r
267
- }));
268
- }
269
- }), [o, n])), !d) return null;
270
- let h = e.createElement(e.Fragment, null, e.createElement(oe, {
271
- id: i,
272
- value: a.draggable
273
- }), e.createElement(R, {
274
- id: u,
275
- announcement: c
276
- }));
277
- return r ? p(h, r) : h;
278
- }
279
- var H;
280
- (function(e) {
281
- e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
282
- })(H ||= {});
283
- function U() {}
284
- function de(e, t) {
285
- return l(() => ({
286
- sensor: e,
287
- options: t ?? {}
288
- }), [e, t]);
289
- }
290
- function fe() {
291
- var e = [...arguments];
292
- return l(() => [...e].filter((e) => e != null), [...e]);
293
- }
294
- var W = /* @__PURE__ */ Object.freeze({
295
- x: 0,
296
- y: 0
297
- });
298
- function G(e, t) {
299
- return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
300
- }
301
- function pe(e, t) {
302
- let n = ie(e);
303
- if (!n) return "0 0";
304
- let r = {
305
- x: (n.x - t.left) / t.width * 100,
306
- y: (n.y - t.top) / t.height * 100
307
- };
308
- return r.x + "% " + r.y + "%";
309
- }
310
- function K(e, t) {
311
- let { data: { value: n } } = e, { data: { value: r } } = t;
312
- return n - r;
313
- }
314
- function me(e, t) {
315
- let { data: { value: n } } = e, { data: { value: r } } = t;
316
- return r - n;
317
- }
318
- function q(e) {
319
- let { left: t, top: n, height: r, width: i } = e;
320
- return [
321
- {
322
- x: t,
323
- y: n
324
- },
325
- {
326
- x: t + i,
327
- y: n
328
- },
329
- {
330
- x: t,
331
- y: n + r
332
- },
333
- {
334
- x: t + i,
335
- y: n + r
336
- }
337
- ];
338
- }
339
- function he(e, t) {
340
- if (!e || e.length === 0) return null;
341
- let [n] = e;
342
- return t ? n[t] : n;
343
- }
344
- function ge(e, t, n) {
345
- return t === void 0 && (t = e.left), n === void 0 && (n = e.top), {
346
- x: t + e.width * .5,
347
- y: n + e.height * .5
348
- };
349
- }
350
- var _e = (e) => {
351
- let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = ge(t, t.left, t.top), a = [];
352
- for (let e of r) {
353
- let { id: t } = e, r = n.get(t);
354
- if (r) {
355
- let n = G(ge(r), i);
356
- a.push({
357
- id: t,
358
- data: {
359
- droppableContainer: e,
360
- value: n
361
- }
362
- });
363
- }
364
- }
365
- return a.sort(K);
366
- }, ve = (e) => {
367
- let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = q(t), a = [];
368
- for (let e of r) {
369
- let { id: t } = e, r = n.get(t);
370
- if (r) {
371
- let n = q(r), o = i.reduce((e, t, r) => e + G(n[r], t), 0), s = Number((o / 4).toFixed(4));
372
- a.push({
373
- id: t,
374
- data: {
375
- droppableContainer: e,
376
- value: s
377
- }
378
- });
379
- }
380
- }
381
- return a.sort(K);
382
- };
383
- function ye(e, t) {
384
- let n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), i = Math.min(t.left + t.width, e.left + e.width), a = Math.min(t.top + t.height, e.top + e.height), o = i - r, s = a - n;
385
- if (r < i && n < a) {
386
- let n = t.width * t.height, r = e.width * e.height, i = o * s, a = i / (n + r - i);
387
- return Number(a.toFixed(4));
388
- }
389
- return 0;
390
- }
391
- var be = (e) => {
392
- let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = [];
393
- for (let e of r) {
394
- let { id: r } = e, a = n.get(r);
395
- if (a) {
396
- let n = ye(a, t);
397
- n > 0 && i.push({
398
- id: r,
399
- data: {
400
- droppableContainer: e,
401
- value: n
402
- }
403
- });
404
- }
405
- }
406
- return i.sort(me);
407
- };
408
- function xe(e, t, n) {
409
- return {
410
- ...e,
411
- scaleX: t && n ? t.width / n.width : 1,
412
- scaleY: t && n ? t.height / n.height : 1
413
- };
414
- }
415
- function Se(e, t) {
416
- return e && t ? {
417
- x: e.left - t.left,
418
- y: e.top - t.top
419
- } : W;
420
- }
421
- function J(e) {
422
- return function(t) {
423
- return [...arguments].slice(1).reduce((t, n) => ({
424
- ...t,
425
- top: t.top + e * n.y,
426
- bottom: t.bottom + e * n.y,
427
- left: t.left + e * n.x,
428
- right: t.right + e * n.x
429
- }), { ...t });
430
- };
431
- }
432
- var Ce = /* @__PURE__ */ J(1);
433
- function we(e) {
434
- if (e.startsWith("matrix3d(")) {
435
- let t = e.slice(9, -1).split(/, /);
436
- return {
437
- x: +t[12],
438
- y: +t[13],
439
- scaleX: +t[0],
440
- scaleY: +t[5]
441
- };
442
- } else if (e.startsWith("matrix(")) {
443
- let t = e.slice(7, -1).split(/, /);
444
- return {
445
- x: +t[4],
446
- y: +t[5],
447
- scaleX: +t[0],
448
- scaleY: +t[3]
449
- };
450
- }
451
- return null;
452
- }
453
- function Te(e, t, n) {
454
- let r = we(t);
455
- if (!r) return e;
456
- let { scaleX: i, scaleY: a, x: o, y: s } = r, c = e.left - o - (1 - i) * parseFloat(n), l = e.top - s - (1 - a) * parseFloat(n.slice(n.indexOf(" ") + 1)), u = i ? e.width / i : e.width, d = a ? e.height / a : e.height;
457
- return {
458
- width: u,
459
- height: d,
460
- top: l,
461
- right: c + u,
462
- bottom: l + d,
463
- left: c
464
- };
465
- }
466
- var Ee = { ignoreTransform: !1 };
467
- function De(e, t) {
468
- t === void 0 && (t = Ee);
469
- let n = e.getBoundingClientRect();
470
- if (t.ignoreTransform) {
471
- let { transform: t, transformOrigin: r } = y(e).getComputedStyle(e);
472
- t && (n = Te(n, t, r));
473
- }
474
- let { top: r, left: i, width: a, height: o, bottom: s, right: c } = n;
475
- return {
476
- top: r,
477
- left: i,
478
- width: a,
479
- height: o,
480
- bottom: s,
481
- right: c
482
- };
483
- }
484
- function Oe(e) {
485
- return De(e, { ignoreTransform: !0 });
486
- }
487
- function ke(e) {
488
- let t = e.innerWidth, n = e.innerHeight;
489
- return {
490
- top: 0,
491
- left: 0,
492
- right: t,
493
- bottom: n,
494
- width: t,
495
- height: n
496
- };
497
- }
498
- function Ae(e, t) {
499
- return t === void 0 && (t = y(e).getComputedStyle(e)), t.position === "fixed";
500
- }
501
- function je(e, t) {
502
- t === void 0 && (t = y(e).getComputedStyle(e));
503
- let n = /(auto|scroll|overlay)/;
504
- return [
505
- "overflow",
506
- "overflowX",
507
- "overflowY"
508
- ].some((e) => {
509
- let r = t[e];
510
- return typeof r == "string" ? n.test(r) : !1;
511
- });
512
- }
513
- function Y(e, t) {
514
- let n = [];
515
- function r(i) {
516
- if (t != null && n.length >= t || !i) return n;
517
- if (b(i) && i.scrollingElement != null && !n.includes(i.scrollingElement)) return n.push(i.scrollingElement), n;
518
- if (!x(i) || S(i) || n.includes(i)) return n;
519
- let a = y(e).getComputedStyle(i);
520
- return i !== e && je(i, a) && n.push(i), Ae(i, a) ? n : r(i.parentNode);
521
- }
522
- return e ? r(e) : n;
523
- }
524
- function Me(e) {
525
- let [t] = Y(e, 1);
526
- return t ?? null;
527
- }
528
- function X(e) {
529
- return !g || !e ? null : _(e) ? e : v(e) ? b(e) || e === C(e).scrollingElement ? window : x(e) ? e : null : null;
530
- }
531
- function Ne(e) {
532
- return _(e) ? e.scrollX : e.scrollLeft;
533
- }
534
- function Pe(e) {
535
- return _(e) ? e.scrollY : e.scrollTop;
536
- }
537
- function Fe(e) {
538
- return {
539
- x: Ne(e),
540
- y: Pe(e)
541
- };
542
- }
543
- var Z;
544
- (function(e) {
545
- e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
546
- })(Z ||= {});
547
- function Ie(e) {
548
- return !g || !e ? !1 : e === document.scrollingElement;
549
- }
550
- function Le(e) {
551
- let t = {
552
- x: 0,
553
- y: 0
554
- }, n = Ie(e) ? {
555
- height: window.innerHeight,
556
- width: window.innerWidth
557
- } : {
558
- height: e.clientHeight,
559
- width: e.clientWidth
560
- }, r = {
561
- x: e.scrollWidth - n.width,
562
- y: e.scrollHeight - n.height
563
- };
564
- return {
565
- isTop: e.scrollTop <= t.y,
566
- isLeft: e.scrollLeft <= t.x,
567
- isBottom: e.scrollTop >= r.y,
568
- isRight: e.scrollLeft >= r.x,
569
- maxScroll: r,
570
- minScroll: t
571
- };
572
- }
573
- var Re = {
574
- x: .2,
575
- y: .2
576
- };
577
- function ze(e, t, n, r, i) {
578
- let { top: a, left: o, right: s, bottom: c } = n;
579
- r === void 0 && (r = 10), i === void 0 && (i = Re);
580
- let { isTop: l, isBottom: u, isLeft: d, isRight: f } = Le(e), p = {
581
- x: 0,
582
- y: 0
583
- }, m = {
584
- x: 0,
585
- y: 0
586
- }, h = {
587
- height: t.height * i.y,
588
- width: t.width * i.x
589
- };
590
- return !l && a <= t.top + h.height ? (p.y = Z.Backward, m.y = r * Math.abs((t.top + h.height - a) / h.height)) : !u && c >= t.bottom - h.height && (p.y = Z.Forward, m.y = r * Math.abs((t.bottom - h.height - c) / h.height)), !f && s >= t.right - h.width ? (p.x = Z.Forward, m.x = r * Math.abs((t.right - h.width - s) / h.width)) : !d && o <= t.left + h.width && (p.x = Z.Backward, m.x = r * Math.abs((t.left + h.width - o) / h.width)), {
591
- direction: p,
592
- speed: m
593
- };
594
- }
595
- function Be(e) {
596
- if (e === document.scrollingElement) {
597
- let { innerWidth: e, innerHeight: t } = window;
598
- return {
599
- top: 0,
600
- left: 0,
601
- right: e,
602
- bottom: t,
603
- width: e,
604
- height: t
605
- };
606
- }
607
- let { top: t, left: n, right: r, bottom: i } = e.getBoundingClientRect();
608
- return {
609
- top: t,
610
- left: n,
611
- right: r,
612
- bottom: i,
613
- width: e.clientWidth,
614
- height: e.clientHeight
615
- };
616
- }
617
- function Ve(e) {
618
- return e.reduce((e, t) => ne(e, Fe(t)), W);
619
- }
620
- function He(e) {
621
- return e.reduce((e, t) => e + Ne(t), 0);
622
- }
623
- function Ue(e) {
624
- return e.reduce((e, t) => e + Pe(t), 0);
625
- }
626
- function We(e, t) {
627
- if (t === void 0 && (t = De), !e) return;
628
- let { top: n, left: r, bottom: i, right: a } = t(e);
629
- Me(e) && (i <= 0 || a <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
630
- block: "center",
631
- inline: "center"
632
- });
633
- }
634
- var Ge = [[
635
- "x",
636
- ["left", "right"],
637
- He
638
- ], [
639
- "y",
640
- ["top", "bottom"],
641
- Ue
642
- ]], Ke = class {
643
- constructor(e, t) {
644
- 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;
645
- let n = Y(t), r = Ve(n);
646
- this.rect = { ...e }, this.width = e.width, this.height = e.height;
647
- for (let [e, t, i] of Ge) for (let a of t) Object.defineProperty(this, a, {
648
- get: () => {
649
- let t = i(n), o = r[e] - t;
650
- return this.rect[a] + o;
651
- },
652
- enumerable: !0
653
- });
654
- Object.defineProperty(this, "rect", { enumerable: !1 });
655
- }
656
- }, qe = class {
657
- constructor(e) {
658
- this.target = void 0, this.listeners = [], this.removeAll = () => {
659
- this.listeners.forEach((e) => this.target?.removeEventListener(...e));
660
- }, this.target = e;
661
- }
662
- add(e, t, n) {
663
- var r;
664
- (r = this.target) == null || r.addEventListener(e, t, n), this.listeners.push([
665
- e,
666
- t,
667
- n
668
- ]);
669
- }
670
- };
671
- function Je(e) {
672
- let { EventTarget: t } = y(e);
673
- return e instanceof t ? e : C(e);
674
- }
675
- function Ye(e, t) {
676
- let n = Math.abs(e.x), r = Math.abs(e.y);
677
- 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;
678
- }
679
- var Q;
680
- (function(e) {
681
- e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
682
- })(Q ||= {});
683
- function Xe(e) {
684
- e.preventDefault();
685
- }
686
- function Ze(e) {
687
- e.stopPropagation();
688
- }
689
- var $;
690
- (function(e) {
691
- e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter", e.Tab = "Tab";
692
- })($ ||= {});
693
- var Qe = {
694
- start: [$.Space, $.Enter],
695
- cancel: [$.Esc],
696
- end: [
697
- $.Space,
698
- $.Enter,
699
- $.Tab
700
- ]
701
- }, $e = (e, t) => {
702
- let { currentCoordinates: n } = t;
703
- switch (e.code) {
704
- case $.Right: return {
705
- ...n,
706
- x: n.x + 25
707
- };
708
- case $.Left: return {
709
- ...n,
710
- x: n.x - 25
711
- };
712
- case $.Down: return {
713
- ...n,
714
- y: n.y + 25
715
- };
716
- case $.Up: return {
717
- ...n,
718
- y: n.y - 25
719
- };
720
- }
721
- }, et = class {
722
- constructor(e) {
723
- this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = e;
724
- let { event: { target: t } } = e;
725
- this.props = e, this.listeners = new qe(C(t)), this.windowListeners = new qe(y(t)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
726
- }
727
- attach() {
728
- this.handleStart(), this.windowListeners.add(Q.Resize, this.handleCancel), this.windowListeners.add(Q.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Q.Keydown, this.handleKeyDown));
729
- }
730
- handleStart() {
731
- let { activeNode: e, onStart: t } = this.props, n = e.node.current;
732
- n && We(n), t(W);
733
- }
734
- handleKeyDown(e) {
735
- if (P(e)) {
736
- let { active: t, context: n, options: r } = this.props, { keyboardCodes: i = Qe, coordinateGetter: a = $e, scrollBehavior: o = "smooth" } = r, { code: s } = e;
737
- if (i.end.includes(s)) {
738
- this.handleEnd(e);
739
- return;
740
- }
741
- if (i.cancel.includes(s)) {
742
- this.handleCancel(e);
743
- return;
744
- }
745
- let { collisionRect: c } = n.current, l = c ? {
746
- x: c.left,
747
- y: c.top
748
- } : W;
749
- this.referenceCoordinates ||= l;
750
- let u = a(e, {
751
- active: t,
752
- context: n.current,
753
- currentCoordinates: l
754
- });
755
- if (u) {
756
- let t = M(u, l), r = {
757
- x: 0,
758
- y: 0
759
- }, { scrollableAncestors: i } = n.current;
760
- for (let n of i) {
761
- let i = e.code, { isTop: a, isRight: s, isLeft: c, isBottom: l, maxScroll: d, minScroll: f } = Le(n), p = Be(n), m = {
762
- x: Math.min(i === $.Right ? p.right - p.width / 2 : p.right, Math.max(i === $.Right ? p.left : p.left + p.width / 2, u.x)),
763
- y: Math.min(i === $.Down ? p.bottom - p.height / 2 : p.bottom, Math.max(i === $.Down ? p.top : p.top + p.height / 2, u.y))
764
- }, h = i === $.Right && !s || i === $.Left && !c, g = i === $.Down && !l || i === $.Up && !a;
765
- if (h && m.x !== u.x) {
766
- let e = n.scrollLeft + t.x, a = i === $.Right && e <= d.x || i === $.Left && e >= f.x;
767
- if (a && !t.y) {
768
- n.scrollTo({
769
- left: e,
770
- behavior: o
771
- });
772
- return;
773
- }
774
- a ? r.x = n.scrollLeft - e : r.x = i === $.Right ? n.scrollLeft - d.x : n.scrollLeft - f.x, r.x && n.scrollBy({
775
- left: -r.x,
776
- behavior: o
777
- });
778
- break;
779
- } else if (g && m.y !== u.y) {
780
- let e = n.scrollTop + t.y, a = i === $.Down && e <= d.y || i === $.Up && e >= f.y;
781
- if (a && !t.x) {
782
- n.scrollTo({
783
- top: e,
784
- behavior: o
785
- });
786
- return;
787
- }
788
- a ? r.y = n.scrollTop - e : r.y = i === $.Down ? n.scrollTop - d.y : n.scrollTop - f.y, r.y && n.scrollBy({
789
- top: -r.y,
790
- behavior: o
791
- });
792
- break;
793
- }
794
- }
795
- this.handleMove(e, ne(M(u, this.referenceCoordinates), r));
796
- }
797
- }
798
- }
799
- handleMove(e, t) {
800
- let { onMove: n } = this.props;
801
- e.preventDefault(), n(t);
802
- }
803
- handleEnd(e) {
804
- let { onEnd: t } = this.props;
805
- e.preventDefault(), this.detach(), t();
806
- }
807
- handleCancel(e) {
808
- let { onCancel: t } = this.props;
809
- e.preventDefault(), this.detach(), t();
810
- }
811
- detach() {
812
- this.listeners.removeAll(), this.windowListeners.removeAll();
813
- }
814
- };
815
- et.activators = [{
816
- eventName: "onKeyDown",
817
- handler: (e, t, n) => {
818
- let { keyboardCodes: r = Qe, onActivation: i } = t, { active: a } = n, { code: o } = e.nativeEvent;
819
- if (r.start.includes(o)) {
820
- let t = a.activatorNode.current;
821
- return t && e.target !== t ? !1 : (e.preventDefault(), i?.({ event: e.nativeEvent }), !0);
822
- }
823
- return !1;
824
- }
825
- }];
826
- function tt(e) {
827
- return !!(e && "distance" in e);
828
- }
829
- function nt(e) {
830
- return !!(e && "delay" in e);
831
- }
832
- var rt = class {
833
- constructor(e, t, n) {
834
- n === void 0 && (n = Je(e.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 = e, this.events = t;
835
- let { event: r } = e, { target: i } = r;
836
- this.props = e, this.events = t, this.document = C(i), this.documentListeners = new qe(this.document), this.listeners = new qe(n), this.windowListeners = new qe(y(i)), this.initialCoordinates = ie(r) ?? W, 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();
837
- }
838
- attach() {
839
- let { events: e, props: { options: { activationConstraint: t, bypassActivationConstraint: n } } } = this;
840
- if (this.listeners.add(e.move.name, this.handleMove, { passive: !1 }), this.listeners.add(e.end.name, this.handleEnd), e.cancel && this.listeners.add(e.cancel.name, this.handleCancel), this.windowListeners.add(Q.Resize, this.handleCancel), this.windowListeners.add(Q.DragStart, Xe), this.windowListeners.add(Q.VisibilityChange, this.handleCancel), this.windowListeners.add(Q.ContextMenu, Xe), this.documentListeners.add(Q.Keydown, this.handleKeydown), t) {
841
- if (n != null && n({
842
- event: this.props.event,
843
- activeNode: this.props.activeNode,
844
- options: this.props.options
845
- })) return this.handleStart();
846
- if (nt(t)) {
847
- this.timeoutId = setTimeout(this.handleStart, t.delay), this.handlePending(t);
848
- return;
849
- }
850
- if (tt(t)) {
851
- this.handlePending(t);
852
- return;
853
- }
854
- }
855
- this.handleStart();
856
- }
857
- detach() {
858
- this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
859
- }
860
- handlePending(e, t) {
861
- let { active: n, onPending: r } = this.props;
862
- r(n, e, this.initialCoordinates, t);
863
- }
864
- handleStart() {
865
- let { initialCoordinates: e } = this, { onStart: t } = this.props;
866
- e && (this.activated = !0, this.documentListeners.add(Q.Click, Ze, { capture: !0 }), this.removeTextSelection(), this.documentListeners.add(Q.SelectionChange, this.removeTextSelection), t(e));
867
- }
868
- handleMove(e) {
869
- let { activated: t, initialCoordinates: n, props: r } = this, { onMove: i, options: { activationConstraint: a } } = r;
870
- if (!n) return;
871
- let o = ie(e) ?? W, s = M(n, o);
872
- if (!t && a) {
873
- if (tt(a)) {
874
- if (a.tolerance != null && Ye(s, a.tolerance)) return this.handleCancel();
875
- if (Ye(s, a.distance)) return this.handleStart();
876
- }
877
- if (nt(a) && Ye(s, a.tolerance)) return this.handleCancel();
878
- this.handlePending(a, s);
879
- return;
880
- }
881
- e.cancelable && e.preventDefault(), i(o);
882
- }
883
- handleEnd() {
884
- let { onAbort: e, onEnd: t } = this.props;
885
- this.detach(), this.activated || e(this.props.active), t();
886
- }
887
- handleCancel() {
888
- let { onAbort: e, onCancel: t } = this.props;
889
- this.detach(), this.activated || e(this.props.active), t();
890
- }
891
- handleKeydown(e) {
892
- e.code === $.Esc && this.handleCancel();
893
- }
894
- removeTextSelection() {
895
- var e;
896
- (e = this.document.getSelection()) == null || e.removeAllRanges();
897
- }
898
- }, it = {
899
- cancel: { name: "pointercancel" },
900
- move: { name: "pointermove" },
901
- end: { name: "pointerup" }
902
- }, at = class extends rt {
903
- constructor(e) {
904
- let { event: t } = e, n = C(t.target);
905
- super(e, it, n);
906
- }
907
- };
908
- at.activators = [{
909
- eventName: "onPointerDown",
910
- handler: (e, t) => {
911
- let { nativeEvent: n } = e, { onActivation: r } = t;
912
- return !n.isPrimary || n.button !== 0 ? !1 : (r?.({ event: n }), !0);
913
- }
914
- }];
915
- var ot = {
916
- move: { name: "mousemove" },
917
- end: { name: "mouseup" }
918
- }, st;
919
- (function(e) {
920
- e[e.RightClick = 2] = "RightClick";
921
- })(st ||= {});
922
- var ct = class extends rt {
923
- constructor(e) {
924
- super(e, ot, C(e.event.target));
925
- }
926
- };
927
- ct.activators = [{
928
- eventName: "onMouseDown",
929
- handler: (e, t) => {
930
- let { nativeEvent: n } = e, { onActivation: r } = t;
931
- return n.button === st.RightClick ? !1 : (r?.({ event: n }), !0);
932
- }
933
- }];
934
- var lt = {
935
- cancel: { name: "touchcancel" },
936
- move: { name: "touchmove" },
937
- end: { name: "touchend" }
938
- }, ut = class extends rt {
939
- constructor(e) {
940
- super(e, lt);
941
- }
942
- static setup() {
943
- return window.addEventListener(lt.move.name, e, {
944
- capture: !1,
945
- passive: !1
946
- }), function() {
947
- window.removeEventListener(lt.move.name, e);
948
- };
949
- function e() {}
950
- }
951
- };
952
- ut.activators = [{
953
- eventName: "onTouchStart",
954
- handler: (e, t) => {
955
- let { nativeEvent: n } = e, { onActivation: r } = t, { touches: i } = n;
956
- return i.length > 1 ? !1 : (r?.({ event: n }), !0);
957
- }
958
- }];
959
- var dt;
960
- (function(e) {
961
- e[e.Pointer = 0] = "Pointer", e[e.DraggableRect = 1] = "DraggableRect";
962
- })(dt ||= {});
963
- var ft;
964
- (function(e) {
965
- e[e.TreeOrder = 0] = "TreeOrder", e[e.ReversedTreeOrder = 1] = "ReversedTreeOrder";
966
- })(ft ||= {});
967
- function pt(e) {
968
- let { acceleration: t, activator: n = dt.Pointer, canScroll: r, draggingRect: i, enabled: o, interval: c = 5, order: u = ft.TreeOrder, pointerCoordinates: f, scrollableAncestors: p, scrollableAncestorRects: m, delta: h, threshold: g } = e, _ = ht({
969
- delta: h,
970
- disabled: !o
971
- }), [v, y] = E(), b = d({
972
- x: 0,
973
- y: 0
974
- }), x = d({
975
- x: 0,
976
- y: 0
977
- }), S = l(() => {
978
- switch (n) {
979
- case dt.Pointer: return f ? {
980
- top: f.y,
981
- bottom: f.y,
982
- left: f.x,
983
- right: f.x
984
- } : null;
985
- case dt.DraggableRect: return i;
986
- }
987
- }, [
988
- n,
989
- i,
990
- f
991
- ]), C = d(null), w = a(() => {
992
- let e = C.current;
993
- if (!e) return;
994
- let t = b.current.x * x.current.x, n = b.current.y * x.current.y;
995
- e.scrollBy(t, n);
996
- }, []), T = l(() => u === ft.TreeOrder ? [...p].reverse() : p, [u, p]);
997
- s(() => {
998
- if (!o || !p.length || !S) {
999
- y();
1000
- return;
1001
- }
1002
- for (let e of T) {
1003
- if (r?.(e) === !1) continue;
1004
- let n = m[p.indexOf(e)];
1005
- if (!n) continue;
1006
- let { direction: i, speed: a } = ze(e, n, S, t, g);
1007
- for (let e of ["x", "y"]) _[e][i[e]] || (a[e] = 0, i[e] = 0);
1008
- if (a.x > 0 || a.y > 0) {
1009
- y(), C.current = e, v(w, c), b.current = a, x.current = i;
1010
- return;
1011
- }
1012
- }
1013
- b.current = {
1014
- x: 0,
1015
- y: 0
1016
- }, x.current = {
1017
- x: 0,
1018
- y: 0
1019
- }, y();
1020
- }, [
1021
- t,
1022
- w,
1023
- r,
1024
- y,
1025
- o,
1026
- c,
1027
- JSON.stringify(S),
1028
- JSON.stringify(_),
1029
- v,
1030
- p,
1031
- T,
1032
- m,
1033
- JSON.stringify(g)
1034
- ]);
1035
- }
1036
- var mt = {
1037
- x: {
1038
- [Z.Backward]: !1,
1039
- [Z.Forward]: !1
1040
- },
1041
- y: {
1042
- [Z.Backward]: !1,
1043
- [Z.Forward]: !1
1044
- }
1045
- };
1046
- function ht(e) {
1047
- let { delta: t, disabled: n } = e, r = k(t);
1048
- return D((e) => {
1049
- if (n || !r || !e) return mt;
1050
- let i = {
1051
- x: Math.sign(t.x - r.x),
1052
- y: Math.sign(t.y - r.y)
1053
- };
1054
- return {
1055
- x: {
1056
- [Z.Backward]: e.x[Z.Backward] || i.x === -1,
1057
- [Z.Forward]: e.x[Z.Forward] || i.x === 1
1058
- },
1059
- y: {
1060
- [Z.Backward]: e.y[Z.Backward] || i.y === -1,
1061
- [Z.Forward]: e.y[Z.Forward] || i.y === 1
1062
- }
1063
- };
1064
- }, [
1065
- n,
1066
- t,
1067
- r
1068
- ]);
1069
- }
1070
- function gt(e, t) {
1071
- let n = t == null ? void 0 : e.get(t), r = n ? n.node.current : null;
1072
- return D((e) => t == null ? null : r ?? e ?? null, [r, t]);
1073
- }
1074
- function _t(e, t) {
1075
- return l(() => e.reduce((e, n) => {
1076
- let { sensor: r } = n, i = r.activators.map((e) => ({
1077
- eventName: e.eventName,
1078
- handler: t(e.handler, n)
1079
- }));
1080
- return [...e, ...i];
1081
- }, []), [e, t]);
1082
- }
1083
- var vt;
1084
- (function(e) {
1085
- e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
1086
- })(vt ||= {});
1087
- var yt;
1088
- (function(e) {
1089
- e.Optimized = "optimized";
1090
- })(yt ||= {});
1091
- var bt = /* @__PURE__ */ new Map();
1092
- function xt(e, t) {
1093
- let { dragging: n, dependencies: r, config: i } = t, [o, c] = f(null), { frequency: l, measure: u, strategy: p } = i, m = d(e), h = b(), g = ee(h), _ = a(function(e) {
1094
- e === void 0 && (e = []), !g.current && c((t) => t === null ? e : t.concat(e.filter((e) => !t.includes(e))));
1095
- }, [g]), v = d(null), y = D((t) => {
1096
- if (h && !n) return bt;
1097
- if (!t || t === bt || m.current !== e || o != null) {
1098
- let t = /* @__PURE__ */ new Map();
1099
- for (let n of e) {
1100
- if (!n) continue;
1101
- if (o && o.length > 0 && !o.includes(n.id) && n.rect.current) {
1102
- t.set(n.id, n.rect.current);
1103
- continue;
1104
- }
1105
- let e = n.node.current, r = e ? new Ke(u(e), e) : null;
1106
- n.rect.current = r, r && t.set(n.id, r);
1107
- }
1108
- return t;
1109
- }
1110
- return t;
1111
- }, [
1112
- e,
1113
- o,
1114
- n,
1115
- h,
1116
- u
1117
- ]);
1118
- return s(() => {
1119
- m.current = e;
1120
- }, [e]), s(() => {
1121
- h || _();
1122
- }, [n, h]), s(() => {
1123
- o && o.length > 0 && c(null);
1124
- }, [JSON.stringify(o)]), s(() => {
1125
- h || typeof l != "number" || v.current !== null || (v.current = setTimeout(() => {
1126
- _(), v.current = null;
1127
- }, l));
1128
- }, [
1129
- l,
1130
- h,
1131
- _,
1132
- ...r
1133
- ]), {
1134
- droppableRects: y,
1135
- measureDroppableContainers: _,
1136
- measuringScheduled: o != null
1137
- };
1138
- function b() {
1139
- switch (p) {
1140
- case vt.Always: return !1;
1141
- case vt.BeforeDragging: return n;
1142
- default: return !n;
1143
- }
1144
- }
1145
- }
1146
- function St(e, t) {
1147
- return D((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
1148
- }
1149
- function Ct(e, t) {
1150
- return St(e, t);
1151
- }
1152
- function wt(e) {
1153
- let { callback: t, disabled: n } = e, r = T(t), i = l(() => {
1154
- if (n || typeof window > "u" || window.MutationObserver === void 0) return;
1155
- let { MutationObserver: e } = window;
1156
- return new e(r);
1157
- }, [r, n]);
1158
- return s(() => () => i?.disconnect(), [i]), i;
1159
- }
1160
- function Tt(e) {
1161
- let { callback: t, disabled: n } = e, r = T(t), i = l(() => {
1162
- if (n || typeof window > "u" || window.ResizeObserver === void 0) return;
1163
- let { ResizeObserver: e } = window;
1164
- return new e(r);
1165
- }, [n]);
1166
- return s(() => () => i?.disconnect(), [i]), i;
1167
- }
1168
- function Et(e) {
1169
- return new Ke(De(e), e);
1170
- }
1171
- function Dt(e, t, n) {
1172
- t === void 0 && (t = Et);
1173
- let [r, i] = f(null);
1174
- function a() {
1175
- i((r) => {
1176
- if (!e) return null;
1177
- if (e.isConnected === !1) return r ?? n ?? null;
1178
- let i = t(e);
1179
- return JSON.stringify(r) === JSON.stringify(i) ? r : i;
1180
- });
1181
- }
1182
- let o = wt({ callback(t) {
1183
- if (e) for (let n of t) {
1184
- let { type: t, target: r } = n;
1185
- if (t === "childList" && r instanceof HTMLElement && r.contains(e)) {
1186
- a();
1187
- break;
1188
- }
1189
- }
1190
- } }), s = Tt({ callback: a });
1191
- return w(() => {
1192
- a(), e ? (s?.observe(e), o?.observe(document.body, {
1193
- childList: !0,
1194
- subtree: !0
1195
- })) : (s?.disconnect(), o?.disconnect());
1196
- }, [e]), r;
1197
- }
1198
- function Ot(e) {
1199
- return Se(e, St(e));
1200
- }
1201
- var kt = [];
1202
- function At(e) {
1203
- let t = d(e), n = D((n) => e ? n && n !== kt && e && t.current && e.parentNode === t.current.parentNode ? n : Y(e) : kt, [e]);
1204
- return s(() => {
1205
- t.current = e;
1206
- }, [e]), n;
1207
- }
1208
- function jt(e) {
1209
- let [t, n] = f(null), r = d(e), i = a((e) => {
1210
- let t = X(e.target);
1211
- t && n((e) => e ? (e.set(t, Fe(t)), new Map(e)) : null);
1212
- }, []);
1213
- return s(() => {
1214
- let t = r.current;
1215
- if (e !== t) {
1216
- a(t);
1217
- let o = e.map((e) => {
1218
- let t = X(e);
1219
- return t ? (t.addEventListener("scroll", i, { passive: !0 }), [t, Fe(t)]) : null;
1220
- }).filter((e) => e != null);
1221
- n(o.length ? new Map(o) : null), r.current = e;
1222
- }
1223
- return () => {
1224
- a(e), a(t);
1225
- };
1226
- function a(e) {
1227
- e.forEach((e) => {
1228
- X(e)?.removeEventListener("scroll", i);
1229
- });
1230
- }
1231
- }, [i, e]), l(() => e.length ? t ? Array.from(t.values()).reduce((e, t) => ne(e, t), W) : Ve(e) : W, [e, t]);
1232
- }
1233
- function Mt(e, t) {
1234
- t === void 0 && (t = []);
1235
- let n = d(null);
1236
- return s(() => {
1237
- n.current = null;
1238
- }, t), s(() => {
1239
- let t = e !== W;
1240
- t && !n.current && (n.current = e), !t && n.current && (n.current = null);
1241
- }, [e]), n.current ? M(e, n.current) : W;
1242
- }
1243
- function Nt(e) {
1244
- s(() => {
1245
- if (!g) return;
1246
- let t = e.map((e) => {
1247
- let { sensor: t } = e;
1248
- return t.setup == null ? void 0 : t.setup();
1249
- });
1250
- return () => {
1251
- for (let e of t) e?.();
1252
- };
1253
- }, e.map((e) => {
1254
- let { sensor: t } = e;
1255
- return t;
1256
- }));
1257
- }
1258
- function Pt(e, t) {
1259
- return l(() => e.reduce((e, n) => {
1260
- let { eventName: r, handler: i } = n;
1261
- return e[r] = (e) => {
1262
- i(e, t);
1263
- }, e;
1264
- }, {}), [e, t]);
1265
- }
1266
- function Ft(e) {
1267
- return l(() => e ? ke(e) : null, [e]);
1268
- }
1269
- var It = [];
1270
- function Lt(e, t) {
1271
- t === void 0 && (t = De);
1272
- let [n] = e, r = Ft(n ? y(n) : null), [i, a] = f(It);
1273
- function o() {
1274
- a(() => e.length ? e.map((e) => Ie(e) ? r : new Ke(t(e), e)) : It);
1275
- }
1276
- let s = Tt({ callback: o });
1277
- return w(() => {
1278
- s?.disconnect(), o(), e.forEach((e) => s?.observe(e));
1279
- }, [e]), i;
1280
- }
1281
- function Rt(e) {
1282
- if (!e) return null;
1283
- if (e.children.length > 1) return e;
1284
- let t = e.children[0];
1285
- return x(t) ? t : e;
1286
- }
1287
- function zt(e) {
1288
- let { measure: t } = e, [n, r] = f(null), i = Tt({ callback: a((e) => {
1289
- for (let { target: n } of e) if (x(n)) {
1290
- r((e) => {
1291
- let r = t(n);
1292
- return e ? {
1293
- ...e,
1294
- width: r.width,
1295
- height: r.height
1296
- } : r;
1297
- });
1298
- break;
1299
- }
1300
- }, [t]) }), [o, s] = O(a((e) => {
1301
- let n = Rt(e);
1302
- i?.disconnect(), n && i?.observe(n), r(n ? t(n) : null);
1303
- }, [t, i]));
1304
- return l(() => ({
1305
- nodeRef: o,
1306
- rect: n,
1307
- setRef: s
1308
- }), [
1309
- n,
1310
- o,
1311
- s
1312
- ]);
1313
- }
1314
- var Bt = [{
1315
- sensor: at,
1316
- options: {}
1317
- }, {
1318
- sensor: et,
1319
- options: {}
1320
- }], Vt = { current: {} }, Ht = {
1321
- draggable: { measure: Oe },
1322
- droppable: {
1323
- measure: Oe,
1324
- strategy: vt.WhileDragging,
1325
- frequency: yt.Optimized
1326
- },
1327
- dragOverlay: { measure: De }
1328
- }, Ut = class extends Map {
1329
- get(e) {
1330
- return e == null ? void 0 : super.get(e) ?? void 0;
1331
- }
1332
- toArray() {
1333
- return Array.from(this.values());
1334
- }
1335
- getEnabled() {
1336
- return this.toArray().filter((e) => {
1337
- let { disabled: t } = e;
1338
- return !t;
1339
- });
1340
- }
1341
- getNodeFor(e) {
1342
- return this.get(e)?.node.current ?? void 0;
1343
- }
1344
- }, Wt = {
1345
- activatorEvent: null,
1346
- active: null,
1347
- activeNode: null,
1348
- activeNodeRect: null,
1349
- collisions: null,
1350
- containerNodeRect: null,
1351
- draggableNodes: /* @__PURE__ */ new Map(),
1352
- droppableRects: /* @__PURE__ */ new Map(),
1353
- droppableContainers: /* @__PURE__ */ new Ut(),
1354
- over: null,
1355
- dragOverlay: {
1356
- nodeRef: { current: null },
1357
- rect: null,
1358
- setRef: U
1359
- },
1360
- scrollableAncestors: [],
1361
- scrollableAncestorRects: [],
1362
- measuringConfiguration: Ht,
1363
- measureDroppableContainers: U,
1364
- windowRect: null,
1365
- measuringScheduled: !1
1366
- }, Gt = {
1367
- activatorEvent: null,
1368
- activators: [],
1369
- active: null,
1370
- activeNodeRect: null,
1371
- ariaDescribedById: { draggable: "" },
1372
- dispatch: U,
1373
- draggableNodes: /* @__PURE__ */ new Map(),
1374
- over: null,
1375
- measureDroppableContainers: U
1376
- }, Kt = /* @__PURE__ */ n(Gt), qt = /* @__PURE__ */ n(Wt);
1377
- function Jt() {
1378
- return {
1379
- draggable: {
1380
- active: null,
1381
- initialCoordinates: {
1382
- x: 0,
1383
- y: 0
1384
- },
1385
- nodes: /* @__PURE__ */ new Map(),
1386
- translate: {
1387
- x: 0,
1388
- y: 0
1389
- }
1390
- },
1391
- droppable: { containers: new Ut() }
1392
- };
1393
- }
1394
- function Yt(e, t) {
1395
- switch (t.type) {
1396
- case H.DragStart: return {
1397
- ...e,
1398
- draggable: {
1399
- ...e.draggable,
1400
- initialCoordinates: t.initialCoordinates,
1401
- active: t.active
1402
- }
1403
- };
1404
- case H.DragMove: return e.draggable.active == null ? e : {
1405
- ...e,
1406
- draggable: {
1407
- ...e.draggable,
1408
- translate: {
1409
- x: t.coordinates.x - e.draggable.initialCoordinates.x,
1410
- y: t.coordinates.y - e.draggable.initialCoordinates.y
1411
- }
1412
- }
1413
- };
1414
- case H.DragEnd:
1415
- case H.DragCancel: return {
1416
- ...e,
1417
- draggable: {
1418
- ...e.draggable,
1419
- active: null,
1420
- initialCoordinates: {
1421
- x: 0,
1422
- y: 0
1423
- },
1424
- translate: {
1425
- x: 0,
1426
- y: 0
1427
- }
1428
- }
1429
- };
1430
- case H.RegisterDroppable: {
1431
- let { element: n } = t, { id: r } = n, i = new Ut(e.droppable.containers);
1432
- return i.set(r, n), {
1433
- ...e,
1434
- droppable: {
1435
- ...e.droppable,
1436
- containers: i
1437
- }
1438
- };
1439
- }
1440
- case H.SetDroppableDisabled: {
1441
- let { id: n, key: r, disabled: i } = t, a = e.droppable.containers.get(n);
1442
- if (!a || r !== a.key) return e;
1443
- let o = new Ut(e.droppable.containers);
1444
- return o.set(n, {
1445
- ...a,
1446
- disabled: i
1447
- }), {
1448
- ...e,
1449
- droppable: {
1450
- ...e.droppable,
1451
- containers: o
1452
- }
1453
- };
1454
- }
1455
- case H.UnregisterDroppable: {
1456
- let { id: n, key: r } = t, i = e.droppable.containers.get(n);
1457
- if (!i || r !== i.key) return e;
1458
- let a = new Ut(e.droppable.containers);
1459
- return a.delete(n), {
1460
- ...e,
1461
- droppable: {
1462
- ...e.droppable,
1463
- containers: a
1464
- }
1465
- };
1466
- }
1467
- default: return e;
1468
- }
1469
- }
1470
- function Xt(e) {
1471
- let { disabled: t } = e, { active: n, activatorEvent: r, draggableNodes: i } = o(Kt), a = k(r), c = k(n?.id);
1472
- return s(() => {
1473
- if (!t && !r && a && c != null) {
1474
- if (!P(a) || document.activeElement === a.target) return;
1475
- let e = i.get(c);
1476
- if (!e) return;
1477
- let { activatorNode: t, node: n } = e;
1478
- if (!t.current && !n.current) return;
1479
- requestAnimationFrame(() => {
1480
- for (let e of [t.current, n.current]) {
1481
- if (!e) continue;
1482
- let t = ae(e);
1483
- if (t) {
1484
- t.focus();
1485
- break;
1486
- }
1487
- }
1488
- });
1489
- }
1490
- }, [
1491
- r,
1492
- t,
1493
- i,
1494
- c,
1495
- a
1496
- ]), null;
1497
- }
1498
- function Zt(e, t) {
1499
- let { transform: n, ...r } = t;
1500
- return e != null && e.length ? e.reduce((e, t) => t({
1501
- transform: e,
1502
- ...r
1503
- }), n) : n;
1504
- }
1505
- function Qt(e) {
1506
- return l(() => ({
1507
- draggable: {
1508
- ...Ht.draggable,
1509
- ...e?.draggable
1510
- },
1511
- droppable: {
1512
- ...Ht.droppable,
1513
- ...e?.droppable
1514
- },
1515
- dragOverlay: {
1516
- ...Ht.dragOverlay,
1517
- ...e?.dragOverlay
1518
- }
1519
- }), [
1520
- e?.draggable,
1521
- e?.droppable,
1522
- e?.dragOverlay
1523
- ]);
1524
- }
1525
- function $t(e) {
1526
- let { activeNode: t, measure: n, initialRect: r, config: i = !0 } = e, a = d(!1), { x: o, y: s } = typeof i == "boolean" ? {
1527
- x: i,
1528
- y: i
1529
- } : i;
1530
- w(() => {
1531
- if (!o && !s || !t) {
1532
- a.current = !1;
1533
- return;
1534
- }
1535
- if (a.current || !r) return;
1536
- let e = t?.node.current;
1537
- if (!e || e.isConnected === !1) return;
1538
- let i = Se(n(e), r);
1539
- if (o || (i.x = 0), s || (i.y = 0), a.current = !0, Math.abs(i.x) > 0 || Math.abs(i.y) > 0) {
1540
- let t = Me(e);
1541
- t && t.scrollBy({
1542
- top: i.y,
1543
- left: i.x
1544
- });
1545
- }
1546
- }, [
1547
- t,
1548
- o,
1549
- s,
1550
- r,
1551
- n
1552
- ]);
1553
- }
1554
- var en = /* @__PURE__ */ n({
1555
- ...W,
1556
- scaleX: 1,
1557
- scaleY: 1
1558
- }), tn;
1559
- (function(e) {
1560
- e[e.Uninitialized = 0] = "Uninitialized", e[e.Initializing = 1] = "Initializing", e[e.Initialized = 2] = "Initialized";
1561
- })(tn ||= {});
1562
- var nn = /* @__PURE__ */ i(function(t) {
1563
- let { id: n, accessibility: r, autoScroll: i = !0, children: o, sensors: c = Bt, collisionDetection: p = be, measuring: h, modifiers: g, ..._ } = t, [v, b] = u(Yt, void 0, Jt), [x, S] = le(), [C, T] = f(tn.Uninitialized), E = C === tn.Initialized, { draggable: { active: D, nodes: O, translate: k }, droppable: { containers: A } } = v, te = D == null ? null : O.get(D), M = d({
1564
- initial: null,
1565
- translated: null
1566
- }), N = l(() => D == null ? null : {
1567
- id: D,
1568
- data: te?.data ?? Vt,
1569
- rect: M
1570
- }, [D, te]), P = d(null), [re, F] = f(null), [I, ae] = f(null), L = ee(_, Object.values(_)), oe = j("DndDescribedBy", n), R = l(() => A.getEnabled(), [A]), z = Qt(h), { droppableRects: ce, measureDroppableContainers: B, measuringScheduled: V } = xt(R, {
1571
- dragging: E,
1572
- dependencies: [k.x, k.y],
1573
- config: z.droppable
1574
- }), U = gt(O, D), de = l(() => I ? ie(I) : null, [I]), fe = ze(), W = Ct(U, z.draggable.measure);
1575
- $t({
1576
- activeNode: D == null ? null : O.get(D),
1577
- config: fe.layoutShiftCompensation,
1578
- initialRect: W,
1579
- measure: z.draggable.measure
1580
- });
1581
- let G = Dt(U, z.draggable.measure, W), pe = Dt(U ? U.parentElement : null), K = d({
1582
- activatorEvent: null,
1583
- active: null,
1584
- activeNode: U,
1585
- collisionRect: null,
1586
- collisions: null,
1587
- droppableRects: ce,
1588
- draggableNodes: O,
1589
- draggingNode: null,
1590
- draggingNodeRect: null,
1591
- droppableContainers: A,
1592
- over: null,
1593
- scrollableAncestors: [],
1594
- scrollAdjustedTranslate: null
1595
- }), me = A.getNodeFor(K.current.over?.id), q = zt({ measure: z.dragOverlay.measure }), ge = q.nodeRef.current ?? U, _e = E ? q.rect ?? G : null, ve = !!(q.nodeRef.current && q.rect), ye = Ot(ve ? null : G), Se = Ft(ge ? y(ge) : null), J = At(E ? me ?? U : null), we = Lt(J), Te = Zt(g, {
1596
- transform: {
1597
- x: k.x - ye.x,
1598
- y: k.y - ye.y,
1599
- scaleX: 1,
1600
- scaleY: 1
1601
- },
1602
- activatorEvent: I,
1603
- active: N,
1604
- activeNodeRect: G,
1605
- containerNodeRect: pe,
1606
- draggingNodeRect: _e,
1607
- over: K.current.over,
1608
- overlayNodeRect: q.rect,
1609
- scrollableAncestors: J,
1610
- scrollableAncestorRects: we,
1611
- windowRect: Se
1612
- }), Ee = de ? ne(de, k) : null, De = jt(J), Oe = Mt(De), ke = Mt(De, [G]), Ae = ne(Te, Oe), je = _e ? Ce(_e, Te) : null, Y = N && je ? p({
1613
- active: N,
1614
- collisionRect: je,
1615
- droppableRects: ce,
1616
- droppableContainers: R,
1617
- pointerCoordinates: Ee
1618
- }) : null, Me = he(Y, "id"), [X, Ne] = f(null), Pe = xe(ve ? Te : ne(Te, ke), X?.rect ?? null, G), Fe = d(null), Z = a((e, t) => {
1619
- let { sensor: n, options: r } = t;
1620
- if (P.current == null) return;
1621
- let i = O.get(P.current);
1622
- if (!i) return;
1623
- let a = e.nativeEvent;
1624
- Fe.current = new n({
1625
- active: P.current,
1626
- activeNode: i,
1627
- event: a,
1628
- options: r,
1629
- context: K,
1630
- onAbort(e) {
1631
- if (!O.get(e)) return;
1632
- let { onDragAbort: t } = L.current, n = { id: e };
1633
- t?.(n), x({
1634
- type: "onDragAbort",
1635
- event: n
1636
- });
1637
- },
1638
- onPending(e, t, n, r) {
1639
- if (!O.get(e)) return;
1640
- let { onDragPending: i } = L.current, a = {
1641
- id: e,
1642
- constraint: t,
1643
- initialCoordinates: n,
1644
- offset: r
1645
- };
1646
- i?.(a), x({
1647
- type: "onDragPending",
1648
- event: a
1649
- });
1650
- },
1651
- onStart(e) {
1652
- let t = P.current;
1653
- if (t == null) return;
1654
- let n = O.get(t);
1655
- if (!n) return;
1656
- let { onDragStart: r } = L.current, i = {
1657
- activatorEvent: a,
1658
- active: {
1659
- id: t,
1660
- data: n.data,
1661
- rect: M
1662
- }
1663
- };
1664
- m(() => {
1665
- r?.(i), T(tn.Initializing), b({
1666
- type: H.DragStart,
1667
- initialCoordinates: e,
1668
- active: t
1669
- }), x({
1670
- type: "onDragStart",
1671
- event: i
1672
- }), F(Fe.current), ae(a);
1673
- });
1674
- },
1675
- onMove(e) {
1676
- b({
1677
- type: H.DragMove,
1678
- coordinates: e
1679
- });
1680
- },
1681
- onEnd: o(H.DragEnd),
1682
- onCancel: o(H.DragCancel)
1683
- });
1684
- function o(e) {
1685
- return async function() {
1686
- let { active: t, collisions: n, over: r, scrollAdjustedTranslate: i } = K.current, o = null;
1687
- if (t && i) {
1688
- let { cancelDrop: s } = L.current;
1689
- o = {
1690
- activatorEvent: a,
1691
- active: t,
1692
- collisions: n,
1693
- delta: i,
1694
- over: r
1695
- }, e === H.DragEnd && typeof s == "function" && await Promise.resolve(s(o)) && (e = H.DragCancel);
1696
- }
1697
- P.current = null, m(() => {
1698
- b({ type: e }), T(tn.Uninitialized), Ne(null), F(null), ae(null), Fe.current = null;
1699
- let t = e === H.DragEnd ? "onDragEnd" : "onDragCancel";
1700
- if (o) {
1701
- let e = L.current[t];
1702
- e?.(o), x({
1703
- type: t,
1704
- event: o
1705
- });
1706
- }
1707
- });
1708
- };
1709
- }
1710
- }, [O]), Ie = _t(c, a((e, t) => (n, r) => {
1711
- let i = n.nativeEvent, a = O.get(r);
1712
- if (P.current !== null || !a || i.dndKit || i.defaultPrevented) return;
1713
- let o = { active: a };
1714
- e(n, t.options, o) === !0 && (i.dndKit = { capturedBy: t.sensor }, P.current = r, Z(n, t));
1715
- }, [O, Z]));
1716
- Nt(c), w(() => {
1717
- G && C === tn.Initializing && T(tn.Initialized);
1718
- }, [G, C]), s(() => {
1719
- let { onDragMove: e } = L.current, { active: t, activatorEvent: n, collisions: r, over: i } = K.current;
1720
- if (!t || !n) return;
1721
- let a = {
1722
- active: t,
1723
- activatorEvent: n,
1724
- collisions: r,
1725
- delta: {
1726
- x: Ae.x,
1727
- y: Ae.y
1728
- },
1729
- over: i
1730
- };
1731
- m(() => {
1732
- e?.(a), x({
1733
- type: "onDragMove",
1734
- event: a
1735
- });
1736
- });
1737
- }, [Ae.x, Ae.y]), s(() => {
1738
- let { active: e, activatorEvent: t, collisions: n, droppableContainers: r, scrollAdjustedTranslate: i } = K.current;
1739
- if (!e || P.current == null || !t || !i) return;
1740
- let { onDragOver: a } = L.current, o = r.get(Me), s = o && o.rect.current ? {
1741
- id: o.id,
1742
- rect: o.rect.current,
1743
- data: o.data,
1744
- disabled: o.disabled
1745
- } : null, c = {
1746
- active: e,
1747
- activatorEvent: t,
1748
- collisions: n,
1749
- delta: {
1750
- x: i.x,
1751
- y: i.y
1752
- },
1753
- over: s
1754
- };
1755
- m(() => {
1756
- Ne(s), a?.(c), x({
1757
- type: "onDragOver",
1758
- event: c
1759
- });
1760
- });
1761
- }, [Me]), w(() => {
1762
- K.current = {
1763
- activatorEvent: I,
1764
- active: N,
1765
- activeNode: U,
1766
- collisionRect: je,
1767
- collisions: Y,
1768
- droppableRects: ce,
1769
- draggableNodes: O,
1770
- draggingNode: ge,
1771
- draggingNodeRect: _e,
1772
- droppableContainers: A,
1773
- over: X,
1774
- scrollableAncestors: J,
1775
- scrollAdjustedTranslate: Ae
1776
- }, M.current = {
1777
- initial: _e,
1778
- translated: je
1779
- };
1780
- }, [
1781
- N,
1782
- U,
1783
- Y,
1784
- je,
1785
- O,
1786
- ge,
1787
- _e,
1788
- ce,
1789
- A,
1790
- X,
1791
- J,
1792
- Ae
1793
- ]), pt({
1794
- ...fe,
1795
- delta: k,
1796
- draggingRect: je,
1797
- pointerCoordinates: Ee,
1798
- scrollableAncestors: J,
1799
- scrollableAncestorRects: we
1800
- });
1801
- let Le = l(() => ({
1802
- active: N,
1803
- activeNode: U,
1804
- activeNodeRect: G,
1805
- activatorEvent: I,
1806
- collisions: Y,
1807
- containerNodeRect: pe,
1808
- dragOverlay: q,
1809
- draggableNodes: O,
1810
- droppableContainers: A,
1811
- droppableRects: ce,
1812
- over: X,
1813
- measureDroppableContainers: B,
1814
- scrollableAncestors: J,
1815
- scrollableAncestorRects: we,
1816
- measuringConfiguration: z,
1817
- measuringScheduled: V,
1818
- windowRect: Se
1819
- }), [
1820
- N,
1821
- U,
1822
- G,
1823
- I,
1824
- Y,
1825
- pe,
1826
- q,
1827
- O,
1828
- A,
1829
- ce,
1830
- X,
1831
- B,
1832
- J,
1833
- we,
1834
- z,
1835
- V,
1836
- Se
1837
- ]), Re = l(() => ({
1838
- activatorEvent: I,
1839
- activators: Ie,
1840
- active: N,
1841
- activeNodeRect: G,
1842
- ariaDescribedById: { draggable: oe },
1843
- dispatch: b,
1844
- draggableNodes: O,
1845
- over: X,
1846
- measureDroppableContainers: B
1847
- }), [
1848
- I,
1849
- Ie,
1850
- N,
1851
- G,
1852
- b,
1853
- oe,
1854
- O,
1855
- X,
1856
- B
1857
- ]);
1858
- return e.createElement(se.Provider, { value: S }, e.createElement(Kt.Provider, { value: Re }, e.createElement(qt.Provider, { value: Le }, e.createElement(en.Provider, { value: Pe }, o)), e.createElement(Xt, { disabled: r?.restoreFocus === !1 })), e.createElement(ue, {
1859
- ...r,
1860
- hiddenTextDescribedById: oe
1861
- }));
1862
- function ze() {
1863
- let e = re?.autoScrollEnabled === !1, t = typeof i == "object" ? i.enabled === !1 : i === !1, n = E && !e && !t;
1864
- return typeof i == "object" ? {
1865
- ...i,
1866
- enabled: n
1867
- } : { enabled: n };
1868
- }
1869
- }), rn = /* @__PURE__ */ n(null), an = "button", on = "Draggable";
1870
- function sn(e) {
1871
- let { id: t, data: n, disabled: r = !1, attributes: i } = e, a = j(on), { activators: s, activatorEvent: c, active: u, activeNodeRect: d, ariaDescribedById: f, draggableNodes: p, over: m } = o(Kt), { role: h = an, roleDescription: g = "draggable", tabIndex: _ = 0 } = i ?? {}, v = u?.id === t, y = o(v ? en : rn), [b, x] = O(), [S, C] = O(), T = Pt(s, t), E = ee(n);
1872
- return w(() => (p.set(t, {
1873
- id: t,
1874
- key: a,
1875
- node: b,
1876
- activatorNode: S,
1877
- data: E
1878
- }), () => {
1879
- let e = p.get(t);
1880
- e && e.key === a && p.delete(t);
1881
- }), [p, t]), {
1882
- active: u,
1883
- activatorEvent: c,
1884
- activeNodeRect: d,
1885
- attributes: l(() => ({
1886
- role: h,
1887
- tabIndex: _,
1888
- "aria-disabled": r,
1889
- "aria-pressed": v && h === an ? !0 : void 0,
1890
- "aria-roledescription": g,
1891
- "aria-describedby": f.draggable
1892
- }), [
1893
- r,
1894
- h,
1895
- _,
1896
- v,
1897
- g,
1898
- f.draggable
1899
- ]),
1900
- isDragging: v,
1901
- listeners: r ? void 0 : T,
1902
- node: b,
1903
- over: m,
1904
- setNodeRef: x,
1905
- setActivatorNodeRef: C,
1906
- transform: y
1907
- };
1908
- }
1909
- function cn() {
1910
- return o(qt);
1911
- }
1912
- var ln = "Droppable", un = { timeout: 25 };
1913
- function dn(e) {
1914
- let { data: t, disabled: n = !1, id: r, resizeObserverConfig: i } = e, c = j(ln), { active: l, dispatch: u, over: f, measureDroppableContainers: p } = o(Kt), m = d({ disabled: n }), h = d(!1), g = d(null), _ = d(null), { disabled: v, updateMeasurementsFor: y, timeout: b } = {
1915
- ...un,
1916
- ...i
1917
- }, x = ee(y ?? r), S = Tt({
1918
- callback: a(() => {
1919
- if (!h.current) {
1920
- h.current = !0;
1921
- return;
1922
- }
1923
- _.current != null && clearTimeout(_.current), _.current = setTimeout(() => {
1924
- p(Array.isArray(x.current) ? x.current : [x.current]), _.current = null;
1925
- }, b);
1926
- }, [b]),
1927
- disabled: v || !l
1928
- }), [C, w] = O(a((e, t) => {
1929
- S && (t && (S.unobserve(t), h.current = !1), e && S.observe(e));
1930
- }, [S])), T = ee(t);
1931
- return s(() => {
1932
- !S || !C.current || (S.disconnect(), h.current = !1, S.observe(C.current));
1933
- }, [C, S]), s(() => (u({
1934
- type: H.RegisterDroppable,
1935
- element: {
1936
- id: r,
1937
- key: c,
1938
- disabled: n,
1939
- node: C,
1940
- rect: g,
1941
- data: T
1942
- }
1943
- }), () => u({
1944
- type: H.UnregisterDroppable,
1945
- key: c,
1946
- id: r
1947
- })), [r]), s(() => {
1948
- n !== m.current.disabled && (u({
1949
- type: H.SetDroppableDisabled,
1950
- id: r,
1951
- key: c,
1952
- disabled: n
1953
- }), m.current.disabled = n);
1954
- }, [
1955
- r,
1956
- c,
1957
- n,
1958
- u
1959
- ]), {
1960
- active: l,
1961
- rect: g,
1962
- isOver: f?.id === r,
1963
- node: C,
1964
- over: f,
1965
- setNodeRef: w
1966
- };
1967
- }
1968
- function fn(n) {
1969
- let { animation: r, children: i } = n, [a, o] = f(null), [s, c] = f(null), l = k(i);
1970
- return !i && !a && l && o(l), w(() => {
1971
- if (!s) return;
1972
- let e = a?.key, t = a?.props.id;
1973
- if (e == null || t == null) {
1974
- o(null);
1975
- return;
1976
- }
1977
- Promise.resolve(r(t, s)).then(() => {
1978
- o(null);
1979
- });
1980
- }, [
1981
- r,
1982
- a,
1983
- s
1984
- ]), e.createElement(e.Fragment, null, i, a ? t(a, { ref: c }) : null);
1985
- }
1986
- var pn = {
1987
- x: 0,
1988
- y: 0,
1989
- scaleX: 1,
1990
- scaleY: 1
1991
- };
1992
- function mn(t) {
1993
- let { children: n } = t;
1994
- return e.createElement(Kt.Provider, { value: Gt }, e.createElement(en.Provider, { value: pn }, n));
1995
- }
1996
- var hn = {
1997
- position: "fixed",
1998
- touchAction: "none"
1999
- }, gn = (e) => P(e) ? "transform 250ms ease" : void 0, _n = /* @__PURE__ */ r((t, n) => {
2000
- let { as: r, activatorEvent: i, adjustScale: a, children: o, className: s, rect: c, style: l, transform: u, transition: d = gn } = t;
2001
- if (!c) return null;
2002
- let f = a ? u : {
2003
- ...u,
2004
- scaleX: 1,
2005
- scaleY: 1
2006
- }, p = {
2007
- ...hn,
2008
- width: c.width,
2009
- height: c.height,
2010
- top: c.top,
2011
- left: c.left,
2012
- transform: F.Transform.toString(f),
2013
- transformOrigin: a && i ? pe(i, c) : void 0,
2014
- transition: typeof d == "function" ? d(i) : d,
2015
- ...l
2016
- };
2017
- return e.createElement(r, {
2018
- className: s,
2019
- style: p,
2020
- ref: n
2021
- }, o);
2022
- }), vn = (e) => (t) => {
2023
- let { active: n, dragOverlay: r } = t, i = {}, { styles: a, className: o } = e;
2024
- if (a != null && a.active) for (let [e, t] of Object.entries(a.active)) t !== void 0 && (i[e] = n.node.style.getPropertyValue(e), n.node.style.setProperty(e, t));
2025
- if (a != null && a.dragOverlay) for (let [e, t] of Object.entries(a.dragOverlay)) t !== void 0 && r.node.style.setProperty(e, t);
2026
- return o != null && o.active && n.node.classList.add(o.active), o != null && o.dragOverlay && r.node.classList.add(o.dragOverlay), function() {
2027
- for (let [e, t] of Object.entries(i)) n.node.style.setProperty(e, t);
2028
- o != null && o.active && n.node.classList.remove(o.active);
2029
- };
2030
- }, yn = {
2031
- duration: 250,
2032
- easing: "ease",
2033
- keyframes: (e) => {
2034
- let { transform: { initial: t, final: n } } = e;
2035
- return [{ transform: F.Transform.toString(t) }, { transform: F.Transform.toString(n) }];
2036
- },
2037
- sideEffects: /* @__PURE__ */ vn({ styles: { active: { opacity: "0" } } })
2038
- };
2039
- function bn(e) {
2040
- let { config: t, draggableNodes: n, droppableContainers: r, measuringConfiguration: i } = e;
2041
- return T((e, a) => {
2042
- if (t === null) return;
2043
- let o = n.get(e);
2044
- if (!o) return;
2045
- let s = o.node.current;
2046
- if (!s) return;
2047
- let c = Rt(a);
2048
- if (!c) return;
2049
- let { transform: l } = y(a).getComputedStyle(a), u = we(l);
2050
- if (!u) return;
2051
- let d = typeof t == "function" ? t : xn(t);
2052
- return We(s, i.draggable.measure), d({
2053
- active: {
2054
- id: e,
2055
- data: o.data,
2056
- node: s,
2057
- rect: i.draggable.measure(s)
2058
- },
2059
- draggableNodes: n,
2060
- dragOverlay: {
2061
- node: a,
2062
- rect: i.dragOverlay.measure(c)
2063
- },
2064
- droppableContainers: r,
2065
- measuringConfiguration: i,
2066
- transform: u
2067
- });
2068
- });
2069
- }
2070
- function xn(e) {
2071
- let { duration: t, easing: n, sideEffects: r, keyframes: i } = {
2072
- ...yn,
2073
- ...e
2074
- };
2075
- return (e) => {
2076
- let { active: a, dragOverlay: o, transform: s, ...c } = e;
2077
- if (!t) return;
2078
- let l = {
2079
- x: o.rect.left - a.rect.left,
2080
- y: o.rect.top - a.rect.top
2081
- }, u = {
2082
- scaleX: s.scaleX === 1 ? 1 : a.rect.width * s.scaleX / o.rect.width,
2083
- scaleY: s.scaleY === 1 ? 1 : a.rect.height * s.scaleY / o.rect.height
2084
- }, d = {
2085
- x: s.x - l.x,
2086
- y: s.y - l.y,
2087
- ...u
2088
- }, f = i({
2089
- ...c,
2090
- active: a,
2091
- dragOverlay: o,
2092
- transform: {
2093
- initial: s,
2094
- final: d
2095
- }
2096
- }), [p] = f, m = f[f.length - 1];
2097
- if (JSON.stringify(p) === JSON.stringify(m)) return;
2098
- let h = r?.({
2099
- active: a,
2100
- dragOverlay: o,
2101
- ...c
2102
- }), g = o.node.animate(f, {
2103
- duration: t,
2104
- easing: n,
2105
- fill: "forwards"
2106
- });
2107
- return new Promise((e) => {
2108
- g.onfinish = () => {
2109
- h?.(), e();
2110
- };
2111
- });
2112
- };
2113
- }
2114
- var Sn = 0;
2115
- function Cn(e) {
2116
- return l(() => {
2117
- if (e != null) return Sn++, Sn;
2118
- }, [e]);
2119
- }
2120
- var wn = /* @__PURE__ */ e.memo((t) => {
2121
- let { adjustScale: n = !1, children: r, dropAnimation: i, style: a, transition: s, modifiers: c, wrapperElement: l = "div", className: u, zIndex: d = 999 } = t, { activatorEvent: f, active: p, activeNodeRect: m, containerNodeRect: h, draggableNodes: g, droppableContainers: _, dragOverlay: v, over: y, measuringConfiguration: b, scrollableAncestors: x, scrollableAncestorRects: S, windowRect: C } = cn(), w = o(en), T = Cn(p?.id), E = Zt(c, {
2122
- activatorEvent: f,
2123
- active: p,
2124
- activeNodeRect: m,
2125
- containerNodeRect: h,
2126
- draggingNodeRect: v.rect,
2127
- over: y,
2128
- overlayNodeRect: v.rect,
2129
- scrollableAncestors: x,
2130
- scrollableAncestorRects: S,
2131
- transform: w,
2132
- windowRect: C
2133
- }), ee = St(m), D = bn({
2134
- config: i,
2135
- draggableNodes: g,
2136
- droppableContainers: _,
2137
- measuringConfiguration: b
2138
- }), O = ee ? v.setRef : void 0;
2139
- return e.createElement(mn, null, e.createElement(fn, { animation: D }, p && T ? e.createElement(_n, {
2140
- key: T,
2141
- id: p.id,
2142
- ref: O,
2143
- as: l,
2144
- activatorEvent: f,
2145
- adjustScale: n,
2146
- className: u,
2147
- transition: s,
2148
- rect: ee,
2149
- style: {
2150
- zIndex: d,
2151
- ...a
2152
- },
2153
- transform: E
2154
- }, r) : null));
2155
- });
2156
- //#endregion
2157
- //#region node_modules/@dnd-kit/sortable/dist/sortable.esm.js
2158
- function Tn(e, t, n) {
2159
- let r = e.slice();
2160
- return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
2161
- }
2162
- function En(e, t) {
2163
- return e.reduce((e, n, r) => {
2164
- let i = t.get(n);
2165
- return i && (e[r] = i), e;
2166
- }, Array(e.length));
2167
- }
2168
- function Dn(e) {
2169
- return e !== null && e >= 0;
2170
- }
2171
- function On(e, t) {
2172
- if (e === t) return !0;
2173
- if (e.length !== t.length) return !1;
2174
- for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
2175
- return !0;
2176
- }
2177
- function kn(e) {
2178
- return typeof e == "boolean" ? {
2179
- draggable: e,
2180
- droppable: e
2181
- } : e;
2182
- }
2183
- var An = (e) => {
2184
- let { rects: t, activeIndex: n, overIndex: r, index: i } = e, a = Tn(t, r, n), o = t[i], s = a[i];
2185
- return !s || !o ? null : {
2186
- x: s.left - o.left,
2187
- y: s.top - o.top,
2188
- scaleX: s.width / o.width,
2189
- scaleY: s.height / o.height
2190
- };
2191
- }, jn = {
2192
- scaleX: 1,
2193
- scaleY: 1
2194
- }, Mn = (e) => {
2195
- let { activeIndex: t, activeNodeRect: n, index: r, rects: i, overIndex: a } = e, o = i[t] ?? n;
2196
- if (!o) return null;
2197
- if (r === t) {
2198
- let e = i[a];
2199
- return e ? {
2200
- x: 0,
2201
- y: t < a ? e.top + e.height - (o.top + o.height) : e.top - o.top,
2202
- ...jn
2203
- } : null;
2204
- }
2205
- let s = Nn(i, r, t);
2206
- return r > t && r <= a ? {
2207
- x: 0,
2208
- y: -o.height - s,
2209
- ...jn
2210
- } : r < t && r >= a ? {
2211
- x: 0,
2212
- y: o.height + s,
2213
- ...jn
2214
- } : {
2215
- x: 0,
2216
- y: 0,
2217
- ...jn
2218
- };
2219
- };
2220
- function Nn(e, t, n) {
2221
- let r = e[t], i = e[t - 1], a = e[t + 1];
2222
- return r ? n < t ? i ? r.top - (i.top + i.height) : a ? a.top - (r.top + r.height) : 0 : a ? a.top - (r.top + r.height) : i ? r.top - (i.top + i.height) : 0 : 0;
2223
- }
2224
- var Pn = "Sortable", Fn = /* @__PURE__ */ e.createContext({
2225
- activeIndex: -1,
2226
- containerId: Pn,
2227
- disableTransforms: !1,
2228
- items: [],
2229
- overIndex: -1,
2230
- useDragOverlay: !1,
2231
- sortedRects: [],
2232
- strategy: An,
2233
- disabled: {
2234
- draggable: !1,
2235
- droppable: !1
2236
- }
2237
- });
2238
- function In(t) {
2239
- let { children: n, id: r, items: i, strategy: a = An, disabled: o = !1 } = t, { active: c, dragOverlay: u, droppableRects: f, over: p, measureDroppableContainers: m } = cn(), h = j(Pn, r), g = u.rect !== null, _ = l(() => i.map((e) => typeof e == "object" && "id" in e ? e.id : e), [i]), v = c != null, y = c ? _.indexOf(c.id) : -1, b = p ? _.indexOf(p.id) : -1, x = d(_), S = !On(_, x.current), C = b !== -1 && y === -1 || S, T = kn(o);
2240
- w(() => {
2241
- S && v && m(_);
2242
- }, [
2243
- S,
2244
- _,
2245
- v,
2246
- m
2247
- ]), s(() => {
2248
- x.current = _;
2249
- }, [_]);
2250
- let E = l(() => ({
2251
- activeIndex: y,
2252
- containerId: h,
2253
- disabled: T,
2254
- disableTransforms: C,
2255
- items: _,
2256
- overIndex: b,
2257
- useDragOverlay: g,
2258
- sortedRects: En(_, f),
2259
- strategy: a
2260
- }), [
2261
- y,
2262
- h,
2263
- T.draggable,
2264
- T.droppable,
2265
- C,
2266
- _,
2267
- b,
2268
- f,
2269
- g,
2270
- a
2271
- ]);
2272
- return e.createElement(Fn.Provider, { value: E }, n);
2273
- }
2274
- var Ln = (e) => {
2275
- let { id: t, items: n, activeIndex: r, overIndex: i } = e;
2276
- return Tn(n, r, i).indexOf(t);
2277
- }, Rn = (e) => {
2278
- let { containerId: t, isSorting: n, wasDragging: r, index: i, items: a, newIndex: o, previousItems: s, previousContainerId: c, transition: l } = e;
2279
- return !l || !r || s !== a && i === o ? !1 : n ? !0 : o !== i && t === c;
2280
- }, zn = {
2281
- duration: 200,
2282
- easing: "ease"
2283
- }, Bn = "transform", Vn = /* @__PURE__ */ F.Transition.toString({
2284
- property: Bn,
2285
- duration: 0,
2286
- easing: "linear"
2287
- }), Hn = { roleDescription: "sortable" };
2288
- function Un(e) {
2289
- let { disabled: t, index: n, node: r, rect: i } = e, [a, o] = f(null), c = d(n);
2290
- return w(() => {
2291
- if (!t && n !== c.current && r.current) {
2292
- let e = i.current;
2293
- if (e) {
2294
- let t = De(r.current, { ignoreTransform: !0 }), n = {
2295
- x: e.left - t.left,
2296
- y: e.top - t.top,
2297
- scaleX: e.width / t.width,
2298
- scaleY: e.height / t.height
2299
- };
2300
- (n.x || n.y) && o(n);
2301
- }
2302
- }
2303
- n !== c.current && (c.current = n);
2304
- }, [
2305
- t,
2306
- n,
2307
- r,
2308
- i
2309
- ]), s(() => {
2310
- a && o(null);
2311
- }, [a]), a;
2312
- }
2313
- function Wn(e) {
2314
- let { animateLayoutChanges: t = Rn, attributes: n, disabled: r, data: i, getNewIndex: a = Ln, id: c, strategy: u, resizeObserverConfig: f, transition: p = zn } = e, { items: m, containerId: g, activeIndex: _, disabled: v, disableTransforms: y, sortedRects: b, overIndex: x, useDragOverlay: S, strategy: C } = o(Fn), w = Gn(r, v), T = m.indexOf(c), E = l(() => ({
2315
- sortable: {
2316
- containerId: g,
2317
- index: T,
2318
- items: m
2319
- },
2320
- ...i
2321
- }), [
2322
- g,
2323
- i,
2324
- T,
2325
- m
2326
- ]), ee = l(() => m.slice(m.indexOf(c)), [m, c]), { rect: D, node: O, isOver: k, setNodeRef: A } = dn({
2327
- id: c,
2328
- data: E,
2329
- disabled: w.droppable,
2330
- resizeObserverConfig: {
2331
- updateMeasurementsFor: ee,
2332
- ...f
2333
- }
2334
- }), { active: j, activatorEvent: te, activeNodeRect: ne, attributes: M, setNodeRef: N, listeners: re, isDragging: ie, over: I, setActivatorNodeRef: ae, transform: L } = sn({
2335
- id: c,
2336
- data: E,
2337
- attributes: {
2338
- ...Hn,
2339
- ...n
2340
- },
2341
- disabled: w.draggable
2342
- }), oe = h(A, N), R = !!j, z = R && !y && Dn(_) && Dn(x), se = !S && ie, ce = z ? (se && z ? L : null) ?? (u ?? C)({
2343
- rects: b,
2344
- activeNodeRect: ne,
2345
- activeIndex: _,
2346
- overIndex: x,
2347
- index: T
2348
- }) : null, le = Dn(_) && Dn(x) ? a({
2349
- id: c,
2350
- items: m,
2351
- activeIndex: _,
2352
- overIndex: x
2353
- }) : T, B = j?.id, V = d({
2354
- activeId: B,
2355
- items: m,
2356
- newIndex: le,
2357
- containerId: g
2358
- }), ue = m !== V.current.items, H = t({
2359
- active: j,
2360
- containerId: g,
2361
- isDragging: ie,
2362
- isSorting: R,
2363
- id: c,
2364
- index: T,
2365
- items: m,
2366
- newIndex: V.current.newIndex,
2367
- previousItems: V.current.items,
2368
- previousContainerId: V.current.containerId,
2369
- transition: p,
2370
- wasDragging: V.current.activeId != null
2371
- }), U = Un({
2372
- disabled: !H,
2373
- index: T,
2374
- node: O,
2375
- rect: D
2376
- });
2377
- return s(() => {
2378
- R && V.current.newIndex !== le && (V.current.newIndex = le), g !== V.current.containerId && (V.current.containerId = g), m !== V.current.items && (V.current.items = m);
2379
- }, [
2380
- R,
2381
- le,
2382
- g,
2383
- m
2384
- ]), s(() => {
2385
- if (B === V.current.activeId) return;
2386
- if (B != null && V.current.activeId == null) {
2387
- V.current.activeId = B;
2388
- return;
2389
- }
2390
- let e = setTimeout(() => {
2391
- V.current.activeId = B;
2392
- }, 50);
2393
- return () => clearTimeout(e);
2394
- }, [B]), {
2395
- active: j,
2396
- activeIndex: _,
2397
- attributes: M,
2398
- data: E,
2399
- rect: D,
2400
- index: T,
2401
- newIndex: le,
2402
- items: m,
2403
- isOver: k,
2404
- isSorting: R,
2405
- isDragging: ie,
2406
- listeners: re,
2407
- node: O,
2408
- overIndex: x,
2409
- over: I,
2410
- setNodeRef: oe,
2411
- setActivatorNodeRef: ae,
2412
- setDroppableNodeRef: A,
2413
- setDraggableNodeRef: N,
2414
- transform: U ?? ce,
2415
- transition: de()
2416
- };
2417
- function de() {
2418
- if (U || ue && V.current.newIndex === T) return Vn;
2419
- if (!(se && !P(te) || !p) && (R || H)) return F.Transition.toString({
2420
- ...p,
2421
- property: Bn
2422
- });
2423
- }
2424
- }
2425
- function Gn(e, t) {
2426
- return typeof e == "boolean" ? {
2427
- draggable: e,
2428
- droppable: !1
2429
- } : {
2430
- draggable: e?.draggable ?? t.draggable,
2431
- droppable: e?.droppable ?? t.droppable
2432
- };
2433
- }
2434
- function Kn(e) {
2435
- if (!e) return !1;
2436
- let t = e.data.current;
2437
- return !!(t && "sortable" in t && typeof t.sortable == "object" && "containerId" in t.sortable && "items" in t.sortable && "index" in t.sortable);
2438
- }
2439
- var qn = [
2440
- $.Down,
2441
- $.Right,
2442
- $.Up,
2443
- $.Left
2444
- ], Jn = (e, t) => {
2445
- let { context: { active: n, collisionRect: r, droppableRects: i, droppableContainers: a, over: o, scrollableAncestors: s } } = t;
2446
- if (qn.includes(e.code)) {
2447
- if (e.preventDefault(), !n || !r) return;
2448
- let t = [];
2449
- a.getEnabled().forEach((n) => {
2450
- if (!n || n != null && n.disabled) return;
2451
- let a = i.get(n.id);
2452
- if (a) switch (e.code) {
2453
- case $.Down:
2454
- r.top < a.top && t.push(n);
2455
- break;
2456
- case $.Up:
2457
- r.top > a.top && t.push(n);
2458
- break;
2459
- case $.Left:
2460
- r.left > a.left && t.push(n);
2461
- break;
2462
- case $.Right:
2463
- r.left < a.left && t.push(n);
2464
- break;
2465
- }
2466
- });
2467
- let c = ve({
2468
- active: n,
2469
- collisionRect: r,
2470
- droppableRects: i,
2471
- droppableContainers: t,
2472
- pointerCoordinates: null
2473
- }), l = he(c, "id");
2474
- if (l === o?.id && c.length > 1 && (l = c[1].id), l != null) {
2475
- let e = a.get(n.id), t = a.get(l), o = t ? i.get(t.id) : null, c = t?.node.current;
2476
- if (c && o && e && t) {
2477
- let n = Y(c).some((e, t) => s[t] !== e), i = Yn(e, t), a = Xn(e, t), l = n || !i ? {
2478
- x: 0,
2479
- y: 0
2480
- } : {
2481
- x: a ? r.width - o.width : 0,
2482
- y: a ? r.height - o.height : 0
2483
- }, u = {
2484
- x: o.left,
2485
- y: o.top
2486
- };
2487
- return l.x && l.y ? u : M(u, l);
2488
- }
2489
- }
2490
- }
2491
- };
2492
- function Yn(e, t) {
2493
- return !Kn(e) || !Kn(t) ? !1 : e.data.current.sortable.containerId === t.data.current.sortable.containerId;
2494
- }
2495
- function Xn(e, t) {
2496
- return !Kn(e) || !Kn(t) || !Yn(e, t) ? !1 : e.data.current.sortable.index < t.data.current.sortable.index;
2497
- }
2498
- //#endregion
2499
- export { de as _, Jn as a, nn as c, vt as d, ct as f, vn as g, _e as h, An as i, wn as l, ut as m, Tn as n, Wn as o, at as p, Rn as r, Mn as s, In as t, et as u, fe as v, F as y };