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