@levo-so/site-runtime 0.3.26 → 0.3.27

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 (3) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/index.js +975 -873
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -4,36 +4,36 @@ import { c as n, o as r, s as i, t as a } from "./inlineBaseTheme-DcNdMEYp.js";
4
4
  import { t as o } from "./inlineCollectionTheme-DjXuH3bK.js";
5
5
  import { a as s, c, d as l, f as u, i as d, l as f, n as p, o as m, r as h, s as g, t as _, u as v } from "./routes-DO1BLfh9.js";
6
6
  import { createLevoClient as y, getLevoError as b } from "@levo-so/core";
7
- import { Suspense as x, createContext as S, lazy as C, useCallback as w, useContext as T, useEffect as E, useLayoutEffect as D, useMemo as O, useRef as k, useState as A, useSyncExternalStore as j } from "react";
8
- import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
9
- import { Dialog as F } from "@base-ui/react/dialog";
10
- import { keepPreviousData as I, useMutation as L, useQuery as R, useQueryClient as z } from "@tanstack/react-query";
11
- import { Link as ee, ScriptOnce as B, redirect as te, useRouterState as V } from "@tanstack/react-router";
12
- import { createLevoInsights as ne } from "@levo-so/insights";
13
- import { ArrowLeftIcon as re, CalendarPlusIcon as ie, CheckIcon as H, ChevronDownIcon as ae, DownloadIcon as oe, LoaderCircleIcon as se, MinusIcon as ce, PlusIcon as le, XIcon as ue } from "lucide-react";
7
+ import { Suspense as x, createContext as S, lazy as C, useCallback as w, useContext as T, useEffect as E, useLayoutEffect as D, useMemo as O, useRef as k, useState as A, useSyncExternalStore as ee } from "react";
8
+ import { Fragment as j, jsx as M, jsxs as N } from "react/jsx-runtime";
9
+ import { Dialog as P } from "@base-ui/react/dialog";
10
+ import { keepPreviousData as F, useMutation as I, useQuery as L, useQueryClient as R } from "@tanstack/react-query";
11
+ import { Link as te, ScriptOnce as z, redirect as ne, useRouterState as B } from "@tanstack/react-router";
12
+ import { createLevoInsights as re } from "@levo-so/insights";
13
+ import { ArrowLeftIcon as ie, CalendarPlusIcon as ae, CheckIcon as V, ChevronDownIcon as oe, DownloadIcon as se, LoaderCircleIcon as ce, MinusIcon as le, PlusIcon as ue, TagIcon as de, XIcon as H } from "lucide-react";
14
14
  import { Accordion as U } from "@base-ui/react/accordion";
15
15
  import { Popover as W } from "@base-ui/react/popover";
16
- import { useRazorpay as de } from "react-razorpay";
17
- import { EmbeddedCheckout as fe, EmbeddedCheckoutProvider as pe } from "@stripe/react-stripe-js";
16
+ import { useRazorpay as fe } from "react-razorpay";
17
+ import { EmbeddedCheckout as pe, EmbeddedCheckoutProvider as me } from "@stripe/react-stripe-js";
18
18
  //#region src/access/types.ts
