@boxcustodia/library 0.2.3 → 0.2.4

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 (248) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.es101.js +2 -2
  3. package/dist/index.es104.js +9 -4
  4. package/dist/index.es105.js +4 -14
  5. package/dist/index.es106.js +14 -5
  6. package/dist/index.es107.js +4 -56
  7. package/dist/index.es108.js +55 -222
  8. package/dist/index.es109.js +224 -11
  9. package/dist/index.es110.js +4 -4
  10. package/dist/index.es111.js +11 -41
  11. package/dist/index.es112.js +41 -11
  12. package/dist/index.es113.js +21 -33
  13. package/dist/index.es114.js +12 -21
  14. package/dist/index.es115.js +4 -5
  15. package/dist/index.es116.js +4 -3
  16. package/dist/index.es117.js +4 -5
  17. package/dist/index.es118.js +14 -14
  18. package/dist/index.es119.js +813 -55
  19. package/dist/index.es120.js +9 -822
  20. package/dist/index.es121.js +5 -3
  21. package/dist/index.es122.js +4 -11
  22. package/dist/index.es123.js +64 -4
  23. package/dist/index.es124.js +33 -13
  24. package/dist/index.es125.js +13 -33
  25. package/dist/index.es126.js +216 -13
  26. package/dist/index.es127.js +13 -8
  27. package/dist/index.es128.js +7 -215
  28. package/dist/index.es130.js +1 -1
  29. package/dist/index.es131.js +1 -1
  30. package/dist/index.es132.js +12 -9
  31. package/dist/index.es133.js +196 -204
  32. package/dist/index.es134.js +41 -10
  33. package/dist/index.es135.js +9 -12
  34. package/dist/index.es136.js +204 -196
  35. package/dist/index.es137.js +10 -41
  36. package/dist/index.es139.js +1 -1
  37. package/dist/index.es140.js +1 -1
  38. package/dist/index.es141.js +12 -6
  39. package/dist/index.es142.js +5 -63
  40. package/dist/index.es143.js +64 -10
  41. package/dist/index.es144.js +10 -124
  42. package/dist/index.es145.js +116 -126
  43. package/dist/index.es146.js +134 -13
  44. package/dist/index.es147.js +14 -33
  45. package/dist/index.es148.js +32 -14
  46. package/dist/index.es149.js +14 -8
  47. package/dist/index.es15.js +1 -1
  48. package/dist/index.es150.js +9 -50
  49. package/dist/index.es151.js +50 -6
  50. package/dist/index.es152.js +6 -2
  51. package/dist/index.es153.js +2 -44
  52. package/dist/index.es154.js +40 -646
  53. package/dist/index.es155.js +648 -11
  54. package/dist/index.es156.js +5 -5
  55. package/dist/index.es157.js +4 -4
  56. package/dist/index.es158.js +45 -3
  57. package/dist/index.es159.js +7 -45
  58. package/dist/index.es160.js +4 -8
  59. package/dist/index.es162.js +1 -1
  60. package/dist/index.es163.js +6 -118
  61. package/dist/index.es164.js +3 -35
  62. package/dist/index.es165.js +2054 -2
  63. package/dist/index.es166.js +118 -2
  64. package/dist/index.es167.js +33 -6
  65. package/dist/index.es168.js +4 -3
  66. package/dist/index.es169.js +2 -2054
  67. package/dist/index.es176.js +1 -1
  68. package/dist/index.es177.js +1 -1
  69. package/dist/index.es178.js +1 -1
  70. package/dist/index.es181.js +2 -2
  71. package/dist/index.es183.js +1 -1
  72. package/dist/index.es203.js +1 -1
  73. package/dist/index.es22.js +2 -2
  74. package/dist/index.es236.js +176 -19
  75. package/dist/index.es237.js +15 -3
  76. package/dist/index.es238.js +3 -32
  77. package/dist/index.es239.js +32 -12
  78. package/dist/index.es240.js +17 -177
  79. package/dist/index.es242.js +5 -5
  80. package/dist/index.es243.js +16 -18
  81. package/dist/index.es246.js +1 -1
  82. package/dist/index.es247.js +1 -1
  83. package/dist/index.es248.js +3 -3
  84. package/dist/index.es27.js +1 -1
  85. package/dist/index.es275.js +12 -12
  86. package/dist/index.es276.js +2 -2
  87. package/dist/index.es277.js +2 -2
  88. package/dist/index.es278.js +8 -8
  89. package/dist/index.es279.js +2 -2
  90. package/dist/index.es28.js +1 -1
  91. package/dist/index.es283.js +16 -15
  92. package/dist/index.es284.js +8 -3
  93. package/dist/index.es285.js +15 -16
  94. package/dist/index.es286.js +3 -8
  95. package/dist/index.es29.js +3 -3
  96. package/dist/index.es30.js +23 -23
  97. package/dist/index.es32.js +2 -2
  98. package/dist/index.es325.js +1 -1
  99. package/dist/index.es33.js +2 -2
  100. package/dist/index.es335.js +3 -3
  101. package/dist/index.es338.js +1 -1
  102. package/dist/index.es339.js +1 -1
  103. package/dist/index.es34.js +46 -35
  104. package/dist/index.es342.js +2 -2
  105. package/dist/index.es343.js +2 -2
  106. package/dist/index.es35.js +2 -2
  107. package/dist/index.es350.js +2 -29
  108. package/dist/index.es351.js +106 -5
  109. package/dist/index.es352.js +76 -2
  110. package/dist/index.es353.js +36 -107
  111. package/dist/index.es354.js +60 -73
  112. package/dist/index.es355.js +28 -30
  113. package/dist/index.es356.js +63 -61
  114. package/dist/index.es357.js +109 -30
  115. package/dist/index.es358.js +87 -59
  116. package/dist/index.es359.js +40 -110
  117. package/dist/index.es360.js +3 -94
  118. package/dist/index.es361.js +3 -43
  119. package/dist/index.es362.js +2 -2
  120. package/dist/index.es363.js +2 -2
  121. package/dist/index.es364.js +2 -2
  122. package/dist/index.es366.js +2 -2
  123. package/dist/index.es367.js +2 -2
  124. package/dist/index.es368.js +2 -2
  125. package/dist/index.es369.js +241 -4
  126. package/dist/index.es370.js +384 -4
  127. package/dist/index.es371.js +132 -204
  128. package/dist/index.es372.js +103 -334
  129. package/dist/index.es373.js +75 -102
  130. package/dist/index.es374.js +4 -153
  131. package/dist/index.es375.js +4 -142
  132. package/dist/index.es376.js +2 -2
  133. package/dist/index.es377.js +2 -2
  134. package/dist/index.es378.js +2 -2
  135. package/dist/index.es379.js +2 -2
  136. package/dist/index.es38.js +1 -1
  137. package/dist/index.es380.js +29 -2
  138. package/dist/index.es381.js +5 -2
  139. package/dist/index.es39.js +1 -1
  140. package/dist/index.es393.js +1 -1
  141. package/dist/index.es394.js +1 -1
  142. package/dist/index.es404.js +68 -2
  143. package/dist/index.es405.js +31 -47
  144. package/dist/index.es406.js +16 -83
  145. package/dist/index.es407.js +140 -13
  146. package/dist/index.es408.js +113 -340
  147. package/dist/index.es409.js +507 -63
  148. package/dist/index.es41.js +1 -1
  149. package/dist/index.es410.js +126 -10
  150. package/dist/index.es411.js +117 -510
  151. package/dist/index.es412.js +64 -116
  152. package/dist/index.es413.js +10 -125
  153. package/dist/index.es414.js +2 -68
  154. package/dist/index.es415.js +47 -31
  155. package/dist/index.es416.js +83 -16
  156. package/dist/index.es417.js +13 -140
  157. package/dist/index.es418.js +340 -113
  158. package/dist/index.es43.js +1 -1
  159. package/dist/index.es439.js +2 -2
  160. package/dist/index.es44.js +4 -4
  161. package/dist/index.es441.js +275 -3
  162. package/dist/index.es442.js +78 -105
  163. package/dist/index.es443.js +166 -2
  164. package/dist/index.es444.js +3 -2
  165. package/dist/index.es445.js +100 -268
  166. package/dist/index.es446.js +2 -80
  167. package/dist/index.es447.js +2 -166
  168. package/dist/index.es45.js +1 -1
  169. package/dist/index.es46.js +5 -5
  170. package/dist/index.es475.js +1 -1
  171. package/dist/index.es476.js +1 -1
  172. package/dist/index.es49.js +2 -2
  173. package/dist/index.es50.js +1 -1
  174. package/dist/index.es51.js +4 -4
  175. package/dist/index.es54.js +1 -1
  176. package/dist/index.es57.js +3 -3
  177. package/dist/index.es59.js +2 -2
  178. package/dist/index.es61.js +1 -1
  179. package/dist/index.es62.js +1 -1
  180. package/dist/index.es63.js +2 -2
  181. package/dist/index.es64.js +1 -1
  182. package/dist/index.es65.js +3 -3
  183. package/dist/index.es66.js +2 -2
  184. package/dist/index.es67.js +2 -2
  185. package/dist/index.es753.js +5 -5
  186. package/dist/index.es754.js +22 -14
  187. package/dist/index.es755.js +82 -59
  188. package/dist/index.es756.js +14 -22
  189. package/dist/index.es757.js +59 -82
  190. package/dist/index.es769.js +2 -8
  191. package/dist/index.es770.js +2 -56
  192. package/dist/index.es771.js +7 -18
  193. package/dist/index.es772.js +56 -2
  194. package/dist/index.es773.js +19 -2
  195. package/dist/index.es780.js +28 -28
  196. package/dist/index.es782.js +5 -5
  197. package/dist/index.es783.js +13 -17
  198. package/dist/index.es785.js +5 -11
  199. package/dist/index.es786.js +28 -28
  200. package/dist/index.es787.js +5 -5
  201. package/dist/index.es788.js +17 -13
  202. package/dist/index.es789.js +11 -5
  203. package/dist/index.es79.js +1 -1
  204. package/dist/index.es790.js +1 -1
  205. package/dist/index.es796.js +1 -1
  206. package/dist/index.es797.js +1 -1
  207. package/dist/index.es798.js +1 -1
  208. package/dist/index.es799.js +1 -1
  209. package/dist/index.es80.js +1 -1
  210. package/dist/index.es801.js +1 -1
  211. package/dist/index.es805.js +8 -10
  212. package/dist/index.es806.js +9 -7
  213. package/dist/index.es807.js +1 -1
  214. package/dist/index.es808.js +10 -8
  215. package/dist/index.es809.js +7 -9
  216. package/dist/index.es810.js +5 -5
  217. package/dist/index.es811.js +2 -2
  218. package/dist/index.es812.js +1 -1
  219. package/dist/index.es814.js +2 -2
  220. package/dist/index.es822.js +1 -1
  221. package/dist/index.es824.js +25 -38
  222. package/dist/index.es825.js +38 -25
  223. package/dist/index.es826.js +15 -64
  224. package/dist/index.es827.js +7 -11
  225. package/dist/index.es828.js +61 -38
  226. package/dist/index.es829.js +7 -54
  227. package/dist/index.es830.js +40 -16
  228. package/dist/index.es831.js +57 -17
  229. package/dist/index.es832.js +20 -7
  230. package/dist/index.es833.js +1 -1
  231. package/dist/index.es84.js +305 -33
  232. package/dist/index.es85.js +12 -46
  233. package/dist/index.es86.js +34 -29
  234. package/dist/index.es87.js +42 -26
  235. package/dist/index.es88.js +27 -304
  236. package/dist/index.es89.js +30 -12
  237. package/dist/index.es90.js +55 -9
  238. package/dist/index.es91.js +52 -52
  239. package/dist/index.es92.js +92 -55
  240. package/dist/index.es93.js +34 -87
  241. package/dist/index.es94.js +23 -36
  242. package/dist/index.es95.js +24 -18
  243. package/dist/index.es96.js +257 -28
  244. package/dist/index.es97.js +5 -5
  245. package/dist/index.es98.js +32 -258
  246. package/dist/index.es99.js +5 -5
  247. package/dist/style.css +8 -8
  248. package/package.json +1 -1
