@zenuml/core 3.27.12 → 3.28.1

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,5 +1,5 @@
1
- import { b as P, u as H, r as E, s as _e, w as k, g as lt, d as at, e as Q, F as ze, m as pe, t as Ee, f as Ie, n as ct, p as ft, h as ut, i as dt, j as ne, U as mt, k as he, T as pt, l as ht, S as gt, q as vt, v as wt, x as yt, y as xt, z as bt, P as Ct, o as Pe, A as At, B as Ot, a as ge, c as Tt, C as Rt, D as St, E as Et, G as Pt, H as Lt, I as Ft } from "./core.d2435cf8.js";
2
- const Ve = ["top", "right", "bottom", "left"], Le = ["start", "end"], Fe = /* @__PURE__ */ Ve.reduce((e, t) => e.concat(t, t + "-" + Le[0], t + "-" + Le[1]), []), Z = Math.min, q = Math.max, ae = Math.round, le = Math.floor, Y = (e) => ({
1
+ import { b as P, u as H, r as R, s as We, w as k, g as lt, d as at, e as Q, F as Ie, m as pe, t as Re, f as Ve, n as ct, p as ut, h as ft, i as dt, j as ne, U as mt, k as ve, T as pt, l as vt, S as gt, q as ht, v as wt, x as yt, y as xt, z as bt, P as Ct, o as Pe, A as Ot, B as At, a as ge, c as Tt, C as St, D as Et, E as Rt, G as Pt, H as Ft, I as Lt } from "./core-cb5ceedc.js";
2
+ const ze = ["top", "right", "bottom", "left"], Fe = ["start", "end"], Le = /* @__PURE__ */ ze.reduce((e, t) => e.concat(t, t + "-" + Fe[0], t + "-" + Fe[1]), []), Z = Math.min, q = Math.max, ae = Math.round, le = Math.floor, X = (e) => ({
3
3
  x: e,
4
4
  y: e
5
5
  }), Bt = {
@@ -17,10 +17,10 @@ function ye(e, t, n) {
17
17
  function K(e, t) {
18
18
  return typeof e == "function" ? e(t) : e;
19
19
  }
20
- function V(e) {
20
+ function z(e) {
21
21
  return e.split("-")[0];
22
22
  }
23
- function W(e) {
23
+ function M(e) {
24
24
  return e.split("-")[1];
25
25
  }
26
26
  function Ue(e) {
@@ -30,19 +30,19 @@ function be(e) {
30
30
  return e === "y" ? "height" : "width";
31
31
  }
32
32
  function de(e) {
33
- return ["top", "bottom"].includes(V(e)) ? "y" : "x";
33
+ return ["top", "bottom"].includes(z(e)) ? "y" : "x";
34
34
  }
35
35
  function Ce(e) {
36
36
  return Ue(de(e));
37
37
  }
38
- function Ye(e, t, n) {
38
+ function Xe(e, t, n) {
39
39
  n === void 0 && (n = !1);
40
- const i = W(e), o = Ce(e), r = be(o);
40
+ const i = M(e), o = Ce(e), r = be(o);
41
41
  let s = o === "x" ? i === (n ? "end" : "start") ? "right" : "left" : i === "start" ? "bottom" : "top";
42
- return t.reference[r] > t.floating[r] && (s = fe(s)), [s, fe(s)];
42
+ return t.reference[r] > t.floating[r] && (s = ue(s)), [s, ue(s)];
43
43
  }
44
44
  function Nt(e) {
45
- const t = fe(e);
45
+ const t = ue(e);
46
46
  return [ce(e), t, ce(t)];
47
47
  }
48
48
  function ce(e) {
@@ -62,14 +62,14 @@ function $t(e, t, n) {
62
62
  }
63
63
  }
64
64
  function kt(e, t, n, i) {
65
- const o = W(e);
66
- let r = $t(V(e), n === "start", i);
65
+ const o = M(e);
66
+ let r = $t(z(e), n === "start", i);
67
67
  return o && (r = r.map((s) => s + "-" + o), t && (r = r.concat(r.map(ce)))), r;
68
68
  }
69
- function fe(e) {
69
+ function ue(e) {
70
70
  return e.replace(/left|right|bottom|top/g, (t) => Bt[t]);
71
71
  }
72
- function Mt(e) {
72
+ function jt(e) {
73
73
  return {
74
74
  top: 0,
75
75
  right: 0,
@@ -78,15 +78,15 @@ function Mt(e) {
78
78
  ...e
79
79
  };
80
80
  }
81
- function Xe(e) {
82
- return typeof e != "number" ? Mt(e) : {
81
+ function Ye(e) {
82
+ return typeof e != "number" ? jt(e) : {
83
83
  top: e,
84
84
  right: e,
85
85
  bottom: e,
86
86
  left: e
87
87
  };
88
88
  }
89
- function ue(e) {
89
+ function fe(e) {
90
90
  const {
91
91
  x: t,
92
92
  y: n,
@@ -109,80 +109,80 @@ function Be(e, t, n) {
109
109
  reference: i,
110
110
  floating: o
111
111
  } = e;
112
- const r = de(t), s = Ce(t), l = be(s), f = V(t), c = r === "y", u = i.x + i.width / 2 - o.width / 2, d = i.y + i.height / 2 - o.height / 2, g = i[l] / 2 - o[l] / 2;
113
- let m;
114
- switch (f) {
112
+ const r = de(t), s = Ce(t), l = be(s), u = z(t), c = r === "y", f = i.x + i.width / 2 - o.width / 2, m = i.y + i.height / 2 - o.height / 2, w = i[l] / 2 - o[l] / 2;
113
+ let d;
114
+ switch (u) {
115
115
  case "top":
116
- m = {
117
- x: u,
116
+ d = {
117
+ x: f,
118
118
  y: i.y - o.height
119
119
  };
120
120
  break;
121
121
  case "bottom":
122
- m = {
123
- x: u,
122
+ d = {
123
+ x: f,
124
124
  y: i.y + i.height
125
125
  };
126
126
  break;
127
127
  case "right":
128
- m = {
128
+ d = {
129
129
  x: i.x + i.width,
130
- y: d
130
+ y: m
131
131
  };
132
132
  break;
133
133
  case "left":
134
- m = {
134
+ d = {
135
135
  x: i.x - o.width,
136
- y: d
136
+ y: m
137
137
  };
138
138
  break;
139
139
  default:
140
- m = {
140
+ d = {
141
141
  x: i.x,
142
142
  y: i.y
143
143
  };
144
144
  }
145
- switch (W(t)) {
145
+ switch (M(t)) {
146
146
  case "start":
147
- m[s] -= g * (n && c ? -1 : 1);
147
+ d[s] -= w * (n && c ? -1 : 1);
148
148
  break;
149
149
  case "end":
150
- m[s] += g * (n && c ? -1 : 1);
150
+ d[s] += w * (n && c ? -1 : 1);
151
151
  break;
152
152
  }
153
- return m;
153
+ return d;
154
154
  }
155
- const jt = async (e, t, n) => {
155
+ const _t = async (e, t, n) => {
156
156
  const {
157
157
  placement: i = "bottom",
158
158
  strategy: o = "absolute",
159
159
  middleware: r = [],
160
160
  platform: s
161
- } = n, l = r.filter(Boolean), f = await (s.isRTL == null ? void 0 : s.isRTL(t));
161
+ } = n, l = r.filter(Boolean), u = await (s.isRTL == null ? void 0 : s.isRTL(t));
162
162
  let c = await s.getElementRects({
163
163
  reference: e,
164
164
  floating: t,
165
165
  strategy: o
166
166
  }), {
167
- x: u,
168
- y: d
169
- } = Be(c, i, f), g = i, m = {}, a = 0;
170
- for (let h = 0; h < l.length; h++) {
167
+ x: f,
168
+ y: m
169
+ } = Be(c, i, u), w = i, d = {}, a = 0;
170
+ for (let v = 0; v < l.length; v++) {
171
171
  const {
172
- name: v,
173
- fn: w
174
- } = l[h], {
172
+ name: g,
173
+ fn: h
174
+ } = l[v], {
175
175
  x: y,
176
176
  y: b,
177
177
  data: C,
178
- reset: A
179
- } = await w({
180
- x: u,
181
- y: d,
178
+ reset: O
179
+ } = await h({
180
+ x: f,
181
+ y: m,
182
182
  initialPlacement: i,
183
- placement: g,
183
+ placement: w,
184
184
  strategy: o,
185
- middlewareData: m,
185
+ middlewareData: d,
186
186
  rects: c,
187
187
  platform: s,
188
188
  elements: {
@@ -190,27 +190,27 @@ const jt = async (e, t, n) => {
190
190
  floating: t
191
191
  }
192
192
  });
193
- u = y != null ? y : u, d = b != null ? b : d, m = {
194
- ...m,
195
- [v]: {
196
- ...m[v],
193
+ f = y ?? f, m = b ?? m, d = {
194
+ ...d,
195
+ [g]: {
196
+ ...d[g],
197
197
  ...C
198
198
  }
199
- }, A && a <= 50 && (a++, typeof A == "object" && (A.placement && (g = A.placement), A.rects && (c = A.rects === !0 ? await s.getElementRects({
199
+ }, O && a <= 50 && (a++, typeof O == "object" && (O.placement && (w = O.placement), O.rects && (c = O.rects === !0 ? await s.getElementRects({
200
200
  reference: e,
201
201
  floating: t,
202
202
  strategy: o
203
- }) : A.rects), {
204
- x: u,
205
- y: d
206
- } = Be(c, g, f)), h = -1);
203
+ }) : O.rects), {
204
+ x: f,
205
+ y: m
206
+ } = Be(c, w, u)), v = -1);
207
207
  }
208
208
  return {
209
- x: u,
210
- y: d,
211
- placement: g,
209
+ x: f,
210
+ y: m,
211
+ placement: w,
212
212
  strategy: o,
213
- middlewareData: m
213
+ middlewareData: d
214
214
  };
215
215
  };
216
216
  async function oe(e, t) {
@@ -222,19 +222,19 @@ async function oe(e, t) {
222
222
  platform: r,
223
223
  rects: s,
224
224
  elements: l,
225
- strategy: f
225
+ strategy: u
226
226
  } = e, {
227
227
  boundary: c = "clippingAncestors",
228
- rootBoundary: u = "viewport",
229
- elementContext: d = "floating",
230
- altBoundary: g = !1,
231
- padding: m = 0
232
- } = K(t, e), a = Xe(m), v = l[g ? d === "floating" ? "reference" : "floating" : d], w = ue(await r.getClippingRect({
233
- element: (n = await (r.isElement == null ? void 0 : r.isElement(v))) == null || n ? v : v.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
228
+ rootBoundary: f = "viewport",
229
+ elementContext: m = "floating",
230
+ altBoundary: w = !1,
231
+ padding: d = 0
232
+ } = K(t, e), a = Ye(d), g = l[w ? m === "floating" ? "reference" : "floating" : m], h = fe(await r.getClippingRect({
233
+ element: (n = await (r.isElement == null ? void 0 : r.isElement(g))) == null || n ? g : g.contextElement || await (r.getDocumentElement == null ? void 0 : r.getDocumentElement(l.floating)),
234
234
  boundary: c,
235
- rootBoundary: u,
236
- strategy: f
237
- })), y = d === "floating" ? {
235
+ rootBoundary: f,
236
+ strategy: u
237
+ })), y = m === "floating" ? {
238
238
  x: i,
239
239
  y: o,
240
240
  width: s.floating.width,
@@ -245,17 +245,17 @@ async function oe(e, t) {
245
245
  } : {
246
246
  x: 1,
247
247
  y: 1
248
- }, A = ue(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
248
+ }, O = fe(r.convertOffsetParentRelativeRectToViewportRelativeRect ? await r.convertOffsetParentRelativeRectToViewportRelativeRect({
249
249
  elements: l,
250
250
  rect: y,
251
251
  offsetParent: b,
252
- strategy: f
252
+ strategy: u
253
253
  }) : y);
254
254
  return {
255
- top: (w.top - A.top + a.top) / C.y,
256
- bottom: (A.bottom - w.bottom + a.bottom) / C.y,
257
- left: (w.left - A.left + a.left) / C.x,
258
- right: (A.right - w.right + a.right) / C.x
255
+ top: (h.top - O.top + a.top) / C.y,
256
+ bottom: (O.bottom - h.bottom + a.bottom) / C.y,
257
+ left: (h.left - O.left + a.left) / C.x,
258
+ right: (O.right - h.right + a.right) / C.x
259
259
  };
260
260
  }
261
261
  const Ht = (e) => ({
@@ -269,37 +269,37 @@ const Ht = (e) => ({
269
269
  rects: r,
270
270
  platform: s,
271
271
  elements: l,
272
- middlewareData: f
272
+ middlewareData: u
273
273
  } = t, {
274
274
  element: c,
275
- padding: u = 0
275
+ padding: f = 0
276
276
  } = K(e, t) || {};
277
277
  if (c == null)
278
278
  return {};
279
- const d = Xe(u), g = {
279
+ const m = Ye(f), w = {
280
280
  x: n,
281
281
  y: i
282
- }, m = Ce(o), a = be(m), h = await s.getDimensions(c), v = m === "y", w = v ? "top" : "left", y = v ? "bottom" : "right", b = v ? "clientHeight" : "clientWidth", C = r.reference[a] + r.reference[m] - g[m] - r.floating[a], A = g[m] - r.reference[m], O = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c));
283
- let p = O ? O[b] : 0;
284
- (!p || !await (s.isElement == null ? void 0 : s.isElement(O))) && (p = l.floating[b] || r.floating[a]);
285
- const T = C / 2 - A / 2, L = p / 2 - h[a] / 2 - 1, S = Z(d[w], L), B = Z(d[y], L), R = S, D = p - h[a] - B, F = p / 2 - h[a] / 2 + T, $ = ye(R, F, D), j = !f.arrow && W(o) != null && F !== $ && r.reference[a] / 2 - (F < R ? S : B) - h[a] / 2 < 0, I = j ? F < R ? F - R : F - D : 0;
282
+ }, d = Ce(o), a = be(d), v = await s.getDimensions(c), g = d === "y", h = g ? "top" : "left", y = g ? "bottom" : "right", b = g ? "clientHeight" : "clientWidth", C = r.reference[a] + r.reference[d] - w[d] - r.floating[a], O = w[d] - r.reference[d], A = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(c));
283
+ let p = A ? A[b] : 0;
284
+ (!p || !await (s.isElement == null ? void 0 : s.isElement(A))) && (p = l.floating[b] || r.floating[a]);
285
+ const T = C / 2 - O / 2, F = p / 2 - v[a] / 2 - 1, E = Z(m[h], F), B = Z(m[y], F), S = E, D = p - v[a] - B, L = p / 2 - v[a] / 2 + T, $ = ye(S, L, D), _ = !u.arrow && M(o) != null && L !== $ && r.reference[a] / 2 - (L < S ? E : B) - v[a] / 2 < 0, V = _ ? L < S ? L - S : L - D : 0;
286
286
  return {
287
- [m]: g[m] + I,
287
+ [d]: w[d] + V,
288
288
  data: {
289
- [m]: $,
290
- centerOffset: F - $ - I,
291
- ...j && {
292
- alignmentOffset: I
289
+ [d]: $,
290
+ centerOffset: L - $ - V,
291
+ ..._ && {
292
+ alignmentOffset: V
293
293
  }
294
294
  },
295
- reset: j
295
+ reset: _
296
296
  };
297
297
  }
298
298
  });
299
- function Wt(e, t, n) {
300
- return (e ? [...n.filter((o) => W(o) === e), ...n.filter((o) => W(o) !== e)] : n.filter((o) => V(o) === o)).filter((o) => e ? W(o) === e || (t ? ce(o) !== o : !1) : !0);
299
+ function Mt(e, t, n) {
300
+ return (e ? [...n.filter((o) => M(o) === e), ...n.filter((o) => M(o) !== e)] : n.filter((o) => z(o) === o)).filter((o) => e ? M(o) === e || (t ? ce(o) !== o : !1) : !0);
301
301
  }
302
- const _t = function(e) {
302
+ const Wt = function(e) {
303
303
  return e === void 0 && (e = {}), {
304
304
  name: "autoPlacement",
305
305
  options: e,
@@ -309,57 +309,65 @@ const _t = function(e) {
309
309
  rects: r,
310
310
  middlewareData: s,
311
311
  placement: l,
312
- platform: f,
312
+ platform: u,
313
313
  elements: c
314
314
  } = t, {
315
- crossAxis: u = !1,
316
- alignment: d,
317
- allowedPlacements: g = Fe,
318
- autoAlignment: m = !0,
315
+ crossAxis: f = !1,
316
+ alignment: m,
317
+ allowedPlacements: w = Le,
318
+ autoAlignment: d = !0,
319
319
  ...a
320
- } = K(e, t), h = d !== void 0 || g === Fe ? Wt(d || null, m, g) : g, v = await oe(t, a), w = ((n = s.autoPlacement) == null ? void 0 : n.index) || 0, y = h[w];
320
+ } = K(e, t), v = m !== void 0 || w === Le ? Mt(m || null, d, w) : w, g = await oe(t, a), h = ((n = s.autoPlacement) == null ? void 0 : n.index) || 0, y = v[h];
321
321
  if (y == null)
322
322
  return {};
323
- const b = Ye(y, r, await (f.isRTL == null ? void 0 : f.isRTL(c.floating)));
323
+ const b = Xe(y, r, await (u.isRTL == null ? void 0 : u.isRTL(c.floating)));
324
324
  if (l !== y)
325
325
  return {
326
326
  reset: {
327
- placement: h[0]
327
+ placement: v[0]
328
328
  }
329
329
  };
330
- const C = [v[V(y)], v[b[0]], v[b[1]]], A = [...((i = s.autoPlacement) == null ? void 0 : i.overflows) || [], {
330
+ const C = [g[z(y)], g[b[0]], g[b[1]]], O = [...((i = s.autoPlacement) == null ? void 0 : i.overflows) || [], {
331
331
  placement: y,
332
332
  overflows: C
333
- }], O = h[w + 1];
334
- if (O)
333
+ }], A = v[h + 1];
334
+ if (A)
335
335
  return {
336
336
  data: {
337
- index: w + 1,
338
- overflows: A
337
+ index: h + 1,
338
+ overflows: O
339
339
  },
340
340
  reset: {
341
- placement: O
341
+ placement: A
342
342
  }
343
343
  };
344
- const p = A.map((S) => {
345
- const B = W(S.placement);
346
- return [S.placement, B && u ? S.overflows.slice(0, 2).reduce((R, D) => R + D, 0) : S.overflows[0], S.overflows];
347
- }).sort((S, B) => S[1] - B[1]), L = ((o = p.filter((S) => S[2].slice(
344
+ const p = O.map((E) => {
345
+ const B = M(E.placement);
346
+ return [E.placement, B && f ? (
347
+ // Check along the mainAxis and main crossAxis side.
348
+ E.overflows.slice(0, 2).reduce((S, D) => S + D, 0)
349
+ ) : (
350
+ // Check only the mainAxis.
351
+ E.overflows[0]
352
+ ), E.overflows];
353
+ }).sort((E, B) => E[1] - B[1]), F = ((o = p.filter((E) => E[2].slice(
348
354
  0,
349
- W(S[0]) ? 2 : 3
355
+ // Aligned placements should not check their opposite crossAxis
356
+ // side.
357
+ M(E[0]) ? 2 : 3
350
358
  ).every((B) => B <= 0))[0]) == null ? void 0 : o[0]) || p[0][0];
351
- return L !== l ? {
359
+ return F !== l ? {
352
360
  data: {
353
- index: w + 1,
354
- overflows: A
361
+ index: h + 1,
362
+ overflows: O
355
363
  },
356
364
  reset: {
357
- placement: L
365
+ placement: F
358
366
  }
359
367
  } : {};
360
368
  }
361
369
  };
362
- }, zt = function(e) {
370
+ }, It = function(e) {
363
371
  return e === void 0 && (e = {}), {
364
372
  name: "flip",
365
373
  options: e,
@@ -370,60 +378,60 @@ const _t = function(e) {
370
378
  middlewareData: r,
371
379
  rects: s,
372
380
  initialPlacement: l,
373
- platform: f,
381
+ platform: u,
374
382
  elements: c
375
383
  } = t, {
376
- mainAxis: u = !0,
377
- crossAxis: d = !0,
378
- fallbackPlacements: g,
379
- fallbackStrategy: m = "bestFit",
384
+ mainAxis: f = !0,
385
+ crossAxis: m = !0,
386
+ fallbackPlacements: w,
387
+ fallbackStrategy: d = "bestFit",
380
388
  fallbackAxisSideDirection: a = "none",
381
- flipAlignment: h = !0,
382
- ...v
389
+ flipAlignment: v = !0,
390
+ ...g
383
391
  } = K(e, t);
384
392
  if ((n = r.arrow) != null && n.alignmentOffset)
385
393
  return {};
386
- const w = V(o), y = V(l) === l, b = await (f.isRTL == null ? void 0 : f.isRTL(c.floating)), C = g || (y || !h ? [fe(l)] : Nt(l));
387
- !g && a !== "none" && C.push(...kt(l, h, a, b));
388
- const A = [l, ...C], O = await oe(t, v), p = [];
394
+ const h = z(o), y = z(l) === l, b = await (u.isRTL == null ? void 0 : u.isRTL(c.floating)), C = w || (y || !v ? [ue(l)] : Nt(l));
395
+ !w && a !== "none" && C.push(...kt(l, v, a, b));
396
+ const O = [l, ...C], A = await oe(t, g), p = [];
389
397
  let T = ((i = r.flip) == null ? void 0 : i.overflows) || [];
390
- if (u && p.push(O[w]), d) {
391
- const R = Ye(o, s, b);
392
- p.push(O[R[0]], O[R[1]]);
398
+ if (f && p.push(A[h]), m) {
399
+ const S = Xe(o, s, b);
400
+ p.push(A[S[0]], A[S[1]]);
393
401
  }
394
402
  if (T = [...T, {
395
403
  placement: o,
396
404
  overflows: p
397
- }], !p.every((R) => R <= 0)) {
398
- var L, S;
399
- const R = (((L = r.flip) == null ? void 0 : L.index) || 0) + 1, D = A[R];
405
+ }], !p.every((S) => S <= 0)) {
406
+ var F, E;
407
+ const S = (((F = r.flip) == null ? void 0 : F.index) || 0) + 1, D = O[S];
400
408
  if (D)
401
409
  return {
402
410
  data: {
403
- index: R,
411
+ index: S,
404
412
  overflows: T
405
413
  },
406
414
  reset: {
407
415
  placement: D
408
416
  }
409
417
  };
410
- let F = (S = T.filter(($) => $.overflows[0] <= 0).sort(($, j) => $.overflows[1] - j.overflows[1])[0]) == null ? void 0 : S.placement;
411
- if (!F)
412
- switch (m) {
418
+ let L = (E = T.filter(($) => $.overflows[0] <= 0).sort(($, _) => $.overflows[1] - _.overflows[1])[0]) == null ? void 0 : E.placement;
419
+ if (!L)
420
+ switch (d) {
413
421
  case "bestFit": {
414
422
  var B;
415
- const $ = (B = T.map((j) => [j.placement, j.overflows.filter((I) => I > 0).reduce((I, st) => I + st, 0)]).sort((j, I) => j[1] - I[1])[0]) == null ? void 0 : B[0];
416
- $ && (F = $);
423
+ const $ = (B = T.map((_) => [_.placement, _.overflows.filter((V) => V > 0).reduce((V, st) => V + st, 0)]).sort((_, V) => _[1] - V[1])[0]) == null ? void 0 : B[0];
424
+ $ && (L = $);
417
425
  break;
418
426
  }
419
427
  case "initialPlacement":
420
- F = l;
428
+ L = l;
421
429
  break;
422
430
  }
423
- if (o !== F)
431
+ if (o !== L)
424
432
  return {
425
433
  reset: {
426
- placement: F
434
+ placement: L
427
435
  }
428
436
  };
429
437
  }
@@ -440,9 +448,9 @@ function De(e, t) {
440
448
  };
441
449
  }
442
450
  function Ne(e) {
443
- return Ve.some((t) => e[t] >= 0);
451
+ return ze.some((t) => e[t] >= 0);
444
452
  }
445
- const It = function(e) {
453
+ const Vt = function(e) {
446
454
  return e === void 0 && (e = {}), {
447
455
  name: "hide",
448
456
  options: e,
@@ -484,32 +492,32 @@ const It = function(e) {
484
492
  }
485
493
  };
486
494
  };
487
- async function Vt(e, t) {
495
+ async function zt(e, t) {
488
496
  const {
489
497
  placement: n,
490
498
  platform: i,
491
499
  elements: o
492
- } = e, r = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), s = V(n), l = W(n), f = de(n) === "y", c = ["left", "top"].includes(s) ? -1 : 1, u = r && f ? -1 : 1, d = K(t, e);
500
+ } = e, r = await (i.isRTL == null ? void 0 : i.isRTL(o.floating)), s = z(n), l = M(n), u = de(n) === "y", c = ["left", "top"].includes(s) ? -1 : 1, f = r && u ? -1 : 1, m = K(t, e);
493
501
  let {
494
- mainAxis: g,
495
- crossAxis: m,
502
+ mainAxis: w,
503
+ crossAxis: d,
496
504
  alignmentAxis: a
497
- } = typeof d == "number" ? {
498
- mainAxis: d,
505
+ } = typeof m == "number" ? {
506
+ mainAxis: m,
499
507
  crossAxis: 0,
500
508
  alignmentAxis: null
501
509
  } : {
502
510
  mainAxis: 0,
503
511
  crossAxis: 0,
504
512
  alignmentAxis: null,
505
- ...d
513
+ ...m
506
514
  };
507
- return l && typeof a == "number" && (m = l === "end" ? a * -1 : a), f ? {
508
- x: m * u,
509
- y: g * c
515
+ return l && typeof a == "number" && (d = l === "end" ? a * -1 : a), u ? {
516
+ x: d * f,
517
+ y: w * c
510
518
  } : {
511
- x: g * c,
512
- y: m * u
519
+ x: w * c,
520
+ y: d * f
513
521
  };
514
522
  }
515
523
  const Ut = function(e) {
@@ -523,18 +531,18 @@ const Ut = function(e) {
523
531
  y: r,
524
532
  placement: s,
525
533
  middlewareData: l
526
- } = t, f = await Vt(t, e);
534
+ } = t, u = await zt(t, e);
527
535
  return s === ((n = l.offset) == null ? void 0 : n.placement) && (i = l.arrow) != null && i.alignmentOffset ? {} : {
528
- x: o + f.x,
529
- y: r + f.y,
536
+ x: o + u.x,
537
+ y: r + u.y,
530
538
  data: {
531
- ...f,
539
+ ...u,
532
540
  placement: s
533
541
  }
534
542
  };
535
543
  }
536
544
  };
537
- }, Yt = function(e) {
545
+ }, Xt = function(e) {
538
546
  return e === void 0 && (e = {}), {
539
547
  name: "shift",
540
548
  options: e,
@@ -547,41 +555,41 @@ const Ut = function(e) {
547
555
  mainAxis: r = !0,
548
556
  crossAxis: s = !1,
549
557
  limiter: l = {
550
- fn: (v) => {
558
+ fn: (g) => {
551
559
  let {
552
- x: w,
560
+ x: h,
553
561
  y
554
- } = v;
562
+ } = g;
555
563
  return {
556
- x: w,
564
+ x: h,
557
565
  y
558
566
  };
559
567
  }
560
568
  },
561
- ...f
569
+ ...u
562
570
  } = K(e, t), c = {
563
571
  x: n,
564
572
  y: i
565
- }, u = await oe(t, f), d = de(V(o)), g = Ue(d);
566
- let m = c[g], a = c[d];
573
+ }, f = await oe(t, u), m = de(z(o)), w = Ue(m);
574
+ let d = c[w], a = c[m];
567
575
  if (r) {
568
- const v = g === "y" ? "top" : "left", w = g === "y" ? "bottom" : "right", y = m + u[v], b = m - u[w];
569
- m = ye(y, m, b);
576
+ const g = w === "y" ? "top" : "left", h = w === "y" ? "bottom" : "right", y = d + f[g], b = d - f[h];
577
+ d = ye(y, d, b);
570
578
  }
571
579
  if (s) {
572
- const v = d === "y" ? "top" : "left", w = d === "y" ? "bottom" : "right", y = a + u[v], b = a - u[w];
580
+ const g = m === "y" ? "top" : "left", h = m === "y" ? "bottom" : "right", y = a + f[g], b = a - f[h];
573
581
  a = ye(y, a, b);
574
582
  }
575
- const h = l.fn({
583
+ const v = l.fn({
576
584
  ...t,
577
- [g]: m,
578
- [d]: a
585
+ [w]: d,
586
+ [m]: a
579
587
  });
580
588
  return {
581
- ...h,
589
+ ...v,
582
590
  data: {
583
- x: h.x - n,
584
- y: h.y - i
591
+ x: v.x - n,
592
+ y: v.y - i
585
593
  }
586
594
  };
587
595
  }
@@ -601,10 +609,10 @@ function U(e) {
601
609
  function qe(e) {
602
610
  return e instanceof Node || e instanceof N(e).Node;
603
611
  }
604
- function _(e) {
612
+ function W(e) {
605
613
  return e instanceof Element || e instanceof N(e).Element;
606
614
  }
607
- function z(e) {
615
+ function I(e) {
608
616
  return e instanceof HTMLElement || e instanceof N(e).HTMLElement;
609
617
  }
610
618
  function $e(e) {
@@ -616,36 +624,36 @@ function se(e) {
616
624
  overflowX: n,
617
625
  overflowY: i,
618
626
  display: o
619
- } = M(e);
627
+ } = j(e);
620
628
  return /auto|scroll|overlay|hidden|clip/.test(t + i + n) && !["inline", "contents"].includes(o);
621
629
  }
622
- function Xt(e) {
630
+ function Yt(e) {
623
631
  return ["table", "td", "th"].includes(te(e));
624
632
  }
625
- function Ae(e) {
626
- const t = Oe(), n = M(e);
633
+ function Oe(e) {
634
+ const t = Ae(), n = j(e);
627
635
  return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((i) => (n.willChange || "").includes(i)) || ["paint", "layout", "strict", "content"].some((i) => (n.contain || "").includes(i));
628
636
  }
629
637
  function qt(e) {
630
- let t = X(e);
631
- for (; z(t) && !ee(t); ) {
632
- if (Ae(t))
638
+ let t = Y(e);
639
+ for (; I(t) && !ee(t); ) {
640
+ if (Oe(t))
633
641
  return t;
634
- t = X(t);
642
+ t = Y(t);
635
643
  }
636
644
  return null;
637
645
  }
638
- function Oe() {
646
+ function Ae() {
639
647
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
640
648
  }
641
649
  function ee(e) {
642
650
  return ["html", "body", "#document"].includes(te(e));
643
651
  }
644
- function M(e) {
652
+ function j(e) {
645
653
  return N(e).getComputedStyle(e);
646
654
  }
647
655
  function me(e) {
648
- return _(e) ? {
656
+ return W(e) ? {
649
657
  scrollLeft: e.scrollLeft,
650
658
  scrollTop: e.scrollTop
651
659
  } : {
@@ -653,15 +661,21 @@ function me(e) {
653
661
  scrollTop: e.pageYOffset
654
662
  };
655
663
  }
656
- function X(e) {
664
+ function Y(e) {
657
665
  if (te(e) === "html")
658
666
  return e;
659
- const t = e.assignedSlot || e.parentNode || $e(e) && e.host || U(e);
667
+ const t = (
668
+ // Step into the shadow DOM of the parent of a slotted node.
669
+ e.assignedSlot || // DOM Element detected.
670
+ e.parentNode || // ShadowRoot detected.
671
+ $e(e) && e.host || // Fallback.
672
+ U(e)
673
+ );
660
674
  return $e(t) ? t.host : t;
661
675
  }
662
676
  function Ge(e) {
663
- const t = X(e);
664
- return ee(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : z(t) && se(t) ? t : Ge(t);
677
+ const t = Y(e);
678
+ return ee(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : I(t) && se(t) ? t : Ge(t);
665
679
  }
666
680
  function ie(e, t, n) {
667
681
  var i;
@@ -670,9 +684,9 @@ function ie(e, t, n) {
670
684
  return r ? t.concat(s, s.visualViewport || [], se(o) ? o : [], s.frameElement && n ? ie(s.frameElement) : []) : t.concat(o, ie(o, [], n));
671
685
  }
672
686
  function Ke(e) {
673
- const t = M(e);
687
+ const t = j(e);
674
688
  let n = parseFloat(t.width) || 0, i = parseFloat(t.height) || 0;
675
- const o = z(e), r = o ? e.offsetWidth : n, s = o ? e.offsetHeight : i, l = ae(n) !== r || ae(i) !== s;
689
+ const o = I(e), r = o ? e.offsetWidth : n, s = o ? e.offsetHeight : i, l = ae(n) !== r || ae(i) !== s;
676
690
  return l && (n = r, i = s), {
677
691
  width: n,
678
692
  height: i,
@@ -680,12 +694,12 @@ function Ke(e) {
680
694
  };
681
695
  }
682
696
  function Te(e) {
683
- return _(e) ? e : e.contextElement;
697
+ return W(e) ? e : e.contextElement;
684
698
  }
685
699
  function J(e) {
686
700
  const t = Te(e);
687
- if (!z(t))
688
- return Y(1);
701
+ if (!I(t))
702
+ return X(1);
689
703
  const n = t.getBoundingClientRect(), {
690
704
  width: i,
691
705
  height: o,
@@ -697,10 +711,10 @@ function J(e) {
697
711
  y: l
698
712
  };
699
713
  }
700
- const Gt = /* @__PURE__ */ Y(0);
714
+ const Gt = /* @__PURE__ */ X(0);
701
715
  function Qe(e) {
702
716
  const t = N(e);
703
- return !Oe() || !t.visualViewport ? Gt : {
717
+ return !Ae() || !t.visualViewport ? Gt : {
704
718
  x: t.visualViewport.offsetLeft,
705
719
  y: t.visualViewport.offsetTop
706
720
  };
@@ -711,27 +725,27 @@ function Kt(e, t, n) {
711
725
  function G(e, t, n, i) {
712
726
  t === void 0 && (t = !1), n === void 0 && (n = !1);
713
727
  const o = e.getBoundingClientRect(), r = Te(e);
714
- let s = Y(1);
715
- t && (i ? _(i) && (s = J(i)) : s = J(e));
716
- const l = Kt(r, n, i) ? Qe(r) : Y(0);
717
- let f = (o.left + l.x) / s.x, c = (o.top + l.y) / s.y, u = o.width / s.x, d = o.height / s.y;
728
+ let s = X(1);
729
+ t && (i ? W(i) && (s = J(i)) : s = J(e));
730
+ const l = Kt(r, n, i) ? Qe(r) : X(0);
731
+ let u = (o.left + l.x) / s.x, c = (o.top + l.y) / s.y, f = o.width / s.x, m = o.height / s.y;
718
732
  if (r) {
719
- const g = N(r), m = i && _(i) ? N(i) : i;
720
- let a = g, h = a.frameElement;
721
- for (; h && i && m !== a; ) {
722
- const v = J(h), w = h.getBoundingClientRect(), y = M(h), b = w.left + (h.clientLeft + parseFloat(y.paddingLeft)) * v.x, C = w.top + (h.clientTop + parseFloat(y.paddingTop)) * v.y;
723
- f *= v.x, c *= v.y, u *= v.x, d *= v.y, f += b, c += C, a = N(h), h = a.frameElement;
733
+ const w = N(r), d = i && W(i) ? N(i) : i;
734
+ let a = w, v = a.frameElement;
735
+ for (; v && i && d !== a; ) {
736
+ const g = J(v), h = v.getBoundingClientRect(), y = j(v), b = h.left + (v.clientLeft + parseFloat(y.paddingLeft)) * g.x, C = h.top + (v.clientTop + parseFloat(y.paddingTop)) * g.y;
737
+ u *= g.x, c *= g.y, f *= g.x, m *= g.y, u += b, c += C, a = N(v), v = a.frameElement;
724
738
  }
725
739
  }
726
- return ue({
727
- width: u,
728
- height: d,
729
- x: f,
740
+ return fe({
741
+ width: f,
742
+ height: m,
743
+ x: u,
730
744
  y: c
731
745
  });
732
746
  }
733
747
  const Qt = [":popover-open", ":modal"];
734
- function Re(e) {
748
+ function Se(e) {
735
749
  return Qt.some((t) => {
736
750
  try {
737
751
  return e.matches(t);
@@ -747,23 +761,23 @@ function Jt(e) {
747
761
  offsetParent: i,
748
762
  strategy: o
749
763
  } = e;
750
- const r = o === "fixed", s = U(i), l = t ? Re(t.floating) : !1;
764
+ const r = o === "fixed", s = U(i), l = t ? Se(t.floating) : !1;
751
765
  if (i === s || l && r)
752
766
  return n;
753
- let f = {
767
+ let u = {
754
768
  scrollLeft: 0,
755
769
  scrollTop: 0
756
- }, c = Y(1);
757
- const u = Y(0), d = z(i);
758
- if ((d || !d && !r) && ((te(i) !== "body" || se(s)) && (f = me(i)), z(i))) {
759
- const g = G(i);
760
- c = J(i), u.x = g.x + i.clientLeft, u.y = g.y + i.clientTop;
770
+ }, c = X(1);
771
+ const f = X(0), m = I(i);
772
+ if ((m || !m && !r) && ((te(i) !== "body" || se(s)) && (u = me(i)), I(i))) {
773
+ const w = G(i);
774
+ c = J(i), f.x = w.x + i.clientLeft, f.y = w.y + i.clientTop;
761
775
  }
762
776
  return {
763
777
  width: n.width * c.x,
764
778
  height: n.height * c.y,
765
- x: n.x * c.x - f.scrollLeft * c.x + u.x,
766
- y: n.y * c.y - f.scrollTop * c.y + u.y
779
+ x: n.x * c.x - u.scrollLeft * c.x + f.x,
780
+ y: n.y * c.y - u.scrollTop * c.y + f.y
767
781
  };
768
782
  }
769
783
  function Zt(e) {
@@ -776,7 +790,7 @@ function en(e) {
776
790
  const t = U(e), n = me(e), i = e.ownerDocument.body, o = q(t.scrollWidth, t.clientWidth, i.scrollWidth, i.clientWidth), r = q(t.scrollHeight, t.clientHeight, i.scrollHeight, i.clientHeight);
777
791
  let s = -n.scrollLeft + Je(e);
778
792
  const l = -n.scrollTop;
779
- return M(i).direction === "rtl" && (s += q(t.clientWidth, i.clientWidth) - o), {
793
+ return j(i).direction === "rtl" && (s += q(t.clientWidth, i.clientWidth) - o), {
780
794
  width: o,
781
795
  height: r,
782
796
  x: s,
@@ -785,25 +799,25 @@ function en(e) {
785
799
  }
786
800
  function tn(e, t) {
787
801
  const n = N(e), i = U(e), o = n.visualViewport;
788
- let r = i.clientWidth, s = i.clientHeight, l = 0, f = 0;
802
+ let r = i.clientWidth, s = i.clientHeight, l = 0, u = 0;
789
803
  if (o) {
790
804
  r = o.width, s = o.height;
791
- const c = Oe();
792
- (!c || c && t === "fixed") && (l = o.offsetLeft, f = o.offsetTop);
805
+ const c = Ae();
806
+ (!c || c && t === "fixed") && (l = o.offsetLeft, u = o.offsetTop);
793
807
  }
794
808
  return {
795
809
  width: r,
796
810
  height: s,
797
811
  x: l,
798
- y: f
812
+ y: u
799
813
  };
800
814
  }
801
815
  function nn(e, t) {
802
- const n = G(e, !0, t === "fixed"), i = n.top + e.clientTop, o = n.left + e.clientLeft, r = z(e) ? J(e) : Y(1), s = e.clientWidth * r.x, l = e.clientHeight * r.y, f = o * r.x, c = i * r.y;
816
+ const n = G(e, !0, t === "fixed"), i = n.top + e.clientTop, o = n.left + e.clientLeft, r = I(e) ? J(e) : X(1), s = e.clientWidth * r.x, l = e.clientHeight * r.y, u = o * r.x, c = i * r.y;
803
817
  return {
804
818
  width: s,
805
819
  height: l,
806
- x: f,
820
+ x: u,
807
821
  y: c
808
822
  };
809
823
  }
@@ -813,7 +827,7 @@ function ke(e, t, n) {
813
827
  i = tn(e, n);
814
828
  else if (t === "document")
815
829
  i = en(U(e));
816
- else if (_(t))
830
+ else if (W(t))
817
831
  i = nn(t, n);
818
832
  else {
819
833
  const o = Qe(e);
@@ -823,22 +837,22 @@ function ke(e, t, n) {
823
837
  y: t.y - o.y
824
838
  };
825
839
  }
826
- return ue(i);
840
+ return fe(i);
827
841
  }
828
842
  function Ze(e, t) {
829
- const n = X(e);
830
- return n === t || !_(n) || ee(n) ? !1 : M(n).position === "fixed" || Ze(n, t);
843
+ const n = Y(e);
844
+ return n === t || !W(n) || ee(n) ? !1 : j(n).position === "fixed" || Ze(n, t);
831
845
  }
832
846
  function on(e, t) {
833
847
  const n = t.get(e);
834
848
  if (n)
835
849
  return n;
836
- let i = ie(e, [], !1).filter((l) => _(l) && te(l) !== "body"), o = null;
837
- const r = M(e).position === "fixed";
838
- let s = r ? X(e) : e;
839
- for (; _(s) && !ee(s); ) {
840
- const l = M(s), f = Ae(s);
841
- !f && l.position === "fixed" && (o = null), (r ? !f && !o : !f && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || se(s) && !f && Ze(e, s)) ? i = i.filter((u) => u !== s) : o = l, s = X(s);
850
+ let i = ie(e, [], !1).filter((l) => W(l) && te(l) !== "body"), o = null;
851
+ const r = j(e).position === "fixed";
852
+ let s = r ? Y(e) : e;
853
+ for (; W(s) && !ee(s); ) {
854
+ const l = j(s), u = Oe(s);
855
+ !u && l.position === "fixed" && (o = null), (r ? !u && !o : !u && l.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || se(s) && !u && Ze(e, s)) ? i = i.filter((f) => f !== s) : o = l, s = Y(s);
842
856
  }
843
857
  return t.set(e, i), i;
844
858
  }
@@ -849,15 +863,15 @@ function rn(e) {
849
863
  rootBoundary: i,
850
864
  strategy: o
851
865
  } = e;
852
- const s = [...n === "clippingAncestors" ? Re(t) ? [] : on(t, this._c) : [].concat(n), i], l = s[0], f = s.reduce((c, u) => {
853
- const d = ke(t, u, o);
854
- return c.top = q(d.top, c.top), c.right = Z(d.right, c.right), c.bottom = Z(d.bottom, c.bottom), c.left = q(d.left, c.left), c;
866
+ const s = [...n === "clippingAncestors" ? Se(t) ? [] : on(t, this._c) : [].concat(n), i], l = s[0], u = s.reduce((c, f) => {
867
+ const m = ke(t, f, o);
868
+ return c.top = q(m.top, c.top), c.right = Z(m.right, c.right), c.bottom = Z(m.bottom, c.bottom), c.left = q(m.left, c.left), c;
855
869
  }, ke(t, l, o));
856
870
  return {
857
- width: f.right - f.left,
858
- height: f.bottom - f.top,
859
- x: f.left,
860
- y: f.top
871
+ width: u.right - u.left,
872
+ height: u.bottom - u.top,
873
+ x: u.left,
874
+ y: u.top
861
875
  };
862
876
  }
863
877
  function sn(e) {
@@ -871,49 +885,49 @@ function sn(e) {
871
885
  };
872
886
  }
873
887
  function ln(e, t, n) {
874
- const i = z(t), o = U(t), r = n === "fixed", s = G(e, !0, r, t);
888
+ const i = I(t), o = U(t), r = n === "fixed", s = G(e, !0, r, t);
875
889
  let l = {
876
890
  scrollLeft: 0,
877
891
  scrollTop: 0
878
892
  };
879
- const f = Y(0);
893
+ const u = X(0);
880
894
  if (i || !i && !r)
881
895
  if ((te(t) !== "body" || se(o)) && (l = me(t)), i) {
882
- const d = G(t, !0, r, t);
883
- f.x = d.x + t.clientLeft, f.y = d.y + t.clientTop;
896
+ const m = G(t, !0, r, t);
897
+ u.x = m.x + t.clientLeft, u.y = m.y + t.clientTop;
884
898
  } else
885
- o && (f.x = Je(o));
886
- const c = s.left + l.scrollLeft - f.x, u = s.top + l.scrollTop - f.y;
899
+ o && (u.x = Je(o));
900
+ const c = s.left + l.scrollLeft - u.x, f = s.top + l.scrollTop - u.y;
887
901
  return {
888
902
  x: c,
889
- y: u,
903
+ y: f,
890
904
  width: s.width,
891
905
  height: s.height
892
906
  };
893
907
  }
894
- function ve(e) {
895
- return M(e).position === "static";
908
+ function he(e) {
909
+ return j(e).position === "static";
896
910
  }
897
- function Me(e, t) {
898
- return !z(e) || M(e).position === "fixed" ? null : t ? t(e) : e.offsetParent;
911
+ function je(e, t) {
912
+ return !I(e) || j(e).position === "fixed" ? null : t ? t(e) : e.offsetParent;
899
913
  }
900
914
  function et(e, t) {
901
915
  const n = N(e);
902
- if (Re(e))
916
+ if (Se(e))
903
917
  return n;
904
- if (!z(e)) {
905
- let o = X(e);
918
+ if (!I(e)) {
919
+ let o = Y(e);
906
920
  for (; o && !ee(o); ) {
907
- if (_(o) && !ve(o))
921
+ if (W(o) && !he(o))
908
922
  return o;
909
- o = X(o);
923
+ o = Y(o);
910
924
  }
911
925
  return n;
912
926
  }
913
- let i = Me(e, t);
914
- for (; i && Xt(i) && ve(i); )
915
- i = Me(i, t);
916
- return i && ee(i) && ve(i) && !Ae(i) ? n : i || qt(e) || n;
927
+ let i = je(e, t);
928
+ for (; i && Yt(i) && he(i); )
929
+ i = je(i, t);
930
+ return i && ee(i) && he(i) && !Oe(i) ? n : i || qt(e) || n;
917
931
  }
918
932
  const an = async function(e) {
919
933
  const t = this.getOffsetParent || et, n = this.getDimensions, i = await n(e.floating);
@@ -928,9 +942,9 @@ const an = async function(e) {
928
942
  };
929
943
  };
930
944
  function cn(e) {
931
- return M(e).direction === "rtl";
945
+ return j(e).direction === "rtl";
932
946
  }
933
- const fn = {
947
+ const un = {
934
948
  convertOffsetParentRelativeRectToViewportRelativeRect: Jt,
935
949
  getDocumentElement: U,
936
950
  getClippingRect: rn,
@@ -939,37 +953,37 @@ const fn = {
939
953
  getClientRects: Zt,
940
954
  getDimensions: sn,
941
955
  getScale: J,
942
- isElement: _,
956
+ isElement: W,
943
957
  isRTL: cn
944
958
  };
945
- function un(e, t) {
959
+ function fn(e, t) {
946
960
  let n = null, i;
947
961
  const o = U(e);
948
962
  function r() {
949
963
  var l;
950
964
  clearTimeout(i), (l = n) == null || l.disconnect(), n = null;
951
965
  }
952
- function s(l, f) {
953
- l === void 0 && (l = !1), f === void 0 && (f = 1), r();
966
+ function s(l, u) {
967
+ l === void 0 && (l = !1), u === void 0 && (u = 1), r();
954
968
  const {
955
969
  left: c,
956
- top: u,
957
- width: d,
958
- height: g
970
+ top: f,
971
+ width: m,
972
+ height: w
959
973
  } = e.getBoundingClientRect();
960
- if (l || t(), !d || !g)
974
+ if (l || t(), !m || !w)
961
975
  return;
962
- const m = le(u), a = le(o.clientWidth - (c + d)), h = le(o.clientHeight - (u + g)), v = le(c), y = {
963
- rootMargin: -m + "px " + -a + "px " + -h + "px " + -v + "px",
964
- threshold: q(0, Z(1, f)) || 1
976
+ const d = le(f), a = le(o.clientWidth - (c + m)), v = le(o.clientHeight - (f + w)), g = le(c), y = {
977
+ rootMargin: -d + "px " + -a + "px " + -v + "px " + -g + "px",
978
+ threshold: q(0, Z(1, u)) || 1
965
979
  };
966
980
  let b = !0;
967
- function C(A) {
968
- const O = A[0].intersectionRatio;
969
- if (O !== f) {
981
+ function C(O) {
982
+ const A = O[0].intersectionRatio;
983
+ if (A !== u) {
970
984
  if (!b)
971
985
  return s();
972
- O ? s(!1, O) : i = setTimeout(() => {
986
+ A ? s(!1, A) : i = setTimeout(() => {
973
987
  s(!1, 1e-7);
974
988
  }, 1e3);
975
989
  }
@@ -978,6 +992,7 @@ function un(e, t) {
978
992
  try {
979
993
  n = new IntersectionObserver(C, {
980
994
  ...y,
995
+ // Handle <iframe>s
981
996
  root: o.ownerDocument
982
997
  });
983
998
  } catch {
@@ -994,44 +1009,44 @@ function dn(e, t, n, i) {
994
1009
  ancestorResize: r = !0,
995
1010
  elementResize: s = typeof ResizeObserver == "function",
996
1011
  layoutShift: l = typeof IntersectionObserver == "function",
997
- animationFrame: f = !1
998
- } = i, c = Te(e), u = o || r ? [...c ? ie(c) : [], ...ie(t)] : [];
999
- u.forEach((w) => {
1000
- o && w.addEventListener("scroll", n, {
1012
+ animationFrame: u = !1
1013
+ } = i, c = Te(e), f = o || r ? [...c ? ie(c) : [], ...ie(t)] : [];
1014
+ f.forEach((h) => {
1015
+ o && h.addEventListener("scroll", n, {
1001
1016
  passive: !0
1002
- }), r && w.addEventListener("resize", n);
1017
+ }), r && h.addEventListener("resize", n);
1003
1018
  });
1004
- const d = c && l ? un(c, n) : null;
1005
- let g = -1, m = null;
1006
- s && (m = new ResizeObserver((w) => {
1007
- let [y] = w;
1008
- y && y.target === c && m && (m.unobserve(t), cancelAnimationFrame(g), g = requestAnimationFrame(() => {
1019
+ const m = c && l ? fn(c, n) : null;
1020
+ let w = -1, d = null;
1021
+ s && (d = new ResizeObserver((h) => {
1022
+ let [y] = h;
1023
+ y && y.target === c && d && (d.unobserve(t), cancelAnimationFrame(w), w = requestAnimationFrame(() => {
1009
1024
  var b;
1010
- (b = m) == null || b.observe(t);
1025
+ (b = d) == null || b.observe(t);
1011
1026
  })), n();
1012
- }), c && !f && m.observe(c), m.observe(t));
1013
- let a, h = f ? G(e) : null;
1014
- f && v();
1015
- function v() {
1016
- const w = G(e);
1017
- h && (w.x !== h.x || w.y !== h.y || w.width !== h.width || w.height !== h.height) && n(), h = w, a = requestAnimationFrame(v);
1027
+ }), c && !u && d.observe(c), d.observe(t));
1028
+ let a, v = u ? G(e) : null;
1029
+ u && g();
1030
+ function g() {
1031
+ const h = G(e);
1032
+ v && (h.x !== v.x || h.y !== v.y || h.width !== v.width || h.height !== v.height) && n(), v = h, a = requestAnimationFrame(g);
1018
1033
  }
1019
1034
  return n(), () => {
1020
- var w;
1021
- u.forEach((y) => {
1035
+ var h;
1036
+ f.forEach((y) => {
1022
1037
  o && y.removeEventListener("scroll", n), r && y.removeEventListener("resize", n);
1023
- }), d == null || d(), (w = m) == null || w.disconnect(), m = null, f && cancelAnimationFrame(a);
1038
+ }), m == null || m(), (h = d) == null || h.disconnect(), d = null, u && cancelAnimationFrame(a);
1024
1039
  };
1025
1040
  }
1026
- const mn = Ut, pn = _t, hn = Yt, gn = zt, vn = It, wn = Ht, yn = (e, t, n) => {
1041
+ const mn = Ut, pn = Wt, vn = Xt, gn = It, hn = Vt, wn = Ht, yn = (e, t, n) => {
1027
1042
  const i = /* @__PURE__ */ new Map(), o = {
1028
- platform: fn,
1043
+ platform: un,
1029
1044
  ...n
1030
1045
  }, r = {
1031
1046
  ...o.platform,
1032
1047
  _c: i
1033
1048
  };
1034
- return jt(e, t, {
1049
+ return _t(e, t, {
1035
1050
  ...o,
1036
1051
  platform: r
1037
1052
  });
@@ -1056,7 +1071,7 @@ function xe(e) {
1056
1071
  }
1057
1072
  return e;
1058
1073
  }
1059
- function An(e) {
1074
+ function On(e) {
1060
1075
  return {
1061
1076
  name: "arrow",
1062
1077
  options: e,
@@ -1072,11 +1087,11 @@ function An(e) {
1072
1087
  function nt(e) {
1073
1088
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1074
1089
  }
1075
- function je(e, t) {
1090
+ function _e(e, t) {
1076
1091
  const n = nt(e);
1077
1092
  return Math.round(t * n) / n;
1078
1093
  }
1079
- function On(e, t, n) {
1094
+ function An(e, t, n) {
1080
1095
  n === void 0 && (n = {});
1081
1096
  const i = n.whileElementsMounted, o = P(() => {
1082
1097
  var p;
@@ -1087,81 +1102,81 @@ function On(e, t, n) {
1087
1102
  }), l = P(() => {
1088
1103
  var p;
1089
1104
  return (p = H(n.strategy)) != null ? p : "absolute";
1090
- }), f = P(() => {
1105
+ }), u = P(() => {
1091
1106
  var p;
1092
1107
  return (p = H(n.transform)) != null ? p : !0;
1093
- }), c = P(() => xe(e.value)), u = P(() => xe(t.value)), d = E(0), g = E(0), m = E(l.value), a = E(s.value), h = _e({}), v = E(!1), w = P(() => {
1108
+ }), c = P(() => xe(e.value)), f = P(() => xe(t.value)), m = R(0), w = R(0), d = R(l.value), a = R(s.value), v = We({}), g = R(!1), h = P(() => {
1094
1109
  const p = {
1095
- position: m.value,
1110
+ position: d.value,
1096
1111
  left: "0",
1097
1112
  top: "0"
1098
1113
  };
1099
- if (!u.value)
1114
+ if (!f.value)
1100
1115
  return p;
1101
- const T = je(u.value, d.value), L = je(u.value, g.value);
1102
- return f.value ? {
1116
+ const T = _e(f.value, m.value), F = _e(f.value, w.value);
1117
+ return u.value ? {
1103
1118
  ...p,
1104
- transform: "translate(" + T + "px, " + L + "px)",
1105
- ...nt(u.value) >= 1.5 && {
1119
+ transform: "translate(" + T + "px, " + F + "px)",
1120
+ ...nt(f.value) >= 1.5 && {
1106
1121
  willChange: "transform"
1107
1122
  }
1108
1123
  } : {
1109
- position: m.value,
1124
+ position: d.value,
1110
1125
  left: T + "px",
1111
- top: L + "px"
1126
+ top: F + "px"
1112
1127
  };
1113
1128
  });
1114
1129
  let y;
1115
1130
  function b() {
1116
- c.value == null || u.value == null || yn(c.value, u.value, {
1131
+ c.value == null || f.value == null || yn(c.value, f.value, {
1117
1132
  middleware: r.value,
1118
1133
  placement: s.value,
1119
1134
  strategy: l.value
1120
1135
  }).then((p) => {
1121
- d.value = p.x, g.value = p.y, m.value = p.strategy, a.value = p.placement, h.value = p.middlewareData, v.value = !0;
1136
+ m.value = p.x, w.value = p.y, d.value = p.strategy, a.value = p.placement, v.value = p.middlewareData, g.value = !0;
1122
1137
  });
1123
1138
  }
1124
1139
  function C() {
1125
1140
  typeof y == "function" && (y(), y = void 0);
1126
1141
  }
1127
- function A() {
1142
+ function O() {
1128
1143
  if (C(), i === void 0) {
1129
1144
  b();
1130
1145
  return;
1131
1146
  }
1132
- if (c.value != null && u.value != null) {
1133
- y = i(c.value, u.value, b);
1147
+ if (c.value != null && f.value != null) {
1148
+ y = i(c.value, f.value, b);
1134
1149
  return;
1135
1150
  }
1136
1151
  }
1137
- function O() {
1138
- o.value || (v.value = !1);
1152
+ function A() {
1153
+ o.value || (g.value = !1);
1139
1154
  }
1140
1155
  return k([r, s, l], b, {
1141
1156
  flush: "sync"
1142
- }), k([c, u], A, {
1157
+ }), k([c, f], O, {
1143
1158
  flush: "sync"
1144
- }), k(o, O, {
1159
+ }), k(o, A, {
1145
1160
  flush: "sync"
1146
1161
  }), lt() && at(C), {
1147
- x: Q(d),
1148
- y: Q(g),
1149
- strategy: Q(m),
1162
+ x: Q(m),
1163
+ y: Q(w),
1164
+ strategy: Q(d),
1150
1165
  placement: Q(a),
1151
- middlewareData: Q(h),
1152
- isPositioned: Q(v),
1153
- floatingStyles: w,
1166
+ middlewareData: Q(v),
1167
+ isPositioned: Q(g),
1168
+ floatingStyles: h,
1154
1169
  update: b
1155
1170
  };
1156
1171
  }
1157
- var Tn = Object.defineProperty, Rn = (e, t, n) => t in e ? Tn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, Sn = (e, t, n) => (Rn(e, typeof t != "symbol" ? t + "" : t, n), n);
1172
+ var Tn = Object.defineProperty, Sn = (e, t, n) => t in e ? Tn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, En = (e, t, n) => (Sn(e, typeof t != "symbol" ? t + "" : t, n), n);
1158
1173
  function re(e) {
1159
- return e == null || e.value == null ? null : e.value instanceof Node ? e.value : "$el" in e.value && e.value.$el ? re(E(e.value.$el)) : "getBoundingClientRect" in e.value ? e.value : null;
1174
+ return e == null || e.value == null ? null : e.value instanceof Node ? e.value : "$el" in e.value && e.value.$el ? re(R(e.value.$el)) : "getBoundingClientRect" in e.value ? e.value : null;
1160
1175
  }
1161
1176
  function ot(e) {
1162
- return e.reduce((t, n) => n.type === ze ? t.concat(ot(n.children)) : t.concat(n), []);
1177
+ return e.reduce((t, n) => n.type === Ie ? t.concat(ot(n.children)) : t.concat(n), []);
1163
1178
  }
1164
- function En(e) {
1179
+ function Rn(e) {
1165
1180
  return e == null ? !1 : typeof e.type == "string" || typeof e.type == "object" || typeof e.type == "function";
1166
1181
  }
1167
1182
  function He(e) {
@@ -1169,7 +1184,7 @@ function He(e) {
1169
1184
  }
1170
1185
  class Pn {
1171
1186
  constructor() {
1172
- Sn(this, "current", this.detect());
1187
+ En(this, "current", this.detect());
1173
1188
  }
1174
1189
  set(t) {
1175
1190
  this.current !== t && (this.current = t);
@@ -1187,9 +1202,9 @@ class Pn {
1187
1202
  return typeof window > "u" || typeof document > "u" ? "server" : "client";
1188
1203
  }
1189
1204
  }
1190
- const Se = new Pn();
1191
- function Ln(e) {
1192
- if (Se.isServer)
1205
+ const Ee = new Pn();
1206
+ function Fn(e) {
1207
+ if (Ee.isServer)
1193
1208
  return null;
1194
1209
  if (e instanceof Node)
1195
1210
  return e.ownerDocument;
@@ -1200,7 +1215,7 @@ function Ln(e) {
1200
1215
  }
1201
1216
  return document;
1202
1217
  }
1203
- function Fn(e, t) {
1218
+ function Ln(e, t) {
1204
1219
  !t.vueTransition && (t.transitionName || t.transitionType) && console.warn(`[headlessui-float]: <${e} /> pass "transition-name" or "transition-type" prop, must be set "vue-transition" prop.`);
1205
1220
  }
1206
1221
  function Bn(e, t, n, i, o) {
@@ -1217,7 +1232,7 @@ function Bn(e, t, n, i, o) {
1217
1232
  (typeof o.offset == "number" || typeof o.offset == "object" || typeof o.offset == "function") && r.push(mn(o.offset)), (o.flip === !0 || typeof o.flip == "number" || typeof o.flip == "object") && r.push(gn({
1218
1233
  padding: typeof o.flip == "number" ? o.flip : void 0,
1219
1234
  ...typeof o.flip == "object" ? o.flip : {}
1220
- })), (o.shift === !0 || typeof o.shift == "number" || typeof o.shift == "object") && r.push(hn({
1235
+ })), (o.shift === !0 || typeof o.shift == "number" || typeof o.shift == "object") && r.push(vn({
1221
1236
  padding: typeof o.shift == "number" ? o.shift : void 0,
1222
1237
  ...typeof o.shift == "object" ? o.shift : {}
1223
1238
  })), (o.autoPlacement === !0 || typeof o.autoPlacement == "object") && r.push(pn(
@@ -1225,11 +1240,11 @@ function Bn(e, t, n, i, o) {
1225
1240
  )), r.push(...typeof o.middleware == "function" ? o.middleware({
1226
1241
  referenceEl: t,
1227
1242
  floatingEl: n
1228
- }) : o.middleware || []), (o.arrow === !0 || typeof o.arrow == "number") && r.push(An({
1243
+ }) : o.middleware || []), (o.arrow === !0 || typeof o.arrow == "number") && r.push(On({
1229
1244
  element: i,
1230
1245
  padding: o.arrow === !0 ? 0 : o.arrow
1231
1246
  })), (o.hide === !0 || typeof o.hide == "object" || Array.isArray(o.hide)) && (Array.isArray(o.hide) ? o.hide : [o.hide]).forEach((s) => {
1232
- r.push(vn(
1247
+ r.push(hn(
1233
1248
  typeof s == "object" ? s : void 0
1234
1249
  ));
1235
1250
  }), e.value = r;
@@ -1238,8 +1253,8 @@ function Bn(e, t, n, i, o) {
1238
1253
  function Dn(e, t, n) {
1239
1254
  let i = () => {
1240
1255
  };
1241
- Ie(() => {
1242
- if (e && Se.isClient && typeof ResizeObserver < "u" && t.value && t.value instanceof Element) {
1256
+ Ve(() => {
1257
+ if (e && Ee.isClient && typeof ResizeObserver < "u" && t.value && t.value instanceof Element) {
1243
1258
  const o = new ResizeObserver(([r]) => {
1244
1259
  n.value = r.borderBoxSize.reduce((s, { inlineSize: l }) => s + l, 0);
1245
1260
  });
@@ -1247,7 +1262,7 @@ function Dn(e, t, n) {
1247
1262
  o.disconnect(), n.value = null;
1248
1263
  };
1249
1264
  }
1250
- }), ut(() => {
1265
+ }), ft(() => {
1251
1266
  i();
1252
1267
  });
1253
1268
  }
@@ -1304,7 +1319,7 @@ function it(e, t, ...n) {
1304
1319
  );
1305
1320
  throw Error.captureStackTrace && Error.captureStackTrace(i, it), i;
1306
1321
  }
1307
- const We = [
1322
+ const Me = [
1308
1323
  "[contentEditable=true]",
1309
1324
  "[tabindex]",
1310
1325
  "a[href]",
@@ -1315,19 +1330,22 @@ const We = [
1315
1330
  "select:not([disabled])",
1316
1331
  "textarea:not([disabled])"
1317
1332
  ].map(
1333
+ // TODO: Remove this once JSDOM fixes the issue where an element that is
1334
+ // "hidden" can be the document.activeElement, because this is not possible
1335
+ // in real browsers.
1318
1336
  (e) => `${e}:not([tabindex='-1'])`
1319
1337
  ).join(",");
1320
1338
  var rt = /* @__PURE__ */ ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(rt || {});
1321
1339
  function kn(e, t = 0) {
1322
1340
  var n;
1323
- return e === ((n = Ln(e)) == null ? void 0 : n.body) ? !1 : it(t, {
1341
+ return e === ((n = Fn(e)) == null ? void 0 : n.body) ? !1 : it(t, {
1324
1342
  0() {
1325
- return e.matches(We);
1343
+ return e.matches(Me);
1326
1344
  },
1327
1345
  1() {
1328
1346
  let i = e;
1329
1347
  for (; i !== null; ) {
1330
- if (i.matches(We))
1348
+ if (i.matches(Me))
1331
1349
  return !0;
1332
1350
  i = i.parentElement;
1333
1351
  }
@@ -1336,30 +1354,39 @@ function kn(e, t = 0) {
1336
1354
  });
1337
1355
  }
1338
1356
  function we(e, t, n) {
1339
- Se.isServer || dt((i) => {
1357
+ Ee.isServer || dt((i) => {
1340
1358
  document.addEventListener(e, t, n), i(() => document.removeEventListener(e, t, n));
1341
1359
  });
1342
1360
  }
1343
- function Mn(e, t, n = P(() => !0)) {
1361
+ function jn(e, t, n = P(() => !0)) {
1344
1362
  function i(r, s) {
1345
1363
  if (!n.value || r.defaultPrevented)
1346
1364
  return;
1347
1365
  const l = s(r);
1348
1366
  if (l === null || !l.getRootNode().contains(l))
1349
1367
  return;
1350
- const f = function c(u) {
1351
- return typeof u == "function" ? c(u()) : Array.isArray(u) || u instanceof Set ? u : [u];
1368
+ const u = function c(f) {
1369
+ return typeof f == "function" ? c(f()) : Array.isArray(f) || f instanceof Set ? f : [f];
1352
1370
  }(e);
1353
- for (const c of f) {
1371
+ for (const c of u) {
1354
1372
  if (c === null)
1355
1373
  continue;
1356
- const u = c instanceof HTMLElement ? c : re(c);
1357
- if (u != null && u.contains(l) || r.composed && r.composedPath().includes(u))
1374
+ const f = c instanceof HTMLElement ? c : re(c);
1375
+ if (f != null && f.contains(l) || r.composed && r.composedPath().includes(f))
1358
1376
  return;
1359
1377
  }
1360
- return !kn(l, rt.Loose) && l.tabIndex !== -1 && r.preventDefault(), t(r, l);
1378
+ return (
1379
+ // This check alllows us to know whether or not we clicked on a "focusable" element like a
1380
+ // button or an input. This is a backwards compatibility check so that you can open a <Menu
1381
+ // /> and click on another <Menu /> which should close Menu A and open Menu B. We might
1382
+ // revisit that so that you will require 2 clicks instead.
1383
+ !kn(l, rt.Loose) && // This could be improved, but the `Combobox.Button` adds tabIndex={-1} to make it
1384
+ // unfocusable via the keyboard so that tabbing to the next item from the input doesn't
1385
+ // first go to the button.
1386
+ l.tabIndex !== -1 && r.preventDefault(), t(r, l)
1387
+ );
1361
1388
  }
1362
- const o = E(null);
1389
+ const o = R(null);
1363
1390
  we("mousedown", (r) => {
1364
1391
  var s, l;
1365
1392
  n.value && (o.value = ((l = (s = r.composedPath) == null ? void 0 : s.call(r)) == null ? void 0 : l[0]) || r.target);
@@ -1368,13 +1395,17 @@ function Mn(e, t, n = P(() => !0)) {
1368
1395
  (r) => {
1369
1396
  o.value && (i(r, () => o.value), o.value = null);
1370
1397
  },
1398
+ // We will use the `capture` phase so that layers in between with `event.stopPropagation()`
1399
+ // don't "cancel" this outside click check. E.g.: A `Menu` inside a `DialogPanel` if the `Menu`
1400
+ // is open, and you click outside of it in the `DialogPanel` the `Menu` should close. However,
1401
+ // the `DialogPanel` has a `onClick(e) { e.stopPropagation() }` which would cancel this.
1371
1402
  !0
1372
1403
  ), we("blur", (r) => i(
1373
1404
  r,
1374
1405
  () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null
1375
1406
  ), !0);
1376
1407
  }
1377
- const jn = Symbol("ArrowContext"), x = {
1408
+ const _n = Symbol("ArrowContext"), x = {
1378
1409
  as: {
1379
1410
  type: [String, Function],
1380
1411
  default: "template"
@@ -1469,15 +1500,15 @@ const jn = Symbol("ArrowContext"), x = {
1469
1500
  }
1470
1501
  };
1471
1502
  function Hn(e, t, n, i) {
1472
- const { floatingRef: o, props: r, mounted: s, show: l, referenceHidden: f, escaped: c, placement: u, floatingStyles: d, referenceElWidth: g, updateFloating: m } = i, a = pe(
1503
+ const { floatingRef: o, props: r, mounted: s, show: l, referenceHidden: u, escaped: c, placement: f, floatingStyles: m, referenceElWidth: w, updateFloating: d } = i, a = pe(
1473
1504
  { ...r, as: r.floatingAs },
1474
1505
  t
1475
- ), { enterActiveClassRef: h, leaveActiveClassRef: v } = $n(a, u), w = {
1506
+ ), { enterActiveClassRef: v, leaveActiveClassRef: g } = $n(a, f), h = {
1476
1507
  show: s.value ? a.show : !1,
1477
- enter: h.value,
1508
+ enter: v.value,
1478
1509
  enterFrom: a.enterFrom,
1479
1510
  enterTo: a.enterTo,
1480
- leave: v.value,
1511
+ leave: g.value,
1481
1512
  leaveFrom: a.leaveFrom,
1482
1513
  leaveTo: a.leaveTo,
1483
1514
  onBeforeEnter() {
@@ -1491,10 +1522,10 @@ function Hn(e, t, n, i) {
1491
1522
  type: a.transitionType,
1492
1523
  appear: !0,
1493
1524
  ...a.transitionName ? {} : {
1494
- enterActiveClass: h.value,
1525
+ enterActiveClass: v.value,
1495
1526
  enterFromClass: a.enterFrom,
1496
1527
  enterToClass: a.enterTo,
1497
- leaveActiveClass: v.value,
1528
+ leaveActiveClass: g.value,
1498
1529
  leaveFromClass: a.leaveFrom,
1499
1530
  leaveToClass: a.leaveTo
1500
1531
  },
@@ -1506,25 +1537,25 @@ function Hn(e, t, n, i) {
1506
1537
  }
1507
1538
  }, b = {
1508
1539
  class: [
1509
- f.value ? a.referenceHiddenClass : void 0,
1540
+ u.value ? a.referenceHiddenClass : void 0,
1510
1541
  c.value ? a.escapedClass : void 0
1511
1542
  ].filter((p) => !!p).join(" "),
1512
1543
  style: {
1513
- ...d.value,
1544
+ ...m.value,
1514
1545
  zIndex: a.zIndex
1515
1546
  }
1516
1547
  };
1517
- if (a.adaptiveWidth && typeof g.value == "number") {
1548
+ if (a.adaptiveWidth && typeof w.value == "number") {
1518
1549
  const p = {
1519
1550
  attribute: "width",
1520
1551
  ...typeof a.adaptiveWidth == "object" ? a.adaptiveWidth : {}
1521
1552
  };
1522
- b.style[p.attribute] = `${g.value}px`;
1553
+ b.style[p.attribute] = `${w.value}px`;
1523
1554
  }
1524
1555
  function C(p) {
1525
- return a.portal ? s.value ? ne(mt, () => p) : he() : p;
1556
+ return a.portal ? s.value ? ne(mt, () => p) : ve() : p;
1526
1557
  }
1527
- function A(p) {
1558
+ function O(p) {
1528
1559
  const T = pe(
1529
1560
  b,
1530
1561
  n,
@@ -1532,106 +1563,108 @@ function Hn(e, t, n, i) {
1532
1563
  );
1533
1564
  return a.as === "template" ? p : typeof a.as == "string" ? ne(a.as, T, p) : ne(a.as, T, () => p);
1534
1565
  }
1535
- function O() {
1566
+ function A() {
1536
1567
  function p() {
1537
1568
  var T;
1538
- const L = a.as === "template" ? pe(
1569
+ const F = a.as === "template" ? pe(
1539
1570
  b,
1540
1571
  n,
1541
1572
  a.dialog ? {} : { ref: o }
1542
- ) : null, S = vt(e, L);
1543
- return ((T = e.props) == null ? void 0 : T.unmount) === !1 ? (m(), S) : a.vueTransition && a.show === !1 ? he() : S;
1573
+ ) : null, E = ht(e, F);
1574
+ return ((T = e.props) == null ? void 0 : T.unmount) === !1 ? (d(), E) : a.vueTransition && a.show === !1 ? ve() : E;
1544
1575
  }
1545
1576
  return s.value ? a.vueTransition ? ne(pt, {
1546
1577
  ...a.dialog ? { ref: o } : {},
1547
1578
  ...y
1548
- }, p) : ne(a.transitionChild ? ht : gt, {
1549
- key: `placement-${u.value}`,
1579
+ }, p) : ne(a.transitionChild ? vt : gt, {
1580
+ key: `placement-${f.value}`,
1550
1581
  ...a.dialog ? { ref: o } : {},
1551
1582
  as: "template",
1552
- ...w
1553
- }, p) : he();
1583
+ ...h
1584
+ }, p) : ve();
1554
1585
  }
1555
1586
  return C(
1556
- A(
1557
- O()
1587
+ O(
1588
+ A()
1558
1589
  )
1559
1590
  );
1560
1591
  }
1561
- function Wn(e, t, n, i, o) {
1562
- const r = E(!1), s = Ee(i, "placement"), l = Ee(i, "strategy"), f = _e({}), c = E(void 0), u = E(void 0), d = E(null), g = E(void 0), m = E(void 0), a = P(() => re(t)), h = P(() => re(n)), v = P(
1563
- () => He(a) && He(h)
1564
- ), { placement: w, middlewareData: y, isPositioned: b, floatingStyles: C, update: A } = On(a, h, {
1592
+ function Mn(e, t, n, i, o) {
1593
+ const r = R(!1), s = Re(i, "placement"), l = Re(i, "strategy"), u = We({}), c = R(void 0), f = R(void 0), m = R(null), w = R(void 0), d = R(void 0), a = P(() => re(t)), v = P(() => re(n)), g = P(
1594
+ () => He(a) && He(v)
1595
+ ), { placement: h, middlewareData: y, isPositioned: b, floatingStyles: C, update: O } = An(a, v, {
1565
1596
  placement: s,
1566
1597
  strategy: l,
1567
- middleware: f,
1598
+ middleware: u,
1599
+ // If enable dialog mode, then set `transform` to false.
1568
1600
  transform: i.dialog ? !1 : i.transform,
1601
+ // Fix transition not smooth bug when dialog mode enabled.
1569
1602
  whileElementsMounted: i.dialog ? () => () => {
1570
1603
  } : void 0
1571
- }), O = E(null);
1572
- Ie(() => {
1604
+ }), A = R(null);
1605
+ Ve(() => {
1573
1606
  r.value = !0;
1574
- }), k(e, (R, D) => {
1575
- R && !D ? o("show") : !R && D && o("hide");
1607
+ }), k(e, (S, D) => {
1608
+ S && !D ? o("show") : !S && D && o("hide");
1576
1609
  }, { immediate: !0 });
1577
1610
  function p() {
1578
- v.value && (A(), o("update"));
1611
+ g.value && (O(), o("update"));
1579
1612
  }
1580
- k([s, l, f], p, { flush: "sync" }), Bn(
1581
- f,
1613
+ k([s, l, u], p, { flush: "sync" }), Bn(
1614
+ u,
1582
1615
  a,
1583
- h,
1584
- d,
1616
+ v,
1617
+ m,
1585
1618
  i
1586
1619
  ), k([y, () => i.hide, b], () => {
1587
- var R, D;
1588
- (i.hide === !0 || typeof i.hide == "object" || Array.isArray(i.hide)) && (c.value = ((R = y.value.hide) == null ? void 0 : R.referenceHidden) || !b.value, u.value = (D = y.value.hide) == null ? void 0 : D.escaped);
1620
+ var S, D;
1621
+ (i.hide === !0 || typeof i.hide == "object" || Array.isArray(i.hide)) && (c.value = ((S = y.value.hide) == null ? void 0 : S.referenceHidden) || !b.value, f.value = (D = y.value.hide) == null ? void 0 : D.escaped);
1589
1622
  }), k(y, () => {
1590
- const R = y.value.arrow;
1591
- g.value = R == null ? void 0 : R.x, m.value = R == null ? void 0 : R.y;
1592
- }), Dn(!!i.adaptiveWidth, a, O), k([e, v], async (R, D, F) => {
1593
- if (await ct(), e.value && v.value && i.autoUpdate) {
1623
+ const S = y.value.arrow;
1624
+ w.value = S == null ? void 0 : S.x, d.value = S == null ? void 0 : S.y;
1625
+ }), Dn(!!i.adaptiveWidth, a, A), k([e, g], async (S, D, L) => {
1626
+ if (await ct(), e.value && g.value && i.autoUpdate) {
1594
1627
  const $ = dn(
1595
1628
  a.value,
1596
- h.value,
1629
+ v.value,
1597
1630
  p,
1598
1631
  typeof i.autoUpdate == "object" ? i.autoUpdate : void 0
1599
1632
  );
1600
- F($);
1633
+ L($);
1601
1634
  }
1602
1635
  }, { flush: "post", immediate: !0 });
1603
- const T = E(!0);
1636
+ const T = R(!0);
1604
1637
  k(a, () => {
1605
- !(a.value instanceof Element) && v.value && T.value && (T.value = !1, window.requestAnimationFrame(() => {
1638
+ !(a.value instanceof Element) && g.value && T.value && (T.value = !1, window.requestAnimationFrame(() => {
1606
1639
  T.value = !0, p();
1607
1640
  }));
1608
1641
  }, { flush: "sync" });
1609
- const L = {
1642
+ const F = {
1610
1643
  referenceRef: t,
1611
- placement: w
1612
- }, S = {
1644
+ placement: h
1645
+ }, E = {
1613
1646
  floatingRef: n,
1614
1647
  props: i,
1615
1648
  mounted: r,
1616
1649
  show: e,
1617
1650
  referenceHidden: c,
1618
- escaped: u,
1619
- placement: w,
1651
+ escaped: f,
1652
+ placement: h,
1620
1653
  floatingStyles: C,
1621
- referenceElWidth: O,
1654
+ referenceElWidth: A,
1622
1655
  updateFloating: p
1623
1656
  }, B = {
1624
- ref: d,
1625
- placement: w,
1626
- x: g,
1627
- y: m
1657
+ ref: m,
1658
+ placement: h,
1659
+ x: w,
1660
+ y: d
1628
1661
  };
1629
- return ft(jn, B), { referenceApi: L, floatingApi: S, arrowApi: B, placement: w, referenceEl: a, floatingEl: h, middlewareData: y, update: p };
1662
+ return ut(_n, B), { referenceApi: F, floatingApi: E, arrowApi: B, placement: h, referenceEl: a, floatingEl: v, middlewareData: y, update: p };
1630
1663
  }
1631
1664
  ({
1632
1665
  ...x.as
1633
1666
  });
1634
- const _n = {
1667
+ const Wn = {
1635
1668
  as: x.as,
1636
1669
  show: x.show,
1637
1670
  placement: x.placement,
@@ -1657,15 +1690,14 @@ const _n = {
1657
1690
  portal: x.portal,
1658
1691
  transform: x.transform,
1659
1692
  middleware: x.middleware
1660
- }, zn = {
1693
+ }, In = {
1661
1694
  name: "FloatVirtual",
1662
1695
  inheritAttrs: !1,
1663
- props: _n,
1696
+ props: Wn,
1664
1697
  emits: ["initial", "show", "hide", "update"],
1665
1698
  setup(e, { emit: t, slots: n, attrs: i }) {
1666
- var u;
1667
- Fn("FloatVirtual", e);
1668
- const o = E((u = e.show) != null ? u : !1), r = E({
1699
+ Ln("FloatVirtual", e);
1700
+ const o = R(e.show ?? !1), r = R({
1669
1701
  getBoundingClientRect() {
1670
1702
  return {
1671
1703
  x: 0,
@@ -1678,31 +1710,30 @@ const _n = {
1678
1710
  height: 0
1679
1711
  };
1680
1712
  }
1681
- }), s = E(null), {
1713
+ }), s = R(null), {
1682
1714
  floatingApi: l,
1683
- placement: f
1684
- } = Wn(o, r, s, e, t);
1715
+ placement: u
1716
+ } = Mn(o, r, s, e, t);
1685
1717
  k(() => e.show, () => {
1686
- var d;
1687
- o.value = (d = e.show) != null ? d : !1;
1718
+ o.value = e.show ?? !1;
1688
1719
  });
1689
1720
  function c() {
1690
1721
  o.value = !1;
1691
1722
  }
1692
1723
  return t("initial", {
1693
1724
  show: o,
1694
- placement: f,
1725
+ placement: u,
1695
1726
  reference: r,
1696
1727
  floating: s
1697
1728
  }), () => {
1698
1729
  if (!n.default)
1699
1730
  return;
1700
- const d = {
1701
- placement: f.value,
1731
+ const f = {
1732
+ placement: u.value,
1702
1733
  close: c
1703
- }, [g] = ot(n.default(d)).filter(En);
1734
+ }, [m] = ot(n.default(f)).filter(Rn);
1704
1735
  return Hn(
1705
- g,
1736
+ m,
1706
1737
  {
1707
1738
  as: e.as,
1708
1739
  show: o.value
@@ -1716,58 +1747,58 @@ const _n = {
1716
1747
  x.as, x.placement, x.strategy, x.offset, x.shift, {
1717
1748
  ...x.flip
1718
1749
  }, x.arrow, x.autoPlacement, x.autoUpdate, x.zIndex, x.vueTransition, x.transitionName, x.transitionType, x.enter, x.enterFrom, x.enterTo, x.leave, x.leaveFrom, x.leaveTo, x.originClass, x.tailwindcssOriginClass, x.transform, x.middleware;
1719
- const In = { class: "flex bg-white shadow-md z-10 rounded-md p-1" }, Vn = ["onClick"], Yn = /* @__PURE__ */ wt({
1750
+ const Vn = { class: "flex bg-white shadow-md z-10 rounded-md p-1" }, zn = ["onClick"], Xn = /* @__PURE__ */ wt({
1720
1751
  __name: "StylePanel",
1721
1752
  setup(e) {
1722
1753
  yt({ WATCH_ARRAY: !1 });
1723
- const t = E({ value: null }), n = xt(), i = P(
1754
+ const t = R({ value: null }), n = xt(), i = P(
1724
1755
  () => n.getters.onContentChange || (() => {
1725
1756
  })
1726
1757
  ), o = P(
1727
1758
  () => bt(n.getters.diagramElement) + Ct
1728
- ), r = P(() => n.getters.code), s = (d) => {
1729
- n.dispatch("updateCode", { code: d }), i.value(d);
1730
- }, l = E([]);
1731
- let f;
1732
- const c = ({ show: d, reference: g, floating: m }) => {
1733
- let a, h, v, w, y, b;
1734
- n.commit("onMessageClick", (C, A) => {
1735
- var O;
1736
- if (a = C.value.start.start, h = Pt(r.value, a), v = Lt(r.value, a), w = ((O = r.value.slice(h).match(/^\s*/)) == null ? void 0 : O[0]) || "", y = v.trim().startsWith("//"), y) {
1737
- const p = v.trimStart().slice(2).trimStart(), T = p.indexOf("["), L = p.indexOf("]");
1738
- b = Boolean(T === 0 && L), b ? l.value = p.slice(T + 1, L).split(",").map((S) => S.trim()) : l.value = [];
1759
+ ), r = P(() => n.getters.code), s = (m) => {
1760
+ n.dispatch("updateCode", { code: m }), i.value(m);
1761
+ }, l = R([]);
1762
+ let u;
1763
+ const c = ({ show: m, reference: w, floating: d }) => {
1764
+ let a, v, g, h, y, b;
1765
+ n.commit("onMessageClick", (C, O) => {
1766
+ var A;
1767
+ if (a = C.value.start.start, v = Pt(r.value, a), g = Ft(r.value, a), h = ((A = r.value.slice(v).match(/^\s*/)) == null ? void 0 : A[0]) || "", y = g.trim().startsWith("//"), y) {
1768
+ const p = g.trimStart().slice(2).trimStart(), T = p.indexOf("["), F = p.indexOf("]");
1769
+ b = !!(T === 0 && F), b ? l.value = p.slice(T + 1, F).split(",").map((E) => E.trim()) : l.value = [];
1739
1770
  }
1740
- g.value = {
1741
- getBoundingClientRect: () => A.getBoundingClientRect()
1742
- }, t.value = C, d.value = !0;
1743
- }), Mn(
1744
- m,
1771
+ w.value = {
1772
+ getBoundingClientRect: () => O.getBoundingClientRect()
1773
+ }, t.value = C, m.value = !0;
1774
+ }), jn(
1775
+ d,
1745
1776
  () => {
1746
- d.value = !1, l.value = [];
1777
+ m.value = !1, l.value = [];
1747
1778
  },
1748
- P(() => d.value)
1749
- ), f = (C) => {
1750
- var A;
1751
- if (d.value = !1, !!t.value.value)
1779
+ P(() => m.value)
1780
+ ), u = (C) => {
1781
+ var O;
1782
+ if (m.value = !1, !!t.value.value)
1752
1783
  if (y) {
1753
- let O = "";
1784
+ let A = "";
1754
1785
  if (b) {
1755
1786
  let p;
1756
- l.value.includes(C) ? p = l.value.filter((T) => T !== C) : p = [...l.value, C], O = `${w}// [${p.filter(Boolean).join(", ")}] ${v.slice(v.indexOf("]") + 1).trimStart()}`;
1787
+ l.value.includes(C) ? p = l.value.filter((T) => T !== C) : p = [...l.value, C], A = `${h}// [${p.filter(Boolean).join(", ")}] ${g.slice(g.indexOf("]") + 1).trimStart()}`;
1757
1788
  } else
1758
- O = `${w}// [${C}] ${v.slice((((A = v.match(/\/\/*/)) == null ? void 0 : A.index) || -2) + 2).trimStart()}`;
1759
- O.endsWith(`
1760
- `) || (O += `
1789
+ A = `${h}// [${C}] ${g.slice((((O = g.match(/\/\/*/)) == null ? void 0 : O.index) || -2) + 2).trimStart()}`;
1790
+ A.endsWith(`
1791
+ `) || (A += `
1761
1792
  `), s(
1762
- r.value.slice(0, Ft(r.value, a)) + O + r.value.slice(h)
1793
+ r.value.slice(0, Lt(r.value, a)) + A + r.value.slice(v)
1763
1794
  );
1764
1795
  } else
1765
1796
  s(
1766
- r.value.slice(0, h) + `${w}// [${C}]
1767
- ` + r.value.slice(h)
1797
+ r.value.slice(0, v) + `${h}// [${C}]
1798
+ ` + r.value.slice(v)
1768
1799
  );
1769
1800
  };
1770
- }, u = [
1801
+ }, f = [
1771
1802
  {
1772
1803
  name: "bold",
1773
1804
  content: "B",
@@ -1789,7 +1820,7 @@ const In = { class: "flex bg-white shadow-md z-10 rounded-md p-1" }, Vn = ["onCl
1789
1820
  class: "line-through"
1790
1821
  }
1791
1822
  ];
1792
- return (d, g) => (Pe(), At(H(zn), {
1823
+ return (m, w) => (Pe(), Ot(H(In), {
1793
1824
  "vue-transition": "",
1794
1825
  id: "style-panel",
1795
1826
  key: "tool",
@@ -1800,19 +1831,19 @@ const In = { class: "flex bg-white shadow-md z-10 rounded-md p-1" }, Vn = ["onCl
1800
1831
  shift: "",
1801
1832
  zIndex: "30"
1802
1833
  }, {
1803
- default: Ot(() => [
1804
- ge("div", In, [
1805
- (Pe(), Tt(ze, null, Rt(u, (m) => ge("div", {
1806
- onClick: () => H(f)(m.class),
1807
- key: m.name
1834
+ default: At(() => [
1835
+ ge("div", Vn, [
1836
+ (Pe(), Tt(Ie, null, St(f, (d) => ge("div", {
1837
+ onClick: () => H(u)(d.class),
1838
+ key: d.name
1808
1839
  }, [
1809
1840
  ge("div", {
1810
- class: St(["w-6 mx-1 py-1 rounded-md text-black text-center cursor-pointer hover:bg-gray-200", [
1811
- m.class,
1812
- { "bg-gray-100": l.value.includes(m.class) }
1841
+ class: Et(["w-6 mx-1 py-1 rounded-md text-black text-center cursor-pointer hover:bg-gray-200", [
1842
+ d.class,
1843
+ { "bg-gray-100": l.value.includes(d.class) }
1813
1844
  ]])
1814
- }, Et(m.content), 3)
1815
- ], 8, Vn)), 64))
1845
+ }, Rt(d.content), 3)
1846
+ ], 8, zn)), 64))
1816
1847
  ])
1817
1848
  ], void 0, !0),
1818
1849
  _: 1
@@ -1820,6 +1851,6 @@ const In = { class: "flex bg-white shadow-md z-10 rounded-md p-1" }, Vn = ["onCl
1820
1851
  }
1821
1852
  });
1822
1853
  export {
1823
- Yn as default
1854
+ Xn as default
1824
1855
  };
1825
- //# sourceMappingURL=StylePanel.1d5cdf4e.js.map
1856
+ //# sourceMappingURL=StylePanel-2776c05a.js.map