@weing-dev/ui-kit-primitive 0.5.0 → 0.5.2

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