@fluid-app/fluid-cli-theme-dev 0.1.172 → 0.1.173

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 (92) hide show
  1. package/dist/dist-cli-preview/.vite/manifest.json +583 -181
  2. package/dist/dist-cli-preview/account-screens.css +1 -0
  3. package/dist/dist-cli-preview/account-screens.js +1 -1
  4. package/dist/dist-cli-preview/chunks/{Breadcrumb-BQKo8hPc.js → Breadcrumb-8-7shsB6.js} +1 -1
  5. package/dist/dist-cli-preview/chunks/Combobox-m3vSk0_A.js +521 -0
  6. package/dist/dist-cli-preview/chunks/{ContactsScreen-IsIZ_lQ0.js → ContactsScreen-CBjQOWmH.js} +1523 -1854
  7. package/dist/dist-cli-preview/chunks/MediaScreen-1akMnH12.js +17379 -0
  8. package/dist/dist-cli-preview/chunks/{MemberManagementProviders-DiQkiWzc.js → MemberManagementProviders-WSjb3a8B.js} +189 -199
  9. package/dist/dist-cli-preview/chunks/{MessagingScreen-B8ZxAE0L.js → MessagingScreen-By-jZq6v.js} +27645 -30195
  10. package/dist/dist-cli-preview/chunks/{MobileActionSheet-DMeTsLlK.js → MobileActionSheet-ERpw3qUF.js} +644 -589
  11. package/dist/dist-cli-preview/chunks/MySiteScreen-JAGvVMx-.js +1706 -0
  12. package/dist/dist-cli-preview/chunks/OrdersScreen-B1HQVMZC.js +9 -0
  13. package/dist/dist-cli-preview/chunks/{OrdersScreen-DrZ3SwEu.js → OrdersScreen-Cb32bBjd.js} +35 -35
  14. package/dist/dist-cli-preview/chunks/PortalTenantClientProvider-CguU_uRG.js +15 -0
  15. package/dist/dist-cli-preview/chunks/{ProfileScreen-Dxspc-6p.js → ProfileScreen-CCWM6TBs.js} +454 -463
  16. package/dist/dist-cli-preview/chunks/Select-5fzq5MB-.js +940 -0
  17. package/dist/dist-cli-preview/chunks/{SubscriptionsScreen-Be0C29uw.js → SubscriptionsScreen-DLdsaVJK.js} +3 -3
  18. package/dist/dist-cli-preview/chunks/Textarea-xoKqLVgY.js +330 -0
  19. package/dist/dist-cli-preview/chunks/{account-screen-runtime-DYMunv0A.js → account-screen-runtime-CCBl8DXt.js} +866 -860
  20. package/dist/dist-cli-preview/chunks/ar-D6LJV1_E.js +679 -0
  21. package/dist/dist-cli-preview/chunks/{arrow-left-Bd7dJtIV.js → arrow-left-CTYaRdTX.js} +1 -1
  22. package/dist/dist-cli-preview/chunks/bg-C5Ldmily.js +679 -0
  23. package/dist/dist-cli-preview/chunks/bn-kfMPWNR6.js +679 -0
  24. package/dist/dist-cli-preview/chunks/{cli-preview-C7Db08Ij.js → cli-preview-HAt0Lt-9.js} +20 -13
  25. package/dist/dist-cli-preview/chunks/{client.gen-Ck6Pm2jV.js → client.gen-B7RMYGYu.js} +1 -1
  26. package/dist/dist-cli-preview/chunks/copy-DHN1DxE_.js +14 -0
  27. package/dist/dist-cli-preview/chunks/{countries-api-adapter-InKUzF1q.js → countries-api-adapter-B4TefdRP.js} +2 -2
  28. package/dist/dist-cli-preview/chunks/{create-card-entry-container-C9z7JILL.js → create-card-entry-container-5NqOQ4D_.js} +3612 -3932
  29. package/dist/dist-cli-preview/chunks/cs-DqEgtV8D.js +679 -0
  30. package/dist/dist-cli-preview/chunks/da-BbuvL7Gx.js +679 -0
  31. package/dist/dist-cli-preview/chunks/de-BfJ7rQig.js +679 -0
  32. package/dist/dist-cli-preview/chunks/el-BO0rLq6D.js +679 -0
  33. package/dist/dist-cli-preview/chunks/es-BEVtEUXk.js +679 -0
  34. package/dist/dist-cli-preview/chunks/eye-qMoMW7-Z.js +20 -0
  35. package/dist/dist-cli-preview/chunks/fi-DjISV3UN.js +679 -0
  36. package/dist/dist-cli-preview/chunks/fr-1fFd-aKy.js +679 -0
  37. package/dist/dist-cli-preview/chunks/he-CaT9bwVp.js +679 -0
  38. package/dist/dist-cli-preview/chunks/{hey-api-client-DGRBsZ7Y.js → hey-api-client-JMNyZwcF.js} +79 -39
  39. package/dist/dist-cli-preview/chunks/hi-DkzEm57l.js +679 -0
  40. package/dist/dist-cli-preview/chunks/hr-DqM5N_bj.js +679 -0
  41. package/dist/dist-cli-preview/chunks/hu-DiLqjo5c.js +679 -0
  42. package/dist/dist-cli-preview/chunks/id-DA1KmwgX.js +679 -0
  43. package/dist/dist-cli-preview/chunks/index-BS4PnEcu.js +353 -0
  44. package/dist/dist-cli-preview/chunks/index-BhMjUmAr.js +2572 -0
  45. package/dist/dist-cli-preview/chunks/{screen-route-slug-utils-BDjSpDoe.js → index-Dor8vM2o.js} +2417 -3035
  46. package/dist/dist-cli-preview/chunks/it-CTEVWCRz.js +679 -0
  47. package/dist/dist-cli-preview/chunks/ja-fxqg1hhg.js +679 -0
  48. package/dist/dist-cli-preview/chunks/ko-Btp1_5YS.js +679 -0
  49. package/dist/dist-cli-preview/chunks/lock-DQTMeEw0.js +14 -0
  50. package/dist/dist-cli-preview/chunks/{log-out-CSPZjXTK.js → log-out-DUdRJX4l.js} +1 -1
  51. package/dist/dist-cli-preview/chunks/{map-pin-B2ScoijR.js → map-pin-DyIkpqP0.js} +1 -1
  52. package/dist/dist-cli-preview/chunks/media-vkLeBb90.js +4 -0
  53. package/dist/dist-cli-preview/chunks/member-permissions-ndhNmlOk.js +19 -0
  54. package/dist/dist-cli-preview/chunks/{mount-account-screen-5thBUz3X.js → mount-account-screen--gdc5WO_.js} +1869 -1884
  55. package/dist/dist-cli-preview/chunks/ms-DqRbmHx8.js +679 -0
  56. package/dist/dist-cli-preview/chunks/navigate-account-screen-AVNopuIP.js +38 -0
  57. package/dist/dist-cli-preview/chunks/nl-CkPNddxO.js +679 -0
  58. package/dist/dist-cli-preview/chunks/no-ftcy0RcQ.js +679 -0
  59. package/dist/dist-cli-preview/chunks/pl-wyJLqfip.js +679 -0
  60. package/dist/dist-cli-preview/chunks/{plus-CocoE5gC.js → plus-DZjrp536.js} +1 -1
  61. package/dist/dist-cli-preview/chunks/pt-7uHLacuI.js +679 -0
  62. package/dist/dist-cli-preview/chunks/ro-Dh12ghww.js +679 -0
  63. package/dist/dist-cli-preview/chunks/ru-DFM7xWFz.js +679 -0
  64. package/dist/dist-cli-preview/chunks/{schemas-D94nZk5x.js → schemas-BTblatUV.js} +1107 -1062
  65. package/dist/dist-cli-preview/chunks/screen-route-slug-utils-DozJp-uc.js +620 -0
  66. package/dist/dist-cli-preview/chunks/{sheet-haptics-context-iOjKcNDj.js → sheet-haptics-context-CYrEaGtf.js} +3 -3
  67. package/dist/dist-cli-preview/chunks/sidebar-9qopXeR1.js +598 -0
  68. package/dist/dist-cli-preview/chunks/sk-CsuNYa1k.js +679 -0
  69. package/dist/dist-cli-preview/chunks/sortable.esm-Dlen88Fc.js +3283 -0
  70. package/dist/dist-cli-preview/chunks/{store-api-context-B96Ip2FB.js → store-api-context-B9pW_xao.js} +1 -1
  71. package/dist/dist-cli-preview/chunks/sv-DVrPaJbh.js +679 -0
  72. package/dist/dist-cli-preview/chunks/th-BEkMpcVW.js +679 -0
  73. package/dist/dist-cli-preview/chunks/tl-CqwwplQC.js +679 -0
  74. package/dist/dist-cli-preview/chunks/tr-XEp4ekrM.js +679 -0
  75. package/dist/dist-cli-preview/chunks/{trash-2-wVweQZMw.js → trash-2-ClRyi9iY.js} +12 -12
  76. package/dist/dist-cli-preview/chunks/uk-DWdZFWBl.js +679 -0
  77. package/dist/dist-cli-preview/chunks/use-mobile-srOt50VV.js +254 -0
  78. package/dist/dist-cli-preview/chunks/{use-optional-store-lZUz976C.js → use-optional-store-BgrOjfZJ.js} +2 -2
  79. package/dist/dist-cli-preview/chunks/{use-store-DVmgsDXy.js → use-store-CUSQx1E-.js} +25 -36
  80. package/dist/dist-cli-preview/chunks/{useInfiniteQuery-Dtzov9uh.js → useInfiniteQuery-DGc8fotv.js} +1 -1
  81. package/dist/dist-cli-preview/chunks/user-Ca2sKJ-h.js +14 -0
  82. package/dist/dist-cli-preview/chunks/users-Dh7zTrKY.js +16 -0
  83. package/dist/dist-cli-preview/chunks/vi-H__PaPsC.js +679 -0
  84. package/dist/dist-cli-preview/chunks/zh_CN-B62j_w_1.js +679 -0
  85. package/dist/dist-cli-preview/chunks/zh_TW-CYUIGBvP.js +679 -0
  86. package/package.json +1 -1
  87. package/dist/dist-cli-preview/chunks/Combobox-cf11L_T-.js +0 -1455
  88. package/dist/dist-cli-preview/chunks/MySiteScreen-Dtw1rsF9.js +0 -4950
  89. package/dist/dist-cli-preview/chunks/OrdersScreen-DkltVCtr.js +0 -9
  90. package/dist/dist-cli-preview/chunks/sidebar-Ckzom4Xc.js +0 -848
  91. package/dist/dist-cli-preview/chunks/user-B81IrSgp.js +0 -31
  92. package/dist/dist-cli-preview/chunks/users-BXTjoCUz.js +0 -27
