webim-adapter 0.4.0 → 0.6.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.
@@ -1,7 +1,7 @@
1
1
  import { Fragment as e, createContext as t, useContext as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
2
2
  import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
3
3
  //#region ../ui/src/components/builder/styles.js
4
- var u = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.top.right.bottom.left".split(".")), d = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, f = [
4
+ var u = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), d = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, f = [
5
5
  "borderWidth",
6
6
  "borderStyle",
7
7
  "borderColor",
@@ -52,29 +52,29 @@ function p(e) {
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
54
  R !== void 0 && B.push(`blur(${d(R)})`), z !== void 0 && B.push(`grayscale(${z}%)`), ee !== void 0 && B.push(`brightness(${ee}%)`), te !== void 0 && B.push(`contrast(${te}%)`), ne !== void 0 && B.push(`saturate(${ne}%)`), B.length && (t.filter = B.join(" "));
55
- let V = F(L);
56
- V.length && (t.backdropFilter = V.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
- let { textStrokeWidth: H, textStrokeColor: U } = t;
58
- delete t.textStrokeWidth, delete t.textStrokeColor, (H !== void 0 || U !== void 0) && (t.WebkitTextStroke = `${d(H ?? 1)} ${U || "currentColor"}`);
59
- let { clipText: re } = t;
60
- delete t.clipText, re && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
- let { transitions: W, transitionDuration: ie, transitionEasing: G, transitionProperty: ae } = t, K = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
55
+ let re = F(L);
56
+ re.length && (t.backdropFilter = re.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
+ let { textStrokeWidth: V, textStrokeColor: ie } = t;
58
+ delete t.textStrokeWidth, delete t.textStrokeColor, (V !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${d(V ?? 1)} ${ie || "currentColor"}`);
59
+ let { clipText: H } = t;
60
+ delete t.clipText, H && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
+ let { transitions: U, transitionDuration: W, transitionEasing: ae, transitionProperty: G } = t, oe = (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 q = (Array.isArray(W) ? W : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${K(e.duration ?? 200)} ${e.easing || "ease"}`);
64
- if (ie !== void 0 && q.push(`${ae || "all"} ${K(ie)} ${G || "ease"}`), q.length && (t.transition = q.join(", ")), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
63
+ let K = (Array.isArray(U) ? U : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${oe(e.duration ?? 200)} ${e.easing || "ease"}`);
64
+ if (W !== void 0 && K.push(`${G || "all"} ${oe(W)} ${ae || "ease"}`), K.length && (t.transition = K.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: J, overlayOpacity: oe } = t;
70
- if (delete t.overlayColor, delete t.overlayOpacity, J) {
71
- let e = `color-mix(in srgb, ${J} ${oe ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
69
+ let { overlayColor: se, overlayOpacity: q } = t;
70
+ if (delete t.overlayColor, delete t.overlayOpacity, se) {
71
+ let e = `color-mix(in srgb, ${se} ${q ?? 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: se } = t;
75
+ let { backgroundLayers: J } = t;
76
76
  delete t.backgroundLayers;
77
- let Y = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1);
77
+ let Y = (Array.isArray(J) ? J : []).filter((e) => e && e.on !== !1);
78
78
  if (Y.length) {
79
79
  let e = [], n = [], r = [], i = [], a = [];
80
80
  for (let t of Y) 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");
@@ -298,6 +298,8 @@ function L({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
298
298
  components: a.builder_components?.components ?? {},
299
299
  custom: o.custom,
300
300
  seo: o.seo,
301
+ direction: o.direction,
302
+ locale: i || a.locales?.default,
301
303
  locales: a.locales,
302
304
  tenant: n ?? "",
303
305
  apiUrl: r ?? ""
@@ -456,15 +458,26 @@ function B(e, t) {
456
458
  return [...n].sort();
457
459
  }
458
460
  //#endregion
459
- //#region ../ui/src/components/builder/views.jsx
460
- var V = t({
461
+ //#region ../ui/src/components/builder/locale.js
462
+ var re = /* @__PURE__ */ new Set([
463
+ "ar",
464
+ "he",
465
+ "fa",
466
+ "ur",
467
+ "ps",
468
+ "sd",
469
+ "ug",
470
+ "yi",
471
+ "dv",
472
+ "ckb"
473
+ ]), V = (e) => re.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", ie = (e, t) => e === "ltr" || e === "rtl" ? e : t ? V(t) : void 0, H = t({
461
474
  tenant: "",
462
475
  apiUrl: "/api"
463
- }), H = t(null), U = t(null), re = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
464
- function W(e, t) {
476
+ }), U = t(null), W = t(null), ae = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
477
+ function G(e, t) {
465
478
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
466
479
  }
467
- var ie = (e) => {
480
+ var oe = (e) => {
468
481
  let t = [];
469
482
  for (let [n, r] of Object.entries(e ?? {})) {
470
483
  if (!/^[\w-]+$/.test(n)) continue;
@@ -474,36 +487,36 @@ var ie = (e) => {
474
487
  }
475
488
  return t;
476
489
  };
477
- function G(e) {
490
+ function K(e) {
478
491
  return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : 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(" ") : "").filter(Boolean).join(" ") : "";
479
492
  }
480
- function ae(e, t) {
481
- let n = t?.data ?? {}, r = ie(n);
493
+ function se(e, t) {
494
+ let n = t?.data ?? {}, r = oe(n);
482
495
  if (!r.length) return e;
483
- let i = RegExp(`:(${r.map(re).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => G(W(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
496
+ let i = RegExp(`:(${r.map(ae).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(G(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
484
497
  return a(e);
485
498
  }
486
- var K = {
499
+ var q = {
487
500
  margin: 0,
488
501
  fontWeight: 700,
489
502
  lineHeight: 1.2,
490
503
  fontFamily: "var(--page-heading-font, inherit)"
491
- }, q = { margin: 0 }, J = {
504
+ }, J = { margin: 0 }, Y = {
492
505
  display: "inline-block",
493
506
  textDecoration: "none",
494
507
  cursor: "pointer",
495
508
  backgroundColor: "var(--page-accent, #111827)",
496
509
  color: "var(--page-accent-text, #ffffff)"
497
- }, oe = {
510
+ }, ce = {
498
511
  flexGrow: 1,
499
512
  display: "flex",
500
513
  flexDirection: "column",
501
514
  position: "relative"
502
- }, se = {
515
+ }, le = {
503
516
  display: "flex",
504
517
  flexDirection: "column"
505
518
  };
506
- function Y({ style: e }) {
519
+ function ue({ style: e }) {
507
520
  let t = e?.backgroundVideo;
508
521
  if (!t) return null;
509
522
  let n = {
@@ -529,7 +542,7 @@ function Y({ style: e }) {
529
542
  background: r
530
543
  } })] });
531
544
  }
532
- var ce = (e, t) => e?.backgroundVideo ? {
545
+ var de = (e, t) => e?.backgroundVideo ? {
533
546
  position: "relative",
534
547
  ...t,
535
548
  ...p(e)
@@ -537,24 +550,24 @@ var ce = (e, t) => e?.backgroundVideo ? {
537
550
  ...t,
538
551
  ...p(e)
539
552
  };
540
- function le({ style: e, nodeRef: t, children: n }) {
553
+ function fe({ style: e, nodeRef: t, children: n }) {
541
554
  return /* @__PURE__ */ l("div", {
542
555
  ref: t,
543
556
  style: {
544
- ...oe,
557
+ ...ce,
545
558
  ...p(e)
546
559
  },
547
- children: [/* @__PURE__ */ c(Y, { style: e }), n]
560
+ children: [/* @__PURE__ */ c(ue, { style: e }), n]
548
561
  });
549
562
  }
550
- function ue({ style: e, nodeRef: t, children: n }) {
563
+ function pe({ style: e, nodeRef: t, children: n }) {
551
564
  return /* @__PURE__ */ l("section", {
552
565
  ref: t,
553
- style: ce(e, se),
554
- children: [/* @__PURE__ */ c(Y, { style: e }), n]
566
+ style: de(e, le),
567
+ children: [/* @__PURE__ */ c(ue, { style: e }), n]
555
568
  });
556
569
  }
557
- function de({ style: e, freeLayout: t, nodeRef: n, children: r }) {
570
+ function me({ style: e, freeLayout: t, nodeRef: n, children: r }) {
558
571
  let i = t ? {
559
572
  position: "relative",
560
573
  minHeight: 240
@@ -563,38 +576,40 @@ function de({ style: e, freeLayout: t, nodeRef: n, children: r }) {
563
576
  ref: n,
564
577
  style: i ? {
565
578
  ...i,
566
- ...ce(e)
567
- } : ce(e),
568
- children: [/* @__PURE__ */ c(Y, { style: e }), r]
579
+ ...de(e)
580
+ } : de(e),
581
+ children: [/* @__PURE__ */ c(ue, { style: e }), r]
569
582
  });
570
583
  }
571
- function fe({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
584
+ function he({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
572
585
  return /* @__PURE__ */ c(n, {
573
586
  ref: a,
574
587
  style: {
575
- ...K,
588
+ ...q,
576
589
  ...p(r)
577
590
  },
578
591
  children: X(t, e, i)
579
592
  });
580
593
  }
581
- var pe = {
594
+ var ge = {
582
595
  fontFamily: k.mono.value,
583
596
  background: "rgba(148, 163, 184, 0.18)",
584
597
  padding: "1px 5px",
585
598
  borderRadius: 4,
586
599
  fontSize: "0.9em"
587
600
  };
588
- function me(e, t = [], n) {
589
- let r = e;
590
- return t.includes("sup") ? r = /* @__PURE__ */ c("sup", { children: r }) : t.includes("sub") && (r = /* @__PURE__ */ c("sub", { children: r })), t.includes("code") && (r = /* @__PURE__ */ c("code", {
591
- style: pe,
592
- children: r
593
- })), t.includes("strike") && (r = /* @__PURE__ */ c("s", { children: r })), t.includes("underline") && (r = /* @__PURE__ */ c("u", { children: r })), t.includes("italic") && (r = /* @__PURE__ */ c("em", { children: r })), t.includes("bold") && (r = /* @__PURE__ */ c("strong", { children: r })), n && (r = /* @__PURE__ */ c("a", {
601
+ function _e(e, t = [], n, r) {
602
+ let i = e;
603
+ return t.includes("sup") ? i = /* @__PURE__ */ c("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ c("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ c("code", {
604
+ style: ge,
605
+ children: i
606
+ })), t.includes("strike") && (i = /* @__PURE__ */ c("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ c("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ c("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ c("strong", { children: i })), n && (i = /* @__PURE__ */ c("a", {
594
607
  href: n,
608
+ target: r || void 0,
609
+ rel: r === "_blank" ? "noopener noreferrer" : void 0,
595
610
  style: { color: "inherit" },
596
- children: r
597
- })), r;
611
+ children: i
612
+ })), i;
598
613
  }
599
614
  function X(t, n, r) {
600
615
  return t?.length ? t.map((t, n) => {
@@ -602,22 +617,30 @@ function X(t, n, r) {
602
617
  if (t.parts) return /* @__PURE__ */ c(e, { children: X(t.parts, "", r) }, n);
603
618
  let i = t.text;
604
619
  return t.sup ? i = /* @__PURE__ */ c("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ c("sub", { children: i })), t.code && (i = /* @__PURE__ */ c("code", {
605
- style: pe,
620
+ style: ge,
606
621
  children: i
607
- })), t.strike && (i = /* @__PURE__ */ c("s", { children: i })), t.underline && (i = /* @__PURE__ */ c("u", { children: i })), t.italic && (i = /* @__PURE__ */ c("em", { children: i })), t.bold && (i = /* @__PURE__ */ c("strong", { children: i })), t.href && (i = /* @__PURE__ */ c("a", {
622
+ })), t.strike && (i = /* @__PURE__ */ c("s", { children: i })), t.underline && (i = /* @__PURE__ */ c("u", { children: i })), t.italic && (i = /* @__PURE__ */ c("em", { children: i })), t.bold && (i = /* @__PURE__ */ c("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ c("span", {
623
+ style: {
624
+ ...t.color && { color: t.color },
625
+ ...t.background && { backgroundColor: t.background }
626
+ },
627
+ children: i
628
+ })), t.href && (i = /* @__PURE__ */ c("a", {
608
629
  href: t.href,
609
- style: { color: "inherit" },
630
+ target: t.target || void 0,
631
+ rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
632
+ style: { color: t.color ?? "inherit" },
610
633
  children: i
611
634
  })), /* @__PURE__ */ c(e, { children: i }, n);
612
635
  }) : n;
613
636
  }
614
- function he({ parts: e, text: t, marks: n, href: r, style: i }) {
637
+ function ve({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
615
638
  return /* @__PURE__ */ c("span", {
616
- style: p(i),
617
- children: e?.length ? X(e, t) : me(t, n, r)
639
+ style: p(a),
640
+ children: e?.length ? X(e, t) : _e(t, n, r, i)
618
641
  });
619
642
  }
620
- var ge = {
643
+ var ye = {
621
644
  h1: 40,
622
645
  h2: 32,
623
646
  h3: 26,
@@ -625,30 +648,41 @@ var ge = {
625
648
  h5: 19,
626
649
  h6: 16
627
650
  };
628
- function _e({ align: e = "center", width: t } = {}) {
629
- let n = t ? `${t}%` : void 0;
630
- return e === "full" ? { width: "100%" } : e === "left" ? {
631
- float: "left",
632
- width: n ?? "50%",
633
- marginTop: 4,
634
- marginRight: 20,
635
- marginBottom: 12,
636
- marginLeft: 0
637
- } : e === "right" ? {
638
- float: "right",
639
- width: n ?? "50%",
640
- marginTop: 4,
641
- marginLeft: 20,
642
- marginBottom: 12,
643
- marginRight: 0
651
+ function be({ align: e = "center", width: t, wrap: n } = {}) {
652
+ let r = t ? `${t}%` : void 0;
653
+ if (e === "full") return { width: "100%" };
654
+ let i = e === "left" || e === "right";
655
+ return i && (n ?? !0) ? {
656
+ float: e,
657
+ width: r ?? "50%",
658
+ maxWidth: "100%",
659
+ marginTop: "4px",
660
+ marginBottom: "12px",
661
+ ...e === "left" ? {
662
+ marginRight: "20px",
663
+ marginLeft: 0
664
+ } : {
665
+ marginLeft: "20px",
666
+ marginRight: 0
667
+ }
668
+ } : i ? {
669
+ width: r ?? "fit-content",
670
+ maxWidth: "100%",
671
+ ...e === "left" ? {
672
+ marginLeft: 0,
673
+ marginRight: "auto"
674
+ } : {
675
+ marginLeft: "auto",
676
+ marginRight: 0
677
+ }
644
678
  } : {
645
- width: n ?? "fit-content",
679
+ width: r ?? "fit-content",
646
680
  maxWidth: "100%",
647
681
  marginLeft: "auto",
648
682
  marginRight: "auto"
649
683
  };
650
684
  }
651
- function ve(e = [], t, n) {
685
+ function xe(e = [], t, n) {
652
686
  let r = n ?? ((e, n) => X(e, n, t));
653
687
  return e.map((t, n) => {
654
688
  let i = {
@@ -671,10 +705,12 @@ function ve(e = [], t, n) {
671
705
  marginLeft: 0,
672
706
  marginRight: 0,
673
707
  ...i,
674
- ..._e(t)
708
+ ...be(t)
675
709
  },
676
710
  children: [t.href ? /* @__PURE__ */ c("a", {
677
711
  href: t.href,
712
+ target: t.target || void 0,
713
+ rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
678
714
  style: { display: "block" },
679
715
  children: e
680
716
  }) : e, t.caption && /* @__PURE__ */ c("figcaption", {
@@ -688,15 +724,16 @@ function ve(e = [], t, n) {
688
724
  })]
689
725
  }, n);
690
726
  }
691
- if (t.type === "video") return ke(t.url) ? /* @__PURE__ */ c("div", {
727
+ if (t.type === "video") return Me(t.url) ? /* @__PURE__ */ c("div", {
692
728
  style: {
693
729
  ...i,
694
- ..._e({
730
+ ...be({
695
731
  align: t.align,
732
+ wrap: t.wrap,
696
733
  width: t.width ?? 100
697
734
  })
698
735
  },
699
- children: /* @__PURE__ */ c(Ae, {
736
+ children: /* @__PURE__ */ c(Ne, {
700
737
  url: t.url,
701
738
  autoplay: t.autoplay,
702
739
  muted: t.muted,
@@ -725,17 +762,17 @@ function ve(e = [], t, n) {
725
762
  }
726
763
  if (t.type === "quote") return /* @__PURE__ */ c("blockquote", {
727
764
  style: {
728
- ...be,
765
+ ...Ce,
729
766
  ...i
730
767
  },
731
768
  children: r(t.parts, t.text)
732
769
  }, n);
733
- if (ge[t.type]) {
770
+ if (ye[t.type]) {
734
771
  let e = t.type;
735
772
  return /* @__PURE__ */ c(e, {
736
773
  style: {
737
- ...K,
738
- fontSize: ge[t.type],
774
+ ...q,
775
+ fontSize: ye[t.type],
739
776
  ...i
740
777
  },
741
778
  children: r(t.parts, t.text)
@@ -743,39 +780,39 @@ function ve(e = [], t, n) {
743
780
  }
744
781
  return /* @__PURE__ */ c("p", {
745
782
  style: {
746
- ...q,
783
+ ...J,
747
784
  ...i
748
785
  },
749
786
  children: r(t.parts, t.text)
750
787
  }, n);
751
788
  });
752
789
  }
753
- function ye({ content: e, style: t, linked: n, nodeRef: r }) {
790
+ function Se({ content: e, style: t, linked: n, nodeRef: r }) {
754
791
  return /* @__PURE__ */ c("div", {
755
792
  ref: r,
756
793
  style: {
757
794
  display: "flow-root",
758
795
  ...p(t)
759
796
  },
760
- children: ve(e, n)
797
+ children: xe(e, n)
761
798
  });
762
799
  }
763
- var be = {
800
+ var Ce = {
764
801
  margin: 0,
765
802
  padding: "8px 0 8px 20px",
766
803
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
767
804
  };
768
- function xe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
805
+ function we({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
769
806
  return /* @__PURE__ */ c("blockquote", {
770
807
  ref: i,
771
808
  style: {
772
- ...be,
809
+ ...Ce,
773
810
  ...p(n)
774
811
  },
775
812
  children: X(t, e, r)
776
813
  });
777
814
  }
778
- function Se({ ordered: e, items: t = [], style: n, nodeRef: r }) {
815
+ function Te({ ordered: e, items: t = [], style: n, nodeRef: r }) {
779
816
  return /* @__PURE__ */ c(e ? "ol" : "ul", {
780
817
  ref: r,
781
818
  style: {
@@ -789,49 +826,49 @@ function Se({ ordered: e, items: t = [], style: n, nodeRef: r }) {
789
826
  }, t))
790
827
  });
791
828
  }
792
- function Ce({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
829
+ function Ee({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
793
830
  return /* @__PURE__ */ c("p", {
794
831
  ref: i,
795
832
  style: {
796
- ...q,
833
+ ...J,
797
834
  ...p(n)
798
835
  },
799
836
  children: X(t, e, r)
800
837
  });
801
838
  }
802
- var we = {
839
+ var De = {
803
840
  color: "var(--page-accent, inherit)",
804
841
  textDecoration: "underline",
805
842
  textUnderlineOffset: 3,
806
843
  cursor: "pointer"
807
844
  };
808
- function Te({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
845
+ function Oe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
809
846
  return /* @__PURE__ */ c("a", {
810
847
  ref: o,
811
848
  href: n || "#",
812
849
  target: r || void 0,
813
850
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
814
851
  style: {
815
- ...we,
852
+ ...De,
816
853
  ...p(i)
817
854
  },
818
855
  children: X(t, e, a)
819
856
  });
820
857
  }
821
- function Ee({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
858
+ function ke({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
822
859
  return /* @__PURE__ */ c("a", {
823
860
  ref: o,
824
861
  href: n || "#",
825
862
  target: r || void 0,
826
863
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
827
864
  style: {
828
- ...J,
865
+ ...Y,
829
866
  ...p(i)
830
867
  },
831
868
  children: X(t, e, a)
832
869
  });
833
870
  }
834
- function De({ src: e, alt: t, style: n, nodeRef: r }) {
871
+ function Ae({ src: e, alt: t, style: n, nodeRef: r }) {
835
872
  return e ? /* @__PURE__ */ c("img", {
836
873
  ref: r,
837
874
  src: e,
@@ -843,7 +880,7 @@ function De({ src: e, alt: t, style: n, nodeRef: r }) {
843
880
  }
844
881
  }) : null;
845
882
  }
846
- function Oe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
883
+ function je({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
847
884
  return e ? /* @__PURE__ */ c("video", {
848
885
  ref: s,
849
886
  src: e,
@@ -861,9 +898,9 @@ function Oe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
861
898
  }
862
899
  }) : null;
863
900
  }
864
- var ke = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
865
- function Ae({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
866
- let l = ke(e);
901
+ var Me = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
902
+ function Ne({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
903
+ let l = Me(e);
867
904
  if (!l) return null;
868
905
  let u = new URLSearchParams({ rel: "0" });
869
906
  return t && u.set("autoplay", "1"), (n || t) && u.set("mute", "1"), i || u.set("controls", "0"), r && (u.set("loop", "1"), u.set("playlist", l)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ c("div", {
@@ -889,7 +926,7 @@ function Ae({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
889
926
  })
890
927
  });
891
928
  }
892
- function je({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
929
+ function Pe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
893
930
  return e ? /* @__PURE__ */ c("iframe", {
894
931
  ref: i,
895
932
  src: e,
@@ -905,7 +942,7 @@ function je({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
905
942
  }
906
943
  }) : null;
907
944
  }
908
- function Me({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
945
+ function Fe({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
909
946
  let [a, s] = o(null);
910
947
  return r(() => {
911
948
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
@@ -924,7 +961,7 @@ function Me({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
924
961
  style: p(n)
925
962
  });
926
963
  }
927
- function Ne({ height: e, nodeRef: t }) {
964
+ function Ie({ height: e, nodeRef: t }) {
928
965
  return /* @__PURE__ */ c("div", {
929
966
  ref: t,
930
967
  style: {
@@ -934,7 +971,7 @@ function Ne({ height: e, nodeRef: t }) {
934
971
  }
935
972
  });
936
973
  }
937
- function Pe({ style: e, nodeRef: t }) {
974
+ function Le({ style: e, nodeRef: t }) {
938
975
  return /* @__PURE__ */ c("div", {
939
976
  ref: t,
940
977
  style: {
@@ -945,7 +982,7 @@ function Pe({ style: e, nodeRef: t }) {
945
982
  }
946
983
  });
947
984
  }
948
- var Fe = {
985
+ var Re = {
949
986
  position: "absolute",
950
987
  top: "50%",
951
988
  transform: "translateY(-50%)",
@@ -962,7 +999,7 @@ var Fe = {
962
999
  alignItems: "center",
963
1000
  justifyContent: "center",
964
1001
  padding: 0
965
- }, Ie = {
1002
+ }, ze = {
966
1003
  bottom: {
967
1004
  inset: "auto 0 0 0",
968
1005
  padding: "40px 24px 20px",
@@ -981,8 +1018,8 @@ var Fe = {
981
1018
  padding: 24,
982
1019
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
983
1020
  }
984
- }, Le = 48;
985
- function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, height: a = 320, swipe: u = !0, style: d, nodeRef: f }) {
1021
+ }, Be = 48;
1022
+ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, height: a = 320, swipe: u = !0, style: d, nodeRef: f }) {
986
1023
  let [m, h] = o(0), [g, _] = o(!1), [v, y] = o(null), b = e ? Math.min(m, e - 1) : 0;
987
1024
  if (r(() => {
988
1025
  if (!n || g || v || e < 2) return;
@@ -998,7 +1035,7 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
998
1035
  let x = (t) => h((t + e) % e), S = () => {
999
1036
  if (!v) return;
1000
1037
  let { dx: e } = v;
1001
- y(null), e < -48 ? x(b + 1) : e > Le && x(b - 1);
1038
+ y(null), e < -48 ? x(b + 1) : e > Be && x(b - 1);
1002
1039
  };
1003
1040
  return /* @__PURE__ */ l("div", {
1004
1041
  ref: f,
@@ -1046,7 +1083,7 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1046
1083
  type: "button",
1047
1084
  "aria-label": "Previous slide",
1048
1085
  style: {
1049
- ...Fe,
1086
+ ...Re,
1050
1087
  left: 12
1051
1088
  },
1052
1089
  onClick: () => x(b - 1),
@@ -1056,7 +1093,7 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1056
1093
  type: "button",
1057
1094
  "aria-label": "Next slide",
1058
1095
  style: {
1059
- ...Fe,
1096
+ ...Re,
1060
1097
  right: 12
1061
1098
  },
1062
1099
  onClick: () => x(b + 1),
@@ -1090,7 +1127,7 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1090
1127
  ] })]
1091
1128
  });
1092
1129
  }
1093
- var ze = (e, t) => ({
1130
+ var He = (e, t) => ({
1094
1131
  position: "absolute",
1095
1132
  inset: 0,
1096
1133
  backgroundImage: e ? `url(${e})` : "none",
@@ -1098,18 +1135,18 @@ var ze = (e, t) => ({
1098
1135
  backgroundSize: "cover",
1099
1136
  backgroundPosition: "center"
1100
1137
  });
1101
- function Be({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1102
- return e.length ? /* @__PURE__ */ c(Re, {
1138
+ function Ue({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1139
+ return e.length ? /* @__PURE__ */ c(Ve, {
1103
1140
  ...r,
1104
1141
  count: e.length,
1105
1142
  renderSlide: (r) => {
1106
1143
  let i = e[r];
1107
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: ze(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
1144
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: He(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
1108
1145
  style: {
1109
1146
  position: "absolute",
1110
1147
  color: "#fff",
1111
1148
  textAlign: n,
1112
- ...Ie[t] ?? Ie.bottom
1149
+ ...ze[t] ?? ze.bottom
1113
1150
  },
1114
1151
  children: [i.title && /* @__PURE__ */ c("div", {
1115
1152
  style: {
@@ -1129,13 +1166,13 @@ function Be({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1129
1166
  }
1130
1167
  }) : null;
1131
1168
  }
1132
- function Ve({ slides: e = [], linked: t, ...n }) {
1133
- return e.length ? /* @__PURE__ */ c(Re, {
1169
+ function We({ slides: e = [], linked: t, ...n }) {
1170
+ return e.length ? /* @__PURE__ */ c(Ve, {
1134
1171
  ...n,
1135
1172
  count: e.length,
1136
1173
  renderSlide: (n) => {
1137
1174
  let r = e[n];
1138
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: ze(r.image, r.color) }), /* @__PURE__ */ c("div", {
1175
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: He(r.image, r.color) }), /* @__PURE__ */ c("div", {
1139
1176
  style: {
1140
1177
  position: "absolute",
1141
1178
  inset: 0,
@@ -1152,14 +1189,14 @@ var Z = {
1152
1189
  textDecoration: "none",
1153
1190
  fontSize: 14,
1154
1191
  opacity: .85
1155
- }, He = {
1192
+ }, Ge = {
1156
1193
  background: "var(--page-bg, #ffffff)",
1157
1194
  color: "var(--page-text, #111827)",
1158
1195
  border: "1px solid rgba(148, 163, 184, 0.25)",
1159
1196
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1160
1197
  zIndex: 60
1161
1198
  };
1162
- function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u = "auto", breakpoint: d = 768 }) {
1199
+ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u = "auto", breakpoint: d = 768 }) {
1163
1200
  let [f, m] = o(null), [h, g] = o(!1), [_, v] = o(!1), [y, b] = o(null);
1164
1201
  r(() => {
1165
1202
  if (!f) return;
@@ -1270,7 +1307,7 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1270
1307
  ]
1271
1308
  }), y === e.key && (n ? /* @__PURE__ */ c("div", {
1272
1309
  style: {
1273
- ...He,
1310
+ ...Ge,
1274
1311
  position: "absolute",
1275
1312
  left: 0,
1276
1313
  right: 0,
@@ -1286,7 +1323,7 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1286
1323
  }))
1287
1324
  }) : /* @__PURE__ */ c("div", {
1288
1325
  style: {
1289
- ...He,
1326
+ ...Ge,
1290
1327
  position: "absolute",
1291
1328
  top: "100%",
1292
1329
  left: 0,
@@ -1326,7 +1363,7 @@ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1326
1363
  ]
1327
1364
  });
1328
1365
  }
1329
- function We({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1366
+ function qe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1330
1367
  let [i, a] = o(0), s = e.length ? Math.min(i, e.length - 1) : 0;
1331
1368
  return e.length ? /* @__PURE__ */ l("div", {
1332
1369
  ref: r,
@@ -1366,7 +1403,7 @@ function We({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1366
1403
  }, e.key))]
1367
1404
  }) : null;
1368
1405
  }
1369
- function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1406
+ function Je({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1370
1407
  let [a, s] = o(() => new Set(e.length ? [e[0].key] : []));
1371
1408
  if (!e.length) return null;
1372
1409
  let u = (e) => s((t) => {
@@ -1423,11 +1460,11 @@ function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1423
1460
  })
1424
1461
  });
1425
1462
  }
1426
- var Ke = {
1463
+ var Ye = {
1427
1464
  display: "flex",
1428
1465
  flexDirection: "column",
1429
1466
  gap: "12px"
1430
- }, qe = {
1467
+ }, Xe = {
1431
1468
  fontSize: "14px",
1432
1469
  fontWeight: 500,
1433
1470
  color: "var(--page-text, #111827)"
@@ -1441,18 +1478,18 @@ var Ke = {
1441
1478
  boxSizing: "border-box",
1442
1479
  backgroundColor: "#ffffff",
1443
1480
  color: "#111827"
1444
- }, Je = {
1481
+ }, Ze = {
1445
1482
  display: "flex",
1446
1483
  alignItems: "center",
1447
1484
  gap: "8px",
1448
1485
  fontSize: "14px",
1449
1486
  color: "var(--page-text, #111827)"
1450
- }, Ye = (e) => e ? {
1487
+ }, Qe = (e) => e ? {
1451
1488
  readOnly: !0,
1452
1489
  tabIndex: -1,
1453
1490
  onMouseDown: (e) => e.preventDefault()
1454
1491
  } : {};
1455
- function Xe(e, t) {
1492
+ function $e(e, t) {
1456
1493
  if (!e) return !0;
1457
1494
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1458
1495
  switch (e.op) {
@@ -1466,11 +1503,11 @@ function Xe(e, t) {
1466
1503
  default: return !1;
1467
1504
  }
1468
1505
  }
1469
- var Ze = {
1506
+ var et = {
1470
1507
  display: "flex",
1471
1508
  flexDirection: "column",
1472
1509
  gap: 6
1473
- }, Qe = {
1510
+ }, tt = {
1474
1511
  font: "inherit",
1475
1512
  fontSize: 15,
1476
1513
  padding: "10px 12px",
@@ -1481,10 +1518,10 @@ var Ze = {
1481
1518
  width: "100%",
1482
1519
  boxSizing: "border-box"
1483
1520
  };
1484
- function $e({ field: e, value: t, onChange: n, inert: r }) {
1521
+ function nt({ field: e, value: t, onChange: n, inert: r }) {
1485
1522
  let i = /* @__PURE__ */ l("span", {
1486
1523
  style: {
1487
- ...qe,
1524
+ ...Xe,
1488
1525
  fontSize: 14
1489
1526
  },
1490
1527
  children: [e.label, e.required ? " *" : ""]
@@ -1493,7 +1530,7 @@ function $e({ field: e, value: t, onChange: n, inert: r }) {
1493
1530
  required: e.required || void 0,
1494
1531
  placeholder: e.placeholder || void 0,
1495
1532
  disabled: r || void 0,
1496
- style: Qe,
1533
+ style: tt,
1497
1534
  value: t ?? "",
1498
1535
  onChange: (t) => n(e.name, t.target.value)
1499
1536
  };
@@ -1522,7 +1559,7 @@ function $e({ field: e, value: t, onChange: n, inert: r }) {
1522
1559
  borderRadius: 8,
1523
1560
  display: "block"
1524
1561
  }
1525
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ c(Ae, {
1562
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ c(Ne, {
1526
1563
  url: e.src,
1527
1564
  style: { width: "100%" }
1528
1565
  }) : /* @__PURE__ */ c("video", {
@@ -1534,14 +1571,14 @@ function $e({ field: e, value: t, onChange: n, inert: r }) {
1534
1571
  display: "block"
1535
1572
  }
1536
1573
  }) : null : /* @__PURE__ */ l("label", {
1537
- style: Ze,
1574
+ style: et,
1538
1575
  children: [
1539
1576
  i,
1540
1577
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ c("textarea", {
1541
1578
  ...a,
1542
1579
  rows: 4,
1543
1580
  style: {
1544
- ...Qe,
1581
+ ...tt,
1545
1582
  resize: "vertical"
1546
1583
  }
1547
1584
  }) : e.type === "select" ? /* @__PURE__ */ l("select", {
@@ -1596,12 +1633,12 @@ function $e({ field: e, value: t, onChange: n, inert: r }) {
1596
1633
  ]
1597
1634
  });
1598
1635
  }
1599
- function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d, auto: f, submitLabel: m, nodeRef: h, inert: g, children: _, linked: v, show: y }) {
1600
- let { tenant: b, apiUrl: x } = n(V), [S, C] = o("form"), [w, T] = o(null), [E, D] = o({}), [O, k] = o(0), A = g ? y || "form" : S;
1636
+ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d, auto: f, submitLabel: m, nodeRef: h, inert: g, children: _, linked: v, show: y }) {
1637
+ let { tenant: b, apiUrl: x } = n(H), [S, C] = o("form"), [w, T] = o(null), [E, D] = o({}), [O, k] = o(0), A = g ? y || "form" : S;
1601
1638
  r(() => {
1602
1639
  if (!f || !d) return;
1603
1640
  let e = !0;
1604
- return fetch(`${x || "/api"}/forms/${encodeURIComponent(d)}`, { headers: b ? { "x-tenant": b } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload ?? null)).catch(() => e && T(null)), () => {
1641
+ return fetch(`${x || "/api"}/forms/${encodeURIComponent(d)}`, { headers: b ? { "x-tenant": b } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
1605
1642
  e = !1;
1606
1643
  };
1607
1644
  }, [
@@ -1614,13 +1651,13 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1614
1651
  section: null,
1615
1652
  fields: []
1616
1653
  }];
1617
- for (let e of w?.fields ?? []) e.type === "section" ? j.push({
1654
+ for (let e of Array.isArray(w?.fields) ? w.fields : []) e.type === "section" ? j.push({
1618
1655
  section: e,
1619
1656
  fields: []
1620
1657
  }) : j[j.length - 1].fields.push(e);
1621
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Xe(e.section.condition, E)).map((e) => ({
1658
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || $e(e.section.condition, E)).map((e) => ({
1622
1659
  ...e,
1623
- fields: e.fields.filter((e) => Xe(e.condition, E))
1660
+ fields: e.fields.filter((e) => $e(e.condition, E))
1624
1661
  })), 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) => {
1625
1662
  let t = E[e.name];
1626
1663
  return e.required && (t == null || t === "" || t === !1);
@@ -1674,11 +1711,11 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1674
1711
  }
1675
1712
  },
1676
1713
  style: {
1677
- ...Ke,
1714
+ ...Ye,
1678
1715
  display: A === "success" ? "none" : "flex"
1679
1716
  },
1680
1717
  children: f && d ? /* @__PURE__ */ l(s, { children: [
1681
- P && /* @__PURE__ */ c(ft, {
1718
+ P && /* @__PURE__ */ c(ht, {
1682
1719
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1683
1720
  active: F + 1,
1684
1721
  style: { marginBottom: 8 }
@@ -1691,7 +1728,7 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1691
1728
  },
1692
1729
  children: N[F].section.help
1693
1730
  }),
1694
- I.map((e) => /* @__PURE__ */ c($e, {
1731
+ I.map((e) => /* @__PURE__ */ c(nt, {
1695
1732
  field: e,
1696
1733
  value: E[e.name],
1697
1734
  onChange: z,
@@ -1709,7 +1746,7 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1709
1746
  disabled: g || void 0,
1710
1747
  onClick: () => k(F - 1),
1711
1748
  style: {
1712
- ...J,
1749
+ ...Y,
1713
1750
  background: "transparent",
1714
1751
  color: "inherit",
1715
1752
  border: 0,
@@ -1722,7 +1759,7 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1722
1759
  disabled: g || L.length > 0,
1723
1760
  onClick: () => k(F + 1),
1724
1761
  style: {
1725
- ...J,
1762
+ ...Y,
1726
1763
  border: 0,
1727
1764
  padding: "10px 22px",
1728
1765
  borderRadius: 8,
@@ -1736,7 +1773,7 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1736
1773
  type: "submit",
1737
1774
  disabled: g || void 0,
1738
1775
  style: {
1739
- ...J,
1776
+ ...Y,
1740
1777
  border: 0,
1741
1778
  padding: "10px 22px",
1742
1779
  borderRadius: 8,
@@ -1763,17 +1800,17 @@ function et({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1763
1800
  ]
1764
1801
  });
1765
1802
  }
1766
- function tt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1803
+ function it({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1767
1804
  return /* @__PURE__ */ c("label", {
1768
1805
  ref: r,
1769
1806
  style: {
1770
- ...qe,
1807
+ ...Xe,
1771
1808
  ...p(n)
1772
1809
  },
1773
1810
  children: X(t, e, i)
1774
1811
  });
1775
1812
  }
1776
- function nt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1813
+ function at({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1777
1814
  return /* @__PURE__ */ c("input", {
1778
1815
  ref: a,
1779
1816
  type: e,
@@ -1784,10 +1821,10 @@ function nt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
1784
1821
  ...Q,
1785
1822
  ...p(i)
1786
1823
  },
1787
- ...Ye(o)
1824
+ ...Qe(o)
1788
1825
  });
1789
1826
  }
1790
- function rt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1827
+ function ot({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1791
1828
  return /* @__PURE__ */ c("textarea", {
1792
1829
  ref: a,
1793
1830
  name: e || void 0,
@@ -1799,14 +1836,14 @@ function rt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
1799
1836
  resize: "vertical",
1800
1837
  ...p(i)
1801
1838
  },
1802
- ...Ye(o)
1839
+ ...Qe(o)
1803
1840
  });
1804
1841
  }
1805
- function it({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1842
+ function st({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1806
1843
  return /* @__PURE__ */ l("label", {
1807
1844
  ref: o,
1808
1845
  style: {
1809
- ...Je,
1846
+ ...Ze,
1810
1847
  ...p(a)
1811
1848
  },
1812
1849
  children: [/* @__PURE__ */ c("input", {
@@ -1823,7 +1860,7 @@ function it({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1823
1860
  }), t]
1824
1861
  });
1825
1862
  }
1826
- function at({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1863
+ function ct({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1827
1864
  return /* @__PURE__ */ l("select", {
1828
1865
  ref: a,
1829
1866
  name: e || void 0,
@@ -1846,7 +1883,7 @@ function at({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1846
1883
  }, t))]
1847
1884
  });
1848
1885
  }
1849
- function ot({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
1886
+ function lt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
1850
1887
  let [u, d] = o(null);
1851
1888
  return /* @__PURE__ */ l("label", {
1852
1889
  ref: a,
@@ -1878,12 +1915,12 @@ function ot({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
1878
1915
  ]
1879
1916
  });
1880
1917
  }
1881
- function st({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1918
+ function ut({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1882
1919
  return /* @__PURE__ */ c("button", {
1883
1920
  ref: n,
1884
1921
  type: r ? "button" : "submit",
1885
1922
  style: {
1886
- ...J,
1923
+ ...Y,
1887
1924
  border: 0,
1888
1925
  cursor: "pointer",
1889
1926
  alignSelf: "flex-start",
@@ -1898,7 +1935,7 @@ function st({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1898
1935
  children: e
1899
1936
  });
1900
1937
  }
1901
- function ct({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1938
+ function dt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1902
1939
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1903
1940
  return /* @__PURE__ */ c("div", {
1904
1941
  ref: r,
@@ -1915,12 +1952,12 @@ function ct({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1915
1952
  }, t))
1916
1953
  });
1917
1954
  }
1918
- function lt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, imageField: s, titleField: u = "name", textField: d, custom: f, templateId: m, style: h, nodeRef: g }) {
1919
- let { tenant: _, apiUrl: v } = n(V), y = n(U), b = n(H)?.[e], [x, S] = o(null);
1955
+ function ft({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, imageField: s, titleField: u = "name", textField: d, custom: f, templateId: m, style: h, nodeRef: g }) {
1956
+ let { tenant: _, apiUrl: v } = n(H), y = n(W), b = n(U)?.[e], [x, S] = o(null);
1920
1957
  if (r(() => {
1921
1958
  if (!e || b) return;
1922
1959
  let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}`;
1923
- return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => t && S(Array.isArray(e?.payload) ? e.payload : [])).catch(() => t && S([])), () => {
1960
+ return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => t && S(Array.isArray(e?.payload) ? e.payload.filter((e) => e && typeof e == "object") : [])).catch(() => t && S([])), () => {
1924
1961
  t = !1;
1925
1962
  };
1926
1963
  }, [
@@ -1947,7 +1984,7 @@ function lt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
1947
1984
  },
1948
1985
  children: C.map((e) => /* @__PURE__ */ c("div", {
1949
1986
  style: { minWidth: 0 },
1950
- children: y.render(m, (t) => ae(t, e))
1987
+ children: y.render(m, (t) => se(t, e))
1951
1988
  }, e.id ?? e?.data?.slug))
1952
1989
  }) : /* @__PURE__ */ c("div", {
1953
1990
  ref: g,
@@ -1957,7 +1994,7 @@ function lt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
1957
1994
  ...p(h)
1958
1995
  },
1959
1996
  children: C.map((e) => {
1960
- let t = s ? W(e?.data, s) : null, n = u ? G(W(e?.data, u)) : null, r = d ? W(e?.data, d) : null, a = Array.isArray(r) ? r : null, o = a || r == null ? null : G(r), f = i === "list";
1997
+ let t = s ? G(e?.data, s) : null, n = u ? K(G(e?.data, u)) : null, r = d ? G(e?.data, d) : null, a = Array.isArray(r) ? r : null, o = a || r == null ? null : K(r), f = i === "list";
1961
1998
  return /* @__PURE__ */ l("div", {
1962
1999
  style: {
1963
2000
  display: "flex",
@@ -2004,7 +2041,7 @@ function lt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2004
2041
  lineHeight: 1.55,
2005
2042
  opacity: .85
2006
2043
  },
2007
- children: ve(a)
2044
+ children: xe(a)
2008
2045
  })
2009
2046
  ]
2010
2047
  })]
@@ -2012,7 +2049,7 @@ function lt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2012
2049
  })
2013
2050
  });
2014
2051
  }
2015
- function ut({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2052
+ function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2016
2053
  return e.length ? /* @__PURE__ */ c("nav", {
2017
2054
  ref: r,
2018
2055
  "aria-label": "Breadcrumb",
@@ -2062,7 +2099,7 @@ function ut({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2062
2099
  })
2063
2100
  }) : null;
2064
2101
  }
2065
- function dt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2102
+ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2066
2103
  let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), u = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", d = (e) => ({
2067
2104
  display: "inline-flex",
2068
2105
  alignItems: "center",
@@ -2115,7 +2152,7 @@ function dt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2115
2152
  ]
2116
2153
  });
2117
2154
  }