19
- var me = [
19
+ var he = [
20
20
  "otp",
21
21
  "magiclink",
22
22
  "whatsapp"
23
- ], he = [
23
+ ], ge = [
24
24
  "google",
25
25
  "microsoft",
26
26
  "linkedin"
27
- ], ge = [...me, ...he], _e = "otp", ve = (e) => typeof e == "object" && !!e && !Array.isArray(e), ye = (e) => me.includes(e), be = (e) => he.includes(e), xe = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : [], Se = (e) => e, Ce = (e) => {
28
- if (!ve(e)) return null;
29
- let t = e.enabled === void 0 ? !0 : e.enabled === !0, n = ve(e.options) ? e.options : {};
27
+ ], _e = [...he, ...ge], ve = "otp", ye = (e) => typeof e == "object" && !!e && !Array.isArray(e), be = (e) => he.includes(e), xe = (e) => ge.includes(e), Se = (e) => Array.isArray(e) ? e.filter((e) => typeof e == "string") : [], Ce = (e) => e, we = (e) => {
28
+ if (!ye(e)) return null;
29
+ let t = e.enabled === void 0 ? !0 : e.enabled === !0, n = ye(e.options) ? e.options : {};
30
30
  switch (e.kind) {
31
31
  case "authentication": return {
32
32
  kind: "authentication",
33
33
  enabled: t,
34
34
  options: {
35
- methods: xe(n.methods).filter((e) => ye(e) || be(e)),
36
- ...ye(n.primary_method) ? { primary_method: n.primary_method } : {}
35
+ methods: Se(n.methods).filter((e) => be(e) || xe(e)),
36
+ ...be(n.primary_method) ? { primary_method: n.primary_method } : {}
37
37
  }
38
38
  };
39
39
  case "gating": return typeof n.collection != "string" || !n.collection.trim() ? null : {
@@ -41,42 +41,42 @@ var me = [
41
41
  enabled: t,
42
42
  options: {
43
43
  collection: n.collection.trim(),
44
- ...ve(n.condition) ? { condition: Se(n.condition) } : {},
45
- hidden: xe(n.hidden)
44
+ ...ye(n.condition) ? { condition: Ce(n.condition) } : {},
45
+ hidden: Se(n.hidden)
46
46
  }
47
47
  };
48
48
  case "profile": return {
49
49
  kind: "profile",
50
50
  enabled: t,
51
51
  options: {
52
- ...ve(n.condition) ? { condition: Se(n.condition) } : {},
53
- hidden: xe(n.hidden)
52
+ ...ye(n.condition) ? { condition: Ce(n.condition) } : {},
53
+ hidden: Se(n.hidden)
54
54
  }
55
55
  };
56
56
  default: return null;
57
57
  }
58
- }, we = (e) => {
58
+ }, Te = (e) => {
59
59
  if (!Array.isArray(e) || e.length === 0) return {
60
60
  rules: [],
61
61
  invalid: !1
62
62
  };
63
- let t = e.map(Ce).filter((e) => e !== null);
63
+ let t = e.map(we).filter((e) => e !== null);
64
64
  return {
65
65
  rules: t.filter((e) => e.enabled !== !1),
66
66
  invalid: t.length === 0
67
67
  };
68
- }, Te = (e) => {
68
+ }, Ee = (e) => {
69
69
  let t = e.find((e) => e.kind === "authentication"), n = t?.kind === "authentication" ? t.options?.methods ?? [] : [];
70
70
  return {
71
- primary: (t?.kind === "authentication" ? t.options?.primary_method : void 0) ?? n.find(ye) ?? _e,
72
- oauth: n.filter(be)
71
+ primary: (t?.kind === "authentication" ? t.options?.primary_method : void 0) ?? n.find(be) ?? ve,
72
+ oauth: n.filter(xe)
73
73
  };
74
- }, Ee = (e = null) => ({
74
+ }, De = (e = null) => ({
75
75
  state: "granted",
76
76
  code: e,
77
77
  message: null,
78
78
  rule: null
79
- }), De = () => ({
79
+ }), Oe = () => ({
80
80
  state: "checking",
81
81
  code: null,
82
82
  message: null,
@@ -86,26 +86,26 @@ var me = [
86
86
  code: e,
87
87
  message: t,
88
88
  rule: n
89
- }), Oe = (e, t) => {
89
+ }), ke = (e, t) => {
90
90
  let n = t?.split(".")[0];
91
91
  return e.find((e) => e.kind === n) ?? null;
92
- }, ke = (e, t) => {
92
+ }, Ae = (e, t) => {
93
93
  let n = (e) => t.find((t) => t.kind === e);
94
- if (e === "granted") return Ee();
94
+ if (e === "granted") return De();
95
95
  if (e === "signed_out") return G("authentication.NOT_LOGGED_IN", "You need to be signed in to view this page.", n("authentication") ?? t[0] ?? null);
96
96
  let r = n("gating");
97
97
  if (e === "entry_missing" && r) return G("gating.ENTRY_NOT_FOUND", null, r);
98
98
  if (e === "entry_under_review" && r) return G("gating.ENTRY_CONDITION_NOT_FULFILLED", "Your submission is being reviewed.", r);
99
99
  let i = n("profile");
100
100
  return e === "profile_incomplete" && i ? G("profile.CONDITION_NOT_FULFILLED", null, i) : null;
101
- }, Ae = ({ rules: e, invalid: t, pageId: n, hasClient: r, isReady: i, isLoggedIn: a, check: o, preview: s }) => {
102
- if (e.length === 0 && !t) return Ee();
101
+ }, je = ({ rules: e, invalid: t, pageId: n, hasClient: r, isReady: i, isLoggedIn: a, check: o, preview: s }) => {
102
+ if (e.length === 0 && !t) return De();
103
103
  if (s) {
104
- let t = ke(s, e);
104
+ let t = Ae(s, e);
105
105
  if (t) return t;
106
106
  }
107
- return t ? G("access.CONFIG_INVALID", "This page's access rules could not be read.") : i ? r ? a ? n ? o.isError ? G("access.CHECK_FAILED", "We could not verify your access.") : o.isSuccess ? o.data ? o.data.has_access ? Ee(o.data.code ?? null) : G(o.data.code ?? "access.CHECK_FAILED", o.data.message ?? null, Oe(e, o.data.code)) : G("access.CHECK_FAILED", "We could not verify your access.") : De() : G("access.PAGE_NOT_IDENTIFIED", "This page is not linked to its access rules yet.") : G("authentication.NOT_LOGGED_IN", "You need to be signed in to view this page.", e.find((e) => e.kind === "authentication") ?? e[0] ?? null) : G("access.UNWIRED", "This site is not connected to an account system.") : De();
108
- }, je = (e) => {
107
+ return t ? G("access.CONFIG_INVALID", "This page's access rules could not be read.") : i ? r ? a ? n ? o.isError ? G("access.CHECK_FAILED", "We could not verify your access.") : o.isSuccess ? o.data ? o.data.has_access ? De(o.data.code ?? null) : G(o.data.code ?? "access.CHECK_FAILED", o.data.message ?? null, ke(e, o.data.code)) : G("access.CHECK_FAILED", "We could not verify your access.") : Oe() : G("access.PAGE_NOT_IDENTIFIED", "This page is not linked to its access rules yet.") : G("authentication.NOT_LOGGED_IN", "You need to be signed in to view this page.", e.find((e) => e.kind === "authentication") ?? e[0] ?? null) : G("access.UNWIRED", "This site is not connected to an account system.") : Oe();
108
+ }, Me = (e) => {
109
109
  let t = (e?.apiUrl || "").replace(/\/$/, "");
110
110
  return t ? y({
111
111
  apiUrl: t,
@@ -114,15 +114,15 @@ var me = [
114
114
  NODE_ENV: "",
115
115
  APP_MODE: e?.appMode || "production"
116
116
  }) : null;
117
- }, Me = (e) => ({
117
+ }, Ne = (e) => ({
118
118
  apiUrl: e.levo?.api_url || "",
119
119
  workspace: e.workspace_id || "",
120
120
  siteId: e.id || "",
121
121
  insightsUrl: e.levo?.insights_url || null,
122
122
  appMode: e.levo?.app_mode || "production"
123
- }), Ne = /\{\$([A-Za-z0-9_]+)\}/g, Pe = (e) => {
123
+ }), Pe = /\{\$([A-Za-z0-9_]+)\}/g, Fe = (e) => {
124
124
  let t = [], n = [], r = 0;
125
- for (let i of e.matchAll(Ne)) n.push(e.slice(r, i.index)), t.push(i[1]), r = i.index + i[0].length;
125
+ for (let i of e.matchAll(Pe)) n.push(e.slice(r, i.index)), t.push(i[1]), r = i.index + i[0].length;
126
126
  n.push(e.slice(r));
127
127
  let i = (t) => /* @__PURE__ */ Error(`Levo pattern "${e}" ${t}`);
128
128
  if (t.length === 0) throw i("names no variable: write each record as {$name}");
@@ -133,10 +133,10 @@ var me = [
133
133
  names: t,
134
134
  literals: n
135
135
  };
136
- }, Fe = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), Ie = ({ literals: e }) => RegExp(`^${e.map(Fe).join("([^/]+)")}$`), Le = /* @__PURE__ */ new Set(), Re = (e, t, n) => {
137
- let r = Pe(t), i = Ie(r), a = (e) => {
136
+ }, Ie = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), Le = ({ literals: e }) => RegExp(`^${e.map(Ie).join("([^/]+)")}$`), Re = /* @__PURE__ */ new Set(), ze = (e, t, n) => {
137
+ let r = Fe(t), i = Le(r), a = (e) => {
138
138
  let n = e;
139
- return t.replace(Ne, (e, r) => {
139
+ return t.replace(Pe, (e, r) => {
140
140
  let i = n[r];
141
141
  if (!i) throw Error(`Levo pattern "${t}" has no value for {$${r}}`);
142
142
  return i;
@@ -146,7 +146,7 @@ var me = [
146
146
  parse: (t) => {
147
147
  if (!Object.hasOwn(t, e)) {
148
148
  let n = Object.keys(t).join(", ") || "none";
149
- return Le.has(e) || (Le.add(e), console.error(`levoParams("${e}", …) names a param this route does not have. Its params are: ${n}. The first argument must be the file's $param name.`)), !1;
149
+ return Re.has(e) || (Re.add(e), console.error(`levoParams("${e}", …) names a param this route does not have. Its params are: ${n}. The first argument must be the file's $param name.`)), !1;
150
150
  }
151
151
  let n = t[e], a = n ? i.exec(n) : null;
152
152
  if (!a) return !1;
@@ -162,33 +162,33 @@ var me = [
162
162
  [e]: a(t)
163
163
  })
164
164
  };
165
- }, ze = (e, t, n) => Object.prototype.hasOwnProperty.call(n, t) ? null : `Record binding "${e}" reads param "${t}", but this route has no such param. Its params are: ${Object.keys(n).join(", ") || "none"}. On a levoParams page, param names a pattern variable (packages, cities), never the segment.`, Be = (e) => [
165
+ }, Be = (e, t, n) => Object.prototype.hasOwnProperty.call(n, t) ? null : `Record binding "${e}" reads param "${t}", but this route has no such param. Its params are: ${Object.keys(n).join(", ") || "none"}. On a levoParams page, param names a pattern variable (packages, cities), never the segment.`, Ve = (e) => [
166
166
  "levo-source",
167
167
  "list",
168
168
  e.module,
169
169
  e.identifier,
170
170
  e.query ?? null,
171
171
  e.options ?? null
172
- ], Ve = (e, t) => [
172
+ ], He = (e, t) => [
173
173
  "levo-source",
174
174
  "record",
175
175
  e.module,
176
176
  e.identifier,
177
177
  t ?? null
178
- ], He = (e) => [
178
+ ], Ue = (e) => [
179
179
  "levo-source",
180
180
  "form",
181
181
  e.module,
182
182
  e.identifier
183
- ], Ue = {
183
+ ], We = {
184
184
  blog_author: "author",
185
185
  blog_category: "category",
186
186
  blog_tag: "tag"
187
- }, We = (e, t) => {
188
- let n = encodeURIComponent(e.identifier), r = t ? `${encodeURIComponent(t)}/get-single` : "list", i = Ue[e.module];
187
+ }, Ge = (e, t) => {
188
+ let n = encodeURIComponent(e.identifier), r = t ? `${encodeURIComponent(t)}/get-single` : "list", i = We[e.module];
189
189
  return i ? `/v1/blog/${n}/${i}/${r}` : e.module === "community" ? `/v1/community/${n}/post/${r}` : null;
190
- }, Ge = async (e, t) => {
191
- let n = We(t);
190
+ }, Ke = async (e, t) => {
191
+ let n = Ge(t);
192
192
  if (n) {
193
193
  let r = await e.fetch.url(n).post(t.query ?? {}).json();
194
194
  return {
@@ -204,16 +204,16 @@ var me = [
204
204
  data: r.content.data ?? [],
205
205
  meta: r.content.meta ?? null
206
206
  };
207
- }, Ke = async (e, t, n) => {
208
- let r = We(t, n);
207
+ }, qe = async (e, t, n) => {
208
+ let r = Ge(t, n);
209
209
  return r ? (await e.fetch.url(r).get().json()).content.data ?? null : (t.module === "collection" ? await e.collection.getCollectionContent({
210
210
  collection_key: t.identifier,
211
211
  slug: n
212
212
  }) : t.module === "blog" ? await e.blog.getSingleBlog(t.identifier, n, { workspace_id: e.workspace ?? "" }) : await e.event.getSingleEvent(n, { workspace_id: e.workspace ?? "" })).content.data ?? null;
213
- }, qe = async (e, t) => (await e.collection.getCollectionByIDExpanded(t.identifier)).content.data ?? null, Je = (e) => {
214
- let t = i(), n = R({
215
- queryKey: Be(e),
216
- queryFn: () => Ge(t, e),
213
+ }, Je = async (e, t) => (await e.collection.getCollectionByIDExpanded(t.identifier)).content.data ?? null, Ye = (e) => {
214
+ let t = i(), n = L({
215
+ queryKey: Ve(e),
216
+ queryFn: () => Ke(t, e),
217
217
  enabled: !!t
218
218
  });
219
219
  return {
@@ -226,10 +226,10 @@ var me = [
226
226
  ...e
227
227
  }) }
228
228
  };
229
- }, Ye = (e, t) => {
230
- let n = i(), r = R({
231
- queryKey: Ve(e, t),
232
- queryFn: () => Ke(n, e, t),
229
+ }, Xe = (e, t) => {
230
+ let n = i(), r = L({
231
+ queryKey: He(e, t),
232
+ queryFn: () => qe(n, e, t),
233
233
  enabled: !!n && !!t
234
234
  });
235
235
  return {
@@ -241,10 +241,10 @@ var me = [
241
241
  ...e
242
242
  }) }
243
243
  };
244
- }, Xe = (e) => {
245
- let t = i(), n = R({
246
- queryKey: He(e),
247
- queryFn: () => qe(t, e),
244
+ }, Ze = (e) => {
245
+ let t = i(), n = L({
246
+ queryKey: Ue(e),
247
+ queryFn: () => Je(t, e),
248
248
  enabled: !!t
249
249
  });
250
250
  return {
@@ -256,35 +256,35 @@ var me = [
256
256
  ...e
257
257
  }) }
258
258
  };
259
- }, Ze = (e) => {
259
+ }, Qe = (e) => {
260
260
  let t = Object.values(e ?? {});
261
261
  return t.length === 1 ? t[0] : e?.slug;
262
- }, Qe = async ({ queryClient: e, config: t, sources: n, params: r }) => {
263
- let i = je(t);
262
+ }, $e = async ({ queryClient: e, config: t, sources: n, params: r }) => {
263
+ let i = Me(t);
264
264
  if (!i || !n) return {};
265
265
  let a = await Promise.all(Object.entries(n).map(async ([t, n]) => {
266
266
  if (n.mode === "record") {
267
- let a = n.param ? ze(t, n.param, r ?? {}) : null;
267
+ let a = n.param ? Be(t, n.param, r ?? {}) : null;
268
268
  if (a) {
269
269
  if (i.APP_MODE !== "production") throw Error(a);
270
270
  return i.logger.error(a), [t, null];
271
271
  }
272
- let o = n.param ? r?.[n.param] : Ze(r);
272
+ let o = n.param ? r?.[n.param] : Qe(r);
273
273
  return o ? [t, await e.ensureQueryData({
274
- queryKey: Ve(n, o),
275
- queryFn: () => Ke(i, n, o)
274
+ queryKey: He(n, o),
275
+ queryFn: () => qe(i, n, o)
276
276
  }).catch(() => null)] : [t, null];
277
277
  }
278
278
  return n.mode === "form" ? [t, await e.ensureQueryData({
279
- queryKey: He(n),
280
- queryFn: () => qe(i, n)
279
+ queryKey: Ue(n),
280
+ queryFn: () => Je(i, n)
281
281
  }).catch(() => null)] : [t, await e.ensureQueryData({
282
- queryKey: Be(n),
283
- queryFn: () => Ge(i, n)
282
+ queryKey: Ve(n),
283
+ queryFn: () => Ke(i, n)
284
284
  }).catch(() => null)];
285
285
  }));
286
286
  return Object.fromEntries(a);
287
- }, $e = {
287
+ }, et = {
288
288
  background: "var(--color-page)",
289
289
  foreground: "var(--color-ink)",
290
290
  text: "var(--color-ink)",
@@ -306,10 +306,10 @@ var me = [
306
306
  input: "var(--color-background1)",
307
307
  inputForeground: "var(--color-ink)",
308
308
  ring: "var(--color-brand)"
309
- }, et = (e) => O(() => ({
309
+ }, tt = (e) => O(() => ({
310
310
  ...a({
311
311
  colors: {
312
- ...$e,
312
+ ...et,
313
313
  ...e?.colors
314
314
  },
315
315
  radius: e?.radius ?? "var(--radius-token)",
@@ -328,8 +328,8 @@ function K() {
328
328
  }
329
329
  //#endregion
330
330
  //#region src/access/useLevoAuth.ts
331
- var q = ["levo-auth", "session"], tt = () => {
332
- let e = i(), t = z(), n = K(), r = R({
331
+ var q = ["levo-auth", "session"], nt = () => {
332
+ let e = i(), t = R(), n = K(), r = L({
333
333
  queryKey: q,
334
334
  queryFn: async () => {
335
335
  try {
@@ -341,7 +341,7 @@ var q = ["levo-auth", "session"], tt = () => {
341
341
  enabled: n && !!e,
342
342
  staleTime: 3e4,
343
343
  retry: !1
344
- }), a = L({
344
+ }), a = I({
345
345
  mutationFn: async () => {
346
346
  await e?.membership?.signOut();
347
347
  },
@@ -363,14 +363,14 @@ var q = ["levo-auth", "session"], tt = () => {
363
363
  signOut: s,
364
364
  isSigningOut: a.isPending
365
365
  };
366
- }, nt = ({ collection: e, hidden: n, submitLabel: r = "Submit", onSuccess: a, theme: o, className: s }) => {
367
- let c = i(), { account: l } = tt(), { schema: u, isLoading: d } = Xe({
366
+ }, rt = ({ collection: e, hidden: n, submitLabel: r = "Submit", onSuccess: a, theme: o, className: s }) => {
367
+ let c = i(), { account: l } = nt(), { schema: u, isLoading: d } = Ze({
368
368
  module: "collection",
369
369
  identifier: e
370
- }), f = et(o);
371
- return c ? /* @__PURE__ */ N("div", {
370
+ }), f = tt(o);
371
+ return c ? /* @__PURE__ */ M("div", {
372
372
  className: s,
373
- children: /* @__PURE__ */ N(t, {
373
+ children: /* @__PURE__ */ M(t, {
374
374
  fetchedSchema: u,
375
375
  isLoading: d,
376
376
  submitButtonConfig: {
@@ -391,17 +391,17 @@ var q = ["levo-auth", "session"], tt = () => {
391
391
  onSuccess: () => a?.()
392
392
  })
393
393
  }) : null;
394
- }, rt = "so_levo_membership_account", it = [
394
+ }, it = "so_levo_membership_account", at = [
395
395
  "profile_picture",
396
396
  "first_name",
397
397
  "last_name",
398
398
  "email",
399
399
  "username",
400
400
  "socials"
401
- ], at = ["email", "username"], ot = (e) => it.includes(e.key) || e.editable === !0, st = ({ hidden: t, submitLabel: n = "Save and continue", onSuccess: r, errorClassName: a = "text-sm text-[var(--color-danger)]", theme: o, className: s }) => {
402
- let c = i(), l = K(), { account: u } = tt(), d = et(o), [f, p] = A(""), m = R({
401
+ ], ot = ["email", "username"], st = (e) => at.includes(e.key) || e.editable === !0, ct = ({ hidden: t, submitLabel: n = "Save and continue", onSuccess: r, errorClassName: a = "text-sm text-[var(--color-danger)]", theme: o, className: s }) => {
402
+ let c = i(), l = K(), { account: u } = nt(), d = tt(o), [f, p] = A(""), m = L({
403
403
  queryKey: ["levo-access", "profile-schema"],
404
- queryFn: async () => (await c?.collection?.getCollectionByIDExpanded(rt))?.content?.data ?? null,
404
+ queryFn: async () => (await c?.collection?.getCollectionByIDExpanded(it))?.content?.data ?? null,
405
405
  enabled: l && !!c,
406
406
  staleTime: 5 * 6e4,
407
407
  retry: 1
@@ -413,14 +413,14 @@ var q = ["levo-auth", "session"], tt = () => {
413
413
  ...e,
414
414
  fields: e.fields?.map((e) => ({
415
415
  ...e,
416
- hidden: !ot(e) || !!t?.includes(e.key),
417
- readonly: e.readonly || at.includes(e.key)
416
+ hidden: !st(e) || !!t?.includes(e.key),
417
+ readonly: e.readonly || ot.includes(e.key)
418
418
  }))
419
419
  }))
420
420
  } : null;
421
- }, [m.data, h]), _ = L({
421
+ }, [m.data, h]), _ = I({
422
422
  mutationFn: async (e) => {
423
- let n = g?.sections?.flatMap((e) => e?.fields ?? [])?.filter((e) => ot(e) && !at.includes(e.key) && !t?.includes(e.key))?.map((e) => e?.key) ?? [];
423
+ let n = g?.sections?.flatMap((e) => e?.fields ?? [])?.filter((e) => st(e) && !ot.includes(e.key) && !t?.includes(e.key))?.map((e) => e?.key) ?? [];
424
424
  await c?.membership?.updateMe(Object.fromEntries(Object.entries(e).filter(([e]) => n.includes(e))));
425
425
  },
426
426
  onMutate: () => p(""),
@@ -430,12 +430,12 @@ var q = ["levo-auth", "session"], tt = () => {
430
430
  c?.logger?.error("Failed to update profile", { exception: t }), p(t?.message || "Something went wrong. Please try again.");
431
431
  }
432
432
  });
433
- return c ? /* @__PURE__ */ P("div", {
433
+ return c ? /* @__PURE__ */ N("div", {
434
434
  className: s,
435
- children: [f ? /* @__PURE__ */ N("p", {
435
+ children: [f ? /* @__PURE__ */ M("p", {
436
436
  className: a,
437
437
  children: f
438
- }) : null, g ? /* @__PURE__ */ N(e, {
438
+ }) : null, g ? /* @__PURE__ */ M(e, {
439
439
  schema: g,
440
440
  initialValues: u ?? {},
441
441
  uiConfig: {
@@ -451,15 +451,15 @@ var q = ["levo-auth", "session"], tt = () => {
451
451
  onSubmit: (e) => _.mutate(e)
452
452
  }) : null]
453
453
  }) : null;
454
- }, ct = null, lt = /* @__PURE__ */ new Set(), ut = (e) => {
455
- if (ct !== e) {
456
- ct = e;
457
- for (let e of lt) e();
454
+ }, lt = null, ut = /* @__PURE__ */ new Set(), dt = (e) => {
455
+ if (lt !== e) {
456
+ lt = e;
457
+ for (let e of ut) e();
458
458
  }
459
- }, dt = (e) => (lt.add(e), () => {
460
- lt.delete(e);
461
- }), ft = () => j(dt, () => ct, () => null), pt = (e) => {
462
- let t = i(), n = z(), r = K(), { isLoggedIn: a, isLoaded: o } = tt(), s = ft(), c = e.id?.trim() || "", { rules: l, invalid: u } = O(() => we(e.access), [e.access]), d = O(() => Te(l), [l]), f = r && !!t && l.length > 0 && !u && !!c && a && !s, p = R({
459
+ }, ft = (e) => (ut.add(e), () => {
460
+ ut.delete(e);
461
+ }), pt = () => ee(ft, () => lt, () => null), mt = (e) => {
462
+ let t = i(), n = R(), r = K(), { isLoggedIn: a, isLoaded: o } = nt(), s = pt(), c = e.id?.trim() || "", { rules: l, invalid: u } = O(() => Te(e.access), [e.access]), d = O(() => Ee(l), [l]), f = r && !!t && l.length > 0 && !u && !!c && a && !s, p = L({
463
463
  queryKey: ["levo-access", c],
464
464
  queryFn: async () => (await t?.fetch.url(`/v1/builder/page/${c}/check-access`).post().json())?.content?.data ?? null,
465
465
  enabled: f,
@@ -477,7 +477,7 @@ var q = ["levo-auth", "session"], tt = () => {
477
477
  n.invalidateQueries({ queryKey: q }), n.invalidateQueries({ queryKey: ["levo-access", c] });
478
478
  }, [n, c]);
479
479
  return {
480
- ...Ae({
480
+ ...je({
481
481
  rules: l,
482
482
  invalid: u,
483
483
  pageId: c,
@@ -495,26 +495,26 @@ var q = ["levo-auth", "session"], tt = () => {
495
495
  recheck: m,
496
496
  isChecking: p.isFetching
497
497
  };
498
- }, mt = "membership.account.ACCOUNT_PENDING_APPROVAL", ht = (e) => e ? e === "membership.account.ACCOUNT_PENDING_APPROVAL" || e.includes("ACCOUNT_PENDING_APPROVAL") : !1, gt = (e) => {
498
+ }, ht = "membership.account.ACCOUNT_PENDING_APPROVAL", gt = (e) => e ? e === "membership.account.ACCOUNT_PENDING_APPROVAL" || e.includes("ACCOUNT_PENDING_APPROVAL") : !1, _t = (e) => {
499
499
  let t = b(e);
500
500
  return {
501
501
  code: t?.code || "SOMETHING_WENT_WRONG",
502
502
  title: t?.title || "Something went wrong",
503
503
  message: t?.message || "Something went wrong. Please try again.",
504
504
  fieldErrors: Object.fromEntries((t?.fieldErrors ?? []).map((e) => [e.param, e.message])),
505
- isPendingApproval: ht(t?.code)
505
+ isPendingApproval: gt(t?.code)
506
506
  };
507
- }, _t = {
507
+ }, vt = {
508
508
  code: "site.NOT_CONNECTED",
509
509
  title: "Sign-in unavailable",
510
510
  message: "This site is not connected to an account system yet.",
511
511
  fieldErrors: {},
512
512
  isPendingApproval: !1
513
- }, vt = () => {
514
- let e = i(), t = z(), n = w(async (t, n) => {
513
+ }, yt = () => {
514
+ let e = i(), t = R(), n = w(async (t, n) => {
515
515
  if (!e?.membership) return {
516
516
  ok: !1,
517
- error: _t
517
+ error: vt
518
518
  };
519
519
  try {
520
520
  return {
@@ -525,7 +525,7 @@ var q = ["levo-auth", "session"], tt = () => {
525
525
  let r = b(n);
526
526
  return e.logger?.error(t, { exception: r }), {
527
527
  ok: !1,
528
- error: gt(r)
528
+ error: _t(r)
529
529
  };
530
530
  }
531
531
  }, [e]), r = w(async ({ identifier: t, medium: n }) => {
@@ -533,13 +533,13 @@ var q = ["levo-auth", "session"], tt = () => {
533
533
  content: t,
534
534
  ...n === "whatsapp" ? { medium: "whatsapp" } : {}
535
535
  });
536
- }, [e]), a = L({ mutationFn: (e) => n("Failed to send verification code", () => r(e)) }), o = L({ mutationFn: (e) => n("Failed to resend verification code", () => r(e)) }), s = L({ mutationFn: ({ identifier: r, code: i }) => n("Verification failed", async () => {
536
+ }, [e]), a = I({ mutationFn: (e) => n("Failed to send verification code", () => r(e)) }), o = I({ mutationFn: (e) => n("Failed to resend verification code", () => r(e)) }), s = I({ mutationFn: ({ identifier: r, code: i }) => n("Verification failed", async () => {
537
537
  let n = await e?.membership?.signInWithOtp({
538
538
  content: r,
539
539
  code: i
540
540
  }) ?? null;
541
541
  return t.setQueryData(q, n), t.invalidateQueries({ queryKey: q }), n;
542
- }) }), c = L({ mutationFn: (t) => n("Failed to send magic link", async () => {
542
+ }) }), c = I({ mutationFn: (t) => n("Failed to send magic link", async () => {
543
543
  await e?.membership?.requestMagicLink({ content: t });
544
544
  }) });
545
545
  return {
@@ -552,11 +552,11 @@ var q = ["levo-auth", "session"], tt = () => {
552
552
  isVerifying: s.isPending,
553
553
  isSendingMagicLink: c.isPending
554
554
  };
555
- }, yt = 700, bt = 500, xt = 700, St = (e, t) => {
556
- let n = window.screenX + (window.outerWidth - bt) / 2, r = window.screenY + (window.outerHeight - xt) / 2.5;
557
- return window.open(e, t, `width=${bt},height=${xt},left=${n},top=${r}`);
558
- }, Ct = ({ methods: e, title: t = "Sign in", onSuccess: n, onError: r }) => {
559
- let a = i(), o = z(), s = K(), [c, l] = A(null), [u, d] = A(null), f = k(null), p = k(void 0), m = k({
555
+ }, bt = 700, xt = 500, St = 700, Ct = (e, t) => {
556
+ let n = window.screenX + (window.outerWidth - xt) / 2, r = window.screenY + (window.outerHeight - St) / 2.5;
557
+ return window.open(e, t, `width=${xt},height=${St},left=${n},top=${r}`);
558
+ }, wt = ({ methods: e, title: t = "Sign in", onSuccess: n, onError: r }) => {
559
+ let a = i(), o = R(), s = K(), [c, l] = A(null), [u, d] = A(null), f = k(null), p = k(void 0), m = k({
560
560
  onSuccess: n,
561
561
  onError: r
562
562
  });
@@ -564,7 +564,7 @@ var q = ["levo-auth", "session"], tt = () => {
564
564
  onSuccess: n,
565
565
  onError: r
566
566
  };
567
- let h = R({
567
+ let h = L({
568
568
  queryKey: ["levo-auth", "oauth-urls"],
569
569
  queryFn: async () => await a?.membership?.getOAuthURL() ?? null,
570
570
  enabled: s && !!a && e.length > 0,
@@ -612,10 +612,10 @@ var q = ["levo-auth", "session"], tt = () => {
612
612
  title: t.get("title") || "Sign-in failed",
613
613
  message: t.get("message") || "We could not sign you in. Please try again.",
614
614
  fieldErrors: {},
615
- isPendingApproval: ht(t.get("code"))
615
+ isPendingApproval: gt(t.get("code"))
616
616
  };
617
617
  r.isPendingApproval || d(r), m.current.onError?.(r);
618
- }, yt);
618
+ }, bt);
619
619
  }, [o, g]), v = O(() => {
620
620
  let e = h.data;
621
621
  if (!e || typeof window > "u") return {};
@@ -636,7 +636,7 @@ var q = ["levo-auth", "session"], tt = () => {
636
636
  signIn: () => {
637
637
  let n = v[e];
638
638
  if (n) {
639
- if (d(null), f.current?.close(), f.current = St(n, t), !f.current) {
639
+ if (d(null), f.current?.close(), f.current = Ct(n, t), !f.current) {
640
640
  d({
641
641
  code: "POPUP_BLOCKED",
642
642
  title: "Popup blocked",
@@ -660,10 +660,10 @@ var q = ["levo-auth", "session"], tt = () => {
660
660
  error: u,
661
661
  clearError: w(() => d(null), [])
662
662
  };
663
- }, wt = 4, Tt = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.trim()), Et = (e) => (/* @__PURE__ */ RegExp("^\\d{4}$")).test(e.trim()), Dt = (e) => {
663
+ }, Tt = 4, Et = (e) => /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.trim()), Dt = (e) => (/* @__PURE__ */ RegExp("^\\d{4}$")).test(e.trim()), Ot = (e) => {
664
664
  let t = e.replace(/\D/g, "").replace(/^0+/, "");
665
665
  return t ? `+${t}` : "";
666
- }, Ot = (e) => /^\+[1-9]\d{7,14}$/.test(Dt(e)), kt = ({ value: e, onChange: t, length: n = 4, onComplete: r, autoFocus: i, disabled: a }) => {
666
+ }, kt = (e) => /^\+[1-9]\d{7,14}$/.test(Ot(e)), At = ({ value: e, onChange: t, length: n = 4, onComplete: r, autoFocus: i, disabled: a }) => {
667
667
  let o = k([]), [s, c] = A(null), l = k(r);
668
668
  l.current = r;
669
669
  let u = Array.from({ length: n }, (t, n) => e[n] ?? ""), d = w((e) => {
@@ -747,11 +747,11 @@ var q = ["levo-auth", "session"], tt = () => {
747
747
  },
748
748
  clear: w(() => f("", 0), [f])
749
749
  };
750
- }, At = C(() => import("./kbChat-eFsau7hG.js")), jt = ({ site: e, path: t }) => {
750
+ }, jt = C(() => import("./kbChat-eFsau7hG.js")), Mt = ({ site: e, path: t }) => {
751
751
  let n = K(), r = e.workspace_id || void 0;
752
- return !n || !r ? null : /* @__PURE__ */ N(x, {
752
+ return !n || !r ? null : /* @__PURE__ */ M(x, {
753
753
  fallback: null,
754
- children: /* @__PURE__ */ N(At, {
754
+ children: /* @__PURE__ */ M(jt, {
755
755
  workspaceId: r,
756
756
  siteName: e.name || void 0,
757
757
  siteLogo: void 0,
@@ -761,77 +761,77 @@ var q = ["levo-auth", "session"], tt = () => {
761
761
  path: t
762
762
  })
763
763
  });
764
- }, Mt = "(prefers-color-scheme: dark)", Nt = (e) => {
764
+ }, Nt = "(prefers-color-scheme: dark)", Pt = (e) => {
765
765
  try {
766
766
  let t = localStorage.getItem(e);
767
767
  return t === "light" || t === "dark" || t === "system" ? t : null;
768
768
  } catch {
769
769
  return null;
770
770
  }
771
- }, Pt = (e, t) => {
771
+ }, Ft = (e, t) => {
772
772
  try {
773
773
  localStorage.setItem(e, t);
774
774
  } catch {}
775
775
  };
776
- function Ft(e, t) {
777
- return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${Mt}').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){}})();`;
776
+ function It(e, t) {
777
+ return `(function(){try{var t=localStorage.getItem(${JSON.stringify(e)});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${JSON.stringify(t)}}var d=matchMedia('${Nt}').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){}})();`;
778
778
  }
779
- var It = S(void 0), Lt = (e) => e === "system" ? window.matchMedia(Mt).matches ? "dark" : "light" : e;
780
- function Rt(e) {
779
+ var Lt = S(void 0), Rt = (e) => e === "system" ? window.matchMedia(Nt).matches ? "dark" : "light" : e;
780
+ function zt(e) {
781
781
  let t = document.documentElement;
782
782
  t.classList.remove("light", "dark"), t.classList.add(e), t.style.colorScheme = e;
783
783
  }
784
- var zt = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode" }) => {
784
+ var Bt = ({ children: e, defaultMode: t = "system", storageKey: n = "color-mode" }) => {
785
785
  let [r, i] = A(t), [a, o] = A(t === "dark" ? "dark" : "light"), s = K();
786
786
  return E(() => {
787
- i(Nt(n) ?? t);
787
+ i(Pt(n) ?? t);
788
788
  }, [t, n]), E(() => {
789
789
  if (!s) return;
790
- let e = Lt(r);
791
- Rt(e), o(e);
790
+ let e = Rt(r);
791
+ zt(e), o(e);
792
792
  }, [r, s]), E(() => {
793
793
  if (!s || r !== "system") return;
794
- let e = window.matchMedia(Mt), t = () => {
794
+ let e = window.matchMedia(Nt), t = () => {
795
795
  let t = e.matches ? "dark" : "light";
796
- Rt(t), o(t);
796
+ zt(t), o(t);
797
797
  };
798
798
  return e.addEventListener("change", t), () => e.removeEventListener("change", t);
799
- }, [r, s]), /* @__PURE__ */ P(It.Provider, {
799
+ }, [r, s]), /* @__PURE__ */ N(Lt.Provider, {
800
800
  value: {
801
801
  mode: r,
802
802
  resolvedMode: a,
803
803
  setMode: (e) => {
804
- Pt(n, e), i(e);
804
+ Ft(n, e), i(e);
805
805
  }
806
806
  },
807
- children: [/* @__PURE__ */ N(B, { children: Ft(n, t) }), e]
807
+ children: [/* @__PURE__ */ M(z, { children: It(n, t) }), e]
808
808
  });
809
809
  };
810
- function Bt() {
811
- let e = T(It);
810
+ function Vt() {
811
+ let e = T(Lt);
812
812
  if (e === void 0) throw Error("useColorMode must be used within a ColorModeProvider");
813
813
  return e;
814
814
  }
815
815
  //#endregion
816
816
  //#region src/form/LevoEditForm.tsx
817
- var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.allow_public_view !== !1 && e.allow_public_submit !== !1, Ht = ({ source: t, initialValues: n, onSubmit: r, isLoading: i, hiddenFields: a, submitLabel: o = "Save changes", theme: s, className: c }) => {
818
- let { schema: l, bind: u } = Xe(t), d = et(s), f = O(() => l ? {
817
+ var Ht = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.allow_public_view !== !1 && e.allow_public_submit !== !1, Ut = ({ source: t, initialValues: n, onSubmit: r, isLoading: i, hiddenFields: a, submitLabel: o = "Save changes", theme: s, className: c }) => {
818
+ let { schema: l, bind: u } = Ze(t), d = tt(s), f = O(() => l ? {
819
819
  ...l,
820
820
  sections: l.sections?.map((e) => ({
821
821
  ...e,
822
822
  fields: e.fields?.map((e) => ({
823
823
  ...e,
824
- hidden: !Vt(e, a)
824
+ hidden: !Ht(e, a)
825
825
  }))
826
826
  }))
827
827
  } : null, [l, a?.join("|") ?? ""]), p = (e) => {
828
- let t = l?.sections?.flatMap((e) => e?.fields ?? []).filter((e) => Vt(e, a)).map((e) => e.key) ?? [];
828
+ let t = l?.sections?.flatMap((e) => e?.fields ?? []).filter((e) => Ht(e, a)).map((e) => e.key) ?? [];
829
829
  r(Object.fromEntries(Object.entries(e).filter(([e]) => t.includes(e))));
830
830
  };
831
- return /* @__PURE__ */ N("div", {
831
+ return /* @__PURE__ */ M("div", {
832
832
  ...u,
833
833
  className: c,
834
- children: f ? /* @__PURE__ */ N(e, {
834
+ children: f ? /* @__PURE__ */ M(e, {
835
835
  schema: f,
836
836
  initialValues: n ?? {},
837
837
  uiConfig: {
@@ -847,12 +847,12 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
847
847
  onSubmit: (e) => p(e)
848
848
  }) : null
849
849
  });
850
- }, Ut = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant: a = "default", successConfig: o, theme: s, className: c, defaultValues: l, disabled: u, showSuccessScreen: d = !0, onSuccess: f, onError: p }) => {
851
- let m = i(), { schema: h, isLoading: g, bind: _ } = Xe(e), v = et(s);
852
- return m ? /* @__PURE__ */ N("div", {
850
+ }, Wt = ({ source: e, submitLabel: n = "Submit", hiddenFields: r, formVariant: a = "default", successConfig: o, theme: s, className: c, defaultValues: l, disabled: u, showSuccessScreen: d = !0, onSuccess: f, onError: p }) => {
851
+ let m = i(), { schema: h, isLoading: g, bind: _ } = Ze(e), v = tt(s);
852
+ return m ? /* @__PURE__ */ M("div", {
853
853
  ..._,
854
854
  className: c,
855
- children: /* @__PURE__ */ N(t, {
855
+ children: /* @__PURE__ */ M(t, {
856
856
  fetchedSchema: h,
857
857
  isLoading: g,
858
858
  submitButtonConfig: {
@@ -878,28 +878,28 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
878
878
  onError: p
879
879
  })
880
880
  }) : null;
881
- }, Wt = 1400, Gt = 12 * 1024 * 1024, Kt = new Set(["transparent", "rgba(0, 0, 0, 0)"]), qt = {
881
+ }, Gt = 1400, Kt = 12 * 1024 * 1024, qt = new Set(["transparent", "rgba(0, 0, 0, 0)"]), Jt = {
882
882
  imagePlaceholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=",
883
883
  onImageErrorHandler: () => void 0
884
- }, Jt = (e) => {
885
- let t = getComputedStyle(e);
886
- return !Kt.has(t.backgroundColor) || t.backgroundImage !== "none";
887
884
  }, Yt = (e) => {
885
+ let t = getComputedStyle(e);
886
+ return !qt.has(t.backgroundColor) || t.backgroundImage !== "none";
887
+ }, Xt = (e) => {
888
888
  for (let t = e; t; t = t.parentElement) {
889
889
  let e = getComputedStyle(t).backgroundColor;
890
- if (!Kt.has(e)) return e;
890
+ if (!qt.has(e)) return e;
891
891
  }
892
892
  return "#ffffff";
893
- }, Xt = async (e, t) => {
894
- let { toPng: n } = await import("./es-CK20DkgT.js"), r = e.getBoundingClientRect(), i = Math.max(r.width, r.height, 1), a = Math.min(2, Math.max(.4, Wt / i)), o = await n(e, {
895
- ...qt,
893
+ }, Zt = async (e, t) => {
894
+ let { toPng: n } = await import("./es-CK20DkgT.js"), r = e.getBoundingClientRect(), i = Math.max(r.width, r.height, 1), a = Math.min(2, Math.max(.4, Gt / i)), o = await n(e, {
895
+ ...Jt,
896
896
  pixelRatio: a,
897
- backgroundColor: Yt(e),
897
+ backgroundColor: Xt(e),
898
898
  filter: (e) => !t.includes(e)
899
899
  });
900
- if (o.length > Gt) throw Error("capture too large");
900
+ if (o.length > Kt) throw Error("capture too large");
901
901
  return o;
902
- }, Zt = 4, Qt = 4e3, $t = (e, t) => {
902
+ }, Qt = 4, $t = 4e3, en = (e, t) => {
903
903
  let n = document.elementFromPoint(e.x + e.width / 2, e.y + e.height / 2);
904
904
  for (; n && t.includes(n);) n = n.parentElement;
905
905
  let r = document.body;
@@ -910,8 +910,8 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
910
910
  break;
911
911
  }
912
912
  }
913
- let i = window.innerWidth * window.innerHeight * Zt || 2 ** 53 - 1, a = r;
914
- for (; !Jt(a);) {
913
+ let i = window.innerWidth * window.innerHeight * Qt || 2 ** 53 - 1, a = r;
914
+ for (; !Yt(a);) {
915
915
  let e = a.parentElement;
916
916
  if (!e || e === document.documentElement) break;
917
917
  let t = e.getBoundingClientRect();
@@ -919,13 +919,13 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
919
919
  a = e;
920
920
  }
921
921
  return a;
922
- }, en = async (e, t) => {
923
- let { toCanvas: n } = await import("./es-CK20DkgT.js"), r = $t(e, t), i = r.getBoundingClientRect(), a = Math.max(e.width, e.height, 1), o = Math.min(2, Math.max(.4, Wt / a)), s = Math.max(i.width, i.height, 1);
924
- o = Math.min(o, Qt / s);
922
+ }, tn = async (e, t) => {
923
+ let { toCanvas: n } = await import("./es-CK20DkgT.js"), r = en(e, t), i = r.getBoundingClientRect(), a = Math.max(e.width, e.height, 1), o = Math.min(2, Math.max(.4, Gt / a)), s = Math.max(i.width, i.height, 1);
924
+ o = Math.min(o, $t / s);
925
925
  let c = await n(r, {
926
- ...qt,
926
+ ...Jt,
927
927
  pixelRatio: o,
928
- backgroundColor: Yt(r),
928
+ backgroundColor: Xt(r),
929
929
  filter: (e) => !t.includes(e)
930
930
  }), l = document.createElement("canvas");
931
931
  l.width = Math.max(1, Math.round(e.width * o)), l.height = Math.max(1, Math.round(e.height * o));
@@ -933,9 +933,9 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
933
933
  if (!u) throw Error("no 2d context");
934
934
  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);
935
935
  let d = l.toDataURL("image/png");
936
- if (d.length > Gt) throw Error("capture too large");
936
+ if (d.length > Kt) throw Error("capture too large");
937
937
  return d;
938
- }, tn = {
938
+ }, nn = {
939
939
  ring: 99997,
940
940
  overlay: 99998,
941
941
  label: 99999
@@ -948,24 +948,24 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
948
948
  }, Y = (e) => {
949
949
  let t = e?.getAttribute("data-tsd-source");
950
950
  return t ? t.replace(/^\//, "") : null;
951
- }, nn = (e) => Array.from(document.querySelectorAll("[data-tsd-source]")).filter((t) => Y(t) === e), rn = (e, t) => {
952
- let n = nn(t).indexOf(e);
951
+ }, rn = (e) => Array.from(document.querySelectorAll("[data-tsd-source]")).filter((t) => Y(t) === e), an = (e, t) => {
952
+ let n = rn(t).indexOf(e);
953
953
  return n < 0 ? 0 : n;
954
- }, an = (e, t = 0) => {
955
- let n = nn(e);
954
+ }, on = (e, t = 0) => {
955
+ let n = rn(e);
956
956
  return n[t] ?? n[0] ?? null;
957
- }, on = (e, t) => {
957
+ }, sn = (e, t) => {
958
958
  let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter(Boolean);
959
959
  n.includes(t) || e.setAttribute("data-staged-key", [...n, t].join(" "));
960
- }, sn = (e, t) => {
960
+ }, cn = (e, t) => {
961
961
  let n = (e.getAttribute("data-staged-key") || "").split(/\s+/).filter((e) => e && e !== t);
962
962
  n.length ? e.setAttribute("data-staged-key", n.join(" ")) : e.removeAttribute("data-staged-key");
963
- }, cn = (e, t) => {
963
+ }, ln = (e, t) => {
964
964
  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("");
965
965
  if (!n) return "";
966
966
  let r = `[data-staged-key~="${CSS.escape(e)}"]{${n}}`, i = t.media?.replace(/[;{}]/g, "").trim();
967
967
  return i ? `@media ${i}{${r}}` : r;
968
- }, ln = (e) => {
968
+ }, un = (e) => {
969
969
  let t = e.tagName.toLowerCase();
970
970
  return t === "input" ? {
971
971
  checkbox: "Checkbox",
@@ -1007,31 +1007,31 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1007
1007
  aside: "Sidebar",
1008
1008
  div: "Container"
1009
1009
  }[t] || `${t.charAt(0).toUpperCase()}${t.slice(1)}`;
1010
- }, un = 36, dn = (e) => {
1011
- let t = ln(e), n = ((e) => e.replace(/\s+/g, " ").trim())(e.getAttribute("aria-label") || e.getAttribute("alt") || e.getAttribute("title") || e.getAttribute("name") || "");
1012
- return n ? `${t} · ${n.length > un ? `${n.slice(0, un - 1).trimEnd()}…` : n}` : t;
1013
- }, fn = (e) => {
1010
+ }, dn = 36, fn = (e) => {
1011
+ let t = un(e), n = ((e) => e.replace(/\s+/g, " ").trim())(e.getAttribute("aria-label") || e.getAttribute("alt") || e.getAttribute("title") || e.getAttribute("name") || "");
1012
+ return n ? `${t} · ${n.length > dn ? `${n.slice(0, dn - 1).trimEnd()}…` : n}` : t;
1013
+ }, pn = (e) => {
1014
1014
  let t = [], n = e;
1015
1015
  for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) t.unshift(n.tagName.toLowerCase()), n = n.parentElement;
1016
1016
  return t.join(" > ");
1017
- }, pn = () => {
1017
+ }, mn = () => {
1018
1018
  let e = document.createElement("div");
1019
- e.style.cssText = `position:fixed;pointer-events:none;z-index:${tn.overlay};background:${J.hoverBg};outline:2px solid ${J.hover};border-radius:2px;display:none`;
1019
+ e.style.cssText = `position:fixed;pointer-events:none;z-index:${nn.overlay};background:${J.hoverBg};outline:2px solid ${J.hover};border-radius:2px;display:none`;
1020
1020
  let t = document.createElement("div");
1021
- t.style.cssText = `position:fixed;pointer-events:none;z-index:${tn.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`;
1021
+ t.style.cssText = `position:fixed;pointer-events:none;z-index:${nn.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`;
1022
1022
  let n = document.createElement("div");
1023
- n.style.cssText = `position:fixed;pointer-events:none;z-index:${tn.ring};outline:2px solid ${J.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 4px ${J.selectGlow};display:none`;
1023
+ n.style.cssText = `position:fixed;pointer-events:none;z-index:${nn.ring};outline:2px solid ${J.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 4px ${J.selectGlow};display:none`;
1024
1024
  let r = document.createElement("div");
1025
- return r.style.cssText = `position:fixed;pointer-events:none;z-index:${tn.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`, {
1025
+ return r.style.cssText = `position:fixed;pointer-events:none;z-index:${nn.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`, {
1026
1026
  overlay: e,
1027
1027
  label: t,
1028
1028
  ring: n,
1029
1029
  ringLabel: r
1030
1030
  };
1031
- }, mn = (e, t, n) => {
1031
+ }, hn = (e, t, n) => {
1032
1032
  let r = n.getBoundingClientRect();
1033
- 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 = dn(n), t.style.left = `${Math.max(4, r.left)}px`, t.style.top = `${r.top > 26 ? r.top - 22 : r.bottom + 4}px`;
1034
- }, hn = (e) => {
1033
+ 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 = fn(n), t.style.left = `${Math.max(4, r.left)}px`, t.style.top = `${r.top > 26 ? r.top - 22 : r.bottom + 4}px`;
1034
+ }, gn = (e) => {
1035
1035
  let t = (e instanceof Element ? e : null)?.closest("a[href]");
1036
1036
  if (!t || t.target === "_blank") return null;
1037
1037
  let n;
@@ -1041,11 +1041,11 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1041
1041
  return null;
1042
1042
  }
1043
1043
  return n.protocol !== "http:" && n.protocol !== "https:" || n.origin === location.origin ? null : n.href;
1044
- }, gn = (e) => {
1044
+ }, _n = (e) => {
1045
1045
  if (!e) return !1;
1046
1046
  let t = e.tagName;
1047
1047
  return t === "INPUT" || t === "TEXTAREA" || t === "SELECT" || e.isContentEditable === !0;
1048
- }, _n = (e) => {
1048
+ }, vn = (e) => {
1049
1049
  if (!e.childNodes.length) return !1;
1050
1050
  let t = !1;
1051
1051
  for (let n of e.childNodes) {
@@ -1053,7 +1053,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1053
1053
  (n.textContent ?? "").trim() && (t = !0);
1054
1054
  }
1055
1055
  return t;
1056
- }, vn = 2e3, yn = (e) => {
1056
+ }, yn = 2e3, bn = (e) => {
1057
1057
  let t = [], n = e;
1058
1058
  for (; n && n.nodeType === 1 && n !== document.body && t.length < 8;) {
1059
1059
  let e = Y(n);
@@ -1064,22 +1064,22 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1064
1064
  }), n = n.parentElement;
1065
1065
  }
1066
1066
  return t;
1067
- }, bn = (e) => {
1068
- let t = Y(e), n = t ? nn(t).length : 1, r = t ? rn(e, t) : 0, i = t && _n(e) ? (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, vn) : void 0, a = xn(e);
1067
+ }, xn = (e) => {
1068
+ let t = Y(e), n = t ? rn(t).length : 1, r = t ? an(e, t) : 0, i = t && vn(e) ? (e.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, yn) : void 0, a = Sn(e);
1069
1069
  return {
1070
1070
  tag: e.tagName.toLowerCase(),
1071
1071
  classes: typeof e.className == "string" ? e.className.trim() : "",
1072
1072
  text: (e.innerText || "").trim().slice(0, 120),
1073
- label: dn(e),
1074
- path: fn(e),
1073
+ label: fn(e),
1074
+ path: pn(e),
1075
1075
  source: t,
1076
1076
  index: r,
1077
1077
  occurrences: n,
1078
- ancestors: yn(e),
1078
+ ancestors: bn(e),
1079
1079
  ...i === void 0 ? {} : { fullText: i },
1080
1080
  ...a ? { sourceBinding: a } : {}
1081
1081
  };
1082
- }, xn = (e) => {
1082
+ }, Sn = (e) => {
1083
1083
  let t = e.closest("[data-levo-source]");
1084
1084
  if (!t) return;
1085
1085
  let n = t.getAttribute("data-levo-source") ?? "", r = Y(t), i;
@@ -1092,11 +1092,11 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1092
1092
  raw: n,
1093
1093
  element: {
1094
1094
  source: r ?? "",
1095
- index: r ? rn(t, r) : 0
1095
+ index: r ? an(t, r) : 0
1096
1096
  },
1097
1097
  ...i === void 0 ? {} : { config: i }
1098
1098
  };
1099
- }, Sn = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
1099
+ }, Cn = () => Array.from(document.querySelectorAll("[data-levo-source]")).map((e) => {
1100
1100
  let t = e.getAttribute("data-levo-source") ?? "", n = Y(e), r;
1101
1101
  try {
1102
1102
  r = JSON.parse(t);
@@ -1107,18 +1107,18 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1107
1107
  raw: t,
1108
1108
  element: {
1109
1109
  source: n ?? "",
1110
- index: n ? rn(e, n) : 0
1110
+ index: n ? an(e, n) : 0
1111
1111
  },
1112
1112
  tag: e.tagName.toLowerCase(),
1113
- label: dn(e),
1113
+ label: fn(e),
1114
1114
  ...r === void 0 ? {} : { config: r }
1115
1115
  };
1116
- }), Cn = 14, wn = 2e3, Tn = 100, En = 48, Dn = new Set([
1116
+ }), wn = 14, Tn = 2e3, En = 100, Dn = 48, On = new Set([
1117
1117
  "script",
1118
1118
  "style",
1119
1119
  "template",
1120
1120
  "noscript"
1121
- ]), On = (e, t) => t.includes(e) || e.id === "studio-staged" || Dn.has(e.tagName.toLowerCase()), kn = (e) => {
1121
+ ]), kn = (e, t) => t.includes(e) || e.id === "studio-staged" || On.has(e.tagName.toLowerCase()), An = (e) => {
1122
1122
  let t = !1, n = 0, r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
1123
1123
  for (let e of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
1124
1124
  let t = Y(e);
@@ -1130,11 +1130,11 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1130
1130
  for (let t of e.childNodes) {
1131
1131
  if (t.nodeType !== 3) continue;
1132
1132
  let e = (t.textContent ?? "").replace(/\s+/g, " ").trim();
1133
- if (e) return e.length > En ? `${e.slice(0, En).trimEnd()}…` : e;
1133
+ if (e) return e.length > Dn ? `${e.slice(0, Dn).trimEnd()}…` : e;
1134
1134
  }
1135
1135
  }, o = (i, s) => {
1136
1136
  n++;
1137
- let c = Y(i), l = a(i), u = Array.from(i.children).filter((t) => !On(t, e)), d = {
1137
+ let c = Y(i), l = a(i), u = Array.from(i.children).filter((t) => !kn(t, e)), d = {
1138
1138
  tag: i.tagName.toLowerCase(),
1139
1139
  ...c ? {
1140
1140
  source: c,
@@ -1145,9 +1145,9 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1145
1145
  childCount: u.length,
1146
1146
  children: []
1147
1147
  };
1148
- if (s >= Cn) return u.length && (t = !0), d;
1148
+ if (s >= wn) return u.length && (t = !0), d;
1149
1149
  for (let e of u) {
1150
- if (d.children.length >= Tn || n >= wn) {
1150
+ if (d.children.length >= En || n >= Tn) {
1151
1151
  t = !0;
1152
1152
  break;
1153
1153
  }
@@ -1159,7 +1159,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1159
1159
  tree: o(document.body, 0),
1160
1160
  truncated: t
1161
1161
  };
1162
- }, An = () => {
1162
+ }, jn = () => {
1163
1163
  let e = null;
1164
1164
  return {
1165
1165
  send: (t) => {
@@ -1174,7 +1174,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1174
1174
  return !0;
1175
1175
  }
1176
1176
  };
1177
- }, jn = (e) => {
1177
+ }, Mn = (e) => {
1178
1178
  let t = location.pathname, n = () => {
1179
1179
  location.pathname !== t && (t = location.pathname, e.onPathChange());
1180
1180
  }, r = !1;
@@ -1194,23 +1194,23 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1194
1194
  e.__inspectorPatched && e.__orig && (history.pushState = e.__orig), t.__inspectorPatched && t.__orig && (history.replaceState = t.__orig);
1195
1195
  }
1196
1196
  } };
1197
- }, Mn = !1, Nn = /* @__PURE__ */ new Set(), Pn = () => {
1198
- if (!Mn) {
1199
- Mn = !0;
1200
- for (let e of Nn) e();
1197
+ }, Nn = !1, Pn = /* @__PURE__ */ new Set(), Fn = () => {
1198
+ if (!Nn) {
1199
+ Nn = !0;
1200
+ for (let e of Pn) e();
1201
1201
  }
1202
- }, Fn = (e) => (Nn.add(e), () => {
1203
- Nn.delete(e);
1204
- }), In = () => j(Fn, () => Mn, () => !1), Ln = (e) => {
1202
+ }, In = (e) => (Pn.add(e), () => {
1203
+ Pn.delete(e);
1204
+ }), Ln = () => ee(In, () => Nn, () => !1), Rn = (e) => {
1205
1205
  let { channel: t, originals: n, staged: r } = e, i = t.send, a = null;
1206
1206
  return { onMessage: (o) => {
1207
1207
  let s = o.data;
1208
1208
  if (!(!s || s.source !== "web-chat") && t.acceptOrigin(o)) {
1209
- if (Pn(), s.type === "set-access-preview") ut(s.stage ?? null);
1209
+ if (Fn(), s.type === "set-access-preview") dt(s.stage ?? null);
1210
1210
  else if (s.type === "set-inspect") e.setInspect(s.enabled);
1211
1211
  else if (s.type === "set-text-edit") e.setTextEdit(s.enabled);
1212
1212
  else if (s.type === "revert-text") {
1213
- 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 : an(e, t);
1213
+ 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 : on(e, t);
1214
1214
  i && r != null && (i.textContent = r);
1215
1215
  } else if (s.type === "stage-style") {
1216
1216
  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;
@@ -1269,7 +1269,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1269
1269
  }
1270
1270
  e.syncDomObserver();
1271
1271
  } else if (s.type === "select-element") {
1272
- let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? an(t, n) : null;
1272
+ let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? on(t, n) : null;
1273
1273
  if (!r) {
1274
1274
  i({
1275
1275
  type: "select-miss",
@@ -1285,10 +1285,10 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1285
1285
  behavior: "smooth"
1286
1286
  }), i({
1287
1287
  type: "element-selected",
1288
- element: bn(r)
1288
+ element: xn(r)
1289
1289
  });
1290
1290
  } else if (s.type === "edit-element") {
1291
- let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? an(t, n) : null;
1291
+ let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? on(t, n) : null;
1292
1292
  if (!r) {
1293
1293
  i({
1294
1294
  type: "select-miss",
@@ -1304,12 +1304,12 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1304
1304
  behavior: "smooth"
1305
1305
  }), i({
1306
1306
  type: "element-selected",
1307
- element: bn(r)
1307
+ element: xn(r)
1308
1308
  }), e.isTextEditing() || e.setTextEdit(!0);
1309
1309
  let o = e.editableTarget(r);
1310
1310
  o && e.startEditAtEnd(o);
1311
1311
  } else if (s.type === "highlight-element") {
1312
- let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? an(t, n) : null;
1312
+ let t = String(s.element?.source || ""), n = Number.isInteger(s.element?.index) ? s.element.index : 0, r = t ? on(t, n) : null;
1313
1313
  if (!r) a = null, e.hideTextHover(), i({
1314
1314
  type: "highlight-miss",
1315
1315
  element: {
@@ -1327,7 +1327,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1327
1327
  }
1328
1328
  } else if (s.type === "clear-highlight") a && (a = null, !e.isInspecting() && !e.editingNode() && e.hideTextHover());
1329
1329
  else if (s.type === "request-layers") {
1330
- let { tree: t, truncated: n } = kn(e.ownNodes);
1330
+ let { tree: t, truncated: n } = An(e.ownNodes);
1331
1331
  i({
1332
1332
  type: "layers-tree",
1333
1333
  tree: t,
@@ -1335,7 +1335,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1335
1335
  });
1336
1336
  } else if (s.type === "request-sources") i({
1337
1337
  type: "sources-list",
1338
- sources: Sn()
1338
+ sources: Cn()
1339
1339
  });
1340
1340
  else if (s.type === "capture-selected") {
1341
1341
  let t = String(s.requestId || "");
@@ -1350,7 +1350,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1350
1350
  });
1351
1351
  return;
1352
1352
  }
1353
- Xt(n, e.ownNodes).then((e) => {
1353
+ Zt(n, e.ownNodes).then((e) => {
1354
1354
  console.info(`[levo-inspector] element capture ok <${n.tagName.toLowerCase()}> (${Math.round(e.length / 1024)}kB)`), i({
1355
1355
  type: "capture-result",
1356
1356
  requestId: t,
@@ -1371,7 +1371,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1371
1371
  }
1372
1372
  }
1373
1373
  } };
1374
- }, Rn = () => {
1374
+ }, zn = () => {
1375
1375
  let e = /* @__PURE__ */ new Map(), t = () => {
1376
1376
  if (e.size > 50) {
1377
1377
  let t = e.keys().next().value;
@@ -1391,31 +1391,31 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1391
1391
  return e.delete(t), n;
1392
1392
  }
1393
1393
  };
1394
- }, zn = 6, Bn = 12, Vn = 12, Hn = .6, Un = (e, t, n, r) => ({
1394
+ }, Bn = 6, Vn = 12, Hn = 12, Un = .6, Wn = (e, t, n, r) => ({
1395
1395
  x: Math.min(e, n),
1396
1396
  y: Math.min(t, r),
1397
1397
  width: Math.abs(n - e),
1398
1398
  height: Math.abs(r - t)
1399
- }), Wn = (e, t) => {
1399
+ }), Gn = (e, t) => {
1400
1400
  let n = e.x + e.width, r = e.y + e.height, i = [];
1401
1401
  for (let a of Array.from(document.querySelectorAll("[data-tsd-source]"))) {
1402
1402
  if (t.includes(a)) continue;
1403
1403
  let o = a.getBoundingClientRect(), s = o.width * o.height;
1404
- 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 >= Hn && i.push(a);
1404
+ 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 >= Un && i.push(a);
1405
1405
  }
1406
1406
  let a = new Set(i), o = i.filter((e) => {
1407
1407
  for (let t = e.parentElement; t; t = t.parentElement) if (a.has(t)) return !1;
1408
1408
  return !0;
1409
- }), s = o.length > Vn, c = [], l = [];
1410
- for (let e of o.slice(0, Vn)) {
1409
+ }), s = o.length > Hn, c = [], l = [];
1410
+ for (let e of o.slice(0, Hn)) {
1411
1411
  let t = Y(e);
1412
1412
  if (!t) continue;
1413
1413
  let n = (e.innerText || "").replace(/\s+/g, " ").trim().slice(0, 80);
1414
1414
  c.push({
1415
1415
  source: t,
1416
- index: rn(e, t),
1416
+ index: an(e, t),
1417
1417
  tag: e.tagName.toLowerCase(),
1418
- label: dn(e),
1418
+ label: fn(e),
1419
1419
  ...n ? { text: n } : {}
1420
1420
  }), l.push(e);
1421
1421
  }
@@ -1424,12 +1424,12 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1424
1424
  nodes: l,
1425
1425
  truncated: s
1426
1426
  };
1427
- }, Gn = () => Array.from({ length: Vn }, () => {
1427
+ }, Kn = () => Array.from({ length: Hn }, () => {
1428
1428
  let e = document.createElement("div");
1429
- return e.style.cssText = `position:fixed;pointer-events:none;z-index:${tn.ring};outline:1.5px solid ${J.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 3px ${J.selectGlow};display:none`, e;
1430
- }), Kn = () => {
1429
+ return e.style.cssText = `position:fixed;pointer-events:none;z-index:${nn.ring};outline:1.5px solid ${J.select};outline-offset:1px;border-radius:3px;box-shadow:0 0 0 3px ${J.selectGlow};display:none`, e;
1430
+ }), qn = () => {
1431
1431
  let e = document.createElement("div");
1432
- e.style.cssText = `position:fixed;pointer-events:none;z-index:${tn.overlay};border:1.5px dashed ${J.select};background:${J.selectGlow};border-radius:2px;display:none`;
1432
+ e.style.cssText = `position:fixed;pointer-events:none;z-index:${nn.overlay};border:1.5px dashed ${J.select};background:${J.selectGlow};border-radius:2px;display:none`;
1433
1433
  let t = null, n = !1, r = 0, i = 0, a = () => {
1434
1434
  e.style.display = "none";
1435
1435
  };
@@ -1444,31 +1444,31 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1444
1444
  pointerMove: (a, o) => {
1445
1445
  if (!t) return;
1446
1446
  if (a = Math.min(Math.max(0, a), window.innerWidth), o = Math.min(Math.max(0, o), window.innerHeight), r = a, i = o, !n) {
1447
- if (Math.abs(a - t.x) < zn && Math.abs(o - t.y) < zn) return;
1447
+ if (Math.abs(a - t.x) < Bn && Math.abs(o - t.y) < Bn) return;
1448
1448
  n = !0;
1449
1449
  }
1450
- let s = Un(t.x, t.y, a, o);
1450
+ let s = Wn(t.x, t.y, a, o);
1451
1451
  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`;
1452
1452
  },
1453
1453
  pointerUp: () => {
1454
1454
  let e = n, o = t;
1455
1455
  if (t = null, n = !1, a(), !e || !o) return null;
1456
- let s = Un(o.x, o.y, r, i);
1457
- return s.width < Bn || s.height < Bn ? null : s;
1456
+ let s = Wn(o.x, o.y, r, i);
1457
+ return s.width < Vn || s.height < Vn ? null : s;
1458
1458
  },
1459
1459
  cancel: () => {
1460
1460
  t = null, n = !1, a();
1461
1461
  },
1462
1462
  isDragging: () => n
1463
1463
  };
1464
- }, qn = (e) => {
1464
+ }, Jn = (e) => {
1465
1465
  let { originals: t, editingNode: n } = e, r = /* @__PURE__ */ new Map(), i = () => {
1466
1466
  let e = document.getElementById("studio-staged");
1467
1467
  return e || (e = document.createElement("style"), e.id = "studio-staged", document.head.appendChild(e)), e;
1468
1468
  }, a = () => {
1469
1469
  let e = [];
1470
1470
  for (let [t, n] of r) if (n.kind === "style") {
1471
- let r = cn(t, n);
1471
+ let r = ln(t, n);
1472
1472
  r && e.push(r);
1473
1473
  }
1474
1474
  let t = e.join("\n");
@@ -1476,8 +1476,8 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1476
1476
  let n = i();
1477
1477
  n.textContent !== t && (n.textContent = t);
1478
1478
  }, o = (e, r) => {
1479
- let i = an(r.source, r.index);
1480
- if (i) if (r.kind === "style") on(i, e);
1479
+ let i = on(r.source, r.index);
1480
+ if (i) if (r.kind === "style") sn(i, e);
1481
1481
  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");
1482
1482
  else {
1483
1483
  if (i === n()) return;
@@ -1490,8 +1490,8 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1490
1490
  let n = r.get(e);
1491
1491
  if (!n) return;
1492
1492
  r.delete(e);
1493
- let i = an(n.source, n.index);
1494
- if (n.kind === "style") i && sn(i, e), a();
1493
+ let i = on(n.source, n.index);
1494
+ if (n.kind === "style") i && cn(i, e), a();
1495
1495
  else if (n.kind === "image") {
1496
1496
  let e = t.restore(`${n.source}#${n.index}:src`), r = t.restore(`${n.source}#${n.index}:srcset`);
1497
1497
  i && (e != null && (e ? i.setAttribute("src", e) : i.removeAttribute("src")), r != null && (r ? i.setAttribute("srcset", r) : i.removeAttribute("srcset")));
@@ -1520,7 +1520,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1520
1520
  for (let e of Array.from(document.querySelectorAll("[data-staged-key]"))) e.removeAttribute("data-staged-key");
1521
1521
  }
1522
1522
  };
1523
- }, Jn = (e) => {
1523
+ }, Yn = (e) => {
1524
1524
  let { channel: t, originals: n, clearTextHover: r } = e, i = null, a = "", o = 0, s = (() => {
1525
1525
  try {
1526
1526
  let e = document.createElement("div");
@@ -1539,7 +1539,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1539
1539
  n.selectNodeContents(e), n.collapse(!1), t.removeAllRanges(), t.addRange(n);
1540
1540
  }, d = (e, t = !1) => {
1541
1541
  if (i === e) return;
1542
- i && p(i), i = e, a = Y(e) || "", o = rn(e, a), r(), n.capture(`${a}#${o}`, e.textContent ?? ""), e.setAttribute("contenteditable", s ? "plaintext-only" : "true");
1542
+ i && p(i), i = e, a = Y(e) || "", o = an(e, a), r(), n.capture(`${a}#${o}`, e.textContent ?? ""), e.setAttribute("contenteditable", s ? "plaintext-only" : "true");
1543
1543
  let d = e;
1544
1544
  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);
1545
1545
  }, f = (e) => {
@@ -1558,7 +1558,7 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1558
1558
  tag: e.tagName.toLowerCase(),
1559
1559
  value: c,
1560
1560
  previous: s,
1561
- occurrences: r ? nn(r).length : 1
1561
+ occurrences: r ? rn(r).length : 1
1562
1562
  }
1563
1563
  });
1564
1564
  }, m = (e) => {
@@ -1577,16 +1577,16 @@ var Vt = (e, t) => !e.hidden && !t?.includes(e.key) && !t?.includes(e.id) && e.a
1577
1577
  i && f(i);
1578
1578
  }
1579
1579
  };
1580
- }, Yn = "2026-07-24g · element-capture + region-drag + region-highlights (stale-region guard)";
1581
- function Xn() {
1582
- return E(() => Zn(), []), null;
1583
- }
1580
+ }, Xn = "2026-07-24g · element-capture + region-drag + region-highlights (stale-region guard)";
1584
1581
  function Zn() {
1585
- let e = !1, t = null, n = null, r = !1, i = null, a = Rn(), o = An(), { overlay: s, label: c, ring: l, ringLabel: u } = pn();
1582
+ return E(() => Qn(), []), null;
1583
+ }
1584
+ function Qn() {
1585
+ let e = !1, t = null, n = null, r = !1, i = null, a = zn(), o = jn(), { overlay: s, label: c, ring: l, ringLabel: u } = mn();
1586
1586
  document.body.append(s, c, l, u);
1587
- let d = Kn();
1587
+ let d = qn();
1588
1588
  document.body.append(d.node);
1589
- let f = Gn();
1589
+ let f = Kn();
1590
1590
  document.body.append(...f);
1591
1591
  let p = [
1592
1592
  s,
@@ -1616,14 +1616,14 @@ function Zn() {
1616
1616
  }, S = (e) => !e || p.includes(e) || e === document.body || e === document.documentElement, C = (e) => {
1617
1617
  if (!e || S(e)) return null;
1618
1618
  let t = Y(e) ? e : e.closest("[data-tsd-source]");
1619
- return !t || S(t) || !_n(t) ? null : t;
1620
- }, w = (e) => mn(s, c, e), T = () => {
1619
+ return !t || S(t) || !vn(t) ? null : t;
1620
+ }, w = (e) => hn(s, c, e), T = () => {
1621
1621
  if (n) {
1622
1622
  if (!n.isConnected) {
1623
- P();
1623
+ N();
1624
1624
  return;
1625
1625
  }
1626
- mn(l, u, n);
1626
+ hn(l, u, n);
1627
1627
  }
1628
1628
  }, E = 0, D = () => {
1629
1629
  E || !n || r || (E = requestAnimationFrame(() => {
@@ -1633,90 +1633,90 @@ function Zn() {
1633
1633
  for (let t of e) {
1634
1634
  let e = t.target;
1635
1635
  if (!p.some((t) => t === e) && !(t.type === "attributes" && t.attributeName === "data-staged-key")) {
1636
- D(), R.scheduleReapply();
1636
+ D(), L.scheduleReapply();
1637
1637
  return;
1638
1638
  }
1639
1639
  }
1640
- }), A = !1, j = () => {
1640
+ }), A = !1, ee = () => {
1641
1641
  A ||= (k.observe(document.documentElement, {
1642
1642
  attributes: !0,
1643
1643
  childList: !0,
1644
1644
  characterData: !0,
1645
1645
  subtree: !0
1646
1646
  }), !0);
1647
- }, M = () => {
1647
+ }, j = () => {
1648
1648
  A &&= (k.disconnect(), !1);
1649
+ }, M = () => {
1650
+ O.disconnect(), n?.isConnected && (O.observe(n), ee());
1649
1651
  }, N = () => {
1650
- O.disconnect(), n?.isConnected && (O.observe(n), j());
1651
- }, P = () => {
1652
- n = null, O.disconnect(), z(), E &&= (cancelAnimationFrame(E), 0), l.style.display = "none", u.style.display = "none", y(), g();
1653
- }, F = (e) => w(e), I = () => {
1652
+ n = null, O.disconnect(), R(), E &&= (cancelAnimationFrame(E), 0), l.style.display = "none", u.style.display = "none", y(), g();
1653
+ }, P = (e) => w(e), F = () => {
1654
1654
  s.style.display = "none", c.style.display = "none";
1655
- }, L = Jn({
1655
+ }, I = Yn({
1656
1656
  channel: o,
1657
1657
  originals: a,
1658
1658
  clearTextHover: () => {
1659
- i = null, I();
1659
+ i = null, F();
1660
1660
  }
1661
- }), R = qn({
1661
+ }), L = Jn({
1662
1662
  originals: a,
1663
- editingNode: L.editingNode
1664
- }), z = () => {
1665
- n?.isConnected || R.count() ? j() : M();
1666
- }, ee = (n) => {
1667
- n && r && B(!1), e = !!n, x(e), e || (t = null, s.style.display = "none", c.style.display = "none", U()), o.send({
1663
+ editingNode: I.editingNode
1664
+ }), R = () => {
1665
+ n?.isConnected || L.count() ? ee() : j();
1666
+ }, te = (n) => {
1667
+ n && r && z(!1), e = !!n, x(e), e || (t = null, s.style.display = "none", c.style.display = "none", H()), o.send({
1668
1668
  type: "inspect-state",
1669
1669
  enabled: e
1670
1670
  });
1671
- }, B = (t) => {
1671
+ }, z = (t) => {
1672
1672
  if (r = !!t, r) {
1673
- e && ee(!1), l.style.display = "none", u.style.display = "none";
1673
+ e && te(!1), l.style.display = "none", u.style.display = "none";
1674
1674
  for (let e of f) e.style.display = "none";
1675
- } else L.commitIfEditing(), I(), document.documentElement.style.cursor = "", n && T(), m.length > 0 && _();
1675
+ } else I.commitIfEditing(), F(), document.documentElement.style.cursor = "", n && T(), m.length > 0 && _();
1676
1676
  o.send({
1677
1677
  type: "text-edit-state",
1678
1678
  enabled: r
1679
1679
  });
1680
- }, te = 0, V = 0, ne = 0, re = () => {
1681
- te = 0;
1682
- let n = document.elementFromPoint(V, ne);
1680
+ }, ne = 0, B = 0, re = 0, ie = () => {
1681
+ ne = 0;
1682
+ let n = document.elementFromPoint(B, re);
1683
1683
  if (!S(n)) {
1684
1684
  if (r) {
1685
1685
  let e = C(n);
1686
- if (e && e === L.editingNode()) {
1687
- i = null, I(), document.documentElement.style.cursor = "";
1686
+ if (e && e === I.editingNode()) {
1687
+ i = null, F(), document.documentElement.style.cursor = "";
1688
1688
  return;
1689
1689
  }
1690
- i = e, document.documentElement.style.cursor = e ? "text" : "", e ? F(e) : I();
1690
+ i = e, document.documentElement.style.cursor = e ? "text" : "", e ? P(e) : F();
1691
1691
  return;
1692
1692
  }
1693
1693
  e && (d.isDragging() || (t = n, n && w(n)));
1694
1694
  }
1695
- }, ie = (t) => {
1696
- !e && !r || (V = t.clientX, ne = t.clientY, te ||= requestAnimationFrame(re));
1697
- }, H = 0, ae = () => {
1698
- H = 0, e && t && w(t), r && !L.editingNode() && i?.isConnected && F(i), n && !r && T(), m.length > 0 && !r && _();
1699
- }, oe = () => {
1700
- H ||= requestAnimationFrame(ae);
1701
- }, se = (n) => {
1702
- n.relatedTarget || (e ? (t = null, s.style.display = "none", c.style.display = "none") : r && !L.editingNode() && (i = null, I(), document.documentElement.style.cursor = ""));
1703
- }, ce = !1, le = null, ue = () => {
1704
- if (le != null) {
1695
+ }, ae = (t) => {
1696
+ !e && !r || (B = t.clientX, re = t.clientY, ne ||= requestAnimationFrame(ie));
1697
+ }, V = 0, oe = () => {
1698
+ V = 0, e && t && w(t), r && !I.editingNode() && i?.isConnected && P(i), n && !r && T(), m.length > 0 && !r && _();
1699
+ }, se = () => {
1700
+ V ||= requestAnimationFrame(oe);
1701
+ }, ce = (n) => {
1702
+ n.relatedTarget || (e ? (t = null, s.style.display = "none", c.style.display = "none") : r && !I.editingNode() && (i = null, F(), document.documentElement.style.cursor = ""));
1703
+ }, le = !1, ue = null, de = () => {
1704
+ if (ue != null) {
1705
1705
  try {
1706
- document.documentElement.releasePointerCapture(le);
1706
+ document.documentElement.releasePointerCapture(ue);
1707
1707
  } catch {}
1708
- le = null;
1708
+ ue = null;
1709
1709
  }
1710
- }, U = () => {
1711
- ue(), d.cancel();
1712
- }, W = (t) => {
1713
- !e || t.button !== 0 || !t.isPrimary || (ce = !1, d.pointerDown(t.clientX, t.clientY));
1714
- }, de = (n) => {
1710
+ }, H = () => {
1711
+ de(), d.cancel();
1712
+ }, U = (t) => {
1713
+ !e || t.button !== 0 || !t.isPrimary || (le = !1, d.pointerDown(t.clientX, t.clientY));
1714
+ }, W = (n) => {
1715
1715
  if (!e || !n.isPrimary) return;
1716
1716
  let r = d.isDragging();
1717
1717
  if (d.pointerMove(n.clientX, n.clientY), d.isDragging()) {
1718
1718
  if (!r) {
1719
- le = n.pointerId;
1719
+ ue = n.pointerId;
1720
1720
  try {
1721
1721
  document.documentElement.setPointerCapture(n.pointerId);
1722
1722
  } catch {}
@@ -1725,14 +1725,14 @@ function Zn() {
1725
1725
  }
1726
1726
  }, fe = (t) => {
1727
1727
  if (!e || !t.isPrimary) return;
1728
- ue();
1728
+ de();
1729
1729
  let n = d.pointerUp();
1730
1730
  if (!n) return;
1731
- ce = !0, P();
1732
- let { elements: r, nodes: i, truncated: a } = Wn(n, p);
1731
+ le = !0, N();
1732
+ let { elements: r, nodes: i, truncated: a } = Gn(n, p);
1733
1733
  console.info(`[levo-inspector] region drag: ${Math.round(n.width)}×${Math.round(n.height)} — ${r.length} element(s)${a ? " (truncated)" : ""}`), v(i);
1734
1734
  let s = ++h;
1735
- en(n, p).then((e) => {
1735
+ tn(n, p).then((e) => {
1736
1736
  s === h && (console.info(`[levo-inspector] region capture ok (${Math.round(e.length / 1024)}kB)`), o.send({
1737
1737
  type: "region-selected",
1738
1738
  rect: n,
@@ -1749,21 +1749,21 @@ function Zn() {
1749
1749
  dataUrl: null
1750
1750
  }));
1751
1751
  });
1752
- }, pe = () => U(), me = (e) => {
1753
- let t = hn(e.target);
1752
+ }, pe = () => H(), me = (e) => {
1753
+ let t = gn(e.target);
1754
1754
  return t ? (e.preventDefault(), e.stopPropagation(), window.open(t, "_blank", "noopener,noreferrer"), !0) : !1;
1755
1755
  }, he = (i) => {
1756
- if (ce) {
1757
- ce = !1, i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
1756
+ if (le) {
1757
+ le = !1, i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation();
1758
1758
  return;
1759
1759
  }
1760
1760
  if (r) {
1761
1761
  let e = C(document.elementFromPoint(i.clientX, i.clientY) || i.target);
1762
- if (!e || e === L.editingNode()) {
1762
+ if (!e || e === I.editingNode()) {
1763
1763
  me(i);
1764
1764
  return;
1765
1765
  }
1766
- i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation(), L.startEdit(e);
1766
+ i.preventDefault(), i.stopPropagation(), i.stopImmediatePropagation(), I.startEdit(e);
1767
1767
  return;
1768
1768
  }
1769
1769
  if (!e) {
@@ -1774,29 +1774,29 @@ function Zn() {
1774
1774
  let a = t || i.target;
1775
1775
  if (S(a)) return;
1776
1776
  let s = a.closest("[data-tsd-source]") || a;
1777
- y(), g(), n = s, T(), N(), o.send({
1777
+ y(), g(), n = s, T(), M(), o.send({
1778
1778
  type: "element-selected",
1779
- element: bn(s)
1779
+ element: xn(s)
1780
1780
  });
1781
- }, ge = Ln({
1781
+ }, ge = Rn({
1782
1782
  channel: o,
1783
1783
  originals: a,
1784
- staged: R,
1785
- setInspect: ee,
1786
- setTextEdit: B,
1784
+ staged: L,
1785
+ setInspect: te,
1786
+ setTextEdit: z,
1787
1787
  isInspecting: () => e,
1788
1788
  isTextEditing: () => r,
1789
- editingNode: L.editingNode,
1789
+ editingNode: I.editingNode,
1790
1790
  setSelected: (e) => {
1791
- y(), g(), n = e, N();
1791
+ y(), g(), n = e, M();
1792
1792
  },
1793
1793
  selectedNode: () => n,
1794
1794
  positionSelected: T,
1795
- clearSelection: P,
1796
- syncDomObserver: z,
1795
+ clearSelection: N,
1796
+ syncDomObserver: R,
1797
1797
  positionHover: w,
1798
- hideTextHover: I,
1799
- startEditAtEnd: (e) => L.startEdit(e, !0),
1798
+ hideTextHover: F,
1799
+ startEditAtEnd: (e) => I.startEdit(e, !0),
1800
1800
  editableTarget: C,
1801
1801
  ownNodes: p
1802
1802
  }), _e = [
@@ -1827,42 +1827,42 @@ function Zn() {
1827
1827
  type: "route",
1828
1828
  route: e
1829
1829
  });
1830
- }, xe = jn({ onPathChange: () => {
1831
- P(), be();
1830
+ }, xe = Mn({ onPathChange: () => {
1831
+ N(), be();
1832
1832
  } }), Se = (t) => {
1833
- if (L.editingNode()) return;
1833
+ if (I.editingNode()) return;
1834
1834
  if (t.key === "Escape") {
1835
1835
  if (e && d.isDragging()) {
1836
- t.stopPropagation(), U();
1836
+ t.stopPropagation(), H();
1837
1837
  return;
1838
1838
  }
1839
- r ? (t.stopPropagation(), B(!1)) : e && (t.stopPropagation(), ee(!1));
1839
+ r ? (t.stopPropagation(), z(!1)) : e && (t.stopPropagation(), te(!1));
1840
1840
  return;
1841
1841
  }
1842
- if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || gn(document.activeElement)) return;
1842
+ if (t.metaKey || t.ctrlKey || t.altKey || t.shiftKey || t.repeat || _n(document.activeElement)) return;
1843
1843
  let n = t.key.toLowerCase();
1844
- n === "s" ? (t.preventDefault(), t.stopPropagation(), ee(!e)) : n === "t" && (t.preventDefault(), t.stopPropagation(), B(!r));
1844
+ n === "s" ? (t.preventDefault(), t.stopPropagation(), te(!e)) : n === "t" && (t.preventDefault(), t.stopPropagation(), z(!r));
1845
1845
  };
1846
- window.addEventListener("mousemove", ie, !0), window.addEventListener("scroll", oe, !0), window.addEventListener("resize", ye), window.addEventListener("click", he, !0), window.addEventListener("keydown", Se, !0), window.addEventListener("message", ge.onMessage), window.addEventListener("mouseout", se, !0), window.addEventListener("pointerdown", W, !0), window.addEventListener("pointermove", de, !0), window.addEventListener("pointerup", fe, !0), window.addEventListener("pointercancel", pe, !0);
1846
+ window.addEventListener("mousemove", ae, !0), window.addEventListener("scroll", se, !0), window.addEventListener("resize", ye), window.addEventListener("click", he, !0), window.addEventListener("keydown", Se, !0), window.addEventListener("message", ge.onMessage), window.addEventListener("mouseout", ce, !0), window.addEventListener("pointerdown", U, !0), window.addEventListener("pointermove", W, !0), window.addEventListener("pointerup", fe, !0), window.addEventListener("pointercancel", pe, !0);
1847
1847
  for (let e of _e) window.addEventListener(e, ve, !0);
1848
- return console.info(`[levo-inspector] build ${Yn} — runtime mounted`), be(), o.send({ type: "ready" }), () => {
1849
- window.removeEventListener("mousemove", ie, !0), window.removeEventListener("keydown", Se, !0), window.removeEventListener("scroll", oe, !0), window.removeEventListener("resize", ye), window.removeEventListener("mouseout", se, !0), window.removeEventListener("pointerdown", W, !0), window.removeEventListener("pointermove", de, !0), window.removeEventListener("pointerup", fe, !0), window.removeEventListener("pointercancel", pe, !0), window.removeEventListener("click", he, !0), window.removeEventListener("message", ge.onMessage);
1848
+ return console.info(`[levo-inspector] build ${Xn} — runtime mounted`), be(), o.send({ type: "ready" }), () => {
1849
+ window.removeEventListener("mousemove", ae, !0), window.removeEventListener("keydown", Se, !0), window.removeEventListener("scroll", se, !0), window.removeEventListener("resize", ye), window.removeEventListener("mouseout", ce, !0), window.removeEventListener("pointerdown", U, !0), window.removeEventListener("pointermove", W, !0), window.removeEventListener("pointerup", fe, !0), window.removeEventListener("pointercancel", pe, !0), window.removeEventListener("click", he, !0), window.removeEventListener("message", ge.onMessage);
1850
1850
  for (let e of _e) window.removeEventListener(e, ve, !0);
1851
- O.disconnect(), k.disconnect(), E && cancelAnimationFrame(E), te && cancelAnimationFrame(te), H && cancelAnimationFrame(H), R.teardown(), xe.teardown(), L.teardown(), document.documentElement.style.cursor = "", b?.remove(), s.remove(), c.remove(), l.remove(), u.remove(), U(), d.node.remove();
1851
+ O.disconnect(), k.disconnect(), E && cancelAnimationFrame(E), ne && cancelAnimationFrame(ne), V && cancelAnimationFrame(V), L.teardown(), xe.teardown(), I.teardown(), document.documentElement.style.cursor = "", b?.remove(), s.remove(), c.remove(), l.remove(), u.remove(), H(), d.node.remove();
1852
1852
  for (let e of f) e.remove();
1853
1853
  };
1854
1854
  }
1855
1855
  //#endregion
1856
1856
  //#region src/branding/MadeWithLevo.tsx
1857
- var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,transform 150ms}
1858
- .${Qn}:hover,.${Qn}:focus-visible{opacity:1;transform:translateY(-2px)}`, er = ({ slug: e }) => {
1857
+ var $n = "levo-made-with", er = `.${$n}{opacity:.2;transition:opacity 150ms,transform 150ms}
1858
+ .${$n}:hover,.${$n}:focus-visible{opacity:1;transform:translateY(-2px)}`, tr = ({ slug: e }) => {
1859
1859
  let t = `utm_source=${encodeURIComponent(e || "website")}&utm_term=Made%20With%20Levo&utm_campaign=footer_branding&utm_medium=organic_footer_branding`;
1860
- return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("style", {
1860
+ return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("style", {
1861
1861
  href: "levo-made-with",
1862
1862
  precedence: "default",
1863
- children: $n
1864
- }), /* @__PURE__ */ P("a", {
1865
- className: Qn,
1863
+ children: er
1864
+ }), /* @__PURE__ */ N("a", {
1865
+ className: $n,
1866
1866
  href: `https://levo.so/?${t}`,
1867
1867
  target: "_blank",
1868
1868
  rel: "noopener noreferrer",
@@ -1882,7 +1882,7 @@ var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,tran
1882
1882
  textDecoration: "none",
1883
1883
  boxShadow: "0 4px 12px rgb(0 0 0 / 0.25)"
1884
1884
  },
1885
- children: [/* @__PURE__ */ N("img", {
1885
+ children: [/* @__PURE__ */ M("img", {
1886
1886
  alt: "",
1887
1887
  src: "https://static.levocdn.com/WLZ1TXTD/Levo-Logo-moxa93IxlVi0W.webp",
1888
1888
  width: 20,
@@ -1893,58 +1893,58 @@ var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,tran
1893
1893
  }
1894
1894
  }), "Made with Levo"]
1895
1895
  })] });
1896
- }, tr = "levo:page-id", nr = () => {
1896
+ }, nr = "levo:page-id", rr = () => {
1897
1897
  if (typeof document > "u") return null;
1898
- let e = document.querySelectorAll(`meta[name="${tr}"]`);
1898
+ let e = document.querySelectorAll(`meta[name="${nr}"]`);
1899
1899
  return e[e.length - 1]?.getAttribute("content")?.trim() || null;
1900
- }, rr = C(() => import("./dist-DTszGV-P.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), ir = ({ siteId: e, pageId: t }) => {
1900
+ }, ir = C(() => import("./dist-DTszGV-P.js").then((e) => e.n).then((e) => ({ default: e.PopupLoader }))), ar = ({ siteId: e, pageId: t }) => {
1901
1901
  let n = K(), r = i();
1902
- return !n || !r ? null : /* @__PURE__ */ N(x, {
1902
+ return !n || !r ? null : /* @__PURE__ */ M(x, {
1903
1903
  fallback: null,
1904
- children: /* @__PURE__ */ N(rr, {
1904
+ children: /* @__PURE__ */ M(ir, {
1905
1905
  pageId: t,
1906
1906
  siteId: e
1907
1907
  })
1908
1908
  });
1909
- }, ar = S(null), or = ar.Provider, sr = () => T(ar), cr = () => i(), lr = () => n(), ur = ({ site: e, analytics: t = !0, children: n }) => {
1909
+ }, or = S(null), sr = or.Provider, cr = () => T(or), lr = () => i(), ur = () => n(), dr = ({ site: e, analytics: t = !0, children: n }) => {
1910
1910
  let [i] = A(() => {
1911
1911
  if (!e) return null;
1912
- let n = Me(e), r = je(n);
1912
+ let n = Ne(e), r = Me(n);
1913
1913
  return r ? {
1914
1914
  client: r,
1915
- insights: ne(r, {
1915
+ insights: re(r, {
1916
1916
  insightsUrl: t && n.insightsUrl || null,
1917
1917
  site: n.siteId || null
1918
1918
  }),
1919
1919
  site: e
1920
1920
  } : null;
1921
- }), [a, o] = A(null), s = V({ select: (e) => e.location.pathname }), c = In();
1921
+ }), [a, o] = A(null), s = B({ select: (e) => e.location.pathname }), c = Ln();
1922
1922
  return E(() => {
1923
1923
  i && (window.levo_client = i.client, window.levo_insights = i.insights);
1924
1924
  }, [i]), D(() => {
1925
1925
  if (!i) return;
1926
- let e = nr();
1926
+ let e = rr();
1927
1927
  o(e), i.insights.init({ pageId: e });
1928
- }, [i, s]), i ? /* @__PURE__ */ P(r, {
1928
+ }, [i, s]), i ? /* @__PURE__ */ N(r, {
1929
1929
  client: i.client,
1930
1930
  insights: i.insights,
1931
1931
  children: [
1932
- /* @__PURE__ */ N(or, {
1932
+ /* @__PURE__ */ M(sr, {
1933
1933
  value: i.site,
1934
1934
  children: n
1935
1935
  }),
1936
- !c && /* @__PURE__ */ N(jt, {
1936
+ !c && /* @__PURE__ */ M(Mt, {
1937
1937
  site: i.site,
1938
1938
  path: s
1939
1939
  }),
1940
- /* @__PURE__ */ N(ir, {
1940
+ /* @__PURE__ */ M(ar, {
1941
1941
  pageId: a ?? void 0,
1942
1942
  siteId: i.site.id
1943
1943
  }),
1944
- !c && !!i.site.feature_flag?.branding && /* @__PURE__ */ N(er, { slug: i.site.slug })
1944
+ !c && !!i.site.feature_flag?.branding && /* @__PURE__ */ M(tr, { slug: i.site.slug })
1945
1945
  ]
1946
- }) : /* @__PURE__ */ N(M, { children: n });
1947
- }, dr = (e, t) => {
1946
+ }) : /* @__PURE__ */ M(j, { children: n });
1947
+ }, fr = (e, t) => {
1948
1948
  let n = h(t);
1949
1949
  return ({ location: t }) => {
1950
1950
  if (!e.isLocalized) return;
@@ -1955,12 +1955,12 @@ var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,tran
1955
1955
  cookie: typeof document > "u" ? null : document.cookie,
1956
1956
  hasRoute: n
1957
1957
  });
1958
- if (r.kind === "redirect" && r.path !== t.pathname) throw te({
1958
+ if (r.kind === "redirect" && r.path !== t.pathname) throw ne({
1959
1959
  search: !0,
1960
1960
  to: r.path
1961
1961
  });
1962
1962
  };
1963
- }, fr = (e) => {
1963
+ }, pr = (e) => {
1964
1964
  let t = e.locales ?? [], n = e.domain?.trim().replace(/^https?:\/\//, "").replace(/\/+$/, "");
1965
1965
  return {
1966
1966
  locales: t,
@@ -1968,8 +1968,8 @@ var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,tran
1968
1968
  isLocalized: t.length > 1,
1969
1969
  origin: n ? `https://${n}` : null
1970
1970
  };
1971
- }, pr = (e) => e.replace(/\/$/, ""), mr = (e) => {
1972
- let { neutralPath: t, locales: n, activePrefix: r, hasRoute: i } = e, a = pr(e.origin), o = `${a}${t}`;
1971
+ }, mr = (e) => e.replace(/\/$/, ""), hr = (e) => {
1972
+ let { neutralPath: t, locales: n, activePrefix: r, hasRoute: i } = e, a = mr(e.origin), o = `${a}${t}`;
1973
1973
  if (n.length <= 1) return [{
1974
1974
  rel: "canonical",
1975
1975
  href: o
@@ -1991,24 +1991,24 @@ var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,tran
1991
1991
  hrefLang: "x-default",
1992
1992
  href: o
1993
1993
  }), s;
1994
- }, hr = ({ to: e, ...t }) => /* @__PURE__ */ N(ee, {
1994
+ }, gr = ({ to: e, ...t }) => /* @__PURE__ */ M(te, {
1995
1995
  ...t,
1996
1996
  to: e
1997
- }), gr = ({ config: e, routeTree: t }) => {
1998
- let n = V({ select: (e) => e.location.pathname });
1997
+ }), _r = ({ config: e, routeTree: t }) => {
1998
+ let n = B({ select: (e) => e.location.pathname });
1999
1999
  if (!e.isLocalized || !e.origin) return null;
2000
2000
  let { neutralPath: r } = f(n, e.locales);
2001
- return /* @__PURE__ */ N(M, { children: mr({
2001
+ return /* @__PURE__ */ M(j, { children: hr({
2002
2002
  neutralPath: r,
2003
2003
  origin: e.origin,
2004
2004
  locales: e.locales,
2005
2005
  hasRoute: t ? h(t) : void 0
2006
- }).filter((e) => e.rel === "alternate").map((e) => /* @__PURE__ */ N("link", {
2006
+ }).filter((e) => e.rel === "alternate").map((e) => /* @__PURE__ */ M("link", {
2007
2007
  href: e.href,
2008
2008
  hrefLang: e.hrefLang,
2009
2009
  rel: e.rel
2010
2010
  }, e.hrefLang ?? e.href)) });
2011
- }, _r = S(void 0), vr = ({ children: e, locale: t, locales: n, defaultLocale: r, source: i = "default", hasRoute: a }) => {
2011
+ }, vr = S(void 0), yr = ({ children: e, locale: t, locales: n, defaultLocale: r, source: i = "default", hasRoute: a }) => {
2012
2012
  let o = O(() => {
2013
2013
  let e = n?.length ? n : [t];
2014
2014
  return {
@@ -2032,13 +2032,13 @@ var Qn = "levo-made-with", $n = `.${Qn}{opacity:.2;transition:opacity 150ms,tran
2032
2032
  i,
2033
2033
  a
2034
2034
  ]);
2035
- return /* @__PURE__ */ N(_r.Provider, {
2035
+ return /* @__PURE__ */ M(vr.Provider, {
2036
2036
  value: o,
2037
2037
  children: e
2038
2038
  });
2039
2039
  };
2040
- function yr() {
2041
- return T(_r) || {
2040
+ function br() {
2041
+ return T(vr) || {
2042
2042
  locale: "en",
2043
2043
  locales: ["en"],
2044
2044
  defaultLocale: "en",
@@ -2048,13 +2048,13 @@ function yr() {
2048
2048
  pathFor: (e) => e
2049
2049
  };
2050
2050
  }
2051
- function br(e) {
2052
- let { prefix: t } = f(V({ select: (e) => e.location.pathname }), e.locales);
2051
+ function xr(e) {
2052
+ let { prefix: t } = f(B({ select: (e) => e.location.pathname }), e.locales);
2053
2053
  return t ?? e.defaultLocale;
2054
2054
  }
2055
- var xr = ({ config: e, children: t, routeTree: n }) => {
2056
- let { prefix: r } = f(V({ select: (e) => e.location.pathname }), e.locales);
2057
- return /* @__PURE__ */ N(vr, {
2055
+ var Sr = ({ config: e, children: t, routeTree: n }) => {
2056
+ let { prefix: r } = f(B({ select: (e) => e.location.pathname }), e.locales);
2057
+ return /* @__PURE__ */ M(yr, {
2058
2058
  defaultLocale: e.defaultLocale,
2059
2059
  hasRoute: n ? h(n) : void 0,
2060
2060
  locale: r ?? e.defaultLocale,
@@ -2063,8 +2063,8 @@ var xr = ({ config: e, children: t, routeTree: n }) => {
2063
2063
  children: t
2064
2064
  });
2065
2065
  };
2066
- function Sr() {
2067
- let { locale: e, locales: t, isMultiLocale: n, setLocale: r, pathFor: i, hasRoute: a } = yr(), o = V({ select: (e) => e.location.pathname });
2066
+ function Cr() {
2067
+ let { locale: e, locales: t, isMultiLocale: n, setLocale: r, pathFor: i, hasRoute: a } = br(), o = B({ select: (e) => e.location.pathname });
2068
2068
  return O(() => {
2069
2069
  if (!n) return [];
2070
2070
  let { neutralPath: s } = f(o, t), c = t.filter((e) => !a || a(i(s, e)));
@@ -2091,14 +2091,14 @@ function Sr() {
2091
2091
  }
2092
2092
  //#endregion
2093
2093
  //#region src/pageHead.tsx
2094
- var Cr = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), wr = (e) => {
2094
+ var wr = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), Tr = (e) => {
2095
2095
  let t = {}, n = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*("([^"]*)"|'([^']*)'|[^\s"'>]+))?/g;
2096
2096
  for (let r = n.exec(e); r; r = n.exec(e)) {
2097
2097
  let e = r[1];
2098
2098
  !e || /^on/i.test(e) || (t[e] = r[3] ?? r[4] ?? (r[2] ? r[2] : ""));
2099
2099
  }
2100
2100
  return t;
2101
- }, Tr = (e) => {
2101
+ }, Er = (e) => {
2102
2102
  let t = {
2103
2103
  meta: [],
2104
2104
  links: [],
@@ -2106,11 +2106,11 @@ var Cr = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), wr = (e) => {
2106
2106
  };
2107
2107
  if (!e?.trim()) return t;
2108
2108
  let n = e.replace(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi, (e, n, r) => {
2109
- let i = wr(n), a = r.trim();
2109
+ let i = Tr(n), a = r.trim();
2110
2110
  return a && (i.children = a), t.scripts.push(i), "";
2111
2111
  });
2112
- return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(wr(r)), "")), t;
2113
- }, Er = (e = {}, t = {}) => {
2112
+ return n = n.replace(/<(meta|link)\b([^>]*?)\/?>/gi, (e, n, r) => ((n.toLowerCase() === "meta" ? t.meta : t.links).push(Tr(r)), "")), t;
2113
+ }, Dr = (e = {}, t = {}) => {
2114
2114
  let n = {
2115
2115
  meta: [],
2116
2116
  links: [],
@@ -2172,21 +2172,21 @@ var Cr = (e) => JSON.stringify(e).replace(/<\//g, "<\\/"), wr = (e) => {
2172
2172
  let y = e.ldJson ? Array.isArray(e.ldJson) ? e.ldJson : [e.ldJson] : [];
2173
2173
  for (let e of y) n.scripts.push({
2174
2174
  type: "application/ld+json",
2175
- children: Cr(e)
2175
+ children: wr(e)
2176
2176
  });
2177
2177
  for (let r of [t.customHead, e.customHead]) {
2178
2178
  if (!r) continue;
2179
- let e = Tr(r);
2179
+ let e = Er(r);
2180
2180
  n.meta.push(...e.meta), n.links.push(...e.links), n.scripts.push(...e.scripts);
2181
2181
  }
2182
2182
  return n;
2183
2183
  };
2184
- function Dr({ meta: e, site: t }) {
2185
- let n = Er(e, t);
2186
- return /* @__PURE__ */ P(M, { children: [
2187
- n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */ N("meta", { ...e }, `m${t}`) : /* @__PURE__ */ N("title", { children: e.title }, `t${t}`)),
2188
- n.links.map((e, t) => /* @__PURE__ */ N("link", { ...e }, `l${t}`)),
2189
- n.scripts.map(({ children: e, ...t }, n) => e === void 0 ? /* @__PURE__ */ N("script", { ...t }, `s${n}`) : /* @__PURE__ */ N("script", {
2184
+ function Or({ meta: e, site: t }) {
2185
+ let n = Dr(e, t);
2186
+ return /* @__PURE__ */ N(j, { children: [
2187
+ n.meta.map((e, t) => e.title === void 0 ? /* @__PURE__ */ M("meta", { ...e }, `m${t}`) : /* @__PURE__ */ M("title", { children: e.title }, `t${t}`)),
2188
+ n.links.map((e, t) => /* @__PURE__ */ M("link", { ...e }, `l${t}`)),
2189
+ n.scripts.map(({ children: e, ...t }, n) => e === void 0 ? /* @__PURE__ */ M("script", { ...t }, `s${n}`) : /* @__PURE__ */ M("script", {
2190
2190
  ...t,
2191
2191
  dangerouslySetInnerHTML: { __html: e }
2192
2192
  }, `s${n}`))
@@ -2194,17 +2194,17 @@ function Dr({ meta: e, site: t }) {
2194
2194
  }
2195
2195
  //#endregion
2196
2196
  //#region src/registration/ui.tsx
2197
- var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, children: n }) => /* @__PURE__ */ N("div", {
2197
+ var X = (...e) => e.filter(Boolean).join(" "), kr = ({ open: e, className: t, children: n }) => /* @__PURE__ */ M("div", {
2198
2198
  inert: !e,
2199
2199
  className: X("grid transition-[grid-template-rows,opacity] duration-250 ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:transition-none", e ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"),
2200
- children: /* @__PURE__ */ N("div", {
2200
+ children: /* @__PURE__ */ M("div", {
2201
2201
  className: "overflow-hidden",
2202
- children: /* @__PURE__ */ N("div", {
2202
+ children: /* @__PURE__ */ M("div", {
2203
2203
  className: t,
2204
2204
  children: n
2205
2205
  })
2206
2206
  })
2207
- }), kr = [
2207
+ }), Ar = [
2208
2208
  {
2209
2209
  key: "email",
2210
2210
  label: "Email",
@@ -2237,7 +2237,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2237
2237
  inputMode: void 0,
2238
2238
  autoComplete: "organization-title"
2239
2239
  }
2240
- ], Ar = [{
2240
+ ], jr = [{
2241
2241
  key: "name",
2242
2242
  label: "Registered company name",
2243
2243
  placeholder: "Acme Corporation",
@@ -2247,7 +2247,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2247
2247
  label: "Tax ID / GST number",
2248
2248
  placeholder: "22AAAAA0000A1Z5",
2249
2249
  autoComplete: "off"
2250
- }], jr = [
2250
+ }], Mr = [
2251
2251
  {
2252
2252
  key: "line1",
2253
2253
  label: "Billing address",
@@ -2296,22 +2296,22 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2296
2296
  wide: !1,
2297
2297
  optional: !1
2298
2298
  }
2299
- ], Mr = (e) => X("w-full rounded-xl border bg-page px-3.5 py-2.5 text-base text-ink outline-none transition placeholder:text-ink-muted/60", e ? "border-danger focus:ring-[3px] focus:ring-danger/15" : "border-border focus:border-brand focus:ring-[3px] focus:ring-brand/20"), Nr = "flex items-baseline gap-1.5 font-medium text-ink text-sm", Pr = () => /* @__PURE__ */ N("span", {
2299
+ ], Nr = (e) => X("w-full rounded-xl border bg-page px-3.5 py-2.5 text-base text-ink outline-none transition placeholder:text-ink-muted/60", e ? "border-danger focus:ring-[3px] focus:ring-danger/15" : "border-border focus:border-brand focus:ring-[3px] focus:ring-brand/20"), Pr = "flex items-baseline gap-1.5 font-medium text-ink text-sm", Fr = () => /* @__PURE__ */ M("span", {
2300
2300
  "aria-hidden": !0,
2301
2301
  className: "text-danger",
2302
2302
  children: "*"
2303
- }), Fr = ({ values: e, errors: t, touched: n, onChange: r, onBlur: i, showBusinessBilling: a = !1, registrationFields: o, nameInputRef: s, idPrefix: c = "attendee", nameLabel: l = "Your name" }) => /* @__PURE__ */ P("div", {
2303
+ }), Ir = ({ values: e, errors: t, touched: n, onChange: r, onBlur: i, showBusinessBilling: a = !1, registrationFields: o, nameInputRef: s, idPrefix: c = "attendee", nameLabel: l = "Your name" }) => /* @__PURE__ */ N("div", {
2304
2304
  className: "flex flex-col gap-4",
2305
2305
  children: [
2306
- /* @__PURE__ */ P("div", {
2306
+ /* @__PURE__ */ N("div", {
2307
2307
  className: "flex flex-col gap-1.5",
2308
2308
  children: [
2309
- /* @__PURE__ */ P("label", {
2309
+ /* @__PURE__ */ N("label", {
2310
2310
  htmlFor: `${c}-name`,
2311
- className: Nr,
2312
- children: [l, /* @__PURE__ */ N(Pr, {})]
2311
+ className: Pr,
2312
+ children: [l, /* @__PURE__ */ M(Fr, {})]
2313
2313
  }),
2314
- /* @__PURE__ */ N("input", {
2314
+ /* @__PURE__ */ M("input", {
2315
2315
  ref: s,
2316
2316
  id: `${c}-name`,
2317
2317
  name: "name",
@@ -2321,31 +2321,31 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2321
2321
  value: e.name,
2322
2322
  onChange: (e) => r("name", e.target.value),
2323
2323
  onBlur: () => i("name"),
2324
- className: Mr(n.name && !!t.name),
2324
+ className: Nr(n.name && !!t.name),
2325
2325
  required: !0
2326
2326
  }),
2327
- n.name && t.name && /* @__PURE__ */ N("p", {
2327
+ n.name && t.name && /* @__PURE__ */ M("p", {
2328
2328
  className: "m-0 text-danger text-xs",
2329
2329
  children: t.name
2330
2330
  })
2331
2331
  ]
2332
2332
  }),
2333
- kr.map((a) => {
2333
+ Ar.map((a) => {
2334
2334
  let s = o[a.key];
2335
2335
  if (s === "off") return null;
2336
2336
  let l = n[a.key] ? t[a.key] : void 0, u = a.key === "email" || a.key === "mobile";
2337
- return /* @__PURE__ */ P("div", {
2337
+ return /* @__PURE__ */ N("div", {
2338
2338
  className: "flex flex-col gap-1.5",
2339
2339
  children: [
2340
- /* @__PURE__ */ P("label", {
2340
+ /* @__PURE__ */ N("label", {
2341
2341
  htmlFor: `${c}-${a.key}`,
2342
- className: Nr,
2343
- children: [a.label, s === "required" ? /* @__PURE__ */ N(Pr, {}) : /* @__PURE__ */ N("span", {
2342
+ className: Pr,
2343
+ children: [a.label, s === "required" ? /* @__PURE__ */ M(Fr, {}) : /* @__PURE__ */ M("span", {
2344
2344
  className: "font-normal text-ink-muted text-xs",
2345
2345
  children: "Optional"
2346
2346
  })]
2347
2347
  }),
2348
- /* @__PURE__ */ N("input", {
2348
+ /* @__PURE__ */ M("input", {
2349
2349
  id: `${c}-${a.key}`,
2350
2350
  name: a.key,
2351
2351
  type: a.type,
@@ -2358,22 +2358,22 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2358
2358
  value: e[a.key],
2359
2359
  onChange: (e) => r(a.key, e.target.value),
2360
2360
  onBlur: () => i(a.key),
2361
- className: Mr(!!l),
2361
+ className: Nr(!!l),
2362
2362
  required: s === "required"
2363
2363
  }),
2364
- l && /* @__PURE__ */ N("p", {
2364
+ l && /* @__PURE__ */ M("p", {
2365
2365
  className: "m-0 text-danger text-xs",
2366
2366
  children: l
2367
2367
  })
2368
2368
  ]
2369
2369
  }, a.key);
2370
2370
  }),
2371
- a && /* @__PURE__ */ N(Ir, {
2371
+ a && /* @__PURE__ */ M(Lr, {
2372
2372
  values: e,
2373
2373
  onChange: r
2374
2374
  })
2375
2375
  ]
2376
- }), Ir = ({ values: e, onChange: t }) => {
2376
+ }), Lr = ({ values: e, onChange: t }) => {
2377
2377
  let n = (n, r) => t("billing_details", {
2378
2378
  ...e.billing_details,
2379
2379
  [n]: r
@@ -2384,13 +2384,13 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2384
2384
  [n]: r
2385
2385
  }
2386
2386
  }), i = !!e.billing_details.name.trim() || !!e.billing_details.tax_id.trim() || Object.values(e.billing_details.address).some((e) => !!e.trim());
2387
- return /* @__PURE__ */ P("div", {
2387
+ return /* @__PURE__ */ N("div", {
2388
2388
  className: "rounded-xl border border-border bg-ink/3",
2389
2389
  children: [
2390
- /* @__PURE__ */ P("label", {
2390
+ /* @__PURE__ */ N("label", {
2391
2391
  htmlFor: "is_business_purchase",
2392
2392
  className: "flex w-full cursor-pointer items-center gap-2.5 px-3.5 py-3 text-ink text-sm",
2393
- children: [/* @__PURE__ */ N("input", {
2393
+ children: [/* @__PURE__ */ M("input", {
2394
2394
  id: "is_business_purchase",
2395
2395
  type: "checkbox",
2396
2396
  checked: e.is_business_purchase,
@@ -2399,29 +2399,29 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2399
2399
  className: "size-4 shrink-0 cursor-pointer rounded accent-brand"
2400
2400
  }), "Bill this to a business — I need a GST invoice"]
2401
2401
  }),
2402
- !e.is_business_purchase && i && /* @__PURE__ */ N("p", {
2402
+ !e.is_business_purchase && i && /* @__PURE__ */ M("p", {
2403
2403
  className: "m-0 px-3.5 pb-3 text-amber-700 text-xs leading-relaxed starting:opacity-0 transition-opacity duration-200 dark:text-amber-400",
2404
2404
  children: "Your billing details are still saved — tick the box to apply them."
2405
2405
  }),
2406
- /* @__PURE__ */ N(Or, {
2406
+ /* @__PURE__ */ M(kr, {
2407
2407
  open: e.is_business_purchase,
2408
2408
  className: "px-3.5 pb-3.5",
2409
- children: /* @__PURE__ */ P("div", {
2409
+ children: /* @__PURE__ */ N("div", {
2410
2410
  className: "flex flex-col gap-3",
2411
2411
  children: [
2412
- /* @__PURE__ */ N("p", {
2412
+ /* @__PURE__ */ M("p", {
2413
2413
  className: "m-0 text-ink-muted text-xs leading-relaxed",
2414
2414
  children: "This booking will be billed to your business. The invoice is raised against the details below."
2415
2415
  }),
2416
- Ar.map((t) => /* @__PURE__ */ P("div", {
2416
+ jr.map((t) => /* @__PURE__ */ N("div", {
2417
2417
  className: "flex flex-col gap-1.5",
2418
- children: [/* @__PURE__ */ P("label", {
2418
+ children: [/* @__PURE__ */ N("label", {
2419
2419
  htmlFor: `billing-${t.key}`,
2420
- className: Nr,
2421
- children: [t.label, /* @__PURE__ */ N(Pr, {})]
2422
- }), /* @__PURE__ */ N("input", {
2420
+ className: Pr,
2421
+ children: [t.label, /* @__PURE__ */ M(Fr, {})]
2422
+ }), /* @__PURE__ */ M("input", {
2423
2423
  id: `billing-${t.key}`,
2424
- className: Mr(),
2424
+ className: Nr(),
2425
2425
  placeholder: t.placeholder,
2426
2426
  autoComplete: t.autoComplete,
2427
2427
  value: e.billing_details[t.key],
@@ -2429,17 +2429,17 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2429
2429
  required: e.is_business_purchase
2430
2430
  })]
2431
2431
  }, t.key)),
2432
- /* @__PURE__ */ N("div", {
2432
+ /* @__PURE__ */ M("div", {
2433
2433
  className: "grid grid-cols-2 gap-3",
2434
- children: jr.map((t) => /* @__PURE__ */ P("div", {
2434
+ children: Mr.map((t) => /* @__PURE__ */ N("div", {
2435
2435
  className: X("flex flex-col gap-1.5", t.wide && "col-span-2"),
2436
- children: [/* @__PURE__ */ P("label", {
2436
+ children: [/* @__PURE__ */ N("label", {
2437
2437
  htmlFor: `billing-${t.key}`,
2438
- className: Nr,
2439
- children: [t.label, !t.optional && /* @__PURE__ */ N(Pr, {})]
2440
- }), /* @__PURE__ */ N("input", {
2438
+ className: Pr,
2439
+ children: [t.label, !t.optional && /* @__PURE__ */ M(Fr, {})]
2440
+ }), /* @__PURE__ */ M("input", {
2441
2441
  id: `billing-${t.key}`,
2442
- className: Mr(),
2442
+ className: Nr(),
2443
2443
  placeholder: t.placeholder,
2444
2444
  autoComplete: t.autoComplete,
2445
2445
  inputMode: t.key === "postal_code" ? "numeric" : void 0,
@@ -2454,7 +2454,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2454
2454
  })
2455
2455
  ]
2456
2456
  });
2457
- }, Lr = ({ attendees: e, openKey: t, onOpenChange: n }) => {
2457
+ }, Rr = ({ attendees: e, openKey: t, onOpenChange: n }) => {
2458
2458
  let { slots: r } = e, i = [];
2459
2459
  for (let e of r) {
2460
2460
  let t = i.at(-1);
@@ -2467,54 +2467,54 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2467
2467
  let a = (t) => {
2468
2468
  e.touchSlot(t), e.isSlotValid(t) && n(r[r.findIndex((e) => e.key === t) + 1]?.key ?? null);
2469
2469
  };
2470
- return /* @__PURE__ */ N(U.Root, {
2470
+ return /* @__PURE__ */ M(U.Root, {
2471
2471
  value: t ? [t] : [],
2472
2472
  onValueChange: (e) => n(e[0] ?? null),
2473
2473
  className: "flex flex-col gap-5",
2474
- children: i.map((n) => /* @__PURE__ */ P("section", {
2474
+ children: i.map((n) => /* @__PURE__ */ N("section", {
2475
2475
  className: "flex flex-col gap-2",
2476
- children: [/* @__PURE__ */ P("h4", {
2476
+ children: [/* @__PURE__ */ N("h4", {
2477
2477
  className: "m-0 font-semibold text-[15px] text-ink leading-snug [overflow-wrap:anywhere]",
2478
- children: [n.title, n.slots.length > 1 && /* @__PURE__ */ P("span", {
2478
+ children: [n.title, n.slots.length > 1 && /* @__PURE__ */ N("span", {
2479
2479
  className: "ml-1.5 font-normal text-ink-muted tabular-nums",
2480
2480
  children: ["× ", n.slots.length]
2481
2481
  })]
2482
2482
  }), n.slots.map((n, i) => {
2483
2483
  let o = n.key === t, s = n.key === r.at(-1)?.key, c = e.getValues(n.key), l = e.isSlotValid(n.key), u = !l && e.isSlotVisited(n.key), d = n.key === r[0]?.key;
2484
- return /* @__PURE__ */ P(U.Item, {
2484
+ return /* @__PURE__ */ N(U.Item, {
2485
2485
  value: n.key,
2486
2486
  className: X("rounded-xl border transition-colors", o ? "border-brand/60" : u ? "border-danger/50" : "border-border"),
2487
- children: [/* @__PURE__ */ N(U.Header, {
2487
+ children: [/* @__PURE__ */ M(U.Header, {
2488
2488
  className: "m-0",
2489
- children: /* @__PURE__ */ P(U.Trigger, {
2489
+ children: /* @__PURE__ */ N(U.Trigger, {
2490
2490
  className: "group flex w-full items-center gap-3 px-3.5 py-3 text-left",
2491
2491
  children: [
2492
- /* @__PURE__ */ N("span", {
2492
+ /* @__PURE__ */ M("span", {
2493
2493
  "aria-hidden": !0,
2494
2494
  className: X("inline-flex size-7 shrink-0 items-center justify-center rounded-full font-semibold text-[12.5px] tabular-nums transition-colors", l ? "bg-emerald-500/10 text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400" : u ? "bg-danger/10 text-danger" : "bg-ink/5 text-ink-soft"),
2495
- children: l ? /* @__PURE__ */ N(H, { className: "size-3.5" }) : i + 1
2495
+ children: l ? /* @__PURE__ */ M(V, { className: "size-3.5" }) : i + 1
2496
2496
  }),
2497
- /* @__PURE__ */ P("span", {
2497
+ /* @__PURE__ */ N("span", {
2498
2498
  className: "min-w-0 flex-1",
2499
- children: [/* @__PURE__ */ P("span", {
2499
+ children: [/* @__PURE__ */ N("span", {
2500
2500
  className: "block font-medium text-[14.5px] text-ink",
2501
2501
  children: ["Attendee ", i + 1]
2502
- }), !o && /* @__PURE__ */ N("span", {
2502
+ }), !o && /* @__PURE__ */ M("span", {
2503
2503
  className: X("mt-0.5 block truncate text-[12.5px]", u ? "text-danger" : "text-ink-muted"),
2504
2504
  children: u ? "Details missing" : c.name.trim() || (d ? "Your details" : "Add details")
2505
2505
  })]
2506
2506
  }),
2507
- /* @__PURE__ */ N(ae, {
2507
+ /* @__PURE__ */ M(oe, {
2508
2508
  "aria-hidden": !0,
2509
2509
  className: "size-4 shrink-0 text-ink-muted transition-transform group-data-[panel-open]:rotate-180"
2510
2510
  })
2511
2511
  ]
2512
2512
  })
2513
- }), /* @__PURE__ */ N(U.Panel, {
2513
+ }), /* @__PURE__ */ M(U.Panel, {
2514
2514
  className: "h-[var(--accordion-panel-height)] overflow-hidden transition-[height] duration-250 ease-[cubic-bezier(0.32,0.72,0,1)] data-[ending-style]:h-0 data-[starting-style]:h-0 motion-reduce:transition-none",
2515
- children: /* @__PURE__ */ P("div", {
2515
+ children: /* @__PURE__ */ N("div", {
2516
2516
  className: "flex flex-col gap-4 px-3.5 pb-3.5",
2517
- children: [/* @__PURE__ */ N(Fr, {
2517
+ children: [/* @__PURE__ */ M(Ir, {
2518
2518
  idPrefix: `attendee-${n.key.replace(":", "-")}`,
2519
2519
  nameLabel: "Full name",
2520
2520
  values: c,
@@ -2523,7 +2523,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2523
2523
  onChange: (t, r) => e.setField(n.key, t, r),
2524
2524
  onBlur: (t) => e.touchField(n.key, t),
2525
2525
  registrationFields: n.rules
2526
- }), !s && /* @__PURE__ */ N("button", {
2526
+ }), !s && /* @__PURE__ */ M("button", {
2527
2527
  type: "button",
2528
2528
  onClick: () => a(n.key),
2529
2529
  className: "inline-flex min-h-[42px] items-center justify-center rounded-xl border border-border font-medium text-[14px] text-ink transition hover:border-brand active:scale-[0.985]",
@@ -2535,7 +2535,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2535
2535
  })]
2536
2536
  }, n.ticketId))
2537
2537
  });
2538
- }, Rr = {
2538
+ }, zr = {
2539
2539
  USD: "$",
2540
2540
  EUR: "€",
2541
2541
  GBP: "£",
@@ -2553,54 +2553,54 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2553
2553
  maximumFractionDigits: 2
2554
2554
  }).format(r);
2555
2555
  } catch {
2556
- return `${Rr[n] ?? n} ${r.toLocaleString()}`;
2556
+ return `${zr[n] ?? n} ${r.toLocaleString()}`;
2557
2557
  }
2558
- }, zr = (e) => !e.tax_enabled || !e.taxes?.length ? null : e.tax_inclusive ? "incl. taxes" : "+ taxes", Br = (e) => !!e?.taxes?.length && e.tax_amount !== void 0, Vr = (e) => !!e && "subtotal" in e && e.tax_enabled === !0 && !!e.taxes?.length, Hr = (e, t) => t ? t.total_amount ?? t.sale_amount ?? 0 : Vr(e) ? e.total ?? e.unit_amount ?? 0 : e?.unit_amount ?? 0, Ur = (e, t) => {
2558
+ }, Br = (e) => !e.tax_enabled || !e.taxes?.length ? null : e.tax_inclusive ? "incl. taxes" : "+ taxes", Vr = (e) => !!e?.taxes?.length && e.tax_amount !== void 0, Hr = (e) => !!e && "subtotal" in e && e.tax_enabled === !0 && !!e.taxes?.length, Ur = (e, t) => t ? t.total_amount ?? t.sale_amount ?? 0 : Hr(e) ? e.total ?? e.unit_amount ?? 0 : e?.unit_amount ?? 0, Wr = (e, t) => {
2559
2559
  if (!e) return null;
2560
- let n = Hr(e, t);
2560
+ let n = Ur(e, t);
2561
2561
  return {
2562
2562
  amount: n,
2563
2563
  currency: e.currency,
2564
2564
  isFree: n === 0
2565
2565
  };
2566
- }, Wr = (e, t) => t ? t.base_amount ?? 0 : Vr(e) ? e.subtotal ?? e.unit_amount ?? 0 : e?.unit_amount ?? 0, Gr = (e, t) => Br(t) ? t.taxes : !t && Vr(e) ? e.taxes : [], Kr = ({ ticket: e, count: t }) => Hr(e, null) * t, qr = (e, t) => {
2566
+ }, Gr = (e, t) => t ? t.base_amount ?? 0 : Hr(e) ? e.subtotal ?? e.unit_amount ?? 0 : e?.unit_amount ?? 0, Kr = (e, t) => Vr(t) ? t.taxes : !t && Hr(e) ? e.taxes : [], qr = ({ ticket: e, count: t }) => Ur(e, null) * t, Jr = (e, t) => {
2567
2567
  if (e.length === 0) return null;
2568
- let n = t ? Hr(null, t) : e.reduce((e, t) => e + Kr(t), 0);
2568
+ let n = t ? Ur(null, t) : e.reduce((e, t) => e + qr(t), 0);
2569
2569
  return {
2570
2570
  amount: n,
2571
2571
  currency: e[0]?.ticket.currency,
2572
2572
  isFree: n === 0
2573
2573
  };
2574
- }, Jr = ({ lines: e, discount: t, pricing: n }) => {
2575
- let r = n?.currency, i = e.some((e) => zr(e.ticket));
2576
- return /* @__PURE__ */ P("div", {
2574
+ }, Yr = ({ lines: e, discount: t, pricing: n }) => {
2575
+ let r = n?.currency, i = e.some((e) => Br(e.ticket));
2576
+ return /* @__PURE__ */ N("div", {
2577
2577
  className: "rounded-xl border border-border bg-ink/3 px-3.5 py-3",
2578
- children: [/* @__PURE__ */ P("div", {
2578
+ children: [/* @__PURE__ */ N("div", {
2579
2579
  className: "flex flex-col gap-1.5 text-[13.5px] text-ink-soft",
2580
2580
  children: [
2581
- e.map((e) => /* @__PURE__ */ P("div", {
2581
+ e.map((e) => /* @__PURE__ */ N("div", {
2582
2582
  className: "flex items-baseline justify-between gap-3",
2583
- children: [/* @__PURE__ */ P("span", {
2583
+ children: [/* @__PURE__ */ N("span", {
2584
2584
  className: "min-w-0 [overflow-wrap:anywhere]",
2585
2585
  children: [
2586
- /* @__PURE__ */ P("span", {
2586
+ /* @__PURE__ */ N("span", {
2587
2587
  className: "text-ink tabular-nums",
2588
2588
  children: [e.count, " ×"]
2589
2589
  }),
2590
2590
  " ",
2591
2591
  e.ticket.title
2592
2592
  ]
2593
- }), /* @__PURE__ */ N("span", {
2593
+ }), /* @__PURE__ */ M("span", {
2594
2594
  className: "shrink-0 tabular-nums",
2595
2595
  children: Z({
2596
- unit_amount: Kr(e),
2596
+ unit_amount: qr(e),
2597
2597
  currency: r
2598
2598
  })
2599
2599
  })]
2600
2600
  }, e.ticket._id)),
2601
- t && t.discount > 0 && /* @__PURE__ */ P("div", {
2601
+ t && t.discount > 0 && /* @__PURE__ */ N("div", {
2602
2602
  className: "flex items-center justify-between gap-3 text-emerald-700 dark:text-emerald-400",
2603
- children: [/* @__PURE__ */ N("span", { children: "Discount" }), /* @__PURE__ */ P("span", {
2603
+ children: [/* @__PURE__ */ M("span", { children: "Discount" }), /* @__PURE__ */ N("span", {
2604
2604
  className: "tabular-nums",
2605
2605
  children: ["-", Z({
2606
2606
  unit_amount: t.discount,
@@ -2608,14 +2608,14 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2608
2608
  })]
2609
2609
  })]
2610
2610
  }),
2611
- i && /* @__PURE__ */ N("p", {
2611
+ i && /* @__PURE__ */ M("p", {
2612
2612
  className: "m-0 text-ink-muted text-xs",
2613
2613
  children: "Prices include applicable taxes"
2614
2614
  })
2615
2615
  ]
2616
- }), /* @__PURE__ */ P("div", {
2616
+ }), /* @__PURE__ */ N("div", {
2617
2617
  className: "mt-2.5 flex items-center justify-between gap-3 border-border border-t pt-2.5 font-semibold text-[15px] text-ink",
2618
- children: [/* @__PURE__ */ N("span", { children: "Total" }), /* @__PURE__ */ N("span", {
2618
+ children: [/* @__PURE__ */ M("span", { children: "Total" }), /* @__PURE__ */ M("span", {
2619
2619
  className: "tabular-nums",
2620
2620
  children: Z({
2621
2621
  unit_amount: n?.amount,
@@ -2624,120 +2624,202 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2624
2624
  })]
2625
2625
  })]
2626
2626
  });
2627
- }, Yr = ({ payment: e, label: t, isPaid: n, blockedReason: r }) => {
2627
+ }, Xr = ({ payment: e, label: t, isPaid: n, blockedReason: r }) => {
2628
2628
  let { state: i } = e, a = i.kind === "busy";
2629
- return /* @__PURE__ */ P(M, { children: [
2630
- (i.kind === "unpaid" || i.kind === "failed") && /* @__PURE__ */ P("p", {
2629
+ return /* @__PURE__ */ N(j, { children: [
2630
+ (i.kind === "unpaid" || i.kind === "failed") && /* @__PURE__ */ N("p", {
2631
2631
  role: "alert",
2632
2632
  className: "m-0 mb-2.5 rounded-xl bg-danger/10 px-3 py-2.5 text-danger text-sm starting:opacity-0 transition-opacity duration-200 motion-reduce:transition-none",
2633
- children: [i.message, i.kind === "unpaid" && /* @__PURE__ */ N("button", {
2633
+ children: [i.message, i.kind === "unpaid" && /* @__PURE__ */ M("button", {
2634
2634
  type: "button",
2635
2635
  onClick: e.retry,
2636
2636
  className: "ml-1.5 inline-flex items-center gap-1 font-semibold underline underline-offset-[3px]",
2637
2637
  children: "Pay again"
2638
2638
  })]
2639
2639
  }),
2640
- /* @__PURE__ */ P("button", {
2640
+ /* @__PURE__ */ N("button", {
2641
2641
  type: "submit",
2642
2642
  disabled: a || !!r,
2643
2643
  className: "inline-flex min-h-[50px] w-full items-center justify-center gap-2 rounded-xl bg-brand font-semibold text-[15.5px] text-brand-foreground transition active:scale-[0.985] disabled:opacity-55",
2644
- children: [a && /* @__PURE__ */ N(se, { className: "size-4 animate-spin" }), a && i.stage === "paying" ? "Opening secure checkout" : t]
2644
+ children: [a && /* @__PURE__ */ M(ce, { className: "size-4 animate-spin" }), a && i.stage === "paying" ? "Opening secure checkout" : t]
2645
2645
  }),
2646
- /* @__PURE__ */ N("p", {
2646
+ /* @__PURE__ */ M("p", {
2647
2647
  className: "m-0 mt-2 text-center text-ink-muted text-xs",
2648
2648
  children: r ?? (n ? "Secure payment · confirmation sent to your email" : "No card needed · joining link sent to your email")
2649
2649
  })
2650
2650
  ] });
2651
- }, Xr = (e, t) => t.length === 0 || e.tickets.length === 0 ? !0 : e.tickets.some((e) => t.includes(typeof e == "string" ? e : e._id)), Zr = (e) => e.kind === "percent" ? `${e.percent_off}% off` : `${Rr[e.currency ?? "INR"] ?? ""}${(e.amount_off ?? 0) / 100} off`, Qr = ({ couponCode: e, onCouponCodeChange: t, couponError: n, couponLoading: r, onValidateCoupon: i, onRemoveCoupon: a, publicCoupons: o, discount: s, tickets: c }) => {
2652
- let [l, u] = A(!1);
2653
- if (s) return /* @__PURE__ */ P("div", {
2654
- className: "flex starting:scale-95 items-center justify-between gap-2.5 rounded-xl border border-emerald-600/40 bg-emerald-500/10 px-3.5 py-2.5 text-[13px] text-emerald-800 starting:opacity-0 transition-[opacity,scale] duration-200 ease-out dark:bg-emerald-500/15 dark:text-emerald-300",
2655
- children: [/* @__PURE__ */ P("span", {
2656
- className: "min-w-0",
2657
- children: [/* @__PURE__ */ N("span", {
2658
- className: "font-semibold tracking-wide",
2659
- children: e
2660
- }), /* @__PURE__ */ P("span", {
2661
- className: "ml-2 text-emerald-700 dark:text-emerald-400",
2662
- children: [
2663
- "saves",
2664
- " ",
2665
- Z({
2666
- unit_amount: s.discount,
2667
- currency: c[0]?.currency
2668
- })
2669
- ]
2651
+ }, Zr = (e) => {
2652
+ if (e.kind !== "percent") return "Flat discount";
2653
+ let t = e.max_amount_off ? `, up to ${Z({
2654
+ unit_amount: e.max_amount_off,
2655
+ currency: e.currency
2656
+ })}` : "";
2657
+ return `${e.percent_off}% off${t}`;
2658
+ }, Qr = ({ applied: e, pending: t, couponError: n, onValidateCoupon: r, onRemoveCoupon: i, offers: a, currency: o }) => {
2659
+ let [s, c] = A(!1), [l, u] = A(""), [d, f] = A(!1), p = async (e) => {
2660
+ await r(e) && (u(""), c(!1));
2661
+ }, m = () => {
2662
+ l.trim() && p(l);
2663
+ }, h = e ? a.filter((t) => t.coupon.code !== e.code) : a, g = h.length > 0 && /* @__PURE__ */ M("ul", {
2664
+ className: "m-0 flex list-none flex-col gap-2 p-0",
2665
+ children: h.map(({ coupon: n, saving: r }, i) => {
2666
+ let s = t?.code === n.code;
2667
+ return /* @__PURE__ */ N("li", {
2668
+ className: "flex items-center gap-3 rounded-xl border border-border border-dashed px-3.5 py-2.5",
2669
+ children: [/* @__PURE__ */ N("div", {
2670
+ className: "flex min-w-0 flex-1 flex-col gap-0.5",
2671
+ children: [
2672
+ /* @__PURE__ */ N("div", {
2673
+ className: "flex items-center gap-2",
2674
+ children: [/* @__PURE__ */ M("span", {
2675
+ className: "truncate font-medium font-mono text-ink text-xs tracking-wide",
2676
+ children: n.code
2677
+ }), !e && i === 0 && a.length > 1 && /* @__PURE__ */ M("span", {
2678
+ className: "shrink-0 rounded-full bg-emerald-500/10 px-1.5 py-px font-medium text-[11px] text-emerald-700 dark:bg-emerald-500/15 dark:text-emerald-400",
2679
+ children: "Best"
2680
+ })]
2681
+ }),
2682
+ /* @__PURE__ */ N("span", {
2683
+ className: "text-[13px] text-ink",
2684
+ children: [/* @__PURE__ */ N("span", {
2685
+ className: "font-semibold",
2686
+ children: ["Save ", Z({
2687
+ unit_amount: r,
2688
+ currency: o
2689
+ })]
2690
+ }), /* @__PURE__ */ N("span", {
2691
+ className: "text-ink-muted",
2692
+ children: [" · ", Zr(n)]
2693
+ })]
2694
+ }),
2695
+ n.description && /* @__PURE__ */ M("span", {
2696
+ className: "truncate text-ink-muted text-xs",
2697
+ title: n.description,
2698
+ children: n.description
2699
+ })
2700
+ ]
2701
+ }), /* @__PURE__ */ N("button", {
2702
+ type: "button",
2703
+ disabled: !!t,
2704
+ onClick: () => void p(n.code),
2705
+ "aria-label": `${e ? "Switch to" : "Apply"} ${n.code}`,
2706
+ className: "inline-flex shrink-0 items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 font-medium text-ink text-sm transition hover:border-brand disabled:opacity-50",
2707
+ children: [s && /* @__PURE__ */ M(ce, { className: "size-3.5 animate-spin" }), e ? "Switch" : "Apply"]
2708
+ })]
2709
+ }, n._id);
2710
+ })
2711
+ }), _ = n && /* @__PURE__ */ M("p", {
2712
+ className: "m-0 text-danger text-xs",
2713
+ children: n
2714
+ }), v = "inline-flex items-center gap-1 self-start text-[13px] text-ink-soft underline underline-offset-[3px] hover:text-ink", y = /* @__PURE__ */ M("button", {
2715
+ type: "button",
2716
+ "aria-expanded": s,
2717
+ onClick: () => c((e) => !e),
2718
+ className: v,
2719
+ children: e || g ? "Have a different code?" : "Have a code?"
2720
+ }), b = /* @__PURE__ */ M(kr, {
2721
+ open: s,
2722
+ children: /* @__PURE__ */ N("div", {
2723
+ className: "flex gap-2 pt-2",
2724
+ children: [/* @__PURE__ */ M("input", {
2725
+ type: "text",
2726
+ value: l,
2727
+ placeholder: "Coupon code",
2728
+ "aria-label": "Coupon code",
2729
+ autoCapitalize: "characters",
2730
+ autoCorrect: "off",
2731
+ spellCheck: !1,
2732
+ onChange: (e) => u(e.target.value),
2733
+ onKeyDown: (e) => {
2734
+ e.key === "Enter" && (e.preventDefault(), m());
2735
+ },
2736
+ className: X("w-full min-w-0 rounded-xl border bg-page px-3.5 py-2.5 text-base text-ink uppercase outline-none transition placeholder:text-ink-muted/60 placeholder:normal-case", n ? "border-danger focus:ring-[3px] focus:ring-danger/15" : "border-border focus:border-brand focus:ring-[3px] focus:ring-brand/20")
2737
+ }), /* @__PURE__ */ N("button", {
2738
+ type: "button",
2739
+ disabled: !l.trim() || !!t,
2740
+ onClick: m,
2741
+ className: "inline-flex shrink-0 items-center gap-1.5 rounded-xl border border-border px-4 font-medium text-ink text-sm transition hover:border-brand disabled:opacity-50",
2742
+ children: [t?.code === l.trim().toUpperCase() && /* @__PURE__ */ M(ce, { className: "size-3.5 animate-spin" }), "Apply"]
2670
2743
  })]
2671
- }), /* @__PURE__ */ N("button", {
2672
- type: "button",
2673
- onClick: () => {
2674
- a(), u(!1);
2675
- },
2676
- "aria-label": "Remove coupon",
2677
- className: "inline-flex shrink-0 rounded-md p-1 hover:bg-emerald-600/15",
2678
- children: /* @__PURE__ */ N(ue, { className: "size-4" })
2679
- })]
2744
+ })
2680
2745
  });
2681
- let d = o.filter((e) => Xr(e, c.map((e) => e._id)));
2682
- return /* @__PURE__ */ P("div", {
2746
+ return e ? /* @__PURE__ */ N("div", {
2683
2747
  className: "flex flex-col",
2684
- children: [/* @__PURE__ */ N("button", {
2685
- type: "button",
2686
- "aria-expanded": l,
2687
- onClick: () => u((e) => !e),
2688
- className: "self-start text-[13px] text-ink-soft underline underline-offset-[3px] hover:text-ink",
2689
- children: "Have a code?"
2690
- }), /* @__PURE__ */ N(Or, {
2691
- open: l,
2692
- children: /* @__PURE__ */ P("div", {
2693
- className: "flex flex-col gap-2 pt-2",
2694
- children: [
2695
- /* @__PURE__ */ P("div", {
2696
- className: "flex gap-2",
2697
- children: [/* @__PURE__ */ N("input", {
2698
- type: "text",
2699
- value: e,
2700
- placeholder: "Coupon code",
2701
- "aria-label": "Coupon code",
2702
- autoCapitalize: "characters",
2703
- autoCorrect: "off",
2704
- spellCheck: !1,
2705
- onChange: (e) => t(e.target.value),
2706
- onKeyDown: (t) => {
2707
- t.key === "Enter" && (t.preventDefault(), e.trim() && i());
2708
- },
2709
- className: X("w-full min-w-0 rounded-xl border bg-page px-3.5 py-2.5 text-base text-ink uppercase outline-none transition placeholder:text-ink-muted/60 placeholder:normal-case", n ? "border-danger focus:ring-[3px] focus:ring-danger/15" : "border-border focus:border-brand focus:ring-[3px] focus:ring-brand/20")
2710
- }), /* @__PURE__ */ P("button", {
2711
- type: "button",
2712
- disabled: !e.trim() || r,
2713
- onClick: () => i(),
2714
- className: "inline-flex shrink-0 items-center gap-1.5 rounded-xl border border-border px-4 font-medium text-ink text-sm transition hover:border-brand disabled:opacity-50",
2715
- children: [r && /* @__PURE__ */ N(se, { className: "size-3.5 animate-spin" }), "Apply"]
2716
- })]
2717
- }),
2718
- n && /* @__PURE__ */ N("p", {
2719
- className: "m-0 text-danger text-xs",
2720
- children: n
2721
- }),
2722
- d.length > 0 && /* @__PURE__ */ N("div", {
2723
- className: "flex flex-wrap gap-1.5",
2724
- children: d.map((e) => /* @__PURE__ */ P("button", {
2725
- type: "button",
2726
- onClick: () => {
2727
- t(e.code), i(e.code);
2728
- },
2729
- title: e.description || void 0,
2730
- className: "rounded-full border border-border border-dashed px-2.5 py-1 text-[12.5px] text-ink-soft transition hover:border-brand hover:text-ink",
2748
+ children: [
2749
+ /* @__PURE__ */ N("div", {
2750
+ className: "flex starting:scale-95 items-center justify-between gap-2.5 rounded-xl border border-emerald-600/40 bg-emerald-500/10 px-3.5 py-2.5 text-[13px] text-emerald-800 starting:opacity-0 transition-[opacity,scale] duration-200 ease-out dark:bg-emerald-500/15 dark:text-emerald-300",
2751
+ children: [/* @__PURE__ */ N("span", {
2752
+ className: "flex min-w-0 items-center gap-2",
2753
+ children: [/* @__PURE__ */ M(de, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ N("span", {
2754
+ className: "min-w-0",
2755
+ children: [/* @__PURE__ */ M("span", {
2756
+ className: "font-semibold tracking-wide",
2757
+ children: e.code
2758
+ }), /* @__PURE__ */ N("span", {
2759
+ className: "ml-2 text-emerald-700 dark:text-emerald-400",
2731
2760
  children: [
2732
- e.code,
2733
- " · ",
2734
- Zr(e)
2761
+ "applied · you save",
2762
+ " ",
2763
+ Z({
2764
+ unit_amount: e.discount.discount,
2765
+ currency: o
2766
+ })
2735
2767
  ]
2736
- }, e._id))
2737
- })
2738
- ]
2768
+ })]
2769
+ })]
2770
+ }), /* @__PURE__ */ M("button", {
2771
+ type: "button",
2772
+ onClick: () => {
2773
+ i(), f(!1);
2774
+ },
2775
+ "aria-label": "Remove coupon",
2776
+ className: "inline-flex shrink-0 rounded-md p-1 hover:bg-emerald-600/15",
2777
+ children: /* @__PURE__ */ M(H, { className: "size-4" })
2778
+ })]
2779
+ }),
2780
+ /* @__PURE__ */ N("div", {
2781
+ className: "mt-2 flex flex-wrap gap-x-4 gap-y-1",
2782
+ children: [h.length > 0 && /* @__PURE__ */ N("button", {
2783
+ type: "button",
2784
+ "aria-expanded": d,
2785
+ onClick: () => f((e) => !e),
2786
+ className: v,
2787
+ children: [h.length === 1 ? "1 more offer" : `${h.length} more offers`, /* @__PURE__ */ M(oe, { className: X("size-3.5 transition-transform", d && "rotate-180") })]
2788
+ }), y]
2789
+ }),
2790
+ /* @__PURE__ */ M(kr, {
2791
+ open: d,
2792
+ children: /* @__PURE__ */ M("div", {
2793
+ className: "pt-2",
2794
+ children: g
2795
+ })
2796
+ }),
2797
+ b,
2798
+ _ && /* @__PURE__ */ M("div", {
2799
+ className: "pt-2",
2800
+ children: _
2739
2801
  })
2740
- })]
2802
+ ]
2803
+ }) : t?.auto ? /* @__PURE__ */ N("p", {
2804
+ className: "m-0 inline-flex items-center gap-2 rounded-xl border border-border border-dashed px-3.5 py-2.5 text-[13px] text-ink-muted",
2805
+ children: [/* @__PURE__ */ M(ce, { className: "size-3.5 animate-spin" }), "Finding your best offer…"]
2806
+ }) : /* @__PURE__ */ N("div", {
2807
+ className: "flex flex-col",
2808
+ children: [
2809
+ g && /* @__PURE__ */ N("div", {
2810
+ className: "mb-2 flex flex-col gap-2",
2811
+ children: [/* @__PURE__ */ M("span", {
2812
+ className: "font-medium text-ink text-sm",
2813
+ children: h.length === 1 ? "Offer for you" : "Offers for you"
2814
+ }), g]
2815
+ }),
2816
+ y,
2817
+ b,
2818
+ _ && /* @__PURE__ */ M("div", {
2819
+ className: "pt-2",
2820
+ children: _
2821
+ })
2822
+ ]
2741
2823
  });
2742
2824
  }, $r = (e) => {
2743
2825
  if (e < 60) return `${e} min`;
@@ -2825,21 +2907,21 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2825
2907
  };
2826
2908
  }, [e]), t;
2827
2909
  }, oi = ({ open: e, title: t, when: n, onClose: r, onClosed: i, onSubmit: a, footer: o, wide: s, initialFocusRef: c, layers: l, children: u }) => {
2828
- let d = k(null), f = ai(e), [p, m] = A(!1), h = /* @__PURE__ */ N("div", {
2910
+ let d = k(null), f = ai(e), [p, m] = A(!1), h = /* @__PURE__ */ M("div", {
2829
2911
  onScroll: (e) => m(e.currentTarget.scrollTop > 2),
2830
2912
  className: "min-h-0 flex-1 overflow-y-auto overflow-x-hidden overscroll-contain",
2831
- children: /* @__PURE__ */ P("div", {
2913
+ children: /* @__PURE__ */ N("div", {
2832
2914
  className: "flex min-h-full flex-col",
2833
- children: [/* @__PURE__ */ N("div", {
2915
+ children: [/* @__PURE__ */ M("div", {
2834
2916
  className: "flex flex-1 flex-col px-5 pt-3 pb-3",
2835
2917
  children: u
2836
- }), o && /* @__PURE__ */ N("div", {
2918
+ }), o && /* @__PURE__ */ M("div", {
2837
2919
  className: "border-border border-t bg-page px-5 pt-3 pb-[max(env(safe-area-inset-bottom),16px)] sm:sticky sm:bottom-0 sm:z-10",
2838
2920
  children: o
2839
2921
  })]
2840
2922
  })
2841
2923
  });
2842
- return /* @__PURE__ */ N(F.Root, {
2924
+ return /* @__PURE__ */ M(P.Root, {
2843
2925
  open: e,
2844
2926
  onOpenChange: (e) => {
2845
2927
  e || r();
@@ -2847,7 +2929,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2847
2929
  onOpenChangeComplete: (e) => {
2848
2930
  e || (m(!1), i());
2849
2931
  },
2850
- children: /* @__PURE__ */ P(F.Portal, { children: [/* @__PURE__ */ N(F.Backdrop, { className: "fixed inset-0 z-[2147483000] bg-black/40 transition-opacity duration-200 ease-out data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[ending-style]:duration-150 motion-reduce:transition-none sm:backdrop-blur-[3px]" }), /* @__PURE__ */ P(F.Popup, {
2932
+ children: /* @__PURE__ */ N(P.Portal, { children: [/* @__PURE__ */ M(P.Backdrop, { className: "fixed inset-0 z-[2147483000] bg-black/40 transition-opacity duration-200 ease-out data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 data-[ending-style]:duration-150 motion-reduce:transition-none sm:backdrop-blur-[3px]" }), /* @__PURE__ */ N(P.Popup, {
2851
2933
  ref: d,
2852
2934
  initialFocus: (e) => {
2853
2935
  let t = c?.current;
@@ -2859,19 +2941,19 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2859
2941
  },
2860
2942
  className: X("fixed inset-x-0 top-[var(--viewport-top)] z-[2147483000] flex h-[var(--viewport-height)] flex-col overflow-hidden bg-page font-body text-ink antialiased outline-none", "sm:inset-x-auto sm:top-[6vh] sm:left-1/2 sm:h-auto sm:max-h-[min(88dvh,var(--viewport-height))] sm:w-[calc(100%-2rem)] sm:-translate-x-1/2 sm:rounded-2xl sm:border sm:border-border sm:shadow-2xl", s ? "sm:max-w-[540px]" : "sm:max-w-[460px]", "transition-[opacity,translate] duration-200 ease-out data-[ending-style]:duration-150 motion-reduce:transition-none", "data-[ending-style]:translate-y-4 data-[starting-style]:translate-y-4 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0", "sm:data-[ending-style]:translate-y-2 sm:data-[starting-style]:translate-y-2"),
2861
2943
  children: [
2862
- /* @__PURE__ */ P("div", {
2944
+ /* @__PURE__ */ N("div", {
2863
2945
  className: X("sticky top-0 z-10 shrink-0 border-b bg-page px-5 pt-[max(env(safe-area-inset-top),16px)] pb-2 transition-colors", p ? "border-border" : "border-transparent"),
2864
- children: [/* @__PURE__ */ P("div", {
2946
+ children: [/* @__PURE__ */ N("div", {
2865
2947
  className: "flex items-center justify-between gap-3",
2866
- children: [/* @__PURE__ */ N(F.Title, {
2948
+ children: [/* @__PURE__ */ M(P.Title, {
2867
2949
  className: "m-0 line-clamp-2 font-heading font-semibold text-[19px] text-ink leading-snug tracking-[-0.011em] [overflow-wrap:anywhere]",
2868
2950
  children: t
2869
- }), /* @__PURE__ */ N(F.Close, {
2951
+ }), /* @__PURE__ */ M(P.Close, {
2870
2952
  "aria-label": "Close",
2871
2953
  className: "-mr-1.5 inline-flex size-8 shrink-0 items-center justify-center rounded-full text-ink-soft transition hover:bg-ink/5 hover:text-ink",
2872
- children: /* @__PURE__ */ N(ue, { className: "size-4" })
2954
+ children: /* @__PURE__ */ M(H, { className: "size-4" })
2873
2955
  })]
2874
- }), n && /* @__PURE__ */ P("p", {
2956
+ }), n && /* @__PURE__ */ N("p", {
2875
2957
  className: "m-0 mt-3.5 text-[13.5px] text-ink-soft",
2876
2958
  children: [
2877
2959
  n.day,
@@ -2881,7 +2963,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2881
2963
  ]
2882
2964
  })]
2883
2965
  }),
2884
- a ? /* @__PURE__ */ N("form", {
2966
+ a ? /* @__PURE__ */ M("form", {
2885
2967
  onSubmit: a,
2886
2968
  className: "flex min-h-0 flex-1 flex-col",
2887
2969
  children: h
@@ -2890,31 +2972,31 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2890
2972
  ]
2891
2973
  })] })
2892
2974
  });
2893
- }, si = "inline-flex items-center justify-center rounded-lg bg-brand px-4 py-3 font-semibold text-brand-foreground transition hover:opacity-90", ci = ({ buttonText: e, registeredEmail: t, isSheetOpen: n, isLoading: r, onOpen: i, onRegisterAnother: a }) => /* @__PURE__ */ N("div", {
2975
+ }, si = "inline-flex items-center justify-center rounded-lg bg-brand px-4 py-3 font-semibold text-brand-foreground transition hover:opacity-90", ci = ({ buttonText: e, registeredEmail: t, isSheetOpen: n, isLoading: r, onOpen: i, onRegisterAnother: a }) => /* @__PURE__ */ M("div", {
2894
2976
  className: "my-2",
2895
- children: t && !n ? /* @__PURE__ */ P("span", {
2977
+ children: t && !n ? /* @__PURE__ */ N("span", {
2896
2978
  className: "inline-flex flex-wrap items-center gap-2 rounded-xl border border-border bg-ink/3 px-3.5 py-2.5 text-ink text-sm",
2897
2979
  children: [
2898
- /* @__PURE__ */ N(H, { className: "size-4 text-emerald-600 dark:text-emerald-400" }),
2980
+ /* @__PURE__ */ M(V, { className: "size-4 text-emerald-600 dark:text-emerald-400" }),
2899
2981
  "You're registered as ",
2900
2982
  t,
2901
- /* @__PURE__ */ N("button", {
2983
+ /* @__PURE__ */ M("button", {
2902
2984
  type: "button",
2903
2985
  onClick: a,
2904
2986
  className: "text-ink-soft underline underline-offset-[3px] hover:text-ink",
2905
2987
  children: "Register someone else"
2906
2988
  })
2907
2989
  ]
2908
- }) : /* @__PURE__ */ N("button", {
2990
+ }) : /* @__PURE__ */ M("button", {
2909
2991
  type: "button",
2910
2992
  onClick: i,
2911
2993
  disabled: r,
2912
2994
  className: X(si, "disabled:opacity-60"),
2913
2995
  children: e
2914
2996
  })
2915
- }), li = ({ hasFailed: e }) => /* @__PURE__ */ N("div", {
2997
+ }), li = ({ hasFailed: e }) => /* @__PURE__ */ M("div", {
2916
2998
  className: "my-2",
2917
- children: /* @__PURE__ */ N("p", {
2999
+ children: /* @__PURE__ */ M("p", {
2918
3000
  className: "m-0 text-ink-soft text-sm",
2919
3001
  children: e ? "We couldn't load tickets for this event. Please refresh the page." : "Registration isn't open for this event yet."
2920
3002
  })
@@ -2927,12 +3009,12 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2927
3009
  });
2928
3010
  return E(() => {
2929
3011
  navigator.vibrate?.(12);
2930
- }, []), /* @__PURE__ */ P("div", {
3012
+ }, []), /* @__PURE__ */ N("div", {
2931
3013
  className: "flex flex-1 flex-col items-center justify-center px-6 py-9 text-center",
2932
3014
  children: [
2933
- /* @__PURE__ */ N("div", {
3015
+ /* @__PURE__ */ M("div", {
2934
3016
  className: "flex size-[68px] starting:scale-50 items-center justify-center rounded-full bg-emerald-500/10 text-emerald-700 starting:opacity-0 transition-[opacity,scale] duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:transition-none dark:bg-emerald-500/15 dark:text-emerald-400",
2935
- children: /* @__PURE__ */ P("svg", {
3017
+ children: /* @__PURE__ */ N("svg", {
2936
3018
  width: "30",
2937
3019
  height: "30",
2938
3020
  viewBox: "0 0 24 24",
@@ -2942,17 +3024,17 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2942
3024
  strokeLinecap: "round",
2943
3025
  strokeLinejoin: "round",
2944
3026
  "aria-hidden": "true",
2945
- children: [/* @__PURE__ */ N("title", { children: "Registered" }), /* @__PURE__ */ N("path", {
3027
+ children: [/* @__PURE__ */ M("title", { children: "Registered" }), /* @__PURE__ */ M("path", {
2946
3028
  d: "M4 12.5 L9.5 18 L20 7",
2947
3029
  className: "transition-[stroke-dashoffset] delay-200 duration-[420ms] ease-[cubic-bezier(0.32,0.72,0,1)] [stroke-dasharray:30] starting:[stroke-dashoffset:30] motion-reduce:transition-none"
2948
3030
  })]
2949
3031
  })
2950
3032
  }),
2951
- /* @__PURE__ */ N("h3", {
3033
+ /* @__PURE__ */ M("h3", {
2952
3034
  className: X(di, "m-0 mt-[18px] font-heading font-semibold text-[22px] text-ink tracking-[-0.016em] delay-[260ms]"),
2953
3035
  children: "You're in"
2954
3036
  }),
2955
- a && /* @__PURE__ */ P("p", {
3037
+ a && /* @__PURE__ */ N("p", {
2956
3038
  className: X(di, "m-0 mt-1.5 text-[14.5px] text-ink delay-[320ms]"),
2957
3039
  children: [
2958
3040
  a.day,
@@ -2960,74 +3042,74 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
2960
3042
  a.time
2961
3043
  ]
2962
3044
  }),
2963
- /* @__PURE__ */ P("p", {
3045
+ /* @__PURE__ */ N("p", {
2964
3046
  className: X(di, "m-0 mt-1 max-w-[300px] text-[13.5px] text-ink-soft leading-relaxed delay-[360ms]"),
2965
- children: [l > 1 ? `${l} spots booked · confirmation sent to ` : "Joining link sent to ", /* @__PURE__ */ N("span", {
3047
+ children: [l > 1 ? `${l} spots booked · confirmation sent to ` : "Joining link sent to ", /* @__PURE__ */ M("span", {
2966
3048
  className: "text-ink [overflow-wrap:anywhere]",
2967
3049
  children: e
2968
3050
  })]
2969
3051
  }),
2970
- /* @__PURE__ */ P("div", {
3052
+ /* @__PURE__ */ N("div", {
2971
3053
  className: X(di, "relative mt-5 w-full max-w-[340px] overflow-hidden rounded-2xl border border-border bg-ink/3 px-4 py-3.5 delay-[420ms]"),
2972
3054
  children: [
2973
- /* @__PURE__ */ N("span", {
3055
+ /* @__PURE__ */ M("span", {
2974
3056
  "aria-hidden": !0,
2975
3057
  className: "pointer-events-none absolute inset-0 starting:-translate-x-[140%] translate-x-[240%] bg-linear-to-r from-transparent via-white/45 to-transparent transition-transform delay-700 duration-900 ease-[cubic-bezier(0.32,0.72,0,1)] motion-reduce:hidden dark:via-white/10"
2976
3058
  }),
2977
- s && /* @__PURE__ */ N("img", {
3059
+ s && /* @__PURE__ */ M("img", {
2978
3060
  src: s,
2979
3061
  alt: "Booking QR code",
2980
3062
  className: "mx-auto mb-3 block size-24 rounded-lg bg-white p-1.5"
2981
3063
  }),
2982
- /* @__PURE__ */ P("div", {
3064
+ /* @__PURE__ */ N("div", {
2983
3065
  className: "flex items-center justify-between gap-3 text-[13.5px]",
2984
- children: [/* @__PURE__ */ N("span", {
3066
+ children: [/* @__PURE__ */ M("span", {
2985
3067
  className: "text-ink-soft",
2986
3068
  children: "Event"
2987
- }), /* @__PURE__ */ N("span", {
3069
+ }), /* @__PURE__ */ M("span", {
2988
3070
  className: "min-w-0 truncate font-medium text-ink",
2989
3071
  children: t
2990
3072
  })]
2991
3073
  }),
2992
- o && /* @__PURE__ */ P("div", {
3074
+ o && /* @__PURE__ */ N("div", {
2993
3075
  className: "mt-2 flex items-center justify-between gap-3 border-border border-t border-dashed pt-2 text-[13.5px]",
2994
- children: [/* @__PURE__ */ N("span", {
3076
+ children: [/* @__PURE__ */ M("span", {
2995
3077
  className: "text-ink-soft",
2996
3078
  children: "Booking ref"
2997
- }), /* @__PURE__ */ N("span", {
3079
+ }), /* @__PURE__ */ M("span", {
2998
3080
  className: "min-w-0 truncate font-medium font-mono text-ink text-xs",
2999
3081
  children: o
3000
3082
  })]
3001
3083
  })
3002
3084
  ]
3003
3085
  }),
3004
- /* @__PURE__ */ P("div", {
3086
+ /* @__PURE__ */ N("div", {
3005
3087
  className: X(di, "mt-4 flex w-full max-w-[340px] flex-col gap-2 delay-[520ms]"),
3006
3088
  children: [
3007
- f && /* @__PURE__ */ P(W.Root, { children: [/* @__PURE__ */ P(W.Trigger, {
3089
+ f && /* @__PURE__ */ N(W.Root, { children: [/* @__PURE__ */ N(W.Trigger, {
3008
3090
  className: fi,
3009
- children: [/* @__PURE__ */ N(ie, { className: "size-4" }), "Add to calendar"]
3010
- }), /* @__PURE__ */ N(W.Portal, { children: /* @__PURE__ */ N(W.Positioner, {
3091
+ children: [/* @__PURE__ */ M(ae, { className: "size-4" }), "Add to calendar"]
3092
+ }), /* @__PURE__ */ M(W.Portal, { children: /* @__PURE__ */ M(W.Positioner, {
3011
3093
  sideOffset: 6,
3012
3094
  className: "z-[2147483001]",
3013
- children: /* @__PURE__ */ P(W.Popup, {
3095
+ children: /* @__PURE__ */ N(W.Popup, {
3014
3096
  className: "flex w-[220px] origin-[var(--transform-origin)] flex-col gap-0.5 rounded-2xl border border-border bg-page p-1.5 font-body text-ink shadow-xl outline-none transition-[opacity,scale] duration-150 ease-out data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 motion-reduce:transition-none",
3015
3097
  children: [
3016
- /* @__PURE__ */ N("a", {
3098
+ /* @__PURE__ */ M("a", {
3017
3099
  href: f.google,
3018
3100
  target: "_blank",
3019
3101
  rel: "noopener noreferrer",
3020
3102
  className: ui,
3021
3103
  children: "Google Calendar"
3022
3104
  }),
3023
- /* @__PURE__ */ N("a", {
3105
+ /* @__PURE__ */ M("a", {
3024
3106
  href: f.outlook,
3025
3107
  target: "_blank",
3026
3108
  rel: "noopener noreferrer",
3027
3109
  className: ui,
3028
3110
  children: "Outlook"
3029
3111
  }),
3030
- /* @__PURE__ */ N("button", {
3112
+ /* @__PURE__ */ M("button", {
3031
3113
  type: "button",
3032
3114
  onClick: () => {
3033
3115
  if (!f) return;
@@ -3040,14 +3122,14 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3040
3122
  ]
3041
3123
  })
3042
3124
  }) })] }),
3043
- c && /* @__PURE__ */ P("a", {
3125
+ c && /* @__PURE__ */ N("a", {
3044
3126
  href: c,
3045
3127
  target: "_blank",
3046
3128
  rel: "noopener noreferrer",
3047
3129
  className: fi,
3048
- children: [/* @__PURE__ */ N(oe, { className: "size-4" }), "Download invoice"]
3130
+ children: [/* @__PURE__ */ M(se, { className: "size-4" }), "Download invoice"]
3049
3131
  }),
3050
- /* @__PURE__ */ N("button", {
3132
+ /* @__PURE__ */ M("button", {
3051
3133
  type: "button",
3052
3134
  onClick: u,
3053
3135
  className: "inline-flex min-h-[46px] w-full items-center justify-center rounded-xl bg-brand font-semibold text-[15px] text-brand-foreground transition active:scale-[0.985]",
@@ -3055,7 +3137,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3055
3137
  })
3056
3138
  ]
3057
3139
  }),
3058
- /* @__PURE__ */ N("button", {
3140
+ /* @__PURE__ */ M("button", {
3059
3141
  type: "button",
3060
3142
  onClick: d,
3061
3143
  className: "mt-4 text-[13px] text-ink-muted underline underline-offset-[3px] starting:opacity-0 transition-opacity delay-[600ms] duration-300 hover:text-ink motion-reduce:transition-none",
@@ -3081,71 +3163,71 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3081
3163
  e.name.trim() || (n.name = "Please enter your name"), t.email !== "off" && (e.email.trim() ? /^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(e.email.trim()) || (n.email = "That email address doesn't look right") : t.email === "required" && (n.email = "Please enter your email")), t.mobile !== "off" && (e.mobile.trim() ? gi(e.mobile) || (n.mobile = "That doesn't look like a valid phone number") : t.mobile === "required" && (n.mobile = "Please enter your phone number"));
3082
3164
  for (let r of ["organization", "designation"]) t[r] === "required" && !e[r].trim() && (n[r] = `Please enter your ${r}`);
3083
3165
  return n;
3084
- }, yi = (e) => e.quantity === null || e.quantity === void 0 ? 10 : Math.max(0, Math.min(10, e.quantity - (e.sale_count ?? 0))), bi = "inline-flex size-8 items-center justify-center rounded-full border border-border text-ink transition hover:border-brand hover:text-brand active:scale-95 disabled:pointer-events-none disabled:opacity-35", xi = ({ tickets: e, counts: t, onChange: n, error: r }) => /* @__PURE__ */ P("fieldset", {
3166
+ }, yi = (e) => e.quantity === null || e.quantity === void 0 ? 10 : Math.max(0, Math.min(10, e.quantity - (e.sale_count ?? 0))), bi = "inline-flex size-8 items-center justify-center rounded-full border border-border text-ink transition hover:border-brand hover:text-brand active:scale-95 disabled:pointer-events-none disabled:opacity-35", xi = ({ tickets: e, counts: t, onChange: n, error: r }) => /* @__PURE__ */ N("fieldset", {
3085
3167
  className: "m-0 flex min-w-0 flex-col gap-2 border-0 p-0",
3086
3168
  children: [
3087
- /* @__PURE__ */ N("legend", {
3169
+ /* @__PURE__ */ M("legend", {
3088
3170
  className: "mb-2 p-0 font-medium text-ink text-sm",
3089
3171
  children: "Choose your tickets"
3090
3172
  }),
3091
3173
  e.map((e) => {
3092
- let r = t[e._id] ?? 0, i = yi(e), a = i === 0, o = zr(e);
3093
- return /* @__PURE__ */ P("div", {
3174
+ let r = t[e._id] ?? 0, i = yi(e), a = i === 0, o = Br(e);
3175
+ return /* @__PURE__ */ N("div", {
3094
3176
  className: X("flex w-full items-start gap-3 rounded-xl border px-3.5 py-3 transition", r > 0 ? "border-brand bg-brand/5" : "border-border", a && "opacity-60"),
3095
- children: [/* @__PURE__ */ P("div", {
3177
+ children: [/* @__PURE__ */ N("div", {
3096
3178
  className: "min-w-0 flex-1 [overflow-wrap:anywhere]",
3097
3179
  children: [
3098
- /* @__PURE__ */ N("span", {
3180
+ /* @__PURE__ */ M("span", {
3099
3181
  className: "block font-medium text-[14.5px] text-ink leading-snug",
3100
3182
  children: e.title
3101
3183
  }),
3102
- /* @__PURE__ */ P("span", {
3184
+ /* @__PURE__ */ N("span", {
3103
3185
  className: "mt-0.5 block font-medium text-[13.5px] text-ink",
3104
- children: [Z(e), o && /* @__PURE__ */ N("span", {
3186
+ children: [Z(e), o && /* @__PURE__ */ M("span", {
3105
3187
  className: "ml-1 font-normal text-[11.5px] text-ink-muted",
3106
3188
  children: o
3107
3189
  })]
3108
3190
  }),
3109
- e.description && /* @__PURE__ */ N("span", {
3191
+ e.description && /* @__PURE__ */ M("span", {
3110
3192
  title: e.description,
3111
3193
  className: "mt-1 line-clamp-2 block text-[12.5px] text-ink-soft leading-snug",
3112
3194
  children: e.description
3113
3195
  })
3114
3196
  ]
3115
- }), a ? /* @__PURE__ */ N("span", {
3197
+ }), a ? /* @__PURE__ */ M("span", {
3116
3198
  className: "shrink-0 rounded-full bg-ink/5 px-2.5 py-1 font-medium text-[12px] text-ink-soft",
3117
3199
  children: "Sold out"
3118
- }) : /* @__PURE__ */ P("div", {
3200
+ }) : /* @__PURE__ */ N("div", {
3119
3201
  className: "flex shrink-0 flex-col items-end gap-1",
3120
- children: [/* @__PURE__ */ P("div", {
3202
+ children: [/* @__PURE__ */ N("div", {
3121
3203
  className: "flex items-center gap-2",
3122
3204
  children: [
3123
- /* @__PURE__ */ N("button", {
3205
+ /* @__PURE__ */ M("button", {
3124
3206
  type: "button",
3125
3207
  "aria-label": `Remove one ${e.title} ticket`,
3126
3208
  disabled: r === 0,
3127
3209
  onClick: () => n(e._id, r - 1),
3128
3210
  className: bi,
3129
- children: /* @__PURE__ */ N(ce, { className: "size-3.5" })
3211
+ children: /* @__PURE__ */ M(le, { className: "size-3.5" })
3130
3212
  }),
3131
- /* @__PURE__ */ P("span", {
3213
+ /* @__PURE__ */ N("span", {
3132
3214
  "aria-live": "polite",
3133
3215
  className: "w-5 text-center font-semibold text-[15px] text-ink tabular-nums",
3134
- children: [r, /* @__PURE__ */ P("span", {
3216
+ children: [r, /* @__PURE__ */ N("span", {
3135
3217
  className: "sr-only",
3136
3218
  children: [" ", e.title]
3137
3219
  })]
3138
3220
  }),
3139
- /* @__PURE__ */ N("button", {
3221
+ /* @__PURE__ */ M("button", {
3140
3222
  type: "button",
3141
3223
  "aria-label": `Add one ${e.title} ticket`,
3142
3224
  disabled: r >= i,
3143
3225
  onClick: () => n(e._id, r + 1),
3144
3226
  className: bi,
3145
- children: /* @__PURE__ */ N(le, { className: "size-3.5" })
3227
+ children: /* @__PURE__ */ M(ue, { className: "size-3.5" })
3146
3228
  })
3147
3229
  ]
3148
- }), r > 0 && r >= i && /* @__PURE__ */ P("span", {
3230
+ }), r > 0 && r >= i && /* @__PURE__ */ N("span", {
3149
3231
  className: "text-[11.5px] text-ink-muted",
3150
3232
  children: [
3151
3233
  "Max ",
@@ -3156,7 +3238,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3156
3238
  })]
3157
3239
  }, e._id);
3158
3240
  }),
3159
- r && /* @__PURE__ */ N("p", {
3241
+ r && /* @__PURE__ */ M("p", {
3160
3242
  className: "m-0 text-danger text-xs",
3161
3243
  children: r
3162
3244
  })
@@ -3288,11 +3370,18 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3288
3370
  reset: x,
3289
3371
  resetValidationDisplay: S
3290
3372
  };
3291
- }, Ti = ({ eventID: e, ticketIds: t, enabled: n }) => {
3292
- let r = i(), a = t.join(","), [o, s] = A(""), [c, l] = A(null), [u, d] = A(!1), [f, p] = A(null), [m, h] = A([]), g = k(0);
3293
- return E(() => {
3373
+ }, Ti = (e) => typeof e == "string" ? e : e._id, Ei = (e) => e.reduce((e, t) => e + (t.unit_amount ?? 0), 0), Di = (e, t, n = Date.now()) => e.flatMap((e) => {
3374
+ if (e.status === "archived" || e.starts_at && new Date(e.starts_at).getTime() > n || e.expires_at && new Date(e.expires_at).getTime() < n || e.max_redemptions && e.redeem_count >= e.max_redemptions || e.min_trnx_amount && Ei(t) < e.min_trnx_amount) return [];
3375
+ let r = e.tickets.map(Ti), i = Ei(t.filter((e) => r.includes(e._id))), a = e.kind === "percent" ? Math.round(i * (e.percent_off ?? 0) / 100) : Math.min(e.amount_off ?? 0, i), o = e.max_amount_off ? Math.min(a, e.max_amount_off) : a;
3376
+ return o > 0 ? [{
3377
+ coupon: e,
3378
+ saving: o
3379
+ }] : [];
3380
+ }).sort((e, t) => t.saving - e.saving), Oi = ({ eventID: e, tickets: t, enabled: n }) => {
3381
+ let r = i(), a = t.map((e) => e._id).join(","), [o, s] = A(null), [c, l] = A(null), [u, d] = A(null), [f, p] = A([]), m = k(0), h = k(null), g = Di(f, t), _ = g[0]?.coupon.code;
3382
+ E(() => {
3294
3383
  !n || !e || !r || r.fetch?.url(`/v1/event/event/${e}/coupon/list-public-coupons`)?.get().json().then((e) => {
3295
- e?.status && e?.content?.data && h(e.content.data);
3384
+ e?.status && e?.content?.data && p(e.content.data);
3296
3385
  }).catch((e) => {
3297
3386
  r.logger?.error("Failed to fetch public coupons", { exception: b(e) });
3298
3387
  });
@@ -3300,52 +3389,69 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3300
3389
  n,
3301
3390
  e,
3302
3391
  r
3303
- ]), {
3304
- code: o,
3305
- setCode: s,
3306
- discount: c,
3307
- isLoading: u,
3308
- error: f,
3309
- publicCoupons: m,
3310
- apply: w(async (t) => {
3311
- let n = (t ?? o).trim();
3312
- if (!n || !r) return;
3313
- let i = ++g.current, c = () => i === g.current;
3314
- d(!0), p(null);
3315
- try {
3316
- let t = await r.fetch?.url(`/v1/event/event/${e}/coupon/validate-coupon-code`)?.post({
3317
- coupon: n,
3318
- event: e,
3319
- attendees: a.split(",").filter(Boolean).map((e) => ({
3320
- name: "",
3321
- email: "",
3322
- ticket: e
3323
- }))
3324
- }).json();
3325
- c() && t?.status && (l(t.content.data), s(n));
3326
- } catch (e) {
3327
- let t = b(e);
3328
- c() && p(t.message), r.logger?.error("Coupon validation failed", { exception: t });
3329
- } finally {
3330
- c() && d(!1);
3331
- }
3332
- }, [
3333
- r,
3334
- o,
3335
- e,
3336
- a
3337
- ]),
3338
- reset: w(() => {
3339
- g.current += 1, d(!1), s(""), l(null), p(null);
3340
- }, [])
3392
+ ]);
3393
+ let v = w(async (t, { auto: n = !1 } = {}) => {
3394
+ let i = t.trim().toUpperCase();
3395
+ if (!i || !r) return !1;
3396
+ n || (h.current = a);
3397
+ let o = ++m.current, c = () => o === m.current;
3398
+ l({
3399
+ code: i,
3400
+ auto: n
3401
+ }), d(null);
3402
+ try {
3403
+ let t = await r.fetch?.url(`/v1/event/event/${e}/coupon/validate-coupon-code`)?.post({
3404
+ coupon: i,
3405
+ event: e,
3406
+ attendees: a.split(",").filter(Boolean).map((e) => ({
3407
+ name: "",
3408
+ email: "",
3409
+ ticket: e
3410
+ }))
3411
+ }).json();
3412
+ return !c() || !t?.status ? !1 : (s({
3413
+ code: i,
3414
+ discount: t.content.data
3415
+ }), !0);
3416
+ } catch (e) {
3417
+ let t = b(e);
3418
+ return c() && !n && d(t.message), r.logger?.error("Coupon validation failed", { exception: t }), !1;
3419
+ } finally {
3420
+ c() && l(null);
3421
+ }
3422
+ }, [
3423
+ r,
3424
+ e,
3425
+ a
3426
+ ]);
3427
+ E(() => {
3428
+ !n || !_ || o || h.current === a || (h.current = a, v(_, { auto: !0 }));
3429
+ }, [
3430
+ n,
3431
+ _,
3432
+ o,
3433
+ a,
3434
+ v
3435
+ ]);
3436
+ let y = w(() => {
3437
+ m.current += 1, l(null), s(null), d(null);
3438
+ }, []);
3439
+ return {
3440
+ applied: o,
3441
+ discount: o?.discount ?? null,
3442
+ pending: c,
3443
+ error: u,
3444
+ offers: g,
3445
+ apply: v,
3446
+ reset: y
3341
3447
  };
3342
- }, Ei = async (e, t) => {
3448
+ }, ki = async (e, t) => {
3343
3449
  let n = new URLSearchParams();
3344
3450
  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 ?? [];
3345
- }, Di = ({ eventID: e, external: t }) => {
3451
+ }, Ai = ({ eventID: e, external: t }) => {
3346
3452
  let n = i(), [r, a] = A([]), [o, s] = A(!t), [c, l] = A(!1), [u, d] = A(null);
3347
3453
  return E(() => {
3348
- t || !e || !n || (s(!0), l(!1), Ei(n, e).then((e) => {
3454
+ t || !e || !n || (s(!0), l(!1), ki(n, e).then((e) => {
3349
3455
  a(e), e.length === 1 && d(e[0] ?? null);
3350
3456
  }).catch((e) => {
3351
3457
  l(!0), n.logger?.error("Failed to load event tickets", { exception: b(e) });
@@ -3361,7 +3467,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3361
3467
  selectedTicket: u,
3362
3468
  selectTicket: d
3363
3469
  };
3364
- }, Oi = async (e) => {
3470
+ }, ji = async (e) => {
3365
3471
  let { payment_session_id: t, order_id: n } = e;
3366
3472
  if (!t || !n) throw Error("Cashfree payment session missing");
3367
3473
  let { load: r } = await import("./script.esm-D4nvz3-k.js"), i = await r({ mode: e.environment || "production" });
@@ -3377,8 +3483,8 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3377
3483
  status: "closed",
3378
3484
  message: a.error?.message
3379
3485
  };
3380
- }, ki = () => typeof window < "u" && "Razorpay" in window, Ai = ({ order: e, onSettled: t, onError: n }) => {
3381
- let { Razorpay: r, isLoading: i, error: a } = de(), o = k({
3486
+ }, Mi = () => typeof window < "u" && "Razorpay" in window, Ni = ({ order: e, onSettled: t, onError: n }) => {
3487
+ let { Razorpay: r, isLoading: i, error: a } = fe(), o = k({
3382
3488
  onSettled: t,
3383
3489
  onError: n
3384
3490
  });
@@ -3393,7 +3499,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3393
3499
  s.current = !0, o.current.onError(Error(a));
3394
3500
  return;
3395
3501
  }
3396
- if (!r || !ki()) return;
3502
+ if (!r || !Mi()) return;
3397
3503
  s.current = !0;
3398
3504
  let t;
3399
3505
  try {
@@ -3431,37 +3537,37 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3431
3537
  a,
3432
3538
  e
3433
3539
  ]), null;
3434
- }, ji = ({ stripePromise: e, clientSecret: t, onClose: n, onComplete: r }) => {
3540
+ }, Pi = ({ stripePromise: e, clientSecret: t, onClose: n, onComplete: r }) => {
3435
3541
  let i = k(r);
3436
3542
  i.current = r;
3437
3543
  let a = O(() => ({
3438
3544
  clientSecret: t,
3439
3545
  onComplete: () => i.current()
3440
3546
  }), [t]);
3441
- return /* @__PURE__ */ N(F.Root, {
3547
+ return /* @__PURE__ */ M(P.Root, {
3442
3548
  open: !0,
3443
3549
  onOpenChange: (e) => {
3444
3550
  e || n();
3445
3551
  },
3446
- children: /* @__PURE__ */ P(F.Portal, { children: [/* @__PURE__ */ N(F.Backdrop, { className: "fixed inset-0 z-[2147483001] bg-black/50" }), /* @__PURE__ */ P(F.Popup, {
3552
+ children: /* @__PURE__ */ N(P.Portal, { children: [/* @__PURE__ */ M(P.Backdrop, { className: "fixed inset-0 z-[2147483001] bg-black/50" }), /* @__PURE__ */ N(P.Popup, {
3447
3553
  className: "fixed top-8 left-1/2 z-[2147483001] flex max-h-[calc(100dvh-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]",
3448
- children: [/* @__PURE__ */ N(F.Close, {
3554
+ children: [/* @__PURE__ */ M(P.Close, {
3449
3555
  "aria-label": "Close payment",
3450
3556
  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",
3451
- children: /* @__PURE__ */ N(ue, { className: "size-5" })
3452
- }), /* @__PURE__ */ N("div", {
3557
+ children: /* @__PURE__ */ M(H, { className: "size-5" })
3558
+ }), /* @__PURE__ */ M("div", {
3453
3559
  className: "flex-1 overflow-y-auto rounded-2xl py-6",
3454
- children: /* @__PURE__ */ N(pe, {
3560
+ children: /* @__PURE__ */ M(me, {
3455
3561
  stripe: e,
3456
3562
  options: a,
3457
- children: /* @__PURE__ */ N(fe, { className: "stripe-embedded-checkout h-full" })
3563
+ children: /* @__PURE__ */ M(pe, { className: "stripe-embedded-checkout h-full" })
3458
3564
  })
3459
3565
  })]
3460
3566
  })] })
3461
3567
  });
3462
- }, Mi = () => {
3568
+ }, Fi = () => {
3463
3569
  let [e, t] = A(null), n = w(async (e, n) => {
3464
- if (e.provider === "cashfree") return Oi(e);
3570
+ if (e.provider === "cashfree") return ji(e);
3465
3571
  if (e.provider === "stripe") {
3466
3572
  let { client_secret: n, session_id: r } = e;
3467
3573
  if (!n || !r) throw Error("Stripe checkout session missing");
@@ -3495,7 +3601,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3495
3601
  }, []), r = (e, n) => {
3496
3602
  t(null), n instanceof Error ? e.settle.reject(n) : e.settle.resolve(n);
3497
3603
  }, i = null;
3498
- return e?.provider === "stripe" ? i = /* @__PURE__ */ N(ji, {
3604
+ return e?.provider === "stripe" ? i = /* @__PURE__ */ M(Pi, {
3499
3605
  stripePromise: e.stripePromise,
3500
3606
  clientSecret: e.clientSecret,
3501
3607
  onComplete: () => r(e, {
@@ -3503,7 +3609,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3503
3609
  confirmation: { session_id: e.sessionId }
3504
3610
  }),
3505
3611
  onClose: () => r(e, { status: "closed" })
3506
- }) : e?.provider === "razorpay" && (i = /* @__PURE__ */ N(Ai, {
3612
+ }) : e?.provider === "razorpay" && (i = /* @__PURE__ */ M(Ni, {
3507
3613
  order: e.order,
3508
3614
  onSettled: (t) => r(e, t),
3509
3615
  onError: (t) => r(e, t)
@@ -3517,8 +3623,8 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3517
3623
  providerUnreachable: "We couldn't reach the payment provider. Check your connection and try again.",
3518
3624
  confirmationFailed: "We couldn't confirm your payment. Your details are saved — try again.",
3519
3625
  generic: "Something went wrong. Please try again."
3520
- }, Ni = (e) => !!e && e.status !== "requires_payment", Pi = ({ eventID: e, details: t, onConfirmed: n }) => {
3521
- let r = i(), a = Mi(), [o, s] = A({ kind: "idle" }), c = k({
3626
+ }, Ii = (e) => !!e && e.status !== "requires_payment", Li = ({ eventID: e, details: t, onConfirmed: n }) => {
3627
+ let r = i(), a = Fi(), [o, s] = A({ kind: "idle" }), c = k({
3522
3628
  details: t,
3523
3629
  onConfirmed: n
3524
3630
  });
@@ -3534,7 +3640,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3534
3640
  message: t
3535
3641
  }), d = async (e, t) => {
3536
3642
  if (!t?.key) {
3537
- Ni(e) ? l(e) : s({
3643
+ Ii(e) ? l(e) : s({
3538
3644
  kind: "failed",
3539
3645
  message: $.registrationFailed
3540
3646
  });
@@ -3568,7 +3674,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3568
3674
  }
3569
3675
  try {
3570
3676
  let t = (await r?.fetch?.url(`/v1/event/booking/${e._id}/confirm-booking`)?.post(n.confirmation)?.json())?.content?.data;
3571
- Ni(t) ? l(t) : u(e._id, $.paymentAbandoned);
3677
+ Ii(t) ? l(t) : u(e._id, $.paymentAbandoned);
3572
3678
  } catch (t) {
3573
3679
  r?.logger?.error("Failed to confirm booking after payment", { exception: b(t) }), u(e._id, $.confirmationFailed);
3574
3680
  }
@@ -3607,67 +3713,67 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3607
3713
  },
3608
3714
  reset: () => s({ kind: "idle" })
3609
3715
  };
3610
- }, Fi = (e) => `levo:event-registration:${e}`, Ii = (e) => {
3716
+ }, Ri = (e) => `levo:event-registration:${e}`, zi = (e) => {
3611
3717
  if (typeof window > "u") return null;
3612
3718
  try {
3613
- let t = window.localStorage.getItem(Fi(e));
3719
+ let t = window.localStorage.getItem(Ri(e));
3614
3720
  return t ? JSON.parse(t) : null;
3615
3721
  } catch {
3616
3722
  return null;
3617
3723
  }
3618
- }, Li = (e, t) => {
3724
+ }, Bi = (e, t) => {
3619
3725
  if (!(typeof window > "u")) try {
3620
- window.localStorage.setItem(Fi(e), JSON.stringify(t));
3726
+ window.localStorage.setItem(Ri(e), JSON.stringify(t));
3621
3727
  } catch {}
3622
- }, Ri = (e) => {
3728
+ }, Vi = (e) => {
3623
3729
  if (!(typeof window > "u")) try {
3624
- window.localStorage.removeItem(Fi(e));
3730
+ window.localStorage.removeItem(Ri(e));
3625
3731
  } catch {}
3626
- }, zi = (e) => {
3732
+ }, Hi = (e) => {
3627
3733
  let [t, n] = A(null), [r, i] = A(null);
3628
3734
  return E(() => {
3629
- let t = Ii(e);
3735
+ let t = zi(e);
3630
3736
  t && i(t.email);
3631
3737
  }, [e]), {
3632
3738
  booking: t,
3633
3739
  registeredEmail: r,
3634
3740
  complete: (t, r) => {
3635
- n(t), i(r), Li(e, {
3741
+ n(t), i(r), Bi(e, {
3636
3742
  bookingId: t._id,
3637
3743
  email: r,
3638
3744
  at: (/* @__PURE__ */ new Date()).toISOString()
3639
3745
  });
3640
3746
  },
3641
3747
  clear: () => {
3642
- Ri(e), i(null), n(null);
3748
+ Vi(e), i(null), n(null);
3643
3749
  }
3644
3750
  };
3645
- }, Bi = "register", Vi = () => {
3751
+ }, Ui = "register", Wi = () => {
3646
3752
  if (typeof window > "u") return !1;
3647
- let e = new URLSearchParams(window.location.search).get(Bi);
3753
+ let e = new URLSearchParams(window.location.search).get(Ui);
3648
3754
  return e !== null && e !== "0" && e !== "false";
3649
- }, Hi = ({ canAutoOpen: e }) => {
3755
+ }, Gi = ({ canAutoOpen: e }) => {
3650
3756
  let [t, n] = A(!1), r = k(!1), i = w(() => n(!0), []), a = w(() => n(!1), []);
3651
3757
  return E(() => {
3652
- r.current || !e || !Vi() || (r.current = !0, n(!0));
3758
+ r.current || !e || !Wi() || (r.current = !0, n(!0));
3653
3759
  }, [e]), {
3654
3760
  isOpen: t,
3655
3761
  open: i,
3656
3762
  close: a
3657
3763
  };
3658
- }, Ui = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, Wi = ({ eventID: e, title: t, buttonText: n = "Register Now", startsAt: r, endsAt: i, eventUrl: a }) => {
3659
- let { account: o } = tt(), s = sr(), c = Di({ eventID: e }), [l, u] = A({}), [d, f] = A("tickets"), [p, m] = A(!1), [h, g] = A(null), _ = c.tickets.length === 1 ? c.tickets[0]?._id : void 0;
3764
+ }, Ki = (e, t) => `${e} ${t}${e === 1 ? "" : "s"}`, qi = ({ eventID: e, title: t, buttonText: n = "Register Now", startsAt: r, endsAt: i, eventUrl: a }) => {
3765
+ let { account: o } = nt(), s = cr(), c = Ai({ eventID: e }), [l, u] = A({}), [d, f] = A("tickets"), [p, m] = A(!1), [h, g] = A(null), _ = c.tickets.length === 1 ? c.tickets[0]?._id : void 0;
3660
3766
  E(() => {
3661
3767
  _ && u((e) => ({ [_]: e[_] || 1 }));
3662
3768
  }, [_]);
3663
3769
  let v = O(() => c.tickets.map((e) => ({
3664
3770
  ticket: e,
3665
3771
  count: l[e._id] ?? 0
3666
- })).filter((e) => e.count > 0), [c.tickets, l]), y = v.reduce((e, t) => e + t.count, 0), b = wi(o, c.tickets, l), x = b.slots[0] ? b.getValues(b.slots[0].key) : null, S = zi(e), { booking: C } = S, w = Hi({ canAutoOpen: !c.isLoading && c.tickets.length > 0 && !S.registeredEmail }), T = v.some((e) => Hr(e.ticket, null) > 0), D = Ti({
3772
+ })).filter((e) => e.count > 0), [c.tickets, l]), y = v.reduce((e, t) => e + t.count, 0), b = wi(o, c.tickets, l), x = b.slots[0] ? b.getValues(b.slots[0].key) : null, S = Hi(e), { booking: C } = S, w = Gi({ canAutoOpen: !c.isLoading && c.tickets.length > 0 && !S.registeredEmail }), T = v.some((e) => Ur(e.ticket, null) > 0), D = Oi({
3667
3773
  eventID: e,
3668
- ticketIds: b.slots.map((e) => e.ticket._id),
3669
- enabled: w.isOpen && T
3670
- }), k = qr(v, D.discount), j = !!k && !k.isFree, F = O(() => ei(r, i), [r, i]), I = t || "this event", L = Pi({
3774
+ tickets: b.slots.map((e) => e.ticket),
3775
+ enabled: w.isOpen && T && d === "review"
3776
+ }), k = Jr(v, D.discount), ee = !!k && !k.isFree, P = O(() => ei(r, i), [r, i]), F = t || "this event", I = Li({
3671
3777
  eventID: e,
3672
3778
  details: {
3673
3779
  merchantName: s?.name || t || "",
@@ -3679,14 +3785,14 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3679
3785
  }
3680
3786
  },
3681
3787
  onConfirmed: (e) => S.complete(e, x?.email.trim() ?? "")
3682
- }), R = (e, t) => {
3683
- D.reset(), L.reset(), m(!1), u((n) => ({
3788
+ }), L = (e, t) => {
3789
+ D.reset(), I.reset(), m(!1), u((n) => ({
3684
3790
  ...n,
3685
3791
  [e]: t
3686
3792
  }));
3687
- }, z = () => {
3688
- S.clear(), L.reset(), D.reset(), b.reset(), u(_ ? { [_]: 1 } : {}), f("tickets"), g(null);
3689
- }, ee = (t) => {
3793
+ }, R = () => {
3794
+ S.clear(), I.reset(), D.reset(), b.reset(), u(_ ? { [_]: 1 } : {}), f("tickets"), g(null);
3795
+ }, te = (t) => {
3690
3796
  if (t.preventDefault(), d === "tickets") {
3691
3797
  if (y === 0) {
3692
3798
  m(!0);
@@ -3705,9 +3811,9 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3705
3811
  return;
3706
3812
  }
3707
3813
  }
3708
- L.register({
3814
+ I.register({
3709
3815
  event: e,
3710
- coupon: D.code,
3816
+ coupon: D.applied?.code ?? "",
3711
3817
  attendees: b.slots.map((e) => {
3712
3818
  let t = b.getValues(e.key);
3713
3819
  return {
@@ -3718,183 +3824,181 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3718
3824
  details: {}
3719
3825
  };
3720
3826
  }),
3721
- ...b.billing.is_business_purchase && j ? {
3827
+ ...b.billing.is_business_purchase && ee ? {
3722
3828
  is_business_purchase: !0,
3723
3829
  billing_details: b.billing.billing_details
3724
3830
  } : {}
3725
3831
  });
3726
3832
  };
3727
- if (!c.isLoading && c.tickets.length === 0) return /* @__PURE__ */ N(li, { hasFailed: c.hasFailed });
3728
- let B = k && !k.isFree ? Z({
3833
+ if (!c.isLoading && c.tickets.length === 0) return /* @__PURE__ */ M(li, { hasFailed: c.hasFailed });
3834
+ let z = k && !k.isFree ? Z({
3729
3835
  unit_amount: k.amount,
3730
3836
  currency: k.currency
3731
- }) : null, te = B ? `Pay ${B}` : y === 1 ? "Save my spot" : `Save ${y} spots`, V = (e, t) => /* @__PURE__ */ P("button", {
3837
+ }) : null, ne = z ? `Pay ${z}` : y === 1 ? "Save my spot" : `Save ${y} spots`, B = (e, t) => /* @__PURE__ */ N("button", {
3732
3838
  type: "button",
3733
- disabled: L.state.kind === "busy",
3839
+ disabled: I.state.kind === "busy",
3734
3840
  onClick: () => {
3735
- L.reset(), f(t);
3841
+ I.reset(), f(t);
3736
3842
  },
3737
3843
  className: "-ml-1 inline-flex items-center gap-1.5 self-start rounded-lg px-1 py-0.5 text-[13px] text-ink-soft transition hover:text-ink disabled:pointer-events-none disabled:opacity-50",
3738
- children: [/* @__PURE__ */ N(re, { className: "size-3.5" }), e]
3739
- }), ne = "inline-flex min-h-[50px] items-center justify-center rounded-xl bg-brand px-6 font-semibold text-[15.5px] text-brand-foreground transition active:scale-[0.985] disabled:opacity-55", ie = /* @__PURE__ */ P("div", {
3844
+ children: [/* @__PURE__ */ M(ie, { className: "size-3.5" }), e]
3845
+ }), re = "inline-flex min-h-[50px] items-center justify-center rounded-xl bg-brand px-6 font-semibold text-[15.5px] text-brand-foreground transition active:scale-[0.985] disabled:opacity-55", ae = /* @__PURE__ */ N("div", {
3740
3846
  className: "flex items-center gap-3",
3741
- children: [/* @__PURE__ */ P("div", {
3847
+ children: [/* @__PURE__ */ N("div", {
3742
3848
  className: "min-w-0 flex-1",
3743
- children: [/* @__PURE__ */ N("span", {
3849
+ children: [/* @__PURE__ */ M("span", {
3744
3850
  className: "block font-semibold text-[15px] text-ink tabular-nums",
3745
- children: y === 0 ? "No tickets yet" : Ui(y, "ticket")
3746
- }), y > 0 && /* @__PURE__ */ N("span", {
3851
+ children: y === 0 ? "No tickets yet" : Ki(y, "ticket")
3852
+ }), y > 0 && /* @__PURE__ */ M("span", {
3747
3853
  className: "block text-[12.5px] text-ink-soft tabular-nums",
3748
- children: B ?? "Free"
3854
+ children: z ?? "Free"
3749
3855
  })]
3750
- }), /* @__PURE__ */ N("button", {
3856
+ }), /* @__PURE__ */ M("button", {
3751
3857
  type: "submit",
3752
- className: ne,
3858
+ className: re,
3753
3859
  children: "Continue"
3754
3860
  })]
3755
- }), H = b.isValid ? void 0 : "Fill in every attendee's details to continue", ae = d === "tickets" ? ie : d === "details" && T ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N("button", {
3861
+ }), V = b.isValid ? void 0 : "Fill in every attendee's details to continue", oe = d === "tickets" ? ae : d === "details" && T ? /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M("button", {
3756
3862
  type: "submit",
3757
3863
  disabled: !b.isValid,
3758
- className: X(ne, "w-full"),
3864
+ className: X(re, "w-full"),
3759
3865
  children: "Review order"
3760
- }), H && /* @__PURE__ */ N("p", {
3866
+ }), V && /* @__PURE__ */ M("p", {
3761
3867
  className: "m-0 mt-2 text-center text-ink-muted text-xs",
3762
- children: H
3763
- })] }) : /* @__PURE__ */ N(Yr, {
3764
- payment: L,
3765
- label: te,
3766
- isPaid: j,
3767
- blockedReason: d === "details" ? H : void 0
3868
+ children: V
3869
+ })] }) : /* @__PURE__ */ M(Xr, {
3870
+ payment: I,
3871
+ label: ne,
3872
+ isPaid: ee,
3873
+ blockedReason: d === "details" ? V : void 0
3768
3874
  });
3769
- return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(ci, {
3875
+ return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(ci, {
3770
3876
  buttonText: n,
3771
3877
  registeredEmail: S.registeredEmail,
3772
3878
  isSheetOpen: w.isOpen,
3773
3879
  isLoading: c.isLoading,
3774
3880
  onOpen: w.open,
3775
- onRegisterAnother: z
3776
- }), /* @__PURE__ */ N(oi, {
3881
+ onRegisterAnother: R
3882
+ }), /* @__PURE__ */ M(oi, {
3777
3883
  open: w.isOpen,
3778
- title: C ? I : `Register for ${I}`,
3779
- when: F,
3884
+ title: C ? F : `Register for ${F}`,
3885
+ when: P,
3780
3886
  wide: !0,
3781
3887
  onClose: w.close,
3782
3888
  onClosed: () => {
3783
- L.reset(), b.resetValidationDisplay(), m(!1);
3889
+ I.reset(), b.resetValidationDisplay(), m(!1);
3784
3890
  },
3785
- layers: L.checkoutElement,
3786
- onSubmit: C ? void 0 : ee,
3787
- footer: C ? void 0 : ae,
3788
- children: C ? /* @__PURE__ */ N(pi, {
3891
+ layers: I.checkoutElement,
3892
+ onSubmit: C ? void 0 : te,
3893
+ footer: C ? void 0 : oe,
3894
+ children: C ? /* @__PURE__ */ M(pi, {
3789
3895
  email: x?.email.trim() ?? "",
3790
- eventTitle: I,
3896
+ eventTitle: F,
3791
3897
  startsAt: r,
3792
3898
  endsAt: i,
3793
3899
  eventUrl: a,
3794
- when: F,
3900
+ when: P,
3795
3901
  bookingRef: C._id,
3796
3902
  qrImageUrl: C.qr_image?.location,
3797
3903
  invoiceUrl: C.invoice?.location,
3798
3904
  attendeeCount: b.slots.length,
3799
3905
  onClose: w.close,
3800
- onRegisterAnother: z
3801
- }) : d === "tickets" ? /* @__PURE__ */ N(xi, {
3906
+ onRegisterAnother: R
3907
+ }) : d === "tickets" ? /* @__PURE__ */ M(xi, {
3802
3908
  tickets: c.tickets,
3803
3909
  counts: l,
3804
- onChange: R,
3910
+ onChange: L,
3805
3911
  error: p ? "Add at least one ticket to continue" : void 0
3806
- }) : d === "details" ? /* @__PURE__ */ P("div", {
3912
+ }) : d === "details" ? /* @__PURE__ */ N("div", {
3807
3913
  className: "flex flex-col gap-4",
3808
3914
  children: [
3809
- V("Change tickets", "tickets"),
3810
- /* @__PURE__ */ N("span", {
3915
+ B("Change tickets", "tickets"),
3916
+ /* @__PURE__ */ M("span", {
3811
3917
  className: "font-semibold text-[16px] text-ink",
3812
3918
  children: y === 1 ? "Your details" : "Attendee details"
3813
3919
  }),
3814
- /* @__PURE__ */ N(Lr, {
3920
+ /* @__PURE__ */ M(Rr, {
3815
3921
  attendees: b,
3816
3922
  openKey: h,
3817
3923
  onOpenChange: g
3818
3924
  })
3819
3925
  ]
3820
- }) : /* @__PURE__ */ P("div", {
3926
+ }) : /* @__PURE__ */ N("div", {
3821
3927
  className: "flex flex-col gap-4",
3822
3928
  children: [
3823
- V("Edit attendee details", "details"),
3824
- /* @__PURE__ */ N(Jr, {
3929
+ B("Edit attendee details", "details"),
3930
+ /* @__PURE__ */ M(Yr, {
3825
3931
  lines: v,
3826
3932
  discount: D.discount,
3827
3933
  pricing: k
3828
3934
  }),
3829
- /* @__PURE__ */ N(Qr, {
3830
- couponCode: D.code,
3831
- onCouponCodeChange: D.setCode,
3935
+ /* @__PURE__ */ M(Qr, {
3936
+ applied: D.applied,
3937
+ pending: D.pending,
3832
3938
  couponError: D.error,
3833
- couponLoading: D.isLoading,
3834
3939
  onValidateCoupon: D.apply,
3835
3940
  onRemoveCoupon: D.reset,
3836
- publicCoupons: D.publicCoupons,
3837
- discount: D.discount,
3838
- tickets: v.map((e) => e.ticket)
3941
+ offers: D.offers,
3942
+ currency: v[0]?.ticket.currency
3839
3943
  }),
3840
- j && /* @__PURE__ */ N(Ir, {
3944
+ ee && /* @__PURE__ */ M(Lr, {
3841
3945
  values: b.billing,
3842
3946
  onChange: b.setBillingField
3843
3947
  })
3844
3948
  ]
3845
3949
  })
3846
3950
  })] });
3847
- }, Gi = ({ selectedTicket: e, discount: t }) => {
3848
- let [n, r] = A(!1), i = e?.currency, a = Hr(e, t), o = Wr(e, t), s = Gr(e, t), c = t?.discount ?? 0, l = s.length > 0 || c > 0 || o !== a, u = /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ P("span", {
3951
+ }, Ji = ({ selectedTicket: e, discount: t }) => {
3952
+ let [n, r] = A(!1), i = e?.currency, a = Ur(e, t), o = Gr(e, t), s = Kr(e, t), c = t?.discount ?? 0, l = s.length > 0 || c > 0 || o !== a, u = /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ N("span", {
3849
3953
  className: "inline-flex items-center gap-1.5",
3850
- children: ["Total", l && /* @__PURE__ */ N(ae, { className: X("size-4 text-ink-muted transition-transform", n && "rotate-180") })]
3851
- }), /* @__PURE__ */ N("span", { children: Z({
3954
+ children: ["Total", l && /* @__PURE__ */ M(oe, { className: X("size-4 text-ink-muted transition-transform", n && "rotate-180") })]
3955
+ }), /* @__PURE__ */ M("span", { children: Z({
3852
3956
  unit_amount: a,
3853
3957
  currency: i
3854
3958
  }) })] }), d = "flex w-full items-center justify-between gap-3 px-3.5 py-3 font-semibold text-[15px] text-ink";
3855
- return /* @__PURE__ */ P("div", {
3959
+ return /* @__PURE__ */ N("div", {
3856
3960
  className: "rounded-xl border border-border bg-ink/3",
3857
- children: [l ? /* @__PURE__ */ N("button", {
3961
+ children: [l ? /* @__PURE__ */ M("button", {
3858
3962
  type: "button",
3859
3963
  onClick: () => r((e) => !e),
3860
3964
  "aria-expanded": n,
3861
3965
  className: d,
3862
3966
  children: u
3863
- }) : /* @__PURE__ */ N("div", {
3967
+ }) : /* @__PURE__ */ M("div", {
3864
3968
  className: d,
3865
3969
  children: u
3866
- }), l && /* @__PURE__ */ N(Or, {
3970
+ }), l && /* @__PURE__ */ M(kr, {
3867
3971
  open: n,
3868
- children: /* @__PURE__ */ P("div", {
3972
+ children: /* @__PURE__ */ N("div", {
3869
3973
  className: "flex flex-col gap-1.5 px-3.5 pb-3 text-[13px] text-ink-soft",
3870
3974
  children: [
3871
- /* @__PURE__ */ P("div", {
3975
+ /* @__PURE__ */ N("div", {
3872
3976
  className: "flex items-center justify-between gap-3",
3873
- children: [/* @__PURE__ */ N("span", { children: "Subtotal" }), /* @__PURE__ */ N("span", { children: Z({
3977
+ children: [/* @__PURE__ */ M("span", { children: "Subtotal" }), /* @__PURE__ */ M("span", { children: Z({
3874
3978
  unit_amount: o,
3875
3979
  currency: i
3876
3980
  }) })]
3877
3981
  }),
3878
- c > 0 && /* @__PURE__ */ P("div", {
3982
+ c > 0 && /* @__PURE__ */ N("div", {
3879
3983
  className: "flex items-center justify-between gap-3 text-emerald-700 dark:text-emerald-400",
3880
- children: [/* @__PURE__ */ N("span", { children: "Discount" }), /* @__PURE__ */ P("span", { children: ["-", Z({
3984
+ children: [/* @__PURE__ */ M("span", { children: "Discount" }), /* @__PURE__ */ N("span", { children: ["-", Z({
3881
3985
  unit_amount: c,
3882
3986
  currency: i
3883
3987
  })] })]
3884
3988
  }),
3885
- s.map((e, t) => /* @__PURE__ */ P("div", {
3989
+ s.map((e, t) => /* @__PURE__ */ N("div", {
3886
3990
  className: "flex items-center justify-between gap-3",
3887
- children: [/* @__PURE__ */ P("span", { children: [
3991
+ children: [/* @__PURE__ */ N("span", { children: [
3888
3992
  e.label,
3889
3993
  " (",
3890
3994
  e.percentage,
3891
3995
  "%)"
3892
- ] }), /* @__PURE__ */ N("span", { children: Z({
3996
+ ] }), /* @__PURE__ */ M("span", { children: Z({
3893
3997
  unit_amount: e.amount,
3894
3998
  currency: i
3895
3999
  }) })]
3896
4000
  }, e.id || e._id || t)),
3897
- e?.tax_inclusive && /* @__PURE__ */ N("p", {
4001
+ e?.tax_inclusive && /* @__PURE__ */ M("p", {
3898
4002
  className: "m-0 text-ink-muted text-xs",
3899
4003
  children: "Price is inclusive of taxes"
3900
4004
  })
@@ -3902,25 +4006,25 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3902
4006
  })
3903
4007
  })]
3904
4008
  });
3905
- }, Ki = ({ tickets: e, selectedTicket: t, onSelect: n, error: r }) => {
4009
+ }, Yi = ({ tickets: e, selectedTicket: t, onSelect: n, error: r }) => {
3906
4010
  let [i, a] = A(!t);
3907
- return /* @__PURE__ */ P("fieldset", {
4011
+ return /* @__PURE__ */ N("fieldset", {
3908
4012
  className: "m-0 flex min-w-0 flex-col gap-2 border-0 p-0",
3909
4013
  children: [
3910
- /* @__PURE__ */ N("legend", {
4014
+ /* @__PURE__ */ M("legend", {
3911
4015
  className: "mb-2 p-0 font-medium text-ink text-sm",
3912
4016
  children: "Choose your ticket"
3913
4017
  }),
3914
- /* @__PURE__ */ N("div", {
4018
+ /* @__PURE__ */ M("div", {
3915
4019
  className: "-mb-2 flex flex-col",
3916
4020
  children: e.map((r) => {
3917
- let o = r._id === t?._id, s = i || o, c = zr(r);
3918
- return /* @__PURE__ */ N(Or, {
4021
+ let o = r._id === t?._id, s = i || o, c = Br(r);
4022
+ return /* @__PURE__ */ M(kr, {
3919
4023
  open: s,
3920
- children: /* @__PURE__ */ P("label", {
4024
+ children: /* @__PURE__ */ N("label", {
3921
4025
  className: X("mb-2 flex w-full cursor-pointer items-start gap-2.5 rounded-xl border px-3.5 py-3 transition", o ? "border-brand bg-brand/5" : "border-border hover:border-brand/50"),
3922
4026
  children: [
3923
- /* @__PURE__ */ N("input", {
4027
+ /* @__PURE__ */ M("input", {
3924
4028
  type: "radio",
3925
4029
  name: "ticket",
3926
4030
  value: r._id,
@@ -3933,35 +4037,35 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3933
4037
  },
3934
4038
  className: "sr-only"
3935
4039
  }),
3936
- /* @__PURE__ */ N("span", {
4040
+ /* @__PURE__ */ M("span", {
3937
4041
  "aria-hidden": !0,
3938
4042
  className: X("mt-0.5 size-[17px] shrink-0 rounded-full border transition-all", o ? "border-[5px] border-brand" : "border-border")
3939
4043
  }),
3940
- /* @__PURE__ */ P("span", {
4044
+ /* @__PURE__ */ N("span", {
3941
4045
  className: "min-w-0 flex-1 [overflow-wrap:anywhere]",
3942
- children: [/* @__PURE__ */ N("span", {
4046
+ children: [/* @__PURE__ */ M("span", {
3943
4047
  className: "block font-medium text-[14.5px] text-ink leading-snug",
3944
4048
  children: r.title
3945
- }), r.description && /* @__PURE__ */ N("span", {
4049
+ }), r.description && /* @__PURE__ */ M("span", {
3946
4050
  title: r.description,
3947
4051
  className: X("mt-0.5 block text-[12.5px] text-ink-soft leading-snug", !i && "line-clamp-2"),
3948
4052
  children: r.description
3949
4053
  })]
3950
4054
  }),
3951
- /* @__PURE__ */ P("span", {
4055
+ /* @__PURE__ */ N("span", {
3952
4056
  className: "flex shrink-0 flex-col items-end gap-1.5",
3953
- children: [/* @__PURE__ */ P("span", {
4057
+ children: [/* @__PURE__ */ N("span", {
3954
4058
  className: "text-right font-medium text-[14.5px] text-ink",
3955
- children: [Z(r), c && /* @__PURE__ */ N("span", {
4059
+ children: [Z(r), c && /* @__PURE__ */ M("span", {
3956
4060
  className: "block font-normal text-[11.5px] text-ink-muted",
3957
4061
  children: c
3958
4062
  })]
3959
- }), o && !i && e.length > 1 && /* @__PURE__ */ P("span", {
4063
+ }), o && !i && e.length > 1 && /* @__PURE__ */ N("span", {
3960
4064
  className: "inline-flex items-center gap-1 whitespace-nowrap rounded-full border border-brand/40 px-2.5 py-1 font-medium text-[12px] text-brand",
3961
4065
  children: [
3962
4066
  e.length - 1,
3963
4067
  " more",
3964
- /* @__PURE__ */ N(ae, {
4068
+ /* @__PURE__ */ M(oe, {
3965
4069
  "aria-hidden": !0,
3966
4070
  className: "size-3.5"
3967
4071
  })
@@ -3973,21 +4077,21 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
3973
4077
  }, r._id);
3974
4078
  })
3975
4079
  }),
3976
- r && /* @__PURE__ */ N("p", {
4080
+ r && /* @__PURE__ */ M("p", {
3977
4081
  className: "m-0 text-danger text-xs",
3978
4082
  children: r
3979
4083
  })
3980
4084
  ]
3981
4085
  });
3982
- }, qi = (e) => e.enableMultipleTicketBooking && !e.external ? /* @__PURE__ */ N(Wi, { ...e }, e.eventID) : /* @__PURE__ */ N(Ji, { ...e }, e.eventID), Ji = ({ eventID: e, title: t, external: n, buttonText: r = "Register Now", startsAt: i, endsAt: a, eventUrl: o }) => {
3983
- let { account: s } = tt(), c = sr(), l = Di({
4086
+ }, Xi = (e) => e.enableMultipleTicketBooking && !e.external ? /* @__PURE__ */ M(qi, { ...e }, e.eventID) : /* @__PURE__ */ M(Zi, { ...e }, e.eventID), Zi = ({ eventID: e, title: t, external: n, buttonText: r = "Register Now", startsAt: i, endsAt: a, eventUrl: o }) => {
4087
+ let { account: s } = nt(), c = cr(), l = Ai({
3984
4088
  eventID: e,
3985
4089
  external: n
3986
- }), u = l.selectedTicket?.registration_fields ?? mi, d = Ci(s, u), f = Ur(l.selectedTicket, null)?.isFree === !1, p = zi(e), { booking: m } = p, h = Hi({ canAutoOpen: !n && !l.isLoading && l.tickets.length > 0 && !p.registeredEmail }), g = k(null), _ = Ti({
4090
+ }), u = l.selectedTicket?.registration_fields ?? mi, d = Ci(s, u), f = Wr(l.selectedTicket, null)?.isFree === !1, p = Hi(e), { booking: m } = p, h = Gi({ canAutoOpen: !n && !l.isLoading && l.tickets.length > 0 && !p.registeredEmail }), g = k(null), _ = Oi({
3987
4091
  eventID: e,
3988
- ticketIds: l.selectedTicket ? [l.selectedTicket._id] : [],
4092
+ tickets: l.selectedTicket ? [l.selectedTicket] : [],
3989
4093
  enabled: h.isOpen && f
3990
- }), v = Ur(l.selectedTicket, _.discount), y = !!v && !v.isFree, b = l.tickets.length > 1, x = O(() => ei(i, a), [i, a]), S = t || "this event", C = b || y, w = Pi({
4094
+ }), v = Wr(l.selectedTicket, _.discount), y = !!v && !v.isFree, b = l.tickets.length > 1, x = O(() => ei(i, a), [i, a]), S = t || "this event", C = b || f, w = Li({
3991
4095
  eventID: e,
3992
4096
  details: {
3993
4097
  merchantName: c?.name || t || "",
@@ -4006,7 +4110,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
4006
4110
  }, D = (t) => {
4007
4111
  t.preventDefault(), d.markSubmitted(), !(!l.selectedTicket || !d.isValid) && w.register({
4008
4112
  event: e,
4009
- coupon: _.code,
4113
+ coupon: _.applied?.code ?? "",
4010
4114
  attendees: [{
4011
4115
  name: d.values.name.trim(),
4012
4116
  email: d.values.email.trim(),
@@ -4020,28 +4124,28 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
4020
4124
  } : {}
4021
4125
  });
4022
4126
  };
4023
- if (n) return /* @__PURE__ */ N("div", {
4127
+ if (n) return /* @__PURE__ */ M("div", {
4024
4128
  className: "my-2",
4025
- children: /* @__PURE__ */ N("button", {
4129
+ children: /* @__PURE__ */ M("button", {
4026
4130
  type: "button",
4027
4131
  className: si,
4028
4132
  onClick: () => window.open(n, "_blank", "noopener,noreferrer"),
4029
4133
  children: r
4030
4134
  })
4031
4135
  });
4032
- if (!l.isLoading && l.tickets.length === 0) return /* @__PURE__ */ N(li, { hasFailed: l.hasFailed });
4136
+ if (!l.isLoading && l.tickets.length === 0) return /* @__PURE__ */ M(li, { hasFailed: l.hasFailed });
4033
4137
  let A = v ? v.isFree ? "Save my spot" : `Pay ${Z({
4034
4138
  unit_amount: v.amount,
4035
4139
  currency: v.currency
4036
4140
  })}` : "Choose a ticket";
4037
- return /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(ci, {
4141
+ return /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(ci, {
4038
4142
  buttonText: r,
4039
4143
  registeredEmail: p.registeredEmail,
4040
4144
  isSheetOpen: h.isOpen,
4041
4145
  isLoading: l.isLoading,
4042
4146
  onOpen: h.open,
4043
4147
  onRegisterAnother: E
4044
- }), /* @__PURE__ */ N(oi, {
4148
+ }), /* @__PURE__ */ M(oi, {
4045
4149
  open: h.isOpen,
4046
4150
  title: m ? S : `Register for ${S}`,
4047
4151
  when: x,
@@ -4053,12 +4157,12 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
4053
4157
  initialFocusRef: b ? void 0 : g,
4054
4158
  layers: w.checkoutElement,
4055
4159
  onSubmit: m ? void 0 : D,
4056
- footer: m ? void 0 : /* @__PURE__ */ N(Yr, {
4160
+ footer: m ? void 0 : /* @__PURE__ */ M(Xr, {
4057
4161
  payment: w,
4058
4162
  label: A,
4059
4163
  isPaid: y
4060
4164
  }),
4061
- children: m ? /* @__PURE__ */ N(pi, {
4165
+ children: m ? /* @__PURE__ */ M(pi, {
4062
4166
  email: d.values.email.trim(),
4063
4167
  eventTitle: S,
4064
4168
  startsAt: i,
@@ -4070,35 +4174,33 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
4070
4174
  invoiceUrl: m.invoice?.location,
4071
4175
  onClose: h.close,
4072
4176
  onRegisterAnother: E
4073
- }) : /* @__PURE__ */ P("div", {
4177
+ }) : /* @__PURE__ */ N("div", {
4074
4178
  className: "flex flex-col gap-4",
4075
4179
  children: [
4076
- b && /* @__PURE__ */ N(Ki, {
4180
+ b && /* @__PURE__ */ M(Yi, {
4077
4181
  tickets: l.tickets,
4078
4182
  selectedTicket: l.selectedTicket,
4079
4183
  onSelect: T,
4080
4184
  error: d.submitAttempted && !l.selectedTicket ? "Choose a ticket to continue" : void 0
4081
4185
  }),
4082
- y && /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(Gi, {
4186
+ f && /* @__PURE__ */ N(j, { children: [/* @__PURE__ */ M(Ji, {
4083
4187
  selectedTicket: l.selectedTicket,
4084
4188
  discount: _.discount
4085
- }), /* @__PURE__ */ N(Qr, {
4086
- couponCode: _.code,
4087
- onCouponCodeChange: _.setCode,
4189
+ }), /* @__PURE__ */ M(Qr, {
4190
+ applied: _.applied,
4191
+ pending: _.pending,
4088
4192
  couponError: _.error,
4089
- couponLoading: _.isLoading,
4090
4193
  onValidateCoupon: _.apply,
4091
4194
  onRemoveCoupon: _.reset,
4092
- publicCoupons: _.publicCoupons,
4093
- discount: _.discount,
4094
- tickets: l.selectedTicket ? [l.selectedTicket] : []
4195
+ offers: _.offers,
4196
+ currency: l.selectedTicket?.currency
4095
4197
  })] }),
4096
- /* @__PURE__ */ P("div", {
4198
+ /* @__PURE__ */ N("div", {
4097
4199
  className: X("flex flex-col gap-4", C && "border-border border-t pt-4"),
4098
- children: [C && /* @__PURE__ */ N("span", {
4200
+ children: [C && /* @__PURE__ */ M("span", {
4099
4201
  className: "font-medium text-ink text-sm",
4100
4202
  children: "Your details"
4101
- }), /* @__PURE__ */ N(Fr, {
4203
+ }), /* @__PURE__ */ M(Ir, {
4102
4204
  values: d.values,
4103
4205
  errors: d.errors,
4104
4206
  touched: d.touched,
@@ -4112,7 +4214,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
4112
4214
  ]
4113
4215
  })
4114
4216
  })] });
4115
- }, Yi = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, Xi = (e) => typeof e == "string" && e.trim() ? e : void 0, Zi = (e) => typeof e == "string" ? e : e?.location ?? void 0, Qi = (e, t) => {
4217
+ }, Qi = (e) => e.length > 1 ? e.replace(/\/+$/, "") : e, $i = (e) => typeof e == "string" && e.trim() ? e : void 0, ea = (e) => typeof e == "string" ? e : e?.location ?? void 0, ta = (e, t) => {
4116
4218
  let n = e.meta ?? {}, r = e.title && t ? `${e.title} | ${t}` : e.title || t || void 0;
4117
4219
  return {
4118
4220
  title: n.meta_title || r,
@@ -4122,32 +4224,32 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
4122
4224
  og: {
4123
4225
  title: n.og_title || void 0,
4124
4226
  description: n.og_description || void 0,
4125
- image: Zi(n.og_image),
4227
+ image: ea(n.og_image),
4126
4228
  url: n.og_url || void 0
4127
4229
  },
4128
4230
  twitter: { card: n.twitter_card || void 0 },
4129
4231
  ldJson: n.ld_json || void 0,
4130
4232
  customHead: n.head_code || void 0
4131
4233
  };
4132
- }, $i = (e) => ({
4234
+ }, na = (e) => ({
4133
4235
  description: e.description || void 0,
4134
4236
  customHead: e.settings?.head_code || void 0
4135
- }), ea = (e) => (t = {}, n) => (r) => {
4136
- let i = Qi(t, e.name);
4237
+ }), ra = (e) => (t = {}, n) => (r) => {
4238
+ let i = ta(t, e.name);
4137
4239
  if (n) {
4138
4240
  let t = r?.loaderData?.[n.source];
4139
4241
  if (t) {
4140
- let r = n.title ? Xi(t[n.title]) : void 0;
4242
+ let r = n.title ? $i(t[n.title]) : void 0;
4141
4243
  r && (i.title = e.name ? `${r} | ${e.name}` : r, i.og = {
4142
4244
  ...i.og,
4143
4245
  title: r
4144
4246
  });
4145
- let a = n.description ? Xi(t[n.description]) : void 0;
4247
+ let a = n.description ? $i(t[n.description]) : void 0;
4146
4248
  a && (i.description = a, i.og = {
4147
4249
  ...i.og,
4148
4250
  description: a
4149
4251
  });
4150
- let o = n.image ? Zi(t[n.image]) : void 0;
4252
+ let o = n.image ? ea(t[n.image]) : void 0;
4151
4253
  o && (i.og = {
4152
4254
  ...i.og,
4153
4255
  image: o
@@ -4156,31 +4258,31 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
4156
4258
  }
4157
4259
  if (!i.canonical) {
4158
4260
  let t = r?.match?.pathname, n = (e.domain || "").trim();
4159
- n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") + Yi(t));
4261
+ n && t?.startsWith("/") && (i.canonical = (/^https?:\/\//.test(n) ? n : `https://${n}`).replace(/\/+$/, "") + Qi(t));
4160
4262
  }
4161
- let a = Er(i, $i(e)), o = t.id?.trim();
4263
+ let a = Dr(i, na(e)), o = t.id?.trim();
4162
4264
  return o && a.meta.push({
4163
- name: tr,
4265
+ name: nr,
4164
4266
  content: o
4165
4267
  }), a;
4166
- }, ta = (e) => e.params, na = (e) => {
4167
- let t = Me(e);
4268
+ }, ia = (e) => e.params, aa = (e) => {
4269
+ let t = Ne(e);
4168
4270
  return (e, n) => {
4169
- let { rules: r, invalid: i } = we(n?.access), a = r.length > 0 || i;
4170
- return (n) => a ? Promise.resolve({}) : Qe({
4271
+ let { rules: r, invalid: i } = Te(n?.access), a = r.length > 0 || i;
4272
+ return (n) => a ? Promise.resolve({}) : $e({
4171
4273
  queryClient: n.context.queryClient,
4172
4274
  config: t,
4173
4275
  sources: e,
4174
- params: ta(n)
4276
+ params: ia(n)
4175
4277
  });
4176
4278
  };
4177
- }, ra = 2, ia = (e) => {
4178
- let { limit: t = 20, debounceMs: n = 300, hotkey: r = !0 } = e ?? {}, a = i(), o = sr(), s = K(), [c, l] = A(""), [u, d] = A(!1), [f, p] = A("");
4279
+ }, oa = 2, sa = (e) => {
4280
+ let { limit: t = 20, debounceMs: n = 300, hotkey: r = !0 } = e ?? {}, a = i(), o = cr(), s = K(), [c, l] = A(""), [u, d] = A(!1), [f, p] = A("");
4179
4281
  E(() => {
4180
4282
  let e = setTimeout(() => p(c.trim()), n);
4181
4283
  return () => clearTimeout(e);
4182
4284
  }, [c, n]);
4183
- let m = f.length >= ra, h = R({
4285
+ let m = f.length >= oa, h = L({
4184
4286
  queryKey: [
4185
4287
  "levo-search",
4186
4288
  o?.id ?? null,
@@ -4200,7 +4302,7 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
4200
4302
  }
4201
4303
  },
4202
4304
  enabled: s && !!a && !!o?.id && m,
4203
- placeholderData: I,
4305
+ placeholderData: F,
4204
4306
  staleTime: 3e4
4205
4307
  }), g = w(() => {
4206
4308
  l(""), p("");
@@ -4229,4 +4331,4 @@ var X = (...e) => e.filter(Boolean).join(" "), Or = ({ open: e, className: t, ch
4229
4331
  };
4230
4332
  };
4231
4333
  //#endregion
4232
- export { zt as ColorModeProvider, Xn as Inspector, ge as LEVO_AUTH_METHODS, q as LEVO_AUTH_QUERY_KEY, he as LEVO_OAUTH_METHODS, wt as LEVO_OTP_LENGTH, mt as LEVO_PENDING_APPROVAL_CODE, me as LEVO_PRIMARY_AUTH_METHODS, m as LOCALE_COOKIE, l as LOCALE_REDIRECT_CACHE_CONTROL, jt as LevoChat, Ht as LevoEditForm, nt as LevoEntryForm, qi as LevoEventRegister, Ut as LevoForm, hr as LevoLink, ir as LevoPopups, st as LevoProfileForm, ur as LevoSiteProvider, gr as LocaleHreflang, vr as LocaleProvider, tr as PAGE_ID_META, Dr as PageHead, xr as SiteLocaleProvider, mr as buildHreflangLinks, ea as createLevoHead, na as createLevoLoader, _ as createRouteTreeMatcher, je as createSiteClient, Ae as decideAccess, v as extractGeoAndLanguageData, ht as isPendingApprovalError, Tt as isValidEmail, Et as isValidOtp, Ot as isValidPhone, Re as levoParams, dr as localeBeforeLoad, p as localePath, d as localeRedirectResponse, Dt as normalizePhone, Er as pageHead, we as parseAccess, Tr as parseRawHead, Qe as prefetchLevoSources, fr as readLocaleConfig, nr as readPageId, Te as resolveAuthMethods, g as resolveLocale, u as resolveLocaleRedirect, s as resolveLocaleRequest, Me as siteConfigFromJson, f as splitLocalePrefix, Bt as useColorMode, Sr as useLanguageOptions, pt as useLevoAccess, tt as useLevoAuth, Xe as useLevoForm, lr as useLevoInsights, vt as useLevoLogin, Ct as useLevoOAuth, kt as useLevoOtpInput, Ye as useLevoRecord, ia as useLevoSearch, cr as useLevoSite, Je as useLevoSource, yr as useLocale, br as useUrlLocale };
4334
+ export { Bt as ColorModeProvider, Zn as Inspector, _e as LEVO_AUTH_METHODS, q as LEVO_AUTH_QUERY_KEY, ge as LEVO_OAUTH_METHODS, Tt as LEVO_OTP_LENGTH, ht as LEVO_PENDING_APPROVAL_CODE, he as LEVO_PRIMARY_AUTH_METHODS, m as LOCALE_COOKIE, l as LOCALE_REDIRECT_CACHE_CONTROL, Mt as LevoChat, Ut as LevoEditForm, rt as LevoEntryForm, Xi as LevoEventRegister, Wt as LevoForm, gr as LevoLink, ar as LevoPopups, ct as LevoProfileForm, dr as LevoSiteProvider, _r as LocaleHreflang, yr as LocaleProvider, nr as PAGE_ID_META, Or as PageHead, Sr as SiteLocaleProvider, hr as buildHreflangLinks, ra as createLevoHead, aa as createLevoLoader, _ as createRouteTreeMatcher, Me as createSiteClient, je as decideAccess, v as extractGeoAndLanguageData, gt as isPendingApprovalError, Et as isValidEmail, Dt as isValidOtp, kt as isValidPhone, ze as levoParams, fr as localeBeforeLoad, p as localePath, d as localeRedirectResponse, Ot as normalizePhone, Dr as pageHead, Te as parseAccess, Er as parseRawHead, $e as prefetchLevoSources, pr as readLocaleConfig, rr as readPageId, Ee as resolveAuthMethods, g as resolveLocale, u as resolveLocaleRedirect, s as resolveLocaleRequest, Ne as siteConfigFromJson, f as splitLocalePrefix, Vt as useColorMode, Cr as useLanguageOptions, mt as useLevoAccess, nt as useLevoAuth, Ze as useLevoForm, ur as useLevoInsights, yt as useLevoLogin, wt as useLevoOAuth, At as useLevoOtpInput, Xe as useLevoRecord, sa as useLevoSearch, lr as useLevoSite, Ye as useLevoSource, br as useLocale, xr as useUrlLocale };