@konstructio/ui 0.1.2-alpha.5 → 0.1.2-alpha.51

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 (203) hide show
  1. package/dist/{Combination-VYaRRJBZ.js → Combination-BtmnusWq.js} +141 -138
  2. package/dist/DatePicker.css +1 -1
  3. package/dist/Modal-CjC-CIJ8.js +99 -0
  4. package/dist/assets/icons/index.js +7 -0
  5. package/dist/chevron-down-DgT-uSF9.js +5 -0
  6. package/dist/chevron-right-DYvXLeql.js +7 -0
  7. package/dist/chevron-up-DEfvgPCw.js +54 -0
  8. package/dist/chevron-up-DrQr2Fwd.js +5 -0
  9. package/dist/components/Alert/Alert.js +2 -2
  10. package/dist/components/AlertDialog/AlertDialog.js +81 -53
  11. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +3 -2
  12. package/dist/components/AlertDialog/components/index.js +1 -1
  13. package/dist/components/Badge/Badge.js +41 -44
  14. package/dist/components/Badge/Badge.variants.js +52 -13
  15. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  16. package/dist/components/Breadcrumb/Breadcrumb.variants.js +3 -3
  17. package/dist/components/Breadcrumb/components/Item/Item.js +22 -22
  18. package/dist/components/Breadcrumb/components/Item/Item.variants.js +25 -14
  19. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  20. package/dist/components/Button/Button.js +1 -1
  21. package/dist/components/Button/Button.variants.js +108 -98
  22. package/dist/components/Card/Card.variants.js +7 -12
  23. package/dist/components/Checkbox/Checkbox.js +108 -105
  24. package/dist/components/Checkbox/Checkbox.variants.js +34 -7
  25. package/dist/components/Command/Command.js +2 -2
  26. package/dist/components/Command/components/Command.js +1 -1
  27. package/dist/components/Command/components/CommandEmpty.js +1 -1
  28. package/dist/components/Command/components/CommandGroup.js +1 -1
  29. package/dist/components/Command/components/CommandInput.js +2 -2
  30. package/dist/components/Command/components/CommandItem.js +1 -1
  31. package/dist/components/Command/components/CommandList.js +1 -1
  32. package/dist/components/Command/components/CommandSeparator.js +1 -1
  33. package/dist/components/Command/components/DialogContent.js +2 -2
  34. package/dist/components/Command/components/DialogOverlay.js +1 -1
  35. package/dist/components/Counter/Counter.js +210 -0
  36. package/dist/components/Counter/Counter.variants.js +70 -0
  37. package/dist/components/Datepicker/DatePicker.js +1587 -1353
  38. package/dist/components/Divider/Divider.variants.js +1 -1
  39. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  40. package/dist/components/Filter/Filter.js +1 -1
  41. package/dist/components/Filter/Filter.variants.js +8 -7
  42. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +71 -45
  43. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +2 -2
  44. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +76 -43
  45. package/dist/components/Filter/components/ResetButton/ResetButton.js +15 -12
  46. package/dist/components/Filter/events/index.js +3 -3
  47. package/dist/components/ImageUpload/ImageUpload.js +221 -0
  48. package/dist/components/ImageUpload/ImageUpload.variants.js +109 -0
  49. package/dist/components/Input/Input.js +185 -118
  50. package/dist/components/Input/Input.variants.js +24 -19
  51. package/dist/components/Loading/Loading.js +1 -7
  52. package/dist/components/Modal/Modal.js +2 -2
  53. package/dist/components/Modal/components/Body/Body.js +1 -1
  54. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  55. package/dist/components/Modal/components/Header/Header.js +1 -1
  56. package/dist/components/Modal/components/Wrapper/Wrapper.js +4 -4
  57. package/dist/components/Modal/components/index.js +1 -1
  58. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.js +34 -0
  59. package/dist/components/MultiSelectDropdown/MultiSelectDropdown.variants.js +30 -0
  60. package/dist/components/MultiSelectDropdown/components/Item/Item.js +30 -0
  61. package/dist/components/MultiSelectDropdown/components/Item/Item.variants.js +38 -0
  62. package/dist/components/MultiSelectDropdown/components/List/List.js +30 -0
  63. package/dist/components/MultiSelectDropdown/components/List/List.variants.js +25 -0
  64. package/dist/components/MultiSelectDropdown/components/Wrapper/Wrapper.js +119 -0
  65. package/dist/components/MultiSelectDropdown/components/index.js +8 -0
  66. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.context.js +21 -0
  67. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.hook.js +13 -0
  68. package/dist/components/MultiSelectDropdown/contexts/MultiSelectDropdown.provider.js +138 -0
  69. package/dist/components/MultiSelectDropdown/contexts/index.js +6 -0
  70. package/dist/components/MultiSelectDropdown/hooks/useMultiSelectDropdown.js +32 -0
  71. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
  72. package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +46 -0
  73. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +36 -0
  74. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +690 -0
  75. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +60 -0
  76. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
  77. package/dist/components/PhoneNumberInput/components/Wrapper.js +651 -0
  78. package/dist/components/PhoneNumberInput/components/index.js +6 -0
  79. package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
  80. package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
  81. package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
  82. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6144 -0
  83. package/dist/components/PhoneNumberInput/utils/index.js +11 -0
  84. package/dist/components/PieChart/PieChart.js +463 -482
  85. package/dist/components/Radio/Radio.js +47 -44
  86. package/dist/components/Radio/Radio.variants.js +12 -8
  87. package/dist/components/RadioCard/RadioCard.variants.js +1 -6
  88. package/dist/components/RadioGroup/RadioGroup.js +10 -10
  89. package/dist/components/Range/Range.js +1 -1
  90. package/dist/components/Select/Select.js +48 -0
  91. package/dist/components/{Dropdown/Dropdown.variants.js → Select/Select.variants.js} +17 -11
  92. package/dist/components/Select/components/List/List.js +172 -0
  93. package/dist/components/{Dropdown → Select}/components/List/List.variants.js +11 -8
  94. package/dist/components/Select/components/ListItem/ListItem.js +117 -0
  95. package/dist/components/{Dropdown → Select}/components/ListItem/ListItem.variants.js +5 -4
  96. package/dist/components/Select/components/Wrapper.js +226 -0
  97. package/dist/components/Select/constants/index.js +4 -0
  98. package/dist/components/Select/constants/pagination.js +4 -0
  99. package/dist/components/Select/contexts/index.js +6 -0
  100. package/dist/components/Select/contexts/select.context.js +36 -0
  101. package/dist/components/Select/contexts/select.hook.js +11 -0
  102. package/dist/components/Select/contexts/select.provider.js +58 -0
  103. package/dist/components/Select/hooks/useNavigationList.js +50 -0
  104. package/dist/components/Select/hooks/useSelect.js +103 -0
  105. package/dist/components/Sidebar/Sidebar.variants.js +2 -2
  106. package/dist/components/Slider/Slider.js +1 -1
  107. package/dist/components/Switch/Switch.js +156 -129
  108. package/dist/components/Switch/Switch.variants.js +19 -10
  109. package/dist/components/Tabs/Tabs.js +1 -1
  110. package/dist/components/Tabs/Tabs.variants.js +4 -3
  111. package/dist/components/Tabs/components/Content.js +1 -1
  112. package/dist/components/Tabs/components/List.js +1 -1
  113. package/dist/components/Tabs/components/Trigger.js +1 -1
  114. package/dist/components/Tag/Tag.js +1 -1
  115. package/dist/components/Tag/Tag.variants.js +1 -0
  116. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +49 -98
  117. package/dist/components/TimePicker/TimePicker.js +1 -1
  118. package/dist/components/TimePicker/TimePicker.variants.js +26 -14
  119. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +30 -20
  120. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +57 -35
  121. package/dist/components/TimePicker/components/WrapperList/WrapperList.js +53 -45
  122. package/dist/components/Toast/Toast.js +283 -256
  123. package/dist/components/Toast/Toast.variants.js +37 -24
  124. package/dist/components/Tooltip/Tooltip.js +15 -14
  125. package/dist/components/Tooltip/Tooltip.variants.js +5 -4
  126. package/dist/components/Typography/Typography.js +23 -25
  127. package/dist/components/Typography/Typography.variants.js +55 -52
  128. package/dist/components/VirtualizedTable/VirtualizedTable.js +97 -71
  129. package/dist/components/VirtualizedTable/components/Actions/Actions.js +95 -33
  130. package/dist/components/VirtualizedTable/components/Body/Body.js +73 -21
  131. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +94 -91
  132. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +20 -20
  133. package/dist/components/VirtualizedTable/components/Filter/Filter.js +61 -44
  134. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +33 -21
  135. package/dist/components/VirtualizedTable/components/Header/Header.js +61 -41
  136. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +43 -22
  137. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +106 -0
  138. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +22 -1858
  139. package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
  140. package/dist/components/VirtualizedTable/components/index.js +8 -6
  141. package/dist/components/VirtualizedTable/contexts/table.context.js +1 -0
  142. package/dist/components/VirtualizedTable/contexts/table.provider.js +68 -761
  143. package/dist/components/index.js +94 -86
  144. package/dist/contexts/theme.provider.js +0 -1
  145. package/dist/{createLucideIcon-D2CN7Ma9.js → createLucideIcon-D4r5Phnh.js} +0 -24
  146. package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
  147. package/dist/{index-C1g_chDT.js → index-AV6ZtGhy.js} +2 -2
  148. package/dist/index-BG8O18ZY.js +93 -0
  149. package/dist/index-BKjcReYh.js +55 -0
  150. package/dist/{index-N2OStZoU.js → index-BOE_3f_Z.js} +4 -25
  151. package/dist/{index-Cd2vhaop.js → index-BlSRBdPy.js} +5 -6
  152. package/dist/index-BmVmDQGH.js +662 -0
  153. package/dist/index-BvoZGpli.js +60 -0
  154. package/dist/index-Byr10W8m.js +1873 -0
  155. package/dist/{index-Dx2grAuN.js → index-CSWGJT-v.js} +0 -20
  156. package/dist/index-CeZcoQDw.js +479 -0
  157. package/dist/index-D6KzX_ef.js +135 -0
  158. package/dist/{index-B7t8D14s.js → index-D9SSJ6om.js} +4 -4
  159. package/dist/index-DKfEnhKr.js +200 -0
  160. package/dist/index-DLcqcWxM.js +29 -0
  161. package/dist/{index-ti1b9kqV.js → index-DMb4KD0b.js} +4 -4
  162. package/dist/{index-BAEWsOG1.js → index-DtEcCIrM.js} +1 -1
  163. package/dist/{index-bwWKd82e.js → index-Dy59FQl5.js} +1 -1
  164. package/dist/{index-C84F4YyO.js → index-gSPwC-1I.js} +10 -11
  165. package/dist/{index-Bnb0ezr3.js → index-vcSp8YRZ.js} +11 -12
  166. package/dist/index.d.ts +2142 -99
  167. package/dist/index.js +116 -106
  168. package/dist/libphonenumber-FTwQ9nyV.js +11549 -0
  169. package/dist/loader-juvMSJ9L.js +5 -0
  170. package/dist/package.json +43 -33
  171. package/dist/styles.css +1 -1
  172. package/dist/ui/civo-theme.css +194 -168
  173. package/dist/ui/theme.css +27 -0
  174. package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
  175. package/dist/utils/index.js +534 -501
  176. package/dist/x-BXShoIAM.js +8 -0
  177. package/dist/{x-4F_5p77m.js → x-Eoa9FJjA.js} +1 -1
  178. package/package.json +43 -33
  179. package/dist/Modal-D-NOEWMX.js +0 -98
  180. package/dist/chevron-down-MZvQoT2F.js +0 -11
  181. package/dist/chevron-right-VYBOBhRt.js +0 -19
  182. package/dist/components/Dropdown/Dropdown.js +0 -42
  183. package/dist/components/Dropdown/components/List/List.js +0 -79
  184. package/dist/components/Dropdown/components/ListItem/ListItem.js +0 -67
  185. package/dist/components/Dropdown/components/Wrapper.js +0 -205
  186. package/dist/components/Dropdown/contexts/dropdown.context.js +0 -19
  187. package/dist/components/Dropdown/contexts/dropdown.hook.js +0 -13
  188. package/dist/components/Dropdown/contexts/dropdown.provider.js +0 -30
  189. package/dist/components/Dropdown/contexts/index.js +0 -6
  190. package/dist/components/Dropdown/hooks/useDropdown.js +0 -58
  191. package/dist/components/Dropdown/hooks/useNavigationList.js +0 -62
  192. package/dist/components/NumberInput/NumberInput.js +0 -179
  193. package/dist/components/NumberInput/NumberInput.variants.js +0 -50
  194. package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +0 -16
  195. package/dist/index-BITvcJAz.js +0 -423
  196. package/dist/index-BfXxHr_2.js +0 -125
  197. package/dist/index-Cvx4lqTq.js +0 -47
  198. package/dist/index-DBbEcSUG.js +0 -31
  199. package/dist/index-DQH6odE9.js +0 -82
  200. package/dist/index-DzIBBMjs.js +0 -436
  201. package/dist/index-os7vysFS.js +0 -131
  202. /package/dist/components/{Dropdown → Select}/components/EmptyList.js +0 -0
  203. /package/dist/components/{Dropdown → Select}/components/index.js +0 -0
