abrplus-ui-kit 1.0.7 → 1.0.8

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