@inertiaui/modal-react 1.0.0-beta-3 → 1.0.0-beta-5
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 +1051 -1018
- package/dist/inertiaui-modal.umd.cjs +6 -6
- package/package.json +3 -3
- package/src/ModalRoot.jsx +15 -5
package/dist/inertiaui-modal.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import * as
|
|
5
|
-
import $, { createContext as z, useContext as H, useEffect as L, useRef as S, useState as
|
|
6
|
-
import { jsxs as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
1
|
+
var Ur = Object.defineProperty;
|
|
2
|
+
var Hr = (e, t, r) => t in e ? Ur(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
|
|
3
|
+
var K = (e, t, r) => Hr(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
|
+
import * as Ce from "react";
|
|
5
|
+
import $, { createContext as z, useContext as H, useEffect as L, useRef as S, useState as F, createElement as Re, useMemo as _, forwardRef as Pt, useImperativeHandle as tr, useLayoutEffect as Vr, useCallback as W, Fragment as ue, isValidElement as Br, cloneElement as Xr, useId as _e, useSyncExternalStore as zr, useReducer as Gr, createRef as Kr } from "react";
|
|
6
|
+
import { jsxs as he, Fragment as Mt, jsx as P } from "react/jsx-runtime";
|
|
7
|
+
import Ge from "axios";
|
|
8
|
+
import * as _t from "@inertiajs/react";
|
|
9
|
+
import { usePage as qr, router as Me } from "@inertiajs/react";
|
|
10
|
+
import { mergeDataIntoQueryString as Yr } from "@inertiajs/core";
|
|
11
|
+
import { createPortal as Zr } from "react-dom";
|
|
12
|
+
const Te = {
|
|
12
13
|
type: "modal",
|
|
13
14
|
navigate: !1,
|
|
14
15
|
modal: {
|
|
@@ -28,20 +29,20 @@ const Se = {
|
|
|
28
29
|
position: "right"
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
|
-
class
|
|
32
|
+
class Jr {
|
|
32
33
|
constructor() {
|
|
33
34
|
this.config = {}, this.reset();
|
|
34
35
|
}
|
|
35
36
|
reset() {
|
|
36
|
-
this.config = JSON.parse(JSON.stringify(
|
|
37
|
+
this.config = JSON.parse(JSON.stringify(Te));
|
|
37
38
|
}
|
|
38
39
|
put(t, r) {
|
|
39
40
|
if (typeof t == "object") {
|
|
40
41
|
this.config = {
|
|
41
|
-
type: t.type ??
|
|
42
|
-
navigate: t.navigate ??
|
|
43
|
-
modal: { ...
|
|
44
|
-
slideover: { ...
|
|
42
|
+
type: t.type ?? Te.type,
|
|
43
|
+
navigate: t.navigate ?? Te.navigate,
|
|
44
|
+
modal: { ...Te.modal, ...t.modal ?? {} },
|
|
45
|
+
slideover: { ...Te.slideover, ...t.slideover ?? {} }
|
|
45
46
|
};
|
|
46
47
|
return;
|
|
47
48
|
}
|
|
@@ -64,30 +65,30 @@ class Gr {
|
|
|
64
65
|
return n;
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
|
-
const
|
|
68
|
-
function
|
|
68
|
+
const Je = new Jr(), Ti = () => Je.reset(), Pi = (e, t) => Je.put(e, t), Lt = (e) => Je.get(e), we = (e, t) => Je.get(e ? `slideover.${t}` : `modal.${t}`);
|
|
69
|
+
function Qr(e, t) {
|
|
69
70
|
const r = typeof window < "u" ? window.location.origin : "http://localhost";
|
|
70
71
|
return e = typeof e == "string" ? new URL(e, r) : e, t = typeof t == "string" ? new URL(t, r) : t, `${e.origin}${e.pathname}` == `${t.origin}${t.pathname}`;
|
|
71
72
|
}
|
|
72
|
-
function
|
|
73
|
+
function ft(e = "inertiaui_modal_") {
|
|
73
74
|
return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? `${e}${crypto.randomUUID()}` : `${e}${Date.now().toString(36)}_${Math.random().toString(36).substr(2, 9)}`;
|
|
74
75
|
}
|
|
75
76
|
function be(e) {
|
|
76
77
|
return typeof e == "string" ? e.toLowerCase() : e;
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
+
function en(e, t, r = !1) {
|
|
79
80
|
return r && (t = t.map(be)), Array.isArray(e) ? e.filter((n) => !t.includes(r ? be(n) : n)) : Object.keys(e).reduce((n, l) => (t.includes(r ? be(l) : l) || (n[l] = e[l]), n), {});
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function tn(e, t, r = !1) {
|
|
82
83
|
return r && (t = t.map(be)), Array.isArray(e) ? e.filter((n) => t.includes(r ? be(n) : n)) : Object.keys(e).reduce((n, l) => (t.includes(r ? be(l) : l) && (n[l] = e[l]), n), {});
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
+
function rn(e) {
|
|
85
86
|
return Array.isArray(e) ? e.filter((t) => t !== null) : Object.keys(e).reduce((t, r) => (r in e && e[r] !== null && (t[r] = e[r]), t), {});
|
|
86
87
|
}
|
|
87
88
|
function Pe(e) {
|
|
88
89
|
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, r) => r.toUpperCase()), e = e.replace(/(.)(?=[A-Z])/g, "$1-"), e.toLowerCase()) : e) : "";
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function nn(e) {
|
|
91
92
|
if (typeof window < "u")
|
|
92
93
|
return e.toLowerCase() in window;
|
|
93
94
|
if (typeof document < "u") {
|
|
@@ -107,84 +108,84 @@ function Jr(e) {
|
|
|
107
108
|
/^on(transitionstart|transitionend|transitionrun|transitioncancel)$/
|
|
108
109
|
].some((n) => n.test(t));
|
|
109
110
|
}
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
let
|
|
113
|
-
const
|
|
114
|
-
const [t, r] =
|
|
111
|
+
const Qe = z(null);
|
|
112
|
+
Qe.displayName = "ModalStackContext";
|
|
113
|
+
let rr = null, nr = null, xe = null, Ve = {}, pt = [], ye = {};
|
|
114
|
+
const ln = ({ children: e }) => {
|
|
115
|
+
const [t, r] = F([]), [n, l] = F({}), i = (h) => {
|
|
115
116
|
r((c) => {
|
|
116
|
-
const d = h([...c]), v = (
|
|
117
|
-
var
|
|
118
|
-
return d.length < 2 ? !0 : ((
|
|
117
|
+
const d = h([...c]), v = (w) => {
|
|
118
|
+
var p;
|
|
119
|
+
return d.length < 2 ? !0 : ((p = d.map((x) => ({ id: x.id, shouldRender: x.shouldRender })).reverse().find((x) => x.shouldRender)) == null ? void 0 : p.id) === w;
|
|
119
120
|
};
|
|
120
|
-
return d.forEach((
|
|
121
|
-
d[
|
|
121
|
+
return d.forEach((w, p) => {
|
|
122
|
+
d[p].onTopOfStack = v(w.id), d[p].getParentModal = () => p < 1 ? null : d.slice(0, p).reverse().find((x) => x.isOpen), d[p].getChildModal = () => p === d.length - 1 ? null : d.slice(p + 1).find((x) => x.isOpen);
|
|
122
123
|
}), d;
|
|
123
124
|
});
|
|
124
125
|
};
|
|
125
126
|
L(() => {
|
|
126
|
-
|
|
127
|
+
pt = t;
|
|
127
128
|
}, [t]);
|
|
128
|
-
class
|
|
129
|
-
constructor(c, d, v,
|
|
130
|
-
|
|
129
|
+
class a {
|
|
130
|
+
constructor(c, d, v, w, p) {
|
|
131
|
+
K(this, "show", () => {
|
|
131
132
|
i(
|
|
132
133
|
(c) => c.map((d) => (d.id === this.id && !d.isOpen && (d.isOpen = !0, d.shouldRender = !0), d))
|
|
133
134
|
);
|
|
134
135
|
});
|
|
135
|
-
|
|
136
|
+
K(this, "setOpen", (c) => {
|
|
136
137
|
c ? this.show() : this.close();
|
|
137
138
|
});
|
|
138
|
-
|
|
139
|
+
K(this, "close", () => {
|
|
139
140
|
i((c) => {
|
|
140
141
|
let d = !1;
|
|
141
|
-
const v = c.map((
|
|
142
|
-
var
|
|
143
|
-
return
|
|
144
|
-
|
|
145
|
-
}),
|
|
142
|
+
const v = c.map((w) => {
|
|
143
|
+
var p;
|
|
144
|
+
return w.id === this.id && w.isOpen && (Object.keys(w.listeners).forEach((x) => {
|
|
145
|
+
w.off(x);
|
|
146
|
+
}), w.isOpen = !1, (p = w.onCloseCallback) == null || p.call(w), d = !0), w;
|
|
146
147
|
});
|
|
147
148
|
return d ? v : c;
|
|
148
149
|
});
|
|
149
150
|
});
|
|
150
|
-
|
|
151
|
+
K(this, "afterLeave", () => {
|
|
151
152
|
this.isOpen || i((c) => {
|
|
152
153
|
const d = c.map((v) => {
|
|
153
|
-
var
|
|
154
|
-
return v.id === this.id && !v.isOpen && (v.shouldRender = !1, (
|
|
154
|
+
var w;
|
|
155
|
+
return v.id === this.id && !v.isOpen && (v.shouldRender = !1, (w = v.afterLeaveCallback) == null || w.call(v), v.afterLeaveCallback = null), v;
|
|
155
156
|
});
|
|
156
157
|
return this.index === 0 ? [] : d;
|
|
157
158
|
});
|
|
158
159
|
});
|
|
159
|
-
|
|
160
|
+
K(this, "on", (c, d) => {
|
|
160
161
|
c = Pe(c), this.listeners[c] = this.listeners[c] ?? [], this.listeners[c].push(d);
|
|
161
162
|
});
|
|
162
|
-
|
|
163
|
+
K(this, "off", (c, d) => {
|
|
163
164
|
var v;
|
|
164
|
-
c = Pe(c), d ? this.listeners[c] = ((v = this.listeners[c]) == null ? void 0 : v.filter((
|
|
165
|
+
c = Pe(c), d ? this.listeners[c] = ((v = this.listeners[c]) == null ? void 0 : v.filter((w) => w !== d)) ?? [] : delete this.listeners[c];
|
|
165
166
|
});
|
|
166
|
-
|
|
167
|
+
K(this, "emit", (c, ...d) => {
|
|
167
168
|
var v;
|
|
168
|
-
(v = this.listeners[Pe(c)]) == null || v.forEach((
|
|
169
|
+
(v = this.listeners[Pe(c)]) == null || v.forEach((w) => w(...d));
|
|
169
170
|
});
|
|
170
|
-
|
|
171
|
+
K(this, "registerEventListenersFromProps", (c) => {
|
|
171
172
|
const d = [];
|
|
172
173
|
return Object.keys(c).filter((v) => v.startsWith("on")).forEach((v) => {
|
|
173
|
-
const
|
|
174
|
-
this.on(
|
|
174
|
+
const w = Pe(v).replace(/^on-/, "");
|
|
175
|
+
this.on(w, c[v]), d.push(() => this.off(w, c[v]));
|
|
175
176
|
}), () => d.forEach((v) => v());
|
|
176
177
|
});
|
|
177
|
-
|
|
178
|
-
var
|
|
178
|
+
K(this, "reload", (c = {}) => {
|
|
179
|
+
var p, x;
|
|
179
180
|
let d = Object.keys(this.response.props);
|
|
180
|
-
if (c.only && (d = c.only), c.except && (d =
|
|
181
|
+
if (c.only && (d = c.only), c.except && (d = en(d, c.except)), !((p = this.response) != null && p.url))
|
|
181
182
|
return;
|
|
182
|
-
const v = (c.method ?? "get").toLowerCase(),
|
|
183
|
-
(x = c.onStart) == null || x.call(c),
|
|
183
|
+
const v = (c.method ?? "get").toLowerCase(), w = c.data ?? {};
|
|
184
|
+
(x = c.onStart) == null || x.call(c), Ge({
|
|
184
185
|
url: this.response.url,
|
|
185
186
|
method: v,
|
|
186
|
-
data: v === "get" ? {} :
|
|
187
|
-
params: v === "get" ?
|
|
187
|
+
data: v === "get" ? {} : w,
|
|
188
|
+
params: v === "get" ? w : {},
|
|
188
189
|
headers: {
|
|
189
190
|
...c.headers ?? {},
|
|
190
191
|
Accept: "text/html, application/xhtml+xml",
|
|
@@ -192,34 +193,34 @@ const Qr = ({ children: e }) => {
|
|
|
192
193
|
"X-Inertia-Partial-Component": this.response.component,
|
|
193
194
|
"X-Inertia-Version": this.response.version,
|
|
194
195
|
"X-Inertia-Partial-Data": d.join(","),
|
|
195
|
-
"X-InertiaUI-Modal":
|
|
196
|
+
"X-InertiaUI-Modal": ft(),
|
|
196
197
|
"X-InertiaUI-Modal-Use-Router": 0,
|
|
197
198
|
"X-InertiaUI-Modal-Base-Url": xe
|
|
198
199
|
}
|
|
199
200
|
}).then((O) => {
|
|
200
|
-
var
|
|
201
|
-
this.updateProps(O.data.props), (
|
|
201
|
+
var N;
|
|
202
|
+
this.updateProps(O.data.props), (N = c.onSuccess) == null || N.call(c, O);
|
|
202
203
|
}).catch((O) => {
|
|
203
|
-
var
|
|
204
|
-
(
|
|
204
|
+
var N;
|
|
205
|
+
(N = c.onError) == null || N.call(c, O);
|
|
205
206
|
}).finally(() => {
|
|
206
207
|
var O;
|
|
207
208
|
(O = c.onFinish) == null || O.call(c);
|
|
208
209
|
});
|
|
209
210
|
});
|
|
210
|
-
|
|
211
|
+
K(this, "updateProps", (c) => {
|
|
211
212
|
Object.assign(this.props, c), i((d) => d);
|
|
212
213
|
});
|
|
213
|
-
if (this.id = d.id ??
|
|
214
|
+
if (this.id = d.id ?? ft(), this.isOpen = !1, this.shouldRender = !1, this.listeners = {}, this.component = c, this.props = d.props, this.response = d, this.config = v ?? {}, this.onCloseCallback = w, this.afterLeaveCallback = p, ye[this.id]) {
|
|
214
215
|
this.config = {
|
|
215
216
|
...this.config,
|
|
216
217
|
...ye[this.id].config ?? {}
|
|
217
218
|
};
|
|
218
219
|
const x = ye[this.id].onClose, O = ye[this.id].onAfterLeave;
|
|
219
|
-
x && (this.onCloseCallback =
|
|
220
|
-
|
|
221
|
-
} : x), O && (this.afterLeaveCallback =
|
|
222
|
-
|
|
220
|
+
x && (this.onCloseCallback = w ? () => {
|
|
221
|
+
w(), x();
|
|
222
|
+
} : x), O && (this.afterLeaveCallback = p ? () => {
|
|
223
|
+
p(), O();
|
|
223
224
|
} : O), delete ye[this.id];
|
|
224
225
|
}
|
|
225
226
|
this.index = -1, this.getParentModal = () => null, this.getChildModal = () => null, this.onTopOfStack = !0;
|
|
@@ -228,23 +229,23 @@ const Qr = ({ children: e }) => {
|
|
|
228
229
|
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)}`;
|
|
229
230
|
}
|
|
230
231
|
}
|
|
231
|
-
const
|
|
232
|
+
const s = (h, c = {}, d = null, v = null) => nr(h.component).then((w) => u(w, h, c, d, v)), o = (h) => {
|
|
232
233
|
var d, v;
|
|
233
234
|
const c = (v = (d = h.response) == null ? void 0 : d.meta) == null ? void 0 : v.deferredProps;
|
|
234
|
-
c && Object.keys(c).forEach((
|
|
235
|
-
h.reload({ only: c[
|
|
235
|
+
c && Object.keys(c).forEach((w) => {
|
|
236
|
+
h.reload({ only: c[w] });
|
|
236
237
|
});
|
|
237
|
-
}, u = (h, c, d, v,
|
|
238
|
-
const
|
|
239
|
-
return
|
|
238
|
+
}, u = (h, c, d, v, w) => {
|
|
239
|
+
const p = new a(h, c, d, v, w);
|
|
240
|
+
return p.index = t.length, i((x) => [...x, p]), o(p), p.show(), p;
|
|
240
241
|
};
|
|
241
|
-
function
|
|
242
|
+
function m(h, c, d, v) {
|
|
242
243
|
if (!n[h])
|
|
243
244
|
throw new Error(`The local modal "${h}" has not been registered.`);
|
|
244
|
-
const
|
|
245
|
-
return
|
|
245
|
+
const w = u(null, {}, c, d, v);
|
|
246
|
+
return w.name = h, n[h].callback(w), w;
|
|
246
247
|
}
|
|
247
|
-
const
|
|
248
|
+
const b = (h, c = {}) => g(
|
|
248
249
|
h,
|
|
249
250
|
c.method ?? "get",
|
|
250
251
|
c.data ?? {},
|
|
@@ -253,81 +254,90 @@ const Qr = ({ children: e }) => {
|
|
|
253
254
|
c.onClose,
|
|
254
255
|
c.onAfterLeave,
|
|
255
256
|
c.queryStringArrayFormat ?? "brackets",
|
|
256
|
-
c.navigate ??
|
|
257
|
+
c.navigate ?? Lt("navigate"),
|
|
257
258
|
c.onStart,
|
|
258
259
|
c.onSuccess,
|
|
259
260
|
c.onError
|
|
260
261
|
).then((d) => {
|
|
261
262
|
const v = c.listeners ?? {};
|
|
262
|
-
return Object.keys(v).forEach((
|
|
263
|
-
const
|
|
264
|
-
d.on(
|
|
263
|
+
return Object.keys(v).forEach((w) => {
|
|
264
|
+
const p = Pe(w);
|
|
265
|
+
d.on(p, v[w]);
|
|
265
266
|
}), d;
|
|
266
|
-
}),
|
|
267
|
-
const B =
|
|
268
|
-
return new Promise((
|
|
267
|
+
}), g = (h, c, d = {}, v = {}, w = {}, p = null, x = null, O = "brackets", N = !1, D = null, C = null, I = null) => {
|
|
268
|
+
const B = ft();
|
|
269
|
+
return new Promise((R, k) => {
|
|
269
270
|
if (h.startsWith("#")) {
|
|
270
|
-
|
|
271
|
+
R(m(h.substring(1), w, p, x));
|
|
271
272
|
return;
|
|
272
273
|
}
|
|
273
|
-
const [
|
|
274
|
-
let
|
|
274
|
+
const [j, ge] = Yr(c, h || "", d, O);
|
|
275
|
+
let ce = N && t.length === 0;
|
|
275
276
|
if (t.length === 0 && (xe = typeof window < "u" ? window.location.href : ""), v = {
|
|
276
277
|
...v,
|
|
277
278
|
Accept: "text/html, application/xhtml+xml",
|
|
278
279
|
"X-Requested-With": "XMLHttpRequest",
|
|
279
280
|
"X-Inertia": !0,
|
|
280
|
-
"X-Inertia-Version":
|
|
281
|
+
"X-Inertia-Version": rr,
|
|
281
282
|
"X-InertiaUI-Modal": B,
|
|
282
|
-
"X-InertiaUI-Modal-Use-Router":
|
|
283
|
+
"X-InertiaUI-Modal-Use-Router": ce ? 1 : 0,
|
|
283
284
|
"X-InertiaUI-Modal-Base-Url": xe
|
|
284
|
-
},
|
|
285
|
-
return
|
|
286
|
-
config:
|
|
287
|
-
onClose:
|
|
285
|
+
}, ce)
|
|
286
|
+
return Ve = {}, ye[B] = {
|
|
287
|
+
config: w,
|
|
288
|
+
onClose: p,
|
|
288
289
|
onAfterLeave: x
|
|
289
|
-
},
|
|
290
|
+
}, Me.visit(j, {
|
|
290
291
|
method: c,
|
|
291
|
-
data:
|
|
292
|
+
data: ge,
|
|
292
293
|
headers: v,
|
|
293
294
|
preserveScroll: !0,
|
|
294
295
|
preserveState: !0,
|
|
295
|
-
onError(...
|
|
296
|
-
|
|
296
|
+
onError(...A) {
|
|
297
|
+
I == null || I(...A), k(...A);
|
|
297
298
|
},
|
|
298
|
-
onStart(...
|
|
299
|
-
|
|
299
|
+
onStart(...A) {
|
|
300
|
+
D == null || D(...A);
|
|
300
301
|
},
|
|
301
|
-
onSuccess(...
|
|
302
|
-
C == null || C(...
|
|
302
|
+
onSuccess(...A) {
|
|
303
|
+
C == null || C(...A);
|
|
303
304
|
},
|
|
304
305
|
onBefore: () => {
|
|
305
|
-
|
|
306
|
+
Ve[B] = R;
|
|
306
307
|
}
|
|
307
308
|
});
|
|
308
|
-
|
|
309
|
-
|
|
309
|
+
D == null || D();
|
|
310
|
+
const Q = (A) => {
|
|
311
|
+
try {
|
|
312
|
+
_t.progress && A(_t.progress);
|
|
313
|
+
} catch {
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
Q((A) => A.start()), Ge({
|
|
317
|
+
url: j,
|
|
310
318
|
method: c,
|
|
311
|
-
data:
|
|
319
|
+
data: ge,
|
|
312
320
|
headers: v
|
|
313
|
-
}).then((
|
|
314
|
-
C == null || C(
|
|
315
|
-
}).catch((...
|
|
316
|
-
|
|
321
|
+
}).then((A) => {
|
|
322
|
+
C == null || C(A), R(s(A.data, w, p, x));
|
|
323
|
+
}).catch((...A) => {
|
|
324
|
+
I == null || I(...A), k(...A);
|
|
325
|
+
}).finally(() => {
|
|
326
|
+
Q((A) => A.finish());
|
|
317
327
|
});
|
|
318
328
|
});
|
|
319
329
|
}, E = {
|
|
320
330
|
stack: t,
|
|
321
331
|
localModals: n,
|
|
322
332
|
push: u,
|
|
323
|
-
pushFromResponseData:
|
|
324
|
-
length: () =>
|
|
333
|
+
pushFromResponseData: s,
|
|
334
|
+
length: () => pt.length,
|
|
325
335
|
closeAll: () => {
|
|
326
|
-
|
|
336
|
+
pt.reverse().forEach((h) => h.close());
|
|
327
337
|
},
|
|
328
338
|
reset: () => i(() => []),
|
|
329
|
-
visit:
|
|
330
|
-
visitModal:
|
|
339
|
+
visit: g,
|
|
340
|
+
visitModal: b,
|
|
331
341
|
registerLocalModal: (h, c) => {
|
|
332
342
|
l((d) => ({
|
|
333
343
|
...d,
|
|
@@ -341,41 +351,41 @@ const Qr = ({ children: e }) => {
|
|
|
341
351
|
});
|
|
342
352
|
},
|
|
343
353
|
onModalOnBase: (h) => {
|
|
344
|
-
const c =
|
|
345
|
-
c && (c(h), delete
|
|
354
|
+
const c = Ve[h.id];
|
|
355
|
+
c && (c(h), delete Ve[h.id]);
|
|
346
356
|
}
|
|
347
357
|
};
|
|
348
|
-
return /* @__PURE__ */
|
|
349
|
-
},
|
|
350
|
-
const e = H(
|
|
358
|
+
return /* @__PURE__ */ P(Qe.Provider, { value: E, children: e });
|
|
359
|
+
}, et = () => {
|
|
360
|
+
const e = H(Qe);
|
|
351
361
|
if (e === null)
|
|
352
362
|
throw new Error("useModalStack must be used within a ModalStackProvider");
|
|
353
363
|
return e;
|
|
354
|
-
},
|
|
355
|
-
e.initialPage && (
|
|
356
|
-
},
|
|
364
|
+
}, Dt = ["closeButton", "closeExplicitly", "maxWidth", "paddingClasses", "panelClasses", "position", "slideover"], on = (e) => {
|
|
365
|
+
e.initialPage && (rr = e.initialPage.version), e.resolveComponent && (nr = e.resolveComponent);
|
|
366
|
+
}, Mi = (e, t) => (on(t), /* @__PURE__ */ P(ln, { children: /* @__PURE__ */ P(e, { ...t, children: ({ Component: n, props: l, key: i }) => /* @__PURE__ */ he(Mt, { children: [
|
|
357
367
|
(() => {
|
|
358
|
-
const
|
|
359
|
-
return typeof n.layout == "function" ? n.layout(
|
|
368
|
+
const s = Re(n, { key: i, ...l });
|
|
369
|
+
return typeof n.layout == "function" ? n.layout(s) : Array.isArray(n.layout) ? n.layout.concat(s).reverse().reduce((u, m) => Re(m, l, u)) : s;
|
|
360
370
|
})(),
|
|
361
|
-
/* @__PURE__ */
|
|
362
|
-
] }) }) })),
|
|
363
|
-
var
|
|
364
|
-
const t = H(
|
|
365
|
-
let n = !1, l =
|
|
366
|
-
L(() =>
|
|
367
|
-
() =>
|
|
368
|
-
const
|
|
369
|
-
if (!
|
|
370
|
-
|
|
371
|
+
/* @__PURE__ */ P(an, {})
|
|
372
|
+
] }) }) })), an = ({ children: e }) => {
|
|
373
|
+
var s, o;
|
|
374
|
+
const t = H(Qe), r = qr();
|
|
375
|
+
let n = !1, l = !!((s = r.props) != null && s._inertiaui_modal);
|
|
376
|
+
L(() => Me.on("start", () => n = !0), []), L(() => Me.on("finish", () => n = !1), []), L(
|
|
377
|
+
() => Me.on("navigate", function(u) {
|
|
378
|
+
const m = u.detail.page.props._inertiaui_modal;
|
|
379
|
+
if (!m) {
|
|
380
|
+
t.closeAll(), xe = null, l = !1;
|
|
371
381
|
return;
|
|
372
382
|
}
|
|
373
|
-
|
|
374
|
-
if (!
|
|
383
|
+
xe = m.baseUrl, t.pushFromResponseData(m, {}, () => {
|
|
384
|
+
if (!m.baseUrl) {
|
|
375
385
|
console.error("No base url in modal response data so cannot navigate back");
|
|
376
386
|
return;
|
|
377
387
|
}
|
|
378
|
-
!n && typeof window < "u" && window.location.href !==
|
|
388
|
+
!n && typeof window < "u" && window.location.href !== m.baseUrl && Me.visit(m.baseUrl, {
|
|
379
389
|
preserveScroll: !0,
|
|
380
390
|
preserveState: !0
|
|
381
391
|
});
|
|
@@ -383,30 +393,30 @@ const Qr = ({ children: e }) => {
|
|
|
383
393
|
}),
|
|
384
394
|
[]
|
|
385
395
|
);
|
|
386
|
-
const
|
|
387
|
-
var
|
|
388
|
-
return
|
|
396
|
+
const i = (u) => {
|
|
397
|
+
var m;
|
|
398
|
+
return u.headers["X-InertiaUI-Modal-Base-Url"] = xe ?? (l ? (m = r.props._inertiaui_modal) == null ? void 0 : m.baseUrl : null), u;
|
|
389
399
|
};
|
|
390
|
-
L(() => (
|
|
400
|
+
L(() => (Ge.interceptors.request.use(i), () => Ge.interceptors.request.eject(i)), []);
|
|
391
401
|
const a = S();
|
|
392
402
|
return L(() => {
|
|
393
403
|
var b, g;
|
|
394
|
-
const
|
|
395
|
-
a.current =
|
|
396
|
-
}, [(
|
|
404
|
+
const u = (b = r.props) == null ? void 0 : b._inertiaui_modal, m = a.current;
|
|
405
|
+
a.current = u, u && m && u.component === m.component && Qr(u.url, m.url) && ((g = t.stack[0]) == null || g.updateProps(u.props ?? {}));
|
|
406
|
+
}, [(o = r.props) == null ? void 0 : o._inertiaui_modal]), /* @__PURE__ */ he(Mt, { children: [
|
|
397
407
|
e,
|
|
398
|
-
t.stack.length > 0 && /* @__PURE__ */
|
|
408
|
+
t.stack.length > 0 && /* @__PURE__ */ P(ir, { index: 0 })
|
|
399
409
|
] });
|
|
400
|
-
},
|
|
401
|
-
|
|
402
|
-
const
|
|
403
|
-
const e = $.useContext(
|
|
410
|
+
}, kt = $.createContext(null);
|
|
411
|
+
kt.displayName = "ModalIndexContext";
|
|
412
|
+
const lr = () => {
|
|
413
|
+
const e = $.useContext(kt);
|
|
404
414
|
if (e === void 0)
|
|
405
415
|
throw new Error("useModalIndex must be used within a ModalIndexProvider");
|
|
406
416
|
return e;
|
|
407
|
-
},
|
|
408
|
-
const { stack: t } =
|
|
409
|
-
return (r == null ? void 0 : r.component) && /* @__PURE__ */
|
|
417
|
+
}, ir = ({ index: e }) => {
|
|
418
|
+
const { stack: t } = et(), r = _(() => t[e], [t, e]);
|
|
419
|
+
return (r == null ? void 0 : r.component) && /* @__PURE__ */ P(kt.Provider, { value: e, children: /* @__PURE__ */ P(
|
|
410
420
|
r.component,
|
|
411
421
|
{
|
|
412
422
|
...r.props,
|
|
@@ -414,45 +424,45 @@ const Qt = () => {
|
|
|
414
424
|
}
|
|
415
425
|
) });
|
|
416
426
|
};
|
|
417
|
-
function
|
|
418
|
-
return
|
|
427
|
+
function or() {
|
|
428
|
+
return et().stack[lr()] ?? null;
|
|
419
429
|
}
|
|
420
|
-
const
|
|
430
|
+
const sn = ({ children: e, data: t, fallback: r }) => {
|
|
421
431
|
if (!t)
|
|
422
432
|
throw new Error("`<Deferred>` requires a `data` prop to be a string or array of strings");
|
|
423
|
-
const [n, l] =
|
|
433
|
+
const [n, l] = F(!1), i = Array.isArray(t) ? t : [t], a = or().props;
|
|
424
434
|
return L(() => {
|
|
425
|
-
l(i.every((
|
|
426
|
-
}, [
|
|
435
|
+
l(i.every((s) => a[s] !== void 0));
|
|
436
|
+
}, [a, i]), n ? e : r;
|
|
427
437
|
};
|
|
428
|
-
|
|
429
|
-
const
|
|
430
|
-
const o =
|
|
431
|
-
var
|
|
432
|
-
return (
|
|
433
|
-
}, [o, u]), h =
|
|
438
|
+
sn.displayName = "InertiaModalDeferred";
|
|
439
|
+
const ar = Pt(({ name: e, children: t, onFocus: r = null, onBlur: n = null, onClose: l = null, onSuccess: i = null, ...a }, s) => {
|
|
440
|
+
const o = lr(), { stack: u, registerLocalModal: m, removeLocalModal: b } = et(), [g, y] = F(null), f = _(() => e ? g : u[o], [e, g, o, u]), E = _(() => {
|
|
441
|
+
var p;
|
|
442
|
+
return (p = u.find((x) => x.shouldRender && x.index > (f == null ? void 0 : f.index))) == null ? void 0 : p.index;
|
|
443
|
+
}, [o, u]), h = _(() => (f == null ? void 0 : f.config.slideover) ?? a.slideover ?? Lt("type") === "slideover", [a.slideover]), c = _(
|
|
434
444
|
() => ({
|
|
435
445
|
slideover: h,
|
|
436
|
-
closeButton:
|
|
437
|
-
closeExplicitly:
|
|
438
|
-
maxWidth:
|
|
439
|
-
paddingClasses:
|
|
440
|
-
panelClasses:
|
|
441
|
-
position:
|
|
446
|
+
closeButton: a.closeButton ?? we(h, "closeButton"),
|
|
447
|
+
closeExplicitly: a.closeExplicitly ?? we(h, "closeExplicitly"),
|
|
448
|
+
maxWidth: a.maxWidth ?? we(h, "maxWidth"),
|
|
449
|
+
paddingClasses: a.paddingClasses ?? we(h, "paddingClasses"),
|
|
450
|
+
panelClasses: a.panelClasses ?? we(h, "panelClasses"),
|
|
451
|
+
position: a.position ?? we(h, "position"),
|
|
442
452
|
...f == null ? void 0 : f.config
|
|
443
453
|
}),
|
|
444
|
-
[
|
|
454
|
+
[a, f == null ? void 0 : f.config]
|
|
445
455
|
);
|
|
446
456
|
L(() => {
|
|
447
457
|
if (e) {
|
|
448
|
-
let
|
|
449
|
-
return
|
|
450
|
-
|
|
458
|
+
let p = null;
|
|
459
|
+
return m(e, (x) => {
|
|
460
|
+
p = x.registerEventListenersFromProps(a), y(x);
|
|
451
461
|
}), () => {
|
|
452
|
-
|
|
462
|
+
p == null || p(), p = null, b(e);
|
|
453
463
|
};
|
|
454
464
|
}
|
|
455
|
-
return f.registerEventListenersFromProps(
|
|
465
|
+
return f.registerEventListenersFromProps(a);
|
|
456
466
|
}, [e]);
|
|
457
467
|
const d = S(f);
|
|
458
468
|
L(() => {
|
|
@@ -460,70 +470,70 @@ const rr = Ot(({ name: e, children: t, onFocus: r = null, onBlur: n = null, onCl
|
|
|
460
470
|
}, [f]), L(() => {
|
|
461
471
|
f !== null && (f.isOpen ? i == null || i() : l == null || l());
|
|
462
472
|
}, [f == null ? void 0 : f.isOpen]);
|
|
463
|
-
const [v,
|
|
473
|
+
const [v, w] = F(!1);
|
|
464
474
|
return L(() => {
|
|
465
|
-
v && f !== null && f.isOpen && (f.onTopOfStack ? r == null || r() : n == null || n()),
|
|
466
|
-
}, [f == null ? void 0 : f.onTopOfStack]),
|
|
467
|
-
|
|
475
|
+
v && f !== null && f.isOpen && (f.onTopOfStack ? r == null || r() : n == null || n()), w(!0);
|
|
476
|
+
}, [f == null ? void 0 : f.onTopOfStack]), tr(
|
|
477
|
+
s,
|
|
468
478
|
() => ({
|
|
469
479
|
afterLeave: () => {
|
|
470
|
-
var
|
|
471
|
-
return (
|
|
480
|
+
var p;
|
|
481
|
+
return (p = d.current) == null ? void 0 : p.afterLeave();
|
|
472
482
|
},
|
|
473
483
|
close: () => {
|
|
474
|
-
var
|
|
475
|
-
return (
|
|
484
|
+
var p;
|
|
485
|
+
return (p = d.current) == null ? void 0 : p.close();
|
|
476
486
|
},
|
|
477
|
-
emit: (...
|
|
487
|
+
emit: (...p) => {
|
|
478
488
|
var x;
|
|
479
|
-
return (x = d.current) == null ? void 0 : x.emit(...
|
|
489
|
+
return (x = d.current) == null ? void 0 : x.emit(...p);
|
|
480
490
|
},
|
|
481
491
|
getChildModal: () => {
|
|
482
|
-
var
|
|
483
|
-
return (
|
|
492
|
+
var p;
|
|
493
|
+
return (p = d.current) == null ? void 0 : p.getChildModal();
|
|
484
494
|
},
|
|
485
495
|
getParentModal: () => {
|
|
486
|
-
var
|
|
487
|
-
return (
|
|
496
|
+
var p;
|
|
497
|
+
return (p = d.current) == null ? void 0 : p.getParentModal();
|
|
488
498
|
},
|
|
489
|
-
reload: (...
|
|
499
|
+
reload: (...p) => {
|
|
490
500
|
var x;
|
|
491
|
-
return (x = d.current) == null ? void 0 : x.reload(...
|
|
501
|
+
return (x = d.current) == null ? void 0 : x.reload(...p);
|
|
492
502
|
},
|
|
493
503
|
setOpen: () => {
|
|
494
|
-
var
|
|
495
|
-
return (
|
|
504
|
+
var p;
|
|
505
|
+
return (p = d.current) == null ? void 0 : p.setOpen();
|
|
496
506
|
},
|
|
497
507
|
get id() {
|
|
498
|
-
var
|
|
499
|
-
return (
|
|
508
|
+
var p;
|
|
509
|
+
return (p = d.current) == null ? void 0 : p.id;
|
|
500
510
|
},
|
|
501
511
|
get index() {
|
|
502
|
-
var
|
|
503
|
-
return (
|
|
512
|
+
var p;
|
|
513
|
+
return (p = d.current) == null ? void 0 : p.index;
|
|
504
514
|
},
|
|
505
515
|
get isOpen() {
|
|
506
|
-
var
|
|
507
|
-
return (
|
|
516
|
+
var p;
|
|
517
|
+
return (p = d.current) == null ? void 0 : p.isOpen;
|
|
508
518
|
},
|
|
509
519
|
get config() {
|
|
510
|
-
var
|
|
511
|
-
return (
|
|
520
|
+
var p;
|
|
521
|
+
return (p = d.current) == null ? void 0 : p.config;
|
|
512
522
|
},
|
|
513
523
|
get modalContext() {
|
|
514
524
|
return d.current;
|
|
515
525
|
},
|
|
516
526
|
get onTopOfStack() {
|
|
517
|
-
var
|
|
518
|
-
return (
|
|
527
|
+
var p;
|
|
528
|
+
return (p = d.current) == null ? void 0 : p.onTopOfStack;
|
|
519
529
|
},
|
|
520
530
|
get shouldRender() {
|
|
521
|
-
var
|
|
522
|
-
return (
|
|
531
|
+
var p;
|
|
532
|
+
return (p = d.current) == null ? void 0 : p.shouldRender;
|
|
523
533
|
}
|
|
524
534
|
}),
|
|
525
535
|
[f]
|
|
526
|
-
), (f == null ? void 0 : f.shouldRender) && /* @__PURE__ */
|
|
536
|
+
), (f == null ? void 0 : f.shouldRender) && /* @__PURE__ */ he(Mt, { children: [
|
|
527
537
|
typeof t == "function" ? t({
|
|
528
538
|
afterLeave: f.afterLeave,
|
|
529
539
|
close: f.close,
|
|
@@ -540,27 +550,27 @@ const rr = Ot(({ name: e, children: t, onFocus: r = null, onBlur: n = null, onCl
|
|
|
540
550
|
setOpen: f.setOpen,
|
|
541
551
|
shouldRender: f.shouldRender
|
|
542
552
|
}) : t,
|
|
543
|
-
E && /* @__PURE__ */
|
|
553
|
+
E && /* @__PURE__ */ P(ir, { index: E })
|
|
544
554
|
] });
|
|
545
555
|
});
|
|
546
|
-
|
|
547
|
-
function
|
|
556
|
+
ar.displayName = "HeadlessModal";
|
|
557
|
+
function sr(e) {
|
|
548
558
|
var t, r, n = "";
|
|
549
559
|
if (typeof e == "string" || typeof e == "number") n += e;
|
|
550
560
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
|
551
561
|
var l = e.length;
|
|
552
|
-
for (t = 0; t < l; t++) e[t] && (r =
|
|
562
|
+
for (t = 0; t < l; t++) e[t] && (r = sr(e[t])) && (n && (n += " "), n += r);
|
|
553
563
|
} else for (r in e) e[r] && (n && (n += " "), n += r);
|
|
554
564
|
return n;
|
|
555
565
|
}
|
|
556
|
-
function
|
|
557
|
-
for (var e, t, r = 0, n = "", l = arguments.length; r < l; r++) (e = arguments[r]) && (t =
|
|
566
|
+
function Ke() {
|
|
567
|
+
for (var e, t, r = 0, n = "", l = arguments.length; r < l; r++) (e = arguments[r]) && (t = sr(e)) && (n && (n += " "), n += t);
|
|
558
568
|
return n;
|
|
559
569
|
}
|
|
560
|
-
var
|
|
561
|
-
let
|
|
570
|
+
var un = Object.defineProperty, cn = (e, t, r) => t in e ? un(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, mt = (e, t, r) => (cn(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
571
|
+
let dn = class {
|
|
562
572
|
constructor() {
|
|
563
|
-
|
|
573
|
+
mt(this, "current", this.detect()), mt(this, "handoffState", "pending"), mt(this, "currentId", 0);
|
|
564
574
|
}
|
|
565
575
|
set(t) {
|
|
566
576
|
this.current !== t && (this.handoffState = "pending", this.currentId = 0, this.current = t);
|
|
@@ -586,12 +596,23 @@ let on = class {
|
|
|
586
596
|
get isHandoffComplete() {
|
|
587
597
|
return this.handoffState === "complete";
|
|
588
598
|
}
|
|
589
|
-
},
|
|
590
|
-
function
|
|
599
|
+
}, Z = new dn();
|
|
600
|
+
function De(e) {
|
|
601
|
+
var t;
|
|
602
|
+
return Z.isServer ? null : e == null ? document : (t = e == null ? void 0 : e.ownerDocument) != null ? t : document;
|
|
603
|
+
}
|
|
604
|
+
function bt(e) {
|
|
605
|
+
var t, r;
|
|
606
|
+
return Z.isServer ? null : e == null ? document : (r = (t = e == null ? void 0 : e.getRootNode) == null ? void 0 : t.call(e)) != null ? r : document;
|
|
607
|
+
}
|
|
608
|
+
function ur(e) {
|
|
591
609
|
var t, r;
|
|
592
|
-
return
|
|
610
|
+
return (r = (t = bt(e)) == null ? void 0 : t.activeElement) != null ? r : null;
|
|
593
611
|
}
|
|
594
|
-
function
|
|
612
|
+
function fn(e) {
|
|
613
|
+
return ur(e) === e;
|
|
614
|
+
}
|
|
615
|
+
function tt(e) {
|
|
595
616
|
typeof queueMicrotask == "function" ? queueMicrotask(e) : Promise.resolve().then(e).catch((t) => setTimeout(() => {
|
|
596
617
|
throw t;
|
|
597
618
|
}));
|
|
@@ -609,7 +630,7 @@ function ne() {
|
|
|
609
630
|
return t.add(() => clearTimeout(n));
|
|
610
631
|
}, microTask(...r) {
|
|
611
632
|
let n = { current: !0 };
|
|
612
|
-
return
|
|
633
|
+
return tt(() => {
|
|
613
634
|
n.current && r[0]();
|
|
614
635
|
}), t.add(() => {
|
|
615
636
|
n.current = !1;
|
|
@@ -632,27 +653,31 @@ function ne() {
|
|
|
632
653
|
} };
|
|
633
654
|
return t;
|
|
634
655
|
}
|
|
635
|
-
function
|
|
636
|
-
let [e] =
|
|
656
|
+
function rt() {
|
|
657
|
+
let [e] = F(ne);
|
|
637
658
|
return L(() => () => e.dispose(), [e]), e;
|
|
638
659
|
}
|
|
639
|
-
let
|
|
640
|
-
|
|
660
|
+
let U = (e, t) => {
|
|
661
|
+
Z.isServer ? L(e, t) : Vr(e, t);
|
|
641
662
|
};
|
|
642
|
-
function
|
|
663
|
+
function ve(e) {
|
|
643
664
|
let t = S(e);
|
|
644
|
-
return
|
|
665
|
+
return U(() => {
|
|
645
666
|
t.current = e;
|
|
646
667
|
}, [e]), t;
|
|
647
668
|
}
|
|
648
669
|
let M = function(e) {
|
|
649
|
-
let t =
|
|
670
|
+
let t = ve(e);
|
|
650
671
|
return $.useCallback((...r) => t.current(...r), [t]);
|
|
651
|
-
}
|
|
652
|
-
function
|
|
653
|
-
return
|
|
672
|
+
};
|
|
673
|
+
function je(e) {
|
|
674
|
+
return _(() => e, Object.values(e));
|
|
654
675
|
}
|
|
655
|
-
|
|
676
|
+
let pn = z(void 0);
|
|
677
|
+
function mn() {
|
|
678
|
+
return H(pn);
|
|
679
|
+
}
|
|
680
|
+
function xt(...e) {
|
|
656
681
|
return Array.from(new Set(e.flatMap((t) => typeof t == "string" ? t.split(" ") : []))).filter(Boolean).join(" ");
|
|
657
682
|
}
|
|
658
683
|
function re(e, t, ...r) {
|
|
@@ -663,68 +688,68 @@ function re(e, t, ...r) {
|
|
|
663
688
|
let n = new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((l) => `"${l}"`).join(", ")}.`);
|
|
664
689
|
throw Error.captureStackTrace && Error.captureStackTrace(n, re), n;
|
|
665
690
|
}
|
|
666
|
-
var
|
|
691
|
+
var qe = ((e) => (e[e.None = 0] = "None", e[e.RenderStrategy = 1] = "RenderStrategy", e[e.Static = 2] = "Static", e))(qe || {}), oe = ((e) => (e[e.Unmount = 0] = "Unmount", e[e.Hidden = 1] = "Hidden", e))(oe || {});
|
|
667
692
|
function G() {
|
|
668
|
-
let e =
|
|
669
|
-
return
|
|
693
|
+
let e = vn();
|
|
694
|
+
return W((t) => hn({ mergeRefs: e, ...t }), [e]);
|
|
670
695
|
}
|
|
671
|
-
function
|
|
672
|
-
|
|
673
|
-
let o =
|
|
674
|
-
if (i) return
|
|
696
|
+
function hn({ ourProps: e, theirProps: t, slot: r, defaultTag: n, features: l, visible: i = !0, name: a, mergeRefs: s }) {
|
|
697
|
+
s = s ?? gn;
|
|
698
|
+
let o = cr(t, e);
|
|
699
|
+
if (i) return Be(o, r, n, a, s);
|
|
675
700
|
let u = l ?? 0;
|
|
676
701
|
if (u & 2) {
|
|
677
|
-
let { static:
|
|
678
|
-
if (
|
|
702
|
+
let { static: m = !1, ...b } = o;
|
|
703
|
+
if (m) return Be(b, r, n, a, s);
|
|
679
704
|
}
|
|
680
705
|
if (u & 1) {
|
|
681
|
-
let { unmount:
|
|
682
|
-
return re(
|
|
706
|
+
let { unmount: m = !0, ...b } = o;
|
|
707
|
+
return re(m ? 0 : 1, { 0() {
|
|
683
708
|
return null;
|
|
684
709
|
}, 1() {
|
|
685
|
-
return
|
|
710
|
+
return Be({ ...b, hidden: !0, style: { display: "none" } }, r, n, a, s);
|
|
686
711
|
} });
|
|
687
712
|
}
|
|
688
|
-
return
|
|
713
|
+
return Be(o, r, n, a, s);
|
|
689
714
|
}
|
|
690
|
-
function
|
|
691
|
-
let { as: i = r, children:
|
|
715
|
+
function Be(e, t = {}, r, n, l) {
|
|
716
|
+
let { as: i = r, children: a, refName: s = "ref", ...o } = ht(e, ["unmount", "static"]), u = e.ref !== void 0 ? { [s]: e.ref } : {}, m = typeof a == "function" ? a(t) : a;
|
|
692
717
|
"className" in o && o.className && typeof o.className == "function" && (o.className = o.className(t)), o["aria-labelledby"] && o["aria-labelledby"] === o.id && (o["aria-labelledby"] = void 0);
|
|
693
|
-
let
|
|
718
|
+
let b = {};
|
|
694
719
|
if (t) {
|
|
695
|
-
let
|
|
696
|
-
for (let [f, E] of Object.entries(t)) typeof E == "boolean" && (
|
|
697
|
-
if (
|
|
698
|
-
|
|
699
|
-
for (let f of
|
|
720
|
+
let g = !1, y = [];
|
|
721
|
+
for (let [f, E] of Object.entries(t)) typeof E == "boolean" && (g = !0), E === !0 && y.push(f.replace(/([A-Z])/g, (h) => `-${h.toLowerCase()}`));
|
|
722
|
+
if (g) {
|
|
723
|
+
b["data-headlessui-state"] = y.join(" ");
|
|
724
|
+
for (let f of y) b[`data-${f}`] = "";
|
|
700
725
|
}
|
|
701
726
|
}
|
|
702
|
-
if (i
|
|
703
|
-
if (Object.keys(
|
|
704
|
-
`), "", "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((
|
|
727
|
+
if (Fe(i) && (Object.keys(de(o)).length > 0 || Object.keys(de(b)).length > 0)) if (!Br(m) || Array.isArray(m) && m.length > 1 || yn(m)) {
|
|
728
|
+
if (Object.keys(de(o)).length > 0) throw new Error(['Passing props on "Fragment"!', "", `The current component <${n} /> is rendering a "Fragment".`, "However we need to passthrough the following props:", Object.keys(de(o)).concat(Object.keys(de(b))).map((g) => ` - ${g}`).join(`
|
|
729
|
+
`), "", "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((g) => ` - ${g}`).join(`
|
|
705
730
|
`)].join(`
|
|
706
731
|
`));
|
|
707
732
|
} else {
|
|
708
|
-
let
|
|
709
|
-
for (let c in
|
|
710
|
-
return
|
|
733
|
+
let g = m.props, y = g == null ? void 0 : g.className, f = typeof y == "function" ? (...c) => xt(y(...c), o.className) : xt(y, o.className), E = f ? { className: f } : {}, h = cr(m.props, de(ht(o, ["ref"])));
|
|
734
|
+
for (let c in b) c in h && delete b[c];
|
|
735
|
+
return Xr(m, Object.assign({}, h, b, u, { ref: l(wn(m), u.ref) }, E));
|
|
711
736
|
}
|
|
712
|
-
return
|
|
737
|
+
return Re(i, Object.assign({}, ht(o, ["ref"]), !Fe(i) && u, !Fe(i) && b), m);
|
|
713
738
|
}
|
|
714
|
-
function
|
|
715
|
-
let e = S([]), t =
|
|
739
|
+
function vn() {
|
|
740
|
+
let e = S([]), t = W((r) => {
|
|
716
741
|
for (let n of e.current) n != null && (typeof n == "function" ? n(r) : n.current = r);
|
|
717
742
|
}, []);
|
|
718
743
|
return (...r) => {
|
|
719
744
|
if (!r.every((n) => n == null)) return e.current = r, t;
|
|
720
745
|
};
|
|
721
746
|
}
|
|
722
|
-
function
|
|
747
|
+
function gn(...e) {
|
|
723
748
|
return e.every((t) => t == null) ? void 0 : (t) => {
|
|
724
749
|
for (let r of e) r != null && (typeof r == "function" ? r(t) : r.current = t);
|
|
725
750
|
};
|
|
726
751
|
}
|
|
727
|
-
function
|
|
752
|
+
function cr(...e) {
|
|
728
753
|
if (e.length === 0) return {};
|
|
729
754
|
if (e.length === 1) return e[0];
|
|
730
755
|
let t = {}, r = {};
|
|
@@ -734,44 +759,50 @@ function lr(...e) {
|
|
|
734
759
|
return (i = l == null ? void 0 : l.preventDefault) == null ? void 0 : i.call(l);
|
|
735
760
|
}]);
|
|
736
761
|
for (let n in r) Object.assign(t, { [n](l, ...i) {
|
|
737
|
-
let
|
|
738
|
-
for (let
|
|
762
|
+
let a = r[n];
|
|
763
|
+
for (let s of a) {
|
|
739
764
|
if ((l instanceof Event || (l == null ? void 0 : l.nativeEvent) instanceof Event) && l.defaultPrevented) return;
|
|
740
|
-
|
|
765
|
+
s(l, ...i);
|
|
741
766
|
}
|
|
742
767
|
} });
|
|
743
768
|
return t;
|
|
744
769
|
}
|
|
745
770
|
function V(e) {
|
|
746
771
|
var t;
|
|
747
|
-
return Object.assign(
|
|
772
|
+
return Object.assign(Pt(e), { displayName: (t = e.displayName) != null ? t : e.name });
|
|
748
773
|
}
|
|
749
|
-
function
|
|
774
|
+
function de(e) {
|
|
750
775
|
let t = Object.assign({}, e);
|
|
751
776
|
for (let r in t) t[r] === void 0 && delete t[r];
|
|
752
777
|
return t;
|
|
753
778
|
}
|
|
754
|
-
function
|
|
779
|
+
function ht(e, t = []) {
|
|
755
780
|
let r = Object.assign({}, e);
|
|
756
781
|
for (let n of t) n in r && delete r[n];
|
|
757
782
|
return r;
|
|
758
783
|
}
|
|
759
|
-
function
|
|
784
|
+
function wn(e) {
|
|
760
785
|
return $.version.split(".")[0] >= "19" ? e.props.ref : e.ref;
|
|
761
786
|
}
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
787
|
+
function Fe(e) {
|
|
788
|
+
return e === ue || e === Symbol.for("react.fragment");
|
|
789
|
+
}
|
|
790
|
+
function yn(e) {
|
|
791
|
+
return Fe(e.type);
|
|
792
|
+
}
|
|
793
|
+
let bn = "span";
|
|
794
|
+
var Ye = ((e) => (e[e.None = 1] = "None", e[e.Focusable = 2] = "Focusable", e[e.Hidden = 4] = "Hidden", e))(Ye || {});
|
|
795
|
+
function xn(e, t) {
|
|
765
796
|
var r;
|
|
766
797
|
let { features: n = 1, ...l } = e, i = { ref: t, "aria-hidden": (n & 2) === 2 ? !0 : (r = l["aria-hidden"]) != null ? r : void 0, hidden: (n & 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", ...(n & 4) === 4 && (n & 2) !== 2 && { display: "none" } } };
|
|
767
|
-
return G()({ ourProps: i, theirProps: l, slot: {}, defaultTag:
|
|
798
|
+
return G()({ ourProps: i, theirProps: l, slot: {}, defaultTag: bn, name: "Hidden" });
|
|
768
799
|
}
|
|
769
|
-
let
|
|
770
|
-
function
|
|
800
|
+
let Et = V(xn);
|
|
801
|
+
function En(e) {
|
|
771
802
|
return typeof e != "object" || e === null ? !1 : "nodeType" in e;
|
|
772
803
|
}
|
|
773
804
|
function se(e) {
|
|
774
|
-
return
|
|
805
|
+
return En(e) && "tagName" in e;
|
|
775
806
|
}
|
|
776
807
|
function me(e) {
|
|
777
808
|
return se(e) && "accessKey" in e;
|
|
@@ -779,20 +810,20 @@ function me(e) {
|
|
|
779
810
|
function ae(e) {
|
|
780
811
|
return se(e) && "tabIndex" in e;
|
|
781
812
|
}
|
|
782
|
-
function
|
|
813
|
+
function $n(e) {
|
|
783
814
|
return se(e) && "style" in e;
|
|
784
815
|
}
|
|
785
|
-
function
|
|
816
|
+
function On(e) {
|
|
786
817
|
return me(e) && e.nodeName === "IFRAME";
|
|
787
818
|
}
|
|
788
|
-
function
|
|
819
|
+
function Sn(e) {
|
|
789
820
|
return me(e) && e.nodeName === "INPUT";
|
|
790
821
|
}
|
|
791
|
-
let
|
|
792
|
-
function
|
|
793
|
-
return Object.assign(e, { [
|
|
822
|
+
let dr = Symbol();
|
|
823
|
+
function Tn(e, t = !0) {
|
|
824
|
+
return Object.assign(e, { [dr]: t });
|
|
794
825
|
}
|
|
795
|
-
function
|
|
826
|
+
function J(...e) {
|
|
796
827
|
let t = S(e);
|
|
797
828
|
L(() => {
|
|
798
829
|
t.current = e;
|
|
@@ -800,43 +831,43 @@ function Q(...e) {
|
|
|
800
831
|
let r = M((n) => {
|
|
801
832
|
for (let l of t.current) l != null && (typeof l == "function" ? l(n) : l.current = n);
|
|
802
833
|
});
|
|
803
|
-
return e.every((n) => n == null || (n == null ? void 0 : n[
|
|
834
|
+
return e.every((n) => n == null || (n == null ? void 0 : n[dr])) ? void 0 : r;
|
|
804
835
|
}
|
|
805
|
-
let
|
|
806
|
-
|
|
807
|
-
function
|
|
808
|
-
let e = H(
|
|
836
|
+
let At = z(null);
|
|
837
|
+
At.displayName = "DescriptionContext";
|
|
838
|
+
function fr() {
|
|
839
|
+
let e = H(At);
|
|
809
840
|
if (e === null) {
|
|
810
841
|
let t = new Error("You used a <Description /> component, but it is not inside a relevant parent.");
|
|
811
|
-
throw Error.captureStackTrace && Error.captureStackTrace(t,
|
|
842
|
+
throw Error.captureStackTrace && Error.captureStackTrace(t, fr), t;
|
|
812
843
|
}
|
|
813
844
|
return e;
|
|
814
845
|
}
|
|
815
|
-
function
|
|
816
|
-
let [e, t] =
|
|
817
|
-
return [e.length > 0 ? e.join(" ") : void 0,
|
|
818
|
-
let n = M((i) => (t((
|
|
819
|
-
let
|
|
820
|
-
return o !== -1 &&
|
|
821
|
-
}))), l =
|
|
822
|
-
return $.createElement(
|
|
846
|
+
function Pn() {
|
|
847
|
+
let [e, t] = F([]);
|
|
848
|
+
return [e.length > 0 ? e.join(" ") : void 0, _(() => function(r) {
|
|
849
|
+
let n = M((i) => (t((a) => [...a, i]), () => t((a) => {
|
|
850
|
+
let s = a.slice(), o = s.indexOf(i);
|
|
851
|
+
return o !== -1 && s.splice(o, 1), s;
|
|
852
|
+
}))), l = _(() => ({ register: n, slot: r.slot, name: r.name, props: r.props, value: r.value }), [n, r.slot, r.name, r.props, r.value]);
|
|
853
|
+
return $.createElement(At.Provider, { value: l }, r.children);
|
|
823
854
|
}, [t])];
|
|
824
855
|
}
|
|
825
|
-
let
|
|
826
|
-
function
|
|
827
|
-
let r =
|
|
828
|
-
|
|
829
|
-
let o =
|
|
830
|
-
return G()({ ourProps:
|
|
831
|
-
}
|
|
832
|
-
let
|
|
833
|
-
var
|
|
834
|
-
let
|
|
856
|
+
let Mn = "p";
|
|
857
|
+
function Ln(e, t) {
|
|
858
|
+
let r = _e(), n = mn(), { id: l = `headlessui-description-${r}`, ...i } = e, a = fr(), s = J(t);
|
|
859
|
+
U(() => a.register(l), [l, a.register]);
|
|
860
|
+
let o = je({ ...a.slot, disabled: n || !1 }), u = { ref: s, ...a.props, id: l };
|
|
861
|
+
return G()({ ourProps: u, theirProps: i, slot: o, defaultTag: Mn, name: a.name || "Description" });
|
|
862
|
+
}
|
|
863
|
+
let kn = V(Ln), An = Object.assign(kn, {});
|
|
864
|
+
var pr = ((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))(pr || {});
|
|
865
|
+
let Cn = z(() => {
|
|
835
866
|
});
|
|
836
|
-
function
|
|
837
|
-
return $.createElement(
|
|
867
|
+
function Fn({ value: e, children: t }) {
|
|
868
|
+
return $.createElement(Cn.Provider, { value: e }, t);
|
|
838
869
|
}
|
|
839
|
-
let
|
|
870
|
+
let mr = class extends Map {
|
|
840
871
|
constructor(t) {
|
|
841
872
|
super(), this.factory = t;
|
|
842
873
|
}
|
|
@@ -845,15 +876,15 @@ let ur = class extends Map {
|
|
|
845
876
|
return r === void 0 && (r = this.factory(t), this.set(t, r)), r;
|
|
846
877
|
}
|
|
847
878
|
};
|
|
848
|
-
var
|
|
879
|
+
var Nn = Object.defineProperty, In = (e, t, r) => t in e ? Nn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Rn = (e, t, r) => (In(e, t + "", r), r), hr = (e, t, r) => {
|
|
849
880
|
if (!t.has(e)) throw TypeError("Cannot " + r);
|
|
850
|
-
}, X = (e, t, r) => (
|
|
881
|
+
}, X = (e, t, r) => (hr(e, t, "read from private field"), r ? r.call(e) : t.get(e)), vt = (e, t, r) => {
|
|
851
882
|
if (t.has(e)) throw TypeError("Cannot add the same private member more than once");
|
|
852
883
|
t instanceof WeakSet ? t.add(e) : t.set(e, r);
|
|
853
|
-
},
|
|
854
|
-
let
|
|
884
|
+
}, jt = (e, t, r, n) => (hr(e, t, "write to private field"), t.set(e, r), r), Y, Le, ke;
|
|
885
|
+
let _n = class {
|
|
855
886
|
constructor(t) {
|
|
856
|
-
|
|
887
|
+
vt(this, Y, {}), vt(this, Le, new mr(() => /* @__PURE__ */ new Set())), vt(this, ke, /* @__PURE__ */ new Set()), Rn(this, "disposables", ne()), jt(this, Y, t), Z.isServer && this.disposables.microTask(() => {
|
|
857
888
|
this.dispose();
|
|
858
889
|
});
|
|
859
890
|
}
|
|
@@ -861,52 +892,52 @@ let Ln = class {
|
|
|
861
892
|
this.disposables.dispose();
|
|
862
893
|
}
|
|
863
894
|
get state() {
|
|
864
|
-
return X(this,
|
|
895
|
+
return X(this, Y);
|
|
865
896
|
}
|
|
866
897
|
subscribe(t, r) {
|
|
867
|
-
if (
|
|
898
|
+
if (Z.isServer) return () => {
|
|
868
899
|
};
|
|
869
|
-
let n = { selector: t, callback: r, current: t(X(this,
|
|
870
|
-
return X(this,
|
|
871
|
-
X(this,
|
|
900
|
+
let n = { selector: t, callback: r, current: t(X(this, Y)) };
|
|
901
|
+
return X(this, ke).add(n), this.disposables.add(() => {
|
|
902
|
+
X(this, ke).delete(n);
|
|
872
903
|
});
|
|
873
904
|
}
|
|
874
905
|
on(t, r) {
|
|
875
|
-
return
|
|
876
|
-
} : (X(this,
|
|
877
|
-
X(this,
|
|
906
|
+
return Z.isServer ? () => {
|
|
907
|
+
} : (X(this, Le).get(t).add(r), this.disposables.add(() => {
|
|
908
|
+
X(this, Le).get(t).delete(r);
|
|
878
909
|
}));
|
|
879
910
|
}
|
|
880
911
|
send(t) {
|
|
881
|
-
let r = this.reduce(X(this,
|
|
882
|
-
if (r !== X(this,
|
|
883
|
-
|
|
884
|
-
for (let n of X(this,
|
|
885
|
-
let l = n.selector(X(this,
|
|
886
|
-
|
|
912
|
+
let r = this.reduce(X(this, Y), t);
|
|
913
|
+
if (r !== X(this, Y)) {
|
|
914
|
+
jt(this, Y, r);
|
|
915
|
+
for (let n of X(this, ke)) {
|
|
916
|
+
let l = n.selector(X(this, Y));
|
|
917
|
+
vr(n.current, l) || (n.current = l, n.callback(l));
|
|
887
918
|
}
|
|
888
|
-
for (let n of X(this,
|
|
919
|
+
for (let n of X(this, Le).get(t.type)) n(X(this, Y), t);
|
|
889
920
|
}
|
|
890
921
|
}
|
|
891
922
|
};
|
|
892
|
-
|
|
893
|
-
function
|
|
894
|
-
return Object.is(e, t) ? !0 : typeof e != "object" || e === null || typeof t != "object" || t === null ? !1 : Array.isArray(e) && Array.isArray(t) ? e.length !== t.length ? !1 :
|
|
923
|
+
Y = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakMap(), ke = /* @__PURE__ */ new WeakMap();
|
|
924
|
+
function vr(e, t) {
|
|
925
|
+
return Object.is(e, t) ? !0 : typeof e != "object" || e === null || typeof t != "object" || t === null ? !1 : Array.isArray(e) && Array.isArray(t) ? e.length !== t.length ? !1 : gt(e[Symbol.iterator](), t[Symbol.iterator]()) : e instanceof Map && t instanceof Map || e instanceof Set && t instanceof Set ? e.size !== t.size ? !1 : gt(e.entries(), t.entries()) : Wt(e) && Wt(t) ? gt(Object.entries(e)[Symbol.iterator](), Object.entries(t)[Symbol.iterator]()) : !1;
|
|
895
926
|
}
|
|
896
|
-
function
|
|
927
|
+
function gt(e, t) {
|
|
897
928
|
do {
|
|
898
929
|
let r = e.next(), n = t.next();
|
|
899
930
|
if (r.done && n.done) return !0;
|
|
900
931
|
if (r.done || n.done || !Object.is(r.value, n.value)) return !1;
|
|
901
932
|
} while (!0);
|
|
902
933
|
}
|
|
903
|
-
function
|
|
934
|
+
function Wt(e) {
|
|
904
935
|
if (Object.prototype.toString.call(e) !== "[object Object]") return !1;
|
|
905
936
|
let t = Object.getPrototypeOf(e);
|
|
906
937
|
return t === null || Object.getPrototypeOf(t) === null;
|
|
907
938
|
}
|
|
908
|
-
var
|
|
909
|
-
let
|
|
939
|
+
var Dn = Object.defineProperty, jn = (e, t, r) => t in e ? Dn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ut = (e, t, r) => (jn(e, typeof t != "symbol" ? t + "" : t, r), r), Wn = ((e) => (e[e.Push = 0] = "Push", e[e.Pop = 1] = "Pop", e))(Wn || {});
|
|
940
|
+
let Un = { 0(e, t) {
|
|
910
941
|
let r = t.id, n = e.stack, l = e.stack.indexOf(r);
|
|
911
942
|
if (l !== -1) {
|
|
912
943
|
let i = e.stack.slice();
|
|
@@ -918,19 +949,19 @@ let Fn = { 0(e, t) {
|
|
|
918
949
|
if (n === -1) return e;
|
|
919
950
|
let l = e.stack.slice();
|
|
920
951
|
return l.splice(n, 1), { ...e, stack: l };
|
|
921
|
-
} },
|
|
952
|
+
} }, Hn = class gr extends _n {
|
|
922
953
|
constructor() {
|
|
923
|
-
super(...arguments),
|
|
954
|
+
super(...arguments), Ut(this, "actions", { push: (t) => this.send({ type: 0, id: t }), pop: (t) => this.send({ type: 1, id: t }) }), Ut(this, "selectors", { isTop: (t, r) => t.stack[t.stack.length - 1] === r, inStack: (t, r) => t.stack.includes(r) });
|
|
924
955
|
}
|
|
925
956
|
static new() {
|
|
926
|
-
return new
|
|
957
|
+
return new gr({ stack: [] });
|
|
927
958
|
}
|
|
928
959
|
reduce(t, r) {
|
|
929
|
-
return re(r.type,
|
|
960
|
+
return re(r.type, Un, t, r);
|
|
930
961
|
}
|
|
931
962
|
};
|
|
932
|
-
const
|
|
933
|
-
var
|
|
963
|
+
const wr = new mr(() => Hn.new());
|
|
964
|
+
var Xe = { exports: {} }, wt = {};
|
|
934
965
|
/**
|
|
935
966
|
* @license React
|
|
936
967
|
* use-sync-external-store-with-selector.production.js
|
|
@@ -940,58 +971,58 @@ var Ve = { exports: {} }, vt = {};
|
|
|
940
971
|
* This source code is licensed under the MIT license found in the
|
|
941
972
|
* LICENSE file in the root directory of this source tree.
|
|
942
973
|
*/
|
|
943
|
-
var
|
|
944
|
-
function
|
|
945
|
-
if (
|
|
946
|
-
|
|
974
|
+
var Ht;
|
|
975
|
+
function Vn() {
|
|
976
|
+
if (Ht) return wt;
|
|
977
|
+
Ht = 1;
|
|
947
978
|
var e = $;
|
|
948
979
|
function t(o, u) {
|
|
949
980
|
return o === u && (o !== 0 || 1 / o === 1 / u) || o !== o && u !== u;
|
|
950
981
|
}
|
|
951
|
-
var r = typeof Object.is == "function" ? Object.is : t, n = e.useSyncExternalStore, l = e.useRef, i = e.useEffect,
|
|
952
|
-
return
|
|
953
|
-
var
|
|
954
|
-
if (
|
|
982
|
+
var r = typeof Object.is == "function" ? Object.is : t, n = e.useSyncExternalStore, l = e.useRef, i = e.useEffect, a = e.useMemo, s = e.useDebugValue;
|
|
983
|
+
return wt.useSyncExternalStoreWithSelector = function(o, u, m, b, g) {
|
|
984
|
+
var y = l(null);
|
|
985
|
+
if (y.current === null) {
|
|
955
986
|
var f = { hasValue: !1, value: null };
|
|
956
|
-
|
|
957
|
-
} else f =
|
|
958
|
-
|
|
987
|
+
y.current = f;
|
|
988
|
+
} else f = y.current;
|
|
989
|
+
y = a(
|
|
959
990
|
function() {
|
|
960
|
-
function h(
|
|
991
|
+
function h(p) {
|
|
961
992
|
if (!c) {
|
|
962
|
-
if (c = !0, d =
|
|
993
|
+
if (c = !0, d = p, p = b(p), g !== void 0 && f.hasValue) {
|
|
963
994
|
var x = f.value;
|
|
964
|
-
if (
|
|
995
|
+
if (g(x, p))
|
|
965
996
|
return v = x;
|
|
966
997
|
}
|
|
967
|
-
return v =
|
|
998
|
+
return v = p;
|
|
968
999
|
}
|
|
969
|
-
if (x = v, r(d,
|
|
970
|
-
var O =
|
|
971
|
-
return
|
|
1000
|
+
if (x = v, r(d, p)) return x;
|
|
1001
|
+
var O = b(p);
|
|
1002
|
+
return g !== void 0 && g(x, O) ? (d = p, x) : (d = p, v = O);
|
|
972
1003
|
}
|
|
973
|
-
var c = !1, d, v,
|
|
1004
|
+
var c = !1, d, v, w = m === void 0 ? null : m;
|
|
974
1005
|
return [
|
|
975
1006
|
function() {
|
|
976
1007
|
return h(u());
|
|
977
1008
|
},
|
|
978
|
-
|
|
979
|
-
return h(
|
|
1009
|
+
w === null ? void 0 : function() {
|
|
1010
|
+
return h(w());
|
|
980
1011
|
}
|
|
981
1012
|
];
|
|
982
1013
|
},
|
|
983
|
-
[u,
|
|
1014
|
+
[u, m, b, g]
|
|
984
1015
|
);
|
|
985
|
-
var E = n(o,
|
|
1016
|
+
var E = n(o, y[0], y[1]);
|
|
986
1017
|
return i(
|
|
987
1018
|
function() {
|
|
988
1019
|
f.hasValue = !0, f.value = E;
|
|
989
1020
|
},
|
|
990
1021
|
[E]
|
|
991
|
-
),
|
|
992
|
-
},
|
|
1022
|
+
), s(E), E;
|
|
1023
|
+
}, wt;
|
|
993
1024
|
}
|
|
994
|
-
var
|
|
1025
|
+
var yt = {};
|
|
995
1026
|
/**
|
|
996
1027
|
* @license React
|
|
997
1028
|
* use-sync-external-store-with-selector.development.js
|
|
@@ -1001,111 +1032,111 @@ var gt = {};
|
|
|
1001
1032
|
* This source code is licensed under the MIT license found in the
|
|
1002
1033
|
* LICENSE file in the root directory of this source tree.
|
|
1003
1034
|
*/
|
|
1004
|
-
var
|
|
1005
|
-
function
|
|
1006
|
-
return
|
|
1035
|
+
var Vt;
|
|
1036
|
+
function Bn() {
|
|
1037
|
+
return Vt || (Vt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
1007
1038
|
function e(o, u) {
|
|
1008
1039
|
return o === u && (o !== 0 || 1 / o === 1 / u) || o !== o && u !== u;
|
|
1009
1040
|
}
|
|
1010
1041
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
1011
|
-
var t = $, r = typeof Object.is == "function" ? Object.is : e, n = t.useSyncExternalStore, l = t.useRef, i = t.useEffect,
|
|
1012
|
-
|
|
1013
|
-
var
|
|
1014
|
-
if (
|
|
1042
|
+
var t = $, r = typeof Object.is == "function" ? Object.is : e, n = t.useSyncExternalStore, l = t.useRef, i = t.useEffect, a = t.useMemo, s = t.useDebugValue;
|
|
1043
|
+
yt.useSyncExternalStoreWithSelector = function(o, u, m, b, g) {
|
|
1044
|
+
var y = l(null);
|
|
1045
|
+
if (y.current === null) {
|
|
1015
1046
|
var f = { hasValue: !1, value: null };
|
|
1016
|
-
|
|
1017
|
-
} else f =
|
|
1018
|
-
|
|
1047
|
+
y.current = f;
|
|
1048
|
+
} else f = y.current;
|
|
1049
|
+
y = a(
|
|
1019
1050
|
function() {
|
|
1020
|
-
function h(
|
|
1051
|
+
function h(p) {
|
|
1021
1052
|
if (!c) {
|
|
1022
|
-
if (c = !0, d =
|
|
1053
|
+
if (c = !0, d = p, p = b(p), g !== void 0 && f.hasValue) {
|
|
1023
1054
|
var x = f.value;
|
|
1024
|
-
if (
|
|
1055
|
+
if (g(x, p))
|
|
1025
1056
|
return v = x;
|
|
1026
1057
|
}
|
|
1027
|
-
return v =
|
|
1058
|
+
return v = p;
|
|
1028
1059
|
}
|
|
1029
|
-
if (x = v, r(d,
|
|
1060
|
+
if (x = v, r(d, p))
|
|
1030
1061
|
return x;
|
|
1031
|
-
var O =
|
|
1032
|
-
return
|
|
1062
|
+
var O = b(p);
|
|
1063
|
+
return g !== void 0 && g(x, O) ? (d = p, x) : (d = p, v = O);
|
|
1033
1064
|
}
|
|
1034
|
-
var c = !1, d, v,
|
|
1065
|
+
var c = !1, d, v, w = m === void 0 ? null : m;
|
|
1035
1066
|
return [
|
|
1036
1067
|
function() {
|
|
1037
1068
|
return h(u());
|
|
1038
1069
|
},
|
|
1039
|
-
|
|
1040
|
-
return h(
|
|
1070
|
+
w === null ? void 0 : function() {
|
|
1071
|
+
return h(w());
|
|
1041
1072
|
}
|
|
1042
1073
|
];
|
|
1043
1074
|
},
|
|
1044
|
-
[u,
|
|
1075
|
+
[u, m, b, g]
|
|
1045
1076
|
);
|
|
1046
|
-
var E = n(o,
|
|
1077
|
+
var E = n(o, y[0], y[1]);
|
|
1047
1078
|
return i(
|
|
1048
1079
|
function() {
|
|
1049
1080
|
f.hasValue = !0, f.value = E;
|
|
1050
1081
|
},
|
|
1051
1082
|
[E]
|
|
1052
|
-
),
|
|
1083
|
+
), s(E), E;
|
|
1053
1084
|
}, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
1054
|
-
})()),
|
|
1085
|
+
})()), yt;
|
|
1055
1086
|
}
|
|
1056
|
-
var
|
|
1057
|
-
function
|
|
1058
|
-
return
|
|
1087
|
+
var Bt;
|
|
1088
|
+
function Xn() {
|
|
1089
|
+
return Bt || (Bt = 1, process.env.NODE_ENV === "production" ? Xe.exports = Vn() : Xe.exports = Bn()), Xe.exports;
|
|
1059
1090
|
}
|
|
1060
|
-
var
|
|
1061
|
-
function
|
|
1062
|
-
return
|
|
1091
|
+
var zn = Xn();
|
|
1092
|
+
function yr(e, t, r = vr) {
|
|
1093
|
+
return zn.useSyncExternalStoreWithSelector(M((n) => e.subscribe(Gn, n)), M(() => e.state), M(() => e.state), M(t), r);
|
|
1063
1094
|
}
|
|
1064
|
-
function
|
|
1095
|
+
function Gn(e) {
|
|
1065
1096
|
return e;
|
|
1066
1097
|
}
|
|
1067
|
-
function
|
|
1068
|
-
let r =
|
|
1069
|
-
return
|
|
1098
|
+
function We(e, t) {
|
|
1099
|
+
let r = _e(), n = wr.get(t), [l, i] = yr(n, W((a) => [n.selectors.isTop(a, r), n.selectors.inStack(a, r)], [n, r]));
|
|
1100
|
+
return U(() => {
|
|
1070
1101
|
if (e) return n.actions.push(r), () => n.actions.pop(r);
|
|
1071
1102
|
}, [n, e, r]), e ? i ? l : !0 : !1;
|
|
1072
1103
|
}
|
|
1073
|
-
let
|
|
1074
|
-
function
|
|
1104
|
+
let $t = /* @__PURE__ */ new Map(), Ne = /* @__PURE__ */ new Map();
|
|
1105
|
+
function Xt(e) {
|
|
1075
1106
|
var t;
|
|
1076
|
-
let r = (t =
|
|
1077
|
-
return
|
|
1107
|
+
let r = (t = Ne.get(e)) != null ? t : 0;
|
|
1108
|
+
return Ne.set(e, r + 1), r !== 0 ? () => zt(e) : ($t.set(e, { "aria-hidden": e.getAttribute("aria-hidden"), inert: e.inert }), e.setAttribute("aria-hidden", "true"), e.inert = !0, () => zt(e));
|
|
1078
1109
|
}
|
|
1079
|
-
function
|
|
1110
|
+
function zt(e) {
|
|
1080
1111
|
var t;
|
|
1081
|
-
let r = (t =
|
|
1082
|
-
if (r === 1 ?
|
|
1083
|
-
let n =
|
|
1084
|
-
n && (n["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", n["aria-hidden"]), e.inert = n.inert,
|
|
1085
|
-
}
|
|
1086
|
-
function
|
|
1087
|
-
let n =
|
|
1088
|
-
|
|
1112
|
+
let r = (t = Ne.get(e)) != null ? t : 1;
|
|
1113
|
+
if (r === 1 ? Ne.delete(e) : Ne.set(e, r - 1), r !== 1) return;
|
|
1114
|
+
let n = $t.get(e);
|
|
1115
|
+
n && (n["aria-hidden"] === null ? e.removeAttribute("aria-hidden") : e.setAttribute("aria-hidden", n["aria-hidden"]), e.inert = n.inert, $t.delete(e));
|
|
1116
|
+
}
|
|
1117
|
+
function Kn(e, { allowed: t, disallowed: r } = {}) {
|
|
1118
|
+
let n = We(e, "inert-others");
|
|
1119
|
+
U(() => {
|
|
1089
1120
|
var l, i;
|
|
1090
1121
|
if (!n) return;
|
|
1091
|
-
let
|
|
1092
|
-
for (let o of (l = r == null ? void 0 : r()) != null ? l : []) o &&
|
|
1093
|
-
let
|
|
1094
|
-
for (let o of
|
|
1122
|
+
let a = ne();
|
|
1123
|
+
for (let o of (l = r == null ? void 0 : r()) != null ? l : []) o && a.add(Xt(o));
|
|
1124
|
+
let s = (i = t == null ? void 0 : t()) != null ? i : [];
|
|
1125
|
+
for (let o of s) {
|
|
1095
1126
|
if (!o) continue;
|
|
1096
|
-
let u =
|
|
1127
|
+
let u = De(o);
|
|
1097
1128
|
if (!u) continue;
|
|
1098
|
-
let
|
|
1099
|
-
for (;
|
|
1100
|
-
for (let
|
|
1101
|
-
|
|
1129
|
+
let m = o.parentElement;
|
|
1130
|
+
for (; m && m !== u.body; ) {
|
|
1131
|
+
for (let b of m.children) s.some((g) => b.contains(g)) || a.add(Xt(b));
|
|
1132
|
+
m = m.parentElement;
|
|
1102
1133
|
}
|
|
1103
1134
|
}
|
|
1104
|
-
return
|
|
1135
|
+
return a.dispose;
|
|
1105
1136
|
}, [n, t, r]);
|
|
1106
1137
|
}
|
|
1107
|
-
function
|
|
1108
|
-
let n =
|
|
1138
|
+
function qn(e, t, r) {
|
|
1139
|
+
let n = ve((l) => {
|
|
1109
1140
|
let i = l.getBoundingClientRect();
|
|
1110
1141
|
i.x === 0 && i.y === 0 && i.width === 0 && i.height === 0 && r();
|
|
1111
1142
|
});
|
|
@@ -1115,39 +1146,39 @@ function Un(e, t, r) {
|
|
|
1115
1146
|
if (!l) return;
|
|
1116
1147
|
let i = ne();
|
|
1117
1148
|
if (typeof ResizeObserver < "u") {
|
|
1118
|
-
let
|
|
1119
|
-
|
|
1149
|
+
let a = new ResizeObserver(() => n.current(l));
|
|
1150
|
+
a.observe(l), i.add(() => a.disconnect());
|
|
1120
1151
|
}
|
|
1121
1152
|
if (typeof IntersectionObserver < "u") {
|
|
1122
|
-
let
|
|
1123
|
-
|
|
1153
|
+
let a = new IntersectionObserver(() => n.current(l));
|
|
1154
|
+
a.observe(l), i.add(() => a.disconnect());
|
|
1124
1155
|
}
|
|
1125
1156
|
return () => i.dispose();
|
|
1126
1157
|
}, [t, n, e]);
|
|
1127
1158
|
}
|
|
1128
|
-
let
|
|
1129
|
-
var ee = ((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))(ee || {}),
|
|
1130
|
-
function
|
|
1131
|
-
return e == null ? [] : Array.from(e.querySelectorAll(
|
|
1159
|
+
let Ze = ["[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "details>summary", "textarea:not([disabled])"].map((e) => `${e}:not([tabindex='-1'])`).join(","), Yn = ["[data-autofocus]"].map((e) => `${e}:not([tabindex='-1'])`).join(",");
|
|
1160
|
+
var ee = ((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))(ee || {}), Ot = ((e) => (e[e.Error = 0] = "Error", e[e.Overflow = 1] = "Overflow", e[e.Success = 2] = "Success", e[e.Underflow = 3] = "Underflow", e))(Ot || {}), Zn = ((e) => (e[e.Previous = -1] = "Previous", e[e.Next = 1] = "Next", e))(Zn || {});
|
|
1161
|
+
function Jn(e = document.body) {
|
|
1162
|
+
return e == null ? [] : Array.from(e.querySelectorAll(Ze)).sort((t, r) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (r.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
1132
1163
|
}
|
|
1133
|
-
function
|
|
1134
|
-
return e == null ? [] : Array.from(e.querySelectorAll(
|
|
1164
|
+
function Qn(e = document.body) {
|
|
1165
|
+
return e == null ? [] : Array.from(e.querySelectorAll(Yn)).sort((t, r) => Math.sign((t.tabIndex || Number.MAX_SAFE_INTEGER) - (r.tabIndex || Number.MAX_SAFE_INTEGER)));
|
|
1135
1166
|
}
|
|
1136
|
-
var
|
|
1137
|
-
function
|
|
1167
|
+
var br = ((e) => (e[e.Strict = 0] = "Strict", e[e.Loose = 1] = "Loose", e))(br || {});
|
|
1168
|
+
function el(e, t = 0) {
|
|
1138
1169
|
var r;
|
|
1139
|
-
return e === ((r =
|
|
1140
|
-
return e.matches(
|
|
1170
|
+
return e === ((r = De(e)) == null ? void 0 : r.body) ? !1 : re(t, { 0() {
|
|
1171
|
+
return e.matches(Ze);
|
|
1141
1172
|
}, 1() {
|
|
1142
1173
|
let n = e;
|
|
1143
1174
|
for (; n !== null; ) {
|
|
1144
|
-
if (n.matches(
|
|
1175
|
+
if (n.matches(Ze)) return !0;
|
|
1145
1176
|
n = n.parentElement;
|
|
1146
1177
|
}
|
|
1147
1178
|
return !1;
|
|
1148
1179
|
} });
|
|
1149
1180
|
}
|
|
1150
|
-
var
|
|
1181
|
+
var tl = ((e) => (e[e.Keyboard = 0] = "Keyboard", e[e.Mouse = 1] = "Mouse", e))(tl || {});
|
|
1151
1182
|
typeof window < "u" && typeof document < "u" && (document.addEventListener("keydown", (e) => {
|
|
1152
1183
|
e.metaKey || e.altKey || e.ctrlKey || (document.documentElement.dataset.headlessuiFocusVisible = "");
|
|
1153
1184
|
}, !0), document.addEventListener("click", (e) => {
|
|
@@ -1156,130 +1187,130 @@ typeof window < "u" && typeof document < "u" && (document.addEventListener("keyd
|
|
|
1156
1187
|
function te(e) {
|
|
1157
1188
|
e == null || e.focus({ preventScroll: !0 });
|
|
1158
1189
|
}
|
|
1159
|
-
let
|
|
1160
|
-
function
|
|
1190
|
+
let rl = ["textarea", "input"].join(",");
|
|
1191
|
+
function nl(e) {
|
|
1161
1192
|
var t, r;
|
|
1162
|
-
return (r = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e,
|
|
1193
|
+
return (r = (t = e == null ? void 0 : e.matches) == null ? void 0 : t.call(e, rl)) != null ? r : !1;
|
|
1163
1194
|
}
|
|
1164
|
-
function
|
|
1195
|
+
function ll(e, t = (r) => r) {
|
|
1165
1196
|
return e.slice().sort((r, n) => {
|
|
1166
1197
|
let l = t(r), i = t(n);
|
|
1167
1198
|
if (l === null || i === null) return 0;
|
|
1168
|
-
let
|
|
1169
|
-
return
|
|
1199
|
+
let a = l.compareDocumentPosition(i);
|
|
1200
|
+
return a & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : a & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
1170
1201
|
});
|
|
1171
1202
|
}
|
|
1172
|
-
function
|
|
1173
|
-
let i = Array.isArray(e) ? e.length > 0 ? e[0]
|
|
1174
|
-
l.length > 0 &&
|
|
1175
|
-
let
|
|
1203
|
+
function Ie(e, t, { sorted: r = !0, relativeTo: n = null, skipElements: l = [] } = {}) {
|
|
1204
|
+
let i = Array.isArray(e) ? e.length > 0 ? bt(e[0]) : document : bt(e), a = Array.isArray(e) ? r ? ll(e) : e : t & 64 ? Qn(e) : Jn(e);
|
|
1205
|
+
l.length > 0 && a.length > 1 && (a = a.filter((y) => !l.some((f) => f != null && "current" in f ? (f == null ? void 0 : f.current) === y : f === y))), n = n ?? (i == null ? void 0 : i.activeElement);
|
|
1206
|
+
let s = (() => {
|
|
1176
1207
|
if (t & 5) return 1;
|
|
1177
1208
|
if (t & 10) return -1;
|
|
1178
1209
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
1179
1210
|
})(), o = (() => {
|
|
1180
1211
|
if (t & 1) return 0;
|
|
1181
|
-
if (t & 2) return Math.max(0,
|
|
1182
|
-
if (t & 4) return Math.max(0,
|
|
1183
|
-
if (t & 8) return
|
|
1212
|
+
if (t & 2) return Math.max(0, a.indexOf(n)) - 1;
|
|
1213
|
+
if (t & 4) return Math.max(0, a.indexOf(n)) + 1;
|
|
1214
|
+
if (t & 8) return a.length - 1;
|
|
1184
1215
|
throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last");
|
|
1185
|
-
})(), u = t & 32 ? { preventScroll: !0 } : {},
|
|
1216
|
+
})(), u = t & 32 ? { preventScroll: !0 } : {}, m = 0, b = a.length, g;
|
|
1186
1217
|
do {
|
|
1187
|
-
if (
|
|
1188
|
-
let
|
|
1189
|
-
if (t & 16)
|
|
1218
|
+
if (m >= b || m + b <= 0) return 0;
|
|
1219
|
+
let y = o + m;
|
|
1220
|
+
if (t & 16) y = (y + b) % b;
|
|
1190
1221
|
else {
|
|
1191
|
-
if (
|
|
1192
|
-
if (
|
|
1222
|
+
if (y < 0) return 3;
|
|
1223
|
+
if (y >= b) return 1;
|
|
1193
1224
|
}
|
|
1194
|
-
|
|
1195
|
-
} while (
|
|
1196
|
-
return t & 6 &&
|
|
1225
|
+
g = a[y], g == null || g.focus(u), m += s;
|
|
1226
|
+
} while (g !== ur(g));
|
|
1227
|
+
return t & 6 && nl(g) && g.select(), 2;
|
|
1197
1228
|
}
|
|
1198
|
-
function
|
|
1229
|
+
function xr() {
|
|
1199
1230
|
return /iPhone/gi.test(window.navigator.platform) || /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0;
|
|
1200
1231
|
}
|
|
1201
|
-
function
|
|
1232
|
+
function il() {
|
|
1202
1233
|
return /Android/gi.test(window.navigator.userAgent);
|
|
1203
1234
|
}
|
|
1204
|
-
function
|
|
1205
|
-
return
|
|
1235
|
+
function Gt() {
|
|
1236
|
+
return xr() || il();
|
|
1206
1237
|
}
|
|
1207
|
-
function
|
|
1208
|
-
let l =
|
|
1238
|
+
function ze(e, t, r, n) {
|
|
1239
|
+
let l = ve(r);
|
|
1209
1240
|
L(() => {
|
|
1210
1241
|
if (!e) return;
|
|
1211
|
-
function i(
|
|
1212
|
-
l.current(
|
|
1242
|
+
function i(a) {
|
|
1243
|
+
l.current(a);
|
|
1213
1244
|
}
|
|
1214
1245
|
return document.addEventListener(t, i, n), () => document.removeEventListener(t, i, n);
|
|
1215
1246
|
}, [e, t, n]);
|
|
1216
1247
|
}
|
|
1217
|
-
function
|
|
1218
|
-
let l =
|
|
1248
|
+
function Er(e, t, r, n) {
|
|
1249
|
+
let l = ve(r);
|
|
1219
1250
|
L(() => {
|
|
1220
1251
|
if (!e) return;
|
|
1221
|
-
function i(
|
|
1222
|
-
l.current(
|
|
1252
|
+
function i(a) {
|
|
1253
|
+
l.current(a);
|
|
1223
1254
|
}
|
|
1224
1255
|
return window.addEventListener(t, i, n), () => window.removeEventListener(t, i, n);
|
|
1225
1256
|
}, [e, t, n]);
|
|
1226
1257
|
}
|
|
1227
|
-
const
|
|
1228
|
-
function
|
|
1229
|
-
let n =
|
|
1230
|
-
if (
|
|
1231
|
-
let u = o(
|
|
1258
|
+
const Kt = 30;
|
|
1259
|
+
function ol(e, t, r) {
|
|
1260
|
+
let n = ve(r), l = W(function(s, o) {
|
|
1261
|
+
if (s.defaultPrevented) return;
|
|
1262
|
+
let u = o(s);
|
|
1232
1263
|
if (u === null || !u.getRootNode().contains(u) || !u.isConnected) return;
|
|
1233
|
-
let
|
|
1234
|
-
return typeof
|
|
1264
|
+
let m = (function b(g) {
|
|
1265
|
+
return typeof g == "function" ? b(g()) : Array.isArray(g) || g instanceof Set ? g : [g];
|
|
1235
1266
|
})(t);
|
|
1236
|
-
for (let
|
|
1237
|
-
return !
|
|
1267
|
+
for (let b of m) if (b !== null && (b.contains(u) || s.composed && s.composedPath().includes(b))) return;
|
|
1268
|
+
return !el(u, br.Loose) && u.tabIndex !== -1 && s.preventDefault(), n.current(s, u);
|
|
1238
1269
|
}, [n, t]), i = S(null);
|
|
1239
|
-
|
|
1270
|
+
ze(e, "pointerdown", (s) => {
|
|
1240
1271
|
var o, u;
|
|
1241
|
-
|
|
1242
|
-
}, !0),
|
|
1243
|
-
if (
|
|
1272
|
+
Gt() || (i.current = ((u = (o = s.composedPath) == null ? void 0 : o.call(s)) == null ? void 0 : u[0]) || s.target);
|
|
1273
|
+
}, !0), ze(e, "pointerup", (s) => {
|
|
1274
|
+
if (Gt() || !i.current) return;
|
|
1244
1275
|
let o = i.current;
|
|
1245
|
-
return i.current = null, l(
|
|
1276
|
+
return i.current = null, l(s, () => o);
|
|
1246
1277
|
}, !0);
|
|
1247
|
-
let
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
}, !0),
|
|
1251
|
-
let o = { x:
|
|
1252
|
-
if (!(Math.abs(o.x -
|
|
1253
|
-
}, !0),
|
|
1254
|
-
}
|
|
1255
|
-
function
|
|
1256
|
-
return
|
|
1257
|
-
}
|
|
1258
|
-
function
|
|
1259
|
-
let l =
|
|
1278
|
+
let a = S({ x: 0, y: 0 });
|
|
1279
|
+
ze(e, "touchstart", (s) => {
|
|
1280
|
+
a.current.x = s.touches[0].clientX, a.current.y = s.touches[0].clientY;
|
|
1281
|
+
}, !0), ze(e, "touchend", (s) => {
|
|
1282
|
+
let o = { x: s.changedTouches[0].clientX, y: s.changedTouches[0].clientY };
|
|
1283
|
+
if (!(Math.abs(o.x - a.current.x) >= Kt || Math.abs(o.y - a.current.y) >= Kt)) return l(s, () => ae(s.target) ? s.target : null);
|
|
1284
|
+
}, !0), Er(e, "blur", (s) => l(s, () => On(window.document.activeElement) ? window.document.activeElement : null), !0);
|
|
1285
|
+
}
|
|
1286
|
+
function Ct(...e) {
|
|
1287
|
+
return _(() => De(...e), [...e]);
|
|
1288
|
+
}
|
|
1289
|
+
function $r(e, t, r, n) {
|
|
1290
|
+
let l = ve(r);
|
|
1260
1291
|
L(() => {
|
|
1261
1292
|
e = e ?? window;
|
|
1262
|
-
function i(
|
|
1263
|
-
l.current(
|
|
1293
|
+
function i(a) {
|
|
1294
|
+
l.current(a);
|
|
1264
1295
|
}
|
|
1265
1296
|
return e.addEventListener(t, i, n), () => e.removeEventListener(t, i, n);
|
|
1266
1297
|
}, [e, t, n]);
|
|
1267
1298
|
}
|
|
1268
|
-
function
|
|
1269
|
-
return
|
|
1299
|
+
function al(e) {
|
|
1300
|
+
return zr(e.subscribe, e.getSnapshot, e.getSnapshot);
|
|
1270
1301
|
}
|
|
1271
|
-
function
|
|
1302
|
+
function sl(e, t) {
|
|
1272
1303
|
let r = e(), n = /* @__PURE__ */ new Set();
|
|
1273
1304
|
return { getSnapshot() {
|
|
1274
1305
|
return r;
|
|
1275
1306
|
}, subscribe(l) {
|
|
1276
1307
|
return n.add(l), () => n.delete(l);
|
|
1277
1308
|
}, dispatch(l, ...i) {
|
|
1278
|
-
let
|
|
1279
|
-
|
|
1309
|
+
let a = t[l].call(r, ...i);
|
|
1310
|
+
a && (r = a, n.forEach((s) => s()));
|
|
1280
1311
|
} };
|
|
1281
1312
|
}
|
|
1282
|
-
function
|
|
1313
|
+
function ul() {
|
|
1283
1314
|
let e;
|
|
1284
1315
|
return { before({ doc: t }) {
|
|
1285
1316
|
var r;
|
|
@@ -1290,139 +1321,144 @@ function tl() {
|
|
|
1290
1321
|
r.style(n, "paddingRight", `${i}px`);
|
|
1291
1322
|
} };
|
|
1292
1323
|
}
|
|
1293
|
-
function
|
|
1294
|
-
return
|
|
1324
|
+
function cl() {
|
|
1325
|
+
return xr() ? { before({ doc: e, d: t, meta: r }) {
|
|
1295
1326
|
function n(l) {
|
|
1296
|
-
|
|
1327
|
+
for (let i of r().containers) for (let a of i()) if (a.contains(l)) return !0;
|
|
1328
|
+
return !1;
|
|
1297
1329
|
}
|
|
1298
1330
|
t.microTask(() => {
|
|
1299
1331
|
var l;
|
|
1300
1332
|
if (window.getComputedStyle(e.documentElement).scrollBehavior !== "auto") {
|
|
1301
|
-
let
|
|
1302
|
-
|
|
1333
|
+
let s = ne();
|
|
1334
|
+
s.style(e.documentElement, "scrollBehavior", "auto"), t.add(() => t.microTask(() => s.dispose()));
|
|
1303
1335
|
}
|
|
1304
|
-
let i = (l = window.scrollY) != null ? l : window.pageYOffset,
|
|
1305
|
-
t.addEventListener(e, "click", (
|
|
1306
|
-
if (ae(
|
|
1307
|
-
let o =
|
|
1336
|
+
let i = (l = window.scrollY) != null ? l : window.pageYOffset, a = null;
|
|
1337
|
+
t.addEventListener(e, "click", (s) => {
|
|
1338
|
+
if (ae(s.target)) try {
|
|
1339
|
+
let o = s.target.closest("a");
|
|
1308
1340
|
if (!o) return;
|
|
1309
|
-
let { hash: u } = new URL(o.href),
|
|
1310
|
-
ae(
|
|
1341
|
+
let { hash: u } = new URL(o.href), m = e.querySelector(u);
|
|
1342
|
+
ae(m) && !n(m) && (a = m);
|
|
1311
1343
|
} catch {
|
|
1312
1344
|
}
|
|
1313
|
-
}, !0), t.
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1345
|
+
}, !0), t.group((s) => {
|
|
1346
|
+
t.addEventListener(e, "touchstart", (o) => {
|
|
1347
|
+
if (s.dispose(), ae(o.target) && $n(o.target)) if (n(o.target)) {
|
|
1348
|
+
let u = o.target;
|
|
1349
|
+
for (; u.parentElement && n(u.parentElement); ) u = u.parentElement;
|
|
1350
|
+
s.style(u, "overscrollBehavior", "contain");
|
|
1351
|
+
} else s.style(o.target, "touchAction", "none");
|
|
1352
|
+
});
|
|
1353
|
+
}), t.addEventListener(e, "touchmove", (s) => {
|
|
1354
|
+
if (ae(s.target)) {
|
|
1355
|
+
if (Sn(s.target)) return;
|
|
1356
|
+
if (n(s.target)) {
|
|
1357
|
+
let o = s.target;
|
|
1324
1358
|
for (; o.parentElement && o.dataset.headlessuiPortal !== "" && !(o.scrollHeight > o.clientHeight || o.scrollWidth > o.clientWidth); ) o = o.parentElement;
|
|
1325
|
-
o.dataset.headlessuiPortal === "" &&
|
|
1326
|
-
} else
|
|
1359
|
+
o.dataset.headlessuiPortal === "" && s.preventDefault();
|
|
1360
|
+
} else s.preventDefault();
|
|
1327
1361
|
}
|
|
1328
1362
|
}, { passive: !1 }), t.add(() => {
|
|
1329
|
-
var
|
|
1330
|
-
let o = (
|
|
1331
|
-
i !== o && window.scrollTo(0, i),
|
|
1363
|
+
var s;
|
|
1364
|
+
let o = (s = window.scrollY) != null ? s : window.pageYOffset;
|
|
1365
|
+
i !== o && window.scrollTo(0, i), a && a.isConnected && (a.scrollIntoView({ block: "nearest" }), a = null);
|
|
1332
1366
|
});
|
|
1333
1367
|
});
|
|
1334
1368
|
} } : {};
|
|
1335
1369
|
}
|
|
1336
|
-
function
|
|
1370
|
+
function dl() {
|
|
1337
1371
|
return { before({ doc: e, d: t }) {
|
|
1338
1372
|
t.style(e.documentElement, "overflow", "hidden");
|
|
1339
1373
|
} };
|
|
1340
1374
|
}
|
|
1341
|
-
function
|
|
1375
|
+
function qt(e) {
|
|
1342
1376
|
let t = {};
|
|
1343
1377
|
for (let r of e) Object.assign(t, r(t));
|
|
1344
1378
|
return t;
|
|
1345
1379
|
}
|
|
1346
|
-
let
|
|
1380
|
+
let pe = sl(() => /* @__PURE__ */ new Map(), { PUSH(e, t) {
|
|
1347
1381
|
var r;
|
|
1348
|
-
let n = (r = this.get(e)) != null ? r : { doc: e, count: 0, d: ne(), meta: /* @__PURE__ */ new Set() };
|
|
1349
|
-
return n.count++, n.meta.add(t), this.set(e, n), this;
|
|
1382
|
+
let n = (r = this.get(e)) != null ? r : { doc: e, count: 0, d: ne(), meta: /* @__PURE__ */ new Set(), computedMeta: {} };
|
|
1383
|
+
return n.count++, n.meta.add(t), n.computedMeta = qt(n.meta), this.set(e, n), this;
|
|
1350
1384
|
}, POP(e, t) {
|
|
1351
1385
|
let r = this.get(e);
|
|
1352
|
-
return r && (r.count--, r.meta.delete(t)), this;
|
|
1353
|
-
}, SCROLL_PREVENT(
|
|
1354
|
-
let
|
|
1355
|
-
|
|
1386
|
+
return r && (r.count--, r.meta.delete(t), r.computedMeta = qt(r.meta)), this;
|
|
1387
|
+
}, SCROLL_PREVENT(e) {
|
|
1388
|
+
let t = { doc: e.doc, d: e.d, meta() {
|
|
1389
|
+
return e.computedMeta;
|
|
1390
|
+
} }, r = [cl(), ul(), dl()];
|
|
1391
|
+
r.forEach(({ before: n }) => n == null ? void 0 : n(t)), r.forEach(({ after: n }) => n == null ? void 0 : n(t));
|
|
1356
1392
|
}, SCROLL_ALLOW({ d: e }) {
|
|
1357
1393
|
e.dispose();
|
|
1358
1394
|
}, TEARDOWN({ doc: e }) {
|
|
1359
1395
|
this.delete(e);
|
|
1360
1396
|
} });
|
|
1361
|
-
|
|
1362
|
-
let e =
|
|
1397
|
+
pe.subscribe(() => {
|
|
1398
|
+
let e = pe.getSnapshot(), t = /* @__PURE__ */ new Map();
|
|
1363
1399
|
for (let [r] of e) t.set(r, r.documentElement.style.overflow);
|
|
1364
1400
|
for (let r of e.values()) {
|
|
1365
1401
|
let n = t.get(r.doc) === "hidden", l = r.count !== 0;
|
|
1366
|
-
(l && !n || !l && n) &&
|
|
1402
|
+
(l && !n || !l && n) && pe.dispatch(r.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", r), r.count === 0 && pe.dispatch("TEARDOWN", r);
|
|
1367
1403
|
}
|
|
1368
1404
|
});
|
|
1369
|
-
function
|
|
1370
|
-
let n =
|
|
1371
|
-
return
|
|
1372
|
-
if (!(!t || !e)) return
|
|
1405
|
+
function fl(e, t, r = () => ({ containers: [] })) {
|
|
1406
|
+
let n = al(pe), l = t ? n.get(t) : void 0, i = l ? l.count > 0 : !1;
|
|
1407
|
+
return U(() => {
|
|
1408
|
+
if (!(!t || !e)) return pe.dispatch("PUSH", t, r), () => pe.dispatch("POP", t, r);
|
|
1373
1409
|
}, [e, t]), i;
|
|
1374
1410
|
}
|
|
1375
|
-
function
|
|
1376
|
-
let n =
|
|
1377
|
-
|
|
1411
|
+
function pl(e, t, r = () => [document.body]) {
|
|
1412
|
+
let n = We(e, "scroll-lock");
|
|
1413
|
+
fl(n, t, (l) => {
|
|
1378
1414
|
var i;
|
|
1379
1415
|
return { containers: [...(i = l.containers) != null ? i : [], r] };
|
|
1380
1416
|
});
|
|
1381
1417
|
}
|
|
1382
|
-
function
|
|
1383
|
-
let [t, r] =
|
|
1384
|
-
return { flags: t, setFlag: n, addFlag: l, hasFlag: i, removeFlag:
|
|
1418
|
+
function ml(e = 0) {
|
|
1419
|
+
let [t, r] = F(e), n = W((o) => r(o), []), l = W((o) => r((u) => u | o), []), i = W((o) => (t & o) === o, [t]), a = W((o) => r((u) => u & ~o), []), s = W((o) => r((u) => u ^ o), []);
|
|
1420
|
+
return { flags: t, setFlag: n, addFlag: l, hasFlag: i, removeFlag: a, toggleFlag: s };
|
|
1385
1421
|
}
|
|
1386
|
-
var
|
|
1387
|
-
typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((
|
|
1422
|
+
var Yt, Zt;
|
|
1423
|
+
typeof process < "u" && typeof globalThis < "u" && typeof Element < "u" && ((Yt = process == null ? void 0 : process.env) == null ? void 0 : Yt.NODE_ENV) === "test" && typeof ((Zt = Element == null ? void 0 : Element.prototype) == null ? void 0 : Zt.getAnimations) > "u" && (Element.prototype.getAnimations = function() {
|
|
1388
1424
|
return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.", "Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.", "", "Example usage:", "```js", "import { mockAnimationsApi } from 'jsdom-testing-mocks'", "mockAnimationsApi()", "```"].join(`
|
|
1389
1425
|
`)), [];
|
|
1390
1426
|
});
|
|
1391
|
-
var
|
|
1392
|
-
function
|
|
1427
|
+
var hl = ((e) => (e[e.None = 0] = "None", e[e.Closed = 1] = "Closed", e[e.Enter = 2] = "Enter", e[e.Leave = 4] = "Leave", e))(hl || {});
|
|
1428
|
+
function vl(e) {
|
|
1393
1429
|
let t = {};
|
|
1394
1430
|
for (let r in e) e[r] === !0 && (t[`data-${r}`] = "");
|
|
1395
1431
|
return t;
|
|
1396
1432
|
}
|
|
1397
|
-
function
|
|
1398
|
-
let [l, i] =
|
|
1399
|
-
return
|
|
1400
|
-
var
|
|
1433
|
+
function gl(e, t, r, n) {
|
|
1434
|
+
let [l, i] = F(r), { hasFlag: a, addFlag: s, removeFlag: o } = ml(e && l ? 3 : 0), u = S(!1), m = S(!1), b = rt();
|
|
1435
|
+
return U(() => {
|
|
1436
|
+
var g;
|
|
1401
1437
|
if (e) {
|
|
1402
1438
|
if (r && i(!0), !t) {
|
|
1403
|
-
r &&
|
|
1439
|
+
r && s(3);
|
|
1404
1440
|
return;
|
|
1405
1441
|
}
|
|
1406
|
-
return (
|
|
1407
|
-
|
|
1442
|
+
return (g = n == null ? void 0 : n.start) == null || g.call(n, r), wl(t, { inFlight: u, prepare() {
|
|
1443
|
+
m.current ? m.current = !1 : m.current = u.current, u.current = !0, !m.current && (r ? (s(3), o(4)) : (s(4), o(2)));
|
|
1408
1444
|
}, run() {
|
|
1409
|
-
|
|
1445
|
+
m.current ? r ? (o(3), s(4)) : (o(4), s(3)) : r ? o(1) : s(1);
|
|
1410
1446
|
}, done() {
|
|
1411
|
-
var
|
|
1412
|
-
|
|
1447
|
+
var y;
|
|
1448
|
+
m.current && xl(t) || (u.current = !1, o(7), r || i(!1), (y = n == null ? void 0 : n.end) == null || y.call(n, r));
|
|
1413
1449
|
} });
|
|
1414
1450
|
}
|
|
1415
|
-
}, [e, r, t,
|
|
1451
|
+
}, [e, r, t, b]), e ? [l, { closed: a(1), enter: a(2), leave: a(4), transition: a(2) || a(4) }] : [r, { closed: void 0, enter: void 0, leave: void 0, transition: void 0 }];
|
|
1416
1452
|
}
|
|
1417
|
-
function
|
|
1453
|
+
function wl(e, { prepare: t, run: r, done: n, inFlight: l }) {
|
|
1418
1454
|
let i = ne();
|
|
1419
|
-
return
|
|
1455
|
+
return bl(e, { prepare: t, inFlight: l }), i.nextFrame(() => {
|
|
1420
1456
|
r(), i.requestAnimationFrame(() => {
|
|
1421
|
-
i.add(
|
|
1457
|
+
i.add(yl(e, n));
|
|
1422
1458
|
});
|
|
1423
1459
|
}), i.dispose;
|
|
1424
1460
|
}
|
|
1425
|
-
function
|
|
1461
|
+
function yl(e, t) {
|
|
1426
1462
|
var r, n;
|
|
1427
1463
|
let l = ne();
|
|
1428
1464
|
if (!e) return l.dispose;
|
|
@@ -1430,12 +1466,12 @@ function fl(e, t) {
|
|
|
1430
1466
|
l.add(() => {
|
|
1431
1467
|
i = !0;
|
|
1432
1468
|
});
|
|
1433
|
-
let
|
|
1434
|
-
return
|
|
1469
|
+
let a = (n = (r = e.getAnimations) == null ? void 0 : r.call(e).filter((s) => s instanceof CSSTransition)) != null ? n : [];
|
|
1470
|
+
return a.length === 0 ? (t(), l.dispose) : (Promise.allSettled(a.map((s) => s.finished)).then(() => {
|
|
1435
1471
|
i || t();
|
|
1436
1472
|
}), l.dispose);
|
|
1437
1473
|
}
|
|
1438
|
-
function
|
|
1474
|
+
function bl(e, { inFlight: t, prepare: r }) {
|
|
1439
1475
|
if (t != null && t.current) {
|
|
1440
1476
|
r();
|
|
1441
1477
|
return;
|
|
@@ -1443,79 +1479,72 @@ function ml(e, { inFlight: t, prepare: r }) {
|
|
|
1443
1479
|
let n = e.style.transition;
|
|
1444
1480
|
e.style.transition = "none", r(), e.offsetHeight, e.style.transition = n;
|
|
1445
1481
|
}
|
|
1446
|
-
function
|
|
1482
|
+
function xl(e) {
|
|
1483
|
+
var t, r;
|
|
1484
|
+
return ((r = (t = e.getAnimations) == null ? void 0 : t.call(e)) != null ? r : []).some((n) => n instanceof CSSTransition && n.playState !== "finished");
|
|
1485
|
+
}
|
|
1486
|
+
function Ft(e, t) {
|
|
1447
1487
|
let r = S([]), n = M(e);
|
|
1448
1488
|
L(() => {
|
|
1449
1489
|
let l = [...r.current];
|
|
1450
|
-
for (let [i,
|
|
1451
|
-
let
|
|
1452
|
-
return r.current = t,
|
|
1490
|
+
for (let [i, a] of t.entries()) if (r.current[i] !== a) {
|
|
1491
|
+
let s = n(t, l);
|
|
1492
|
+
return r.current = t, s;
|
|
1453
1493
|
}
|
|
1454
1494
|
}, [n, ...t]);
|
|
1455
1495
|
}
|
|
1456
|
-
let
|
|
1457
|
-
|
|
1458
|
-
var
|
|
1459
|
-
function
|
|
1460
|
-
return H(
|
|
1496
|
+
let nt = z(null);
|
|
1497
|
+
nt.displayName = "OpenClosedContext";
|
|
1498
|
+
var q = ((e) => (e[e.Open = 1] = "Open", e[e.Closed = 2] = "Closed", e[e.Closing = 4] = "Closing", e[e.Opening = 8] = "Opening", e))(q || {});
|
|
1499
|
+
function lt() {
|
|
1500
|
+
return H(nt);
|
|
1461
1501
|
}
|
|
1462
|
-
function
|
|
1463
|
-
return $.createElement(
|
|
1502
|
+
function El({ value: e, children: t }) {
|
|
1503
|
+
return $.createElement(nt.Provider, { value: e }, t);
|
|
1464
1504
|
}
|
|
1465
|
-
function
|
|
1466
|
-
return $.createElement(
|
|
1505
|
+
function $l({ children: e }) {
|
|
1506
|
+
return $.createElement(nt.Provider, { value: null }, e);
|
|
1467
1507
|
}
|
|
1468
|
-
function
|
|
1508
|
+
function Ol(e) {
|
|
1469
1509
|
function t() {
|
|
1470
1510
|
document.readyState !== "loading" && (e(), document.removeEventListener("DOMContentLoaded", t));
|
|
1471
1511
|
}
|
|
1472
1512
|
typeof window < "u" && typeof document < "u" && (document.addEventListener("DOMContentLoaded", t), t());
|
|
1473
1513
|
}
|
|
1474
1514
|
let ie = [];
|
|
1475
|
-
|
|
1515
|
+
Ol(() => {
|
|
1476
1516
|
function e(t) {
|
|
1477
1517
|
if (!ae(t.target) || t.target === document.body || ie[0] === t.target) return;
|
|
1478
1518
|
let r = t.target;
|
|
1479
|
-
r = r.closest(
|
|
1519
|
+
r = r.closest(Ze), ie.unshift(r ?? t.target), ie = ie.filter((n) => n != null && n.isConnected), ie.splice(10);
|
|
1480
1520
|
}
|
|
1481
1521
|
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 });
|
|
1482
1522
|
});
|
|
1483
|
-
function
|
|
1523
|
+
function Or(e) {
|
|
1484
1524
|
let t = M(e), r = S(!1);
|
|
1485
1525
|
L(() => (r.current = !1, () => {
|
|
1486
|
-
r.current = !0,
|
|
1526
|
+
r.current = !0, tt(() => {
|
|
1487
1527
|
r.current && t();
|
|
1488
1528
|
});
|
|
1489
1529
|
}), [t]);
|
|
1490
1530
|
}
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
return
|
|
1494
|
-
}, () => !1, () => !e) : !1;
|
|
1495
|
-
}
|
|
1496
|
-
function De() {
|
|
1497
|
-
let e = gl(), [t, r] = Ae.useState(J.isHandoffComplete);
|
|
1498
|
-
return t && J.isHandoffComplete === !1 && r(!1), Ae.useEffect(() => {
|
|
1499
|
-
t !== !0 && r(!0);
|
|
1500
|
-
}, [t]), Ae.useEffect(() => J.handoff(), []), e ? !1 : t;
|
|
1531
|
+
let Sr = z(!1);
|
|
1532
|
+
function Sl() {
|
|
1533
|
+
return H(Sr);
|
|
1501
1534
|
}
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
return H(br);
|
|
1535
|
+
function Jt(e) {
|
|
1536
|
+
return $.createElement(Sr.Provider, { value: e.force }, e.children);
|
|
1505
1537
|
}
|
|
1506
|
-
function
|
|
1507
|
-
|
|
1508
|
-
}
|
|
1509
|
-
function yl(e) {
|
|
1510
|
-
let t = wl(), r = H(Er), [n, l] = A(() => {
|
|
1538
|
+
function Tl(e) {
|
|
1539
|
+
let t = Sl(), r = H(Pr), [n, l] = F(() => {
|
|
1511
1540
|
var i;
|
|
1512
1541
|
if (!t && r !== null) return (i = r.current) != null ? i : null;
|
|
1513
|
-
if (
|
|
1514
|
-
let
|
|
1515
|
-
if (
|
|
1542
|
+
if (Z.isServer) return null;
|
|
1543
|
+
let a = e == null ? void 0 : e.getElementById("headlessui-portal-root");
|
|
1544
|
+
if (a) return a;
|
|
1516
1545
|
if (e === null) return null;
|
|
1517
|
-
let
|
|
1518
|
-
return
|
|
1546
|
+
let s = e.createElement("div");
|
|
1547
|
+
return s.setAttribute("id", "headlessui-portal-root"), e.body.appendChild(s);
|
|
1519
1548
|
});
|
|
1520
1549
|
return L(() => {
|
|
1521
1550
|
n !== null && (e != null && e.body.contains(n) || e == null || e.body.appendChild(n));
|
|
@@ -1523,54 +1552,47 @@ function yl(e) {
|
|
|
1523
1552
|
t || r !== null && l(r.current);
|
|
1524
1553
|
}, [r, l, t]), n;
|
|
1525
1554
|
}
|
|
1526
|
-
let
|
|
1527
|
-
let { ownerDocument: r = null, ...n } = e, l = S(null), i =
|
|
1555
|
+
let Tr = ue, Pl = V(function(e, t) {
|
|
1556
|
+
let { ownerDocument: r = null, ...n } = e, l = S(null), i = J(Tn((g) => {
|
|
1528
1557
|
l.current = g;
|
|
1529
|
-
}), t),
|
|
1530
|
-
|
|
1531
|
-
return J.isServer ? null : (g = a == null ? void 0 : a.createElement("div")) != null ? g : null;
|
|
1532
|
-
}), p = H(Et), w = De();
|
|
1533
|
-
_(() => {
|
|
1534
|
-
!o || !u || o.contains(u) || (u.setAttribute("data-headlessui-portal", ""), o.appendChild(u));
|
|
1535
|
-
}, [o, u]), _(() => {
|
|
1536
|
-
if (u && p) return p.register(u);
|
|
1537
|
-
}, [p, u]), yr(() => {
|
|
1558
|
+
}), t), a = Ct(l.current), s = r ?? a, o = Tl(s), u = H(St), m = rt(), b = G();
|
|
1559
|
+
return Or(() => {
|
|
1538
1560
|
var g;
|
|
1539
|
-
|
|
1540
|
-
})
|
|
1541
|
-
|
|
1542
|
-
|
|
1561
|
+
o && o.childNodes.length <= 0 && ((g = o.parentElement) == null || g.removeChild(o));
|
|
1562
|
+
}), o ? Zr($.createElement("div", { "data-headlessui-portal": "", ref: (g) => {
|
|
1563
|
+
m.dispose(), u && g && m.add(u.register(g));
|
|
1564
|
+
} }, b({ ourProps: { ref: i }, theirProps: n, slot: {}, defaultTag: Tr, name: "Portal" })), o) : null;
|
|
1543
1565
|
});
|
|
1544
|
-
function
|
|
1545
|
-
let r =
|
|
1546
|
-
return n ? $.createElement(
|
|
1547
|
-
}
|
|
1548
|
-
let
|
|
1549
|
-
function
|
|
1550
|
-
let { target: r, ...n } = e, l = { ref:
|
|
1551
|
-
return $.createElement(
|
|
1552
|
-
}
|
|
1553
|
-
let
|
|
1554
|
-
function
|
|
1555
|
-
let e = H(
|
|
1556
|
-
let
|
|
1557
|
-
|
|
1558
|
-
}), l =
|
|
1559
|
-
return [t,
|
|
1560
|
-
return $.createElement(
|
|
1566
|
+
function Ml(e, t) {
|
|
1567
|
+
let r = J(t), { enabled: n = !0, ownerDocument: l, ...i } = e, a = G();
|
|
1568
|
+
return n ? $.createElement(Pl, { ...i, ownerDocument: l, ref: r }) : a({ ourProps: { ref: r }, theirProps: i, slot: {}, defaultTag: Tr, name: "Portal" });
|
|
1569
|
+
}
|
|
1570
|
+
let Ll = ue, Pr = z(null);
|
|
1571
|
+
function kl(e, t) {
|
|
1572
|
+
let { target: r, ...n } = e, l = { ref: J(t) }, i = G();
|
|
1573
|
+
return $.createElement(Pr.Provider, { value: r }, i({ ourProps: l, theirProps: n, defaultTag: Ll, name: "Popover.Group" }));
|
|
1574
|
+
}
|
|
1575
|
+
let St = z(null);
|
|
1576
|
+
function Al() {
|
|
1577
|
+
let e = H(St), t = S([]), r = M((i) => (t.current.push(i), e && e.register(i), () => n(i))), n = M((i) => {
|
|
1578
|
+
let a = t.current.indexOf(i);
|
|
1579
|
+
a !== -1 && t.current.splice(a, 1), e && e.unregister(i);
|
|
1580
|
+
}), l = _(() => ({ register: r, unregister: n, portals: t }), [r, n, t]);
|
|
1581
|
+
return [t, _(() => function({ children: i }) {
|
|
1582
|
+
return $.createElement(St.Provider, { value: l }, i);
|
|
1561
1583
|
}, [l])];
|
|
1562
1584
|
}
|
|
1563
|
-
let
|
|
1564
|
-
function
|
|
1565
|
-
let n =
|
|
1566
|
-
|
|
1567
|
-
n && (l.defaultPrevented || l.key ===
|
|
1585
|
+
let Cl = V(Ml), Mr = V(kl), Fl = Object.assign(Cl, { Group: Mr });
|
|
1586
|
+
function Nl(e, t = typeof document < "u" ? document.defaultView : null, r) {
|
|
1587
|
+
let n = We(e, "escape");
|
|
1588
|
+
$r(t, "keydown", (l) => {
|
|
1589
|
+
n && (l.defaultPrevented || l.key === pr.Escape && r(l));
|
|
1568
1590
|
});
|
|
1569
1591
|
}
|
|
1570
|
-
function
|
|
1592
|
+
function Il() {
|
|
1571
1593
|
var e;
|
|
1572
|
-
let [t] =
|
|
1573
|
-
return
|
|
1594
|
+
let [t] = F(() => typeof window < "u" && typeof window.matchMedia == "function" ? window.matchMedia("(pointer: coarse)") : null), [r, n] = F((e = t == null ? void 0 : t.matches) != null ? e : !1);
|
|
1595
|
+
return U(() => {
|
|
1574
1596
|
if (!t) return;
|
|
1575
1597
|
function l(i) {
|
|
1576
1598
|
n(i.matches);
|
|
@@ -1578,91 +1600,102 @@ function Ml() {
|
|
|
1578
1600
|
return t.addEventListener("change", l), () => t.removeEventListener("change", l);
|
|
1579
1601
|
}, [t]), r;
|
|
1580
1602
|
}
|
|
1581
|
-
function
|
|
1582
|
-
let n =
|
|
1583
|
-
var
|
|
1584
|
-
let a = [];
|
|
1585
|
-
for (let o of e) o !== null && (se(o) ?
|
|
1586
|
-
if (t != null && t.current) for (let o of t.current)
|
|
1587
|
-
for (let o of (
|
|
1588
|
-
return
|
|
1603
|
+
function Rl({ defaultContainers: e = [], portals: t, mainTreeNode: r } = {}) {
|
|
1604
|
+
let n = M(() => {
|
|
1605
|
+
var l, i;
|
|
1606
|
+
let a = De(r), s = [];
|
|
1607
|
+
for (let o of e) o !== null && (se(o) ? s.push(o) : "current" in o && se(o.current) && s.push(o.current));
|
|
1608
|
+
if (t != null && t.current) for (let o of t.current) s.push(o);
|
|
1609
|
+
for (let o of (l = a == null ? void 0 : a.querySelectorAll("html > *, body > *")) != null ? l : []) o !== document.body && o !== document.head && se(o) && o.id !== "headlessui-portal-root" && (r && (o.contains(r) || o.contains((i = r == null ? void 0 : r.getRootNode()) == null ? void 0 : i.host)) || s.some((u) => o.contains(u)) || s.push(o));
|
|
1610
|
+
return s;
|
|
1589
1611
|
});
|
|
1590
|
-
return { resolveContainers:
|
|
1612
|
+
return { resolveContainers: n, contains: M((l) => n().some((i) => i.contains(l))) };
|
|
1591
1613
|
}
|
|
1592
|
-
let
|
|
1593
|
-
function
|
|
1594
|
-
let [r, n] =
|
|
1595
|
-
return $.createElement(
|
|
1596
|
-
var
|
|
1614
|
+
let Lr = z(null);
|
|
1615
|
+
function Qt({ children: e, node: t }) {
|
|
1616
|
+
let [r, n] = F(null), l = kr(t ?? r);
|
|
1617
|
+
return $.createElement(Lr.Provider, { value: l }, e, l === null && $.createElement(Et, { features: Ye.Hidden, ref: (i) => {
|
|
1618
|
+
var a, s;
|
|
1597
1619
|
if (i) {
|
|
1598
|
-
for (let o of (
|
|
1620
|
+
for (let o of (s = (a = De(i)) == null ? void 0 : a.querySelectorAll("html > *, body > *")) != null ? s : []) if (o !== document.body && o !== document.head && se(o) && o != null && o.contains(i)) {
|
|
1599
1621
|
n(o);
|
|
1600
1622
|
break;
|
|
1601
1623
|
}
|
|
1602
1624
|
}
|
|
1603
1625
|
} }));
|
|
1604
1626
|
}
|
|
1605
|
-
function
|
|
1627
|
+
function kr(e = null) {
|
|
1606
1628
|
var t;
|
|
1607
|
-
return (t = H(
|
|
1629
|
+
return (t = H(Lr)) != null ? t : e;
|
|
1630
|
+
}
|
|
1631
|
+
function _l() {
|
|
1632
|
+
let e = typeof document > "u";
|
|
1633
|
+
return "useSyncExternalStore" in Ce ? ((t) => t.useSyncExternalStore)(Ce)(() => () => {
|
|
1634
|
+
}, () => !1, () => !e) : !1;
|
|
1635
|
+
}
|
|
1636
|
+
function it() {
|
|
1637
|
+
let e = _l(), [t, r] = Ce.useState(Z.isHandoffComplete);
|
|
1638
|
+
return t && Z.isHandoffComplete === !1 && r(!1), Ce.useEffect(() => {
|
|
1639
|
+
t !== !0 && r(!0);
|
|
1640
|
+
}, [t]), Ce.useEffect(() => Z.handoff(), []), e ? !1 : t;
|
|
1608
1641
|
}
|
|
1609
|
-
function
|
|
1642
|
+
function Nt() {
|
|
1610
1643
|
let e = S(!1);
|
|
1611
|
-
return
|
|
1644
|
+
return U(() => (e.current = !0, () => {
|
|
1612
1645
|
e.current = !1;
|
|
1613
1646
|
}), []), e;
|
|
1614
1647
|
}
|
|
1615
|
-
var
|
|
1616
|
-
function
|
|
1648
|
+
var Ae = ((e) => (e[e.Forwards = 0] = "Forwards", e[e.Backwards = 1] = "Backwards", e))(Ae || {});
|
|
1649
|
+
function Dl() {
|
|
1617
1650
|
let e = S(0);
|
|
1618
|
-
return
|
|
1651
|
+
return Er(!0, "keydown", (t) => {
|
|
1619
1652
|
t.key === "Tab" && (e.current = t.shiftKey ? 1 : 0);
|
|
1620
1653
|
}, !0), e;
|
|
1621
1654
|
}
|
|
1622
|
-
function
|
|
1655
|
+
function Ar(e) {
|
|
1623
1656
|
if (!e) return /* @__PURE__ */ new Set();
|
|
1624
1657
|
if (typeof e == "function") return new Set(e());
|
|
1625
1658
|
let t = /* @__PURE__ */ new Set();
|
|
1626
1659
|
for (let r of e.current) se(r.current) && t.add(r.current);
|
|
1627
1660
|
return t;
|
|
1628
1661
|
}
|
|
1629
|
-
let
|
|
1630
|
-
var
|
|
1631
|
-
function
|
|
1632
|
-
let r = S(null), n =
|
|
1633
|
-
|
|
1634
|
-
let u =
|
|
1635
|
-
|
|
1636
|
-
let
|
|
1637
|
-
|
|
1638
|
-
let
|
|
1662
|
+
let jl = "div";
|
|
1663
|
+
var fe = ((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))(fe || {});
|
|
1664
|
+
function Wl(e, t) {
|
|
1665
|
+
let r = S(null), n = J(r, t), { initialFocus: l, initialFocusFallback: i, containers: a, features: s = 15, ...o } = e;
|
|
1666
|
+
it() || (s = 0);
|
|
1667
|
+
let u = Ct(r.current);
|
|
1668
|
+
Bl(s, { ownerDocument: u });
|
|
1669
|
+
let m = Xl(s, { ownerDocument: u, container: r, initialFocus: l, initialFocusFallback: i });
|
|
1670
|
+
zl(s, { ownerDocument: u, container: r, containers: a, previousActiveElement: m });
|
|
1671
|
+
let b = Dl(), g = M((d) => {
|
|
1639
1672
|
if (!me(r.current)) return;
|
|
1640
1673
|
let v = r.current;
|
|
1641
|
-
((
|
|
1642
|
-
re(
|
|
1643
|
-
|
|
1644
|
-
}, [
|
|
1645
|
-
|
|
1674
|
+
((w) => w())(() => {
|
|
1675
|
+
re(b.current, { [Ae.Forwards]: () => {
|
|
1676
|
+
Ie(v, ee.First, { skipElements: [d.relatedTarget, i] });
|
|
1677
|
+
}, [Ae.Backwards]: () => {
|
|
1678
|
+
Ie(v, ee.Last, { skipElements: [d.relatedTarget, i] });
|
|
1646
1679
|
} });
|
|
1647
1680
|
});
|
|
1648
|
-
}),
|
|
1681
|
+
}), y = We(!!(s & 2), "focus-trap#tab-lock"), f = rt(), E = S(!1), h = { ref: n, onKeyDown(d) {
|
|
1649
1682
|
d.key == "Tab" && (E.current = !0, f.requestAnimationFrame(() => {
|
|
1650
1683
|
E.current = !1;
|
|
1651
1684
|
}));
|
|
1652
1685
|
}, onBlur(d) {
|
|
1653
|
-
if (!(
|
|
1654
|
-
let v =
|
|
1686
|
+
if (!(s & 4)) return;
|
|
1687
|
+
let v = Ar(a);
|
|
1655
1688
|
me(r.current) && v.add(r.current);
|
|
1656
|
-
let
|
|
1657
|
-
ae(
|
|
1689
|
+
let w = d.relatedTarget;
|
|
1690
|
+
ae(w) && w.dataset.headlessuiFocusGuard !== "true" && (Cr(v, w) || (E.current ? Ie(r.current, re(b.current, { [Ae.Forwards]: () => ee.Next, [Ae.Backwards]: () => ee.Previous }) | ee.WrapAround, { relativeTo: d.target }) : ae(d.target) && te(d.target)));
|
|
1658
1691
|
} }, c = G();
|
|
1659
|
-
return $.createElement($.Fragment, null,
|
|
1692
|
+
return $.createElement($.Fragment, null, y && $.createElement(Et, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: g, features: Ye.Focusable }), c({ ourProps: h, theirProps: o, defaultTag: jl, name: "FocusTrap" }), y && $.createElement(Et, { as: "button", type: "button", "data-headlessui-focus-guard": !0, onFocus: g, features: Ye.Focusable }));
|
|
1660
1693
|
}
|
|
1661
|
-
let
|
|
1662
|
-
function
|
|
1694
|
+
let Ul = V(Wl), Hl = Object.assign(Ul, { features: fe });
|
|
1695
|
+
function Vl(e = !0) {
|
|
1663
1696
|
let t = S(ie.slice());
|
|
1664
|
-
return
|
|
1665
|
-
n === !0 && r === !1 &&
|
|
1697
|
+
return Ft(([r], [n]) => {
|
|
1698
|
+
n === !0 && r === !1 && tt(() => {
|
|
1666
1699
|
t.current.splice(0);
|
|
1667
1700
|
}), n === !1 && r === !0 && (t.current = ie.slice());
|
|
1668
1701
|
}, [e, ie, t]), M(() => {
|
|
@@ -1670,25 +1703,25 @@ function Il(e = !0) {
|
|
|
1670
1703
|
return (r = t.current.find((n) => n != null && n.isConnected)) != null ? r : null;
|
|
1671
1704
|
});
|
|
1672
1705
|
}
|
|
1673
|
-
function
|
|
1674
|
-
let r = !!(e & 8), n =
|
|
1675
|
-
|
|
1676
|
-
r || (t == null ? void 0 : t.
|
|
1677
|
-
}, [r]),
|
|
1706
|
+
function Bl(e, { ownerDocument: t }) {
|
|
1707
|
+
let r = !!(e & 8), n = Vl(r);
|
|
1708
|
+
Ft(() => {
|
|
1709
|
+
r || fn(t == null ? void 0 : t.body) && te(n());
|
|
1710
|
+
}, [r]), Or(() => {
|
|
1678
1711
|
r && te(n());
|
|
1679
1712
|
});
|
|
1680
1713
|
}
|
|
1681
|
-
function
|
|
1682
|
-
let i = S(null),
|
|
1683
|
-
return
|
|
1714
|
+
function Xl(e, { ownerDocument: t, container: r, initialFocus: n, initialFocusFallback: l }) {
|
|
1715
|
+
let i = S(null), a = We(!!(e & 1), "focus-trap#initial-focus"), s = Nt();
|
|
1716
|
+
return Ft(() => {
|
|
1684
1717
|
if (e === 0) return;
|
|
1685
|
-
if (!
|
|
1718
|
+
if (!a) {
|
|
1686
1719
|
l != null && l.current && te(l.current);
|
|
1687
1720
|
return;
|
|
1688
1721
|
}
|
|
1689
1722
|
let o = r.current;
|
|
1690
|
-
o &&
|
|
1691
|
-
if (!
|
|
1723
|
+
o && tt(() => {
|
|
1724
|
+
if (!s.current) return;
|
|
1692
1725
|
let u = t == null ? void 0 : t.activeElement;
|
|
1693
1726
|
if (n != null && n.current) {
|
|
1694
1727
|
if ((n == null ? void 0 : n.current) === u) {
|
|
@@ -1702,239 +1735,239 @@ function Dl(e, { ownerDocument: t, container: r, initialFocus: n, initialFocusFa
|
|
|
1702
1735
|
if (n != null && n.current) te(n.current);
|
|
1703
1736
|
else {
|
|
1704
1737
|
if (e & 16) {
|
|
1705
|
-
if (
|
|
1706
|
-
} else if (
|
|
1738
|
+
if (Ie(o, ee.First | ee.AutoFocus) !== Ot.Error) return;
|
|
1739
|
+
} else if (Ie(o, ee.First) !== Ot.Error) return;
|
|
1707
1740
|
if (l != null && l.current && (te(l.current), (t == null ? void 0 : t.activeElement) === l.current)) return;
|
|
1708
1741
|
console.warn("There are no focusable elements inside the <FocusTrap />");
|
|
1709
1742
|
}
|
|
1710
1743
|
i.current = t == null ? void 0 : t.activeElement;
|
|
1711
1744
|
});
|
|
1712
|
-
}, [l,
|
|
1745
|
+
}, [l, a, e]), i;
|
|
1713
1746
|
}
|
|
1714
|
-
function
|
|
1715
|
-
let i =
|
|
1716
|
-
|
|
1717
|
-
if (!
|
|
1718
|
-
let o =
|
|
1747
|
+
function zl(e, { ownerDocument: t, container: r, containers: n, previousActiveElement: l }) {
|
|
1748
|
+
let i = Nt(), a = !!(e & 4);
|
|
1749
|
+
$r(t == null ? void 0 : t.defaultView, "focus", (s) => {
|
|
1750
|
+
if (!a || !i.current) return;
|
|
1751
|
+
let o = Ar(n);
|
|
1719
1752
|
me(r.current) && o.add(r.current);
|
|
1720
1753
|
let u = l.current;
|
|
1721
1754
|
if (!u) return;
|
|
1722
|
-
let
|
|
1723
|
-
me(
|
|
1755
|
+
let m = s.target;
|
|
1756
|
+
me(m) ? Cr(o, m) ? (l.current = m, te(m)) : (s.preventDefault(), s.stopPropagation(), te(u)) : te(l.current);
|
|
1724
1757
|
}, !0);
|
|
1725
1758
|
}
|
|
1726
|
-
function
|
|
1759
|
+
function Cr(e, t) {
|
|
1727
1760
|
for (let r of e) if (r.contains(t)) return !0;
|
|
1728
1761
|
return !1;
|
|
1729
1762
|
}
|
|
1730
|
-
function
|
|
1763
|
+
function Fr(e) {
|
|
1731
1764
|
var t;
|
|
1732
|
-
return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || ((t = e.as) != null ? t :
|
|
1765
|
+
return !!(e.enter || e.enterFrom || e.enterTo || e.leave || e.leaveFrom || e.leaveTo) || !Fe((t = e.as) != null ? t : Ir) || $.Children.count(e.children) === 1;
|
|
1733
1766
|
}
|
|
1734
|
-
let
|
|
1735
|
-
|
|
1736
|
-
var
|
|
1737
|
-
function
|
|
1738
|
-
let e = H(
|
|
1767
|
+
let ot = z(null);
|
|
1768
|
+
ot.displayName = "TransitionContext";
|
|
1769
|
+
var Gl = ((e) => (e.Visible = "visible", e.Hidden = "hidden", e))(Gl || {});
|
|
1770
|
+
function Kl() {
|
|
1771
|
+
let e = H(ot);
|
|
1739
1772
|
if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
1740
1773
|
return e;
|
|
1741
1774
|
}
|
|
1742
|
-
function
|
|
1743
|
-
let e = H(
|
|
1775
|
+
function ql() {
|
|
1776
|
+
let e = H(at);
|
|
1744
1777
|
if (e === null) throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");
|
|
1745
1778
|
return e;
|
|
1746
1779
|
}
|
|
1747
|
-
let
|
|
1748
|
-
|
|
1749
|
-
function
|
|
1750
|
-
return "children" in e ?
|
|
1780
|
+
let at = z(null);
|
|
1781
|
+
at.displayName = "NestingContext";
|
|
1782
|
+
function st(e) {
|
|
1783
|
+
return "children" in e ? st(e.children) : e.current.filter(({ el: t }) => t.current !== null).filter(({ state: t }) => t === "visible").length > 0;
|
|
1751
1784
|
}
|
|
1752
|
-
function
|
|
1753
|
-
let r =
|
|
1754
|
-
let E = n.current.findIndex(({ el: h }) => h ===
|
|
1785
|
+
function Nr(e, t) {
|
|
1786
|
+
let r = ve(e), n = S([]), l = Nt(), i = rt(), a = M((y, f = oe.Hidden) => {
|
|
1787
|
+
let E = n.current.findIndex(({ el: h }) => h === y);
|
|
1755
1788
|
E !== -1 && (re(f, { [oe.Unmount]() {
|
|
1756
1789
|
n.current.splice(E, 1);
|
|
1757
1790
|
}, [oe.Hidden]() {
|
|
1758
1791
|
n.current[E].state = "hidden";
|
|
1759
1792
|
} }), i.microTask(() => {
|
|
1760
1793
|
var h;
|
|
1761
|
-
!
|
|
1794
|
+
!st(n) && l.current && ((h = r.current) == null || h.call(r));
|
|
1762
1795
|
}));
|
|
1763
|
-
}),
|
|
1764
|
-
let f = n.current.find(({ el: E }) => E ===
|
|
1765
|
-
return f ? f.state !== "visible" && (f.state = "visible") : n.current.push({ el:
|
|
1766
|
-
}), o = S([]), u = S(Promise.resolve()),
|
|
1767
|
-
o.current.splice(0), t && (t.chains.current[f] = t.chains.current[f].filter(([h]) => h !==
|
|
1796
|
+
}), s = M((y) => {
|
|
1797
|
+
let f = n.current.find(({ el: E }) => E === y);
|
|
1798
|
+
return f ? f.state !== "visible" && (f.state = "visible") : n.current.push({ el: y, state: "visible" }), () => a(y, oe.Unmount);
|
|
1799
|
+
}), o = S([]), u = S(Promise.resolve()), m = S({ enter: [], leave: [] }), b = M((y, f, E) => {
|
|
1800
|
+
o.current.splice(0), t && (t.chains.current[f] = t.chains.current[f].filter(([h]) => h !== y)), t == null || t.chains.current[f].push([y, new Promise((h) => {
|
|
1768
1801
|
o.current.push(h);
|
|
1769
|
-
})]), t == null || t.chains.current[f].push([
|
|
1770
|
-
Promise.all(
|
|
1802
|
+
})]), t == null || t.chains.current[f].push([y, new Promise((h) => {
|
|
1803
|
+
Promise.all(m.current[f].map(([c, d]) => d)).then(() => h());
|
|
1771
1804
|
})]), f === "enter" ? u.current = u.current.then(() => t == null ? void 0 : t.wait.current).then(() => E(f)) : E(f);
|
|
1772
|
-
}),
|
|
1773
|
-
Promise.all(
|
|
1805
|
+
}), g = M((y, f, E) => {
|
|
1806
|
+
Promise.all(m.current[f].splice(0).map(([h, c]) => c)).then(() => {
|
|
1774
1807
|
var h;
|
|
1775
1808
|
(h = o.current.shift()) == null || h();
|
|
1776
1809
|
}).then(() => E(f));
|
|
1777
1810
|
});
|
|
1778
|
-
return
|
|
1811
|
+
return _(() => ({ children: n, register: s, unregister: a, onStart: b, onStop: g, wait: u, chains: m }), [s, a, n, b, g, m, u]);
|
|
1779
1812
|
}
|
|
1780
|
-
let
|
|
1781
|
-
function
|
|
1813
|
+
let Ir = ue, Rr = qe.RenderStrategy;
|
|
1814
|
+
function Yl(e, t) {
|
|
1782
1815
|
var r, n;
|
|
1783
|
-
let { transition: l = !0, beforeEnter: i, afterEnter:
|
|
1784
|
-
|
|
1816
|
+
let { transition: l = !0, beforeEnter: i, afterEnter: a, beforeLeave: s, afterLeave: o, enter: u, enterFrom: m, enterTo: b, entered: g, leave: y, leaveFrom: f, leaveTo: E, ...h } = e, [c, d] = F(null), v = S(null), w = Fr(e), p = J(...w ? [v, t, d] : t === null ? [] : [t]), x = (r = h.unmount) == null || r ? oe.Unmount : oe.Hidden, { show: O, appear: N, initial: D } = Kl(), [C, I] = F(O ? "visible" : "hidden"), B = ql(), { register: R, unregister: k } = B;
|
|
1817
|
+
U(() => R(v), [R, v]), U(() => {
|
|
1785
1818
|
if (x === oe.Hidden && v.current) {
|
|
1786
1819
|
if (O && C !== "visible") {
|
|
1787
|
-
|
|
1820
|
+
I("visible");
|
|
1788
1821
|
return;
|
|
1789
1822
|
}
|
|
1790
|
-
return re(C, { hidden: () => k(v), visible: () =>
|
|
1823
|
+
return re(C, { hidden: () => k(v), visible: () => R(v) });
|
|
1791
1824
|
}
|
|
1792
|
-
}, [C, v,
|
|
1793
|
-
let
|
|
1794
|
-
|
|
1795
|
-
if (
|
|
1796
|
-
}, [v, C,
|
|
1797
|
-
let
|
|
1798
|
-
|
|
1799
|
-
}, B),
|
|
1800
|
-
|
|
1801
|
-
let
|
|
1802
|
-
|
|
1803
|
-
|
|
1825
|
+
}, [C, v, R, k, O, x]);
|
|
1826
|
+
let j = it();
|
|
1827
|
+
U(() => {
|
|
1828
|
+
if (w && j && C === "visible" && v.current === null) throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?");
|
|
1829
|
+
}, [v, C, j, w]);
|
|
1830
|
+
let ge = D && !N, ce = N && O && D, Q = S(!1), A = Nr(() => {
|
|
1831
|
+
Q.current || (I("hidden"), k(v));
|
|
1832
|
+
}, B), $e = M((dt) => {
|
|
1833
|
+
Q.current = !0;
|
|
1834
|
+
let He = dt ? "enter" : "leave";
|
|
1835
|
+
A.onStart(v, He, (Se) => {
|
|
1836
|
+
Se === "enter" ? i == null || i() : Se === "leave" && (s == null || s());
|
|
1804
1837
|
});
|
|
1805
|
-
}), le = M((
|
|
1806
|
-
let
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
}),
|
|
1838
|
+
}), le = M((dt) => {
|
|
1839
|
+
let He = dt ? "enter" : "leave";
|
|
1840
|
+
Q.current = !1, A.onStop(v, He, (Se) => {
|
|
1841
|
+
Se === "enter" ? a == null || a() : Se === "leave" && (o == null || o());
|
|
1842
|
+
}), He === "leave" && !st(A) && (I("hidden"), k(v));
|
|
1810
1843
|
});
|
|
1811
1844
|
L(() => {
|
|
1812
|
-
|
|
1813
|
-
}, [O,
|
|
1814
|
-
let
|
|
1815
|
-
C === "visible" && (
|
|
1816
|
-
let
|
|
1817
|
-
return $.createElement(
|
|
1818
|
-
}
|
|
1819
|
-
function
|
|
1820
|
-
let { show: r, appear: n = !1, unmount: l = !0, ...i } = e,
|
|
1821
|
-
|
|
1822
|
-
let u =
|
|
1823
|
-
if (r === void 0 && u !== null && (r = (u &
|
|
1824
|
-
let [
|
|
1825
|
-
r ||
|
|
1826
|
-
}), [
|
|
1827
|
-
|
|
1828
|
-
|
|
1845
|
+
w && l || ($e(O), le(O));
|
|
1846
|
+
}, [O, w, l]);
|
|
1847
|
+
let ct = !(!l || !w || !j || ge), [, T] = gl(ct, c, O, { start: $e, end: le }), Ue = de({ ref: p, className: ((n = xt(h.className, ce && u, ce && m, T.enter && u, T.enter && T.closed && m, T.enter && !T.closed && b, T.leave && y, T.leave && !T.closed && f, T.leave && T.closed && E, !T.transition && O && g)) == null ? void 0 : n.trim()) || void 0, ...vl(T) }), Oe = 0;
|
|
1848
|
+
C === "visible" && (Oe |= q.Open), C === "hidden" && (Oe |= q.Closed), O && C === "hidden" && (Oe |= q.Opening), !O && C === "visible" && (Oe |= q.Closing);
|
|
1849
|
+
let Wr = G();
|
|
1850
|
+
return $.createElement(at.Provider, { value: A }, $.createElement(El, { value: Oe }, Wr({ ourProps: Ue, theirProps: h, defaultTag: Ir, features: Rr, visible: C === "visible", name: "Transition.Child" })));
|
|
1851
|
+
}
|
|
1852
|
+
function Zl(e, t) {
|
|
1853
|
+
let { show: r, appear: n = !1, unmount: l = !0, ...i } = e, a = S(null), s = Fr(e), o = J(...s ? [a, t] : t === null ? [] : [t]);
|
|
1854
|
+
it();
|
|
1855
|
+
let u = lt();
|
|
1856
|
+
if (r === void 0 && u !== null && (r = (u & q.Open) === q.Open), r === void 0) throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");
|
|
1857
|
+
let [m, b] = F(r ? "visible" : "hidden"), g = Nr(() => {
|
|
1858
|
+
r || b("hidden");
|
|
1859
|
+
}), [y, f] = F(!0), E = S([r]);
|
|
1860
|
+
U(() => {
|
|
1861
|
+
y !== !1 && E.current[E.current.length - 1] !== r && (E.current.push(r), f(!1));
|
|
1829
1862
|
}, [E, r]);
|
|
1830
|
-
let h =
|
|
1831
|
-
|
|
1832
|
-
r ?
|
|
1833
|
-
}, [r,
|
|
1863
|
+
let h = _(() => ({ show: r, appear: n, initial: y }), [r, n, y]);
|
|
1864
|
+
U(() => {
|
|
1865
|
+
r ? b("visible") : !st(g) && a.current !== null && b("hidden");
|
|
1866
|
+
}, [r, g]);
|
|
1834
1867
|
let c = { unmount: l }, d = M(() => {
|
|
1835
|
-
var
|
|
1836
|
-
|
|
1868
|
+
var p;
|
|
1869
|
+
y && f(!1), (p = e.beforeEnter) == null || p.call(e);
|
|
1837
1870
|
}), v = M(() => {
|
|
1838
|
-
var
|
|
1839
|
-
|
|
1840
|
-
}),
|
|
1841
|
-
return $.createElement(
|
|
1842
|
-
}
|
|
1843
|
-
function
|
|
1844
|
-
let r = H(
|
|
1845
|
-
return $.createElement($.Fragment, null, !r && n ? $.createElement(
|
|
1846
|
-
}
|
|
1847
|
-
let
|
|
1848
|
-
var
|
|
1849
|
-
let
|
|
1871
|
+
var p;
|
|
1872
|
+
y && f(!1), (p = e.beforeLeave) == null || p.call(e);
|
|
1873
|
+
}), w = G();
|
|
1874
|
+
return $.createElement(at.Provider, { value: g }, $.createElement(ot.Provider, { value: h }, w({ ourProps: { ...c, as: ue, children: $.createElement(_r, { ref: o, ...c, ...i, beforeEnter: d, beforeLeave: v }) }, theirProps: {}, defaultTag: ue, features: Rr, visible: m === "visible", name: "Transition" })));
|
|
1875
|
+
}
|
|
1876
|
+
function Jl(e, t) {
|
|
1877
|
+
let r = H(ot) !== null, n = lt() !== null;
|
|
1878
|
+
return $.createElement($.Fragment, null, !r && n ? $.createElement(Tt, { ref: t, ...e }) : $.createElement(_r, { ref: t, ...e }));
|
|
1879
|
+
}
|
|
1880
|
+
let Tt = V(Zl), _r = V(Yl), Ee = V(Jl), Dr = Object.assign(Tt, { Child: Ee, Root: Tt });
|
|
1881
|
+
var Ql = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Ql || {}), ei = ((e) => (e[e.SetTitleId = 0] = "SetTitleId", e))(ei || {});
|
|
1882
|
+
let ti = { 0(e, t) {
|
|
1850
1883
|
return e.titleId === t.id ? e : { ...e, titleId: t.id };
|
|
1851
|
-
} },
|
|
1852
|
-
|
|
1853
|
-
function
|
|
1854
|
-
let t = H(
|
|
1884
|
+
} }, It = z(null);
|
|
1885
|
+
It.displayName = "DialogContext";
|
|
1886
|
+
function ut(e) {
|
|
1887
|
+
let t = H(It);
|
|
1855
1888
|
if (t === null) {
|
|
1856
1889
|
let r = new Error(`<${e} /> is missing a parent <Dialog /> component.`);
|
|
1857
|
-
throw Error.captureStackTrace && Error.captureStackTrace(r,
|
|
1890
|
+
throw Error.captureStackTrace && Error.captureStackTrace(r, ut), r;
|
|
1858
1891
|
}
|
|
1859
1892
|
return t;
|
|
1860
1893
|
}
|
|
1861
|
-
function
|
|
1862
|
-
return re(t.type,
|
|
1894
|
+
function ri(e, t) {
|
|
1895
|
+
return re(t.type, ti, e, t);
|
|
1863
1896
|
}
|
|
1864
|
-
let
|
|
1865
|
-
let r =
|
|
1866
|
-
|
|
1867
|
-
return
|
|
1897
|
+
let er = V(function(e, t) {
|
|
1898
|
+
let r = _e(), { id: n = `headlessui-dialog-${r}`, open: l, onClose: i, initialFocus: a, role: s = "dialog", autoFocus: o = !0, __demoMode: u = !1, unmount: m = !1, ...b } = e, g = S(!1);
|
|
1899
|
+
s = (function() {
|
|
1900
|
+
return s === "dialog" || s === "alertdialog" ? s : (g.current || (g.current = !0, console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)), "dialog");
|
|
1868
1901
|
})();
|
|
1869
|
-
let
|
|
1870
|
-
l === void 0 &&
|
|
1871
|
-
let f = S(null), E =
|
|
1872
|
-
var
|
|
1873
|
-
return (
|
|
1874
|
-
} }, C =
|
|
1875
|
-
|
|
1876
|
-
var
|
|
1877
|
-
return [(
|
|
1902
|
+
let y = lt();
|
|
1903
|
+
l === void 0 && y !== null && (l = (y & q.Open) === q.Open);
|
|
1904
|
+
let f = S(null), E = J(f, t), h = Ct(f.current), c = l ? 0 : 1, [d, v] = Gr(ri, { titleId: null, descriptionId: null, panelRef: Kr() }), w = M(() => i(!1)), p = M((T) => v({ type: 0, id: T })), x = it() ? c === 0 : !1, [O, N] = Al(), D = { get current() {
|
|
1905
|
+
var T;
|
|
1906
|
+
return (T = d.panelRef.current) != null ? T : f.current;
|
|
1907
|
+
} }, C = kr(), { resolveContainers: I } = Rl({ mainTreeNode: C, portals: O, defaultContainers: [D] }), B = y !== null ? (y & q.Closing) === q.Closing : !1;
|
|
1908
|
+
Kn(u || B ? !1 : x, { allowed: M(() => {
|
|
1909
|
+
var T, Ue;
|
|
1910
|
+
return [(Ue = (T = f.current) == null ? void 0 : T.closest("[data-headlessui-portal]")) != null ? Ue : null];
|
|
1878
1911
|
}), disallowed: M(() => {
|
|
1879
|
-
var
|
|
1880
|
-
return [(
|
|
1912
|
+
var T;
|
|
1913
|
+
return [(T = C == null ? void 0 : C.closest("body > *:not(#headlessui-portal-root)")) != null ? T : null];
|
|
1881
1914
|
}) });
|
|
1882
|
-
let
|
|
1883
|
-
|
|
1884
|
-
if (x) return
|
|
1885
|
-
}, [
|
|
1886
|
-
let k =
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
}),
|
|
1890
|
-
|
|
1891
|
-
}),
|
|
1892
|
-
let [
|
|
1893
|
-
x && !u && (le |=
|
|
1894
|
-
let
|
|
1895
|
-
return $.createElement(
|
|
1896
|
-
}),
|
|
1897
|
-
function
|
|
1898
|
-
let { transition: r = !1, open: n, ...l } = e, i =
|
|
1899
|
-
if (!
|
|
1900
|
-
if (!
|
|
1901
|
-
if (!
|
|
1915
|
+
let R = wr.get(null);
|
|
1916
|
+
U(() => {
|
|
1917
|
+
if (x) return R.actions.push(n), () => R.actions.pop(n);
|
|
1918
|
+
}, [R, n, x]);
|
|
1919
|
+
let k = yr(R, W((T) => R.selectors.isTop(T, n), [R, n]));
|
|
1920
|
+
ol(k, I, (T) => {
|
|
1921
|
+
T.preventDefault(), w();
|
|
1922
|
+
}), Nl(k, h == null ? void 0 : h.defaultView, (T) => {
|
|
1923
|
+
T.preventDefault(), T.stopPropagation(), document.activeElement && "blur" in document.activeElement && typeof document.activeElement.blur == "function" && document.activeElement.blur(), w();
|
|
1924
|
+
}), pl(u || B ? !1 : x, h, I), qn(x, f, w);
|
|
1925
|
+
let [j, ge] = Pn(), ce = _(() => [{ dialogState: c, close: w, setTitleId: p, unmount: m }, d], [c, w, p, m, d]), Q = je({ open: c === 0 }), A = { ref: E, id: n, role: s, tabIndex: -1, "aria-modal": u ? void 0 : c === 0 ? !0 : void 0, "aria-labelledby": d.titleId, "aria-describedby": j, unmount: m }, $e = !Il(), le = fe.None;
|
|
1926
|
+
x && !u && (le |= fe.RestoreFocus, le |= fe.TabLock, o && (le |= fe.AutoFocus), $e && (le |= fe.InitialFocus));
|
|
1927
|
+
let ct = G();
|
|
1928
|
+
return $.createElement($l, null, $.createElement(Jt, { force: !0 }, $.createElement(Fl, null, $.createElement(It.Provider, { value: ce }, $.createElement(Mr, { target: f }, $.createElement(Jt, { force: !1 }, $.createElement(ge, { slot: Q }, $.createElement(N, null, $.createElement(Hl, { initialFocus: a, initialFocusFallback: f, containers: I, features: le }, $.createElement(Fn, { value: w }, ct({ ourProps: A, theirProps: b, slot: Q, defaultTag: ni, features: li, visible: c === 0, name: "Dialog" })))))))))));
|
|
1929
|
+
}), ni = "div", li = qe.RenderStrategy | qe.Static;
|
|
1930
|
+
function ii(e, t) {
|
|
1931
|
+
let { transition: r = !1, open: n, ...l } = e, i = lt(), a = e.hasOwnProperty("open") || i !== null, s = e.hasOwnProperty("onClose");
|
|
1932
|
+
if (!a && !s) throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");
|
|
1933
|
+
if (!a) throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");
|
|
1934
|
+
if (!s) throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");
|
|
1902
1935
|
if (!i && 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}`);
|
|
1903
1936
|
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}`);
|
|
1904
|
-
return (n !== void 0 || r) && !l.static ? $.createElement(
|
|
1937
|
+
return (n !== void 0 || r) && !l.static ? $.createElement(Qt, null, $.createElement(Dr, { show: n, transition: r, unmount: l.unmount }, $.createElement(er, { ref: t, ...l }))) : $.createElement(Qt, null, $.createElement(er, { ref: t, open: n, ...l }));
|
|
1905
1938
|
}
|
|
1906
|
-
let
|
|
1907
|
-
function
|
|
1908
|
-
let r =
|
|
1939
|
+
let oi = "div";
|
|
1940
|
+
function ai(e, t) {
|
|
1941
|
+
let r = _e(), { id: n = `headlessui-dialog-panel-${r}`, transition: l = !1, ...i } = e, [{ dialogState: a, unmount: s }, o] = ut("Dialog.Panel"), u = J(t, o.panelRef), m = je({ open: a === 0 }), b = M((h) => {
|
|
1909
1942
|
h.stopPropagation();
|
|
1910
|
-
}),
|
|
1911
|
-
return $.createElement(
|
|
1912
|
-
}
|
|
1913
|
-
let
|
|
1914
|
-
function
|
|
1915
|
-
let { transition: r = !1, ...n } = e, [{ dialogState: l, unmount: i }] =
|
|
1916
|
-
return $.createElement(o, { ...u },
|
|
1917
|
-
}
|
|
1918
|
-
let
|
|
1919
|
-
function
|
|
1920
|
-
let r =
|
|
1921
|
-
L(() => (
|
|
1922
|
-
let o =
|
|
1923
|
-
return G()({ ourProps: u, theirProps: l, slot: o, defaultTag:
|
|
1924
|
-
}
|
|
1925
|
-
let
|
|
1926
|
-
V(
|
|
1927
|
-
let
|
|
1928
|
-
function
|
|
1929
|
-
return /* @__PURE__ */
|
|
1943
|
+
}), g = { ref: u, id: n, onClick: b }, y = l ? Ee : ue, f = l ? { unmount: s } : {}, E = G();
|
|
1944
|
+
return $.createElement(y, { ...f }, E({ ourProps: g, theirProps: i, slot: m, defaultTag: oi, name: "Dialog.Panel" }));
|
|
1945
|
+
}
|
|
1946
|
+
let si = "div";
|
|
1947
|
+
function ui(e, t) {
|
|
1948
|
+
let { transition: r = !1, ...n } = e, [{ dialogState: l, unmount: i }] = ut("Dialog.Backdrop"), a = je({ open: l === 0 }), s = { ref: t, "aria-hidden": !0 }, o = r ? Ee : ue, u = r ? { unmount: i } : {}, m = G();
|
|
1949
|
+
return $.createElement(o, { ...u }, m({ ourProps: s, theirProps: n, slot: a, defaultTag: si, name: "Dialog.Backdrop" }));
|
|
1950
|
+
}
|
|
1951
|
+
let ci = "h2";
|
|
1952
|
+
function di(e, t) {
|
|
1953
|
+
let r = _e(), { id: n = `headlessui-dialog-title-${r}`, ...l } = e, [{ dialogState: i, setTitleId: a }] = ut("Dialog.Title"), s = J(t);
|
|
1954
|
+
L(() => (a(n), () => a(null)), [n, a]);
|
|
1955
|
+
let o = je({ open: i === 0 }), u = { ref: s, id: n };
|
|
1956
|
+
return G()({ ourProps: u, theirProps: l, slot: o, defaultTag: ci, name: "Dialog.Title" });
|
|
1957
|
+
}
|
|
1958
|
+
let fi = V(ii), Rt = V(ai);
|
|
1959
|
+
V(ui);
|
|
1960
|
+
let pi = V(di), mi = Object.assign(fi, { Panel: Rt, Title: pi, Description: An });
|
|
1961
|
+
function jr({ onClick: e }) {
|
|
1962
|
+
return /* @__PURE__ */ he(
|
|
1930
1963
|
"button",
|
|
1931
1964
|
{
|
|
1932
1965
|
type: "button",
|
|
1933
1966
|
className: "im-close-button text-gray-400 hover:text-gray-500",
|
|
1934
1967
|
onClick: e,
|
|
1935
1968
|
children: [
|
|
1936
|
-
/* @__PURE__ */
|
|
1937
|
-
/* @__PURE__ */
|
|
1969
|
+
/* @__PURE__ */ P("span", { className: "sr-only", children: "Close" }),
|
|
1970
|
+
/* @__PURE__ */ P(
|
|
1938
1971
|
"svg",
|
|
1939
1972
|
{
|
|
1940
1973
|
className: "size-6",
|
|
@@ -1944,7 +1977,7 @@ function Nr({ onClick: e }) {
|
|
|
1944
1977
|
strokeWidth: "2",
|
|
1945
1978
|
stroke: "currentColor",
|
|
1946
1979
|
"aria-hidden": "true",
|
|
1947
|
-
children: /* @__PURE__ */
|
|
1980
|
+
children: /* @__PURE__ */ P(
|
|
1948
1981
|
"path",
|
|
1949
1982
|
{
|
|
1950
1983
|
strokeLinecap: "round",
|
|
@@ -1958,17 +1991,17 @@ function Nr({ onClick: e }) {
|
|
|
1958
1991
|
}
|
|
1959
1992
|
);
|
|
1960
1993
|
}
|
|
1961
|
-
const
|
|
1962
|
-
const [n, l] =
|
|
1963
|
-
return /* @__PURE__ */
|
|
1994
|
+
const hi = ({ modalContext: e, config: t, children: r }) => {
|
|
1995
|
+
const [n, l] = F(!1);
|
|
1996
|
+
return /* @__PURE__ */ P("div", { className: "im-modal-container fixed inset-0 z-40 overflow-y-auto p-4", children: /* @__PURE__ */ P(
|
|
1964
1997
|
"div",
|
|
1965
1998
|
{
|
|
1966
|
-
className:
|
|
1999
|
+
className: Ke("im-modal-positioner flex min-h-full justify-center", {
|
|
1967
2000
|
"items-start": t.position === "top",
|
|
1968
2001
|
"items-center": t.position === "center",
|
|
1969
2002
|
"items-end": t.position === "bottom"
|
|
1970
2003
|
}),
|
|
1971
|
-
children: /* @__PURE__ */
|
|
2004
|
+
children: /* @__PURE__ */ P(
|
|
1972
2005
|
Ee,
|
|
1973
2006
|
{
|
|
1974
2007
|
as: "div",
|
|
@@ -1978,7 +2011,7 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
1978
2011
|
leaveTo: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",
|
|
1979
2012
|
afterEnter: () => l(!0),
|
|
1980
2013
|
afterLeave: e.afterLeave,
|
|
1981
|
-
className:
|
|
2014
|
+
className: Ke("im-modal-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
|
|
1982
2015
|
"sm:max-w-sm": t.maxWidth === "sm",
|
|
1983
2016
|
"sm:max-w-md": t.maxWidth === "md",
|
|
1984
2017
|
"sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
|
|
@@ -1990,13 +2023,13 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
1990
2023
|
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": t.maxWidth === "6xl",
|
|
1991
2024
|
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl"
|
|
1992
2025
|
}),
|
|
1993
|
-
children: /* @__PURE__ */
|
|
1994
|
-
|
|
2026
|
+
children: /* @__PURE__ */ he(
|
|
2027
|
+
Rt,
|
|
1995
2028
|
{
|
|
1996
2029
|
className: `im-modal-content relative ${t.paddingClasses} ${t.panelClasses}`,
|
|
1997
2030
|
"data-inertiaui-modal-entered": n,
|
|
1998
2031
|
children: [
|
|
1999
|
-
t.closeButton && /* @__PURE__ */
|
|
2032
|
+
t.closeButton && /* @__PURE__ */ P("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ P(jr, { onClick: e.close }) }),
|
|
2000
2033
|
typeof r == "function" ? r({ modalContext: e, config: t }) : r
|
|
2001
2034
|
]
|
|
2002
2035
|
}
|
|
@@ -2005,16 +2038,16 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2005
2038
|
)
|
|
2006
2039
|
}
|
|
2007
2040
|
) });
|
|
2008
|
-
},
|
|
2009
|
-
const [n, l] =
|
|
2010
|
-
return /* @__PURE__ */
|
|
2041
|
+
}, vi = ({ modalContext: e, config: t, children: r }) => {
|
|
2042
|
+
const [n, l] = F(!1);
|
|
2043
|
+
return /* @__PURE__ */ P("div", { className: "im-slideover-container fixed inset-0 z-40 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ P(
|
|
2011
2044
|
"div",
|
|
2012
2045
|
{
|
|
2013
|
-
className:
|
|
2046
|
+
className: Ke("im-slideover-positioner flex min-h-full items-center", {
|
|
2014
2047
|
"justify-start rtl:justify-end": (t == null ? void 0 : t.position) === "left",
|
|
2015
2048
|
"justify-end rtl:justify-start": (t == null ? void 0 : t.position) === "right"
|
|
2016
2049
|
}),
|
|
2017
|
-
children: /* @__PURE__ */
|
|
2050
|
+
children: /* @__PURE__ */ P(
|
|
2018
2051
|
Ee,
|
|
2019
2052
|
{
|
|
2020
2053
|
as: "div",
|
|
@@ -2024,7 +2057,7 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2024
2057
|
leaveTo: `opacity-0 ${t.position === "left" ? "-translate-x-full" : "translate-x-full"}`,
|
|
2025
2058
|
afterEnter: () => l(!0),
|
|
2026
2059
|
afterLeave: e.afterLeave,
|
|
2027
|
-
className:
|
|
2060
|
+
className: Ke("im-slideover-wrapper w-full transition duration-300 ease-in-out", e.onTopOfStack ? "" : "blur-sm", {
|
|
2028
2061
|
"sm:max-w-sm": t.maxWidth === "sm",
|
|
2029
2062
|
"sm:max-w-md": t.maxWidth === "md",
|
|
2030
2063
|
"sm:max-w-md md:max-w-lg": t.maxWidth === "lg",
|
|
@@ -2036,13 +2069,13 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2036
2069
|
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-6xl": t.maxWidth === "6xl",
|
|
2037
2070
|
"sm:max-w-md md:max-w-xl lg:max-w-3xl xl:max-w-5xl 2xl:max-w-7xl": t.maxWidth === "7xl"
|
|
2038
2071
|
}),
|
|
2039
|
-
children: /* @__PURE__ */
|
|
2040
|
-
|
|
2072
|
+
children: /* @__PURE__ */ he(
|
|
2073
|
+
Rt,
|
|
2041
2074
|
{
|
|
2042
2075
|
className: `im-slideover-content relative ${t.paddingClasses} ${t.panelClasses}`,
|
|
2043
2076
|
"data-inertiaui-modal-entered": n,
|
|
2044
2077
|
children: [
|
|
2045
|
-
t.closeButton && /* @__PURE__ */
|
|
2078
|
+
t.closeButton && /* @__PURE__ */ P("div", { className: "absolute right-0 top-0 pr-3 pt-3", children: /* @__PURE__ */ P(jr, { onClick: e.close }) }),
|
|
2046
2079
|
typeof r == "function" ? r({ modalContext: e, config: t }) : r
|
|
2047
2080
|
]
|
|
2048
2081
|
}
|
|
@@ -2051,49 +2084,49 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2051
2084
|
)
|
|
2052
2085
|
}
|
|
2053
2086
|
) });
|
|
2054
|
-
},
|
|
2055
|
-
const u = (
|
|
2056
|
-
return
|
|
2057
|
-
|
|
2087
|
+
}, gi = Pt(({ name: e, children: t, onFocus: r = null, onBlur: n = null, onClose: l = null, onSuccess: i = null, onAfterLeave: a = null, ...s }, o) => {
|
|
2088
|
+
const u = (b) => typeof t == "function" ? t(b) : t, m = S(null);
|
|
2089
|
+
return tr(o, () => m.current, [m]), /* @__PURE__ */ P(
|
|
2090
|
+
ar,
|
|
2058
2091
|
{
|
|
2059
|
-
ref:
|
|
2092
|
+
ref: m,
|
|
2060
2093
|
name: e,
|
|
2061
2094
|
onFocus: r,
|
|
2062
2095
|
onBlur: n,
|
|
2063
2096
|
onClose: l,
|
|
2064
2097
|
onSuccess: i,
|
|
2065
|
-
...
|
|
2098
|
+
...s,
|
|
2066
2099
|
children: ({
|
|
2067
|
-
afterLeave:
|
|
2068
|
-
close:
|
|
2069
|
-
config:
|
|
2100
|
+
afterLeave: b,
|
|
2101
|
+
close: g,
|
|
2102
|
+
config: y,
|
|
2070
2103
|
emit: f,
|
|
2071
2104
|
getChildModal: E,
|
|
2072
2105
|
getParentModal: h,
|
|
2073
2106
|
id: c,
|
|
2074
2107
|
index: d,
|
|
2075
2108
|
isOpen: v,
|
|
2076
|
-
modalContext:
|
|
2077
|
-
onTopOfStack:
|
|
2109
|
+
modalContext: w,
|
|
2110
|
+
onTopOfStack: p,
|
|
2078
2111
|
reload: x,
|
|
2079
2112
|
setOpen: O,
|
|
2080
|
-
shouldRender:
|
|
2081
|
-
}) => /* @__PURE__ */
|
|
2082
|
-
|
|
2113
|
+
shouldRender: N
|
|
2114
|
+
}) => /* @__PURE__ */ P(
|
|
2115
|
+
Dr,
|
|
2083
2116
|
{
|
|
2084
2117
|
appear: !0,
|
|
2085
2118
|
show: v ?? !1,
|
|
2086
|
-
afterLeave:
|
|
2087
|
-
children: /* @__PURE__ */
|
|
2088
|
-
|
|
2119
|
+
afterLeave: a,
|
|
2120
|
+
children: /* @__PURE__ */ he(
|
|
2121
|
+
mi,
|
|
2089
2122
|
{
|
|
2090
2123
|
as: "div",
|
|
2091
2124
|
className: "im-dialog relative z-20",
|
|
2092
|
-
onClose: () =>
|
|
2125
|
+
onClose: () => y.closeExplicitly ? null : g(),
|
|
2093
2126
|
"data-inertiaui-modal-id": c,
|
|
2094
2127
|
"data-inertiaui-modal-index": d,
|
|
2095
2128
|
children: [
|
|
2096
|
-
d === 0 ? /* @__PURE__ */
|
|
2129
|
+
d === 0 ? /* @__PURE__ */ P(
|
|
2097
2130
|
Ee,
|
|
2098
2131
|
{
|
|
2099
2132
|
enter: "transition transform ease-in-out duration-300",
|
|
@@ -2102,58 +2135,58 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2102
2135
|
leave: "transition transform ease-in-out duration-300",
|
|
2103
2136
|
leaveFrom: "opacity-100",
|
|
2104
2137
|
leaveTo: "opacity-0",
|
|
2105
|
-
children:
|
|
2138
|
+
children: p ? /* @__PURE__ */ P(
|
|
2106
2139
|
"div",
|
|
2107
2140
|
{
|
|
2108
2141
|
className: "im-backdrop fixed inset-0 z-30 bg-black/75",
|
|
2109
2142
|
"aria-hidden": "true"
|
|
2110
2143
|
}
|
|
2111
|
-
) : /* @__PURE__ */
|
|
2144
|
+
) : /* @__PURE__ */ P("div", {})
|
|
2112
2145
|
}
|
|
2113
2146
|
) : null,
|
|
2114
|
-
d > 0 &&
|
|
2115
|
-
|
|
2116
|
-
|
|
2147
|
+
d > 0 && p ? /* @__PURE__ */ P("div", { className: "im-backdrop fixed inset-0 z-30 bg-black/75" }) : null,
|
|
2148
|
+
y.slideover ? /* @__PURE__ */ P(
|
|
2149
|
+
vi,
|
|
2117
2150
|
{
|
|
2118
|
-
modalContext:
|
|
2119
|
-
config:
|
|
2151
|
+
modalContext: w,
|
|
2152
|
+
config: y,
|
|
2120
2153
|
children: u({
|
|
2121
|
-
afterLeave:
|
|
2122
|
-
close:
|
|
2123
|
-
config:
|
|
2154
|
+
afterLeave: b,
|
|
2155
|
+
close: g,
|
|
2156
|
+
config: y,
|
|
2124
2157
|
emit: f,
|
|
2125
2158
|
getChildModal: E,
|
|
2126
2159
|
getParentModal: h,
|
|
2127
2160
|
id: c,
|
|
2128
2161
|
index: d,
|
|
2129
2162
|
isOpen: v,
|
|
2130
|
-
modalContext:
|
|
2131
|
-
onTopOfStack:
|
|
2163
|
+
modalContext: w,
|
|
2164
|
+
onTopOfStack: p,
|
|
2132
2165
|
reload: x,
|
|
2133
2166
|
setOpen: O,
|
|
2134
|
-
shouldRender:
|
|
2167
|
+
shouldRender: N
|
|
2135
2168
|
})
|
|
2136
2169
|
}
|
|
2137
|
-
) : /* @__PURE__ */
|
|
2138
|
-
|
|
2170
|
+
) : /* @__PURE__ */ P(
|
|
2171
|
+
hi,
|
|
2139
2172
|
{
|
|
2140
|
-
modalContext:
|
|
2141
|
-
config:
|
|
2173
|
+
modalContext: w,
|
|
2174
|
+
config: y,
|
|
2142
2175
|
children: u({
|
|
2143
|
-
afterLeave:
|
|
2144
|
-
close:
|
|
2145
|
-
config:
|
|
2176
|
+
afterLeave: b,
|
|
2177
|
+
close: g,
|
|
2178
|
+
config: y,
|
|
2146
2179
|
emit: f,
|
|
2147
2180
|
getChildModal: E,
|
|
2148
2181
|
getParentModal: h,
|
|
2149
2182
|
id: c,
|
|
2150
2183
|
index: d,
|
|
2151
2184
|
isOpen: v,
|
|
2152
|
-
modalContext:
|
|
2153
|
-
onTopOfStack:
|
|
2185
|
+
modalContext: w,
|
|
2186
|
+
onTopOfStack: p,
|
|
2154
2187
|
reload: x,
|
|
2155
2188
|
setOpen: O,
|
|
2156
|
-
shouldRender:
|
|
2189
|
+
shouldRender: N
|
|
2157
2190
|
})
|
|
2158
2191
|
}
|
|
2159
2192
|
)
|
|
@@ -2165,69 +2198,69 @@ const ai = ({ modalContext: e, config: t, children: r }) => {
|
|
|
2165
2198
|
}
|
|
2166
2199
|
);
|
|
2167
2200
|
});
|
|
2168
|
-
|
|
2169
|
-
const
|
|
2201
|
+
gi.displayName = "Modal";
|
|
2202
|
+
const Ci = ({
|
|
2170
2203
|
href: e,
|
|
2171
2204
|
method: t = "get",
|
|
2172
2205
|
data: r = {},
|
|
2173
2206
|
as: n = "a",
|
|
2174
2207
|
headers: l = {},
|
|
2175
2208
|
queryStringArrayFormat: i = "brackets",
|
|
2176
|
-
onAfterLeave:
|
|
2177
|
-
onBlur:
|
|
2209
|
+
onAfterLeave: a = null,
|
|
2210
|
+
onBlur: s = null,
|
|
2178
2211
|
onClose: o = null,
|
|
2179
2212
|
onError: u = null,
|
|
2180
|
-
onFocus:
|
|
2181
|
-
onStart:
|
|
2182
|
-
onSuccess:
|
|
2183
|
-
navigate:
|
|
2213
|
+
onFocus: m = null,
|
|
2214
|
+
onStart: b = null,
|
|
2215
|
+
onSuccess: g = null,
|
|
2216
|
+
navigate: y = null,
|
|
2184
2217
|
children: f,
|
|
2185
2218
|
...E
|
|
2186
2219
|
}) => {
|
|
2187
|
-
const [h, c] =
|
|
2220
|
+
const [h, c] = F(!1), [d, v] = F(null), { stack: w, visit: p } = et(), x = _(() => y ?? Lt("navigate"), [y]), O = {}, N = {};
|
|
2188
2221
|
Object.keys(E).forEach((k) => {
|
|
2189
|
-
|
|
2222
|
+
Dt.includes(k) || (k.startsWith("on") && typeof E[k] == "function" ? nn(k) ? O[k] = E[k] : N[k] = E[k] : O[k] = E[k]);
|
|
2190
2223
|
});
|
|
2191
|
-
const [
|
|
2224
|
+
const [D, C] = F(!1);
|
|
2192
2225
|
L(() => {
|
|
2193
|
-
d && (d.onTopOfStack &&
|
|
2194
|
-
}, [
|
|
2195
|
-
const
|
|
2226
|
+
d && (d.onTopOfStack && D ? m == null || m() : !d.onTopOfStack && !D && (s == null || s()), C(!d.onTopOfStack));
|
|
2227
|
+
}, [w]);
|
|
2228
|
+
const I = W(() => {
|
|
2196
2229
|
o == null || o();
|
|
2197
|
-
}, [o]), B =
|
|
2198
|
-
v(null),
|
|
2199
|
-
}, [
|
|
2230
|
+
}, [o]), B = W(() => {
|
|
2231
|
+
v(null), a == null || a();
|
|
2232
|
+
}, [a]), R = W(
|
|
2200
2233
|
(k) => {
|
|
2201
|
-
k == null || k.preventDefault(), !h && (e.startsWith("#") || (c(!0),
|
|
2234
|
+
k == null || k.preventDefault(), !h && (e.startsWith("#") || (c(!0), b == null || b()), p(
|
|
2202
2235
|
e,
|
|
2203
2236
|
t,
|
|
2204
2237
|
r,
|
|
2205
2238
|
l,
|
|
2206
|
-
|
|
2207
|
-
() =>
|
|
2239
|
+
rn(tn(E, Dt)),
|
|
2240
|
+
() => I(w.length),
|
|
2208
2241
|
B,
|
|
2209
2242
|
i,
|
|
2210
2243
|
x
|
|
2211
|
-
).then((
|
|
2212
|
-
v(
|
|
2213
|
-
}).catch((
|
|
2214
|
-
console.error(
|
|
2244
|
+
).then((j) => {
|
|
2245
|
+
v(j), j.registerEventListenersFromProps(N), g == null || g();
|
|
2246
|
+
}).catch((j) => {
|
|
2247
|
+
console.error(j), u == null || u(j);
|
|
2215
2248
|
}).finally(() => c(!1)));
|
|
2216
2249
|
},
|
|
2217
|
-
[e, t, r, l, i, E,
|
|
2250
|
+
[e, t, r, l, i, E, I, B]
|
|
2218
2251
|
);
|
|
2219
|
-
return /* @__PURE__ */
|
|
2252
|
+
return /* @__PURE__ */ P(
|
|
2220
2253
|
n,
|
|
2221
2254
|
{
|
|
2222
2255
|
...O,
|
|
2223
2256
|
href: e,
|
|
2224
|
-
onClick:
|
|
2257
|
+
onClick: R,
|
|
2225
2258
|
children: typeof f == "function" ? f({ loading: h }) : f
|
|
2226
2259
|
}
|
|
2227
2260
|
);
|
|
2228
|
-
},
|
|
2229
|
-
i = i ?? !1, l = l ?? "div",
|
|
2230
|
-
const [
|
|
2261
|
+
}, wi = ({ children: e, data: t, params: r, buffer: n, as: l, always: i, fallback: a }) => {
|
|
2262
|
+
i = i ?? !1, l = l ?? "div", a = a ?? null;
|
|
2263
|
+
const [s, o] = F(!1), u = S(!1), m = S(!1), b = S(null), g = or(), y = W(() => {
|
|
2231
2264
|
if (t)
|
|
2232
2265
|
return {
|
|
2233
2266
|
only: Array.isArray(t) ? t : [t]
|
|
@@ -2237,23 +2270,23 @@ const Oi = ({
|
|
|
2237
2270
|
return r;
|
|
2238
2271
|
}, [r, t]);
|
|
2239
2272
|
return L(() => {
|
|
2240
|
-
if (!
|
|
2273
|
+
if (!b.current)
|
|
2241
2274
|
return;
|
|
2242
2275
|
const f = new IntersectionObserver(
|
|
2243
2276
|
(E) => {
|
|
2244
|
-
if (!E[0].isIntersecting || (!i && u.current && f.disconnect(),
|
|
2277
|
+
if (!E[0].isIntersecting || (!i && u.current && f.disconnect(), m.current))
|
|
2245
2278
|
return;
|
|
2246
|
-
u.current = !0,
|
|
2247
|
-
const h =
|
|
2248
|
-
|
|
2279
|
+
u.current = !0, m.current = !0;
|
|
2280
|
+
const h = y();
|
|
2281
|
+
g.reload({
|
|
2249
2282
|
...h,
|
|
2250
2283
|
onStart: (c) => {
|
|
2251
2284
|
var d;
|
|
2252
|
-
|
|
2285
|
+
m.current = !0, (d = h.onStart) == null || d.call(h, c);
|
|
2253
2286
|
},
|
|
2254
2287
|
onFinish: (c) => {
|
|
2255
2288
|
var d;
|
|
2256
|
-
o(!0),
|
|
2289
|
+
o(!0), m.current = !1, (d = h.onFinish) == null || d.call(h, c), i || f.disconnect();
|
|
2257
2290
|
}
|
|
2258
2291
|
});
|
|
2259
2292
|
},
|
|
@@ -2261,35 +2294,35 @@ const Oi = ({
|
|
|
2261
2294
|
rootMargin: `${n || 0}px`
|
|
2262
2295
|
}
|
|
2263
2296
|
);
|
|
2264
|
-
return f.observe(
|
|
2297
|
+
return f.observe(b.current), () => {
|
|
2265
2298
|
f.disconnect();
|
|
2266
2299
|
};
|
|
2267
|
-
}, [
|
|
2300
|
+
}, [b, y, n]), i || !s ? Re(
|
|
2268
2301
|
l,
|
|
2269
2302
|
{
|
|
2270
2303
|
props: null,
|
|
2271
|
-
ref:
|
|
2304
|
+
ref: b
|
|
2272
2305
|
},
|
|
2273
|
-
|
|
2274
|
-
) :
|
|
2306
|
+
s ? e : a
|
|
2307
|
+
) : s ? e : null;
|
|
2275
2308
|
};
|
|
2276
|
-
|
|
2277
|
-
const
|
|
2309
|
+
wi.displayName = "InertiaWhenVisible";
|
|
2310
|
+
const Fi = (e) => (t) => (t.default.layout = (r) => Re(e, {}, r), t);
|
|
2278
2311
|
export {
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2312
|
+
sn as Deferred,
|
|
2313
|
+
ar as HeadlessModal,
|
|
2314
|
+
gi as Modal,
|
|
2315
|
+
Ci as ModalLink,
|
|
2316
|
+
an as ModalRoot,
|
|
2317
|
+
ln as ModalStackProvider,
|
|
2318
|
+
wi as WhenVisible,
|
|
2319
|
+
Lt as getConfig,
|
|
2320
|
+
on as initFromPageProps,
|
|
2321
|
+
Pi as putConfig,
|
|
2322
|
+
Mi as renderApp,
|
|
2323
|
+
Ti as resetConfig,
|
|
2324
|
+
Fi as setPageLayout,
|
|
2325
|
+
or as useModal,
|
|
2326
|
+
lr as useModalIndex,
|
|
2327
|
+
et as useModalStack
|
|
2295
2328
|
};
|