@@ -0,0 +1,1873 @@
1
+ import * as g from "react";
2
+ import { useLayoutEffect as Bt } from "react";
3
+ import { P as le, c as tt, u as ze, a as Vt, b as J } from "./index-DKfEnhKr.js";
4
+ import { u as we } from "./index-DLcqcWxM.js";
5
+ import { D as zt } from "./index-BlSRBdPy.js";
6
+ import { u as jt } from "./index-Dy59FQl5.js";
7
+ import * as Yt from "react-dom";
8
+ import { jsx as T, Fragment as Xt, jsxs as Gt } from "react/jsx-runtime";
9
+ import { u as qt } from "./index-0ioNhtNM.js";
10
+ import { u as Ut } from "./index-DtEcCIrM.js";
11
+ import { P as Kt } from "./index-AV6ZtGhy.js";
12
+ const Zt = ["top", "right", "bottom", "left"], U = Math.min, F = Math.max, pe = Math.round, ue = Math.floor, j = (e) => ({
13
+ x: e,
14
+ y: e
15
+ }), Jt = {
16
+ left: "right",
17
+ right: "left",
18
+ bottom: "top",
19
+ top: "bottom"
20
+ }, Qt = {
21
+ start: "end",
22
+ end: "start"
23
+ };
24
+ function Oe(e, t, n) {
25
+ return F(e, U(t, n));
26
+ }
27
+ function G(e, t) {
28
+ return typeof e == "function" ? e(t) : e;
29
+ }
30
+ function q(e) {
31
+ return e.split("-")[0];
32
+ }
33
+ function ne(e) {
34
+ return e.split("-")[1];
35
+ }
36
+ function Me(e) {
37
+ return e === "x" ? "y" : "x";
38
+ }
39
+ function _e(e) {
40
+ return e === "y" ? "height" : "width";
41
+ }
42
+ const en = /* @__PURE__ */ new Set(["top", "bottom"]);
43
+ function z(e) {
44
+ return en.has(q(e)) ? "y" : "x";
45
+ }
46
+ function ke(e) {
47
+ return Me(z(e));
48
+ }
49
+ function tn(e, t, n) {
50
+ n === void 0 && (n = !1);
51
+ const o = ne(e), r = ke(e), i = _e(r);
52
+ let s = r === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
53
+ return t.reference[i] > t.floating[i] && (s = me(s)), [s, me(s)];
54
+ }
55
+ function nn(e) {
56
+ const t = me(e);
57
+ return [Ee(e), t, Ee(t)];
58
+ }
59
+ function Ee(e) {
60
+ return e.replace(/start|end/g, (t) => Qt[t]);
61
+ }
62
+ const je = ["left", "right"], Ye = ["right", "left"], on = ["top", "bottom"], rn = ["bottom", "top"];
63
+ function sn(e, t, n) {
64
+ switch (e) {
65
+ case "top":
66
+ case "bottom":
67
+ return n ? t ? Ye : je : t ? je : Ye;
68
+ case "left":
69
+ case "right":
70
+ return t ? on : rn;
71
+ default:
72
+ return [];
73
+ }
74
+ }
75
+ function cn(e, t, n, o) {
76
+ const r = ne(e);
77
+ let i = sn(q(e), n === "start", o);
78
+ return r && (i = i.map((s) => s + "-" + r), t && (i = i.concat(i.map(Ee)))), i;
79
+ }
80
+ function me(e) {
81
+ return e.replace(/left|right|bottom|top/g, (t) => Jt[t]);
82
+ }
83
+ function ln(e) {
84
+ return {
85
+ top: 0,
86
+ right: 0,
87
+ bottom: 0,
88
+ left: 0,
89
+ ...e
90
+ };
91
+ }
92
+ function nt(e) {
93
+ return typeof e != "number" ? ln(e) : {
94
+ top: e,
95
+ right: e,
96
+ bottom: e,
97
+ left: e
98
+ };
99
+ }
100
+ function he(e) {
101
+ const {
102
+ x: t,
103
+ y: n,
104
+ width: o,
105
+ height: r
106
+ } = e;
107
+ return {
108
+ width: o,
109
+ height: r,
110
+ top: n,
111
+ left: t,
112
+ right: t + o,
113
+ bottom: n + r,
114
+ x: t,
115
+ y: n
116
+ };
117
+ }
118
+ function Xe(e, t, n) {
119
+ let {
120
+ reference: o,
121
+ floating: r
122
+ } = e;
123
+ const i = z(t), s = ke(t), a = _e(s), c = q(t), f = i === "y", l = o.x + o.width / 2 - r.width / 2, u = o.y + o.height / 2 - r.height / 2, p = o[a] / 2 - r[a] / 2;
124
+ let d;
125
+ switch (c) {
126
+ case "top":
127
+ d = {
128
+ x: l,
129
+ y: o.y - r.height
130
+ };
131
+ break;
132
+ case "bottom":
133
+ d = {
134
+ x: l,
135
+ y: o.y + o.height
136
+ };
137
+ break;
138
+ case "right":
139
+ d = {
140
+ x: o.x + o.width,
141
+ y: u
142
+ };
143
+ break;
144
+ case "left":
145
+ d = {
146
+ x: o.x - r.width,
147
+ y: u
148
+ };
149
+ break;
150
+ default:
151
+ d = {
152
+ x: o.x,
153
+ y: o.y
154
+ };
155
+ }
156
+ switch (ne(t)) {
157
+ case "start":
158
+ d[s] -= p * (n && f ? -1 : 1);
159
+ break;
160
+ case "end":
161
+ d[s] += p * (n && f ? -1 : 1);
162
+ break;
163
+ }
164
+ return d;
165
+ }
166
+ const an = async (e, t, n) => {
167
+ const {
168
+ placement: o = "bottom",
169
+ strategy: r = "absolute",
170
+ middleware: i = [],
171
+ platform: s
172
+ } = n, a = i.filter(Boolean), c = await (s.isRTL == null ? void 0 : s.isRTL(t));
173
+ let f = await s.getElementRects({
174
+ reference: e,
175
+ floating: t,
176
+ strategy: r
177
+ }), {
178
+ x: l,
179
+ y: u
180
+ } = Xe(f, o, c), p = o, d = {}, m = 0;
181
+ for (let h = 0; h < a.length; h++) {
182
+ const {
183
+ name: w,
184
+ fn: y
185
+ } = a[h], {
186
+ x,
187
+ y: C,
188
+ data: v,
189
+ reset: b
190
+ } = await y({
191
+ x: l,
192
+ y: u,
193
+ initialPlacement: o,
194
+ placement: p,
195
+ strategy: r,
196
+ middlewareData: d,
197
+ rects: f,
198
+ platform: s,
199
+ elements: {
200
+ reference: e,
201
+ floating: t
202
+ }
203
+ });
204
+ l = x ?? l, u = C ?? u, d = {
205
+ ...d,
206
+ [w]: {
207
+ ...d[w],
208
+ ...v
209
+ }
210
+ }, b && m <= 50 && (m++, typeof b == "object" && (b.placement && (p = b.placement), b.rects && (f = b.rects === !0 ? await s.getElementRects({
211
+ reference: e,
212
+ floating: t,
213
+ strategy: r
214
+ }) : b.rects), {
215
+ x: l,
216
+ y: u
217
+ } = Xe(f, p, c)), h = -1);
218
+ }
219
+ return {
220
+ x: l,
221
+ y: u,
222
+ placement: p,
223
+ strategy: r,
224
+ middlewareData: d
225
+ };
226
+ };
227
+ async function ie(e, t) {
228
+ var n;
229
+ t === void 0 && (t = {});
230
+ const {
231
+ x: o,
232
+ y: r,
233
+ platform: i,
234
+ rects: s,
235
+ elements: a,
236
+ strategy: c
237
+ } = e, {
238
+ boundary: f = "clippingAncestors",
239
+ rootBoundary: l = "viewport",
240
+ elementContext: u = "floating",
241
+ altBoundary: p = !1,
242
+ padding: d = 0
243
+ } = G(t, e), m = nt(d), w = a[p ? u === "floating" ? "reference" : "floating" : u], y = he(await i.getClippingRect({
244
+ element: (n = await (i.isElement == null ? void 0 : i.isElement(w))) == null || n ? w : w.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(a.floating)),
245
+ boundary: f,
246
+ rootBoundary: l,
247
+ strategy: c
248
+ })), x = u === "floating" ? {
249
+ x: o,
250
+ y: r,
251
+ width: s.floating.width,
252
+ height: s.floating.height
253
+ } : s.reference, C = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a.floating)), v = await (i.isElement == null ? void 0 : i.isElement(C)) ? await (i.getScale == null ? void 0 : i.getScale(C)) || {
254
+ x: 1,
255
+ y: 1
256
+ } : {
257
+ x: 1,
258
+ y: 1
259
+ }, b = he(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
260
+ elements: a,
261
+ rect: x,
262
+ offsetParent: C,
263
+ strategy: c
264
+ }) : x);
265
+ return {
266
+ top: (y.top - b.top + m.top) / v.y,
267
+ bottom: (b.bottom - y.bottom + m.bottom) / v.y,
268
+ left: (y.left - b.left + m.left) / v.x,
269
+ right: (b.right - y.right + m.right) / v.x
270
+ };
271
+ }
272
+ const fn = (e) => ({
273
+ name: "arrow",
274
+ options: e,
275
+ async fn(t) {
276
+ const {
277
+ x: n,
278
+ y: o,
279
+ placement: r,
280
+ rects: i,
281
+ platform: s,
282
+ elements: a,
283
+ middlewareData: c
284
+ } = t, {
285
+ element: f,
286
+ padding: l = 0
287
+ } = G(e, t) || {};
288
+ if (f == null)
289
+ return {};
290
+ const u = nt(l), p = {
291
+ x: n,
292
+ y: o
293
+ }, d = ke(r), m = _e(d), h = await s.getDimensions(f), w = d === "y", y = w ? "top" : "left", x = w ? "bottom" : "right", C = w ? "clientHeight" : "clientWidth", v = i.reference[m] + i.reference[d] - p[d] - i.floating[m], b = p[d] - i.reference[d], P = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(f));
294
+ let R = P ? P[C] : 0;
295
+ (!R || !await (s.isElement == null ? void 0 : s.isElement(P))) && (R = a.floating[C] || i.floating[m]);
296
+ const M = v / 2 - b / 2, H = R / 2 - h[m] / 2 - 1, D = U(u[y], H), k = U(u[x], H), N = D, E = R - h[m] - k, O = R / 2 - h[m] / 2 + M, $ = Oe(N, O, E), S = !c.arrow && ne(r) != null && O !== $ && i.reference[m] / 2 - (O < N ? D : k) - h[m] / 2 < 0, L = S ? O < N ? O - N : O - E : 0;
297
+ return {
298
+ [d]: p[d] + L,
299
+ data: {
300
+ [d]: $,
301
+ centerOffset: O - $ - L,
302
+ ...S && {
303
+ alignmentOffset: L
304
+ }
305
+ },
306
+ reset: S
307
+ };
308
+ }
309
+ }), un = function(e) {
310
+ return e === void 0 && (e = {}), {
311
+ name: "flip",
312
+ options: e,
313
+ async fn(t) {
314
+ var n, o;
315
+ const {
316
+ placement: r,
317
+ middlewareData: i,
318
+ rects: s,
319
+ initialPlacement: a,
320
+ platform: c,
321
+ elements: f
322
+ } = t, {
323
+ mainAxis: l = !0,
324
+ crossAxis: u = !0,
325
+ fallbackPlacements: p,
326
+ fallbackStrategy: d = "bestFit",
327
+ fallbackAxisSideDirection: m = "none",
328
+ flipAlignment: h = !0,
329
+ ...w
330
+ } = G(e, t);
331
+ if ((n = i.arrow) != null && n.alignmentOffset)
332
+ return {};
333
+ const y = q(r), x = z(a), C = q(a) === a, v = await (c.isRTL == null ? void 0 : c.isRTL(f.floating)), b = p || (C || !h ? [me(a)] : nn(a)), P = m !== "none";
334
+ !p && P && b.push(...cn(a, h, m, v));
335
+ const R = [a, ...b], M = await ie(t, w), H = [];
336
+ let D = ((o = i.flip) == null ? void 0 : o.overflows) || [];
337
+ if (l && H.push(M[y]), u) {
338
+ const O = tn(r, s, v);
339
+ H.push(M[O[0]], M[O[1]]);
340
+ }
341
+ if (D = [...D, {
342
+ placement: r,
343
+ overflows: H
344
+ }], !H.every((O) => O <= 0)) {
345
+ var k, N;
346
+ const O = (((k = i.flip) == null ? void 0 : k.index) || 0) + 1, $ = R[O];
347
+ if ($ && (!(u === "alignment" ? x !== z($) : !1) || // We leave the current main axis only if every placement on that axis
348
+ // overflows the main axis.
349
+ D.every((A) => z(A.placement) === x ? A.overflows[0] > 0 : !0)))
350
+ return {
351
+ data: {
352
+ index: O,
353
+ overflows: D
354
+ },
355
+ reset: {
356
+ placement: $
357
+ }
358
+ };
359
+ let S = (N = D.filter((L) => L.overflows[0] <= 0).sort((L, A) => L.overflows[1] - A.overflows[1])[0]) == null ? void 0 : N.placement;
360
+ if (!S)
361
+ switch (d) {
362
+ case "bestFit": {
363
+ var E;
364
+ const L = (E = D.filter((A) => {
365
+ if (P) {
366
+ const _ = z(A.placement);
367
+ return _ === x || // Create a bias to the `y` side axis due to horizontal
368
+ // reading directions favoring greater width.
369
+ _ === "y";
370
+ }
371
+ return !0;
372
+ }).map((A) => [A.placement, A.overflows.filter((_) => _ > 0).reduce((_, V) => _ + V, 0)]).sort((A, _) => A[1] - _[1])[0]) == null ? void 0 : E[0];
373
+ L && (S = L);
374
+ break;
375
+ }
376
+ case "initialPlacement":
377
+ S = a;
378
+ break;
379
+ }
380
+ if (r !== S)
381
+ return {
382
+ reset: {
383
+ placement: S
384
+ }
385
+ };
386
+ }
387
+ return {};
388
+ }
389
+ };
390
+ };
391
+ function Ge(e, t) {
392
+ return {
393
+ top: e.top - t.height,
394
+ right: e.right - t.width,
395
+ bottom: e.bottom - t.height,
396
+ left: e.left - t.width
397
+ };
398
+ }
399
+ function qe(e) {
400
+ return Zt.some((t) => e[t] >= 0);
401
+ }
402
+ const dn = function(e) {
403
+ return e === void 0 && (e = {}), {
404
+ name: "hide",
405
+ options: e,
406
+ async fn(t) {
407
+ const {
408
+ rects: n
409
+ } = t, {
410
+ strategy: o = "referenceHidden",
411
+ ...r
412
+ } = G(e, t);
413
+ switch (o) {
414
+ case "referenceHidden": {
415
+ const i = await ie(t, {
416
+ ...r,
417
+ elementContext: "reference"
418
+ }), s = Ge(i, n.reference);
419
+ return {
420
+ data: {
421
+ referenceHiddenOffsets: s,
422
+ referenceHidden: qe(s)
423
+ }
424
+ };
425
+ }
426
+ case "escaped": {
427
+ const i = await ie(t, {
428
+ ...r,
429
+ altBoundary: !0
430
+ }), s = Ge(i, n.floating);
431
+ return {
432
+ data: {
433
+ escapedOffsets: s,
434
+ escaped: qe(s)
435
+ }
436
+ };
437
+ }
438
+ default:
439
+ return {};
440
+ }
441
+ }
442
+ };
443
+ }, ot = /* @__PURE__ */ new Set(["left", "top"]);
444
+ async function pn(e, t) {
445
+ const {
446
+ placement: n,
447
+ platform: o,
448
+ elements: r
449
+ } = e, i = await (o.isRTL == null ? void 0 : o.isRTL(r.floating)), s = q(n), a = ne(n), c = z(n) === "y", f = ot.has(s) ? -1 : 1, l = i && c ? -1 : 1, u = G(t, e);
450
+ let {
451
+ mainAxis: p,
452
+ crossAxis: d,
453
+ alignmentAxis: m
454
+ } = typeof u == "number" ? {
455
+ mainAxis: u,
456
+ crossAxis: 0,
457
+ alignmentAxis: null
458
+ } : {
459
+ mainAxis: u.mainAxis || 0,
460
+ crossAxis: u.crossAxis || 0,
461
+ alignmentAxis: u.alignmentAxis
462
+ };
463
+ return a && typeof m == "number" && (d = a === "end" ? m * -1 : m), c ? {
464
+ x: d * l,
465
+ y: p * f
466
+ } : {
467
+ x: p * f,
468
+ y: d * l
469
+ };
470
+ }
471
+ const mn = function(e) {
472
+ return e === void 0 && (e = 0), {
473
+ name: "offset",
474
+ options: e,
475
+ async fn(t) {
476
+ var n, o;
477
+ const {
478
+ x: r,
479
+ y: i,
480
+ placement: s,
481
+ middlewareData: a
482
+ } = t, c = await pn(t, e);
483
+ return s === ((n = a.offset) == null ? void 0 : n.placement) && (o = a.arrow) != null && o.alignmentOffset ? {} : {
484
+ x: r + c.x,
485
+ y: i + c.y,
486
+ data: {
487
+ ...c,
488
+ placement: s
489
+ }
490
+ };
491
+ }
492
+ };
493
+ }, hn = function(e) {
494
+ return e === void 0 && (e = {}), {
495
+ name: "shift",
496
+ options: e,
497
+ async fn(t) {
498
+ const {
499
+ x: n,
500
+ y: o,
501
+ placement: r
502
+ } = t, {
503
+ mainAxis: i = !0,
504
+ crossAxis: s = !1,
505
+ limiter: a = {
506
+ fn: (w) => {
507
+ let {
508
+ x: y,
509
+ y: x
510
+ } = w;
511
+ return {
512
+ x: y,
513
+ y: x
514
+ };
515
+ }
516
+ },
517
+ ...c
518
+ } = G(e, t), f = {
519
+ x: n,
520
+ y: o
521
+ }, l = await ie(t, c), u = z(q(r)), p = Me(u);
522
+ let d = f[p], m = f[u];
523
+ if (i) {
524
+ const w = p === "y" ? "top" : "left", y = p === "y" ? "bottom" : "right", x = d + l[w], C = d - l[y];
525
+ d = Oe(x, d, C);
526
+ }
527
+ if (s) {
528
+ const w = u === "y" ? "top" : "left", y = u === "y" ? "bottom" : "right", x = m + l[w], C = m - l[y];
529
+ m = Oe(x, m, C);
530
+ }
531
+ const h = a.fn({
532
+ ...t,
533
+ [p]: d,
534
+ [u]: m
535
+ });
536
+ return {
537
+ ...h,
538
+ data: {
539
+ x: h.x - n,
540
+ y: h.y - o,
541
+ enabled: {
542
+ [p]: i,
543
+ [u]: s
544
+ }
545
+ }
546
+ };
547
+ }
548
+ };
549
+ }, gn = function(e) {
550
+ return e === void 0 && (e = {}), {
551
+ options: e,
552
+ fn(t) {
553
+ const {
554
+ x: n,
555
+ y: o,
556
+ placement: r,
557
+ rects: i,
558
+ middlewareData: s
559
+ } = t, {
560
+ offset: a = 0,
561
+ mainAxis: c = !0,
562
+ crossAxis: f = !0
563
+ } = G(e, t), l = {
564
+ x: n,
565
+ y: o
566
+ }, u = z(r), p = Me(u);
567
+ let d = l[p], m = l[u];
568
+ const h = G(a, t), w = typeof h == "number" ? {
569
+ mainAxis: h,
570
+ crossAxis: 0
571
+ } : {
572
+ mainAxis: 0,
573
+ crossAxis: 0,
574
+ ...h
575
+ };
576
+ if (c) {
577
+ const C = p === "y" ? "height" : "width", v = i.reference[p] - i.floating[C] + w.mainAxis, b = i.reference[p] + i.reference[C] - w.mainAxis;
578
+ d < v ? d = v : d > b && (d = b);
579
+ }
580
+ if (f) {
581
+ var y, x;
582
+ const C = p === "y" ? "width" : "height", v = ot.has(q(r)), b = i.reference[u] - i.floating[C] + (v && ((y = s.offset) == null ? void 0 : y[u]) || 0) + (v ? 0 : w.crossAxis), P = i.reference[u] + i.reference[C] + (v ? 0 : ((x = s.offset) == null ? void 0 : x[u]) || 0) - (v ? w.crossAxis : 0);
583
+ m < b ? m = b : m > P && (m = P);
584
+ }
585
+ return {
586
+ [p]: d,
587
+ [u]: m
588
+ };
589
+ }
590
+ };
591
+ }, wn = function(e) {
592
+ return e === void 0 && (e = {}), {
593
+ name: "size",
594
+ options: e,
595
+ async fn(t) {
596
+ var n, o;
597
+ const {
598
+ placement: r,
599
+ rects: i,
600
+ platform: s,
601
+ elements: a
602
+ } = t, {
603
+ apply: c = () => {
604
+ },
605
+ ...f
606
+ } = G(e, t), l = await ie(t, f), u = q(r), p = ne(r), d = z(r) === "y", {
607
+ width: m,
608
+ height: h
609
+ } = i.floating;
610
+ let w, y;
611
+ u === "top" || u === "bottom" ? (w = u, y = p === (await (s.isRTL == null ? void 0 : s.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (y = u, w = p === "end" ? "top" : "bottom");
612
+ const x = h - l.top - l.bottom, C = m - l.left - l.right, v = U(h - l[w], x), b = U(m - l[y], C), P = !t.middlewareData.shift;
613
+ let R = v, M = b;
614
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (M = C), (o = t.middlewareData.shift) != null && o.enabled.y && (R = x), P && !p) {
615
+ const D = F(l.left, 0), k = F(l.right, 0), N = F(l.top, 0), E = F(l.bottom, 0);
616
+ d ? M = m - 2 * (D !== 0 || k !== 0 ? D + k : F(l.left, l.right)) : R = h - 2 * (N !== 0 || E !== 0 ? N + E : F(l.top, l.bottom));
617
+ }
618
+ await c({
619
+ ...t,
620
+ availableWidth: M,
621
+ availableHeight: R
622
+ });
623
+ const H = await s.getDimensions(a.floating);
624
+ return m !== H.width || h !== H.height ? {
625
+ reset: {
626
+ rects: !0
627
+ }
628
+ } : {};
629
+ }
630
+ };
631
+ };
632
+ function ye() {
633
+ return typeof window < "u";
634
+ }
635
+ function oe(e) {
636
+ return rt(e) ? (e.nodeName || "").toLowerCase() : "#document";
637
+ }
638
+ function I(e) {
639
+ var t;
640
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
641
+ }
642
+ function X(e) {
643
+ var t;
644
+ return (t = (rt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
645
+ }
646
+ function rt(e) {
647
+ return ye() ? e instanceof Node || e instanceof I(e).Node : !1;
648
+ }
649
+ function W(e) {
650
+ return ye() ? e instanceof Element || e instanceof I(e).Element : !1;
651
+ }
652
+ function Y(e) {
653
+ return ye() ? e instanceof HTMLElement || e instanceof I(e).HTMLElement : !1;
654
+ }
655
+ function Ue(e) {
656
+ return !ye() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof I(e).ShadowRoot;
657
+ }
658
+ const yn = /* @__PURE__ */ new Set(["inline", "contents"]);
659
+ function ae(e) {
660
+ const {
661
+ overflow: t,
662
+ overflowX: n,
663
+ overflowY: o,
664
+ display: r
665
+ } = B(e);
666
+ return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !yn.has(r);
667
+ }
668
+ const xn = /* @__PURE__ */ new Set(["table", "td", "th"]);
669
+ function vn(e) {
670
+ return xn.has(oe(e));
671
+ }
672
+ const bn = [":popover-open", ":modal"];
673
+ function xe(e) {
674
+ return bn.some((t) => {
675
+ try {
676
+ return e.matches(t);
677
+ } catch {
678
+ return !1;
679
+ }
680
+ });
681
+ }
682
+ const Cn = ["transform", "translate", "scale", "rotate", "perspective"], An = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Rn = ["paint", "layout", "strict", "content"];
683
+ function Ne(e) {
684
+ const t = He(), n = W(e) ? B(e) : e;
685
+ return Cn.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || An.some((o) => (n.willChange || "").includes(o)) || Rn.some((o) => (n.contain || "").includes(o));
686
+ }
687
+ function Pn(e) {
688
+ let t = K(e);
689
+ for (; Y(t) && !ee(t); ) {
690
+ if (Ne(t))
691
+ return t;
692
+ if (xe(t))
693
+ return null;
694
+ t = K(t);
695
+ }
696
+ return null;
697
+ }
698
+ function He() {
699
+ return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
700
+ }
701
+ const Tn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
702
+ function ee(e) {
703
+ return Tn.has(oe(e));
704
+ }
705
+ function B(e) {
706
+ return I(e).getComputedStyle(e);
707
+ }
708
+ function ve(e) {
709
+ return W(e) ? {
710
+ scrollLeft: e.scrollLeft,
711
+ scrollTop: e.scrollTop
712
+ } : {
713
+ scrollLeft: e.scrollX,
714
+ scrollTop: e.scrollY
715
+ };
716
+ }
717
+ function K(e) {
718
+ if (oe(e) === "html")
719
+ return e;
720
+ const t = (
721
+ // Step into the shadow DOM of the parent of a slotted node.
722
+ e.assignedSlot || // DOM Element detected.
723
+ e.parentNode || // ShadowRoot detected.
724
+ Ue(e) && e.host || // Fallback.
725
+ X(e)
726
+ );
727
+ return Ue(t) ? t.host : t;
728
+ }
729
+ function it(e) {
730
+ const t = K(e);
731
+ return ee(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : Y(t) && ae(t) ? t : it(t);
732
+ }
733
+ function se(e, t, n) {
734
+ var o;
735
+ t === void 0 && (t = []), n === void 0 && (n = !0);
736
+ const r = it(e), i = r === ((o = e.ownerDocument) == null ? void 0 : o.body), s = I(r);
737
+ if (i) {
738
+ const a = Se(s);
739
+ return t.concat(s, s.visualViewport || [], ae(r) ? r : [], a && n ? se(a) : []);
740
+ }
741
+ return t.concat(r, se(r, [], n));
742
+ }
743
+ function Se(e) {
744
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
745
+ }
746
+ function st(e) {
747
+ const t = B(e);
748
+ let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
749
+ const r = Y(e), i = r ? e.offsetWidth : n, s = r ? e.offsetHeight : o, a = pe(n) !== i || pe(o) !== s;
750
+ return a && (n = i, o = s), {
751
+ width: n,
752
+ height: o,
753
+ $: a
754
+ };
755
+ }
756
+ function $e(e) {
757
+ return W(e) ? e : e.contextElement;
758
+ }
759
+ function Q(e) {
760
+ const t = $e(e);
761
+ if (!Y(t))
762
+ return j(1);
763
+ const n = t.getBoundingClientRect(), {
764
+ width: o,
765
+ height: r,
766
+ $: i
767
+ } = st(t);
768
+ let s = (i ? pe(n.width) : n.width) / o, a = (i ? pe(n.height) : n.height) / r;
769
+ return (!s || !Number.isFinite(s)) && (s = 1), (!a || !Number.isFinite(a)) && (a = 1), {
770
+ x: s,
771
+ y: a
772
+ };
773
+ }
774
+ const On = /* @__PURE__ */ j(0);
775
+ function ct(e) {
776
+ const t = I(e);
777
+ return !He() || !t.visualViewport ? On : {
778
+ x: t.visualViewport.offsetLeft,
779
+ y: t.visualViewport.offsetTop
780
+ };
781
+ }
782
+ function En(e, t, n) {
783
+ return t === void 0 && (t = !1), !n || t && n !== I(e) ? !1 : t;
784
+ }
785
+ function Z(e, t, n, o) {
786
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
787
+ const r = e.getBoundingClientRect(), i = $e(e);
788
+ let s = j(1);
789
+ t && (o ? W(o) && (s = Q(o)) : s = Q(e));
790
+ const a = En(i, n, o) ? ct(i) : j(0);
791
+ let c = (r.left + a.x) / s.x, f = (r.top + a.y) / s.y, l = r.width / s.x, u = r.height / s.y;
792
+ if (i) {
793
+ const p = I(i), d = o && W(o) ? I(o) : o;
794
+ let m = p, h = Se(m);
795
+ for (; h && o && d !== m; ) {
796
+ const w = Q(h), y = h.getBoundingClientRect(), x = B(h), C = y.left + (h.clientLeft + parseFloat(x.paddingLeft)) * w.x, v = y.top + (h.clientTop + parseFloat(x.paddingTop)) * w.y;
797
+ c *= w.x, f *= w.y, l *= w.x, u *= w.y, c += C, f += v, m = I(h), h = Se(m);
798
+ }
799
+ }
800
+ return he({
801
+ width: l,
802
+ height: u,
803
+ x: c,
804
+ y: f
805
+ });
806
+ }
807
+ function be(e, t) {
808
+ const n = ve(e).scrollLeft;
809
+ return t ? t.left + n : Z(X(e)).left + n;
810
+ }
811
+ function lt(e, t) {
812
+ const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - be(e, n), r = n.top + t.scrollTop;
813
+ return {
814
+ x: o,
815
+ y: r
816
+ };
817
+ }
818
+ function Sn(e) {
819
+ let {
820
+ elements: t,
821
+ rect: n,
822
+ offsetParent: o,
823
+ strategy: r
824
+ } = e;
825
+ const i = r === "fixed", s = X(o), a = t ? xe(t.floating) : !1;
826
+ if (o === s || a && i)
827
+ return n;
828
+ let c = {
829
+ scrollLeft: 0,
830
+ scrollTop: 0
831
+ }, f = j(1);
832
+ const l = j(0), u = Y(o);
833
+ if ((u || !u && !i) && ((oe(o) !== "body" || ae(s)) && (c = ve(o)), Y(o))) {
834
+ const d = Z(o);
835
+ f = Q(o), l.x = d.x + o.clientLeft, l.y = d.y + o.clientTop;
836
+ }
837
+ const p = s && !u && !i ? lt(s, c) : j(0);
838
+ return {
839
+ width: n.width * f.x,
840
+ height: n.height * f.y,
841
+ x: n.x * f.x - c.scrollLeft * f.x + l.x + p.x,
842
+ y: n.y * f.y - c.scrollTop * f.y + l.y + p.y
843
+ };
844
+ }
845
+ function Ln(e) {
846
+ return Array.from(e.getClientRects());
847
+ }
848
+ function Dn(e) {
849
+ const t = X(e), n = ve(e), o = e.ownerDocument.body, r = F(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), i = F(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
850
+ let s = -n.scrollLeft + be(e);
851
+ const a = -n.scrollTop;
852
+ return B(o).direction === "rtl" && (s += F(t.clientWidth, o.clientWidth) - r), {
853
+ width: r,
854
+ height: i,
855
+ x: s,
856
+ y: a
857
+ };
858
+ }
859
+ const Ke = 25;
860
+ function Mn(e, t) {
861
+ const n = I(e), o = X(e), r = n.visualViewport;
862
+ let i = o.clientWidth, s = o.clientHeight, a = 0, c = 0;
863
+ if (r) {
864
+ i = r.width, s = r.height;
865
+ const l = He();
866
+ (!l || l && t === "fixed") && (a = r.offsetLeft, c = r.offsetTop);
867
+ }
868
+ const f = be(o);
869
+ if (f <= 0) {
870
+ const l = o.ownerDocument, u = l.body, p = getComputedStyle(u), d = l.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, m = Math.abs(o.clientWidth - u.clientWidth - d);
871
+ m <= Ke && (i -= m);
872
+ } else f <= Ke && (i += f);
873
+ return {
874
+ width: i,
875
+ height: s,
876
+ x: a,
877
+ y: c
878
+ };
879
+ }
880
+ const _n = /* @__PURE__ */ new Set(["absolute", "fixed"]);
881
+ function kn(e, t) {
882
+ const n = Z(e, !0, t === "fixed"), o = n.top + e.clientTop, r = n.left + e.clientLeft, i = Y(e) ? Q(e) : j(1), s = e.clientWidth * i.x, a = e.clientHeight * i.y, c = r * i.x, f = o * i.y;
883
+ return {
884
+ width: s,
885
+ height: a,
886
+ x: c,
887
+ y: f
888
+ };
889
+ }
890
+ function Ze(e, t, n) {
891
+ let o;
892
+ if (t === "viewport")
893
+ o = Mn(e, n);
894
+ else if (t === "document")
895
+ o = Dn(X(e));
896
+ else if (W(t))
897
+ o = kn(t, n);
898
+ else {
899
+ const r = ct(e);
900
+ o = {
901
+ x: t.x - r.x,
902
+ y: t.y - r.y,
903
+ width: t.width,
904
+ height: t.height
905
+ };
906
+ }
907
+ return he(o);
908
+ }
909
+ function at(e, t) {
910
+ const n = K(e);
911
+ return n === t || !W(n) || ee(n) ? !1 : B(n).position === "fixed" || at(n, t);
912
+ }
913
+ function Nn(e, t) {
914
+ const n = t.get(e);
915
+ if (n)
916
+ return n;
917
+ let o = se(e, [], !1).filter((a) => W(a) && oe(a) !== "body"), r = null;
918
+ const i = B(e).position === "fixed";
919
+ let s = i ? K(e) : e;
920
+ for (; W(s) && !ee(s); ) {
921
+ const a = B(s), c = Ne(s);
922
+ !c && a.position === "fixed" && (r = null), (i ? !c && !r : !c && a.position === "static" && !!r && _n.has(r.position) || ae(s) && !c && at(e, s)) ? o = o.filter((l) => l !== s) : r = a, s = K(s);
923
+ }
924
+ return t.set(e, o), o;
925
+ }
926
+ function Hn(e) {
927
+ let {
928
+ element: t,
929
+ boundary: n,
930
+ rootBoundary: o,
931
+ strategy: r
932
+ } = e;
933
+ const s = [...n === "clippingAncestors" ? xe(t) ? [] : Nn(t, this._c) : [].concat(n), o], a = s[0], c = s.reduce((f, l) => {
934
+ const u = Ze(t, l, r);
935
+ return f.top = F(u.top, f.top), f.right = U(u.right, f.right), f.bottom = U(u.bottom, f.bottom), f.left = F(u.left, f.left), f;
936
+ }, Ze(t, a, r));
937
+ return {
938
+ width: c.right - c.left,
939
+ height: c.bottom - c.top,
940
+ x: c.left,
941
+ y: c.top
942
+ };
943
+ }
944
+ function $n(e) {
945
+ const {
946
+ width: t,
947
+ height: n
948
+ } = st(e);
949
+ return {
950
+ width: t,
951
+ height: n
952
+ };
953
+ }
954
+ function Fn(e, t, n) {
955
+ const o = Y(t), r = X(t), i = n === "fixed", s = Z(e, !0, i, t);
956
+ let a = {
957
+ scrollLeft: 0,
958
+ scrollTop: 0
959
+ };
960
+ const c = j(0);
961
+ function f() {
962
+ c.x = be(r);
963
+ }
964
+ if (o || !o && !i)
965
+ if ((oe(t) !== "body" || ae(r)) && (a = ve(t)), o) {
966
+ const d = Z(t, !0, i, t);
967
+ c.x = d.x + t.clientLeft, c.y = d.y + t.clientTop;
968
+ } else r && f();
969
+ i && !o && r && f();
970
+ const l = r && !o && !i ? lt(r, a) : j(0), u = s.left + a.scrollLeft - c.x - l.x, p = s.top + a.scrollTop - c.y - l.y;
971
+ return {
972
+ x: u,
973
+ y: p,
974
+ width: s.width,
975
+ height: s.height
976
+ };
977
+ }
978
+ function Pe(e) {
979
+ return B(e).position === "static";
980
+ }
981
+ function Je(e, t) {
982
+ if (!Y(e) || B(e).position === "fixed")
983
+ return null;
984
+ if (t)
985
+ return t(e);
986
+ let n = e.offsetParent;
987
+ return X(e) === n && (n = n.ownerDocument.body), n;
988
+ }
989
+ function ft(e, t) {
990
+ const n = I(e);
991
+ if (xe(e))
992
+ return n;
993
+ if (!Y(e)) {
994
+ let r = K(e);
995
+ for (; r && !ee(r); ) {
996
+ if (W(r) && !Pe(r))
997
+ return r;
998
+ r = K(r);
999
+ }
1000
+ return n;
1001
+ }
1002
+ let o = Je(e, t);
1003
+ for (; o && vn(o) && Pe(o); )
1004
+ o = Je(o, t);
1005
+ return o && ee(o) && Pe(o) && !Ne(o) ? n : o || Pn(e) || n;
1006
+ }
1007
+ const In = async function(e) {
1008
+ const t = this.getOffsetParent || ft, n = this.getDimensions, o = await n(e.floating);
1009
+ return {
1010
+ reference: Fn(e.reference, await t(e.floating), e.strategy),
1011
+ floating: {
1012
+ x: 0,
1013
+ y: 0,
1014
+ width: o.width,
1015
+ height: o.height
1016
+ }
1017
+ };
1018
+ };
1019
+ function Wn(e) {
1020
+ return B(e).direction === "rtl";
1021
+ }
1022
+ const Bn = {
1023
+ convertOffsetParentRelativeRectToViewportRelativeRect: Sn,
1024
+ getDocumentElement: X,
1025
+ getClippingRect: Hn,
1026
+ getOffsetParent: ft,
1027
+ getElementRects: In,
1028
+ getClientRects: Ln,
1029
+ getDimensions: $n,
1030
+ getScale: Q,
1031
+ isElement: W,
1032
+ isRTL: Wn
1033
+ };
1034
+ function ut(e, t) {
1035
+ return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1036
+ }
1037
+ function Vn(e, t) {
1038
+ let n = null, o;
1039
+ const r = X(e);
1040
+ function i() {
1041
+ var a;
1042
+ clearTimeout(o), (a = n) == null || a.disconnect(), n = null;
1043
+ }
1044
+ function s(a, c) {
1045
+ a === void 0 && (a = !1), c === void 0 && (c = 1), i();
1046
+ const f = e.getBoundingClientRect(), {
1047
+ left: l,
1048
+ top: u,
1049
+ width: p,
1050
+ height: d
1051
+ } = f;
1052
+ if (a || t(), !p || !d)
1053
+ return;
1054
+ const m = ue(u), h = ue(r.clientWidth - (l + p)), w = ue(r.clientHeight - (u + d)), y = ue(l), C = {
1055
+ rootMargin: -m + "px " + -h + "px " + -w + "px " + -y + "px",
1056
+ threshold: F(0, U(1, c)) || 1
1057
+ };
1058
+ let v = !0;
1059
+ function b(P) {
1060
+ const R = P[0].intersectionRatio;
1061
+ if (R !== c) {
1062
+ if (!v)
1063
+ return s();
1064
+ R ? s(!1, R) : o = setTimeout(() => {
1065
+ s(!1, 1e-7);
1066
+ }, 1e3);
1067
+ }
1068
+ R === 1 && !ut(f, e.getBoundingClientRect()) && s(), v = !1;
1069
+ }
1070
+ try {
1071
+ n = new IntersectionObserver(b, {
1072
+ ...C,
1073
+ // Handle <iframe>s
1074
+ root: r.ownerDocument
1075
+ });
1076
+ } catch {
1077
+ n = new IntersectionObserver(b, C);
1078
+ }
1079
+ n.observe(e);
1080
+ }
1081
+ return s(!0), i;
1082
+ }
1083
+ function zn(e, t, n, o) {
1084
+ o === void 0 && (o = {});
1085
+ const {
1086
+ ancestorScroll: r = !0,
1087
+ ancestorResize: i = !0,
1088
+ elementResize: s = typeof ResizeObserver == "function",
1089
+ layoutShift: a = typeof IntersectionObserver == "function",
1090
+ animationFrame: c = !1
1091
+ } = o, f = $e(e), l = r || i ? [...f ? se(f) : [], ...se(t)] : [];
1092
+ l.forEach((y) => {
1093
+ r && y.addEventListener("scroll", n, {
1094
+ passive: !0
1095
+ }), i && y.addEventListener("resize", n);
1096
+ });
1097
+ const u = f && a ? Vn(f, n) : null;
1098
+ let p = -1, d = null;
1099
+ s && (d = new ResizeObserver((y) => {
1100
+ let [x] = y;
1101
+ x && x.target === f && d && (d.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1102
+ var C;
1103
+ (C = d) == null || C.observe(t);
1104
+ })), n();
1105
+ }), f && !c && d.observe(f), d.observe(t));
1106
+ let m, h = c ? Z(e) : null;
1107
+ c && w();
1108
+ function w() {
1109
+ const y = Z(e);
1110
+ h && !ut(h, y) && n(), h = y, m = requestAnimationFrame(w);
1111
+ }
1112
+ return n(), () => {
1113
+ var y;
1114
+ l.forEach((x) => {
1115
+ r && x.removeEventListener("scroll", n), i && x.removeEventListener("resize", n);
1116
+ }), u?.(), (y = d) == null || y.disconnect(), d = null, c && cancelAnimationFrame(m);
1117
+ };
1118
+ }
1119
+ const jn = mn, Yn = hn, Xn = un, Gn = wn, qn = dn, Qe = fn, Un = gn, Kn = (e, t, n) => {
1120
+ const o = /* @__PURE__ */ new Map(), r = {
1121
+ platform: Bn,
1122
+ ...n
1123
+ }, i = {
1124
+ ...r.platform,
1125
+ _c: o
1126
+ };
1127
+ return an(e, t, {
1128
+ ...r,
1129
+ platform: i
1130
+ });
1131
+ };
1132
+ var Zn = typeof document < "u", Jn = function() {
1133
+ }, de = Zn ? Bt : Jn;
1134
+ function ge(e, t) {
1135
+ if (e === t)
1136
+ return !0;
1137
+ if (typeof e != typeof t)
1138
+ return !1;
1139
+ if (typeof e == "function" && e.toString() === t.toString())
1140
+ return !0;
1141
+ let n, o, r;
1142
+ if (e && t && typeof e == "object") {
1143
+ if (Array.isArray(e)) {
1144
+ if (n = e.length, n !== t.length) return !1;
1145
+ for (o = n; o-- !== 0; )
1146
+ if (!ge(e[o], t[o]))
1147
+ return !1;
1148
+ return !0;
1149
+ }
1150
+ if (r = Object.keys(e), n = r.length, n !== Object.keys(t).length)
1151
+ return !1;
1152
+ for (o = n; o-- !== 0; )
1153
+ if (!{}.hasOwnProperty.call(t, r[o]))
1154
+ return !1;
1155
+ for (o = n; o-- !== 0; ) {
1156
+ const i = r[o];
1157
+ if (!(i === "_owner" && e.$$typeof) && !ge(e[i], t[i]))
1158
+ return !1;
1159
+ }
1160
+ return !0;
1161
+ }
1162
+ return e !== e && t !== t;
1163
+ }
1164
+ function dt(e) {
1165
+ return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1166
+ }
1167
+ function et(e, t) {
1168
+ const n = dt(e);
1169
+ return Math.round(t * n) / n;
1170
+ }
1171
+ function Te(e) {
1172
+ const t = g.useRef(e);
1173
+ return de(() => {
1174
+ t.current = e;
1175
+ }), t;
1176
+ }
1177
+ function Qn(e) {
1178
+ e === void 0 && (e = {});
1179
+ const {
1180
+ placement: t = "bottom",
1181
+ strategy: n = "absolute",
1182
+ middleware: o = [],
1183
+ platform: r,
1184
+ elements: {
1185
+ reference: i,
1186
+ floating: s
1187
+ } = {},
1188
+ transform: a = !0,
1189
+ whileElementsMounted: c,
1190
+ open: f
1191
+ } = e, [l, u] = g.useState({
1192
+ x: 0,
1193
+ y: 0,
1194
+ strategy: n,
1195
+ placement: t,
1196
+ middlewareData: {},
1197
+ isPositioned: !1
1198
+ }), [p, d] = g.useState(o);
1199
+ ge(p, o) || d(o);
1200
+ const [m, h] = g.useState(null), [w, y] = g.useState(null), x = g.useCallback((A) => {
1201
+ A !== P.current && (P.current = A, h(A));
1202
+ }, []), C = g.useCallback((A) => {
1203
+ A !== R.current && (R.current = A, y(A));
1204
+ }, []), v = i || m, b = s || w, P = g.useRef(null), R = g.useRef(null), M = g.useRef(l), H = c != null, D = Te(c), k = Te(r), N = Te(f), E = g.useCallback(() => {
1205
+ if (!P.current || !R.current)
1206
+ return;
1207
+ const A = {
1208
+ placement: t,
1209
+ strategy: n,
1210
+ middleware: p
1211
+ };
1212
+ k.current && (A.platform = k.current), Kn(P.current, R.current, A).then((_) => {
1213
+ const V = {
1214
+ ..._,
1215
+ // The floating element's position may be recomputed while it's closed
1216
+ // but still mounted (such as when transitioning out). To ensure
1217
+ // `isPositioned` will be `false` initially on the next open, avoid
1218
+ // setting it to `true` when `open === false` (must be specified).
1219
+ isPositioned: N.current !== !1
1220
+ };
1221
+ O.current && !ge(M.current, V) && (M.current = V, Yt.flushSync(() => {
1222
+ u(V);
1223
+ }));
1224
+ });
1225
+ }, [p, t, n, k, N]);
1226
+ de(() => {
1227
+ f === !1 && M.current.isPositioned && (M.current.isPositioned = !1, u((A) => ({
1228
+ ...A,
1229
+ isPositioned: !1
1230
+ })));
1231
+ }, [f]);
1232
+ const O = g.useRef(!1);
1233
+ de(() => (O.current = !0, () => {
1234
+ O.current = !1;
1235
+ }), []), de(() => {
1236
+ if (v && (P.current = v), b && (R.current = b), v && b) {
1237
+ if (D.current)
1238
+ return D.current(v, b, E);
1239
+ E();
1240
+ }
1241
+ }, [v, b, E, D, H]);
1242
+ const $ = g.useMemo(() => ({
1243
+ reference: P,
1244
+ floating: R,
1245
+ setReference: x,
1246
+ setFloating: C
1247
+ }), [x, C]), S = g.useMemo(() => ({
1248
+ reference: v,
1249
+ floating: b
1250
+ }), [v, b]), L = g.useMemo(() => {
1251
+ const A = {
1252
+ position: n,
1253
+ left: 0,
1254
+ top: 0
1255
+ };
1256
+ if (!S.floating)
1257
+ return A;
1258
+ const _ = et(S.floating, l.x), V = et(S.floating, l.y);
1259
+ return a ? {
1260
+ ...A,
1261
+ transform: "translate(" + _ + "px, " + V + "px)",
1262
+ ...dt(S.floating) >= 1.5 && {
1263
+ willChange: "transform"
1264
+ }
1265
+ } : {
1266
+ position: n,
1267
+ left: _,
1268
+ top: V
1269
+ };
1270
+ }, [n, a, S.floating, l.x, l.y]);
1271
+ return g.useMemo(() => ({
1272
+ ...l,
1273
+ update: E,
1274
+ refs: $,
1275
+ elements: S,
1276
+ floatingStyles: L
1277
+ }), [l, E, $, S, L]);
1278
+ }
1279
+ const eo = (e) => {
1280
+ function t(n) {
1281
+ return {}.hasOwnProperty.call(n, "current");
1282
+ }
1283
+ return {
1284
+ name: "arrow",
1285
+ options: e,
1286
+ fn(n) {
1287
+ const {
1288
+ element: o,
1289
+ padding: r
1290
+ } = typeof e == "function" ? e(n) : e;
1291
+ return o && t(o) ? o.current != null ? Qe({
1292
+ element: o.current,
1293
+ padding: r
1294
+ }).fn(n) : {} : o ? Qe({
1295
+ element: o,
1296
+ padding: r
1297
+ }).fn(n) : {};
1298
+ }
1299
+ };
1300
+ }, to = (e, t) => ({
1301
+ ...jn(e),
1302
+ options: [e, t]
1303
+ }), no = (e, t) => ({
1304
+ ...Yn(e),
1305
+ options: [e, t]
1306
+ }), oo = (e, t) => ({
1307
+ ...Un(e),
1308
+ options: [e, t]
1309
+ }), ro = (e, t) => ({
1310
+ ...Xn(e),
1311
+ options: [e, t]
1312
+ }), io = (e, t) => ({
1313
+ ...Gn(e),
1314
+ options: [e, t]
1315
+ }), so = (e, t) => ({
1316
+ ...qn(e),
1317
+ options: [e, t]
1318
+ }), co = (e, t) => ({
1319
+ ...eo(e),
1320
+ options: [e, t]
1321
+ });
1322
+ var lo = "Arrow", pt = g.forwardRef((e, t) => {
1323
+ const { children: n, width: o = 10, height: r = 5, ...i } = e;
1324
+ return /* @__PURE__ */ T(
1325
+ le.svg,
1326
+ {
1327
+ ...i,
1328
+ ref: t,
1329
+ width: o,
1330
+ height: r,
1331
+ viewBox: "0 0 30 10",
1332
+ preserveAspectRatio: "none",
1333
+ children: e.asChild ? n : /* @__PURE__ */ T("polygon", { points: "0,0 30,0 15,10" })
1334
+ }
1335
+ );
1336
+ });
1337
+ pt.displayName = lo;
1338
+ var ao = pt, Fe = "Popper", [mt, ht] = tt(Fe), [fo, gt] = mt(Fe), wt = (e) => {
1339
+ const { __scopePopper: t, children: n } = e, [o, r] = g.useState(null);
1340
+ return /* @__PURE__ */ T(fo, { scope: t, anchor: o, onAnchorChange: r, children: n });
1341
+ };
1342
+ wt.displayName = Fe;
1343
+ var yt = "PopperAnchor", xt = g.forwardRef(
1344
+ (e, t) => {
1345
+ const { __scopePopper: n, virtualRef: o, ...r } = e, i = gt(yt, n), s = g.useRef(null), a = we(t, s), c = g.useRef(null);
1346
+ return g.useEffect(() => {
1347
+ const f = c.current;
1348
+ c.current = o?.current || s.current, f !== c.current && i.onAnchorChange(c.current);
1349
+ }), o ? null : /* @__PURE__ */ T(le.div, { ...r, ref: a });
1350
+ }
1351
+ );
1352
+ xt.displayName = yt;
1353
+ var Ie = "PopperContent", [uo, po] = mt(Ie), vt = g.forwardRef(
1354
+ (e, t) => {
1355
+ const {
1356
+ __scopePopper: n,
1357
+ side: o = "bottom",
1358
+ sideOffset: r = 0,
1359
+ align: i = "center",
1360
+ alignOffset: s = 0,
1361
+ arrowPadding: a = 0,
1362
+ avoidCollisions: c = !0,
1363
+ collisionBoundary: f = [],
1364
+ collisionPadding: l = 0,
1365
+ sticky: u = "partial",
1366
+ hideWhenDetached: p = !1,
1367
+ updatePositionStrategy: d = "optimized",
1368
+ onPlaced: m,
1369
+ ...h
1370
+ } = e, w = gt(Ie, n), [y, x] = g.useState(null), C = we(t, (re) => x(re)), [v, b] = g.useState(null), P = Ut(v), R = P?.width ?? 0, M = P?.height ?? 0, H = o + (i !== "center" ? "-" + i : ""), D = typeof l == "number" ? l : { top: 0, right: 0, bottom: 0, left: 0, ...l }, k = Array.isArray(f) ? f : [f], N = k.length > 0, E = {
1371
+ padding: D,
1372
+ boundary: k.filter(ho),
1373
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
1374
+ altBoundary: N
1375
+ }, { refs: O, floatingStyles: $, placement: S, isPositioned: L, middlewareData: A } = Qn({
1376
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
1377
+ strategy: "fixed",
1378
+ placement: H,
1379
+ whileElementsMounted: (...re) => zn(...re, {
1380
+ animationFrame: d === "always"
1381
+ }),
1382
+ elements: {
1383
+ reference: w.anchor
1384
+ },
1385
+ middleware: [
1386
+ to({ mainAxis: r + M, alignmentAxis: s }),
1387
+ c && no({
1388
+ mainAxis: !0,
1389
+ crossAxis: !1,
1390
+ limiter: u === "partial" ? oo() : void 0,
1391
+ ...E
1392
+ }),
1393
+ c && ro({ ...E }),
1394
+ io({
1395
+ ...E,
1396
+ apply: ({ elements: re, rects: Ve, availableWidth: $t, availableHeight: Ft }) => {
1397
+ const { width: It, height: Wt } = Ve.reference, fe = re.floating.style;
1398
+ fe.setProperty("--radix-popper-available-width", `${$t}px`), fe.setProperty("--radix-popper-available-height", `${Ft}px`), fe.setProperty("--radix-popper-anchor-width", `${It}px`), fe.setProperty("--radix-popper-anchor-height", `${Wt}px`);
1399
+ }
1400
+ }),
1401
+ v && co({ element: v, padding: a }),
1402
+ go({ arrowWidth: R, arrowHeight: M }),
1403
+ p && so({ strategy: "referenceHidden", ...E })
1404
+ ]
1405
+ }), [_, V] = At(S), Be = qt(m);
1406
+ ze(() => {
1407
+ L && Be?.();
1408
+ }, [L, Be]);
1409
+ const Mt = A.arrow?.x, _t = A.arrow?.y, kt = A.arrow?.centerOffset !== 0, [Nt, Ht] = g.useState();
1410
+ return ze(() => {
1411
+ y && Ht(window.getComputedStyle(y).zIndex);
1412
+ }, [y]), /* @__PURE__ */ T(
1413
+ "div",
1414
+ {
1415
+ ref: O.setFloating,
1416
+ "data-radix-popper-content-wrapper": "",
1417
+ style: {
1418
+ ...$,
1419
+ transform: L ? $.transform : "translate(0, -200%)",
1420
+ // keep off the page when measuring
1421
+ minWidth: "max-content",
1422
+ zIndex: Nt,
1423
+ "--radix-popper-transform-origin": [
1424
+ A.transformOrigin?.x,
1425
+ A.transformOrigin?.y
1426
+ ].join(" "),
1427
+ // hide the content if using the hide middleware and should be hidden
1428
+ // set visibility to hidden and disable pointer events so the UI behaves
1429
+ // as if the PopperContent isn't there at all
1430
+ ...A.hide?.referenceHidden && {
1431
+ visibility: "hidden",
1432
+ pointerEvents: "none"
1433
+ }
1434
+ },
1435
+ dir: e.dir,
1436
+ children: /* @__PURE__ */ T(
1437
+ uo,
1438
+ {
1439
+ scope: n,
1440
+ placedSide: _,
1441
+ onArrowChange: b,
1442
+ arrowX: Mt,
1443
+ arrowY: _t,
1444
+ shouldHideArrow: kt,
1445
+ children: /* @__PURE__ */ T(
1446
+ le.div,
1447
+ {
1448
+ "data-side": _,
1449
+ "data-align": V,
1450
+ ...h,
1451
+ ref: C,
1452
+ style: {
1453
+ ...h.style,
1454
+ // if the PopperContent hasn't been placed yet (not all measurements done)
1455
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
1456
+ animation: L ? void 0 : "none"
1457
+ }
1458
+ }
1459
+ )
1460
+ }
1461
+ )
1462
+ }
1463
+ );
1464
+ }
1465
+ );
1466
+ vt.displayName = Ie;
1467
+ var bt = "PopperArrow", mo = {
1468
+ top: "bottom",
1469
+ right: "left",
1470
+ bottom: "top",
1471
+ left: "right"
1472
+ }, Ct = g.forwardRef(function(t, n) {
1473
+ const { __scopePopper: o, ...r } = t, i = po(bt, o), s = mo[i.placedSide];
1474
+ return (
1475
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
1476
+ // doesn't report size as we'd expect on SVG elements.
1477
+ // it reports their bounding box which is effectively the largest path inside the SVG.
1478
+ /* @__PURE__ */ T(
1479
+ "span",
1480
+ {
1481
+ ref: i.onArrowChange,
1482
+ style: {
1483
+ position: "absolute",
1484
+ left: i.arrowX,
1485
+ top: i.arrowY,
1486
+ [s]: 0,
1487
+ transformOrigin: {
1488
+ top: "",
1489
+ right: "0 0",
1490
+ bottom: "center 0",
1491
+ left: "100% 0"
1492
+ }[i.placedSide],
1493
+ transform: {
1494
+ top: "translateY(100%)",
1495
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
1496
+ bottom: "rotate(180deg)",
1497
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
1498
+ }[i.placedSide],
1499
+ visibility: i.shouldHideArrow ? "hidden" : void 0
1500
+ },
1501
+ children: /* @__PURE__ */ T(
1502
+ ao,
1503
+ {
1504
+ ...r,
1505
+ ref: n,
1506
+ style: {
1507
+ ...r.style,
1508
+ // ensures the element can be measured correctly (mostly for if SVG)
1509
+ display: "block"
1510
+ }
1511
+ }
1512
+ )
1513
+ }
1514
+ )
1515
+ );
1516
+ });
1517
+ Ct.displayName = bt;
1518
+ function ho(e) {
1519
+ return e !== null;
1520
+ }
1521
+ var go = (e) => ({
1522
+ name: "transformOrigin",
1523
+ options: e,
1524
+ fn(t) {
1525
+ const { placement: n, rects: o, middlewareData: r } = t, s = r.arrow?.centerOffset !== 0, a = s ? 0 : e.arrowWidth, c = s ? 0 : e.arrowHeight, [f, l] = At(n), u = { start: "0%", center: "50%", end: "100%" }[l], p = (r.arrow?.x ?? 0) + a / 2, d = (r.arrow?.y ?? 0) + c / 2;
1526
+ let m = "", h = "";
1527
+ return f === "bottom" ? (m = s ? u : `${p}px`, h = `${-c}px`) : f === "top" ? (m = s ? u : `${p}px`, h = `${o.floating.height + c}px`) : f === "right" ? (m = `${-c}px`, h = s ? u : `${d}px`) : f === "left" && (m = `${o.floating.width + c}px`, h = s ? u : `${d}px`), { data: { x: m, y: h } };
1528
+ }
1529
+ });
1530
+ function At(e) {
1531
+ const [t, n = "center"] = e.split("-");
1532
+ return [t, n];
1533
+ }
1534
+ var wo = wt, yo = xt, xo = vt, vo = Ct, bo = /* @__PURE__ */ Symbol("radix.slottable");
1535
+ // @__NO_SIDE_EFFECTS__
1536
+ function Co(e) {
1537
+ const t = ({ children: n }) => /* @__PURE__ */ T(Xt, { children: n });
1538
+ return t.displayName = `${e}.Slottable`, t.__radixId = bo, t;
1539
+ }
1540
+ var Ao = Object.freeze({
1541
+ // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
1542
+ position: "absolute",
1543
+ border: 0,
1544
+ width: 1,
1545
+ height: 1,
1546
+ padding: 0,
1547
+ margin: -1,
1548
+ overflow: "hidden",
1549
+ clip: "rect(0, 0, 0, 0)",
1550
+ whiteSpace: "nowrap",
1551
+ wordWrap: "normal"
1552
+ }), Ro = "VisuallyHidden", Rt = g.forwardRef(
1553
+ (e, t) => /* @__PURE__ */ T(
1554
+ le.span,
1555
+ {
1556
+ ...e,
1557
+ ref: t,
1558
+ style: { ...Ao, ...e.style }
1559
+ }
1560
+ )
1561
+ );
1562
+ Rt.displayName = Ro;
1563
+ var Po = Rt, [Ce, Zo] = tt("Tooltip", [
1564
+ ht
1565
+ ]), Ae = ht(), Pt = "TooltipProvider", To = 700, Le = "tooltip.open", [Oo, We] = Ce(Pt), Tt = (e) => {
1566
+ const {
1567
+ __scopeTooltip: t,
1568
+ delayDuration: n = To,
1569
+ skipDelayDuration: o = 300,
1570
+ disableHoverableContent: r = !1,
1571
+ children: i
1572
+ } = e, s = g.useRef(!0), a = g.useRef(!1), c = g.useRef(0);
1573
+ return g.useEffect(() => {
1574
+ const f = c.current;
1575
+ return () => window.clearTimeout(f);
1576
+ }, []), /* @__PURE__ */ T(
1577
+ Oo,
1578
+ {
1579
+ scope: t,
1580
+ isOpenDelayedRef: s,
1581
+ delayDuration: n,
1582
+ onOpen: g.useCallback(() => {
1583
+ window.clearTimeout(c.current), s.current = !1;
1584
+ }, []),
1585
+ onClose: g.useCallback(() => {
1586
+ window.clearTimeout(c.current), c.current = window.setTimeout(
1587
+ () => s.current = !0,
1588
+ o
1589
+ );
1590
+ }, [o]),
1591
+ isPointerInTransitRef: a,
1592
+ onPointerInTransitChange: g.useCallback((f) => {
1593
+ a.current = f;
1594
+ }, []),
1595
+ disableHoverableContent: r,
1596
+ children: i
1597
+ }
1598
+ );
1599
+ };
1600
+ Tt.displayName = Pt;
1601
+ var ce = "Tooltip", [Eo, Re] = Ce(ce), Ot = (e) => {
1602
+ const {
1603
+ __scopeTooltip: t,
1604
+ children: n,
1605
+ open: o,
1606
+ defaultOpen: r,
1607
+ onOpenChange: i,
1608
+ disableHoverableContent: s,
1609
+ delayDuration: a
1610
+ } = e, c = We(ce, e.__scopeTooltip), f = Ae(t), [l, u] = g.useState(null), p = jt(), d = g.useRef(0), m = s ?? c.disableHoverableContent, h = a ?? c.delayDuration, w = g.useRef(!1), [y, x] = Vt({
1611
+ prop: o,
1612
+ defaultProp: r ?? !1,
1613
+ onChange: (R) => {
1614
+ R ? (c.onOpen(), document.dispatchEvent(new CustomEvent(Le))) : c.onClose(), i?.(R);
1615
+ },
1616
+ caller: ce
1617
+ }), C = g.useMemo(() => y ? w.current ? "delayed-open" : "instant-open" : "closed", [y]), v = g.useCallback(() => {
1618
+ window.clearTimeout(d.current), d.current = 0, w.current = !1, x(!0);
1619
+ }, [x]), b = g.useCallback(() => {
1620
+ window.clearTimeout(d.current), d.current = 0, x(!1);
1621
+ }, [x]), P = g.useCallback(() => {
1622
+ window.clearTimeout(d.current), d.current = window.setTimeout(() => {
1623
+ w.current = !0, x(!0), d.current = 0;
1624
+ }, h);
1625
+ }, [h, x]);
1626
+ return g.useEffect(() => () => {
1627
+ d.current && (window.clearTimeout(d.current), d.current = 0);
1628
+ }, []), /* @__PURE__ */ T(wo, { ...f, children: /* @__PURE__ */ T(
1629
+ Eo,
1630
+ {
1631
+ scope: t,
1632
+ contentId: p,
1633
+ open: y,
1634
+ stateAttribute: C,
1635
+ trigger: l,
1636
+ onTriggerChange: u,
1637
+ onTriggerEnter: g.useCallback(() => {
1638
+ c.isOpenDelayedRef.current ? P() : v();
1639
+ }, [c.isOpenDelayedRef, P, v]),
1640
+ onTriggerLeave: g.useCallback(() => {
1641
+ m ? b() : (window.clearTimeout(d.current), d.current = 0);
1642
+ }, [b, m]),
1643
+ onOpen: v,
1644
+ onClose: b,
1645
+ disableHoverableContent: m,
1646
+ children: n
1647
+ }
1648
+ ) });
1649
+ };
1650
+ Ot.displayName = ce;
1651
+ var De = "TooltipTrigger", Et = g.forwardRef(
1652
+ (e, t) => {
1653
+ const { __scopeTooltip: n, ...o } = e, r = Re(De, n), i = We(De, n), s = Ae(n), a = g.useRef(null), c = we(t, a, r.onTriggerChange), f = g.useRef(!1), l = g.useRef(!1), u = g.useCallback(() => f.current = !1, []);
1654
+ return g.useEffect(() => () => document.removeEventListener("pointerup", u), [u]), /* @__PURE__ */ T(yo, { asChild: !0, ...s, children: /* @__PURE__ */ T(
1655
+ le.button,
1656
+ {
1657
+ "aria-describedby": r.open ? r.contentId : void 0,
1658
+ "data-state": r.stateAttribute,
1659
+ ...o,
1660
+ ref: c,
1661
+ onPointerMove: J(e.onPointerMove, (p) => {
1662
+ p.pointerType !== "touch" && !l.current && !i.isPointerInTransitRef.current && (r.onTriggerEnter(), l.current = !0);
1663
+ }),
1664
+ onPointerLeave: J(e.onPointerLeave, () => {
1665
+ r.onTriggerLeave(), l.current = !1;
1666
+ }),
1667
+ onPointerDown: J(e.onPointerDown, () => {
1668
+ r.open && r.onClose(), f.current = !0, document.addEventListener("pointerup", u, { once: !0 });
1669
+ }),
1670
+ onFocus: J(e.onFocus, () => {
1671
+ f.current || r.onOpen();
1672
+ }),
1673
+ onBlur: J(e.onBlur, r.onClose),
1674
+ onClick: J(e.onClick, r.onClose)
1675
+ }
1676
+ ) });
1677
+ }
1678
+ );
1679
+ Et.displayName = De;
1680
+ var So = "TooltipPortal", [Jo, Lo] = Ce(So, {
1681
+ forceMount: void 0
1682
+ }), te = "TooltipContent", St = g.forwardRef(
1683
+ (e, t) => {
1684
+ const n = Lo(te, e.__scopeTooltip), { forceMount: o = n.forceMount, side: r = "top", ...i } = e, s = Re(te, e.__scopeTooltip);
1685
+ return /* @__PURE__ */ T(Kt, { present: o || s.open, children: s.disableHoverableContent ? /* @__PURE__ */ T(Lt, { side: r, ...i, ref: t }) : /* @__PURE__ */ T(Do, { side: r, ...i, ref: t }) });
1686
+ }
1687
+ ), Do = g.forwardRef((e, t) => {
1688
+ const n = Re(te, e.__scopeTooltip), o = We(te, e.__scopeTooltip), r = g.useRef(null), i = we(t, r), [s, a] = g.useState(null), { trigger: c, onClose: f } = n, l = r.current, { onPointerInTransitChange: u } = o, p = g.useCallback(() => {
1689
+ a(null), u(!1);
1690
+ }, [u]), d = g.useCallback(
1691
+ (m, h) => {
1692
+ const w = m.currentTarget, y = { x: m.clientX, y: m.clientY }, x = Ho(y, w.getBoundingClientRect()), C = $o(y, x), v = Fo(h.getBoundingClientRect()), b = Wo([...C, ...v]);
1693
+ a(b), u(!0);
1694
+ },
1695
+ [u]
1696
+ );
1697
+ return g.useEffect(() => () => p(), [p]), g.useEffect(() => {
1698
+ if (c && l) {
1699
+ const m = (w) => d(w, l), h = (w) => d(w, c);
1700
+ return c.addEventListener("pointerleave", m), l.addEventListener("pointerleave", h), () => {
1701
+ c.removeEventListener("pointerleave", m), l.removeEventListener("pointerleave", h);
1702
+ };
1703
+ }
1704
+ }, [c, l, d, p]), g.useEffect(() => {
1705
+ if (s) {
1706
+ const m = (h) => {
1707
+ const w = h.target, y = { x: h.clientX, y: h.clientY }, x = c?.contains(w) || l?.contains(w), C = !Io(y, s);
1708
+ x ? p() : C && (p(), f());
1709
+ };
1710
+ return document.addEventListener("pointermove", m), () => document.removeEventListener("pointermove", m);
1711
+ }
1712
+ }, [c, l, s, f, p]), /* @__PURE__ */ T(Lt, { ...e, ref: i });
1713
+ }), [Mo, _o] = Ce(ce, { isInside: !1 }), ko = /* @__PURE__ */ Co("TooltipContent"), Lt = g.forwardRef(
1714
+ (e, t) => {
1715
+ const {
1716
+ __scopeTooltip: n,
1717
+ children: o,
1718
+ "aria-label": r,
1719
+ onEscapeKeyDown: i,
1720
+ onPointerDownOutside: s,
1721
+ ...a
1722
+ } = e, c = Re(te, n), f = Ae(n), { onClose: l } = c;
1723
+ return g.useEffect(() => (document.addEventListener(Le, l), () => document.removeEventListener(Le, l)), [l]), g.useEffect(() => {
1724
+ if (c.trigger) {
1725
+ const u = (p) => {
1726
+ p.target?.contains(c.trigger) && l();
1727
+ };
1728
+ return window.addEventListener("scroll", u, { capture: !0 }), () => window.removeEventListener("scroll", u, { capture: !0 });
1729
+ }
1730
+ }, [c.trigger, l]), /* @__PURE__ */ T(
1731
+ zt,
1732
+ {
1733
+ asChild: !0,
1734
+ disableOutsidePointerEvents: !1,
1735
+ onEscapeKeyDown: i,
1736
+ onPointerDownOutside: s,
1737
+ onFocusOutside: (u) => u.preventDefault(),
1738
+ onDismiss: l,
1739
+ children: /* @__PURE__ */ Gt(
1740
+ xo,
1741
+ {
1742
+ "data-state": c.stateAttribute,
1743
+ ...f,
1744
+ ...a,
1745
+ ref: t,
1746
+ style: {
1747
+ ...a.style,
1748
+ "--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
1749
+ "--radix-tooltip-content-available-width": "var(--radix-popper-available-width)",
1750
+ "--radix-tooltip-content-available-height": "var(--radix-popper-available-height)",
1751
+ "--radix-tooltip-trigger-width": "var(--radix-popper-anchor-width)",
1752
+ "--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
1753
+ },
1754
+ children: [
1755
+ /* @__PURE__ */ T(ko, { children: o }),
1756
+ /* @__PURE__ */ T(Mo, { scope: n, isInside: !0, children: /* @__PURE__ */ T(Po, { id: c.contentId, role: "tooltip", children: r || o }) })
1757
+ ]
1758
+ }
1759
+ )
1760
+ }
1761
+ );
1762
+ }
1763
+ );
1764
+ St.displayName = te;
1765
+ var Dt = "TooltipArrow", No = g.forwardRef(
1766
+ (e, t) => {
1767
+ const { __scopeTooltip: n, ...o } = e, r = Ae(n);
1768
+ return _o(
1769
+ Dt,
1770
+ n
1771
+ ).isInside ? null : /* @__PURE__ */ T(vo, { ...r, ...o, ref: t });
1772
+ }
1773
+ );
1774
+ No.displayName = Dt;
1775
+ function Ho(e, t) {
1776
+ const n = Math.abs(t.top - e.y), o = Math.abs(t.bottom - e.y), r = Math.abs(t.right - e.x), i = Math.abs(t.left - e.x);
1777
+ switch (Math.min(n, o, r, i)) {
1778
+ case i:
1779
+ return "left";
1780
+ case r:
1781
+ return "right";
1782
+ case n:
1783
+ return "top";
1784
+ case o:
1785
+ return "bottom";
1786
+ default:
1787
+ throw new Error("unreachable");
1788
+ }
1789
+ }
1790
+ function $o(e, t, n = 5) {
1791
+ const o = [];
1792
+ switch (t) {
1793
+ case "top":
1794
+ o.push(
1795
+ { x: e.x - n, y: e.y + n },
1796
+ { x: e.x + n, y: e.y + n }
1797
+ );
1798
+ break;
1799
+ case "bottom":
1800
+ o.push(
1801
+ { x: e.x - n, y: e.y - n },
1802
+ { x: e.x + n, y: e.y - n }
1803
+ );
1804
+ break;
1805
+ case "left":
1806
+ o.push(
1807
+ { x: e.x + n, y: e.y - n },
1808
+ { x: e.x + n, y: e.y + n }
1809
+ );
1810
+ break;
1811
+ case "right":
1812
+ o.push(
1813
+ { x: e.x - n, y: e.y - n },
1814
+ { x: e.x - n, y: e.y + n }
1815
+ );
1816
+ break;
1817
+ }
1818
+ return o;
1819
+ }
1820
+ function Fo(e) {
1821
+ const { top: t, right: n, bottom: o, left: r } = e;
1822
+ return [
1823
+ { x: r, y: t },
1824
+ { x: n, y: t },
1825
+ { x: n, y: o },
1826
+ { x: r, y: o }
1827
+ ];
1828
+ }
1829
+ function Io(e, t) {
1830
+ const { x: n, y: o } = e;
1831
+ let r = !1;
1832
+ for (let i = 0, s = t.length - 1; i < t.length; s = i++) {
1833
+ const a = t[i], c = t[s], f = a.x, l = a.y, u = c.x, p = c.y;
1834
+ l > o != p > o && n < (u - f) * (o - l) / (p - l) + f && (r = !r);
1835
+ }
1836
+ return r;
1837
+ }
1838
+ function Wo(e) {
1839
+ const t = e.slice();
1840
+ return t.sort((n, o) => n.x < o.x ? -1 : n.x > o.x ? 1 : n.y < o.y ? -1 : n.y > o.y ? 1 : 0), Bo(t);
1841
+ }
1842
+ function Bo(e) {
1843
+ if (e.length <= 1) return e.slice();
1844
+ const t = [];
1845
+ for (let o = 0; o < e.length; o++) {
1846
+ const r = e[o];
1847
+ for (; t.length >= 2; ) {
1848
+ const i = t[t.length - 1], s = t[t.length - 2];
1849
+ if ((i.x - s.x) * (r.y - s.y) >= (i.y - s.y) * (r.x - s.x)) t.pop();
1850
+ else break;
1851
+ }
1852
+ t.push(r);
1853
+ }
1854
+ t.pop();
1855
+ const n = [];
1856
+ for (let o = e.length - 1; o >= 0; o--) {
1857
+ const r = e[o];
1858
+ for (; n.length >= 2; ) {
1859
+ const i = n[n.length - 1], s = n[n.length - 2];
1860
+ if ((i.x - s.x) * (r.y - s.y) >= (i.y - s.y) * (r.x - s.x)) n.pop();
1861
+ else break;
1862
+ }
1863
+ n.push(r);
1864
+ }
1865
+ return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
1866
+ }
1867
+ var Qo = Tt, er = Ot, tr = Et, nr = St;
1868
+ export {
1869
+ nr as C,
1870
+ Qo as P,
1871
+ er as R,
1872
+ tr as T
1873
+ };