@inertiaui/modal-react 0.19.5 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/inertiaui-modal.js +412 -423
- package/dist/inertiaui-modal.umd.cjs +3 -3
- package/package.json +1 -1
- package/src/ModalRoot.jsx +12 -4
- package/src/helpers.js +2 -2
package/dist/inertiaui-modal.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var q = (e, t, n) =>
|
|
4
|
-
import * as
|
|
5
|
-
import E, { createContext as H, useContext as R, useEffect as M, useRef as O, useState as S, createElement as
|
|
6
|
-
import { jsxs as se, Fragment as
|
|
7
|
-
import
|
|
8
|
-
import { router as
|
|
9
|
-
import { mergeDataIntoQueryString as
|
|
10
|
-
import { createPortal as
|
|
11
|
-
const
|
|
1
|
+
var mn = Object.defineProperty;
|
|
2
|
+
var pn = (e, t, n) => t in e ? mn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var q = (e, t, n) => pn(e, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
+
import * as $e from "react";
|
|
5
|
+
import E, { createContext as H, useContext as R, useEffect as M, useRef as O, useState as S, createElement as De, useMemo as C, forwardRef as dt, useImperativeHandle as Ft, useLayoutEffect as hn, useCallback as Y, Fragment as G, isValidElement as vn, cloneElement as gn, useId as Me, useSyncExternalStore as wn, useReducer as xn, createRef as yn } from "react";
|
|
6
|
+
import { jsxs as se, Fragment as ft, jsx as T } from "react/jsx-runtime";
|
|
7
|
+
import je from "axios";
|
|
8
|
+
import { router as be, usePage as bn } from "@inertiajs/react";
|
|
9
|
+
import { mergeDataIntoQueryString as En } from "@inertiajs/core";
|
|
10
|
+
import { createPortal as $n } from "react-dom";
|
|
11
|
+
const we = {
|
|
12
12
|
type: "modal",
|
|
13
13
|
navigate: !1,
|
|
14
14
|
modal: {
|
|
@@ -28,20 +28,20 @@ const ge = {
|
|
|
28
28
|
position: "right"
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
class
|
|
31
|
+
class Tn {
|
|
32
32
|
constructor() {
|
|
33
33
|
this.config = {}, this.reset();
|
|
34
34
|
}
|
|
35
35
|
reset() {
|
|
36
|
-
this.config = JSON.parse(JSON.stringify(
|
|
36
|
+
this.config = JSON.parse(JSON.stringify(we));
|
|
37
37
|
}
|
|
38
38
|
put(t, n) {
|
|
39
39
|
if (typeof t == "object") {
|
|
40
40
|
this.config = {
|
|
41
|
-
type: t.type ??
|
|
42
|
-
navigate: t.navigate ??
|
|
43
|
-
modal: { ...
|
|
44
|
-
slideover: { ...
|
|
41
|
+
type: t.type ?? we.type,
|
|
42
|
+
navigate: t.navigate ?? we.navigate,
|
|
43
|
+
modal: { ...we.modal, ...t.modal ?? {} },
|
|
44
|
+
slideover: { ...we.slideover, ...t.slideover ?? {} }
|
|
45
45
|
};
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
@@ -64,19 +64,21 @@ class On {
|
|
|
64
64
|
return r;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
const
|
|
68
|
-
function
|
|
67
|
+
const Be = new Tn(), Sl = () => Be.reset(), Fl = (e, t) => Be.put(e, t), mt = (e) => Be.get(e), ce = (e, t) => Be.get(e ? `slideover.${t}` : `modal.${t}`);
|
|
68
|
+
function On(e, t) {
|
|
69
69
|
return e = typeof e == "string" ? new URL(e, window.location.origin) : e, t = typeof t == "string" ? new URL(t, window.location.origin) : t, `${e.origin}${e.pathname}` == `${t.origin}${t.pathname}`;
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function tt(e = "inertiaui_modal_") {
|
|
72
72
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `${e}${crypto.randomUUID()}` : `${e}${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
function fe(e) {
|
|
75
|
+
return typeof e == "string" ? e.toLowerCase() : e;
|
|
76
|
+
}
|
|
77
|
+
function Pn(e, t, n = !1) {
|
|
78
|
+
return n && (t = t.map(fe)), Array.isArray(e) ? e.filter((r) => !t.includes(n ? fe(r) : r)) : Object.keys(e).reduce((r, l) => (t.includes(n ? fe(l) : l) || (r[l] = e[l]), r), {});
|
|
77
79
|
}
|
|
78
|
-
function
|
|
79
|
-
return Array.isArray(e) ? e.filter((
|
|
80
|
+
function Ct(e, t, n = !1) {
|
|
81
|
+
return n && (t = t.map(fe)), Array.isArray(e) ? e.filter((r) => t.includes(n ? fe(r) : r)) : Object.keys(e).reduce((r, l) => (t.includes(n ? fe(l) : l) && (r[l] = e[l]), r), {});
|
|
80
82
|
}
|
|
81
83
|
function Mn(e) {
|
|
82
84
|
return Array.isArray(e) ? e.filter((t) => t !== null) : Object.keys(e).reduce((t, n) => (n in e && e[n] !== null && (t[n] = e[n]), t), {});
|
|
@@ -95,50 +97,29 @@ function Ln(e, t = 3, n = 10) {
|
|
|
95
97
|
}, n);
|
|
96
98
|
});
|
|
97
99
|
}
|
|
98
|
-
function
|
|
100
|
+
function xe(e) {
|
|
99
101
|
return e ? (e = e.replace(/_/g, "-"), e = e.replace(/-+/g, "-"), /[A-Z]/.test(e) ? (e = e.replace(/\s+/g, "").replace(/_/g, "").replace(/(?:^|\s|-)+([A-Za-z])/g, (t, n) => n.toUpperCase()), e = e.replace(/(.)(?=[A-Z])/g, "$1-"), e.toLowerCase()) : e) : "";
|
|
100
102
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
[
|
|
105
|
-
"name",
|
|
106
|
-
"slideover",
|
|
107
|
-
"closeButton",
|
|
108
|
-
"close-button",
|
|
109
|
-
"closeExplicitly",
|
|
110
|
-
"close-explicitly",
|
|
111
|
-
"maxWidth",
|
|
112
|
-
"max-width",
|
|
113
|
-
"paddingClasses",
|
|
114
|
-
"padding-classes",
|
|
115
|
-
"panelClasses",
|
|
116
|
-
"panel-classes",
|
|
117
|
-
"position"
|
|
118
|
-
],
|
|
119
|
-
!0
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
const Be = H(null);
|
|
123
|
-
Be.displayName = "ModalStackContext";
|
|
124
|
-
let At = null, kt = null, $e = null, rt = null, Ie = [], de = {};
|
|
103
|
+
const Xe = H(null);
|
|
104
|
+
Xe.displayName = "ModalStackContext";
|
|
105
|
+
let Nt = null, At = null, Te = null, lt = null, Re = [], de = {};
|
|
125
106
|
const Sn = ({ children: e }) => {
|
|
126
|
-
const [t, n] = S([]), [r, l] = S({}), o = (
|
|
107
|
+
const [t, n] = S([]), [r, l] = S({}), o = (g) => {
|
|
127
108
|
n((u) => {
|
|
128
|
-
const m =
|
|
109
|
+
const m = g([...u]), p = (v) => {
|
|
129
110
|
var y;
|
|
130
|
-
return m.length < 2 ? !0 : ((y = m.map((h) => ({ id: h.id, shouldRender: h.shouldRender })).reverse().find((h) => h.shouldRender)) == null ? void 0 : y.id) ===
|
|
111
|
+
return m.length < 2 ? !0 : ((y = m.map((h) => ({ id: h.id, shouldRender: h.shouldRender })).reverse().find((h) => h.shouldRender)) == null ? void 0 : y.id) === v;
|
|
131
112
|
};
|
|
132
|
-
return m.forEach((
|
|
133
|
-
m[y].onTopOfStack = p(
|
|
113
|
+
return m.forEach((v, y) => {
|
|
114
|
+
m[y].onTopOfStack = p(v.id), m[y].getParentModal = () => y < 1 ? null : m.slice(0, y).reverse().find((h) => h.isOpen), m[y].getChildModal = () => y === m.length - 1 ? null : m.slice(y + 1).find((h) => h.isOpen);
|
|
134
115
|
}), m;
|
|
135
116
|
});
|
|
136
117
|
};
|
|
137
118
|
M(() => {
|
|
138
|
-
|
|
119
|
+
Re = t;
|
|
139
120
|
}, [t]);
|
|
140
121
|
class a {
|
|
141
|
-
constructor(u, m, p,
|
|
122
|
+
constructor(u, m, p, v, y) {
|
|
142
123
|
q(this, "show", () => {
|
|
143
124
|
o(
|
|
144
125
|
(u) => u.map((m) => (m.id === this.id && !m.isOpen && (m.isOpen = !0, m.shouldRender = !0), m))
|
|
@@ -151,8 +132,8 @@ const Sn = ({ children: e }) => {
|
|
|
151
132
|
o(
|
|
152
133
|
(u) => u.map((m) => {
|
|
153
134
|
var p;
|
|
154
|
-
return m.id === this.id && m.isOpen && (Object.keys(m.listeners).forEach((
|
|
155
|
-
m.off(
|
|
135
|
+
return m.id === this.id && m.isOpen && (Object.keys(m.listeners).forEach((v) => {
|
|
136
|
+
m.off(v);
|
|
156
137
|
}), m.isOpen = !1, (p = m.onCloseCallback) == null || p.call(m)), m;
|
|
157
138
|
})
|
|
158
139
|
);
|
|
@@ -160,59 +141,67 @@ const Sn = ({ children: e }) => {
|
|
|
160
141
|
q(this, "afterLeave", () => {
|
|
161
142
|
this.isOpen || o((u) => {
|
|
162
143
|
const m = u.map((p) => {
|
|
163
|
-
var
|
|
164
|
-
return p.id === this.id && !p.isOpen && (p.shouldRender = !1, (
|
|
144
|
+
var v;
|
|
145
|
+
return p.id === this.id && !p.isOpen && (p.shouldRender = !1, (v = p.afterLeaveCallback) == null || v.call(p), p.afterLeaveCallback = null), p;
|
|
165
146
|
});
|
|
166
147
|
return this.index === 0 ? [] : m;
|
|
167
148
|
});
|
|
168
149
|
});
|
|
169
150
|
q(this, "on", (u, m) => {
|
|
170
|
-
u =
|
|
151
|
+
u = xe(u), this.listeners[u] = this.listeners[u] ?? [], this.listeners[u].push(m);
|
|
171
152
|
});
|
|
172
153
|
q(this, "off", (u, m) => {
|
|
173
154
|
var p;
|
|
174
|
-
u =
|
|
155
|
+
u = xe(u), m ? this.listeners[u] = ((p = this.listeners[u]) == null ? void 0 : p.filter((v) => v !== m)) ?? [] : delete this.listeners[u];
|
|
175
156
|
});
|
|
176
157
|
q(this, "emit", (u, ...m) => {
|
|
177
158
|
var p;
|
|
178
|
-
(p = this.listeners[
|
|
159
|
+
(p = this.listeners[xe(u)]) == null || p.forEach((v) => v(...m));
|
|
179
160
|
});
|
|
180
161
|
q(this, "registerEventListenersFromProps", (u) => {
|
|
181
162
|
const m = [];
|
|
182
163
|
return Object.keys(u).filter((p) => p.startsWith("on")).forEach((p) => {
|
|
183
|
-
const
|
|
184
|
-
this.on(
|
|
164
|
+
const v = xe(p).replace(/^on-/, "");
|
|
165
|
+
this.on(v, u[p]), m.push(() => this.off(v, u[p]));
|
|
185
166
|
}), () => m.forEach((p) => p());
|
|
186
167
|
});
|
|
187
168
|
q(this, "reload", (u = {}) => {
|
|
188
|
-
var
|
|
169
|
+
var y;
|
|
189
170
|
let m = Object.keys(this.response.props);
|
|
190
|
-
u.only && (m =
|
|
171
|
+
if (u.only && (m = Ct(m, u.only)), u.except && (m = Pn(m, u.except)), !((y = this.response) != null && y.url))
|
|
172
|
+
return;
|
|
173
|
+
const p = (u.method ?? "get").toLowerCase(), v = u.data ?? {};
|
|
174
|
+
je({
|
|
175
|
+
url: this.response.url,
|
|
176
|
+
method: p,
|
|
177
|
+
data: p === "get" ? {} : v,
|
|
178
|
+
params: p === "get" ? v : {},
|
|
191
179
|
headers: {
|
|
180
|
+
...u.headers ?? {},
|
|
192
181
|
Accept: "text/html, application/xhtml+xml",
|
|
193
182
|
"X-Inertia": !0,
|
|
194
183
|
"X-Inertia-Partial-Component": this.response.component,
|
|
195
184
|
"X-Inertia-Version": this.response.version,
|
|
196
185
|
"X-Inertia-Partial-Data": m.join(","),
|
|
197
|
-
"X-InertiaUI-Modal":
|
|
186
|
+
"X-InertiaUI-Modal": tt(),
|
|
198
187
|
"X-InertiaUI-Modal-Use-Router": 0,
|
|
199
|
-
"X-InertiaUI-Modal-Base-Url":
|
|
188
|
+
"X-InertiaUI-Modal-Base-Url": Te
|
|
200
189
|
}
|
|
201
|
-
}).then((
|
|
202
|
-
this.updateProps(
|
|
190
|
+
}).then((h) => {
|
|
191
|
+
this.updateProps(h.data.props);
|
|
203
192
|
});
|
|
204
193
|
});
|
|
205
194
|
q(this, "updateProps", (u) => {
|
|
206
|
-
Object.assign(this.props,
|
|
195
|
+
Object.assign(this.props, u), o((m) => m);
|
|
207
196
|
});
|
|
208
|
-
if (this.id = m.id ??
|
|
197
|
+
if (this.id = m.id ?? tt(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = u, this.props = m.props, this.response = m, this.config = p ?? {}, this.onCloseCallback = v, this.afterLeaveCallback = y, de[this.id]) {
|
|
209
198
|
this.config = {
|
|
210
199
|
...this.config,
|
|
211
200
|
...de[this.id].config ?? {}
|
|
212
201
|
};
|
|
213
202
|
const h = de[this.id].onClose, $ = de[this.id].onAfterLeave;
|
|
214
|
-
h && (this.onCloseCallback =
|
|
215
|
-
|
|
203
|
+
h && (this.onCloseCallback = v ? () => {
|
|
204
|
+
v(), h();
|
|
216
205
|
} : h), $ && (this.afterLeaveCallback = y ? () => {
|
|
217
206
|
y(), $();
|
|
218
207
|
} : $), delete de[this.id];
|
|
@@ -223,18 +212,18 @@ const Sn = ({ children: e }) => {
|
|
|
223
212
|
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)}`;
|
|
224
213
|
}
|
|
225
214
|
}
|
|
226
|
-
const s = (
|
|
227
|
-
const y = new a(
|
|
215
|
+
const s = (g, u = {}, m = null, p = null) => At(g.component).then((v) => i(v, g, u, m, p)), i = (g, u, m, p, v) => {
|
|
216
|
+
const y = new a(g, u, m, p, v);
|
|
228
217
|
return y.index = t.length, o((h) => [...h, y]), y.show(), y;
|
|
229
218
|
};
|
|
230
|
-
function c(
|
|
231
|
-
if (!r[
|
|
232
|
-
throw new Error(`The local modal "${
|
|
233
|
-
const
|
|
234
|
-
return
|
|
219
|
+
function c(g, u, m, p) {
|
|
220
|
+
if (!r[g])
|
|
221
|
+
throw new Error(`The local modal "${g}" has not been registered.`);
|
|
222
|
+
const v = i(null, {}, u, m, p);
|
|
223
|
+
return v.name = g, r[g].callback(v), v;
|
|
235
224
|
}
|
|
236
|
-
const f = (
|
|
237
|
-
|
|
225
|
+
const f = (g, u = {}) => x(
|
|
226
|
+
g,
|
|
238
227
|
u.method ?? "get",
|
|
239
228
|
u.data ?? {},
|
|
240
229
|
u.headers ?? {},
|
|
@@ -242,37 +231,37 @@ const Sn = ({ children: e }) => {
|
|
|
242
231
|
u.onClose,
|
|
243
232
|
u.onAfterLeave,
|
|
244
233
|
u.queryStringArrayFormat ?? "brackets",
|
|
245
|
-
u.navigate ??
|
|
234
|
+
u.navigate ?? mt("navigate")
|
|
246
235
|
).then((m) => {
|
|
247
236
|
const p = u.listeners ?? {};
|
|
248
|
-
return Object.keys(p).forEach((
|
|
249
|
-
const y =
|
|
250
|
-
m.on(y, p[
|
|
237
|
+
return Object.keys(p).forEach((v) => {
|
|
238
|
+
const y = xe(v);
|
|
239
|
+
m.on(y, p[v]);
|
|
251
240
|
}), m;
|
|
252
|
-
}), x = (
|
|
253
|
-
const j =
|
|
241
|
+
}), x = (g, u, m = {}, p = {}, v = {}, y = null, h = null, $ = "brackets", F = !1) => {
|
|
242
|
+
const j = tt();
|
|
254
243
|
return new Promise((_, A) => {
|
|
255
|
-
if (
|
|
256
|
-
_(c(
|
|
244
|
+
if (g.startsWith("#")) {
|
|
245
|
+
_(c(g.substring(1), v, y, h));
|
|
257
246
|
return;
|
|
258
247
|
}
|
|
259
|
-
const [U, B] =
|
|
248
|
+
const [U, B] = En(u, g || "", m, $);
|
|
260
249
|
let X = F && t.length === 0;
|
|
261
|
-
if (t.length === 0 && (
|
|
250
|
+
if (t.length === 0 && (Te = typeof window < "u" ? window.location.href : ""), p = {
|
|
262
251
|
...p,
|
|
263
252
|
Accept: "text/html, application/xhtml+xml",
|
|
264
253
|
"X-Requested-With": "XMLHttpRequest",
|
|
265
254
|
"X-Inertia": !0,
|
|
266
|
-
"X-Inertia-Version":
|
|
255
|
+
"X-Inertia-Version": Nt,
|
|
267
256
|
"X-InertiaUI-Modal": j,
|
|
268
257
|
"X-InertiaUI-Modal-Use-Router": X ? 1 : 0,
|
|
269
|
-
"X-InertiaUI-Modal-Base-Url":
|
|
258
|
+
"X-InertiaUI-Modal-Base-Url": Te
|
|
270
259
|
}, X)
|
|
271
|
-
return
|
|
272
|
-
config:
|
|
260
|
+
return lt = null, de[j] = {
|
|
261
|
+
config: v,
|
|
273
262
|
onClose: y,
|
|
274
263
|
onAfterLeave: h
|
|
275
|
-
},
|
|
264
|
+
}, be.visit(U, {
|
|
276
265
|
method: u,
|
|
277
266
|
data: B,
|
|
278
267
|
headers: p,
|
|
@@ -280,15 +269,15 @@ const Sn = ({ children: e }) => {
|
|
|
280
269
|
preserveState: !0,
|
|
281
270
|
onError: A,
|
|
282
271
|
onFinish: () => {
|
|
283
|
-
Ln(() =>
|
|
272
|
+
Ln(() => lt).then(_);
|
|
284
273
|
}
|
|
285
274
|
});
|
|
286
|
-
|
|
275
|
+
je({
|
|
287
276
|
url: U,
|
|
288
277
|
method: u,
|
|
289
278
|
data: B,
|
|
290
279
|
headers: p
|
|
291
|
-
}).then((P) => _(s(P.data,
|
|
280
|
+
}).then((P) => _(s(P.data, v, y, h))).catch((P) => {
|
|
292
281
|
A(P);
|
|
293
282
|
});
|
|
294
283
|
});
|
|
@@ -297,98 +286,98 @@ const Sn = ({ children: e }) => {
|
|
|
297
286
|
localModals: r,
|
|
298
287
|
push: i,
|
|
299
288
|
pushFromResponseData: s,
|
|
300
|
-
length: () =>
|
|
289
|
+
length: () => Re.length,
|
|
301
290
|
closeAll: () => {
|
|
302
|
-
|
|
291
|
+
Re.reverse().forEach((g) => g.close());
|
|
303
292
|
},
|
|
304
293
|
reset: () => o(() => []),
|
|
305
294
|
visit: x,
|
|
306
295
|
visitModal: f,
|
|
307
|
-
registerLocalModal: (
|
|
296
|
+
registerLocalModal: (g, u) => {
|
|
308
297
|
l((m) => ({
|
|
309
298
|
...m,
|
|
310
|
-
[
|
|
299
|
+
[g]: { name: g, callback: u }
|
|
311
300
|
}));
|
|
312
301
|
},
|
|
313
|
-
removeLocalModal: (
|
|
302
|
+
removeLocalModal: (g) => {
|
|
314
303
|
l((u) => {
|
|
315
304
|
const m = { ...u };
|
|
316
|
-
return delete m[
|
|
305
|
+
return delete m[g], m;
|
|
317
306
|
});
|
|
318
307
|
}
|
|
319
308
|
};
|
|
320
|
-
return /* @__PURE__ */ T(
|
|
321
|
-
},
|
|
322
|
-
const e = R(
|
|
309
|
+
return /* @__PURE__ */ T(Xe.Provider, { value: d, children: e });
|
|
310
|
+
}, Ve = () => {
|
|
311
|
+
const e = R(Xe);
|
|
323
312
|
if (e === null)
|
|
324
313
|
throw new Error("useModalStack must be used within a ModalStackProvider");
|
|
325
314
|
return e;
|
|
326
315
|
}, bt = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], Fn = (e) => {
|
|
327
|
-
e.initialPage && (
|
|
328
|
-
}, Cl = (e, t) => (Fn(t), /* @__PURE__ */ T(Sn, { children: /* @__PURE__ */ T(e, { ...t, children: ({ Component: r, props: l, key: o }) => /* @__PURE__ */ se(
|
|
316
|
+
e.initialPage && (Nt = e.initialPage.version), e.resolveComponent && (At = e.resolveComponent);
|
|
317
|
+
}, Cl = (e, t) => (Fn(t), /* @__PURE__ */ T(Sn, { children: /* @__PURE__ */ T(e, { ...t, children: ({ Component: r, props: l, key: o }) => /* @__PURE__ */ se(ft, { children: [
|
|
329
318
|
(() => {
|
|
330
|
-
const s =
|
|
331
|
-
return typeof r.layout == "function" ? r.layout(s) : Array.isArray(r.layout) ? r.layout.concat(s).reverse().reduce((c, f) =>
|
|
319
|
+
const s = De(r, { key: o, ...l });
|
|
320
|
+
return typeof r.layout == "function" ? r.layout(s) : Array.isArray(r.layout) ? r.layout.concat(s).reverse().reduce((c, f) => De(f, l, c)) : s;
|
|
332
321
|
})(),
|
|
333
322
|
/* @__PURE__ */ T(Cn, {})
|
|
334
323
|
] }) }) })), Cn = ({ children: e }) => {
|
|
335
324
|
var s;
|
|
336
|
-
const t = R(
|
|
325
|
+
const t = R(Xe);
|
|
337
326
|
let n = !1, r = !1;
|
|
338
|
-
M(() =>
|
|
339
|
-
() =>
|
|
327
|
+
M(() => be.on("start", () => n = !0), []), M(() => be.on("finish", () => n = !1), []), M(
|
|
328
|
+
() => be.on("navigate", function(i) {
|
|
340
329
|
const c = i.detail.page.props._inertiaui_modal;
|
|
341
330
|
if (!c) {
|
|
342
331
|
r && t.closeAll();
|
|
343
332
|
return;
|
|
344
333
|
}
|
|
345
|
-
r = c,
|
|
334
|
+
r = c, Te = c.baseUrl, t.pushFromResponseData(c, {}, () => {
|
|
346
335
|
if (!c.baseUrl) {
|
|
347
336
|
console.error("No base url in modal response data so cannot navigate back");
|
|
348
337
|
return;
|
|
349
338
|
}
|
|
350
|
-
!n && window.location.href !== c.baseUrl &&
|
|
339
|
+
!n && window.location.href !== c.baseUrl && be.visit(c.baseUrl, {
|
|
351
340
|
preserveScroll: !0,
|
|
352
341
|
preserveState: !0
|
|
353
342
|
});
|
|
354
343
|
}).then((f) => {
|
|
355
|
-
|
|
344
|
+
lt = f;
|
|
356
345
|
});
|
|
357
346
|
}),
|
|
358
347
|
[]
|
|
359
348
|
);
|
|
360
|
-
const l = (i) => (
|
|
361
|
-
M(() => (
|
|
362
|
-
const o =
|
|
349
|
+
const l = (i) => (Re.length && (i.headers["X-InertiaUI-Modal-Base-Url"] = Te), i);
|
|
350
|
+
M(() => (je.interceptors.request.use(l), () => je.interceptors.request.eject(l)), []);
|
|
351
|
+
const o = bn(), a = O();
|
|
363
352
|
return M(() => {
|
|
364
353
|
var f, x;
|
|
365
354
|
const i = (f = o.props) == null ? void 0 : f._inertiaui_modal, c = a.current;
|
|
366
|
-
a.current = i, i && c && i.component === c.component &&
|
|
367
|
-
}, [(s = o.props) == null ? void 0 : s._inertiaui_modal]), /* @__PURE__ */ se(
|
|
355
|
+
a.current = i, i && c && i.component === c.component && On(i.url, c.url) && ((x = t.stack[0]) == null || x.updateProps(i.props ?? {}));
|
|
356
|
+
}, [(s = o.props) == null ? void 0 : s._inertiaui_modal]), /* @__PURE__ */ se(ft, { children: [
|
|
368
357
|
e,
|
|
369
|
-
t.stack.length > 0 && /* @__PURE__ */ T(
|
|
358
|
+
t.stack.length > 0 && /* @__PURE__ */ T(It, { index: 0 })
|
|
370
359
|
] });
|
|
371
|
-
},
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
const e = E.useContext(
|
|
360
|
+
}, pt = E.createContext(null);
|
|
361
|
+
pt.displayName = "ModalIndexContext";
|
|
362
|
+
const kt = () => {
|
|
363
|
+
const e = E.useContext(pt);
|
|
375
364
|
if (e === void 0)
|
|
376
365
|
throw new Error("useModalIndex must be used within a ModalIndexProvider");
|
|
377
366
|
return e;
|
|
378
|
-
},
|
|
379
|
-
const { stack: t } =
|
|
380
|
-
return (n == null ? void 0 : n.component) && /* @__PURE__ */ T(
|
|
367
|
+
}, It = ({ index: e }) => {
|
|
368
|
+
const { stack: t } = Ve(), n = C(() => t[e], [t, e]);
|
|
369
|
+
return (n == null ? void 0 : n.component) && /* @__PURE__ */ T(pt.Provider, { value: e, children: /* @__PURE__ */ T(
|
|
381
370
|
n.component,
|
|
382
371
|
{
|
|
383
372
|
...n.props,
|
|
384
373
|
onModalEvent: (...r) => n.emit(...r)
|
|
385
374
|
}
|
|
386
375
|
) });
|
|
387
|
-
},
|
|
388
|
-
const i =
|
|
376
|
+
}, Rt = dt(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess: o = null, ...a }, s) => {
|
|
377
|
+
const i = kt(), { stack: c, registerLocalModal: f, removeLocalModal: x } = Ve(), [b, w] = S(null), d = C(() => e ? b : c[i], [e, b, i, c]), g = C(() => {
|
|
389
378
|
var h;
|
|
390
379
|
return (h = c.find(($) => $.shouldRender && $.index > (d == null ? void 0 : d.index))) == null ? void 0 : h.index;
|
|
391
|
-
}, [i, c]), u = C(() => (d == null ? void 0 : d.config.slideover) ?? a.slideover ??
|
|
380
|
+
}, [i, c]), u = C(() => (d == null ? void 0 : d.config.slideover) ?? a.slideover ?? mt("type") === "slideover", [a.slideover]), m = C(
|
|
392
381
|
() => ({
|
|
393
382
|
slideover: u,
|
|
394
383
|
closeButton: a.closeButton ?? ce(u, "closeButton"),
|
|
@@ -418,9 +407,9 @@ const It = () => {
|
|
|
418
407
|
}, [d]), M(() => {
|
|
419
408
|
d !== null && (d.isOpen ? o == null || o() : l == null || l());
|
|
420
409
|
}, [d == null ? void 0 : d.isOpen]);
|
|
421
|
-
const [
|
|
410
|
+
const [v, y] = S(!1);
|
|
422
411
|
return M(() => {
|
|
423
|
-
|
|
412
|
+
v && d !== null && d.isOpen && (d.onTopOfStack ? n == null || n() : r == null || r()), y(!0);
|
|
424
413
|
}, [d == null ? void 0 : d.onTopOfStack]), Ft(
|
|
425
414
|
s,
|
|
426
415
|
() => ({
|
|
@@ -481,7 +470,7 @@ const It = () => {
|
|
|
481
470
|
}
|
|
482
471
|
}),
|
|
483
472
|
[d]
|
|
484
|
-
), (d == null ? void 0 : d.shouldRender) && /* @__PURE__ */ se(
|
|
473
|
+
), (d == null ? void 0 : d.shouldRender) && /* @__PURE__ */ se(ft, { children: [
|
|
485
474
|
typeof t == "function" ? t({
|
|
486
475
|
afterLeave: d.afterLeave,
|
|
487
476
|
close: d.close,
|
|
@@ -498,27 +487,27 @@ const It = () => {
|
|
|
498
487
|
setOpen: d.setOpen,
|
|
499
488
|
shouldRender: d.shouldRender
|
|
500
489
|
}) : t,
|
|
501
|
-
|
|
490
|
+
g && /* @__PURE__ */ T(It, { index: g })
|
|
502
491
|
] });
|
|
503
492
|
});
|
|
504
|
-
|
|
505
|
-
function
|
|
493
|
+
Rt.displayName = "HeadlessModal";
|
|
494
|
+
function Dt(e) {
|
|
506
495
|
var t, n, r = "";
|
|
507
496
|
if (typeof e == "string" || typeof e == "number") r += e;
|
|
508
497
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
509
498
|
var l = e.length;
|
|
510
|
-
for (t = 0; t < l; t++) e[t] && (n =
|
|
499
|
+
for (t = 0; t < l; t++) e[t] && (n = Dt(e[t])) && (r && (r += " "), r += n);
|
|
511
500
|
} else for (n in e) e[n] && (r && (r += " "), r += n);
|
|
512
501
|
return r;
|
|
513
502
|
}
|
|
514
|
-
function
|
|
515
|
-
for (var e, t, n = 0, r = "", l = arguments.length; n < l; n++) (e = arguments[n]) && (t =
|
|
503
|
+
function Ue() {
|
|
504
|
+
for (var e, t, n = 0, r = "", l = arguments.length; n < l; n++) (e = arguments[n]) && (t = Dt(e)) && (r && (r += " "), r += t);
|
|
516
505
|
return r;
|
|
517
506
|
}
|
|
518
|
-
var Nn = Object.defineProperty, An = (e, t, n) => t in e ? Nn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n,
|
|
507
|
+
var Nn = Object.defineProperty, An = (e, t, n) => t in e ? Nn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, nt = (e, t, n) => (An(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
519
508
|
let kn = class {
|
|
520
509
|
constructor() {
|
|
521
|
-
|
|
510
|
+
nt(this, "current", this.detect()), nt(this, "handoffState", "pending"), nt(this, "currentId", 0);
|
|
522
511
|
}
|
|
523
512
|
set(t) {
|
|
524
513
|
this.current !== t && (this.handoffState = "pending", this.currentId = 0, this.current = t);
|
|
@@ -545,10 +534,10 @@ let kn = class {
|
|
|
545
534
|
return this.handoffState === "complete";
|
|
546
535
|
}
|
|
547
536
|
}, ae = new kn();
|
|
548
|
-
function
|
|
537
|
+
function qe(e) {
|
|
549
538
|
return ae.isServer ? null : e instanceof Node ? e.ownerDocument : e != null && e.hasOwnProperty("current") && e.current instanceof Node ? e.current.ownerDocument : document;
|
|
550
539
|
}
|
|
551
|
-
function
|
|
540
|
+
function Ye(e) {
|
|
552
541
|
typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => {
|
|
553
542
|
throw t;
|
|
554
543
|
}));
|
|
@@ -566,7 +555,7 @@ function re() {
|
|
|
566
555
|
return t.add(() => clearTimeout(r));
|
|
567
556
|
}, microTask(...n) {
|
|
568
557
|
let r = { current: !0 };
|
|
569
|
-
return
|
|
558
|
+
return Ye(() => {
|
|
570
559
|
r.current && n[0]();
|
|
571
560
|
}), t.add(() => {
|
|
572
561
|
r.current = !1;
|
|
@@ -589,12 +578,12 @@ function re() {
|
|
|
589
578
|
} };
|
|
590
579
|
return t;
|
|
591
580
|
}
|
|
592
|
-
function
|
|
581
|
+
function ht() {
|
|
593
582
|
let [e] = S(re);
|
|
594
583
|
return M(() => () => e.dispose(), [e]), e;
|
|
595
584
|
}
|
|
596
585
|
let k = (e, t) => {
|
|
597
|
-
ae.isServer ? M(e, t) :
|
|
586
|
+
ae.isServer ? M(e, t) : hn(e, t);
|
|
598
587
|
};
|
|
599
588
|
function ue(e) {
|
|
600
589
|
let t = O(e);
|
|
@@ -609,7 +598,7 @@ let L = function(e) {
|
|
|
609
598
|
function Rn() {
|
|
610
599
|
return R(In);
|
|
611
600
|
}
|
|
612
|
-
function
|
|
601
|
+
function it(...e) {
|
|
613
602
|
return Array.from(new Set(e.flatMap((t) => typeof t == "string" ? t.split(" ") : []))).filter(Boolean).join(" ");
|
|
614
603
|
}
|
|
615
604
|
function ne(e, t, ...n) {
|
|
@@ -620,53 +609,53 @@ function ne(e, t, ...n) {
|
|
|
620
609
|
let r = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((l) => `"${l}"`).join(", ")}.`);
|
|
621
610
|
throw Error.captureStackTrace && Error.captureStackTrace(r, ne), r;
|
|
622
611
|
}
|
|
623
|
-
var
|
|
612
|
+
var He = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(He || {}), te = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(te || {});
|
|
624
613
|
function W() {
|
|
625
614
|
let e = jn();
|
|
626
615
|
return Y((t) => Dn({ mergeRefs: e, ...t }), [e]);
|
|
627
616
|
}
|
|
628
617
|
function Dn({ ourProps: e, theirProps: t, slot: n, defaultTag: r, features: l, visible: o = !0, name: a, mergeRefs: s }) {
|
|
629
618
|
s = s ?? Un;
|
|
630
|
-
let i =
|
|
631
|
-
if (o) return
|
|
619
|
+
let i = jt(t, e);
|
|
620
|
+
if (o) return Ie(i, n, r, a, s);
|
|
632
621
|
let c = l ?? 0;
|
|
633
622
|
if (c & 2) {
|
|
634
623
|
let { static: f = !1, ...x } = i;
|
|
635
|
-
if (f) return
|
|
624
|
+
if (f) return Ie(x, n, r, a, s);
|
|
636
625
|
}
|
|
637
626
|
if (c & 1) {
|
|
638
627
|
let { unmount: f = !0, ...x } = i;
|
|
639
628
|
return ne(f ? 0 : 1, { 0() {
|
|
640
629
|
return null;
|
|
641
630
|
}, 1() {
|
|
642
|
-
return
|
|
631
|
+
return Ie({ ...x, hidden: !0, style: { display: "none" } }, n, r, a, s);
|
|
643
632
|
} });
|
|
644
633
|
}
|
|
645
|
-
return
|
|
634
|
+
return Ie(i, n, r, a, s);
|
|
646
635
|
}
|
|
647
|
-
function
|
|
648
|
-
let { as: o = n, children: a, refName: s = "ref", ...i } =
|
|
636
|
+
function Ie(e, t = {}, n, r, l) {
|
|
637
|
+
let { as: o = n, children: a, refName: s = "ref", ...i } = rt(e, ["unmount", "static"]), c = e.ref !== void 0 ? { [s]: e.ref } : {}, f = typeof a == "function" ? a(t) : a;
|
|
649
638
|
"className" in i && i.className && typeof i.className == "function" && (i.className = i.className(t)), i["aria-labelledby"] && i["aria-labelledby"] === i.id && (i["aria-labelledby"] = void 0);
|
|
650
639
|
let x = {};
|
|
651
640
|
if (t) {
|
|
652
641
|
let b = !1, w = [];
|
|
653
|
-
for (let [d,
|
|
642
|
+
for (let [d, g] of Object.entries(t)) typeof g == "boolean" && (b = !0), g === !0 && w.push(d.replace(/([A-Z])/g, (u) => `-${u.toLowerCase()}`));
|
|
654
643
|
if (b) {
|
|
655
644
|
x["data-headlessui-state"] = w.join(" ");
|
|
656
645
|
for (let d of w) x[`data-${d}`] = "";
|
|
657
646
|
}
|
|
658
647
|
}
|
|
659
|
-
if (o === G && (Object.keys(le(i)).length > 0 || Object.keys(le(x)).length > 0)) if (!
|
|
648
|
+
if (o === G && (Object.keys(le(i)).length > 0 || Object.keys(le(x)).length > 0)) if (!vn(f) || Array.isArray(f) && f.length > 1) {
|
|
660
649
|
if (Object.keys(le(i)).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(le(i)).concat(Object.keys(le(x))).map((b) => ` - ${b}`).join(`
|
|
661
650
|
`), "", "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((b) => ` - ${b}`).join(`
|
|
662
651
|
`)].join(`
|
|
663
652
|
`));
|
|
664
653
|
} else {
|
|
665
|
-
let b = f.props, w = b == null ? void 0 : b.className, d = typeof w == "function" ? (...m) =>
|
|
654
|
+
let b = f.props, w = b == null ? void 0 : b.className, d = typeof w == "function" ? (...m) => it(w(...m), i.className) : it(w, i.className), g = d ? { className: d } : {}, u = jt(f.props, le(rt(i, ["ref"])));
|
|
666
655
|
for (let m in x) m in u && delete x[m];
|
|
667
|
-
return
|
|
656
|
+
return gn(f, Object.assign({}, u, x, c, { ref: l(Hn(f), c.ref) }, g));
|
|
668
657
|
}
|
|
669
|
-
return
|
|
658
|
+
return De(o, Object.assign({}, rt(i, ["ref"]), o !== G && c, o !== G && x), f);
|
|
670
659
|
}
|
|
671
660
|
function jn() {
|
|
672
661
|
let e = O([]), t = Y((n) => {
|
|
@@ -681,7 +670,7 @@ function Un(...e) {
|
|
|
681
670
|
for (let n of e) n != null && (typeof n == "function" ? n(t) : n.current = t);
|
|
682
671
|
};
|
|
683
672
|
}
|
|
684
|
-
function
|
|
673
|
+
function jt(...e) {
|
|
685
674
|
if (e.length === 0) return {};
|
|
686
675
|
if (e.length === 1) return e[0];
|
|
687
676
|
let t = {}, n = {};
|
|
@@ -701,14 +690,14 @@ function Ut(...e) {
|
|
|
701
690
|
}
|
|
702
691
|
function D(e) {
|
|
703
692
|
var t;
|
|
704
|
-
return Object.assign(
|
|
693
|
+
return Object.assign(dt(e), { displayName: (t = e.displayName) != null ? t : e.name });
|
|
705
694
|
}
|
|
706
695
|
function le(e) {
|
|
707
696
|
let t = Object.assign({}, e);
|
|
708
697
|
for (let n in t) t[n] === void 0 && delete t[n];
|
|
709
698
|
return t;
|
|
710
699
|
}
|
|
711
|
-
function
|
|
700
|
+
function rt(e, t = []) {
|
|
712
701
|
let n = Object.assign({}, e);
|
|
713
702
|
for (let r of t) r in n && delete n[r];
|
|
714
703
|
return n;
|
|
@@ -717,15 +706,15 @@ function Hn(e) {
|
|
|
717
706
|
return E.version.split(".")[0] >= "19" ? e.props.ref : e.ref;
|
|
718
707
|
}
|
|
719
708
|
let Wn = "span";
|
|
720
|
-
var
|
|
709
|
+
var We = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(We || {});
|
|
721
710
|
function _n(e, t) {
|
|
722
711
|
var n;
|
|
723
712
|
let { features: r = 1, ...l } = e, o = { ref: t, "aria-hidden": (r & 2) === 2 ? !0 : (n = l["aria-hidden"]) != null ? n : void 0, hidden: (r & 4) === 4 ? !0 : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(r & 4) === 4 && (r & 2) !== 2 && { display: "none" } } };
|
|
724
713
|
return W()({ ourProps: o, theirProps: l, slot: {}, defaultTag: Wn, name: "Hidden" });
|
|
725
714
|
}
|
|
726
|
-
let
|
|
715
|
+
let ot = D(_n), Ut = Symbol();
|
|
727
716
|
function Bn(e, t = !0) {
|
|
728
|
-
return Object.assign(e, { [
|
|
717
|
+
return Object.assign(e, { [Ut]: t });
|
|
729
718
|
}
|
|
730
719
|
function Z(...e) {
|
|
731
720
|
let t = O(e);
|
|
@@ -735,15 +724,15 @@ function Z(...e) {
|
|
|
735
724
|
let n = L((r) => {
|
|
736
725
|
for (let l of t.current) l != null && (typeof l == "function" ? l(r) : l.current = r);
|
|
737
726
|
});
|
|
738
|
-
return e.every((r) => r == null || (r == null ? void 0 : r[
|
|
727
|
+
return e.every((r) => r == null || (r == null ? void 0 : r[Ut])) ? void 0 : n;
|
|
739
728
|
}
|
|
740
|
-
let
|
|
741
|
-
|
|
742
|
-
function
|
|
743
|
-
let e = R(
|
|
729
|
+
let vt = H(null);
|
|
730
|
+
vt.displayName = "DescriptionContext";
|
|
731
|
+
function Ht() {
|
|
732
|
+
let e = R(vt);
|
|
744
733
|
if (e === null) {
|
|
745
734
|
let t = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
|
|
746
|
-
throw Error.captureStackTrace && Error.captureStackTrace(t,
|
|
735
|
+
throw Error.captureStackTrace && Error.captureStackTrace(t, Ht), t;
|
|
747
736
|
}
|
|
748
737
|
return e;
|
|
749
738
|
}
|
|
@@ -754,18 +743,18 @@ function Xn() {
|
|
|
754
743
|
let s = a.slice(), i = s.indexOf(o);
|
|
755
744
|
return i !== -1 && s.splice(i, 1), s;
|
|
756
745
|
}))), l = C(() => ({ register: r, slot: n.slot, name: n.name, props: n.props, value: n.value }), [r, n.slot, n.name, n.props, n.value]);
|
|
757
|
-
return E.createElement(
|
|
746
|
+
return E.createElement(vt.Provider, { value: l }, n.children);
|
|
758
747
|
}, [t])];
|
|
759
748
|
}
|
|
760
749
|
let Vn = "p";
|
|
761
750
|
function qn(e, t) {
|
|
762
|
-
let n =
|
|
751
|
+
let n = Me(), r = Rn(), { id: l = `headlessui-description-${n}`, ...o } = e, a = Ht(), s = Z(t);
|
|
763
752
|
k(() => a.register(l), [l, a.register]);
|
|
764
753
|
let i = r || !1, c = C(() => ({ ...a.slot, disabled: i }), [a.slot, i]), f = { ref: s, ...a.props, id: l };
|
|
765
754
|
return W()({ ourProps: f, theirProps: o, slot: c, defaultTag: Vn, name: a.name || "Description" });
|
|
766
755
|
}
|
|
767
756
|
let Yn = D(qn), zn = Object.assign(Yn, {});
|
|
768
|
-
var
|
|
757
|
+
var Wt = ((e) => (e.Space = " ", e.Enter = "Enter", e.Escape = "Escape", e.Backspace = "Backspace", e.Delete = "Delete", e.ArrowLeft = "ArrowLeft", e.ArrowUp = "ArrowUp", e.ArrowRight = "ArrowRight", e.ArrowDown = "ArrowDown", e.Home = "Home", e.End = "End", e.PageUp = "PageUp", e.PageDown = "PageDown", e.Tab = "Tab", e))(Wt || {});
|
|
769
758
|
let Gn = H(() => {
|
|
770
759
|
});
|
|
771
760
|
function Kn({ value: e, children: t }) {
|
|
@@ -780,7 +769,7 @@ let Zn = class extends Map {
|
|
|
780
769
|
return n === void 0 && (n = this.factory(t), this.set(t, n)), n;
|
|
781
770
|
}
|
|
782
771
|
};
|
|
783
|
-
function
|
|
772
|
+
function _t(e, t) {
|
|
784
773
|
let n = e(), r = /* @__PURE__ */ new Set();
|
|
785
774
|
return { getSnapshot() {
|
|
786
775
|
return n;
|
|
@@ -791,10 +780,10 @@ function Bt(e, t) {
|
|
|
791
780
|
a && (n = a, r.forEach((s) => s()));
|
|
792
781
|
} };
|
|
793
782
|
}
|
|
794
|
-
function
|
|
795
|
-
return
|
|
783
|
+
function Bt(e) {
|
|
784
|
+
return wn(e.subscribe, e.getSnapshot, e.getSnapshot);
|
|
796
785
|
}
|
|
797
|
-
let Jn = new Zn(() =>
|
|
786
|
+
let Jn = new Zn(() => _t(() => [], { ADD(e) {
|
|
798
787
|
return this.includes(e) ? this : [...this, e];
|
|
799
788
|
}, REMOVE(e) {
|
|
800
789
|
let t = this.indexOf(e);
|
|
@@ -802,29 +791,29 @@ let Jn = new Zn(() => Bt(() => [], { ADD(e) {
|
|
|
802
791
|
let n = this.slice();
|
|
803
792
|
return n.splice(t, 1), n;
|
|
804
793
|
} }));
|
|
805
|
-
function
|
|
806
|
-
let n = Jn.get(t), r =
|
|
794
|
+
function me(e, t) {
|
|
795
|
+
let n = Jn.get(t), r = Me(), l = Bt(n);
|
|
807
796
|
if (k(() => {
|
|
808
797
|
if (e) return n.dispatch("ADD", r), () => n.dispatch("REMOVE", r);
|
|
809
798
|
}, [n, e]), !e) return !1;
|
|
810
799
|
let o = l.indexOf(r), a = l.length;
|
|
811
800
|
return o === -1 && (o = a, a += 1), o === a - 1;
|
|
812
801
|
}
|
|
813
|
-
let
|
|
802
|
+
let at = /* @__PURE__ */ new Map(), Oe = /* @__PURE__ */ new Map();
|
|
814
803
|
function Et(e) {
|
|
815
804
|
var t;
|
|
816
|
-
let n = (t =
|
|
817
|
-
return
|
|
805
|
+
let n = (t = Oe.get(e)) != null ? t : 0;
|
|
806
|
+
return Oe.set(e, n + 1), n !== 0 ? () => $t(e) : (at.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => $t(e));
|
|
818
807
|
}
|
|
819
808
|
function $t(e) {
|
|
820
809
|
var t;
|
|
821
|
-
let n = (t =
|
|
822
|
-
if (n === 1 ?
|
|
823
|
-
let r =
|
|
824
|
-
r && (r["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", r["aria-hidden"]), e.inert = r.inert,
|
|
810
|
+
let n = (t = Oe.get(e)) != null ? t : 1;
|
|
811
|
+
if (n === 1 ? Oe.delete(e) : Oe.set(e, n - 1), n !== 1) return;
|
|
812
|
+
let r = at.get(e);
|
|
813
|
+
r && (r["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", r["aria-hidden"]), e.inert = r.inert, at.delete(e));
|
|
825
814
|
}
|
|
826
815
|
function Qn(e, { allowed: t, disallowed: n } = {}) {
|
|
827
|
-
let r =
|
|
816
|
+
let r = me(e, "inert-others");
|
|
828
817
|
k(() => {
|
|
829
818
|
var l, o;
|
|
830
819
|
if (!r) return;
|
|
@@ -833,7 +822,7 @@ function Qn(e, { allowed: t, disallowed: n } = {}) {
|
|
|
833
822
|
let s = (o = t == null ? void 0 : t()) != null ? o : [];
|
|
834
823
|
for (let i of s) {
|
|
835
824
|
if (!i) continue;
|
|
836
|
-
let c =
|
|
825
|
+
let c = qe(i);
|
|
837
826
|
if (!c) continue;
|
|
838
827
|
let f = i.parentElement;
|
|
839
828
|
for (; f && f !== c.body; ) {
|
|
@@ -865,23 +854,23 @@ function er(e, t, n) {
|
|
|
865
854
|
return () => o.dispose();
|
|
866
855
|
}, [t, r, e]);
|
|
867
856
|
}
|
|
868
|
-
let
|
|
869
|
-
var J = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e[e.AutoFocus = 64] = "AutoFocus", e))(J || {}),
|
|
857
|
+
let _e = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(","), tr = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
|
858
|
+
var J = ((e) => (e[e.First = 1] = "First", e[e.Previous = 2] = "Previous", e[e.Next = 4] = "Next", e[e.Last = 8] = "Last", e[e.WrapAround = 16] = "WrapAround", e[e.NoScroll = 32] = "NoScroll", e[e.AutoFocus = 64] = "AutoFocus", e))(J || {}), st = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(st || {}), nr = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(nr || {});
|
|
870
859
|
function rr(e = document.body) {
|
|
871
|
-
return e == null ? [] : Array.from(e.querySelectorAll(
|
|
860
|
+
return e == null ? [] : Array.from(e.querySelectorAll(_e)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
872
861
|
}
|
|
873
862
|
function lr(e = document.body) {
|
|
874
863
|
return e == null ? [] : Array.from(e.querySelectorAll(tr)).sort((t, n) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (n.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
875
864
|
}
|
|
876
|
-
var
|
|
865
|
+
var Xt = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(Xt || {});
|
|
877
866
|
function ir(e, t = 0) {
|
|
878
867
|
var n;
|
|
879
|
-
return e === ((n =
|
|
880
|
-
return e.matches(
|
|
868
|
+
return e === ((n = qe(e)) == null ? void 0 : n.body) ? !1 : ne(t, { 0() {
|
|
869
|
+
return e.matches(_e);
|
|
881
870
|
}, 1() {
|
|
882
871
|
let r = e;
|
|
883
872
|
for (; r !== null; ) {
|
|
884
|
-
if (r.matches(
|
|
873
|
+
if (r.matches(_e)) return !0;
|
|
885
874
|
r = r.parentElement;
|
|
886
875
|
}
|
|
887
876
|
return !1;
|
|
@@ -909,7 +898,7 @@ function ur(e, t = (n) => n) {
|
|
|
909
898
|
return a & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : a & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
910
899
|
});
|
|
911
900
|
}
|
|
912
|
-
function
|
|
901
|
+
function Pe(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] } = {}) {
|
|
913
902
|
let o = Array.isArray(e) ? e.length > 0 ? e[0].ownerDocument : document : e.ownerDocument, a = Array.isArray(e) ? n ? ur(e) : e : t & 64 ? lr(e) : rr(e);
|
|
914
903
|
l.length > 0 && a.length > 1 && (a = a.filter((w) => !l.some((d) => d != null && "current" in d ? (d == null ? void 0 : d.current) === w : d === w))), r = r ?? o.activeElement;
|
|
915
904
|
let s = (() => {
|
|
@@ -935,16 +924,16 @@ function Oe(e, t, { sorted: n = !0, relativeTo: r = null, skipElements: l = [] }
|
|
|
935
924
|
} while (b !== o.activeElement);
|
|
936
925
|
return t & 6 && sr(b) && b.select(), 2;
|
|
937
926
|
}
|
|
938
|
-
function
|
|
927
|
+
function Vt() {
|
|
939
928
|
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
|
940
929
|
}
|
|
941
930
|
function cr() {
|
|
942
931
|
return /Android/gi.test(window.navigator.userAgent);
|
|
943
932
|
}
|
|
944
933
|
function dr() {
|
|
945
|
-
return
|
|
934
|
+
return Vt() || cr();
|
|
946
935
|
}
|
|
947
|
-
function
|
|
936
|
+
function ye(e, t, n, r) {
|
|
948
937
|
let l = ue(n);
|
|
949
938
|
M(() => {
|
|
950
939
|
if (!e) return;
|
|
@@ -954,7 +943,7 @@ function xe(e, t, n, r) {
|
|
|
954
943
|
return document.addEventListener(t, o, r), () => document.removeEventListener(t, o, r);
|
|
955
944
|
}, [e, t, r]);
|
|
956
945
|
}
|
|
957
|
-
function
|
|
946
|
+
function qt(e, t, n, r) {
|
|
958
947
|
let l = ue(n);
|
|
959
948
|
M(() => {
|
|
960
949
|
if (!e) return;
|
|
@@ -966,7 +955,7 @@ function Yt(e, t, n, r) {
|
|
|
966
955
|
}
|
|
967
956
|
const Tt = 30;
|
|
968
957
|
function fr(e, t, n) {
|
|
969
|
-
let r =
|
|
958
|
+
let r = me(e, "outside-click"), l = ue(n), o = Y(function(i, c) {
|
|
970
959
|
if (i.defaultPrevented) return;
|
|
971
960
|
let f = c(i);
|
|
972
961
|
if (f === null || !f.getRootNode().contains(f) || !f.isConnected) return;
|
|
@@ -974,29 +963,29 @@ function fr(e, t, n) {
|
|
|
974
963
|
return typeof w == "function" ? b(w()) : Array.isArray(w) || w instanceof Set ? w : [w];
|
|
975
964
|
}(t);
|
|
976
965
|
for (let b of x) if (b !== null && (b.contains(f) || i.composed && i.composedPath().includes(b))) return;
|
|
977
|
-
return !ir(f,
|
|
966
|
+
return !ir(f, Xt.Loose) && f.tabIndex !== -1 && i.preventDefault(), l.current(i, f);
|
|
978
967
|
}, [l, t]), a = O(null);
|
|
979
|
-
|
|
968
|
+
ye(r, "pointerdown", (i) => {
|
|
980
969
|
var c, f;
|
|
981
970
|
a.current = ((f = (c = i.composedPath) == null ? void 0 : c.call(i)) == null ? void 0 : f[0]) || i.target;
|
|
982
|
-
}, !0),
|
|
971
|
+
}, !0), ye(r, "mousedown", (i) => {
|
|
983
972
|
var c, f;
|
|
984
973
|
a.current = ((f = (c = i.composedPath) == null ? void 0 : c.call(i)) == null ? void 0 : f[0]) || i.target;
|
|
985
|
-
}, !0),
|
|
974
|
+
}, !0), ye(r, "click", (i) => {
|
|
986
975
|
dr() || a.current && (o(i, () => a.current), a.current = null);
|
|
987
976
|
}, !0);
|
|
988
977
|
let s = O({ x: 0, y: 0 });
|
|
989
|
-
|
|
978
|
+
ye(r, "touchstart", (i) => {
|
|
990
979
|
s.current.x = i.touches[0].clientX, s.current.y = i.touches[0].clientY;
|
|
991
|
-
}, !0),
|
|
980
|
+
}, !0), ye(r, "touchend", (i) => {
|
|
992
981
|
let c = { x: i.changedTouches[0].clientX, y: i.changedTouches[0].clientY };
|
|
993
982
|
if (!(Math.abs(c.x - s.current.x) >= Tt || Math.abs(c.y - s.current.y) >= Tt)) return o(i, () => i.target instanceof HTMLElement ? i.target : null);
|
|
994
|
-
}, !0),
|
|
983
|
+
}, !0), qt(r, "blur", (i) => o(i, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null), !0);
|
|
995
984
|
}
|
|
996
|
-
function
|
|
997
|
-
return C(() =>
|
|
985
|
+
function Le(...e) {
|
|
986
|
+
return C(() => qe(...e), [...e]);
|
|
998
987
|
}
|
|
999
|
-
function
|
|
988
|
+
function Yt(e, t, n, r) {
|
|
1000
989
|
let l = ue(n);
|
|
1001
990
|
M(() => {
|
|
1002
991
|
e = e ?? window;
|
|
@@ -1018,7 +1007,7 @@ function mr() {
|
|
|
1018
1007
|
} };
|
|
1019
1008
|
}
|
|
1020
1009
|
function pr() {
|
|
1021
|
-
return
|
|
1010
|
+
return Vt() ? { before({ doc: e, d: t, meta: n }) {
|
|
1022
1011
|
function r(l) {
|
|
1023
1012
|
return n.containers.flatMap((o) => o()).some((o) => o.contains(l));
|
|
1024
1013
|
}
|
|
@@ -1070,7 +1059,7 @@ function vr(e) {
|
|
|
1070
1059
|
for (let n of e) Object.assign(t, n(t));
|
|
1071
1060
|
return t;
|
|
1072
1061
|
}
|
|
1073
|
-
let oe =
|
|
1062
|
+
let oe = _t(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
1074
1063
|
var n;
|
|
1075
1064
|
let r = (n = this.get(e)) != null ? n : { doc: e, count: 0, d: re(), meta: /* @__PURE__ */ new Set() };
|
|
1076
1065
|
return r.count++, r.meta.add(t), this.set(e, r), this;
|
|
@@ -1094,13 +1083,13 @@ oe.subscribe(() => {
|
|
|
1094
1083
|
}
|
|
1095
1084
|
});
|
|
1096
1085
|
function gr(e, t, n = () => ({ containers: [] })) {
|
|
1097
|
-
let r =
|
|
1086
|
+
let r = Bt(oe), l = t ? r.get(t) : void 0, o = l ? l.count > 0 : !1;
|
|
1098
1087
|
return k(() => {
|
|
1099
1088
|
if (!(!t || !e)) return oe.dispatch("PUSH", t, n), () => oe.dispatch("POP", t, n);
|
|
1100
1089
|
}, [e, t]), o;
|
|
1101
1090
|
}
|
|
1102
1091
|
function wr(e, t, n = () => [document.body]) {
|
|
1103
|
-
let r =
|
|
1092
|
+
let r = me(e, "scroll-lock");
|
|
1104
1093
|
gr(r, t, (l) => {
|
|
1105
1094
|
var o;
|
|
1106
1095
|
return { containers: [...(o = l.containers) != null ? o : [], n] };
|
|
@@ -1122,7 +1111,7 @@ function br(e) {
|
|
|
1122
1111
|
return t;
|
|
1123
1112
|
}
|
|
1124
1113
|
function Er(e, t, n, r) {
|
|
1125
|
-
let [l, o] = S(n), { hasFlag: a, addFlag: s, removeFlag: i } = xr(e && l ? 3 : 0), c = O(!1), f = O(!1), x =
|
|
1114
|
+
let [l, o] = S(n), { hasFlag: a, addFlag: s, removeFlag: i } = xr(e && l ? 3 : 0), c = O(!1), f = O(!1), x = ht();
|
|
1126
1115
|
return k(() => {
|
|
1127
1116
|
var b;
|
|
1128
1117
|
if (e) {
|
|
@@ -1170,7 +1159,7 @@ function Or(e, { inFlight: t, prepare: n }) {
|
|
|
1170
1159
|
let r = e.style.transition;
|
|
1171
1160
|
e.style.transition = "none", n(), e.offsetHeight, e.style.transition = r;
|
|
1172
1161
|
}
|
|
1173
|
-
function
|
|
1162
|
+
function gt(e, t) {
|
|
1174
1163
|
let n = O([]), r = L(e);
|
|
1175
1164
|
M(() => {
|
|
1176
1165
|
let l = [...n.current];
|
|
@@ -1180,17 +1169,17 @@ function vt(e, t) {
|
|
|
1180
1169
|
}
|
|
1181
1170
|
}, [r, ...t]);
|
|
1182
1171
|
}
|
|
1183
|
-
let
|
|
1184
|
-
|
|
1172
|
+
let ze = H(null);
|
|
1173
|
+
ze.displayName = "OpenClosedContext";
|
|
1185
1174
|
var z = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(z || {});
|
|
1186
|
-
function
|
|
1187
|
-
return R(
|
|
1175
|
+
function Ge() {
|
|
1176
|
+
return R(ze);
|
|
1188
1177
|
}
|
|
1189
1178
|
function Pr({ value: e, children: t }) {
|
|
1190
|
-
return E.createElement(
|
|
1179
|
+
return E.createElement(ze.Provider, { value: e }, t);
|
|
1191
1180
|
}
|
|
1192
1181
|
function Mr({ children: e }) {
|
|
1193
|
-
return E.createElement(
|
|
1182
|
+
return E.createElement(ze.Provider, { value: null }, e);
|
|
1194
1183
|
}
|
|
1195
1184
|
function Lr(e) {
|
|
1196
1185
|
function t() {
|
|
@@ -1203,38 +1192,38 @@ Lr(() => {
|
|
|
1203
1192
|
function e(t) {
|
|
1204
1193
|
if (!(t.target instanceof HTMLElement) || t.target === document.body || ee[0] === t.target) return;
|
|
1205
1194
|
let n = t.target;
|
|
1206
|
-
n = n.closest(
|
|
1195
|
+
n = n.closest(_e), ee.unshift(n ?? t.target), ee = ee.filter((r) => r != null && r.isConnected), ee.splice(10);
|
|
1207
1196
|
}
|
|
1208
1197
|
window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
|
|
1209
1198
|
});
|
|
1210
|
-
function
|
|
1199
|
+
function zt(e) {
|
|
1211
1200
|
let t = L(e), n = O(!1);
|
|
1212
1201
|
M(() => (n.current = !1, () => {
|
|
1213
|
-
n.current = !0,
|
|
1202
|
+
n.current = !0, Ye(() => {
|
|
1214
1203
|
n.current && t();
|
|
1215
1204
|
});
|
|
1216
1205
|
}), [t]);
|
|
1217
1206
|
}
|
|
1218
1207
|
function Sr() {
|
|
1219
1208
|
let e = typeof document > "u";
|
|
1220
|
-
return "useSyncExternalStore" in
|
|
1209
|
+
return "useSyncExternalStore" in $e ? ((t) => t.useSyncExternalStore)($e)(() => () => {
|
|
1221
1210
|
}, () => !1, () => !e) : !1;
|
|
1222
1211
|
}
|
|
1223
|
-
function
|
|
1224
|
-
let e = Sr(), [t, n] =
|
|
1225
|
-
return t && ae.isHandoffComplete === !1 && n(!1),
|
|
1212
|
+
function Se() {
|
|
1213
|
+
let e = Sr(), [t, n] = $e.useState(ae.isHandoffComplete);
|
|
1214
|
+
return t && ae.isHandoffComplete === !1 && n(!1), $e.useEffect(() => {
|
|
1226
1215
|
t !== !0 && n(!0);
|
|
1227
|
-
}, [t]),
|
|
1216
|
+
}, [t]), $e.useEffect(() => ae.handoff(), []), e ? !1 : t;
|
|
1228
1217
|
}
|
|
1229
|
-
let
|
|
1218
|
+
let Gt = H(!1);
|
|
1230
1219
|
function Fr() {
|
|
1231
|
-
return R(
|
|
1220
|
+
return R(Gt);
|
|
1232
1221
|
}
|
|
1233
1222
|
function Mt(e) {
|
|
1234
|
-
return E.createElement(
|
|
1223
|
+
return E.createElement(Gt.Provider, { value: e.force }, e.children);
|
|
1235
1224
|
}
|
|
1236
1225
|
function Cr(e) {
|
|
1237
|
-
let t = Fr(), n = R(
|
|
1226
|
+
let t = Fr(), n = R(Zt), r = Le(e), [l, o] = S(() => {
|
|
1238
1227
|
var a;
|
|
1239
1228
|
if (!t && n !== null) return (a = n.current) != null ? a : null;
|
|
1240
1229
|
if (ae.isServer) return null;
|
|
@@ -1250,48 +1239,48 @@ function Cr(e) {
|
|
|
1250
1239
|
t || n !== null && o(n.current);
|
|
1251
1240
|
}, [n, o, t]), l;
|
|
1252
1241
|
}
|
|
1253
|
-
let
|
|
1242
|
+
let Kt = G, Nr = D(function(e, t) {
|
|
1254
1243
|
let n = e, r = O(null), l = Z(Bn((x) => {
|
|
1255
1244
|
r.current = x;
|
|
1256
|
-
}), t), o =
|
|
1245
|
+
}), t), o = Le(r), a = Cr(r), [s] = S(() => {
|
|
1257
1246
|
var x;
|
|
1258
1247
|
return ae.isServer ? null : (x = o == null ? void 0 : o.createElement("div")) != null ? x : null;
|
|
1259
|
-
}), i = R(
|
|
1248
|
+
}), i = R(ut), c = Se();
|
|
1260
1249
|
k(() => {
|
|
1261
1250
|
!a || !s || a.contains(s) || (s.setAttribute("data-headlessui-portal", ""), a.appendChild(s));
|
|
1262
1251
|
}, [a, s]), k(() => {
|
|
1263
1252
|
if (s && i) return i.register(s);
|
|
1264
|
-
}, [i, s]),
|
|
1253
|
+
}, [i, s]), zt(() => {
|
|
1265
1254
|
var x;
|
|
1266
1255
|
!a || !s || (s instanceof Node && a.contains(s) && a.removeChild(s), a.childNodes.length <= 0 && ((x = a.parentElement) == null || x.removeChild(a)));
|
|
1267
1256
|
});
|
|
1268
1257
|
let f = W();
|
|
1269
|
-
return c ? !a || !s ? null :
|
|
1258
|
+
return c ? !a || !s ? null : $n(f({ ourProps: { ref: l }, theirProps: n, slot: {}, defaultTag: Kt, name: "Portal" }), s) : null;
|
|
1270
1259
|
});
|
|
1271
1260
|
function Ar(e, t) {
|
|
1272
1261
|
let n = Z(t), { enabled: r = !0, ...l } = e, o = W();
|
|
1273
|
-
return r ? E.createElement(Nr, { ...l, ref: n }) : o({ ourProps: { ref: n }, theirProps: l, slot: {}, defaultTag:
|
|
1262
|
+
return r ? E.createElement(Nr, { ...l, ref: n }) : o({ ourProps: { ref: n }, theirProps: l, slot: {}, defaultTag: Kt, name: "Portal" });
|
|
1274
1263
|
}
|
|
1275
|
-
let kr = G,
|
|
1264
|
+
let kr = G, Zt = H(null);
|
|
1276
1265
|
function Ir(e, t) {
|
|
1277
1266
|
let { target: n, ...r } = e, l = { ref: Z(t) }, o = W();
|
|
1278
|
-
return E.createElement(
|
|
1267
|
+
return E.createElement(Zt.Provider, { value: n }, o({ ourProps: l, theirProps: r, defaultTag: kr, name: "Popover.Group" }));
|
|
1279
1268
|
}
|
|
1280
|
-
let
|
|
1269
|
+
let ut = H(null);
|
|
1281
1270
|
function Rr() {
|
|
1282
|
-
let e = R(
|
|
1271
|
+
let e = R(ut), t = O([]), n = L((o) => (t.current.push(o), e && e.register(o), () => r(o))), r = L((o) => {
|
|
1283
1272
|
let a = t.current.indexOf(o);
|
|
1284
1273
|
a !== -1 && t.current.splice(a, 1), e && e.unregister(o);
|
|
1285
1274
|
}), l = C(() => ({ register: n, unregister: r, portals: t }), [n, r, t]);
|
|
1286
1275
|
return [t, C(() => function({ children: o }) {
|
|
1287
|
-
return E.createElement(
|
|
1276
|
+
return E.createElement(ut.Provider, { value: l }, o);
|
|
1288
1277
|
}, [l])];
|
|
1289
1278
|
}
|
|
1290
|
-
let Dr = D(Ar),
|
|
1279
|
+
let Dr = D(Ar), Jt = D(Ir), jr = Object.assign(Dr, { Group: Jt });
|
|
1291
1280
|
function Ur(e, t = typeof document < "u" ? document.defaultView : null, n) {
|
|
1292
|
-
let r =
|
|
1293
|
-
|
|
1294
|
-
r && (l.defaultPrevented || l.key ===
|
|
1281
|
+
let r = me(e, "escape");
|
|
1282
|
+
Yt(t, "keydown", (l) => {
|
|
1283
|
+
r && (l.defaultPrevented || l.key === Wt.Escape && n(l));
|
|
1295
1284
|
});
|
|
1296
1285
|
}
|
|
1297
1286
|
function Hr() {
|
|
@@ -1306,7 +1295,7 @@ function Hr() {
|
|
|
1306
1295
|
}, [t]), n;
|
|
1307
1296
|
}
|
|
1308
1297
|
function Wr({ defaultContainers: e = [], portals: t, mainTreeNode: n } = {}) {
|
|
1309
|
-
let r =
|
|
1298
|
+
let r = Le(n), l = L(() => {
|
|
1310
1299
|
var o, a;
|
|
1311
1300
|
let s = [];
|
|
1312
1301
|
for (let i of e) i !== null && (i instanceof HTMLElement ? s.push(i) : "current" in i && i.current instanceof HTMLElement && s.push(i.current));
|
|
@@ -1316,37 +1305,37 @@ function Wr({ defaultContainers: e = [], portals: t, mainTreeNode: n } = {}) {
|
|
|
1316
1305
|
});
|
|
1317
1306
|
return { resolveContainers: l, contains: L((o) => l().some((a) => a.contains(o))) };
|
|
1318
1307
|
}
|
|
1319
|
-
let
|
|
1308
|
+
let Qt = H(null);
|
|
1320
1309
|
function Lt({ children: e, node: t }) {
|
|
1321
|
-
let [n, r] = S(null), l =
|
|
1322
|
-
return E.createElement(
|
|
1310
|
+
let [n, r] = S(null), l = en(t ?? n);
|
|
1311
|
+
return E.createElement(Qt.Provider, { value: l }, e, l === null && E.createElement(ot, { features: We.Hidden, ref: (o) => {
|
|
1323
1312
|
var a, s;
|
|
1324
1313
|
if (o) {
|
|
1325
|
-
for (let i of (s = (a =
|
|
1314
|
+
for (let i of (s = (a = qe(o)) == null ? void 0 : a.querySelectorAll("html > *, body > *")) != null ? s : []) if (i !== document.body && i !== document.head && i instanceof HTMLElement && i != null && i.contains(o)) {
|
|
1326
1315
|
r(i);
|
|
1327
1316
|
break;
|
|
1328
1317
|
}
|
|
1329
1318
|
}
|
|
1330
1319
|
} }));
|
|
1331
1320
|
}
|
|
1332
|
-
function
|
|
1321
|
+
function en(e = null) {
|
|
1333
1322
|
var t;
|
|
1334
|
-
return (t = R(
|
|
1323
|
+
return (t = R(Qt)) != null ? t : e;
|
|
1335
1324
|
}
|
|
1336
|
-
function
|
|
1325
|
+
function wt() {
|
|
1337
1326
|
let e = O(!1);
|
|
1338
1327
|
return k(() => (e.current = !0, () => {
|
|
1339
1328
|
e.current = !1;
|
|
1340
1329
|
}), []), e;
|
|
1341
1330
|
}
|
|
1342
|
-
var
|
|
1331
|
+
var Ee = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(Ee || {});
|
|
1343
1332
|
function _r() {
|
|
1344
1333
|
let e = O(0);
|
|
1345
|
-
return
|
|
1334
|
+
return qt(!0, "keydown", (t) => {
|
|
1346
1335
|
t.key === "Tab" && (e.current = t.shiftKey ? 1 : 0);
|
|
1347
1336
|
}, !0), e;
|
|
1348
1337
|
}
|
|
1349
|
-
function
|
|
1338
|
+
function tn(e) {
|
|
1350
1339
|
if (!e) return /* @__PURE__ */ new Set();
|
|
1351
1340
|
if (typeof e == "function") return new Set(e());
|
|
1352
1341
|
let t = /* @__PURE__ */ new Set();
|
|
@@ -1357,38 +1346,38 @@ let Br = "div";
|
|
|
1357
1346
|
var ie = ((e) => (e[e.None = 0] = "None", e[e.InitialFocus = 1] = "InitialFocus", e[e.TabLock = 2] = "TabLock", e[e.FocusLock = 4] = "FocusLock", e[e.RestoreFocus = 8] = "RestoreFocus", e[e.AutoFocus = 16] = "AutoFocus", e))(ie || {});
|
|
1358
1347
|
function Xr(e, t) {
|
|
1359
1348
|
let n = O(null), r = Z(n, t), { initialFocus: l, initialFocusFallback: o, containers: a, features: s = 15, ...i } = e;
|
|
1360
|
-
|
|
1361
|
-
let c =
|
|
1349
|
+
Se() || (s = 0);
|
|
1350
|
+
let c = Le(n);
|
|
1362
1351
|
zr(s, { ownerDocument: c });
|
|
1363
1352
|
let f = Gr(s, { ownerDocument: c, container: n, initialFocus: l, initialFocusFallback: o });
|
|
1364
1353
|
Kr(s, { ownerDocument: c, container: n, containers: a, previousActiveElement: f });
|
|
1365
1354
|
let x = _r(), b = L((p) => {
|
|
1366
|
-
let
|
|
1367
|
-
|
|
1368
|
-
ne(x.current, { [
|
|
1369
|
-
|
|
1370
|
-
}, [
|
|
1371
|
-
|
|
1355
|
+
let v = n.current;
|
|
1356
|
+
v && ((y) => y())(() => {
|
|
1357
|
+
ne(x.current, { [Ee.Forwards]: () => {
|
|
1358
|
+
Pe(v, J.First, { skipElements: [p.relatedTarget, o] });
|
|
1359
|
+
}, [Ee.Backwards]: () => {
|
|
1360
|
+
Pe(v, J.Last, { skipElements: [p.relatedTarget, o] });
|
|
1372
1361
|
} });
|
|
1373
1362
|
});
|
|
1374
|
-
}), w =
|
|
1375
|
-
p.key == "Tab" && (
|
|
1376
|
-
|
|
1363
|
+
}), w = me(!!(s & 2), "focus-trap#tab-lock"), d = ht(), g = O(!1), u = { ref: r, onKeyDown(p) {
|
|
1364
|
+
p.key == "Tab" && (g.current = !0, d.requestAnimationFrame(() => {
|
|
1365
|
+
g.current = !1;
|
|
1377
1366
|
}));
|
|
1378
1367
|
}, onBlur(p) {
|
|
1379
1368
|
if (!(s & 4)) return;
|
|
1380
|
-
let
|
|
1381
|
-
n.current instanceof HTMLElement &&
|
|
1369
|
+
let v = tn(a);
|
|
1370
|
+
n.current instanceof HTMLElement && v.add(n.current);
|
|
1382
1371
|
let y = p.relatedTarget;
|
|
1383
|
-
y instanceof HTMLElement && y.dataset.headlessuiFocusGuard !== "true" && (
|
|
1372
|
+
y instanceof HTMLElement && y.dataset.headlessuiFocusGuard !== "true" && (nn(v, y) || (g.current ? Pe(n.current, ne(x.current, { [Ee.Forwards]: () => J.Next, [Ee.Backwards]: () => J.Previous }) | J.WrapAround, { relativeTo: p.target }) : p.target instanceof HTMLElement && Q(p.target)));
|
|
1384
1373
|
} }, m = W();
|
|
1385
|
-
return E.createElement(E.Fragment, null, w && E.createElement(
|
|
1374
|
+
return E.createElement(E.Fragment, null, w && E.createElement(ot, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: b, features: We.Focusable }), m({ ourProps: u, theirProps: i, defaultTag: Br, name: "FocusTrap" }), w && E.createElement(ot, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: b, features: We.Focusable }));
|
|
1386
1375
|
}
|
|
1387
1376
|
let Vr = D(Xr), qr = Object.assign(Vr, { features: ie });
|
|
1388
1377
|
function Yr(e = !0) {
|
|
1389
1378
|
let t = O(ee.slice());
|
|
1390
|
-
return
|
|
1391
|
-
r === !0 && n === !1 &&
|
|
1379
|
+
return gt(([n], [r]) => {
|
|
1380
|
+
r === !0 && n === !1 && Ye(() => {
|
|
1392
1381
|
t.current.splice(0);
|
|
1393
1382
|
}), r === !1 && n === !0 && (t.current = ee.slice());
|
|
1394
1383
|
}, [e, ee, t]), L(() => {
|
|
@@ -1398,22 +1387,22 @@ function Yr(e = !0) {
|
|
|
1398
1387
|
}
|
|
1399
1388
|
function zr(e, { ownerDocument: t }) {
|
|
1400
1389
|
let n = !!(e & 8), r = Yr(n);
|
|
1401
|
-
|
|
1390
|
+
gt(() => {
|
|
1402
1391
|
n || (t == null ? void 0 : t.activeElement) === (t == null ? void 0 : t.body) && Q(r());
|
|
1403
|
-
}, [n]),
|
|
1392
|
+
}, [n]), zt(() => {
|
|
1404
1393
|
n && Q(r());
|
|
1405
1394
|
});
|
|
1406
1395
|
}
|
|
1407
1396
|
function Gr(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFallback: l }) {
|
|
1408
|
-
let o = O(null), a =
|
|
1409
|
-
return
|
|
1397
|
+
let o = O(null), a = me(!!(e & 1), "focus-trap#initial-focus"), s = wt();
|
|
1398
|
+
return gt(() => {
|
|
1410
1399
|
if (e === 0) return;
|
|
1411
1400
|
if (!a) {
|
|
1412
1401
|
l != null && l.current && Q(l.current);
|
|
1413
1402
|
return;
|
|
1414
1403
|
}
|
|
1415
1404
|
let i = n.current;
|
|
1416
|
-
i &&
|
|
1405
|
+
i && Ye(() => {
|
|
1417
1406
|
if (!s.current) return;
|
|
1418
1407
|
let c = t == null ? void 0 : t.activeElement;
|
|
1419
1408
|
if (r != null && r.current) {
|
|
@@ -1428,8 +1417,8 @@ function Gr(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFa
|
|
|
1428
1417
|
if (r != null && r.current) Q(r.current);
|
|
1429
1418
|
else {
|
|
1430
1419
|
if (e & 16) {
|
|
1431
|
-
if (
|
|
1432
|
-
} else if (
|
|
1420
|
+
if (Pe(i, J.First | J.AutoFocus) !== st.Error) return;
|
|
1421
|
+
} else if (Pe(i, J.First) !== st.Error) return;
|
|
1433
1422
|
if (l != null && l.current && (Q(l.current), (t == null ? void 0 : t.activeElement) === l.current)) return;
|
|
1434
1423
|
console.warn("There are no focusable elements inside the <FocusTrap />");
|
|
1435
1424
|
}
|
|
@@ -1438,149 +1427,149 @@ function Gr(e, { ownerDocument: t, container: n, initialFocus: r, initialFocusFa
|
|
|
1438
1427
|
}, [l, a, e]), o;
|
|
1439
1428
|
}
|
|
1440
1429
|
function Kr(e, { ownerDocument: t, container: n, containers: r, previousActiveElement: l }) {
|
|
1441
|
-
let o =
|
|
1442
|
-
|
|
1430
|
+
let o = wt(), a = !!(e & 4);
|
|
1431
|
+
Yt(t == null ? void 0 : t.defaultView, "focus", (s) => {
|
|
1443
1432
|
if (!a || !o.current) return;
|
|
1444
|
-
let i =
|
|
1433
|
+
let i = tn(r);
|
|
1445
1434
|
n.current instanceof HTMLElement && i.add(n.current);
|
|
1446
1435
|
let c = l.current;
|
|
1447
1436
|
if (!c) return;
|
|
1448
1437
|
let f = s.target;
|
|
1449
|
-
f && f instanceof HTMLElement ?
|
|
1438
|
+
f && f instanceof HTMLElement ? nn(i, f) ? (l.current = f, Q(f)) : (s.preventDefault(), s.stopPropagation(), Q(c)) : Q(l.current);
|
|
1450
1439
|
}, !0);
|
|
1451
1440
|
}
|
|
1452
|
-
function
|
|
1441
|
+
function nn(e, t) {
|
|
1453
1442
|
for (let n of e) if (n.contains(t)) return !0;
|
|
1454
1443
|
return !1;
|
|
1455
1444
|
}
|
|
1456
|
-
function
|
|
1445
|
+
function rn(e) {
|
|
1457
1446
|
var t;
|
|
1458
|
-
return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t :
|
|
1447
|
+
return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t : on) !== G || E.Children.count(e.children) === 1;
|
|
1459
1448
|
}
|
|
1460
|
-
let
|
|
1461
|
-
|
|
1449
|
+
let Ke = H(null);
|
|
1450
|
+
Ke.displayName = "TransitionContext";
|
|
1462
1451
|
var Zr = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Zr || {});
|
|
1463
1452
|
function Jr() {
|
|
1464
|
-
let e = R(
|
|
1453
|
+
let e = R(Ke);
|
|
1465
1454
|
if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
1466
1455
|
return e;
|
|
1467
1456
|
}
|
|
1468
1457
|
function Qr() {
|
|
1469
|
-
let e = R(
|
|
1458
|
+
let e = R(Ze);
|
|
1470
1459
|
if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
1471
1460
|
return e;
|
|
1472
1461
|
}
|
|
1473
|
-
let
|
|
1474
|
-
|
|
1475
|
-
function
|
|
1476
|
-
return "children" in e ?
|
|
1477
|
-
}
|
|
1478
|
-
function
|
|
1479
|
-
let n = ue(e), r = O([]), l =
|
|
1480
|
-
let
|
|
1481
|
-
|
|
1482
|
-
r.current.splice(
|
|
1462
|
+
let Ze = H(null);
|
|
1463
|
+
Ze.displayName = "NestingContext";
|
|
1464
|
+
function Je(e) {
|
|
1465
|
+
return "children" in e ? Je(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
|
|
1466
|
+
}
|
|
1467
|
+
function ln(e, t) {
|
|
1468
|
+
let n = ue(e), r = O([]), l = wt(), o = ht(), a = L((w, d = te.Hidden) => {
|
|
1469
|
+
let g = r.current.findIndex(({ el: u }) => u === w);
|
|
1470
|
+
g !== -1 && (ne(d, { [te.Unmount]() {
|
|
1471
|
+
r.current.splice(g, 1);
|
|
1483
1472
|
}, [te.Hidden]() {
|
|
1484
|
-
r.current[
|
|
1473
|
+
r.current[g].state = "hidden";
|
|
1485
1474
|
} }), o.microTask(() => {
|
|
1486
1475
|
var u;
|
|
1487
|
-
!
|
|
1476
|
+
!Je(r) && l.current && ((u = n.current) == null || u.call(n));
|
|
1488
1477
|
}));
|
|
1489
1478
|
}), s = L((w) => {
|
|
1490
|
-
let d = r.current.find(({ el:
|
|
1479
|
+
let d = r.current.find(({ el: g }) => g === w);
|
|
1491
1480
|
return d ? d.state !== "visible" && (d.state = "visible") : r.current.push({ el: w, state: "visible" }), () => a(w, te.Unmount);
|
|
1492
|
-
}), i = O([]), c = O(Promise.resolve()), f = O({ enter: [], leave: [] }), x = L((w, d,
|
|
1481
|
+
}), i = O([]), c = O(Promise.resolve()), f = O({ enter: [], leave: [] }), x = L((w, d, g) => {
|
|
1493
1482
|
i.current.splice(0), t && (t.chains.current[d] = t.chains.current[d].filter(([u]) => u !== w)), t == null || t.chains.current[d].push([w, new Promise((u) => {
|
|
1494
1483
|
i.current.push(u);
|
|
1495
1484
|
})]), t == null || t.chains.current[d].push([w, new Promise((u) => {
|
|
1496
1485
|
Promise.all(f.current[d].map(([m, p]) => p)).then(() => u());
|
|
1497
|
-
})]), d === "enter" ? c.current = c.current.then(() => t == null ? void 0 : t.wait.current).then(() =>
|
|
1498
|
-
}), b = L((w, d,
|
|
1486
|
+
})]), d === "enter" ? c.current = c.current.then(() => t == null ? void 0 : t.wait.current).then(() => g(d)) : g(d);
|
|
1487
|
+
}), b = L((w, d, g) => {
|
|
1499
1488
|
Promise.all(f.current[d].splice(0).map(([u, m]) => m)).then(() => {
|
|
1500
1489
|
var u;
|
|
1501
1490
|
(u = i.current.shift()) == null || u();
|
|
1502
|
-
}).then(() =>
|
|
1491
|
+
}).then(() => g(d));
|
|
1503
1492
|
});
|
|
1504
1493
|
return C(() => ({ children: r, register: s, unregister: a, onStart: x, onStop: b, wait: c, chains: f }), [s, a, r, x, b, f, c]);
|
|
1505
1494
|
}
|
|
1506
|
-
let
|
|
1495
|
+
let on = G, an = He.RenderStrategy;
|
|
1507
1496
|
function el(e, t) {
|
|
1508
1497
|
var n, r;
|
|
1509
|
-
let { transition: l = !0, beforeEnter: o, afterEnter: a, beforeLeave: s, afterLeave: i, enter: c, enterFrom: f, enterTo: x, entered: b, leave: w, leaveFrom: d, leaveTo:
|
|
1510
|
-
k(() => X(
|
|
1511
|
-
if ($ === te.Hidden &&
|
|
1498
|
+
let { transition: l = !0, beforeEnter: o, afterEnter: a, beforeLeave: s, afterLeave: i, enter: c, enterFrom: f, enterTo: x, entered: b, leave: w, leaveFrom: d, leaveTo: g, ...u } = e, [m, p] = S(null), v = O(null), y = rn(e), h = Z(...y ? [v, t, p] : t === null ? [] : [t]), $ = (n = u.unmount) == null || n ? te.Unmount : te.Hidden, { show: F, appear: j, initial: _ } = Jr(), [A, U] = S(F ? "visible" : "hidden"), B = Qr(), { register: X, unregister: P } = B;
|
|
1499
|
+
k(() => X(v), [X, v]), k(() => {
|
|
1500
|
+
if ($ === te.Hidden && v.current) {
|
|
1512
1501
|
if (F && A !== "visible") {
|
|
1513
1502
|
U("visible");
|
|
1514
1503
|
return;
|
|
1515
1504
|
}
|
|
1516
|
-
return ne(A, { hidden: () => P(
|
|
1505
|
+
return ne(A, { hidden: () => P(v), visible: () => X(v) });
|
|
1517
1506
|
}
|
|
1518
|
-
}, [A,
|
|
1519
|
-
let V =
|
|
1507
|
+
}, [A, v, X, P, F, $]);
|
|
1508
|
+
let V = Se();
|
|
1520
1509
|
k(() => {
|
|
1521
|
-
if (y && V && A === "visible" &&
|
|
1522
|
-
}, [
|
|
1523
|
-
let
|
|
1524
|
-
|
|
1525
|
-
}, B),
|
|
1526
|
-
|
|
1527
|
-
let
|
|
1528
|
-
K.onStart(
|
|
1529
|
-
|
|
1510
|
+
if (y && V && A === "visible" && v.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
|
|
1511
|
+
}, [v, A, V, y]);
|
|
1512
|
+
let Fe = _ && !j, Ce = j && F && _, he = O(!1), K = ln(() => {
|
|
1513
|
+
he.current || (U("hidden"), P(v));
|
|
1514
|
+
}, B), Ne = L((et) => {
|
|
1515
|
+
he.current = !0;
|
|
1516
|
+
let ke = et ? "enter" : "leave";
|
|
1517
|
+
K.onStart(v, ke, (ge) => {
|
|
1518
|
+
ge === "enter" ? o == null || o() : ge === "leave" && (s == null || s());
|
|
1530
1519
|
});
|
|
1531
|
-
}), N = L((
|
|
1532
|
-
let
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
}),
|
|
1520
|
+
}), N = L((et) => {
|
|
1521
|
+
let ke = et ? "enter" : "leave";
|
|
1522
|
+
he.current = !1, K.onStop(v, ke, (ge) => {
|
|
1523
|
+
ge === "enter" ? a == null || a() : ge === "leave" && (i == null || i());
|
|
1524
|
+
}), ke === "leave" && !Je(K) && (U("hidden"), P(v));
|
|
1536
1525
|
});
|
|
1537
1526
|
M(() => {
|
|
1538
|
-
y && l || (
|
|
1527
|
+
y && l || (Ne(F), N(F));
|
|
1539
1528
|
}, [F, y, l]);
|
|
1540
|
-
let
|
|
1541
|
-
A === "visible" && (
|
|
1542
|
-
let
|
|
1543
|
-
return E.createElement(
|
|
1529
|
+
let Ae = !(!l || !y || !V || Fe), [, I] = Er(Ae, m, F, { start: Ne, end: N }), dn = le({ ref: h, className: ((r = it(u.className, Ce && c, Ce && f, I.enter && c, I.enter && I.closed && f, I.enter && !I.closed && x, I.leave && w, I.leave && !I.closed && d, I.leave && I.closed && g, !I.transition && F && b)) == null ? void 0 : r.trim()) || void 0, ...br(I) }), ve = 0;
|
|
1530
|
+
A === "visible" && (ve |= z.Open), A === "hidden" && (ve |= z.Closed), I.enter && (ve |= z.Opening), I.leave && (ve |= z.Closing);
|
|
1531
|
+
let fn = W();
|
|
1532
|
+
return E.createElement(Ze.Provider, { value: K }, E.createElement(Pr, { value: ve }, fn({ ourProps: dn, theirProps: u, defaultTag: on, features: an, visible: A === "visible", name: "Transition.Child" })));
|
|
1544
1533
|
}
|
|
1545
1534
|
function tl(e, t) {
|
|
1546
|
-
let { show: n, appear: r = !1, unmount: l = !0, ...o } = e, a = O(null), s =
|
|
1547
|
-
|
|
1548
|
-
let c =
|
|
1535
|
+
let { show: n, appear: r = !1, unmount: l = !0, ...o } = e, a = O(null), s = rn(e), i = Z(...s ? [a, t] : t === null ? [] : [t]);
|
|
1536
|
+
Se();
|
|
1537
|
+
let c = Ge();
|
|
1549
1538
|
if (n === void 0 && c !== null && (n = (c & z.Open) === z.Open), n === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
|
|
1550
|
-
let [f, x] = S(n ? "visible" : "hidden"), b =
|
|
1539
|
+
let [f, x] = S(n ? "visible" : "hidden"), b = ln(() => {
|
|
1551
1540
|
n || x("hidden");
|
|
1552
|
-
}), [w, d] = S(!0),
|
|
1541
|
+
}), [w, d] = S(!0), g = O([n]);
|
|
1553
1542
|
k(() => {
|
|
1554
|
-
w !== !1 &&
|
|
1555
|
-
}, [
|
|
1543
|
+
w !== !1 && g.current[g.current.length - 1] !== n && (g.current.push(n), d(!1));
|
|
1544
|
+
}, [g, n]);
|
|
1556
1545
|
let u = C(() => ({ show: n, appear: r, initial: w }), [n, r, w]);
|
|
1557
1546
|
k(() => {
|
|
1558
|
-
n ? x("visible") : !
|
|
1547
|
+
n ? x("visible") : !Je(b) && a.current !== null && x("hidden");
|
|
1559
1548
|
}, [n, b]);
|
|
1560
1549
|
let m = { unmount: l }, p = L(() => {
|
|
1561
1550
|
var h;
|
|
1562
1551
|
w && d(!1), (h = e.beforeEnter) == null || h.call(e);
|
|
1563
|
-
}),
|
|
1552
|
+
}), v = L(() => {
|
|
1564
1553
|
var h;
|
|
1565
1554
|
w && d(!1), (h = e.beforeLeave) == null || h.call(e);
|
|
1566
1555
|
}), y = W();
|
|
1567
|
-
return E.createElement(
|
|
1556
|
+
return E.createElement(Ze.Provider, { value: b }, E.createElement(Ke.Provider, { value: u }, y({ ourProps: { ...m, as: G, children: E.createElement(sn, { ref: i, ...m, ...o, beforeEnter: p, beforeLeave: v }) }, theirProps: {}, defaultTag: G, features: an, visible: f === "visible", name: "Transition" })));
|
|
1568
1557
|
}
|
|
1569
1558
|
function nl(e, t) {
|
|
1570
|
-
let n = R(
|
|
1571
|
-
return E.createElement(E.Fragment, null, !n && r ? E.createElement(
|
|
1559
|
+
let n = R(Ke) !== null, r = Ge() !== null;
|
|
1560
|
+
return E.createElement(E.Fragment, null, !n && r ? E.createElement(ct, { ref: t, ...e }) : E.createElement(sn, { ref: t, ...e }));
|
|
1572
1561
|
}
|
|
1573
|
-
let
|
|
1562
|
+
let ct = D(tl), sn = D(el), pe = D(nl), un = Object.assign(ct, { Child: pe, Root: ct });
|
|
1574
1563
|
var rl = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(rl || {}), ll = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(ll || {});
|
|
1575
1564
|
let il = { 0(e, t) {
|
|
1576
1565
|
return e.titleId === t.id ? e : { ...e, titleId: t.id };
|
|
1577
|
-
} },
|
|
1578
|
-
|
|
1579
|
-
function
|
|
1580
|
-
let t = R(
|
|
1566
|
+
} }, xt = H(null);
|
|
1567
|
+
xt.displayName = "DialogContext";
|
|
1568
|
+
function Qe(e) {
|
|
1569
|
+
let t = R(xt);
|
|
1581
1570
|
if (t === null) {
|
|
1582
1571
|
let n = new Error(`<${e} /> is missing a parent <Dialog /> component.`);
|
|
1583
|
-
throw Error.captureStackTrace && Error.captureStackTrace(n,
|
|
1572
|
+
throw Error.captureStackTrace && Error.captureStackTrace(n, Qe), n;
|
|
1584
1573
|
}
|
|
1585
1574
|
return t;
|
|
1586
1575
|
}
|
|
@@ -1588,19 +1577,19 @@ function ol(e, t) {
|
|
|
1588
1577
|
return ne(t.type, il, e, t);
|
|
1589
1578
|
}
|
|
1590
1579
|
let St = D(function(e, t) {
|
|
1591
|
-
let n =
|
|
1580
|
+
let n = Me(), { id: r = `headlessui-dialog-${n}`, open: l, onClose: o, initialFocus: a, role: s = "dialog", autoFocus: i = !0, __demoMode: c = !1, unmount: f = !1, ...x } = e, b = O(!1);
|
|
1592
1581
|
s = function() {
|
|
1593
1582
|
return s === "dialog" || s === "alertdialog" ? s : (b.current || (b.current = !0, console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog");
|
|
1594
1583
|
}();
|
|
1595
|
-
let w =
|
|
1584
|
+
let w = Ge();
|
|
1596
1585
|
l === void 0 && w !== null && (l = (w & z.Open) === z.Open);
|
|
1597
|
-
let d = O(null),
|
|
1586
|
+
let d = O(null), g = Z(d, t), u = Le(d), m = l ? 0 : 1, [p, v] = xn(ol, { titleId: null, descriptionId: null, panelRef: yn() }), y = L(() => o(!1)), h = L((N) => v({ type: 0, id: N })), $ = Se() ? m === 0 : !1, [F, j] = Rr(), _ = { get current() {
|
|
1598
1587
|
var N;
|
|
1599
1588
|
return (N = p.panelRef.current) != null ? N : d.current;
|
|
1600
|
-
} }, A =
|
|
1589
|
+
} }, A = en(), { resolveContainers: U } = Wr({ mainTreeNode: A, portals: F, defaultContainers: [_] }), B = w !== null ? (w & z.Closing) === z.Closing : !1;
|
|
1601
1590
|
Qn(c || B ? !1 : $, { allowed: L(() => {
|
|
1602
|
-
var N,
|
|
1603
|
-
return [(
|
|
1591
|
+
var N, Ae;
|
|
1592
|
+
return [(Ae = (N = d.current) == null ? void 0 : N.closest("[data-headlessui-portal]")) != null ? Ae : null];
|
|
1604
1593
|
}), disallowed: L(() => {
|
|
1605
1594
|
var N;
|
|
1606
1595
|
return [(N = A == null ? void 0 : A.closest("body > *:not(#headlessui-portal-root)")) != null ? N : null];
|
|
@@ -1609,43 +1598,43 @@ let St = D(function(e, t) {
|
|
|
1609
1598
|
}), Ur($, u == null ? void 0 : u.defaultView, (N) => {
|
|
1610
1599
|
N.preventDefault(), N.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), y();
|
|
1611
1600
|
}), wr(c || B ? !1 : $, u, U), er($, d, y);
|
|
1612
|
-
let [X, P] = Xn(), V = C(() => [{ dialogState: m, close: y, setTitleId: h, unmount: f }, p], [m, p, y, h, f]),
|
|
1613
|
-
$ && !c && (K |= ie.RestoreFocus, K |= ie.TabLock, i && (K |= ie.AutoFocus),
|
|
1614
|
-
let
|
|
1615
|
-
return E.createElement(Mr, null, E.createElement(Mt, { force: !0 }, E.createElement(jr, null, E.createElement(
|
|
1616
|
-
}), al = "div", sl =
|
|
1601
|
+
let [X, P] = Xn(), V = C(() => [{ dialogState: m, close: y, setTitleId: h, unmount: f }, p], [m, p, y, h, f]), Fe = C(() => ({ open: m === 0 }), [m]), Ce = { ref: g, id: r, role: s, tabIndex: -1, "aria-modal": c ? void 0 : m === 0 ? !0 : void 0, "aria-labelledby": p.titleId, "aria-describedby": X, unmount: f }, he = !Hr(), K = ie.None;
|
|
1602
|
+
$ && !c && (K |= ie.RestoreFocus, K |= ie.TabLock, i && (K |= ie.AutoFocus), he && (K |= ie.InitialFocus));
|
|
1603
|
+
let Ne = W();
|
|
1604
|
+
return E.createElement(Mr, null, E.createElement(Mt, { force: !0 }, E.createElement(jr, null, E.createElement(xt.Provider, { value: V }, E.createElement(Jt, { target: d }, E.createElement(Mt, { force: !1 }, E.createElement(P, { slot: Fe }, E.createElement(j, null, E.createElement(qr, { initialFocus: a, initialFocusFallback: d, containers: U, features: K }, E.createElement(Kn, { value: y }, Ne({ ourProps: Ce, theirProps: x, slot: Fe, defaultTag: al, features: sl, visible: m === 0, name: "Dialog" })))))))))));
|
|
1605
|
+
}), al = "div", sl = He.RenderStrategy | He.Static;
|
|
1617
1606
|
function ul(e, t) {
|
|
1618
|
-
let { transition: n = !1, open: r, ...l } = e, o =
|
|
1607
|
+
let { transition: n = !1, open: r, ...l } = e, o = Ge(), a = e.hasOwnProperty("open") || o !== null, s = e.hasOwnProperty("onClose");
|
|
1619
1608
|
if (!a && !s) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
|
|
1620
1609
|
if (!a) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");
|
|
1621
1610
|
if (!s) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
|
|
1622
1611
|
if (!o && typeof e.open != "boolean") throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);
|
|
1623
1612
|
if (typeof e.onClose != "function") throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);
|
|
1624
|
-
return (r !== void 0 || n) && !l.static ? E.createElement(Lt, null, E.createElement(
|
|
1613
|
+
return (r !== void 0 || n) && !l.static ? E.createElement(Lt, null, E.createElement(un, { show: r, transition: n, unmount: l.unmount }, E.createElement(St, { ref: t, ...l }))) : E.createElement(Lt, null, E.createElement(St, { ref: t, open: r, ...l }));
|
|
1625
1614
|
}
|
|
1626
1615
|
let cl = "div";
|
|
1627
1616
|
function dl(e, t) {
|
|
1628
|
-
let n =
|
|
1617
|
+
let n = Me(), { id: r = `headlessui-dialog-panel-${n}`, transition: l = !1, ...o } = e, [{ dialogState: a, unmount: s }, i] = Qe("Dialog.Panel"), c = Z(t, i.panelRef), f = C(() => ({ open: a === 0 }), [a]), x = L((u) => {
|
|
1629
1618
|
u.stopPropagation();
|
|
1630
|
-
}), b = { ref: c, id: r, onClick: x }, w = l ?
|
|
1631
|
-
return E.createElement(w, { ...d },
|
|
1619
|
+
}), b = { ref: c, id: r, onClick: x }, w = l ? pe : G, d = l ? { unmount: s } : {}, g = W();
|
|
1620
|
+
return E.createElement(w, { ...d }, g({ ourProps: b, theirProps: o, slot: f, defaultTag: cl, name: "Dialog.Panel" }));
|
|
1632
1621
|
}
|
|
1633
1622
|
let fl = "div";
|
|
1634
1623
|
function ml(e, t) {
|
|
1635
|
-
let { transition: n = !1, ...r } = e, [{ dialogState: l, unmount: o }] =
|
|
1624
|
+
let { transition: n = !1, ...r } = e, [{ dialogState: l, unmount: o }] = Qe("Dialog.Backdrop"), a = C(() => ({ open: l === 0 }), [l]), s = { ref: t, "aria-hidden": !0 }, i = n ? pe : G, c = n ? { unmount: o } : {}, f = W();
|
|
1636
1625
|
return E.createElement(i, { ...c }, f({ ourProps: s, theirProps: r, slot: a, defaultTag: fl, name: "Dialog.Backdrop" }));
|
|
1637
1626
|
}
|
|
1638
1627
|
let pl = "h2";
|
|
1639
1628
|
function hl(e, t) {
|
|
1640
|
-
let n =
|
|
1629
|
+
let n = Me(), { id: r = `headlessui-dialog-title-${n}`, ...l } = e, [{ dialogState: o, setTitleId: a }] = Qe("Dialog.Title"), s = Z(t);
|
|
1641
1630
|
M(() => (a(r), () => a(null)), [r, a]);
|
|
1642
1631
|
let i = C(() => ({ open: o === 0 }), [o]), c = { ref: s, id: r };
|
|
1643
1632
|
return W()({ ourProps: c, theirProps: l, slot: i, defaultTag: pl, name: "Dialog.Title" });
|
|
1644
1633
|
}
|
|
1645
|
-
let vl = D(ul),
|
|
1634
|
+
let vl = D(ul), yt = D(dl);
|
|
1646
1635
|
D(ml);
|
|
1647
|
-
let gl = D(hl), wl = Object.assign(vl, { Panel:
|
|
1648
|
-
function
|
|
1636
|
+
let gl = D(hl), wl = Object.assign(vl, { Panel: yt, Title: gl, Description: zn });
|
|
1637
|
+
function cn({ onClick: e }) {
|
|
1649
1638
|
return /* @__PURE__ */ se(
|
|
1650
1639
|
"button",
|
|
1651
1640
|
{
|
|
@@ -1683,13 +1672,13 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1683
1672
|
return /* @__PURE__ */ T("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ T(
|
|
1684
1673
|
"div",
|
|
1685
1674
|
{
|
|
1686
|
-
className:
|
|
1675
|
+
className: Ue("im-modal-positioner flex min-h-full justify-center", {
|
|
1687
1676
|
"items-start": t.position === "top",
|
|
1688
1677
|
"items-center": t.position === "center",
|
|
1689
1678
|
"items-end": t.position === "bottom"
|
|
1690
1679
|
}),
|
|
1691
1680
|
children: /* @__PURE__ */ T(
|
|
1692
|
-
|
|
1681
|
+
pe,
|
|
1693
1682
|
{
|
|
1694
1683
|
as: "div",
|
|
1695
1684
|
enterFrom: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
@@ -1698,7 +1687,7 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1698
1687
|
leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
1699
1688
|
afterEnter: () => l(!0),
|
|
1700
1689
|
afterLeave: e.afterLeave,
|
|
1701
|
-
className:
|
|
1690
|
+
className: Ue("im-modal-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
|
|
1702
1691
|
"sm:max-w-sm": t.maxWidth === "sm",
|
|
1703
1692
|
"sm:max-w-md": t.maxWidth === "md",
|
|
1704
1693
|
"sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
|
|
@@ -1711,12 +1700,12 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1711
1700
|
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl"
|
|
1712
1701
|
}),
|
|
1713
1702
|
children: /* @__PURE__ */ se(
|
|
1714
|
-
|
|
1703
|
+
yt,
|
|
1715
1704
|
{
|
|
1716
1705
|
className: `im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`,
|
|
1717
1706
|
"data-inertiaui-modal-entered": r,
|
|
1718
1707
|
children: [
|
|
1719
|
-
t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(
|
|
1708
|
+
t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(cn, { onClick: e.close }) }),
|
|
1720
1709
|
typeof n == "function" ? n({ modalContext: e, config: t }) : n
|
|
1721
1710
|
]
|
|
1722
1711
|
}
|
|
@@ -1730,12 +1719,12 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1730
1719
|
return /* @__PURE__ */ T("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ T(
|
|
1731
1720
|
"div",
|
|
1732
1721
|
{
|
|
1733
|
-
className:
|
|
1722
|
+
className: Ue("im-slideover-positioner flex min-h-full items-center", {
|
|
1734
1723
|
"justify-start rtl:justify-end": (t == null ? void 0 : t.position) === "left",
|
|
1735
1724
|
"justify-end rtl:justify-start": (t == null ? void 0 : t.position) === "right"
|
|
1736
1725
|
}),
|
|
1737
1726
|
children: /* @__PURE__ */ T(
|
|
1738
|
-
|
|
1727
|
+
pe,
|
|
1739
1728
|
{
|
|
1740
1729
|
as: "div",
|
|
1741
1730
|
enterFrom: `opacity-0 ${t.position === "left" ? "-translate-x-full" : "translate-x-full"}`,
|
|
@@ -1744,7 +1733,7 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1744
1733
|
leaveTo: `opacity-0 ${t.position === "left" ? "-translate-x-full" : "translate-x-full"}`,
|
|
1745
1734
|
afterEnter: () => l(!0),
|
|
1746
1735
|
afterLeave: e.afterLeave,
|
|
1747
|
-
className:
|
|
1736
|
+
className: Ue("im-slideover-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
|
|
1748
1737
|
"sm:max-w-sm": t.maxWidth === "sm",
|
|
1749
1738
|
"sm:max-w-md": t.maxWidth === "md",
|
|
1750
1739
|
"sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
|
|
@@ -1757,12 +1746,12 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1757
1746
|
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl"
|
|
1758
1747
|
}),
|
|
1759
1748
|
children: /* @__PURE__ */ se(
|
|
1760
|
-
|
|
1749
|
+
yt,
|
|
1761
1750
|
{
|
|
1762
1751
|
className: `im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`,
|
|
1763
1752
|
"data-inertiaui-modal-entered": r,
|
|
1764
1753
|
children: [
|
|
1765
|
-
t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(
|
|
1754
|
+
t.closeButton && /* @__PURE__ */ T("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ T(cn, { onClick: e.close }) }),
|
|
1766
1755
|
typeof n == "function" ? n({ modalContext: e, config: t }) : n
|
|
1767
1756
|
]
|
|
1768
1757
|
}
|
|
@@ -1771,10 +1760,10 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1771
1760
|
)
|
|
1772
1761
|
}
|
|
1773
1762
|
) });
|
|
1774
|
-
}, bl =
|
|
1763
|
+
}, bl = dt(({ name: e, children: t, onFocus: n = null, onBlur: r = null, onClose: l = null, onSuccess: o = null, onAfterLeave: a = null, ...s }, i) => {
|
|
1775
1764
|
const c = (x) => typeof t == "function" ? t(x) : t, f = O(null);
|
|
1776
1765
|
return Ft(i, () => f.current, [f]), /* @__PURE__ */ T(
|
|
1777
|
-
|
|
1766
|
+
Rt,
|
|
1778
1767
|
{
|
|
1779
1768
|
ref: f,
|
|
1780
1769
|
name: e,
|
|
@@ -1788,21 +1777,21 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1788
1777
|
close: b,
|
|
1789
1778
|
config: w,
|
|
1790
1779
|
emit: d,
|
|
1791
|
-
getChildModal:
|
|
1780
|
+
getChildModal: g,
|
|
1792
1781
|
getParentModal: u,
|
|
1793
1782
|
id: m,
|
|
1794
1783
|
index: p,
|
|
1795
|
-
isOpen:
|
|
1784
|
+
isOpen: v,
|
|
1796
1785
|
modalContext: y,
|
|
1797
1786
|
onTopOfStack: h,
|
|
1798
1787
|
reload: $,
|
|
1799
1788
|
setOpen: F,
|
|
1800
1789
|
shouldRender: j
|
|
1801
1790
|
}) => /* @__PURE__ */ T(
|
|
1802
|
-
|
|
1791
|
+
un,
|
|
1803
1792
|
{
|
|
1804
1793
|
appear: !0,
|
|
1805
|
-
show:
|
|
1794
|
+
show: v ?? !1,
|
|
1806
1795
|
afterLeave: a,
|
|
1807
1796
|
children: /* @__PURE__ */ se(
|
|
1808
1797
|
wl,
|
|
@@ -1814,7 +1803,7 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1814
1803
|
"data-inertiaui-modal-index": p,
|
|
1815
1804
|
children: [
|
|
1816
1805
|
p === 0 ? /* @__PURE__ */ T(
|
|
1817
|
-
|
|
1806
|
+
pe,
|
|
1818
1807
|
{
|
|
1819
1808
|
enter: "transition transform ease-in-out duration-300",
|
|
1820
1809
|
enterFrom: "opacity-0",
|
|
@@ -1842,11 +1831,11 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1842
1831
|
close: b,
|
|
1843
1832
|
config: w,
|
|
1844
1833
|
emit: d,
|
|
1845
|
-
getChildModal:
|
|
1834
|
+
getChildModal: g,
|
|
1846
1835
|
getParentModal: u,
|
|
1847
1836
|
id: m,
|
|
1848
1837
|
index: p,
|
|
1849
|
-
isOpen:
|
|
1838
|
+
isOpen: v,
|
|
1850
1839
|
modalContext: y,
|
|
1851
1840
|
onTopOfStack: h,
|
|
1852
1841
|
reload: $,
|
|
@@ -1864,11 +1853,11 @@ const xl = ({ modalContext: e, config: t, children: n }) => {
|
|
|
1864
1853
|
close: b,
|
|
1865
1854
|
config: w,
|
|
1866
1855
|
emit: d,
|
|
1867
|
-
getChildModal:
|
|
1856
|
+
getChildModal: g,
|
|
1868
1857
|
getParentModal: u,
|
|
1869
1858
|
id: m,
|
|
1870
1859
|
index: p,
|
|
1871
|
-
isOpen:
|
|
1860
|
+
isOpen: v,
|
|
1872
1861
|
modalContext: y,
|
|
1873
1862
|
onTopOfStack: h,
|
|
1874
1863
|
reload: $,
|
|
@@ -1902,11 +1891,11 @@ const kl = ({
|
|
|
1902
1891
|
onSuccess: b = null,
|
|
1903
1892
|
navigate: w = null,
|
|
1904
1893
|
children: d,
|
|
1905
|
-
...
|
|
1894
|
+
...g
|
|
1906
1895
|
}) => {
|
|
1907
|
-
const [u, m] = S(!1), [p,
|
|
1908
|
-
Object.keys(
|
|
1909
|
-
bt.includes(P) || (P.startsWith("on") && typeof
|
|
1896
|
+
const [u, m] = S(!1), [p, v] = S(null), { stack: y, visit: h } = Ve(), $ = C(() => w ?? mt("navigate"), [w]), F = {}, j = {};
|
|
1897
|
+
Object.keys(g).forEach((P) => {
|
|
1898
|
+
bt.includes(P) || (P.startsWith("on") && typeof g[P] == "function" ? P.toLowerCase() in window ? F[P] = g[P] : j[P] = g[P] : F[P] = g[P]);
|
|
1910
1899
|
});
|
|
1911
1900
|
const [_, A] = S(!1);
|
|
1912
1901
|
M(() => {
|
|
@@ -1915,7 +1904,7 @@ const kl = ({
|
|
|
1915
1904
|
const U = Y(() => {
|
|
1916
1905
|
i == null || i();
|
|
1917
1906
|
}, [i]), B = Y(() => {
|
|
1918
|
-
|
|
1907
|
+
v(null), a == null || a();
|
|
1919
1908
|
}, [a]), X = Y(
|
|
1920
1909
|
(P) => {
|
|
1921
1910
|
P == null || P.preventDefault(), !u && (e.startsWith("#") || (m(!0), x == null || x()), h(
|
|
@@ -1923,18 +1912,18 @@ const kl = ({
|
|
|
1923
1912
|
t,
|
|
1924
1913
|
n,
|
|
1925
1914
|
l,
|
|
1926
|
-
Mn(
|
|
1915
|
+
Mn(Ct(g, bt)),
|
|
1927
1916
|
() => U(y.length),
|
|
1928
1917
|
B,
|
|
1929
1918
|
o,
|
|
1930
1919
|
$
|
|
1931
1920
|
).then((V) => {
|
|
1932
|
-
|
|
1921
|
+
v(V), V.registerEventListenersFromProps(j), b == null || b();
|
|
1933
1922
|
}).catch((V) => {
|
|
1934
1923
|
console.error(V), c == null || c(V);
|
|
1935
1924
|
}).finally(() => m(!1)));
|
|
1936
1925
|
},
|
|
1937
|
-
[e, t, n, l, o,
|
|
1926
|
+
[e, t, n, l, o, g, U, B]
|
|
1938
1927
|
);
|
|
1939
1928
|
return /* @__PURE__ */ T(
|
|
1940
1929
|
r,
|
|
@@ -1947,22 +1936,22 @@ const kl = ({
|
|
|
1947
1936
|
);
|
|
1948
1937
|
};
|
|
1949
1938
|
function Il() {
|
|
1950
|
-
return
|
|
1939
|
+
return Ve().stack[kt()] ?? null;
|
|
1951
1940
|
}
|
|
1952
|
-
const Rl = (e) => (t) => (t.default.layout = (n) =>
|
|
1941
|
+
const Rl = (e) => (t) => (t.default.layout = (n) => De(e, {}, n), t);
|
|
1953
1942
|
export {
|
|
1954
|
-
|
|
1943
|
+
Rt as HeadlessModal,
|
|
1955
1944
|
bl as Modal,
|
|
1956
1945
|
kl as ModalLink,
|
|
1957
1946
|
Cn as ModalRoot,
|
|
1958
1947
|
Sn as ModalStackProvider,
|
|
1959
|
-
|
|
1948
|
+
mt as getConfig,
|
|
1960
1949
|
Fn as initFromPageProps,
|
|
1961
1950
|
Fl as putConfig,
|
|
1962
1951
|
Cl as renderApp,
|
|
1963
1952
|
Sl as resetConfig,
|
|
1964
1953
|
Rl as setPageLayout,
|
|
1965
1954
|
Il as useModal,
|
|
1966
|
-
|
|
1967
|
-
|
|
1955
|
+
kt as useModalIndex,
|
|
1956
|
+
Ve as useModalStack
|
|
1968
1957
|
};
|