webim-adapter 0.12.0 → 0.14.0

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.
@@ -48,36 +48,36 @@ function h(e) {
48
48
  color: j,
49
49
  inset: M
50
50
  })), N.length && (t.boxShadow = N.join(", "));
51
- let P = (e) => e.type === "blur" ? `blur(${p(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: ee, filterBrightness: z, filterContrast: te, filterSaturate: ne } = t;
51
+ let P = (e) => e.type === "blur" ? `blur(${p(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: ee, filterBlur: L, filterGrayscale: te, filterBrightness: R, filterContrast: z, filterSaturate: ne } = t;
52
52
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
53
53
  let B = F(I);
54
- R !== void 0 && B.push(`blur(${p(R)})`), ee !== void 0 && B.push(`grayscale(${ee}%)`), z !== void 0 && B.push(`brightness(${z}%)`), te !== void 0 && B.push(`contrast(${te}%)`), ne !== void 0 && B.push(`saturate(${ne}%)`), B.length && (t.filter = B.join(" "));
55
- let re = F(L);
54
+ L !== void 0 && B.push(`blur(${p(L)})`), te !== void 0 && B.push(`grayscale(${te}%)`), R !== void 0 && B.push(`brightness(${R}%)`), z !== void 0 && B.push(`contrast(${z}%)`), ne !== void 0 && B.push(`saturate(${ne}%)`), B.length && (t.filter = B.join(" "));
55
+ let re = F(ee);
56
56
  re.length && (t.backdropFilter = re.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
57
  let { textStrokeWidth: ie, textStrokeColor: ae } = t;
58
58
  delete t.textStrokeWidth, delete t.textStrokeColor, (ie !== void 0 || ae !== void 0) && (t.WebkitTextStroke = `${p(ie ?? 1)} ${ae || "currentColor"}`);
59
59
  let { clipText: oe } = t;
60
60
  delete t.clipText, oe && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
- let { transitions: se, transitionDuration: V, transitionEasing: H, transitionProperty: ce } = t, le = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
61
+ let { transitions: se, transitionDuration: V, transitionEasing: H, transitionProperty: U } = t, W = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
62
62
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
63
- let U = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${le(e.duration ?? 200)} ${e.easing || "ease"}`);
64
- if (V !== void 0 && U.push(`${ce || "all"} ${le(V)} ${H || "ease"}`), U.length && (t.transition = U.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
63
+ let G = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${W(e.duration ?? 200)} ${e.easing || "ease"}`);
64
+ if (V !== void 0 && G.push(`${U || "all"} ${W(V)} ${H || "ease"}`), G.length && (t.transition = G.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
65
65
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
66
66
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
67
67
  }
68
68
  delete t.backgroundVideo;
69
- let { overlayColor: ue, overlayOpacity: W } = t;
70
- if (delete t.overlayColor, delete t.overlayOpacity, ue) {
71
- let e = `color-mix(in srgb, ${ue} ${W ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
69
+ let { overlayColor: K, overlayOpacity: ce } = t;
70
+ if (delete t.overlayColor, delete t.overlayOpacity, K) {
71
+ let e = `color-mix(in srgb, ${K} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
72
72
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
73
73
  }
74
74
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
75
- let { backgroundLayers: de } = t;
75
+ let { backgroundLayers: q } = t;
76
76
  delete t.backgroundLayers;
77
- let G = (Array.isArray(de) ? de : []).filter((e) => e && e.on !== !1);
78
- if (G.length) {
77
+ let le = (Array.isArray(q) ? q : []).filter((e) => e && e.on !== !1);
78
+ if (le.length) {
79
79
  let e = [], n = [], r = [], i = [], a = [];
80
- for (let t of G) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
80
+ for (let t of le) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
81
81
  else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
82
82
  else {
83
83
  if (!t.src) continue;
@@ -272,19 +272,19 @@ function I(e) {
272
272
  "--page-heading-font": t.headingFont === "inherit" ? "inherit" : M(t.headingFont, "inherit")
273
273
  };
274
274
  }
275
- function L(e, t = "light") {
275
+ function ee(e, t = "light") {
276
276
  let n = P(e);
277
277
  return {
278
278
  ...I(e),
279
279
  ...F(n[t] ?? n.light)
280
280
  };
281
281
  }
282
- function R(e, t) {
282
+ function L(e, t) {
283
283
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
284
284
  }
285
285
  //#endregion
286
286
  //#region src/bundle.js
287
- function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
287
+ function te({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
288
288
  let a = {
289
289
  ...t?.global ?? {},
290
290
  ...t?.tenant ?? {}
@@ -294,7 +294,7 @@ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
294
294
  title: e.title,
295
295
  slug: e.slug,
296
296
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
297
- theme: R(o, a.builder_themes?.themes),
297
+ theme: L(o, a.builder_themes?.themes),
298
298
  components: a.builder_components?.components ?? {},
299
299
  custom: o.custom,
300
300
  seo: o.seo,
@@ -308,29 +308,36 @@ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
308
308
  }
309
309
  //#endregion
310
310
  //#region src/fetchPage.js
311
- var z = async (e) => {
311
+ var R = async (e) => {
312
312
  let t = await e.json().catch(() => null);
313
313
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
314
314
  return t?.payload ?? t;
315
315
  };
316
- async function te({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
316
+ async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
317
317
  if (!e) throw Error("fetchPage: apiUrl is required");
318
318
  if (!n) throw Error("fetchPage: slug is required");
319
- let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
319
+ let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
320
320
  ...t ? { "x-tenant": t } : {},
321
321
  ...a ? { authorization: `Bearer ${a}` } : {}
322
- }, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(z), s(`${c}/settings/public`, { headers: l }).then(z)]), f = ee({
323
- page: u,
324
- settings: d,
322
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(R), c(`${l}/settings/public`, { headers: u }).then(R)]), p = te({
323
+ page: d,
324
+ settings: f,
325
325
  tenant: t,
326
- apiUrl: c,
326
+ apiUrl: l,
327
327
  locale: r
328
- }), p = [...new Set(Object.values(f.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
329
- if (p.length) {
330
- let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(z).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
331
- f.datasets = Object.fromEntries(t);
328
+ }), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
329
+ if (m.length) {
330
+ let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(R).then((e) => {
331
+ let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
332
+ return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
333
+ }).catch(() => [[t, []]])));
334
+ p.datasets = Object.fromEntries(t.flat());
332
335
  }
333
- return f;
336
+ let h = Number(o);
337
+ return Number.isFinite(h) && h >= 1 && (p.datasets = {
338
+ ...p.datasets ?? {},
339
+ __page: Math.floor(h)
340
+ }), p;
334
341
  }
335
342
  new Map([
336
343
  {
@@ -479,11 +486,17 @@ var ae = /* @__PURE__ */ new Set([
479
486
  apiUrl: "/api",
480
487
  locale: "",
481
488
  settings: null
482
- }), H = t(null), ce = t(null), le = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
483
- function U(e, t) {
489
+ }), H = t(null), U = (e) => {
490
+ let t = Number(e?.__page);
491
+ if (Number.isFinite(t) && t >= 1) return Math.floor(t);
492
+ if (typeof window > "u") return 1;
493
+ let n = Number(new URLSearchParams(window.location.search).get("page"));
494
+ return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
495
+ }, W = t(null), G = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
496
+ function K(e, t) {
484
497
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
485
498
  }
486
- var ue = (e) => {
499
+ var ce = (e) => {
487
500
  let t = [];
488
501
  for (let [n, r] of Object.entries(e ?? {})) {
489
502
  if (!/^[\w-]+$/.test(n)) continue;
@@ -493,36 +506,36 @@ var ue = (e) => {
493
506
  }
494
507
  return t;
495
508
  };
496
- function W(e) {
509
+ function q(e) {
497
510
  return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
498
511
  }
499
- function de(e, t) {
500
- let n = t?.data ?? {}, r = ue(n);
512
+ function le(e, t) {
513
+ let n = t?.data ?? {}, r = ce(n);
501
514
  if (!r.length) return e;
502
- let i = RegExp(`:(${r.map(le).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => W(U(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
515
+ let i = RegExp(`:(${r.map(G).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => q(K(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
503
516
  return a(e);
504
517
  }
505
- var G = {
518
+ var ue = {
506
519
  margin: 0,
507
520
  fontWeight: 700,
508
521
  lineHeight: 1.2,
509
522
  fontFamily: "var(--page-heading-font, inherit)"
510
- }, fe = { margin: 0 }, K = {
523
+ }, de = { margin: 0 }, J = {
511
524
  display: "inline-block",
512
525
  textDecoration: "none",
513
526
  cursor: "pointer",
514
527
  backgroundColor: "var(--page-accent, #111827)",
515
528
  color: "var(--page-accent-text, #ffffff)"
516
- }, pe = {
529
+ }, fe = {
517
530
  flexGrow: 1,
518
531
  display: "flex",
519
532
  flexDirection: "column",
520
533
  position: "relative"
521
- }, me = {
534
+ }, pe = {
522
535
  display: "flex",
523
536
  flexDirection: "column"
524
537
  };
525
- function he({ style: e }) {
538
+ function me({ style: e }) {
526
539
  let t = e?.backgroundVideo;
527
540
  if (!t) return null;
528
541
  let n = {
@@ -548,7 +561,7 @@ function he({ style: e }) {
548
561
  background: r
549
562
  } })] });
550
563
  }
551
- var ge = (e, t) => e?.backgroundVideo ? {
564
+ var he = (e, t) => e?.backgroundVideo ? {
552
565
  position: "relative",
553
566
  ...t,
554
567
  ...h(e)
@@ -556,24 +569,24 @@ var ge = (e, t) => e?.backgroundVideo ? {
556
569
  ...t,
557
570
  ...h(e)
558
571
  };
559
- function _e({ style: e, nodeRef: t, children: n }) {
572
+ function ge({ style: e, nodeRef: t, children: n }) {
560
573
  return /* @__PURE__ */ d("div", {
561
574
  ref: t,
562
575
  style: {
563
- ...pe,
576
+ ...fe,
564
577
  ...h(e)
565
578
  },
566
- children: [/* @__PURE__ */ u(he, { style: e }), n]
579
+ children: [/* @__PURE__ */ u(me, { style: e }), n]
567
580
  });
568
581
  }
569
- function ve({ style: e, nodeRef: t, children: n }) {
582
+ function _e({ style: e, nodeRef: t, children: n }) {
570
583
  return /* @__PURE__ */ d("section", {
571
584
  ref: t,
572
- style: ge(e, me),
573
- children: [/* @__PURE__ */ u(he, { style: e }), n]
585
+ style: he(e, pe),
586
+ children: [/* @__PURE__ */ u(me, { style: e }), n]
574
587
  });
575
588
  }
576
- function ye({ style: e, freeLayout: t, nodeRef: n, children: r }) {
589
+ function ve({ style: e, freeLayout: t, nodeRef: n, children: r }) {
577
590
  let i = t ? {
578
591
  position: "relative",
579
592
  minHeight: 240
@@ -582,32 +595,32 @@ function ye({ style: e, freeLayout: t, nodeRef: n, children: r }) {
582
595
  ref: n,
583
596
  style: i ? {
584
597
  ...i,
585
- ...ge(e)
586
- } : ge(e),
587
- children: [/* @__PURE__ */ u(he, { style: e }), r]
598
+ ...he(e)
599
+ } : he(e),
600
+ children: [/* @__PURE__ */ u(me, { style: e }), r]
588
601
  });
589
602
  }
590
- function be({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
603
+ function ye({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
591
604
  return /* @__PURE__ */ u(n, {
592
605
  ref: a,
593
606
  style: {
594
- ...G,
607
+ ...ue,
595
608
  ...h(r)
596
609
  },
597
- children: q(t, e, i)
610
+ children: Y(t, e, i)
598
611
  });
599
612
  }
600
- var xe = {
613
+ var be = {
601
614
  fontFamily: j.mono.value,
602
615
  background: "rgba(148, 163, 184, 0.18)",
603
616
  padding: "1px 5px",
604
617
  borderRadius: 4,
605
618
  fontSize: "0.9em"
606
619
  };
607
- function Se(e, t = [], n, r) {
620
+ function xe(e, t = [], n, r) {
608
621
  let i = e;
609
622
  return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
610
- style: xe,
623
+ style: be,
611
624
  children: i
612
625
  })), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n && (i = /* @__PURE__ */ u("a", {
613
626
  href: n,
@@ -617,13 +630,13 @@ function Se(e, t = [], n, r) {
617
630
  children: i
618
631
  })), i;
619
632
  }
620
- function q(t, n, r) {
633
+ function Y(t, n, r) {
621
634
  return t?.length ? t.map((t, n) => {
622
635
  if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
623
- if (t.parts) return /* @__PURE__ */ u(e, { children: q(t.parts, "", r) }, n);
636
+ if (t.parts) return /* @__PURE__ */ u(e, { children: Y(t.parts, "", r) }, n);
624
637
  let i = t.text;
625
638
  return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
626
- style: xe,
639
+ style: be,
627
640
  children: i
628
641
  })), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
629
642
  style: {
@@ -640,13 +653,13 @@ function q(t, n, r) {
640
653
  })), /* @__PURE__ */ u(e, { children: i }, n);
641
654
  }) : n;
642
655
  }
643
- function Ce({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
656
+ function Se({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
644
657
  return /* @__PURE__ */ u("span", {
645
658
  style: h(a),
646
- children: e?.length ? q(e, t) : Se(t, n, r, i)
659
+ children: e?.length ? Y(e, t) : xe(t, n, r, i)
647
660
  });
648
661
  }
649
- var we = {
662
+ var Ce = {
650
663
  h1: 40,
651
664
  h2: 32,
652
665
  h3: 26,
@@ -654,7 +667,7 @@ var we = {
654
667
  h5: 19,
655
668
  h6: 16
656
669
  };
657
- function Te({ align: e = "center", width: t, wrap: n } = {}) {
670
+ function we({ align: e = "center", width: t, wrap: n } = {}) {
658
671
  let r = t ? `${t}%` : void 0;
659
672
  if (e === "full") return { width: "100%" };
660
673
  let i = e === "left" || e === "right";
@@ -688,8 +701,8 @@ function Te({ align: e = "center", width: t, wrap: n } = {}) {
688
701
  marginRight: "auto"
689
702
  };
690
703
  }
691
- function Ee(e = [], t, n) {
692
- let r = n ?? ((e, n) => q(e, n, t));
704
+ function Te(e = [], t, n) {
705
+ let r = n ?? ((e, n) => Y(e, n, t));
693
706
  return e.map((t, n) => {
694
707
  let i = {
695
708
  marginTop: 0,
@@ -711,7 +724,7 @@ function Ee(e = [], t, n) {
711
724
  marginLeft: 0,
712
725
  marginRight: 0,
713
726
  ...i,
714
- ...Te(t)
727
+ ...we(t)
715
728
  },
716
729
  children: [t.href ? /* @__PURE__ */ u("a", {
717
730
  href: t.href,
@@ -730,16 +743,16 @@ function Ee(e = [], t, n) {
730
743
  })]
731
744
  }, n);
732
745
  }
733
- if (t.type === "video") return Le(t.url) ? /* @__PURE__ */ u("div", {
746
+ if (t.type === "video") return Ie(t.url) ? /* @__PURE__ */ u("div", {
734
747
  style: {
735
748
  ...i,
736
- ...Te({
749
+ ...we({
737
750
  align: t.align,
738
751
  wrap: t.wrap,
739
752
  width: t.width ?? 100
740
753
  })
741
754
  },
742
- children: /* @__PURE__ */ u(Re, {
755
+ children: /* @__PURE__ */ u(Le, {
743
756
  url: t.url,
744
757
  autoplay: t.autoplay,
745
758
  muted: t.muted,
@@ -768,17 +781,17 @@ function Ee(e = [], t, n) {
768
781
  }
769
782
  if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
770
783
  style: {
771
- ...Oe,
784
+ ...De,
772
785
  ...i
773
786
  },
774
787
  children: r(t.parts, t.text)
775
788
  }, n);
776
- if (we[t.type]) {
789
+ if (Ce[t.type]) {
777
790
  let e = t.type;
778
791
  return /* @__PURE__ */ u(e, {
779
792
  style: {
780
- ...G,
781
- fontSize: we[t.type],
793
+ ...ue,
794
+ fontSize: Ce[t.type],
782
795
  ...i
783
796
  },
784
797
  children: r(t.parts, t.text)
@@ -786,39 +799,39 @@ function Ee(e = [], t, n) {
786
799
  }
787
800
  return /* @__PURE__ */ u("p", {
788
801
  style: {
789
- ...fe,
802
+ ...de,
790
803
  ...i
791
804
  },
792
805
  children: r(t.parts, t.text)
793
806
  }, n);
794
807
  });
795
808
  }
796
- function De({ content: e, style: t, linked: n, nodeRef: r }) {
809
+ function Ee({ content: e, style: t, linked: n, nodeRef: r }) {
797
810
  return /* @__PURE__ */ u("div", {
798
811
  ref: r,
799
812
  style: {
800
813
  display: "flow-root",
801
814
  ...h(t)
802
815
  },
803
- children: Ee(e, n)
816
+ children: Te(e, n)
804
817
  });
805
818
  }
806
- var Oe = {
819
+ var De = {
807
820
  margin: 0,
808
821
  padding: "8px 0 8px 20px",
809
822
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
810
823
  };
811
- function ke({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
824
+ function Oe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
812
825
  return /* @__PURE__ */ u("blockquote", {
813
826
  ref: i,
814
827
  style: {
815
- ...Oe,
828
+ ...De,
816
829
  ...h(n)
817
830
  },
818
- children: q(t, e, r)
831
+ children: Y(t, e, r)
819
832
  });
820
833
  }
821
- function Ae({ ordered: e, items: t = [], style: n, nodeRef: r }) {
834
+ function ke({ ordered: e, items: t = [], style: n, nodeRef: r }) {
822
835
  return /* @__PURE__ */ u(e ? "ol" : "ul", {
823
836
  ref: r,
824
837
  style: {
@@ -828,53 +841,53 @@ function Ae({ ordered: e, items: t = [], style: n, nodeRef: r }) {
828
841
  },
829
842
  children: t.map((e, t) => /* @__PURE__ */ u("li", {
830
843
  style: { marginBottom: 4 },
831
- children: q(e.parts, e.text)
844
+ children: Y(e.parts, e.text)
832
845
  }, t))
833
846
  });
834
847
  }
835
- function je({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
848
+ function Ae({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
836
849
  return /* @__PURE__ */ u("p", {
837
850
  ref: i,
838
851
  style: {
839
- ...fe,
852
+ ...de,
840
853
  ...h(n)
841
854
  },
842
- children: q(t, e, r)
855
+ children: Y(t, e, r)
843
856
  });
844
857
  }
845
- var Me = {
858
+ var je = {
846
859
  color: "var(--page-accent, inherit)",
847
860
  textDecoration: "underline",
848
861
  textUnderlineOffset: 3,
849
862
  cursor: "pointer"
850
863
  };
851
- function Ne({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
864
+ function Me({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
852
865
  return /* @__PURE__ */ u("a", {
853
866
  ref: o,
854
867
  href: n || "#",
855
868
  target: r || void 0,
856
869
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
857
870
  style: {
858
- ...Me,
871
+ ...je,
859
872
  ...h(i)
860
873
  },
861
- children: q(t, e, a)
874
+ children: Y(t, e, a)
862
875
  });
863
876
  }
864
- function Pe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
877
+ function Ne({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
865
878
  return /* @__PURE__ */ u("a", {
866
879
  ref: o,
867
880
  href: n || "#",
868
881
  target: r || void 0,
869
882
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
870
883
  style: {
871
- ...K,
884
+ ...J,
872
885
  ...h(i)
873
886
  },
874
- children: q(t, e, a)
887
+ children: Y(t, e, a)
875
888
  });
876
889
  }
877
- function Fe({ src: e, alt: t, style: n, nodeRef: r }) {
890
+ function Pe({ src: e, alt: t, style: n, nodeRef: r }) {
878
891
  return e ? /* @__PURE__ */ u("img", {
879
892
  ref: r,
880
893
  src: e,
@@ -886,7 +899,7 @@ function Fe({ src: e, alt: t, style: n, nodeRef: r }) {
886
899
  }
887
900
  }) : null;
888
901
  }
889
- function Ie({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
902
+ function Fe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
890
903
  return e ? /* @__PURE__ */ u("video", {
891
904
  ref: s,
892
905
  src: e,
@@ -904,9 +917,9 @@ function Ie({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
904
917
  }
905
918
  }) : null;
906
919
  }
907
- var Le = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
908
- function Re({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
909
- let c = Le(e);
920
+ var Ie = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
921
+ function Le({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
922
+ let c = Ie(e);
910
923
  if (!c) return null;
911
924
  let l = new URLSearchParams({ rel: "0" });
912
925
  return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ u("div", {
@@ -932,7 +945,7 @@ function Re({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
932
945
  })
933
946
  });
934
947
  }
935
- function ze({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
948
+ function Re({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
936
949
  return e ? /* @__PURE__ */ u("iframe", {
937
950
  ref: i,
938
951
  src: e,
@@ -948,7 +961,7 @@ function ze({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
948
961
  }
949
962
  }) : null;
950
963
  }
951
- function Be({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
964
+ function ze({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
952
965
  let [a, o] = c(null);
953
966
  return i(() => {
954
967
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
@@ -967,7 +980,7 @@ function Be({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
967
980
  style: h(n)
968
981
  });
969
982
  }
970
- function Ve({ height: e, nodeRef: t }) {
983
+ function Be({ height: e, nodeRef: t }) {
971
984
  return /* @__PURE__ */ u("div", {
972
985
  ref: t,
973
986
  style: {
@@ -977,7 +990,7 @@ function Ve({ height: e, nodeRef: t }) {
977
990
  }
978
991
  });
979
992
  }
980
- function He({ style: e, nodeRef: t }) {
993
+ function Ve({ style: e, nodeRef: t }) {
981
994
  return /* @__PURE__ */ u("div", {
982
995
  ref: t,
983
996
  style: {
@@ -988,7 +1001,7 @@ function He({ style: e, nodeRef: t }) {
988
1001
  }
989
1002
  });
990
1003
  }
991
- var Ue = {
1004
+ var He = {
992
1005
  position: "absolute",
993
1006
  top: "50%",
994
1007
  transform: "translateY(-50%)",
@@ -1005,7 +1018,7 @@ var Ue = {
1005
1018
  alignItems: "center",
1006
1019
  justifyContent: "center",
1007
1020
  padding: 0
1008
- }, We = {
1021
+ }, Ue = {
1009
1022
  bottom: {
1010
1023
  inset: "auto 0 0 0",
1011
1024
  padding: "40px 24px 20px",
@@ -1024,8 +1037,8 @@ var Ue = {
1024
1037
  padding: 24,
1025
1038
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1026
1039
  }
1027
- }, Ge = 48;
1028
- function Ke({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1040
+ }, We = 48;
1041
+ function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1029
1042
  let [p, m] = c(0), [g, _] = c(!1), [v, y] = c(null), b = e ? Math.min(p, e - 1) : 0;
1030
1043
  if (i(() => {
1031
1044
  if (!n || g || v || e < 2) return;
@@ -1041,7 +1054,7 @@ function Ke({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1041
1054
  let x = (t) => m((t + e) % e), S = () => {
1042
1055
  if (!v) return;
1043
1056
  let { dx: e } = v;
1044
- y(null), e < -48 ? x(b + 1) : e > Ge && x(b - 1);
1057
+ y(null), e < -48 ? x(b + 1) : e > We && x(b - 1);
1045
1058
  };
1046
1059
  return /* @__PURE__ */ d("div", {
1047
1060
  ref: f,
@@ -1089,7 +1102,7 @@ function Ke({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1089
1102
  type: "button",
1090
1103
  "aria-label": "Previous slide",
1091
1104
  style: {
1092
- ...Ue,
1105
+ ...He,
1093
1106
  left: 12
1094
1107
  },
1095
1108
  onClick: () => x(b - 1),
@@ -1099,7 +1112,7 @@ function Ke({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1099
1112
  type: "button",
1100
1113
  "aria-label": "Next slide",
1101
1114
  style: {
1102
- ...Ue,
1115
+ ...He,
1103
1116
  right: 12
1104
1117
  },
1105
1118
  onClick: () => x(b + 1),
@@ -1133,7 +1146,7 @@ function Ke({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1133
1146
  ] })]
1134
1147
  });
1135
1148
  }
1136
- var qe = (e, t) => ({
1149
+ var Ke = (e, t) => ({
1137
1150
  position: "absolute",
1138
1151
  inset: 0,
1139
1152
  backgroundImage: e ? `url(${e})` : "none",
@@ -1141,18 +1154,18 @@ var qe = (e, t) => ({
1141
1154
  backgroundSize: "cover",
1142
1155
  backgroundPosition: "center"
1143
1156
  });
1144
- function Je({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1145
- return e.length ? /* @__PURE__ */ u(Ke, {
1157
+ function qe({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1158
+ return e.length ? /* @__PURE__ */ u(Ge, {
1146
1159
  ...r,
1147
1160
  count: e.length,
1148
1161
  renderSlide: (r) => {
1149
1162
  let i = e[r];
1150
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: qe(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1163
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ke(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1151
1164
  style: {
1152
1165
  position: "absolute",
1153
1166
  color: "#fff",
1154
1167
  textAlign: n,
1155
- ...We[t] ?? We.bottom
1168
+ ...Ue[t] ?? Ue.bottom
1156
1169
  },
1157
1170
  children: [i.title && /* @__PURE__ */ u("div", {
1158
1171
  style: {
@@ -1172,13 +1185,13 @@ function Je({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1172
1185
  }
1173
1186
  }) : null;
1174
1187
  }
1175
- function Ye({ slides: e = [], linked: t, ...n }) {
1176
- return e.length ? /* @__PURE__ */ u(Ke, {
1188
+ function Je({ slides: e = [], linked: t, ...n }) {
1189
+ return e.length ? /* @__PURE__ */ u(Ge, {
1177
1190
  ...n,
1178
1191
  count: e.length,
1179
1192
  renderSlide: (n) => {
1180
1193
  let r = e[n];
1181
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: qe(r.image, r.color) }), /* @__PURE__ */ u("div", {
1194
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ke(r.image, r.color) }), /* @__PURE__ */ u("div", {
1182
1195
  style: {
1183
1196
  position: "absolute",
1184
1197
  inset: 0,
@@ -1190,7 +1203,7 @@ function Ye({ slides: e = [], linked: t, ...n }) {
1190
1203
  }
1191
1204
  }) : null;
1192
1205
  }
1193
- var J = {
1206
+ var Ye = {
1194
1207
  color: "inherit",
1195
1208
  textDecoration: "none",
1196
1209
  fontSize: 14,
@@ -1212,7 +1225,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1212
1225
  let w = p === "hamburger" || p === "auto" && v, T = (e, t) => /* @__PURE__ */ d("a", {
1213
1226
  href: e.href || "#",
1214
1227
  style: {
1215
- ...J,
1228
+ ...Ye,
1216
1229
  display: "block",
1217
1230
  ...t
1218
1231
  },
@@ -1300,7 +1313,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1300
1313
  let t = e.children ?? [];
1301
1314
  if (!t.length) return /* @__PURE__ */ u("a", {
1302
1315
  href: e.href || "#",
1303
- style: J,
1316
+ style: Ye,
1304
1317
  children: e.label
1305
1318
  }, e.key);
1306
1319
  let n = e.type === "mega";
@@ -1314,7 +1327,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1314
1327
  children: [/* @__PURE__ */ d("a", {
1315
1328
  href: e.href || "#",
1316
1329
  style: {
1317
- ...J,
1330
+ ...Ye,
1318
1331
  cursor: "pointer"
1319
1332
  },
1320
1333
  children: [
@@ -1375,7 +1388,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1375
1388
  children: o.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
1376
1389
  href: t.href || "#",
1377
1390
  style: {
1378
- ...J,
1391
+ ...Ye,
1379
1392
  padding: "10px 4px",
1380
1393
  fontWeight: (t.children ?? []).length ? 600 : 400,
1381
1394
  opacity: 1
@@ -1487,11 +1500,11 @@ var et = {
1487
1500
  display: "flex",
1488
1501
  flexDirection: "column",
1489
1502
  gap: "12px"
1490
- }, Y = {
1503
+ }, X = {
1491
1504
  fontSize: "14px",
1492
1505
  fontWeight: 500,
1493
1506
  color: "var(--page-text, #111827)"
1494
- }, X = {
1507
+ }, Z = {
1495
1508
  padding: "10px 12px",
1496
1509
  border: "1px solid #d1d5db",
1497
1510
  borderRadius: "6px",
@@ -1507,7 +1520,7 @@ var et = {
1507
1520
  gap: "8px",
1508
1521
  fontSize: "14px",
1509
1522
  color: "var(--page-text, #111827)"
1510
- }, Z = (e) => e ? {
1523
+ }, Q = (e) => e ? {
1511
1524
  readOnly: !0,
1512
1525
  tabIndex: -1,
1513
1526
  onMouseDown: (e) => e.preventDefault()
@@ -1550,7 +1563,7 @@ function at(e, t) {
1550
1563
  function ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
1551
1564
  let a = /* @__PURE__ */ d("span", {
1552
1565
  style: {
1553
- ...Y,
1566
+ ...X,
1554
1567
  fontSize: 14
1555
1568
  },
1556
1569
  children: [e.label, e.required ? " *" : ""]
@@ -1588,7 +1601,7 @@ function ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
1588
1601
  borderRadius: 8,
1589
1602
  display: "block"
1590
1603
  }
1591
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Re, {
1604
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Le, {
1592
1605
  url: e.src,
1593
1606
  style: { width: "100%" }
1594
1607
  }) : /* @__PURE__ */ u("video", {
@@ -1688,10 +1701,10 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1688
1701
  let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || nt(e.section.condition, E)).map((e) => ({
1689
1702
  ...e,
1690
1703
  fields: e.fields.filter((e) => nt(e.condition, E))
1691
- })), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
1704
+ })), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), ee = I.filter((e) => {
1692
1705
  let t = E[e.name];
1693
1706
  return e.required && (t == null || t === "" || t === !1);
1694
- }), R = F >= N.length - 1, ee = (e, t) => D((n) => {
1707
+ }), L = F >= N.length - 1, te = (e, t) => D((n) => {
1695
1708
  let r = {
1696
1709
  ...n,
1697
1710
  [e]: t
@@ -1766,7 +1779,7 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1766
1779
  field: e,
1767
1780
  value: E[e.name],
1768
1781
  values: E,
1769
- onChange: ee,
1782
+ onChange: te,
1770
1783
  inert: g
1771
1784
  }, e.name)),
1772
1785
  /* @__PURE__ */ d("div", {
@@ -1781,7 +1794,7 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1781
1794
  disabled: g || void 0,
1782
1795
  onClick: () => k(F - 1),
1783
1796
  style: {
1784
- ...K,
1797
+ ...J,
1785
1798
  background: "transparent",
1786
1799
  color: "inherit",
1787
1800
  border: 0,
@@ -1789,26 +1802,26 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1789
1802
  cursor: "pointer"
1790
1803
  },
1791
1804
  children: "Back"
1792
- }), P && !R ? /* @__PURE__ */ u("button", {
1805
+ }), P && !L ? /* @__PURE__ */ u("button", {
1793
1806
  type: "button",
1794
- disabled: g || L.length > 0,
1807
+ disabled: g || ee.length > 0,
1795
1808
  onClick: () => k(F + 1),
1796
1809
  style: {
1797
- ...K,
1810
+ ...J,
1798
1811
  border: 0,
1799
1812
  padding: "10px 22px",
1800
1813
  borderRadius: 8,
1801
1814
  fontSize: 15,
1802
1815
  fontWeight: 600,
1803
1816
  cursor: "pointer",
1804
- opacity: L.length ? .5 : 1
1817
+ opacity: ee.length ? .5 : 1
1805
1818
  },
1806
1819
  children: "Next"
1807
1820
  }) : /* @__PURE__ */ u("button", {
1808
1821
  type: "submit",
1809
1822
  disabled: g || void 0,
1810
1823
  style: {
1811
- ...K,
1824
+ ...J,
1812
1825
  border: 0,
1813
1826
  padding: "10px 22px",
1814
1827
  borderRadius: 8,
@@ -1929,10 +1942,10 @@ function dt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1929
1942
  return /* @__PURE__ */ u("label", {
1930
1943
  ref: r,
1931
1944
  style: {
1932
- ...Y,
1945
+ ...X,
1933
1946
  ...h(n)
1934
1947
  },
1935
- children: q(t, e, i)
1948
+ children: Y(t, e, i)
1936
1949
  });
1937
1950
  }
1938
1951
  function ft({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
@@ -1943,10 +1956,10 @@ function ft({ type: e = "text", name: t, placeholder: n, required: r, style: i,
1943
1956
  placeholder: n,
1944
1957
  required: !o && !!r,
1945
1958
  style: {
1946
- ...X,
1959
+ ...Z,
1947
1960
  ...h(i)
1948
1961
  },
1949
- ...Z(o)
1962
+ ...Q(o)
1950
1963
  });
1951
1964
  }
1952
1965
  function pt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
@@ -1957,11 +1970,11 @@ function pt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
1957
1970
  rows: n,
1958
1971
  required: !o && !!r,
1959
1972
  style: {
1960
- ...X,
1973
+ ...Z,
1961
1974
  resize: "vertical",
1962
1975
  ...h(i)
1963
1976
  },
1964
- ...Z(o)
1977
+ ...Q(o)
1965
1978
  });
1966
1979
  }
1967
1980
  function mt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
@@ -1994,7 +2007,7 @@ function ht({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1994
2007
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
1995
2008
  tabIndex: o ? -1 : void 0,
1996
2009
  style: {
1997
- ...X,
2010
+ ...Z,
1998
2011
  appearance: "auto",
1999
2012
  ...h(i)
2000
2013
  },
@@ -2013,7 +2026,7 @@ function gt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
2013
2026
  return /* @__PURE__ */ d("label", {
2014
2027
  ref: a,
2015
2028
  style: {
2016
- ...X,
2029
+ ...Z,
2017
2030
  display: "flex",
2018
2031
  alignItems: "center",
2019
2032
  gap: "8px",
@@ -2045,7 +2058,7 @@ function _t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2045
2058
  ref: n,
2046
2059
  type: r ? "button" : "submit",
2047
2060
  style: {
2048
- ...K,
2061
+ ...J,
2049
2062
  border: 0,
2050
2063
  cursor: "pointer",
2051
2064
  alignSelf: "flex-start",
@@ -2077,53 +2090,61 @@ function vt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2077
2090
  }, t))
2078
2091
  });
2079
2092
  }
2080
- function yt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, style: m, nodeRef: g }) {
2081
- let { tenant: _, apiUrl: v, locale: y } = r(V), b = r(ce), x = r(H)?.[e], [S, C] = c(null);
2093
+ function yt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, style: g, nodeRef: _ }) {
2094
+ let { tenant: v, apiUrl: y, locale: b } = r(V), x = r(W), S = r(H), C = S?.[e], w = m ? U(S) : 1, [T, E] = c(null);
2082
2095
  if (i(() => {
2083
- if (!e || x) return;
2084
- let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}${y ? `?locale=${encodeURIComponent(y)}` : ""}`;
2085
- return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => {
2086
- let n = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
2087
- return t && C(n.filter((e) => e && typeof e == "object"));
2088
- }).catch(() => t && C([])), () => {
2089
- t = !1;
2096
+ if (!e || C) return;
2097
+ let n = !0, r = new URLSearchParams();
2098
+ if (b && r.set("locale", b), m && !e.startsWith("api:")) {
2099
+ let e = Math.max(1, Number(t) || 6);
2100
+ r.set("offset", String((w - 1) * e)), r.set("limit", String(e));
2101
+ }
2102
+ let i = r.toString(), a = e.startsWith("api:") ? `${y}/data/${encodeURIComponent(e.slice(4))}` : `${y}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
2103
+ return fetch(a, { headers: v ? { "x-tenant": v } : {} }).then((e) => e.json()).then((e) => {
2104
+ let t = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
2105
+ return n && E(t.filter((e) => e && typeof e == "object"));
2106
+ }).catch(() => n && E([])), () => {
2107
+ n = !1;
2090
2108
  };
2091
2109
  }, [
2092
2110
  e,
2093
- _,
2094
2111
  v,
2095
2112
  y,
2096
- x
2113
+ b,
2114
+ C,
2115
+ m,
2116
+ w,
2117
+ t
2097
2118
  ]), !e) return null;
2098
- let w = (x ?? S ?? []).slice(0, Math.max(1, Number(t) || 6)), T = Math.min(Math.max(Number(a) || 3, 1), 6), E = n === "list" ? {
2119
+ let D = Math.max(1, Number(t) || 6), O = m ? C || e.startsWith("api:") ? (C ?? T ?? []).slice((w - 1) * D, w * D) : (T ?? []).slice(0, D) : (C ?? T ?? []).slice(0, D), k = Math.min(Math.max(Number(a) || 3, 1), 6), A = n === "list" ? {
2099
2120
  display: "flex",
2100
2121
  flexDirection: "column",
2101
2122
  gap: 20
2102
2123
  } : {
2103
2124
  display: "grid",
2104
- gridTemplateColumns: `repeat(${T}, minmax(0, 1fr))`,
2125
+ gridTemplateColumns: `repeat(${k}, minmax(0, 1fr))`,
2105
2126
  gap: 24
2106
2127
  };
2107
- return f && p && b?.render ? /* @__PURE__ */ u("div", {
2108
- ref: g,
2128
+ return f && p && x?.render ? /* @__PURE__ */ u("div", {
2129
+ ref: _,
2109
2130
  style: {
2110
2131
  width: "100%",
2111
- ...E,
2112
- ...h(m)
2132
+ ...A,
2133
+ ...h(g)
2113
2134
  },
2114
- children: w.map((e) => /* @__PURE__ */ u("div", {
2135
+ children: O.map((e) => /* @__PURE__ */ u("div", {
2115
2136
  style: { minWidth: 0 },
2116
- children: b.render(p, (t) => de(t, e))
2137
+ children: x.render(p, (t) => le(t, e))
2117
2138
  }, e.id ?? e?.data?.slug))
2118
2139
  }) : /* @__PURE__ */ u("div", {
2119
- ref: g,
2140
+ ref: _,
2120
2141
  style: {
2121
2142
  width: "100%",
2122
- ...E,
2123
- ...h(m)
2143
+ ...A,
2144
+ ...h(g)
2124
2145
  },
2125
- children: w.map((e) => {
2126
- let t = o ? U(e?.data, o) : null, r = s ? W(U(e?.data, s)) : null, i = l ? U(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : W(i), f = n === "list";
2146
+ children: O.map((e) => {
2147
+ let t = o ? K(e?.data, o) : null, r = s ? q(K(e?.data, s)) : null, i = l ? K(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : q(i), f = n === "list";
2127
2148
  return /* @__PURE__ */ d("div", {
2128
2149
  style: {
2129
2150
  display: "flex",
@@ -2170,7 +2191,7 @@ function yt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2170
2191
  lineHeight: 1.55,
2171
2192
  opacity: .85
2172
2193
  },
2173
- children: Ee(a)
2194
+ children: Te(a)
2174
2195
  })
2175
2196
  ]
2176
2197
  })]
@@ -2228,8 +2249,36 @@ function bt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2228
2249
  })
2229
2250
  }) : null;
2230
2251
  }
2231
- function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2232
- let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), c = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", l = (e) => ({
2252
+ function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: g }) {
2253
+ let { tenant: _, apiUrl: v } = r(V), y = r(H), [b, x] = c(null), S = o ? Number(y?.[`${o}:total`]) : NaN;
2254
+ i(() => {
2255
+ if (!o || Number.isFinite(S)) return;
2256
+ let e = !0, t = o.startsWith("api:") ? `${v}/data/${encodeURIComponent(o.slice(4))}` : `${v}/dynamic/${encodeURIComponent(o)}?limit=1`;
2257
+ return fetch(t, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((t) => {
2258
+ if (!e) return;
2259
+ let n = t?.payload, r = Array.isArray(n) ? n.length : Number(n?.total?.filtered ?? n?.total?.all ?? (Array.isArray(n?.data) ? n.data.length : 0));
2260
+ x(Number.isFinite(r) ? r : 0);
2261
+ }).catch(() => e && x(0)), () => {
2262
+ e = !1;
2263
+ };
2264
+ }, [
2265
+ o,
2266
+ _,
2267
+ v,
2268
+ S
2269
+ ]);
2270
+ let C = Math.max(1, Number(s) || 6), w = Number.isFinite(S) ? S : b;
2271
+ if (o && w === null || o && f && !(w > 0)) return null;
2272
+ let T = Math.min(Math.max(o ? Math.ceil(w / C) : Number(e) || 1, 1), 50), E = Math.min(Math.max(o ? U(y) : Number(t) || 1, 1), T), D = (e) => {
2273
+ if (o) {
2274
+ if (typeof window < "u") {
2275
+ let t = new URLSearchParams(window.location.search);
2276
+ return t.set("page", String(e)), `?${t.toString()}`;
2277
+ }
2278
+ return `?page=${e}`;
2279
+ }
2280
+ return a && a !== "#" ? a.replace("{page}", String(e)) : "#";
2281
+ }, O = l === "center" ? "center" : l === "right" ? "flex-end" : "flex-start", k = p ? (e) => e.preventDefault() : void 0, A = (e) => ({
2233
2282
  display: "inline-flex",
2234
2283
  alignItems: "center",
2235
2284
  justifyContent: "center",
@@ -2244,37 +2293,41 @@ function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2244
2293
  border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
2245
2294
  });
2246
2295
  return /* @__PURE__ */ d("nav", {
2247
- ref: a,
2296
+ ref: g,
2248
2297
  "aria-label": "Pagination",
2249
2298
  style: {
2250
2299
  display: "flex",
2251
2300
  flexWrap: "wrap",
2252
2301
  gap: 8,
2253
2302
  alignItems: "center",
2254
- ...h(i)
2303
+ justifyContent: O,
2304
+ ...h(m)
2255
2305
  },
2256
2306
  children: [
2257
2307
  n && /* @__PURE__ */ u("a", {
2258
- href: s > 1 ? c(s - 1) : "#",
2308
+ href: E > 1 ? D(E - 1) : "#",
2309
+ onClick: k,
2259
2310
  "aria-label": "Previous",
2260
2311
  style: {
2261
- ...l(!1),
2262
- opacity: s > 1 ? 1 : .4
2312
+ ...A(!1),
2313
+ opacity: E > 1 ? 1 : .4
2263
2314
  },
2264
2315
  children: "‹"
2265
2316
  }),
2266
- Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
2267
- href: c(e),
2268
- "aria-current": e === s ? "page" : void 0,
2269
- style: l(e === s),
2317
+ Array.from({ length: T }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
2318
+ href: D(e),
2319
+ onClick: k,
2320
+ "aria-current": e === E ? "page" : void 0,
2321
+ style: A(e === E),
2270
2322
  children: e
2271
2323
  }, e)),
2272
2324
  n && /* @__PURE__ */ u("a", {
2273
- href: s < o ? c(s + 1) : "#",
2325
+ href: E < T ? D(E + 1) : "#",
2326
+ onClick: k,
2274
2327
  "aria-label": "Next",
2275
2328
  style: {
2276
- ...l(!1),
2277
- opacity: s < o ? 1 : .4
2329
+ ...A(!1),
2330
+ opacity: E < T ? 1 : .4
2278
2331
  },
2279
2332
  children: "›"
2280
2333
  })
@@ -2436,19 +2489,19 @@ function Tt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2436
2489
  horizontal: n
2437
2490
  };
2438
2491
  }
2439
- var Q = (e, t) => {
2492
+ var Et = (e, t) => {
2440
2493
  let n = String(e ?? "");
2441
2494
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
2442
- }, Et = (e) => {
2495
+ }, Dt = (e) => {
2443
2496
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
2444
2497
  if (!t) return "#ffffff";
2445
2498
  let n = t[1];
2446
2499
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
2447
2500
  let r = parseInt(n, 16);
2448
2501
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
2449
- }, Dt = (e) => !!(e?.cv?.trim?.() || e?.photo);
2450
- function Ot(e, t = {}) {
2451
- let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : W(e);
2502
+ }, Ot = (e) => !!(e?.cv?.trim?.() || e?.photo);
2503
+ function kt(e, t = {}) {
2504
+ let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : q(e);
2452
2505
  return n.map((e) => {
2453
2506
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
2454
2507
  return {
@@ -2462,11 +2515,11 @@ function Ot(e, t = {}) {
2462
2515
  };
2463
2516
  });
2464
2517
  }
2465
- var kt = {
2518
+ var At = {
2466
2519
  size: 36,
2467
2520
  pad: 10
2468
2521
  };
2469
- function At({ node: e, onClose: t }) {
2522
+ function jt({ node: e, onClose: t }) {
2470
2523
  return i(() => {
2471
2524
  let e = (e) => e.key === "Escape" && t();
2472
2525
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -2584,7 +2637,7 @@ function At({ node: e, onClose: t }) {
2584
2637
  })
2585
2638
  });
2586
2639
  }
2587
- function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
2640
+ function Mt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
2588
2641
  let x = a(), [S, C] = c(null), { tenant: w, apiUrl: T } = r(V), E = r(H)?.[t], [D, O] = c(null);
2589
2642
  i(() => {
2590
2643
  if (!t || E) return;
@@ -2601,7 +2654,7 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2601
2654
  T,
2602
2655
  E
2603
2656
  ]);
2604
- let k = t ? Ot(E ?? D ?? [], {
2657
+ let k = t ? kt(E ?? D ?? [], {
2605
2658
  nameField: n,
2606
2659
  titleField: o,
2607
2660
  photoField: s,
@@ -2654,7 +2707,7 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2654
2707
  stroke: "rgba(148, 163, 184, 0.7)",
2655
2708
  strokeWidth: "1.5"
2656
2709
  }, t)), j.map(({ node: e, x: t, y: n }) => {
2657
- let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Et(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Et(e.color2) : s, f = b && (Dt(e) || e.href), p = () => Dt(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + kt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
2710
+ let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Dt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Dt(e.color2) : s, f = b && (Ot(e) || e.href), p = () => Ot(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + At.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
2658
2711
  return /* @__PURE__ */ d("g", {
2659
2712
  onClick: f ? p : void 0,
2660
2713
  style: f ? { cursor: "pointer" } : void 0,
@@ -2718,13 +2771,13 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2718
2771
  e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
2719
2772
  id: `${x}-${e.id}`,
2720
2773
  children: /* @__PURE__ */ u("circle", {
2721
- cx: t + kt.pad + A.avatar / 2,
2774
+ cx: t + At.pad + A.avatar / 2,
2722
2775
  cy: n + A.h / 2,
2723
2776
  r: A.avatar / 2
2724
2777
  })
2725
2778
  }), /* @__PURE__ */ u("image", {
2726
2779
  href: e.photo,
2727
- x: t + kt.pad,
2780
+ x: t + At.pad,
2728
2781
  y: n + (A.h - A.avatar) / 2,
2729
2782
  width: A.avatar,
2730
2783
  height: A.avatar,
@@ -2738,7 +2791,7 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2738
2791
  fontSize: A.title,
2739
2792
  fontWeight: "600",
2740
2793
  fill: s,
2741
- children: Q(e.title, g + 4)
2794
+ children: Et(e.title, g + 4)
2742
2795
  }), e.name && /* @__PURE__ */ u("text", {
2743
2796
  x: m,
2744
2797
  y: n + _ + _ / 2 + A.name * .35,
@@ -2746,7 +2799,7 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2746
2799
  fontSize: A.name,
2747
2800
  fontWeight: "600",
2748
2801
  fill: c,
2749
- children: Q(e.name, g)
2802
+ children: Et(e.name, g)
2750
2803
  })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
2751
2804
  x: m,
2752
2805
  y: n + (v[1] ? A.h * .43 : A.h * .57),
@@ -2754,7 +2807,7 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2754
2807
  fontSize: A.name,
2755
2808
  fontWeight: "600",
2756
2809
  fill: s,
2757
- children: Q(v[0], g)
2810
+ children: Et(v[0], g)
2758
2811
  }), v[1] && /* @__PURE__ */ u("text", {
2759
2812
  x: m,
2760
2813
  y: n + A.h * .73,
@@ -2762,100 +2815,115 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2762
2815
  fontSize: A.title,
2763
2816
  opacity: "0.7",
2764
2817
  fill: s,
2765
- children: Q(v[1], g + 4)
2818
+ children: Et(v[1], g + 4)
2766
2819
  })] })
2767
2820
  ]
2768
2821
  }, e.id);
2769
2822
  })]
2770
- }), S && /* @__PURE__ */ u(At, {
2823
+ }), S && /* @__PURE__ */ u(jt, {
2771
2824
  node: S,
2772
2825
  onClose: () => C(null)
2773
2826
  })]
2774
2827
  });
2775
2828
  }
2776
- function Mt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, style: f, nodeRef: p }) {
2777
- let { tenant: m, apiUrl: g } = r(V), _ = r(H)?.[n], [v, y] = c(null);
2829
+ function Nt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, paged: f, emptyText: p, style: m, nodeRef: g }) {
2830
+ let { tenant: _, apiUrl: v } = r(V), y = r(H), b = y?.[n], x = f ? U(y) : 1, [S, C] = c(null);
2778
2831
  if (i(() => {
2779
- if (!n || _) return;
2780
- let e = !0, t = n.startsWith("api:") ? `${g}/data/${encodeURIComponent(n.slice(4))}` : `${g}/dynamic/${encodeURIComponent(n)}`;
2781
- return fetch(t, { headers: m ? { "x-tenant": m } : {} }).then((e) => e.json()).then((t) => e && y(Array.isArray(t?.payload) ? t.payload : [])).catch(() => e && y([])), () => {
2832
+ if (!n || b) return;
2833
+ let e = !0, t = Math.max(1, Number(a) || 10), r = f && !n.startsWith("api:") ? `?offset=${(x - 1) * t}&limit=${t}` : "", i = n.startsWith("api:") ? `${v}/data/${encodeURIComponent(n.slice(4))}` : `${v}/dynamic/${encodeURIComponent(n)}${r}`;
2834
+ return fetch(i, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((t) => {
2835
+ let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
2836
+ return e && C(n);
2837
+ }).catch(() => e && C([])), () => {
2782
2838
  e = !1;
2783
2839
  };
2784
2840
  }, [
2785
2841
  n,
2786
- m,
2787
- g,
2788
- _
2842
+ _,
2843
+ v,
2844
+ b,
2845
+ f,
2846
+ x,
2847
+ a
2789
2848
  ]), !e.length) return null;
2790
- let b = n ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => W(U(t?.data, e.field)))) : t, S = l ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = s ? { border: C } : { borderBottom: C };
2849
+ let w = Math.max(1, Number(a) || 10), T = n ? f ? b || n.startsWith("api:") ? (b ?? S ?? []).slice((x - 1) * w, x * w) : (S ?? []).slice(0, w) : (b ?? S ?? []).slice(0, w) : null, E = T ? T.map((t) => e.map((e) => q(K(t?.data, e.field)))) : t, D = !!n && !(n && !b && S === null) && E.length === 0, O = l ? "6px 10px" : "10px 14px", k = "1px solid rgba(148, 163, 184, 0.35)", A = s ? { border: k } : { borderBottom: k };
2791
2850
  return /* @__PURE__ */ u("div", {
2792
- ref: p,
2851
+ ref: g,
2793
2852
  style: {
2794
2853
  width: "100%",
2795
2854
  overflowX: "auto",
2796
- ...h(f)
2855
+ ...h(m)
2797
2856
  },
2798
2857
  children: /* @__PURE__ */ d("table", {
2799
2858
  style: {
2800
2859
  width: "100%",
2801
2860
  borderCollapse: "collapse",
2802
2861
  fontSize: 14,
2803
- ...s ? { border: C } : {}
2862
+ ...s ? { border: k } : {}
2804
2863
  },
2805
2864
  children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("th", {
2806
2865
  style: {
2807
2866
  textAlign: "left",
2808
2867
  fontWeight: 600,
2809
- padding: S,
2868
+ padding: O,
2810
2869
  background: "rgba(148, 163, 184, 0.12)",
2811
- ...w
2870
+ ...A
2812
2871
  },
2813
2872
  children: e.label ?? e
2814
- }, t)) }) }), /* @__PURE__ */ u("tbody", { children: x.map((t, n) => /* @__PURE__ */ u("tr", {
2873
+ }, t)) }) }), /* @__PURE__ */ d("tbody", { children: [D && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
2874
+ colSpan: e.length,
2875
+ style: {
2876
+ padding: O,
2877
+ textAlign: "center",
2878
+ opacity: .6,
2879
+ ...A
2880
+ },
2881
+ children: p || "No data yet"
2882
+ }) }), E.map((t, n) => /* @__PURE__ */ u("tr", {
2815
2883
  style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2816
2884
  children: e.map((e, n) => /* @__PURE__ */ u("td", {
2817
2885
  style: {
2818
- padding: S,
2819
- ...w
2886
+ padding: O,
2887
+ ...A
2820
2888
  },
2821
2889
  children: t?.[n] ?? ""
2822
2890
  }, n))
2823
- }, n)) })]
2891
+ }, n))] })]
2824
2892
  })
2825
2893
  });
2826
2894
  }
2827
- var Nt = {
2828
- PageRoot: _e,
2829
- Section: ve,
2830
- Container: ye,
2831
- Heading: be,
2832
- TextBlock: je,
2833
- ButtonBlock: Pe,
2834
- ImageBlock: Fe,
2835
- Spacer: Ve,
2836
- Divider: He,
2837
- SliderBlock: Je,
2838
- CanvasSlider: Ye,
2895
+ var Pt = {
2896
+ PageRoot: ge,
2897
+ Section: _e,
2898
+ Container: ve,
2899
+ Heading: ye,
2900
+ TextBlock: Ae,
2901
+ ButtonBlock: Ne,
2902
+ ImageBlock: Pe,
2903
+ Spacer: Be,
2904
+ Divider: Ve,
2905
+ SliderBlock: qe,
2906
+ CanvasSlider: Je,
2839
2907
  TabsBlock: Qe,
2840
2908
  QuickStack: vt,
2841
2909
  CollectionList: yt,
2842
2910
  BreadcrumbsBlock: bt,
2843
2911
  PaginationBlock: xt,
2844
2912
  StepperBlock: St,
2845
- OrgChartBlock: jt,
2846
- TableBlock: Mt,
2913
+ OrgChartBlock: Mt,
2914
+ TableBlock: Nt,
2847
2915
  AccordionBlock: $e,
2848
2916
  NavbarBlock: Ze,
2849
- ListBlock: Ae,
2850
- TextSpan: Ce,
2851
- QuoteBlock: ke,
2852
- TextLink: Ne,
2853
- RichTextBlock: De,
2854
- RichContentBlock: De,
2855
- VideoBlock: Ie,
2856
- YouTubeBlock: Re,
2857
- IframeBlock: ze,
2858
- EmbedBlock: Be,
2917
+ ListBlock: ke,
2918
+ TextSpan: Se,
2919
+ QuoteBlock: Oe,
2920
+ TextLink: Me,
2921
+ RichTextBlock: Ee,
2922
+ RichContentBlock: Ee,
2923
+ VideoBlock: Fe,
2924
+ YouTubeBlock: Le,
2925
+ IframeBlock: Re,
2926
+ EmbedBlock: ze,
2859
2927
  FormBlock: st,
2860
2928
  FormLabel: dt,
2861
2929
  FormInput: ft,
@@ -2872,26 +2940,26 @@ var Nt = {
2872
2940
  FormFile: gt,
2873
2941
  FormRecaptcha: ut,
2874
2942
  FormSubmit: _t
2875
- }, Pt = {
2943
+ }, Ft = {
2876
2944
  id: "auth",
2877
2945
  label: "Accounts",
2878
2946
  category: "Apps",
2879
2947
  keys: ["SiteLoginForm", "SiteAccountMenu"],
2880
2948
  ssr: "shell",
2881
2949
  settings: ["apps.auth.redirect"]
2882
- }, Ft = t({
2950
+ }, It = t({
2883
2951
  user: null,
2884
2952
  status: "idle",
2885
2953
  ensure: () => {},
2886
2954
  refresh: () => {},
2887
2955
  signOut: () => {}
2888
- }), It = () => {
2889
- let e = r(Ft);
2956
+ }), Lt = () => {
2957
+ let e = r(It);
2890
2958
  return i(() => {
2891
2959
  e.ensure();
2892
2960
  }, [e]), e;
2893
2961
  };
2894
- function Lt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
2962
+ function Rt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
2895
2963
  let d = r(V), f = a || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : i ? "guest" : "idle"), v = s(!1), y = n((e, t) => fetch(`${f}${e}`, {
2896
2964
  ...t,
2897
2965
  credentials: "include",
@@ -2924,18 +2992,18 @@ function Lt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l })
2924
2992
  b,
2925
2993
  x
2926
2994
  ]);
2927
- return /* @__PURE__ */ u(Ft.Provider, {
2995
+ return /* @__PURE__ */ u(It.Provider, {
2928
2996
  value: C,
2929
2997
  children: e
2930
2998
  });
2931
2999
  }
2932
- function Rt({ when: e, children: t }) {
2933
- let { status: n } = It();
3000
+ function zt({ when: e, children: t }) {
3001
+ let { status: n } = Lt();
2934
3002
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
2935
3003
  }
2936
3004
  //#endregion
2937
3005
  //#region ../ui/src/components/builder/apps/auth/views.jsx
2938
- function zt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
3006
+ function Bt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
2939
3007
  let { tenant: g, apiUrl: _, settings: v } = r(V), [y, b] = c("form"), [x, S] = c(""), [C, w] = c(!1), T = e === "register", E = f ? m || "form" : y, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
2940
3008
  if (e.preventDefault(), f) return;
2941
3009
  let n = new FormData(e.currentTarget);
@@ -2984,20 +3052,20 @@ function zt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
2984
3052
  children: [
2985
3053
  T ? /* @__PURE__ */ d("label", {
2986
3054
  style: {
2987
- ...Y,
3055
+ ...X,
2988
3056
  display: "grid",
2989
3057
  gap: 6
2990
3058
  },
2991
3059
  children: [a, /* @__PURE__ */ u("input", {
2992
3060
  name: "name",
2993
3061
  type: "text",
2994
- style: X,
2995
- ...Z(f)
3062
+ style: Z,
3063
+ ...Q(f)
2996
3064
  })]
2997
3065
  }) : null,
2998
3066
  /* @__PURE__ */ d("label", {
2999
3067
  style: {
3000
- ...Y,
3068
+ ...X,
3001
3069
  display: "grid",
3002
3070
  gap: 6
3003
3071
  },
@@ -3005,13 +3073,13 @@ function zt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3005
3073
  name: "email",
3006
3074
  type: "email",
3007
3075
  required: !f,
3008
- style: X,
3009
- ...Z(f)
3076
+ style: Z,
3077
+ ...Q(f)
3010
3078
  })]
3011
3079
  }),
3012
3080
  /* @__PURE__ */ d("label", {
3013
3081
  style: {
3014
- ...Y,
3082
+ ...X,
3015
3083
  display: "grid",
3016
3084
  gap: 6
3017
3085
  },
@@ -3019,15 +3087,15 @@ function zt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3019
3087
  name: "password",
3020
3088
  type: "password",
3021
3089
  required: !f,
3022
- style: X,
3023
- ...Z(f)
3090
+ style: Z,
3091
+ ...Q(f)
3024
3092
  })]
3025
3093
  }),
3026
3094
  /* @__PURE__ */ u("button", {
3027
3095
  type: f ? "button" : "submit",
3028
3096
  disabled: C || void 0,
3029
3097
  style: {
3030
- ...K,
3098
+ ...J,
3031
3099
  border: 0,
3032
3100
  padding: "10px 22px",
3033
3101
  borderRadius: 8,
@@ -3059,8 +3127,8 @@ function zt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3059
3127
  ]
3060
3128
  });
3061
3129
  }
3062
- function Bt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3063
- let { user: c, status: l, signOut: f } = It(), p = a ? s || "user" : l, m = a ? {
3130
+ function Vt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3131
+ let { user: c, status: l, signOut: f } = Lt(), p = a ? s || "user" : l, m = a ? {
3064
3132
  name: "Ada Lovelace",
3065
3133
  email: "ada@example.com"
3066
3134
  } : c;
@@ -3081,7 +3149,7 @@ function Bt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3081
3149
  children: [
3082
3150
  /* @__PURE__ */ d("span", {
3083
3151
  style: {
3084
- ...Y,
3152
+ ...X,
3085
3153
  fontWeight: 600
3086
3154
  },
3087
3155
  children: [
@@ -3092,7 +3160,7 @@ function Bt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3092
3160
  }),
3093
3161
  n && m?.email ? /* @__PURE__ */ u("span", {
3094
3162
  style: {
3095
- ...Y,
3163
+ ...X,
3096
3164
  opacity: .7
3097
3165
  },
3098
3166
  children: m.email
@@ -3101,14 +3169,14 @@ function Bt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3101
3169
  type: "button",
3102
3170
  onClick: a ? void 0 : f,
3103
3171
  style: {
3104
- ...K,
3172
+ ...J,
3105
3173
  border: 0,
3106
3174
  padding: "8px 16px",
3107
3175
  borderRadius: 8,
3108
3176
  fontSize: 14,
3109
3177
  cursor: a ? "default" : "pointer"
3110
3178
  },
3111
- ...Z(a),
3179
+ ...Q(a),
3112
3180
  children: t
3113
3181
  })
3114
3182
  ]
@@ -3125,16 +3193,16 @@ function Bt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3125
3193
  }
3126
3194
  //#endregion
3127
3195
  //#region ../ui/src/components/builder/apps/index.js
3128
- var Vt = [Pt], Ht = {
3129
- SiteLoginForm: zt,
3130
- SiteAccountMenu: Bt
3196
+ var Ht = [Ft], Ut = {
3197
+ SiteLoginForm: Bt,
3198
+ SiteAccountMenu: Vt
3131
3199
  };
3132
- new Set(Vt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3200
+ new Set(Ht.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3133
3201
  //#endregion
3134
3202
  //#region ../ui/src/components/builder/render.jsx
3135
- var Ut = {
3136
- ...Nt,
3137
- ...Ht
3203
+ var Wt = {
3204
+ ...Pt,
3205
+ ...Ut
3138
3206
  };
3139
3207
  function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3140
3208
  let o = n[t];
@@ -3146,7 +3214,7 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3146
3214
  let c = new Set(i).add(n);
3147
3215
  return /* @__PURE__ */ u(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
3148
3216
  }
3149
- let l = Ut[s];
3217
+ let l = Wt[s];
3150
3218
  if (!l) return null;
3151
3219
  let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
3152
3220
  ...c,
@@ -3157,15 +3225,15 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3157
3225
  },
3158
3226
  children: d.length ? d : void 0
3159
3227
  }, t);
3160
- return c.when && c.when !== "always" ? /* @__PURE__ */ u(Rt, {
3228
+ return c.when && c.when !== "always" ? /* @__PURE__ */ u(zt, {
3161
3229
  when: c.when,
3162
3230
  children: m
3163
3231
  }, t) : m;
3164
3232
  }
3165
3233
  //#endregion
3166
3234
  //#region ../ui/src/components/builder/PageRenderer.jsx
3167
- var Wt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
3168
- function Gt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: g }) {
3235
+ var Gt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
3236
+ function Kt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: g }) {
3169
3237
  let _ = s?.js?.trim();
3170
3238
  if (i(() => {
3171
3239
  if (!_) return;
@@ -3191,18 +3259,18 @@ function Gt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
3191
3259
  locale: p || "",
3192
3260
  settings: h ?? null
3193
3261
  },
3194
- children: /* @__PURE__ */ u(Lt, {
3262
+ children: /* @__PURE__ */ u(Rt, {
3195
3263
  initialUser: g,
3196
3264
  children: /* @__PURE__ */ u(H.Provider, {
3197
3265
  value: f ?? null,
3198
- children: /* @__PURE__ */ u(ce.Provider, {
3266
+ children: /* @__PURE__ */ u(W.Provider, {
3199
3267
  value: S,
3200
3268
  children: /* @__PURE__ */ d("div", {
3201
3269
  ...v,
3202
3270
  className: "webim-page",
3203
3271
  style: {
3204
3272
  ...b,
3205
- ...L(t, r),
3273
+ ...ee(t, r),
3206
3274
  ...a
3207
3275
  },
3208
3276
  children: [
@@ -3226,11 +3294,11 @@ function Gt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
3226
3294
  locale: p || "",
3227
3295
  settings: h ?? null
3228
3296
  },
3229
- children: /* @__PURE__ */ u(Lt, {
3297
+ children: /* @__PURE__ */ u(Rt, {
3230
3298
  initialUser: g,
3231
3299
  children: /* @__PURE__ */ u(H.Provider, {
3232
3300
  value: f ?? null,
3233
- children: /* @__PURE__ */ u(ce.Provider, {
3301
+ children: /* @__PURE__ */ u(W.Provider, {
3234
3302
  value: S,
3235
3303
  children: /* @__PURE__ */ d("div", {
3236
3304
  ...v,
@@ -3241,8 +3309,8 @@ function Gt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
3241
3309
  ...a
3242
3310
  },
3243
3311
  children: [
3244
- /* @__PURE__ */ u("style", { children: `.webim-page { ${Wt(F(k.light))} }
3245
- @media (prefers-color-scheme: dark) { .webim-page { ${Wt(F(k.dark))} } }` }),
3312
+ /* @__PURE__ */ u("style", { children: `.webim-page { ${Gt(F(k.light))} }
3313
+ @media (prefers-color-scheme: dark) { .webim-page { ${Gt(F(k.dark))} } }` }),
3246
3314
  O,
3247
3315
  /* @__PURE__ */ u("style", { children: y }),
3248
3316
  C && /* @__PURE__ */ u("style", { children: C }),
@@ -3258,8 +3326,8 @@ function Gt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
3258
3326
  }
3259
3327
  //#endregion
3260
3328
  //#region src/WebimContent.jsx
3261
- function Kt({ bundle: e, mode: t = "auto", style: n }) {
3262
- return e?.blocks?.ROOT ? /* @__PURE__ */ u(Gt, {
3329
+ function qt({ bundle: e, mode: t = "auto", style: n }) {
3330
+ return e?.blocks?.ROOT ? /* @__PURE__ */ u(Kt, {
3263
3331
  blocks: e.blocks,
3264
3332
  theme: e.theme,
3265
3333
  components: e.components,
@@ -3276,7 +3344,7 @@ function Kt({ bundle: e, mode: t = "auto", style: n }) {
3276
3344
  }
3277
3345
  //#endregion
3278
3346
  //#region src/WebimPage.jsx
3279
- function qt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
3347
+ function Jt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
3280
3348
  let [g, _] = c({ status: "loading" }), v = s({
3281
3349
  onLoad: m,
3282
3350
  onError: h
@@ -3286,7 +3354,7 @@ function qt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
3286
3354
  onError: h
3287
3355
  }, i(() => {
3288
3356
  let i = !0;
3289
- return _({ status: "loading" }), te({
3357
+ return _({ status: "loading" }), z({
3290
3358
  apiUrl: e,
3291
3359
  tenant: t,
3292
3360
  slug: n,
@@ -3313,11 +3381,11 @@ function qt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
3313
3381
  r,
3314
3382
  a,
3315
3383
  o
3316
- ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Kt, {
3384
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(qt, {
3317
3385
  bundle: g.bundle,
3318
3386
  mode: l,
3319
3387
  style: d
3320
3388
  });
3321
3389
  }
3322
3390
  //#endregion
3323
- export { Gt as PageRenderer, Kt as WebimContent, qt as WebimPage, te as fetchPage, Ee as renderRichContent, R as resolveTheme };
3391
+ export { Kt as PageRenderer, qt as WebimContent, Jt as WebimPage, z as fetchPage, Te as renderRichContent, L as resolveTheme };