2118
- function ft({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2155
+ function ht({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2119
2156
  if (!t.length) return null;
2120
2157
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
2121
2158
  width: 32,
@@ -2193,8 +2230,8 @@ function ft({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2193
2230
  })
2194
2231
  });
2195
2232
  }
2196
- function pt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped: s = !0, bordered: u = !1, compact: d = !1, style: f, nodeRef: m }) {
2197
- let { tenant: h, apiUrl: g } = n(V), _ = n(H)?.[i], [v, y] = o(null);
2233
+ function gt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped: s = !0, bordered: u = !1, compact: d = !1, style: f, nodeRef: m }) {
2234
+ let { tenant: h, apiUrl: g } = n(H), _ = n(U)?.[i], [v, y] = o(null);
2198
2235
  if (r(() => {
2199
2236
  if (!i || _) return;
2200
2237
  let e = !0, t = i.startsWith("api:") ? `${g}/data/${encodeURIComponent(i.slice(4))}` : `${g}/dynamic/${encodeURIComponent(i)}`;
@@ -2207,7 +2244,7 @@ function pt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
2207
2244
  g,
2208
2245
  _
2209
2246
  ]), !e.length) return null;
2210
- let b = i ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => G(W(t?.data, e.field)))) : t, S = d ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = u ? { border: C } : { borderBottom: C };
2247
+ let b = i ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, S = d ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = u ? { border: C } : { borderBottom: C };
2211
2248
  return /* @__PURE__ */ c("div", {
2212
2249
  ref: m,
2213
2250
  style: {
@@ -2244,52 +2281,52 @@ function pt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
2244
2281
  })
2245
2282
  });
