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