@levo-so/site-runtime 0.3.1 → 0.3.7
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/{DateTimeWidget-C1jHOtz7.js → DateTimeWidget-Cctsvcrs.js} +2 -2
- package/Dialog-DVB4WpBS.js +130 -0
- package/{KBChatWidget-D7F9LRwI.js → KBChatWidget-Cnq0DCOQ.js} +383 -435
- package/LevoProvider-nmIbMlsk.js +20 -0
- package/{PhoneWidget-_nw97rkI.js → PhoneWidget-J3VTMWJH.js} +2 -2
- package/{PopupRenderer-Bncp54gB-DuCULkBK.js → PopupBody-DZVwDLkg-yrot8Uqb.js} +201 -910
- package/PopupRenderer-BjW1jg70-Biwj2bIc.js +387 -0
- package/{RichTextWidget-D-mGlES0.js → RichTextWidget-BOrVIR2j.js} +10 -9
- package/{VerifyButton-BkP98H17.js → VerifyButton-CA1GtEZJ.js} +20 -19
- package/{theme.cssm-2YTdd8Yh.js → createThemeExtension-DhGk81nV.js} +2 -2
- package/{dist-DBbiX2ST.js → dist-C8gLeklT.js} +601 -598
- package/{dist-CJknSbJK.js → dist-Cb6sb7nO.js} +21 -22
- package/{inlineCollectionTheme-D2w17LHX.js → generateRadiusScale-54mE9ikx.js} +4 -19
- package/index.d.ts +15 -0
- package/index.js +295 -290
- package/{inlineBaseTheme-DS-AfUHi.js → inlineBaseTheme-B6E9zzyp.js} +2 -2
- package/inlineCollectionTheme-DYYMrmcE.js +19 -0
- package/{kbChat-AUJxjURc.js → kbChat-DIb4AS7E.js} +31 -26
- package/{nodeAlignment-Cn6xNtOP.js → nodeAlignment-D70kOcui.js} +13 -13
- package/package.json +9 -9
- package/pillChrome-BAu5AfCT.js +30 -0
- package/popupState-JmpeKzgM-qhNTV79U.js +229 -0
- package/popups.js +1 -1
- package/react-6kO0cqgr.js +74 -0
- package/rteTheme.cssm-xg0gJ28J.js +4 -0
- package/styles.css +1 -1
- package/theme.cssm-mkQwezuj.js +4 -0
- package/usePopupRedirect-BThP_YPW-DoixMAB9.js +80 -0
- package/Dialog-CzVhHLEY.js +0 -145
- package/pillChrome-AhXOWXIb.js +0 -20
- /package/{CollectionField-CzS-34zx.js → CollectionField-C59pmeQw.js} +0 -0
- /package/{Popover-q5dL7y0W.js → Popover-C7zZHBIc.js} +0 -0
- /package/{es-iCqKQf1c.js → es-CztjLuNy.js} +0 -0
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { n as r } from "./dist-
|
|
4
|
-
import { t as i } from "./
|
|
5
|
-
import { t as a } from "./
|
|
2
|
+
import { i as e, n as t, r as n } from "./LevoProvider-nmIbMlsk.js";
|
|
3
|
+
import { n as r } from "./dist-C8gLeklT.js";
|
|
4
|
+
import { t as i } from "./inlineBaseTheme-B6E9zzyp.js";
|
|
5
|
+
import { t as a } from "./inlineCollectionTheme-DYYMrmcE.js";
|
|
6
6
|
import * as o from "react";
|
|
7
7
|
import { Suspense as s, createContext as c, lazy as l, useCallback as u, useContext as d, useEffect as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
8
8
|
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
@@ -21,17 +21,18 @@ function N() {
|
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
23
|
//#region src/chat/LevoChat.tsx
|
|
24
|
-
var P = l(() => import("./kbChat-
|
|
25
|
-
let
|
|
26
|
-
return !
|
|
24
|
+
var P = l(() => import("./kbChat-DIb4AS7E.js")), ie = ({ site: e, path: t }) => {
|
|
25
|
+
let n = N(), r = e.workspace_id || void 0;
|
|
26
|
+
return !n || !r ? null : /* @__PURE__ */ v(s, {
|
|
27
27
|
fallback: null,
|
|
28
28
|
children: /* @__PURE__ */ v(P, {
|
|
29
|
-
workspaceId:
|
|
29
|
+
workspaceId: r,
|
|
30
30
|
siteName: e.name || void 0,
|
|
31
31
|
siteLogo: void 0,
|
|
32
32
|
siteIcon: e.icon?.location,
|
|
33
33
|
siteSlug: e.slug || void 0,
|
|
34
|
-
showBranding: !!e.feature_flag?.branding
|
|
34
|
+
showBranding: !!e.feature_flag?.branding,
|
|
35
|
+
path: t
|
|
35
36
|
})
|
|
36
37
|
});
|
|
37
38
|
}, F = (e) => {
|
|
@@ -65,23 +66,23 @@ function se(e, t) {
|
|
|
65
66
|
return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${L}').matches;var r=t==='system'?(d?'dark':'light'):t;var e=document.documentElement;e.classList.remove('light','dark');e.classList.add(r);e.style.colorScheme=r}catch(e){}})();`;
|
|
66
67
|
}
|
|
67
68
|
var R = c(void 0), z = (e) => e === "system" ? window.matchMedia(L).matches ? "dark" : "light" : e;
|
|
68
|
-
function
|
|
69
|
+
function B(e) {
|
|
69
70
|
let t = document.documentElement;
|
|
70
71
|
t.classList.remove("light", "dark"), t.classList.add(e), t.style.colorScheme = e;
|
|
71
72
|
}
|
|
72
|
-
var
|
|
73
|
+
var ce = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode" }) => {
|
|
73
74
|
let [r, i] = g(t), [a, o] = g(t === "dark" ? "dark" : "light"), s = N();
|
|
74
75
|
return f(() => {
|
|
75
76
|
i(ae(n) ?? t);
|
|
76
77
|
}, [t, n]), f(() => {
|
|
77
78
|
if (!s) return;
|
|
78
79
|
let e = z(r);
|
|
79
|
-
|
|
80
|
+
B(e), o(e);
|
|
80
81
|
}, [r, s]), f(() => {
|
|
81
82
|
if (!s || r !== "system") return;
|
|
82
83
|
let e = window.matchMedia(L), t = () => {
|
|
83
84
|
let t = e.matches ? "dark" : "light";
|
|
84
|
-
|
|
85
|
+
B(t), o(t);
|
|
85
86
|
};
|
|
86
87
|
return e.addEventListener("change", t), () => e.removeEventListener("change", t);
|
|
87
88
|
}, [r, s]), /* @__PURE__ */ y(R.Provider, {
|
|
@@ -95,32 +96,32 @@ var le = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode"
|
|
|
95
96
|
children: [/* @__PURE__ */ v(S, { children: se(n, t) }), e]
|
|
96
97
|
});
|
|
97
98
|
};
|
|
98
|
-
function
|
|
99
|
+
function V() {
|
|
99
100
|
let e = d(R);
|
|
100
101
|
if (e === void 0) throw Error("useColorMode must be used within a ColorModeProvider");
|
|
101
102
|
return e;
|
|
102
103
|
}
|
|
103
104
|
//#endregion
|
|
104
105
|
//#region src/data/index.ts
|
|
105
|
-
var
|
|
106
|
+
var H = (e) => [
|
|
106
107
|
"levo-source",
|
|
107
108
|
"list",
|
|
108
109
|
e.module,
|
|
109
110
|
e.identifier,
|
|
110
111
|
e.query ?? null,
|
|
111
112
|
e.options ?? null
|
|
112
|
-
],
|
|
113
|
+
], U = (e, t) => [
|
|
113
114
|
"levo-source",
|
|
114
115
|
"record",
|
|
115
116
|
e.module,
|
|
116
117
|
e.identifier,
|
|
117
118
|
t ?? null
|
|
118
|
-
],
|
|
119
|
+
], W = (e) => [
|
|
119
120
|
"levo-source",
|
|
120
121
|
"form",
|
|
121
122
|
e.module,
|
|
122
123
|
e.identifier
|
|
123
|
-
],
|
|
124
|
+
], G = async (e, t) => {
|
|
124
125
|
let n = t.module === "collection" ? await e.collection.getCollectionContentList({
|
|
125
126
|
collection_key: t.identifier,
|
|
126
127
|
...t.query ?? {}
|
|
@@ -129,13 +130,13 @@ var B = (e) => [
|
|
|
129
130
|
data: n.content.data ?? [],
|
|
130
131
|
meta: n.content.meta ?? null
|
|
131
132
|
};
|
|
132
|
-
},
|
|
133
|
+
}, le = async (e, t, n) => (t.module === "collection" ? await e.collection.getCollectionContent({
|
|
133
134
|
collection_key: t.identifier,
|
|
134
135
|
slug: n
|
|
135
|
-
}) : t.module === "blog" ? await e.blog.getSingleBlog(t.identifier, n) : await e.event.getSingleEvent(n)).content.data ?? null,
|
|
136
|
+
}) : t.module === "blog" ? await e.blog.getSingleBlog(t.identifier, n) : await e.event.getSingleEvent(n)).content.data ?? null, K = async (e, t) => (await e.collection.getCollectionByIDExpanded(t.identifier)).content.data ?? null, ue = (e) => {
|
|
136
137
|
let t = n(), r = w({
|
|
137
|
-
queryKey:
|
|
138
|
-
queryFn: () =>
|
|
138
|
+
queryKey: H(e),
|
|
139
|
+
queryFn: () => G(t, e),
|
|
139
140
|
enabled: !!t
|
|
140
141
|
});
|
|
141
142
|
return {
|
|
@@ -148,10 +149,10 @@ var B = (e) => [
|
|
|
148
149
|
...e
|
|
149
150
|
}) }
|
|
150
151
|
};
|
|
151
|
-
},
|
|
152
|
+
}, de = (e, t) => {
|
|
152
153
|
let r = n(), i = w({
|
|
153
|
-
queryKey:
|
|
154
|
-
queryFn: () =>
|
|
154
|
+
queryKey: U(e, t),
|
|
155
|
+
queryFn: () => le(r, e, t),
|
|
155
156
|
enabled: !!r && !!t
|
|
156
157
|
});
|
|
157
158
|
return {
|
|
@@ -163,10 +164,10 @@ var B = (e) => [
|
|
|
163
164
|
...e
|
|
164
165
|
}) }
|
|
165
166
|
};
|
|
166
|
-
},
|
|
167
|
+
}, fe = (e) => {
|
|
167
168
|
let t = n(), r = w({
|
|
168
|
-
queryKey:
|
|
169
|
-
queryFn: () =>
|
|
169
|
+
queryKey: W(e),
|
|
170
|
+
queryFn: () => K(t, e),
|
|
170
171
|
enabled: !!t
|
|
171
172
|
});
|
|
172
173
|
return {
|
|
@@ -178,27 +179,27 @@ var B = (e) => [
|
|
|
178
179
|
...e
|
|
179
180
|
}) }
|
|
180
181
|
};
|
|
181
|
-
},
|
|
182
|
+
}, pe = async ({ queryClient: e, config: t, sources: n, params: r }) => {
|
|
182
183
|
let i = F(t);
|
|
183
184
|
if (!i || !n) return {};
|
|
184
185
|
let a = await Promise.all(Object.entries(n).map(async ([t, n]) => {
|
|
185
186
|
if (n.mode === "record") {
|
|
186
187
|
let a = r?.slug;
|
|
187
188
|
return a ? [t, await e.ensureQueryData({
|
|
188
|
-
queryKey:
|
|
189
|
-
queryFn: () =>
|
|
189
|
+
queryKey: U(n, a),
|
|
190
|
+
queryFn: () => le(i, n, a)
|
|
190
191
|
}).catch(() => null)] : [t, null];
|
|
191
192
|
}
|
|
192
193
|
return n.mode === "form" ? [t, await e.ensureQueryData({
|
|
193
|
-
queryKey:
|
|
194
|
-
queryFn: () =>
|
|
194
|
+
queryKey: W(n),
|
|
195
|
+
queryFn: () => K(i, n)
|
|
195
196
|
}).catch(() => null)] : [t, await e.ensureQueryData({
|
|
196
|
-
queryKey:
|
|
197
|
-
queryFn: () =>
|
|
197
|
+
queryKey: H(n),
|
|
198
|
+
queryFn: () => G(i, n)
|
|
198
199
|
}).catch(() => null)];
|
|
199
200
|
}));
|
|
200
201
|
return Object.fromEntries(a);
|
|
201
|
-
},
|
|
202
|
+
}, me = {
|
|
202
203
|
background: "var(--color-page)",
|
|
203
204
|
foreground: "var(--color-ink)",
|
|
204
205
|
text: "var(--color-ink)",
|
|
@@ -220,11 +221,11 @@ var B = (e) => [
|
|
|
220
221
|
input: "var(--color-background1)",
|
|
221
222
|
inputForeground: "var(--color-ink)",
|
|
222
223
|
ring: "var(--color-brand)"
|
|
223
|
-
},
|
|
224
|
-
let d = n(), { schema: f, isLoading: p, bind: h } =
|
|
225
|
-
...
|
|
224
|
+
}, he = ({ source: e, submitLabel: t = "Submit", hiddenFields: o, formVariant: s = "default", successConfig: c, theme: l, className: u }) => {
|
|
225
|
+
let d = n(), { schema: f, isLoading: p, bind: h } = fe(e), g = m(() => ({
|
|
226
|
+
...i({
|
|
226
227
|
colors: {
|
|
227
|
-
...
|
|
228
|
+
...me,
|
|
228
229
|
...l?.colors
|
|
229
230
|
},
|
|
230
231
|
radius: l?.radius ?? "var(--radius-token)",
|
|
@@ -233,7 +234,7 @@ var B = (e) => [
|
|
|
233
234
|
heading: "var(--font-heading)"
|
|
234
235
|
}
|
|
235
236
|
}),
|
|
236
|
-
...l?.gap ?
|
|
237
|
+
...l?.gap ? a({ form: { gap: l.gap } }) : {}
|
|
237
238
|
}), [l]);
|
|
238
239
|
return d ? /* @__PURE__ */ v("div", {
|
|
239
240
|
...h,
|
|
@@ -255,28 +256,28 @@ var B = (e) => [
|
|
|
255
256
|
successConfig: c
|
|
256
257
|
})
|
|
257
258
|
}) : null;
|
|
258
|
-
},
|
|
259
|
+
}, ge = 1400, _e = 12 * 1024 * 1024, ve = new Set(["transparent", "rgba(0, 0, 0, 0)"]), ye = {
|
|
259
260
|
imagePlaceholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
|
|
260
261
|
onImageErrorHandler: () => void 0
|
|
261
|
-
},
|
|
262
|
+
}, be = (e) => {
|
|
262
263
|
let t = getComputedStyle(e);
|
|
263
|
-
return !
|
|
264
|
-
},
|
|
264
|
+
return !ve.has(t.backgroundColor) || t.backgroundImage !== "none";
|
|
265
|
+
}, xe = (e) => {
|
|
265
266
|
for (let t = e; t; t = t.parentElement) {
|
|
266
267
|
let e = getComputedStyle(t).backgroundColor;
|
|
267
|
-
if (!
|
|
268
|
+
if (!ve.has(e)) return e;
|
|
268
269
|
}
|
|
269
270
|
return "#ffffff";
|
|
270
|
-
},
|
|
271
|
-
let { toPng: n } = await import("./es-
|
|
272
|
-
...
|
|
271
|
+
}, Se = async (e, t) => {
|
|
272
|
+
let { toPng: n } = await import("./es-CztjLuNy.js"), r = e.getBoundingClientRect(), i = Math.max(r.width, r.height, 1), a = Math.min(2, Math.max(.4, ge / i)), o = await n(e, {
|
|
273
|
+
...ye,
|
|
273
274
|
pixelRatio: a,
|
|
274
|
-
backgroundColor:
|
|
275
|
+
backgroundColor: xe(e),
|
|
275
276
|
filter: (e) => !t.includes(e)
|
|
276
277
|
});
|
|
277
|
-
if (o.length >
|
|
278
|
+
if (o.length > _e) throw Error("capture too large");
|
|
278
279
|
return o;
|
|
279
|
-
},
|
|
280
|
+
}, Ce = 4, we = 4e3, Te = (e, t) => {
|
|
280
281
|
let n = document.elementFromPoint(e.x + e.width / 2, e.y + e.height / 2);
|
|
281
282
|
for (; n && t.includes(n);) n = n.parentElement;
|
|
282
283
|
let r = document.body;
|
|
@@ -287,8 +288,8 @@ var B = (e) => [
|
|
|
287
288
|
break;
|
|
288
289
|
}
|
|
289
290
|
}
|
|
290
|
-
let i = window.innerWidth * window.innerHeight *
|
|
291
|
-
for (; !
|
|
291
|
+
let i = window.innerWidth * window.innerHeight * Ce || 2 ** 53 - 1, a = r;
|
|
292
|
+
for (; !be(a);) {
|
|
292
293
|
let e = a.parentElement;
|
|
293
294
|
if (!e || e === document.documentElement) break;
|
|
294
295
|
let t = e.getBoundingClientRect();
|
|
@@ -296,13 +297,13 @@ var B = (e) => [
|
|
|
296
297
|
a = e;
|
|
297
298
|
}
|
|
298
299
|
return a;
|
|
299
|
-
},
|
|
300
|
-
let { toCanvas: n } = await import("./es-
|
|
301
|
-
o = Math.min(o,
|
|
300
|
+
}, Ee = async (e, t) => {
|
|
301
|
+
let { toCanvas: n } = await import("./es-CztjLuNy.js"), r = Te(e, t), i = r.getBoundingClientRect(), a = Math.max(e.width, e.height, 1), o = Math.min(2, Math.max(.4, ge / a)), s = Math.max(i.width, i.height, 1);
|
|
302
|
+
o = Math.min(o, we / s);
|
|
302
303
|
let c = await n(r, {
|
|
303
|
-
...
|
|
304
|
+
...ye,
|
|
304
305
|
pixelRatio: o,
|
|
305
|
-
backgroundColor:
|
|
306
|
+
backgroundColor: xe(r),
|
|
306
307
|
filter: (e) => !t.includes(e)
|
|
307
308
|
}), l = document.createElement("canvas");
|
|
308
309
|
l.width = Math.max(1, Math.round(e.width * o)), l.height = Math.max(1, Math.round(e.height * o));
|
|
@@ -310,39 +311,39 @@ var B = (e) => [
|
|
|
310
311
|
if (!u) throw Error("no 2d context");
|
|
311
312
|
u.drawImage(c, (e.x - i.left) * o, (e.y - i.top) * o, e.width * o, e.height * o, 0, 0, l.width, l.height);
|
|
312
313
|
let d = l.toDataURL("image/png");
|
|
313
|
-
if (d.length >
|
|
314
|
+
if (d.length > _e) throw Error("capture too large");
|
|
314
315
|
return d;
|
|
315
|
-
},
|
|
316
|
+
}, q = {
|
|
316
317
|
ring: 99997,
|
|
317
318
|
overlay: 99998,
|
|
318
319
|
label: 99999
|
|
319
|
-
},
|
|
320
|
+
}, J = {
|
|
320
321
|
hover: "#3b82f6",
|
|
321
322
|
hoverBg: "rgba(59,130,246,0.12)",
|
|
322
323
|
hoverLabelBg: "#1d4ed8",
|
|
323
324
|
select: "#16a34a",
|
|
324
325
|
selectGlow: "rgba(22,163,74,0.18)"
|
|
325
|
-
},
|
|
326
|
+
}, Y = (e) => {
|
|
326
327
|
let t = e?.getAttribute("data-tsd-source");
|
|
327
328
|
return t ? t.replace(/^\//, "") : null;
|
|
328
|
-
},
|
|
329
|
-
let n =
|
|
329
|
+
}, De = (e) => Array.from(document.querySelectorAll("[data-tsd-source]")).filter((t) => Y(t) === e), Oe = (e, t) => {
|
|
330
|
+
let n = De(t).indexOf(e);
|
|
330
331
|
return n < 0 ? 0 : n;
|
|
331
|
-
},
|
|
332
|
-
let n =
|
|
332
|
+
}, X = (e, t = 0) => {
|
|
333
|
+
let n = De(e);
|
|
333
334
|
return n[t] ?? n[0] ?? null;
|
|
334
|
-
},
|
|
335
|
+
}, ke = (e, t) => {
|
|
335
336
|
let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter(Boolean);
|
|
336
337
|
n.includes(t) || e.setAttribute("data-staged-key", [...n, t].join(" "));
|
|
337
|
-
},
|
|
338
|
+
}, Ae = (e, t) => {
|
|
338
339
|
let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter((e) => e && e !== t);
|
|
339
340
|
n.length ? e.setAttribute("data-staged-key", n.join(" ")) : e.removeAttribute("data-staged-key");
|
|
340
|
-
},
|
|
341
|
+
}, je = (e, t) => {
|
|
341
342
|
let n = Object.entries(t.styles).filter(([e]) => /^-?[a-zA-Z][a-zA-Z0-9-]*$/.test(e)).map(([e, t]) => `${e}:${String(t).replace(/[;{}]/g, "")} !important;`).join("");
|
|
342
343
|
if (!n) return "";
|
|
343
344
|
let r = `[data-staged-key~="${CSS.escape(e)}"]{${n}}`, i = t.media?.replace(/[;{}]/g, "").trim();
|
|
344
345
|
return i ? `@media ${i}{${r}}` : r;
|
|
345
|
-
},
|
|
346
|
+
}, Me = (e) => {
|
|
346
347
|
let t = e.tagName.toLowerCase();
|
|
347
348
|
return t === "input" ? {
|
|
348
349
|
checkbox: "Checkbox",
|
|
@@ -384,31 +385,31 @@ var B = (e) => [
|
|
|
384
385
|
aside: "Sidebar",
|
|
385
386
|
div: "Container"
|
|
386
387
|
}[t] || `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
|
|
387
|
-
},
|
|
388
|
-
let t =
|
|
389
|
-
return n ? `${t} · ${n.length >
|
|
390
|
-
},
|
|
388
|
+
}, Ne = 36, Pe = (e) => {
|
|
389
|
+
let t = Me(e), n = ((e) => e.replace(/\s+/g, " ").trim())(e.getAttribute("aria-label") || e.getAttribute("alt") || e.getAttribute("title") || e.getAttribute("name") || "");
|
|
390
|
+
return n ? `${t} · ${n.length > Ne ? `${n.slice(0, Ne - 1).trimEnd()}…` : n}` : t;
|
|
391
|
+
}, Fe = (e) => {
|
|
391
392
|
let t = [], n = e;
|
|
392
393
|
for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) t.unshift(n.tagName.toLowerCase()), n = n.parentElement;
|
|
393
394
|
return t.join(" > ");
|
|
394
|
-
},
|
|
395
|
+
}, Ie = () => {
|
|
395
396
|
let e = document.createElement("div");
|
|
396
|
-
e.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
397
|
+
e.style.cssText = `position:fixed;pointer-events:none;z-index:${q.overlay};background:${J.hoverBg};outline:2px solid ${J.hover};border-radius:2px;display:none`;
|
|
397
398
|
let t = document.createElement("div");
|
|
398
|
-
t.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
399
|
+
t.style.cssText = `position:fixed;pointer-events:none;z-index:${q.label};background:${J.hoverLabelBg};color:#fff;font:11px/1.6 ui-monospace,monospace;padding:1px 6px;border-radius:4px;display:none;max-width:70vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis`;
|
|
399
400
|
let n = document.createElement("div");
|
|
400
|
-
n.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
401
|
+
n.style.cssText = `position:fixed;pointer-events:none;z-index:${q.ring};outline:2px solid ${J.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 4px ${J.selectGlow};display:none`;
|
|
401
402
|
let r = document.createElement("div");
|
|
402
|
-
return r.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
403
|
+
return r.style.cssText = `position:fixed;pointer-events:none;z-index:${q.label};background:${J.select};color:#fff;font:11px/1.6 ui-monospace,monospace;padding:1px 6px;border-radius:4px;display:none;max-width:70vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis`, {
|
|
403
404
|
overlay: e,
|
|
404
405
|
label: t,
|
|
405
406
|
ring: n,
|
|
406
407
|
ringLabel: r
|
|
407
408
|
};
|
|
408
|
-
},
|
|
409
|
+
}, Le = (e, t, n) => {
|
|
409
410
|
let r = n.getBoundingClientRect();
|
|
410
|
-
e.style.display = "block", e.style.left = `${r.left}px`, e.style.top = `${r.top}px`, e.style.width = `${r.width}px`, e.style.height = `${r.height}px`, t.style.display = "block", t.textContent =
|
|
411
|
-
},
|
|
411
|
+
e.style.display = "block", e.style.left = `${r.left}px`, e.style.top = `${r.top}px`, e.style.width = `${r.width}px`, e.style.height = `${r.height}px`, t.style.display = "block", t.textContent = Pe(n), t.style.left = `${Math.max(4, r.left)}px`, t.style.top = `${r.top > 26 ? r.top - 22 : r.bottom + 4}px`;
|
|
412
|
+
}, Re = (e) => {
|
|
412
413
|
let t = (e instanceof Element ? e : null)?.closest("a[href]");
|
|
413
414
|
if (!t || t.target === "_blank") return null;
|
|
414
415
|
let n;
|
|
@@ -418,11 +419,11 @@ var B = (e) => [
|
|
|
418
419
|
return null;
|
|
419
420
|
}
|
|
420
421
|
return n.protocol !== "http:" && n.protocol !== "https:" || n.origin === location.origin ? null : n.href;
|
|
421
|
-
},
|
|
422
|
+
}, ze = (e) => {
|
|
422
423
|
if (!e) return !1;
|
|
423
424
|
let t = e.tagName;
|
|
424
425
|
return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable === !0;
|
|
425
|
-
},
|
|
426
|
+
}, Be = (e) => {
|
|
426
427
|
if (!e.childNodes.length) return !1;
|
|
427
428
|
let t = !1;
|
|
428
429
|
for (let n of e.childNodes) {
|
|
@@ -430,10 +431,10 @@ var B = (e) => [
|
|
|
430
431
|
(n.textContent ?? "").trim() && (t = !0);
|
|
431
432
|
}
|
|
432
433
|
return t;
|
|
433
|
-
},
|
|
434
|
+
}, Ve = 2e3, He = (e) => {
|
|
434
435
|
let t = [], n = e;
|
|
435
436
|
for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) {
|
|
436
|
-
let e =
|
|
437
|
+
let e = Y(n);
|
|
437
438
|
e && t.unshift({
|
|
438
439
|
tag: n.tagName.toLowerCase(),
|
|
439
440
|
text: (n.textContent || "").trim().slice(0, 60),
|
|
@@ -441,25 +442,25 @@ var B = (e) => [
|
|
|
441
442
|
}), n = n.parentElement;
|
|
442
443
|
}
|
|
443
444
|
return t;
|
|
444
|
-
},
|
|
445
|
-
let t =
|
|
445
|
+
}, Ue = (e) => {
|
|
446
|
+
let t = Y(e), n = t ? De(t).length : 1, r = t ? Oe(e, t) : 0, i = t && Be(e) ? (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, Ve) : void 0, a = We(e);
|
|
446
447
|
return {
|
|
447
448
|
tag: e.tagName.toLowerCase(),
|
|
448
449
|
classes: typeof e.className == "string" ? e.className.trim() : "",
|
|
449
450
|
text: (e.innerText || "").trim().slice(0, 120),
|
|
450
|
-
label:
|
|
451
|
-
path:
|
|
451
|
+
label: Pe(e),
|
|
452
|
+
path: Fe(e),
|
|
452
453
|
source: t,
|
|
453
454
|
index: r,
|
|
454
455
|
occurrences: n,
|
|
455
|
-
ancestors:
|
|
456
|
+
ancestors: He(e),
|
|
456
457
|
...i === void 0 ? {} : { fullText: i },
|
|
457
458
|
...a ? { sourceBinding: a } : {}
|
|
458
459
|
};
|
|
459
|
-
},
|
|
460
|
+
}, We = (e) => {
|
|
460
461
|
let t = e.closest("[data-levo-source]");
|
|
461
462
|
if (!t) return;
|
|
462
|
-
let n = t.getAttribute("data-levo-source") ?? "", r =
|
|
463
|
+
let n = t.getAttribute("data-levo-source") ?? "", r = Y(t), i;
|
|
463
464
|
try {
|
|
464
465
|
i = JSON.parse(n);
|
|
465
466
|
} catch {
|
|
@@ -469,12 +470,12 @@ var B = (e) => [
|
|
|
469
470
|
raw: n,
|
|
470
471
|
element: {
|
|
471
472
|
source: r ?? "",
|
|
472
|
-
index: r ?
|
|
473
|
+
index: r ? Oe(t, r) : 0
|
|
473
474
|
},
|
|
474
475
|
...i === void 0 ? {} : { config: i }
|
|
475
476
|
};
|
|
476
|
-
},
|
|
477
|
-
let t = e.getAttribute("data-levo-source") ?? "", n =
|
|
477
|
+
}, Ge = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
|
|
478
|
+
let t = e.getAttribute("data-levo-source") ?? "", n = Y(e), r;
|
|
478
479
|
try {
|
|
479
480
|
r = JSON.parse(t);
|
|
480
481
|
} catch {
|
|
@@ -484,21 +485,21 @@ var B = (e) => [
|
|
|
484
485
|
raw: t,
|
|
485
486
|
element: {
|
|
486
487
|
source: n ?? "",
|
|
487
|
-
index: n ?
|
|
488
|
+
index: n ? Oe(e, n) : 0
|
|
488
489
|
},
|
|
489
490
|
tag: e.tagName.toLowerCase(),
|
|
490
|
-
label:
|
|
491
|
+
label: Pe(e),
|
|
491
492
|
...r === void 0 ? {} : { config: r }
|
|
492
493
|
};
|
|
493
|
-
}),
|
|
494
|
+
}), Ke = 14, qe = 2e3, Je = 100, Ye = 48, Xe = new Set([
|
|
494
495
|
"script",
|
|
495
496
|
"style",
|
|
496
497
|
"template",
|
|
497
498
|
"noscript"
|
|
498
|
-
]),
|
|
499
|
+
]), Ze = (e, t) => t.includes(e) || e.id === "studio-staged" || Xe.has(e.tagName.toLowerCase()), Qe = (e) => {
|
|
499
500
|
let t = !1, n = 0, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
500
501
|
for (let e of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
|
|
501
|
-
let t =
|
|
502
|
+
let t = Y(e);
|
|
502
503
|
if (!t) continue;
|
|
503
504
|
let n = i.get(t) ?? 0;
|
|
504
505
|
r.set(e, n), i.set(t, n + 1);
|
|
@@ -507,11 +508,11 @@ var B = (e) => [
|
|
|
507
508
|
for (let t of e.childNodes) {
|
|
508
509
|
if (t.nodeType !== 3) continue;
|
|
509
510
|
let e = (t.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
510
|
-
if (e) return e.length >
|
|
511
|
+
if (e) return e.length > Ye ? `${e.slice(0, Ye).trimEnd()}…` : e;
|
|
511
512
|
}
|
|
512
513
|
}, o = (i, s) => {
|
|
513
514
|
n++;
|
|
514
|
-
let c =
|
|
515
|
+
let c = Y(i), l = a(i), u = Array.from(i.children).filter((t) => !Ze(t, e)), d = {
|
|
515
516
|
tag: i.tagName.toLowerCase(),
|
|
516
517
|
...c ? {
|
|
517
518
|
source: c,
|
|
@@ -522,9 +523,9 @@ var B = (e) => [
|
|
|
522
523
|
childCount: u.length,
|
|
523
524
|
children: []
|
|
524
525
|
};
|
|
525
|
-
if (s >=
|
|
526
|
+
if (s >= Ke) return u.length && (t = !0), d;
|
|
526
527
|
for (let e of u) {
|
|
527
|
-
if (d.children.length >=
|
|
528
|
+
if (d.children.length >= Je || n >= qe) {
|
|
528
529
|
t = !0;
|
|
529
530
|
break;
|
|
530
531
|
}
|
|
@@ -536,7 +537,7 @@ var B = (e) => [
|
|
|
536
537
|
tree: o(document.body, 0),
|
|
537
538
|
truncated: t
|
|
538
539
|
};
|
|
539
|
-
},
|
|
540
|
+
}, $e = () => {
|
|
540
541
|
let e = null;
|
|
541
542
|
return {
|
|
542
543
|
send: (t) => {
|
|
@@ -551,7 +552,7 @@ var B = (e) => [
|
|
|
551
552
|
return !0;
|
|
552
553
|
}
|
|
553
554
|
};
|
|
554
|
-
},
|
|
555
|
+
}, et = (e) => {
|
|
555
556
|
let t = location.pathname, n = () => {
|
|
556
557
|
location.pathname !== t && (t = location.pathname, e.onPathChange());
|
|
557
558
|
}, r = !1;
|
|
@@ -571,7 +572,7 @@ var B = (e) => [
|
|
|
571
572
|
e.__inspectorPatched && e.__orig && (history.pushState = e.__orig), t.__inspectorPatched && t.__orig && (history.replaceState = t.__orig);
|
|
572
573
|
}
|
|
573
574
|
} };
|
|
574
|
-
},
|
|
575
|
+
}, tt = (e) => {
|
|
575
576
|
let { channel: t, originals: n, staged: r } = e, i = t.send, a = null;
|
|
576
577
|
return { onMessage: (o) => {
|
|
577
578
|
let s = o.data;
|
|
@@ -579,7 +580,7 @@ var B = (e) => [
|
|
|
579
580
|
if (s.type === "set-inspect") e.setInspect(s.enabled);
|
|
580
581
|
else if (s.type === "set-text-edit") e.setTextEdit(s.enabled);
|
|
581
582
|
else if (s.type === "revert-text") {
|
|
582
|
-
let e = String(s.element?.source || ""), t = Number.isInteger(s.element?.index) ? s.element.index : 0, r = n.restore(`${e}#${t}`), i = r == null ? null :
|
|
583
|
+
let e = String(s.element?.source || ""), t = Number.isInteger(s.element?.index) ? s.element.index : 0, r = n.restore(`${e}#${t}`), i = r == null ? null : X(e, t);
|
|
583
584
|
i && r != null && (i.textContent = r);
|
|
584
585
|
} else if (s.type === "stage-style") {
|
|
585
586
|
let t = String(s.stageId || ""), n = String(s.element?.source || ""), a = Number.isInteger(s.element?.index) ? s.element.index : 0, o = s.styles && typeof s.styles == "object" ? s.styles : null;
|
|
@@ -638,7 +639,7 @@ var B = (e) => [
|
|
|
638
639
|
}
|
|
639
640
|
e.syncDomObserver();
|
|
640
641
|
} else if (s.type === "select-element") {
|
|
641
|
-
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ?
|
|
642
|
+
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? X(t, n) : null;
|
|
642
643
|
if (!r) {
|
|
643
644
|
i({
|
|
644
645
|
type: "select-miss",
|
|
@@ -654,10 +655,10 @@ var B = (e) => [
|
|
|
654
655
|
behavior: "smooth"
|
|
655
656
|
}), i({
|
|
656
657
|
type: "element-selected",
|
|
657
|
-
element:
|
|
658
|
+
element: Ue(r)
|
|
658
659
|
});
|
|
659
660
|
} else if (s.type === "edit-element") {
|
|
660
|
-
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ?
|
|
661
|
+
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? X(t, n) : null;
|
|
661
662
|
if (!r) {
|
|
662
663
|
i({
|
|
663
664
|
type: "select-miss",
|
|
@@ -673,12 +674,12 @@ var B = (e) => [
|
|
|
673
674
|
behavior: "smooth"
|
|
674
675
|
}), i({
|
|
675
676
|
type: "element-selected",
|
|
676
|
-
element:
|
|
677
|
+
element: Ue(r)
|
|
677
678
|
}), e.isTextEditing() || e.setTextEdit(!0);
|
|
678
679
|
let o = e.editableTarget(r);
|
|
679
680
|
o && e.startEditAtEnd(o);
|
|
680
681
|
} else if (s.type === "highlight-element") {
|
|
681
|
-
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ?
|
|
682
|
+
let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? X(t, n) : null;
|
|
682
683
|
if (!r) a = null, e.hideTextHover(), i({
|
|
683
684
|
type: "highlight-miss",
|
|
684
685
|
element: {
|
|
@@ -696,7 +697,7 @@ var B = (e) => [
|
|
|
696
697
|
}
|
|
697
698
|
} else if (s.type === "clear-highlight") a && (a = null, !e.isInspecting() && !e.editingNode() && e.hideTextHover());
|
|
698
699
|
else if (s.type === "request-layers") {
|
|
699
|
-
let { tree: t, truncated: n } =
|
|
700
|
+
let { tree: t, truncated: n } = Qe(e.ownNodes);
|
|
700
701
|
i({
|
|
701
702
|
type: "layers-tree",
|
|
702
703
|
tree: t,
|
|
@@ -704,7 +705,7 @@ var B = (e) => [
|
|
|
704
705
|
});
|
|
705
706
|
} else if (s.type === "request-sources") i({
|
|
706
707
|
type: "sources-list",
|
|
707
|
-
sources:
|
|
708
|
+
sources: Ge()
|
|
708
709
|
});
|
|
709
710
|
else if (s.type === "capture-selected") {
|
|
710
711
|
let t = String(s.requestId || "");
|
|
@@ -719,7 +720,7 @@ var B = (e) => [
|
|
|
719
720
|
});
|
|
720
721
|
return;
|
|
721
722
|
}
|
|
722
|
-
|
|
723
|
+
Se(n, e.ownNodes).then((e) => {
|
|
723
724
|
console.info(`[levo-inspector] element capture ok <${n.tagName.toLowerCase()}> (${Math.round(e.length / 1024)}kB)`), i({
|
|
724
725
|
type: "capture-result",
|
|
725
726
|
requestId: t,
|
|
@@ -740,7 +741,7 @@ var B = (e) => [
|
|
|
740
741
|
}
|
|
741
742
|
}
|
|
742
743
|
} };
|
|
743
|
-
},
|
|
744
|
+
}, nt = () => {
|
|
744
745
|
let e = /* @__PURE__ */ new Map(), t = () => {
|
|
745
746
|
if (e.size > 50) {
|
|
746
747
|
let t = e.keys().next().value;
|
|
@@ -760,31 +761,31 @@ var B = (e) => [
|
|
|
760
761
|
return e.delete(t), n;
|
|
761
762
|
}
|
|
762
763
|
};
|
|
763
|
-
},
|
|
764
|
+
}, rt = 6, it = 12, at = 12, ot = .6, st = (e, t, n, r) => ({
|
|
764
765
|
x: Math.min(e, n),
|
|
765
766
|
y: Math.min(t, r),
|
|
766
767
|
width: Math.abs(n - e),
|
|
767
768
|
height: Math.abs(r - t)
|
|
768
|
-
}),
|
|
769
|
+
}), ct = (e, t) => {
|
|
769
770
|
let n = e.x + e.width, r = e.y + e.height, i = [];
|
|
770
771
|
for (let a of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
|
|
771
772
|
if (t.includes(a)) continue;
|
|
772
773
|
let o = a.getBoundingClientRect(), s = o.width * o.height;
|
|
773
|
-
s <= 0 || Math.max(0, Math.min(n, o.right) - Math.max(e.x, o.left)) * Math.max(0, Math.min(r, o.bottom) - Math.max(e.y, o.top)) / s >=
|
|
774
|
+
s <= 0 || Math.max(0, Math.min(n, o.right) - Math.max(e.x, o.left)) * Math.max(0, Math.min(r, o.bottom) - Math.max(e.y, o.top)) / s >= ot && i.push(a);
|
|
774
775
|
}
|
|
775
776
|
let a = new Set(i), o = i.filter((e) => {
|
|
776
777
|
for (let t = e.parentElement; t; t = t.parentElement) if (a.has(t)) return !1;
|
|
777
778
|
return !0;
|
|
778
|
-
}), s = o.length >
|
|
779
|
-
for (let e of o.slice(0,
|
|
780
|
-
let t =
|
|
779
|
+
}), s = o.length > at, c = [], l = [];
|
|
780
|
+
for (let e of o.slice(0, at)) {
|
|
781
|
+
let t = Y(e);
|
|
781
782
|
if (!t) continue;
|
|
782
783
|
let n = (e.innerText || "").replace(/\s+/g, " ").trim().slice(0, 80);
|
|
783
784
|
c.push({
|
|
784
785
|
source: t,
|
|
785
|
-
index:
|
|
786
|
+
index: Oe(e, t),
|
|
786
787
|
tag: e.tagName.toLowerCase(),
|
|
787
|
-
label:
|
|
788
|
+
label: Pe(e),
|
|
788
789
|
...n ? { text: n } : {}
|
|
789
790
|
}), l.push(e);
|
|
790
791
|
}
|
|
@@ -793,12 +794,12 @@ var B = (e) => [
|
|
|
793
794
|
nodes: l,
|
|
794
795
|
truncated: s
|
|
795
796
|
};
|
|
796
|
-
},
|
|
797
|
+
}, lt = () => Array.from({ length: at }, () => {
|
|
797
798
|
let e = document.createElement("div");
|
|
798
|
-
return e.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
799
|
-
}),
|
|
799
|
+
return e.style.cssText = `position:fixed;pointer-events:none;z-index:${q.ring};outline:1.5px solid ${J.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 3px ${J.selectGlow};display:none`, e;
|
|
800
|
+
}), ut = () => {
|
|
800
801
|
let e = document.createElement("div");
|
|
801
|
-
e.style.cssText = `position:fixed;pointer-events:none;z-index:${
|
|
802
|
+
e.style.cssText = `position:fixed;pointer-events:none;z-index:${q.overlay};border:1.5px dashed ${J.select};background:${J.selectGlow};border-radius:2px;display:none`;
|
|
802
803
|
let t = null, n = !1, r = 0, i = 0, a = () => {
|
|
803
804
|
e.style.display = "none";
|
|
804
805
|
};
|
|
@@ -813,31 +814,31 @@ var B = (e) => [
|
|
|
813
814
|
pointerMove: (a, o) => {
|
|
814
815
|
if (!t) return;
|
|
815
816
|
if (a = Math.min(Math.max(0, a), window.innerWidth), o = Math.min(Math.max(0, o), window.innerHeight), r = a, i = o, !n) {
|
|
816
|
-
if (Math.abs(a - t.x) <
|
|
817
|
+
if (Math.abs(a - t.x) < rt && Math.abs(o - t.y) < rt) return;
|
|
817
818
|
n = !0;
|
|
818
819
|
}
|
|
819
|
-
let s =
|
|
820
|
+
let s = st(t.x, t.y, a, o);
|
|
820
821
|
e.style.display = "block", e.style.left = `${s.x}px`, e.style.top = `${s.y}px`, e.style.width = `${s.width}px`, e.style.height = `${s.height}px`;
|
|
821
822
|
},
|
|
822
823
|
pointerUp: () => {
|
|
823
824
|
let e = n, o = t;
|
|
824
825
|
if (t = null, n = !1, a(), !e || !o) return null;
|
|
825
|
-
let s =
|
|
826
|
-
return s.width <
|
|
826
|
+
let s = st(o.x, o.y, r, i);
|
|
827
|
+
return s.width < it || s.height < it ? null : s;
|
|
827
828
|
},
|
|
828
829
|
cancel: () => {
|
|
829
830
|
t = null, n = !1, a();
|
|
830
831
|
},
|
|
831
832
|
isDragging: () => n
|
|
832
833
|
};
|
|
833
|
-
},
|
|
834
|
+
}, dt = (e) => {
|
|
834
835
|
let { originals: t, editingNode: n } = e, r = /* @__PURE__ */ new Map(), i = () => {
|
|
835
836
|
let e = document.getElementById("studio-staged");
|
|
836
837
|
return e || (e = document.createElement("style"), e.id = "studio-staged", document.head.appendChild(e)), e;
|
|
837
838
|
}, a = () => {
|
|
838
839
|
let e = [];
|
|
839
840
|
for (let [t, n] of r) if (n.kind === "style") {
|
|
840
|
-
let r =
|
|
841
|
+
let r = je(t, n);
|
|
841
842
|
r && e.push(r);
|
|
842
843
|
}
|
|
843
844
|
let t = e.join("\n");
|
|
@@ -845,8 +846,8 @@ var B = (e) => [
|
|
|
845
846
|
let n = i();
|
|
846
847
|
n.textContent !== t && (n.textContent = t);
|
|
847
848
|
}, o = (e, r) => {
|
|
848
|
-
let i =
|
|
849
|
-
if (i) if (r.kind === "style")
|
|
849
|
+
let i = X(r.source, r.index);
|
|
850
|
+
if (i) if (r.kind === "style") ke(i, e);
|
|
850
851
|
else if (r.kind === "image") t.captureOnce(`${r.source}#${r.index}:src`, i.getAttribute("src") ?? ""), t.captureOnce(`${r.source}#${r.index}:srcset`, i.getAttribute("srcset") ?? ""), i.getAttribute("src") !== r.value && i.setAttribute("src", r.value), i.hasAttribute("srcset") && i.removeAttribute("srcset");
|
|
851
852
|
else {
|
|
852
853
|
if (i === n()) return;
|
|
@@ -859,8 +860,8 @@ var B = (e) => [
|
|
|
859
860
|
let n = r.get(e);
|
|
860
861
|
if (!n) return;
|
|
861
862
|
r.delete(e);
|
|
862
|
-
let i =
|
|
863
|
-
if (n.kind === "style") i &&
|
|
863
|
+
let i = X(n.source, n.index);
|
|
864
|
+
if (n.kind === "style") i && Ae(i, e), a();
|
|
864
865
|
else if (n.kind === "image") {
|
|
865
866
|
let e = t.restore(`${n.source}#${n.index}:src`), r = t.restore(`${n.source}#${n.index}:srcset`);
|
|
866
867
|
i && (e != null && (e ? i.setAttribute("src", e) : i.removeAttribute("src")), r != null && (r ? i.setAttribute("srcset", r) : i.removeAttribute("srcset")));
|
|
@@ -889,7 +890,7 @@ var B = (e) => [
|
|
|
889
890
|
for (let e of Array.from(document.querySelectorAll("[data-staged-key]"))) e.removeAttribute("data-staged-key");
|
|
890
891
|
}
|
|
891
892
|
};
|
|
892
|
-
},
|
|
893
|
+
}, ft = (e) => {
|
|
893
894
|
let { channel: t, originals: n, clearTextHover: r } = e, i = null, a = "", o = 0, s = (() => {
|
|
894
895
|
try {
|
|
895
896
|
let e = document.createElement("div");
|
|
@@ -908,15 +909,15 @@ var B = (e) => [
|
|
|
908
909
|
n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n);
|
|
909
910
|
}, d = (e, t = !1) => {
|
|
910
911
|
if (i === e) return;
|
|
911
|
-
i && p(i), i = e, a =
|
|
912
|
+
i && p(i), i = e, a = Y(e) || "", o = Oe(e, a), r(), n.capture(`${a}#${o}`, e.textContent ?? ""), e.setAttribute("contenteditable", s ? "plaintext-only" : "true");
|
|
912
913
|
let d = e;
|
|
913
|
-
d.style.outline = `2px solid ${
|
|
914
|
+
d.style.outline = `2px solid ${J.hover}`, d.style.outlineOffset = "3px", d.style.borderRadius = "3px", d.focus(), t && u(e), d.addEventListener("blur", c, !0), d.addEventListener("keydown", l, !0);
|
|
914
915
|
}, f = (e) => {
|
|
915
916
|
e.removeAttribute("contenteditable");
|
|
916
917
|
let t = e;
|
|
917
918
|
t.style.outline = "", t.style.outlineOffset = "", t.style.borderRadius = "", t.removeEventListener("blur", c, !0), t.removeEventListener("keydown", l, !0), i = null;
|
|
918
919
|
}, p = (e) => {
|
|
919
|
-
let r =
|
|
920
|
+
let r = Y(e), i = o, s = n.get(`${a}#${o}`);
|
|
920
921
|
f(e);
|
|
921
922
|
let c = (e.textContent ?? "").replace(/\s+/g, " ").trim();
|
|
922
923
|
t.send({
|
|
@@ -927,7 +928,7 @@ var B = (e) => [
|
|
|
927
928
|
tag: e.tagName.toLowerCase(),
|
|
928
929
|
value: c,
|
|
929
930
|
previous: s,
|
|
930
|
-
occurrences: r ?
|
|
931
|
+
occurrences: r ? De(r).length : 1
|
|
931
932
|
}
|
|
932
933
|
});
|
|
933
934
|
}, m = (e) => {
|
|
@@ -946,16 +947,16 @@ var B = (e) => [
|
|
|
946
947
|
i && f(i);
|
|
947
948
|
}
|
|
948
949
|
};
|
|
949
|
-
},
|
|
950
|
-
function
|
|
951
|
-
return f(() =>
|
|
950
|
+
}, pt = "2026-07-24g · element-capture + region-drag + region-highlights (stale-region guard)";
|
|
951
|
+
function mt() {
|
|
952
|
+
return f(() => ht(), []), null;
|
|
952
953
|
}
|
|
953
|
-
function
|
|
954
|
-
let e = !1, t = null, n = null, r = !1, i = null, a =
|
|
954
|
+
function ht() {
|
|
955
|
+
let e = !1, t = null, n = null, r = !1, i = null, a = nt(), o = $e(), { overlay: s, label: c, ring: l, ringLabel: u } = Ie();
|
|
955
956
|
document.body.append(s, c, l, u);
|
|
956
|
-
let d =
|
|
957
|
+
let d = ut();
|
|
957
958
|
document.body.append(d.node);
|
|
958
|
-
let f =
|
|
959
|
+
let f = lt();
|
|
959
960
|
document.body.append(...f);
|
|
960
961
|
let p = [
|
|
961
962
|
s,
|
|
@@ -984,15 +985,15 @@ function gt() {
|
|
|
984
985
|
e && !b ? (b = document.createElement("style"), b.id = "studio-pick-cursor", b.textContent = "*,*::before,*::after{cursor:crosshair !important}", document.head.appendChild(b)) : !e && b && (b.remove(), b = null);
|
|
985
986
|
}, S = (e) => !e || p.includes(e) || e === document.body || e === document.documentElement, C = (e) => {
|
|
986
987
|
if (!e || S(e)) return null;
|
|
987
|
-
let t =
|
|
988
|
-
return !t || S(t) || !
|
|
989
|
-
}, w = (e) =>
|
|
988
|
+
let t = Y(e) ? e : e.closest("[data-tsd-source]");
|
|
989
|
+
return !t || S(t) || !Be(t) ? null : t;
|
|
990
|
+
}, w = (e) => Le(s, c, e), T = () => {
|
|
990
991
|
if (n) {
|
|
991
992
|
if (!n.isConnected) {
|
|
992
993
|
ne();
|
|
993
994
|
return;
|
|
994
995
|
}
|
|
995
|
-
|
|
996
|
+
Le(l, u, n);
|
|
996
997
|
}
|
|
997
998
|
}, E = 0, D = () => {
|
|
998
999
|
E || !n || r || (E = requestAnimationFrame(() => {
|
|
@@ -1021,19 +1022,19 @@ function gt() {
|
|
|
1021
1022
|
n = null, O.disconnect(), ie(), E &&= (cancelAnimationFrame(E), 0), l.style.display = "none", u.style.display = "none", y(), g();
|
|
1022
1023
|
}, re = (e) => w(e), M = () => {
|
|
1023
1024
|
s.style.display = "none", c.style.display = "none";
|
|
1024
|
-
}, N =
|
|
1025
|
+
}, N = ft({
|
|
1025
1026
|
channel: o,
|
|
1026
1027
|
originals: a,
|
|
1027
1028
|
clearTextHover: () => {
|
|
1028
1029
|
i = null, M();
|
|
1029
1030
|
}
|
|
1030
|
-
}), P =
|
|
1031
|
+
}), P = dt({
|
|
1031
1032
|
originals: a,
|
|
1032
1033
|
editingNode: N.editingNode
|
|
1033
1034
|
}), ie = () => {
|
|
1034
1035
|
n?.isConnected || P.count() ? ee() : j();
|
|
1035
1036
|
}, F = (n) => {
|
|
1036
|
-
n && r && I(!1), e = !!n, x(e), e || (t = null, s.style.display = "none", c.style.display = "none",
|
|
1037
|
+
n && r && I(!1), e = !!n, x(e), e || (t = null, s.style.display = "none", c.style.display = "none", G()), o.send({
|
|
1037
1038
|
type: "inspect-state",
|
|
1038
1039
|
enabled: e
|
|
1039
1040
|
});
|
|
@@ -1063,45 +1064,45 @@ function gt() {
|
|
|
1063
1064
|
}
|
|
1064
1065
|
}, R = (t) => {
|
|
1065
1066
|
!e && !r || (ae = t.clientX, oe = t.clientY, L ||= requestAnimationFrame(se));
|
|
1066
|
-
}, z = 0,
|
|
1067
|
+
}, z = 0, B = () => {
|
|
1067
1068
|
z = 0, e && t && w(t), r && !N.editingNode() && i?.isConnected && re(i), n && !r && T(), m.length > 0 && !r && _();
|
|
1068
|
-
},
|
|
1069
|
-
z ||= requestAnimationFrame(
|
|
1070
|
-
},
|
|
1069
|
+
}, ce = () => {
|
|
1070
|
+
z ||= requestAnimationFrame(B);
|
|
1071
|
+
}, V = (n) => {
|
|
1071
1072
|
n.relatedTarget || (e ? (t = null, s.style.display = "none", c.style.display = "none") : r && !N.editingNode() && (i = null, M(), document.documentElement.style.cursor = ""));
|
|
1072
|
-
},
|
|
1073
|
-
if (
|
|
1073
|
+
}, H = !1, U = null, W = () => {
|
|
1074
|
+
if (U != null) {
|
|
1074
1075
|
try {
|
|
1075
|
-
document.documentElement.releasePointerCapture(
|
|
1076
|
+
document.documentElement.releasePointerCapture(U);
|
|
1076
1077
|
} catch {}
|
|
1077
|
-
|
|
1078
|
+
U = null;
|
|
1078
1079
|
}
|
|
1079
|
-
},
|
|
1080
|
-
|
|
1081
|
-
},
|
|
1082
|
-
!e || t.button !== 0 || !t.isPrimary || (
|
|
1083
|
-
},
|
|
1080
|
+
}, G = () => {
|
|
1081
|
+
W(), d.cancel();
|
|
1082
|
+
}, le = (t) => {
|
|
1083
|
+
!e || t.button !== 0 || !t.isPrimary || (H = !1, d.pointerDown(t.clientX, t.clientY));
|
|
1084
|
+
}, K = (n) => {
|
|
1084
1085
|
if (!e || !n.isPrimary) return;
|
|
1085
1086
|
let r = d.isDragging();
|
|
1086
1087
|
if (d.pointerMove(n.clientX, n.clientY), d.isDragging()) {
|
|
1087
1088
|
if (!r) {
|
|
1088
|
-
|
|
1089
|
+
U = n.pointerId;
|
|
1089
1090
|
try {
|
|
1090
1091
|
document.documentElement.setPointerCapture(n.pointerId);
|
|
1091
1092
|
} catch {}
|
|
1092
1093
|
}
|
|
1093
1094
|
t = null, s.style.display = "none", c.style.display = "none";
|
|
1094
1095
|
}
|
|
1095
|
-
},
|
|
1096
|
+
}, ue = (t) => {
|
|
1096
1097
|
if (!e || !t.isPrimary) return;
|
|
1097
|
-
|
|
1098
|
+
W();
|
|
1098
1099
|
let n = d.pointerUp();
|
|
1099
1100
|
if (!n) return;
|
|
1100
|
-
|
|
1101
|
-
let { elements: r, nodes: i, truncated: a } =
|
|
1101
|
+
H = !0, ne();
|
|
1102
|
+
let { elements: r, nodes: i, truncated: a } = ct(n, p);
|
|
1102
1103
|
console.info(`[levo-inspector] region drag: ${Math.round(n.width)}×${Math.round(n.height)} — ${r.length} element(s)${a ? " (truncated)" : ""}`), v(i);
|
|
1103
1104
|
let s = ++h;
|
|
1104
|
-
|
|
1105
|
+
Ee(n, p).then((e) => {
|
|
1105
1106
|
s === h && (console.info(`[levo-inspector] region capture ok (${Math.round(e.length / 1024)}kB)`), o.send({
|
|
1106
1107
|
type: "region-selected",
|
|
1107
1108
|
rect: n,
|
|
@@ -1118,25 +1119,25 @@ function gt() {
|
|
|
1118
1119
|
dataUrl: null
|
|
1119
1120
|
}));
|
|
1120
1121
|
});
|
|
1121
|
-
},
|
|
1122
|
-
let t =
|
|
1122
|
+
}, de = () => G(), fe = (e) => {
|
|
1123
|
+
let t = Re(e.target);
|
|
1123
1124
|
return t ? (e.preventDefault(), e.stopPropagation(), window.open(t, "_blank", "noopener,noreferrer"), !0) : !1;
|
|
1124
|
-
},
|
|
1125
|
-
if (
|
|
1126
|
-
|
|
1125
|
+
}, pe = (i) => {
|
|
1126
|
+
if (H) {
|
|
1127
|
+
H = !1, i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
|
|
1127
1128
|
return;
|
|
1128
1129
|
}
|
|
1129
1130
|
if (r) {
|
|
1130
1131
|
let e = C(document.elementFromPoint(i.clientX, i.clientY) || i.target);
|
|
1131
1132
|
if (!e || e === N.editingNode()) {
|
|
1132
|
-
|
|
1133
|
+
fe(i);
|
|
1133
1134
|
return;
|
|
1134
1135
|
}
|
|
1135
1136
|
i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation(), N.startEdit(e);
|
|
1136
1137
|
return;
|
|
1137
1138
|
}
|
|
1138
1139
|
if (!e) {
|
|
1139
|
-
|
|
1140
|
+
fe(i);
|
|
1140
1141
|
return;
|
|
1141
1142
|
}
|
|
1142
1143
|
i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
|
|
@@ -1145,9 +1146,9 @@ function gt() {
|
|
|
1145
1146
|
let s = a.closest("[data-tsd-source]") || a;
|
|
1146
1147
|
y(), g(), n = s, T(), te(), o.send({
|
|
1147
1148
|
type: "element-selected",
|
|
1148
|
-
element:
|
|
1149
|
+
element: Ue(s)
|
|
1149
1150
|
});
|
|
1150
|
-
},
|
|
1151
|
+
}, me = tt({
|
|
1151
1152
|
channel: o,
|
|
1152
1153
|
originals: a,
|
|
1153
1154
|
staged: P,
|
|
@@ -1168,7 +1169,7 @@ function gt() {
|
|
|
1168
1169
|
startEditAtEnd: (e) => N.startEdit(e, !0),
|
|
1169
1170
|
editableTarget: C,
|
|
1170
1171
|
ownNodes: p
|
|
1171
|
-
}),
|
|
1172
|
+
}), he = [
|
|
1172
1173
|
"mousedown",
|
|
1173
1174
|
"mouseup",
|
|
1174
1175
|
"dblclick",
|
|
@@ -1186,95 +1187,98 @@ function gt() {
|
|
|
1186
1187
|
"touchstart",
|
|
1187
1188
|
"touchend",
|
|
1188
1189
|
"submit"
|
|
1189
|
-
],
|
|
1190
|
+
], ge = (t) => {
|
|
1190
1191
|
e && (t.cancelable && t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation());
|
|
1191
|
-
},
|
|
1192
|
+
}, _e = () => {
|
|
1192
1193
|
n && !r && T(), m.length > 0 && !r && _();
|
|
1193
|
-
},
|
|
1194
|
+
}, ve = () => {
|
|
1194
1195
|
let e = location.pathname.replace(/\/$/, "") || "/";
|
|
1195
1196
|
o.send({
|
|
1196
1197
|
type: "route",
|
|
1197
1198
|
route: e
|
|
1198
1199
|
});
|
|
1199
|
-
},
|
|
1200
|
-
ne(),
|
|
1201
|
-
} }),
|
|
1200
|
+
}, ye = et({ onPathChange: () => {
|
|
1201
|
+
ne(), ve();
|
|
1202
|
+
} }), be = (t) => {
|
|
1202
1203
|
if (N.editingNode()) return;
|
|
1203
1204
|
if (t.key === "Escape") {
|
|
1204
1205
|
if (e && d.isDragging()) {
|
|
1205
|
-
t.stopPropagation(),
|
|
1206
|
+
t.stopPropagation(), G();
|
|
1206
1207
|
return;
|
|
1207
1208
|
}
|
|
1208
1209
|
r ? (t.stopPropagation(), I(!1)) : e && (t.stopPropagation(), F(!1));
|
|
1209
1210
|
return;
|
|
1210
1211
|
}
|
|
1211
|
-
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat ||
|
|
1212
|
+
if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || ze(document.activeElement)) return;
|
|
1212
1213
|
let n = t.key.toLowerCase();
|
|
1213
1214
|
n === "s" ? (t.preventDefault(), t.stopPropagation(), F(!e)) : n === "t" && (t.preventDefault(), t.stopPropagation(), I(!r));
|
|
1214
1215
|
};
|
|
1215
|
-
window.addEventListener("mousemove", R, !0), window.addEventListener("scroll",
|
|
1216
|
-
for (let e of
|
|
1217
|
-
return console.info(`[levo-inspector] build ${
|
|
1218
|
-
window.removeEventListener("mousemove", R, !0), window.removeEventListener("keydown",
|
|
1219
|
-
for (let e of
|
|
1220
|
-
O.disconnect(), k.disconnect(), E && cancelAnimationFrame(E), L && cancelAnimationFrame(L), z && cancelAnimationFrame(z), P.teardown(),
|
|
1216
|
+
window.addEventListener("mousemove", R, !0), window.addEventListener("scroll", ce, !0), window.addEventListener("resize", _e), window.addEventListener("click", pe, !0), window.addEventListener("keydown", be, !0), window.addEventListener("message", me.onMessage), window.addEventListener("mouseout", V, !0), window.addEventListener("pointerdown", le, !0), window.addEventListener("pointermove", K, !0), window.addEventListener("pointerup", ue, !0), window.addEventListener("pointercancel", de, !0);
|
|
1217
|
+
for (let e of he) window.addEventListener(e, ge, !0);
|
|
1218
|
+
return console.info(`[levo-inspector] build ${pt} — runtime mounted`), ve(), o.send({ type: "ready" }), () => {
|
|
1219
|
+
window.removeEventListener("mousemove", R, !0), window.removeEventListener("keydown", be, !0), window.removeEventListener("scroll", ce, !0), window.removeEventListener("resize", _e), window.removeEventListener("mouseout", V, !0), window.removeEventListener("pointerdown", le, !0), window.removeEventListener("pointermove", K, !0), window.removeEventListener("pointerup", ue, !0), window.removeEventListener("pointercancel", de, !0), window.removeEventListener("click", pe, !0), window.removeEventListener("message", me.onMessage);
|
|
1220
|
+
for (let e of he) window.removeEventListener(e, ge, !0);
|
|
1221
|
+
O.disconnect(), k.disconnect(), E && cancelAnimationFrame(E), L && cancelAnimationFrame(L), z && cancelAnimationFrame(z), P.teardown(), ye.teardown(), N.teardown(), document.documentElement.style.cursor = "", b?.remove(), s.remove(), c.remove(), l.remove(), u.remove(), G(), d.node.remove();
|
|
1221
1222
|
for (let e of f) e.remove();
|
|
1222
1223
|
};
|
|
1223
1224
|
}
|
|
1224
1225
|
//#endregion
|
|
1225
1226
|
//#region src/pageId.ts
|
|
1226
|
-
var
|
|
1227
|
+
var gt = "levo:page-id", _t = () => {
|
|
1227
1228
|
if (typeof document > "u") return null;
|
|
1228
|
-
let e = document.querySelectorAll(`meta[name="${
|
|
1229
|
+
let e = document.querySelectorAll(`meta[name="${gt}"]`);
|
|
1229
1230
|
return e[e.length - 1]?.getAttribute("content")?.trim() || null;
|
|
1230
|
-
},
|
|
1231
|
+
}, vt = l(() => import("./dist-Cb6sb7nO.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), yt = ({ siteId: e, pageId: t }) => {
|
|
1231
1232
|
let r = N(), i = n();
|
|
1232
1233
|
return !r || !i ? null : /* @__PURE__ */ v(s, {
|
|
1233
1234
|
fallback: null,
|
|
1234
|
-
children: /* @__PURE__ */ v(
|
|
1235
|
+
children: /* @__PURE__ */ v(vt, {
|
|
1235
1236
|
pageId: t,
|
|
1236
1237
|
siteId: e
|
|
1237
1238
|
})
|
|
1238
1239
|
});
|
|
1239
|
-
},
|
|
1240
|
+
}, bt = () => n(), xt = () => e(), St = ({ site: e, children: n }) => {
|
|
1240
1241
|
let [r] = g(() => {
|
|
1241
|
-
if (!
|
|
1242
|
-
let
|
|
1242
|
+
if (!e) return null;
|
|
1243
|
+
let t = I(e), n = F(t);
|
|
1243
1244
|
return n ? {
|
|
1244
1245
|
client: n,
|
|
1245
1246
|
insights: E(n, {
|
|
1246
|
-
insightsUrl:
|
|
1247
|
-
site:
|
|
1247
|
+
insightsUrl: t.insightsUrl || null,
|
|
1248
|
+
site: t.siteId || null
|
|
1248
1249
|
}),
|
|
1249
|
-
site:
|
|
1250
|
+
site: e
|
|
1250
1251
|
} : null;
|
|
1251
1252
|
}), [i, a] = g(null), o = C({ select: (e) => e.location.pathname });
|
|
1252
1253
|
return f(() => {
|
|
1253
1254
|
r && (window.levo_client = r.client, window.levo_insights = r.insights);
|
|
1254
1255
|
}, [r]), p(() => {
|
|
1255
1256
|
if (!r) return;
|
|
1256
|
-
let e =
|
|
1257
|
+
let e = _t();
|
|
1257
1258
|
a(e), r.insights.init({ pageId: e });
|
|
1258
|
-
}, [r, o]), r ? /* @__PURE__ */ y(
|
|
1259
|
+
}, [r, o]), r ? /* @__PURE__ */ y(t, {
|
|
1259
1260
|
client: r.client,
|
|
1260
1261
|
insights: r.insights,
|
|
1261
1262
|
children: [
|
|
1262
1263
|
n,
|
|
1263
|
-
/* @__PURE__ */ v(ie, {
|
|
1264
|
-
|
|
1264
|
+
/* @__PURE__ */ v(ie, {
|
|
1265
|
+
site: r.site,
|
|
1266
|
+
path: o
|
|
1267
|
+
}),
|
|
1268
|
+
/* @__PURE__ */ v(yt, {
|
|
1265
1269
|
pageId: i ?? void 0,
|
|
1266
1270
|
siteId: r.site.id
|
|
1267
1271
|
})
|
|
1268
1272
|
]
|
|
1269
1273
|
}) : /* @__PURE__ */ v(_, { children: n });
|
|
1270
|
-
},
|
|
1274
|
+
}, Ct = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), wt = (e) => {
|
|
1271
1275
|
let t = {}, n = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("([^"]*)"|'([^']*)'|[^\s"'>]+))?/g;
|
|
1272
1276
|
for (let r = n.exec(e); r; r = n.exec(e)) {
|
|
1273
1277
|
let e = r[1];
|
|
1274
1278
|
!e || /^on/i.test(e) || (t[e] = r[3] ?? r[4] ?? (r[2] ? r[2] : ""));
|
|
1275
1279
|
}
|
|
1276
1280
|
return t;
|
|
1277
|
-
},
|
|
1281
|
+
}, Tt = (e) => {
|
|
1278
1282
|
let t = {
|
|
1279
1283
|
meta: [],
|
|
1280
1284
|
links: [],
|
|
@@ -1282,11 +1286,11 @@ var _t = "levo:page-id", vt = () => {
|
|
|
1282
1286
|
};
|
|
1283
1287
|
if (!e?.trim()) return t;
|
|
1284
1288
|
let n = e.replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi, (e, n, r) => {
|
|
1285
|
-
let i =
|
|
1289
|
+
let i = wt(n), a = r.trim();
|
|
1286
1290
|
return a && (i.children = a), t.scripts.push(i), "";
|
|
1287
1291
|
});
|
|
1288
|
-
return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(
|
|
1289
|
-
},
|
|
1292
|
+
return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(wt(r)), "")), t;
|
|
1293
|
+
}, Et = (e = {}, t = {}) => {
|
|
1290
1294
|
let n = {
|
|
1291
1295
|
meta: [],
|
|
1292
1296
|
links: [],
|
|
@@ -1351,17 +1355,17 @@ var _t = "levo:page-id", vt = () => {
|
|
|
1351
1355
|
let y = e.ldJson ? Array.isArray(e.ldJson) ? e.ldJson : [e.ldJson] : [];
|
|
1352
1356
|
for (let e of y) n.scripts.push({
|
|
1353
1357
|
type: "application/ld+json",
|
|
1354
|
-
children:
|
|
1358
|
+
children: Ct(e)
|
|
1355
1359
|
});
|
|
1356
1360
|
for (let r of [t.customHead, e.customHead]) {
|
|
1357
1361
|
if (!r) continue;
|
|
1358
|
-
let e =
|
|
1362
|
+
let e = Tt(r);
|
|
1359
1363
|
n.meta.push(...e.meta), n.links.push(...e.links), n.scripts.push(...e.scripts);
|
|
1360
1364
|
}
|
|
1361
1365
|
return n;
|
|
1362
1366
|
};
|
|
1363
|
-
function
|
|
1364
|
-
let n =
|
|
1367
|
+
function Dt({ meta: e, site: t }) {
|
|
1368
|
+
let n = Et(e, t);
|
|
1365
1369
|
return /* @__PURE__ */ y(_, { children: [
|
|
1366
1370
|
n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */ v("meta", { ...e }, `m${t}`) : /* @__PURE__ */ v("title", { children: e.title }, `t${t}`)),
|
|
1367
1371
|
n.links.map((e, t) => /* @__PURE__ */ v("link", { ...e }, `l${t}`)),
|
|
@@ -1373,17 +1377,17 @@ function Ot({ meta: e, site: t }) {
|
|
|
1373
1377
|
}
|
|
1374
1378
|
//#endregion
|
|
1375
1379
|
//#region src/registration/ui.tsx
|
|
1376
|
-
var
|
|
1380
|
+
var Ot = (...e) => e.filter(Boolean).join(" "), Z = o.forwardRef(({ className: e, isLoading: t, loadingText: n, children: r, type: i = "button", ...a }, o) => /* @__PURE__ */ v("button", {
|
|
1377
1381
|
ref: o,
|
|
1378
1382
|
type: i,
|
|
1379
|
-
className:
|
|
1383
|
+
className: Ot("inline-flex items-center justify-center", e),
|
|
1380
1384
|
...a,
|
|
1381
|
-
children: t ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(A, { className:
|
|
1385
|
+
children: t ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(A, { className: Ot("h-4 w-4 animate-spin", n ? "mr-2" : "") }), n] }) : r
|
|
1382
1386
|
}));
|
|
1383
1387
|
Z.displayName = "Btn";
|
|
1384
1388
|
//#endregion
|
|
1385
1389
|
//#region src/registration/AttendeeForm.tsx
|
|
1386
|
-
var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, registerLoading: i, onBack: a, submitLabel: o }) => /* @__PURE__ */ y("form", {
|
|
1390
|
+
var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, registerLoading: i, onBack: a, submitLabel: o, showBusinessBilling: s = !0 }) => /* @__PURE__ */ y("form", {
|
|
1387
1391
|
onSubmit: r,
|
|
1388
1392
|
className: "flex flex-col gap-4",
|
|
1389
1393
|
children: [
|
|
@@ -1414,7 +1418,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1414
1418
|
type: "email",
|
|
1415
1419
|
required: !0
|
|
1416
1420
|
})] }),
|
|
1417
|
-
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
1421
|
+
s && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
1418
1422
|
htmlFor: "is_business_purchase",
|
|
1419
1423
|
className: "flex items-center gap-2 text-sm",
|
|
1420
1424
|
children: [/* @__PURE__ */ v("input", {
|
|
@@ -1431,7 +1435,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1431
1435
|
className: "mt-1 text-gray-500 text-xs",
|
|
1432
1436
|
children: "Check this if you're purchasing for a business and need a tax-compliant invoice"
|
|
1433
1437
|
})] }),
|
|
1434
|
-
e.is_business_purchase && /* @__PURE__ */ y(_, { children: [
|
|
1438
|
+
s && e.is_business_purchase && /* @__PURE__ */ y(_, { children: [
|
|
1435
1439
|
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
|
|
1436
1440
|
htmlFor: "business_name",
|
|
1437
1441
|
className: "font-medium text-sm",
|
|
@@ -1561,7 +1565,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1561
1565
|
if (!e) return !1;
|
|
1562
1566
|
let t = e;
|
|
1563
1567
|
return t.tax_enabled === !0 && t.taxes !== void 0 && t.taxes.length > 0 && t.subtotal !== void 0;
|
|
1564
|
-
}, $ = (e, t) => !t || e.tickets.length === 0 ? !0 : e.tickets.some((e) => typeof e == "string" ? e === t : e._id === t),
|
|
1568
|
+
}, Pt = (e, t) => t ? t.total_amount ?? t.sale_amount ?? 0 : Nt(e) ? e.total ?? e.unit_amount ?? 0 : e?.unit_amount ?? 0, $ = (e, t) => !t || e.tickets.length === 0 ? !0 : e.tickets.some((e) => typeof e == "string" ? e === t : e._id === t), Ft = ({ couponCode: e, onCouponCodeChange: t, couponError: n, couponLoading: r, onValidateCoupon: i, publicCoupons: a, onBack: o, selectedTicket: s }) => {
|
|
1565
1569
|
let c = [...a].sort((e, t) => {
|
|
1566
1570
|
let n = $(e, s?._id), r = $(t, s?._id);
|
|
1567
1571
|
return n && !r ? -1 : !n && r ? 1 : 0;
|
|
@@ -1663,7 +1667,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1663
1667
|
})] })]
|
|
1664
1668
|
})
|
|
1665
1669
|
] });
|
|
1666
|
-
},
|
|
1670
|
+
}, It = (e) => {
|
|
1667
1671
|
let t = new Date(e);
|
|
1668
1672
|
return `${new Intl.DateTimeFormat("en-GB", {
|
|
1669
1673
|
day: "numeric",
|
|
@@ -1674,7 +1678,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1674
1678
|
minute: "2-digit",
|
|
1675
1679
|
hour12: !0
|
|
1676
1680
|
}).format(t)}`;
|
|
1677
|
-
},
|
|
1681
|
+
}, Lt = ({ ticketData: e, paymentData: t, type: n }) => {
|
|
1678
1682
|
let [r, i] = g(!0), a = (t.total_amount || t.unit_amount) / 100, o = t.unit_amount === 0, s = (e) => new Intl.NumberFormat("en-IN", {
|
|
1679
1683
|
style: "currency",
|
|
1680
1684
|
currency: t.currency || "INR",
|
|
@@ -1822,7 +1826,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1822
1826
|
]
|
|
1823
1827
|
}), /* @__PURE__ */ v("p", {
|
|
1824
1828
|
className: "mt-3 text-center text-gray-400 text-xs",
|
|
1825
|
-
children:
|
|
1829
|
+
children: It(t.created_at)
|
|
1826
1830
|
})]
|
|
1827
1831
|
}),
|
|
1828
1832
|
/* @__PURE__ */ y("div", {
|
|
@@ -1862,7 +1866,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1862
1866
|
]
|
|
1863
1867
|
})] })
|
|
1864
1868
|
});
|
|
1865
|
-
},
|
|
1869
|
+
}, Rt = ({ isOpen: e, onClose: t, stripePromise: n, clientSecret: r, onComplete: i }) => !n || !r ? null : /* @__PURE__ */ v(T.Root, {
|
|
1866
1870
|
open: e,
|
|
1867
1871
|
onOpenChange: (e) => {
|
|
1868
1872
|
e || t();
|
|
@@ -1884,14 +1888,14 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
1884
1888
|
})
|
|
1885
1889
|
})]
|
|
1886
1890
|
})] })
|
|
1887
|
-
}),
|
|
1891
|
+
}), zt = ({ tickets: e, selectedTicket: t, onSelectTicket: n, discount: r, couponCode: i, publicCouponsCount: a, onApplyCouponClick: o, onRemoveCoupon: s, onNext: c }) => {
|
|
1888
1892
|
let l = Nt(t), u = Mt(r);
|
|
1889
1893
|
return /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("div", {
|
|
1890
1894
|
className: "flex max-h-[64dvh] w-full flex-col justify-between gap-6 overflow-y-auto md:max-h-[unset] md:flex-row",
|
|
1891
1895
|
children: [/* @__PURE__ */ v("div", {
|
|
1892
1896
|
className: "flex w-full flex-col gap-3 md:w-[55%]",
|
|
1893
1897
|
children: e.map((e) => /* @__PURE__ */ v("div", {
|
|
1894
|
-
className:
|
|
1898
|
+
className: Ot("flex cursor-pointer items-center justify-between rounded-md border border-gray-300 px-3 py-2 transition duration-300 hover:bg-gray-50", e._id === t?._id ? "border-brand bg-brand/10 hover:bg-brand/20" : ""),
|
|
1895
1899
|
onClick: () => n(e),
|
|
1896
1900
|
children: /* @__PURE__ */ y("div", { children: [
|
|
1897
1901
|
/* @__PURE__ */ v("p", {
|
|
@@ -2164,7 +2168,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2164
2168
|
})]
|
|
2165
2169
|
})
|
|
2166
2170
|
}) : /* @__PURE__ */ y("div", {
|
|
2167
|
-
className:
|
|
2171
|
+
className: Ot("flex cursor-pointer items-center justify-between border-b border-b-gray-300 pr-1 pl-4 transition-all duration-200 hover:bg-gray-50", t ? "h-[50px] py-3" : "py-3"),
|
|
2168
2172
|
onClick: () => t ? o() : null,
|
|
2169
2173
|
children: [/* @__PURE__ */ y("span", {
|
|
2170
2174
|
className: "flex items-center gap-2",
|
|
@@ -2183,7 +2187,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2183
2187
|
children: "Continue for Payment"
|
|
2184
2188
|
})
|
|
2185
2189
|
})] });
|
|
2186
|
-
},
|
|
2190
|
+
}, Bt = () => {
|
|
2187
2191
|
let [e, t] = g(null), [n, r] = g(null), [i, a] = g(!1), [o, s] = g(null);
|
|
2188
2192
|
return {
|
|
2189
2193
|
stripePromise: e,
|
|
@@ -2207,7 +2211,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2207
2211
|
s(() => e);
|
|
2208
2212
|
}, [])
|
|
2209
2213
|
};
|
|
2210
|
-
},
|
|
2214
|
+
}, Vt = {
|
|
2211
2215
|
name: "",
|
|
2212
2216
|
email: "",
|
|
2213
2217
|
is_business_purchase: !1,
|
|
@@ -2223,29 +2227,29 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2223
2227
|
country: ""
|
|
2224
2228
|
}
|
|
2225
2229
|
}
|
|
2226
|
-
},
|
|
2230
|
+
}, Ht = (e, t, n) => {
|
|
2227
2231
|
let r = t.split("."), i = structuredClone(e), a = i, o = r.length - 1;
|
|
2228
2232
|
return r.forEach((e, t) => {
|
|
2229
2233
|
t === o ? a[e] = n : a = a[e];
|
|
2230
2234
|
}), i;
|
|
2231
|
-
},
|
|
2235
|
+
}, Ut = async (e, t) => {
|
|
2232
2236
|
try {
|
|
2233
2237
|
let n = new URLSearchParams();
|
|
2234
2238
|
return n.append("query", JSON.stringify({ where: { status: "active" } })), (await e.fetch?.url(`/v1/event/event/${t}/ticket/query?${n.toString()}`).get().json())?.content?.data;
|
|
2235
2239
|
} catch (t) {
|
|
2236
2240
|
e.logger?.error("Failed to fetch event tickets", { exception: x(t) });
|
|
2237
2241
|
}
|
|
2238
|
-
},
|
|
2239
|
-
let a = n(), [o, s] = g([]), [c, l] = g(!0), [d, p] = g(!1), [m, b] = g(!1), [S, C] = g(null), [w, E] = g(void 0), [D, O] = g(""), [k, A] = g(null), [ee, j] = g(!1), [re, M] = g(null), [N, P] = g(!1), [ie, F] = g(1), [I, L] = g(null), [ae, oe] = g([]), [se, R] = g(
|
|
2242
|
+
}, Wt = ({ eventID: e, title: t, external: r, buttonText: i = "Register Now" }) => {
|
|
2243
|
+
let a = n(), [o, s] = g([]), [c, l] = g(!0), [d, p] = g(!1), [m, b] = g(!1), [S, C] = g(null), [w, E] = g(void 0), [D, O] = g(""), [k, A] = g(null), [ee, j] = g(!1), [re, M] = g(null), [N, P] = g(!1), [ie, F] = g(1), [I, L] = g(null), [ae, oe] = g([]), [se, R] = g(Vt), z = Pt(S, k) === 0, B = h(null), ce = () => R(Vt), V = () => {
|
|
2240
2244
|
A(null), E(void 0), M(null), j(!1), O(""), L(null), p(!1), F(1), ce();
|
|
2241
|
-
}, { Razorpay:
|
|
2242
|
-
let e =
|
|
2245
|
+
}, { Razorpay: H } = ne(), { stripePromise: U, config: W, isOpen: G, openStripeCheckout: le, closeStripeCheckout: K, setOnComplete: ue } = Bt(), de = () => {
|
|
2246
|
+
let e = B.current;
|
|
2243
2247
|
!e || !a || a.fetch?.url(`/v1/event/booking/${e.bookingId}/confirm-booking`)?.post({ session_id: e.sessionId })?.json().then((e) => {
|
|
2244
|
-
e?.content?.data && E(e?.content?.data),
|
|
2248
|
+
e?.content?.data && E(e?.content?.data), K(), B.current = null;
|
|
2245
2249
|
}).catch((e) => {
|
|
2246
|
-
a.logger?.error("Failed to confirm booking after Stripe payment", { exception: x(e) }),
|
|
2250
|
+
a.logger?.error("Failed to confirm booking after Stripe payment", { exception: x(e) }), K(), B.current = null;
|
|
2247
2251
|
});
|
|
2248
|
-
},
|
|
2252
|
+
}, fe = async () => {
|
|
2249
2253
|
if (!a) return;
|
|
2250
2254
|
b(!0), L(null);
|
|
2251
2255
|
let { name: t, email: n, is_business_purchase: r, billing_details: i } = se;
|
|
@@ -2260,25 +2264,25 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2260
2264
|
details: {}
|
|
2261
2265
|
}]
|
|
2262
2266
|
};
|
|
2263
|
-
r && (o.is_business_purchase = !0, o.billing_details = i);
|
|
2267
|
+
r && !z && (o.is_business_purchase = !0, o.billing_details = i);
|
|
2264
2268
|
let s = await a.fetch?.url(`/v1/event/event/${e}/booking/create-new-booking`)?.post(o).json();
|
|
2265
2269
|
if (!s?.status) L("Booking failed. Please try again.");
|
|
2266
2270
|
else {
|
|
2267
|
-
|
|
2271
|
+
V();
|
|
2268
2272
|
let e = s?.content?.meta;
|
|
2269
2273
|
if (e?.key) {
|
|
2270
2274
|
let t = s?.content.data?._id;
|
|
2271
|
-
e.provider === "stripe" && e.client_secret ? (
|
|
2275
|
+
e.provider === "stripe" && e.client_secret ? (B.current = t && e.session_id ? {
|
|
2272
2276
|
bookingId: t,
|
|
2273
2277
|
sessionId: e.session_id
|
|
2274
|
-
} : null, de
|
|
2278
|
+
} : null, ue(de), await le({
|
|
2275
2279
|
key: e.key,
|
|
2276
2280
|
client_secret: e.client_secret,
|
|
2277
2281
|
amount: s?.content.data?.unit_amount || 0,
|
|
2278
2282
|
currency: e.currency || "USD",
|
|
2279
2283
|
provider: "stripe",
|
|
2280
2284
|
reference_id: e.reference_id || ""
|
|
2281
|
-
})) :
|
|
2285
|
+
})) : pe({
|
|
2282
2286
|
key: e.key,
|
|
2283
2287
|
amount: s?.content.data?.unit_amount,
|
|
2284
2288
|
currency: e.currency || "INR",
|
|
@@ -2291,9 +2295,9 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2291
2295
|
L(x(e).message || "Something went wrong. Please try again.");
|
|
2292
2296
|
}
|
|
2293
2297
|
b(!1);
|
|
2294
|
-
},
|
|
2298
|
+
}, pe = async (e) => {
|
|
2295
2299
|
if (!a) return;
|
|
2296
|
-
let n = new
|
|
2300
|
+
let n = new H({
|
|
2297
2301
|
key: e.key,
|
|
2298
2302
|
amount: e.amount ?? 0,
|
|
2299
2303
|
currency: e.currency,
|
|
@@ -2321,7 +2325,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2321
2325
|
n.on("payment.failed", (e) => {
|
|
2322
2326
|
a.logger?.error("Razorpay payment failed", { exception: x(e.error) });
|
|
2323
2327
|
}), n.open();
|
|
2324
|
-
},
|
|
2328
|
+
}, me = u(async () => {
|
|
2325
2329
|
if (a) try {
|
|
2326
2330
|
let t = await a.fetch?.url(`/v1/event/event/${e}/coupon/list-public-coupons`)?.get().json();
|
|
2327
2331
|
t?.status && t?.content?.data && oe(t.content.data);
|
|
@@ -2354,16 +2358,16 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2354
2358
|
M(null), j(!1), O(""), P(!1);
|
|
2355
2359
|
}, ye = (e) => {
|
|
2356
2360
|
let { name: t, value: n, type: r, checked: i } = e.target;
|
|
2357
|
-
R((e) =>
|
|
2361
|
+
R((e) => Ht(e, t, r === "checkbox" ? i : n));
|
|
2358
2362
|
}, be = () => {}, xe = (e) => {
|
|
2359
|
-
e?.preventDefault(),
|
|
2363
|
+
e?.preventDefault(), fe();
|
|
2360
2364
|
};
|
|
2361
2365
|
if (f(() => {
|
|
2362
2366
|
if (r) {
|
|
2363
2367
|
l(!1);
|
|
2364
2368
|
return;
|
|
2365
2369
|
}
|
|
2366
|
-
e && a && (l(!0),
|
|
2370
|
+
e && a && (l(!0), Ut(a, e).then((e) => {
|
|
2367
2371
|
s(e ?? []), e && e.length > 0 && C(e[0] || null), l(!1);
|
|
2368
2372
|
}));
|
|
2369
2373
|
}, [
|
|
@@ -2373,11 +2377,11 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2373
2377
|
]), f(() => {
|
|
2374
2378
|
S?.unit_amount === 0 && o?.length === 1 && F(2);
|
|
2375
2379
|
}, [S, o]), f(() => {
|
|
2376
|
-
d && e &&
|
|
2380
|
+
d && e && me();
|
|
2377
2381
|
}, [
|
|
2378
2382
|
d,
|
|
2379
2383
|
e,
|
|
2380
|
-
|
|
2384
|
+
me
|
|
2381
2385
|
]), r) return /* @__PURE__ */ v("div", {
|
|
2382
2386
|
className: "my-2",
|
|
2383
2387
|
children: /* @__PURE__ */ v(Z, {
|
|
@@ -2393,7 +2397,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2393
2397
|
children: "Loading..."
|
|
2394
2398
|
})
|
|
2395
2399
|
});
|
|
2396
|
-
let Se =
|
|
2400
|
+
let Se = z ? "Complete Registration" : "Pay";
|
|
2397
2401
|
return /* @__PURE__ */ y(_, { children: [
|
|
2398
2402
|
/* @__PURE__ */ v("div", {
|
|
2399
2403
|
className: "my-2",
|
|
@@ -2409,10 +2413,10 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2409
2413
|
/* @__PURE__ */ v(T.Root, {
|
|
2410
2414
|
open: d,
|
|
2411
2415
|
onOpenChange: (e) => {
|
|
2412
|
-
e ||
|
|
2416
|
+
e || V();
|
|
2413
2417
|
},
|
|
2414
2418
|
children: /* @__PURE__ */ y(T.Portal, { children: [/* @__PURE__ */ v(T.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ y(T.Popup, {
|
|
2415
|
-
className:
|
|
2419
|
+
className: Ot("fixed top-24 left-1/2 z-[100] flex max-h-[calc(100dvh-12rem)] w-[90%] -translate-x-1/2 flex-col overflow-y-auto rounded-lg bg-white p-4", N ? "md:w-[30%]" : "md:w-[40%]"),
|
|
2416
2420
|
children: [/* @__PURE__ */ y("div", {
|
|
2417
2421
|
className: `mb-4 flex w-full items-start justify-between ${N ? "" : "pb-[6px]"} `,
|
|
2418
2422
|
children: [/* @__PURE__ */ y(T.Title, {
|
|
@@ -2429,7 +2433,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2429
2433
|
}), /* @__PURE__ */ y("div", { children: [I && /* @__PURE__ */ v("div", {
|
|
2430
2434
|
className: "mb-4 rounded-md bg-red-50 p-3 text-red-600 text-sm",
|
|
2431
2435
|
children: I
|
|
2432
|
-
}), ie === 1 ? /* @__PURE__ */ v("div", { children: N ? /* @__PURE__ */ v(
|
|
2436
|
+
}), ie === 1 ? /* @__PURE__ */ v("div", { children: N ? /* @__PURE__ */ v(Ft, {
|
|
2433
2437
|
couponCode: D,
|
|
2434
2438
|
onCouponCodeChange: O,
|
|
2435
2439
|
couponError: re,
|
|
@@ -2438,7 +2442,7 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2438
2442
|
publicCoupons: ae,
|
|
2439
2443
|
onBack: ve,
|
|
2440
2444
|
selectedTicket: S
|
|
2441
|
-
}) : /* @__PURE__ */ v(
|
|
2445
|
+
}) : /* @__PURE__ */ v(zt, {
|
|
2442
2446
|
tickets: o,
|
|
2443
2447
|
selectedTicket: S,
|
|
2444
2448
|
onSelectTicket: ge,
|
|
@@ -2455,24 +2459,25 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2455
2459
|
handleSubmit: xe,
|
|
2456
2460
|
registerLoading: m,
|
|
2457
2461
|
onBack: () => F(1),
|
|
2458
|
-
submitLabel: Se
|
|
2462
|
+
submitLabel: Se,
|
|
2463
|
+
showBusinessBilling: !z
|
|
2459
2464
|
})] })]
|
|
2460
2465
|
})] })
|
|
2461
2466
|
}),
|
|
2462
|
-
w && /* @__PURE__ */ v(
|
|
2467
|
+
w && /* @__PURE__ */ v(Lt, {
|
|
2463
2468
|
paymentData: w,
|
|
2464
2469
|
ticketData: o,
|
|
2465
2470
|
type: "confirm"
|
|
2466
2471
|
}),
|
|
2467
|
-
|
|
2468
|
-
isOpen:
|
|
2469
|
-
onClose:
|
|
2470
|
-
stripePromise:
|
|
2471
|
-
clientSecret:
|
|
2472
|
-
onComplete:
|
|
2472
|
+
G && W && /* @__PURE__ */ v(Rt, {
|
|
2473
|
+
isOpen: G,
|
|
2474
|
+
onClose: K,
|
|
2475
|
+
stripePromise: U,
|
|
2476
|
+
clientSecret: W.clientSecret,
|
|
2477
|
+
onComplete: de
|
|
2473
2478
|
})
|
|
2474
2479
|
] });
|
|
2475
|
-
},
|
|
2480
|
+
}, Gt = (e) => typeof e == "string" && e.trim() ? e : void 0, Kt = (e) => typeof e == "string" ? e : e?.location ?? void 0, qt = (e, t) => {
|
|
2476
2481
|
let n = e.meta ?? {}, r = e.title && t ? `${e.title} | ${t}` : e.title || t || void 0;
|
|
2477
2482
|
return {
|
|
2478
2483
|
title: n.meta_title || r,
|
|
@@ -2482,33 +2487,33 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2482
2487
|
og: {
|
|
2483
2488
|
title: n.og_title || void 0,
|
|
2484
2489
|
description: n.og_description || void 0,
|
|
2485
|
-
image:
|
|
2490
|
+
image: Kt(n.og_image),
|
|
2486
2491
|
url: n.og_url || void 0
|
|
2487
2492
|
},
|
|
2488
2493
|
twitter: { card: n.twitter_card || void 0 },
|
|
2489
2494
|
ldJson: n.ld_json || void 0,
|
|
2490
2495
|
customHead: n.head_code || void 0
|
|
2491
2496
|
};
|
|
2492
|
-
},
|
|
2497
|
+
}, Jt = (e) => ({
|
|
2493
2498
|
description: e.description || void 0,
|
|
2494
2499
|
icon: e.icon?.location || void 0,
|
|
2495
2500
|
customHead: e.settings?.head_code || void 0
|
|
2496
|
-
}),
|
|
2497
|
-
let i =
|
|
2501
|
+
}), Yt = (e) => (t = {}, n) => (r) => {
|
|
2502
|
+
let i = qt(t, e.name);
|
|
2498
2503
|
if (n) {
|
|
2499
2504
|
let t = r?.loaderData?.[n.source];
|
|
2500
2505
|
if (t) {
|
|
2501
|
-
let r = n.title ?
|
|
2506
|
+
let r = n.title ? Gt(t[n.title]) : void 0;
|
|
2502
2507
|
r && (i.title = e.name ? `${r} | ${e.name}` : r, i.og = {
|
|
2503
2508
|
...i.og,
|
|
2504
2509
|
title: r
|
|
2505
2510
|
});
|
|
2506
|
-
let a = n.description ?
|
|
2511
|
+
let a = n.description ? Gt(t[n.description]) : void 0;
|
|
2507
2512
|
a && (i.description = a, i.og = {
|
|
2508
2513
|
...i.og,
|
|
2509
2514
|
description: a
|
|
2510
2515
|
});
|
|
2511
|
-
let o = n.image ?
|
|
2516
|
+
let o = n.image ? Kt(t[n.image]) : void 0;
|
|
2512
2517
|
o && (i.og = {
|
|
2513
2518
|
...i.og,
|
|
2514
2519
|
image: o
|
|
@@ -2519,14 +2524,14 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2519
2524
|
let t = r?.match?.pathname, n = (e.domain || "").trim();
|
|
2520
2525
|
n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") + t);
|
|
2521
2526
|
}
|
|
2522
|
-
let a =
|
|
2527
|
+
let a = Et(i, Jt(e)), o = t.id?.trim();
|
|
2523
2528
|
return o && a.meta.push({
|
|
2524
|
-
name:
|
|
2529
|
+
name: gt,
|
|
2525
2530
|
content: o
|
|
2526
2531
|
}), a;
|
|
2527
|
-
},
|
|
2532
|
+
}, Xt = (e) => {
|
|
2528
2533
|
let t = I(e);
|
|
2529
|
-
return (e) => ({ context: n, params: r }) =>
|
|
2534
|
+
return (e) => ({ context: n, params: r }) => pe({
|
|
2530
2535
|
queryClient: n.queryClient,
|
|
2531
2536
|
config: t,
|
|
2532
2537
|
sources: e,
|
|
@@ -2534,4 +2539,4 @@ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
|
|
|
2534
2539
|
});
|
|
2535
2540
|
};
|
|
2536
2541
|
//#endregion
|
|
2537
|
-
export {
|
|
2542
|
+
export { ce as ColorModeProvider, mt as Inspector, ie as LevoChat, Wt as LevoEventRegister, he as LevoForm, yt as LevoPopups, St as LevoSiteProvider, gt as PAGE_ID_META, Dt as PageHead, Yt as createLevoHead, Xt as createLevoLoader, F as createSiteClient, Et as pageHead, Tt as parseRawHead, pe as prefetchLevoSources, _t as readPageId, I as siteConfigFromJson, V as useColorMode, fe as useLevoForm, xt as useLevoInsights, de as useLevoRecord, bt as useLevoSite, ue as useLevoSource };
|