@charisol/plexo-sdk 1.1.15 → 1.1.16

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,6 +1,6 @@
1
- import { a as e, b as t, c as n, d as r, f as i, h as a, i as o, l as s, m as c, n as l, o as u, p as d, r as f, s as p, t as m, v as h } from "./iconSvgStatic-CA1z-vnh.js";
1
+ import { a as e, c as t, f as n, g as r, h as i, i as a, l as o, m as s, n as c, o as l, p as u, r as d, s as f, t as p, u as m, x as h, y as g } from "./iconSvgStatic-D04qA352.js";
2
2
  //#region src/utilities/playground.constants.ts
3
- var g = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, _ = [
3
+ var _ = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, v = [
4
4
  {
5
5
  id: "all",
6
6
  label: "All sources"
@@ -17,7 +17,7 @@ var g = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, _
17
17
  id: "pixabay",
18
18
  label: "Pixabay"
19
19
  }
20
- ], v = [
20
+ ], y = [
21
21
  {
22
22
  id: "surface-book",
23
23
  label: "Surface Book",
@@ -84,10 +84,10 @@ var g = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, _
84
84
  width: 375,
85
85
  category: "mobile"
86
86
  }
87
- ], y = 1280, b = Object.entries(h).map(([e, t]) => ({
87
+ ], b = 1280, x = Object.entries(g).map(([e, t]) => ({
88
88
  id: e,
89
89
  label: t.label
90
- })), x = [
90
+ })), S = [
91
91
  {
92
92
  label: "Text",
93
93
  value: "text"
@@ -120,7 +120,7 @@ var g = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, _
120
120
  label: "Checkbox",
121
121
  value: "checkbox"
122
122
  }
123
- ], S = [
123
+ ], C = [
124
124
  {
125
125
  label: "1 Column",
126
126
  widths: ["100%"],
@@ -169,7 +169,7 @@ var g = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, _
169
169
  "25%"
170
170
  ]
171
171
  }
172
- ], C = [
172
+ ], w = [
173
173
  {
174
174
  label: "Roboto",
175
175
  value: "'Roboto', sans-serif",
@@ -570,8 +570,8 @@ var g = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, _
570
570
  value: "'Great Vibes', cursive",
571
571
  style: "handwriting"
572
572
  }
573
- ], w = new Map(C.map((e) => [e.value, e.label]));
574
- function T(e, t = []) {
573
+ ], T = new Map(w.map((e) => [e.value, e.label]));
574
+ function E(e, t = []) {
575
575
  let n = /* @__PURE__ */ new Set(), r = (e) => {
576
576
  if (!e) return;
577
577
  let t = Array.isArray(e.columns) ? e.columns : [];
@@ -589,17 +589,17 @@ function T(e, t = []) {
589
589
  for (let e of t) typeof e == "string" && e.trim() && n.add(e.trim());
590
590
  return n;
591
591
  }
592
- function E(e) {
592
+ function D(e) {
593
593
  let t = /* @__PURE__ */ new Set();
594
594
  for (let n of e) {
595
- let e = w.get(n);
595
+ let e = T.get(n);
596
596
  e && t.add(e);
597
597
  }
598
598
  return t.size === 0 ? null : `https://fonts.googleapis.com/css?family=${Array.from(t).map((e) => `${encodeURIComponent(e).replace(/%20/g, "+")}:400,700`).join("|")}&display=swap`;
599
599
  }
600
600
  //#endregion
601
601
  //#region src/utilities/responsiveDefaults.ts
602
- var D = {
602
+ var O = {
603
603
  tablet: {
604
604
  thresholdPx: 24,
605
605
  scale: .85,
@@ -621,7 +621,7 @@ var D = {
621
621
  scale: .55,
622
622
  floorPx: 140
623
623
  }
624
- }, O = {
624
+ }, k = {
625
625
  tablet: {
626
626
  thresholdPx: 48,
627
627
  scale: .75,
@@ -632,7 +632,7 @@ var D = {
632
632
  scale: .55,
633
633
  floorPx: 16
634
634
  }
635
- }, k = {
635
+ }, A = {
636
636
  tablet: {
637
637
  thresholdPx: 500,
638
638
  scale: 1,
@@ -643,11 +643,11 @@ var D = {
643
643
  scale: 1,
644
644
  floorPx: 0
645
645
  }
646
- }, A = ["fontSize"], j = [
646
+ }, j = ["fontSize"], M = [
647
647
  "height",
648
648
  "minHeight",
649
649
  "maxHeight"
650
- ], M = [
650
+ ], N = [
651
651
  "padding",
652
652
  "paddingTop",
653
653
  "paddingBottom",
@@ -656,8 +656,8 @@ var D = {
656
656
  "margin",
657
657
  "marginTop",
658
658
  "marginBottom"
659
- ], N = ["width", "maxWidth"];
660
- function P(e) {
659
+ ], P = ["width", "maxWidth"];
660
+ function F(e) {
661
661
  if (typeof e == "number" && Number.isFinite(e)) return e;
662
662
  if (typeof e != "string") return null;
663
663
  let t = e.trim().match(/^(-?\d+(?:\.\d+)?)px$/);
@@ -665,48 +665,48 @@ function P(e) {
665
665
  let n = parseFloat(t[1]);
666
666
  return Number.isFinite(n) ? n : null;
667
667
  }
668
- function F(e, t) {
668
+ function I(e, t) {
669
669
  return e < t.thresholdPx ? null : Math.max(Math.round(e * t.scale), t.floorPx);
670
670
  }
671
- function I(e, t) {
671
+ function L(e, t) {
672
672
  if (!e || typeof e != "object") return {};
673
673
  let n = {};
674
- for (let r of A) {
675
- let i = P(e[r]);
676
- if (i === null) continue;
677
- let a = F(i, D[t]);
678
- a !== null && (n[r] = `${a}px`);
679
- }
680
674
  for (let r of j) {
681
- let i = P(e[r]);
675
+ let i = F(e[r]);
682
676
  if (i === null) continue;
683
- let a = F(i, ee[t]);
677
+ let a = I(i, O[t]);
684
678
  a !== null && (n[r] = `${a}px`);
685
679
  }
686
680
  for (let r of M) {
687
- let i = P(e[r]);
681
+ let i = F(e[r]);
688
682
  if (i === null) continue;
689
- let a = F(i, O[t]);
683
+ let a = I(i, ee[t]);
690
684
  a !== null && (n[r] = `${a}px`);
691
685
  }
692
686
  for (let r of N) {
693
- let i = P(e[r]);
694
- i !== null && i >= k[t].thresholdPx && (n[r] = "100%");
687
+ let i = F(e[r]);
688
+ if (i === null) continue;
689
+ let a = I(i, k[t]);
690
+ a !== null && (n[r] = `${a}px`);
691
+ }
692
+ for (let r of P) {
693
+ let i = F(e[r]);
694
+ i !== null && i >= A[t].thresholdPx && (n[r] = "100%");
695
695
  }
696
696
  return n;
697
697
  }
698
- function L(e, t, n) {
698
+ function R(e, t, n) {
699
699
  let r = e || {};
700
700
  return n ? {
701
701
  ...r,
702
- ...I(r, n),
702
+ ...L(r, n),
703
703
  ...t || {}
704
704
  } : r;
705
705
  }
706
706
  //#endregion
707
707
  //#region src/utilities/compiler.ts
708
- var R = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
709
- function z(e) {
708
+ var z = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
709
+ function B(e) {
710
710
  if (!e || typeof e != "object") return null;
711
711
  if (Array.isArray(e.columns) && e.columns.length > 0) return e;
712
712
  let t = (e.type || "").toLowerCase(), n = e.props || e.content || e.attributes || e.data || e.payload || e, r = e.style || {};
@@ -960,7 +960,7 @@ function z(e) {
960
960
  }
961
961
  }
962
962
  }
963
- var B = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter(([e, t]) => t != null && t !== "").map(([e, t]) => {
963
+ var V = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter(([e, t]) => t != null && t !== "").map(([e, t]) => {
964
964
  let n = e.replace(/([A-Z])/g, "-$1").toLowerCase(), r = t;
965
965
  return typeof t == "number" && [
966
966
  "padding",
@@ -971,25 +971,25 @@ var B = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
971
971
  "width",
972
972
  "height"
973
973
  ].some((t) => e.toLowerCase().includes(t)) && (r = `${t}px`), `${n}: ${r};`;
974
- }).join(" "), V = (e = {}) => B(e).replace(/;(\s|$)/g, " !important;$1");
975
- function H(e) {
974
+ }).join(" "), H = (e = {}) => V(e).replace(/;(\s|$)/g, " !important;$1");
975
+ function U(e) {
976
976
  if (typeof e != "string") return !1;
977
977
  let t = e.toLowerCase();
978
978
  return t.includes("javascript:") || t.includes("vbscript:") || t.includes("expression") || t.includes("url(") || t.includes("@import") || t.includes("-moz-binding") || t.includes("behavior") || t.includes("</style") || /\\/.test(e);
979
979
  }
980
- function U(e, t, n, r, i) {
980
+ function W(e, t, n, r, i) {
981
981
  let a = {
982
- ...I(n, r),
982
+ ...L(n, r),
983
983
  ...i || {}
984
984
  };
985
- for (let e of Object.keys(a)) H(a[e]) && delete a[e];
985
+ for (let e of Object.keys(a)) U(a[e]) && delete a[e];
986
986
  if (Object.keys(a).length === 0) return;
987
- let o = V(a);
987
+ let o = H(a);
988
988
  if (!o) return;
989
989
  let s = String(t).replace(/["\\]/g, "");
990
990
  e[r].push(`[data-plexo-id="${s}"] { ${o} }`);
991
991
  }
992
- function W(e, t) {
992
+ function G(e, t) {
993
993
  if (e.type !== "menu" || !t || t.textAlign === void 0) return t;
994
994
  let n = t.textAlign === "center" ? "center" : t.textAlign === "right" ? "flex-end" : "flex-start";
995
995
  return {
@@ -997,7 +997,7 @@ function W(e, t) {
997
997
  justifyContent: n
998
998
  };
999
999
  }
1000
- var G = () => ({
1000
+ var K = () => ({
1001
1001
  backgroundColor: "#ffffff",
1002
1002
  borderRadius: "20px",
1003
1003
  width: "100%",
@@ -1020,11 +1020,11 @@ var G = () => ({
1020
1020
  buttonPaddingRight: "14px",
1021
1021
  buttonFontSize: "13px",
1022
1022
  buttonFontWeight: "700"
1023
- }), K = (e) => (e || "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), q = (e, t) => {
1023
+ }), q = (e) => (e || "").replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), J = (e, t) => {
1024
1024
  if (typeof t != "string") return "";
1025
1025
  let n = t.trim();
1026
- return n ? ` ${e}="${K(n)}"` : "";
1027
- }, J = [
1026
+ return n ? ` ${e}="${q(n)}"` : "";
1027
+ }, Y = [
1028
1028
  "fieldSpacing",
1029
1029
  "buttonBackgroundColor",
1030
1030
  "buttonTextColor",
@@ -1044,9 +1044,9 @@ var G = () => ({
1044
1044
  "buttonWidth",
1045
1045
  "buttonHeight",
1046
1046
  "buttonAlign"
1047
- ], Y = (e) => {
1047
+ ], X = (e) => {
1048
1048
  if (!e || typeof e != "object") return "";
1049
- let t = e.kind || "text", n = K(e.name || e.label || "field"), r = e.required ? " required" : "", i = B({
1049
+ let t = e.kind || "text", n = q(e.name || e.id || "field"), r = e.required ? " required" : "", i = V({
1050
1050
  fontSize: e.fontSize || "13px",
1051
1051
  borderRadius: e.borderRadius || "12px",
1052
1052
  borderWidth: e.borderWidth || "1px",
@@ -1054,19 +1054,19 @@ var G = () => ({
1054
1054
  borderStyle: "solid",
1055
1055
  color: e.inputTextColor
1056
1056
  }), a = e.showLabel === !1 ? "" : `<label style="display: block; margin-bottom: 4px; font-size: ${e.fontSize || "12px"}; font-weight: ${e.labelFontWeight || "700"}; color: ${e.labelColor || "inherit"};">${e.label || ""}${e.required ? " <span style=\"color:#e11d48;\">*</span>" : ""}</label>`;
1057
- return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${K(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}></textarea>` : t === "select" ? `${a}<select name="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}>${(Array.isArray(e.options) ? e.options : []).map((e) => `<option value="${K(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>` : t === "radio" || t === "checkbox" ? `${a}<div style="display: flex; flex-wrap: wrap; gap: 8px;">${(Array.isArray(e.options) && e.options.length > 0 ? e.options : [{
1057
+ return t === "textarea" ? `${a}<textarea name="${n}" placeholder="${q(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}></textarea>` : t === "select" ? `${a}<select name="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r}>${(Array.isArray(e.options) ? e.options : []).map((e) => `<option value="${q(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>` : t === "radio" || t === "checkbox" ? `${a}<div style="display: flex; flex-wrap: wrap; gap: 8px;">${(Array.isArray(e.options) && e.options.length > 0 ? e.options : [{
1058
1058
  label: e.label || "Option",
1059
1059
  value: e.name || "option"
1060
- }]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${K(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${K(t)}" name="${n}" placeholder="${K(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
1060
+ }]).map((r) => `<label style="display: inline-flex; align-items: center; gap: 6px; font-size: ${e.fontSize || "12px"};"><input type="${t}" name="${n}" value="${q(r?.value ?? "")}" />${r?.label ?? r?.value ?? ""}</label>`).join("")}</div>` : `${a}<input type="${q(t)}" name="${n}" placeholder="${q(e.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; ${i}"${r} />`;
1061
1061
  };
1062
- function X(e, t, n) {
1062
+ function te(e, t, n) {
1063
1063
  if (e === "none") return "";
1064
- let r = K(t);
1064
+ let r = q(t);
1065
1065
  return e === "plus" ? `<span data-acc-icon style="font-size: 14px; line-height: 1; font-weight: 700; color: ${r};">${n ? "−" : "+"}</span>` : e === "arrow" ? `<span data-acc-icon style="font-size: 14px; line-height: 1; display: inline-block; color: ${r}; transform: ${n ? "rotate(90deg)" : "none"}; transition: transform 0.2s ease;">›</span>` : `<svg data-acc-icon width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="${r}" stroke-width="2.5" style="flex-shrink: 0; transform: ${n ? "rotate(180deg)" : "none"}; transition: transform 0.2s ease;"><path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5"/></svg>`;
1066
1066
  }
1067
1067
  function Z(e, t, n) {
1068
1068
  return e.map((r, i) => {
1069
- let a = i === e.length - 1, o = B({ borderBottom: n.showDividers && !a ? `1px solid ${t.dividerColor || "#e2e8f0"}` : void 0 }), s = B({
1069
+ let a = i === e.length - 1, o = V({ borderBottom: n.showDividers && !a ? `1px solid ${t.dividerColor || "#e2e8f0"}` : void 0 }), s = V({
1070
1070
  display: "flex",
1071
1071
  alignItems: "center",
1072
1072
  gap: "8px",
@@ -1083,91 +1083,91 @@ function Z(e, t, n) {
1083
1083
  border: "none",
1084
1084
  font: "inherit",
1085
1085
  background: void 0
1086
- }), c = B({
1086
+ }), c = V({
1087
1087
  display: "grid",
1088
1088
  gridTemplateRows: r.defaultOpen ? "1fr" : "0fr",
1089
1089
  transition: n.animated ? "grid-template-rows 0.25s ease" : void 0,
1090
1090
  backgroundColor: t.contentBackgroundColor || "#ffffff"
1091
- }), l = B({
1091
+ }), l = V({
1092
1092
  padding: t.contentPadding || "14px",
1093
1093
  color: t.contentTextColor || "#475569",
1094
1094
  fontSize: t.contentFontSize || "13px",
1095
1095
  whiteSpace: "pre-wrap"
1096
- }), u = X(n.iconStyle, t.iconColor || "#64748b", !!r.defaultOpen), d = K(r.title), f = K(r.content), p = r.children.length ? `<div class="plexo-acc-group" style="margin-top: 10px;">${Z(r.children, t, n)}</div>` : "";
1096
+ }), u = te(n.iconStyle, t.iconColor || "#64748b", !!r.defaultOpen), d = q(r.title), f = q(r.content), p = r.children.length ? `<div class="plexo-acc-group" style="margin-top: 10px;">${Z(r.children, t, n)}</div>` : "";
1097
1097
  return `<div class="plexo-acc-item" style="${o}"><button type="button" data-acc-header data-acc-open="${r.defaultOpen ? "1" : "0"}" style="${s}"><span style="flex: 1;">${d}</span>${u}</button><div data-acc-panel style="${c}"><div style="overflow: hidden;"><div style="${l}">${f}${p}</div></div></div></div>`;
1098
1098
  }).join("");
1099
1099
  }
1100
- function te(e) {
1100
+ function ne(e) {
1101
1101
  return `<!-- Unsupported block ${String(e)} -->`;
1102
1102
  }
1103
- var ne = (t) => {
1104
- if (!t || typeof t != "object") return "";
1105
- let h = t.style || {}, g = B(t.type === "form_container" ? {
1106
- ...G(),
1107
- ...h
1108
- } : h), _ = t.attributes || {}, v = ` data-plexo-id="${K(t.id)}"`;
1109
- switch (t.type) {
1110
- case "heading": return `<h2${v} style="margin-top: 0; margin-bottom: 8px; ${g}">${_.text || "Heading"}</h2>`;
1111
- case "paragraph": return `<p${v} style="margin-top: 0; margin-bottom: 12px; ${g}">${_.text || "Paragraph text content."}</p>`;
1112
- case "text": return `<div${v} style="${g}">${_.text || ""}</div>`;
1103
+ var re = (h) => {
1104
+ if (!h || typeof h != "object") return "";
1105
+ let g = h.style || {}, _ = V(h.type === "form_container" ? {
1106
+ ...K(),
1107
+ ...g
1108
+ } : g), v = h.attributes || {}, y = ` data-plexo-id="${q(h.id)}"`;
1109
+ switch (h.type) {
1110
+ case "heading": return `<h2${y} style="margin-top: 0; margin-bottom: 8px; ${_}">${v.text || "Heading"}</h2>`;
1111
+ case "paragraph": return `<p${y} style="margin-top: 0; margin-bottom: 12px; ${_}">${v.text || "Paragraph text content."}</p>`;
1112
+ case "text": return `<div${y} style="${_}">${v.text || ""}</div>`;
1113
1113
  case "button": {
1114
- let n = e(t), r = B({
1115
- ...h,
1116
- width: n.width,
1117
- height: n.height
1114
+ let e = l(h), t = V({
1115
+ ...g,
1116
+ width: e.width,
1117
+ height: e.height
1118
1118
  });
1119
- return `<div style="text-align: ${h.textAlign || "center"};"><a${v} href="${_.href || "#"}" target="${_.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${r}">${_.text || "Button"}</a></div>`;
1119
+ return `<div style="text-align: ${g.textAlign || "center"};"><a${y} href="${v.href || "#"}" target="${v.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${t}">${v.text || "Button"}</a></div>`;
1120
1120
  }
1121
1121
  case "image": {
1122
- let e = s(t), n = h.textAlign === "center" ? "margin: 0 auto; display: block;" : h.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", r = B({
1123
- ...h,
1122
+ let e = m(h), t = g.textAlign === "center" ? "margin: 0 auto; display: block;" : g.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", n = V({
1123
+ ...g,
1124
1124
  width: e.width,
1125
1125
  height: e.height
1126
1126
  });
1127
- return `<img${v} src="${_.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${_.alt || ""}" style="${r} ${n}" />`;
1127
+ return `<img${y} src="${v.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${v.alt || ""}" style="${n} ${t}" />`;
1128
1128
  }
1129
- case "divider": return `<hr${v} style="border: 0; border-top: ${h.borderWidth || "1px"} ${h.borderStyle || "solid"} ${h.borderColor || "#334155"}; ${g}" />`;
1130
- case "spacer": return `<div${v} style="height: ${h.height || "24px"};"></div>`;
1131
- case "card": return `<div${v} style="${g}">
1132
- <h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${_.title || "Card Title"}</h3>
1133
- <p style="margin: 0; color: #94a3b8; font-size: 14px;">${_.description || "Card description."}</p>
1129
+ case "divider": return `<hr${y} style="border: 0; border-top: ${g.borderWidth || "1px"} ${g.borderStyle || "solid"} ${g.borderColor || "#334155"}; ${_}" />`;
1130
+ case "spacer": return `<div${y} style="height: ${g.height || "24px"};"></div>`;
1131
+ case "card": return `<div${y} style="${_}">
1132
+ <h3 style="margin-top: 0; margin-bottom: 8px; color: #ffffff;">${v.title || "Card Title"}</h3>
1133
+ <p style="margin: 0; color: #94a3b8; font-size: 14px;">${v.description || "Card description."}</p>
1134
1134
  </div>`;
1135
1135
  case "form_container": {
1136
- let e = {
1137
- ...G(),
1138
- ...h
1139
- }, n = {};
1140
- for (let t of Object.keys(e)) J.includes(t) || (n[t] = e[t]);
1141
- n.height = u(t);
1142
- let r = B(n), i = p(Array.isArray(_.fields) ? _.fields : []), a = e.fieldSpacing || "12px", s = i.map((e) => `<div style="margin-bottom: ${a};">${Y(e)}</div>`).join(""), c = _.buttonAutoWidth === !1 ? e.buttonWidth || "100%" : "auto", l = e.buttonAlign === "left" ? "flex-start" : e.buttonAlign === "right" ? "flex-end" : "center", d = _.buttonAutoHeight === !1 && e.buttonHeight || "auto", f = B({
1143
- backgroundColor: e.buttonBackgroundColor,
1144
- color: e.buttonTextColor,
1145
- borderRadius: e.buttonBorderRadius,
1146
- paddingTop: o(e.buttonPaddingTop, e.buttonPadding, "top", "10px"),
1147
- paddingBottom: o(e.buttonPaddingBottom, e.buttonPadding, "bottom", "10px"),
1148
- paddingLeft: o(e.buttonPaddingLeft, e.buttonPadding, "left", "14px"),
1149
- paddingRight: o(e.buttonPaddingRight, e.buttonPadding, "right", "14px"),
1150
- marginTop: o(e.buttonMarginTop, e.buttonMargin, "top"),
1151
- marginBottom: o(e.buttonMarginBottom, e.buttonMargin, "bottom"),
1152
- marginLeft: o(e.buttonMarginLeft, e.buttonMargin, "left"),
1153
- marginRight: o(e.buttonMarginRight, e.buttonMargin, "right"),
1154
- fontSize: e.buttonFontSize,
1155
- fontWeight: e.buttonFontWeight,
1156
- width: c,
1136
+ let n = {
1137
+ ...K(),
1138
+ ...g
1139
+ }, r = {};
1140
+ for (let e of Object.keys(n)) Y.includes(e) || (r[e] = n[e]);
1141
+ r.height = f(h);
1142
+ let i = V(r), a = c(t(Array.isArray(v.fields) ? v.fields : [])), o = n.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${X(e)}</div>`).join(""), l = v.buttonAutoWidth === !1 ? n.buttonWidth || "100%" : "auto", u = n.buttonAlign === "left" ? "flex-start" : n.buttonAlign === "right" ? "flex-end" : "center", d = v.buttonAutoHeight === !1 && n.buttonHeight || "auto", p = V({
1143
+ backgroundColor: n.buttonBackgroundColor,
1144
+ color: n.buttonTextColor,
1145
+ borderRadius: n.buttonBorderRadius,
1146
+ paddingTop: e(n.buttonPaddingTop, n.buttonPadding, "top", "10px"),
1147
+ paddingBottom: e(n.buttonPaddingBottom, n.buttonPadding, "bottom", "10px"),
1148
+ paddingLeft: e(n.buttonPaddingLeft, n.buttonPadding, "left", "14px"),
1149
+ paddingRight: e(n.buttonPaddingRight, n.buttonPadding, "right", "14px"),
1150
+ marginTop: e(n.buttonMarginTop, n.buttonMargin, "top"),
1151
+ marginBottom: e(n.buttonMarginBottom, n.buttonMargin, "bottom"),
1152
+ marginLeft: e(n.buttonMarginLeft, n.buttonMargin, "left"),
1153
+ marginRight: e(n.buttonMarginRight, n.buttonMargin, "right"),
1154
+ fontSize: n.buttonFontSize,
1155
+ fontWeight: n.buttonFontWeight,
1156
+ width: l,
1157
1157
  height: d
1158
1158
  });
1159
- return `<form${v} action="${K(_.actionUrl || _.action || "#")}" method="${K(_.method || "POST")}" style="${r}">${s}<div style="display: flex; width: 100%; justify-content: ${l};"><button type="submit" style="border: 0; cursor: pointer; ${f}">${_.submitLabel || "Submit"}</button></div></form>`;
1159
+ return `<form${y} action="${q(v.actionUrl || v.action || "#")}" method="${q(v.method || "POST")}" style="${i}">${s}<div style="display: flex; width: 100%; justify-content: ${u};"><button type="submit" style="border: 0; cursor: pointer; ${p}">${v.submitLabel || "Submit"}</button></div></form>`;
1160
1160
  }
1161
1161
  case "input": {
1162
- let e = _.inputType || _.type || "text", t = K(_.name || _.fieldName || "field"), n = K(_.placeholder || ""), r = _.required ? " required" : "";
1163
- return `<input${v} type="${K(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${g}"${r} />`;
1162
+ let e = v.inputType || v.type || "text", t = q(v.name || v.fieldName || "field"), n = q(v.placeholder || ""), r = v.required ? " required" : "";
1163
+ return `<input${y} type="${q(e)}" name="${t}" placeholder="${n}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${_}"${r} />`;
1164
1164
  }
1165
- case "textarea": return `<textarea${v} name="${K(_.name || _.fieldName || "field")}" placeholder="${K(_.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${g}"${_.required ? " required" : ""}></textarea>`;
1166
- case "select": return `<select${v} name="${K(_.name || _.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${g}"${_.required ? " required" : ""}>${(Array.isArray(_.options) ? _.options : []).map((e) => `<option value="${K(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
1167
- case "html": return `<div${v} style="${B({
1168
- ...h,
1169
- height: n(t, "auto")
1170
- })}">${_.htmlContent || _.text || ""}</div>`;
1165
+ case "textarea": return `<textarea${y} name="${q(v.name || v.fieldName || "field")}" placeholder="${q(v.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${_}"${v.required ? " required" : ""}></textarea>`;
1166
+ case "select": return `<select${y} name="${q(v.name || v.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${_}"${v.required ? " required" : ""}>${(Array.isArray(v.options) ? v.options : []).map((e) => `<option value="${q(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
1167
+ case "html": return `<div${y} style="${V({
1168
+ ...g,
1169
+ height: o(h, "auto")
1170
+ })}">${v.htmlContent || v.text || ""}</div>`;
1171
1171
  case "blog_title":
1172
1172
  case "blog_content":
1173
1173
  case "blog_featured_image":
@@ -1176,20 +1176,20 @@ var ne = (t) => {
1176
1176
  case "blog_categories":
1177
1177
  case "blog_comments":
1178
1178
  case "blog_post_list": {
1179
- let e = t.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), n = B(h);
1180
- return `<div${v} data-plexo-blog-${e}="true"${q("data-plexo-blog-prefix", _.prefix)} style="${n}"></div>`;
1179
+ let e = h.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), t = V(g);
1180
+ return `<div${y} data-plexo-blog-${e}="true"${J("data-plexo-blog-prefix", v.prefix)} style="${t}"></div>`;
1181
1181
  }
1182
1182
  case "social": {
1183
- let e = i(t), n = h.textAlign === "center" ? "center" : h.textAlign === "right" ? "flex-end" : "flex-start";
1184
- return `<div${v} style="${B({
1185
- padding: h.padding,
1186
- margin: h.margin,
1183
+ let e = u(h), t = g.textAlign === "center" ? "center" : g.textAlign === "right" ? "flex-end" : "flex-start";
1184
+ return `<div${y} style="${V({
1185
+ padding: g.padding,
1186
+ margin: g.margin,
1187
1187
  display: "flex",
1188
1188
  flexWrap: "wrap",
1189
- gap: h.iconSpacing || "8px",
1190
- justifyContent: n
1189
+ gap: g.iconSpacing || "8px",
1190
+ justifyContent: t
1191
1191
  })}">${e.map((e) => {
1192
- let t = B({
1192
+ let t = V({
1193
1193
  width: e.size,
1194
1194
  height: e.size,
1195
1195
  padding: "8px",
@@ -1201,141 +1201,141 @@ var ne = (t) => {
1201
1201
  justifyContent: "center",
1202
1202
  overflow: "hidden"
1203
1203
  });
1204
- return `<a href="${K(e.url)}" style="${t} text-decoration: none;">${l(e.provider, e.color)}</a>`;
1204
+ return `<a href="${q(e.url)}" style="${t} text-decoration: none;">${d(e.provider, e.color)}</a>`;
1205
1205
  }).join("")}</div>`;
1206
1206
  }
1207
1207
  case "menu": {
1208
- let e = r(t), n = h.textAlign === "center" ? "center" : h.textAlign === "right" ? "flex-end" : "flex-start";
1209
- return `<div${v} style="${B({
1210
- ...h,
1208
+ let e = n(h), t = g.textAlign === "center" ? "center" : g.textAlign === "right" ? "flex-end" : "flex-start";
1209
+ return `<div${y} style="${V({
1210
+ ...g,
1211
1211
  display: "flex",
1212
1212
  flexWrap: "wrap",
1213
1213
  gap: "16px",
1214
- justifyContent: n
1215
- })}">${e.map((e) => `<a href="${K(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${h.fontWeight || 600};">${K(e.label)}</a>`).join("")}</div>`;
1214
+ justifyContent: t
1215
+ })}">${e.map((e) => `<a href="${q(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${g.fontWeight || 600};">${q(e.label)}</a>`).join("")}</div>`;
1216
1216
  }
1217
1217
  case "icon": {
1218
- let e = h.fontSize || `${_.iconSize || 48}px`, t = h.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = m(_.iconName, n, t), i = h.textAlign === "right" ? "flex-end" : h.textAlign === "left" ? "flex-start" : "center", a = B({
1219
- padding: h.padding,
1220
- margin: h.margin,
1218
+ let e = g.fontSize || `${v.iconSize || 48}px`, t = g.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = p(v.iconName, n, t), i = g.textAlign === "right" ? "flex-end" : g.textAlign === "left" ? "flex-start" : "center", a = V({
1219
+ padding: g.padding,
1220
+ margin: g.margin,
1221
1221
  display: "flex",
1222
1222
  justifyContent: i
1223
- }), o = typeof _.href == "string" ? _.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`;
1224
- return `<div style="${a}">${o ? `<a${v} href="${K(o)}" target="${_.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${v}>${s}</span>`}</div>`;
1223
+ }), o = typeof v.href == "string" ? v.href.trim() : "", s = `<span style="display: inline-flex; align-items: center; justify-content: center; color: ${t};">${r}</span>`;
1224
+ return `<div style="${a}">${o ? `<a${y} href="${q(o)}" target="${v.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${y}>${s}</span>`}</div>`;
1225
1225
  }
1226
1226
  case "table": {
1227
- let e = d(t), n = `${h.borderWidth || "1px"} ${h.borderStyle || "solid"} ${h.borderColor || "#cbd5e1"}`, r = (t, r, i) => {
1228
- let a = i ? "th" : "td", o = i ? h.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : h.contentBgColor || "#ffffff", s = i ? h.headerTextColor || "#1e293b" : h.contentTextColor || "#475569", c = i ? h.headerTextAlign || "left" : h.contentTextAlign || "left";
1229
- return `<tr>${t.map((e) => {
1230
- let t = B({
1231
- padding: h.cellPadding || "8px",
1232
- border: n,
1227
+ let e = s(h), t = `${g.borderWidth || "1px"} ${g.borderStyle || "solid"} ${g.borderColor || "#cbd5e1"}`, n = (n, r, i) => {
1228
+ let a = i ? "th" : "td", o = i ? g.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : g.contentBgColor || "#ffffff", s = i ? g.headerTextColor || "#1e293b" : g.contentTextColor || "#475569", c = i ? g.headerTextAlign || "left" : g.contentTextAlign || "left";
1229
+ return `<tr>${n.map((e) => {
1230
+ let n = V({
1231
+ padding: g.cellPadding || "8px",
1232
+ border: t,
1233
1233
  backgroundColor: o,
1234
1234
  color: s,
1235
1235
  textAlign: c,
1236
- lineHeight: h.contentLineHeight,
1237
- letterSpacing: h.contentLetterSpacing,
1236
+ lineHeight: g.contentLineHeight,
1237
+ letterSpacing: g.contentLetterSpacing,
1238
1238
  fontWeight: i ? "700" : void 0
1239
1239
  });
1240
- return `<${a} style="${t}">${e || "&nbsp;"}</${a}>`;
1240
+ return `<${a} style="${n}">${e || "&nbsp;"}</${a}>`;
1241
1241
  }).join("")}</tr>`;
1242
- }, i = e.enableHeader && e.cells.length > 0 ? `<thead>${r(e.cells[0], 0, !0)}</thead>` : "", a = +!!e.enableHeader, o = e.enableFooter ? e.cells.length - 1 : e.cells.length, s = e.cells.slice(a, Math.max(a, o)).map((e, t) => r(e, t, !1)).join(""), c = e.enableFooter && e.cells.length > a ? `<tfoot>${r(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : "", l = B({
1242
+ }, r = e.enableHeader && e.cells.length > 0 ? `<thead>${n(e.cells[0], 0, !0)}</thead>` : "", i = +!!e.enableHeader, a = e.enableFooter ? e.cells.length - 1 : e.cells.length, o = e.cells.slice(i, Math.max(i, a)).map((e, t) => n(e, t, !1)).join(""), c = e.enableFooter && e.cells.length > i ? `<tfoot>${n(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : "", l = V({
1243
1243
  borderCollapse: "collapse",
1244
1244
  width: "100%"
1245
1245
  });
1246
- return `<div${v} style="${B({
1247
- padding: h.padding,
1248
- margin: h.margin,
1246
+ return `<div${y} style="${V({
1247
+ padding: g.padding,
1248
+ margin: g.margin,
1249
1249
  overflowX: "auto"
1250
- })}"><table style="${l}">${i}<tbody>${s}</tbody>${c}</table></div>`;
1250
+ })}"><table style="${l}">${r}<tbody>${o}</tbody>${c}</table></div>`;
1251
1251
  }
1252
1252
  case "video": {
1253
- let e = a(_.videoUrl), t = _.linkType === "email" ? `mailto:${_.href || ""}` : _.href || _.videoUrl || "#", n = _.target || "_blank";
1254
- return `<div${v} style="${B({
1255
- padding: h.padding,
1256
- margin: h.margin,
1257
- borderRadius: h.borderRadius,
1253
+ let e = r(v.videoUrl), t = v.linkType === "email" ? `mailto:${v.href || ""}` : v.href || v.videoUrl || "#", n = v.target || "_blank";
1254
+ return `<div${y} style="${V({
1255
+ padding: g.padding,
1256
+ margin: g.margin,
1257
+ borderRadius: g.borderRadius,
1258
1258
  overflow: "hidden"
1259
- })}"><a href="${K(t)}" target="${K(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${K(e.thumbnailUrl)}" alt="${K(_.alt || "Video preview")}" style="width: 100%; display: block;" /><span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 9999px; background: rgba(15, 23, 42, 0.75); display: flex; align-items: center; justify-content: center;"><span style="width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 16px solid #ffffff; margin-left: 4px;"></span></span></a></div>`;
1259
+ })}"><a href="${q(t)}" target="${q(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${q(e.thumbnailUrl)}" alt="${q(v.alt || "Video preview")}" style="width: 100%; display: block;" /><span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 9999px; background: rgba(15, 23, 42, 0.75); display: flex; align-items: center; justify-content: center;"><span style="width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 16px solid #ffffff; margin-left: 4px;"></span></span></a></div>`;
1260
1260
  }
1261
1261
  case "timer": {
1262
- let e = _.showLabels !== !1, n = B({
1263
- fontFamily: h.digitsFontFamily,
1264
- fontSize: h.digitsFontSize || "40px",
1265
- color: h.digitsColor || "#1e293b",
1262
+ let e = v.showLabels !== !1, t = V({
1263
+ fontFamily: g.digitsFontFamily,
1264
+ fontSize: g.digitsFontSize || "40px",
1265
+ color: g.digitsColor || "#1e293b",
1266
1266
  fontWeight: "800"
1267
- }), r = B({
1268
- fontFamily: h.labelsFontFamily,
1269
- fontSize: h.labelsFontSize || "16px",
1270
- color: h.labelsColor || "#64748b"
1271
- }), i = B({
1272
- backgroundColor: h.backgroundColor || "#f8fafc",
1273
- borderRadius: h.borderRadius || "8px",
1274
- padding: h.padding || "16px",
1267
+ }), n = V({
1268
+ fontFamily: g.labelsFontFamily,
1269
+ fontSize: g.labelsFontSize || "16px",
1270
+ color: g.labelsColor || "#64748b"
1271
+ }), r = V({
1272
+ backgroundColor: g.backgroundColor || "#f8fafc",
1273
+ borderRadius: g.borderRadius || "8px",
1274
+ padding: g.padding || "16px",
1275
1275
  textAlign: "center"
1276
- }), a = (t, i, a) => `<div style="display: inline-flex; flex-direction: column; align-items: center; padding: 0 10px;"><span data-unit="${t}" style="${n}">${a}</span>${e ? `<span style="${r}">${i}</span>` : ""}</div>`, o = c(_.targetDate), s = K(_.targetDate || "2026-12-31T23:59:59"), l = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${t.id}"]`)});if(!wrap)return;var target=new Date(wrap.getAttribute('data-plexo-target')).getTime();function pad(n){return String(n).padStart(2,'0');}function tick(){var diff=target-Date.now();var d=wrap.querySelector('[data-unit="days"]'),h=wrap.querySelector('[data-unit="hours"]'),m=wrap.querySelector('[data-unit="minutes"]'),s=wrap.querySelector('[data-unit="seconds"]');if(diff<=0){[d,h,m,s].forEach(function(n){if(n)n.textContent='00';});clearInterval(iv);return;}var total=Math.floor(diff/1000);if(d)d.textContent=pad(Math.floor(total/86400));if(h)h.textContent=pad(Math.floor(total%86400/3600));if(m)m.textContent=pad(Math.floor(total%3600/60));if(s)s.textContent=pad(total%60);}tick();var iv=setInterval(tick,1000);})();<\/script>`;
1277
- return `<div${v} data-plexo-target="${s}" style="${i}"><div>${a("days", "Days", o.days)}${a("hours", "Hours", o.hours)}${a("minutes", "Mins", o.minutes)}${a("seconds", "Secs", o.seconds)}</div>${l}</div>`;
1276
+ }), a = (r, i, a) => `<div style="display: inline-flex; flex-direction: column; align-items: center; padding: 0 10px;"><span data-unit="${r}" style="${t}">${a}</span>${e ? `<span style="${n}">${i}</span>` : ""}</div>`, o = i(v.targetDate), s = q(v.targetDate || "2026-12-31T23:59:59"), c = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${h.id}"]`)});if(!wrap)return;var target=new Date(wrap.getAttribute('data-plexo-target')).getTime();function pad(n){return String(n).padStart(2,'0');}function tick(){var diff=target-Date.now();var d=wrap.querySelector('[data-unit="days"]'),h=wrap.querySelector('[data-unit="hours"]'),m=wrap.querySelector('[data-unit="minutes"]'),s=wrap.querySelector('[data-unit="seconds"]');if(diff<=0){[d,h,m,s].forEach(function(n){if(n)n.textContent='00';});clearInterval(iv);return;}var total=Math.floor(diff/1000);if(d)d.textContent=pad(Math.floor(total/86400));if(h)h.textContent=pad(Math.floor(total%86400/3600));if(m)m.textContent=pad(Math.floor(total%3600/60));if(s)s.textContent=pad(total%60);}tick();var iv=setInterval(tick,1000);})();<\/script>`;
1277
+ return `<div${y} data-plexo-target="${s}" style="${r}"><div>${a("days", "Days", o.days)}${a("hours", "Hours", o.hours)}${a("minutes", "Mins", o.minutes)}${a("seconds", "Secs", o.seconds)}</div>${c}</div>`;
1278
1278
  }
1279
1279
  case "carousel": {
1280
- let e = Array.isArray(_.images) ? _.images : [], n = B({
1281
- padding: h.padding || "10px",
1282
- margin: h.margin,
1283
- backgroundColor: h.backgroundColor,
1280
+ let e = Array.isArray(v.images) ? v.images : [], t = V({
1281
+ padding: g.padding || "10px",
1282
+ margin: g.margin,
1283
+ backgroundColor: g.backgroundColor,
1284
1284
  position: "relative",
1285
1285
  overflow: "hidden",
1286
1286
  borderRadius: "12px"
1287
1287
  });
1288
- if (e.length === 0) return `<div${v} style="${n}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
1289
- let r = Math.min(e.length - 1, Math.max(0, parseInt(String(_.activeIdx), 10) || 0)), i = e.map((e, t) => `<div data-slide-idx="${t}" style="display: ${t === r ? "block" : "none"};"><img src="${K(e.src)}" alt="${K(e.alt || e.caption || "")}" style="width: 100%; display: block;" />${e.caption ? `<div style="padding: 8px; text-align: center; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 12px; font-weight: 600;">${K(e.caption)}</div>` : ""}</div>`).join(""), a = e.length > 1 ? `<div style="display: flex; gap: 6px; justify-content: center; padding: 8px 0;">${e.map((e, t) => `<button type="button" data-dot-idx="${t}" style="width: 8px; height: 8px; border-radius: 9999px; border: none; background: ${t === r ? "#4f46e5" : "#cbd5e1"}; cursor: pointer;"></button>`).join("")}</div>` : "";
1290
- return `<div${v} data-active-idx="${r}" style="${n}">${e.length > 1 ? "<button type=\"button\" data-nav=\"prev\" style=\"position: absolute; left: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">‹</button><button type=\"button\" data-nav=\"next\" style=\"position: absolute; right: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">›</button>" : ""}${i}${a}${`<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${t.id}"]`)});if(!wrap)return;var slides=wrap.querySelectorAll('[data-slide-idx]');var dots=wrap.querySelectorAll('[data-dot-idx]');function show(n){var idx=(n+slides.length)%slides.length;slides.forEach(function(s,i){s.style.display=i===idx?'block':'none';});dots.forEach(function(d,i){d.style.background=i===idx?'#4f46e5':'#cbd5e1';});wrap.setAttribute('data-active-idx',String(idx));}var prev=wrap.querySelector('[data-nav="prev"]');var next=wrap.querySelector('[data-nav="next"]');if(prev)prev.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)-1);});if(next)next.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)+1);});dots.forEach(function(d,i){d.addEventListener('click',function(){show(i);});});})();<\/script>`}</div>`;
1288
+ if (e.length === 0) return `<div${y} style="${t}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
1289
+ let n = Math.min(e.length - 1, Math.max(0, parseInt(String(v.activeIdx), 10) || 0)), r = e.map((e, t) => `<div data-slide-idx="${t}" style="display: ${t === n ? "block" : "none"};"><img src="${q(e.src)}" alt="${q(e.alt || e.caption || "")}" style="width: 100%; display: block;" />${e.caption ? `<div style="padding: 8px; text-align: center; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 12px; font-weight: 600;">${q(e.caption)}</div>` : ""}</div>`).join(""), i = e.length > 1 ? `<div style="display: flex; gap: 6px; justify-content: center; padding: 8px 0;">${e.map((e, t) => `<button type="button" data-dot-idx="${t}" style="width: 8px; height: 8px; border-radius: 9999px; border: none; background: ${t === n ? "#4f46e5" : "#cbd5e1"}; cursor: pointer;"></button>`).join("")}</div>` : "";
1290
+ return `<div${y} data-active-idx="${n}" style="${t}">${e.length > 1 ? "<button type=\"button\" data-nav=\"prev\" style=\"position: absolute; left: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">‹</button><button type=\"button\" data-nav=\"next\" style=\"position: absolute; right: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">›</button>" : ""}${r}${i}${`<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${h.id}"]`)});if(!wrap)return;var slides=wrap.querySelectorAll('[data-slide-idx]');var dots=wrap.querySelectorAll('[data-dot-idx]');function show(n){var idx=(n+slides.length)%slides.length;slides.forEach(function(s,i){s.style.display=i===idx?'block':'none';});dots.forEach(function(d,i){d.style.background=i===idx?'#4f46e5':'#cbd5e1';});wrap.setAttribute('data-active-idx',String(idx));}var prev=wrap.querySelector('[data-nav="prev"]');var next=wrap.querySelector('[data-nav="next"]');if(prev)prev.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)-1);});if(next)next.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)+1);});dots.forEach(function(d,i){d.addEventListener('click',function(){show(i);});});})();<\/script>`}</div>`;
1291
1291
  }
1292
1292
  case "accordion": {
1293
- let e = f(t), n = _.mode === "multi" ? "multi" : "single", r = _.iconStyle || "chevron", i = _.iconPosition === "left", a = _.showDividers !== !1, o = _.animation !== "none", s = B({
1294
- border: `${h.borderWidth || "1px"} ${h.borderStyle || "solid"} ${h.borderColor || "#e2e8f0"}`,
1295
- borderRadius: h.borderRadius || "10px",
1293
+ let e = a(h), t = v.mode === "multi" ? "multi" : "single", n = v.iconStyle || "chevron", r = v.iconPosition === "left", i = v.showDividers !== !1, o = v.animation !== "none", s = V({
1294
+ border: `${g.borderWidth || "1px"} ${g.borderStyle || "solid"} ${g.borderColor || "#e2e8f0"}`,
1295
+ borderRadius: g.borderRadius || "10px",
1296
1296
  overflow: "hidden",
1297
- margin: h.margin
1297
+ margin: g.margin
1298
1298
  });
1299
- return e.length === 0 ? `<div${v} style="${s}"></div>` : `<div${v} data-acc-mode="${n}" data-acc-icon-style="${r}" style="${s}"><div class="plexo-acc-group">${Z(e, h, {
1300
- iconStyle: r,
1301
- iconOnLeft: i,
1302
- showDividers: a,
1299
+ return e.length === 0 ? `<div${y} style="${s}"></div>` : `<div${y} data-acc-mode="${t}" data-acc-icon-style="${n}" style="${s}"><div class="plexo-acc-group">${Z(e, g, {
1300
+ iconStyle: n,
1301
+ iconOnLeft: r,
1302
+ showDividers: i,
1303
1303
  animated: o
1304
- })}</div>${`<script>(function(){var root=document.querySelector(${JSON.stringify(`[data-plexo-id="${t.id}"]`)});if(!root)return;var mode=root.getAttribute('data-acc-mode')||'single';var iconStyle=root.getAttribute('data-acc-icon-style')||'chevron';function setIconState(icon,open){if(!icon)return;if(iconStyle==='plus'){icon.textContent=open?'−':'+';}else if(iconStyle==='arrow'){icon.style.transform=open?'rotate(90deg)':'';}else if(iconStyle==='chevron'){icon.style.transform=open?'rotate(180deg)':'';}}var headers=root.querySelectorAll('[data-acc-header]');headers.forEach(function(header){header.addEventListener('click',function(){var item=header.parentElement;var group=item.parentElement;var panel=item.children[1];var isOpen=header.getAttribute('data-acc-open')==='1';if(mode!=='multi'&&group){Array.prototype.forEach.call(group.children,function(sib){if(sib===item)return;var sh=sib.children[0];var sp=sib.children[1];if(sh){sh.setAttribute('data-acc-open','0');setIconState(sh.querySelector('[data-acc-icon]'),false);}if(sp)sp.style.gridTemplateRows='0fr';});}var next=!isOpen;header.setAttribute('data-acc-open',next?'1':'0');panel.style.gridTemplateRows=next?'1fr':'0fr';setIconState(header.querySelector('[data-acc-icon]'),next);});});})();<\/script>`}</div>`;
1304
+ })}</div>${`<script>(function(){var root=document.querySelector(${JSON.stringify(`[data-plexo-id="${h.id}"]`)});if(!root)return;var mode=root.getAttribute('data-acc-mode')||'single';var iconStyle=root.getAttribute('data-acc-icon-style')||'chevron';function setIconState(icon,open){if(!icon)return;if(iconStyle==='plus'){icon.textContent=open?'−':'+';}else if(iconStyle==='arrow'){icon.style.transform=open?'rotate(90deg)':'';}else if(iconStyle==='chevron'){icon.style.transform=open?'rotate(180deg)':'';}}var headers=root.querySelectorAll('[data-acc-header]');headers.forEach(function(header){header.addEventListener('click',function(){var item=header.parentElement;var group=item.parentElement;var panel=item.children[1];var isOpen=header.getAttribute('data-acc-open')==='1';if(mode!=='multi'&&group){Array.prototype.forEach.call(group.children,function(sib){if(sib===item)return;var sh=sib.children[0];var sp=sib.children[1];if(sh){sh.setAttribute('data-acc-open','0');setIconState(sh.querySelector('[data-acc-icon]'),false);}if(sp)sp.style.gridTemplateRows='0fr';});}var next=!isOpen;header.setAttribute('data-acc-open',next?'1':'0');panel.style.gridTemplateRows=next?'1fr':'0fr';setIconState(header.querySelector('[data-acc-icon]'),next);});});})();<\/script>`}</div>`;
1305
1305
  }
1306
- default: return te(t.type);
1306
+ default: return ne(h.type);
1307
1307
  }
1308
- }, Q = (e, n) => {
1308
+ }, Q = (e, t) => {
1309
1309
  if (!e || typeof e != "object") return "";
1310
- let r = z(e);
1311
- if (!r) return `\n <!-- ROW SKIPPED (type="${typeof e.type == "string" ? e.type : "unknown"}"${e.id ? `, id="${e.id}"` : ""}): this row has no 'columns' array and its shorthand content (e.g. a list of items/links) can't be auto-converted without losing data. Provide a fully hydrated row with 'columns' and 'elements' instead. -->`;
1312
- let i = B(r.style || {}), a = q("id", r.htmlId), o = q("class", r.htmlClass), s = r.id || `row-${Math.random().toString(36).substring(2, 9)}`;
1313
- U(n, s, r.style, "tablet", r.styleTablet), U(n, s, r.style, "mobile", r.styleMobile);
1314
- let c = `\n <!-- ROW START: ${r.id || "row"} -->`;
1315
- c += `\n <div data-plexo-id="${s}"${a}${o} class="plexo-row" style="display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; ${i}">`;
1316
- let l = Array.isArray(r.columns) ? r.columns : [];
1317
- for (let e of l) {
1310
+ let n = B(e);
1311
+ if (!n) return `\n <!-- ROW SKIPPED (type="${typeof e.type == "string" ? e.type : "unknown"}"${e.id ? `, id="${e.id}"` : ""}): this row has no 'columns' array and its shorthand content (e.g. a list of items/links) can't be auto-converted without losing data. Provide a fully hydrated row with 'columns' and 'elements' instead. -->`;
1312
+ let r = V(n.style || {}), i = J("id", n.htmlId), a = J("class", n.htmlClass), o = n.id || `row-${Math.random().toString(36).substring(2, 9)}`;
1313
+ W(t, o, n.style, "tablet", n.styleTablet), W(t, o, n.style, "mobile", n.styleMobile);
1314
+ let s = `\n <!-- ROW START: ${n.id || "row"} -->`;
1315
+ s += `\n <div data-plexo-id="${o}"${i}${a} class="plexo-row" style="display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; ${r}">`;
1316
+ let c = Array.isArray(n.columns) ? n.columns : [];
1317
+ for (let e of c) {
1318
1318
  if (!e) continue;
1319
- let r = e.styles || e.style || {}, i = B(r), a = r.gap || "16px", o = q("id", e.attrs?.htmlId), s = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", l = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
1320
- U(n, l, r, "tablet", e.stylesTablet), U(n, l, r, "mobile", e.stylesMobile), c += `\n <!-- COLUMN START: ${e.id || "col"} -->`, c += `\n <div data-plexo-id="${l}"${o} class="plexo-col${s}" style="box-sizing: border-box; padding-left: 8px; padding-right: 8px; width: ${e.width || "100%"}; --plexo-col-gap: ${a}; ${i}">`;
1321
- let u = Array.isArray(e.elements) ? e.elements : [], d = Array.isArray(e.nestedRows) ? e.nestedRows : [], f = new Map(u.map((e) => [e.id, e])), p = new Map(d.map((e) => [e.id, e]));
1322
- for (let r of t({
1319
+ let n = e.styles || e.style || {}, r = V(n), i = n.gap || "16px", a = J("id", e.attrs?.htmlId), o = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", c = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
1320
+ W(t, c, n, "tablet", e.stylesTablet), W(t, c, n, "mobile", e.stylesMobile), s += `\n <!-- COLUMN START: ${e.id || "col"} -->`, s += `\n <div data-plexo-id="${c}"${a} class="plexo-col${o}" style="box-sizing: border-box; padding-left: 8px; padding-right: 8px; width: ${e.width || "100%"}; --plexo-col-gap: ${i}; ${r}">`;
1321
+ let l = Array.isArray(e.elements) ? e.elements : [], u = Array.isArray(e.nestedRows) ? e.nestedRows : [], d = new Map(l.map((e) => [e.id, e])), f = new Map(u.map((e) => [e.id, e]));
1322
+ for (let n of h({
1323
1323
  ...e,
1324
- elements: u,
1325
- nestedRows: d
1324
+ elements: l,
1325
+ nestedRows: u
1326
1326
  })) {
1327
- let e = f.get(r);
1327
+ let e = d.get(n);
1328
1328
  if (e) {
1329
- let t = e.attributes || {}, r = typeof t.htmlClassNames == "string" ? t.htmlClassNames : typeof t.htmlClass == "string" ? t.htmlClass : typeof t.className == "string" ? t.className : "", i = q("id", t.htmlId), o = q("class", r), s = e.style?.display, l = s === "inline-block" || s === "inline" || s === "inline-flex" ? `margin-bottom: ${a}; display: ${s}; vertical-align: top;` : `margin-bottom: ${a};`;
1330
- U(n, e.id, e.style, "tablet", W(e, e.styleTablet)), U(n, e.id, e.style, "mobile", W(e, e.styleMobile)), c += `\n <div${i}${o} style="${l}">`, c += `\n ${ne(e)}`, c += "\n </div>";
1329
+ let n = e.attributes || {}, r = typeof n.htmlClassNames == "string" ? n.htmlClassNames : typeof n.htmlClass == "string" ? n.htmlClass : typeof n.className == "string" ? n.className : "", a = J("id", n.htmlId), o = J("class", r), c = e.style?.display, l = c === "inline-block" || c === "inline" || c === "inline-flex" ? `margin-bottom: ${i}; display: ${c}; vertical-align: top;` : `margin-bottom: ${i};`;
1330
+ W(t, e.id, e.style, "tablet", G(e, e.styleTablet)), W(t, e.id, e.style, "mobile", G(e, e.styleMobile)), s += `\n <div${a}${o} style="${l}">`, s += `\n ${re(e)}`, s += "\n </div>";
1331
1331
  continue;
1332
1332
  }
1333
- let t = p.get(r);
1334
- t && (c += Q(t, n));
1333
+ let r = f.get(n);
1334
+ r && (s += Q(r, t));
1335
1335
  }
1336
- c += "\n </div>";
1336
+ s += "\n </div>";
1337
1337
  }
1338
- return c += "\n </div>", c;
1338
+ return s += "\n </div>", s;
1339
1339
  }, $ = (e) => {
1340
1340
  if (!e || typeof e != "object") return "<!-- Empty template -->";
1341
1341
  let t = e.designJson || e.template || e, n = t.body || (Array.isArray(t.rows) ? {
@@ -1364,7 +1364,7 @@ var ne = (t) => {
1364
1364
  "favicon"
1365
1365
  ], a = {};
1366
1366
  for (let e of Object.keys(r)) i.includes(e) || (a[e] = r[e]);
1367
- let o = B(a), s = typeof r.htmlTitle == "string" && r.htmlTitle.trim() ? r.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", c = q("id", r.htmlId), l = q("class", r.htmlClass), u = typeof r.customCss == "string" && r.customCss.trim() ? r.customCss.trim() : "", d = typeof r.customJs == "string" && r.customJs.trim() ? r.customJs.trim() : "", f = typeof r.favicon == "string" && r.favicon.trim() ? r.favicon.trim() : "", p = Array.isArray(n.rows) ? n.rows : Array.isArray(t.rows) ? t.rows : Array.isArray(e.rows) ? e.rows : [], m = E(T(p, [r.fontFamily])), h = {
1367
+ let o = V(a), s = typeof r.htmlTitle == "string" && r.htmlTitle.trim() ? r.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", c = J("id", r.htmlId), l = J("class", r.htmlClass), u = typeof r.customCss == "string" && r.customCss.trim() ? r.customCss.trim() : "", d = typeof r.customJs == "string" && r.customJs.trim() ? r.customJs.trim() : "", f = typeof r.favicon == "string" && r.favicon.trim() ? r.favicon.trim() : "", p = Array.isArray(n.rows) ? n.rows : Array.isArray(t.rows) ? t.rows : Array.isArray(e.rows) ? e.rows : [], m = D(E(p, [r.fontFamily])), h = {
1368
1368
  tablet: [],
1369
1369
  mobile: []
1370
1370
  }, g = "";
@@ -1373,12 +1373,12 @@ var ne = (t) => {
1373
1373
  <html>
1374
1374
  <head>
1375
1375
  <meta charset="utf-8">
1376
- <title>${K(s)}</title>
1377
- ${f ? `<link rel="icon" href="${K(f)}">` : ""}
1376
+ <title>${q(s)}</title>
1377
+ ${f ? `<link rel="icon" href="${q(f)}">` : ""}
1378
1378
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
1379
1379
  ${m ? `<link rel="stylesheet" href="${m}">` : ""}
1380
1380
  <style>
1381
- body { margin: 0; font-family: ${R}; }
1381
+ body { margin: 0; font-family: ${z}; }
1382
1382
  .plexo-row {
1383
1383
  display: flex;
1384
1384
  flex-wrap: wrap;
@@ -1408,14 +1408,14 @@ ${d ? ` <script>\n${d}\n <\/script>` : ""}
1408
1408
  </body>
1409
1409
  </html>`, y = y.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), y;
1410
1410
  };
1411
- function re(e) {
1411
+ function ie(e) {
1412
1412
  return $(e).replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
1413
1413
  }
1414
- function ie(e) {
1414
+ function ae(e) {
1415
1415
  return $(e);
1416
1416
  }
1417
- function ae(e) {
1417
+ function oe(e) {
1418
1418
  return e;
1419
1419
  }
1420
1420
  //#endregion
1421
- export { C as _, ie as a, _ as b, G as c, L as d, E as f, x as g, v as h, $ as i, V as l, S as m, J as n, re as o, T as p, U as r, z as s, R as t, ae as u, y as v, g as x, b as y };
1421
+ export { w as _, ae as a, v as b, K as c, R as d, D as f, S as g, y as h, $ as i, H as l, C as m, Y as n, ie as o, E as p, W as r, B as s, z as t, oe as u, b as v, _ as x, x as y };