@levo-so/site-runtime 0.3.0 → 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.
Files changed (33) hide show
  1. package/{DateTimeWidget-C1jHOtz7.js → DateTimeWidget-Cctsvcrs.js} +2 -2
  2. package/Dialog-DVB4WpBS.js +130 -0
  3. package/{KBChatWidget-D7F9LRwI.js → KBChatWidget-Cnq0DCOQ.js} +383 -435
  4. package/LevoProvider-nmIbMlsk.js +20 -0
  5. package/{PhoneWidget-_nw97rkI.js → PhoneWidget-J3VTMWJH.js} +2 -2
  6. package/{PopupRenderer-Bncp54gB-DuCULkBK.js → PopupBody-DZVwDLkg-yrot8Uqb.js} +201 -910
  7. package/PopupRenderer-BjW1jg70-Biwj2bIc.js +387 -0
  8. package/{RichTextWidget-D-mGlES0.js → RichTextWidget-BOrVIR2j.js} +10 -9
  9. package/{VerifyButton-BkP98H17.js → VerifyButton-CA1GtEZJ.js} +20 -19
  10. package/{theme.cssm-2YTdd8Yh.js → createThemeExtension-DhGk81nV.js} +2 -2
  11. package/{dist-DBbiX2ST.js → dist-C8gLeklT.js} +601 -598
  12. package/{dist-CJknSbJK.js → dist-Cb6sb7nO.js} +21 -22
  13. package/{inlineCollectionTheme-D2w17LHX.js → generateRadiusScale-54mE9ikx.js} +4 -19
  14. package/index.d.ts +42 -3
  15. package/index.js +724 -694
  16. package/{inlineBaseTheme-DS-AfUHi.js → inlineBaseTheme-B6E9zzyp.js} +2 -2
  17. package/inlineCollectionTheme-DYYMrmcE.js +19 -0
  18. package/{kbChat-AUJxjURc.js → kbChat-DIb4AS7E.js} +31 -26
  19. package/{nodeAlignment-Cn6xNtOP.js → nodeAlignment-D70kOcui.js} +13 -13
  20. package/package.json +9 -9
  21. package/pillChrome-BAu5AfCT.js +30 -0
  22. package/popupState-JmpeKzgM-qhNTV79U.js +229 -0
  23. package/popups.js +1 -1
  24. package/react-6kO0cqgr.js +74 -0
  25. package/rteTheme.cssm-xg0gJ28J.js +4 -0
  26. package/styles.css +1 -1
  27. package/theme.cssm-mkQwezuj.js +4 -0
  28. package/usePopupRedirect-BThP_YPW-DoixMAB9.js +80 -0
  29. package/Dialog-CzVhHLEY.js +0 -145
  30. package/pillChrome-AhXOWXIb.js +0 -20
  31. /package/{CollectionField-CzS-34zx.js → CollectionField-C59pmeQw.js} +0 -0
  32. /package/{Popover-q5dL7y0W.js → Popover-C7zZHBIc.js} +0 -0
  33. /package/{es-iCqKQf1c.js → es-CztjLuNy.js} +0 -0
package/index.js CHANGED
@@ -1,126 +1,127 @@
1
1
  "use client";