2246
2283
  }
2247
- var mt = {
2248
- PageRoot: le,
2249
- Section: ue,
2250
- Container: de,
2251
- Heading: fe,
2252
- TextBlock: Ce,
2253
- ButtonBlock: Ee,
2254
- ImageBlock: De,
2255
- Spacer: Ne,
2256
- Divider: Pe,
2257
- SliderBlock: Be,
2258
- CanvasSlider: Ve,
2259
- TabsBlock: We,
2260
- QuickStack: ct,
2261
- CollectionList: lt,
2262
- BreadcrumbsBlock: ut,
2263
- PaginationBlock: dt,
2264
- StepperBlock: ft,
2265
- TableBlock: pt,
2266
- AccordionBlock: Ge,
2267
- NavbarBlock: Ue,
2268
- ListBlock: Se,
2269
- TextSpan: he,
2270
- QuoteBlock: xe,
2271
- TextLink: Te,
2272
- RichTextBlock: ye,
2273
- RichContentBlock: ye,
2274
- VideoBlock: Oe,
2275
- YouTubeBlock: Ae,
2276
- IframeBlock: je,
2277
- EmbedBlock: Me,
2278
- FormBlock: et,
2279
- FormLabel: tt,
2280
- FormInput: nt,
2281
- FormTextarea: rt,
2282
- FormCheckbox: (e) => /* @__PURE__ */ c(it, {
2284
+ var _t = {
2285
+ PageRoot: fe,
2286
+ Section: pe,
2287
+ Container: me,
2288
+ Heading: he,
2289
+ TextBlock: Ee,
2290
+ ButtonBlock: ke,
2291
+ ImageBlock: Ae,
2292
+ Spacer: Ie,
2293
+ Divider: Le,
2294
+ SliderBlock: Ue,
2295
+ CanvasSlider: We,
2296
+ TabsBlock: qe,
2297
+ QuickStack: dt,
2298
+ CollectionList: ft,
2299
+ BreadcrumbsBlock: pt,
2300
+ PaginationBlock: mt,
2301
+ StepperBlock: ht,
2302
+ TableBlock: gt,
2303
+ AccordionBlock: Je,
2304
+ NavbarBlock: Ke,
2305
+ ListBlock: Te,
2306
+ TextSpan: ve,
2307
+ QuoteBlock: we,
2308
+ TextLink: Oe,
2309
+ RichTextBlock: Se,
2310
+ RichContentBlock: Se,
2311
+ VideoBlock: je,
2312
+ YouTubeBlock: Ne,
2313
+ IframeBlock: Pe,
2314
+ EmbedBlock: Fe,
2315
+ FormBlock: rt,
2316
+ FormLabel: it,
2317
+ FormInput: at,
2318
+ FormTextarea: ot,
2319
+ FormCheckbox: (e) => /* @__PURE__ */ c(st, {
2283
2320
  kind: "checkbox",
2284
2321
  ...e
2285
2322
  }),
2286
- FormRadio: (e) => /* @__PURE__ */ c(it, {
2323
+ FormRadio: (e) => /* @__PURE__ */ c(st, {
2287
2324
  kind: "radio",
2288
2325
  ...e
2289
2326
  }),
2290
- FormSelect: at,
2291
- FormFile: ot,
2292
- FormSubmit: st
2327
+ FormSelect: ct,
2328
+ FormFile: lt,
2329
+ FormSubmit: ut
2293
2330
  };
2294
2331
  //#endregion
2295
2332
  //#region ../ui/src/components/builder/render.jsx
@@ -2303,7 +2340,7 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2303
2340
  let l = new Set(i).add(n);
2304
2341
  return /* @__PURE__ */ c(e, { children: $(s.template.rootId, s.template.nodes, r, l, a) }, t);
2305
2342
  }
2306
- let u = mt[s];
2343
+ let u = _t[s];
2307
2344
  if (!u) return null;
2308
2345
  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;
2309
2346
  return /* @__PURE__ */ c(u, {
@@ -2318,74 +2355,79 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2318
2355
  }
2319
2356
  //#endregion
2320
2357
  //#region ../ui/src/components/builder/PageRenderer.jsx
2321
- var ht = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2322
- function gt({ blocks: e, theme: t, components: n, mode: a = "auto", style: o, custom: s, tenant: u, apiUrl: d, datasets: f }) {
2323
- let p = s?.js?.trim();
2358
+ var vt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2359
+ function yt({ blocks: e, theme: t, components: n, mode: a = "auto", style: o, custom: s, tenant: u, apiUrl: d, datasets: f, locale: p, direction: m }) {
2360
+ let h = s?.js?.trim();
2324
2361
  if (r(() => {
2325
- if (!p) return;
2362
+ if (!h) return;
2326
2363
  let e = document.createElement("script");
2327
- return e.text = p, document.body.appendChild(e), () => e.remove();
2328
- }, [p]), !e?.ROOT) return null;
2329
- let m = {
2364
+ return e.text = h, document.body.appendChild(e), () => e.remove();
2365
+ }, [h]), !e?.ROOT) return null;
2366
+ let g = {
2367
+ lang: p || void 0,
2368
+ dir: ie(m, p)
2369
+ }, _ = {
2330
2370
  minHeight: "100%",
2331
2371
  display: "flex",
2332
2372
  flexDirection: "column"
2333
- }, h = $("ROOT", e, n), g = i(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), _ = T(e, n), v = w(e, n), y = s?.css?.trim(), b = B(e, n).map((e) => /* @__PURE__ */ c("link", {
2373
+ }, v = $("ROOT", e, n), y = i(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), b = T(e, n), x = w(e, n), S = s?.css?.trim(), C = B(e, n).map((e) => /* @__PURE__ */ c("link", {
2334
2374
  rel: "stylesheet",
2335
2375
  precedence: "default",
2336
2376
  href: te(e)
2337
2377
  }, e));
2338
- if (a !== "auto") return /* @__PURE__ */ c(V.Provider, {
2378
+ if (a !== "auto") return /* @__PURE__ */ c(H.Provider, {
2339
2379
  value: {
2340
2380
  tenant: u || "",
2341
2381
  apiUrl: d || "/api"
2342
2382
  },
2343
- children: /* @__PURE__ */ c(H.Provider, {
2383
+ children: /* @__PURE__ */ c(U.Provider, {
2344
2384
  value: f ?? null,
2345
- children: /* @__PURE__ */ c(U.Provider, {
2346
- value: g,
2385
+ children: /* @__PURE__ */ c(W.Provider, {
2386
+ value: y,
2347
2387
  children: /* @__PURE__ */ l("div", {
2388
+ ...g,
2348
2389
  style: {
2349
- ...m,
2390
+ ..._,
2350
2391
  ...F(t, a),
2351
2392
  ...o
2352
2393
  },
2353
2394
  children: [
2354
- b,
2355
- _ && /* @__PURE__ */ c("style", { children: _ }),
2356
- v && /* @__PURE__ */ c("style", { children: v }),
2357
- y && /* @__PURE__ */ c("style", { children: y }),
2358
- h
2395
+ C,
2396
+ b && /* @__PURE__ */ c("style", { children: b }),
2397
+ x && /* @__PURE__ */ c("style", { children: x }),
2398
+ S && /* @__PURE__ */ c("style", { children: S }),
2399
+ v
2359
2400
  ]
2360
2401
  })
2361
2402
  })
2362
2403
  })
2363
2404
  });
2364
- let x = M(t);
2365
- return /* @__PURE__ */ c(V.Provider, {
2405
+ let E = M(t);
2406
+ return /* @__PURE__ */ c(H.Provider, {
2366
2407
  value: {
2367
2408
  tenant: u || "",
2368
2409
  apiUrl: d || "/api"
2369
2410
  },
2370
- children: /* @__PURE__ */ c(H.Provider, {
2411
+ children: /* @__PURE__ */ c(U.Provider, {
2371
2412
  value: f ?? null,
2372
- children: /* @__PURE__ */ c(U.Provider, {
2373
- value: g,
2413
+ children: /* @__PURE__ */ c(W.Provider, {
2414
+ value: y,
2374
2415
  children: /* @__PURE__ */ l("div", {
2416
+ ...g,
2375
2417
  className: "webim-page",
2376
2418
  style: {
2377
- ...m,
2419
+ ..._,
2378
2420
  ...P(t),
2379
2421
  ...o
2380
2422
  },
2381
2423
  children: [
2382
- /* @__PURE__ */ c("style", { children: `.webim-page { ${ht(N(x.light))} }
2383
- @media (prefers-color-scheme: dark) { .webim-page { ${ht(N(x.dark))} } }` }),
2384
- b,
2385
- _ && /* @__PURE__ */ c("style", { children: _ }),
2386
- v && /* @__PURE__ */ c("style", { children: v }),
2387
- y && /* @__PURE__ */ c("style", { children: y }),
2388
- h
2424
+ /* @__PURE__ */ c("style", { children: `.webim-page { ${vt(N(E.light))} }
2425
+ @media (prefers-color-scheme: dark) { .webim-page { ${vt(N(E.dark))} } }` }),
2426
+ C,
2427
+ b && /* @__PURE__ */ c("style", { children: b }),
2428
+ x && /* @__PURE__ */ c("style", { children: x }),
2429
+ S && /* @__PURE__ */ c("style", { children: S }),
2430
+ v
2389
2431
  ]
2390
2432
  })
2391
2433
  })
@@ -2394,8 +2436,8 @@ function gt({ blocks: e, theme: t, components: n, mode: a = "auto", style: o, cu
2394
2436
  }
2395
2437
  //#endregion
2396
2438
  //#region src/WebimContent.jsx
2397
- function _t({ bundle: e, mode: t = "auto", style: n }) {
2398
- return e?.blocks?.ROOT ? /* @__PURE__ */ c(gt, {
2439
+ function bt({ bundle: e, mode: t = "auto", style: n }) {
2440
+ return e?.blocks?.ROOT ? /* @__PURE__ */ c(yt, {
2399
2441
  blocks: e.blocks,
2400
2442
  theme: e.theme,
2401
2443
  components: e.components,
@@ -2403,13 +2445,15 @@ function _t({ bundle: e, mode: t = "auto", style: n }) {
2403
2445
  tenant: e.tenant,
2404
2446
  apiUrl: e.apiUrl,
2405
2447
  datasets: e.datasets,
2448
+ locale: e.locale,
2449
+ direction: e.direction,
2406
2450
  mode: t,
2407
2451
  style: n
2408
2452
  }) : null;
2409
2453
  }
2410
2454
  //#endregion
2411
2455
  //#region src/WebimPage.jsx
2412
- function vt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: s, mode: l = "auto", style: u, fallback: d = null, errorFallback: f = null, onLoad: p, onError: m }) {
2456
+ function xt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: s, mode: l = "auto", style: u, fallback: d = null, errorFallback: f = null, onLoad: p, onError: m }) {
2413
2457
  let [h, g] = o({ status: "loading" }), _ = a({
2414
2458
  onLoad: p,
2415
2459
  onError: m
@@ -2444,11 +2488,11 @@ function vt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: s, mode: l = "a
2444
2488
  n,
2445
2489
  i,
2446
2490
  s
2447
- ]), h.status === "loading" ? d : h.status === "error" ? typeof f == "function" ? f(h.error) : f : /* @__PURE__ */ c(_t, {
2491
+ ]), h.status === "loading" ? d : h.status === "error" ? typeof f == "function" ? f(h.error) : f : /* @__PURE__ */ c(bt, {
2448
2492
  bundle: h.bundle,
2449
2493
  mode: l,
2450
2494
  style: u
2451
2495
  });
2452
2496
  }
2453
2497
  //#endregion
2454
- export { gt as PageRenderer, _t as WebimContent, vt as WebimPage, z as fetchPage, ve as renderRichContent, I as resolveTheme };
2498
+ export { yt as PageRenderer, bt as WebimContent, xt as WebimPage, z as fetchPage, xe as renderRichContent, I as resolveTheme };