@devalok/shilp-sutra 0.26.0 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +1,35 @@
1
1
  "use client";
2
- import * as S from "react";
3
- import v, { useState as Dn, useLayoutEffect as Nn } from "react";
4
- import { an as mt, ao as Je, ap as Pn } from "./vendor-utils.js";
5
- import * as Ln from "react-dom";
6
- import Bn from "react-dom";
7
- var qt = "right-scroll-bar-position", Kt = "width-before-scroll-bar", _n = "with-scroll-bars-hidden", In = "--removed-body-scroll-bar-size";
8
- function ce(t, e) {
2
+ import * as w from "react";
3
+ import { useState as Se, useLayoutEffect as Ce } from "react";
4
+ import * as Re from "react-dom";
5
+ var I = function() {
6
+ return I = Object.assign || function(e) {
7
+ for (var n, r = 1, o = arguments.length; r < o; r++) {
8
+ n = arguments[r];
9
+ for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i]);
10
+ }
11
+ return e;
12
+ }, I.apply(this, arguments);
13
+ };
14
+ function re(t, e) {
15
+ var n = {};
16
+ for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && e.indexOf(r) < 0 && (n[r] = t[r]);
17
+ if (t != null && typeof Object.getOwnPropertySymbols == "function")
18
+ for (var o = 0, r = Object.getOwnPropertySymbols(t); o < r.length; o++)
19
+ e.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, r[o]) && (n[r[o]] = t[r[o]]);
20
+ return n;
21
+ }
22
+ function Ae(t, e, n) {
23
+ if (n || arguments.length === 2) for (var r = 0, o = e.length, i; r < o; r++)
24
+ (i || !(r in e)) && (i || (i = Array.prototype.slice.call(e, 0, r)), i[r] = e[r]);
25
+ return t.concat(i || Array.prototype.slice.call(e));
26
+ }
27
+ var ht = "right-scroll-bar-position", mt = "width-before-scroll-bar", Ee = "with-scroll-bars-hidden", Oe = "--removed-body-scroll-bar-size";
28
+ function At(t, e) {
9
29
  return typeof t == "function" ? t(e) : t && (t.current = e), t;
10
30
  }