2
- import { f as e, m as t, p as n } from "./Dialog-CzVhHLEY.js";
3
- import { n as r } from "./dist-DBbiX2ST.js";
4
- import { t as i } from "./inlineCollectionTheme-D2w17LHX.js";
5
- import { t as a } from "./inlineBaseTheme-DS-AfUHi.js";
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
- import { Suspense as s, createContext as c, lazy as l, useCallback as u, useContext as d, useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
8
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
9
- import { createLevoClient as y, getLevoError as b } from "@levo-so/core";
10
- import { ScriptOnce as ee } from "@tanstack/react-router";
11
- import { useQuery as x } from "@tanstack/react-query";
12
- import { Dialog as S } from "@base-ui/react/dialog";
13
- import { createLevoInsights as C } from "@levo-so/insights";
14
- import { CheckIcon as w, ChevronLeftIcon as T, ChevronRightIcon as E, LoaderCircle as D, Tag as O, X as k, XIcon as te } from "lucide-react";
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
+ import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
9
+ import { createLevoClient as b, getLevoError as x } from "@levo-so/core";
10
+ import { ScriptOnce as S, useRouterState as C } from "@tanstack/react-router";
11
+ import { useQuery as w } from "@tanstack/react-query";
12
+ import { Dialog as T } from "@base-ui/react/dialog";
13
+ import { createLevoInsights as E } from "@levo-so/insights";
14
+ import { CheckIcon as D, ChevronLeftIcon as O, ChevronRightIcon as k, LoaderCircle as A, Tag as ee, X as j, XIcon as te } from "lucide-react";
15
15
  import { useRazorpay as ne } from "react-razorpay";
16
- import { EmbeddedCheckout as re, EmbeddedCheckoutProvider as A } from "@stripe/react-stripe-js";
16
+ import { EmbeddedCheckout as re, EmbeddedCheckoutProvider as M } from "@stripe/react-stripe-js";
17
17
  //#region src/hooks/useMounted.ts
18
- function j() {
19
- let [e, t] = h(!1);
18
+ function N() {
19
+ let [e, t] = g(!1);
20
20
  return f(() => t(!0), []), e;
21
21
  }
22
22
  //#endregion
23
23
  //#region src/chat/LevoChat.tsx
24
- var M = l(() => import("./kbChat-AUJxjURc.js")), N = ({ site: e }) => {
25
- let t = j(), n = e.workspace_id || void 0;
26
- return !t || !n ? null : /* @__PURE__ */ _(s, {
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
- children: /* @__PURE__ */ _(M, {
29
- workspaceId: n,
28
+ children: /* @__PURE__ */ v(P, {
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
- }, P = (e) => {
38
+ }, F = (e) => {
38
39
  let t = (e?.apiUrl || "").replace(/\/$/, "");
39
- return t ? y({
40
+ return t ? b({
40
41
  apiUrl: t,
41
42
  workspace: e?.workspace ? e.workspace : null,
42
43
  appName: "studio-site",
43
44
  NODE_ENV: "",
44
45
  APP_MODE: e?.appMode || "production"
45
46
  }) : null;
46
- }, F = (e) => ({
47
+ }, I = (e) => ({
47
48
  apiUrl: e.levo?.api_url || "",
48
49
  workspace: e.workspace_id || "",
49
50
  siteId: e.id || "",
50
51
  insightsUrl: e.levo?.insights_url || null,
51
52
  appMode: e.levo?.app_mode || "production"
52
- }), I = "(prefers-color-scheme: dark)", L = (e) => {
53
+ }), L = "(prefers-color-scheme: dark)", ae = (e) => {
53
54
  try {
54
55
  let t = localStorage.getItem(e);
55
56
  return t === "light" || t === "dark" || t === "system" ? t : null;
56
57
  } catch {
57
58
  return null;
58
59
  }
59
- }, R = (e, t) => {
60
+ }, oe = (e, t) => {
60
61
  try {
61
62
  localStorage.setItem(e, t);
62
63
  } catch {}
63
64
  };
64
- function ie(e, t) {
65
- return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${I}').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){}})();`;
65
+ function se(e, t) {
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
- var ae = c(void 0), oe = (e) => e === "system" ? window.matchMedia(I).matches ? "dark" : "light" : e;
68
- function z(e) {
68
+ var R = c(void 0), z = (e) => e === "system" ? window.matchMedia(L).matches ? "dark" : "light" : e;
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 B = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode" }) => {
73
- let [r, i] = h(t), [a, o] = h(t === "dark" ? "dark" : "light"), s = j();
73
+ var ce = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode" }) => {
74
+ let [r, i] = g(t), [a, o] = g(t === "dark" ? "dark" : "light"), s = N();
74
75
  return f(() => {
75
- i(L(n) ?? t);
76
+ i(ae(n) ?? t);
76
77
  }, [t, n]), f(() => {
77
78
  if (!s) return;
78
- let e = oe(r);
79
- z(e), o(e);
79
+ let e = z(r);
80
+ B(e), o(e);
80
81
  }, [r, s]), f(() => {
81
82
  if (!s || r !== "system") return;
82
- let e = window.matchMedia(I), t = () => {
83
+ let e = window.matchMedia(L), t = () => {
83
84
  let t = e.matches ? "dark" : "light";
84
- z(t), o(t);
85
+ B(t), o(t);
85
86
  };
86
87
  return e.addEventListener("change", t), () => e.removeEventListener("change", t);
87
- }, [r, s]), /* @__PURE__ */ v(ae.Provider, {
88
+ }, [r, s]), /* @__PURE__ */ y(R.Provider, {
88
89
  value: {
89
90
  mode: r,
90
91
  resolvedMode: a,
91
92
  setMode: (e) => {
92
- R(n, e), i(e);
93
+ oe(n, e), i(e);
93
94
  }
94
95
  },
95
- children: [/* @__PURE__ */ _(ee, { children: ie(n, t) }), e]
96
+ children: [/* @__PURE__ */ v(S, { children: se(n, t) }), e]
96
97
  });
97
98
  };
98
- function se() {
99
- let e = d(ae);
99
+ function V() {
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 V = (e) => [
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
- ], ce = (e, t) => [
113
+ ], U = (e, t) => [
113
114
  "levo-source",
114
115
  "record",
115
116
  e.module,
116
117
  e.identifier,
117
118
  t ?? null
118
- ], H = (e) => [
119
+ ], W = (e) => [
119
120
  "levo-source",
120
121
  "form",
121
122
  e.module,
122
123
  e.identifier
123
- ], U = async (e, t) => {
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,76 +130,76 @@ var V = (e) => [
129
130
  data: n.content.data ?? [],
130
131
  meta: n.content.meta ?? null
131
132
  };
132
- }, W = async (e, t, n) => (t.module === "collection" ? await e.collection.getCollectionContent({
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, G = async (e, t) => (await e.collection.getCollectionByIDExpanded(t.identifier)).content.data ?? null, K = (e) => {
136
- let t = n(), r = x({
137
- queryKey: V(e),
138
- queryFn: () => U(t, e),
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) => {
137
+ let t = n(), r = w({
138
+ queryKey: H(e),
139
+ queryFn: () => G(t, e),
139
140
  enabled: !!t
140
141
  });
141
142
  return {
142
143
  data: r.data?.data ?? null,
143
144
  meta: r.data?.meta ?? null,
144
145
  isLoading: r.isLoading,
145
- error: r.error ? b(r.error).message : null,
146
+ error: r.error ? x(r.error).message : null,
146
147
  bind: { "data-levo-source": JSON.stringify({
147
148
  mode: "list",
148
149
  ...e
149
150
  }) }
150
151
  };
151
- }, le = (e, t) => {
152
- let r = n(), i = x({
153
- queryKey: ce(e, t),
154
- queryFn: () => W(r, e, t),
152
+ }, de = (e, t) => {
153
+ let r = n(), i = w({
154
+ queryKey: U(e, t),
155
+ queryFn: () => le(r, e, t),
155
156
  enabled: !!r && !!t
156
157
  });
157
158
  return {
158
159
  data: i.data ?? null,
159
160
  isLoading: i.isLoading,
160
- error: i.error ? b(i.error).message : null,
161
+ error: i.error ? x(i.error).message : null,
161
162
  bind: { "data-levo-source": JSON.stringify({
162
163
  mode: "record",
163
164
  ...e
164
165
  }) }
165
166
  };
166
- }, q = (e) => {
167
- let t = n(), r = x({
168
- queryKey: H(e),
169
- queryFn: () => G(t, e),
167
+ }, fe = (e) => {
168
+ let t = n(), r = w({
169
+ queryKey: W(e),
170
+ queryFn: () => K(t, e),
170
171
  enabled: !!t
171
172
  });
172
173
  return {
173
174
  schema: r.data ?? null,
174
175
  isLoading: r.isLoading,
175
- error: r.error ? b(r.error).message : null,
176
+ error: r.error ? x(r.error).message : null,
176
177
  bind: { "data-levo-source": JSON.stringify({
177
178
  mode: "form",
178
179
  ...e
179
180
  }) }
180
181
  };
181
- }, ue = async ({ queryClient: e, config: t, sources: n, params: r }) => {
182
- let i = P(t);
182
+ }, pe = async ({ queryClient: e, config: t, sources: n, params: r }) => {
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: ce(n, a),
189
- queryFn: () => W(i, n, a)
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({
194
+ queryKey: W(n),
195
+ queryFn: () => K(i, n)
196
+ }).catch(() => null)] : [t, await e.ensureQueryData({
193
197
  queryKey: H(n),
194
198
  queryFn: () => G(i, n)
195
- }).catch(() => null)] : [t, await e.ensureQueryData({
196
- queryKey: V(n),
197
- queryFn: () => U(i, n)
198
199
  }).catch(() => null)];
199
200
  }));
200
201
  return Object.fromEntries(a);
201
- }, de = {
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 V = (e) => [
220
221
  input: "var(--color-background1)",
221
222
  inputForeground: "var(--color-ink)",
222
223
  ring: "var(--color-brand)"
223
- }, fe = ({ source: e, submitLabel: t = "Submit", hiddenFields: o, formVariant: s = "default", successConfig: c, theme: l, className: u }) => {
224
- let d = n(), { schema: f, isLoading: m, bind: h } = q(e), g = p(() => ({
225
- ...a({
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
- ...de,
228
+ ...me,
228
229
  ...l?.colors
229
230
  },
230
231
  radius: l?.radius ?? "var(--radius-token)",
@@ -233,14 +234,14 @@ var V = (e) => [
233
234
  heading: "var(--font-heading)"
234
235
  }
235
236
  }),
236
- ...l?.gap ? i({ form: { gap: l.gap } }) : {}
237
+ ...l?.gap ? a({ form: { gap: l.gap } }) : {}
237
238
  }), [l]);
238
- return d ? /* @__PURE__ */ _("div", {
239
+ return d ? /* @__PURE__ */ v("div", {
239
240
  ...h,
240
241
  className: u,
241
- children: /* @__PURE__ */ _(r, {
242
+ children: /* @__PURE__ */ v(r, {
242
243
  fetchedSchema: f,
243
- isLoading: m,
244
+ isLoading: p,
244
245
  submitButtonConfig: {
245
246
  show: !0,
246
247
  text: t
@@ -255,24 +256,28 @@ var V = (e) => [
255
256
  successConfig: c
256
257
  })
257
258
  }) : null;
258
- }, pe = 1400, me = 12 * 1024 * 1024, he = new Set(["transparent", "rgba(0, 0, 0, 0)"]), ge = (e) => {
259
+ }, ge = 1400, _e = 12 * 1024 * 1024, ve = new Set(["transparent", "rgba(0, 0, 0, 0)"]), ye = {
260
+ imagePlaceholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
261
+ onImageErrorHandler: () => void 0
262
+ }, be = (e) => {
259
263
  let t = getComputedStyle(e);
260
- return !he.has(t.backgroundColor) || t.backgroundImage !== "none";
261
- }, _e = (e) => {
264
+ return !ve.has(t.backgroundColor) || t.backgroundImage !== "none";
265
+ }, xe = (e) => {
262
266
  for (let t = e; t; t = t.parentElement) {
263
267
  let e = getComputedStyle(t).backgroundColor;
264
- if (!he.has(e)) return e;
268
+ if (!ve.has(e)) return e;
265
269
  }
266
270
  return "#ffffff";
267
- }, ve = async (e, t) => {
268
- let { toPng: n } = await import("./es-iCqKQf1c.js"), r = e.getBoundingClientRect(), i = Math.max(r.width, r.height, 1), a = await n(e, {
269
- pixelRatio: Math.min(2, Math.max(.4, pe / i)),
270
- backgroundColor: _e(e),
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,
274
+ pixelRatio: a,
275
+ backgroundColor: xe(e),
271
276
  filter: (e) => !t.includes(e)
272
277
  });
273
- if (a.length > me) throw Error("capture too large");
274
- return a;
275
- }, ye = 4, be = 4e3, xe = (e, t) => {
278
+ if (o.length > _e) throw Error("capture too large");
279
+ return o;
280
+ }, Ce = 4, we = 4e3, Te = (e, t) => {
276
281
  let n = document.elementFromPoint(e.x + e.width / 2, e.y + e.height / 2);
277
282
  for (; n && t.includes(n);) n = n.parentElement;
278
283
  let r = document.body;
@@ -283,8 +288,8 @@ var V = (e) => [
283
288
  break;
284
289
  }
285
290
  }
286
- let i = window.innerWidth * window.innerHeight * ye || 2 ** 53 - 1, a = r;
287
- for (; !ge(a);) {
291
+ let i = window.innerWidth * window.innerHeight * Ce || 2 ** 53 - 1, a = r;
292
+ for (; !be(a);) {
288
293
  let e = a.parentElement;
289
294
  if (!e || e === document.documentElement) break;
290
295
  let t = e.getBoundingClientRect();
@@ -292,12 +297,13 @@ var V = (e) => [
292
297
  a = e;
293
298
  }
294
299
  return a;
295
- }, Se = async (e, t) => {
296
- let { toCanvas: n } = await import("./es-iCqKQf1c.js"), r = xe(e, t), i = r.getBoundingClientRect(), a = Math.max(e.width, e.height, 1), o = Math.min(2, Math.max(.4, pe / a)), s = Math.max(i.width, i.height, 1);
297
- o = Math.min(o, be / s);
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);
298
303
  let c = await n(r, {
304
+ ...ye,
299
305
  pixelRatio: o,
300
- backgroundColor: _e(r),
306
+ backgroundColor: xe(r),
301
307
  filter: (e) => !t.includes(e)
302
308
  }), l = document.createElement("canvas");
303
309
  l.width = Math.max(1, Math.round(e.width * o)), l.height = Math.max(1, Math.round(e.height * o));
@@ -305,39 +311,39 @@ var V = (e) => [
305
311
  if (!u) throw Error("no 2d context");
306
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);
307
313
  let d = l.toDataURL("image/png");
308
- if (d.length > me) throw Error("capture too large");
314
+ if (d.length > _e) throw Error("capture too large");
309
315
  return d;
310
- }, J = {
316
+ }, q = {
311
317
  ring: 99997,
312
318
  overlay: 99998,
313
319
  label: 99999
314
- }, Y = {
320
+ }, J = {
315
321
  hover: "#3b82f6",
316
322
  hoverBg: "rgba(59,130,246,0.12)",
317
323
  hoverLabelBg: "#1d4ed8",
318
324
  select: "#16a34a",
319
325
  selectGlow: "rgba(22,163,74,0.18)"
320
- }, X = (e) => {
326
+ }, Y = (e) => {
321
327
  let t = e?.getAttribute("data-tsd-source");
322
328
  return t ? t.replace(/^\//, "") : null;
323
- }, Ce = (e) => Array.from(document.querySelectorAll("[data-tsd-source]")).filter((t) => X(t) === e), we = (e, t) => {
324
- let n = Ce(t).indexOf(e);
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);
325
331
  return n < 0 ? 0 : n;
326
- }, Z = (e, t = 0) => {
327
- let n = Ce(e);
332
+ }, X = (e, t = 0) => {
333
+ let n = De(e);
328
334
  return n[t] ?? n[0] ?? null;
329
- }, Te = (e, t) => {
335
+ }, ke = (e, t) => {
330
336
  let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter(Boolean);
331
337
  n.includes(t) || e.setAttribute("data-staged-key", [...n, t].join(" "));
332
- }, Ee = (e, t) => {
338
+ }, Ae = (e, t) => {
333
339
  let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter((e) => e && e !== t);
334
340
  n.length ? e.setAttribute("data-staged-key", n.join(" ")) : e.removeAttribute("data-staged-key");
335
- }, De = (e, t) => {
341
+ }, je = (e, t) => {
336
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("");
337
343
  if (!n) return "";
338
344
  let r = `[data-staged-key~="${CSS.escape(e)}"]{${n}}`, i = t.media?.replace(/[;{}]/g, "").trim();
339
345
  return i ? `@media ${i}{${r}}` : r;
340
- }, Oe = (e) => {
346
+ }, Me = (e) => {
341
347
  let t = e.tagName.toLowerCase();
342
348
  return t === "input" ? {
343
349
  checkbox: "Checkbox",
@@ -379,31 +385,31 @@ var V = (e) => [
379
385
  aside: "Sidebar",
380
386
  div: "Container"
381
387
  }[t] || `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
382
- }, ke = 36, Ae = (e) => {
383
- let t = Oe(e), n = ((e) => e.replace(/\s+/g, " ").trim())(e.getAttribute("aria-label") || e.getAttribute("alt") || e.getAttribute("title") || e.getAttribute("name") || "");
384
- return n ? `${t} · ${n.length > ke ? `${n.slice(0, ke - 1).trimEnd()}…` : n}` : t;
385
- }, je = (e) => {
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) => {
386
392
  let t = [], n = e;
387
393
  for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) t.unshift(n.tagName.toLowerCase()), n = n.parentElement;
388
394
  return t.join(" > ");
389
- }, Me = () => {
395
+ }, Ie = () => {
390
396
  let e = document.createElement("div");
391
- e.style.cssText = `position:fixed;pointer-events:none;z-index:${J.overlay};background:${Y.hoverBg};outline:2px solid ${Y.hover};border-radius:2px;display:none`;
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`;
392
398
  let t = document.createElement("div");
393
- t.style.cssText = `position:fixed;pointer-events:none;z-index:${J.label};background:${Y.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
+ 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`;
394
400
  let n = document.createElement("div");
395
- n.style.cssText = `position:fixed;pointer-events:none;z-index:${J.ring};outline:2px solid ${Y.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 4px ${Y.selectGlow};display:none`;
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`;
396
402
  let r = document.createElement("div");
397
- return r.style.cssText = `position:fixed;pointer-events:none;z-index:${J.label};background:${Y.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
+ 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`, {
398
404
  overlay: e,
399
405
  label: t,
400
406
  ring: n,
401
407
  ringLabel: r
402
408
  };
403
- }, Ne = (e, t, n) => {
409
+ }, Le = (e, t, n) => {
404
410
  let r = n.getBoundingClientRect();
405
- 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 = Ae(n), t.style.left = `${Math.max(4, r.left)}px`, t.style.top = `${r.top > 26 ? r.top - 22 : r.bottom + 4}px`;
406
- }, Pe = (e) => {
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) => {
407
413
  let t = (e instanceof Element ? e : null)?.closest("a[href]");
408
414
  if (!t || t.target === "_blank") return null;
409
415
  let n;
@@ -413,11 +419,11 @@ var V = (e) => [
413
419
  return null;
414
420
  }
415
421
  return n.protocol !== "http:" && n.protocol !== "https:" || n.origin === location.origin ? null : n.href;
416
- }, Fe = (e) => {
422
+ }, ze = (e) => {
417
423
  if (!e) return !1;
418
424
  let t = e.tagName;
419
425
  return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable === !0;
420
- }, Ie = (e) => {
426
+ }, Be = (e) => {
421
427
  if (!e.childNodes.length) return !1;
422
428
  let t = !1;
423
429
  for (let n of e.childNodes) {
@@ -425,10 +431,10 @@ var V = (e) => [
425
431
  (n.textContent ?? "").trim() && (t = !0);
426
432
  }
427
433
  return t;
428
- }, Le = 2e3, Re = (e) => {
434
+ }, Ve = 2e3, He = (e) => {
429
435
  let t = [], n = e;
430
436
  for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) {
431
- let e = X(n);
437
+ let e = Y(n);
432
438
  e && t.unshift({
433
439
  tag: n.tagName.toLowerCase(),
434
440
  text: (n.textContent || "").trim().slice(0, 60),
@@ -436,25 +442,25 @@ var V = (e) => [
436
442
  }), n = n.parentElement;
437
443
  }
438
444
  return t;
439
- }, ze = (e) => {
440
- let t = X(e), n = t ? Ce(t).length : 1, r = t ? we(e, t) : 0, i = t && Ie(e) ? (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, Le) : void 0, a = Be(e);
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);
441
447
  return {
442
448
  tag: e.tagName.toLowerCase(),
443
449
  classes: typeof e.className == "string" ? e.className.trim() : "",
444
450
  text: (e.innerText || "").trim().slice(0, 120),
445
- label: Ae(e),
446
- path: je(e),
451
+ label: Pe(e),
452
+ path: Fe(e),
447
453
  source: t,
448
454
  index: r,
449
455
  occurrences: n,
450
- ancestors: Re(e),
456
+ ancestors: He(e),
451
457
  ...i === void 0 ? {} : { fullText: i },
452
458
  ...a ? { sourceBinding: a } : {}
453
459
  };
454
- }, Be = (e) => {
460
+ }, We = (e) => {
455
461
  let t = e.closest("[data-levo-source]");
456
462
  if (!t) return;
457
- let n = t.getAttribute("data-levo-source") ?? "", r = X(t), i;
463
+ let n = t.getAttribute("data-levo-source") ?? "", r = Y(t), i;
458
464
  try {
459
465
  i = JSON.parse(n);
460
466
  } catch {
@@ -464,12 +470,12 @@ var V = (e) => [
464
470
  raw: n,
465
471
  element: {
466
472
  source: r ?? "",
467
- index: r ? we(t, r) : 0
473
+ index: r ? Oe(t, r) : 0
468
474
  },
469
475
  ...i === void 0 ? {} : { config: i }
470
476
  };
471
- }, Ve = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
472
- let t = e.getAttribute("data-levo-source") ?? "", n = X(e), r;
477
+ }, Ge = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
478
+ let t = e.getAttribute("data-levo-source") ?? "", n = Y(e), r;
473
479
  try {
474
480
  r = JSON.parse(t);
475
481
  } catch {
@@ -479,21 +485,21 @@ var V = (e) => [
479
485
  raw: t,
480
486
  element: {
481
487
  source: n ?? "",
482
- index: n ? we(e, n) : 0
488
+ index: n ? Oe(e, n) : 0
483
489
  },
484
490
  tag: e.tagName.toLowerCase(),
485
- label: Ae(e),
491
+ label: Pe(e),
486
492
  ...r === void 0 ? {} : { config: r }
487
493
  };
488
- }), He = 14, Ue = 2e3, We = 100, Ge = 48, Ke = new Set([
494
+ }), Ke = 14, qe = 2e3, Je = 100, Ye = 48, Xe = new Set([
489
495
  "script",
490
496
  "style",
491
497
  "template",
492
498
  "noscript"
493
- ]), qe = (e, t) => t.includes(e) || e.id === "studio-staged" || Ke.has(e.tagName.toLowerCase()), Je = (e) => {
499
+ ]), Ze = (e, t) => t.includes(e) || e.id === "studio-staged" || Xe.has(e.tagName.toLowerCase()), Qe = (e) => {
494
500
  let t = !1, n = 0, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
495
501
  for (let e of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
496
- let t = X(e);
502
+ let t = Y(e);
497
503
  if (!t) continue;
498
504
  let n = i.get(t) ?? 0;
499
505
  r.set(e, n), i.set(t, n + 1);
@@ -502,11 +508,11 @@ var V = (e) => [
502
508
  for (let t of e.childNodes) {
503
509
  if (t.nodeType !== 3) continue;
504
510
  let e = (t.textContent ?? "").replace(/\s+/g, " ").trim();
505
- if (e) return e.length > Ge ? `${e.slice(0, Ge).trimEnd()}…` : e;
511
+ if (e) return e.length > Ye ? `${e.slice(0, Ye).trimEnd()}…` : e;
506
512
  }
507
513
  }, o = (i, s) => {
508
514
  n++;
509
- let c = X(i), l = a(i), u = Array.from(i.children).filter((t) => !qe(t, e)), d = {
515
+ let c = Y(i), l = a(i), u = Array.from(i.children).filter((t) => !Ze(t, e)), d = {
510
516
  tag: i.tagName.toLowerCase(),
511
517
  ...c ? {
512
518
  source: c,
@@ -517,9 +523,9 @@ var V = (e) => [
517
523
  childCount: u.length,
518
524
  children: []
519
525
  };
520
- if (s >= He) return u.length && (t = !0), d;
526
+ if (s >= Ke) return u.length && (t = !0), d;
521
527
  for (let e of u) {
522
- if (d.children.length >= We || n >= Ue) {
528
+ if (d.children.length >= Je || n >= qe) {
523
529
  t = !0;
524
530
  break;
525
531
  }
@@ -531,7 +537,7 @@ var V = (e) => [
531
537
  tree: o(document.body, 0),
532
538
  truncated: t
533
539
  };
534
- }, Ye = () => {
540
+ }, $e = () => {
535
541
  let e = null;
536
542
  return {
537
543
  send: (t) => {
@@ -546,77 +552,7 @@ var V = (e) => [
546
552
  return !0;
547
553
  }
548
554
  };
549
- }, Xe = 6, Ze = 12, Qe = 12, $e = .6, et = (e, t, n, r) => ({
550
- x: Math.min(e, n),
551
- y: Math.min(t, r),
552
- width: Math.abs(n - e),
553
- height: Math.abs(r - t)
554
- }), tt = (e, t) => {
555
- let n = e.x + e.width, r = e.y + e.height, i = [];
556
- for (let a of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
557
- if (t.includes(a)) continue;
558
- let o = a.getBoundingClientRect(), s = o.width * o.height;
559
- 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 >= $e && i.push(a);
560
- }
561
- let a = new Set(i), o = i.filter((e) => {
562
- for (let t = e.parentElement; t; t = t.parentElement) if (a.has(t)) return !1;
563
- return !0;
564
- }), s = o.length > Qe, c = [], l = [];
565
- for (let e of o.slice(0, Qe)) {
566
- let t = X(e);
567
- if (!t) continue;
568
- let n = (e.innerText || "").replace(/\s+/g, " ").trim().slice(0, 80);
569
- c.push({
570
- source: t,
571
- index: we(e, t),
572
- tag: e.tagName.toLowerCase(),
573
- label: Ae(e),
574
- ...n ? { text: n } : {}
575
- }), l.push(e);
576
- }
577
- return {
578
- elements: c,
579
- nodes: l,
580
- truncated: s
581
- };
582
- }, nt = () => Array.from({ length: Qe }, () => {
583
- let e = document.createElement("div");
584
- return e.style.cssText = `position:fixed;pointer-events:none;z-index:${J.ring};outline:1.5px solid ${Y.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 3px ${Y.selectGlow};display:none`, e;
585
- }), rt = () => {
586
- let e = document.createElement("div");
587
- e.style.cssText = `position:fixed;pointer-events:none;z-index:${J.overlay};border:1.5px dashed ${Y.select};background:${Y.selectGlow};border-radius:2px;display:none`;
588
- let t = null, n = !1, r = 0, i = 0, a = () => {
589
- e.style.display = "none";
590
- };
591
- return {
592
- node: e,
593
- pointerDown: (e, a) => {
594
- t = {
595
- x: e,
596
- y: a
597
- }, n = !1, r = e, i = a;
598
- },
599
- pointerMove: (a, o) => {
600
- if (!t) return;
601
- if (a = Math.min(Math.max(0, a), window.innerWidth), o = Math.min(Math.max(0, o), window.innerHeight), r = a, i = o, !n) {
602
- if (Math.abs(a - t.x) < Xe && Math.abs(o - t.y) < Xe) return;
603
- n = !0;
604
- }
605
- let s = et(t.x, t.y, a, o);
606
- 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`;
607
- },
608
- pointerUp: () => {
609
- let e = n, o = t;
610
- if (t = null, n = !1, a(), !e || !o) return null;
611
- let s = et(o.x, o.y, r, i);
612
- return s.width < Ze || s.height < Ze ? null : s;
613
- },
614
- cancel: () => {
615
- t = null, n = !1, a();
616
- },
617
- isDragging: () => n
618
- };
619
- }, it = (e) => {
555
+ }, et = (e) => {
620
556
  let t = location.pathname, n = () => {
621
557
  location.pathname !== t && (t = location.pathname, e.onPathChange());
622
558
  }, r = !1;
@@ -636,7 +572,7 @@ var V = (e) => [
636
572
  e.__inspectorPatched && e.__orig && (history.pushState = e.__orig), t.__inspectorPatched && t.__orig && (history.replaceState = t.__orig);
637
573
  }
638
574
  } };
639
- }, at = (e) => {
575
+ }, tt = (e) => {
640
576
  let { channel: t, originals: n, staged: r } = e, i = t.send, a = null;
641
577
  return { onMessage: (o) => {
642
578
  let s = o.data;
@@ -644,7 +580,7 @@ var V = (e) => [
644
580
  if (s.type === "set-inspect") e.setInspect(s.enabled);
645
581
  else if (s.type === "set-text-edit") e.setTextEdit(s.enabled);
646
582
  else if (s.type === "revert-text") {
647
- 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 : Z(e, t);
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);
648
584
  i && r != null && (i.textContent = r);
649
585
  } else if (s.type === "stage-style") {
650
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;
@@ -703,7 +639,7 @@ var V = (e) => [
703
639
  }
704
640
  e.syncDomObserver();
705
641
  } else if (s.type === "select-element") {
706
- let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Z(t, n) : null;
642
+ let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? X(t, n) : null;
707
643
  if (!r) {
708
644
  i({
709
645
  type: "select-miss",
@@ -719,10 +655,10 @@ var V = (e) => [
719
655
  behavior: "smooth"
720
656
  }), i({
721
657
  type: "element-selected",
722
- element: ze(r)
658
+ element: Ue(r)
723
659
  });
724
660
  } else if (s.type === "edit-element") {
725
- let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Z(t, n) : null;
661
+ let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? X(t, n) : null;
726
662
  if (!r) {
727
663
  i({
728
664
  type: "select-miss",
@@ -738,12 +674,12 @@ var V = (e) => [
738
674
  behavior: "smooth"
739
675
  }), i({
740
676
  type: "element-selected",
741
- element: ze(r)
677
+ element: Ue(r)
742
678
  }), e.isTextEditing() || e.setTextEdit(!0);
743
679
  let o = e.editableTarget(r);
744
680
  o && e.startEditAtEnd(o);
745
681
  } else if (s.type === "highlight-element") {
746
- let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? Z(t, n) : null;
682
+ let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? X(t, n) : null;
747
683
  if (!r) a = null, e.hideTextHover(), i({
748
684
  type: "highlight-miss",
749
685
  element: {
@@ -761,7 +697,7 @@ var V = (e) => [
761
697
  }
762
698
  } else if (s.type === "clear-highlight") a && (a = null, !e.isInspecting() && !e.editingNode() && e.hideTextHover());
763
699
  else if (s.type === "request-layers") {
764
- let { tree: t, truncated: n } = Je(e.ownNodes);
700
+ let { tree: t, truncated: n } = Qe(e.ownNodes);
765
701
  i({
766
702
  type: "layers-tree",
767
703
  tree: t,
@@ -769,7 +705,7 @@ var V = (e) => [
769
705
  });
770
706
  } else if (s.type === "request-sources") i({
771
707
  type: "sources-list",
772
- sources: Ve()
708
+ sources: Ge()
773
709
  });
774
710
  else if (s.type === "capture-selected") {
775
711
  let t = String(s.requestId || "");
@@ -784,7 +720,7 @@ var V = (e) => [
784
720
  });
785
721
  return;
786
722
  }
787
- ve(n, e.ownNodes).then((e) => {
723
+ Se(n, e.ownNodes).then((e) => {
788
724
  console.info(`[levo-inspector] element capture ok <${n.tagName.toLowerCase()}> (${Math.round(e.length / 1024)}kB)`), i({
789
725
  type: "capture-result",
790
726
  requestId: t,
@@ -805,7 +741,7 @@ var V = (e) => [
805
741
  }
806
742
  }
807
743
  } };
808
- }, ot = () => {
744
+ }, nt = () => {
809
745
  let e = /* @__PURE__ */ new Map(), t = () => {
810
746
  if (e.size > 50) {
811
747
  let t = e.keys().next().value;
@@ -825,14 +761,84 @@ var V = (e) => [
825
761
  return e.delete(t), n;
826
762
  }
827
763
  };
828
- }, st = (e) => {
764
+ }, rt = 6, it = 12, at = 12, ot = .6, st = (e, t, n, r) => ({
765
+ x: Math.min(e, n),
766
+ y: Math.min(t, r),
767
+ width: Math.abs(n - e),
768
+ height: Math.abs(r - t)
769
+ }), ct = (e, t) => {
770
+ let n = e.x + e.width, r = e.y + e.height, i = [];
771
+ for (let a of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
772
+ if (t.includes(a)) continue;
773
+ let o = a.getBoundingClientRect(), s = o.width * o.height;
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);
775
+ }
776
+ let a = new Set(i), o = i.filter((e) => {
777
+ for (let t = e.parentElement; t; t = t.parentElement) if (a.has(t)) return !1;
778
+ return !0;
779
+ }), s = o.length > at, c = [], l = [];
780
+ for (let e of o.slice(0, at)) {
781
+ let t = Y(e);
782
+ if (!t) continue;
783
+ let n = (e.innerText || "").replace(/\s+/g, " ").trim().slice(0, 80);
784
+ c.push({
785
+ source: t,
786
+ index: Oe(e, t),
787
+ tag: e.tagName.toLowerCase(),
788
+ label: Pe(e),
789
+ ...n ? { text: n } : {}
790
+ }), l.push(e);
791
+ }
792
+ return {
793
+ elements: c,
794
+ nodes: l,
795
+ truncated: s
796
+ };
797
+ }, lt = () => Array.from({ length: at }, () => {
798
+ let e = document.createElement("div");
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 = () => {
801
+ let e = document.createElement("div");
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`;
803
+ let t = null, n = !1, r = 0, i = 0, a = () => {
804
+ e.style.display = "none";
805
+ };
806
+ return {
807
+ node: e,
808
+ pointerDown: (e, a) => {
809
+ t = {
810
+ x: e,
811
+ y: a
812
+ }, n = !1, r = e, i = a;
813
+ },
814
+ pointerMove: (a, o) => {
815
+ if (!t) return;
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) {
817
+ if (Math.abs(a - t.x) < rt && Math.abs(o - t.y) < rt) return;
818
+ n = !0;
819
+ }
820
+ let s = st(t.x, t.y, a, o);
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`;
822
+ },
823
+ pointerUp: () => {
824
+ let e = n, o = t;
825
+ if (t = null, n = !1, a(), !e || !o) return null;
826
+ let s = st(o.x, o.y, r, i);
827
+ return s.width < it || s.height < it ? null : s;
828
+ },
829
+ cancel: () => {
830
+ t = null, n = !1, a();
831
+ },
832
+ isDragging: () => n
833
+ };
834
+ }, dt = (e) => {
829
835
  let { originals: t, editingNode: n } = e, r = /* @__PURE__ */ new Map(), i = () => {
830
836
  let e = document.getElementById("studio-staged");
831
837
  return e || (e = document.createElement("style"), e.id = "studio-staged", document.head.appendChild(e)), e;
832
838
  }, a = () => {
833
839
  let e = [];
834
840
  for (let [t, n] of r) if (n.kind === "style") {
835
- let r = De(t, n);
841
+ let r = je(t, n);
836
842
  r && e.push(r);
837
843
  }
838
844
  let t = e.join("\n");
@@ -840,8 +846,8 @@ var V = (e) => [
840
846
  let n = i();
841
847
  n.textContent !== t && (n.textContent = t);
842
848
  }, o = (e, r) => {
843
- let i = Z(r.source, r.index);
844
- if (i) if (r.kind === "style") Te(i, e);
849
+ let i = X(r.source, r.index);
850
+ if (i) if (r.kind === "style") ke(i, e);
845
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");
846
852
  else {
847
853
  if (i === n()) return;
@@ -854,8 +860,8 @@ var V = (e) => [
854
860
  let n = r.get(e);
855
861
  if (!n) return;
856
862
  r.delete(e);
857
- let i = Z(n.source, n.index);
858
- if (n.kind === "style") i && Ee(i, e), a();
863
+ let i = X(n.source, n.index);
864
+ if (n.kind === "style") i && Ae(i, e), a();
859
865
  else if (n.kind === "image") {
860
866
  let e = t.restore(`${n.source}#${n.index}:src`), r = t.restore(`${n.source}#${n.index}:srcset`);
861
867
  i && (e != null && (e ? i.setAttribute("src", e) : i.removeAttribute("src")), r != null && (r ? i.setAttribute("srcset", r) : i.removeAttribute("srcset")));
@@ -884,7 +890,7 @@ var V = (e) => [
884
890
  for (let e of Array.from(document.querySelectorAll("[data-staged-key]"))) e.removeAttribute("data-staged-key");
885
891
  }
886
892
  };
887
- }, ct = (e) => {
893
+ }, ft = (e) => {
888
894
  let { channel: t, originals: n, clearTextHover: r } = e, i = null, a = "", o = 0, s = (() => {
889
895
  try {
890
896
  let e = document.createElement("div");
@@ -903,15 +909,15 @@ var V = (e) => [
903
909
  n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n);
904
910
  }, d = (e, t = !1) => {
905
911
  if (i === e) return;
906
- i && p(i), i = e, a = X(e) || "", o = we(e, a), r(), n.capture(`${a}#${o}`, e.textContent ?? ""), e.setAttribute("contenteditable", s ? "plaintext-only" : "true");
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");
907
913
  let d = e;
908
- d.style.outline = `2px solid ${Y.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
+ 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);
909
915
  }, f = (e) => {
910
916
  e.removeAttribute("contenteditable");
911
917
  let t = e;
912
918
  t.style.outline = "", t.style.outlineOffset = "", t.style.borderRadius = "", t.removeEventListener("blur", c, !0), t.removeEventListener("keydown", l, !0), i = null;
913
919
  }, p = (e) => {
914
- let r = X(e), i = o, s = n.get(`${a}#${o}`);
920
+ let r = Y(e), i = o, s = n.get(`${a}#${o}`);
915
921
  f(e);
916
922
  let c = (e.textContent ?? "").replace(/\s+/g, " ").trim();
917
923
  t.send({
@@ -922,7 +928,7 @@ var V = (e) => [
922
928
  tag: e.tagName.toLowerCase(),
923
929
  value: c,
924
930
  previous: s,
925
- occurrences: r ? Ce(r).length : 1
931
+ occurrences: r ? De(r).length : 1
926
932
  }
927
933
  });
928
934
  }, m = (e) => {
@@ -941,16 +947,16 @@ var V = (e) => [
941
947
  i && f(i);
942
948
  }
943
949
  };
944
- }, lt = "2026-07-24g · element-capture + region-drag + region-highlights (stale-region guard)";
945
- function ut() {
946
- return f(() => dt(), []), null;
950
+ }, pt = "2026-07-24g · element-capture + region-drag + region-highlights (stale-region guard)";
951
+ function mt() {
952
+ return f(() => ht(), []), null;
947
953
  }
948
- function dt() {
949
- let e = !1, t = null, n = null, r = !1, i = null, a = ot(), o = Ye(), { overlay: s, label: c, ring: l, ringLabel: u } = Me();
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();
950
956
  document.body.append(s, c, l, u);
951
- let d = rt();
957
+ let d = ut();
952
958
  document.body.append(d.node);
953
- let f = nt();
959
+ let f = lt();
954
960
  document.body.append(...f);
955
961
  let p = [
956
962
  s,
@@ -975,94 +981,94 @@ function dt() {
975
981
  m = e, _();
976
982
  }, y = () => {
977
983
  m.length !== 0 && (m = [], _());
978
- }, b = null, ee = (e) => {
984
+ }, b = null, x = (e) => {
979
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);
980
- }, x = (e) => !e || p.includes(e) || e === document.body || e === document.documentElement, S = (e) => {
981
- if (!e || x(e)) return null;
982
- let t = X(e) ? e : e.closest("[data-tsd-source]");
983
- return !t || x(t) || !Ie(t) ? null : t;
984
- }, C = (e) => Ne(s, c, e), w = () => {
986
+ }, S = (e) => !e || p.includes(e) || e === document.body || e === document.documentElement, C = (e) => {
987
+ if (!e || S(e)) return null;
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 = () => {
985
991
  if (n) {
986
992
  if (!n.isConnected) {
987
- A();
993
+ ne();
988
994
  return;
989
995
  }
990
- Ne(l, u, n);
996
+ Le(l, u, n);
991
997
  }
992
- }, T = 0, E = () => {
993
- T || !n || r || (T = requestAnimationFrame(() => {
994
- T = 0, w();
998
+ }, E = 0, D = () => {
999
+ E || !n || r || (E = requestAnimationFrame(() => {
1000
+ E = 0, T();
995
1001
  }));
996
- }, D = new ResizeObserver(E), O = new MutationObserver((e) => {
1002
+ }, O = new ResizeObserver(D), k = new MutationObserver((e) => {
997
1003
  for (let t of e) {
998
1004
  let e = t.target;
999
1005
  if (!p.some((t) => t === e) && !(t.type === "attributes" && t.attributeName === "data-staged-key")) {
1000
- E(), P.scheduleReapply();
1006
+ D(), P.scheduleReapply();
1001
1007
  return;
1002
1008
  }
1003
1009
  }
1004
- }), k = !1, te = () => {
1005
- k ||= (O.observe(document.documentElement, {
1010
+ }), A = !1, ee = () => {
1011
+ A ||= (k.observe(document.documentElement, {
1006
1012
  attributes: !0,
1007
1013
  childList: !0,
1008
1014
  characterData: !0,
1009
1015
  subtree: !0
1010
1016
  }), !0);
1017
+ }, j = () => {
1018
+ A &&= (k.disconnect(), !1);
1019
+ }, te = () => {
1020
+ O.disconnect(), n?.isConnected && (O.observe(n), ee());
1011
1021
  }, ne = () => {
1012
- k &&= (O.disconnect(), !1);
1013
- }, re = () => {
1014
- D.disconnect(), n?.isConnected && (D.observe(n), te());
1015
- }, A = () => {
1016
- n = null, D.disconnect(), F(), T &&= (cancelAnimationFrame(T), 0), l.style.display = "none", u.style.display = "none", y(), g();
1017
- }, j = (e) => C(e), M = () => {
1022
+ n = null, O.disconnect(), ie(), E &&= (cancelAnimationFrame(E), 0), l.style.display = "none", u.style.display = "none", y(), g();
1023
+ }, re = (e) => w(e), M = () => {
1018
1024
  s.style.display = "none", c.style.display = "none";
1019
- }, N = ct({
1025
+ }, N = ft({
1020
1026
  channel: o,
1021
1027
  originals: a,
1022
1028
  clearTextHover: () => {
1023
1029
  i = null, M();
1024
1030
  }
1025
- }), P = st({
1031
+ }), P = dt({
1026
1032
  originals: a,
1027
1033
  editingNode: N.editingNode
1028
- }), F = () => {
1029
- n?.isConnected || P.count() ? te() : ne();
1030
- }, I = (n) => {
1031
- n && r && L(!1), e = !!n, ee(e), e || (t = null, s.style.display = "none", c.style.display = "none", G()), o.send({
1034
+ }), ie = () => {
1035
+ n?.isConnected || P.count() ? ee() : j();
1036
+ }, F = (n) => {
1037
+ n && r && I(!1), e = !!n, x(e), e || (t = null, s.style.display = "none", c.style.display = "none", G()), o.send({
1032
1038
  type: "inspect-state",
1033
1039
  enabled: e
1034
1040
  });
1035
- }, L = (t) => {
1041
+ }, I = (t) => {
1036
1042
  if (r = !!t, r) {
1037
- e && I(!1), l.style.display = "none", u.style.display = "none";
1043
+ e && F(!1), l.style.display = "none", u.style.display = "none";
1038
1044
  for (let e of f) e.style.display = "none";
1039
- } else N.commitIfEditing(), M(), document.documentElement.style.cursor = "", n && w(), m.length > 0 && _();
1045
+ } else N.commitIfEditing(), M(), document.documentElement.style.cursor = "", n && T(), m.length > 0 && _();
1040
1046
  o.send({
1041
1047
  type: "text-edit-state",
1042
1048
  enabled: r
1043
1049
  });
1044
- }, R = 0, ie = 0, ae = 0, oe = () => {
1045
- R = 0;
1046
- let n = document.elementFromPoint(ie, ae);
1047
- if (!x(n)) {
1050
+ }, L = 0, ae = 0, oe = 0, se = () => {
1051
+ L = 0;
1052
+ let n = document.elementFromPoint(ae, oe);
1053
+ if (!S(n)) {
1048
1054
  if (r) {
1049
- let e = S(n);
1055
+ let e = C(n);
1050
1056
  if (e && e === N.editingNode()) {
1051
1057
  i = null, M(), document.documentElement.style.cursor = "";
1052
1058
  return;
1053
1059
  }
1054
- i = e, document.documentElement.style.cursor = e ? "text" : "", e ? j(e) : M();
1060
+ i = e, document.documentElement.style.cursor = e ? "text" : "", e ? re(e) : M();
1055
1061
  return;
1056
1062
  }
1057
- e && (d.isDragging() || (t = n, n && C(n)));
1063
+ e && (d.isDragging() || (t = n, n && w(n)));
1058
1064
  }
1059
- }, z = (t) => {
1060
- !e && !r || (ie = t.clientX, ae = t.clientY, R ||= requestAnimationFrame(oe));
1061
- }, B = 0, se = () => {
1062
- B = 0, e && t && C(t), r && !N.editingNode() && i?.isConnected && j(i), n && !r && w(), m.length > 0 && !r && _();
1063
- }, V = () => {
1064
- B ||= requestAnimationFrame(se);
1065
- }, ce = (n) => {
1065
+ }, R = (t) => {
1066
+ !e && !r || (ae = t.clientX, oe = t.clientY, L ||= requestAnimationFrame(se));
1067
+ }, z = 0, B = () => {
1068
+ z = 0, e && t && w(t), r && !N.editingNode() && i?.isConnected && re(i), n && !r && T(), m.length > 0 && !r && _();
1069
+ }, ce = () => {
1070
+ z ||= requestAnimationFrame(B);
1071
+ }, V = (n) => {
1066
1072
  n.relatedTarget || (e ? (t = null, s.style.display = "none", c.style.display = "none") : r && !N.editingNode() && (i = null, M(), document.documentElement.style.cursor = ""));
1067
1073
  }, H = !1, U = null, W = () => {
1068
1074
  if (U != null) {
@@ -1073,9 +1079,9 @@ function dt() {
1073
1079
  }
1074
1080
  }, G = () => {
1075
1081
  W(), d.cancel();
1076
- }, K = (t) => {
1082
+ }, le = (t) => {
1077
1083
  !e || t.button !== 0 || !t.isPrimary || (H = !1, d.pointerDown(t.clientX, t.clientY));
1078
- }, le = (n) => {
1084
+ }, K = (n) => {
1079
1085
  if (!e || !n.isPrimary) return;
1080
1086
  let r = d.isDragging();
1081
1087
  if (d.pointerMove(n.clientX, n.clientY), d.isDragging()) {
@@ -1087,16 +1093,16 @@ function dt() {
1087
1093
  }
1088
1094
  t = null, s.style.display = "none", c.style.display = "none";
1089
1095
  }
1090
- }, q = (t) => {
1096
+ }, ue = (t) => {
1091
1097
  if (!e || !t.isPrimary) return;
1092
1098
  W();
1093
1099
  let n = d.pointerUp();
1094
1100
  if (!n) return;
1095
- H = !0, A();
1096
- let { elements: r, nodes: i, truncated: a } = tt(n, p);
1101
+ H = !0, ne();
1102
+ let { elements: r, nodes: i, truncated: a } = ct(n, p);
1097
1103
  console.info(`[levo-inspector] region drag: ${Math.round(n.width)}×${Math.round(n.height)} — ${r.length} element(s)${a ? " (truncated)" : ""}`), v(i);
1098
1104
  let s = ++h;
1099
- Se(n, p).then((e) => {
1105
+ Ee(n, p).then((e) => {
1100
1106
  s === h && (console.info(`[levo-inspector] region capture ok (${Math.round(e.length / 1024)}kB)`), o.send({
1101
1107
  type: "region-selected",
1102
1108
  rect: n,
@@ -1113,57 +1119,57 @@ function dt() {
1113
1119
  dataUrl: null
1114
1120
  }));
1115
1121
  });
1116
- }, ue = () => G(), de = (e) => {
1117
- let t = Pe(e.target);
1122
+ }, de = () => G(), fe = (e) => {
1123
+ let t = Re(e.target);
1118
1124
  return t ? (e.preventDefault(), e.stopPropagation(), window.open(t, "_blank", "noopener,noreferrer"), !0) : !1;
1119
- }, fe = (i) => {
1125
+ }, pe = (i) => {
1120
1126
  if (H) {
1121
1127
  H = !1, i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
1122
1128
  return;
1123
1129
  }
1124
1130
  if (r) {
1125
- let e = S(document.elementFromPoint(i.clientX, i.clientY) || i.target);
1131
+ let e = C(document.elementFromPoint(i.clientX, i.clientY) || i.target);
1126
1132
  if (!e || e === N.editingNode()) {
1127
- de(i);
1133
+ fe(i);
1128
1134
  return;
1129
1135
  }
1130
1136
  i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation(), N.startEdit(e);
1131
1137
  return;
1132
1138
  }
1133
1139
  if (!e) {
1134
- de(i);
1140
+ fe(i);
1135
1141
  return;
1136
1142
  }
1137
1143
  i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
1138
1144
  let a = t || i.target;
1139
- if (x(a)) return;
1145
+ if (S(a)) return;
1140
1146
  let s = a.closest("[data-tsd-source]") || a;
1141
- y(), g(), n = s, w(), re(), o.send({
1147
+ y(), g(), n = s, T(), te(), o.send({
1142
1148
  type: "element-selected",
1143
- element: ze(s)
1149
+ element: Ue(s)
1144
1150
  });
1145
- }, pe = at({
1151
+ }, me = tt({
1146
1152
  channel: o,
1147
1153
  originals: a,
1148
1154
  staged: P,
1149
- setInspect: I,
1150
- setTextEdit: L,
1155
+ setInspect: F,
1156
+ setTextEdit: I,
1151
1157
  isInspecting: () => e,
1152
1158
  isTextEditing: () => r,
1153
1159
  editingNode: N.editingNode,
1154
1160
  setSelected: (e) => {
1155
- y(), g(), n = e, re();
1161
+ y(), g(), n = e, te();
1156
1162
  },
1157
1163
  selectedNode: () => n,
1158
- positionSelected: w,
1159
- clearSelection: A,
1160
- syncDomObserver: F,
1161
- positionHover: C,
1164
+ positionSelected: T,
1165
+ clearSelection: ne,
1166
+ syncDomObserver: ie,
1167
+ positionHover: w,
1162
1168
  hideTextHover: M,
1163
1169
  startEditAtEnd: (e) => N.startEdit(e, !0),
1164
- editableTarget: S,
1170
+ editableTarget: C,
1165
1171
  ownNodes: p
1166
- }), me = [
1172
+ }), he = [
1167
1173
  "mousedown",
1168
1174
  "mouseup",
1169
1175
  "dblclick",
@@ -1181,79 +1187,98 @@ function dt() {
1181
1187
  "touchstart",
1182
1188
  "touchend",
1183
1189
  "submit"
1184
- ], he = (t) => {
1190
+ ], ge = (t) => {
1185
1191
  e && (t.cancelable && t.preventDefault(), t.stopPropagation(), t.stopImmediatePropagation());
1186
- }, ge = () => {
1187
- n && !r && w(), m.length > 0 && !r && _();
1188
1192
  }, _e = () => {
1193
+ n && !r && T(), m.length > 0 && !r && _();
1194
+ }, ve = () => {
1189
1195
  let e = location.pathname.replace(/\/$/, "") || "/";
1190
1196
  o.send({
1191
1197
  type: "route",
1192
1198
  route: e
1193
1199
  });
1194
- }, ve = it({ onPathChange: () => {
1195
- A(), _e();
1196
- } }), ye = (t) => {
1200
+ }, ye = et({ onPathChange: () => {
1201
+ ne(), ve();
1202
+ } }), be = (t) => {
1197
1203
  if (N.editingNode()) return;
1198
1204
  if (t.key === "Escape") {
1199
1205
  if (e && d.isDragging()) {
1200
1206
  t.stopPropagation(), G();
1201
1207
  return;
1202
1208
  }
1203
- r ? (t.stopPropagation(), L(!1)) : e && (t.stopPropagation(), I(!1));
1209
+ r ? (t.stopPropagation(), I(!1)) : e && (t.stopPropagation(), F(!1));
1204
1210
  return;
1205
1211
  }
1206
- if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || Fe(document.activeElement)) return;
1212
+ if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || ze(document.activeElement)) return;
1207
1213
  let n = t.key.toLowerCase();
1208
- n === "s" ? (t.preventDefault(), t.stopPropagation(), I(!e)) : n === "t" && (t.preventDefault(), t.stopPropagation(), L(!r));
1214
+ n === "s" ? (t.preventDefault(), t.stopPropagation(), F(!e)) : n === "t" && (t.preventDefault(), t.stopPropagation(), I(!r));
1209
1215
  };
1210
- window.addEventListener("mousemove", z, !0), window.addEventListener("scroll", V, !0), window.addEventListener("resize", ge), window.addEventListener("click", fe, !0), window.addEventListener("keydown", ye, !0), window.addEventListener("message", pe.onMessage), window.addEventListener("mouseout", ce, !0), window.addEventListener("pointerdown", K, !0), window.addEventListener("pointermove", le, !0), window.addEventListener("pointerup", q, !0), window.addEventListener("pointercancel", ue, !0);
1211
- for (let e of me) window.addEventListener(e, he, !0);
1212
- return console.info(`[levo-inspector] build ${lt} — runtime mounted`), _e(), o.send({ type: "ready" }), () => {
1213
- window.removeEventListener("mousemove", z, !0), window.removeEventListener("keydown", ye, !0), window.removeEventListener("scroll", V, !0), window.removeEventListener("resize", ge), window.removeEventListener("mouseout", ce, !0), window.removeEventListener("pointerdown", K, !0), window.removeEventListener("pointermove", le, !0), window.removeEventListener("pointerup", q, !0), window.removeEventListener("pointercancel", ue, !0), window.removeEventListener("click", fe, !0), window.removeEventListener("message", pe.onMessage);
1214
- for (let e of me) window.removeEventListener(e, he, !0);
1215
- D.disconnect(), O.disconnect(), T && cancelAnimationFrame(T), R && cancelAnimationFrame(R), B && cancelAnimationFrame(B), P.teardown(), ve.teardown(), N.teardown(), document.documentElement.style.cursor = "", b?.remove(), s.remove(), c.remove(), l.remove(), u.remove(), G(), d.node.remove();
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();
1216
1222
  for (let e of f) e.remove();
1217
1223
  };
1218
1224
  }
1219
1225
  //#endregion
1220
- //#region src/popups/LevoPopups.tsx
1221
- var ft = l(() => import("./dist-CJknSbJK.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), pt = ({ siteId: e }) => {
1222
- let t = j(), r = n();
1223
- return !t || !r ? null : /* @__PURE__ */ _(s, {
1226
+ //#region src/pageId.ts
1227
+ var gt = "levo:page-id", _t = () => {
1228
+ if (typeof document > "u") return null;
1229
+ let e = document.querySelectorAll(`meta[name="${gt}"]`);
1230
+ return e[e.length - 1]?.getAttribute("content")?.trim() || null;
1231
+ }, vt = l(() => import("./dist-Cb6sb7nO.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), yt = ({ siteId: e, pageId: t }) => {
1232
+ let r = N(), i = n();
1233
+ return !r || !i ? null : /* @__PURE__ */ v(s, {
1224
1234
  fallback: null,
1225
- children: /* @__PURE__ */ _(ft, { siteId: e })
1235
+ children: /* @__PURE__ */ v(vt, {
1236
+ pageId: t,
1237
+ siteId: e
1238
+ })
1226
1239
  });
1227
- }, mt = () => n(), ht = () => t(), gt = ({ site: t, children: n }) => {
1228
- let [r] = h(() => {
1229
- if (!t) return null;
1230
- let e = F(t), n = P(e);
1240
+ }, bt = () => n(), xt = () => e(), St = ({ site: e, children: n }) => {
1241
+ let [r] = g(() => {
1242
+ if (!e) return null;
1243
+ let t = I(e), n = F(t);
1231
1244
  return n ? {
1232
1245
  client: n,
1233
- insights: C(n, {
1234
- insightsUrl: e.insightsUrl || null,
1235
- site: e.siteId || null
1246
+ insights: E(n, {
1247
+ insightsUrl: t.insightsUrl || null,
1248
+ site: t.siteId || null
1236
1249
  }),
1237
- site: t
1250
+ site: e
1238
1251
  } : null;
1239
- });
1240
- return r ? /* @__PURE__ */ v(e, {
1252
+ }), [i, a] = g(null), o = C({ select: (e) => e.location.pathname });
1253
+ return f(() => {
1254
+ r && (window.levo_client = r.client, window.levo_insights = r.insights);
1255
+ }, [r]), p(() => {
1256
+ if (!r) return;
1257
+ let e = _t();
1258
+ a(e), r.insights.init({ pageId: e });
1259
+ }, [r, o]), r ? /* @__PURE__ */ y(t, {
1241
1260
  client: r.client,
1242
1261
  insights: r.insights,
1243
1262
  children: [
1244
1263
  n,
1245
- /* @__PURE__ */ _(N, { site: r.site }),
1246
- /* @__PURE__ */ _(pt, { siteId: r.site.id })
1264
+ /* @__PURE__ */ v(ie, {
1265
+ site: r.site,
1266
+ path: o
1267
+ }),
1268
+ /* @__PURE__ */ v(yt, {
1269
+ pageId: i ?? void 0,
1270
+ siteId: r.site.id
1271
+ })
1247
1272
  ]
1248
- }) : /* @__PURE__ */ _(g, { children: n });
1249
- }, _t = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), vt = (e) => {
1273
+ }) : /* @__PURE__ */ v(_, { children: n });
1274
+ }, Ct = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), wt = (e) => {
1250
1275
  let t = {}, n = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("([^"]*)"|'([^']*)'|[^\s"'>]+))?/g;
1251
1276
  for (let r = n.exec(e); r; r = n.exec(e)) {
1252
1277
  let e = r[1];
1253
1278
  !e || /^on/i.test(e) || (t[e] = r[3] ?? r[4] ?? (r[2] ? r[2] : ""));
1254
1279
  }
1255
1280
  return t;
1256
- }, yt = (e) => {
1281
+ }, Tt = (e) => {
1257
1282
  let t = {
1258
1283
  meta: [],
1259
1284
  links: [],
@@ -1261,11 +1286,11 @@ var ft = l(() => import("./dist-CJknSbJK.js").then((e) => e.n).then((e) => ({ de
1261
1286
  };
1262
1287
  if (!e?.trim()) return t;
1263
1288
  let n = e.replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi, (e, n, r) => {
1264
- let i = vt(n), a = r.trim();
1289
+ let i = wt(n), a = r.trim();
1265
1290
  return a && (i.children = a), t.scripts.push(i), "";
1266
1291
  });
1267
- return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(vt(r)), "")), t;
1268
- }, bt = (e = {}, t = {}) => {
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 = {}) => {
1269
1294
  let n = {
1270
1295
  meta: [],
1271
1296
  links: [],
@@ -1330,21 +1355,21 @@ var ft = l(() => import("./dist-CJknSbJK.js").then((e) => e.n).then((e) => ({ de
1330
1355
  let y = e.ldJson ? Array.isArray(e.ldJson) ? e.ldJson : [e.ldJson] : [];
1331
1356
  for (let e of y) n.scripts.push({
1332
1357
  type: "application/ld+json",
1333
- children: _t(e)
1358
+ children: Ct(e)
1334
1359
  });
1335
1360
  for (let r of [t.customHead, e.customHead]) {
1336
1361
  if (!r) continue;
1337
- let e = yt(r);
1362
+ let e = Tt(r);
1338
1363
  n.meta.push(...e.meta), n.links.push(...e.links), n.scripts.push(...e.scripts);
1339
1364
  }
1340
1365
  return n;
1341
1366
  };
1342
- function xt({ meta: e, site: t }) {
1343
- let n = bt(e, t);
1344
- return /* @__PURE__ */ v(g, { children: [
1345
- n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */ _("meta", { ...e }, `m${t}`) : /* @__PURE__ */ _("title", { children: e.title }, `t${t}`)),
1346
- n.links.map((e, t) => /* @__PURE__ */ _("link", { ...e }, `l${t}`)),
1347
- n.scripts.map(({ children: e, ...t }, n) => e === void 0 ? /* @__PURE__ */ _("script", { ...t }, `s${n}`) : /* @__PURE__ */ _("script", {
1367
+ function Dt({ meta: e, site: t }) {
1368
+ let n = Et(e, t);
1369
+ return /* @__PURE__ */ y(_, { children: [
1370
+ n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */ v("meta", { ...e }, `m${t}`) : /* @__PURE__ */ v("title", { children: e.title }, `t${t}`)),
1371
+ n.links.map((e, t) => /* @__PURE__ */ v("link", { ...e }, `l${t}`)),
1372
+ n.scripts.map(({ children: e, ...t }, n) => e === void 0 ? /* @__PURE__ */ v("script", { ...t }, `s${n}`) : /* @__PURE__ */ v("script", {
1348
1373
  ...t,
1349
1374
  dangerouslySetInnerHTML: { __html: e }
1350
1375
  }, `s${n}`))
@@ -1352,25 +1377,25 @@ function xt({ meta: e, site: t }) {
1352
1377
  }
1353
1378
  //#endregion
1354
1379
  //#region src/registration/ui.tsx
1355
- var St = (...e) => e.filter(Boolean).join(" "), Q = o.forwardRef(({ className: e, isLoading: t, loadingText: n, children: r, type: i = "button", ...a }, o) => /* @__PURE__ */ _("button", {
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", {
1356
1381
  ref: o,
1357
1382
  type: i,
1358
- className: St("inline-flex items-center justify-center", e),
1383
+ className: Ot("inline-flex items-center justify-center", e),
1359
1384
  ...a,
1360
- children: t ? /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(D, { className: St("h-4 w-4 animate-spin", n ? "mr-2" : "") }), n] }) : r
1385
+ children: t ? /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(A, { className: Ot("h-4 w-4 animate-spin", n ? "mr-2" : "") }), n] }) : r
1361
1386
  }));
1362
- Q.displayName = "Btn";
1387
+ Z.displayName = "Btn";
1363
1388
  //#endregion
1364
1389
  //#region src/registration/AttendeeForm.tsx
1365
- var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, registerLoading: i, onBack: a, submitLabel: o }) => /* @__PURE__ */ v("form", {
1390
+ var kt = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, registerLoading: i, onBack: a, submitLabel: o, showBusinessBilling: s = !0 }) => /* @__PURE__ */ y("form", {
1366
1391
  onSubmit: r,
1367
1392
  className: "flex flex-col gap-4",
1368
1393
  children: [
1369
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
1394
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
1370
1395
  htmlFor: "name",
1371
1396
  className: "font-medium text-sm",
1372
1397
  children: "Name"
1373
- }), /* @__PURE__ */ _("input", {
1398
+ }), /* @__PURE__ */ v("input", {
1374
1399
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1375
1400
  placeholder: "Name",
1376
1401
  name: "name",
@@ -1379,11 +1404,11 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1379
1404
  onBlur: n,
1380
1405
  required: !0
1381
1406
  })] }),
1382
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
1407
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
1383
1408
  htmlFor: "email",
1384
1409
  className: "font-medium text-sm",
1385
1410
  children: "Email"
1386
- }), /* @__PURE__ */ _("input", {
1411
+ }), /* @__PURE__ */ v("input", {
1387
1412
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1388
1413
  placeholder: "Email",
1389
1414
  name: "email",
@@ -1393,32 +1418,32 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1393
1418
  type: "email",
1394
1419
  required: !0
1395
1420
  })] }),
1396
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
1421
+ s && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
1397
1422
  htmlFor: "is_business_purchase",
1398
1423
  className: "flex items-center gap-2 text-sm",
1399
- children: [/* @__PURE__ */ _("input", {
1424
+ children: [/* @__PURE__ */ v("input", {
1400
1425
  type: "checkbox",
1401
1426
  name: "is_business_purchase",
1402
1427
  checked: e.is_business_purchase || !1,
1403
1428
  onChange: t,
1404
1429
  className: "rounded border-gray-300"
1405
- }), /* @__PURE__ */ _("span", {
1430
+ }), /* @__PURE__ */ v("span", {
1406
1431
  className: "font-medium",
1407
1432
  children: "Tax for Business"
1408
1433
  })]
1409
- }), /* @__PURE__ */ _("p", {
1434
+ }), /* @__PURE__ */ v("p", {
1410
1435
  className: "mt-1 text-gray-500 text-xs",
1411
1436
  children: "Check this if you're purchasing for a business and need a tax-compliant invoice"
1412
1437
  })] }),
1413
- e.is_business_purchase && /* @__PURE__ */ v(g, { children: [
1414
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
1438
+ s && e.is_business_purchase && /* @__PURE__ */ y(_, { children: [
1439
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
1415
1440
  htmlFor: "business_name",
1416
1441
  className: "font-medium text-sm",
1417
- children: ["Company Name ", /* @__PURE__ */ _("span", {
1442
+ children: ["Company Name ", /* @__PURE__ */ v("span", {
1418
1443
  className: "text-red-500",
1419
1444
  children: "*"
1420
1445
  })]
1421
- }), /* @__PURE__ */ _("input", {
1446
+ }), /* @__PURE__ */ v("input", {
1422
1447
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1423
1448
  placeholder: "Acme Corporation",
1424
1449
  name: "billing_details.name",
@@ -1427,14 +1452,14 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1427
1452
  onBlur: n,
1428
1453
  required: e.is_business_purchase
1429
1454
  })] }),
1430
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("label", {
1455
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("label", {
1431
1456
  htmlFor: "business_tax_id",
1432
1457
  className: "font-medium text-sm",
1433
- children: ["Tax ID / GST Number ", /* @__PURE__ */ _("span", {
1458
+ children: ["Tax ID / GST Number ", /* @__PURE__ */ v("span", {
1434
1459
  className: "text-red-500",
1435
1460
  children: "*"
1436
1461
  })]
1437
- }), /* @__PURE__ */ _("input", {
1462
+ }), /* @__PURE__ */ v("input", {
1438
1463
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1439
1464
  placeholder: "GST123456789",
1440
1465
  name: "billing_details.tax_id",
@@ -1443,15 +1468,15 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1443
1468
  onBlur: n,
1444
1469
  required: e.is_business_purchase
1445
1470
  })] }),
1446
- /* @__PURE__ */ v("div", { children: [
1447
- /* @__PURE__ */ v("p", {
1471
+ /* @__PURE__ */ y("div", { children: [
1472
+ /* @__PURE__ */ y("p", {
1448
1473
  className: "mb-1 font-medium text-sm",
1449
- children: ["Business Address ", /* @__PURE__ */ _("span", {
1474
+ children: ["Business Address ", /* @__PURE__ */ v("span", {
1450
1475
  className: "text-red-500",
1451
1476
  children: "*"
1452
1477
  })]
1453
1478
  }),
1454
- /* @__PURE__ */ _("input", {
1479
+ /* @__PURE__ */ v("input", {
1455
1480
  className: "mb-2 w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1456
1481
  placeholder: "Street Address Line 1",
1457
1482
  name: "billing_details.address.line1",
@@ -1460,7 +1485,7 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1460
1485
  onBlur: n,
1461
1486
  required: e.is_business_purchase
1462
1487
  }),
1463
- /* @__PURE__ */ _("input", {
1488
+ /* @__PURE__ */ v("input", {
1464
1489
  className: "mb-2 w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1465
1490
  placeholder: "Street Address Line 2 (Optional)",
1466
1491
  name: "billing_details.address.line2",
@@ -1468,9 +1493,9 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1468
1493
  onChange: t,
1469
1494
  onBlur: n
1470
1495
  }),
1471
- /* @__PURE__ */ v("div", {
1496
+ /* @__PURE__ */ y("div", {
1472
1497
  className: "grid grid-cols-2 gap-2",
1473
- children: [/* @__PURE__ */ _("input", {
1498
+ children: [/* @__PURE__ */ v("input", {
1474
1499
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1475
1500
  placeholder: "City",
1476
1501
  name: "billing_details.address.city",
@@ -1478,7 +1503,7 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1478
1503
  onChange: t,
1479
1504
  onBlur: n,
1480
1505
  required: e.is_business_purchase
1481
- }), /* @__PURE__ */ _("input", {
1506
+ }), /* @__PURE__ */ v("input", {
1482
1507
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1483
1508
  placeholder: "State/Province",
1484
1509
  name: "billing_details.address.state",
@@ -1488,9 +1513,9 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1488
1513
  required: e.is_business_purchase
1489
1514
  })]
1490
1515
  }),
1491
- /* @__PURE__ */ v("div", {
1516
+ /* @__PURE__ */ y("div", {
1492
1517
  className: "mt-2 grid grid-cols-2 gap-2",
1493
- children: [/* @__PURE__ */ _("input", {
1518
+ children: [/* @__PURE__ */ v("input", {
1494
1519
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1495
1520
  placeholder: "Postal Code",
1496
1521
  name: "billing_details.address.postal_code",
@@ -1498,7 +1523,7 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1498
1523
  onChange: t,
1499
1524
  onBlur: n,
1500
1525
  required: e.is_business_purchase
1501
- }), /* @__PURE__ */ _("input", {
1526
+ }), /* @__PURE__ */ v("input", {
1502
1527
  className: "w-full rounded-lg border border-gray-300 px-3 py-2 focus:outline-none",
1503
1528
  placeholder: "Country",
1504
1529
  name: "billing_details.address.country",
@@ -1510,15 +1535,15 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1510
1535
  })
1511
1536
  ] })
1512
1537
  ] }),
1513
- /* @__PURE__ */ v("div", {
1538
+ /* @__PURE__ */ y("div", {
1514
1539
  className: "flex flex-col-reverse justify-end gap-4 md:flex-row",
1515
- children: [/* @__PURE__ */ _(Q, {
1540
+ children: [/* @__PURE__ */ v(Z, {
1516
1541
  className: "rounded-lg bg-gray-100 px-6 py-2 font-semibold text-black hover:bg-gray-200",
1517
1542
  type: "button",
1518
1543
  onClick: a,
1519
1544
  disabled: i,
1520
1545
  children: "Back"
1521
- }), /* @__PURE__ */ _(Q, {
1546
+ }), /* @__PURE__ */ v(Z, {
1522
1547
  className: "rounded-lg bg-brand px-6 py-2 font-semibold text-brand-foreground hover:opacity-90",
1523
1548
  type: "submit",
1524
1549
  isLoading: i,
@@ -1527,57 +1552,57 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1527
1552
  })]
1528
1553
  })
1529
1554
  ]
1530
- }), wt = {
1555
+ }), At = {
1531
1556
  USD: "$",
1532
1557
  EUR: "€",
1533
1558
  GBP: "£",
1534
1559
  INR: "₹"
1535
- }, $ = (e) => e?.unit_amount ? `${wt[e.currency ?? "INR"]} ${(e.unit_amount ?? 0) / 100}` : "Free", Tt = (e) => {
1560
+ }, Q = (e) => e?.unit_amount ? `${At[e.currency ?? "INR"]} ${(e.unit_amount ?? 0) / 100}` : "Free", jt = (e) => {
1536
1561
  if (!e) return null;
1537
1562
  let t = e.tax_enabled ?? !1, n = e.tax_inclusive ?? !1, r = e.taxes ?? [];
1538
1563
  return !t || r.length === 0 ? null : n ? "(inclusive of taxes)" : "+ taxes";
1539
- }, Et = (e) => !!(e?.taxes && e.taxes.length > 0 && e.tax_amount !== void 0), Dt = (e) => {
1564
+ }, Mt = (e) => !!(e?.taxes && e.taxes.length > 0 && e.tax_amount !== void 0), Nt = (e) => {
1540
1565
  if (!e) return !1;
1541
1566
  let t = e;
1542
1567
  return t.tax_enabled === !0 && t.taxes !== void 0 && t.taxes.length > 0 && t.subtotal !== void 0;
1543
- }, Ot = (e, t) => !t || e.tickets.length === 0 ? !0 : e.tickets.some((e) => typeof e == "string" ? e === t : e._id === t), kt = ({ couponCode: e, onCouponCodeChange: t, couponError: n, couponLoading: r, onValidateCoupon: i, publicCoupons: a, onBack: o, selectedTicket: s }) => {
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 }) => {
1544
1569
  let c = [...a].sort((e, t) => {
1545
- let n = Ot(e, s?._id), r = Ot(t, s?._id);
1570
+ let n = $(e, s?._id), r = $(t, s?._id);
1546
1571
  return n && !r ? -1 : !n && r ? 1 : 0;
1547
1572
  });
1548
- return /* @__PURE__ */ v("div", { children: [
1549
- /* @__PURE__ */ v("div", {
1573
+ return /* @__PURE__ */ y("div", { children: [
1574
+ /* @__PURE__ */ y("div", {
1550
1575
  className: "flex items-center justify-between text-center",
1551
1576
  children: [
1552
- /* @__PURE__ */ _("button", {
1577
+ /* @__PURE__ */ v("button", {
1553
1578
  type: "button",
1554
1579
  className: "rounded-md p-2 hover:bg-gray-50 focus:outline-none",
1555
1580
  "aria-label": "Back",
1556
1581
  onClick: o,
1557
- children: /* @__PURE__ */ _(T, { className: "size-4" })
1582
+ children: /* @__PURE__ */ v(O, { className: "size-4" })
1558
1583
  }),
1559
- /* @__PURE__ */ v("p", {
1584
+ /* @__PURE__ */ y("p", {
1560
1585
  className: "font-semibold text-md",
1561
1586
  children: ["Apply Coupon for ", s?.title]
1562
1587
  }),
1563
- /* @__PURE__ */ _("div", { className: "w-4" })
1588
+ /* @__PURE__ */ v("div", { className: "w-4" })
1564
1589
  ]
1565
1590
  }),
1566
- /* @__PURE__ */ v("div", {
1591
+ /* @__PURE__ */ y("div", {
1567
1592
  className: "mt-2 flex gap-4",
1568
- children: [/* @__PURE__ */ v("div", {
1593
+ children: [/* @__PURE__ */ y("div", {
1569
1594
  className: "w-full",
1570
- children: [/* @__PURE__ */ _("input", {
1595
+ children: [/* @__PURE__ */ v("input", {
1571
1596
  className: "w-full rounded border border-gray-300 px-3 py-2 focus:border-brand focus:outline-none",
1572
1597
  type: "text",
1573
1598
  placeholder: "Enter Coupon Code",
1574
1599
  value: e,
1575
1600
  onChange: (e) => t(e.target.value)
1576
- }), n && /* @__PURE__ */ _("p", {
1601
+ }), n && /* @__PURE__ */ v("p", {
1577
1602
  className: "mt-1 text-red-400 text-xs",
1578
1603
  children: n
1579
1604
  })]
1580
- }), /* @__PURE__ */ _(Q, {
1605
+ }), /* @__PURE__ */ v(Z, {
1581
1606
  "aria-label": "Apply Coupon",
1582
1607
  onClick: () => i(),
1583
1608
  className: "rounded-lg bg-brand px-3 text-brand-foreground hover:opacity-90",
@@ -1586,55 +1611,55 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1586
1611
  zIndex: e ? 1 : -1
1587
1612
  },
1588
1613
  isLoading: r,
1589
- children: /* @__PURE__ */ _(w, { className: "h-fit" })
1614
+ children: /* @__PURE__ */ v(D, { className: "h-fit" })
1590
1615
  })]
1591
1616
  }),
1592
- c.length > 0 && /* @__PURE__ */ v("div", {
1617
+ c.length > 0 && /* @__PURE__ */ y("div", {
1593
1618
  className: "mt-4 flex flex-col gap-4",
1594
- children: [c.filter((e) => Ot(e, s?._id)).length > 0 && /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
1619
+ children: [c.filter((e) => $(e, s?._id)).length > 0 && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
1595
1620
  className: "mb-2 text-gray-600 text-sm",
1596
1621
  children: "Available Coupons"
1597
- }), /* @__PURE__ */ _("div", {
1622
+ }), /* @__PURE__ */ v("div", {
1598
1623
  className: "flex flex-col gap-2",
1599
- children: c.filter((e) => Ot(e, s?._id)).map((e) => /* @__PURE__ */ v("button", {
1624
+ children: c.filter((e) => $(e, s?._id)).map((e) => /* @__PURE__ */ y("button", {
1600
1625
  type: "button",
1601
1626
  className: "flex flex-col gap-1 rounded-md border border-gray-300 border-dashed px-3 py-2 text-left transition hover:border-gray-400 hover:bg-gray-50",
1602
1627
  onClick: () => {
1603
1628
  i(e.code), t(e.code);
1604
1629
  },
1605
- children: [/* @__PURE__ */ v("div", {
1630
+ children: [/* @__PURE__ */ y("div", {
1606
1631
  className: "flex w-full items-center justify-between",
1607
- children: [/* @__PURE__ */ _("span", {
1632
+ children: [/* @__PURE__ */ v("span", {
1608
1633
  className: "font-medium",
1609
1634
  children: e.code
1610
- }), /* @__PURE__ */ _("span", {
1635
+ }), /* @__PURE__ */ v("span", {
1611
1636
  className: "text-gray-500 text-sm",
1612
- children: e.kind === "percent" ? `${e.percent_off}% off` : `${wt[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
1637
+ children: e.kind === "percent" ? `${e.percent_off}% off` : `${At[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
1613
1638
  })]
1614
- }), e.description && /* @__PURE__ */ _("span", {
1639
+ }), e.description && /* @__PURE__ */ v("span", {
1615
1640
  className: "text-gray-500 text-xs",
1616
1641
  children: e.description
1617
1642
  })]
1618
1643
  }, e._id))
1619
- })] }), c.filter((e) => !Ot(e, s?._id)).length > 0 && /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
1644
+ })] }), c.filter((e) => !$(e, s?._id)).length > 0 && /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
1620
1645
  className: "mb-2 text-gray-400 text-sm",
1621
1646
  children: "Not Applicable"
1622
- }), /* @__PURE__ */ _("div", {
1647
+ }), /* @__PURE__ */ v("div", {
1623
1648
  className: "flex flex-col gap-2",
1624
- children: c.filter((e) => !Ot(e, s?._id)).map((e) => /* @__PURE__ */ v("button", {
1649
+ children: c.filter((e) => !$(e, s?._id)).map((e) => /* @__PURE__ */ y("button", {
1625
1650
  type: "button",
1626
1651
  disabled: !0,
1627
1652
  className: "flex cursor-not-allowed flex-col gap-1 rounded-md border border-gray-200 border-dashed px-3 py-2 text-left opacity-50",
1628
- children: [/* @__PURE__ */ v("div", {
1653
+ children: [/* @__PURE__ */ y("div", {
1629
1654
  className: "flex w-full items-center justify-between",
1630
- children: [/* @__PURE__ */ _("span", {
1655
+ children: [/* @__PURE__ */ v("span", {
1631
1656
  className: "font-medium",
1632
1657
  children: e.code
1633
- }), /* @__PURE__ */ _("span", {
1658
+ }), /* @__PURE__ */ v("span", {
1634
1659
  className: "text-gray-500 text-sm",
1635
- children: e.kind === "percent" ? `${e.percent_off}% off` : `${wt[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
1660
+ children: e.kind === "percent" ? `${e.percent_off}% off` : `${At[e.currency ?? "INR"]} ${(e.amount_off ?? 0) / 100} off`
1636
1661
  })]
1637
- }), e.description && /* @__PURE__ */ _("span", {
1662
+ }), e.description && /* @__PURE__ */ v("span", {
1638
1663
  className: "text-gray-500 text-xs",
1639
1664
  children: e.description
1640
1665
  })]
@@ -1642,7 +1667,7 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1642
1667
  })] })]
1643
1668
  })
1644
1669
  ] });
1645
- }, At = (e) => {
1670
+ }, It = (e) => {
1646
1671
  let t = new Date(e);
1647
1672
  return `${new Intl.DateTimeFormat("en-GB", {
1648
1673
  day: "numeric",
@@ -1653,24 +1678,24 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1653
1678
  minute: "2-digit",
1654
1679
  hour12: !0
1655
1680
  }).format(t)}`;
1656
- }, jt = ({ ticketData: e, paymentData: t, type: n }) => {
1657
- let [r, i] = h(!0), a = (t.total_amount || t.unit_amount) / 100, o = t.unit_amount === 0, s = (e) => new Intl.NumberFormat("en-IN", {
1681
+ }, Lt = ({ ticketData: e, paymentData: t, type: n }) => {
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", {
1658
1683
  style: "currency",
1659
1684
  currency: t.currency || "INR",
1660
1685
  minimumFractionDigits: 0
1661
1686
  }).format(e);
1662
- return /* @__PURE__ */ _(S.Root, {
1687
+ return /* @__PURE__ */ v(T.Root, {
1663
1688
  open: r,
1664
1689
  onOpenChange: (e) => i(e),
1665
- children: /* @__PURE__ */ v(S.Portal, { children: [/* @__PURE__ */ _(S.Backdrop, { className: "fixed inset-0 z-50 bg-black/50" }), /* @__PURE__ */ v(S.Popup, {
1690
+ children: /* @__PURE__ */ y(T.Portal, { children: [/* @__PURE__ */ v(T.Backdrop, { className: "fixed inset-0 z-50 bg-black/50" }), /* @__PURE__ */ y(T.Popup, {
1666
1691
  className: "fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-2rem)] w-full max-w-md -translate-x-1/2 -translate-y-1/2 flex-col overflow-y-auto rounded-2xl bg-white shadow-2xl",
1667
1692
  children: [
1668
- /* @__PURE__ */ v("div", {
1693
+ /* @__PURE__ */ y("div", {
1669
1694
  className: "bg-gradient-to-br from-green-50 to-emerald-50 px-6 py-6 text-center",
1670
1695
  children: [
1671
- /* @__PURE__ */ _("div", {
1696
+ /* @__PURE__ */ v("div", {
1672
1697
  className: "mx-auto mb-3 flex size-14 items-center justify-center rounded-full bg-green-100 ring-4 ring-green-50",
1673
- children: /* @__PURE__ */ v("svg", {
1698
+ children: /* @__PURE__ */ y("svg", {
1674
1699
  xmlns: "http://www.w3.org/2000/svg",
1675
1700
  width: "28",
1676
1701
  height: "28",
@@ -1682,72 +1707,72 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1682
1707
  strokeLinejoin: "round",
1683
1708
  className: "text-green-600",
1684
1709
  "aria-hidden": "true",
1685
- children: [/* @__PURE__ */ _("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }), /* @__PURE__ */ _("polyline", { points: "22 4 12 14.01 9 11.01" })]
1710
+ children: [/* @__PURE__ */ v("path", { d: "M22 11.08V12a10 10 0 1 1-5.93-9.14" }), /* @__PURE__ */ v("polyline", { points: "22 4 12 14.01 9 11.01" })]
1686
1711
  })
1687
1712
  }),
1688
- /* @__PURE__ */ _(S.Title, {
1713
+ /* @__PURE__ */ v(T.Title, {
1689
1714
  className: "font-bold text-gray-900 text-lg",
1690
1715
  children: n === "view" ? "Booking Details" : "Tickets Confirmed!"
1691
1716
  }),
1692
- /* @__PURE__ */ _(S.Description, {
1717
+ /* @__PURE__ */ v(T.Description, {
1693
1718
  className: "mt-1 text-gray-600 text-sm",
1694
1719
  children: n === "confirm" ? "Your tickets have been confirmed. A confirmation email is on its way." : "Here are the details about your booking."
1695
1720
  })
1696
1721
  ]
1697
1722
  }),
1698
- /* @__PURE__ */ v("div", {
1723
+ /* @__PURE__ */ y("div", {
1699
1724
  className: "px-6 py-5",
1700
- children: [/* @__PURE__ */ v("div", {
1725
+ children: [/* @__PURE__ */ y("div", {
1701
1726
  className: "relative overflow-hidden rounded-xl border border-gray-200 bg-white",
1702
1727
  children: [
1703
- /* @__PURE__ */ _("div", { className: "absolute top-1/2 -left-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
1704
- /* @__PURE__ */ _("div", { className: "absolute top-1/2 -right-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
1705
- /* @__PURE__ */ v("div", {
1728
+ /* @__PURE__ */ v("div", { className: "absolute top-1/2 -left-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
1729
+ /* @__PURE__ */ v("div", { className: "absolute top-1/2 -right-3 size-6 -translate-y-1/2 rounded-full bg-gray-100" }),
1730
+ /* @__PURE__ */ y("div", {
1706
1731
  className: "px-5 py-4",
1707
1732
  children: [
1708
- t.qr_image && /* @__PURE__ */ _("div", {
1733
+ t.qr_image && /* @__PURE__ */ v("div", {
1709
1734
  className: "mb-4 flex flex-col items-center",
1710
- children: /* @__PURE__ */ _("div", {
1735
+ children: /* @__PURE__ */ v("div", {
1711
1736
  className: "rounded-lg border border-gray-200 bg-white p-2",
1712
- children: /* @__PURE__ */ _("img", {
1737
+ children: /* @__PURE__ */ v("img", {
1713
1738
  src: t.qr_image.location,
1714
1739
  alt: "Booking QR Code",
1715
1740
  className: "size-24"
1716
1741
  })
1717
1742
  })
1718
1743
  }),
1719
- /* @__PURE__ */ v("div", {
1744
+ /* @__PURE__ */ y("div", {
1720
1745
  className: "mb-4 flex items-center justify-between rounded-lg bg-gray-50 px-3 py-2.5",
1721
- children: [/* @__PURE__ */ _("span", {
1746
+ children: [/* @__PURE__ */ v("span", {
1722
1747
  className: "font-medium text-gray-500 text-xs uppercase tracking-wide",
1723
1748
  children: "Booking ID"
1724
- }), /* @__PURE__ */ _("span", {
1749
+ }), /* @__PURE__ */ v("span", {
1725
1750
  className: "font-mono font-semibold text-gray-900 text-sm",
1726
1751
  children: t._id
1727
1752
  })]
1728
1753
  }),
1729
- /* @__PURE__ */ _("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
1730
- /* @__PURE__ */ _("div", {
1754
+ /* @__PURE__ */ v("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
1755
+ /* @__PURE__ */ v("div", {
1731
1756
  className: "space-y-3",
1732
1757
  children: t.attendees.map((t) => {
1733
1758
  let n = e.find((e) => e._id === t.ticket._id);
1734
- return n ? /* @__PURE__ */ v("div", {
1759
+ return n ? /* @__PURE__ */ y("div", {
1735
1760
  className: "flex items-center justify-between",
1736
- children: [/* @__PURE__ */ v("div", {
1761
+ children: [/* @__PURE__ */ y("div", {
1737
1762
  className: "min-w-0 flex-1",
1738
- children: [/* @__PURE__ */ _("p", {
1763
+ children: [/* @__PURE__ */ v("p", {
1739
1764
  className: "truncate font-medium text-gray-900 text-sm",
1740
1765
  children: t.name
1741
- }), /* @__PURE__ */ _("p", {
1766
+ }), /* @__PURE__ */ v("p", {
1742
1767
  className: "truncate text-gray-500 text-xs",
1743
1768
  children: t.email
1744
1769
  })]
1745
- }), /* @__PURE__ */ v("div", {
1770
+ }), /* @__PURE__ */ y("div", {
1746
1771
  className: "ml-3 shrink-0 text-right",
1747
- children: [/* @__PURE__ */ _("p", {
1772
+ children: [/* @__PURE__ */ v("p", {
1748
1773
  className: "font-medium text-gray-900 text-sm",
1749
1774
  children: n.title
1750
- }), /* @__PURE__ */ _("p", {
1775
+ }), /* @__PURE__ */ v("p", {
1751
1776
  className: "text-gray-500 text-xs",
1752
1777
  children: s(t.ticket.unit_amount / 100)
1753
1778
  })]
@@ -1755,63 +1780,63 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1755
1780
  }, t._id) : null;
1756
1781
  })
1757
1782
  }),
1758
- /* @__PURE__ */ _("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
1759
- !o && /* @__PURE__ */ v("div", {
1783
+ /* @__PURE__ */ v("div", { className: "my-4 border-gray-200 border-t border-dashed" }),
1784
+ !o && /* @__PURE__ */ y("div", {
1760
1785
  className: "space-y-1.5 text-sm",
1761
1786
  children: [
1762
- /* @__PURE__ */ v("div", {
1787
+ /* @__PURE__ */ y("div", {
1763
1788
  className: "flex justify-between",
1764
- children: [/* @__PURE__ */ _("span", {
1789
+ children: [/* @__PURE__ */ v("span", {
1765
1790
  className: "text-gray-500",
1766
1791
  children: "Base Amount"
1767
- }), /* @__PURE__ */ _("span", {
1792
+ }), /* @__PURE__ */ v("span", {
1768
1793
  className: "font-medium text-gray-700",
1769
1794
  children: s(t.unit_amount / 100)
1770
1795
  })]
1771
1796
  }),
1772
- t.discount > 0 && /* @__PURE__ */ v("div", {
1797
+ t.discount > 0 && /* @__PURE__ */ y("div", {
1773
1798
  className: "flex justify-between text-green-600",
1774
- children: [/* @__PURE__ */ _("span", { children: "Discount" }), /* @__PURE__ */ v("span", {
1799
+ children: [/* @__PURE__ */ v("span", { children: "Discount" }), /* @__PURE__ */ y("span", {
1775
1800
  className: "font-medium",
1776
1801
  children: ["- ", s(t.discount / 100)]
1777
1802
  })]
1778
1803
  }),
1779
- t.taxes && Array.isArray(t.taxes) && t.taxes.length > 0 && t.taxes.map((e, t) => /* @__PURE__ */ v("div", {
1804
+ t.taxes && Array.isArray(t.taxes) && t.taxes.length > 0 && t.taxes.map((e, t) => /* @__PURE__ */ y("div", {
1780
1805
  className: "flex justify-between",
1781
- children: [/* @__PURE__ */ _("span", {
1806
+ children: [/* @__PURE__ */ v("span", {
1782
1807
  className: "text-gray-500",
1783
1808
  children: e.label
1784
- }), /* @__PURE__ */ _("span", {
1809
+ }), /* @__PURE__ */ v("span", {
1785
1810
  className: "font-medium text-gray-700",
1786
1811
  children: s(e.amount / 100)
1787
1812
  })]
1788
1813
  }, t)),
1789
- /* @__PURE__ */ v("div", {
1814
+ /* @__PURE__ */ y("div", {
1790
1815
  className: "flex justify-between border-gray-200 border-t pt-2 font-semibold text-gray-900",
1791
- children: [/* @__PURE__ */ _("span", { children: "Total Paid" }), /* @__PURE__ */ _("span", { children: s(a) })]
1816
+ children: [/* @__PURE__ */ v("span", { children: "Total Paid" }), /* @__PURE__ */ v("span", { children: s(a) })]
1792
1817
  })
1793
1818
  ]
1794
1819
  }),
1795
- o && /* @__PURE__ */ v("div", {
1820
+ o && /* @__PURE__ */ y("div", {
1796
1821
  className: "flex items-center justify-between font-semibold text-gray-900",
1797
- children: [/* @__PURE__ */ _("span", { children: "Total" }), /* @__PURE__ */ _("span", { children: "Free" })]
1822
+ children: [/* @__PURE__ */ v("span", { children: "Total" }), /* @__PURE__ */ v("span", { children: "Free" })]
1798
1823
  })
1799
1824
  ]
1800
1825
  })
1801
1826
  ]
1802
- }), /* @__PURE__ */ _("p", {
1827
+ }), /* @__PURE__ */ v("p", {
1803
1828
  className: "mt-3 text-center text-gray-400 text-xs",
1804
- children: At(t.created_at)
1829
+ children: It(t.created_at)
1805
1830
  })]
1806
1831
  }),
1807
- /* @__PURE__ */ v("div", {
1832
+ /* @__PURE__ */ y("div", {
1808
1833
  className: "flex flex-col gap-2 px-6 pb-5",
1809
- children: [t.invoice?.location && /* @__PURE__ */ v("a", {
1834
+ children: [t.invoice?.location && /* @__PURE__ */ y("a", {
1810
1835
  href: t.invoice.location,
1811
1836
  target: "_blank",
1812
1837
  rel: "noopener noreferrer",
1813
1838
  className: "flex w-full items-center justify-center gap-2 rounded-lg border border-gray-200 px-4 py-2.5 font-medium text-gray-700 text-sm transition-colors hover:bg-gray-50",
1814
- children: [/* @__PURE__ */ v("svg", {
1839
+ children: [/* @__PURE__ */ y("svg", {
1815
1840
  xmlns: "http://www.w3.org/2000/svg",
1816
1841
  width: "16",
1817
1842
  height: "16",
@@ -1823,9 +1848,9 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1823
1848
  strokeLinejoin: "round",
1824
1849
  "aria-hidden": "true",
1825
1850
  children: [
1826
- /* @__PURE__ */ _("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1827
- /* @__PURE__ */ _("polyline", { points: "7 10 12 15 17 10" }),
1828
- /* @__PURE__ */ _("line", {
1851
+ /* @__PURE__ */ v("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
1852
+ /* @__PURE__ */ v("polyline", { points: "7 10 12 15 17 10" }),
1853
+ /* @__PURE__ */ v("line", {
1829
1854
  x1: "12",
1830
1855
  x2: "12",
1831
1856
  y1: "15",
@@ -1833,7 +1858,7 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1833
1858
  })
1834
1859
  ]
1835
1860
  }), "Download Invoice"]
1836
- }), /* @__PURE__ */ _(S.Close, {
1861
+ }), /* @__PURE__ */ v(T.Close, {
1837
1862
  className: "w-full rounded-lg bg-gray-900 px-4 py-2.5 font-medium text-sm text-white transition-colors hover:bg-gray-800",
1838
1863
  children: "Done"
1839
1864
  })]
@@ -1841,123 +1866,123 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1841
1866
  ]
1842
1867
  })] })
1843
1868
  });
1844
- }, Mt = ({ isOpen: e, onClose: t, stripePromise: n, clientSecret: r, onComplete: i }) => !n || !r ? null : /* @__PURE__ */ _(S.Root, {
1869
+ }, Rt = ({ isOpen: e, onClose: t, stripePromise: n, clientSecret: r, onComplete: i }) => !n || !r ? null : /* @__PURE__ */ v(T.Root, {
1845
1870
  open: e,
1846
1871
  onOpenChange: (e) => {
1847
1872
  e || t();
1848
1873
  },
1849
- children: /* @__PURE__ */ v(S.Portal, { children: [/* @__PURE__ */ _(S.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ v(S.Popup, {
1874
+ children: /* @__PURE__ */ y(T.Portal, { children: [/* @__PURE__ */ v(T.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ y(T.Popup, {
1850
1875
  className: "fixed top-8 left-1/2 z-[100] flex max-h-[calc(100vh-4rem)] min-h-[500px] w-[98vw] -translate-x-1/2 flex-col overflow-hidden rounded-2xl bg-white shadow-2xl md:top-10 md:w-auto md:max-w-[1000px] lg:max-w-[1100px]",
1851
- children: [/* @__PURE__ */ _(S.Close, {
1876
+ children: [/* @__PURE__ */ v(T.Close, {
1852
1877
  className: "absolute top-4 right-4 z-10 rounded-full bg-white/90 p-2.5 text-gray-500 shadow-md backdrop-blur-sm transition-all hover:bg-white hover:text-gray-700",
1853
- children: /* @__PURE__ */ _(te, { className: "size-5" })
1854
- }), /* @__PURE__ */ _("div", {
1878
+ children: /* @__PURE__ */ v(te, { className: "size-5" })
1879
+ }), /* @__PURE__ */ v("div", {
1855
1880
  className: "flex-1 overflow-y-auto rounded-2xl py-6",
1856
- children: /* @__PURE__ */ _(A, {
1881
+ children: /* @__PURE__ */ v(M, {
1857
1882
  stripe: n,
1858
1883
  options: {
1859
1884
  clientSecret: r,
1860
1885
  onComplete: i
1861
1886
  },
1862
- children: /* @__PURE__ */ _(re, { className: "stripe-embedded-checkout h-full" })
1887
+ children: /* @__PURE__ */ v(re, { className: "stripe-embedded-checkout h-full" })
1863
1888
  })
1864
1889
  })]
1865
1890
  })] })
1866
- }), Nt = ({ tickets: e, selectedTicket: t, onSelectTicket: n, discount: r, couponCode: i, publicCouponsCount: a, onApplyCouponClick: o, onRemoveCoupon: s, onNext: c }) => {
1867
- let l = Dt(t), u = Et(r);
1868
- return /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ v("div", {
1891
+ }), zt = ({ tickets: e, selectedTicket: t, onSelectTicket: n, discount: r, couponCode: i, publicCouponsCount: a, onApplyCouponClick: o, onRemoveCoupon: s, onNext: c }) => {
1892
+ let l = Nt(t), u = Mt(r);
1893
+ return /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ y("div", {
1869
1894
  className: "flex max-h-[64dvh] w-full flex-col justify-between gap-6 overflow-y-auto md:max-h-[unset] md:flex-row",
1870
- children: [/* @__PURE__ */ _("div", {
1895
+ children: [/* @__PURE__ */ v("div", {
1871
1896
  className: "flex w-full flex-col gap-3 md:w-[55%]",
1872
- children: e.map((e) => /* @__PURE__ */ _("div", {
1873
- className: St("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" : ""),
1897
+ children: e.map((e) => /* @__PURE__ */ v("div", {
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" : ""),
1874
1899
  onClick: () => n(e),
1875
- children: /* @__PURE__ */ v("div", { children: [
1876
- /* @__PURE__ */ _("p", {
1900
+ children: /* @__PURE__ */ y("div", { children: [
1901
+ /* @__PURE__ */ v("p", {
1877
1902
  className: "text-md",
1878
1903
  children: e.title
1879
1904
  }),
1880
- /* @__PURE__ */ _("p", {
1905
+ /* @__PURE__ */ v("p", {
1881
1906
  className: "-mt-[2px] mb-1 text-gray-600 text-xs",
1882
1907
  children: e.description
1883
1908
  }),
1884
- /* @__PURE__ */ v("p", {
1909
+ /* @__PURE__ */ y("p", {
1885
1910
  className: "text-md",
1886
- children: [$(e), Tt(e) && /* @__PURE__ */ v("span", {
1911
+ children: [Q(e), jt(e) && /* @__PURE__ */ y("span", {
1887
1912
  className: "text-gray-500 text-sm",
1888
- children: [" ", Tt(e)]
1913
+ children: [" ", jt(e)]
1889
1914
  })]
1890
1915
  })
1891
1916
  ] })
1892
1917
  }, e._id))
1893
- }), /* @__PURE__ */ v("div", {
1918
+ }), /* @__PURE__ */ y("div", {
1894
1919
  className: "w-full md:w-[45%]",
1895
- children: [/* @__PURE__ */ v("div", {
1920
+ children: [/* @__PURE__ */ y("div", {
1896
1921
  className: "mt-4 flex min-h-[250px] flex-col justify-between rounded-md border border-gray-300 p-4 md:mt-0",
1897
- children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
1922
+ children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
1898
1923
  className: "border-b border-b-gray-200 pb-1 text-md",
1899
1924
  children: "Confirm Details"
1900
- }), /* @__PURE__ */ _("div", {
1925
+ }), /* @__PURE__ */ v("div", {
1901
1926
  className: "mt-2 flex flex-col gap-2",
1902
- children: t && /* @__PURE__ */ v("div", {
1927
+ children: t && /* @__PURE__ */ y("div", {
1903
1928
  className: "flex justify-between",
1904
- children: [/* @__PURE__ */ _("span", {
1929
+ children: [/* @__PURE__ */ v("span", {
1905
1930
  className: "text-md",
1906
1931
  children: t.title
1907
- }), /* @__PURE__ */ _("span", { children: $({
1932
+ }), /* @__PURE__ */ v("span", { children: Q({
1908
1933
  unit_amount: l ? t.subtotal : t.unit_amount,
1909
1934
  currency: t.currency
1910
1935
  }) })]
1911
1936
  })
1912
- })] }), r && u ? /* @__PURE__ */ v("div", {
1937
+ })] }), r && u ? /* @__PURE__ */ y("div", {
1913
1938
  className: "mt-2",
1914
1939
  children: [
1915
- /* @__PURE__ */ v("div", {
1940
+ /* @__PURE__ */ y("div", {
1916
1941
  className: "flex items-center justify-between",
1917
- children: [/* @__PURE__ */ _("span", {
1942
+ children: [/* @__PURE__ */ v("span", {
1918
1943
  className: "text-md",
1919
1944
  children: "Subtotal"
1920
- }), /* @__PURE__ */ _("span", {
1945
+ }), /* @__PURE__ */ v("span", {
1921
1946
  className: "text-md",
1922
- children: $({
1947
+ children: Q({
1923
1948
  unit_amount: r.base_amount,
1924
1949
  currency: t?.currency
1925
1950
  })
1926
1951
  })]
1927
1952
  }),
1928
- /* @__PURE__ */ v("div", {
1953
+ /* @__PURE__ */ y("div", {
1929
1954
  className: "flex items-center justify-between text-green-600",
1930
- children: [/* @__PURE__ */ _("span", {
1955
+ children: [/* @__PURE__ */ v("span", {
1931
1956
  className: "text-md",
1932
1957
  children: "Discount"
1933
- }), /* @__PURE__ */ v("span", {
1958
+ }), /* @__PURE__ */ y("span", {
1934
1959
  className: "text-md",
1935
1960
  children: [
1936
1961
  "-",
1937
1962
  " ",
1938
- $({
1963
+ Q({
1939
1964
  unit_amount: r.discount,
1940
1965
  currency: t?.currency
1941
1966
  })
1942
1967
  ]
1943
1968
  })]
1944
1969
  }),
1945
- /* @__PURE__ */ v("div", {
1970
+ /* @__PURE__ */ y("div", {
1946
1971
  className: "flex items-center justify-between border-t border-t-gray-200 pt-1",
1947
- children: [/* @__PURE__ */ _("span", {
1972
+ children: [/* @__PURE__ */ v("span", {
1948
1973
  className: "text-md",
1949
1974
  children: "Taxable Amount"
1950
- }), /* @__PURE__ */ _("span", {
1975
+ }), /* @__PURE__ */ v("span", {
1951
1976
  className: "text-md",
1952
- children: $({
1977
+ children: Q({
1953
1978
  unit_amount: r.taxable_amount,
1954
1979
  currency: t?.currency
1955
1980
  })
1956
1981
  })]
1957
1982
  }),
1958
- r.taxes?.map((e, n) => /* @__PURE__ */ v("div", {
1983
+ r.taxes?.map((e, n) => /* @__PURE__ */ y("div", {
1959
1984
  className: "flex items-center justify-between text-gray-600",
1960
- children: [/* @__PURE__ */ v("span", {
1985
+ children: [/* @__PURE__ */ y("span", {
1961
1986
  className: "text-sm",
1962
1987
  children: [
1963
1988
  e.label,
@@ -1965,94 +1990,94 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
1965
1990
  e.percentage,
1966
1991
  "%)"
1967
1992
  ]
1968
- }), /* @__PURE__ */ _("span", {
1993
+ }), /* @__PURE__ */ v("span", {
1969
1994
  className: "text-sm",
1970
- children: $({
1995
+ children: Q({
1971
1996
  unit_amount: e.amount,
1972
1997
  currency: t?.currency
1973
1998
  })
1974
1999
  })]
1975
2000
  }, e.id || e._id || n)),
1976
- /* @__PURE__ */ v("div", {
2001
+ /* @__PURE__ */ y("div", {
1977
2002
  className: "mt-1 flex items-center justify-between border-t border-t-gray-200 pt-1 font-medium",
1978
- children: [/* @__PURE__ */ _("span", {
2003
+ children: [/* @__PURE__ */ v("span", {
1979
2004
  className: "text-md",
1980
2005
  children: "Payable"
1981
- }), /* @__PURE__ */ _("span", {
2006
+ }), /* @__PURE__ */ v("span", {
1982
2007
  className: "text-md",
1983
- children: $({
2008
+ children: Q({
1984
2009
  unit_amount: r.total_amount,
1985
2010
  currency: t?.currency
1986
2011
  })
1987
2012
  })]
1988
2013
  })
1989
2014
  ]
1990
- }) : r ? /* @__PURE__ */ v("div", {
2015
+ }) : r ? /* @__PURE__ */ y("div", {
1991
2016
  className: "mt-2",
1992
2017
  children: [
1993
- /* @__PURE__ */ v("div", {
2018
+ /* @__PURE__ */ y("div", {
1994
2019
  className: "flex items-center justify-between",
1995
- children: [/* @__PURE__ */ _("span", {
2020
+ children: [/* @__PURE__ */ v("span", {
1996
2021
  className: "text-md",
1997
2022
  children: "Subtotal"
1998
- }), /* @__PURE__ */ _("span", {
2023
+ }), /* @__PURE__ */ v("span", {
1999
2024
  className: "text-md",
2000
- children: $({
2025
+ children: Q({
2001
2026
  unit_amount: r.base_amount,
2002
2027
  currency: t?.currency
2003
2028
  })
2004
2029
  })]
2005
2030
  }),
2006
- /* @__PURE__ */ v("div", {
2031
+ /* @__PURE__ */ y("div", {
2007
2032
  className: "flex items-center justify-between text-green-600",
2008
- children: [/* @__PURE__ */ _("span", {
2033
+ children: [/* @__PURE__ */ v("span", {
2009
2034
  className: "text-md",
2010
2035
  children: "Discount"
2011
- }), /* @__PURE__ */ v("span", {
2036
+ }), /* @__PURE__ */ y("span", {
2012
2037
  className: "text-md",
2013
2038
  children: [
2014
2039
  "-",
2015
2040
  " ",
2016
- $({
2041
+ Q({
2017
2042
  unit_amount: r.discount,
2018
2043
  currency: t?.currency
2019
2044
  })
2020
2045
  ]
2021
2046
  })]
2022
2047
  }),
2023
- /* @__PURE__ */ v("div", {
2048
+ /* @__PURE__ */ y("div", {
2024
2049
  className: "mt-1 flex items-center justify-between border-t border-t-gray-200 pt-1 font-medium",
2025
- children: [/* @__PURE__ */ _("span", {
2050
+ children: [/* @__PURE__ */ v("span", {
2026
2051
  className: "text-md",
2027
2052
  children: "Payable"
2028
- }), /* @__PURE__ */ _("span", {
2053
+ }), /* @__PURE__ */ v("span", {
2029
2054
  className: "text-md",
2030
- children: $({
2055
+ children: Q({
2031
2056
  unit_amount: r.sale_amount,
2032
2057
  currency: t?.currency
2033
2058
  })
2034
2059
  })]
2035
2060
  })
2036
2061
  ]
2037
- }) : l ? /* @__PURE__ */ v("div", {
2062
+ }) : l ? /* @__PURE__ */ y("div", {
2038
2063
  className: "mt-2",
2039
2064
  children: [
2040
- /* @__PURE__ */ v("div", {
2065
+ /* @__PURE__ */ y("div", {
2041
2066
  className: "flex items-center justify-between",
2042
- children: [/* @__PURE__ */ _("span", {
2067
+ children: [/* @__PURE__ */ v("span", {
2043
2068
  className: "text-md",
2044
2069
  children: "Subtotal"
2045
- }), /* @__PURE__ */ _("span", {
2070
+ }), /* @__PURE__ */ v("span", {
2046
2071
  className: "text-md",
2047
- children: $({
2072
+ children: Q({
2048
2073
  unit_amount: t.subtotal,
2049
2074
  currency: t?.currency
2050
2075
  })
2051
2076
  })]
2052
2077
  }),
2053
- t.taxes.map((e, n) => /* @__PURE__ */ v("div", {
2078
+ t.taxes.map((e, n) => /* @__PURE__ */ y("div", {
2054
2079
  className: "flex items-center justify-between text-gray-600",
2055
- children: [/* @__PURE__ */ v("span", {
2080
+ children: [/* @__PURE__ */ y("span", {
2056
2081
  className: "text-sm",
2057
2082
  children: [
2058
2083
  e.label,
@@ -2060,81 +2085,81 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2060
2085
  e.percentage,
2061
2086
  "%)"
2062
2087
  ]
2063
- }), /* @__PURE__ */ _("span", {
2088
+ }), /* @__PURE__ */ v("span", {
2064
2089
  className: "text-sm",
2065
- children: $({
2090
+ children: Q({
2066
2091
  unit_amount: e.amount,
2067
2092
  currency: t?.currency
2068
2093
  })
2069
2094
  })]
2070
2095
  }, e.id || e._id || n)),
2071
- /* @__PURE__ */ v("div", {
2096
+ /* @__PURE__ */ y("div", {
2072
2097
  className: "mt-1 flex items-center justify-between border-t border-t-gray-200 pt-1 font-medium",
2073
- children: [/* @__PURE__ */ _("span", {
2098
+ children: [/* @__PURE__ */ v("span", {
2074
2099
  className: "text-md",
2075
2100
  children: "Payable"
2076
- }), /* @__PURE__ */ _("span", {
2101
+ }), /* @__PURE__ */ v("span", {
2077
2102
  className: "text-md",
2078
- children: $({
2103
+ children: Q({
2079
2104
  unit_amount: t.total,
2080
2105
  currency: t?.currency
2081
2106
  })
2082
2107
  })]
2083
2108
  }),
2084
- t.tax_inclusive && /* @__PURE__ */ _("p", {
2109
+ t.tax_inclusive && /* @__PURE__ */ v("p", {
2085
2110
  className: "mt-1 text-gray-500 text-xs",
2086
2111
  children: "* Price is inclusive of taxes"
2087
2112
  })
2088
2113
  ]
2089
- }) : /* @__PURE__ */ _("div", {
2114
+ }) : /* @__PURE__ */ v("div", {
2090
2115
  className: "mt-2",
2091
- children: /* @__PURE__ */ v("div", {
2116
+ children: /* @__PURE__ */ y("div", {
2092
2117
  className: "flex items-center justify-between font-medium",
2093
- children: [/* @__PURE__ */ _("span", {
2118
+ children: [/* @__PURE__ */ v("span", {
2094
2119
  className: "text-md",
2095
2120
  children: "Payable"
2096
- }), /* @__PURE__ */ _("span", {
2121
+ }), /* @__PURE__ */ v("span", {
2097
2122
  className: "text-md",
2098
- children: $(t)
2123
+ children: Q(t)
2099
2124
  })]
2100
2125
  })
2101
2126
  })]
2102
- }), r ? /* @__PURE__ */ _("div", {
2127
+ }), r ? /* @__PURE__ */ v("div", {
2103
2128
  className: "flex flex-col justify-between gap-1 py-2",
2104
- children: /* @__PURE__ */ v("div", {
2129
+ children: /* @__PURE__ */ y("div", {
2105
2130
  className: "mt-2 mb-1 space-y-1 rounded-lg border border-green-200 bg-green-50 px-3 py-3",
2106
- children: [/* @__PURE__ */ v("div", {
2131
+ children: [/* @__PURE__ */ y("div", {
2107
2132
  className: "flex items-start justify-between gap-2",
2108
- children: [/* @__PURE__ */ v("div", {
2133
+ children: [/* @__PURE__ */ y("div", {
2109
2134
  className: "flex max-w-16 items-center gap-2",
2110
- children: [/* @__PURE__ */ _("div", {
2135
+ children: [/* @__PURE__ */ v("div", {
2111
2136
  className: "rounded bg-green-500 p-2",
2112
- children: /* @__PURE__ */ _(O, {
2137
+ children: /* @__PURE__ */ v(ee, {
2113
2138
  size: 16,
2114
2139
  className: "text-white"
2115
2140
  })
2116
- }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("div", {
2141
+ }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("div", {
2117
2142
  className: "font-medium text-green-700 text-xs uppercase opacity-60",
2118
2143
  children: "Coupon Applied"
2119
- }), /* @__PURE__ */ _("div", {
2144
+ }), /* @__PURE__ */ v("div", {
2120
2145
  className: "-mt-0.5 max-w-32 truncate font-bold text-green-900 text-sm tracking-wide",
2121
2146
  children: i
2122
2147
  })] })]
2123
- }), /* @__PURE__ */ _("button", {
2148
+ }), /* @__PURE__ */ v("button", {
2124
2149
  type: "button",
2125
2150
  onClick: s,
2126
2151
  className: "rounded-md p-1 text-green-600 transition-colors hover:bg-green-100 hover:text-green-800",
2127
2152
  "aria-label": "Remove coupon",
2128
- children: /* @__PURE__ */ _(k, { size: 18 })
2153
+ children: /* @__PURE__ */ v(j, { size: 18 })
2129
2154
  })]
2130
- }), /* @__PURE__ */ v("div", {
2155
+ }), /* @__PURE__ */ y("div", {
2131
2156
  className: "text-green-700 text-xs",
2132
2157
  children: [
2133
2158
  "You are saving",
2134
2159
  " ",
2135
- /* @__PURE__ */ _("span", {
2160
+ /* @__PURE__ */ v("span", {
2136
2161
  className: "font-semibold",
2137
- children: $({
2162
+ children: Q({
2138
2163
  unit_amount: r.discount,
2139
2164
  currency: t?.currency
2140
2165
  })
@@ -2142,28 +2167,28 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2142
2167
  ]
2143
2168
  })]
2144
2169
  })
2145
- }) : /* @__PURE__ */ v("div", {
2146
- className: St("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"),
2170
+ }) : /* @__PURE__ */ y("div", {
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"),
2147
2172
  onClick: () => t ? o() : null,
2148
- children: [/* @__PURE__ */ v("span", {
2173
+ children: [/* @__PURE__ */ y("span", {
2149
2174
  className: "flex items-center gap-2",
2150
- children: ["Apply Coupon", a > 0 && /* @__PURE__ */ _("span", {
2175
+ children: ["Apply Coupon", a > 0 && /* @__PURE__ */ v("span", {
2151
2176
  className: "rounded-full bg-gray-200 px-2 py-0.5 text-gray-600 text-xs",
2152
2177
  children: a
2153
2178
  })]
2154
- }), /* @__PURE__ */ _("span", { children: /* @__PURE__ */ _(E, {}) })]
2179
+ }), /* @__PURE__ */ v("span", { children: /* @__PURE__ */ v(k, {}) })]
2155
2180
  })]
2156
2181
  })]
2157
- }), /* @__PURE__ */ _("div", {
2182
+ }), /* @__PURE__ */ v("div", {
2158
2183
  className: "mt-3 flex justify-start",
2159
- children: /* @__PURE__ */ _(Q, {
2184
+ children: /* @__PURE__ */ v(Z, {
2160
2185
  onClick: c,
2161
2186
  className: "rounded-lg bg-brand px-6 py-2 font-semibold text-brand-foreground hover:opacity-90",
2162
2187
  children: "Continue for Payment"
2163
2188
  })
2164
2189
  })] });
2165
- }, Pt = () => {
2166
- let [e, t] = h(null), [n, r] = h(null), [i, a] = h(!1), [o, s] = h(null);
2190
+ }, Bt = () => {
2191
+ let [e, t] = g(null), [n, r] = g(null), [i, a] = g(!1), [o, s] = g(null);
2167
2192
  return {
2168
2193
  stripePromise: e,
2169
2194
  config: n,
@@ -2186,7 +2211,7 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2186
2211
  s(() => e);
2187
2212
  }, [])
2188
2213
  };
2189
- }, Ft = {
2214
+ }, Vt = {
2190
2215
  name: "",
2191
2216
  email: "",
2192
2217
  is_business_purchase: !1,
@@ -2202,46 +2227,46 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2202
2227
  country: ""
2203
2228
  }
2204
2229
  }
2205
- }, It = (e, t, n) => {
2230
+ }, Ht = (e, t, n) => {
2206
2231
  let r = t.split("."), i = structuredClone(e), a = i, o = r.length - 1;
2207
2232
  return r.forEach((e, t) => {
2208
2233
  t === o ? a[e] = n : a = a[e];
2209
2234
  }), i;
2210
- }, Lt = async (e, t) => {
2235
+ }, Ut = async (e, t) => {
2211
2236
  try {
2212
2237
  let n = new URLSearchParams();
2213
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;
2214
2239
  } catch (t) {
2215
- e.logger?.error("Failed to fetch event tickets", { exception: b(t) });
2240
+ e.logger?.error("Failed to fetch event tickets", { exception: x(t) });
2216
2241
  }
2217
- }, Rt = ({ eventID: e, title: t, external: r, buttonText: i = "Register Now" }) => {
2218
- let a = n(), [o, s] = h([]), [c, l] = h(!0), [d, p] = h(!1), [y, ee] = h(!1), [x, C] = h(null), [w, T] = h(void 0), [E, D] = h(""), [O, k] = h(null), [re, A] = h(!1), [j, M] = h(null), [N, P] = h(!1), [F, I] = h(1), [L, R] = h(null), [ie, ae] = h([]), [oe, z] = h(Ft), B = m(null), se = () => z(Ft), V = () => {
2219
- k(null), T(void 0), M(null), A(!1), D(""), R(null), p(!1), I(1), se();
2220
- }, { Razorpay: ce } = ne(), { stripePromise: H, config: U, isOpen: W, openStripeCheckout: G, closeStripeCheckout: K, setOnComplete: le } = Pt(), q = () => {
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 = () => {
2244
+ A(null), E(void 0), M(null), j(!1), O(""), L(null), p(!1), F(1), ce();
2245
+ }, { Razorpay: H } = ne(), { stripePromise: U, config: W, isOpen: G, openStripeCheckout: le, closeStripeCheckout: K, setOnComplete: ue } = Bt(), de = () => {
2221
2246
  let e = B.current;
2222
2247
  !e || !a || a.fetch?.url(`/v1/event/booking/${e.bookingId}/confirm-booking`)?.post({ session_id: e.sessionId })?.json().then((e) => {
2223
- e?.content?.data && T(e?.content?.data), K(), B.current = null;
2248
+ e?.content?.data && E(e?.content?.data), K(), B.current = null;
2224
2249
  }).catch((e) => {
2225
- a.logger?.error("Failed to confirm booking after Stripe payment", { exception: b(e) }), K(), B.current = null;
2250
+ a.logger?.error("Failed to confirm booking after Stripe payment", { exception: x(e) }), K(), B.current = null;
2226
2251
  });
2227
- }, ue = async () => {
2252
+ }, fe = async () => {
2228
2253
  if (!a) return;
2229
- ee(!0), R(null);
2230
- let { name: t, email: n, is_business_purchase: r, billing_details: i } = oe;
2254
+ b(!0), L(null);
2255
+ let { name: t, email: n, is_business_purchase: r, billing_details: i } = se;
2231
2256
  try {
2232
2257
  let o = {
2233
2258
  event: e,
2234
- coupon: E,
2259
+ coupon: D,
2235
2260
  attendees: [{
2236
2261
  name: t,
2237
2262
  email: n,
2238
- ticket: x?._id,
2263
+ ticket: S?._id,
2239
2264
  details: {}
2240
2265
  }]
2241
2266
  };
2242
- r && (o.is_business_purchase = !0, o.billing_details = i);
2267
+ r && !z && (o.is_business_purchase = !0, o.billing_details = i);
2243
2268
  let s = await a.fetch?.url(`/v1/event/event/${e}/booking/create-new-booking`)?.post(o).json();
2244
- if (!s?.status) R("Booking failed. Please try again.");
2269
+ if (!s?.status) L("Booking failed. Please try again.");
2245
2270
  else {
2246
2271
  V();
2247
2272
  let e = s?.content?.meta;
@@ -2250,29 +2275,29 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2250
2275
  e.provider === "stripe" && e.client_secret ? (B.current = t && e.session_id ? {
2251
2276
  bookingId: t,
2252
2277
  sessionId: e.session_id
2253
- } : null, le(q), await G({
2278
+ } : null, ue(de), await le({
2254
2279
  key: e.key,
2255
2280
  client_secret: e.client_secret,
2256
2281
  amount: s?.content.data?.unit_amount || 0,
2257
2282
  currency: e.currency || "USD",
2258
2283
  provider: "stripe",
2259
2284
  reference_id: e.reference_id || ""
2260
- })) : de({
2285
+ })) : pe({
2261
2286
  key: e.key,
2262
2287
  amount: s?.content.data?.unit_amount,
2263
2288
  currency: e.currency || "INR",
2264
2289
  order_id: e.order_id,
2265
2290
  booking_id: t
2266
2291
  });
2267
- } else T(s?.content.data);
2292
+ } else E(s?.content.data);
2268
2293
  }
2269
2294
  } catch (e) {
2270
- R(b(e).message || "Something went wrong. Please try again.");
2295
+ L(x(e).message || "Something went wrong. Please try again.");
2271
2296
  }
2272
- ee(!1);
2273
- }, de = async (e) => {
2297
+ b(!1);
2298
+ }, pe = async (e) => {
2274
2299
  if (!a) return;
2275
- let n = new ce({
2300
+ let n = new H({
2276
2301
  key: e.key,
2277
2302
  amount: e.amount ?? 0,
2278
2303
  currency: e.currency,
@@ -2285,9 +2310,9 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2285
2310
  payment_id: t.razorpay_payment_id,
2286
2311
  signature: t.razorpay_signature
2287
2312
  })?.json().then((e) => {
2288
- e?.content?.data?.status && T(e?.content?.data);
2313
+ e?.content?.data?.status && E(e?.content?.data);
2289
2314
  }).catch((e) => {
2290
- a.logger?.error("Failed to confirm Razorpay booking", { exception: b(e) });
2315
+ a.logger?.error("Failed to confirm Razorpay booking", { exception: x(e) });
2291
2316
  });
2292
2317
  },
2293
2318
  prefill: {
@@ -2298,19 +2323,19 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2298
2323
  theme: { color: "#FC751A" }
2299
2324
  });
2300
2325
  n.on("payment.failed", (e) => {
2301
- a.logger?.error("Razorpay payment failed", { exception: b(e.error) });
2326
+ a.logger?.error("Razorpay payment failed", { exception: x(e.error) });
2302
2327
  }), n.open();
2303
- }, fe = u(async () => {
2328
+ }, me = u(async () => {
2304
2329
  if (a) try {
2305
2330
  let t = await a.fetch?.url(`/v1/event/event/${e}/coupon/list-public-coupons`)?.get().json();
2306
- t?.status && t?.content?.data && ae(t.content.data);
2331
+ t?.status && t?.content?.data && oe(t.content.data);
2307
2332
  } catch (e) {
2308
- a.logger?.error("Failed to fetch public coupons", { exception: b(e) });
2333
+ a.logger?.error("Failed to fetch public coupons", { exception: x(e) });
2309
2334
  }
2310
- }, [a, e]), pe = async (t) => {
2335
+ }, [a, e]), he = async (t) => {
2311
2336
  if (!a) return;
2312
- let n = t ?? E;
2313
- A(!0), M(null);
2337
+ let n = t ?? D;
2338
+ j(!0), M(null);
2314
2339
  try {
2315
2340
  let t = await a.fetch?.url(`/v1/event/event/${e}/coupon/validate-coupon-code`)?.post({
2316
2341
  coupon: n,
@@ -2318,31 +2343,31 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2318
2343
  attendees: [{
2319
2344
  name: "",
2320
2345
  email: "",
2321
- ticket: x?._id
2346
+ ticket: S?._id
2322
2347
  }]
2323
2348
  }).json();
2324
- t?.status && (k(t.content.data), D(n)), P(!1), A(!1);
2349
+ t?.status && (A(t.content.data), O(n)), P(!1), j(!1);
2325
2350
  } catch (e) {
2326
- M(b(e).message), A(!1);
2351
+ M(x(e).message), j(!1);
2327
2352
  }
2328
- }, me = (e) => {
2329
- D(""), k(null), M(null), A(!1), R(null), C(e);
2330
- }, he = () => {
2331
- k(null), M(null), D("");
2332
- }, ge = () => {
2333
- M(null), A(!1), D(""), P(!1);
2334
- }, _e = (e) => {
2353
+ }, ge = (e) => {
2354
+ O(""), A(null), M(null), j(!1), L(null), C(e);
2355
+ }, _e = () => {
2356
+ A(null), M(null), O("");
2357
+ }, ve = () => {
2358
+ M(null), j(!1), O(""), P(!1);
2359
+ }, ye = (e) => {
2335
2360
  let { name: t, value: n, type: r, checked: i } = e.target;
2336
- z((e) => It(e, t, r === "checkbox" ? i : n));
2337
- }, ve = () => {}, ye = (e) => {
2338
- e?.preventDefault(), ue();
2361
+ R((e) => Ht(e, t, r === "checkbox" ? i : n));
2362
+ }, be = () => {}, xe = (e) => {
2363
+ e?.preventDefault(), fe();
2339
2364
  };
2340
2365
  if (f(() => {
2341
2366
  if (r) {
2342
2367
  l(!1);
2343
2368
  return;
2344
2369
  }
2345
- e && a && (l(!0), Lt(a, e).then((e) => {
2370
+ e && a && (l(!0), Ut(a, e).then((e) => {
2346
2371
  s(e ?? []), e && e.length > 0 && C(e[0] || null), l(!1);
2347
2372
  }));
2348
2373
  }, [
@@ -2350,108 +2375,109 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2350
2375
  r,
2351
2376
  a
2352
2377
  ]), f(() => {
2353
- x?.unit_amount === 0 && o?.length === 1 && I(2);
2354
- }, [x, o]), f(() => {
2355
- d && e && fe();
2378
+ S?.unit_amount === 0 && o?.length === 1 && F(2);
2379
+ }, [S, o]), f(() => {
2380
+ d && e && me();
2356
2381
  }, [
2357
2382
  d,
2358
2383
  e,
2359
- fe
2360
- ]), r) return /* @__PURE__ */ _("div", {
2384
+ me
2385
+ ]), r) return /* @__PURE__ */ v("div", {
2361
2386
  className: "my-2",
2362
- children: /* @__PURE__ */ _(Q, {
2387
+ children: /* @__PURE__ */ v(Z, {
2363
2388
  className: "rounded-lg bg-brand px-4 py-3 font-semibold text-brand-foreground hover:opacity-90",
2364
2389
  onClick: () => window.open(r, "_blank", "noopener,noreferrer"),
2365
2390
  children: i
2366
2391
  })
2367
2392
  });
2368
- if (c) return /* @__PURE__ */ _("div", {
2393
+ if (c) return /* @__PURE__ */ v("div", {
2369
2394
  className: "my-2",
2370
- children: /* @__PURE__ */ _(Q, {
2395
+ children: /* @__PURE__ */ v(Z, {
2371
2396
  className: "rounded-lg bg-brand px-4 py-2 font-bold text-brand-foreground",
2372
2397
  children: "Loading..."
2373
2398
  })
2374
2399
  });
2375
- let be = O?.sale_amount === 0 || x?.unit_amount === 0 ? "Complete Registration" : "Pay";
2376
- return /* @__PURE__ */ v(g, { children: [
2377
- /* @__PURE__ */ _("div", {
2400
+ let Se = z ? "Complete Registration" : "Pay";
2401
+ return /* @__PURE__ */ y(_, { children: [
2402
+ /* @__PURE__ */ v("div", {
2378
2403
  className: "my-2",
2379
- children: o?.length ? /* @__PURE__ */ _(Q, {
2404
+ children: o?.length ? /* @__PURE__ */ v(Z, {
2380
2405
  onClick: () => p(!0),
2381
2406
  className: "rounded-lg bg-brand px-4 py-3 font-semibold text-brand-foreground hover:opacity-90",
2382
2407
  children: i
2383
- }) : /* @__PURE__ */ _("p", {
2408
+ }) : /* @__PURE__ */ v("p", {
2384
2409
  className: "text-red-500",
2385
2410
  children: "No tickets available for this event."
2386
2411
  })
2387
2412
  }),
2388
- /* @__PURE__ */ _(S.Root, {
2413
+ /* @__PURE__ */ v(T.Root, {
2389
2414
  open: d,
2390
2415
  onOpenChange: (e) => {
2391
2416
  e || V();
2392
2417
  },
2393
- children: /* @__PURE__ */ v(S.Portal, { children: [/* @__PURE__ */ _(S.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ v(S.Popup, {
2394
- className: St("fixed top-24 left-1/2 z-[100] flex max-h-[calc(100vh-7rem)] w-[90%] -translate-x-1/2 flex-col overflow-y-auto rounded-lg bg-white p-4", N ? "md:w-[30%]" : "md:w-[40%]"),
2395
- children: [/* @__PURE__ */ v("div", {
2418
+ children: /* @__PURE__ */ y(T.Portal, { children: [/* @__PURE__ */ v(T.Backdrop, { className: "fixed inset-0 z-[100] bg-black/50" }), /* @__PURE__ */ y(T.Popup, {
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%]"),
2420
+ children: [/* @__PURE__ */ y("div", {
2396
2421
  className: `mb-4 flex w-full items-start justify-between ${N ? "" : "pb-[6px]"} `,
2397
- children: [/* @__PURE__ */ v(S.Title, {
2422
+ children: [/* @__PURE__ */ y(T.Title, {
2398
2423
  className: "font-semibold text-lg",
2399
2424
  children: [
2400
2425
  "Register for ",
2401
2426
  t,
2402
2427
  "!"
2403
2428
  ]
2404
- }), /* @__PURE__ */ _(S.Close, {
2429
+ }), /* @__PURE__ */ v(T.Close, {
2405
2430
  className: "rounded-md p-2 hover:bg-gray-100 focus:outline-none",
2406
- children: /* @__PURE__ */ _(te, { className: "size-4" })
2431
+ children: /* @__PURE__ */ v(te, { className: "size-4" })
2407
2432
  })]
2408
- }), /* @__PURE__ */ v("div", { children: [L && /* @__PURE__ */ _("div", {
2433
+ }), /* @__PURE__ */ y("div", { children: [I && /* @__PURE__ */ v("div", {
2409
2434
  className: "mb-4 rounded-md bg-red-50 p-3 text-red-600 text-sm",
2410
- children: L
2411
- }), F === 1 ? /* @__PURE__ */ _("div", { children: N ? /* @__PURE__ */ _(kt, {
2412
- couponCode: E,
2413
- onCouponCodeChange: D,
2414
- couponError: j,
2415
- couponLoading: re,
2416
- onValidateCoupon: pe,
2417
- publicCoupons: ie,
2418
- onBack: ge,
2419
- selectedTicket: x
2420
- }) : /* @__PURE__ */ _(Nt, {
2435
+ children: I
2436
+ }), ie === 1 ? /* @__PURE__ */ v("div", { children: N ? /* @__PURE__ */ v(Ft, {
2437
+ couponCode: D,
2438
+ onCouponCodeChange: O,
2439
+ couponError: re,
2440
+ couponLoading: ee,
2441
+ onValidateCoupon: he,
2442
+ publicCoupons: ae,
2443
+ onBack: ve,
2444
+ selectedTicket: S
2445
+ }) : /* @__PURE__ */ v(zt, {
2421
2446
  tickets: o,
2422
- selectedTicket: x,
2423
- onSelectTicket: me,
2424
- discount: O,
2425
- couponCode: E,
2426
- publicCouponsCount: ie.length,
2447
+ selectedTicket: S,
2448
+ onSelectTicket: ge,
2449
+ discount: k,
2450
+ couponCode: D,
2451
+ publicCouponsCount: ae.length,
2427
2452
  onApplyCouponClick: () => P(!0),
2428
- onRemoveCoupon: he,
2429
- onNext: () => I(2)
2430
- }) }) : /* @__PURE__ */ _(Ct, {
2431
- values: oe,
2432
- handleChange: _e,
2433
- handleBlur: ve,
2434
- handleSubmit: ye,
2435
- registerLoading: y,
2436
- onBack: () => I(1),
2437
- submitLabel: be
2453
+ onRemoveCoupon: _e,
2454
+ onNext: () => F(2)
2455
+ }) }) : /* @__PURE__ */ v(kt, {
2456
+ values: se,
2457
+ handleChange: ye,
2458
+ handleBlur: be,
2459
+ handleSubmit: xe,
2460
+ registerLoading: m,
2461
+ onBack: () => F(1),
2462
+ submitLabel: Se,
2463
+ showBusinessBilling: !z
2438
2464
  })] })]
2439
2465
  })] })
2440
2466
  }),
2441
- w && /* @__PURE__ */ _(jt, {
2467
+ w && /* @__PURE__ */ v(Lt, {
2442
2468
  paymentData: w,
2443
2469
  ticketData: o,
2444
2470
  type: "confirm"
2445
2471
  }),
2446
- W && U && /* @__PURE__ */ _(Mt, {
2447
- isOpen: W,
2472
+ G && W && /* @__PURE__ */ v(Rt, {
2473
+ isOpen: G,
2448
2474
  onClose: K,
2449
- stripePromise: H,
2450
- clientSecret: U.clientSecret,
2451
- onComplete: q
2475
+ stripePromise: U,
2476
+ clientSecret: W.clientSecret,
2477
+ onComplete: de
2452
2478
  })
2453
2479
  ] });
2454
- }, zt = (e) => typeof e == "string" && e.trim() ? e : void 0, Bt = (e) => typeof e == "string" ? e : e?.location ?? void 0, Vt = (e, t) => {
2480
+ }, Gt = (e) => typeof e == "string" && e.trim() ? e : void 0, Kt = (e) => typeof e == "string" ? e : e?.location ?? void 0, qt = (e, t) => {
2455
2481
  let n = e.meta ?? {}, r = e.title && t ? `${e.title} | ${t}` : e.title || t || void 0;
2456
2482
  return {
2457
2483
  title: n.meta_title || r,
@@ -2461,33 +2487,33 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2461
2487
  og: {
2462
2488
  title: n.og_title || void 0,
2463
2489
  description: n.og_description || void 0,
2464
- image: Bt(n.og_image),
2490
+ image: Kt(n.og_image),
2465
2491
  url: n.og_url || void 0
2466
2492
  },
2467
2493
  twitter: { card: n.twitter_card || void 0 },
2468
2494
  ldJson: n.ld_json || void 0,
2469
2495
  customHead: n.head_code || void 0
2470
2496
  };
2471
- }, Ht = (e) => ({
2497
+ }, Jt = (e) => ({
2472
2498
  description: e.description || void 0,
2473
2499
  icon: e.icon?.location || void 0,
2474
2500
  customHead: e.settings?.head_code || void 0
2475
- }), Ut = (e) => (t = {}, n) => (r) => {
2476
- let i = Vt(t, e.name);
2501
+ }), Yt = (e) => (t = {}, n) => (r) => {
2502
+ let i = qt(t, e.name);
2477
2503
  if (n) {
2478
2504
  let t = r?.loaderData?.[n.source];
2479
2505
  if (t) {
2480
- let r = n.title ? zt(t[n.title]) : void 0;
2506
+ let r = n.title ? Gt(t[n.title]) : void 0;
2481
2507
  r && (i.title = e.name ? `${r} | ${e.name}` : r, i.og = {
2482
2508
  ...i.og,
2483
2509
  title: r
2484
2510
  });
2485
- let a = n.description ? zt(t[n.description]) : void 0;
2511
+ let a = n.description ? Gt(t[n.description]) : void 0;
2486
2512
  a && (i.description = a, i.og = {
2487
2513
  ...i.og,
2488
2514
  description: a
2489
2515
  });
2490
- let o = n.image ? Bt(t[n.image]) : void 0;
2516
+ let o = n.image ? Kt(t[n.image]) : void 0;
2491
2517
  o && (i.og = {
2492
2518
  ...i.og,
2493
2519
  image: o
@@ -2498,10 +2524,14 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2498
2524
  let t = r?.match?.pathname, n = (e.domain || "").trim();
2499
2525
  n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") + t);
2500
2526
  }
2501
- return bt(i, Ht(e));
2502
- }, Wt = (e) => {
2503
- let t = F(e);
2504
- return (e) => ({ context: n, params: r }) => ue({
2527
+ let a = Et(i, Jt(e)), o = t.id?.trim();
2528
+ return o && a.meta.push({
2529
+ name: gt,
2530
+ content: o
2531
+ }), a;
2532
+ }, Xt = (e) => {
2533
+ let t = I(e);
2534
+ return (e) => ({ context: n, params: r }) => pe({
2505
2535
  queryClient: n.queryClient,
2506
2536
  config: t,
2507
2537
  sources: e,
@@ -2509,4 +2539,4 @@ var Ct = ({ values: e, handleChange: t, handleBlur: n, handleSubmit: r, register
2509
2539
  });
2510
2540
  };
2511
2541
  //#endregion
2512
- export { B as ColorModeProvider, ut as Inspector, N as LevoChat, Rt as LevoEventRegister, fe as LevoForm, pt as LevoPopups, gt as LevoSiteProvider, xt as PageHead, Ut as createLevoHead, Wt as createLevoLoader, P as createSiteClient, bt as pageHead, yt as parseRawHead, ue as prefetchLevoSources, F as siteConfigFromJson, se as useColorMode, q as useLevoForm, ht as useLevoInsights, le as useLevoRecord, mt as useLevoSite, K as useLevoSource };
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 };