@@ -0,0 +1,3283 @@
1
+ import { c as Vt, j as $e, M as Ke, l as a, G as st, J as ge, H as z, a7 as Le } from "./account-screen-runtime-CCBl8DXt.js";
2
+ import { u as ve } from "./schemas-BTblatUV.js";
3
+ /**
4
+ * @license lucide-react v0.575.0 - ISC
5
+ *
6
+ * This source code is licensed under the ISC license.
7
+ * See the LICENSE file in the root directory of this source tree.
8
+ */
9
+ const kn = [
10
+ ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
11
+ ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
12
+ ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
13
+ ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
14
+ ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
15
+ ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
16
+ ], yo = Vt("grip-vertical", kn);
17
+ /**
18
+ * @license lucide-react v0.575.0 - ISC
19
+ *
20
+ * This source code is licensed under the ISC license.
21
+ * See the LICENSE file in the root directory of this source tree.
22
+ */
23
+ const Ln = [
24
+ ["rect", { width: "7", height: "7", x: "3", y: "3", rx: "1", key: "1g98yp" }],
25
+ ["rect", { width: "7", height: "7", x: "14", y: "3", rx: "1", key: "6d4xhi" }],
26
+ ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }],
27
+ ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }]
28
+ ], mo = Vt("layout-grid", Ln);
29
+ function wo({
30
+ className: e,
31
+ ...t
32
+ }) {
33
+ return /* @__PURE__ */ $e.jsx(
34
+ "div",
35
+ {
36
+ "data-slot": "card",
37
+ className: Ke(
38
+ "bg-card text-card-foreground flex h-full flex-col gap-6 rounded-xl border py-6 shadow-sm",
39
+ e
40
+ ),
41
+ ...t
42
+ }
43
+ );
44
+ }
45
+ function xo({
46
+ className: e,
47
+ ...t
48
+ }) {
49
+ return /* @__PURE__ */ $e.jsx(
50
+ "div",
51
+ {
52
+ "data-slot": "card-header",
53
+ className: Ke(
54
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
55
+ e
56
+ ),
57
+ ...t
58
+ }
59
+ );
60
+ }
61
+ function Do({
62
+ className: e,
63
+ ...t
64
+ }) {
65
+ return /* @__PURE__ */ $e.jsx(
66
+ "div",
67
+ {
68
+ "data-slot": "card-title",
69
+ className: Ke("leading-none font-semibold", e),
70
+ ...t
71
+ }
72
+ );
73
+ }
74
+ function Co({
75
+ className: e,
76
+ ...t
77
+ }) {
78
+ return /* @__PURE__ */ $e.jsx(
79
+ "div",
80
+ {
81
+ "data-slot": "card-action",
82
+ className: Ke(
83
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
84
+ e
85
+ ),
86
+ ...t
87
+ }
88
+ );
89
+ }
90
+ function So({
91
+ className: e,
92
+ ...t
93
+ }) {
94
+ return /* @__PURE__ */ $e.jsx(
95
+ "div",
96
+ {
97
+ "data-slot": "card-content",
98
+ className: Ke("px-6", e),
99
+ ...t
100
+ }
101
+ );
102
+ }
103
+ const Gt = a.createContext(null), Ro = Gt.Provider;
104
+ function _() {
105
+ const e = a.use(Gt);
106
+ if (!e)
107
+ throw new Error("useMySiteApi must be used within a MySiteApiProvider");
108
+ return e;
109
+ }
110
+ const N = {
111
+ profile: () => ["portal-mysite", "profile"],
112
+ links: () => ["portal-mysite", "links"],
113
+ favorites: () => ["portal-mysite", "favorites"],
114
+ themes: () => ["portal-mysite", "themes"]
115
+ };
116
+ function Eo() {
117
+ const e = _();
118
+ return st({
119
+ queryKey: N.profile(),
120
+ queryFn: () => e.fetchProfile()
121
+ });
122
+ }
123
+ function Mo(e) {
124
+ const t = _(), n = ge();
125
+ return ve({
126
+ mutationFn: (r) => t.updateSettings(r),
127
+ // Awaited so the mutation stays pending until the refetches land. Callers
128
+ // otherwise show a success toast over the slug the user just replaced.
129
+ onSuccess: async (r, o) => {
130
+ await n.invalidateQueries({
131
+ queryKey: N.profile()
132
+ }), await e?.onSuccess?.(o);
133
+ }
134
+ });
135
+ }
136
+ function Ao() {
137
+ const e = _();
138
+ return st({
139
+ queryKey: N.links(),
140
+ queryFn: () => e.listLinks()
141
+ });
142
+ }
143
+ function Io() {
144
+ const e = _(), t = ge();
145
+ return ve({
146
+ mutationFn: (n) => e.createLink(n),
147
+ onSuccess: () => {
148
+ t.invalidateQueries({
149
+ queryKey: N.links()
150
+ });
151
+ }
152
+ });
153
+ }
154
+ function To() {
155
+ const e = _(), t = ge();
156
+ return ve({
157
+ mutationFn: ({ linkId: n, body: r }) => e.updateLink(n, r),
158
+ onSuccess: () => {
159
+ t.invalidateQueries({
160
+ queryKey: N.links()
161
+ });
162
+ }
163
+ });
164
+ }
165
+ function No() {
166
+ const e = _(), t = ge();
167
+ return ve({
168
+ mutationFn: (n) => e.deleteLink(n),
169
+ onSuccess: () => {
170
+ t.invalidateQueries({
171
+ queryKey: N.links()
172
+ });
173
+ }
174
+ });
175
+ }
176
+ function Oo() {
177
+ const e = _(), t = ge();
178
+ return ve({
179
+ mutationFn: ({
180
+ orderedIds: n
181
+ }) => e.reorderLinks(n),
182
+ onMutate: async ({ optimisticItems: n }) => {
183
+ await t.cancelQueries({
184
+ queryKey: N.links()
185
+ });
186
+ const r = t.getQueryData(
187
+ N.links()
188
+ );
189
+ return t.setQueryData(N.links(), n), { previousData: r };
190
+ },
191
+ onError: (n, r, o) => {
192
+ o?.previousData && t.setQueryData(
193
+ N.links(),
194
+ o.previousData
195
+ );
196
+ },
197
+ onSettled: () => {
198
+ t.invalidateQueries({
199
+ queryKey: N.links()
200
+ });
201
+ }
202
+ });
203
+ }
204
+ function ko() {
205
+ const e = _();
206
+ return st({
207
+ queryKey: N.favorites(),
208
+ queryFn: () => e.listFavorites()
209
+ });
210
+ }
211
+ function Lo() {
212
+ const e = _(), t = ge();
213
+ return ve({
214
+ mutationFn: (n) => e.deleteFavorite(n),
215
+ onSuccess: () => {
216
+ t.invalidateQueries({
217
+ queryKey: N.favorites()
218
+ });
219
+ }
220
+ });
221
+ }
222
+ function Po() {
223
+ const e = _(), t = ge();
224
+ return ve({
225
+ mutationFn: ({
226
+ orderedIds: n
227
+ }) => e.reorderFavorites(n),
228
+ onMutate: async ({ optimisticItems: n }) => {
229
+ await t.cancelQueries({
230
+ queryKey: N.favorites()
231
+ });
232
+ const r = t.getQueryData(
233
+ N.favorites()
234
+ );
235
+ return t.setQueryData(N.favorites(), n), { previousData: r };
236
+ },
237
+ onError: (n, r, o) => {
238
+ o?.previousData && t.setQueryData(
239
+ N.favorites(),
240
+ o.previousData
241
+ );
242
+ },
243
+ onSettled: () => {
244
+ t.invalidateQueries({
245
+ queryKey: N.favorites()
246
+ });
247
+ }
248
+ });
249
+ }
250
+ function Fo() {
251
+ const e = _();
252
+ return st({
253
+ queryKey: N.themes(),
254
+ queryFn: () => e.listThemes()
255
+ });
256
+ }
257
+ function Pn() {
258
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
259
+ t[n] = arguments[n];
260
+ return a.useMemo(
261
+ () => (r) => {
262
+ t.forEach((o) => o(r));
263
+ },
264
+ // eslint-disable-next-line react-hooks/exhaustive-deps
265
+ t
266
+ );
267
+ }
268
+ const at = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u";
269
+ function Ce(e) {
270
+ const t = Object.prototype.toString.call(e);
271
+ return t === "[object Window]" || // In Electron context the Window object serializes to [object global]
272
+ t === "[object global]";
273
+ }
274
+ function Ct(e) {
275
+ return "nodeType" in e;
276
+ }
277
+ function B(e) {
278
+ var t, n;
279
+ return e ? Ce(e) ? e : Ct(e) && (t = (n = e.ownerDocument) == null ? void 0 : n.defaultView) != null ? t : window : window;
280
+ }
281
+ function St(e) {
282
+ const {
283
+ Document: t
284
+ } = B(e);
285
+ return e instanceof t;
286
+ }
287
+ function Xe(e) {
288
+ return Ce(e) ? !1 : e instanceof B(e).HTMLElement;
289
+ }
290
+ function Jt(e) {
291
+ return e instanceof B(e).SVGElement;
292
+ }
293
+ function Se(e) {
294
+ return e ? Ce(e) ? e.document : Ct(e) ? St(e) ? e : Xe(e) || Jt(e) ? e.ownerDocument : document : document : document;
295
+ }
296
+ const ee = at ? a.useLayoutEffect : a.useEffect;
297
+ function Rt(e) {
298
+ const t = a.useRef(e);
299
+ return ee(() => {
300
+ t.current = e;
301
+ }), a.useCallback(function() {
302
+ for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++)
303
+ r[o] = arguments[o];
304
+ return t.current == null ? void 0 : t.current(...r);
305
+ }, []);
306
+ }
307
+ function Fn() {
308
+ const e = a.useRef(null), t = a.useCallback((r, o) => {
309
+ e.current = setInterval(r, o);
310
+ }, []), n = a.useCallback(() => {
311
+ e.current !== null && (clearInterval(e.current), e.current = null);
312
+ }, []);
313
+ return [t, n];
314
+ }
315
+ function Be(e, t) {
316
+ t === void 0 && (t = [e]);
317
+ const n = a.useRef(e);
318
+ return ee(() => {
319
+ n.current !== e && (n.current = e);
320
+ }, t), n;
321
+ }
322
+ function Ye(e, t) {
323
+ const n = a.useRef();
324
+ return a.useMemo(
325
+ () => {
326
+ const r = e(n.current);
327
+ return n.current = r, r;
328
+ },
329
+ // eslint-disable-next-line react-hooks/exhaustive-deps
330
+ [...t]
331
+ );
332
+ }
333
+ function tt(e) {
334
+ const t = Rt(e), n = a.useRef(null), r = a.useCallback(
335
+ (o) => {
336
+ o !== n.current && t?.(o, n.current), n.current = o;
337
+ },
338
+ //eslint-disable-next-line
339
+ []
340
+ );
341
+ return [n, r];
342
+ }
343
+ function yt(e) {
344
+ const t = a.useRef();
345
+ return a.useEffect(() => {
346
+ t.current = e;
347
+ }, [e]), t.current;
348
+ }
349
+ let gt = {};
350
+ function Ue(e, t) {
351
+ return a.useMemo(() => {
352
+ if (t)
353
+ return t;
354
+ const n = gt[e] == null ? 0 : gt[e] + 1;
355
+ return gt[e] = n, e + "-" + n;
356
+ }, [e, t]);
357
+ }
358
+ function Zt(e) {
359
+ return function(t) {
360
+ for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++)
361
+ r[o - 1] = arguments[o];
362
+ return r.reduce((i, s) => {
363
+ const c = Object.entries(s);
364
+ for (const [l, u] of c) {
365
+ const f = i[l];
366
+ f != null && (i[l] = f + e * u);
367
+ }
368
+ return i;
369
+ }, {
370
+ ...t
371
+ });
372
+ };
373
+ }
374
+ const De = /* @__PURE__ */ Zt(1), qe = /* @__PURE__ */ Zt(-1);
375
+ function zn(e) {
376
+ return "clientX" in e && "clientY" in e;
377
+ }
378
+ function Et(e) {
379
+ if (!e)
380
+ return !1;
381
+ const {
382
+ KeyboardEvent: t
383
+ } = B(e.target);
384
+ return t && e instanceof t;
385
+ }
386
+ function Bn(e) {
387
+ if (!e)
388
+ return !1;
389
+ const {
390
+ TouchEvent: t
391
+ } = B(e.target);
392
+ return t && e instanceof t;
393
+ }
394
+ function mt(e) {
395
+ if (Bn(e)) {
396
+ if (e.touches && e.touches.length) {
397
+ const {
398
+ clientX: t,
399
+ clientY: n
400
+ } = e.touches[0];
401
+ return {
402
+ x: t,
403
+ y: n
404
+ };
405
+ } else if (e.changedTouches && e.changedTouches.length) {
406
+ const {
407
+ clientX: t,
408
+ clientY: n
409
+ } = e.changedTouches[0];
410
+ return {
411
+ x: t,
412
+ y: n
413
+ };
414
+ }
415
+ }
416
+ return zn(e) ? {
417
+ x: e.clientX,
418
+ y: e.clientY
419
+ } : null;
420
+ }
421
+ const nt = /* @__PURE__ */ Object.freeze({
422
+ Translate: {
423
+ toString(e) {
424
+ if (!e)
425
+ return;
426
+ const {
427
+ x: t,
428
+ y: n
429
+ } = e;
430
+ return "translate3d(" + (t ? Math.round(t) : 0) + "px, " + (n ? Math.round(n) : 0) + "px, 0)";
431
+ }
432
+ },
433
+ Scale: {
434
+ toString(e) {
435
+ if (!e)
436
+ return;
437
+ const {
438
+ scaleX: t,
439
+ scaleY: n
440
+ } = e;
441
+ return "scaleX(" + t + ") scaleY(" + n + ")";
442
+ }
443
+ },
444
+ Transform: {
445
+ toString(e) {
446
+ if (e)
447
+ return [nt.Translate.toString(e), nt.Scale.toString(e)].join(" ");
448
+ }
449
+ },
450
+ Transition: {
451
+ toString(e) {
452
+ let {
453
+ property: t,
454
+ duration: n,
455
+ easing: r
456
+ } = e;
457
+ return t + " " + n + "ms " + r;
458
+ }
459
+ }
460
+ }), zt = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
461
+ function qn(e) {
462
+ return e.matches(zt) ? e : e.querySelector(zt);
463
+ }
464
+ const jn = {
465
+ display: "none"
466
+ };
467
+ function $n(e) {
468
+ let {
469
+ id: t,
470
+ value: n
471
+ } = e;
472
+ return z.createElement("div", {
473
+ id: t,
474
+ style: jn
475
+ }, n);
476
+ }
477
+ function Kn(e) {
478
+ let {
479
+ id: t,
480
+ announcement: n,
481
+ ariaLiveType: r = "assertive"
482
+ } = e;
483
+ const o = {
484
+ position: "fixed",
485
+ top: 0,
486
+ left: 0,
487
+ width: 1,
488
+ height: 1,
489
+ margin: -1,
490
+ border: 0,
491
+ padding: 0,
492
+ overflow: "hidden",
493
+ clip: "rect(0 0 0 0)",
494
+ clipPath: "inset(100%)",
495
+ whiteSpace: "nowrap"
496
+ };
497
+ return z.createElement("div", {
498
+ id: t,
499
+ style: o,
500
+ role: "status",
501
+ "aria-live": r,
502
+ "aria-atomic": !0
503
+ }, n);
504
+ }
505
+ function Xn() {
506
+ const [e, t] = a.useState("");
507
+ return {
508
+ announce: a.useCallback((r) => {
509
+ r != null && t(r);
510
+ }, []),
511
+ announcement: e
512
+ };
513
+ }
514
+ const en = /* @__PURE__ */ a.createContext(null);
515
+ function Yn(e) {
516
+ const t = a.useContext(en);
517
+ a.useEffect(() => {
518
+ if (!t)
519
+ throw new Error("useDndMonitor must be used within a children of <DndContext>");
520
+ return t(e);
521
+ }, [e, t]);
522
+ }
523
+ function Un() {
524
+ const [e] = a.useState(() => /* @__PURE__ */ new Set()), t = a.useCallback((r) => (e.add(r), () => e.delete(r)), [e]);
525
+ return [a.useCallback((r) => {
526
+ let {
527
+ type: o,
528
+ event: i
529
+ } = r;
530
+ e.forEach((s) => {
531
+ var c;
532
+ return (c = s[o]) == null ? void 0 : c.call(s, i);
533
+ });
534
+ }, [e]), t];
535
+ }
536
+ const Qn = {
537
+ draggable: `
538
+ To pick up a draggable item, press the space bar.
539
+ While dragging, use the arrow keys to move the item.
540
+ Press space again to drop the item in its new position, or press escape to cancel.
541
+ `
542
+ }, Wn = {
543
+ onDragStart(e) {
544
+ let {
545
+ active: t
546
+ } = e;
547
+ return "Picked up draggable item " + t.id + ".";
548
+ },
549
+ onDragOver(e) {
550
+ let {
551
+ active: t,
552
+ over: n
553
+ } = e;
554
+ return n ? "Draggable item " + t.id + " was moved over droppable area " + n.id + "." : "Draggable item " + t.id + " is no longer over a droppable area.";
555
+ },
556
+ onDragEnd(e) {
557
+ let {
558
+ active: t,
559
+ over: n
560
+ } = e;
561
+ return n ? "Draggable item " + t.id + " was dropped over droppable area " + n.id : "Draggable item " + t.id + " was dropped.";
562
+ },
563
+ onDragCancel(e) {
564
+ let {
565
+ active: t
566
+ } = e;
567
+ return "Dragging was cancelled. Draggable item " + t.id + " was dropped.";
568
+ }
569
+ };
570
+ function Hn(e) {
571
+ let {
572
+ announcements: t = Wn,
573
+ container: n,
574
+ hiddenTextDescribedById: r,
575
+ screenReaderInstructions: o = Qn
576
+ } = e;
577
+ const {
578
+ announce: i,
579
+ announcement: s
580
+ } = Xn(), c = Ue("DndLiveRegion"), [l, u] = a.useState(!1);
581
+ if (a.useEffect(() => {
582
+ u(!0);
583
+ }, []), Yn(a.useMemo(() => ({
584
+ onDragStart(d) {
585
+ let {
586
+ active: g
587
+ } = d;
588
+ i(t.onDragStart({
589
+ active: g
590
+ }));
591
+ },
592
+ onDragMove(d) {
593
+ let {
594
+ active: g,
595
+ over: h
596
+ } = d;
597
+ t.onDragMove && i(t.onDragMove({
598
+ active: g,
599
+ over: h
600
+ }));
601
+ },
602
+ onDragOver(d) {
603
+ let {
604
+ active: g,
605
+ over: h
606
+ } = d;
607
+ i(t.onDragOver({
608
+ active: g,
609
+ over: h
610
+ }));
611
+ },
612
+ onDragEnd(d) {
613
+ let {
614
+ active: g,
615
+ over: h
616
+ } = d;
617
+ i(t.onDragEnd({
618
+ active: g,
619
+ over: h
620
+ }));
621
+ },
622
+ onDragCancel(d) {
623
+ let {
624
+ active: g,
625
+ over: h
626
+ } = d;
627
+ i(t.onDragCancel({
628
+ active: g,
629
+ over: h
630
+ }));
631
+ }
632
+ }), [i, t])), !l)
633
+ return null;
634
+ const f = z.createElement(z.Fragment, null, z.createElement($n, {
635
+ id: r,
636
+ value: o.draggable
637
+ }), z.createElement(Kn, {
638
+ id: c,
639
+ announcement: s
640
+ }));
641
+ return n ? Le.createPortal(f, n) : f;
642
+ }
643
+ var T;
644
+ (function(e) {
645
+ e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
646
+ })(T || (T = {}));
647
+ function rt() {
648
+ }
649
+ function zo(e, t) {
650
+ return a.useMemo(
651
+ () => ({
652
+ sensor: e,
653
+ options: t ?? {}
654
+ }),
655
+ // eslint-disable-next-line react-hooks/exhaustive-deps
656
+ [e, t]
657
+ );
658
+ }
659
+ function Bo() {
660
+ for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
661
+ t[n] = arguments[n];
662
+ return a.useMemo(
663
+ () => [...t].filter((r) => r != null),
664
+ // eslint-disable-next-line react-hooks/exhaustive-deps
665
+ [...t]
666
+ );
667
+ }
668
+ const H = /* @__PURE__ */ Object.freeze({
669
+ x: 0,
670
+ y: 0
671
+ });
672
+ function tn(e, t) {
673
+ return Math.sqrt(Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2));
674
+ }
675
+ function nn(e, t) {
676
+ let {
677
+ data: {
678
+ value: n
679
+ }
680
+ } = e, {
681
+ data: {
682
+ value: r
683
+ }
684
+ } = t;
685
+ return n - r;
686
+ }
687
+ function _n(e, t) {
688
+ let {
689
+ data: {
690
+ value: n
691
+ }
692
+ } = e, {
693
+ data: {
694
+ value: r
695
+ }
696
+ } = t;
697
+ return r - n;
698
+ }
699
+ function Bt(e) {
700
+ let {
701
+ left: t,
702
+ top: n,
703
+ height: r,
704
+ width: o
705
+ } = e;
706
+ return [{
707
+ x: t,
708
+ y: n
709
+ }, {
710
+ x: t + o,
711
+ y: n
712
+ }, {
713
+ x: t,
714
+ y: n + r
715
+ }, {
716
+ x: t + o,
717
+ y: n + r
718
+ }];
719
+ }
720
+ function rn(e, t) {
721
+ if (!e || e.length === 0)
722
+ return null;
723
+ const [n] = e;
724
+ return n[t];
725
+ }
726
+ function qt(e, t, n) {
727
+ return t === void 0 && (t = e.left), n === void 0 && (n = e.top), {
728
+ x: t + e.width * 0.5,
729
+ y: n + e.height * 0.5
730
+ };
731
+ }
732
+ const qo = (e) => {
733
+ let {
734
+ collisionRect: t,
735
+ droppableRects: n,
736
+ droppableContainers: r
737
+ } = e;
738
+ const o = qt(t, t.left, t.top), i = [];
739
+ for (const s of r) {
740
+ const {
741
+ id: c
742
+ } = s, l = n.get(c);
743
+ if (l) {
744
+ const u = tn(qt(l), o);
745
+ i.push({
746
+ id: c,
747
+ data: {
748
+ droppableContainer: s,
749
+ value: u
750
+ }
751
+ });
752
+ }
753
+ }
754
+ return i.sort(nn);
755
+ }, Vn = (e) => {
756
+ let {
757
+ collisionRect: t,
758
+ droppableRects: n,
759
+ droppableContainers: r
760
+ } = e;
761
+ const o = Bt(t), i = [];
762
+ for (const s of r) {
763
+ const {
764
+ id: c
765
+ } = s, l = n.get(c);
766
+ if (l) {
767
+ const u = Bt(l), f = o.reduce((g, h, C) => g + tn(u[C], h), 0), d = Number((f / 4).toFixed(4));
768
+ i.push({
769
+ id: c,
770
+ data: {
771
+ droppableContainer: s,
772
+ value: d
773
+ }
774
+ });
775
+ }
776
+ }
777
+ return i.sort(nn);
778
+ };
779
+ function Gn(e, t) {
780
+ 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, c = i - n;
781
+ if (r < o && n < i) {
782
+ const l = t.width * t.height, u = e.width * e.height, f = s * c, d = f / (l + u - f);
783
+ return Number(d.toFixed(4));
784
+ }
785
+ return 0;
786
+ }
787
+ const Jn = (e) => {
788
+ let {
789
+ collisionRect: t,
790
+ droppableRects: n,
791
+ droppableContainers: r
792
+ } = e;
793
+ const o = [];
794
+ for (const i of r) {
795
+ const {
796
+ id: s
797
+ } = i, c = n.get(s);
798
+ if (c) {
799
+ const l = Gn(c, t);
800
+ l > 0 && o.push({
801
+ id: s,
802
+ data: {
803
+ droppableContainer: i,
804
+ value: l
805
+ }
806
+ });
807
+ }
808
+ }
809
+ return o.sort(_n);
810
+ };
811
+ function Zn(e, t, n) {
812
+ return {
813
+ ...e,
814
+ scaleX: t && n ? t.width / n.width : 1,
815
+ scaleY: t && n ? t.height / n.height : 1
816
+ };
817
+ }
818
+ function on(e, t) {
819
+ return e && t ? {
820
+ x: e.left - t.left,
821
+ y: e.top - t.top
822
+ } : H;
823
+ }
824
+ function er(e) {
825
+ return function(n) {
826
+ for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), i = 1; i < r; i++)
827
+ o[i - 1] = arguments[i];
828
+ return o.reduce((s, c) => ({
829
+ ...s,
830
+ top: s.top + e * c.y,
831
+ bottom: s.bottom + e * c.y,
832
+ left: s.left + e * c.x,
833
+ right: s.right + e * c.x
834
+ }), {
835
+ ...n
836
+ });
837
+ };
838
+ }
839
+ const tr = /* @__PURE__ */ er(1);
840
+ function nr(e) {
841
+ if (e.startsWith("matrix3d(")) {
842
+ const t = e.slice(9, -1).split(/, /);
843
+ return {
844
+ x: +t[12],
845
+ y: +t[13],
846
+ scaleX: +t[0],
847
+ scaleY: +t[5]
848
+ };
849
+ } else if (e.startsWith("matrix(")) {
850
+ const t = e.slice(7, -1).split(/, /);
851
+ return {
852
+ x: +t[4],
853
+ y: +t[5],
854
+ scaleX: +t[0],
855
+ scaleY: +t[3]
856
+ };
857
+ }
858
+ return null;
859
+ }
860
+ function rr(e, t, n) {
861
+ const r = nr(t);
862
+ if (!r)
863
+ return e;
864
+ const {
865
+ scaleX: o,
866
+ scaleY: i,
867
+ x: s,
868
+ y: c
869
+ } = r, l = e.left - s - (1 - o) * parseFloat(n), u = e.top - c - (1 - i) * parseFloat(n.slice(n.indexOf(" ") + 1)), f = o ? e.width / o : e.width, d = i ? e.height / i : e.height;
870
+ return {
871
+ width: f,
872
+ height: d,
873
+ top: u,
874
+ right: l + f,
875
+ bottom: u + d,
876
+ left: l
877
+ };
878
+ }
879
+ const or = {
880
+ ignoreTransform: !1
881
+ };
882
+ function Re(e, t) {
883
+ t === void 0 && (t = or);
884
+ let n = e.getBoundingClientRect();
885
+ if (t.ignoreTransform) {
886
+ const {
887
+ transform: u,
888
+ transformOrigin: f
889
+ } = B(e).getComputedStyle(e);
890
+ u && (n = rr(n, u, f));
891
+ }
892
+ const {
893
+ top: r,
894
+ left: o,
895
+ width: i,
896
+ height: s,
897
+ bottom: c,
898
+ right: l
899
+ } = n;
900
+ return {
901
+ top: r,
902
+ left: o,
903
+ width: i,
904
+ height: s,
905
+ bottom: c,
906
+ right: l
907
+ };
908
+ }
909
+ function jt(e) {
910
+ return Re(e, {
911
+ ignoreTransform: !0
912
+ });
913
+ }
914
+ function ir(e) {
915
+ const t = e.innerWidth, n = e.innerHeight;
916
+ return {
917
+ top: 0,
918
+ left: 0,
919
+ right: t,
920
+ bottom: n,
921
+ width: t,
922
+ height: n
923
+ };
924
+ }
925
+ function sr(e, t) {
926
+ return t === void 0 && (t = B(e).getComputedStyle(e)), t.position === "fixed";
927
+ }
928
+ function ar(e, t) {
929
+ t === void 0 && (t = B(e).getComputedStyle(e));
930
+ const n = /(auto|scroll|overlay)/;
931
+ return ["overflow", "overflowX", "overflowY"].some((o) => {
932
+ const i = t[o];
933
+ return typeof i == "string" ? n.test(i) : !1;
934
+ });
935
+ }
936
+ function ct(e, t) {
937
+ const n = [];
938
+ function r(o) {
939
+ if (t != null && n.length >= t || !o)
940
+ return n;
941
+ if (St(o) && o.scrollingElement != null && !n.includes(o.scrollingElement))
942
+ return n.push(o.scrollingElement), n;
943
+ if (!Xe(o) || Jt(o) || n.includes(o))
944
+ return n;
945
+ const i = B(e).getComputedStyle(o);
946
+ return o !== e && ar(o, i) && n.push(o), sr(o, i) ? n : r(o.parentNode);
947
+ }
948
+ return e ? r(e) : n;
949
+ }
950
+ function sn(e) {
951
+ const [t] = ct(e, 1);
952
+ return t ?? null;
953
+ }
954
+ function vt(e) {
955
+ return !at || !e ? null : Ce(e) ? e : Ct(e) ? St(e) || e === Se(e).scrollingElement ? window : Xe(e) ? e : null : null;
956
+ }
957
+ function an(e) {
958
+ return Ce(e) ? e.scrollX : e.scrollLeft;
959
+ }
960
+ function cn(e) {
961
+ return Ce(e) ? e.scrollY : e.scrollTop;
962
+ }
963
+ function wt(e) {
964
+ return {
965
+ x: an(e),
966
+ y: cn(e)
967
+ };
968
+ }
969
+ var k;
970
+ (function(e) {
971
+ e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
972
+ })(k || (k = {}));
973
+ function ln(e) {
974
+ return !at || !e ? !1 : e === document.scrollingElement;
975
+ }
976
+ function un(e) {
977
+ const t = {
978
+ x: 0,
979
+ y: 0
980
+ }, n = ln(e) ? {
981
+ height: window.innerHeight,
982
+ width: window.innerWidth
983
+ } : {
984
+ height: e.clientHeight,
985
+ width: e.clientWidth
986
+ }, r = {
987
+ x: e.scrollWidth - n.width,
988
+ y: e.scrollHeight - n.height
989
+ }, o = e.scrollTop <= t.y, i = e.scrollLeft <= t.x, s = e.scrollTop >= r.y, c = e.scrollLeft >= r.x;
990
+ return {
991
+ isTop: o,
992
+ isLeft: i,
993
+ isBottom: s,
994
+ isRight: c,
995
+ maxScroll: r,
996
+ minScroll: t
997
+ };
998
+ }
999
+ const cr = {
1000
+ x: 0.2,
1001
+ y: 0.2
1002
+ };
1003
+ function lr(e, t, n, r, o) {
1004
+ let {
1005
+ top: i,
1006
+ left: s,
1007
+ right: c,
1008
+ bottom: l
1009
+ } = n;
1010
+ r === void 0 && (r = 10), o === void 0 && (o = cr);
1011
+ const {
1012
+ isTop: u,
1013
+ isBottom: f,
1014
+ isLeft: d,
1015
+ isRight: g
1016
+ } = un(e), h = {
1017
+ x: 0,
1018
+ y: 0
1019
+ }, C = {
1020
+ x: 0,
1021
+ y: 0
1022
+ }, v = {
1023
+ height: t.height * o.y,
1024
+ width: t.width * o.x
1025
+ };
1026
+ return !u && i <= t.top + v.height ? (h.y = k.Backward, C.y = r * Math.abs((t.top + v.height - i) / v.height)) : !f && l >= t.bottom - v.height && (h.y = k.Forward, C.y = r * Math.abs((t.bottom - v.height - l) / v.height)), !g && c >= t.right - v.width ? (h.x = k.Forward, C.x = r * Math.abs((t.right - v.width - c) / v.width)) : !d && s <= t.left + v.width && (h.x = k.Backward, C.x = r * Math.abs((t.left + v.width - s) / v.width)), {
1027
+ direction: h,
1028
+ speed: C
1029
+ };
1030
+ }
1031
+ function ur(e) {
1032
+ if (e === document.scrollingElement) {
1033
+ const {
1034
+ innerWidth: i,
1035
+ innerHeight: s
1036
+ } = window;
1037
+ return {
1038
+ top: 0,
1039
+ left: 0,
1040
+ right: i,
1041
+ bottom: s,
1042
+ width: i,
1043
+ height: s
1044
+ };
1045
+ }
1046
+ const {
1047
+ top: t,
1048
+ left: n,
1049
+ right: r,
1050
+ bottom: o
1051
+ } = e.getBoundingClientRect();
1052
+ return {
1053
+ top: t,
1054
+ left: n,
1055
+ right: r,
1056
+ bottom: o,
1057
+ width: e.clientWidth,
1058
+ height: e.clientHeight
1059
+ };
1060
+ }
1061
+ function dn(e) {
1062
+ return e.reduce((t, n) => De(t, wt(n)), H);
1063
+ }
1064
+ function dr(e) {
1065
+ return e.reduce((t, n) => t + an(n), 0);
1066
+ }
1067
+ function fr(e) {
1068
+ return e.reduce((t, n) => t + cn(n), 0);
1069
+ }
1070
+ function hr(e, t) {
1071
+ if (t === void 0 && (t = Re), !e)
1072
+ return;
1073
+ const {
1074
+ top: n,
1075
+ left: r,
1076
+ bottom: o,
1077
+ right: i
1078
+ } = t(e);
1079
+ sn(e) && (o <= 0 || i <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
1080
+ block: "center",
1081
+ inline: "center"
1082
+ });
1083
+ }
1084
+ const gr = [["x", ["left", "right"], dr], ["y", ["top", "bottom"], fr]];
1085
+ class Mt {
1086
+ constructor(t, n) {
1087
+ 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;
1088
+ const r = ct(n), o = dn(r);
1089
+ this.rect = {
1090
+ ...t
1091
+ }, this.width = t.width, this.height = t.height;
1092
+ for (const [i, s, c] of gr)
1093
+ for (const l of s)
1094
+ Object.defineProperty(this, l, {
1095
+ get: () => {
1096
+ const u = c(r), f = o[i] - u;
1097
+ return this.rect[l] + f;
1098
+ },
1099
+ enumerable: !0
1100
+ });
1101
+ Object.defineProperty(this, "rect", {
1102
+ enumerable: !1
1103
+ });
1104
+ }
1105
+ }
1106
+ class Pe {
1107
+ constructor(t) {
1108
+ this.target = void 0, this.listeners = [], this.removeAll = () => {
1109
+ this.listeners.forEach((n) => {
1110
+ var r;
1111
+ return (r = this.target) == null ? void 0 : r.removeEventListener(...n);
1112
+ });
1113
+ }, this.target = t;
1114
+ }
1115
+ add(t, n, r) {
1116
+ var o;
1117
+ (o = this.target) == null || o.addEventListener(t, n, r), this.listeners.push([t, n, r]);
1118
+ }
1119
+ }
1120
+ function vr(e) {
1121
+ const {
1122
+ EventTarget: t
1123
+ } = B(e);
1124
+ return e instanceof t ? e : Se(e);
1125
+ }
1126
+ function pt(e, t) {
1127
+ const n = Math.abs(e.x), r = Math.abs(e.y);
1128
+ 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;
1129
+ }
1130
+ var U;
1131
+ (function(e) {
1132
+ e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
1133
+ })(U || (U = {}));
1134
+ function $t(e) {
1135
+ e.preventDefault();
1136
+ }
1137
+ function pr(e) {
1138
+ e.stopPropagation();
1139
+ }
1140
+ var y;
1141
+ (function(e) {
1142
+ e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter", e.Tab = "Tab";
1143
+ })(y || (y = {}));
1144
+ const fn = {
1145
+ start: [y.Space, y.Enter],
1146
+ cancel: [y.Esc],
1147
+ end: [y.Space, y.Enter, y.Tab]
1148
+ }, br = (e, t) => {
1149
+ let {
1150
+ currentCoordinates: n
1151
+ } = t;
1152
+ switch (e.code) {
1153
+ case y.Right:
1154
+ return {
1155
+ ...n,
1156
+ x: n.x + 25
1157
+ };
1158
+ case y.Left:
1159
+ return {
1160
+ ...n,
1161
+ x: n.x - 25
1162
+ };
1163
+ case y.Down:
1164
+ return {
1165
+ ...n,
1166
+ y: n.y + 25
1167
+ };
1168
+ case y.Up:
1169
+ return {
1170
+ ...n,
1171
+ y: n.y - 25
1172
+ };
1173
+ }
1174
+ };
1175
+ class hn {
1176
+ constructor(t) {
1177
+ this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = t;
1178
+ const {
1179
+ event: {
1180
+ target: n
1181
+ }
1182
+ } = t;
1183
+ this.props = t, this.listeners = new Pe(Se(n)), this.windowListeners = new Pe(B(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
1184
+ }
1185
+ attach() {
1186
+ this.handleStart(), this.windowListeners.add(U.Resize, this.handleCancel), this.windowListeners.add(U.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(U.Keydown, this.handleKeyDown));
1187
+ }
1188
+ handleStart() {
1189
+ const {
1190
+ activeNode: t,
1191
+ onStart: n
1192
+ } = this.props, r = t.node.current;
1193
+ r && hr(r), n(H);
1194
+ }
1195
+ handleKeyDown(t) {
1196
+ if (Et(t)) {
1197
+ const {
1198
+ active: n,
1199
+ context: r,
1200
+ options: o
1201
+ } = this.props, {
1202
+ keyboardCodes: i = fn,
1203
+ coordinateGetter: s = br,
1204
+ scrollBehavior: c = "smooth"
1205
+ } = o, {
1206
+ code: l
1207
+ } = t;
1208
+ if (i.end.includes(l)) {
1209
+ this.handleEnd(t);
1210
+ return;
1211
+ }
1212
+ if (i.cancel.includes(l)) {
1213
+ this.handleCancel(t);
1214
+ return;
1215
+ }
1216
+ const {
1217
+ collisionRect: u
1218
+ } = r.current, f = u ? {
1219
+ x: u.left,
1220
+ y: u.top
1221
+ } : H;
1222
+ this.referenceCoordinates || (this.referenceCoordinates = f);
1223
+ const d = s(t, {
1224
+ active: n,
1225
+ context: r.current,
1226
+ currentCoordinates: f
1227
+ });
1228
+ if (d) {
1229
+ const g = qe(d, f), h = {
1230
+ x: 0,
1231
+ y: 0
1232
+ }, {
1233
+ scrollableAncestors: C
1234
+ } = r.current;
1235
+ for (const v of C) {
1236
+ const p = t.code, {
1237
+ isTop: m,
1238
+ isRight: w,
1239
+ isLeft: b,
1240
+ isBottom: S,
1241
+ maxScroll: R,
1242
+ minScroll: E
1243
+ } = un(v), x = ur(v), D = {
1244
+ x: Math.min(p === y.Right ? x.right - x.width / 2 : x.right, Math.max(p === y.Right ? x.left : x.left + x.width / 2, d.x)),
1245
+ y: Math.min(p === y.Down ? x.bottom - x.height / 2 : x.bottom, Math.max(p === y.Down ? x.top : x.top + x.height / 2, d.y))
1246
+ }, I = p === y.Right && !w || p === y.Left && !b, O = p === y.Down && !S || p === y.Up && !m;
1247
+ if (I && D.x !== d.x) {
1248
+ const A = v.scrollLeft + g.x, Q = p === y.Right && A <= R.x || p === y.Left && A >= E.x;
1249
+ if (Q && !g.y) {
1250
+ v.scrollTo({
1251
+ left: A,
1252
+ behavior: c
1253
+ });
1254
+ return;
1255
+ }
1256
+ Q ? h.x = v.scrollLeft - A : h.x = p === y.Right ? v.scrollLeft - R.x : v.scrollLeft - E.x, h.x && v.scrollBy({
1257
+ left: -h.x,
1258
+ behavior: c
1259
+ });
1260
+ break;
1261
+ } else if (O && D.y !== d.y) {
1262
+ const A = v.scrollTop + g.y, Q = p === y.Down && A <= R.y || p === y.Up && A >= E.y;
1263
+ if (Q && !g.x) {
1264
+ v.scrollTo({
1265
+ top: A,
1266
+ behavior: c
1267
+ });
1268
+ return;
1269
+ }
1270
+ Q ? h.y = v.scrollTop - A : h.y = p === y.Down ? v.scrollTop - R.y : v.scrollTop - E.y, h.y && v.scrollBy({
1271
+ top: -h.y,
1272
+ behavior: c
1273
+ });
1274
+ break;
1275
+ }
1276
+ }
1277
+ this.handleMove(t, De(qe(d, this.referenceCoordinates), h));
1278
+ }
1279
+ }
1280
+ }
1281
+ handleMove(t, n) {
1282
+ const {
1283
+ onMove: r
1284
+ } = this.props;
1285
+ t.preventDefault(), r(n);
1286
+ }
1287
+ handleEnd(t) {
1288
+ const {
1289
+ onEnd: n
1290
+ } = this.props;
1291
+ t.preventDefault(), this.detach(), n();
1292
+ }
1293
+ handleCancel(t) {
1294
+ const {
1295
+ onCancel: n
1296
+ } = this.props;
1297
+ t.preventDefault(), this.detach(), n();
1298
+ }
1299
+ detach() {
1300
+ this.listeners.removeAll(), this.windowListeners.removeAll();
1301
+ }
1302
+ }
1303
+ hn.activators = [{
1304
+ eventName: "onKeyDown",
1305
+ handler: (e, t, n) => {
1306
+ let {
1307
+ keyboardCodes: r = fn,
1308
+ onActivation: o
1309
+ } = t, {
1310
+ active: i
1311
+ } = n;
1312
+ const {
1313
+ code: s
1314
+ } = e.nativeEvent;
1315
+ if (r.start.includes(s)) {
1316
+ const c = i.activatorNode.current;
1317
+ return c && e.target !== c ? !1 : (e.preventDefault(), o?.({
1318
+ event: e.nativeEvent
1319
+ }), !0);
1320
+ }
1321
+ return !1;
1322
+ }
1323
+ }];
1324
+ function Kt(e) {
1325
+ return !!(e && "distance" in e);
1326
+ }
1327
+ function Xt(e) {
1328
+ return !!(e && "delay" in e);
1329
+ }
1330
+ class At {
1331
+ constructor(t, n, r) {
1332
+ var o;
1333
+ r === void 0 && (r = vr(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;
1334
+ const {
1335
+ event: i
1336
+ } = t, {
1337
+ target: s
1338
+ } = i;
1339
+ this.props = t, this.events = n, this.document = Se(s), this.documentListeners = new Pe(this.document), this.listeners = new Pe(r), this.windowListeners = new Pe(B(s)), this.initialCoordinates = (o = mt(i)) != null ? o : H, 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();
1340
+ }
1341
+ attach() {
1342
+ const {
1343
+ events: t,
1344
+ props: {
1345
+ options: {
1346
+ activationConstraint: n,
1347
+ bypassActivationConstraint: r
1348
+ }
1349
+ }
1350
+ } = this;
1351
+ if (this.listeners.add(t.move.name, this.handleMove, {
1352
+ passive: !1
1353
+ }), this.listeners.add(t.end.name, this.handleEnd), t.cancel && this.listeners.add(t.cancel.name, this.handleCancel), this.windowListeners.add(U.Resize, this.handleCancel), this.windowListeners.add(U.DragStart, $t), this.windowListeners.add(U.VisibilityChange, this.handleCancel), this.windowListeners.add(U.ContextMenu, $t), this.documentListeners.add(U.Keydown, this.handleKeydown), n) {
1354
+ if (r != null && r({
1355
+ event: this.props.event,
1356
+ activeNode: this.props.activeNode,
1357
+ options: this.props.options
1358
+ }))
1359
+ return this.handleStart();
1360
+ if (Xt(n)) {
1361
+ this.timeoutId = setTimeout(this.handleStart, n.delay), this.handlePending(n);
1362
+ return;
1363
+ }
1364
+ if (Kt(n)) {
1365
+ this.handlePending(n);
1366
+ return;
1367
+ }
1368
+ }
1369
+ this.handleStart();
1370
+ }
1371
+ detach() {
1372
+ this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), this.timeoutId !== null && (clearTimeout(this.timeoutId), this.timeoutId = null);
1373
+ }
1374
+ handlePending(t, n) {
1375
+ const {
1376
+ active: r,
1377
+ onPending: o
1378
+ } = this.props;
1379
+ o(r, t, this.initialCoordinates, n);
1380
+ }
1381
+ handleStart() {
1382
+ const {
1383
+ initialCoordinates: t
1384
+ } = this, {
1385
+ onStart: n
1386
+ } = this.props;
1387
+ t && (this.activated = !0, this.documentListeners.add(U.Click, pr, {
1388
+ capture: !0
1389
+ }), this.removeTextSelection(), this.documentListeners.add(U.SelectionChange, this.removeTextSelection), n(t));
1390
+ }
1391
+ handleMove(t) {
1392
+ var n;
1393
+ const {
1394
+ activated: r,
1395
+ initialCoordinates: o,
1396
+ props: i
1397
+ } = this, {
1398
+ onMove: s,
1399
+ options: {
1400
+ activationConstraint: c
1401
+ }
1402
+ } = i;
1403
+ if (!o)
1404
+ return;
1405
+ const l = (n = mt(t)) != null ? n : H, u = qe(o, l);
1406
+ if (!r && c) {
1407
+ if (Kt(c)) {
1408
+ if (c.tolerance != null && pt(u, c.tolerance))
1409
+ return this.handleCancel();
1410
+ if (pt(u, c.distance))
1411
+ return this.handleStart();
1412
+ }
1413
+ if (Xt(c) && pt(u, c.tolerance))
1414
+ return this.handleCancel();
1415
+ this.handlePending(c, u);
1416
+ return;
1417
+ }
1418
+ t.cancelable && t.preventDefault(), s(l);
1419
+ }
1420
+ handleEnd() {
1421
+ const {
1422
+ onAbort: t,
1423
+ onEnd: n
1424
+ } = this.props;
1425
+ this.detach(), this.activated || t(this.props.active), n();
1426
+ }
1427
+ handleCancel() {
1428
+ const {
1429
+ onAbort: t,
1430
+ onCancel: n
1431
+ } = this.props;
1432
+ this.detach(), this.activated || t(this.props.active), n();
1433
+ }
1434
+ handleKeydown(t) {
1435
+ t.code === y.Esc && this.handleCancel();
1436
+ }
1437
+ removeTextSelection() {
1438
+ var t;
1439
+ (t = this.document.getSelection()) == null || t.removeAllRanges();
1440
+ }
1441
+ }
1442
+ const yr = {
1443
+ cancel: {
1444
+ name: "pointercancel"
1445
+ },
1446
+ move: {
1447
+ name: "pointermove"
1448
+ },
1449
+ end: {
1450
+ name: "pointerup"
1451
+ }
1452
+ };
1453
+ class gn extends At {
1454
+ constructor(t) {
1455
+ const {
1456
+ event: n
1457
+ } = t, r = Se(n.target);
1458
+ super(t, yr, r);
1459
+ }
1460
+ }
1461
+ gn.activators = [{
1462
+ eventName: "onPointerDown",
1463
+ handler: (e, t) => {
1464
+ let {
1465
+ nativeEvent: n
1466
+ } = e, {
1467
+ onActivation: r
1468
+ } = t;
1469
+ return !n.isPrimary || n.button !== 0 ? !1 : (r?.({
1470
+ event: n
1471
+ }), !0);
1472
+ }
1473
+ }];
1474
+ const mr = {
1475
+ move: {
1476
+ name: "mousemove"
1477
+ },
1478
+ end: {
1479
+ name: "mouseup"
1480
+ }
1481
+ };
1482
+ var xt;
1483
+ (function(e) {
1484
+ e[e.RightClick = 2] = "RightClick";
1485
+ })(xt || (xt = {}));
1486
+ class wr extends At {
1487
+ constructor(t) {
1488
+ super(t, mr, Se(t.event.target));
1489
+ }
1490
+ }
1491
+ wr.activators = [{
1492
+ eventName: "onMouseDown",
1493
+ handler: (e, t) => {
1494
+ let {
1495
+ nativeEvent: n
1496
+ } = e, {
1497
+ onActivation: r
1498
+ } = t;
1499
+ return n.button === xt.RightClick ? !1 : (r?.({
1500
+ event: n
1501
+ }), !0);
1502
+ }
1503
+ }];
1504
+ const bt = {
1505
+ cancel: {
1506
+ name: "touchcancel"
1507
+ },
1508
+ move: {
1509
+ name: "touchmove"
1510
+ },
1511
+ end: {
1512
+ name: "touchend"
1513
+ }
1514
+ };
1515
+ class xr extends At {
1516
+ constructor(t) {
1517
+ super(t, bt);
1518
+ }
1519
+ static setup() {
1520
+ return window.addEventListener(bt.move.name, t, {
1521
+ capture: !1,
1522
+ passive: !1
1523
+ }), function() {
1524
+ window.removeEventListener(bt.move.name, t);
1525
+ };
1526
+ function t() {
1527
+ }
1528
+ }
1529
+ }
1530
+ xr.activators = [{
1531
+ eventName: "onTouchStart",
1532
+ handler: (e, t) => {
1533
+ let {
1534
+ nativeEvent: n
1535
+ } = e, {
1536
+ onActivation: r
1537
+ } = t;
1538
+ const {
1539
+ touches: o
1540
+ } = n;
1541
+ return o.length > 1 ? !1 : (r?.({
1542
+ event: n
1543
+ }), !0);
1544
+ }
1545
+ }];
1546
+ var Fe;
1547
+ (function(e) {
1548
+ e[e.Pointer = 0] = "Pointer", e[e.DraggableRect = 1] = "DraggableRect";
1549
+ })(Fe || (Fe = {}));
1550
+ var ot;
1551
+ (function(e) {
1552
+ e[e.TreeOrder = 0] = "TreeOrder", e[e.ReversedTreeOrder = 1] = "ReversedTreeOrder";
1553
+ })(ot || (ot = {}));
1554
+ function Dr(e) {
1555
+ let {
1556
+ acceleration: t,
1557
+ activator: n = Fe.Pointer,
1558
+ canScroll: r,
1559
+ draggingRect: o,
1560
+ enabled: i,
1561
+ interval: s = 5,
1562
+ order: c = ot.TreeOrder,
1563
+ pointerCoordinates: l,
1564
+ scrollableAncestors: u,
1565
+ scrollableAncestorRects: f,
1566
+ delta: d,
1567
+ threshold: g
1568
+ } = e;
1569
+ const h = Sr({
1570
+ delta: d,
1571
+ disabled: !i
1572
+ }), [C, v] = Fn(), p = a.useRef({
1573
+ x: 0,
1574
+ y: 0
1575
+ }), m = a.useRef({
1576
+ x: 0,
1577
+ y: 0
1578
+ }), w = a.useMemo(() => {
1579
+ switch (n) {
1580
+ case Fe.Pointer:
1581
+ return l ? {
1582
+ top: l.y,
1583
+ bottom: l.y,
1584
+ left: l.x,
1585
+ right: l.x
1586
+ } : null;
1587
+ case Fe.DraggableRect:
1588
+ return o;
1589
+ }
1590
+ }, [n, o, l]), b = a.useRef(null), S = a.useCallback(() => {
1591
+ const E = b.current;
1592
+ if (!E)
1593
+ return;
1594
+ const x = p.current.x * m.current.x, D = p.current.y * m.current.y;
1595
+ E.scrollBy(x, D);
1596
+ }, []), R = a.useMemo(() => c === ot.TreeOrder ? [...u].reverse() : u, [c, u]);
1597
+ a.useEffect(
1598
+ () => {
1599
+ if (!i || !u.length || !w) {
1600
+ v();
1601
+ return;
1602
+ }
1603
+ for (const E of R) {
1604
+ if (r?.(E) === !1)
1605
+ continue;
1606
+ const x = u.indexOf(E), D = f[x];
1607
+ if (!D)
1608
+ continue;
1609
+ const {
1610
+ direction: I,
1611
+ speed: O
1612
+ } = lr(E, D, w, t, g);
1613
+ for (const A of ["x", "y"])
1614
+ h[A][I[A]] || (O[A] = 0, I[A] = 0);
1615
+ if (O.x > 0 || O.y > 0) {
1616
+ v(), b.current = E, C(S, s), p.current = O, m.current = I;
1617
+ return;
1618
+ }
1619
+ }
1620
+ p.current = {
1621
+ x: 0,
1622
+ y: 0
1623
+ }, m.current = {
1624
+ x: 0,
1625
+ y: 0
1626
+ }, v();
1627
+ },
1628
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1629
+ [
1630
+ t,
1631
+ S,
1632
+ r,
1633
+ v,
1634
+ i,
1635
+ s,
1636
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1637
+ JSON.stringify(w),
1638
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1639
+ JSON.stringify(h),
1640
+ C,
1641
+ u,
1642
+ R,
1643
+ f,
1644
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1645
+ JSON.stringify(g)
1646
+ ]
1647
+ );
1648
+ }
1649
+ const Cr = {
1650
+ x: {
1651
+ [k.Backward]: !1,
1652
+ [k.Forward]: !1
1653
+ },
1654
+ y: {
1655
+ [k.Backward]: !1,
1656
+ [k.Forward]: !1
1657
+ }
1658
+ };
1659
+ function Sr(e) {
1660
+ let {
1661
+ delta: t,
1662
+ disabled: n
1663
+ } = e;
1664
+ const r = yt(t);
1665
+ return Ye((o) => {
1666
+ if (n || !r || !o)
1667
+ return Cr;
1668
+ const i = {
1669
+ x: Math.sign(t.x - r.x),
1670
+ y: Math.sign(t.y - r.y)
1671
+ };
1672
+ return {
1673
+ x: {
1674
+ [k.Backward]: o.x[k.Backward] || i.x === -1,
1675
+ [k.Forward]: o.x[k.Forward] || i.x === 1
1676
+ },
1677
+ y: {
1678
+ [k.Backward]: o.y[k.Backward] || i.y === -1,
1679
+ [k.Forward]: o.y[k.Forward] || i.y === 1
1680
+ }
1681
+ };
1682
+ }, [n, t, r]);
1683
+ }
1684
+ function Rr(e, t) {
1685
+ const n = t != null ? e.get(t) : void 0, r = n ? n.node.current : null;
1686
+ return Ye((o) => {
1687
+ var i;
1688
+ return t == null ? null : (i = r ?? o) != null ? i : null;
1689
+ }, [r, t]);
1690
+ }
1691
+ function Er(e, t) {
1692
+ return a.useMemo(() => e.reduce((n, r) => {
1693
+ const {
1694
+ sensor: o
1695
+ } = r, i = o.activators.map((s) => ({
1696
+ eventName: s.eventName,
1697
+ handler: t(s.handler, r)
1698
+ }));
1699
+ return [...n, ...i];
1700
+ }, []), [e, t]);
1701
+ }
1702
+ var je;
1703
+ (function(e) {
1704
+ e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
1705
+ })(je || (je = {}));
1706
+ var Dt;
1707
+ (function(e) {
1708
+ e.Optimized = "optimized";
1709
+ })(Dt || (Dt = {}));
1710
+ const Yt = /* @__PURE__ */ new Map();
1711
+ function Mr(e, t) {
1712
+ let {
1713
+ dragging: n,
1714
+ dependencies: r,
1715
+ config: o
1716
+ } = t;
1717
+ const [i, s] = a.useState(null), {
1718
+ frequency: c,
1719
+ measure: l,
1720
+ strategy: u
1721
+ } = o, f = a.useRef(e), d = p(), g = Be(d), h = a.useCallback(function(m) {
1722
+ m === void 0 && (m = []), !g.current && s((w) => w === null ? m : w.concat(m.filter((b) => !w.includes(b))));
1723
+ }, [g]), C = a.useRef(null), v = Ye((m) => {
1724
+ if (d && !n)
1725
+ return Yt;
1726
+ if (!m || m === Yt || f.current !== e || i != null) {
1727
+ const w = /* @__PURE__ */ new Map();
1728
+ for (let b of e) {
1729
+ if (!b)
1730
+ continue;
1731
+ if (i && i.length > 0 && !i.includes(b.id) && b.rect.current) {
1732
+ w.set(b.id, b.rect.current);
1733
+ continue;
1734
+ }
1735
+ const S = b.node.current, R = S ? new Mt(l(S), S) : null;
1736
+ b.rect.current = R, R && w.set(b.id, R);
1737
+ }
1738
+ return w;
1739
+ }
1740
+ return m;
1741
+ }, [e, i, n, d, l]);
1742
+ return a.useEffect(() => {
1743
+ f.current = e;
1744
+ }, [e]), a.useEffect(
1745
+ () => {
1746
+ d || h();
1747
+ },
1748
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1749
+ [n, d]
1750
+ ), a.useEffect(
1751
+ () => {
1752
+ i && i.length > 0 && s(null);
1753
+ },
1754
+ //eslint-disable-next-line react-hooks/exhaustive-deps
1755
+ [JSON.stringify(i)]
1756
+ ), a.useEffect(
1757
+ () => {
1758
+ d || typeof c != "number" || C.current !== null || (C.current = setTimeout(() => {
1759
+ h(), C.current = null;
1760
+ }, c));
1761
+ },
1762
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1763
+ [c, d, h, ...r]
1764
+ ), {
1765
+ droppableRects: v,
1766
+ measureDroppableContainers: h,
1767
+ measuringScheduled: i != null
1768
+ };
1769
+ function p() {
1770
+ switch (u) {
1771
+ case je.Always:
1772
+ return !1;
1773
+ case je.BeforeDragging:
1774
+ return n;
1775
+ default:
1776
+ return !n;
1777
+ }
1778
+ }
1779
+ }
1780
+ function vn(e, t) {
1781
+ return Ye((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
1782
+ }
1783
+ function Ar(e, t) {
1784
+ return vn(e, t);
1785
+ }
1786
+ function Ir(e) {
1787
+ let {
1788
+ callback: t,
1789
+ disabled: n
1790
+ } = e;
1791
+ const r = Rt(t), o = a.useMemo(() => {
1792
+ if (n || typeof window > "u" || typeof window.MutationObserver > "u")
1793
+ return;
1794
+ const {
1795
+ MutationObserver: i
1796
+ } = window;
1797
+ return new i(r);
1798
+ }, [r, n]);
1799
+ return a.useEffect(() => () => o?.disconnect(), [o]), o;
1800
+ }
1801
+ function lt(e) {
1802
+ let {
1803
+ callback: t,
1804
+ disabled: n
1805
+ } = e;
1806
+ const r = Rt(t), o = a.useMemo(
1807
+ () => {
1808
+ if (n || typeof window > "u" || typeof window.ResizeObserver > "u")
1809
+ return;
1810
+ const {
1811
+ ResizeObserver: i
1812
+ } = window;
1813
+ return new i(r);
1814
+ },
1815
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1816
+ [n]
1817
+ );
1818
+ return a.useEffect(() => () => o?.disconnect(), [o]), o;
1819
+ }
1820
+ function Tr(e) {
1821
+ return new Mt(Re(e), e);
1822
+ }
1823
+ function Ut(e, t, n) {
1824
+ t === void 0 && (t = Tr);
1825
+ const [r, o] = a.useState(null);
1826
+ function i() {
1827
+ o((l) => {
1828
+ if (!e)
1829
+ return null;
1830
+ if (e.isConnected === !1) {
1831
+ var u;
1832
+ return (u = l ?? n) != null ? u : null;
1833
+ }
1834
+ const f = t(e);
1835
+ return JSON.stringify(l) === JSON.stringify(f) ? l : f;
1836
+ });
1837
+ }
1838
+ const s = Ir({
1839
+ callback(l) {
1840
+ if (e)
1841
+ for (const u of l) {
1842
+ const {
1843
+ type: f,
1844
+ target: d
1845
+ } = u;
1846
+ if (f === "childList" && d instanceof HTMLElement && d.contains(e)) {
1847
+ i();
1848
+ break;
1849
+ }
1850
+ }
1851
+ }
1852
+ }), c = lt({
1853
+ callback: i
1854
+ });
1855
+ return ee(() => {
1856
+ i(), e ? (c?.observe(e), s?.observe(document.body, {
1857
+ childList: !0,
1858
+ subtree: !0
1859
+ })) : (c?.disconnect(), s?.disconnect());
1860
+ }, [e]), r;
1861
+ }
1862
+ function Nr(e) {
1863
+ const t = vn(e);
1864
+ return on(e, t);
1865
+ }
1866
+ const Qt = [];
1867
+ function Or(e) {
1868
+ const t = a.useRef(e), n = Ye((r) => e ? r && r !== Qt && e && t.current && e.parentNode === t.current.parentNode ? r : ct(e) : Qt, [e]);
1869
+ return a.useEffect(() => {
1870
+ t.current = e;
1871
+ }, [e]), n;
1872
+ }
1873
+ function kr(e) {
1874
+ const [t, n] = a.useState(null), r = a.useRef(e), o = a.useCallback((i) => {
1875
+ const s = vt(i.target);
1876
+ s && n((c) => c ? (c.set(s, wt(s)), new Map(c)) : null);
1877
+ }, []);
1878
+ return a.useEffect(() => {
1879
+ const i = r.current;
1880
+ if (e !== i) {
1881
+ s(i);
1882
+ const c = e.map((l) => {
1883
+ const u = vt(l);
1884
+ return u ? (u.addEventListener("scroll", o, {
1885
+ passive: !0
1886
+ }), [u, wt(u)]) : null;
1887
+ }).filter((l) => l != null);
1888
+ n(c.length ? new Map(c) : null), r.current = e;
1889
+ }
1890
+ return () => {
1891
+ s(e), s(i);
1892
+ };
1893
+ function s(c) {
1894
+ c.forEach((l) => {
1895
+ const u = vt(l);
1896
+ u?.removeEventListener("scroll", o);
1897
+ });
1898
+ }
1899
+ }, [o, e]), a.useMemo(() => e.length ? t ? Array.from(t.values()).reduce((i, s) => De(i, s), H) : dn(e) : H, [e, t]);
1900
+ }
1901
+ function Wt(e, t) {
1902
+ t === void 0 && (t = []);
1903
+ const n = a.useRef(null);
1904
+ return a.useEffect(
1905
+ () => {
1906
+ n.current = null;
1907
+ },
1908
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1909
+ t
1910
+ ), a.useEffect(() => {
1911
+ const r = e !== H;
1912
+ r && !n.current && (n.current = e), !r && n.current && (n.current = null);
1913
+ }, [e]), n.current ? qe(e, n.current) : H;
1914
+ }
1915
+ function Lr(e) {
1916
+ a.useEffect(
1917
+ () => {
1918
+ if (!at)
1919
+ return;
1920
+ const t = e.map((n) => {
1921
+ let {
1922
+ sensor: r
1923
+ } = n;
1924
+ return r.setup == null ? void 0 : r.setup();
1925
+ });
1926
+ return () => {
1927
+ for (const n of t)
1928
+ n?.();
1929
+ };
1930
+ },
1931
+ // TO-DO: Sensors length could theoretically change which would not be a valid dependency
1932
+ // eslint-disable-next-line react-hooks/exhaustive-deps
1933
+ e.map((t) => {
1934
+ let {
1935
+ sensor: n
1936
+ } = t;
1937
+ return n;
1938
+ })
1939
+ );
1940
+ }
1941
+ function Pr(e, t) {
1942
+ return a.useMemo(() => e.reduce((n, r) => {
1943
+ let {
1944
+ eventName: o,
1945
+ handler: i
1946
+ } = r;
1947
+ return n[o] = (s) => {
1948
+ i(s, t);
1949
+ }, n;
1950
+ }, {}), [e, t]);
1951
+ }
1952
+ function pn(e) {
1953
+ return a.useMemo(() => e ? ir(e) : null, [e]);
1954
+ }
1955
+ const Ht = [];
1956
+ function Fr(e, t) {
1957
+ t === void 0 && (t = Re);
1958
+ const [n] = e, r = pn(n ? B(n) : null), [o, i] = a.useState(Ht);
1959
+ function s() {
1960
+ i(() => e.length ? e.map((l) => ln(l) ? r : new Mt(t(l), l)) : Ht);
1961
+ }
1962
+ const c = lt({
1963
+ callback: s
1964
+ });
1965
+ return ee(() => {
1966
+ c?.disconnect(), s(), e.forEach((l) => c?.observe(l));
1967
+ }, [e]), o;
1968
+ }
1969
+ function zr(e) {
1970
+ if (!e)
1971
+ return null;
1972
+ if (e.children.length > 1)
1973
+ return e;
1974
+ const t = e.children[0];
1975
+ return Xe(t) ? t : e;
1976
+ }
1977
+ function Br(e) {
1978
+ let {
1979
+ measure: t
1980
+ } = e;
1981
+ const [n, r] = a.useState(null), o = a.useCallback((u) => {
1982
+ for (const {
1983
+ target: f
1984
+ } of u)
1985
+ if (Xe(f)) {
1986
+ r((d) => {
1987
+ const g = t(f);
1988
+ return d ? {
1989
+ ...d,
1990
+ width: g.width,
1991
+ height: g.height
1992
+ } : g;
1993
+ });
1994
+ break;
1995
+ }
1996
+ }, [t]), i = lt({
1997
+ callback: o
1998
+ }), s = a.useCallback((u) => {
1999
+ const f = zr(u);
2000
+ i?.disconnect(), f && i?.observe(f), r(f ? t(f) : null);
2001
+ }, [t, i]), [c, l] = tt(s);
2002
+ return a.useMemo(() => ({
2003
+ nodeRef: c,
2004
+ rect: n,
2005
+ setRef: l
2006
+ }), [n, c, l]);
2007
+ }
2008
+ const qr = [{
2009
+ sensor: gn,
2010
+ options: {}
2011
+ }, {
2012
+ sensor: hn,
2013
+ options: {}
2014
+ }], jr = {
2015
+ current: {}
2016
+ }, et = {
2017
+ draggable: {
2018
+ measure: jt
2019
+ },
2020
+ droppable: {
2021
+ measure: jt,
2022
+ strategy: je.WhileDragging,
2023
+ frequency: Dt.Optimized
2024
+ },
2025
+ dragOverlay: {
2026
+ measure: Re
2027
+ }
2028
+ };
2029
+ class ze extends Map {
2030
+ get(t) {
2031
+ var n;
2032
+ return t != null && (n = super.get(t)) != null ? n : void 0;
2033
+ }
2034
+ toArray() {
2035
+ return Array.from(this.values());
2036
+ }
2037
+ getEnabled() {
2038
+ return this.toArray().filter((t) => {
2039
+ let {
2040
+ disabled: n
2041
+ } = t;
2042
+ return !n;
2043
+ });
2044
+ }
2045
+ getNodeFor(t) {
2046
+ var n, r;
2047
+ return (n = (r = this.get(t)) == null ? void 0 : r.node.current) != null ? n : void 0;
2048
+ }
2049
+ }
2050
+ const $r = {
2051
+ activatorEvent: null,
2052
+ active: null,
2053
+ activeNode: null,
2054
+ activeNodeRect: null,
2055
+ collisions: null,
2056
+ containerNodeRect: null,
2057
+ draggableNodes: /* @__PURE__ */ new Map(),
2058
+ droppableRects: /* @__PURE__ */ new Map(),
2059
+ droppableContainers: /* @__PURE__ */ new ze(),
2060
+ over: null,
2061
+ dragOverlay: {
2062
+ nodeRef: {
2063
+ current: null
2064
+ },
2065
+ rect: null,
2066
+ setRef: rt
2067
+ },
2068
+ scrollableAncestors: [],
2069
+ scrollableAncestorRects: [],
2070
+ measuringConfiguration: et,
2071
+ measureDroppableContainers: rt,
2072
+ windowRect: null,
2073
+ measuringScheduled: !1
2074
+ }, Kr = {
2075
+ activatorEvent: null,
2076
+ activators: [],
2077
+ active: null,
2078
+ activeNodeRect: null,
2079
+ ariaDescribedById: {
2080
+ draggable: ""
2081
+ },
2082
+ dispatch: rt,
2083
+ draggableNodes: /* @__PURE__ */ new Map(),
2084
+ over: null,
2085
+ measureDroppableContainers: rt
2086
+ }, ut = /* @__PURE__ */ a.createContext(Kr), bn = /* @__PURE__ */ a.createContext($r);
2087
+ function Xr() {
2088
+ return {
2089
+ draggable: {
2090
+ active: null,
2091
+ initialCoordinates: {
2092
+ x: 0,
2093
+ y: 0
2094
+ },
2095
+ nodes: /* @__PURE__ */ new Map(),
2096
+ translate: {
2097
+ x: 0,
2098
+ y: 0
2099
+ }
2100
+ },
2101
+ droppable: {
2102
+ containers: new ze()
2103
+ }
2104
+ };
2105
+ }
2106
+ function Yr(e, t) {
2107
+ switch (t.type) {
2108
+ case T.DragStart:
2109
+ return {
2110
+ ...e,
2111
+ draggable: {
2112
+ ...e.draggable,
2113
+ initialCoordinates: t.initialCoordinates,
2114
+ active: t.active
2115
+ }
2116
+ };
2117
+ case T.DragMove:
2118
+ return e.draggable.active == null ? e : {
2119
+ ...e,
2120
+ draggable: {
2121
+ ...e.draggable,
2122
+ translate: {
2123
+ x: t.coordinates.x - e.draggable.initialCoordinates.x,
2124
+ y: t.coordinates.y - e.draggable.initialCoordinates.y
2125
+ }
2126
+ }
2127
+ };
2128
+ case T.DragEnd:
2129
+ case T.DragCancel:
2130
+ return {
2131
+ ...e,
2132
+ draggable: {
2133
+ ...e.draggable,
2134
+ active: null,
2135
+ initialCoordinates: {
2136
+ x: 0,
2137
+ y: 0
2138
+ },
2139
+ translate: {
2140
+ x: 0,
2141
+ y: 0
2142
+ }
2143
+ }
2144
+ };
2145
+ case T.RegisterDroppable: {
2146
+ const {
2147
+ element: n
2148
+ } = t, {
2149
+ id: r
2150
+ } = n, o = new ze(e.droppable.containers);
2151
+ return o.set(r, n), {
2152
+ ...e,
2153
+ droppable: {
2154
+ ...e.droppable,
2155
+ containers: o
2156
+ }
2157
+ };
2158
+ }
2159
+ case T.SetDroppableDisabled: {
2160
+ const {
2161
+ id: n,
2162
+ key: r,
2163
+ disabled: o
2164
+ } = t, i = e.droppable.containers.get(n);
2165
+ if (!i || r !== i.key)
2166
+ return e;
2167
+ const s = new ze(e.droppable.containers);
2168
+ return s.set(n, {
2169
+ ...i,
2170
+ disabled: o
2171
+ }), {
2172
+ ...e,
2173
+ droppable: {
2174
+ ...e.droppable,
2175
+ containers: s
2176
+ }
2177
+ };
2178
+ }
2179
+ case T.UnregisterDroppable: {
2180
+ const {
2181
+ id: n,
2182
+ key: r
2183
+ } = t, o = e.droppable.containers.get(n);
2184
+ if (!o || r !== o.key)
2185
+ return e;
2186
+ const i = new ze(e.droppable.containers);
2187
+ return i.delete(n), {
2188
+ ...e,
2189
+ droppable: {
2190
+ ...e.droppable,
2191
+ containers: i
2192
+ }
2193
+ };
2194
+ }
2195
+ default:
2196
+ return e;
2197
+ }
2198
+ }
2199
+ function Ur(e) {
2200
+ let {
2201
+ disabled: t
2202
+ } = e;
2203
+ const {
2204
+ active: n,
2205
+ activatorEvent: r,
2206
+ draggableNodes: o
2207
+ } = a.useContext(ut), i = yt(r), s = yt(n?.id);
2208
+ return a.useEffect(() => {
2209
+ if (!t && !r && i && s != null) {
2210
+ if (!Et(i) || document.activeElement === i.target)
2211
+ return;
2212
+ const c = o.get(s);
2213
+ if (!c)
2214
+ return;
2215
+ const {
2216
+ activatorNode: l,
2217
+ node: u
2218
+ } = c;
2219
+ if (!l.current && !u.current)
2220
+ return;
2221
+ requestAnimationFrame(() => {
2222
+ for (const f of [l.current, u.current]) {
2223
+ if (!f)
2224
+ continue;
2225
+ const d = qn(f);
2226
+ if (d) {
2227
+ d.focus();
2228
+ break;
2229
+ }
2230
+ }
2231
+ });
2232
+ }
2233
+ }, [r, t, o, s, i]), null;
2234
+ }
2235
+ function Qr(e, t) {
2236
+ let {
2237
+ transform: n,
2238
+ ...r
2239
+ } = t;
2240
+ return e != null && e.length ? e.reduce((o, i) => i({
2241
+ transform: o,
2242
+ ...r
2243
+ }), n) : n;
2244
+ }
2245
+ function Wr(e) {
2246
+ return a.useMemo(
2247
+ () => ({
2248
+ draggable: {
2249
+ ...et.draggable,
2250
+ ...e?.draggable
2251
+ },
2252
+ droppable: {
2253
+ ...et.droppable,
2254
+ ...e?.droppable
2255
+ },
2256
+ dragOverlay: {
2257
+ ...et.dragOverlay,
2258
+ ...e?.dragOverlay
2259
+ }
2260
+ }),
2261
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2262
+ [e?.draggable, e?.droppable, e?.dragOverlay]
2263
+ );
2264
+ }
2265
+ function Hr(e) {
2266
+ let {
2267
+ activeNode: t,
2268
+ measure: n,
2269
+ initialRect: r,
2270
+ config: o = !0
2271
+ } = e;
2272
+ const i = a.useRef(!1), {
2273
+ x: s,
2274
+ y: c
2275
+ } = typeof o == "boolean" ? {
2276
+ x: o,
2277
+ y: o
2278
+ } : o;
2279
+ ee(() => {
2280
+ if (!s && !c || !t) {
2281
+ i.current = !1;
2282
+ return;
2283
+ }
2284
+ if (i.current || !r)
2285
+ return;
2286
+ const u = t?.node.current;
2287
+ if (!u || u.isConnected === !1)
2288
+ return;
2289
+ const f = n(u), d = on(f, r);
2290
+ if (s || (d.x = 0), c || (d.y = 0), i.current = !0, Math.abs(d.x) > 0 || Math.abs(d.y) > 0) {
2291
+ const g = sn(u);
2292
+ g && g.scrollBy({
2293
+ top: d.y,
2294
+ left: d.x
2295
+ });
2296
+ }
2297
+ }, [t, s, c, r, n]);
2298
+ }
2299
+ const yn = /* @__PURE__ */ a.createContext({
2300
+ ...H,
2301
+ scaleX: 1,
2302
+ scaleY: 1
2303
+ });
2304
+ var fe;
2305
+ (function(e) {
2306
+ e[e.Uninitialized = 0] = "Uninitialized", e[e.Initializing = 1] = "Initializing", e[e.Initialized = 2] = "Initialized";
2307
+ })(fe || (fe = {}));
2308
+ const jo = /* @__PURE__ */ a.memo(function(t) {
2309
+ var n, r, o, i;
2310
+ let {
2311
+ id: s,
2312
+ accessibility: c,
2313
+ autoScroll: l = !0,
2314
+ children: u,
2315
+ sensors: f = qr,
2316
+ collisionDetection: d = Jn,
2317
+ measuring: g,
2318
+ modifiers: h,
2319
+ ...C
2320
+ } = t;
2321
+ const v = a.useReducer(Yr, void 0, Xr), [p, m] = v, [w, b] = Un(), [S, R] = a.useState(fe.Uninitialized), E = S === fe.Initialized, {
2322
+ draggable: {
2323
+ active: x,
2324
+ nodes: D,
2325
+ translate: I
2326
+ },
2327
+ droppable: {
2328
+ containers: O
2329
+ }
2330
+ } = p, A = x != null ? D.get(x) : null, Q = a.useRef({
2331
+ initial: null,
2332
+ translated: null
2333
+ }), W = a.useMemo(() => {
2334
+ var P;
2335
+ return x != null ? {
2336
+ id: x,
2337
+ // It's possible for the active node to unmount while dragging
2338
+ data: (P = A?.data) != null ? P : jr,
2339
+ rect: Q
2340
+ } : null;
2341
+ }, [x, A]), V = a.useRef(null), [Ee, Qe] = a.useState(null), [q, We] = a.useState(null), te = Be(C, Object.values(C)), Me = Ue("DndDescribedBy", s), He = a.useMemo(() => O.getEnabled(), [O]), F = Wr(g), {
2342
+ droppableRects: ne,
2343
+ measureDroppableContainers: he,
2344
+ measuringScheduled: Ae
2345
+ } = Mr(He, {
2346
+ dragging: E,
2347
+ dependencies: [I.x, I.y],
2348
+ config: F.droppable
2349
+ }), X = Rr(D, x), _e = a.useMemo(() => q ? mt(q) : null, [q]), se = On(), re = Ar(X, F.draggable.measure);
2350
+ Hr({
2351
+ activeNode: x != null ? D.get(x) : null,
2352
+ config: se.layoutShiftCompensation,
2353
+ initialRect: re,
2354
+ measure: F.draggable.measure
2355
+ });
2356
+ const M = Ut(X, F.draggable.measure, re), Ie = Ut(X ? X.parentElement : null), G = a.useRef({
2357
+ activatorEvent: null,
2358
+ active: null,
2359
+ activeNode: X,
2360
+ collisionRect: null,
2361
+ collisions: null,
2362
+ droppableRects: ne,
2363
+ draggableNodes: D,
2364
+ draggingNode: null,
2365
+ draggingNodeRect: null,
2366
+ droppableContainers: O,
2367
+ over: null,
2368
+ scrollableAncestors: [],
2369
+ scrollAdjustedTranslate: null
2370
+ }), pe = O.getNodeFor((n = G.current.over) == null ? void 0 : n.id), oe = Br({
2371
+ measure: F.dragOverlay.measure
2372
+ }), be = (r = oe.nodeRef.current) != null ? r : X, ye = E ? (o = oe.rect) != null ? o : M : null, It = !!(oe.nodeRef.current && oe.rect), Tt = Nr(It ? null : M), dt = pn(be ? B(be) : null), ae = Or(E ? pe ?? X : null), Ve = Fr(ae), Ge = Qr(h, {
2373
+ transform: {
2374
+ x: I.x - Tt.x,
2375
+ y: I.y - Tt.y,
2376
+ scaleX: 1,
2377
+ scaleY: 1
2378
+ },
2379
+ activatorEvent: q,
2380
+ active: W,
2381
+ activeNodeRect: M,
2382
+ containerNodeRect: Ie,
2383
+ draggingNodeRect: ye,
2384
+ over: G.current.over,
2385
+ overlayNodeRect: oe.rect,
2386
+ scrollableAncestors: ae,
2387
+ scrollableAncestorRects: Ve,
2388
+ windowRect: dt
2389
+ }), Nt = _e ? De(_e, I) : null, Ot = kr(ae), Rn = Wt(Ot), En = Wt(Ot, [M]), me = De(Ge, Rn), we = ye ? tr(ye, Ge) : null, Te = W && we ? d({
2390
+ active: W,
2391
+ collisionRect: we,
2392
+ droppableRects: ne,
2393
+ droppableContainers: He,
2394
+ pointerCoordinates: Nt
2395
+ }) : null, kt = rn(Te, "id"), [ce, Lt] = a.useState(null), Mn = It ? Ge : De(Ge, En), An = Zn(Mn, (i = ce?.rect) != null ? i : null, M), ft = a.useRef(null), Pt = a.useCallback(
2396
+ (P, j) => {
2397
+ let {
2398
+ sensor: $,
2399
+ options: le
2400
+ } = j;
2401
+ if (V.current == null)
2402
+ return;
2403
+ const Y = D.get(V.current);
2404
+ if (!Y)
2405
+ return;
2406
+ const K = P.nativeEvent, J = new $({
2407
+ active: V.current,
2408
+ activeNode: Y,
2409
+ event: K,
2410
+ options: le,
2411
+ // Sensors need to be instantiated with refs for arguments that change over time
2412
+ // otherwise they are frozen in time with the stale arguments
2413
+ context: G,
2414
+ onAbort(L) {
2415
+ if (!D.get(L))
2416
+ return;
2417
+ const {
2418
+ onDragAbort: Z
2419
+ } = te.current, ie = {
2420
+ id: L
2421
+ };
2422
+ Z?.(ie), w({
2423
+ type: "onDragAbort",
2424
+ event: ie
2425
+ });
2426
+ },
2427
+ onPending(L, ue, Z, ie) {
2428
+ if (!D.get(L))
2429
+ return;
2430
+ const {
2431
+ onDragPending: Oe
2432
+ } = te.current, de = {
2433
+ id: L,
2434
+ constraint: ue,
2435
+ initialCoordinates: Z,
2436
+ offset: ie
2437
+ };
2438
+ Oe?.(de), w({
2439
+ type: "onDragPending",
2440
+ event: de
2441
+ });
2442
+ },
2443
+ onStart(L) {
2444
+ const ue = V.current;
2445
+ if (ue == null)
2446
+ return;
2447
+ const Z = D.get(ue);
2448
+ if (!Z)
2449
+ return;
2450
+ const {
2451
+ onDragStart: ie
2452
+ } = te.current, Ne = {
2453
+ activatorEvent: K,
2454
+ active: {
2455
+ id: ue,
2456
+ data: Z.data,
2457
+ rect: Q
2458
+ }
2459
+ };
2460
+ Le.unstable_batchedUpdates(() => {
2461
+ ie?.(Ne), R(fe.Initializing), m({
2462
+ type: T.DragStart,
2463
+ initialCoordinates: L,
2464
+ active: ue
2465
+ }), w({
2466
+ type: "onDragStart",
2467
+ event: Ne
2468
+ }), Qe(ft.current), We(K);
2469
+ });
2470
+ },
2471
+ onMove(L) {
2472
+ m({
2473
+ type: T.DragMove,
2474
+ coordinates: L
2475
+ });
2476
+ },
2477
+ onEnd: xe(T.DragEnd),
2478
+ onCancel: xe(T.DragCancel)
2479
+ });
2480
+ ft.current = J;
2481
+ function xe(L) {
2482
+ return async function() {
2483
+ const {
2484
+ active: Z,
2485
+ collisions: ie,
2486
+ over: Ne,
2487
+ scrollAdjustedTranslate: Oe
2488
+ } = G.current;
2489
+ let de = null;
2490
+ if (Z && Oe) {
2491
+ const {
2492
+ cancelDrop: ke
2493
+ } = te.current;
2494
+ de = {
2495
+ activatorEvent: K,
2496
+ active: Z,
2497
+ collisions: ie,
2498
+ delta: Oe,
2499
+ over: Ne
2500
+ }, L === T.DragEnd && typeof ke == "function" && await Promise.resolve(ke(de)) && (L = T.DragCancel);
2501
+ }
2502
+ V.current = null, Le.unstable_batchedUpdates(() => {
2503
+ m({
2504
+ type: L
2505
+ }), R(fe.Uninitialized), Lt(null), Qe(null), We(null), ft.current = null;
2506
+ const ke = L === T.DragEnd ? "onDragEnd" : "onDragCancel";
2507
+ if (de) {
2508
+ const ht = te.current[ke];
2509
+ ht?.(de), w({
2510
+ type: ke,
2511
+ event: de
2512
+ });
2513
+ }
2514
+ });
2515
+ };
2516
+ }
2517
+ },
2518
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2519
+ [D]
2520
+ ), In = a.useCallback((P, j) => ($, le) => {
2521
+ const Y = $.nativeEvent, K = D.get(le);
2522
+ if (
2523
+ // Another sensor is already instantiating
2524
+ V.current !== null || // No active draggable
2525
+ !K || // Event has already been captured
2526
+ Y.dndKit || Y.defaultPrevented
2527
+ )
2528
+ return;
2529
+ const J = {
2530
+ active: K
2531
+ };
2532
+ P($, j.options, J) === !0 && (Y.dndKit = {
2533
+ capturedBy: j.sensor
2534
+ }, V.current = le, Pt($, j));
2535
+ }, [D, Pt]), Ft = Er(f, In);
2536
+ Lr(f), ee(() => {
2537
+ M && S === fe.Initializing && R(fe.Initialized);
2538
+ }, [M, S]), a.useEffect(
2539
+ () => {
2540
+ const {
2541
+ onDragMove: P
2542
+ } = te.current, {
2543
+ active: j,
2544
+ activatorEvent: $,
2545
+ collisions: le,
2546
+ over: Y
2547
+ } = G.current;
2548
+ if (!j || !$)
2549
+ return;
2550
+ const K = {
2551
+ active: j,
2552
+ activatorEvent: $,
2553
+ collisions: le,
2554
+ delta: {
2555
+ x: me.x,
2556
+ y: me.y
2557
+ },
2558
+ over: Y
2559
+ };
2560
+ Le.unstable_batchedUpdates(() => {
2561
+ P?.(K), w({
2562
+ type: "onDragMove",
2563
+ event: K
2564
+ });
2565
+ });
2566
+ },
2567
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2568
+ [me.x, me.y]
2569
+ ), a.useEffect(
2570
+ () => {
2571
+ const {
2572
+ active: P,
2573
+ activatorEvent: j,
2574
+ collisions: $,
2575
+ droppableContainers: le,
2576
+ scrollAdjustedTranslate: Y
2577
+ } = G.current;
2578
+ if (!P || V.current == null || !j || !Y)
2579
+ return;
2580
+ const {
2581
+ onDragOver: K
2582
+ } = te.current, J = le.get(kt), xe = J && J.rect.current ? {
2583
+ id: J.id,
2584
+ rect: J.rect.current,
2585
+ data: J.data,
2586
+ disabled: J.disabled
2587
+ } : null, L = {
2588
+ active: P,
2589
+ activatorEvent: j,
2590
+ collisions: $,
2591
+ delta: {
2592
+ x: Y.x,
2593
+ y: Y.y
2594
+ },
2595
+ over: xe
2596
+ };
2597
+ Le.unstable_batchedUpdates(() => {
2598
+ Lt(xe), K?.(L), w({
2599
+ type: "onDragOver",
2600
+ event: L
2601
+ });
2602
+ });
2603
+ },
2604
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2605
+ [kt]
2606
+ ), ee(() => {
2607
+ G.current = {
2608
+ activatorEvent: q,
2609
+ active: W,
2610
+ activeNode: X,
2611
+ collisionRect: we,
2612
+ collisions: Te,
2613
+ droppableRects: ne,
2614
+ draggableNodes: D,
2615
+ draggingNode: be,
2616
+ draggingNodeRect: ye,
2617
+ droppableContainers: O,
2618
+ over: ce,
2619
+ scrollableAncestors: ae,
2620
+ scrollAdjustedTranslate: me
2621
+ }, Q.current = {
2622
+ initial: ye,
2623
+ translated: we
2624
+ };
2625
+ }, [W, X, Te, we, D, be, ye, ne, O, ce, ae, me]), Dr({
2626
+ ...se,
2627
+ delta: I,
2628
+ draggingRect: we,
2629
+ pointerCoordinates: Nt,
2630
+ scrollableAncestors: ae,
2631
+ scrollableAncestorRects: Ve
2632
+ });
2633
+ const Tn = a.useMemo(() => ({
2634
+ active: W,
2635
+ activeNode: X,
2636
+ activeNodeRect: M,
2637
+ activatorEvent: q,
2638
+ collisions: Te,
2639
+ containerNodeRect: Ie,
2640
+ dragOverlay: oe,
2641
+ draggableNodes: D,
2642
+ droppableContainers: O,
2643
+ droppableRects: ne,
2644
+ over: ce,
2645
+ measureDroppableContainers: he,
2646
+ scrollableAncestors: ae,
2647
+ scrollableAncestorRects: Ve,
2648
+ measuringConfiguration: F,
2649
+ measuringScheduled: Ae,
2650
+ windowRect: dt
2651
+ }), [W, X, M, q, Te, Ie, oe, D, O, ne, ce, he, ae, Ve, F, Ae, dt]), Nn = a.useMemo(() => ({
2652
+ activatorEvent: q,
2653
+ activators: Ft,
2654
+ active: W,
2655
+ activeNodeRect: M,
2656
+ ariaDescribedById: {
2657
+ draggable: Me
2658
+ },
2659
+ dispatch: m,
2660
+ draggableNodes: D,
2661
+ over: ce,
2662
+ measureDroppableContainers: he
2663
+ }), [q, Ft, W, M, m, Me, D, ce, he]);
2664
+ return z.createElement(en.Provider, {
2665
+ value: b
2666
+ }, z.createElement(ut.Provider, {
2667
+ value: Nn
2668
+ }, z.createElement(bn.Provider, {
2669
+ value: Tn
2670
+ }, z.createElement(yn.Provider, {
2671
+ value: An
2672
+ }, u)), z.createElement(Ur, {
2673
+ disabled: c?.restoreFocus === !1
2674
+ })), z.createElement(Hn, {
2675
+ ...c,
2676
+ hiddenTextDescribedById: Me
2677
+ }));
2678
+ function On() {
2679
+ const P = Ee?.autoScrollEnabled === !1, j = typeof l == "object" ? l.enabled === !1 : l === !1, $ = E && !P && !j;
2680
+ return typeof l == "object" ? {
2681
+ ...l,
2682
+ enabled: $
2683
+ } : {
2684
+ enabled: $
2685
+ };
2686
+ }
2687
+ }), _r = /* @__PURE__ */ a.createContext(null), _t = "button", Vr = "Draggable";
2688
+ function Gr(e) {
2689
+ let {
2690
+ id: t,
2691
+ data: n,
2692
+ disabled: r = !1,
2693
+ attributes: o
2694
+ } = e;
2695
+ const i = Ue(Vr), {
2696
+ activators: s,
2697
+ activatorEvent: c,
2698
+ active: l,
2699
+ activeNodeRect: u,
2700
+ ariaDescribedById: f,
2701
+ draggableNodes: d,
2702
+ over: g
2703
+ } = a.useContext(ut), {
2704
+ role: h = _t,
2705
+ roleDescription: C = "draggable",
2706
+ tabIndex: v = 0
2707
+ } = o ?? {}, p = l?.id === t, m = a.useContext(p ? yn : _r), [w, b] = tt(), [S, R] = tt(), E = Pr(s, t), x = Be(n);
2708
+ ee(
2709
+ () => (d.set(t, {
2710
+ id: t,
2711
+ key: i,
2712
+ node: w,
2713
+ activatorNode: S,
2714
+ data: x
2715
+ }), () => {
2716
+ const I = d.get(t);
2717
+ I && I.key === i && d.delete(t);
2718
+ }),
2719
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2720
+ [d, t]
2721
+ );
2722
+ const D = a.useMemo(() => ({
2723
+ role: h,
2724
+ tabIndex: v,
2725
+ "aria-disabled": r,
2726
+ "aria-pressed": p && h === _t ? !0 : void 0,
2727
+ "aria-roledescription": C,
2728
+ "aria-describedby": f.draggable
2729
+ }), [r, h, v, p, C, f.draggable]);
2730
+ return {
2731
+ active: l,
2732
+ activatorEvent: c,
2733
+ activeNodeRect: u,
2734
+ attributes: D,
2735
+ isDragging: p,
2736
+ listeners: r ? void 0 : E,
2737
+ node: w,
2738
+ over: g,
2739
+ setNodeRef: b,
2740
+ setActivatorNodeRef: R,
2741
+ transform: m
2742
+ };
2743
+ }
2744
+ function Jr() {
2745
+ return a.useContext(bn);
2746
+ }
2747
+ const Zr = "Droppable", eo = {
2748
+ timeout: 25
2749
+ };
2750
+ function to(e) {
2751
+ let {
2752
+ data: t,
2753
+ disabled: n = !1,
2754
+ id: r,
2755
+ resizeObserverConfig: o
2756
+ } = e;
2757
+ const i = Ue(Zr), {
2758
+ active: s,
2759
+ dispatch: c,
2760
+ over: l,
2761
+ measureDroppableContainers: u
2762
+ } = a.useContext(ut), f = a.useRef({
2763
+ disabled: n
2764
+ }), d = a.useRef(!1), g = a.useRef(null), h = a.useRef(null), {
2765
+ disabled: C,
2766
+ updateMeasurementsFor: v,
2767
+ timeout: p
2768
+ } = {
2769
+ ...eo,
2770
+ ...o
2771
+ }, m = Be(v ?? r), w = a.useCallback(
2772
+ () => {
2773
+ if (!d.current) {
2774
+ d.current = !0;
2775
+ return;
2776
+ }
2777
+ h.current != null && clearTimeout(h.current), h.current = setTimeout(() => {
2778
+ u(Array.isArray(m.current) ? m.current : [m.current]), h.current = null;
2779
+ }, p);
2780
+ },
2781
+ //eslint-disable-next-line react-hooks/exhaustive-deps
2782
+ [p]
2783
+ ), b = lt({
2784
+ callback: w,
2785
+ disabled: C || !s
2786
+ }), S = a.useCallback((D, I) => {
2787
+ b && (I && (b.unobserve(I), d.current = !1), D && b.observe(D));
2788
+ }, [b]), [R, E] = tt(S), x = Be(t);
2789
+ return a.useEffect(() => {
2790
+ !b || !R.current || (b.disconnect(), d.current = !1, b.observe(R.current));
2791
+ }, [R, b]), a.useEffect(
2792
+ () => (c({
2793
+ type: T.RegisterDroppable,
2794
+ element: {
2795
+ id: r,
2796
+ key: i,
2797
+ disabled: n,
2798
+ node: R,
2799
+ rect: g,
2800
+ data: x
2801
+ }
2802
+ }), () => c({
2803
+ type: T.UnregisterDroppable,
2804
+ key: i,
2805
+ id: r
2806
+ })),
2807
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2808
+ [r]
2809
+ ), a.useEffect(() => {
2810
+ n !== f.current.disabled && (c({
2811
+ type: T.SetDroppableDisabled,
2812
+ id: r,
2813
+ key: i,
2814
+ disabled: n
2815
+ }), f.current.disabled = n);
2816
+ }, [r, i, n, c]), {
2817
+ active: s,
2818
+ rect: g,
2819
+ isOver: l?.id === r,
2820
+ node: R,
2821
+ over: l,
2822
+ setNodeRef: E
2823
+ };
2824
+ }
2825
+ function mn(e, t, n) {
2826
+ const r = e.slice();
2827
+ return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
2828
+ }
2829
+ function no(e, t) {
2830
+ return e.reduce((n, r, o) => {
2831
+ const i = t.get(r);
2832
+ return i && (n[o] = i), n;
2833
+ }, Array(e.length));
2834
+ }
2835
+ function Je(e) {
2836
+ return e !== null && e >= 0;
2837
+ }
2838
+ function ro(e, t) {
2839
+ if (e === t)
2840
+ return !0;
2841
+ if (e.length !== t.length)
2842
+ return !1;
2843
+ for (let n = 0; n < e.length; n++)
2844
+ if (e[n] !== t[n])
2845
+ return !1;
2846
+ return !0;
2847
+ }
2848
+ function oo(e) {
2849
+ return typeof e == "boolean" ? {
2850
+ draggable: e,
2851
+ droppable: e
2852
+ } : e;
2853
+ }
2854
+ const wn = (e) => {
2855
+ let {
2856
+ rects: t,
2857
+ activeIndex: n,
2858
+ overIndex: r,
2859
+ index: o
2860
+ } = e;
2861
+ const i = mn(t, r, n), s = t[o], c = i[o];
2862
+ return !c || !s ? null : {
2863
+ x: c.left - s.left,
2864
+ y: c.top - s.top,
2865
+ scaleX: c.width / s.width,
2866
+ scaleY: c.height / s.height
2867
+ };
2868
+ }, Ze = {
2869
+ scaleX: 1,
2870
+ scaleY: 1
2871
+ }, $o = (e) => {
2872
+ var t;
2873
+ let {
2874
+ activeIndex: n,
2875
+ activeNodeRect: r,
2876
+ index: o,
2877
+ rects: i,
2878
+ overIndex: s
2879
+ } = e;
2880
+ const c = (t = i[n]) != null ? t : r;
2881
+ if (!c)
2882
+ return null;
2883
+ if (o === n) {
2884
+ const u = i[s];
2885
+ return u ? {
2886
+ x: 0,
2887
+ y: n < s ? u.top + u.height - (c.top + c.height) : u.top - c.top,
2888
+ ...Ze
2889
+ } : null;
2890
+ }
2891
+ const l = io(i, o, n);
2892
+ return o > n && o <= s ? {
2893
+ x: 0,
2894
+ y: -c.height - l,
2895
+ ...Ze
2896
+ } : o < n && o >= s ? {
2897
+ x: 0,
2898
+ y: c.height + l,
2899
+ ...Ze
2900
+ } : {
2901
+ x: 0,
2902
+ y: 0,
2903
+ ...Ze
2904
+ };
2905
+ };
2906
+ function io(e, t, n) {
2907
+ const r = e[t], o = e[t - 1], i = e[t + 1];
2908
+ 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;
2909
+ }
2910
+ const xn = "Sortable", Dn = /* @__PURE__ */ z.createContext({
2911
+ activeIndex: -1,
2912
+ containerId: xn,
2913
+ disableTransforms: !1,
2914
+ items: [],
2915
+ overIndex: -1,
2916
+ useDragOverlay: !1,
2917
+ sortedRects: [],
2918
+ strategy: wn,
2919
+ disabled: {
2920
+ draggable: !1,
2921
+ droppable: !1
2922
+ }
2923
+ });
2924
+ function Ko(e) {
2925
+ let {
2926
+ children: t,
2927
+ id: n,
2928
+ items: r,
2929
+ strategy: o = wn,
2930
+ disabled: i = !1
2931
+ } = e;
2932
+ const {
2933
+ active: s,
2934
+ dragOverlay: c,
2935
+ droppableRects: l,
2936
+ over: u,
2937
+ measureDroppableContainers: f
2938
+ } = Jr(), d = Ue(xn, n), g = c.rect !== null, h = a.useMemo(() => r.map((E) => typeof E == "object" && "id" in E ? E.id : E), [r]), C = s != null, v = s ? h.indexOf(s.id) : -1, p = u ? h.indexOf(u.id) : -1, m = a.useRef(h), w = !ro(h, m.current), b = p !== -1 && v === -1 || w, S = oo(i);
2939
+ ee(() => {
2940
+ w && C && f(h);
2941
+ }, [w, h, C, f]), a.useEffect(() => {
2942
+ m.current = h;
2943
+ }, [h]);
2944
+ const R = a.useMemo(
2945
+ () => ({
2946
+ activeIndex: v,
2947
+ containerId: d,
2948
+ disabled: S,
2949
+ disableTransforms: b,
2950
+ items: h,
2951
+ overIndex: p,
2952
+ useDragOverlay: g,
2953
+ sortedRects: no(h, l),
2954
+ strategy: o
2955
+ }),
2956
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2957
+ [v, d, S.draggable, S.droppable, b, h, p, l, g, o]
2958
+ );
2959
+ return z.createElement(Dn.Provider, {
2960
+ value: R
2961
+ }, t);
2962
+ }
2963
+ const so = (e) => {
2964
+ let {
2965
+ id: t,
2966
+ items: n,
2967
+ activeIndex: r,
2968
+ overIndex: o
2969
+ } = e;
2970
+ return mn(n, r, o).indexOf(t);
2971
+ }, ao = (e) => {
2972
+ let {
2973
+ containerId: t,
2974
+ isSorting: n,
2975
+ wasDragging: r,
2976
+ index: o,
2977
+ items: i,
2978
+ newIndex: s,
2979
+ previousItems: c,
2980
+ previousContainerId: l,
2981
+ transition: u
2982
+ } = e;
2983
+ return !u || !r || c !== i && o === s ? !1 : n ? !0 : s !== o && t === l;
2984
+ }, co = {
2985
+ duration: 200,
2986
+ easing: "ease"
2987
+ }, Cn = "transform", lo = /* @__PURE__ */ nt.Transition.toString({
2988
+ property: Cn,
2989
+ duration: 0,
2990
+ easing: "linear"
2991
+ }), uo = {
2992
+ roleDescription: "sortable"
2993
+ };
2994
+ function fo(e) {
2995
+ let {
2996
+ disabled: t,
2997
+ index: n,
2998
+ node: r,
2999
+ rect: o
3000
+ } = e;
3001
+ const [i, s] = a.useState(null), c = a.useRef(n);
3002
+ return ee(() => {
3003
+ if (!t && n !== c.current && r.current) {
3004
+ const l = o.current;
3005
+ if (l) {
3006
+ const u = Re(r.current, {
3007
+ ignoreTransform: !0
3008
+ }), f = {
3009
+ x: l.left - u.left,
3010
+ y: l.top - u.top,
3011
+ scaleX: l.width / u.width,
3012
+ scaleY: l.height / u.height
3013
+ };
3014
+ (f.x || f.y) && s(f);
3015
+ }
3016
+ }
3017
+ n !== c.current && (c.current = n);
3018
+ }, [t, n, r, o]), a.useEffect(() => {
3019
+ i && s(null);
3020
+ }, [i]), i;
3021
+ }
3022
+ function Xo(e) {
3023
+ let {
3024
+ animateLayoutChanges: t = ao,
3025
+ attributes: n,
3026
+ disabled: r,
3027
+ data: o,
3028
+ getNewIndex: i = so,
3029
+ id: s,
3030
+ strategy: c,
3031
+ resizeObserverConfig: l,
3032
+ transition: u = co
3033
+ } = e;
3034
+ const {
3035
+ items: f,
3036
+ containerId: d,
3037
+ activeIndex: g,
3038
+ disabled: h,
3039
+ disableTransforms: C,
3040
+ sortedRects: v,
3041
+ overIndex: p,
3042
+ useDragOverlay: m,
3043
+ strategy: w
3044
+ } = a.useContext(Dn), b = ho(r, h), S = f.indexOf(s), R = a.useMemo(() => ({
3045
+ sortable: {
3046
+ containerId: d,
3047
+ index: S,
3048
+ items: f
3049
+ },
3050
+ ...o
3051
+ }), [d, o, S, f]), E = a.useMemo(() => f.slice(f.indexOf(s)), [f, s]), {
3052
+ rect: x,
3053
+ node: D,
3054
+ isOver: I,
3055
+ setNodeRef: O
3056
+ } = to({
3057
+ id: s,
3058
+ data: R,
3059
+ disabled: b.droppable,
3060
+ resizeObserverConfig: {
3061
+ updateMeasurementsFor: E,
3062
+ ...l
3063
+ }
3064
+ }), {
3065
+ active: A,
3066
+ activatorEvent: Q,
3067
+ activeNodeRect: W,
3068
+ attributes: V,
3069
+ setNodeRef: Ee,
3070
+ listeners: Qe,
3071
+ isDragging: q,
3072
+ over: We,
3073
+ setActivatorNodeRef: te,
3074
+ transform: Me
3075
+ } = Gr({
3076
+ id: s,
3077
+ data: R,
3078
+ attributes: {
3079
+ ...uo,
3080
+ ...n
3081
+ },
3082
+ disabled: b.draggable
3083
+ }), He = Pn(O, Ee), F = !!A, ne = F && !C && Je(g) && Je(p), he = !m && q, Ae = he && ne ? Me : null, _e = ne ? Ae ?? (c ?? w)({
3084
+ rects: v,
3085
+ activeNodeRect: W,
3086
+ activeIndex: g,
3087
+ overIndex: p,
3088
+ index: S
3089
+ }) : null, se = Je(g) && Je(p) ? i({
3090
+ id: s,
3091
+ items: f,
3092
+ activeIndex: g,
3093
+ overIndex: p
3094
+ }) : S, re = A?.id, M = a.useRef({
3095
+ activeId: re,
3096
+ items: f,
3097
+ newIndex: se,
3098
+ containerId: d
3099
+ }), Ie = f !== M.current.items, G = t({
3100
+ active: A,
3101
+ containerId: d,
3102
+ isDragging: q,
3103
+ isSorting: F,
3104
+ id: s,
3105
+ index: S,
3106
+ items: f,
3107
+ newIndex: M.current.newIndex,
3108
+ previousItems: M.current.items,
3109
+ previousContainerId: M.current.containerId,
3110
+ transition: u,
3111
+ wasDragging: M.current.activeId != null
3112
+ }), pe = fo({
3113
+ disabled: !G,
3114
+ index: S,
3115
+ node: D,
3116
+ rect: x
3117
+ });
3118
+ return a.useEffect(() => {
3119
+ F && M.current.newIndex !== se && (M.current.newIndex = se), d !== M.current.containerId && (M.current.containerId = d), f !== M.current.items && (M.current.items = f);
3120
+ }, [F, se, d, f]), a.useEffect(() => {
3121
+ if (re === M.current.activeId)
3122
+ return;
3123
+ if (re != null && M.current.activeId == null) {
3124
+ M.current.activeId = re;
3125
+ return;
3126
+ }
3127
+ const be = setTimeout(() => {
3128
+ M.current.activeId = re;
3129
+ }, 50);
3130
+ return () => clearTimeout(be);
3131
+ }, [re]), {
3132
+ active: A,
3133
+ activeIndex: g,
3134
+ attributes: V,
3135
+ data: R,
3136
+ rect: x,
3137
+ index: S,
3138
+ newIndex: se,
3139
+ items: f,
3140
+ isOver: I,
3141
+ isSorting: F,
3142
+ isDragging: q,
3143
+ listeners: Qe,
3144
+ node: D,
3145
+ overIndex: p,
3146
+ over: We,
3147
+ setNodeRef: He,
3148
+ setActivatorNodeRef: te,
3149
+ setDroppableNodeRef: O,
3150
+ setDraggableNodeRef: Ee,
3151
+ transform: pe ?? _e,
3152
+ transition: oe()
3153
+ };
3154
+ function oe() {
3155
+ if (
3156
+ // Temporarily disable transitions for a single frame to set up derived transforms
3157
+ pe || // Or to prevent items jumping to back to their "new" position when items change
3158
+ Ie && M.current.newIndex === S
3159
+ )
3160
+ return lo;
3161
+ if (!(he && !Et(Q) || !u) && (F || G))
3162
+ return nt.Transition.toString({
3163
+ ...u,
3164
+ property: Cn
3165
+ });
3166
+ }
3167
+ }
3168
+ function ho(e, t) {
3169
+ var n, r;
3170
+ return typeof e == "boolean" ? {
3171
+ draggable: e,
3172
+ // Backwards compatibility
3173
+ droppable: !1
3174
+ } : {
3175
+ draggable: (n = e?.draggable) != null ? n : t.draggable,
3176
+ droppable: (r = e?.droppable) != null ? r : t.droppable
3177
+ };
3178
+ }
3179
+ function it(e) {
3180
+ if (!e)
3181
+ return !1;
3182
+ const t = e.data.current;
3183
+ return !!(t && "sortable" in t && typeof t.sortable == "object" && "containerId" in t.sortable && "items" in t.sortable && "index" in t.sortable);
3184
+ }
3185
+ const go = [y.Down, y.Right, y.Up, y.Left], Yo = (e, t) => {
3186
+ let {
3187
+ context: {
3188
+ active: n,
3189
+ collisionRect: r,
3190
+ droppableRects: o,
3191
+ droppableContainers: i,
3192
+ over: s,
3193
+ scrollableAncestors: c
3194
+ }
3195
+ } = t;
3196
+ if (go.includes(e.code)) {
3197
+ if (e.preventDefault(), !n || !r)
3198
+ return;
3199
+ const l = [];
3200
+ i.getEnabled().forEach((d) => {
3201
+ if (!d || d != null && d.disabled)
3202
+ return;
3203
+ const g = o.get(d.id);
3204
+ if (g)
3205
+ switch (e.code) {
3206
+ case y.Down:
3207
+ r.top < g.top && l.push(d);
3208
+ break;
3209
+ case y.Up:
3210
+ r.top > g.top && l.push(d);
3211
+ break;
3212
+ case y.Left:
3213
+ r.left > g.left && l.push(d);
3214
+ break;
3215
+ case y.Right:
3216
+ r.left < g.left && l.push(d);
3217
+ break;
3218
+ }
3219
+ });
3220
+ const u = Vn({
3221
+ collisionRect: r,
3222
+ droppableRects: o,
3223
+ droppableContainers: l
3224
+ });
3225
+ let f = rn(u, "id");
3226
+ if (f === s?.id && u.length > 1 && (f = u[1].id), f != null) {
3227
+ const d = i.get(n.id), g = i.get(f), h = g ? o.get(g.id) : null, C = g?.node.current;
3228
+ if (C && h && d && g) {
3229
+ const p = ct(C).some((E, x) => c[x] !== E), m = Sn(d, g), w = vo(d, g), b = p || !m ? {
3230
+ x: 0,
3231
+ y: 0
3232
+ } : {
3233
+ x: w ? r.width - h.width : 0,
3234
+ y: w ? r.height - h.height : 0
3235
+ }, S = {
3236
+ x: h.left,
3237
+ y: h.top
3238
+ };
3239
+ return b.x && b.y ? S : qe(S, b);
3240
+ }
3241
+ }
3242
+ }
3243
+ };
3244
+ function Sn(e, t) {
3245
+ return !it(e) || !it(t) ? !1 : e.data.current.sortable.containerId === t.data.current.sortable.containerId;
3246
+ }
3247
+ function vo(e, t) {
3248
+ return !it(e) || !it(t) || !Sn(e, t) ? !1 : e.data.current.sortable.index < t.data.current.sortable.index;
3249
+ }
3250
+ export {
3251
+ wo as C,
3252
+ jo as D,
3253
+ yo as G,
3254
+ hn as K,
3255
+ mo as L,
3256
+ Ro as M,
3257
+ gn as P,
3258
+ Ko as S,
3259
+ So as a,
3260
+ nt as b,
3261
+ Bo as c,
3262
+ zo as d,
3263
+ qo as e,
3264
+ mn as f,
3265
+ N as g,
3266
+ xo as h,
3267
+ Do as i,
3268
+ Co as j,
3269
+ Ao as k,
3270
+ Io as l,
3271
+ To as m,
3272
+ No as n,
3273
+ Oo as o,
3274
+ ko as p,
3275
+ Lo as q,
3276
+ Po as r,
3277
+ Yo as s,
3278
+ Eo as t,
3279
+ Xo as u,
3280
+ $o as v,
3281
+ Fo as w,
3282
+ Mo as x
3283
+ };