@devalok/shilp-sutra-karm 0.20.2 → 0.21.0

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