@@ -1,77 +1,521 @@
1
- import { isItem as h, bound as a, isClosed as x, isOpenWithEmptyChildren as m, indexOf as I } from "./index.es257.js";
2
- function w(e, t) {
3
- const o = e.getBoundingClientRect(), r = t.x - Math.round(o.x), d = t.y - Math.round(o.y), l = o.height, c = d < l / 2, p = !c, n = l / 4, i = d > n && d < l - n;
4
- return { x: r, inTopHalf: c, inBottomHalf: p, inMiddle: i, atTop: !i && c, atBottom: !i && p };
5
- }
6
- function M(e, t, o, r) {
7
- return e ? e.isInternal ? r.atTop ? [t, e] : r.inMiddle ? [e, e] : [e, o] : r.inTopHalf ? [t, e] : [e, o] : [t, null];
8
- }
9
- function v(e, t) {
10
- return { parentId: e || null, index: t };
1
+ import { evaluate as D, getSide as F, getSideAxis as V, getOppositePlacement as _, getExpandedPlacements as ee, getOppositeAxisPlacements as te, getAlignmentSides as ne, clamp as $, getAlignment as X, min as W, max as j, getAlignmentAxis as K, getPaddingObject as N, rectToClientRect as I, sides as ie, getOppositeAxis as Q, getAxisLength as U } from "./index.es410.js";
2
+ function q(t, e, d) {
3
+ let {
4
+ reference: s,
5
+ floating: r
6
+ } = t;
7
+ const n = V(e), o = K(e), m = U(o), a = F(e), g = n === "y", u = s.x + s.width / 2 - r.width / 2, l = s.y + s.height / 2 - r.height / 2, f = s[m] / 2 - r[m] / 2;
8
+ let i;
9
+ switch (a) {
10
+ case "top":
11
+ i = {
12
+ x: u,
13
+ y: s.y - r.height
14
+ };
15
+ break;
16
+ case "bottom":
17
+ i = {
18
+ x: u,
19
+ y: s.y + s.height
20
+ };
21
+ break;
22
+ case "right":
23
+ i = {
24
+ x: s.x + s.width,
25
+ y: l
26
+ };
27
+ break;
28
+ case "left":
29
+ i = {
30
+ x: s.x - r.width,
31
+ y: l
32
+ };
33
+ break;
34
+ default:
35
+ i = {
36
+ x: s.x,
37
+ y: s.y
38
+ };
39
+ }
40
+ switch (X(e)) {
41
+ case "start":
42
+ i[o] -= f * (d && g ? -1 : 1);
43
+ break;
44
+ case "end":
45
+ i[o] += f * (d && g ? -1 : 1);
46
+ break;
47
+ }
48
+ return i;
11
49
  }
12
- function s(e, t) {
50
+ const ce = async (t, e, d) => {
51
+ const {
52
+ placement: s = "bottom",
53
+ strategy: r = "absolute",
54
+ middleware: n = [],
55
+ platform: o
56
+ } = d, m = n.filter(Boolean), a = await (o.isRTL == null ? void 0 : o.isRTL(e));
57
+ let g = await o.getElementRects({
58
+ reference: t,
59
+ floating: e,
60
+ strategy: r
61
+ }), {
62
+ x: u,
63
+ y: l
64
+ } = q(g, s, a), f = s, i = {}, c = 0;
65
+ for (let w = 0; w < m.length; w++) {
66
+ const {
67
+ name: x,
68
+ fn: y
69
+ } = m[w], {
70
+ x: v,
71
+ y: p,
72
+ data: A,
73
+ reset: h
74
+ } = await y({
75
+ x: u,
76
+ y: l,
77
+ initialPlacement: s,
78
+ placement: f,
79
+ strategy: r,
80
+ middlewareData: i,
81
+ rects: g,
82
+ platform: o,
83
+ elements: {
84
+ reference: t,
85
+ floating: e
86
+ }
87
+ });
88
+ u = v ?? u, l = p ?? l, i = {
89
+ ...i,
90
+ [x]: {
91
+ ...i[x],
92
+ ...A
93
+ }
94
+ }, h && c <= 50 && (c++, typeof h == "object" && (h.placement && (f = h.placement), h.rects && (g = h.rects === !0 ? await o.getElementRects({
95
+ reference: t,
96
+ floating: e,
97
+ strategy: r
98
+ }) : h.rects), {
99
+ x: u,
100
+ y: l
101
+ } = q(g, f, a)), w = -1);
102
+ }
13
103
  return {
14
- type: "line",
15
- index: e,
16
- level: t
104
+ x: u,
105
+ y: l,
106
+ placement: f,
107
+ strategy: r,
108
+ middlewareData: i
17
109
  };
18
- }
19
- function g(e) {
110
+ };
111
+ async function z(t, e) {
112
+ var d;
113
+ e === void 0 && (e = {});
114
+ const {
115
+ x: s,
116
+ y: r,
117
+ platform: n,
118
+ rects: o,
119
+ elements: m,
120
+ strategy: a
121
+ } = t, {
122
+ boundary: g = "clippingAncestors",
123
+ rootBoundary: u = "viewport",
124
+ elementContext: l = "floating",
125
+ altBoundary: f = !1,
126
+ padding: i = 0
127
+ } = D(e, t), c = N(i), x = m[f ? l === "floating" ? "reference" : "floating" : l], y = I(await n.getClippingRect({
128
+ element: (d = await (n.isElement == null ? void 0 : n.isElement(x))) == null || d ? x : x.contextElement || await (n.getDocumentElement == null ? void 0 : n.getDocumentElement(m.floating)),
129
+ boundary: g,
130
+ rootBoundary: u,
131
+ strategy: a
132
+ })), v = l === "floating" ? {
133
+ x: s,
134
+ y: r,
135
+ width: o.floating.width,
136
+ height: o.floating.height
137
+ } : o.reference, p = await (n.getOffsetParent == null ? void 0 : n.getOffsetParent(m.floating)), A = await (n.isElement == null ? void 0 : n.isElement(p)) ? await (n.getScale == null ? void 0 : n.getScale(p)) || {
138
+ x: 1,
139
+ y: 1
140
+ } : {
141
+ x: 1,
142
+ y: 1
143
+ }, h = I(n.convertOffsetParentRelativeRectToViewportRelativeRect ? await n.convertOffsetParentRelativeRectToViewportRelativeRect({
144
+ elements: m,
145
+ rect: v,
146
+ offsetParent: p,
147
+ strategy: a
148
+ }) : v);
20
149
  return {
21
- type: "highlight",
22
- id: e
150
+ top: (y.top - h.top + c.top) / A.y,
151
+ bottom: (h.bottom - y.bottom + c.bottom) / A.y,
152
+ left: (y.left - h.left + c.left) / A.x,
153
+ right: (h.right - y.right + c.right) / A.x
23
154
  };
24
155
  }
25
- function f(e, t) {
26
- var o;
27
- let r = e;
28
- for (; r.parent && r.level > t; )
29
- r = r.parent;
30
- const d = ((o = r.parent) === null || o === void 0 ? void 0 : o.id) || null, l = I(r) + 1;
31
- return { parentId: d, index: l };
32
- }
33
- function T(e) {
34
- var t;
35
- const o = w(e.element, e.offset), r = e.indent, d = Math.round(Math.max(0, o.x - r) / r), { node: l, nextNode: c, prevNode: p } = e, [n, i] = M(l, p, c, o);
36
- if (l && l.isInternal && o.inMiddle)
37
- return {
38
- drop: v(l.id, null),
39
- cursor: g(l.id)
40
- };
41
- if (!n)
42
- return {
43
- drop: v((t = i == null ? void 0 : i.parent) === null || t === void 0 ? void 0 : t.id, 0),
44
- cursor: s(0, 0)
45
- };
46
- if (h(n)) {
47
- const u = a(d, (i == null ? void 0 : i.level) || 0, n.level);
48
- return {
49
- drop: f(n, u),
50
- cursor: s(n.rowIndex + 1, u)
51
- };
52
- }
53
- if (x(n)) {
54
- const u = a(d, (i == null ? void 0 : i.level) || 0, n.level);
156
+ const ae = (t) => ({
157
+ name: "arrow",
158
+ options: t,
159
+ async fn(e) {
160
+ const {
161
+ x: d,
162
+ y: s,
163
+ placement: r,
164
+ rects: n,
165
+ platform: o,
166
+ elements: m,
167
+ middlewareData: a
168
+ } = e, {
169
+ element: g,
170
+ padding: u = 0
171
+ } = D(t, e) || {};
172
+ if (g == null)
173
+ return {};
174
+ const l = N(u), f = {
175
+ x: d,
176
+ y: s
177
+ }, i = K(r), c = U(i), w = await o.getDimensions(g), x = i === "y", y = x ? "top" : "left", v = x ? "bottom" : "right", p = x ? "clientHeight" : "clientWidth", A = n.reference[c] + n.reference[i] - f[i] - n.floating[c], h = f[i] - n.reference[i], O = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(g));
178
+ let C = O ? O[p] : 0;
179
+ (!C || !await (o.isElement == null ? void 0 : o.isElement(O))) && (C = m.floating[p] || n.floating[c]);
180
+ const M = A / 2 - h / 2, R = C / 2 - w[c] / 2 - 1, P = W(l[y], R), E = W(l[v], R), H = P, Y = C - w[c] - E, b = C / 2 - w[c] / 2 + M, B = $(H, b, Y), k = !a.arrow && X(r) != null && b !== B && n.reference[c] / 2 - (b < H ? P : E) - w[c] / 2 < 0, S = k ? b < H ? b - H : b - Y : 0;
55
181
  return {
56
- drop: f(n, u),
57
- cursor: s(n.rowIndex + 1, u)
58
- };
59
- }
60
- if (m(n)) {
61
- const u = a(d, 0, n.level + 1);
62
- return u > n.level ? {
63
- drop: v(n.id, 0),
64
- cursor: s(n.rowIndex + 1, u)
65
- } : {
66
- drop: f(n, u),
67
- cursor: s(n.rowIndex + 1, u)
182
+ [i]: f[i] + S,
183
+ data: {
184
+ [i]: B,
185
+ centerOffset: b - B - S,
186
+ ...k && {
187
+ alignmentOffset: S
188
+ }
189
+ },
190
+ reset: k
68
191
  };
69
192
  }
193
+ }), le = function(t) {
194
+ return t === void 0 && (t = {}), {
195
+ name: "flip",
196
+ options: t,
197
+ async fn(e) {
198
+ var d, s;
199
+ const {
200
+ placement: r,
201
+ middlewareData: n,
202
+ rects: o,
203
+ initialPlacement: m,
204
+ platform: a,
205
+ elements: g
206
+ } = e, {
207
+ mainAxis: u = !0,
208
+ crossAxis: l = !0,
209
+ fallbackPlacements: f,
210
+ fallbackStrategy: i = "bestFit",
211
+ fallbackAxisSideDirection: c = "none",
212
+ flipAlignment: w = !0,
213
+ ...x
214
+ } = D(t, e);
215
+ if ((d = n.arrow) != null && d.alignmentOffset)
216
+ return {};
217
+ const y = F(r), v = V(m), p = F(m) === m, A = await (a.isRTL == null ? void 0 : a.isRTL(g.floating)), h = f || (p || !w ? [_(m)] : ee(m)), O = c !== "none";
218
+ !f && O && h.push(...te(m, w, c, A));
219
+ const C = [m, ...h], M = await z(e, x), R = [];
220
+ let P = ((s = n.flip) == null ? void 0 : s.overflows) || [];
221
+ if (u && R.push(M[y]), l) {
222
+ const b = ne(r, o, A);
223
+ R.push(M[b[0]], M[b[1]]);
224
+ }
225
+ if (P = [...P, {
226
+ placement: r,
227
+ overflows: R
228
+ }], !R.every((b) => b <= 0)) {
229
+ var E, H;
230
+ const b = (((E = n.flip) == null ? void 0 : E.index) || 0) + 1, B = C[b];
231
+ if (B)
232
+ return {
233
+ data: {
234
+ index: b,
235
+ overflows: P
236
+ },
237
+ reset: {
238
+ placement: B
239
+ }
240
+ };
241
+ let k = (H = P.filter((S) => S.overflows[0] <= 0).sort((S, T) => S.overflows[1] - T.overflows[1])[0]) == null ? void 0 : H.placement;
242
+ if (!k)
243
+ switch (i) {
244
+ case "bestFit": {
245
+ var Y;
246
+ const S = (Y = P.filter((T) => {
247
+ if (O) {
248
+ const L = V(T.placement);
249
+ return L === v || // Create a bias to the `y` side axis due to horizontal
250
+ // reading directions favoring greater width.
251
+ L === "y";
252
+ }
253
+ return !0;
254
+ }).map((T) => [T.placement, T.overflows.filter((L) => L > 0).reduce((L, Z) => L + Z, 0)]).sort((T, L) => T[1] - L[1])[0]) == null ? void 0 : Y[0];
255
+ S && (k = S);
256
+ break;
257
+ }
258
+ case "initialPlacement":
259
+ k = m;
260
+ break;
261
+ }
262
+ if (r !== k)
263
+ return {
264
+ reset: {
265
+ placement: k
266
+ }
267
+ };
268
+ }
269
+ return {};
270
+ }
271
+ };
272
+ };
273
+ function G(t, e) {
70
274
  return {
71
- drop: v(n == null ? void 0 : n.id, 0),
72
- cursor: s(n.rowIndex + 1, n.level + 1)
275
+ top: t.top - e.height,
276
+ right: t.right - e.width,
277
+ bottom: t.bottom - e.height,
278
+ left: t.left - e.width
73
279
  };
74
280
  }
281
+ function J(t) {
282
+ return ie.some((e) => t[e] >= 0);
283
+ }
284
+ const re = function(t) {
285
+ return t === void 0 && (t = {}), {
286
+ name: "hide",
287
+ options: t,
288
+ async fn(e) {
289
+ const {
290
+ rects: d
291
+ } = e, {
292
+ strategy: s = "referenceHidden",
293
+ ...r
294
+ } = D(t, e);
295
+ switch (s) {
296
+ case "referenceHidden": {
297
+ const n = await z(e, {
298
+ ...r,
299
+ elementContext: "reference"
300
+ }), o = G(n, d.reference);
301
+ return {
302
+ data: {
303
+ referenceHiddenOffsets: o,
304
+ referenceHidden: J(o)
305
+ }
306
+ };
307
+ }
308
+ case "escaped": {
309
+ const n = await z(e, {
310
+ ...r,
311
+ altBoundary: !0
312
+ }), o = G(n, d.floating);
313
+ return {
314
+ data: {
315
+ escapedOffsets: o,
316
+ escaped: J(o)
317
+ }
318
+ };
319
+ }
320
+ default:
321
+ return {};
322
+ }
323
+ }
324
+ };
325
+ };
326
+ async function se(t, e) {
327
+ const {
328
+ placement: d,
329
+ platform: s,
330
+ elements: r
331
+ } = t, n = await (s.isRTL == null ? void 0 : s.isRTL(r.floating)), o = F(d), m = X(d), a = V(d) === "y", g = ["left", "top"].includes(o) ? -1 : 1, u = n && a ? -1 : 1, l = D(e, t);
332
+ let {
333
+ mainAxis: f,
334
+ crossAxis: i,
335
+ alignmentAxis: c
336
+ } = typeof l == "number" ? {
337
+ mainAxis: l,
338
+ crossAxis: 0,
339
+ alignmentAxis: null
340
+ } : {
341
+ mainAxis: 0,
342
+ crossAxis: 0,
343
+ alignmentAxis: null,
344
+ ...l
345
+ };
346
+ return m && typeof c == "number" && (i = m === "end" ? c * -1 : c), a ? {
347
+ x: i * u,
348
+ y: f * g
349
+ } : {
350
+ x: f * g,
351
+ y: i * u
352
+ };
353
+ }
354
+ const fe = function(t) {
355
+ return t === void 0 && (t = 0), {
356
+ name: "offset",
357
+ options: t,
358
+ async fn(e) {
359
+ var d, s;
360
+ const {
361
+ x: r,
362
+ y: n,
363
+ placement: o,
364
+ middlewareData: m
365
+ } = e, a = await se(e, t);
366
+ return o === ((d = m.offset) == null ? void 0 : d.placement) && (s = m.arrow) != null && s.alignmentOffset ? {} : {
367
+ x: r + a.x,
368
+ y: n + a.y,
369
+ data: {
370
+ ...a,
371
+ placement: o
372
+ }
373
+ };
374
+ }
375
+ };
376
+ }, me = function(t) {
377
+ return t === void 0 && (t = {}), {
378
+ name: "shift",
379
+ options: t,
380
+ async fn(e) {
381
+ const {
382
+ x: d,
383
+ y: s,
384
+ placement: r
385
+ } = e, {
386
+ mainAxis: n = !0,
387
+ crossAxis: o = !1,
388
+ limiter: m = {
389
+ fn: (x) => {
390
+ let {
391
+ x: y,
392
+ y: v
393
+ } = x;
394
+ return {
395
+ x: y,
396
+ y: v
397
+ };
398
+ }
399
+ },
400
+ ...a
401
+ } = D(t, e), g = {
402
+ x: d,
403
+ y: s
404
+ }, u = await z(e, a), l = V(F(r)), f = Q(l);
405
+ let i = g[f], c = g[l];
406
+ if (n) {
407
+ const x = f === "y" ? "top" : "left", y = f === "y" ? "bottom" : "right", v = i + u[x], p = i - u[y];
408
+ i = $(v, i, p);
409
+ }
410
+ if (o) {
411
+ const x = l === "y" ? "top" : "left", y = l === "y" ? "bottom" : "right", v = c + u[x], p = c - u[y];
412
+ c = $(v, c, p);
413
+ }
414
+ const w = m.fn({
415
+ ...e,
416
+ [f]: i,
417
+ [l]: c
418
+ });
419
+ return {
420
+ ...w,
421
+ data: {
422
+ x: w.x - d,
423
+ y: w.y - s
424
+ }
425
+ };
426
+ }
427
+ };
428
+ }, de = function(t) {
429
+ return t === void 0 && (t = {}), {
430
+ options: t,
431
+ fn(e) {
432
+ const {
433
+ x: d,
434
+ y: s,
435
+ placement: r,
436
+ rects: n,
437
+ middlewareData: o
438
+ } = e, {
439
+ offset: m = 0,
440
+ mainAxis: a = !0,
441
+ crossAxis: g = !0
442
+ } = D(t, e), u = {
443
+ x: d,
444
+ y: s
445
+ }, l = V(r), f = Q(l);
446
+ let i = u[f], c = u[l];
447
+ const w = D(m, e), x = typeof w == "number" ? {
448
+ mainAxis: w,
449
+ crossAxis: 0
450
+ } : {
451
+ mainAxis: 0,
452
+ crossAxis: 0,
453
+ ...w
454
+ };
455
+ if (a) {
456
+ const p = f === "y" ? "height" : "width", A = n.reference[f] - n.floating[p] + x.mainAxis, h = n.reference[f] + n.reference[p] - x.mainAxis;
457
+ i < A ? i = A : i > h && (i = h);
458
+ }
459
+ if (g) {
460
+ var y, v;
461
+ const p = f === "y" ? "width" : "height", A = ["top", "left"].includes(F(r)), h = n.reference[l] - n.floating[p] + (A && ((y = o.offset) == null ? void 0 : y[l]) || 0) + (A ? 0 : x.crossAxis), O = n.reference[l] + n.reference[p] + (A ? 0 : ((v = o.offset) == null ? void 0 : v[l]) || 0) - (A ? x.crossAxis : 0);
462
+ c < h ? c = h : c > O && (c = O);
463
+ }
464
+ return {
465
+ [f]: i,
466
+ [l]: c
467
+ };
468
+ }
469
+ };
470
+ }, ue = function(t) {
471
+ return t === void 0 && (t = {}), {
472
+ name: "size",
473
+ options: t,
474
+ async fn(e) {
475
+ const {
476
+ placement: d,
477
+ rects: s,
478
+ platform: r,
479
+ elements: n
480
+ } = e, {
481
+ apply: o = () => {
482
+ },
483
+ ...m
484
+ } = D(t, e), a = await z(e, m), g = F(d), u = X(d), l = V(d) === "y", {
485
+ width: f,
486
+ height: i
487
+ } = s.floating;
488
+ let c, w;
489
+ g === "top" || g === "bottom" ? (c = g, w = u === (await (r.isRTL == null ? void 0 : r.isRTL(n.floating)) ? "start" : "end") ? "left" : "right") : (w = g, c = u === "end" ? "top" : "bottom");
490
+ const x = i - a.top - a.bottom, y = f - a.left - a.right, v = W(i - a[c], x), p = W(f - a[w], y), A = !e.middlewareData.shift;
491
+ let h = v, O = p;
492
+ if (l ? O = u || A ? W(p, y) : y : h = u || A ? W(v, x) : x, A && !u) {
493
+ const M = j(a.left, 0), R = j(a.right, 0), P = j(a.top, 0), E = j(a.bottom, 0);
494
+ l ? O = f - 2 * (M !== 0 || R !== 0 ? M + R : j(a.left, a.right)) : h = i - 2 * (P !== 0 || E !== 0 ? P + E : j(a.top, a.bottom));
495
+ }
496
+ await o({
497
+ ...e,
498
+ availableWidth: O,
499
+ availableHeight: h
500
+ });
501
+ const C = await r.getDimensions(n.floating);
502
+ return f !== C.width || i !== C.height ? {
503
+ reset: {
504
+ rects: !0
505
+ }
506
+ } : {};
507
+ }
508
+ };
509
+ };
75
510
  export {
76
- T as computeDrop
511
+ ae as arrow,
512
+ ce as computePosition,
513
+ z as detectOverflow,
514
+ le as flip,
515
+ re as hide,
516
+ de as limitShift,
517
+ fe as offset,
518
+ I as rectToClientRect,
519
+ me as shift,
520
+ ue as size
77
521
  };
@@ -1,5 +1,5 @@
1
1
  import { j as f } from "./index.es83.js";
2
- import { useControllableState as m } from "./index.es87.js";
2
+ import { useControllableState as m } from "./index.es89.js";
3
3
  import { forwardRef as d } from "react";
4
4
  import { cn as p } from "./index.es73.js";
5
5
  const c = d(