@inertiaui/modal-react 0.18.0 → 0.18.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,12 +1,12 @@
1
- var Wt = Object.defineProperty;
2
- var Bt = (t, e, n) => e in t ? Wt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
- var X = (t, e, n) => Bt(t, typeof e != "symbol" ? e + "" : e, n);
4
- import * as ve from "react";
5
- import B, { createContext as Pe, useState as $, useEffect as D, useContext as de, useRef as j, createElement as Ne, useMemo as Y, forwardRef as Ze, useImperativeHandle as ct, useLayoutEffect as Ht, useCallback as V, Fragment as ae, isValidElement as Kt, cloneElement as qt } from "react";
6
- import { jsx as F, jsxs as le, Fragment as Ye } from "react/jsx-runtime";
1
+ var Ut = Object.defineProperty;
2
+ var Bt = (t, e, n) => e in t ? Ut(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
+ var q = (t, e, n) => Bt(t, typeof e != "symbol" ? e + "" : e, n);
4
+ import * as pe from "react";
5
+ import B, { createContext as Ie, useState as $, useEffect as D, useContext as de, useRef as j, createElement as Ne, useMemo as Y, forwardRef as Ze, useImperativeHandle as ct, useLayoutEffect as Ht, useCallback as V, Fragment as ae, isValidElement as Kt, cloneElement as _t } from "react";
6
+ import { jsx as C, jsxs as le, Fragment as Ye } from "react/jsx-runtime";
7
7
  import Te from "axios";
8
- import { router as he, usePage as Xt } from "@inertiajs/react";
9
- import { mergeDataIntoQueryString as _t } from "@inertiajs/core";
8
+ import { router as ve, usePage as qt } from "@inertiajs/react";
9
+ import { mergeDataIntoQueryString as Xt } from "@inertiajs/core";
10
10
  const fe = {
11
11
  type: "modal",
12
12
  navigate: !1,
@@ -63,28 +63,27 @@ class Vt {
63
63
  return r;
64
64
  }
65
65
  }
66
- const Ie = new Vt(), mr = () => Ie.reset(), pr = (t, e) => Ie.put(t, e), Je = (t) => Ie.get(t), se = (t, e) => Ie.get(t ? `slideover.${e}` : `modal.${e}`), nt = {
66
+ const Pe = new Vt(), mr = () => Pe.reset(), hr = (t, e) => Pe.put(t, e), Je = (t) => Pe.get(t), se = (t, e) => Pe.get(t ? `slideover.${e}` : `modal.${e}`), nt = {
67
67
  modifiedElements: [],
68
68
  bodyState: {
69
69
  hasOverflowHidden: !1,
70
- hasPointerEventsNone: !1,
71
70
  originalPaddingRight: ""
72
71
  },
73
72
  prepare() {
74
73
  const t = window.innerWidth - document.documentElement.clientWidth;
75
74
  this.bodyState.originalPaddingRight = document.body.style.paddingRight;
76
75
  const e = parseInt(window.getComputedStyle(document.body).paddingRight, 10);
77
- document.body.style.paddingRight = `${e + t}px`, document.body.classList.contains("overflow-hidden") || (document.body.classList.add("overflow-hidden"), this.bodyState.hasOverflowHidden = !0), document.body.classList.contains("pointer-events-none") || (document.body.classList.add("pointer-events-none"), this.bodyState.hasPointerEventsNone = !0), Array.from(document.body.children).forEach((n) => {
76
+ document.body.style.paddingRight = `${e + t}px`, document.body.classList.contains("overflow-hidden") || (document.body.classList.add("overflow-hidden"), this.bodyState.hasOverflowHidden = !0), Array.from(document.body.children).forEach((n) => {
78
77
  !n.classList.contains("im-dialog") && n.getAttribute("aria-hidden") !== "true" && (n.setAttribute("aria-hidden", "true"), this.modifiedElements.push(n));
79
78
  });
80
79
  },
81
80
  cleanup() {
82
- this.bodyState.hasOverflowHidden && (document.body.classList.remove("overflow-hidden"), this.bodyState.hasOverflowHidden = !1), this.bodyState.hasPointerEventsNone && (document.body.classList.remove("pointer-events-none"), this.bodyState.hasPointerEventsNone = !1), document.body.style.paddingRight = this.bodyState.originalPaddingRight, this.bodyState.originalPaddingRight = "", this.modifiedElements.forEach((t) => {
81
+ this.bodyState.hasOverflowHidden && (document.body.classList.remove("overflow-hidden"), this.bodyState.hasOverflowHidden = !1), document.body.style.paddingRight = this.bodyState.originalPaddingRight, this.bodyState.originalPaddingRight = "", this.modifiedElements.forEach((t) => {
83
82
  t.removeAttribute("aria-hidden");
84
83
  }), this.modifiedElements = [];
85
84
  }
86
85
  };
87
- function We(t = "inertiaui_modal_") {
86
+ function Ue(t = "inertiaui_modal_") {
88
87
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `${t}${crypto.randomUUID()}` : `${t}${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`;
89
88
  }
90
89
  function zt(t, e) {
@@ -113,82 +112,82 @@ function Zt(t, e = 3, n = 10) {
113
112
  function me(t) {
114
113
  return t ? (t = t.replace(/_/g, "-"), t = t.replace(/-+/g, "-"), /[A-Z]/.test(t) ? (t = t.replace(/\s+/g, "").replace(/_/g, "").replace(/(?:^|\s|-)+([A-Za-z])/g, (e, n) => n.toUpperCase()), t = t.replace(/(.)(?=[A-Z])/g, "$1-"), t.toLowerCase()) : t) : "";
115
114
  }
116
- const Re = Pe(null);
115
+ const Re = Ie(null);
117
116
  Re.displayName = "ModalStackContext";
118
- let mt = null, pt = null, be = null, qe = null, Xe = [], oe = {};
117
+ let mt = null, ht = null, be = null, _e = null, qe = [], oe = {};
119
118
  const Yt = ({ children: t }) => {
120
119
  const [e, n] = $([]), [r, i] = $({}), l = (g) => {
121
120
  n((d) => {
122
- const f = g([...d]), p = (y) => {
121
+ const f = g([...d]), h = (y) => {
123
122
  var N;
124
- return f.length < 2 ? !0 : ((N = f.map((h) => ({ id: h.id, shouldRender: h.shouldRender })).reverse().find((h) => h.shouldRender)) == null ? void 0 : N.id) === y;
123
+ return f.length < 2 ? !0 : ((N = f.map((v) => ({ id: v.id, shouldRender: v.shouldRender })).reverse().find((v) => v.shouldRender)) == null ? void 0 : N.id) === y;
125
124
  };
126
125
  return f.forEach((y, N) => {
127
- f[N].onTopOfStack = p(y.id), f[N].getParentModal = () => N < 1 ? null : f.slice(0, N).reverse().find((h) => h.isOpen), f[N].getChildModal = () => N === f.length - 1 ? null : f.slice(N + 1).find((h) => h.isOpen);
126
+ f[N].onTopOfStack = h(y.id), f[N].getParentModal = () => N < 1 ? null : f.slice(0, N).reverse().find((v) => v.isOpen), f[N].getChildModal = () => N === f.length - 1 ? null : f.slice(N + 1).find((v) => v.isOpen);
128
127
  }), f;
129
128
  });
130
129
  };
131
130
  D(() => {
132
- Xe = e;
131
+ qe = e;
133
132
  }, [e]);
134
133
  class a {
135
- constructor(d, f, p, y, N) {
136
- X(this, "show", () => {
134
+ constructor(d, f, h, y, N) {
135
+ q(this, "show", () => {
137
136
  l(
138
137
  (d) => d.map((f) => (f.id === this.id && !f.isOpen && (f.isOpen = !0, f.shouldRender = !0), f))
139
138
  );
140
139
  });
141
- X(this, "setOpen", (d) => {
140
+ q(this, "setOpen", (d) => {
142
141
  d ? this.show() : this.close();
143
142
  });
144
- X(this, "close", () => {
143
+ q(this, "close", () => {
145
144
  l(
146
145
  (d) => d.map((f) => {
147
- var p;
146
+ var h;
148
147
  return f.id === this.id && f.isOpen && (Object.keys(f.listeners).forEach((y) => {
149
148
  f.off(y);
150
- }), f.isOpen = !1, (p = f.onCloseCallback) == null || p.call(f)), f;
149
+ }), f.isOpen = !1, (h = f.onCloseCallback) == null || h.call(f)), f;
151
150
  })
152
151
  );
153
152
  });
154
- X(this, "afterLeave", () => {
153
+ q(this, "afterLeave", () => {
155
154
  this.isOpen || l((d) => {
156
- const f = d.map((p) => {
155
+ const f = d.map((h) => {
157
156
  var y;
158
- return p.id === this.id && !p.isOpen && (p.shouldRender = !1, (y = p.afterLeaveCallback) == null || y.call(p), p.afterLeaveCallback = null), p;
157
+ return h.id === this.id && !h.isOpen && (h.shouldRender = !1, (y = h.afterLeaveCallback) == null || y.call(h), h.afterLeaveCallback = null), h;
159
158
  });
160
159
  return this.index === 0 ? [] : f;
161
160
  });
162
161
  });
163
- X(this, "on", (d, f) => {
162
+ q(this, "on", (d, f) => {
164
163
  d = me(d), this.listeners[d] = this.listeners[d] ?? [], this.listeners[d].push(f);
165
164
  });
166
- X(this, "off", (d, f) => {
167
- var p;
168
- d = me(d), f ? this.listeners[d] = ((p = this.listeners[d]) == null ? void 0 : p.filter((y) => y !== f)) ?? [] : delete this.listeners[d];
165
+ q(this, "off", (d, f) => {
166
+ var h;
167
+ d = me(d), f ? this.listeners[d] = ((h = this.listeners[d]) == null ? void 0 : h.filter((y) => y !== f)) ?? [] : delete this.listeners[d];
169
168
  });
170
- X(this, "emit", (d, ...f) => {
171
- var p;
172
- (p = this.listeners[me(d)]) == null || p.forEach((y) => y(...f));
169
+ q(this, "emit", (d, ...f) => {
170
+ var h;
171
+ (h = this.listeners[me(d)]) == null || h.forEach((y) => y(...f));
173
172
  });
174
- X(this, "registerEventListenersFromProps", (d) => {
173
+ q(this, "registerEventListenersFromProps", (d) => {
175
174
  const f = [];
176
- return Object.keys(d).filter((p) => p.startsWith("on")).forEach((p) => {
177
- const y = me(p).replace(/^on-/, "");
178
- this.on(y, d[p]), f.push(() => this.off(y, d[p]));
179
- }), () => f.forEach((p) => p());
175
+ return Object.keys(d).filter((h) => h.startsWith("on")).forEach((h) => {
176
+ const y = me(h).replace(/^on-/, "");
177
+ this.on(y, d[h]), f.push(() => this.off(y, d[h]));
178
+ }), () => f.forEach((h) => h());
180
179
  });
181
- X(this, "reload", (d = {}) => {
182
- var p;
180
+ q(this, "reload", (d = {}) => {
181
+ var h;
183
182
  let f = Object.keys(this.response.props);
184
- d.only && (f = ft(f, d.only)), d.except && (f = zt(f, d.except)), (p = this.response) != null && p.url && Te.get(this.response.url, {
183
+ d.only && (f = ft(f, d.only)), d.except && (f = zt(f, d.except)), (h = this.response) != null && h.url && Te.get(this.response.url, {
185
184
  headers: {
186
185
  Accept: "text/html, application/xhtml+xml",
187
186
  "X-Inertia": !0,
188
187
  "X-Inertia-Partial-Component": this.response.component,
189
188
  "X-Inertia-Version": this.response.version,
190
189
  "X-Inertia-Partial-Data": f.join(","),
191
- "X-InertiaUI-Modal": We(),
190
+ "X-InertiaUI-Modal": Ue(),
192
191
  "X-InertiaUI-Modal-Use-Router": 0,
193
192
  "X-InertiaUI-Modal-Base-Url": be
194
193
  }
@@ -196,20 +195,20 @@ const Yt = ({ children: t }) => {
196
195
  this.updateProps(y.data.props);
197
196
  });
198
197
  });
199
- X(this, "updateProps", (d) => {
198
+ q(this, "updateProps", (d) => {
200
199
  Object.assign(this.props, d), l((f) => f);
201
200
  });
202
- if (this.id = f.id ?? We(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = d, this.props = f.props, this.response = f, this.config = p ?? {}, this.onCloseCallback = y, this.afterLeaveCallback = N, oe[this.id]) {
201
+ if (this.id = f.id ?? Ue(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = d, this.props = f.props, this.response = f, this.config = h ?? {}, this.onCloseCallback = y, this.afterLeaveCallback = N, oe[this.id]) {
203
202
  this.config = {
204
203
  ...this.config,
205
204
  ...oe[this.id].config ?? {}
206
205
  };
207
- const h = oe[this.id].onClose, k = oe[this.id].onAfterLeave;
208
- h && (this.onCloseCallback = y ? () => {
209
- y(), h();
210
- } : h), k && (this.afterLeaveCallback = N ? () => {
211
- N(), k();
212
- } : k), delete oe[this.id];
206
+ const v = oe[this.id].onClose, I = oe[this.id].onAfterLeave;
207
+ v && (this.onCloseCallback = y ? () => {
208
+ y(), v();
209
+ } : v), I && (this.afterLeaveCallback = N ? () => {
210
+ N(), I();
211
+ } : I), delete oe[this.id];
213
212
  }
214
213
  this.index = -1, this.getParentModal = () => null, this.getChildModal = () => null, this.onTopOfStack = !0;
215
214
  }
@@ -217,17 +216,17 @@ const Yt = ({ children: t }) => {
217
216
  return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `inertiaui_modal_${crypto.randomUUID()}` : `inertiaui_modal_${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`;
218
217
  }
219
218
  }
220
- const m = (g, d = {}, f = null, p = null) => pt(g.component).then((y) => s(y, g, d, f, p)), s = (g, d, f, p, y) => {
221
- const N = new a(g, d, f, p, y);
222
- return N.index = e.length, l((h) => [...h, N]), N.show(), N;
219
+ const m = (g, d = {}, f = null, h = null) => ht(g.component).then((y) => s(y, g, d, f, h)), s = (g, d, f, h, y) => {
220
+ const N = new a(g, d, f, h, y);
221
+ return N.index = e.length, l((v) => [...v, N]), N.show(), N;
223
222
  };
224
- function v(g, d, f, p) {
223
+ function p(g, d, f, h) {
225
224
  if (!r[g])
226
225
  throw new Error(`The local modal "${g}" has not been registered.`);
227
- const y = s(null, {}, d, f, p);
226
+ const y = s(null, {}, d, f, h);
228
227
  return y.name = g, r[g].callback(y), y;
229
228
  }
230
- const b = (g, d = {}) => x(
229
+ const b = (g, d = {}) => w(
231
230
  g,
232
231
  d.method ?? "get",
233
232
  d.data ?? {},
@@ -238,22 +237,22 @@ const Yt = ({ children: t }) => {
238
237
  d.queryStringArrayFormat ?? "brackets",
239
238
  d.navigate ?? Je("navigate")
240
239
  ).then((f) => {
241
- const p = d.listeners ?? {};
242
- return Object.keys(p).forEach((y) => {
240
+ const h = d.listeners ?? {};
241
+ return Object.keys(h).forEach((y) => {
243
242
  const N = me(y);
244
- f.on(N, p[y]);
243
+ f.on(N, h[y]);
245
244
  }), f;
246
- }), x = (g, d, f = {}, p = {}, y = {}, N = null, h = null, k = "brackets", A = !1) => {
247
- const H = We();
248
- return new Promise((K, U) => {
245
+ }), w = (g, d, f = {}, h = {}, y = {}, N = null, v = null, I = "brackets", A = !1) => {
246
+ const H = Ue();
247
+ return new Promise((K, W) => {
249
248
  if (g.startsWith("#")) {
250
- K(v(g.substring(1), y, N, h));
249
+ K(p(g.substring(1), y, N, v));
251
250
  return;
252
251
  }
253
- const [W, O] = _t(d, g || "", f, k);
252
+ const [U, O] = Xt(d, g || "", f, I);
254
253
  let o = A && e.length === 0;
255
- if (e.length === 0 && (be = typeof window < "u" ? window.location.href : ""), p = {
256
- ...p,
254
+ if (e.length === 0 && (be = typeof window < "u" ? window.location.href : ""), h = {
255
+ ...h,
257
256
  Accept: "text/html, application/xhtml+xml",
258
257
  "X-Requested-With": "XMLHttpRequest",
259
258
  "X-Inertia": !0,
@@ -262,28 +261,28 @@ const Yt = ({ children: t }) => {
262
261
  "X-InertiaUI-Modal-Use-Router": o ? 1 : 0,
263
262
  "X-InertiaUI-Modal-Base-Url": be
264
263
  }, o)
265
- return qe = null, oe[H] = {
264
+ return _e = null, oe[H] = {
266
265
  config: y,
267
266
  onClose: N,
268
- onAfterLeave: h
269
- }, he.visit(W, {
267
+ onAfterLeave: v
268
+ }, ve.visit(U, {
270
269
  method: d,
271
270
  data: O,
272
- headers: p,
271
+ headers: h,
273
272
  preserveScroll: !0,
274
273
  preserveState: !0,
275
- onError: U,
274
+ onError: W,
276
275
  onFinish: () => {
277
- Zt(() => qe).then(K);
276
+ Zt(() => _e).then(K);
278
277
  }
279
278
  });
280
279
  Te({
281
- url: W,
280
+ url: U,
282
281
  method: d,
283
282
  data: O,
284
- headers: p
285
- }).then((u) => K(m(u.data, y, N, h))).catch((u) => {
286
- U(u);
283
+ headers: h
284
+ }).then((u) => K(m(u.data, y, N, v))).catch((u) => {
285
+ W(u);
287
286
  });
288
287
  });
289
288
  }, c = {
@@ -292,10 +291,10 @@ const Yt = ({ children: t }) => {
292
291
  push: s,
293
292
  pushFromResponseData: m,
294
293
  closeAll: () => {
295
- Xe.reverse().forEach((g) => g.close());
294
+ qe.reverse().forEach((g) => g.close());
296
295
  },
297
296
  reset: () => l(() => []),
298
- visit: x,
297
+ visit: w,
299
298
  visitModal: b,
300
299
  registerLocalModal: (g, d) => {
301
300
  i((f) => ({
@@ -310,67 +309,67 @@ const Yt = ({ children: t }) => {
310
309
  });
311
310
  }
312
311
  };
313
- return /* @__PURE__ */ F(Re.Provider, { value: c, children: t });
312
+ return /* @__PURE__ */ C(Re.Provider, { value: c, children: t });
314
313
  }, Ae = () => {
315
314
  const t = de(Re);
316
315
  if (t === null)
317
316
  throw new Error("useModalStack must be used within a ModalStackProvider");
318
317
  return t;
319
318
  }, rt = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], Jt = (t) => {
320
- t.initialPage && (mt = t.initialPage.version), t.resolveComponent && (pt = t.resolveComponent);
321
- }, hr = (t, e) => (Jt(e), /* @__PURE__ */ F(Yt, { children: /* @__PURE__ */ F(t, { ...e, children: ({ Component: r, props: i, key: l }) => /* @__PURE__ */ le(Ye, { children: [
319
+ t.initialPage && (mt = t.initialPage.version), t.resolveComponent && (ht = t.resolveComponent);
320
+ }, vr = (t, e) => (Jt(e), /* @__PURE__ */ C(Yt, { children: /* @__PURE__ */ C(t, { ...e, children: ({ Component: r, props: i, key: l }) => /* @__PURE__ */ le(Ye, { children: [
322
321
  (() => {
323
322
  const m = Ne(r, { key: l, ...i });
324
- return typeof r.layout == "function" ? r.layout(m) : Array.isArray(r.layout) ? r.layout.concat(m).reverse().reduce((v, b) => Ne(b, i, v)) : m;
323
+ return typeof r.layout == "function" ? r.layout(m) : Array.isArray(r.layout) ? r.layout.concat(m).reverse().reduce((p, b) => Ne(b, i, p)) : m;
325
324
  })(),
326
- /* @__PURE__ */ F(Qt, {})
325
+ /* @__PURE__ */ C(Qt, {})
327
326
  ] }) }) })), Qt = ({ children: t }) => {
328
327
  var m;
329
328
  const e = de(Re);
330
329
  let n = !1, r = !1;
331
- D(() => he.on("start", () => n = !0), []), D(() => he.on("finish", () => n = !1), []), D(
332
- () => he.on("navigate", function(s) {
333
- const v = s.detail.page.props._inertiaui_modal;
334
- if (!v) {
330
+ D(() => ve.on("start", () => n = !0), []), D(() => ve.on("finish", () => n = !1), []), D(
331
+ () => ve.on("navigate", function(s) {
332
+ const p = s.detail.page.props._inertiaui_modal;
333
+ if (!p) {
335
334
  r && e.closeAll();
336
335
  return;
337
336
  }
338
- r = v, be = v.baseUrl, e.pushFromResponseData(v, {}, () => {
339
- if (!v.baseUrl) {
337
+ r = p, be = p.baseUrl, e.pushFromResponseData(p, {}, () => {
338
+ if (!p.baseUrl) {
340
339
  console.error("No base url in modal response data so cannot navigate back");
341
340
  return;
342
341
  }
343
- !n && window.location.href !== v.baseUrl && he.visit(v.baseUrl, {
342
+ !n && window.location.href !== p.baseUrl && ve.visit(p.baseUrl, {
344
343
  preserveScroll: !0,
345
344
  preserveState: !0
346
345
  });
347
346
  }).then((b) => {
348
- qe = b;
347
+ _e = b;
349
348
  });
350
349
  }),
351
350
  []
352
351
  );
353
- const i = (s) => (Xe.length && (s.headers["X-InertiaUI-Modal-Base-Url"] = be), s);
352
+ const i = (s) => (qe.length && (s.headers["X-InertiaUI-Modal-Base-Url"] = be), s);
354
353
  D(() => (Te.interceptors.request.use(i), () => Te.interceptors.request.eject(i)), []);
355
- const l = Xt(), a = j();
354
+ const l = qt(), a = j();
356
355
  return D(() => {
357
- var b, x;
358
- const s = (b = l.props) == null ? void 0 : b._inertiaui_modal, v = a.current;
359
- a.current = s, s && v && s.component === v.component && s.url === v.url && ((x = e.stack[0]) == null || x.updateProps(s.props ?? {}));
356
+ var b, w;
357
+ const s = (b = l.props) == null ? void 0 : b._inertiaui_modal, p = a.current;
358
+ a.current = s, s && p && s.component === p.component && s.url === p.url && ((w = e.stack[0]) == null || w.updateProps(s.props ?? {}));
360
359
  }, [(m = l.props) == null ? void 0 : m._inertiaui_modal]), /* @__PURE__ */ le(Ye, { children: [
361
360
  t,
362
- e.stack.length > 0 && /* @__PURE__ */ F(vt, { index: 0 })
361
+ e.stack.length > 0 && /* @__PURE__ */ C(pt, { index: 0 })
363
362
  ] });
364
363
  }, Qe = B.createContext(null);
365
364
  Qe.displayName = "ModalIndexContext";
366
- const ht = () => {
365
+ const vt = () => {
367
366
  const t = B.useContext(Qe);
368
367
  if (t === void 0)
369
368
  throw new Error("useModalIndex must be used within a ModalIndexProvider");
370
369
  return t;
371
- }, vt = ({ index: t }) => {
370
+ }, pt = ({ index: t }) => {
372
371
  const { stack: e } = Ae(), n = Y(() => e[t], [e, t]);
373
- return (n == null ? void 0 : n.component) && /* @__PURE__ */ F(Qe.Provider, { value: t, children: /* @__PURE__ */ F(
372
+ return (n == null ? void 0 : n.component) && /* @__PURE__ */ C(Qe.Provider, { value: t, children: /* @__PURE__ */ C(
374
373
  n.component,
375
374
  {
376
375
  ...n.props,
@@ -378,10 +377,10 @@ const ht = () => {
378
377
  }
379
378
  ) });
380
379
  }, bt = Ze(({ name: t, children: e, onFocus: n = null, onBlur: r = null, onClose: i = null, onSuccess: l = null, ...a }, m) => {
381
- const s = ht(), { stack: v, registerLocalModal: b, removeLocalModal: x } = Ae(), [T, E] = $(null), c = Y(() => t ? T : v[s], [t, T, s, v]), g = Y(() => {
382
- var h;
383
- return (h = v.find((k) => k.shouldRender && k.index > (c == null ? void 0 : c.index))) == null ? void 0 : h.index;
384
- }, [s, v]), d = Y(() => (c == null ? void 0 : c.config.slideover) ?? a.slideover ?? Je("type") === "slideover", [a.slideover]), f = Y(
380
+ const s = vt(), { stack: p, registerLocalModal: b, removeLocalModal: w } = Ae(), [T, E] = $(null), c = Y(() => t ? T : p[s], [t, T, s, p]), g = Y(() => {
381
+ var v;
382
+ return (v = p.find((I) => I.shouldRender && I.index > (c == null ? void 0 : c.index))) == null ? void 0 : v.index;
383
+ }, [s, p]), d = Y(() => (c == null ? void 0 : c.config.slideover) ?? a.slideover ?? Je("type") === "slideover", [a.slideover]), f = Y(
385
384
  () => ({
386
385
  slideover: d,
387
386
  closeButton: a.closeButton ?? se(d, "closeButton"),
@@ -396,18 +395,18 @@ const ht = () => {
396
395
  );
397
396
  D(() => {
398
397
  if (t) {
399
- let h = null;
400
- return b(t, (k) => {
401
- h = k.registerEventListenersFromProps(a), E(k);
398
+ let v = null;
399
+ return b(t, (I) => {
400
+ v = I.registerEventListenersFromProps(a), E(I);
402
401
  }), () => {
403
- h == null || h(), h = null, x(t);
402
+ v == null || v(), v = null, w(t);
404
403
  };
405
404
  }
406
405
  return c.registerEventListenersFromProps(a);
407
406
  }, [t]);
408
- const p = j(c);
407
+ const h = j(c);
409
408
  D(() => {
410
- p.current = c;
409
+ h.current = c;
411
410
  }, [c]), D(() => {
412
411
  c !== null && (c.isOpen ? l == null || l() : i == null || i());
413
412
  }, [c == null ? void 0 : c.isOpen]);
@@ -418,59 +417,59 @@ const ht = () => {
418
417
  m,
419
418
  () => ({
420
419
  afterLeave: () => {
421
- var h;
422
- return (h = p.current) == null ? void 0 : h.afterLeave();
420
+ var v;
421
+ return (v = h.current) == null ? void 0 : v.afterLeave();
423
422
  },
424
423
  close: () => {
425
- var h;
426
- return (h = p.current) == null ? void 0 : h.close();
424
+ var v;
425
+ return (v = h.current) == null ? void 0 : v.close();
427
426
  },
428
- emit: (...h) => {
429
- var k;
430
- return (k = p.current) == null ? void 0 : k.emit(...h);
427
+ emit: (...v) => {
428
+ var I;
429
+ return (I = h.current) == null ? void 0 : I.emit(...v);
431
430
  },
432
431
  getChildModal: () => {
433
- var h;
434
- return (h = p.current) == null ? void 0 : h.getChildModal();
432
+ var v;
433
+ return (v = h.current) == null ? void 0 : v.getChildModal();
435
434
  },
436
435
  getParentModal: () => {
437
- var h;
438
- return (h = p.current) == null ? void 0 : h.getParentModal();
436
+ var v;
437
+ return (v = h.current) == null ? void 0 : v.getParentModal();
439
438
  },
440
- reload: (...h) => {
441
- var k;
442
- return (k = p.current) == null ? void 0 : k.reload(...h);
439
+ reload: (...v) => {
440
+ var I;
441
+ return (I = h.current) == null ? void 0 : I.reload(...v);
443
442
  },
444
443
  setOpen: () => {
445
- var h;
446
- return (h = p.current) == null ? void 0 : h.setOpen();
444
+ var v;
445
+ return (v = h.current) == null ? void 0 : v.setOpen();
447
446
  },
448
447
  get id() {
449
- var h;
450
- return (h = p.current) == null ? void 0 : h.id;
448
+ var v;
449
+ return (v = h.current) == null ? void 0 : v.id;
451
450
  },
452
451
  get index() {
453
- var h;
454
- return (h = p.current) == null ? void 0 : h.index;
452
+ var v;
453
+ return (v = h.current) == null ? void 0 : v.index;
455
454
  },
456
455
  get isOpen() {
457
- var h;
458
- return (h = p.current) == null ? void 0 : h.isOpen;
456
+ var v;
457
+ return (v = h.current) == null ? void 0 : v.isOpen;
459
458
  },
460
459
  get config() {
461
- var h;
462
- return (h = p.current) == null ? void 0 : h.config;
460
+ var v;
461
+ return (v = h.current) == null ? void 0 : v.config;
463
462
  },
464
463
  get modalContext() {
465
- return p.current;
464
+ return h.current;
466
465
  },
467
466
  get onTopOfStack() {
468
- var h;
469
- return (h = p.current) == null ? void 0 : h.onTopOfStack;
467
+ var v;
468
+ return (v = h.current) == null ? void 0 : v.onTopOfStack;
470
469
  },
471
470
  get shouldRender() {
472
- var h;
473
- return (h = p.current) == null ? void 0 : h.shouldRender;
471
+ var v;
472
+ return (v = h.current) == null ? void 0 : v.shouldRender;
474
473
  }
475
474
  }),
476
475
  [c]
@@ -491,7 +490,7 @@ const ht = () => {
491
490
  setOpen: c.setOpen,
492
491
  shouldRender: c.shouldRender
493
492
  }) : e,
494
- g && /* @__PURE__ */ F(vt, { index: g })
493
+ g && /* @__PURE__ */ C(pt, { index: g })
495
494
  ] });
496
495
  });
497
496
  bt.displayName = "HeadlessModal";
@@ -596,7 +595,7 @@ let G = function(t) {
596
595
  let e = wt(t);
597
596
  return B.useCallback((...n) => e.current(...n), [e]);
598
597
  };
599
- function _e(...t) {
598
+ function Xe(...t) {
600
599
  return Array.from(new Set(t.flatMap((e) => typeof e == "string" ? e.split(" ") : []))).filter(Boolean).join(" ");
601
600
  }
602
601
  function Le(t, e, ...n) {
@@ -616,44 +615,44 @@ function an({ ourProps: t, theirProps: e, slot: n, defaultTag: r, features: i, v
616
615
  m = m ?? sn;
617
616
  let s = Nt(e, t);
618
617
  if (l) return we(s, n, r, a, m);
619
- let v = i ?? 0;
620
- if (v & 2) {
621
- let { static: b = !1, ...x } = s;
622
- if (b) return we(x, n, r, a, m);
618
+ let p = i ?? 0;
619
+ if (p & 2) {
620
+ let { static: b = !1, ...w } = s;
621
+ if (b) return we(w, n, r, a, m);
623
622
  }
624
- if (v & 1) {
625
- let { unmount: b = !0, ...x } = s;
623
+ if (p & 1) {
624
+ let { unmount: b = !0, ...w } = s;
626
625
  return Le(b ? 0 : 1, { 0() {
627
626
  return null;
628
627
  }, 1() {
629
- return we({ ...x, hidden: !0, style: { display: "none" } }, n, r, a, m);
628
+ return we({ ...w, hidden: !0, style: { display: "none" } }, n, r, a, m);
630
629
  } });
631
630
  }
632
631
  return we(s, n, r, a, m);
633
632
  }
634
633
  function we(t, e = {}, n, r, i) {
635
- let { as: l = n, children: a, refName: m = "ref", ...s } = He(t, ["unmount", "static"]), v = t.ref !== void 0 ? { [m]: t.ref } : {}, b = typeof a == "function" ? a(e) : a;
634
+ let { as: l = n, children: a, refName: m = "ref", ...s } = He(t, ["unmount", "static"]), p = t.ref !== void 0 ? { [m]: t.ref } : {}, b = typeof a == "function" ? a(e) : a;
636
635
  "className" in s && s.className && typeof s.className == "function" && (s.className = s.className(e)), s["aria-labelledby"] && s["aria-labelledby"] === s.id && (s["aria-labelledby"] = void 0);
637
- let x = {};
636
+ let w = {};
638
637
  if (e) {
639
638
  let T = !1, E = [];
640
639
  for (let [c, g] of Object.entries(e)) typeof g == "boolean" && (T = !0), g === !0 && E.push(c.replace(/([A-Z])/g, (d) => `-${d.toLowerCase()}`));
641
640
  if (T) {
642
- x["data-headlessui-state"] = E.join(" ");
643
- for (let c of E) x[`data-${c}`] = "";
641
+ w["data-headlessui-state"] = E.join(" ");
642
+ for (let c of E) w[`data-${c}`] = "";
644
643
  }
645
644
  }
646
- if (l === ae && (Object.keys(te(s)).length > 0 || Object.keys(te(x)).length > 0)) if (!Kt(b) || Array.isArray(b) && b.length > 1) {
647
- if (Object.keys(te(s)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(te(s)).concat(Object.keys(te(x))).map((T) => ` - ${T}`).join(`
645
+ if (l === ae && (Object.keys(te(s)).length > 0 || Object.keys(te(w)).length > 0)) if (!Kt(b) || Array.isArray(b) && b.length > 1) {
646
+ if (Object.keys(te(s)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${r} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(te(s)).concat(Object.keys(te(w))).map((T) => ` - ${T}`).join(`
648
647
  `), "", "You can apply a few solutions:", ['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element."].map((T) => ` - ${T}`).join(`
649
648
  `)].join(`
650
649
  `));
651
650
  } else {
652
- let T = b.props, E = T == null ? void 0 : T.className, c = typeof E == "function" ? (...f) => _e(E(...f), s.className) : _e(E, s.className), g = c ? { className: c } : {}, d = Nt(b.props, te(He(s, ["ref"])));
653
- for (let f in x) f in d && delete x[f];
654
- return qt(b, Object.assign({}, d, x, v, { ref: i(on(b), v.ref) }, g));
651
+ let T = b.props, E = T == null ? void 0 : T.className, c = typeof E == "function" ? (...f) => Xe(E(...f), s.className) : Xe(E, s.className), g = c ? { className: c } : {}, d = Nt(b.props, te(He(s, ["ref"])));
652
+ for (let f in w) f in d && delete w[f];
653
+ return _t(b, Object.assign({}, d, w, p, { ref: i(on(b), p.ref) }, g));
655
654
  }
656
- return Ne(l, Object.assign({}, He(s, ["ref"]), l !== ae && v, l !== ae && x), b);
655
+ return Ne(l, Object.assign({}, He(s, ["ref"]), l !== ae && p, l !== ae && w), b);
657
656
  }
658
657
  function ln() {
659
658
  let t = j([]), e = V((n) => {
@@ -715,7 +714,7 @@ function Tt(...t) {
715
714
  return t.every((r) => r == null || (r == null ? void 0 : r[un])) ? void 0 : n;
716
715
  }
717
716
  function dn(t = 0) {
718
- let [e, n] = $(t), r = V((s) => n(s), [e]), i = V((s) => n((v) => v | s), [e]), l = V((s) => (e & s) === s, [e]), a = V((s) => n((v) => v & ~s), [n]), m = V((s) => n((v) => v ^ s), [n]);
717
+ let [e, n] = $(t), r = V((s) => n(s), [e]), i = V((s) => n((p) => p | s), [e]), l = V((s) => (e & s) === s, [e]), a = V((s) => n((p) => p & ~s), [n]), m = V((s) => n((p) => p ^ s), [n]);
719
718
  return { flags: e, setFlag: r, addFlag: i, hasFlag: l, removeFlag: a, toggleFlag: m };
720
719
  }
721
720
  var at, it;
@@ -730,7 +729,7 @@ function fn(t) {
730
729
  return e;
731
730
  }
732
731
  function mn(t, e, n, r) {
733
- let [i, l] = $(n), { hasFlag: a, addFlag: m, removeFlag: s } = dn(t && i ? 3 : 0), v = j(!1), b = j(!1), x = yt();
732
+ let [i, l] = $(n), { hasFlag: a, addFlag: m, removeFlag: s } = dn(t && i ? 3 : 0), p = j(!1), b = j(!1), w = yt();
734
733
  return Q(() => {
735
734
  var T;
736
735
  if (t) {
@@ -738,26 +737,26 @@ function mn(t, e, n, r) {
738
737
  n && m(3);
739
738
  return;
740
739
  }
741
- return (T = r == null ? void 0 : r.start) == null || T.call(r, n), pn(e, { inFlight: v, prepare() {
742
- b.current ? b.current = !1 : b.current = v.current, v.current = !0, !b.current && (n ? (m(3), s(4)) : (m(4), s(2)));
740
+ return (T = r == null ? void 0 : r.start) == null || T.call(r, n), hn(e, { inFlight: p, prepare() {
741
+ b.current ? b.current = !1 : b.current = p.current, p.current = !0, !b.current && (n ? (m(3), s(4)) : (m(4), s(2)));
743
742
  }, run() {
744
743
  b.current ? n ? (s(3), m(4)) : (s(4), m(3)) : n ? s(1) : m(1);
745
744
  }, done() {
746
745
  var E;
747
- b.current && typeof e.getAnimations == "function" && e.getAnimations().length > 0 || (v.current = !1, s(7), n || l(!1), (E = r == null ? void 0 : r.end) == null || E.call(r, n));
746
+ b.current && typeof e.getAnimations == "function" && e.getAnimations().length > 0 || (p.current = !1, s(7), n || l(!1), (E = r == null ? void 0 : r.end) == null || E.call(r, n));
748
747
  } });
749
748
  }
750
- }, [t, n, e, x]), t ? [i, { closed: a(1), enter: a(2), leave: a(4), transition: a(2) || a(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
749
+ }, [t, n, e, w]), t ? [i, { closed: a(1), enter: a(2), leave: a(4), transition: a(2) || a(4) }] : [n, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
751
750
  }
752
- function pn(t, { prepare: e, run: n, done: r, inFlight: i }) {
751
+ function hn(t, { prepare: e, run: n, done: r, inFlight: i }) {
753
752
  let l = Me();
754
- return vn(t, { prepare: e, inFlight: i }), l.nextFrame(() => {
753
+ return pn(t, { prepare: e, inFlight: i }), l.nextFrame(() => {
755
754
  n(), l.requestAnimationFrame(() => {
756
- l.add(hn(t, r));
755
+ l.add(vn(t, r));
757
756
  });
758
757
  }), l.dispose;
759
758
  }
760
- function hn(t, e) {
759
+ function vn(t, e) {
761
760
  var n, r;
762
761
  let i = Me();
763
762
  if (!t) return i.dispose;
@@ -770,7 +769,7 @@ function hn(t, e) {
770
769
  l || e();
771
770
  }), i.dispose);
772
771
  }
773
- function vn(t, { inFlight: e, prepare: n }) {
772
+ function pn(t, { inFlight: e, prepare: n }) {
774
773
  if (e != null && e.current) {
775
774
  n();
776
775
  return;
@@ -806,18 +805,18 @@ var St = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
806
805
  var a = l.shift();
807
806
  if (!ke(a, !1))
808
807
  if (a.tagName === "SLOT") {
809
- var m = a.assignedElements(), s = m.length ? m : a.children, v = t(s, !0, r);
810
- r.flatten ? i.push.apply(i, v) : i.push({
808
+ var m = a.assignedElements(), s = m.length ? m : a.children, p = t(s, !0, r);
809
+ r.flatten ? i.push.apply(i, p) : i.push({
811
810
  scopeParent: a,
812
- candidates: v
811
+ candidates: p
813
812
  });
814
813
  } else {
815
814
  var b = ie.call(a, Oe);
816
815
  b && r.filter(a) && (n || !e.includes(a)) && i.push(a);
817
- var x = a.shadowRoot || // check for an undisclosed shadow
818
- typeof r.getShadowRoot == "function" && r.getShadowRoot(a), T = !ke(x, !1) && (!r.shadowRootFilter || r.shadowRootFilter(a));
819
- if (x && T) {
820
- var E = t(x === !0 ? a.children : x.children, !0, r);
816
+ var w = a.shadowRoot || // check for an undisclosed shadow
817
+ typeof r.getShadowRoot == "function" && r.getShadowRoot(a), T = !ke(w, !1) && (!r.shadowRootFilter || r.shadowRootFilter(a));
818
+ if (w && T) {
819
+ var E = t(w === !0 ? a.children : w.children, !0, r);
821
820
  r.flatten ? i.push.apply(i, E) : i.push({
822
821
  scopeParent: a,
823
822
  candidates: E
@@ -838,10 +837,10 @@ var St = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
838
837
  return r < 0 && n && !Ct(e) ? 0 : r;
839
838
  }, yn = function(e, n) {
840
839
  return e.tabIndex === n.tabIndex ? e.documentOrder - n.documentOrder : e.tabIndex - n.tabIndex;
841
- }, Pt = function(e) {
840
+ }, It = function(e) {
842
841
  return e.tagName === "INPUT";
843
842
  }, wn = function(e) {
844
- return Pt(e) && e.type === "hidden";
843
+ return It(e) && e.type === "hidden";
845
844
  }, xn = function(e) {
846
845
  var n = e.tagName === "DETAILS" && Array.prototype.slice.apply(e.children).some(function(r) {
847
846
  return r.tagName === "SUMMARY";
@@ -868,7 +867,7 @@ var St = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
868
867
  var l = En(i, e.form);
869
868
  return !l || l === e;
870
869
  }, Tn = function(e) {
871
- return Pt(e) && e.type === "radio";
870
+ return It(e) && e.type === "radio";
872
871
  }, Sn = function(e) {
873
872
  return Tn(e) && !Nn(e);
874
873
  }, On = function(e) {
@@ -876,8 +875,8 @@ var St = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
876
875
  if (r && r !== e) {
877
876
  var a, m, s;
878
877
  for (l = !!((a = i) !== null && a !== void 0 && (m = a.ownerDocument) !== null && m !== void 0 && m.contains(i) || e != null && (s = e.ownerDocument) !== null && s !== void 0 && s.contains(e)); !l && i; ) {
879
- var v, b, x;
880
- r = Fe(i), i = (v = r) === null || v === void 0 ? void 0 : v.host, l = !!((b = i) !== null && b !== void 0 && (x = b.ownerDocument) !== null && x !== void 0 && x.contains(i));
878
+ var p, b, w;
879
+ r = Fe(i), i = (p = r) === null || p === void 0 ? void 0 : p.host, l = !!((b = i) !== null && b !== void 0 && (w = b.ownerDocument) !== null && w !== void 0 && w.contains(i));
881
880
  }
882
881
  }
883
882
  return l;
@@ -894,10 +893,10 @@ var St = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
894
893
  if (!r || r === "full" || r === "legacy-full") {
895
894
  if (typeof i == "function") {
896
895
  for (var m = e; e; ) {
897
- var s = e.parentElement, v = Fe(e);
896
+ var s = e.parentElement, p = Fe(e);
898
897
  if (s && !s.shadowRoot && i(s) === !0)
899
898
  return lt(e);
900
- e.assignedSlot ? e = e.assignedSlot : !s && v !== e.ownerDocument ? e = v.host : e = s;
899
+ e.assignedSlot ? e = e.assignedSlot : !s && p !== e.ownerDocument ? e = p.host : e = s;
901
900
  }
902
901
  e = m;
903
902
  }
@@ -933,21 +932,21 @@ var St = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
933
932
  }, Cn = function(e) {
934
933
  var n = parseInt(e.getAttribute("tabindex"), 10);
935
934
  return !!(isNaN(n) || n >= 0);
936
- }, Pn = function t(e) {
935
+ }, In = function t(e) {
937
936
  var n = [], r = [];
938
937
  return e.forEach(function(i, l) {
939
- var a = !!i.scopeParent, m = a ? i.scopeParent : i, s = gn(m, a), v = a ? t(i.candidates) : m;
940
- s === 0 ? a ? n.push.apply(n, v) : n.push(m) : r.push({
938
+ var a = !!i.scopeParent, m = a ? i.scopeParent : i, s = gn(m, a), p = a ? t(i.candidates) : m;
939
+ s === 0 ? a ? n.push.apply(n, p) : n.push(m) : r.push({
941
940
  documentOrder: l,
942
941
  tabIndex: s,
943
942
  item: i,
944
943
  isScope: a,
945
- content: v
944
+ content: p
946
945
  });
947
946
  }), r.sort(yn).reduce(function(i, l) {
948
947
  return l.isScope ? i.push.apply(i, l.content) : i.push(l.content), i;
949
948
  }, []).concat(n);
950
- }, In = function(e, n) {
949
+ }, Pn = function(e, n) {
951
950
  n = n || {};
952
951
  var r;
953
952
  return n.getShadowRoot ? r = kt([e], n.includeContainer, {
@@ -955,7 +954,7 @@ var St = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
955
954
  flatten: !1,
956
955
  getShadowRoot: n.getShadowRoot,
957
956
  shadowRootFilter: Cn
958
- }) : r = Ft(e, n.includeContainer, Ve.bind(null, n)), Pn(r);
957
+ }) : r = Ft(e, n.includeContainer, Ve.bind(null, n)), In(r);
959
958
  }, Rn = function(e, n) {
960
959
  n = n || {};
961
960
  var r;
@@ -973,10 +972,10 @@ var St = ["input:not([inert])", "select:not([inert])", "textarea:not([inert])",
973
972
  throw new Error("No node provided");
974
973
  return ie.call(e, An) === !1 ? !1 : Ce(n, e);
975
974
  };
976
- let tt = Pe(null);
975
+ let tt = Ie(null);
977
976
  tt.displayName = "OpenClosedContext";
978
977
  var re = ((t) => (t[t.Open = 1] = "Open", t[t.Closed = 2] = "Closed", t[t.Closing = 4] = "Closing", t[t.Opening = 8] = "Opening", t))(re || {});
979
- function It() {
978
+ function Pt() {
980
979
  return de(tt);
981
980
  }
982
981
  function Mn({ value: t, children: e }) {
@@ -984,14 +983,14 @@ function Mn({ value: t, children: e }) {
984
983
  }
985
984
  function Ln() {
986
985
  let t = typeof document > "u";
987
- return "useSyncExternalStore" in ve ? ((e) => e.useSyncExternalStore)(ve)(() => () => {
986
+ return "useSyncExternalStore" in pe ? ((e) => e.useSyncExternalStore)(pe)(() => () => {
988
987
  }, () => !1, () => !t) : !1;
989
988
  }
990
989
  function Rt() {
991
- let t = Ln(), [e, n] = ve.useState(Ee.isHandoffComplete);
992
- return e && Ee.isHandoffComplete === !1 && n(!1), ve.useEffect(() => {
990
+ let t = Ln(), [e, n] = pe.useState(Ee.isHandoffComplete);
991
+ return e && Ee.isHandoffComplete === !1 && n(!1), pe.useEffect(() => {
993
992
  e !== !0 && n(!0);
994
- }, [e]), ve.useEffect(() => Ee.handoff(), []), t ? !1 : e;
993
+ }, [e]), pe.useEffect(() => Ee.handoff(), []), t ? !1 : e;
995
994
  }
996
995
  function jn() {
997
996
  let t = j(!1);
@@ -1003,7 +1002,7 @@ function At(t) {
1003
1002
  var e;
1004
1003
  return !!(t.enter || t.enterFrom || t.enterTo || t.leave || t.leaveFrom || t.leaveTo) || ((e = t.as) != null ? e : Lt) !== ae || B.Children.count(t.children) === 1;
1005
1004
  }
1006
- let je = Pe(null);
1005
+ let je = Ie(null);
1007
1006
  je.displayName = "TransitionContext";
1008
1007
  var Dn = ((t) => (t.Visible = "visible", t.Hidden = "hidden", t))(Dn || {});
1009
1008
  function $n() {
@@ -1011,12 +1010,12 @@ function $n() {
1011
1010
  if (t === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
1012
1011
  return t;
1013
1012
  }
1014
- function Un() {
1013
+ function Wn() {
1015
1014
  let t = de(De);
1016
1015
  if (t === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
1017
1016
  return t;
1018
1017
  }
1019
- let De = Pe(null);
1018
+ let De = Ie(null);
1020
1019
  De.displayName = "NestingContext";
1021
1020
  function $e(t) {
1022
1021
  return "children" in t ? $e(t.children) : t.current.filter(({ el: e }) => e.current !== null).filter(({ state: e }) => e === "visible").length > 0;
@@ -1035,88 +1034,88 @@ function Mt(t, e) {
1035
1034
  }), m = G((E) => {
1036
1035
  let c = r.current.find(({ el: g }) => g === E);
1037
1036
  return c ? c.state !== "visible" && (c.state = "visible") : r.current.push({ el: E, state: "visible" }), () => a(E, J.Unmount);
1038
- }), s = j([]), v = j(Promise.resolve()), b = j({ enter: [], leave: [] }), x = G((E, c, g) => {
1037
+ }), s = j([]), p = j(Promise.resolve()), b = j({ enter: [], leave: [] }), w = G((E, c, g) => {
1039
1038
  s.current.splice(0), e && (e.chains.current[c] = e.chains.current[c].filter(([d]) => d !== E)), e == null || e.chains.current[c].push([E, new Promise((d) => {
1040
1039
  s.current.push(d);
1041
1040
  })]), e == null || e.chains.current[c].push([E, new Promise((d) => {
1042
- Promise.all(b.current[c].map(([f, p]) => p)).then(() => d());
1043
- })]), c === "enter" ? v.current = v.current.then(() => e == null ? void 0 : e.wait.current).then(() => g(c)) : g(c);
1041
+ Promise.all(b.current[c].map(([f, h]) => h)).then(() => d());
1042
+ })]), c === "enter" ? p.current = p.current.then(() => e == null ? void 0 : e.wait.current).then(() => g(c)) : g(c);
1044
1043
  }), T = G((E, c, g) => {
1045
1044
  Promise.all(b.current[c].splice(0).map(([d, f]) => f)).then(() => {
1046
1045
  var d;
1047
1046
  (d = s.current.shift()) == null || d();
1048
1047
  }).then(() => g(c));
1049
1048
  });
1050
- return Y(() => ({ children: r, register: m, unregister: a, onStart: x, onStop: T, wait: v, chains: b }), [m, a, r, x, T, b, v]);
1049
+ return Y(() => ({ children: r, register: m, unregister: a, onStart: w, onStop: T, wait: p, chains: b }), [m, a, r, w, T, b, p]);
1051
1050
  }
1052
1051
  let Lt = ae, jt = xt.RenderStrategy;
1053
- function Wn(t, e) {
1052
+ function Un(t, e) {
1054
1053
  var n, r;
1055
- let { transition: i = !0, beforeEnter: l, afterEnter: a, beforeLeave: m, afterLeave: s, enter: v, enterFrom: b, enterTo: x, entered: T, leave: E, leaveFrom: c, leaveTo: g, ...d } = t, [f, p] = $(null), y = j(null), N = At(t), h = Tt(...N ? [y, e, p] : e === null ? [] : [e]), k = (n = d.unmount) == null || n ? J.Unmount : J.Hidden, { show: A, appear: H, initial: K } = $n(), [U, W] = $(A ? "visible" : "hidden"), O = Un(), { register: o, unregister: u } = O;
1054
+ let { transition: i = !0, beforeEnter: l, afterEnter: a, beforeLeave: m, afterLeave: s, enter: p, enterFrom: b, enterTo: w, entered: T, leave: E, leaveFrom: c, leaveTo: g, ...d } = t, [f, h] = $(null), y = j(null), N = At(t), v = Tt(...N ? [y, e, h] : e === null ? [] : [e]), I = (n = d.unmount) == null || n ? J.Unmount : J.Hidden, { show: A, appear: H, initial: K } = $n(), [W, U] = $(A ? "visible" : "hidden"), O = Wn(), { register: o, unregister: u } = O;
1056
1055
  Q(() => o(y), [o, y]), Q(() => {
1057
- if (k === J.Hidden && y.current) {
1058
- if (A && U !== "visible") {
1059
- W("visible");
1056
+ if (I === J.Hidden && y.current) {
1057
+ if (A && W !== "visible") {
1058
+ U("visible");
1060
1059
  return;
1061
1060
  }
1062
- return Le(U, { hidden: () => u(y), visible: () => o(y) });
1061
+ return Le(W, { hidden: () => u(y), visible: () => o(y) });
1063
1062
  }
1064
- }, [U, y, o, u, A, k]);
1065
- let w = Rt();
1063
+ }, [W, y, o, u, A, I]);
1064
+ let x = Rt();
1066
1065
  Q(() => {
1067
- if (N && w && U === "visible" && y.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
1068
- }, [y, U, w, N]);
1069
- let C = K && !H, P = H && A && K, I = j(!1), S = Mt(() => {
1070
- I.current || (W("hidden"), u(y));
1066
+ if (N && x && W === "visible" && y.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
1067
+ }, [y, W, x, N]);
1068
+ let F = K && !H, k = H && A && K, P = j(!1), S = Mt(() => {
1069
+ P.current || (U("hidden"), u(y));
1071
1070
  }, O), R = G((ee) => {
1072
- I.current = !0;
1071
+ P.current = !0;
1073
1072
  let Z = ee ? "enter" : "leave";
1074
1073
  S.onStart(y, Z, (ce) => {
1075
1074
  ce === "enter" ? l == null || l() : ce === "leave" && (m == null || m());
1076
1075
  });
1077
1076
  }), M = G((ee) => {
1078
1077
  let Z = ee ? "enter" : "leave";
1079
- I.current = !1, S.onStop(y, Z, (ce) => {
1078
+ P.current = !1, S.onStop(y, Z, (ce) => {
1080
1079
  ce === "enter" ? a == null || a() : ce === "leave" && (s == null || s());
1081
- }), Z === "leave" && !$e(S) && (W("hidden"), u(y));
1080
+ }), Z === "leave" && !$e(S) && (U("hidden"), u(y));
1082
1081
  });
1083
1082
  D(() => {
1084
1083
  N && i || (R(A), M(A));
1085
1084
  }, [A, N, i]);
1086
- let z = !(!i || !N || !w || C), [, L] = mn(z, f, A, { start: R, end: M }), _ = te({ ref: h, className: ((r = _e(d.className, P && v, P && b, L.enter && v, L.enter && L.closed && b, L.enter && !L.closed && x, L.leave && E, L.leave && !L.closed && c, L.leave && L.closed && g, !L.transition && A && T)) == null ? void 0 : r.trim()) || void 0, ...fn(L) }), q = 0;
1087
- U === "visible" && (q |= re.Open), U === "hidden" && (q |= re.Closed), L.enter && (q |= re.Opening), L.leave && (q |= re.Closing);
1085
+ let z = !(!i || !N || !x || F), [, L] = mn(z, f, A, { start: R, end: M }), X = te({ ref: v, className: ((r = Xe(d.className, k && p, k && b, L.enter && p, L.enter && L.closed && b, L.enter && !L.closed && w, L.leave && E, L.leave && !L.closed && c, L.leave && L.closed && g, !L.transition && A && T)) == null ? void 0 : r.trim()) || void 0, ...fn(L) }), _ = 0;
1086
+ W === "visible" && (_ |= re.Open), W === "hidden" && (_ |= re.Closed), L.enter && (_ |= re.Opening), L.leave && (_ |= re.Closing);
1088
1087
  let ye = Et();
1089
- return B.createElement(De.Provider, { value: S }, B.createElement(Mn, { value: q }, ye({ ourProps: _, theirProps: d, defaultTag: Lt, features: jt, visible: U === "visible", name: "Transition.Child" })));
1088
+ return B.createElement(De.Provider, { value: S }, B.createElement(Mn, { value: _ }, ye({ ourProps: X, theirProps: d, defaultTag: Lt, features: jt, visible: W === "visible", name: "Transition.Child" })));
1090
1089
  }
1091
1090
  function Bn(t, e) {
1092
1091
  let { show: n, appear: r = !1, unmount: i = !0, ...l } = t, a = j(null), m = At(t), s = Tt(...m ? [a, e] : e === null ? [] : [e]);
1093
1092
  Rt();
1094
- let v = It();
1095
- if (n === void 0 && v !== null && (n = (v & re.Open) === re.Open), n === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
1096
- let [b, x] = $(n ? "visible" : "hidden"), T = Mt(() => {
1097
- n || x("hidden");
1093
+ let p = Pt();
1094
+ if (n === void 0 && p !== null && (n = (p & re.Open) === re.Open), n === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
1095
+ let [b, w] = $(n ? "visible" : "hidden"), T = Mt(() => {
1096
+ n || w("hidden");
1098
1097
  }), [E, c] = $(!0), g = j([n]);
1099
1098
  Q(() => {
1100
1099
  E !== !1 && g.current[g.current.length - 1] !== n && (g.current.push(n), c(!1));
1101
1100
  }, [g, n]);
1102
1101
  let d = Y(() => ({ show: n, appear: r, initial: E }), [n, r, E]);
1103
1102
  Q(() => {
1104
- n ? x("visible") : !$e(T) && a.current !== null && x("hidden");
1103
+ n ? w("visible") : !$e(T) && a.current !== null && w("hidden");
1105
1104
  }, [n, T]);
1106
- let f = { unmount: i }, p = G(() => {
1107
- var h;
1108
- E && c(!1), (h = t.beforeEnter) == null || h.call(t);
1105
+ let f = { unmount: i }, h = G(() => {
1106
+ var v;
1107
+ E && c(!1), (v = t.beforeEnter) == null || v.call(t);
1109
1108
  }), y = G(() => {
1110
- var h;
1111
- E && c(!1), (h = t.beforeLeave) == null || h.call(t);
1109
+ var v;
1110
+ E && c(!1), (v = t.beforeLeave) == null || v.call(t);
1112
1111
  }), N = Et();
1113
- return B.createElement(De.Provider, { value: T }, B.createElement(je.Provider, { value: d }, N({ ourProps: { ...f, as: ae, children: B.createElement(Dt, { ref: s, ...f, ...l, beforeEnter: p, beforeLeave: y }) }, theirProps: {}, defaultTag: ae, features: jt, visible: b === "visible", name: "Transition" })));
1112
+ return B.createElement(De.Provider, { value: T }, B.createElement(je.Provider, { value: d }, N({ ourProps: { ...f, as: ae, children: B.createElement(Dt, { ref: s, ...f, ...l, beforeEnter: h, beforeLeave: y }) }, theirProps: {}, defaultTag: ae, features: jt, visible: b === "visible", name: "Transition" })));
1114
1113
  }
1115
1114
  function Hn(t, e) {
1116
- let n = de(je) !== null, r = It() !== null;
1115
+ let n = de(je) !== null, r = Pt() !== null;
1117
1116
  return B.createElement(B.Fragment, null, !n && r ? B.createElement(ze, { ref: e, ...t }) : B.createElement(Dt, { ref: e, ...t }));
1118
1117
  }
1119
- let ze = et(Bn), Dt = et(Wn), Ue = et(Hn), Kn = Object.assign(ze, { Child: Ue, Root: ze });
1118
+ let ze = et(Bn), Dt = et(Un), We = et(Hn), Kn = Object.assign(ze, { Child: We, Root: ze });
1120
1119
  function $t({ onClick: t }) {
1121
1120
  return /* @__PURE__ */ le(
1122
1121
  "button",
@@ -1125,8 +1124,8 @@ function $t({ onClick: t }) {
1125
1124
  className: "im-close-button text-gray-400 hover:text-gray-500",
1126
1125
  onClick: t,
1127
1126
  children: [
1128
- /* @__PURE__ */ F("span", { className: "sr-only", children: "Close" }),
1129
- /* @__PURE__ */ F(
1127
+ /* @__PURE__ */ C("span", { className: "sr-only", children: "Close" }),
1128
+ /* @__PURE__ */ C(
1130
1129
  "svg",
1131
1130
  {
1132
1131
  className: "size-6",
@@ -1136,7 +1135,7 @@ function $t({ onClick: t }) {
1136
1135
  strokeWidth: "2",
1137
1136
  stroke: "currentColor",
1138
1137
  "aria-hidden": "true",
1139
- children: /* @__PURE__ */ F(
1138
+ children: /* @__PURE__ */ C(
1140
1139
  "path",
1141
1140
  {
1142
1141
  strokeLinecap: "round",
@@ -1151,7 +1150,7 @@ function $t({ onClick: t }) {
1151
1150
  );
1152
1151
  }
1153
1152
  /*!
1154
- * focus-trap 7.6.2
1153
+ * focus-trap 7.6.4
1155
1154
  * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
1156
1155
  */
1157
1156
  function Ge(t, e) {
@@ -1159,10 +1158,10 @@ function Ge(t, e) {
1159
1158
  for (var n = 0, r = Array(e); n < e; n++) r[n] = t[n];
1160
1159
  return r;
1161
1160
  }
1162
- function qn(t) {
1161
+ function _n(t) {
1163
1162
  if (Array.isArray(t)) return Ge(t);
1164
1163
  }
1165
- function Xn(t, e, n) {
1164
+ function qn(t, e, n) {
1166
1165
  return (e = Zn(e)) in t ? Object.defineProperty(t, e, {
1167
1166
  value: n,
1168
1167
  enumerable: !0,
@@ -1170,7 +1169,7 @@ function Xn(t, e, n) {
1170
1169
  writable: !0
1171
1170
  }) : t[e] = n, t;
1172
1171
  }
1173
- function _n(t) {
1172
+ function Xn(t) {
1174
1173
  if (typeof Symbol < "u" && t[Symbol.iterator] != null || t["@@iterator"] != null) return Array.from(t);
1175
1174
  }
1176
1175
  function Vn() {
@@ -1191,7 +1190,7 @@ function ot(t) {
1191
1190
  for (var e = 1; e < arguments.length; e++) {
1192
1191
  var n = arguments[e] != null ? arguments[e] : {};
1193
1192
  e % 2 ? st(Object(n), !0).forEach(function(r) {
1194
- Xn(t, r, n[r]);
1193
+ qn(t, r, n[r]);
1195
1194
  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(n)) : st(Object(n)).forEach(function(r) {
1196
1195
  Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(n, r));
1197
1196
  });
@@ -1199,7 +1198,7 @@ function ot(t) {
1199
1198
  return t;
1200
1199
  }
1201
1200
  function zn(t) {
1202
- return qn(t) || _n(t) || Yn(t) || Vn();
1201
+ return _n(t) || Xn(t) || Yn(t) || Vn();
1203
1202
  }
1204
1203
  function Gn(t, e) {
1205
1204
  if (typeof t != "object" || !t) return t;
@@ -1226,14 +1225,14 @@ var ut = {
1226
1225
  activateTrap: function(e, n) {
1227
1226
  if (e.length > 0) {
1228
1227
  var r = e[e.length - 1];
1229
- r !== n && r.pause();
1228
+ r !== n && r._setPausedState(!0);
1230
1229
  }
1231
1230
  var i = e.indexOf(n);
1232
1231
  i === -1 || e.splice(i, 1), e.push(n);
1233
1232
  },
1234
1233
  deactivateTrap: function(e, n) {
1235
1234
  var r = e.indexOf(n);
1236
- r !== -1 && e.splice(r, 1), e.length > 0 && e[e.length - 1].unpause();
1235
+ r !== -1 && e.splice(r, 1), e.length > 0 && !e[e.length - 1]._isManuallyPaused() && e[e.length - 1]._setPausedState(!1);
1237
1236
  }
1238
1237
  }, Jn = function(e) {
1239
1238
  return e.tagName && e.tagName.toLowerCase() === "input" && typeof e.select == "function";
@@ -1247,7 +1246,7 @@ var ut = {
1247
1246
  return ge(e) && e.shiftKey;
1248
1247
  }, dt = function(e) {
1249
1248
  return setTimeout(e, 0);
1250
- }, pe = function(e) {
1249
+ }, he = function(e) {
1251
1250
  for (var n = arguments.length, r = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++)
1252
1251
  r[i - 1] = arguments[i];
1253
1252
  return typeof e == "function" ? e.apply(void 0, r) : e;
@@ -1291,28 +1290,29 @@ var ut = {
1291
1290
  mostRecentlyFocusedNode: null,
1292
1291
  active: !1,
1293
1292
  paused: !1,
1293
+ manuallyPaused: !1,
1294
1294
  // timer ID for when delayInitialFocus is true and initial focus in this trap
1295
1295
  // has been delayed during activation
1296
1296
  delayInitialFocusTimer: void 0,
1297
1297
  // the most recent KeyboardEvent for the configured nav key (typically [SHIFT+]TAB), if any
1298
1298
  recentNavEvent: void 0
1299
- }, m, s = function(o, u, w) {
1300
- return o && o[u] !== void 0 ? o[u] : l[w || u];
1301
- }, v = function(o, u) {
1302
- var w = typeof (u == null ? void 0 : u.composedPath) == "function" ? u.composedPath() : void 0;
1303
- return a.containerGroups.findIndex(function(C) {
1304
- var P = C.container, I = C.tabbableNodes;
1305
- return P.contains(o) || // fall back to explicit tabbable search which will take into consideration any
1299
+ }, m, s = function(o, u, x) {
1300
+ return o && o[u] !== void 0 ? o[u] : l[x || u];
1301
+ }, p = function(o, u) {
1302
+ var x = typeof (u == null ? void 0 : u.composedPath) == "function" ? u.composedPath() : void 0;
1303
+ return a.containerGroups.findIndex(function(F) {
1304
+ var k = F.container, P = F.tabbableNodes;
1305
+ return k.contains(o) || // fall back to explicit tabbable search which will take into consideration any
1306
1306
  // web components if the `tabbableOptions.getShadowRoot` option was used for
1307
1307
  // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't
1308
1308
  // look inside web components even if open)
1309
- (w == null ? void 0 : w.includes(P)) || I.find(function(S) {
1309
+ (x == null ? void 0 : x.includes(k)) || P.find(function(S) {
1310
1310
  return S === o;
1311
1311
  });
1312
1312
  });
1313
1313
  }, b = function(o) {
1314
- var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, w = u.hasFallback, C = w === void 0 ? !1 : w, P = u.params, I = P === void 0 ? [] : P, S = l[o];
1315
- if (typeof S == "function" && (S = S.apply(void 0, zn(I))), S === !0 && (S = void 0), !S) {
1314
+ var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, x = u.hasFallback, F = x === void 0 ? !1 : x, k = u.params, P = k === void 0 ? [] : k, S = l[o];
1315
+ if (typeof S == "function" && (S = S.apply(void 0, zn(P))), S === !0 && (S = void 0), !S) {
1316
1316
  if (S === void 0 || S === !1)
1317
1317
  return S;
1318
1318
  throw new Error("`".concat(o, "` was specified but was not a node, or did not return a node"));
@@ -1324,22 +1324,22 @@ var ut = {
1324
1324
  } catch (M) {
1325
1325
  throw new Error("`".concat(o, '` appears to be an invalid selector; error="').concat(M.message, '"'));
1326
1326
  }
1327
- if (!R && !C)
1327
+ if (!R && !F)
1328
1328
  throw new Error("`".concat(o, "` as selector refers to no known node"));
1329
1329
  }
1330
1330
  return R;
1331
- }, x = function() {
1331
+ }, w = function() {
1332
1332
  var o = b("initialFocus", {
1333
1333
  hasFallback: !0
1334
1334
  });
1335
1335
  if (o === !1)
1336
1336
  return !1;
1337
1337
  if (o === void 0 || o && !Ke(o, l.tabbableOptions))
1338
- if (v(r.activeElement) >= 0)
1338
+ if (p(r.activeElement) >= 0)
1339
1339
  o = r.activeElement;
1340
1340
  else {
1341
- var u = a.tabbableGroups[0], w = u && u.firstTabbableNode;
1342
- o = w || b("fallbackFocus");
1341
+ var u = a.tabbableGroups[0], x = u && u.firstTabbableNode;
1342
+ o = x || b("fallbackFocus");
1343
1343
  }
1344
1344
  else o === null && (o = b("fallbackFocus"));
1345
1345
  if (!o)
@@ -1347,9 +1347,9 @@ var ut = {
1347
1347
  return o;
1348
1348
  }, T = function() {
1349
1349
  if (a.containerGroups = a.containers.map(function(o) {
1350
- var u = In(o, l.tabbableOptions), w = Rn(o, l.tabbableOptions), C = u.length > 0 ? u[0] : void 0, P = u.length > 0 ? u[u.length - 1] : void 0, I = w.find(function(M) {
1350
+ var u = Pn(o, l.tabbableOptions), x = Rn(o, l.tabbableOptions), F = u.length > 0 ? u[0] : void 0, k = u.length > 0 ? u[u.length - 1] : void 0, P = x.find(function(M) {
1351
1351
  return ue(M);
1352
- }), S = w.slice().reverse().find(function(M) {
1352
+ }), S = x.slice().reverse().find(function(M) {
1353
1353
  return ue(M);
1354
1354
  }), R = !!u.find(function(M) {
1355
1355
  return ne(M) > 0;
@@ -1357,13 +1357,13 @@ var ut = {
1357
1357
  return {
1358
1358
  container: o,
1359
1359
  tabbableNodes: u,
1360
- focusableNodes: w,
1360
+ focusableNodes: x,
1361
1361
  /** True if at least one node with positive `tabindex` was found in this container. */
1362
1362
  posTabIndexesFound: R,
1363
1363
  /** First tabbable node in container, __tabindex__ order; `undefined` if none. */
1364
- firstTabbableNode: C,
1364
+ firstTabbableNode: F,
1365
1365
  /** Last tabbable node in container, __tabindex__ order; `undefined` if none. */
1366
- lastTabbableNode: P,
1366
+ lastTabbableNode: k,
1367
1367
  // NOTE: DOM order is NOT NECESSARILY "document position" order, but figuring that out
1368
1368
  // would require more than just https://developer.mozilla.org/en-US/docs/Web/API/Node/compareDocumentPosition
1369
1369
  // because that API doesn't work with Shadow DOM as well as it should (@see
@@ -1372,7 +1372,7 @@ var ut = {
1372
1372
  // "close enough most of the time" alternative for positive tabindexes which should generally
1373
1373
  // be avoided anyway...
1374
1374
  /** First tabbable node in container, __DOM__ order; `undefined` if none. */
1375
- firstDomTabbableNode: I,
1375
+ firstDomTabbableNode: P,
1376
1376
  /** Last tabbable node in container, __DOM__ order; `undefined` if none. */
1377
1377
  lastDomTabbableNode: S,
1378
1378
  /**
@@ -1384,12 +1384,12 @@ var ut = {
1384
1384
  * @returns {HTMLElement|undefined} The next tabbable node, if any.
1385
1385
  */
1386
1386
  nextTabbableNode: function(z) {
1387
- var L = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, _ = u.indexOf(z);
1388
- return _ < 0 ? L ? w.slice(w.indexOf(z) + 1).find(function(q) {
1389
- return ue(q);
1390
- }) : w.slice(0, w.indexOf(z)).reverse().find(function(q) {
1391
- return ue(q);
1392
- }) : u[_ + (L ? 1 : -1)];
1387
+ var L = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0, X = u.indexOf(z);
1388
+ return X < 0 ? L ? x.slice(x.indexOf(z) + 1).find(function(_) {
1389
+ return ue(_);
1390
+ }) : x.slice(0, x.indexOf(z)).reverse().find(function(_) {
1391
+ return ue(_);
1392
+ }) : u[X + (L ? 1 : -1)];
1393
1393
  }
1394
1394
  };
1395
1395
  }), a.tabbableGroups = a.containerGroups.filter(function(o) {
@@ -1407,7 +1407,7 @@ var ut = {
1407
1407
  }, c = function(o) {
1408
1408
  if (o !== !1 && o !== E(document)) {
1409
1409
  if (!o || !o.focus) {
1410
- c(x());
1410
+ c(w());
1411
1411
  return;
1412
1412
  }
1413
1413
  o.focus({
@@ -1420,39 +1420,39 @@ var ut = {
1420
1420
  });
1421
1421
  return u || (u === !1 ? !1 : o);
1422
1422
  }, d = function(o) {
1423
- var u = o.target, w = o.event, C = o.isBackward, P = C === void 0 ? !1 : C;
1424
- u = u || xe(w), T();
1425
- var I = null;
1423
+ var u = o.target, x = o.event, F = o.isBackward, k = F === void 0 ? !1 : F;
1424
+ u = u || xe(x), T();
1425
+ var P = null;
1426
1426
  if (a.tabbableGroups.length > 0) {
1427
- var S = v(u, w), R = S >= 0 ? a.containerGroups[S] : void 0;
1427
+ var S = p(u, x), R = S >= 0 ? a.containerGroups[S] : void 0;
1428
1428
  if (S < 0)
1429
- P ? I = a.tabbableGroups[a.tabbableGroups.length - 1].lastTabbableNode : I = a.tabbableGroups[0].firstTabbableNode;
1430
- else if (P) {
1429
+ k ? P = a.tabbableGroups[a.tabbableGroups.length - 1].lastTabbableNode : P = a.tabbableGroups[0].firstTabbableNode;
1430
+ else if (k) {
1431
1431
  var M = a.tabbableGroups.findIndex(function(ee) {
1432
1432
  var Z = ee.firstTabbableNode;
1433
1433
  return u === Z;
1434
1434
  });
1435
1435
  if (M < 0 && (R.container === u || Ke(u, l.tabbableOptions) && !ue(u, l.tabbableOptions) && !R.nextTabbableNode(u, !1)) && (M = S), M >= 0) {
1436
1436
  var z = M === 0 ? a.tabbableGroups.length - 1 : M - 1, L = a.tabbableGroups[z];
1437
- I = ne(u) >= 0 ? L.lastTabbableNode : L.lastDomTabbableNode;
1438
- } else ge(w) || (I = R.nextTabbableNode(u, !1));
1437
+ P = ne(u) >= 0 ? L.lastTabbableNode : L.lastDomTabbableNode;
1438
+ } else ge(x) || (P = R.nextTabbableNode(u, !1));
1439
1439
  } else {
1440
- var _ = a.tabbableGroups.findIndex(function(ee) {
1440
+ var X = a.tabbableGroups.findIndex(function(ee) {
1441
1441
  var Z = ee.lastTabbableNode;
1442
1442
  return u === Z;
1443
1443
  });
1444
- if (_ < 0 && (R.container === u || Ke(u, l.tabbableOptions) && !ue(u, l.tabbableOptions) && !R.nextTabbableNode(u)) && (_ = S), _ >= 0) {
1445
- var q = _ === a.tabbableGroups.length - 1 ? 0 : _ + 1, ye = a.tabbableGroups[q];
1446
- I = ne(u) >= 0 ? ye.firstTabbableNode : ye.firstDomTabbableNode;
1447
- } else ge(w) || (I = R.nextTabbableNode(u));
1444
+ if (X < 0 && (R.container === u || Ke(u, l.tabbableOptions) && !ue(u, l.tabbableOptions) && !R.nextTabbableNode(u)) && (X = S), X >= 0) {
1445
+ var _ = X === a.tabbableGroups.length - 1 ? 0 : X + 1, ye = a.tabbableGroups[_];
1446
+ P = ne(u) >= 0 ? ye.firstTabbableNode : ye.firstDomTabbableNode;
1447
+ } else ge(x) || (P = R.nextTabbableNode(u));
1448
1448
  }
1449
1449
  } else
1450
- I = b("fallbackFocus");
1451
- return I;
1450
+ P = b("fallbackFocus");
1451
+ return P;
1452
1452
  }, f = function(o) {
1453
1453
  var u = xe(o);
1454
- if (!(v(u, o) >= 0)) {
1455
- if (pe(l.clickOutsideDeactivates, o)) {
1454
+ if (!(p(u, o) >= 0)) {
1455
+ if (he(l.clickOutsideDeactivates, o)) {
1456
1456
  m.deactivate({
1457
1457
  // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,
1458
1458
  // which will result in the outside click setting focus to the node
@@ -1464,86 +1464,86 @@ var ut = {
1464
1464
  });
1465
1465
  return;
1466
1466
  }
1467
- pe(l.allowOutsideClick, o) || o.preventDefault();
1467
+ he(l.allowOutsideClick, o) || o.preventDefault();
1468
1468
  }
1469
- }, p = function(o) {
1470
- var u = xe(o), w = v(u, o) >= 0;
1471
- if (w || u instanceof Document)
1472
- w && (a.mostRecentlyFocusedNode = u);
1469
+ }, h = function(o) {
1470
+ var u = xe(o), x = p(u, o) >= 0;
1471
+ if (x || u instanceof Document)
1472
+ x && (a.mostRecentlyFocusedNode = u);
1473
1473
  else {
1474
1474
  o.stopImmediatePropagation();
1475
- var C, P = !0;
1475
+ var F, k = !0;
1476
1476
  if (a.mostRecentlyFocusedNode)
1477
1477
  if (ne(a.mostRecentlyFocusedNode) > 0) {
1478
- var I = v(a.mostRecentlyFocusedNode), S = a.containerGroups[I].tabbableNodes;
1478
+ var P = p(a.mostRecentlyFocusedNode), S = a.containerGroups[P].tabbableNodes;
1479
1479
  if (S.length > 0) {
1480
1480
  var R = S.findIndex(function(M) {
1481
1481
  return M === a.mostRecentlyFocusedNode;
1482
1482
  });
1483
- R >= 0 && (l.isKeyForward(a.recentNavEvent) ? R + 1 < S.length && (C = S[R + 1], P = !1) : R - 1 >= 0 && (C = S[R - 1], P = !1));
1483
+ R >= 0 && (l.isKeyForward(a.recentNavEvent) ? R + 1 < S.length && (F = S[R + 1], k = !1) : R - 1 >= 0 && (F = S[R - 1], k = !1));
1484
1484
  }
1485
1485
  } else
1486
1486
  a.containerGroups.some(function(M) {
1487
1487
  return M.tabbableNodes.some(function(z) {
1488
1488
  return ne(z) > 0;
1489
1489
  });
1490
- }) || (P = !1);
1490
+ }) || (k = !1);
1491
1491
  else
1492
- P = !1;
1493
- P && (C = d({
1492
+ k = !1;
1493
+ k && (F = d({
1494
1494
  // move FROM the MRU node, not event-related node (which will be the node that is
1495
1495
  // outside the trap causing the focus escape we're trying to fix)
1496
1496
  target: a.mostRecentlyFocusedNode,
1497
1497
  isBackward: l.isKeyBackward(a.recentNavEvent)
1498
- })), c(C || a.mostRecentlyFocusedNode || x());
1498
+ })), c(F || a.mostRecentlyFocusedNode || w());
1499
1499
  }
1500
1500
  a.recentNavEvent = void 0;
1501
1501
  }, y = function(o) {
1502
1502
  var u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1;
1503
1503
  a.recentNavEvent = o;
1504
- var w = d({
1504
+ var x = d({
1505
1505
  event: o,
1506
1506
  isBackward: u
1507
1507
  });
1508
- w && (ge(o) && o.preventDefault(), c(w));
1508
+ x && (ge(o) && o.preventDefault(), c(x));
1509
1509
  }, N = function(o) {
1510
1510
  (l.isKeyForward(o) || l.isKeyBackward(o)) && y(o, l.isKeyBackward(o));
1511
- }, h = function(o) {
1512
- Qn(o) && pe(l.escapeDeactivates, o) !== !1 && (o.preventDefault(), m.deactivate());
1513
- }, k = function(o) {
1511
+ }, v = function(o) {
1512
+ Qn(o) && he(l.escapeDeactivates, o) !== !1 && (o.preventDefault(), m.deactivate());
1513
+ }, I = function(o) {
1514
1514
  var u = xe(o);
1515
- v(u, o) >= 0 || pe(l.clickOutsideDeactivates, o) || pe(l.allowOutsideClick, o) || (o.preventDefault(), o.stopImmediatePropagation());
1515
+ p(u, o) >= 0 || he(l.clickOutsideDeactivates, o) || he(l.allowOutsideClick, o) || (o.preventDefault(), o.stopImmediatePropagation());
1516
1516
  }, A = function() {
1517
1517
  if (a.active)
1518
1518
  return ut.activateTrap(i, m), a.delayInitialFocusTimer = l.delayInitialFocus ? dt(function() {
1519
- c(x());
1520
- }) : c(x()), r.addEventListener("focusin", p, !0), r.addEventListener("mousedown", f, {
1519
+ c(w());
1520
+ }) : c(w()), r.addEventListener("focusin", h, !0), r.addEventListener("mousedown", f, {
1521
1521
  capture: !0,
1522
1522
  passive: !1
1523
1523
  }), r.addEventListener("touchstart", f, {
1524
1524
  capture: !0,
1525
1525
  passive: !1
1526
- }), r.addEventListener("click", k, {
1526
+ }), r.addEventListener("click", I, {
1527
1527
  capture: !0,
1528
1528
  passive: !1
1529
1529
  }), r.addEventListener("keydown", N, {
1530
1530
  capture: !0,
1531
1531
  passive: !1
1532
- }), r.addEventListener("keydown", h), m;
1532
+ }), r.addEventListener("keydown", v), m;
1533
1533
  }, H = function() {
1534
1534
  if (a.active)
1535
- return r.removeEventListener("focusin", p, !0), r.removeEventListener("mousedown", f, !0), r.removeEventListener("touchstart", f, !0), r.removeEventListener("click", k, !0), r.removeEventListener("keydown", N, !0), r.removeEventListener("keydown", h), m;
1535
+ return r.removeEventListener("focusin", h, !0), r.removeEventListener("mousedown", f, !0), r.removeEventListener("touchstart", f, !0), r.removeEventListener("click", I, !0), r.removeEventListener("keydown", N, !0), r.removeEventListener("keydown", v), m;
1536
1536
  }, K = function(o) {
1537
- var u = o.some(function(w) {
1538
- var C = Array.from(w.removedNodes);
1539
- return C.some(function(P) {
1540
- return P === a.mostRecentlyFocusedNode;
1537
+ var u = o.some(function(x) {
1538
+ var F = Array.from(x.removedNodes);
1539
+ return F.some(function(k) {
1540
+ return k === a.mostRecentlyFocusedNode;
1541
1541
  });
1542
1542
  });
1543
- u && c(x());
1544
- }, U = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(K) : void 0, W = function() {
1545
- U && (U.disconnect(), a.active && !a.paused && a.containers.map(function(o) {
1546
- U.observe(o, {
1543
+ u && c(w());
1544
+ }, W = typeof window < "u" && "MutationObserver" in window ? new MutationObserver(K) : void 0, U = function() {
1545
+ W && (W.disconnect(), a.active && !a.paused && a.containers.map(function(o) {
1546
+ W.observe(o, {
1547
1547
  subtree: !0,
1548
1548
  childList: !0
1549
1549
  });
@@ -1559,12 +1559,12 @@ var ut = {
1559
1559
  activate: function(o) {
1560
1560
  if (a.active)
1561
1561
  return this;
1562
- var u = s(o, "onActivate"), w = s(o, "onPostActivate"), C = s(o, "checkCanFocusTrap");
1563
- C || T(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation = r.activeElement, u == null || u();
1564
- var P = function() {
1565
- C && T(), A(), W(), w == null || w();
1562
+ var u = s(o, "onActivate"), x = s(o, "onPostActivate"), F = s(o, "checkCanFocusTrap");
1563
+ F || T(), a.active = !0, a.paused = !1, a.nodeFocusedBeforeActivation = r.activeElement, u == null || u();
1564
+ var k = function() {
1565
+ F && T(), A(), U(), x == null || x();
1566
1566
  };
1567
- return C ? (C(a.containers.concat()).then(P, P), this) : (P(), this);
1567
+ return F ? (F(a.containers.concat()).then(k, k), this) : (k(), this);
1568
1568
  },
1569
1569
  deactivate: function(o) {
1570
1570
  if (!a.active)
@@ -1574,37 +1574,51 @@ var ut = {
1574
1574
  onPostDeactivate: l.onPostDeactivate,
1575
1575
  checkCanReturnFocus: l.checkCanReturnFocus
1576
1576
  }, o);
1577
- clearTimeout(a.delayInitialFocusTimer), a.delayInitialFocusTimer = void 0, H(), a.active = !1, a.paused = !1, W(), ut.deactivateTrap(i, m);
1578
- var w = s(u, "onDeactivate"), C = s(u, "onPostDeactivate"), P = s(u, "checkCanReturnFocus"), I = s(u, "returnFocus", "returnFocusOnDeactivate");
1579
- w == null || w();
1577
+ clearTimeout(a.delayInitialFocusTimer), a.delayInitialFocusTimer = void 0, H(), a.active = !1, a.paused = !1, U(), ut.deactivateTrap(i, m);
1578
+ var x = s(u, "onDeactivate"), F = s(u, "onPostDeactivate"), k = s(u, "checkCanReturnFocus"), P = s(u, "returnFocus", "returnFocusOnDeactivate");
1579
+ x == null || x();
1580
1580
  var S = function() {
1581
1581
  dt(function() {
1582
- I && c(g(a.nodeFocusedBeforeActivation)), C == null || C();
1582
+ P && c(g(a.nodeFocusedBeforeActivation)), F == null || F();
1583
1583
  });
1584
1584
  };
1585
- return I && P ? (P(g(a.nodeFocusedBeforeActivation)).then(S, S), this) : (S(), this);
1585
+ return P && k ? (k(g(a.nodeFocusedBeforeActivation)).then(S, S), this) : (S(), this);
1586
1586
  },
1587
1587
  pause: function(o) {
1588
- if (a.paused || !a.active)
1589
- return this;
1590
- var u = s(o, "onPause"), w = s(o, "onPostPause");
1591
- return a.paused = !0, u == null || u(), H(), W(), w == null || w(), this;
1588
+ return a.active ? (a.manuallyPaused = !0, this._setPausedState(!0, o)) : this;
1592
1589
  },
1593
1590
  unpause: function(o) {
1594
- if (!a.paused || !a.active)
1595
- return this;
1596
- var u = s(o, "onUnpause"), w = s(o, "onPostUnpause");
1597
- return a.paused = !1, u == null || u(), T(), A(), W(), w == null || w(), this;
1591
+ return a.active ? (a.manuallyPaused = !1, i[i.length - 1] !== this ? this : this._setPausedState(!1, o)) : this;
1598
1592
  },
1599
1593
  updateContainerElements: function(o) {
1600
1594
  var u = [].concat(o).filter(Boolean);
1601
- return a.containers = u.map(function(w) {
1602
- return typeof w == "string" ? r.querySelector(w) : w;
1603
- }), a.active && T(), W(), this;
1595
+ return a.containers = u.map(function(x) {
1596
+ return typeof x == "string" ? r.querySelector(x) : x;
1597
+ }), a.active && T(), U(), this;
1604
1598
  }
1605
- }, m.updateContainerElements(e), m;
1599
+ }, Object.defineProperties(m, {
1600
+ _isManuallyPaused: {
1601
+ value: function() {
1602
+ return a.manuallyPaused;
1603
+ }
1604
+ },
1605
+ _setPausedState: {
1606
+ value: function(o, u) {
1607
+ if (a.paused === o)
1608
+ return this;
1609
+ if (a.paused = o, o) {
1610
+ var x = s(u, "onPause"), F = s(u, "onPostPause");
1611
+ x == null || x(), H(), U(), F == null || F();
1612
+ } else {
1613
+ var k = s(u, "onUnpause"), P = s(u, "onPostUnpause");
1614
+ k == null || k(), T(), A(), U(), P == null || P();
1615
+ }
1616
+ return this;
1617
+ }
1618
+ }
1619
+ }), m.updateContainerElements(e), m;
1606
1620
  };
1607
- function Ut(t, e, n) {
1621
+ function Wt(t, e, n) {
1608
1622
  let r = null;
1609
1623
  return t && (r = rr(t, {
1610
1624
  clickOutsideDeactivates: !e,
@@ -1618,9 +1632,9 @@ function Ut(t, e, n) {
1618
1632
  const ar = ({ modalContext: t, config: e, children: n }) => {
1619
1633
  const [r, i] = $(!1), l = j(null), [a, m] = $(null);
1620
1634
  function s() {
1621
- m(Ut(l.current, e == null ? void 0 : e.closeExplicitly, () => t.close())), i(!0);
1635
+ m(Wt(l.current, e == null ? void 0 : e.closeExplicitly, () => t.close())), i(!0);
1622
1636
  }
1623
- return D(() => () => a == null ? void 0 : a.deactivate(), [a]), /* @__PURE__ */ F("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ F(
1637
+ return D(() => () => a == null ? void 0 : a.deactivate(), [a]), /* @__PURE__ */ C("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ C(
1624
1638
  "div",
1625
1639
  {
1626
1640
  className: Se("im-modal-positioner flex min-h-full justify-center", {
@@ -1628,8 +1642,8 @@ const ar = ({ modalContext: t, config: e, children: n }) => {
1628
1642
  "items-center": e.position === "center",
1629
1643
  "items-end": e.position === "bottom"
1630
1644
  }),
1631
- children: /* @__PURE__ */ F(
1632
- Ue,
1645
+ children: /* @__PURE__ */ C(
1646
+ We,
1633
1647
  {
1634
1648
  as: "div",
1635
1649
  ref: l,
@@ -1639,29 +1653,25 @@ const ar = ({ modalContext: t, config: e, children: n }) => {
1639
1653
  leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
1640
1654
  afterEnter: s,
1641
1655
  afterLeave: t.afterLeave,
1642
- className: Se(
1643
- "im-modal-wrapper pointer-events-auto w-full transition duration-300 ease-in-out",
1644
- t.onTopOfStack ? "" : "blur-sm",
1645
- {
1646
- "sm:max-w-sm": e.maxWidth === "sm",
1647
- "sm:max-w-md": e.maxWidth === "md",
1648
- "sm:max-w-md md:max-w-lg": e.maxWidth === "lg",
1649
- "sm:max-w-md md:max-w-xl": e.maxWidth === "xl",
1650
- "sm:max-w-md md:max-w-xl lg:max-w-2xl": e.maxWidth === "2xl",
1651
- "sm:max-w-md md:max-w-xl lg:max-w-3xl": e.maxWidth === "3xl",
1652
- "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": e.maxWidth === "4xl",
1653
- "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": e.maxWidth === "5xl",
1654
- "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": e.maxWidth === "6xl",
1655
- "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": e.maxWidth === "7xl"
1656
- }
1657
- ),
1656
+ className: Se("im-modal-wrapper w-full transition duration-300 ease-in-out", t.onTopOfStack ? "" : "blur-sm", {
1657
+ "sm:max-w-sm": e.maxWidth === "sm",
1658
+ "sm:max-w-md": e.maxWidth === "md",
1659
+ "sm:max-w-md md:max-w-lg": e.maxWidth === "lg",
1660
+ "sm:max-w-md md:max-w-xl": e.maxWidth === "xl",
1661
+ "sm:max-w-md md:max-w-xl lg:max-w-2xl": e.maxWidth === "2xl",
1662
+ "sm:max-w-md md:max-w-xl lg:max-w-3xl": e.maxWidth === "3xl",
1663
+ "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": e.maxWidth === "4xl",
1664
+ "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": e.maxWidth === "5xl",
1665
+ "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": e.maxWidth === "6xl",
1666
+ "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": e.maxWidth === "7xl"
1667
+ }),
1658
1668
  children: /* @__PURE__ */ le(
1659
1669
  "div",
1660
1670
  {
1661
1671
  className: `im-modal-content relative ${e.paddingClasses} ${e.panelClasses}`,
1662
1672
  "data-inertiaui-modal-entered": r,
1663
1673
  children: [
1664
- e.closeButton && /* @__PURE__ */ F("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ F($t, { onClick: t.close }) }),
1674
+ e.closeButton && /* @__PURE__ */ C("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ C($t, { onClick: t.close }) }),
1665
1675
  typeof n == "function" ? n({ modalContext: t, config: e }) : n
1666
1676
  ]
1667
1677
  }
@@ -1673,17 +1683,17 @@ const ar = ({ modalContext: t, config: e, children: n }) => {
1673
1683
  }, ir = ({ modalContext: t, config: e, children: n }) => {
1674
1684
  const [r, i] = $(!1), l = j(null), [a, m] = $(null);
1675
1685
  function s() {
1676
- m(Ut(l.current, e == null ? void 0 : e.closeExplicitly, () => t.close())), i(!0);
1686
+ m(Wt(l.current, e == null ? void 0 : e.closeExplicitly, () => t.close())), i(!0);
1677
1687
  }
1678
- return D(() => () => a == null ? void 0 : a.deactivate(), [a]), /* @__PURE__ */ F("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ F(
1688
+ return D(() => () => a == null ? void 0 : a.deactivate(), [a]), /* @__PURE__ */ C("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ C(
1679
1689
  "div",
1680
1690
  {
1681
1691
  className: Se("im-slideover-positioner flex min-h-full items-center", {
1682
1692
  "justify-start rtl:justify-end": (e == null ? void 0 : e.position) === "left",
1683
1693
  "justify-end rtl:justify-start": (e == null ? void 0 : e.position) === "right"
1684
1694
  }),
1685
- children: /* @__PURE__ */ F(
1686
- Ue,
1695
+ children: /* @__PURE__ */ C(
1696
+ We,
1687
1697
  {
1688
1698
  as: "div",
1689
1699
  ref: l,
@@ -1693,29 +1703,25 @@ const ar = ({ modalContext: t, config: e, children: n }) => {
1693
1703
  leaveTo: `opacity-0 ${e.position === "left" ? "-translate-x-full" : "translate-x-full"}`,
1694
1704
  afterEnter: s,
1695
1705
  afterLeave: t.afterLeave,
1696
- className: Se(
1697
- "im-slideover-wrapper pointer-events-auto w-full transition duration-300 ease-in-out",
1698
- t.onTopOfStack ? "" : "blur-sm",
1699
- {
1700
- "sm:max-w-sm": e.maxWidth === "sm",
1701
- "sm:max-w-md": e.maxWidth === "md",
1702
- "sm:max-w-md md:max-w-lg": e.maxWidth === "lg",
1703
- "sm:max-w-md md:max-w-xl": e.maxWidth === "xl",
1704
- "sm:max-w-md md:max-w-xl lg:max-w-2xl": e.maxWidth === "2xl",
1705
- "sm:max-w-md md:max-w-xl lg:max-w-3xl": e.maxWidth === "3xl",
1706
- "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": e.maxWidth === "4xl",
1707
- "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": e.maxWidth === "5xl",
1708
- "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": e.maxWidth === "6xl",
1709
- "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": e.maxWidth === "7xl"
1710
- }
1711
- ),
1706
+ className: Se("im-slideover-wrapper w-full transition duration-300 ease-in-out", t.onTopOfStack ? "" : "blur-sm", {
1707
+ "sm:max-w-sm": e.maxWidth === "sm",
1708
+ "sm:max-w-md": e.maxWidth === "md",
1709
+ "sm:max-w-md md:max-w-lg": e.maxWidth === "lg",
1710
+ "sm:max-w-md md:max-w-xl": e.maxWidth === "xl",
1711
+ "sm:max-w-md md:max-w-xl lg:max-w-2xl": e.maxWidth === "2xl",
1712
+ "sm:max-w-md md:max-w-xl lg:max-w-3xl": e.maxWidth === "3xl",
1713
+ "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-4xl": e.maxWidth === "4xl",
1714
+ "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl": e.maxWidth === "5xl",
1715
+ "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": e.maxWidth === "6xl",
1716
+ "sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": e.maxWidth === "7xl"
1717
+ }),
1712
1718
  children: /* @__PURE__ */ le(
1713
1719
  "div",
1714
1720
  {
1715
1721
  className: `im-slideover-content relative ${e.paddingClasses} ${e.panelClasses}`,
1716
1722
  "data-inertiaui-modal-entered": r,
1717
1723
  children: [
1718
- e.closeButton && /* @__PURE__ */ F("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ F($t, { onClick: t.close }) }),
1724
+ e.closeButton && /* @__PURE__ */ C("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ C($t, { onClick: t.close }) }),
1719
1725
  typeof n == "function" ? n({ modalContext: t, config: e }) : n
1720
1726
  ]
1721
1727
  }
@@ -1725,12 +1731,12 @@ const ar = ({ modalContext: t, config: e, children: n }) => {
1725
1731
  }
1726
1732
  ) });
1727
1733
  }, lr = Ze(({ name: t, children: e, onFocus: n = null, onBlur: r = null, onClose: i = null, onSuccess: l = null, onAfterLeave: a = null, ...m }, s) => {
1728
- const v = (x) => typeof e == "function" ? e(x) : e, b = j(null);
1734
+ const p = (w) => typeof e == "function" ? e(w) : e, b = j(null);
1729
1735
  return D(() => {
1730
- var x;
1731
- if (((x = b == null ? void 0 : b.current) == null ? void 0 : x.index) === 0)
1736
+ var w;
1737
+ if (((w = b == null ? void 0 : b.current) == null ? void 0 : w.index) === 0)
1732
1738
  return nt.prepare(), () => nt.cleanup();
1733
- }, [b]), ct(s, () => b.current, [b]), /* @__PURE__ */ F(
1739
+ }, [b]), ct(s, () => b.current, [b]), /* @__PURE__ */ C(
1734
1740
  bt,
1735
1741
  {
1736
1742
  ref: b,
@@ -1741,21 +1747,21 @@ const ar = ({ modalContext: t, config: e, children: n }) => {
1741
1747
  onSuccess: l,
1742
1748
  ...m,
1743
1749
  children: ({
1744
- afterLeave: x,
1750
+ afterLeave: w,
1745
1751
  close: T,
1746
1752
  config: E,
1747
1753
  emit: c,
1748
1754
  getChildModal: g,
1749
1755
  getParentModal: d,
1750
1756
  id: f,
1751
- index: p,
1757
+ index: h,
1752
1758
  isOpen: y,
1753
1759
  modalContext: N,
1754
- onTopOfStack: h,
1755
- reload: k,
1760
+ onTopOfStack: v,
1761
+ reload: I,
1756
1762
  setOpen: A,
1757
1763
  shouldRender: H
1758
- }) => /* @__PURE__ */ F(
1764
+ }) => /* @__PURE__ */ C(
1759
1765
  Kn,
1760
1766
  {
1761
1767
  appear: !0,
@@ -1766,10 +1772,10 @@ const ar = ({ modalContext: t, config: e, children: n }) => {
1766
1772
  {
1767
1773
  className: "im-dialog relative z-20",
1768
1774
  "data-inertiaui-modal-id": f,
1769
- "data-inertiaui-modal-index": p,
1775
+ "data-inertiaui-modal-index": h,
1770
1776
  children: [
1771
- p === 0 ? /* @__PURE__ */ F(
1772
- Ue,
1777
+ h === 0 ? /* @__PURE__ */ C(
1778
+ We,
1773
1779
  {
1774
1780
  enter: "transition transform ease-in-out duration-300",
1775
1781
  enterFrom: "opacity-0",
@@ -1777,56 +1783,56 @@ const ar = ({ modalContext: t, config: e, children: n }) => {
1777
1783
  leave: "transition transform ease-in-out duration-300",
1778
1784
  leaveFrom: "opacity-100",
1779
1785
  leaveTo: "opacity-0",
1780
- children: h ? /* @__PURE__ */ F(
1786
+ children: v ? /* @__PURE__ */ C(
1781
1787
  "div",
1782
1788
  {
1783
1789
  className: "im-backdrop fixed inset-0 z-30 bg-black/75",
1784
1790
  "aria-hidden": "true"
1785
1791
  }
1786
- ) : /* @__PURE__ */ F("div", {})
1792
+ ) : /* @__PURE__ */ C("div", {})
1787
1793
  }
1788
1794
  ) : null,
1789
- p > 0 && h ? /* @__PURE__ */ F("div", { className: "im-backdrop fixed inset-0 z-30 bg-black/75" }) : null,
1790
- E.slideover ? /* @__PURE__ */ F(
1795
+ h > 0 && v ? /* @__PURE__ */ C("div", { className: "im-backdrop fixed inset-0 z-30 bg-black/75" }) : null,
1796
+ E.slideover ? /* @__PURE__ */ C(
1791
1797
  ir,
1792
1798
  {
1793
1799
  modalContext: N,
1794
1800
  config: E,
1795
- children: v({
1796
- afterLeave: x,
1801
+ children: p({
1802
+ afterLeave: w,
1797
1803
  close: T,
1798
1804
  config: E,
1799
1805
  emit: c,
1800
1806
  getChildModal: g,
1801
1807
  getParentModal: d,
1802
1808
  id: f,
1803
- index: p,
1809
+ index: h,
1804
1810
  isOpen: y,
1805
1811
  modalContext: N,
1806
- onTopOfStack: h,
1807
- reload: k,
1812
+ onTopOfStack: v,
1813
+ reload: I,
1808
1814
  setOpen: A,
1809
1815
  shouldRender: H
1810
1816
  })
1811
1817
  }
1812
- ) : /* @__PURE__ */ F(
1818
+ ) : /* @__PURE__ */ C(
1813
1819
  ar,
1814
1820
  {
1815
1821
  modalContext: N,
1816
1822
  config: E,
1817
- children: v({
1818
- afterLeave: x,
1823
+ children: p({
1824
+ afterLeave: w,
1819
1825
  close: T,
1820
1826
  config: E,
1821
1827
  emit: c,
1822
1828
  getChildModal: g,
1823
1829
  getParentModal: d,
1824
1830
  id: f,
1825
- index: p,
1831
+ index: h,
1826
1832
  isOpen: y,
1827
1833
  modalContext: N,
1828
- onTopOfStack: h,
1829
- reload: k,
1834
+ onTopOfStack: v,
1835
+ reload: I,
1830
1836
  setOpen: A,
1831
1837
  shouldRender: H
1832
1838
  })
@@ -1851,47 +1857,47 @@ const br = ({
1851
1857
  onAfterLeave: a = null,
1852
1858
  onBlur: m = null,
1853
1859
  onClose: s = null,
1854
- onError: v = null,
1860
+ onError: p = null,
1855
1861
  onFocus: b = null,
1856
- onStart: x = null,
1862
+ onStart: w = null,
1857
1863
  onSuccess: T = null,
1858
1864
  navigate: E = null,
1859
1865
  children: c,
1860
1866
  ...g
1861
1867
  }) => {
1862
- const [d, f] = $(!1), [p, y] = $(null), { stack: N, visit: h } = Ae(), k = Y(() => E ?? Je("navigate"), [E]), A = {}, H = {};
1868
+ const [d, f] = $(!1), [h, y] = $(null), { stack: N, visit: v } = Ae(), I = Y(() => E ?? Je("navigate"), [E]), A = {}, H = {};
1863
1869
  Object.keys(g).forEach((u) => {
1864
1870
  rt.includes(u) || (u.startsWith("on") && typeof g[u] == "function" ? u.toLowerCase() in window ? A[u] = g[u] : H[u] = g[u] : A[u] = g[u]);
1865
1871
  });
1866
- const [K, U] = $(!1);
1872
+ const [K, W] = $(!1);
1867
1873
  D(() => {
1868
- p && (p.onTopOfStack && K ? b == null || b() : !p.onTopOfStack && !K && (m == null || m()), U(!p.onTopOfStack));
1874
+ h && (h.onTopOfStack && K ? b == null || b() : !h.onTopOfStack && !K && (m == null || m()), W(!h.onTopOfStack));
1869
1875
  }, [N]);
1870
- const W = V(() => {
1876
+ const U = V(() => {
1871
1877
  s == null || s();
1872
1878
  }, [s]), O = V(() => {
1873
1879
  y(null), a == null || a();
1874
1880
  }, [a]), o = V(
1875
1881
  (u) => {
1876
- u == null || u.preventDefault(), !d && (t.startsWith("#") || (f(!0), x == null || x()), h(
1882
+ u == null || u.preventDefault(), !d && (t.startsWith("#") || (f(!0), w == null || w()), v(
1877
1883
  t,
1878
1884
  e,
1879
1885
  n,
1880
1886
  i,
1881
1887
  Gt(ft(g, rt)),
1882
- () => W(N.length),
1888
+ () => U(N.length),
1883
1889
  O,
1884
1890
  l,
1885
- k
1886
- ).then((w) => {
1887
- y(w), w.registerEventListenersFromProps(H), T == null || T();
1888
- }).catch((w) => {
1889
- console.error(w), v == null || v(w);
1891
+ I
1892
+ ).then((x) => {
1893
+ y(x), x.registerEventListenersFromProps(H), T == null || T();
1894
+ }).catch((x) => {
1895
+ console.error(x), p == null || p(x);
1890
1896
  }).finally(() => f(!1)));
1891
1897
  },
1892
- [t, e, n, i, l, g, W, O]
1898
+ [t, e, n, i, l, g, U, O]
1893
1899
  );
1894
- return /* @__PURE__ */ F(
1900
+ return /* @__PURE__ */ C(
1895
1901
  r,
1896
1902
  {
1897
1903
  ...A,
@@ -1902,7 +1908,7 @@ const br = ({
1902
1908
  );
1903
1909
  };
1904
1910
  function gr() {
1905
- return Ae().stack[ht()] ?? null;
1911
+ return Ae().stack[vt()] ?? null;
1906
1912
  }
1907
1913
  const yr = (t) => (e) => (e.default.layout = (n) => Ne(t, {}, n), e);
1908
1914
  export {
@@ -1913,11 +1919,11 @@ export {
1913
1919
  Yt as ModalStackProvider,
1914
1920
  Je as getConfig,
1915
1921
  Jt as initFromPageProps,
1916
- pr as putConfig,
1917
- hr as renderApp,
1922
+ hr as putConfig,
1923
+ vr as renderApp,
1918
1924
  mr as resetConfig,
1919
1925
  yr as setPageLayout,
1920
1926
  gr as useModal,
1921
- ht as useModalIndex,
1927
+ vt as useModalIndex,
1922
1928
  Ae as useModalStack
1923
1929
  };