11
- function Hn(t, e) {
12
- var n = Dn(function() {
31
+ function Pe(t, e) {
32
+ var n = Se(function() {
13
33
  return {
14
34
  // value
15
35
  value: t,
@@ -20,62 +40,62 @@ function Hn(t, e) {
20
40
  get current() {
21
41
  return n.value;
22
42
  },
23
- set current(o) {
24
- var a = n.value;
25
- a !== o && (n.value = o, n.callback(o, a));
43
+ set current(r) {
44
+ var o = n.value;
45
+ o !== r && (n.value = r, n.callback(r, o));
26
46
  }
27
47
  }
28
48
  };
29
49
  })[0];
30
50
  return n.callback = e, n.facade;
31
51
  }
32
- var Fn = typeof window < "u" ? S.useLayoutEffect : S.useEffect, Be = /* @__PURE__ */ new WeakMap();
33
- function Wn(t, e) {
34
- var n = Hn(null, function(o) {
35
- return t.forEach(function(a) {
36
- return ce(a, o);
52
+ var Me = typeof window < "u" ? w.useLayoutEffect : w.useEffect, It = /* @__PURE__ */ new WeakMap();
53
+ function ke(t, e) {
54
+ var n = Pe(null, function(r) {
55
+ return t.forEach(function(o) {
56
+ return At(o, r);
37
57
  });
38
58
  });
39
- return Fn(function() {
40
- var o = Be.get(n);
41
- if (o) {
42
- var a = new Set(o), i = new Set(t), s = n.current;
43
- a.forEach(function(l) {
44
- i.has(l) || ce(l, null);
45
- }), i.forEach(function(l) {
46
- a.has(l) || ce(l, s);
59
+ return Me(function() {
60
+ var r = It.get(n);
61
+ if (r) {
62
+ var o = new Set(r), i = new Set(t), c = n.current;
63
+ o.forEach(function(s) {
64
+ i.has(s) || At(s, null);
65
+ }), i.forEach(function(s) {
66
+ o.has(s) || At(s, c);
47
67
  });
48
68
  }
49
- Be.set(n, t);
69
+ It.set(n, t);
50
70
  }, [t]), n;
51
71
  }
52
- function $n(t) {
72
+ function Le(t) {
53
73
  return t;
54
74
  }
55
- function zn(t, e) {
56
- e === void 0 && (e = $n);
57
- var n = [], o = !1, a = {
75
+ function Te(t, e) {
76
+ e === void 0 && (e = Le);
77
+ var n = [], r = !1, o = {
58
78
  read: function() {
59
- if (o)
79
+ if (r)
60
80
  throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
61
81
  return n.length ? n[n.length - 1] : t;
62
82
  },
63
83
  useMedium: function(i) {
64
- var s = e(i, o);
65
- return n.push(s), function() {
66
- n = n.filter(function(l) {
67
- return l !== s;
84
+ var c = e(i, r);
85
+ return n.push(c), function() {
86
+ n = n.filter(function(s) {
87
+ return s !== c;
68
88
  });
69
89
  };
70
90
  },
71
91
  assignSyncMedium: function(i) {
72
- for (o = !0; n.length; ) {
73
- var s = n;
74
- n = [], s.forEach(i);
92
+ for (r = !0; n.length; ) {
93
+ var c = n;
94
+ n = [], c.forEach(i);
75
95
  }
76
96
  n = {
77
- push: function(l) {
78
- return i(l);
97
+ push: function(s) {
98
+ return i(s);
79
99
  },
80
100
  filter: function() {
81
101
  return n;
@@ -83,501 +103,501 @@ function zn(t, e) {
83
103
  };
84
104
  },
85
105
  assignMedium: function(i) {
86
- o = !0;
87
- var s = [];
106
+ r = !0;
107
+ var c = [];
88
108
  if (n.length) {
89
- var l = n;
90
- n = [], l.forEach(i), s = n;
109
+ var s = n;
110
+ n = [], s.forEach(i), c = n;
91
111
  }
92
- var d = function() {
93
- var u = s;
94
- s = [], u.forEach(i);
95
- }, c = function() {
96
- return Promise.resolve().then(d);
112
+ var u = function() {
113
+ var l = c;
114
+ c = [], l.forEach(i);
115
+ }, f = function() {
116
+ return Promise.resolve().then(u);
97
117
  };
98
- c(), n = {
99
- push: function(u) {
100
- s.push(u), c();
118
+ f(), n = {
119
+ push: function(l) {
120
+ c.push(l), f();
101
121
  },
102
- filter: function(u) {
103
- return s = s.filter(u), n;
122
+ filter: function(l) {
123
+ return c = c.filter(l), n;
104
124
  }
105
125
  };
106
126
  }
107
127
  };
108
- return a;
128
+ return o;
109
129
  }
110
- function Vn(t) {
130
+ function De(t) {
111
131
  t === void 0 && (t = {});
112
- var e = zn(null);
113
- return e.options = mt({ async: !0, ssr: !1 }, t), e;
132
+ var e = Te(null);
133
+ return e.options = I({ async: !0, ssr: !1 }, t), e;
114
134
  }
115
- var tn = function(t) {
116
- var e = t.sideCar, n = Je(t, ["sideCar"]);
135
+ var oe = function(t) {
136
+ var e = t.sideCar, n = re(t, ["sideCar"]);
117
137
  if (!e)
118
138
  throw new Error("Sidecar: please provide `sideCar` property to import the right car");
119
- var o = e.read();
120
- if (!o)
139
+ var r = e.read();
140
+ if (!r)
121
141
  throw new Error("Sidecar medium not found");
122
- return S.createElement(o, mt({}, n));
142
+ return w.createElement(r, I({}, n));
123
143
  };
124
- tn.isSideCarExport = !0;
125
- function Yn(t, e) {
126
- return t.useMedium(e), tn;
127
- }
128
- var en = Vn(), ue = function() {
129
- }, ee = S.forwardRef(function(t, e) {
130
- var n = S.useRef(null), o = S.useState({
131
- onScrollCapture: ue,
132
- onWheelCapture: ue,
133
- onTouchMoveCapture: ue
134
- }), a = o[0], i = o[1], s = t.forwardProps, l = t.children, d = t.className, c = t.removeScrollBar, u = t.enabled, r = t.shards, f = t.sideCar, m = t.noRelative, p = t.noIsolation, h = t.inert, y = t.allowPinchZoom, g = t.as, b = g === void 0 ? "div" : g, w = t.gapMode, x = Je(t, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), E = f, R = Wn([n, e]), A = mt(mt({}, x), a);
135
- return S.createElement(
136
- S.Fragment,
144
+ oe.isSideCarExport = !0;
145
+ function We(t, e) {
146
+ return t.useMedium(e), oe;
147
+ }
148
+ var ie = De(), Et = function() {
149
+ }, xt = w.forwardRef(function(t, e) {
150
+ var n = w.useRef(null), r = w.useState({
151
+ onScrollCapture: Et,
152
+ onWheelCapture: Et,
153
+ onTouchMoveCapture: Et
154
+ }), o = r[0], i = r[1], c = t.forwardProps, s = t.children, u = t.className, f = t.removeScrollBar, l = t.enabled, a = t.shards, m = t.sideCar, h = t.noRelative, v = t.noIsolation, d = t.inert, g = t.allowPinchZoom, p = t.as, y = p === void 0 ? "div" : p, x = t.gapMode, b = re(t, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), S = m, C = ke([n, e]), R = I(I({}, b), o);
155
+ return w.createElement(
156
+ w.Fragment,
137
157
  null,
138
- u && S.createElement(E, { sideCar: en, removeScrollBar: c, shards: r, noRelative: m, noIsolation: p, inert: h, setCallbacks: i, allowPinchZoom: !!y, lockRef: n, gapMode: w }),
139
- s ? S.cloneElement(S.Children.only(l), mt(mt({}, A), { ref: R })) : S.createElement(b, mt({}, A, { className: d, ref: R }), l)
158
+ l && w.createElement(S, { sideCar: ie, removeScrollBar: f, shards: a, noRelative: h, noIsolation: v, inert: d, setCallbacks: i, allowPinchZoom: !!g, lockRef: n, gapMode: x }),
159
+ c ? w.cloneElement(w.Children.only(s), I(I({}, R), { ref: C })) : w.createElement(y, I({}, R, { className: u, ref: C }), s)
140
160
  );
141
161
  });
142
- ee.defaultProps = {
162
+ xt.defaultProps = {
143
163
  enabled: !0,
144
164
  removeScrollBar: !0,
145
165
  inert: !1
146
166
  };
147
- ee.classNames = {
148
- fullWidth: Kt,
149
- zeroRight: qt
167
+ xt.classNames = {
168
+ fullWidth: mt,
169
+ zeroRight: ht
150
170
  };
151
- var jn = function() {
171
+ var Ne = function() {
152
172
  if (typeof __webpack_nonce__ < "u")
153
173
  return __webpack_nonce__;
154
174
  };
155
- function Xn() {
175
+ function Be() {
156
176
  if (typeof document === "undefined")
157
177
  return null;
158
178
  var t = document.createElement("style");
159
179
  t.type = "text/css";
160
- var e = jn();
180
+ var e = Ne();
161
181
  return e && t.setAttribute("nonce", e), t;
162
182
  }
163
- function Un(t, e) {
183
+ function Fe(t, e) {
164
184
  t.styleSheet ? t.styleSheet.cssText = e : t.appendChild(document.createTextNode(e));
165
185
  }
166
- function qn(t) {
186
+ function Ve(t) {
167
187
  var e = document.head || document.getElementsByTagName("head")[0];
168
188
  e.appendChild(t);
169
189
  }
170
- var Kn = function() {
190
+ var He = function() {
171
191
  var t = 0, e = null;
172
192
  return {
173
193
  add: function(n) {
174
- t == 0 && (e = Xn()) && (Un(e, n), qn(e)), t++;
194
+ t == 0 && (e = Be()) && (Fe(e, n), Ve(e)), t++;
175
195
  },
176
196
  remove: function() {
177
197
  t--, !t && e && (e.parentNode && e.parentNode.removeChild(e), e = null);
178
198
  }
179
199
  };
180
- }, Zn = function() {
181
- var t = Kn();
200
+ }, $e = function() {
201
+ var t = He();
182
202
  return function(e, n) {
183
- S.useEffect(function() {
203
+ w.useEffect(function() {
184
204
  return t.add(e), function() {
185
205
  t.remove();
186
206
  };
187
207
  }, [e && n]);
188
208
  };
189
- }, nn = function() {
190
- var t = Zn(), e = function(n) {
191
- var o = n.styles, a = n.dynamic;
192
- return t(o, a), null;
209
+ }, ce = function() {
210
+ var t = $e(), e = function(n) {
211
+ var r = n.styles, o = n.dynamic;
212
+ return t(r, o), null;
193
213
  };
194
214
  return e;
195
- }, Gn = {
215
+ }, Ie = {
196
216
  left: 0,
197
217
  top: 0,
198
218
  right: 0,
199
219
  gap: 0
200
- }, de = function(t) {
220
+ }, Ot = function(t) {
201
221
  return parseInt(t || "", 10) || 0;
202
- }, Qn = function(t) {
203
- var e = window.getComputedStyle(document.body), n = e[t === "padding" ? "paddingLeft" : "marginLeft"], o = e[t === "padding" ? "paddingTop" : "marginTop"], a = e[t === "padding" ? "paddingRight" : "marginRight"];
204
- return [de(n), de(o), de(a)];
205
- }, Jn = function(t) {
222
+ }, _e = function(t) {
223
+ var e = window.getComputedStyle(document.body), n = e[t === "padding" ? "paddingLeft" : "marginLeft"], r = e[t === "padding" ? "paddingTop" : "marginTop"], o = e[t === "padding" ? "paddingRight" : "marginRight"];
224
+ return [Ot(n), Ot(r), Ot(o)];
225
+ }, ze = function(t) {
206
226
  if (t === void 0 && (t = "margin"), typeof window > "u")
207
- return Gn;
208
- var e = Qn(t), n = document.documentElement.clientWidth, o = window.innerWidth;
227
+ return Ie;
228
+ var e = _e(t), n = document.documentElement.clientWidth, r = window.innerWidth;
209
229
  return {
210
230
  left: e[0],
211
231
  top: e[1],
212
232
  right: e[2],
213
- gap: Math.max(0, o - n + e[2] - e[0])
233
+ gap: Math.max(0, r - n + e[2] - e[0])
214
234
  };
215
- }, to = nn(), kt = "data-scroll-locked", eo = function(t, e, n, o) {
216
- var a = t.left, i = t.top, s = t.right, l = t.gap;
235
+ }, je = ce(), et = "data-scroll-locked", Xe = function(t, e, n, r) {
236
+ var o = t.left, i = t.top, c = t.right, s = t.gap;
217
237
  return n === void 0 && (n = "margin"), `
218
- .`.concat(_n, ` {
219
- overflow: hidden `).concat(o, `;
220
- padding-right: `).concat(l, "px ").concat(o, `;
238
+ .`.concat(Ee, ` {
239
+ overflow: hidden `).concat(r, `;
240
+ padding-right: `).concat(s, "px ").concat(r, `;
221
241
  }
222
- body[`).concat(kt, `] {
223
- overflow: hidden `).concat(o, `;
242
+ body[`).concat(et, `] {
243
+ overflow: hidden `).concat(r, `;
224
244
  overscroll-behavior: contain;
225
245
  `).concat([
226
- e && "position: relative ".concat(o, ";"),
246
+ e && "position: relative ".concat(r, ";"),
227
247
  n === "margin" && `
228
- padding-left: `.concat(a, `px;
248
+ padding-left: `.concat(o, `px;
229
249
  padding-top: `).concat(i, `px;
230
- padding-right: `).concat(s, `px;
250
+ padding-right: `).concat(c, `px;
231
251
  margin-left:0;
232
252
  margin-top:0;
233
- margin-right: `).concat(l, "px ").concat(o, `;
253
+ margin-right: `).concat(s, "px ").concat(r, `;
234
254
  `),
235
- n === "padding" && "padding-right: ".concat(l, "px ").concat(o, ";")
255
+ n === "padding" && "padding-right: ".concat(s, "px ").concat(r, ";")
236
256
  ].filter(Boolean).join(""), `
237
257
  }
238
258
 
239
- .`).concat(qt, ` {
240
- right: `).concat(l, "px ").concat(o, `;
259
+ .`).concat(ht, ` {
260
+ right: `).concat(s, "px ").concat(r, `;
241
261
  }
242
262
 
243
- .`).concat(Kt, ` {
244
- margin-right: `).concat(l, "px ").concat(o, `;
263
+ .`).concat(mt, ` {
264
+ margin-right: `).concat(s, "px ").concat(r, `;
245
265
  }
246
266
 
247
- .`).concat(qt, " .").concat(qt, ` {
248
- right: 0 `).concat(o, `;
267
+ .`).concat(ht, " .").concat(ht, ` {
268
+ right: 0 `).concat(r, `;
249
269
  }
250
270
 
251
- .`).concat(Kt, " .").concat(Kt, ` {
252
- margin-right: 0 `).concat(o, `;
271
+ .`).concat(mt, " .").concat(mt, ` {
272
+ margin-right: 0 `).concat(r, `;
253
273
  }
254
274
 
255
- body[`).concat(kt, `] {
256
- `).concat(In, ": ").concat(l, `px;
275
+ body[`).concat(et, `] {
276
+ `).concat(Oe, ": ").concat(s, `px;
257
277
  }
258
278
  `);
259
- }, _e = function() {
260
- var t = parseInt(document.body.getAttribute(kt) || "0", 10);
279
+ }, _t = function() {
280
+ var t = parseInt(document.body.getAttribute(et) || "0", 10);
261
281
  return isFinite(t) ? t : 0;
262
- }, no = function() {
263
- S.useEffect(function() {
264
- return document.body.setAttribute(kt, (_e() + 1).toString()), function() {
265
- var t = _e() - 1;
266
- t <= 0 ? document.body.removeAttribute(kt) : document.body.setAttribute(kt, t.toString());
282
+ }, Ye = function() {
283
+ w.useEffect(function() {
284
+ return document.body.setAttribute(et, (_t() + 1).toString()), function() {
285
+ var t = _t() - 1;
286
+ t <= 0 ? document.body.removeAttribute(et) : document.body.setAttribute(et, t.toString());
267
287
  };
268
288
  }, []);
269
- }, oo = function(t) {
270
- var e = t.noRelative, n = t.noImportant, o = t.gapMode, a = o === void 0 ? "margin" : o;
271
- no();
272
- var i = S.useMemo(function() {
273
- return Jn(a);
274
- }, [a]);
275
- return S.createElement(to, { styles: eo(i, !e, a, n ? "" : "!important") });
276
- }, ge = !1;
289
+ }, qe = function(t) {
290
+ var e = t.noRelative, n = t.noImportant, r = t.gapMode, o = r === void 0 ? "margin" : r;
291
+ Ye();
292
+ var i = w.useMemo(function() {
293
+ return ze(o);
294
+ }, [o]);
295
+ return w.createElement(je, { styles: Xe(i, !e, o, n ? "" : "!important") });
296
+ }, Lt = !1;
277
297
  if (typeof window < "u")
278
298
  try {
279
- var zt = Object.defineProperty({}, "passive", {
299
+ var at = Object.defineProperty({}, "passive", {
280
300
  get: function() {
281
- return ge = !0, !0;
301
+ return Lt = !0, !0;
282
302
  }
283
303
  });
284
- window.addEventListener("test", zt, zt), window.removeEventListener("test", zt, zt);
304
+ window.addEventListener("test", at, at), window.removeEventListener("test", at, at);
285
305
  } catch {
286
- ge = !1;
306
+ Lt = !1;
287
307
  }
288
- var Ct = ge ? { passive: !1 } : !1, ro = function(t) {
308
+ var Q = Lt ? { passive: !1 } : !1, Ze = function(t) {
289
309
  return t.tagName === "TEXTAREA";
290
- }, on = function(t, e) {
310
+ }, se = function(t, e) {
291
311
  if (!(t instanceof Element))
292
312
  return !1;
293
313
  var n = window.getComputedStyle(t);
294
314
  return (
295
315
  // not-not-scrollable
296
316
  n[e] !== "hidden" && // contains scroll inside self
297
- !(n.overflowY === n.overflowX && !ro(t) && n[e] === "visible")
317
+ !(n.overflowY === n.overflowX && !Ze(t) && n[e] === "visible")
298
318
  );
299
- }, ao = function(t) {
300
- return on(t, "overflowY");
301
- }, io = function(t) {
302
- return on(t, "overflowX");
303
- }, Ie = function(t, e) {
304
- var n = e.ownerDocument, o = e;
319
+ }, Ue = function(t) {
320
+ return se(t, "overflowY");
321
+ }, Ge = function(t) {
322
+ return se(t, "overflowX");
323
+ }, zt = function(t, e) {
324
+ var n = e.ownerDocument, r = e;
305
325
  do {
306
- typeof ShadowRoot < "u" && o instanceof ShadowRoot && (o = o.host);
307
- var a = rn(t, o);
308
- if (a) {
309
- var i = an(t, o), s = i[1], l = i[2];
310
- if (s > l)
326
+ typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
327
+ var o = ae(t, r);
328
+ if (o) {
329
+ var i = le(t, r), c = i[1], s = i[2];
330
+ if (c > s)
311
331
  return !0;
312
332
  }
313
- o = o.parentNode;
314
- } while (o && o !== n.body);
333
+ r = r.parentNode;
334
+ } while (r && r !== n.body);
315
335
  return !1;
316
- }, so = function(t) {
317
- var e = t.scrollTop, n = t.scrollHeight, o = t.clientHeight;
336
+ }, Ke = function(t) {
337
+ var e = t.scrollTop, n = t.scrollHeight, r = t.clientHeight;
318
338
  return [
319
339
  e,
320
340
  n,
321
- o
341
+ r
322
342
  ];
323
- }, lo = function(t) {
324
- var e = t.scrollLeft, n = t.scrollWidth, o = t.clientWidth;
343
+ }, Qe = function(t) {
344
+ var e = t.scrollLeft, n = t.scrollWidth, r = t.clientWidth;
325
345
  return [
326
346
  e,
327
347
  n,
328
- o
348
+ r
329
349
  ];
330
- }, rn = function(t, e) {
331
- return t === "v" ? ao(e) : io(e);
332
- }, an = function(t, e) {
333
- return t === "v" ? so(e) : lo(e);
334
- }, co = function(t, e) {
350
+ }, ae = function(t, e) {
351
+ return t === "v" ? Ue(e) : Ge(e);
352
+ }, le = function(t, e) {
353
+ return t === "v" ? Ke(e) : Qe(e);
354
+ }, Je = function(t, e) {
335
355
  return t === "h" && e === "rtl" ? -1 : 1;
336
- }, uo = function(t, e, n, o, a) {
337
- var i = co(t, window.getComputedStyle(e).direction), s = i * o, l = n.target, d = e.contains(l), c = !1, u = s > 0, r = 0, f = 0;
356
+ }, tn = function(t, e, n, r, o) {
357
+ var i = Je(t, window.getComputedStyle(e).direction), c = i * r, s = n.target, u = e.contains(s), f = !1, l = c > 0, a = 0, m = 0;
338
358
  do {
339
- if (!l)
359
+ if (!s)
340
360
  break;
341
- var m = an(t, l), p = m[0], h = m[1], y = m[2], g = h - y - i * p;
342
- (p || g) && rn(t, l) && (r += g, f += p);
343
- var b = l.parentNode;
344
- l = b && b.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? b.host : b;
361
+ var h = le(t, s), v = h[0], d = h[1], g = h[2], p = d - g - i * v;
362
+ (v || p) && ae(t, s) && (a += p, m += v);
363
+ var y = s.parentNode;
364
+ s = y && y.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? y.host : y;
345
365
  } while (
346
366
  // portaled content
347
- !d && l !== document.body || // self content
348
- d && (e.contains(l) || e === l)
367
+ !u && s !== document.body || // self content
368
+ u && (e.contains(s) || e === s)
349
369
  );
350
- return (u && Math.abs(r) < 1 || !u && Math.abs(f) < 1) && (c = !0), c;
351
- }, Vt = function(t) {
370
+ return (l && Math.abs(a) < 1 || !l && Math.abs(m) < 1) && (f = !0), f;
371
+ }, lt = function(t) {
352
372
  return "changedTouches" in t ? [t.changedTouches[0].clientX, t.changedTouches[0].clientY] : [0, 0];
353
- }, He = function(t) {
373
+ }, jt = function(t) {
354
374
  return [t.deltaX, t.deltaY];
355
- }, Fe = function(t) {
375
+ }, Xt = function(t) {
356
376
  return t && "current" in t ? t.current : t;
357
- }, fo = function(t, e) {
377
+ }, en = function(t, e) {
358
378
  return t[0] === e[0] && t[1] === e[1];
359
- }, mo = function(t) {
379
+ }, nn = function(t) {
360
380
  return `
361
381
  .block-interactivity-`.concat(t, ` {pointer-events: none;}
362
382
  .allow-interactivity-`).concat(t, ` {pointer-events: all;}
363
383
  `);
364
- }, ho = 0, Tt = [];
365
- function go(t) {
366
- var e = S.useRef([]), n = S.useRef([0, 0]), o = S.useRef(), a = S.useState(ho++)[0], i = S.useState(nn)[0], s = S.useRef(t);
367
- S.useEffect(function() {
368
- s.current = t;
369
- }, [t]), S.useEffect(function() {
384
+ }, rn = 0, J = [];
385
+ function on(t) {
386
+ var e = w.useRef([]), n = w.useRef([0, 0]), r = w.useRef(), o = w.useState(rn++)[0], i = w.useState(ce)[0], c = w.useRef(t);
387
+ w.useEffect(function() {
388
+ c.current = t;
389
+ }, [t]), w.useEffect(function() {
370
390
  if (t.inert) {
371
- document.body.classList.add("block-interactivity-".concat(a));
372
- var h = Pn([t.lockRef.current], (t.shards || []).map(Fe), !0).filter(Boolean);
373
- return h.forEach(function(y) {
374
- return y.classList.add("allow-interactivity-".concat(a));
391
+ document.body.classList.add("block-interactivity-".concat(o));
392
+ var d = Ae([t.lockRef.current], (t.shards || []).map(Xt), !0).filter(Boolean);
393
+ return d.forEach(function(g) {
394
+ return g.classList.add("allow-interactivity-".concat(o));
375
395
  }), function() {
376
- document.body.classList.remove("block-interactivity-".concat(a)), h.forEach(function(y) {
377
- return y.classList.remove("allow-interactivity-".concat(a));
396
+ document.body.classList.remove("block-interactivity-".concat(o)), d.forEach(function(g) {
397
+ return g.classList.remove("allow-interactivity-".concat(o));
378
398
  });
379
399
  };
380
400
  }
381
401
  }, [t.inert, t.lockRef.current, t.shards]);
382
- var l = S.useCallback(function(h, y) {
383
- if ("touches" in h && h.touches.length === 2 || h.type === "wheel" && h.ctrlKey)
384
- return !s.current.allowPinchZoom;
385
- var g = Vt(h), b = n.current, w = "deltaX" in h ? h.deltaX : b[0] - g[0], x = "deltaY" in h ? h.deltaY : b[1] - g[1], E, R = h.target, A = Math.abs(w) > Math.abs(x) ? "h" : "v";
386
- if ("touches" in h && A === "h" && R.type === "range")
402
+ var s = w.useCallback(function(d, g) {
403
+ if ("touches" in d && d.touches.length === 2 || d.type === "wheel" && d.ctrlKey)
404
+ return !c.current.allowPinchZoom;
405
+ var p = lt(d), y = n.current, x = "deltaX" in d ? d.deltaX : y[0] - p[0], b = "deltaY" in d ? d.deltaY : y[1] - p[1], S, C = d.target, R = Math.abs(x) > Math.abs(b) ? "h" : "v";
406
+ if ("touches" in d && R === "h" && C.type === "range")
387
407
  return !1;
388
- var D = window.getSelection(), $ = D && D.anchorNode, B = $ ? $ === R || $.contains(R) : !1;
389
- if (B)
408
+ var P = window.getSelection(), L = P && P.anchorNode, O = L ? L === C || L.contains(C) : !1;
409
+ if (O)
390
410
  return !1;
391
- var H = Ie(A, R);
392
- if (!H)
411
+ var M = zt(R, C);
412
+ if (!M)
393
413
  return !0;
394
- if (H ? E = A : (E = A === "v" ? "h" : "v", H = Ie(A, R)), !H)
414
+ if (M ? S = R : (S = R === "v" ? "h" : "v", M = zt(R, C)), !M)
395
415
  return !1;
396
- if (!o.current && "changedTouches" in h && (w || x) && (o.current = E), !E)
416
+ if (!r.current && "changedTouches" in d && (x || b) && (r.current = S), !S)
397
417
  return !0;
398
- var _ = o.current || E;
399
- return uo(_, y, h, _ === "h" ? w : x);
400
- }, []), d = S.useCallback(function(h) {
401
- var y = h;
402
- if (!(!Tt.length || Tt[Tt.length - 1] !== i)) {
403
- var g = "deltaY" in y ? He(y) : Vt(y), b = e.current.filter(function(E) {
404
- return E.name === y.type && (E.target === y.target || y.target === E.shadowParent) && fo(E.delta, g);
418
+ var T = r.current || S;
419
+ return tn(T, g, d, T === "h" ? x : b);
420
+ }, []), u = w.useCallback(function(d) {
421
+ var g = d;
422
+ if (!(!J.length || J[J.length - 1] !== i)) {
423
+ var p = "deltaY" in g ? jt(g) : lt(g), y = e.current.filter(function(S) {
424
+ return S.name === g.type && (S.target === g.target || g.target === S.shadowParent) && en(S.delta, p);
405
425
  })[0];
406
- if (b && b.should) {
407
- y.cancelable && y.preventDefault();
426
+ if (y && y.should) {
427
+ g.cancelable && g.preventDefault();
408
428
  return;
409
429
  }
410
- if (!b) {
411
- var w = (s.current.shards || []).map(Fe).filter(Boolean).filter(function(E) {
412
- return E.contains(y.target);
413
- }), x = w.length > 0 ? l(y, w[0]) : !s.current.noIsolation;
414
- x && y.cancelable && y.preventDefault();
430
+ if (!y) {
431
+ var x = (c.current.shards || []).map(Xt).filter(Boolean).filter(function(S) {
432
+ return S.contains(g.target);
433
+ }), b = x.length > 0 ? s(g, x[0]) : !c.current.noIsolation;
434
+ b && g.cancelable && g.preventDefault();
415
435
  }
416
436
  }
417
- }, []), c = S.useCallback(function(h, y, g, b) {
418
- var w = { name: h, delta: y, target: g, should: b, shadowParent: po(g) };
419
- e.current.push(w), setTimeout(function() {
420
- e.current = e.current.filter(function(x) {
421
- return x !== w;
437
+ }, []), f = w.useCallback(function(d, g, p, y) {
438
+ var x = { name: d, delta: g, target: p, should: y, shadowParent: cn(p) };
439
+ e.current.push(x), setTimeout(function() {
440
+ e.current = e.current.filter(function(b) {
441
+ return b !== x;
422
442
  });
423
443
  }, 1);
424
- }, []), u = S.useCallback(function(h) {
425
- n.current = Vt(h), o.current = void 0;
426
- }, []), r = S.useCallback(function(h) {
427
- c(h.type, He(h), h.target, l(h, t.lockRef.current));
428
- }, []), f = S.useCallback(function(h) {
429
- c(h.type, Vt(h), h.target, l(h, t.lockRef.current));
444
+ }, []), l = w.useCallback(function(d) {
445
+ n.current = lt(d), r.current = void 0;
446
+ }, []), a = w.useCallback(function(d) {
447
+ f(d.type, jt(d), d.target, s(d, t.lockRef.current));
448
+ }, []), m = w.useCallback(function(d) {
449
+ f(d.type, lt(d), d.target, s(d, t.lockRef.current));
430
450
  }, []);
431
- S.useEffect(function() {
432
- return Tt.push(i), t.setCallbacks({
433
- onScrollCapture: r,
434
- onWheelCapture: r,
435
- onTouchMoveCapture: f
436
- }), document.addEventListener("wheel", d, Ct), document.addEventListener("touchmove", d, Ct), document.addEventListener("touchstart", u, Ct), function() {
437
- Tt = Tt.filter(function(h) {
438
- return h !== i;
439
- }), document.removeEventListener("wheel", d, Ct), document.removeEventListener("touchmove", d, Ct), document.removeEventListener("touchstart", u, Ct);
451
+ w.useEffect(function() {
452
+ return J.push(i), t.setCallbacks({
453
+ onScrollCapture: a,
454
+ onWheelCapture: a,
455
+ onTouchMoveCapture: m
456
+ }), document.addEventListener("wheel", u, Q), document.addEventListener("touchmove", u, Q), document.addEventListener("touchstart", l, Q), function() {
457
+ J = J.filter(function(d) {
458
+ return d !== i;
459
+ }), document.removeEventListener("wheel", u, Q), document.removeEventListener("touchmove", u, Q), document.removeEventListener("touchstart", l, Q);
440
460
  };
441
461
  }, []);
442
- var m = t.removeScrollBar, p = t.inert;
443
- return S.createElement(
444
- S.Fragment,
462
+ var h = t.removeScrollBar, v = t.inert;
463
+ return w.createElement(
464
+ w.Fragment,
445
465
  null,
446
- p ? S.createElement(i, { styles: mo(a) }) : null,
447
- m ? S.createElement(oo, { noRelative: t.noRelative, gapMode: t.gapMode }) : null
466
+ v ? w.createElement(i, { styles: nn(o) }) : null,
467
+ h ? w.createElement(qe, { noRelative: t.noRelative, gapMode: t.gapMode }) : null
448
468
  );
449
469
  }
450
- function po(t) {
470
+ function cn(t) {
451
471
  for (var e = null; t !== null; )
452
472
  t instanceof ShadowRoot && (e = t.host, t = t.host), t = t.parentNode;
453
473
  return e;
454
474
  }
455
- const vo = Yn(en, go);
456
- var yo = S.forwardRef(function(t, e) {
457
- return S.createElement(ee, mt({}, t, { ref: e, sideCar: vo }));
475
+ const sn = We(ie, on);
476
+ var an = w.forwardRef(function(t, e) {
477
+ return w.createElement(xt, I({}, t, { ref: e, sideCar: sn }));
458
478
  });
459
- yo.classNames = ee.classNames;
460
- var bo = function(t) {
479
+ an.classNames = xt.classNames;
480
+ var ln = function(t) {
461
481
  if (typeof document > "u")
462
482
  return null;
463
483
  var e = Array.isArray(t) ? t[0] : t;
464
484
  return e.ownerDocument.body;
465
- }, At = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new WeakMap(), jt = {}, fe = 0, sn = function(t) {
466
- return t && (t.host || sn(t.parentNode));
467
- }, wo = function(t, e) {
485
+ }, tt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), ut = {}, Pt = 0, fe = function(t) {
486
+ return t && (t.host || fe(t.parentNode));
487
+ }, fn = function(t, e) {
468
488
  return e.map(function(n) {
469
489
  if (t.contains(n))
470
490
  return n;
471
- var o = sn(n);
472
- return o && t.contains(o) ? o : (console.error("aria-hidden", n, "in not contained inside", t, ". Doing nothing"), null);
491
+ var r = fe(n);
492
+ return r && t.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", t, ". Doing nothing"), null);
473
493
  }).filter(function(n) {
474
494
  return !!n;
475
495
  });
476
- }, xo = function(t, e, n, o) {
477
- var a = wo(e, Array.isArray(t) ? t : [t]);
478
- jt[n] || (jt[n] = /* @__PURE__ */ new WeakMap());
479
- var i = jt[n], s = [], l = /* @__PURE__ */ new Set(), d = new Set(a), c = function(r) {
480
- !r || l.has(r) || (l.add(r), c(r.parentNode));
496
+ }, un = function(t, e, n, r) {
497
+ var o = fn(e, Array.isArray(t) ? t : [t]);
498
+ ut[n] || (ut[n] = /* @__PURE__ */ new WeakMap());
499
+ var i = ut[n], c = [], s = /* @__PURE__ */ new Set(), u = new Set(o), f = function(a) {
500
+ !a || s.has(a) || (s.add(a), f(a.parentNode));
481
501
  };
482
- a.forEach(c);
483
- var u = function(r) {
484
- !r || d.has(r) || Array.prototype.forEach.call(r.children, function(f) {
485
- if (l.has(f))
486
- u(f);
502
+ o.forEach(f);
503
+ var l = function(a) {
504
+ !a || u.has(a) || Array.prototype.forEach.call(a.children, function(m) {
505
+ if (s.has(m))
506
+ l(m);
487
507
  else
488
508
  try {
489
- var m = f.getAttribute(o), p = m !== null && m !== "false", h = (At.get(f) || 0) + 1, y = (i.get(f) || 0) + 1;
490
- At.set(f, h), i.set(f, y), s.push(f), h === 1 && p && Yt.set(f, !0), y === 1 && f.setAttribute(n, "true"), p || f.setAttribute(o, "true");
491
- } catch (g) {
492
- console.error("aria-hidden: cannot operate on ", f, g);
509
+ var h = m.getAttribute(r), v = h !== null && h !== "false", d = (tt.get(m) || 0) + 1, g = (i.get(m) || 0) + 1;
510
+ tt.set(m, d), i.set(m, g), c.push(m), d === 1 && v && ft.set(m, !0), g === 1 && m.setAttribute(n, "true"), v || m.setAttribute(r, "true");
511
+ } catch (p) {
512
+ console.error("aria-hidden: cannot operate on ", m, p);
493
513
  }
494
514
  });
495
515
  };
496
- return u(e), l.clear(), fe++, function() {
497
- s.forEach(function(r) {
498
- var f = At.get(r) - 1, m = i.get(r) - 1;
499
- At.set(r, f), i.set(r, m), f || (Yt.has(r) || r.removeAttribute(o), Yt.delete(r)), m || r.removeAttribute(n);
500
- }), fe--, fe || (At = /* @__PURE__ */ new WeakMap(), At = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new WeakMap(), jt = {});
516
+ return l(e), s.clear(), Pt++, function() {
517
+ c.forEach(function(a) {
518
+ var m = tt.get(a) - 1, h = i.get(a) - 1;
519
+ tt.set(a, m), i.set(a, h), m || (ft.has(a) || a.removeAttribute(r), ft.delete(a)), h || a.removeAttribute(n);
520
+ }), Pt--, Pt || (tt = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), ft = /* @__PURE__ */ new WeakMap(), ut = {});
501
521
  };
502
- }, ta = function(t, e, n) {
522
+ }, gr = function(t, e, n) {
503
523
  n === void 0 && (n = "data-aria-hidden");
504
- var o = Array.from(Array.isArray(t) ? t : [t]), a = bo(t);
505
- return a ? (o.push.apply(o, Array.from(a.querySelectorAll("[aria-live], script"))), xo(o, a, n, "aria-hidden")) : function() {
524
+ var r = Array.from(Array.isArray(t) ? t : [t]), o = ln(t);
525
+ return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), un(r, o, n, "aria-hidden")) : function() {
506
526
  return null;
507
527
  };
508
528
  };
509
- const So = ["top", "right", "bottom", "left"], ht = Math.min, Z = Math.max, Gt = Math.round, Xt = Math.floor, it = (t) => ({
529
+ const dn = ["top", "right", "bottom", "left"], U = Math.min, B = Math.max, vt = Math.round, dt = Math.floor, z = (t) => ({
510
530
  x: t,
511
531
  y: t
512
- }), Eo = {
532
+ }), hn = {
513
533
  left: "right",
514
534
  right: "left",
515
535
  bottom: "top",
516
536
  top: "bottom"
517
- }, Ro = {
537
+ }, mn = {
518
538
  start: "end",
519
539
  end: "start"
520
540
  };
521
- function pe(t, e, n) {
522
- return Z(t, ht(e, n));
541
+ function Tt(t, e, n) {
542
+ return B(t, U(e, n));
523
543
  }
524
- function ut(t, e) {
544
+ function Y(t, e) {
525
545
  return typeof t == "function" ? t(e) : t;
526
546
  }
527
- function dt(t) {
547
+ function q(t) {
528
548
  return t.split("-")[0];
529
549
  }
530
- function Dt(t) {
550
+ function ot(t) {
531
551
  return t.split("-")[1];
532
552
  }
533
- function we(t) {
553
+ function Nt(t) {
534
554
  return t === "x" ? "y" : "x";
535
555
  }
536
- function xe(t) {
556
+ function Bt(t) {
537
557
  return t === "y" ? "height" : "width";
538
558
  }
539
- const Co = /* @__PURE__ */ new Set(["top", "bottom"]);
540
- function at(t) {
541
- return Co.has(dt(t)) ? "y" : "x";
559
+ const gn = /* @__PURE__ */ new Set(["top", "bottom"]);
560
+ function _(t) {
561
+ return gn.has(q(t)) ? "y" : "x";
542
562
  }
543
- function Se(t) {
544
- return we(at(t));
563
+ function Ft(t) {
564
+ return Nt(_(t));
545
565
  }
546
- function To(t, e, n) {
566
+ function vn(t, e, n) {
547
567
  n === void 0 && (n = !1);
548
- const o = Dt(t), a = Se(t), i = xe(a);
549
- let s = a === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
550
- return e.reference[i] > e.floating[i] && (s = Qt(s)), [s, Qt(s)];
568
+ const r = ot(t), o = Ft(t), i = Bt(o);
569
+ let c = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
570
+ return e.reference[i] > e.floating[i] && (c = pt(c)), [c, pt(c)];
551
571
  }
552
- function Ao(t) {
553
- const e = Qt(t);
554
- return [ve(t), e, ve(e)];
572
+ function pn(t) {
573
+ const e = pt(t);
574
+ return [Dt(t), e, Dt(e)];
555
575
  }
556
- function ve(t) {
557
- return t.replace(/start|end/g, (e) => Ro[e]);
576
+ function Dt(t) {
577
+ return t.replace(/start|end/g, (e) => mn[e]);
558
578
  }
559
- const We = ["left", "right"], $e = ["right", "left"], ko = ["top", "bottom"], Mo = ["bottom", "top"];
560
- function Oo(t, e, n) {
579
+ const Yt = ["left", "right"], qt = ["right", "left"], wn = ["top", "bottom"], yn = ["bottom", "top"];
580
+ function xn(t, e, n) {
561
581
  switch (t) {
562
582
  case "top":
563
583
  case "bottom":
564
- return n ? e ? $e : We : e ? We : $e;
584
+ return n ? e ? qt : Yt : e ? Yt : qt;
565
585
  case "left":
566
586
  case "right":
567
- return e ? ko : Mo;
587
+ return e ? wn : yn;
568
588
  default:
569
589
  return [];
570
590
  }
571
591
  }
572
- function Do(t, e, n, o) {
573
- const a = Dt(t);
574
- let i = Oo(dt(t), n === "start", o);
575
- return a && (i = i.map((s) => s + "-" + a), e && (i = i.concat(i.map(ve)))), i;
592
+ function bn(t, e, n, r) {
593
+ const o = ot(t);
594
+ let i = xn(q(t), n === "start", r);
595
+ return o && (i = i.map((c) => c + "-" + o), e && (i = i.concat(i.map(Dt)))), i;
576
596
  }
577
- function Qt(t) {
578
- return t.replace(/left|right|bottom|top/g, (e) => Eo[e]);
597
+ function pt(t) {
598
+ return t.replace(/left|right|bottom|top/g, (e) => hn[e]);
579
599
  }
580
- function No(t) {
600
+ function Sn(t) {
581
601
  return {
582
602
  top: 0,
583
603
  right: 0,
@@ -586,301 +606,301 @@ function No(t) {
586
606
  ...t
587
607
  };
588
608
  }
589
- function ln(t) {
590
- return typeof t != "number" ? No(t) : {
609
+ function ue(t) {
610
+ return typeof t != "number" ? Sn(t) : {
591
611
  top: t,
592
612
  right: t,
593
613
  bottom: t,
594
614
  left: t
595
615
  };
596
616
  }
597
- function Jt(t) {
617
+ function wt(t) {
598
618
  const {
599
619
  x: e,
600
620
  y: n,
601
- width: o,
602
- height: a
621
+ width: r,
622
+ height: o
603
623
  } = t;
604
624
  return {
605
- width: o,
606
- height: a,
625
+ width: r,
626
+ height: o,
607
627
  top: n,
608
628
  left: e,
609
- right: e + o,
610
- bottom: n + a,
629
+ right: e + r,
630
+ bottom: n + o,
611
631
  x: e,
612
632
  y: n
613
633
  };
614
634
  }
615
- function ze(t, e, n) {
635
+ function Zt(t, e, n) {
616
636
  let {
617
- reference: o,
618
- floating: a
637
+ reference: r,
638
+ floating: o
619
639
  } = t;
620
- const i = at(e), s = Se(e), l = xe(s), d = dt(e), c = i === "y", u = o.x + o.width / 2 - a.width / 2, r = o.y + o.height / 2 - a.height / 2, f = o[l] / 2 - a[l] / 2;
621
- let m;
622
- switch (d) {
640
+ const i = _(e), c = Ft(e), s = Bt(c), u = q(e), f = i === "y", l = r.x + r.width / 2 - o.width / 2, a = r.y + r.height / 2 - o.height / 2, m = r[s] / 2 - o[s] / 2;
641
+ let h;
642
+ switch (u) {
623
643
  case "top":
624
- m = {
625
- x: u,
626
- y: o.y - a.height
644
+ h = {
645
+ x: l,
646
+ y: r.y - o.height
627
647
  };
628
648
  break;
629
649
  case "bottom":
630
- m = {
631
- x: u,
632
- y: o.y + o.height
650
+ h = {
651
+ x: l,
652
+ y: r.y + r.height
633
653
  };
634
654
  break;
635
655
  case "right":
636
- m = {
637
- x: o.x + o.width,
638
- y: r
656
+ h = {
657
+ x: r.x + r.width,
658
+ y: a
639
659
  };
640
660
  break;
641
661
  case "left":
642
- m = {
643
- x: o.x - a.width,
644
- y: r
662
+ h = {
663
+ x: r.x - o.width,
664
+ y: a
645
665
  };
646
666
  break;
647
667
  default:
648
- m = {
649
- x: o.x,
650
- y: o.y
668
+ h = {
669
+ x: r.x,
670
+ y: r.y
651
671
  };
652
672
  }
653
- switch (Dt(e)) {
673
+ switch (ot(e)) {
654
674
  case "start":
655
- m[s] -= f * (n && c ? -1 : 1);
675
+ h[c] -= m * (n && f ? -1 : 1);
656
676
  break;
657
677
  case "end":
658
- m[s] += f * (n && c ? -1 : 1);
678
+ h[c] += m * (n && f ? -1 : 1);
659
679
  break;
660
680
  }
661
- return m;
681
+ return h;
662
682
  }
663
- async function Po(t, e) {
683
+ async function Cn(t, e) {
664
684
  var n;
665
685
  e === void 0 && (e = {});
666
686
  const {
667
- x: o,
668
- y: a,
687
+ x: r,
688
+ y: o,
669
689
  platform: i,
670
- rects: s,
671
- elements: l,
672
- strategy: d
690
+ rects: c,
691
+ elements: s,
692
+ strategy: u
673
693
  } = t, {
674
- boundary: c = "clippingAncestors",
675
- rootBoundary: u = "viewport",
676
- elementContext: r = "floating",
677
- altBoundary: f = !1,
678
- padding: m = 0
679
- } = ut(e, t), p = ln(m), y = l[f ? r === "floating" ? "reference" : "floating" : r], g = Jt(await i.getClippingRect({
680
- element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(l.floating)),
681
- boundary: c,
682
- rootBoundary: u,
683
- strategy: d
684
- })), b = r === "floating" ? {
685
- x: o,
686
- y: a,
687
- width: s.floating.width,
688
- height: s.floating.height
689
- } : s.reference, w = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(l.floating)), x = await (i.isElement == null ? void 0 : i.isElement(w)) ? await (i.getScale == null ? void 0 : i.getScale(w)) || {
694
+ boundary: f = "clippingAncestors",
695
+ rootBoundary: l = "viewport",
696
+ elementContext: a = "floating",
697
+ altBoundary: m = !1,
698
+ padding: h = 0
699
+ } = Y(e, t), v = ue(h), g = s[m ? a === "floating" ? "reference" : "floating" : a], p = wt(await i.getClippingRect({
700
+ element: (n = await (i.isElement == null ? void 0 : i.isElement(g))) == null || n ? g : g.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(s.floating)),
701
+ boundary: f,
702
+ rootBoundary: l,
703
+ strategy: u
704
+ })), y = a === "floating" ? {
705
+ x: r,
706
+ y: o,
707
+ width: c.floating.width,
708
+ height: c.floating.height
709
+ } : c.reference, x = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(s.floating)), b = await (i.isElement == null ? void 0 : i.isElement(x)) ? await (i.getScale == null ? void 0 : i.getScale(x)) || {
690
710
  x: 1,
691
711
  y: 1
692
712
  } : {
693
713
  x: 1,
694
714
  y: 1
695
- }, E = Jt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
696
- elements: l,
697
- rect: b,
698
- offsetParent: w,
699
- strategy: d
700
- }) : b);
715
+ }, S = wt(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
716
+ elements: s,
717
+ rect: y,
718
+ offsetParent: x,
719
+ strategy: u
720
+ }) : y);
701
721
  return {
702
- top: (g.top - E.top + p.top) / x.y,
703
- bottom: (E.bottom - g.bottom + p.bottom) / x.y,
704
- left: (g.left - E.left + p.left) / x.x,
705
- right: (E.right - g.right + p.right) / x.x
722
+ top: (p.top - S.top + v.top) / b.y,
723
+ bottom: (S.bottom - p.bottom + v.bottom) / b.y,
724
+ left: (p.left - S.left + v.left) / b.x,
725
+ right: (S.right - p.right + v.right) / b.x
706
726
  };
707
727
  }
708
- const Lo = async (t, e, n) => {
728
+ const Rn = async (t, e, n) => {
709
729
  const {
710
- placement: o = "bottom",
711
- strategy: a = "absolute",
730
+ placement: r = "bottom",
731
+ strategy: o = "absolute",
712
732
  middleware: i = [],
713
- platform: s
714
- } = n, l = i.filter(Boolean), d = await (s.isRTL == null ? void 0 : s.isRTL(e));
715
- let c = await s.getElementRects({
733
+ platform: c
734
+ } = n, s = i.filter(Boolean), u = await (c.isRTL == null ? void 0 : c.isRTL(e));
735
+ let f = await c.getElementRects({
716
736
  reference: t,
717
737
  floating: e,
718
- strategy: a
738
+ strategy: o
719
739
  }), {
720
- x: u,
721
- y: r
722
- } = ze(c, o, d), f = o, m = {}, p = 0;
723
- for (let y = 0; y < l.length; y++) {
724
- var h;
740
+ x: l,
741
+ y: a
742
+ } = Zt(f, r, u), m = r, h = {}, v = 0;
743
+ for (let g = 0; g < s.length; g++) {
744
+ var d;
725
745
  const {
726
- name: g,
727
- fn: b
728
- } = l[y], {
729
- x: w,
730
- y: x,
731
- data: E,
732
- reset: R
733
- } = await b({
734
- x: u,
735
- y: r,
736
- initialPlacement: o,
737
- placement: f,
738
- strategy: a,
739
- middlewareData: m,
740
- rects: c,
746
+ name: p,
747
+ fn: y
748
+ } = s[g], {
749
+ x,
750
+ y: b,
751
+ data: S,
752
+ reset: C
753
+ } = await y({
754
+ x: l,
755
+ y: a,
756
+ initialPlacement: r,
757
+ placement: m,
758
+ strategy: o,
759
+ middlewareData: h,
760
+ rects: f,
741
761
  platform: {
742
- ...s,
743
- detectOverflow: (h = s.detectOverflow) != null ? h : Po
762
+ ...c,
763
+ detectOverflow: (d = c.detectOverflow) != null ? d : Cn
744
764
  },
745
765
  elements: {
746
766
  reference: t,
747
767
  floating: e
748
768
  }
749
769
  });
750
- u = w ?? u, r = x ?? r, m = {
751
- ...m,
752
- [g]: {
753
- ...m[g],
754
- ...E
770
+ l = x ?? l, a = b ?? a, h = {
771
+ ...h,
772
+ [p]: {
773
+ ...h[p],
774
+ ...S
755
775
  }
756
- }, R && p <= 50 && (p++, typeof R == "object" && (R.placement && (f = R.placement), R.rects && (c = R.rects === !0 ? await s.getElementRects({
776
+ }, C && v <= 50 && (v++, typeof C == "object" && (C.placement && (m = C.placement), C.rects && (f = C.rects === !0 ? await c.getElementRects({
757
777
  reference: t,
758
778
  floating: e,
759
- strategy: a
760
- }) : R.rects), {
761
- x: u,
762
- y: r
763
- } = ze(c, f, d)), y = -1);
779
+ strategy: o
780
+ }) : C.rects), {
781
+ x: l,
782
+ y: a
783
+ } = Zt(f, m, u)), g = -1);
764
784
  }
765
785
  return {
766
- x: u,
767
- y: r,
768
- placement: f,
769
- strategy: a,
770
- middlewareData: m
786
+ x: l,
787
+ y: a,
788
+ placement: m,
789
+ strategy: o,
790
+ middlewareData: h
771
791
  };
772
- }, Bo = (t) => ({
792
+ }, An = (t) => ({
773
793
  name: "arrow",
774
794
  options: t,
775
795
  async fn(e) {
776
796
  const {
777
797
  x: n,
778
- y: o,
779
- placement: a,
798
+ y: r,
799
+ placement: o,
780
800
  rects: i,
781
- platform: s,
782
- elements: l,
783
- middlewareData: d
801
+ platform: c,
802
+ elements: s,
803
+ middlewareData: u
784
804
  } = e, {
785
- element: c,
786
- padding: u = 0
787
- } = ut(t, e) || {};
788
- if (c == null)
805
+ element: f,
806
+ padding: l = 0
807
+ } = Y(t, e) || {};
808
+ if (f == null)
789
809
  return {};
790
- const r = ln(u), f = {
810
+ const a = ue(l), m = {
791
811
  x: n,
792
- y: o
793
- }, m = Se(a), p = xe(m), h = await s.getDimensions(c), y = m === "y", g = y ? "top" : "left", b = y ? "bottom" : "right", w = y ? "clientHeight" : "clientWidth", x = i.reference[p] + i.reference[m] - f[m] - i.floating[p], E = f[m] - i.reference[m], R = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c));
794
- let A = R ? R[w] : 0;
795
- (!A || !await (s.isElement == null ? void 0 : s.isElement(R))) && (A = l.floating[w] || i.floating[p]);
796
- const D = x / 2 - E / 2, $ = A / 2 - h[p] / 2 - 1, B = ht(r[g], $), H = ht(r[b], $), _ = B, N = A - h[p] - H, P = A / 2 - h[p] / 2 + D, j = pe(_, P, N), C = !d.arrow && Dt(a) != null && P !== j && i.reference[p] / 2 - (P < _ ? B : H) - h[p] / 2 < 0, O = C ? P < _ ? P - _ : P - N : 0;
812
+ y: r
813
+ }, h = Ft(o), v = Bt(h), d = await c.getDimensions(f), g = h === "y", p = g ? "top" : "left", y = g ? "bottom" : "right", x = g ? "clientHeight" : "clientWidth", b = i.reference[v] + i.reference[h] - m[h] - i.floating[v], S = m[h] - i.reference[h], C = await (c.getOffsetParent == null ? void 0 : c.getOffsetParent(f));
814
+ let R = C ? C[x] : 0;
815
+ (!R || !await (c.isElement == null ? void 0 : c.isElement(C))) && (R = s.floating[x] || i.floating[v]);
816
+ const P = b / 2 - S / 2, L = R / 2 - d[v] / 2 - 1, O = U(a[p], L), M = U(a[y], L), T = O, D = R - d[v] - M, E = R / 2 - d[v] / 2 + P, $ = Tt(T, E, D), k = !u.arrow && ot(o) != null && E !== $ && i.reference[v] / 2 - (E < T ? O : M) - d[v] / 2 < 0, W = k ? E < T ? E - T : E - D : 0;
797
817
  return {
798
- [m]: f[m] + O,
818
+ [h]: m[h] + W,
799
819
  data: {
800
- [m]: j,
801
- centerOffset: P - j - O,
802
- ...C && {
803
- alignmentOffset: O
820
+ [h]: $,
821
+ centerOffset: E - $ - W,
822
+ ...k && {
823
+ alignmentOffset: W
804
824
  }
805
825
  },
806
- reset: C
826
+ reset: k
807
827
  };
808
828
  }
809
- }), _o = function(t) {
829
+ }), En = function(t) {
810
830
  return t === void 0 && (t = {}), {
811
831
  name: "flip",
812
832
  options: t,
813
833
  async fn(e) {
814
- var n, o;
834
+ var n, r;
815
835
  const {
816
- placement: a,
836
+ placement: o,
817
837
  middlewareData: i,
818
- rects: s,
819
- initialPlacement: l,
820
- platform: d,
821
- elements: c
838
+ rects: c,
839
+ initialPlacement: s,
840
+ platform: u,
841
+ elements: f
822
842
  } = e, {
823
- mainAxis: u = !0,
824
- crossAxis: r = !0,
825
- fallbackPlacements: f,
826
- fallbackStrategy: m = "bestFit",
827
- fallbackAxisSideDirection: p = "none",
828
- flipAlignment: h = !0,
829
- ...y
830
- } = ut(t, e);
843
+ mainAxis: l = !0,
844
+ crossAxis: a = !0,
845
+ fallbackPlacements: m,
846
+ fallbackStrategy: h = "bestFit",
847
+ fallbackAxisSideDirection: v = "none",
848
+ flipAlignment: d = !0,
849
+ ...g
850
+ } = Y(t, e);
831
851
  if ((n = i.arrow) != null && n.alignmentOffset)
832
852
  return {};
833
- const g = dt(a), b = at(l), w = dt(l) === l, x = await (d.isRTL == null ? void 0 : d.isRTL(c.floating)), E = f || (w || !h ? [Qt(l)] : Ao(l)), R = p !== "none";
834
- !f && R && E.push(...Do(l, h, p, x));
835
- const A = [l, ...E], D = await d.detectOverflow(e, y), $ = [];
836
- let B = ((o = i.flip) == null ? void 0 : o.overflows) || [];
837
- if (u && $.push(D[g]), r) {
838
- const P = To(a, s, x);
839
- $.push(D[P[0]], D[P[1]]);
853
+ const p = q(o), y = _(s), x = q(s) === s, b = await (u.isRTL == null ? void 0 : u.isRTL(f.floating)), S = m || (x || !d ? [pt(s)] : pn(s)), C = v !== "none";
854
+ !m && C && S.push(...bn(s, d, v, b));
855
+ const R = [s, ...S], P = await u.detectOverflow(e, g), L = [];
856
+ let O = ((r = i.flip) == null ? void 0 : r.overflows) || [];
857
+ if (l && L.push(P[p]), a) {
858
+ const E = vn(o, c, b);
859
+ L.push(P[E[0]], P[E[1]]);
840
860
  }
841
- if (B = [...B, {
842
- placement: a,
843
- overflows: $
844
- }], !$.every((P) => P <= 0)) {
845
- var H, _;
846
- const P = (((H = i.flip) == null ? void 0 : H.index) || 0) + 1, j = A[P];
847
- if (j && (!(r === "alignment" ? b !== at(j) : !1) || // We leave the current main axis only if every placement on that axis
861
+ if (O = [...O, {
862
+ placement: o,
863
+ overflows: L
864
+ }], !L.every((E) => E <= 0)) {
865
+ var M, T;
866
+ const E = (((M = i.flip) == null ? void 0 : M.index) || 0) + 1, $ = R[E];
867
+ if ($ && (!(a === "alignment" ? y !== _($) : !1) || // We leave the current main axis only if every placement on that axis
848
868
  // overflows the main axis.
849
- B.every((k) => at(k.placement) === b ? k.overflows[0] > 0 : !0)))
869
+ O.every((A) => _(A.placement) === y ? A.overflows[0] > 0 : !0)))
850
870
  return {
851
871
  data: {
852
- index: P,
853
- overflows: B
872
+ index: E,
873
+ overflows: O
854
874
  },
855
875
  reset: {
856
- placement: j
876
+ placement: $
857
877
  }
858
878
  };
859
- let C = (_ = B.filter((O) => O.overflows[0] <= 0).sort((O, k) => O.overflows[1] - k.overflows[1])[0]) == null ? void 0 : _.placement;
860
- if (!C)
861
- switch (m) {
879
+ let k = (T = O.filter((W) => W.overflows[0] <= 0).sort((W, A) => W.overflows[1] - A.overflows[1])[0]) == null ? void 0 : T.placement;
880
+ if (!k)
881
+ switch (h) {
862
882
  case "bestFit": {
863
- var N;
864
- const O = (N = B.filter((k) => {
865
- if (R) {
866
- const F = at(k.placement);
867
- return F === b || // Create a bias to the `y` side axis due to horizontal
883
+ var D;
884
+ const W = (D = O.filter((A) => {
885
+ if (C) {
886
+ const N = _(A.placement);
887
+ return N === y || // Create a bias to the `y` side axis due to horizontal
868
888
  // reading directions favoring greater width.
869
- F === "y";
889
+ N === "y";
870
890
  }
871
891
  return !0;
872
- }).map((k) => [k.placement, k.overflows.filter((F) => F > 0).reduce((F, z) => F + z, 0)]).sort((k, F) => k[1] - F[1])[0]) == null ? void 0 : N[0];
873
- O && (C = O);
892
+ }).map((A) => [A.placement, A.overflows.filter((N) => N > 0).reduce((N, Z) => N + Z, 0)]).sort((A, N) => A[1] - N[1])[0]) == null ? void 0 : D[0];
893
+ W && (k = W);
874
894
  break;
875
895
  }
876
896
  case "initialPlacement":
877
- C = l;
897
+ k = s;
878
898
  break;
879
899
  }
880
- if (a !== C)
900
+ if (o !== k)
881
901
  return {
882
902
  reset: {
883
- placement: C
903
+ placement: k
884
904
  }
885
905
  };
886
906
  }
@@ -888,7 +908,7 @@ const Lo = async (t, e, n) => {
888
908
  }
889
909
  };
890
910
  };
891
- function Ve(t, e) {
911
+ function Ut(t, e) {
892
912
  return {
893
913
  top: t.top - e.height,
894
914
  right: t.right - e.width,
@@ -896,43 +916,43 @@ function Ve(t, e) {
896
916
  left: t.left - e.width
897
917
  };
898
918
  }
899
- function Ye(t) {
900
- return So.some((e) => t[e] >= 0);
919
+ function Gt(t) {
920
+ return dn.some((e) => t[e] >= 0);
901
921
  }
902
- const Io = function(t) {
922
+ const On = function(t) {
903
923
  return t === void 0 && (t = {}), {
904
924
  name: "hide",
905
925
  options: t,
906
926
  async fn(e) {
907
927
  const {
908
928
  rects: n,
909
- platform: o
929
+ platform: r
910
930
  } = e, {
911
- strategy: a = "referenceHidden",
931
+ strategy: o = "referenceHidden",
912
932
  ...i
913
- } = ut(t, e);
914
- switch (a) {
933
+ } = Y(t, e);
934
+ switch (o) {
915
935
  case "referenceHidden": {
916
- const s = await o.detectOverflow(e, {
936
+ const c = await r.detectOverflow(e, {
917
937
  ...i,
918
938
  elementContext: "reference"
919
- }), l = Ve(s, n.reference);
939
+ }), s = Ut(c, n.reference);
920
940
  return {
921
941
  data: {
922
- referenceHiddenOffsets: l,
923
- referenceHidden: Ye(l)
942
+ referenceHiddenOffsets: s,
943
+ referenceHidden: Gt(s)
924
944
  }
925
945
  };
926
946
  }
927
947
  case "escaped": {
928
- const s = await o.detectOverflow(e, {
948
+ const c = await r.detectOverflow(e, {
929
949
  ...i,
930
950
  altBoundary: !0
931
- }), l = Ve(s, n.floating);
951
+ }), s = Ut(c, n.floating);
932
952
  return {
933
953
  data: {
934
- escapedOffsets: l,
935
- escaped: Ye(l)
954
+ escapedOffsets: s,
955
+ escaped: Gt(s)
936
956
  }
937
957
  };
938
958
  }
@@ -941,189 +961,189 @@ const Io = function(t) {
941
961
  }
942
962
  }
943
963
  };
944
- }, cn = /* @__PURE__ */ new Set(["left", "top"]);
945
- async function Ho(t, e) {
964
+ }, de = /* @__PURE__ */ new Set(["left", "top"]);
965
+ async function Pn(t, e) {
946
966
  const {
947
967
  placement: n,
948
- platform: o,
949
- elements: a
950
- } = t, i = await (o.isRTL == null ? void 0 : o.isRTL(a.floating)), s = dt(n), l = Dt(n), d = at(n) === "y", c = cn.has(s) ? -1 : 1, u = i && d ? -1 : 1, r = ut(e, t);
968
+ platform: r,
969
+ elements: o
970
+ } = t, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), c = q(n), s = ot(n), u = _(n) === "y", f = de.has(c) ? -1 : 1, l = i && u ? -1 : 1, a = Y(e, t);
951
971
  let {
952
- mainAxis: f,
953
- crossAxis: m,
954
- alignmentAxis: p
955
- } = typeof r == "number" ? {
956
- mainAxis: r,
972
+ mainAxis: m,
973
+ crossAxis: h,
974
+ alignmentAxis: v
975
+ } = typeof a == "number" ? {
976
+ mainAxis: a,
957
977
  crossAxis: 0,
958
978
  alignmentAxis: null
959
979
  } : {
960
- mainAxis: r.mainAxis || 0,
961
- crossAxis: r.crossAxis || 0,
962
- alignmentAxis: r.alignmentAxis
980
+ mainAxis: a.mainAxis || 0,
981
+ crossAxis: a.crossAxis || 0,
982
+ alignmentAxis: a.alignmentAxis
963
983
  };
964
- return l && typeof p == "number" && (m = l === "end" ? p * -1 : p), d ? {
965
- x: m * u,
966
- y: f * c
984
+ return s && typeof v == "number" && (h = s === "end" ? v * -1 : v), u ? {
985
+ x: h * l,
986
+ y: m * f
967
987
  } : {
968
- x: f * c,
969
- y: m * u
988
+ x: m * f,
989
+ y: h * l
970
990
  };
971
991
  }
972
- const Fo = function(t) {
992
+ const Mn = function(t) {
973
993
  return t === void 0 && (t = 0), {
974
994
  name: "offset",
975
995
  options: t,
976
996
  async fn(e) {
977
- var n, o;
997
+ var n, r;
978
998
  const {
979
- x: a,
999
+ x: o,
980
1000
  y: i,
981
- placement: s,
982
- middlewareData: l
983
- } = e, d = await Ho(e, t);
984
- return s === ((n = l.offset) == null ? void 0 : n.placement) && (o = l.arrow) != null && o.alignmentOffset ? {} : {
985
- x: a + d.x,
986
- y: i + d.y,
1001
+ placement: c,
1002
+ middlewareData: s
1003
+ } = e, u = await Pn(e, t);
1004
+ return c === ((n = s.offset) == null ? void 0 : n.placement) && (r = s.arrow) != null && r.alignmentOffset ? {} : {
1005
+ x: o + u.x,
1006
+ y: i + u.y,
987
1007
  data: {
988
- ...d,
989
- placement: s
1008
+ ...u,
1009
+ placement: c
990
1010
  }
991
1011
  };
992
1012
  }
993
1013
  };
994
- }, Wo = function(t) {
1014
+ }, kn = function(t) {
995
1015
  return t === void 0 && (t = {}), {
996
1016
  name: "shift",
997
1017
  options: t,
998
1018
  async fn(e) {
999
1019
  const {
1000
1020
  x: n,
1001
- y: o,
1002
- placement: a,
1021
+ y: r,
1022
+ placement: o,
1003
1023
  platform: i
1004
1024
  } = e, {
1005
- mainAxis: s = !0,
1006
- crossAxis: l = !1,
1007
- limiter: d = {
1008
- fn: (g) => {
1025
+ mainAxis: c = !0,
1026
+ crossAxis: s = !1,
1027
+ limiter: u = {
1028
+ fn: (p) => {
1009
1029
  let {
1010
- x: b,
1011
- y: w
1012
- } = g;
1030
+ x: y,
1031
+ y: x
1032
+ } = p;
1013
1033
  return {
1014
- x: b,
1015
- y: w
1034
+ x: y,
1035
+ y: x
1016
1036
  };
1017
1037
  }
1018
1038
  },
1019
- ...c
1020
- } = ut(t, e), u = {
1039
+ ...f
1040
+ } = Y(t, e), l = {
1021
1041
  x: n,
1022
- y: o
1023
- }, r = await i.detectOverflow(e, c), f = at(dt(a)), m = we(f);
1024
- let p = u[m], h = u[f];
1025
- if (s) {
1026
- const g = m === "y" ? "top" : "left", b = m === "y" ? "bottom" : "right", w = p + r[g], x = p - r[b];
1027
- p = pe(w, p, x);
1042
+ y: r
1043
+ }, a = await i.detectOverflow(e, f), m = _(q(o)), h = Nt(m);
1044
+ let v = l[h], d = l[m];
1045
+ if (c) {
1046
+ const p = h === "y" ? "top" : "left", y = h === "y" ? "bottom" : "right", x = v + a[p], b = v - a[y];
1047
+ v = Tt(x, v, b);
1028
1048
  }
1029
- if (l) {
1030
- const g = f === "y" ? "top" : "left", b = f === "y" ? "bottom" : "right", w = h + r[g], x = h - r[b];
1031
- h = pe(w, h, x);
1049
+ if (s) {
1050
+ const p = m === "y" ? "top" : "left", y = m === "y" ? "bottom" : "right", x = d + a[p], b = d - a[y];
1051
+ d = Tt(x, d, b);
1032
1052
  }
1033
- const y = d.fn({
1053
+ const g = u.fn({
1034
1054
  ...e,
1035
- [m]: p,
1036
- [f]: h
1055
+ [h]: v,
1056
+ [m]: d
1037
1057
  });
1038
1058
  return {
1039
- ...y,
1059
+ ...g,
1040
1060
  data: {
1041
- x: y.x - n,
1042
- y: y.y - o,
1061
+ x: g.x - n,
1062
+ y: g.y - r,
1043
1063
  enabled: {
1044
- [m]: s,
1045
- [f]: l
1064
+ [h]: c,
1065
+ [m]: s
1046
1066
  }
1047
1067
  }
1048
1068
  };
1049
1069
  }
1050
1070
  };
1051
- }, $o = function(t) {
1071
+ }, Ln = function(t) {
1052
1072
  return t === void 0 && (t = {}), {
1053
1073
  options: t,
1054
1074
  fn(e) {
1055
1075
  const {
1056
1076
  x: n,
1057
- y: o,
1058
- placement: a,
1077
+ y: r,
1078
+ placement: o,
1059
1079
  rects: i,
1060
- middlewareData: s
1080
+ middlewareData: c
1061
1081
  } = e, {
1062
- offset: l = 0,
1063
- mainAxis: d = !0,
1064
- crossAxis: c = !0
1065
- } = ut(t, e), u = {
1082
+ offset: s = 0,
1083
+ mainAxis: u = !0,
1084
+ crossAxis: f = !0
1085
+ } = Y(t, e), l = {
1066
1086
  x: n,
1067
- y: o
1068
- }, r = at(a), f = we(r);
1069
- let m = u[f], p = u[r];
1070
- const h = ut(l, e), y = typeof h == "number" ? {
1071
- mainAxis: h,
1087
+ y: r
1088
+ }, a = _(o), m = Nt(a);
1089
+ let h = l[m], v = l[a];
1090
+ const d = Y(s, e), g = typeof d == "number" ? {
1091
+ mainAxis: d,
1072
1092
  crossAxis: 0
1073
1093
  } : {
1074
1094
  mainAxis: 0,
1075
1095
  crossAxis: 0,
1076
- ...h
1096
+ ...d
1077
1097
  };
1078
- if (d) {
1079
- const w = f === "y" ? "height" : "width", x = i.reference[f] - i.floating[w] + y.mainAxis, E = i.reference[f] + i.reference[w] - y.mainAxis;
1080
- m < x ? m = x : m > E && (m = E);
1098
+ if (u) {
1099
+ const x = m === "y" ? "height" : "width", b = i.reference[m] - i.floating[x] + g.mainAxis, S = i.reference[m] + i.reference[x] - g.mainAxis;
1100
+ h < b ? h = b : h > S && (h = S);
1081
1101
  }
1082
- if (c) {
1083
- var g, b;
1084
- const w = f === "y" ? "width" : "height", x = cn.has(dt(a)), E = i.reference[r] - i.floating[w] + (x && ((g = s.offset) == null ? void 0 : g[r]) || 0) + (x ? 0 : y.crossAxis), R = i.reference[r] + i.reference[w] + (x ? 0 : ((b = s.offset) == null ? void 0 : b[r]) || 0) - (x ? y.crossAxis : 0);
1085
- p < E ? p = E : p > R && (p = R);
1102
+ if (f) {
1103
+ var p, y;
1104
+ const x = m === "y" ? "width" : "height", b = de.has(q(o)), S = i.reference[a] - i.floating[x] + (b && ((p = c.offset) == null ? void 0 : p[a]) || 0) + (b ? 0 : g.crossAxis), C = i.reference[a] + i.reference[x] + (b ? 0 : ((y = c.offset) == null ? void 0 : y[a]) || 0) - (b ? g.crossAxis : 0);
1105
+ v < S ? v = S : v > C && (v = C);
1086
1106
  }
1087
1107
  return {
1088
- [f]: m,
1089
- [r]: p
1108
+ [m]: h,
1109
+ [a]: v
1090
1110
  };
1091
1111
  }
1092
1112
  };
1093
- }, zo = function(t) {
1113
+ }, Tn = function(t) {
1094
1114
  return t === void 0 && (t = {}), {
1095
1115
  name: "size",
1096
1116
  options: t,
1097
1117
  async fn(e) {
1098
- var n, o;
1118
+ var n, r;
1099
1119
  const {
1100
- placement: a,
1120
+ placement: o,
1101
1121
  rects: i,
1102
- platform: s,
1103
- elements: l
1122
+ platform: c,
1123
+ elements: s
1104
1124
  } = e, {
1105
- apply: d = () => {
1125
+ apply: u = () => {
1106
1126
  },
1107
- ...c
1108
- } = ut(t, e), u = await s.detectOverflow(e, c), r = dt(a), f = Dt(a), m = at(a) === "y", {
1109
- width: p,
1110
- height: h
1127
+ ...f
1128
+ } = Y(t, e), l = await c.detectOverflow(e, f), a = q(o), m = ot(o), h = _(o) === "y", {
1129
+ width: v,
1130
+ height: d
1111
1131
  } = i.floating;
1112
- let y, g;
1113
- r === "top" || r === "bottom" ? (y = r, g = f === (await (s.isRTL == null ? void 0 : s.isRTL(l.floating)) ? "start" : "end") ? "left" : "right") : (g = r, y = f === "end" ? "top" : "bottom");
1114
- const b = h - u.top - u.bottom, w = p - u.left - u.right, x = ht(h - u[y], b), E = ht(p - u[g], w), R = !e.middlewareData.shift;
1115
- let A = x, D = E;
1116
- if ((n = e.middlewareData.shift) != null && n.enabled.x && (D = w), (o = e.middlewareData.shift) != null && o.enabled.y && (A = b), R && !f) {
1117
- const B = Z(u.left, 0), H = Z(u.right, 0), _ = Z(u.top, 0), N = Z(u.bottom, 0);
1118
- m ? D = p - 2 * (B !== 0 || H !== 0 ? B + H : Z(u.left, u.right)) : A = h - 2 * (_ !== 0 || N !== 0 ? _ + N : Z(u.top, u.bottom));
1132
+ let g, p;
1133
+ a === "top" || a === "bottom" ? (g = a, p = m === (await (c.isRTL == null ? void 0 : c.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (p = a, g = m === "end" ? "top" : "bottom");
1134
+ const y = d - l.top - l.bottom, x = v - l.left - l.right, b = U(d - l[g], y), S = U(v - l[p], x), C = !e.middlewareData.shift;
1135
+ let R = b, P = S;
1136
+ if ((n = e.middlewareData.shift) != null && n.enabled.x && (P = x), (r = e.middlewareData.shift) != null && r.enabled.y && (R = y), C && !m) {
1137
+ const O = B(l.left, 0), M = B(l.right, 0), T = B(l.top, 0), D = B(l.bottom, 0);
1138
+ h ? P = v - 2 * (O !== 0 || M !== 0 ? O + M : B(l.left, l.right)) : R = d - 2 * (T !== 0 || D !== 0 ? T + D : B(l.top, l.bottom));
1119
1139
  }
1120
- await d({
1140
+ await u({
1121
1141
  ...e,
1122
- availableWidth: D,
1123
- availableHeight: A
1142
+ availableWidth: P,
1143
+ availableHeight: R
1124
1144
  });
1125
- const $ = await s.getDimensions(l.floating);
1126
- return p !== $.width || h !== $.height ? {
1145
+ const L = await c.getDimensions(s.floating);
1146
+ return v !== L.width || d !== L.height ? {
1127
1147
  reset: {
1128
1148
  rects: !0
1129
1149
  }
@@ -1131,49 +1151,49 @@ const Fo = function(t) {
1131
1151
  }
1132
1152
  };
1133
1153
  };
1134
- function ne() {
1154
+ function bt() {
1135
1155
  return typeof window < "u";
1136
1156
  }
1137
- function Nt(t) {
1138
- return un(t) ? (t.nodeName || "").toLowerCase() : "#document";
1157
+ function it(t) {
1158
+ return he(t) ? (t.nodeName || "").toLowerCase() : "#document";
1139
1159
  }
1140
- function G(t) {
1160
+ function F(t) {
1141
1161
  var e;
1142
1162
  return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
1143
1163
  }
1144
- function lt(t) {
1164
+ function X(t) {
1145
1165
  var e;
1146
- return (e = (un(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
1166
+ return (e = (he(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
1147
1167
  }
1148
- function un(t) {
1149
- return ne() ? t instanceof Node || t instanceof G(t).Node : !1;
1168
+ function he(t) {
1169
+ return bt() ? t instanceof Node || t instanceof F(t).Node : !1;
1150
1170
  }
1151
- function nt(t) {
1152
- return ne() ? t instanceof Element || t instanceof G(t).Element : !1;
1171
+ function V(t) {
1172
+ return bt() ? t instanceof Element || t instanceof F(t).Element : !1;
1153
1173
  }
1154
- function st(t) {
1155
- return ne() ? t instanceof HTMLElement || t instanceof G(t).HTMLElement : !1;
1174
+ function j(t) {
1175
+ return bt() ? t instanceof HTMLElement || t instanceof F(t).HTMLElement : !1;
1156
1176
  }
1157
- function je(t) {
1158
- return !ne() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof G(t).ShadowRoot;
1177
+ function Kt(t) {
1178
+ return !bt() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof F(t).ShadowRoot;
1159
1179
  }
1160
- const Vo = /* @__PURE__ */ new Set(["inline", "contents"]);
1161
- function Bt(t) {
1180
+ const Dn = /* @__PURE__ */ new Set(["inline", "contents"]);
1181
+ function st(t) {
1162
1182
  const {
1163
1183
  overflow: e,
1164
1184
  overflowX: n,
1165
- overflowY: o,
1166
- display: a
1167
- } = ot(t);
1168
- return /auto|scroll|overlay|hidden|clip/.test(e + o + n) && !Vo.has(a);
1169
- }
1170
- const Yo = /* @__PURE__ */ new Set(["table", "td", "th"]);
1171
- function jo(t) {
1172
- return Yo.has(Nt(t));
1173
- }
1174
- const Xo = [":popover-open", ":modal"];
1175
- function oe(t) {
1176
- return Xo.some((e) => {
1185
+ overflowY: r,
1186
+ display: o
1187
+ } = H(t);
1188
+ return /auto|scroll|overlay|hidden|clip/.test(e + r + n) && !Dn.has(o);
1189
+ }
1190
+ const Wn = /* @__PURE__ */ new Set(["table", "td", "th"]);
1191
+ function Nn(t) {
1192
+ return Wn.has(it(t));
1193
+ }
1194
+ const Bn = [":popover-open", ":modal"];
1195
+ function St(t) {
1196
+ return Bn.some((e) => {
1177
1197
  try {
1178
1198
  return t.matches(e);
1179
1199
  } catch {
@@ -1181,34 +1201,34 @@ function oe(t) {
1181
1201
  }
1182
1202
  });
1183
1203
  }
1184
- const Uo = ["transform", "translate", "scale", "rotate", "perspective"], qo = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Ko = ["paint", "layout", "strict", "content"];
1185
- function Ee(t) {
1186
- const e = Re(), n = nt(t) ? ot(t) : t;
1187
- return Uo.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || qo.some((o) => (n.willChange || "").includes(o)) || Ko.some((o) => (n.contain || "").includes(o));
1204
+ const Fn = ["transform", "translate", "scale", "rotate", "perspective"], Vn = ["transform", "translate", "scale", "rotate", "perspective", "filter"], Hn = ["paint", "layout", "strict", "content"];
1205
+ function Vt(t) {
1206
+ const e = Ht(), n = V(t) ? H(t) : t;
1207
+ return Fn.some((r) => n[r] ? n[r] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !e && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !e && (n.filter ? n.filter !== "none" : !1) || Vn.some((r) => (n.willChange || "").includes(r)) || Hn.some((r) => (n.contain || "").includes(r));
1188
1208
  }
1189
- function Zo(t) {
1190
- let e = gt(t);
1191
- for (; st(e) && !Ot(e); ) {
1192
- if (Ee(e))
1209
+ function $n(t) {
1210
+ let e = G(t);
1211
+ for (; j(e) && !rt(e); ) {
1212
+ if (Vt(e))
1193
1213
  return e;
1194
- if (oe(e))
1214
+ if (St(e))
1195
1215
  return null;
1196
- e = gt(e);
1216
+ e = G(e);
1197
1217
  }
1198
1218
  return null;
1199
1219
  }
1200
- function Re() {
1220
+ function Ht() {
1201
1221
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1202
1222
  }
1203
- const Go = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1204
- function Ot(t) {
1205
- return Go.has(Nt(t));
1223
+ const In = /* @__PURE__ */ new Set(["html", "body", "#document"]);
1224
+ function rt(t) {
1225
+ return In.has(it(t));
1206
1226
  }
1207
- function ot(t) {
1208
- return G(t).getComputedStyle(t);
1227
+ function H(t) {
1228
+ return F(t).getComputedStyle(t);
1209
1229
  }
1210
- function re(t) {
1211
- return nt(t) ? {
1230
+ function Ct(t) {
1231
+ return V(t) ? {
1212
1232
  scrollLeft: t.scrollLeft,
1213
1233
  scrollTop: t.scrollTop
1214
1234
  } : {
@@ -1216,569 +1236,569 @@ function re(t) {
1216
1236
  scrollTop: t.scrollY
1217
1237
  };
1218
1238
  }
1219
- function gt(t) {
1220
- if (Nt(t) === "html")
1239
+ function G(t) {
1240
+ if (it(t) === "html")
1221
1241
  return t;
1222
1242
  const e = (
1223
1243
  // Step into the shadow DOM of the parent of a slotted node.
1224
1244
  t.assignedSlot || // DOM Element detected.
1225
1245
  t.parentNode || // ShadowRoot detected.
1226
- je(t) && t.host || // Fallback.
1227
- lt(t)
1246
+ Kt(t) && t.host || // Fallback.
1247
+ X(t)
1228
1248
  );
1229
- return je(e) ? e.host : e;
1249
+ return Kt(e) ? e.host : e;
1230
1250
  }
1231
- function dn(t) {
1232
- const e = gt(t);
1233
- return Ot(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : st(e) && Bt(e) ? e : dn(e);
1251
+ function me(t) {
1252
+ const e = G(t);
1253
+ return rt(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : j(e) && st(e) ? e : me(e);
1234
1254
  }
1235
- function Lt(t, e, n) {
1236
- var o;
1255
+ function ct(t, e, n) {
1256
+ var r;
1237
1257
  e === void 0 && (e = []), n === void 0 && (n = !0);
1238
- const a = dn(t), i = a === ((o = t.ownerDocument) == null ? void 0 : o.body), s = G(a);
1258
+ const o = me(t), i = o === ((r = t.ownerDocument) == null ? void 0 : r.body), c = F(o);
1239
1259
  if (i) {
1240
- const l = ye(s);
1241
- return e.concat(s, s.visualViewport || [], Bt(a) ? a : [], l && n ? Lt(l) : []);
1260
+ const s = Wt(c);
1261
+ return e.concat(c, c.visualViewport || [], st(o) ? o : [], s && n ? ct(s) : []);
1242
1262
  }
1243
- return e.concat(a, Lt(a, [], n));
1263
+ return e.concat(o, ct(o, [], n));
1244
1264
  }
1245
- function ye(t) {
1265
+ function Wt(t) {
1246
1266
  return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
1247
1267
  }
1248
- function fn(t) {
1249
- const e = ot(t);
1250
- let n = parseFloat(e.width) || 0, o = parseFloat(e.height) || 0;
1251
- const a = st(t), i = a ? t.offsetWidth : n, s = a ? t.offsetHeight : o, l = Gt(n) !== i || Gt(o) !== s;
1252
- return l && (n = i, o = s), {
1268
+ function ge(t) {
1269
+ const e = H(t);
1270
+ let n = parseFloat(e.width) || 0, r = parseFloat(e.height) || 0;
1271
+ const o = j(t), i = o ? t.offsetWidth : n, c = o ? t.offsetHeight : r, s = vt(n) !== i || vt(r) !== c;
1272
+ return s && (n = i, r = c), {
1253
1273
  width: n,
1254
- height: o,
1255
- $: l
1274
+ height: r,
1275
+ $: s
1256
1276
  };
1257
1277
  }
1258
- function Ce(t) {
1259
- return nt(t) ? t : t.contextElement;
1278
+ function $t(t) {
1279
+ return V(t) ? t : t.contextElement;
1260
1280
  }
1261
- function Mt(t) {
1262
- const e = Ce(t);
1263
- if (!st(e))
1264
- return it(1);
1281
+ function nt(t) {
1282
+ const e = $t(t);
1283
+ if (!j(e))
1284
+ return z(1);
1265
1285
  const n = e.getBoundingClientRect(), {
1266
- width: o,
1267
- height: a,
1286
+ width: r,
1287
+ height: o,
1268
1288
  $: i
1269
- } = fn(e);
1270
- let s = (i ? Gt(n.width) : n.width) / o, l = (i ? Gt(n.height) : n.height) / a;
1271
- return (!s || !Number.isFinite(s)) && (s = 1), (!l || !Number.isFinite(l)) && (l = 1), {
1272
- x: s,
1273
- y: l
1289
+ } = ge(e);
1290
+ let c = (i ? vt(n.width) : n.width) / r, s = (i ? vt(n.height) : n.height) / o;
1291
+ return (!c || !Number.isFinite(c)) && (c = 1), (!s || !Number.isFinite(s)) && (s = 1), {
1292
+ x: c,
1293
+ y: s
1274
1294
  };
1275
1295
  }
1276
- const Qo = /* @__PURE__ */ it(0);
1277
- function mn(t) {
1278
- const e = G(t);
1279
- return !Re() || !e.visualViewport ? Qo : {
1296
+ const _n = /* @__PURE__ */ z(0);
1297
+ function ve(t) {
1298
+ const e = F(t);
1299
+ return !Ht() || !e.visualViewport ? _n : {
1280
1300
  x: e.visualViewport.offsetLeft,
1281
1301
  y: e.visualViewport.offsetTop
1282
1302
  };
1283
1303
  }
1284
- function Jo(t, e, n) {
1285
- return e === void 0 && (e = !1), !n || e && n !== G(t) ? !1 : e;
1304
+ function zn(t, e, n) {
1305
+ return e === void 0 && (e = !1), !n || e && n !== F(t) ? !1 : e;
1286
1306
  }
1287
- function yt(t, e, n, o) {
1307
+ function K(t, e, n, r) {
1288
1308
  e === void 0 && (e = !1), n === void 0 && (n = !1);
1289
- const a = t.getBoundingClientRect(), i = Ce(t);
1290
- let s = it(1);
1291
- e && (o ? nt(o) && (s = Mt(o)) : s = Mt(t));
1292
- const l = Jo(i, n, o) ? mn(i) : it(0);
1293
- let d = (a.left + l.x) / s.x, c = (a.top + l.y) / s.y, u = a.width / s.x, r = a.height / s.y;
1309
+ const o = t.getBoundingClientRect(), i = $t(t);
1310
+ let c = z(1);
1311
+ e && (r ? V(r) && (c = nt(r)) : c = nt(t));
1312
+ const s = zn(i, n, r) ? ve(i) : z(0);
1313
+ let u = (o.left + s.x) / c.x, f = (o.top + s.y) / c.y, l = o.width / c.x, a = o.height / c.y;
1294
1314
  if (i) {
1295
- const f = G(i), m = o && nt(o) ? G(o) : o;
1296
- let p = f, h = ye(p);
1297
- for (; h && o && m !== p; ) {
1298
- const y = Mt(h), g = h.getBoundingClientRect(), b = ot(h), w = g.left + (h.clientLeft + parseFloat(b.paddingLeft)) * y.x, x = g.top + (h.clientTop + parseFloat(b.paddingTop)) * y.y;
1299
- d *= y.x, c *= y.y, u *= y.x, r *= y.y, d += w, c += x, p = G(h), h = ye(p);
1315
+ const m = F(i), h = r && V(r) ? F(r) : r;
1316
+ let v = m, d = Wt(v);
1317
+ for (; d && r && h !== v; ) {
1318
+ const g = nt(d), p = d.getBoundingClientRect(), y = H(d), x = p.left + (d.clientLeft + parseFloat(y.paddingLeft)) * g.x, b = p.top + (d.clientTop + parseFloat(y.paddingTop)) * g.y;
1319
+ u *= g.x, f *= g.y, l *= g.x, a *= g.y, u += x, f += b, v = F(d), d = Wt(v);
1300
1320
  }
1301
1321
  }
1302
- return Jt({
1303
- width: u,
1304
- height: r,
1305
- x: d,
1306
- y: c
1322
+ return wt({
1323
+ width: l,
1324
+ height: a,
1325
+ x: u,
1326
+ y: f
1307
1327
  });
1308
1328
  }
1309
- function ae(t, e) {
1310
- const n = re(t).scrollLeft;
1311
- return e ? e.left + n : yt(lt(t)).left + n;
1329
+ function Rt(t, e) {
1330
+ const n = Ct(t).scrollLeft;
1331
+ return e ? e.left + n : K(X(t)).left + n;
1312
1332
  }
1313
- function hn(t, e) {
1314
- const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - ae(t, n), a = n.top + e.scrollTop;
1333
+ function pe(t, e) {
1334
+ const n = t.getBoundingClientRect(), r = n.left + e.scrollLeft - Rt(t, n), o = n.top + e.scrollTop;
1315
1335
  return {
1316
- x: o,
1317
- y: a
1336
+ x: r,
1337
+ y: o
1318
1338
  };
1319
1339
  }
1320
- function tr(t) {
1340
+ function jn(t) {
1321
1341
  let {
1322
1342
  elements: e,
1323
1343
  rect: n,
1324
- offsetParent: o,
1325
- strategy: a
1344
+ offsetParent: r,
1345
+ strategy: o
1326
1346
  } = t;
1327
- const i = a === "fixed", s = lt(o), l = e ? oe(e.floating) : !1;
1328
- if (o === s || l && i)
1347
+ const i = o === "fixed", c = X(r), s = e ? St(e.floating) : !1;
1348
+ if (r === c || s && i)
1329
1349
  return n;
1330
- let d = {
1350
+ let u = {
1331
1351
  scrollLeft: 0,
1332
1352
  scrollTop: 0
1333
- }, c = it(1);
1334
- const u = it(0), r = st(o);
1335
- if ((r || !r && !i) && ((Nt(o) !== "body" || Bt(s)) && (d = re(o)), st(o))) {
1336
- const m = yt(o);
1337
- c = Mt(o), u.x = m.x + o.clientLeft, u.y = m.y + o.clientTop;
1353
+ }, f = z(1);
1354
+ const l = z(0), a = j(r);
1355
+ if ((a || !a && !i) && ((it(r) !== "body" || st(c)) && (u = Ct(r)), j(r))) {
1356
+ const h = K(r);
1357
+ f = nt(r), l.x = h.x + r.clientLeft, l.y = h.y + r.clientTop;
1338
1358
  }
1339
- const f = s && !r && !i ? hn(s, d) : it(0);
1359
+ const m = c && !a && !i ? pe(c, u) : z(0);
1340
1360
  return {
1341
- width: n.width * c.x,
1342
- height: n.height * c.y,
1343
- x: n.x * c.x - d.scrollLeft * c.x + u.x + f.x,
1344
- y: n.y * c.y - d.scrollTop * c.y + u.y + f.y
1361
+ width: n.width * f.x,
1362
+ height: n.height * f.y,
1363
+ x: n.x * f.x - u.scrollLeft * f.x + l.x + m.x,
1364
+ y: n.y * f.y - u.scrollTop * f.y + l.y + m.y
1345
1365
  };
1346
1366
  }
1347
- function er(t) {
1367
+ function Xn(t) {
1348
1368
  return Array.from(t.getClientRects());
1349
1369
  }
1350
- function nr(t) {
1351
- const e = lt(t), n = re(t), o = t.ownerDocument.body, a = Z(e.scrollWidth, e.clientWidth, o.scrollWidth, o.clientWidth), i = Z(e.scrollHeight, e.clientHeight, o.scrollHeight, o.clientHeight);
1352
- let s = -n.scrollLeft + ae(t);
1353
- const l = -n.scrollTop;
1354
- return ot(o).direction === "rtl" && (s += Z(e.clientWidth, o.clientWidth) - a), {
1355
- width: a,
1370
+ function Yn(t) {
1371
+ const e = X(t), n = Ct(t), r = t.ownerDocument.body, o = B(e.scrollWidth, e.clientWidth, r.scrollWidth, r.clientWidth), i = B(e.scrollHeight, e.clientHeight, r.scrollHeight, r.clientHeight);
1372
+ let c = -n.scrollLeft + Rt(t);
1373
+ const s = -n.scrollTop;
1374
+ return H(r).direction === "rtl" && (c += B(e.clientWidth, r.clientWidth) - o), {
1375
+ width: o,
1356
1376
  height: i,
1357
- x: s,
1358
- y: l
1377
+ x: c,
1378
+ y: s
1359
1379
  };
1360
1380
  }
1361
- const Xe = 25;
1362
- function or(t, e) {
1363
- const n = G(t), o = lt(t), a = n.visualViewport;
1364
- let i = o.clientWidth, s = o.clientHeight, l = 0, d = 0;
1365
- if (a) {
1366
- i = a.width, s = a.height;
1367
- const u = Re();
1368
- (!u || u && e === "fixed") && (l = a.offsetLeft, d = a.offsetTop);
1381
+ const Qt = 25;
1382
+ function qn(t, e) {
1383
+ const n = F(t), r = X(t), o = n.visualViewport;
1384
+ let i = r.clientWidth, c = r.clientHeight, s = 0, u = 0;
1385
+ if (o) {
1386
+ i = o.width, c = o.height;
1387
+ const l = Ht();
1388
+ (!l || l && e === "fixed") && (s = o.offsetLeft, u = o.offsetTop);
1369
1389
  }
1370
- const c = ae(o);
1371
- if (c <= 0) {
1372
- const u = o.ownerDocument, r = u.body, f = getComputedStyle(r), m = u.compatMode === "CSS1Compat" && parseFloat(f.marginLeft) + parseFloat(f.marginRight) || 0, p = Math.abs(o.clientWidth - r.clientWidth - m);
1373
- p <= Xe && (i -= p);
1374
- } else c <= Xe && (i += c);
1390
+ const f = Rt(r);
1391
+ if (f <= 0) {
1392
+ const l = r.ownerDocument, a = l.body, m = getComputedStyle(a), h = l.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, v = Math.abs(r.clientWidth - a.clientWidth - h);
1393
+ v <= Qt && (i -= v);
1394
+ } else f <= Qt && (i += f);
1375
1395
  return {
1376
1396
  width: i,
1377
- height: s,
1378
- x: l,
1379
- y: d
1397
+ height: c,
1398
+ x: s,
1399
+ y: u
1380
1400
  };
1381
1401
  }
1382
- const rr = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1383
- function ar(t, e) {
1384
- const n = yt(t, !0, e === "fixed"), o = n.top + t.clientTop, a = n.left + t.clientLeft, i = st(t) ? Mt(t) : it(1), s = t.clientWidth * i.x, l = t.clientHeight * i.y, d = a * i.x, c = o * i.y;
1402
+ const Zn = /* @__PURE__ */ new Set(["absolute", "fixed"]);
1403
+ function Un(t, e) {
1404
+ const n = K(t, !0, e === "fixed"), r = n.top + t.clientTop, o = n.left + t.clientLeft, i = j(t) ? nt(t) : z(1), c = t.clientWidth * i.x, s = t.clientHeight * i.y, u = o * i.x, f = r * i.y;
1385
1405
  return {
1386
- width: s,
1387
- height: l,
1388
- x: d,
1389
- y: c
1406
+ width: c,
1407
+ height: s,
1408
+ x: u,
1409
+ y: f
1390
1410
  };
1391
1411
  }
1392
- function Ue(t, e, n) {
1393
- let o;
1412
+ function Jt(t, e, n) {
1413
+ let r;
1394
1414
  if (e === "viewport")
1395
- o = or(t, n);
1415
+ r = qn(t, n);
1396
1416
  else if (e === "document")
1397
- o = nr(lt(t));
1398
- else if (nt(e))
1399
- o = ar(e, n);
1417
+ r = Yn(X(t));
1418
+ else if (V(e))
1419
+ r = Un(e, n);
1400
1420
  else {
1401
- const a = mn(t);
1402
- o = {
1403
- x: e.x - a.x,
1404
- y: e.y - a.y,
1421
+ const o = ve(t);
1422
+ r = {
1423
+ x: e.x - o.x,
1424
+ y: e.y - o.y,
1405
1425
  width: e.width,
1406
1426
  height: e.height
1407
1427
  };
1408
1428
  }
1409
- return Jt(o);
1429
+ return wt(r);
1410
1430
  }
1411
- function gn(t, e) {
1412
- const n = gt(t);
1413
- return n === e || !nt(n) || Ot(n) ? !1 : ot(n).position === "fixed" || gn(n, e);
1431
+ function we(t, e) {
1432
+ const n = G(t);
1433
+ return n === e || !V(n) || rt(n) ? !1 : H(n).position === "fixed" || we(n, e);
1414
1434
  }
1415
- function ir(t, e) {
1435
+ function Gn(t, e) {
1416
1436
  const n = e.get(t);
1417
1437
  if (n)
1418
1438
  return n;
1419
- let o = Lt(t, [], !1).filter((l) => nt(l) && Nt(l) !== "body"), a = null;
1420
- const i = ot(t).position === "fixed";
1421
- let s = i ? gt(t) : t;
1422
- for (; nt(s) && !Ot(s); ) {
1423
- const l = ot(s), d = Ee(s);
1424
- !d && l.position === "fixed" && (a = null), (i ? !d && !a : !d && l.position === "static" && !!a && rr.has(a.position) || Bt(s) && !d && gn(t, s)) ? o = o.filter((u) => u !== s) : a = l, s = gt(s);
1439
+ let r = ct(t, [], !1).filter((s) => V(s) && it(s) !== "body"), o = null;
1440
+ const i = H(t).position === "fixed";
1441
+ let c = i ? G(t) : t;
1442
+ for (; V(c) && !rt(c); ) {
1443
+ const s = H(c), u = Vt(c);
1444
+ !u && s.position === "fixed" && (o = null), (i ? !u && !o : !u && s.position === "static" && !!o && Zn.has(o.position) || st(c) && !u && we(t, c)) ? r = r.filter((l) => l !== c) : o = s, c = G(c);
1425
1445
  }
1426
- return e.set(t, o), o;
1446
+ return e.set(t, r), r;
1427
1447
  }
1428
- function sr(t) {
1448
+ function Kn(t) {
1429
1449
  let {
1430
1450
  element: e,
1431
1451
  boundary: n,
1432
- rootBoundary: o,
1433
- strategy: a
1452
+ rootBoundary: r,
1453
+ strategy: o
1434
1454
  } = t;
1435
- const s = [...n === "clippingAncestors" ? oe(e) ? [] : ir(e, this._c) : [].concat(n), o], l = s[0], d = s.reduce((c, u) => {
1436
- const r = Ue(e, u, a);
1437
- return c.top = Z(r.top, c.top), c.right = ht(r.right, c.right), c.bottom = ht(r.bottom, c.bottom), c.left = Z(r.left, c.left), c;
1438
- }, Ue(e, l, a));
1455
+ const c = [...n === "clippingAncestors" ? St(e) ? [] : Gn(e, this._c) : [].concat(n), r], s = c[0], u = c.reduce((f, l) => {
1456
+ const a = Jt(e, l, o);
1457
+ return f.top = B(a.top, f.top), f.right = U(a.right, f.right), f.bottom = U(a.bottom, f.bottom), f.left = B(a.left, f.left), f;
1458
+ }, Jt(e, s, o));
1439
1459
  return {
1440
- width: d.right - d.left,
1441
- height: d.bottom - d.top,
1442
- x: d.left,
1443
- y: d.top
1460
+ width: u.right - u.left,
1461
+ height: u.bottom - u.top,
1462
+ x: u.left,
1463
+ y: u.top
1444
1464
  };
1445
1465
  }
1446
- function lr(t) {
1466
+ function Qn(t) {
1447
1467
  const {
1448
1468
  width: e,
1449
1469
  height: n
1450
- } = fn(t);
1470
+ } = ge(t);
1451
1471
  return {
1452
1472
  width: e,
1453
1473
  height: n
1454
1474
  };
1455
1475
  }
1456
- function cr(t, e, n) {
1457
- const o = st(e), a = lt(e), i = n === "fixed", s = yt(t, !0, i, e);
1458
- let l = {
1476
+ function Jn(t, e, n) {
1477
+ const r = j(e), o = X(e), i = n === "fixed", c = K(t, !0, i, e);
1478
+ let s = {
1459
1479
  scrollLeft: 0,
1460
1480
  scrollTop: 0
1461
1481
  };
1462
- const d = it(0);
1463
- function c() {
1464
- d.x = ae(a);
1482
+ const u = z(0);
1483
+ function f() {
1484
+ u.x = Rt(o);
1465
1485
  }
1466
- if (o || !o && !i)
1467
- if ((Nt(e) !== "body" || Bt(a)) && (l = re(e)), o) {
1468
- const m = yt(e, !0, i, e);
1469
- d.x = m.x + e.clientLeft, d.y = m.y + e.clientTop;
1470
- } else a && c();
1471
- i && !o && a && c();
1472
- const u = a && !o && !i ? hn(a, l) : it(0), r = s.left + l.scrollLeft - d.x - u.x, f = s.top + l.scrollTop - d.y - u.y;
1486
+ if (r || !r && !i)
1487
+ if ((it(e) !== "body" || st(o)) && (s = Ct(e)), r) {
1488
+ const h = K(e, !0, i, e);
1489
+ u.x = h.x + e.clientLeft, u.y = h.y + e.clientTop;
1490
+ } else o && f();
1491
+ i && !r && o && f();
1492
+ const l = o && !r && !i ? pe(o, s) : z(0), a = c.left + s.scrollLeft - u.x - l.x, m = c.top + s.scrollTop - u.y - l.y;
1473
1493
  return {
1474
- x: r,
1475
- y: f,
1476
- width: s.width,
1477
- height: s.height
1494
+ x: a,
1495
+ y: m,
1496
+ width: c.width,
1497
+ height: c.height
1478
1498
  };
1479
1499
  }
1480
- function me(t) {
1481
- return ot(t).position === "static";
1500
+ function Mt(t) {
1501
+ return H(t).position === "static";
1482
1502
  }
1483
- function qe(t, e) {
1484
- if (!st(t) || ot(t).position === "fixed")
1503
+ function te(t, e) {
1504
+ if (!j(t) || H(t).position === "fixed")
1485
1505
  return null;
1486
1506
  if (e)
1487
1507
  return e(t);
1488
1508
  let n = t.offsetParent;
1489
- return lt(t) === n && (n = n.ownerDocument.body), n;
1509
+ return X(t) === n && (n = n.ownerDocument.body), n;
1490
1510
  }
1491
- function pn(t, e) {
1492
- const n = G(t);
1493
- if (oe(t))
1511
+ function ye(t, e) {
1512
+ const n = F(t);
1513
+ if (St(t))
1494
1514
  return n;
1495
- if (!st(t)) {
1496
- let a = gt(t);
1497
- for (; a && !Ot(a); ) {
1498
- if (nt(a) && !me(a))
1499
- return a;
1500
- a = gt(a);
1515
+ if (!j(t)) {
1516
+ let o = G(t);
1517
+ for (; o && !rt(o); ) {
1518
+ if (V(o) && !Mt(o))
1519
+ return o;
1520
+ o = G(o);
1501
1521
  }
1502
1522
  return n;
1503
1523
  }
1504
- let o = qe(t, e);
1505
- for (; o && jo(o) && me(o); )
1506
- o = qe(o, e);
1507
- return o && Ot(o) && me(o) && !Ee(o) ? n : o || Zo(t) || n;
1524
+ let r = te(t, e);
1525
+ for (; r && Nn(r) && Mt(r); )
1526
+ r = te(r, e);
1527
+ return r && rt(r) && Mt(r) && !Vt(r) ? n : r || $n(t) || n;
1508
1528
  }
1509
- const ur = async function(t) {
1510
- const e = this.getOffsetParent || pn, n = this.getDimensions, o = await n(t.floating);
1529
+ const tr = async function(t) {
1530
+ const e = this.getOffsetParent || ye, n = this.getDimensions, r = await n(t.floating);
1511
1531
  return {
1512
- reference: cr(t.reference, await e(t.floating), t.strategy),
1532
+ reference: Jn(t.reference, await e(t.floating), t.strategy),
1513
1533
  floating: {
1514
1534
  x: 0,
1515
1535
  y: 0,
1516
- width: o.width,
1517
- height: o.height
1536
+ width: r.width,
1537
+ height: r.height
1518
1538
  }
1519
1539
  };
1520
1540
  };
1521
- function dr(t) {
1522
- return ot(t).direction === "rtl";
1523
- }
1524
- const fr = {
1525
- convertOffsetParentRelativeRectToViewportRelativeRect: tr,
1526
- getDocumentElement: lt,
1527
- getClippingRect: sr,
1528
- getOffsetParent: pn,
1529
- getElementRects: ur,
1530
- getClientRects: er,
1531
- getDimensions: lr,
1532
- getScale: Mt,
1533
- isElement: nt,
1534
- isRTL: dr
1541
+ function er(t) {
1542
+ return H(t).direction === "rtl";
1543
+ }
1544
+ const nr = {
1545
+ convertOffsetParentRelativeRectToViewportRelativeRect: jn,
1546
+ getDocumentElement: X,
1547
+ getClippingRect: Kn,
1548
+ getOffsetParent: ye,
1549
+ getElementRects: tr,
1550
+ getClientRects: Xn,
1551
+ getDimensions: Qn,
1552
+ getScale: nt,
1553
+ isElement: V,
1554
+ isRTL: er
1535
1555
  };
1536
- function vn(t, e) {
1556
+ function xe(t, e) {
1537
1557
  return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
1538
1558
  }
1539
- function mr(t, e) {
1540
- let n = null, o;
1541
- const a = lt(t);
1559
+ function rr(t, e) {
1560
+ let n = null, r;
1561
+ const o = X(t);
1542
1562
  function i() {
1543
- var l;
1544
- clearTimeout(o), (l = n) == null || l.disconnect(), n = null;
1563
+ var s;
1564
+ clearTimeout(r), (s = n) == null || s.disconnect(), n = null;
1545
1565
  }
1546
- function s(l, d) {
1547
- l === void 0 && (l = !1), d === void 0 && (d = 1), i();
1548
- const c = t.getBoundingClientRect(), {
1549
- left: u,
1550
- top: r,
1551
- width: f,
1552
- height: m
1553
- } = c;
1554
- if (l || e(), !f || !m)
1566
+ function c(s, u) {
1567
+ s === void 0 && (s = !1), u === void 0 && (u = 1), i();
1568
+ const f = t.getBoundingClientRect(), {
1569
+ left: l,
1570
+ top: a,
1571
+ width: m,
1572
+ height: h
1573
+ } = f;
1574
+ if (s || e(), !m || !h)
1555
1575
  return;
1556
- const p = Xt(r), h = Xt(a.clientWidth - (u + f)), y = Xt(a.clientHeight - (r + m)), g = Xt(u), w = {
1557
- rootMargin: -p + "px " + -h + "px " + -y + "px " + -g + "px",
1558
- threshold: Z(0, ht(1, d)) || 1
1576
+ const v = dt(a), d = dt(o.clientWidth - (l + m)), g = dt(o.clientHeight - (a + h)), p = dt(l), x = {
1577
+ rootMargin: -v + "px " + -d + "px " + -g + "px " + -p + "px",
1578
+ threshold: B(0, U(1, u)) || 1
1559
1579
  };
1560
- let x = !0;
1561
- function E(R) {
1562
- const A = R[0].intersectionRatio;
1563
- if (A !== d) {
1564
- if (!x)
1565
- return s();
1566
- A ? s(!1, A) : o = setTimeout(() => {
1567
- s(!1, 1e-7);
1580
+ let b = !0;
1581
+ function S(C) {
1582
+ const R = C[0].intersectionRatio;
1583
+ if (R !== u) {
1584
+ if (!b)
1585
+ return c();
1586
+ R ? c(!1, R) : r = setTimeout(() => {
1587
+ c(!1, 1e-7);
1568
1588
  }, 1e3);
1569
1589
  }
1570
- A === 1 && !vn(c, t.getBoundingClientRect()) && s(), x = !1;
1590
+ R === 1 && !xe(f, t.getBoundingClientRect()) && c(), b = !1;
1571
1591
  }
1572
1592
  try {
1573
- n = new IntersectionObserver(E, {
1574
- ...w,
1593
+ n = new IntersectionObserver(S, {
1594
+ ...x,
1575
1595
  // Handle <iframe>s
1576
- root: a.ownerDocument
1596
+ root: o.ownerDocument
1577
1597
  });
1578
1598
  } catch {
1579
- n = new IntersectionObserver(E, w);
1599
+ n = new IntersectionObserver(S, x);
1580
1600
  }
1581
1601
  n.observe(t);
1582
1602
  }
1583
- return s(!0), i;
1603
+ return c(!0), i;
1584
1604
  }
1585
- function ea(t, e, n, o) {
1586
- o === void 0 && (o = {});
1605
+ function vr(t, e, n, r) {
1606
+ r === void 0 && (r = {});
1587
1607
  const {
1588
- ancestorScroll: a = !0,
1608
+ ancestorScroll: o = !0,
1589
1609
  ancestorResize: i = !0,
1590
- elementResize: s = typeof ResizeObserver == "function",
1591
- layoutShift: l = typeof IntersectionObserver == "function",
1592
- animationFrame: d = !1
1593
- } = o, c = Ce(t), u = a || i ? [...c ? Lt(c) : [], ...Lt(e)] : [];
1594
- u.forEach((g) => {
1595
- a && g.addEventListener("scroll", n, {
1610
+ elementResize: c = typeof ResizeObserver == "function",
1611
+ layoutShift: s = typeof IntersectionObserver == "function",
1612
+ animationFrame: u = !1
1613
+ } = r, f = $t(t), l = o || i ? [...f ? ct(f) : [], ...ct(e)] : [];
1614
+ l.forEach((p) => {
1615
+ o && p.addEventListener("scroll", n, {
1596
1616
  passive: !0
1597
- }), i && g.addEventListener("resize", n);
1617
+ }), i && p.addEventListener("resize", n);
1598
1618
  });
1599
- const r = c && l ? mr(c, n) : null;
1600
- let f = -1, m = null;
1601
- s && (m = new ResizeObserver((g) => {
1602
- let [b] = g;
1603
- b && b.target === c && m && (m.unobserve(e), cancelAnimationFrame(f), f = requestAnimationFrame(() => {
1604
- var w;
1605
- (w = m) == null || w.observe(e);
1619
+ const a = f && s ? rr(f, n) : null;
1620
+ let m = -1, h = null;
1621
+ c && (h = new ResizeObserver((p) => {
1622
+ let [y] = p;
1623
+ y && y.target === f && h && (h.unobserve(e), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1624
+ var x;
1625
+ (x = h) == null || x.observe(e);
1606
1626
  })), n();
1607
- }), c && !d && m.observe(c), m.observe(e));
1608
- let p, h = d ? yt(t) : null;
1609
- d && y();
1610
- function y() {
1611
- const g = yt(t);
1612
- h && !vn(h, g) && n(), h = g, p = requestAnimationFrame(y);
1627
+ }), f && !u && h.observe(f), h.observe(e));
1628
+ let v, d = u ? K(t) : null;
1629
+ u && g();
1630
+ function g() {
1631
+ const p = K(t);
1632
+ d && !xe(d, p) && n(), d = p, v = requestAnimationFrame(g);
1613
1633
  }
1614
1634
  return n(), () => {
1615
- var g;
1616
- u.forEach((b) => {
1617
- a && b.removeEventListener("scroll", n), i && b.removeEventListener("resize", n);
1618
- }), r == null || r(), (g = m) == null || g.disconnect(), m = null, d && cancelAnimationFrame(p);
1635
+ var p;
1636
+ l.forEach((y) => {
1637
+ o && y.removeEventListener("scroll", n), i && y.removeEventListener("resize", n);
1638
+ }), a == null || a(), (p = h) == null || p.disconnect(), h = null, u && cancelAnimationFrame(v);
1619
1639
  };
1620
1640
  }
1621
- const hr = Fo, gr = Wo, pr = _o, vr = zo, yr = Io, Ke = Bo, br = $o, wr = (t, e, n) => {
1622
- const o = /* @__PURE__ */ new Map(), a = {
1623
- platform: fr,
1641
+ const or = Mn, ir = kn, cr = En, sr = Tn, ar = On, ee = An, lr = Ln, fr = (t, e, n) => {
1642
+ const r = /* @__PURE__ */ new Map(), o = {
1643
+ platform: nr,
1624
1644
  ...n
1625
1645
  }, i = {
1626
- ...a.platform,
1627
- _c: o
1646
+ ...o.platform,
1647
+ _c: r
1628
1648
  };
1629
- return Lo(t, e, {
1630
- ...a,
1649
+ return Rn(t, e, {
1650
+ ...o,
1631
1651
  platform: i
1632
1652
  });
1633
1653
  };
1634
- var xr = typeof document < "u", Sr = function() {
1635
- }, Zt = xr ? Nn : Sr;
1636
- function te(t, e) {
1654
+ var ur = typeof document < "u", dr = function() {
1655
+ }, gt = ur ? Ce : dr;
1656
+ function yt(t, e) {
1637
1657
  if (t === e)
1638
1658
  return !0;
1639
1659
  if (typeof t != typeof e)
1640
1660
  return !1;
1641
1661
  if (typeof t == "function" && t.toString() === e.toString())
1642
1662
  return !0;
1643
- let n, o, a;
1663
+ let n, r, o;
1644
1664
  if (t && e && typeof t == "object") {
1645
1665
  if (Array.isArray(t)) {
1646
1666
  if (n = t.length, n !== e.length) return !1;
1647
- for (o = n; o-- !== 0; )
1648
- if (!te(t[o], e[o]))
1667
+ for (r = n; r-- !== 0; )
1668
+ if (!yt(t[r], e[r]))
1649
1669
  return !1;
1650
1670
  return !0;
1651
1671
  }
1652
- if (a = Object.keys(t), n = a.length, n !== Object.keys(e).length)
1672
+ if (o = Object.keys(t), n = o.length, n !== Object.keys(e).length)
1653
1673
  return !1;
1654
- for (o = n; o-- !== 0; )
1655
- if (!{}.hasOwnProperty.call(e, a[o]))
1674
+ for (r = n; r-- !== 0; )
1675
+ if (!{}.hasOwnProperty.call(e, o[r]))
1656
1676
  return !1;
1657
- for (o = n; o-- !== 0; ) {
1658
- const i = a[o];
1659
- if (!(i === "_owner" && t.$$typeof) && !te(t[i], e[i]))
1677
+ for (r = n; r-- !== 0; ) {
1678
+ const i = o[r];
1679
+ if (!(i === "_owner" && t.$$typeof) && !yt(t[i], e[i]))
1660
1680
  return !1;
1661
1681
  }
1662
1682
  return !0;
1663
1683
  }
1664
1684
  return t !== t && e !== e;
1665
1685
  }
1666
- function yn(t) {
1686
+ function be(t) {
1667
1687
  return typeof window > "u" ? 1 : (t.ownerDocument.defaultView || window).devicePixelRatio || 1;
1668
1688
  }
1669
- function Ze(t, e) {
1670
- const n = yn(t);
1689
+ function ne(t, e) {
1690
+ const n = be(t);
1671
1691
  return Math.round(e * n) / n;
1672
1692
  }
1673
- function he(t) {
1674
- const e = S.useRef(t);
1675
- return Zt(() => {
1693
+ function kt(t) {
1694
+ const e = w.useRef(t);
1695
+ return gt(() => {
1676
1696
  e.current = t;
1677
1697
  }), e;
1678
1698
  }
1679
- function na(t) {
1699
+ function pr(t) {
1680
1700
  t === void 0 && (t = {});
1681
1701
  const {
1682
1702
  placement: e = "bottom",
1683
1703
  strategy: n = "absolute",
1684
- middleware: o = [],
1685
- platform: a,
1704
+ middleware: r = [],
1705
+ platform: o,
1686
1706
  elements: {
1687
1707
  reference: i,
1688
- floating: s
1708
+ floating: c
1689
1709
  } = {},
1690
- transform: l = !0,
1691
- whileElementsMounted: d,
1692
- open: c
1693
- } = t, [u, r] = S.useState({
1710
+ transform: s = !0,
1711
+ whileElementsMounted: u,
1712
+ open: f
1713
+ } = t, [l, a] = w.useState({
1694
1714
  x: 0,
1695
1715
  y: 0,
1696
1716
  strategy: n,
1697
1717
  placement: e,
1698
1718
  middlewareData: {},
1699
1719
  isPositioned: !1
1700
- }), [f, m] = S.useState(o);
1701
- te(f, o) || m(o);
1702
- const [p, h] = S.useState(null), [y, g] = S.useState(null), b = S.useCallback((k) => {
1703
- k !== R.current && (R.current = k, h(k));
1704
- }, []), w = S.useCallback((k) => {
1705
- k !== A.current && (A.current = k, g(k));
1706
- }, []), x = i || p, E = s || y, R = S.useRef(null), A = S.useRef(null), D = S.useRef(u), $ = d != null, B = he(d), H = he(a), _ = he(c), N = S.useCallback(() => {
1707
- if (!R.current || !A.current)
1720
+ }), [m, h] = w.useState(r);
1721
+ yt(m, r) || h(r);
1722
+ const [v, d] = w.useState(null), [g, p] = w.useState(null), y = w.useCallback((A) => {
1723
+ A !== C.current && (C.current = A, d(A));
1724
+ }, []), x = w.useCallback((A) => {
1725
+ A !== R.current && (R.current = A, p(A));
1726
+ }, []), b = i || v, S = c || g, C = w.useRef(null), R = w.useRef(null), P = w.useRef(l), L = u != null, O = kt(u), M = kt(o), T = kt(f), D = w.useCallback(() => {
1727
+ if (!C.current || !R.current)
1708
1728
  return;
1709
- const k = {
1729
+ const A = {
1710
1730
  placement: e,
1711
1731
  strategy: n,
1712
- middleware: f
1732
+ middleware: m
1713
1733
  };
1714
- H.current && (k.platform = H.current), wr(R.current, A.current, k).then((F) => {
1715
- const z = {
1716
- ...F,
1734
+ M.current && (A.platform = M.current), fr(C.current, R.current, A).then((N) => {
1735
+ const Z = {
1736
+ ...N,
1717
1737
  // The floating element's position may be recomputed while it's closed
1718
1738
  // but still mounted (such as when transitioning out). To ensure
1719
1739
  // `isPositioned` will be `false` initially on the next open, avoid
1720
1740
  // setting it to `true` when `open === false` (must be specified).
1721
- isPositioned: _.current !== !1
1741
+ isPositioned: T.current !== !1
1722
1742
  };
1723
- P.current && !te(D.current, z) && (D.current = z, Ln.flushSync(() => {
1724
- r(z);
1743
+ E.current && !yt(P.current, Z) && (P.current = Z, Re.flushSync(() => {
1744
+ a(Z);
1725
1745
  }));
1726
1746
  });
1727
- }, [f, e, n, H, _]);
1728
- Zt(() => {
1729
- c === !1 && D.current.isPositioned && (D.current.isPositioned = !1, r((k) => ({
1730
- ...k,
1747
+ }, [m, e, n, M, T]);
1748
+ gt(() => {
1749
+ f === !1 && P.current.isPositioned && (P.current.isPositioned = !1, a((A) => ({
1750
+ ...A,
1731
1751
  isPositioned: !1
1732
1752
  })));
1733
- }, [c]);
1734
- const P = S.useRef(!1);
1735
- Zt(() => (P.current = !0, () => {
1736
- P.current = !1;
1737
- }), []), Zt(() => {
1738
- if (x && (R.current = x), E && (A.current = E), x && E) {
1739
- if (B.current)
1740
- return B.current(x, E, N);
1741
- N();
1753
+ }, [f]);
1754
+ const E = w.useRef(!1);
1755
+ gt(() => (E.current = !0, () => {
1756
+ E.current = !1;
1757
+ }), []), gt(() => {
1758
+ if (b && (C.current = b), S && (R.current = S), b && S) {
1759
+ if (O.current)
1760
+ return O.current(b, S, D);
1761
+ D();
1742
1762
  }
1743
- }, [x, E, N, B, $]);
1744
- const j = S.useMemo(() => ({
1745
- reference: R,
1746
- floating: A,
1747
- setReference: b,
1748
- setFloating: w
1749
- }), [b, w]), C = S.useMemo(() => ({
1750
- reference: x,
1751
- floating: E
1752
- }), [x, E]), O = S.useMemo(() => {
1753
- const k = {
1763
+ }, [b, S, D, O, L]);
1764
+ const $ = w.useMemo(() => ({
1765
+ reference: C,
1766
+ floating: R,
1767
+ setReference: y,
1768
+ setFloating: x
1769
+ }), [y, x]), k = w.useMemo(() => ({
1770
+ reference: b,
1771
+ floating: S
1772
+ }), [b, S]), W = w.useMemo(() => {
1773
+ const A = {
1754
1774
  position: n,
1755
1775
  left: 0,
1756
1776
  top: 0
1757
1777
  };
1758
- if (!C.floating)
1759
- return k;
1760
- const F = Ze(C.floating, u.x), z = Ze(C.floating, u.y);
1761
- return l ? {
1762
- ...k,
1763
- transform: "translate(" + F + "px, " + z + "px)",
1764
- ...yn(C.floating) >= 1.5 && {
1778
+ if (!k.floating)
1779
+ return A;
1780
+ const N = ne(k.floating, l.x), Z = ne(k.floating, l.y);
1781
+ return s ? {
1782
+ ...A,
1783
+ transform: "translate(" + N + "px, " + Z + "px)",
1784
+ ...be(k.floating) >= 1.5 && {
1765
1785
  willChange: "transform"
1766
1786
  }
1767
1787
  } : {
1768
1788
  position: n,
1769
- left: F,
1770
- top: z
1789
+ left: N,
1790
+ top: Z
1771
1791
  };
1772
- }, [n, l, C.floating, u.x, u.y]);
1773
- return S.useMemo(() => ({
1774
- ...u,
1775
- update: N,
1776
- refs: j,
1777
- elements: C,
1778
- floatingStyles: O
1779
- }), [u, N, j, C, O]);
1780
- }
1781
- const Er = (t) => {
1792
+ }, [n, s, k.floating, l.x, l.y]);
1793
+ return w.useMemo(() => ({
1794
+ ...l,
1795
+ update: D,
1796
+ refs: $,
1797
+ elements: k,
1798
+ floatingStyles: W
1799
+ }), [l, D, $, k, W]);
1800
+ }
1801
+ const hr = (t) => {
1782
1802
  function e(n) {
1783
1803
  return {}.hasOwnProperty.call(n, "current");
1784
1804
  }
@@ -1787,792 +1807,50 @@ const Er = (t) => {
1787
1807
  options: t,
1788
1808
  fn(n) {
1789
1809
  const {
1790
- element: o,
1791
- padding: a
1810
+ element: r,
1811
+ padding: o
1792
1812
  } = typeof t == "function" ? t(n) : t;
1793
- return o && e(o) ? o.current != null ? Ke({
1794
- element: o.current,
1795
- padding: a
1796
- }).fn(n) : {} : o ? Ke({
1797
- element: o,
1798
- padding: a
1813
+ return r && e(r) ? r.current != null ? ee({
1814
+ element: r.current,
1815
+ padding: o
1816
+ }).fn(n) : {} : r ? ee({
1817
+ element: r,
1818
+ padding: o
1799
1819
  }).fn(n) : {};
1800
1820
  }
1801
1821
  };
1802
- }, oa = (t, e) => ({
1803
- ...hr(t),
1822
+ }, wr = (t, e) => ({
1823
+ ...or(t),
1804
1824
  options: [t, e]
1805
- }), ra = (t, e) => ({
1806
- ...gr(t),
1825
+ }), yr = (t, e) => ({
1826
+ ...ir(t),
1807
1827
  options: [t, e]
1808
- }), aa = (t, e) => ({
1809
- ...br(t),
1828
+ }), xr = (t, e) => ({
1829
+ ...lr(t),
1810
1830
  options: [t, e]
1811
- }), ia = (t, e) => ({
1812
- ...pr(t),
1831
+ }), br = (t, e) => ({
1832
+ ...cr(t),
1813
1833
  options: [t, e]
1814
- }), sa = (t, e) => ({
1815
- ...vr(t),
1834
+ }), Sr = (t, e) => ({
1835
+ ...sr(t),
1816
1836
  options: [t, e]
1817
- }), la = (t, e) => ({
1818
- ...yr(t),
1837
+ }), Cr = (t, e) => ({
1838
+ ...ar(t),
1819
1839
  options: [t, e]
1820
- }), ca = (t, e) => ({
1821
- ...Er(t),
1840
+ }), Rr = (t, e) => ({
1841
+ ...hr(t),
1822
1842
  options: [t, e]
1823
1843
  });
1824
- function Rr(t) {
1825
- if (typeof document > "u") return;
1826
- let e = document.head || document.getElementsByTagName("head")[0], n = document.createElement("style");
1827
- n.type = "text/css", e.appendChild(n), n.styleSheet ? n.styleSheet.cssText = t : n.appendChild(document.createTextNode(t));
1828
- }
1829
- const Cr = (t) => {
1830
- switch (t) {
1831
- case "success":
1832
- return kr;
1833
- case "info":
1834
- return Or;
1835
- case "warning":
1836
- return Mr;
1837
- case "error":
1838
- return Dr;
1839
- default:
1840
- return null;
1841
- }
1842
- }, Tr = Array(12).fill(0), Ar = ({ visible: t, className: e }) => /* @__PURE__ */ v.createElement("div", {
1843
- className: [
1844
- "sonner-loading-wrapper",
1845
- e
1846
- ].filter(Boolean).join(" "),
1847
- "data-visible": t
1848
- }, /* @__PURE__ */ v.createElement("div", {
1849
- className: "sonner-spinner"
1850
- }, Tr.map((n, o) => /* @__PURE__ */ v.createElement("div", {
1851
- className: "sonner-loading-bar",
1852
- key: `spinner-bar-${o}`
1853
- })))), kr = /* @__PURE__ */ v.createElement("svg", {
1854
- xmlns: "http://www.w3.org/2000/svg",
1855
- viewBox: "0 0 20 20",
1856
- fill: "currentColor",
1857
- height: "20",
1858
- width: "20"
1859
- }, /* @__PURE__ */ v.createElement("path", {
1860
- fillRule: "evenodd",
1861
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
1862
- clipRule: "evenodd"
1863
- })), Mr = /* @__PURE__ */ v.createElement("svg", {
1864
- xmlns: "http://www.w3.org/2000/svg",
1865
- viewBox: "0 0 24 24",
1866
- fill: "currentColor",
1867
- height: "20",
1868
- width: "20"
1869
- }, /* @__PURE__ */ v.createElement("path", {
1870
- fillRule: "evenodd",
1871
- d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
1872
- clipRule: "evenodd"
1873
- })), Or = /* @__PURE__ */ v.createElement("svg", {
1874
- xmlns: "http://www.w3.org/2000/svg",
1875
- viewBox: "0 0 20 20",
1876
- fill: "currentColor",
1877
- height: "20",
1878
- width: "20"
1879
- }, /* @__PURE__ */ v.createElement("path", {
1880
- fillRule: "evenodd",
1881
- d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
1882
- clipRule: "evenodd"
1883
- })), Dr = /* @__PURE__ */ v.createElement("svg", {
1884
- xmlns: "http://www.w3.org/2000/svg",
1885
- viewBox: "0 0 20 20",
1886
- fill: "currentColor",
1887
- height: "20",
1888
- width: "20"
1889
- }, /* @__PURE__ */ v.createElement("path", {
1890
- fillRule: "evenodd",
1891
- d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
1892
- clipRule: "evenodd"
1893
- })), Nr = /* @__PURE__ */ v.createElement("svg", {
1894
- xmlns: "http://www.w3.org/2000/svg",
1895
- width: "12",
1896
- height: "12",
1897
- viewBox: "0 0 24 24",
1898
- fill: "none",
1899
- stroke: "currentColor",
1900
- strokeWidth: "1.5",
1901
- strokeLinecap: "round",
1902
- strokeLinejoin: "round"
1903
- }, /* @__PURE__ */ v.createElement("line", {
1904
- x1: "18",
1905
- y1: "6",
1906
- x2: "6",
1907
- y2: "18"
1908
- }), /* @__PURE__ */ v.createElement("line", {
1909
- x1: "6",
1910
- y1: "6",
1911
- x2: "18",
1912
- y2: "18"
1913
- })), Pr = () => {
1914
- const [t, e] = v.useState(document.hidden);
1915
- return v.useEffect(() => {
1916
- const n = () => {
1917
- e(document.hidden);
1918
- };
1919
- return document.addEventListener("visibilitychange", n), () => window.removeEventListener("visibilitychange", n);
1920
- }, []), t;
1921
- };
1922
- let be = 1;
1923
- class Lr {
1924
- constructor() {
1925
- this.subscribe = (e) => (this.subscribers.push(e), () => {
1926
- const n = this.subscribers.indexOf(e);
1927
- this.subscribers.splice(n, 1);
1928
- }), this.publish = (e) => {
1929
- this.subscribers.forEach((n) => n(e));
1930
- }, this.addToast = (e) => {
1931
- this.publish(e), this.toasts = [
1932
- ...this.toasts,
1933
- e
1934
- ];
1935
- }, this.create = (e) => {
1936
- var n;
1937
- const { message: o, ...a } = e, i = typeof (e == null ? void 0 : e.id) == "number" || ((n = e.id) == null ? void 0 : n.length) > 0 ? e.id : be++, s = this.toasts.find((d) => d.id === i), l = e.dismissible === void 0 ? !0 : e.dismissible;
1938
- return this.dismissedToasts.has(i) && this.dismissedToasts.delete(i), s ? this.toasts = this.toasts.map((d) => d.id === i ? (this.publish({
1939
- ...d,
1940
- ...e,
1941
- id: i,
1942
- title: o
1943
- }), {
1944
- ...d,
1945
- ...e,
1946
- id: i,
1947
- dismissible: l,
1948
- title: o
1949
- }) : d) : this.addToast({
1950
- title: o,
1951
- ...a,
1952
- dismissible: l,
1953
- id: i
1954
- }), i;
1955
- }, this.dismiss = (e) => (e ? (this.dismissedToasts.add(e), requestAnimationFrame(() => this.subscribers.forEach((n) => n({
1956
- id: e,
1957
- dismiss: !0
1958
- })))) : this.toasts.forEach((n) => {
1959
- this.subscribers.forEach((o) => o({
1960
- id: n.id,
1961
- dismiss: !0
1962
- }));
1963
- }), e), this.message = (e, n) => this.create({
1964
- ...n,
1965
- message: e
1966
- }), this.error = (e, n) => this.create({
1967
- ...n,
1968
- message: e,
1969
- type: "error"
1970
- }), this.success = (e, n) => this.create({
1971
- ...n,
1972
- type: "success",
1973
- message: e
1974
- }), this.info = (e, n) => this.create({
1975
- ...n,
1976
- type: "info",
1977
- message: e
1978
- }), this.warning = (e, n) => this.create({
1979
- ...n,
1980
- type: "warning",
1981
- message: e
1982
- }), this.loading = (e, n) => this.create({
1983
- ...n,
1984
- type: "loading",
1985
- message: e
1986
- }), this.promise = (e, n) => {
1987
- if (!n)
1988
- return;
1989
- let o;
1990
- n.loading !== void 0 && (o = this.create({
1991
- ...n,
1992
- promise: e,
1993
- type: "loading",
1994
- message: n.loading,
1995
- description: typeof n.description != "function" ? n.description : void 0
1996
- }));
1997
- const a = Promise.resolve(e instanceof Function ? e() : e);
1998
- let i = o !== void 0, s;
1999
- const l = a.then(async (c) => {
2000
- if (s = [
2001
- "resolve",
2002
- c
2003
- ], v.isValidElement(c))
2004
- i = !1, this.create({
2005
- id: o,
2006
- type: "default",
2007
- message: c
2008
- });
2009
- else if (_r(c) && !c.ok) {
2010
- i = !1;
2011
- const r = typeof n.error == "function" ? await n.error(`HTTP error! status: ${c.status}`) : n.error, f = typeof n.description == "function" ? await n.description(`HTTP error! status: ${c.status}`) : n.description, p = typeof r == "object" && !v.isValidElement(r) ? r : {
2012
- message: r
2013
- };
2014
- this.create({
2015
- id: o,
2016
- type: "error",
2017
- description: f,
2018
- ...p
2019
- });
2020
- } else if (c instanceof Error) {
2021
- i = !1;
2022
- const r = typeof n.error == "function" ? await n.error(c) : n.error, f = typeof n.description == "function" ? await n.description(c) : n.description, p = typeof r == "object" && !v.isValidElement(r) ? r : {
2023
- message: r
2024
- };
2025
- this.create({
2026
- id: o,
2027
- type: "error",
2028
- description: f,
2029
- ...p
2030
- });
2031
- } else if (n.success !== void 0) {
2032
- i = !1;
2033
- const r = typeof n.success == "function" ? await n.success(c) : n.success, f = typeof n.description == "function" ? await n.description(c) : n.description, p = typeof r == "object" && !v.isValidElement(r) ? r : {
2034
- message: r
2035
- };
2036
- this.create({
2037
- id: o,
2038
- type: "success",
2039
- description: f,
2040
- ...p
2041
- });
2042
- }
2043
- }).catch(async (c) => {
2044
- if (s = [
2045
- "reject",
2046
- c
2047
- ], n.error !== void 0) {
2048
- i = !1;
2049
- const u = typeof n.error == "function" ? await n.error(c) : n.error, r = typeof n.description == "function" ? await n.description(c) : n.description, m = typeof u == "object" && !v.isValidElement(u) ? u : {
2050
- message: u
2051
- };
2052
- this.create({
2053
- id: o,
2054
- type: "error",
2055
- description: r,
2056
- ...m
2057
- });
2058
- }
2059
- }).finally(() => {
2060
- i && (this.dismiss(o), o = void 0), n.finally == null || n.finally.call(n);
2061
- }), d = () => new Promise((c, u) => l.then(() => s[0] === "reject" ? u(s[1]) : c(s[1])).catch(u));
2062
- return typeof o != "string" && typeof o != "number" ? {
2063
- unwrap: d
2064
- } : Object.assign(o, {
2065
- unwrap: d
2066
- });
2067
- }, this.custom = (e, n) => {
2068
- const o = (n == null ? void 0 : n.id) || be++;
2069
- return this.create({
2070
- jsx: e(o),
2071
- id: o,
2072
- ...n
2073
- }), o;
2074
- }, this.getActiveToasts = () => this.toasts.filter((e) => !this.dismissedToasts.has(e.id)), this.subscribers = [], this.toasts = [], this.dismissedToasts = /* @__PURE__ */ new Set();
2075
- }
2076
- }
2077
- const U = new Lr(), Br = (t, e) => {
2078
- const n = (e == null ? void 0 : e.id) || be++;
2079
- return U.addToast({
2080
- title: t,
2081
- ...e,
2082
- id: n
2083
- }), n;
2084
- }, _r = (t) => t && typeof t == "object" && "ok" in t && typeof t.ok == "boolean" && "status" in t && typeof t.status == "number", Ir = Br, Hr = () => U.toasts, Fr = () => U.getActiveToasts(), ua = Object.assign(Ir, {
2085
- success: U.success,
2086
- info: U.info,
2087
- warning: U.warning,
2088
- error: U.error,
2089
- custom: U.custom,
2090
- message: U.message,
2091
- promise: U.promise,
2092
- dismiss: U.dismiss,
2093
- loading: U.loading
2094
- }, {
2095
- getHistory: Hr,
2096
- getToasts: Fr
2097
- });
2098
- Rr("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");
2099
- function Ut(t) {
2100
- return t.label !== void 0;
2101
- }
2102
- const Wr = 3, $r = "24px", zr = "16px", Ge = 4e3, Vr = 356, Yr = 14, jr = 45, Xr = 200;
2103
- function rt(...t) {
2104
- return t.filter(Boolean).join(" ");
2105
- }
2106
- function Ur(t) {
2107
- const [e, n] = t.split("-"), o = [];
2108
- return e && o.push(e), n && o.push(n), o;
2109
- }
2110
- const qr = (t) => {
2111
- var e, n, o, a, i, s, l, d, c;
2112
- const { invert: u, toast: r, unstyled: f, interacting: m, setHeights: p, visibleToasts: h, heights: y, index: g, toasts: b, expanded: w, removeToast: x, defaultRichColors: E, closeButton: R, style: A, cancelButtonStyle: D, actionButtonStyle: $, className: B = "", descriptionClassName: H = "", duration: _, position: N, gap: P, expandByDefault: j, classNames: C, icons: O, closeButtonAriaLabel: k = "Close toast" } = t, [F, z] = v.useState(null), [pt, _t] = v.useState(null), [M, W] = v.useState(!1), [I, Q] = v.useState(!1), [bt, L] = v.useState(!1), [wt, It] = v.useState(!1), [Ht, xt] = v.useState(!1), [bn, ie] = v.useState(0), [wn, Te] = v.useState(0), Pt = v.useRef(r.duration || _ || Ge), Ae = v.useRef(null), ct = v.useRef(null), xn = g === 0, Sn = g + 1 <= h, q = r.type, St = r.dismissible !== !1, En = r.className || "", Rn = r.descriptionClassName || "", Ft = v.useMemo(() => y.findIndex((T) => T.toastId === r.id) || 0, [
2113
- y,
2114
- r.id
2115
- ]), Cn = v.useMemo(() => {
2116
- var T;
2117
- return (T = r.closeButton) != null ? T : R;
2118
- }, [
2119
- r.closeButton,
2120
- R
2121
- ]), ke = v.useMemo(() => r.duration || _ || Ge, [
2122
- r.duration,
2123
- _
2124
- ]), se = v.useRef(0), Et = v.useRef(0), Me = v.useRef(0), Rt = v.useRef(null), [Tn, An] = N.split("-"), Oe = v.useMemo(() => y.reduce((T, V, X) => X >= Ft ? T : T + V.height, 0), [
2125
- y,
2126
- Ft
2127
- ]), De = Pr(), kn = r.invert || u, le = q === "loading";
2128
- Et.current = v.useMemo(() => Ft * P + Oe, [
2129
- Ft,
2130
- Oe
2131
- ]), v.useEffect(() => {
2132
- Pt.current = ke;
2133
- }, [
2134
- ke
2135
- ]), v.useEffect(() => {
2136
- W(!0);
2137
- }, []), v.useEffect(() => {
2138
- const T = ct.current;
2139
- if (T) {
2140
- const V = T.getBoundingClientRect().height;
2141
- return Te(V), p((X) => [
2142
- {
2143
- toastId: r.id,
2144
- height: V,
2145
- position: r.position
2146
- },
2147
- ...X
2148
- ]), () => p((X) => X.filter((K) => K.toastId !== r.id));
2149
- }
2150
- }, [
2151
- p,
2152
- r.id
2153
- ]), v.useLayoutEffect(() => {
2154
- if (!M) return;
2155
- const T = ct.current, V = T.style.height;
2156
- T.style.height = "auto";
2157
- const X = T.getBoundingClientRect().height;
2158
- T.style.height = V, Te(X), p((K) => K.find((Y) => Y.toastId === r.id) ? K.map((Y) => Y.toastId === r.id ? {
2159
- ...Y,
2160
- height: X
2161
- } : Y) : [
2162
- {
2163
- toastId: r.id,
2164
- height: X,
2165
- position: r.position
2166
- },
2167
- ...K
2168
- ]);
2169
- }, [
2170
- M,
2171
- r.title,
2172
- r.description,
2173
- p,
2174
- r.id,
2175
- r.jsx,
2176
- r.action,
2177
- r.cancel
2178
- ]);
2179
- const ft = v.useCallback(() => {
2180
- Q(!0), ie(Et.current), p((T) => T.filter((V) => V.toastId !== r.id)), setTimeout(() => {
2181
- x(r);
2182
- }, Xr);
2183
- }, [
2184
- r,
2185
- x,
2186
- p,
2187
- Et
2188
- ]);
2189
- v.useEffect(() => {
2190
- if (r.promise && q === "loading" || r.duration === 1 / 0 || r.type === "loading") return;
2191
- let T;
2192
- return w || m || De ? (() => {
2193
- if (Me.current < se.current) {
2194
- const K = (/* @__PURE__ */ new Date()).getTime() - se.current;
2195
- Pt.current = Pt.current - K;
2196
- }
2197
- Me.current = (/* @__PURE__ */ new Date()).getTime();
2198
- })() : (() => {
2199
- Pt.current !== 1 / 0 && (se.current = (/* @__PURE__ */ new Date()).getTime(), T = setTimeout(() => {
2200
- r.onAutoClose == null || r.onAutoClose.call(r, r), ft();
2201
- }, Pt.current));
2202
- })(), () => clearTimeout(T);
2203
- }, [
2204
- w,
2205
- m,
2206
- r,
2207
- q,
2208
- De,
2209
- ft
2210
- ]), v.useEffect(() => {
2211
- r.delete && (ft(), r.onDismiss == null || r.onDismiss.call(r, r));
2212
- }, [
2213
- ft,
2214
- r.delete
2215
- ]);
2216
- function Mn() {
2217
- var T;
2218
- if (O != null && O.loading) {
2219
- var V;
2220
- return /* @__PURE__ */ v.createElement("div", {
2221
- className: rt(C == null ? void 0 : C.loader, r == null || (V = r.classNames) == null ? void 0 : V.loader, "sonner-loader"),
2222
- "data-visible": q === "loading"
2223
- }, O.loading);
2224
- }
2225
- return /* @__PURE__ */ v.createElement(Ar, {
2226
- className: rt(C == null ? void 0 : C.loader, r == null || (T = r.classNames) == null ? void 0 : T.loader),
2227
- visible: q === "loading"
2228
- });
2229
- }
2230
- const On = r.icon || (O == null ? void 0 : O[q]) || Cr(q);
2231
- var Ne, Pe;
2232
- return /* @__PURE__ */ v.createElement("li", {
2233
- tabIndex: 0,
2234
- ref: ct,
2235
- className: rt(B, En, C == null ? void 0 : C.toast, r == null || (e = r.classNames) == null ? void 0 : e.toast, C == null ? void 0 : C.default, C == null ? void 0 : C[q], r == null || (n = r.classNames) == null ? void 0 : n[q]),
2236
- "data-sonner-toast": "",
2237
- "data-rich-colors": (Ne = r.richColors) != null ? Ne : E,
2238
- "data-styled": !(r.jsx || r.unstyled || f),
2239
- "data-mounted": M,
2240
- "data-promise": !!r.promise,
2241
- "data-swiped": Ht,
2242
- "data-removed": I,
2243
- "data-visible": Sn,
2244
- "data-y-position": Tn,
2245
- "data-x-position": An,
2246
- "data-index": g,
2247
- "data-front": xn,
2248
- "data-swiping": bt,
2249
- "data-dismissible": St,
2250
- "data-type": q,
2251
- "data-invert": kn,
2252
- "data-swipe-out": wt,
2253
- "data-swipe-direction": pt,
2254
- "data-expanded": !!(w || j && M),
2255
- "data-testid": r.testId,
2256
- style: {
2257
- "--index": g,
2258
- "--toasts-before": g,
2259
- "--z-index": b.length - g,
2260
- "--offset": `${I ? bn : Et.current}px`,
2261
- "--initial-height": j ? "auto" : `${wn}px`,
2262
- ...A,
2263
- ...r.style
2264
- },
2265
- onDragEnd: () => {
2266
- L(!1), z(null), Rt.current = null;
2267
- },
2268
- onPointerDown: (T) => {
2269
- T.button !== 2 && (le || !St || (Ae.current = /* @__PURE__ */ new Date(), ie(Et.current), T.target.setPointerCapture(T.pointerId), T.target.tagName !== "BUTTON" && (L(!0), Rt.current = {
2270
- x: T.clientX,
2271
- y: T.clientY
2272
- })));
2273
- },
2274
- onPointerUp: () => {
2275
- var T, V, X;
2276
- if (wt || !St) return;
2277
- Rt.current = null;
2278
- const K = Number(((T = ct.current) == null ? void 0 : T.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0), Wt = Number(((V = ct.current) == null ? void 0 : V.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0), Y = (/* @__PURE__ */ new Date()).getTime() - ((X = Ae.current) == null ? void 0 : X.getTime()), J = F === "x" ? K : Wt, $t = Math.abs(J) / Y;
2279
- if (Math.abs(J) >= jr || $t > 0.11) {
2280
- ie(Et.current), r.onDismiss == null || r.onDismiss.call(r, r), _t(F === "x" ? K > 0 ? "right" : "left" : Wt > 0 ? "down" : "up"), ft(), It(!0);
2281
- return;
2282
- } else {
2283
- var tt, et;
2284
- (tt = ct.current) == null || tt.style.setProperty("--swipe-amount-x", "0px"), (et = ct.current) == null || et.style.setProperty("--swipe-amount-y", "0px");
2285
- }
2286
- xt(!1), L(!1), z(null);
2287
- },
2288
- onPointerMove: (T) => {
2289
- var V, X, K;
2290
- if (!Rt.current || !St || ((V = window.getSelection()) == null ? void 0 : V.toString().length) > 0) return;
2291
- const Y = T.clientY - Rt.current.y, J = T.clientX - Rt.current.x;
2292
- var $t;
2293
- const tt = ($t = t.swipeDirections) != null ? $t : Ur(N);
2294
- !F && (Math.abs(J) > 1 || Math.abs(Y) > 1) && z(Math.abs(J) > Math.abs(Y) ? "x" : "y");
2295
- let et = {
2296
- x: 0,
2297
- y: 0
2298
- };
2299
- const Le = (vt) => 1 / (1.5 + Math.abs(vt) / 20);
2300
- if (F === "y") {
2301
- if (tt.includes("top") || tt.includes("bottom"))
2302
- if (tt.includes("top") && Y < 0 || tt.includes("bottom") && Y > 0)
2303
- et.y = Y;
2304
- else {
2305
- const vt = Y * Le(Y);
2306
- et.y = Math.abs(vt) < Math.abs(Y) ? vt : Y;
2307
- }
2308
- } else if (F === "x" && (tt.includes("left") || tt.includes("right")))
2309
- if (tt.includes("left") && J < 0 || tt.includes("right") && J > 0)
2310
- et.x = J;
2311
- else {
2312
- const vt = J * Le(J);
2313
- et.x = Math.abs(vt) < Math.abs(J) ? vt : J;
2314
- }
2315
- (Math.abs(et.x) > 0 || Math.abs(et.y) > 0) && xt(!0), (X = ct.current) == null || X.style.setProperty("--swipe-amount-x", `${et.x}px`), (K = ct.current) == null || K.style.setProperty("--swipe-amount-y", `${et.y}px`);
2316
- }
2317
- }, Cn && !r.jsx && q !== "loading" ? /* @__PURE__ */ v.createElement("button", {
2318
- "aria-label": k,
2319
- "data-disabled": le,
2320
- "data-close-button": !0,
2321
- onClick: le || !St ? () => {
2322
- } : () => {
2323
- ft(), r.onDismiss == null || r.onDismiss.call(r, r);
2324
- },
2325
- className: rt(C == null ? void 0 : C.closeButton, r == null || (o = r.classNames) == null ? void 0 : o.closeButton)
2326
- }, (Pe = O == null ? void 0 : O.close) != null ? Pe : Nr) : null, (q || r.icon || r.promise) && r.icon !== null && ((O == null ? void 0 : O[q]) !== null || r.icon) ? /* @__PURE__ */ v.createElement("div", {
2327
- "data-icon": "",
2328
- className: rt(C == null ? void 0 : C.icon, r == null || (a = r.classNames) == null ? void 0 : a.icon)
2329
- }, r.promise || r.type === "loading" && !r.icon ? r.icon || Mn() : null, r.type !== "loading" ? On : null) : null, /* @__PURE__ */ v.createElement("div", {
2330
- "data-content": "",
2331
- className: rt(C == null ? void 0 : C.content, r == null || (i = r.classNames) == null ? void 0 : i.content)
2332
- }, /* @__PURE__ */ v.createElement("div", {
2333
- "data-title": "",
2334
- className: rt(C == null ? void 0 : C.title, r == null || (s = r.classNames) == null ? void 0 : s.title)
2335
- }, r.jsx ? r.jsx : typeof r.title == "function" ? r.title() : r.title), r.description ? /* @__PURE__ */ v.createElement("div", {
2336
- "data-description": "",
2337
- className: rt(H, Rn, C == null ? void 0 : C.description, r == null || (l = r.classNames) == null ? void 0 : l.description)
2338
- }, typeof r.description == "function" ? r.description() : r.description) : null), /* @__PURE__ */ v.isValidElement(r.cancel) ? r.cancel : r.cancel && Ut(r.cancel) ? /* @__PURE__ */ v.createElement("button", {
2339
- "data-button": !0,
2340
- "data-cancel": !0,
2341
- style: r.cancelButtonStyle || D,
2342
- onClick: (T) => {
2343
- Ut(r.cancel) && St && (r.cancel.onClick == null || r.cancel.onClick.call(r.cancel, T), ft());
2344
- },
2345
- className: rt(C == null ? void 0 : C.cancelButton, r == null || (d = r.classNames) == null ? void 0 : d.cancelButton)
2346
- }, r.cancel.label) : null, /* @__PURE__ */ v.isValidElement(r.action) ? r.action : r.action && Ut(r.action) ? /* @__PURE__ */ v.createElement("button", {
2347
- "data-button": !0,
2348
- "data-action": !0,
2349
- style: r.actionButtonStyle || $,
2350
- onClick: (T) => {
2351
- Ut(r.action) && (r.action.onClick == null || r.action.onClick.call(r.action, T), !T.defaultPrevented && ft());
2352
- },
2353
- className: rt(C == null ? void 0 : C.actionButton, r == null || (c = r.classNames) == null ? void 0 : c.actionButton)
2354
- }, r.action.label) : null);
2355
- };
2356
- function Qe() {
2357
- if (typeof window > "u" || typeof document > "u") return "ltr";
2358
- const t = document.documentElement.getAttribute("dir");
2359
- return t === "auto" || !t ? window.getComputedStyle(document.documentElement).direction : t;
2360
- }
2361
- function Kr(t, e) {
2362
- const n = {};
2363
- return [
2364
- t,
2365
- e
2366
- ].forEach((o, a) => {
2367
- const i = a === 1, s = i ? "--mobile-offset" : "--offset", l = i ? zr : $r;
2368
- function d(c) {
2369
- [
2370
- "top",
2371
- "right",
2372
- "bottom",
2373
- "left"
2374
- ].forEach((u) => {
2375
- n[`${s}-${u}`] = typeof c == "number" ? `${c}px` : c;
2376
- });
2377
- }
2378
- typeof o == "number" || typeof o == "string" ? d(o) : typeof o == "object" ? [
2379
- "top",
2380
- "right",
2381
- "bottom",
2382
- "left"
2383
- ].forEach((c) => {
2384
- o[c] === void 0 ? n[`${s}-${c}`] = l : n[`${s}-${c}`] = typeof o[c] == "number" ? `${o[c]}px` : o[c];
2385
- }) : d(l);
2386
- }), n;
2387
- }
2388
- const da = /* @__PURE__ */ v.forwardRef(function(e, n) {
2389
- const { id: o, invert: a, position: i = "bottom-right", hotkey: s = [
2390
- "altKey",
2391
- "KeyT"
2392
- ], expand: l, closeButton: d, className: c, offset: u, mobileOffset: r, theme: f = "light", richColors: m, duration: p, style: h, visibleToasts: y = Wr, toastOptions: g, dir: b = Qe(), gap: w = Yr, icons: x, containerAriaLabel: E = "Notifications" } = e, [R, A] = v.useState([]), D = v.useMemo(() => o ? R.filter((M) => M.toasterId === o) : R.filter((M) => !M.toasterId), [
2393
- R,
2394
- o
2395
- ]), $ = v.useMemo(() => Array.from(new Set([
2396
- i
2397
- ].concat(D.filter((M) => M.position).map((M) => M.position)))), [
2398
- D,
2399
- i
2400
- ]), [B, H] = v.useState([]), [_, N] = v.useState(!1), [P, j] = v.useState(!1), [C, O] = v.useState(f !== "system" ? f : typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"), k = v.useRef(null), F = s.join("+").replace(/Key/g, "").replace(/Digit/g, ""), z = v.useRef(null), pt = v.useRef(!1), _t = v.useCallback((M) => {
2401
- A((W) => {
2402
- var I;
2403
- return (I = W.find((Q) => Q.id === M.id)) != null && I.delete || U.dismiss(M.id), W.filter(({ id: Q }) => Q !== M.id);
2404
- });
2405
- }, []);
2406
- return v.useEffect(() => U.subscribe((M) => {
2407
- if (M.dismiss) {
2408
- requestAnimationFrame(() => {
2409
- A((W) => W.map((I) => I.id === M.id ? {
2410
- ...I,
2411
- delete: !0
2412
- } : I));
2413
- });
2414
- return;
2415
- }
2416
- setTimeout(() => {
2417
- Bn.flushSync(() => {
2418
- A((W) => {
2419
- const I = W.findIndex((Q) => Q.id === M.id);
2420
- return I !== -1 ? [
2421
- ...W.slice(0, I),
2422
- {
2423
- ...W[I],
2424
- ...M
2425
- },
2426
- ...W.slice(I + 1)
2427
- ] : [
2428
- M,
2429
- ...W
2430
- ];
2431
- });
2432
- });
2433
- });
2434
- }), [
2435
- R
2436
- ]), v.useEffect(() => {
2437
- if (f !== "system") {
2438
- O(f);
2439
- return;
2440
- }
2441
- if (f === "system" && (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? O("dark") : O("light")), typeof window > "u") return;
2442
- const M = window.matchMedia("(prefers-color-scheme: dark)");
2443
- try {
2444
- M.addEventListener("change", ({ matches: W }) => {
2445
- O(W ? "dark" : "light");
2446
- });
2447
- } catch {
2448
- M.addListener(({ matches: I }) => {
2449
- try {
2450
- O(I ? "dark" : "light");
2451
- } catch (Q) {
2452
- console.error(Q);
2453
- }
2454
- });
2455
- }
2456
- }, [
2457
- f
2458
- ]), v.useEffect(() => {
2459
- R.length <= 1 && N(!1);
2460
- }, [
2461
- R
2462
- ]), v.useEffect(() => {
2463
- const M = (W) => {
2464
- var I;
2465
- if (s.every((L) => W[L] || W.code === L)) {
2466
- var bt;
2467
- N(!0), (bt = k.current) == null || bt.focus();
2468
- }
2469
- W.code === "Escape" && (document.activeElement === k.current || (I = k.current) != null && I.contains(document.activeElement)) && N(!1);
2470
- };
2471
- return document.addEventListener("keydown", M), () => document.removeEventListener("keydown", M);
2472
- }, [
2473
- s
2474
- ]), v.useEffect(() => {
2475
- if (k.current)
2476
- return () => {
2477
- z.current && (z.current.focus({
2478
- preventScroll: !0
2479
- }), z.current = null, pt.current = !1);
2480
- };
2481
- }, [
2482
- k.current
2483
- ]), // Remove item from normal navigation flow, only available via hotkey
2484
- /* @__PURE__ */ v.createElement("section", {
2485
- ref: n,
2486
- "aria-label": `${E} ${F}`,
2487
- tabIndex: -1,
2488
- "aria-live": "polite",
2489
- "aria-relevant": "additions text",
2490
- "aria-atomic": "false",
2491
- suppressHydrationWarning: !0
2492
- }, $.map((M, W) => {
2493
- var I;
2494
- const [Q, bt] = M.split("-");
2495
- return D.length ? /* @__PURE__ */ v.createElement("ol", {
2496
- key: M,
2497
- dir: b === "auto" ? Qe() : b,
2498
- tabIndex: -1,
2499
- ref: k,
2500
- className: c,
2501
- "data-sonner-toaster": !0,
2502
- "data-sonner-theme": C,
2503
- "data-y-position": Q,
2504
- "data-x-position": bt,
2505
- style: {
2506
- "--front-toast-height": `${((I = B[0]) == null ? void 0 : I.height) || 0}px`,
2507
- "--width": `${Vr}px`,
2508
- "--gap": `${w}px`,
2509
- ...h,
2510
- ...Kr(u, r)
2511
- },
2512
- onBlur: (L) => {
2513
- pt.current && !L.currentTarget.contains(L.relatedTarget) && (pt.current = !1, z.current && (z.current.focus({
2514
- preventScroll: !0
2515
- }), z.current = null));
2516
- },
2517
- onFocus: (L) => {
2518
- L.target instanceof HTMLElement && L.target.dataset.dismissible === "false" || pt.current || (pt.current = !0, z.current = L.relatedTarget);
2519
- },
2520
- onMouseEnter: () => N(!0),
2521
- onMouseMove: () => N(!0),
2522
- onMouseLeave: () => {
2523
- P || N(!1);
2524
- },
2525
- onDragEnd: () => N(!1),
2526
- onPointerDown: (L) => {
2527
- L.target instanceof HTMLElement && L.target.dataset.dismissible === "false" || j(!0);
2528
- },
2529
- onPointerUp: () => j(!1)
2530
- }, D.filter((L) => !L.position && W === 0 || L.position === M).map((L, wt) => {
2531
- var It, Ht;
2532
- return /* @__PURE__ */ v.createElement(qr, {
2533
- key: L.id,
2534
- icons: x,
2535
- index: wt,
2536
- toast: L,
2537
- defaultRichColors: m,
2538
- duration: (It = g == null ? void 0 : g.duration) != null ? It : p,
2539
- className: g == null ? void 0 : g.className,
2540
- descriptionClassName: g == null ? void 0 : g.descriptionClassName,
2541
- invert: a,
2542
- visibleToasts: y,
2543
- closeButton: (Ht = g == null ? void 0 : g.closeButton) != null ? Ht : d,
2544
- interacting: P,
2545
- position: M,
2546
- style: g == null ? void 0 : g.style,
2547
- unstyled: g == null ? void 0 : g.unstyled,
2548
- classNames: g == null ? void 0 : g.classNames,
2549
- cancelButtonStyle: g == null ? void 0 : g.cancelButtonStyle,
2550
- actionButtonStyle: g == null ? void 0 : g.actionButtonStyle,
2551
- closeButtonAriaLabel: g == null ? void 0 : g.closeButtonAriaLabel,
2552
- removeToast: _t,
2553
- toasts: D.filter((xt) => xt.position == L.position),
2554
- heights: B.filter((xt) => xt.position == L.position),
2555
- setHeights: H,
2556
- expandByDefault: l,
2557
- gap: w,
2558
- expanded: _,
2559
- swipeDirections: e.swipeDirections
2560
- });
2561
- })) : null;
2562
- }));
2563
- });
2564
1844
  export {
2565
- yo as R,
2566
- da as T,
2567
- sa as a,
2568
- ca as b,
2569
- la as c,
2570
- ea as d,
2571
- ia as f,
2572
- ta as h,
2573
- aa as l,
2574
- oa as o,
2575
- ra as s,
2576
- ua as t,
2577
- na as u
1845
+ an as R,
1846
+ Sr as a,
1847
+ Rr as b,
1848
+ Cr as c,
1849
+ vr as d,
1850
+ br as f,
1851
+ gr as h,
1852
+ xr as l,
1853
+ wr as o,
1854
+ yr as s,
1855
+ pr as u
2578
1856
  };