webim-adapter 0.2.0 → 0.3.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,61 +1,61 @@
1
- import { Fragment as e, createContext as t, useContext as n, useEffect as r, useRef as i, useState as a } from "react";
2
- import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
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
+ 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 l = /* @__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(".")), u = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, d = [
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 = [
5
5
  "borderWidth",
6
6
  "borderStyle",
7
7
  "borderColor",
8
8
  "borderRadius",
9
9
  "gap"
10
10
  ];
11
- function f(e) {
11
+ function p(e) {
12
12
  let t = {};
13
- for (let n of d) {
13
+ for (let n of f) {
14
14
  let r = e?.[n];
15
- r != null && r !== "" && (t[n] = l.has(n) ? u(r) : r);
15
+ r != null && r !== "" && (t[n] = u.has(n) ? d(r) : r);
16
16
  }
17
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || d.includes(n) || (t[n] = l.has(n) ? u(r) : r);
17
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || f.includes(n) || (t[n] = u.has(n) ? d(r) : r);
18
18
  let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
19
19
  delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
20
- let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: f, textShadowColor: p } = t;
20
+ let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: p } = t;
21
21
  delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
22
- let m = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${u(e.x ?? 0)} ${u(e.y ?? 0)} ${u(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
22
+ let m = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${d(e.x ?? 0)} ${d(e.y ?? 0)} ${d(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
23
23
  [
24
24
  s,
25
25
  c,
26
- f,
26
+ l,
27
27
  p
28
- ].some((e) => e !== void 0) && m.push(`${u(s ?? 0)} ${u(c ?? 0)} ${u(f ?? 0)} ${p || "rgba(0, 0, 0, 0.35)"}`), m.length && (t.textShadow = m.join(", "));
29
- let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${u(e.x ?? 0)}, ${u(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${h(e.a ?? 0)})` : e.type === "skew" ? `skew(${h(e.x ?? 0)}, ${h(e.y ?? 0)})` : null, { transforms: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY: ee } = t;
28
+ ].some((e) => e !== void 0) && m.push(`${d(s ?? 0)} ${d(c ?? 0)} ${d(l ?? 0)} ${p || "rgba(0, 0, 0, 0.35)"}`), m.length && (t.textShadow = m.join(", "));
29
+ let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${d(e.x ?? 0)}, ${d(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${h(e.a ?? 0)})` : e.type === "skew" ? `skew(${h(e.x ?? 0)}, ${h(e.y ?? 0)})` : null, { transforms: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY: C } = t;
30
30
  delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
31
- let C = (Array.isArray(_) ? _ : []).filter((e) => e && e.on !== !1).map(g).filter(Boolean);
32
- (v !== void 0 || y !== void 0) && C.push(`translate(${u(v ?? 0)}, ${u(y ?? 0)})`), b !== void 0 && C.push(`scale(${b})`), x !== void 0 && C.push(`rotate(${h(x)})`), (S !== void 0 || ee !== void 0) && C.push(`skew(${h(S ?? 0)}, ${h(ee ?? 0)})`), C.length && (t.transform = C.join(" "));
33
- let w = (e) => `${e.inset ? "inset " : ""}${u(e.x ?? 0)} ${u(e.y ?? 0)} ${u(e.blur ?? 0)} ${u(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: T, boxShadowX: E, boxShadowY: D, boxShadowBlur: O, boxShadowSpread: k, boxShadowColor: A, boxShadowInset: j } = t;
31
+ let w = (Array.isArray(_) ? _ : []).filter((e) => e && e.on !== !1).map(g).filter(Boolean);
32
+ (v !== void 0 || y !== void 0) && w.push(`translate(${d(v ?? 0)}, ${d(y ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), x !== void 0 && w.push(`rotate(${h(x)})`), (S !== void 0 || C !== void 0) && w.push(`skew(${h(S ?? 0)}, ${h(C ?? 0)})`), w.length && (t.transform = w.join(" "));
33
+ let T = (e) => `${e.inset ? "inset " : ""}${d(e.x ?? 0)} ${d(e.y ?? 0)} ${d(e.blur ?? 0)} ${d(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: E, boxShadowX: D, boxShadowY: O, boxShadowBlur: k, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
34
34
  delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
35
- let M = (Array.isArray(T) ? T : []).filter((e) => e && e.on !== !1).map(w);
35
+ let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
36
36
  [
37
- E,
38
37
  D,
39
38
  O,
40
39
  k,
41
40
  A,
42
- j
43
- ].some((e) => e !== void 0) && M.push(w({
44
- x: E,
45
- y: D,
46
- blur: O,
47
- spread: k,
48
- color: A,
49
- inset: j
50
- })), M.length && (t.boxShadow = M.join(", "));
51
- let te = (e) => e.type === "blur" ? `blur(${u(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, N = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(te), { filters: ne, backdropFilters: re, filterBlur: P, filterGrayscale: F, filterBrightness: I, filterContrast: L, filterSaturate: R } = t;
41
+ j,
42
+ M
43
+ ].some((e) => e !== void 0) && N.push(T({
44
+ x: D,
45
+ y: O,
46
+ blur: k,
47
+ spread: A,
48
+ color: j,
49
+ inset: M
50
+ })), N.length && (t.boxShadow = N.join(", "));
51
+ let ee = (e) => e.type === "blur" ? `blur(${d(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, P = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(ee), { filters: F, backdropFilters: te, filterBlur: I, filterGrayscale: L, filterBrightness: ne, filterContrast: re, filterSaturate: R } = t;
52
52
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
53
- let z = N(ne);
54
- P !== void 0 && z.push(`blur(${u(P)})`), F !== void 0 && z.push(`grayscale(${F}%)`), I !== void 0 && z.push(`brightness(${I}%)`), L !== void 0 && z.push(`contrast(${L}%)`), R !== void 0 && z.push(`saturate(${R}%)`), z.length && (t.filter = z.join(" "));
55
- let B = N(re);
53
+ let z = P(F);
54
+ I !== void 0 && z.push(`blur(${d(I)})`), L !== void 0 && z.push(`grayscale(${L}%)`), ne !== void 0 && z.push(`brightness(${ne}%)`), re !== void 0 && z.push(`contrast(${re}%)`), R !== void 0 && z.push(`saturate(${R}%)`), z.length && (t.filter = z.join(" "));
55
+ let B = P(te);
56
56
  B.length && (t.backdropFilter = B.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
57
  let { textStrokeWidth: V, textStrokeColor: H } = t;
58
- delete t.textStrokeWidth, delete t.textStrokeColor, (V !== void 0 || H !== void 0) && (t.WebkitTextStroke = `${u(V ?? 1)} ${H || "currentColor"}`);
58
+ delete t.textStrokeWidth, delete t.textStrokeColor, (V !== void 0 || H !== void 0) && (t.WebkitTextStroke = `${d(V ?? 1)} ${H || "currentColor"}`);
59
59
  let { clipText: ie } = t;
60
60
  delete t.clipText, ie && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
61
  let { transitions: U, transitionDuration: W, transitionEasing: G, transitionProperty: ae } = t, K = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
@@ -66,58 +66,58 @@ function f(e) {
66
66
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
67
67
  }
68
68
  delete t.backgroundVideo;
69
- let { overlayColor: J, overlayOpacity: Y } = t;
69
+ let { overlayColor: J, overlayOpacity: oe } = t;
70
70
  if (delete t.overlayColor, delete t.overlayOpacity, J) {
71
- let e = `color-mix(in srgb, ${J} ${Y ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
71
+ let e = `color-mix(in srgb, ${J} ${oe ?? 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: oe } = t;
75
+ let { backgroundLayers: se } = t;
76
76
  delete t.backgroundLayers;
77
- let X = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1);
78
- if (X.length) {
77
+ let Y = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1);
78
+ if (Y.length) {
79
79
  let e = [], n = [], r = [], i = [], a = [];
80
- for (let t of X) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
80
+ for (let t of 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");
81
81
  else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
82
82
  else {
83
83
  if (!t.src) continue;
84
- e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${u(t.w ?? "auto")} ${u(t.h ?? "auto")}` : t.size || "cover"), r.push(`${u(t.posX ?? 0)} ${u(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
84
+ e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${d(t.w ?? "auto")} ${d(t.h ?? "auto")}` : t.size || "cover"), r.push(`${d(t.posX ?? 0)} ${d(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
85
85
  }
86
86
  e.length && (t.backgroundImage && (e.push(t.backgroundImage), n.push(t.backgroundSize || "cover"), r.push(t.backgroundPosition || "center"), i.push(t.backgroundRepeat || "no-repeat"), a.push("scroll")), t.backgroundImage = e.join(", "), t.backgroundSize = n.join(", "), t.backgroundPosition = r.join(", "), t.backgroundRepeat = i.join(", "), t.backgroundAttachment = a.join(", "));
87
87
  }
88
88
  return t;
89
89
  }
90
- var p = {
90
+ var m = {
91
91
  hover: ":hover",
92
92
  pressed: ":active",
93
93
  focused: ":focus"
94
- }, m = /* @__PURE__ */ new Set([
94
+ }, h = /* @__PURE__ */ new Set([
95
95
  "style",
96
96
  "class",
97
97
  "id",
98
98
  "data-wb",
99
99
  "data-wb-class",
100
100
  "data-slot"
101
- ]), h = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !m.has(e.toLowerCase());
102
- function g(e, t, n = []) {
101
+ ]), g = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !h.has(e.toLowerCase());
102
+ function _(e, t, n = []) {
103
103
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
104
104
  for (let t of n) e.removeAttribute(t);
105
105
  let r = [];
106
106
  for (let n of t.attributes ?? []) {
107
107
  let t = String(n?.name ?? "").trim();
108
- h(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
108
+ g(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
109
109
  }
110
110
  return r;
111
111
  }
112
- var _ = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
113
- function v(e, t, n, r = !1) {
114
- let i = Object.entries(f(t)).map(([e, t]) => `${_(e)}: ${t} !important;`).join(" ");
112
+ var v = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
113
+ function y(e, t, n, r = !1) {
114
+ let i = Object.entries(p(t)).map(([e, t]) => `${v(e)}: ${t} !important;`).join(" ");
115
115
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
116
116
  }
117
- function y(e, t, n) {
118
- return Object.entries(p).map(([r, i]) => v(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
117
+ function b(e, t, n) {
118
+ return Object.entries(m).map(([r, i]) => y(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
119
119
  }
120
- var b = [
120
+ var x = [
121
121
  {
122
122
  key: "tablet",
123
123
  max: 991
@@ -130,17 +130,17 @@ var b = [
130
130
  key: "mobile",
131
131
  max: 478
132
132
  }
133
- ], x = (e) => Object.entries(f(e)).map(([e, t]) => `${_(e)}: ${t} !important;`).join(" ");
134
- function S(e, t) {
135
- return b.map(({ key: n, max: r }) => {
136
- let i = t?.[n] ? x(t[n]) : "";
133
+ ], S = (e) => Object.entries(p(e)).map(([e, t]) => `${v(e)}: ${t} !important;`).join(" ");
134
+ function C(e, t) {
135
+ return x.map(({ key: n, max: r }) => {
136
+ let i = t?.[n] ? S(t[n]) : "";
137
137
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
138
138
  }).filter(Boolean).join("\n");
139
139
  }
140
- function ee(e, t) {
140
+ function w(e, t) {
141
141
  let n = [], r = (e) => {
142
142
  for (let [t, r] of Object.entries(e || {})) {
143
- let e = S(t, r.props);
143
+ let e = C(t, r.props);
144
144
  e && n.push(e);
145
145
  }
146
146
  };
@@ -148,10 +148,10 @@ function ee(e, t) {
148
148
  for (let e of Object.values(t || {})) r(e.template?.nodes);
149
149
  return n.join("\n");
150
150
  }
151
- function C(e, t) {
151
+ function T(e, t) {
152
152
  let n = [], r = (e) => {
153
153
  for (let [t, r] of Object.entries(e || {})) {
154
- let e = y(t, r.props);
154
+ let e = b(t, r.props);
155
155
  e && n.push(e);
156
156
  }
157
157
  };
@@ -159,7 +159,7 @@ function C(e, t) {
159
159
  for (let e of Object.values(t || {})) r(e.template?.nodes);
160
160
  return n.join("\n");
161
161
  }
162
- var w = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", T = {
162
+ var E = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", D = {
163
163
  light: {
164
164
  background: "#ffffff",
165
165
  text: "#111827",
@@ -196,23 +196,23 @@ var w = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
196
196
  contrastText: "#052e2b"
197
197
  }
198
198
  }
199
- }, E = {
199
+ }, O = {
200
200
  font: "system",
201
201
  headingFont: "inherit",
202
- light: T.light,
203
- dark: T.dark
204
- }, D = {
202
+ light: D.light,
203
+ dark: D.dark
204
+ }, k = {
205
205
  system: {
206
206
  label: "System",
207
- value: w
207
+ value: E
208
208
  },
209
209
  inter: {
210
210
  label: "Inter",
211
- value: `"Inter", ${w}`
211
+ value: `"Inter", ${E}`
212
212
  },
213
213
  outfit: {
214
214
  label: "Outfit",
215
- value: `"Outfit", ${w}`
215
+ value: `"Outfit", ${E}`
216
216
  },
217
217
  serif: {
218
218
  label: "Serif",
@@ -222,7 +222,7 @@ var w = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
222
222
  label: "Mono",
223
223
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
224
224
  }
225
- }, O = (e, t) => D[e]?.value ?? t, k = (e, ...t) => {
225
+ }, A = (e, t) => k[e]?.value ?? t, j = (e, ...t) => {
226
226
  let n = Object.assign({}, e, ...t);
227
227
  return n.primary = {
228
228
  ...e.primary,
@@ -238,16 +238,16 @@ var w = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
238
238
  }), {})
239
239
  }, n;
240
240
  };
241
- function A(e) {
241
+ function M(e) {
242
242
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
243
243
  return {
244
- font: r ?? E.font,
245
- headingFont: i ?? E.headingFont,
246
- light: k(T.light, a, t),
247
- dark: k(T.dark, n)
244
+ font: r ?? O.font,
245
+ headingFont: i ?? O.headingFont,
246
+ light: j(D.light, a, t),
247
+ dark: j(D.dark, n)
248
248
  };
249
249
  }
250
- function j(e) {
250
+ function N(e) {
251
251
  return {
252
252
  "--page-bg": e.background,
253
253
  "--page-text": e.text,
@@ -263,28 +263,28 @@ function j(e) {
263
263
  "--page-secondary-contrast": e.secondary.contrastText
264
264
  };
265
265
  }
266
- function M(e) {
267
- let t = A(e);
266
+ function ee(e) {
267
+ let t = M(e);
268
268
  return {
269
269
  backgroundColor: "var(--page-bg)",
270
270
  color: "var(--page-text)",
271
- fontFamily: O(t.font, w),
272
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : O(t.headingFont, "inherit")
271
+ fontFamily: A(t.font, E),
272
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : A(t.headingFont, "inherit")
273
273
  };
274
274
  }
275
- function te(e, t = "light") {
276
- let n = A(e);
275
+ function P(e, t = "light") {
276
+ let n = M(e);
277
277
  return {
278
- ...M(e),
279
- ...j(n[t] ?? n.light)
278
+ ...ee(e),
279
+ ...N(n[t] ?? n.light)
280
280
  };
281
281
  }
282
- function N(e, t) {
282
+ function F(e, t) {
283
283
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
284
284
  }
285
285
  //#endregion
286
286
  //#region src/bundle.js
287
- function ne({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
287
+ function te({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
288
288
  let a = {
289
289
  ...t?.global ?? {},
290
290
  ...t?.tenant ?? {}
@@ -294,7 +294,7 @@ function ne({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
294
294
  title: e.title,
295
295
  slug: e.slug,
296
296
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
297
- theme: N(o, a.builder_themes?.themes),
297
+ theme: F(o, a.builder_themes?.themes),
298
298
  components: a.builder_components?.components ?? {},
299
299
  custom: o.custom,
300
300
  seo: o.seo,
@@ -305,22 +305,26 @@ function ne({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
305
305
  }
306
306
  //#endregion
307
307
  //#region src/fetchPage.js
308
- var re = async (e) => {
308
+ var I = async (e) => {
309
309
  let t = await e.json().catch(() => null);
310
310
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
311
311
  return t?.payload ?? t;
312
312
  };
313
- async function P({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
313
+ async function L({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
314
314
  if (!e) throw Error("fetchPage: apiUrl is required");
315
315
  if (!n) throw Error("fetchPage: slug is required");
316
- let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(re), o(`${s}/settings/public`, { headers: c }).then(re)]);
317
- return ne({
316
+ let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(I), o(`${s}/settings/public`, { headers: c }).then(I)]), d = te({
318
317
  page: l,
319
318
  settings: u,
320
319
  tenant: t,
321
320
  apiUrl: s,
322
321
  locale: r
323
- });
322
+ }), f = [...new Set(Object.values(d.blocks ?? {}).filter((e) => e?.type?.resolvedName === "CollectionList" && e.props?.collection).map((e) => e.props.collection))];
323
+ if (f.length) {
324
+ let e = (e) => e.startsWith("api:") ? `${s}/data/${encodeURIComponent(e.slice(4))}` : `${s}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(f.map((t) => o(e(t), { headers: c }).then(I).then((e) => [t, Array.isArray(e) ? e : []]).catch(() => [t, []])));
325
+ d.datasets = Object.fromEntries(t);
326
+ }
327
+ return d;
324
328
  }
325
329
  new Map([
326
330
  {
@@ -428,14 +432,14 @@ new Map([
428
432
  fallback: "sans-serif"
429
433
  }
430
434
  ].map((e) => [e.family, e]));
431
- function F(e) {
435
+ function ne(e) {
432
436
  return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
433
437
  }
434
- var I = (e) => F([e]), L = (e) => {
438
+ var re = (e) => ne([e]), R = (e) => {
435
439
  let t = typeof e == "string" && e.match(/^"([^"]+)"/);
436
440
  return t ? t[1] : null;
437
441
  };
438
- function R(e, t) {
442
+ function z(e, t) {
439
443
  let n = /* @__PURE__ */ new Set(), r = (e) => {
440
444
  for (let t of Object.values(e || {})) for (let e of [
441
445
  "style",
@@ -443,7 +447,7 @@ function R(e, t) {
443
447
  "pressed",
444
448
  "focused"
445
449
  ]) {
446
- let r = L(t.props?.[e]?.fontFamily);
450
+ let r = R(t.props?.[e]?.fontFamily);
447
451
  r && n.add(r);
448
452
  }
449
453
  };
@@ -453,30 +457,53 @@ function R(e, t) {
453
457
  }
454
458
  //#endregion
455
459
  //#region ../ui/src/components/builder/views.jsx
456
- var z = t({
460
+ var B = t({
457
461
  tenant: "",
458
462
  apiUrl: "/api"
459
- }), B = {
463
+ }), V = t(null), H = t(null), ie = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
464
+ function U(e, t) {
465
+ if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
466
+ }
467
+ var W = (e) => {
468
+ let t = [];
469
+ for (let [n, r] of Object.entries(e ?? {})) {
470
+ if (!/^[\w-]+$/.test(n)) continue;
471
+ t.push(n);
472
+ let e = Array.isArray(r) ? r[0] : r, i = Array.isArray(r) ? `${n}.0` : n;
473
+ if (e && typeof e == "object" && !Array.isArray(e)) for (let n of Object.keys(e)) /^[\w-]+$/.test(n) && t.push(`${i}.${n}`);
474
+ }
475
+ return t;
476
+ };
477
+ function G(e) {
478
+ 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
+ }
480
+ function ae(e, t) {
481
+ let n = t?.data ?? {}, r = W(n);
482
+ if (!r.length) return e;
483
+ let i = RegExp(`:(${r.map(ie).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => G(U(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
484
+ return a(e);
485
+ }
486
+ var K = {
460
487
  margin: 0,
461
488
  fontWeight: 700,
462
489
  lineHeight: 1.2,
463
490
  fontFamily: "var(--page-heading-font, inherit)"
464
- }, V = { margin: 0 }, H = {
491
+ }, q = { margin: 0 }, J = {
465
492
  display: "inline-block",
466
493
  textDecoration: "none",
467
494
  cursor: "pointer",
468
495
  backgroundColor: "var(--page-accent, #111827)",
469
496
  color: "var(--page-accent-text, #ffffff)"
470
- }, ie = {
497
+ }, oe = {
471
498
  flexGrow: 1,
472
499
  display: "flex",
473
500
  flexDirection: "column",
474
501
  position: "relative"
475
- }, U = {
502
+ }, se = {
476
503
  display: "flex",
477
504
  flexDirection: "column"
478
505
  };
479
- function W({ style: e }) {
506
+ function Y({ style: e }) {
480
507
  let t = e?.backgroundVideo;
481
508
  if (!t) return null;
482
509
  let n = {
@@ -487,7 +514,7 @@ function W({ style: e }) {
487
514
  zIndex: -1,
488
515
  pointerEvents: "none"
489
516
  }, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
490
- return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("video", {
517
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("video", {
491
518
  src: t,
492
519
  autoPlay: !0,
493
520
  muted: !0,
@@ -497,73 +524,73 @@ function W({ style: e }) {
497
524
  ...n,
498
525
  objectFit: "cover"
499
526
  }
500
- }), r && /* @__PURE__ */ s("div", { style: {
527
+ }), r && /* @__PURE__ */ c("div", { style: {
501
528
  ...n,
502
529
  background: r
503
530
  } })] });
504
531
  }
505
- var G = (e, t) => e?.backgroundVideo ? {
532
+ var ce = (e, t) => e?.backgroundVideo ? {
506
533
  position: "relative",
507
534
  ...t,
508
- ...f(e)
535
+ ...p(e)
509
536
  } : {
510
537
  ...t,
511
- ...f(e)
538
+ ...p(e)
512
539
  };
513
- function ae({ style: e, nodeRef: t, children: n }) {
514
- return /* @__PURE__ */ c("div", {
540
+ function le({ style: e, nodeRef: t, children: n }) {
541
+ return /* @__PURE__ */ l("div", {
515
542
  ref: t,
516
543
  style: {
517
- ...ie,
518
- ...f(e)
544
+ ...oe,
545
+ ...p(e)
519
546
  },
520
- children: [/* @__PURE__ */ s(W, { style: e }), n]
547
+ children: [/* @__PURE__ */ c(Y, { style: e }), n]
521
548
  });
522
549
  }
523
- function K({ style: e, nodeRef: t, children: n }) {
524
- return /* @__PURE__ */ c("section", {
550
+ function ue({ style: e, nodeRef: t, children: n }) {
551
+ return /* @__PURE__ */ l("section", {
525
552
  ref: t,
526
- style: G(e, U),
527
- children: [/* @__PURE__ */ s(W, { style: e }), n]
553
+ style: ce(e, se),
554
+ children: [/* @__PURE__ */ c(Y, { style: e }), n]
528
555
  });
529
556
  }
530
- function q({ style: e, freeLayout: t, nodeRef: n, children: r }) {
557
+ function de({ style: e, freeLayout: t, nodeRef: n, children: r }) {
531
558
  let i = t ? {
532
559
  position: "relative",
533
560
  minHeight: 240
534
561
  } : null;
535
- return /* @__PURE__ */ c("div", {
562
+ return /* @__PURE__ */ l("div", {
536
563
  ref: n,
537
564
  style: i ? {
538
565
  ...i,
539
- ...G(e)
540
- } : G(e),
541
- children: [/* @__PURE__ */ s(W, { style: e }), r]
566
+ ...ce(e)
567
+ } : ce(e),
568
+ children: [/* @__PURE__ */ c(Y, { style: e }), r]
542
569
  });
543
570
  }
544
- function J({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
545
- return /* @__PURE__ */ s(n, {
571
+ function fe({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
572
+ return /* @__PURE__ */ c(n, {
546
573
  ref: a,
547
574
  style: {
548
- ...B,
549
- ...f(r)
575
+ ...K,
576
+ ...p(r)
550
577
  },
551
578
  children: X(t, e, i)
552
579
  });
553
580
  }
554
- var Y = {
555
- fontFamily: D.mono.value,
581
+ var pe = {
582
+ fontFamily: k.mono.value,
556
583
  background: "rgba(148, 163, 184, 0.18)",
557
584
  padding: "1px 5px",
558
585
  borderRadius: 4,
559
586
  fontSize: "0.9em"
560
587
  };
561
- function oe(e, t = [], n) {
588
+ function me(e, t = [], n) {
562
589
  let r = e;
563
- return t.includes("sup") ? r = /* @__PURE__ */ s("sup", { children: r }) : t.includes("sub") && (r = /* @__PURE__ */ s("sub", { children: r })), t.includes("code") && (r = /* @__PURE__ */ s("code", {
564
- style: Y,
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,
565
592
  children: r
566
- })), t.includes("strike") && (r = /* @__PURE__ */ s("s", { children: r })), t.includes("underline") && (r = /* @__PURE__ */ s("u", { children: r })), t.includes("italic") && (r = /* @__PURE__ */ s("em", { children: r })), t.includes("bold") && (r = /* @__PURE__ */ s("strong", { children: r })), n && (r = /* @__PURE__ */ s("a", {
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", {
567
594
  href: n,
568
595
  style: { color: "inherit" },
569
596
  children: r
@@ -571,26 +598,26 @@ function oe(e, t = [], n) {
571
598
  }
572
599
  function X(t, n, r) {
573
600
  return t?.length ? t.map((t, n) => {
574
- if (t.slot) return /* @__PURE__ */ s(e, { children: r?.[t.slot] ?? null }, n);
575
- if (t.parts) return /* @__PURE__ */ s(e, { children: X(t.parts, "", r) }, n);
601
+ if (t.slot) return /* @__PURE__ */ c(e, { children: r?.[t.slot] ?? null }, n);
602
+ if (t.parts) return /* @__PURE__ */ c(e, { children: X(t.parts, "", r) }, n);
576
603
  let i = t.text;
577
- return t.sup ? i = /* @__PURE__ */ s("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ s("sub", { children: i })), t.code && (i = /* @__PURE__ */ s("code", {
578
- style: Y,
604
+ 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,
579
606
  children: i
580
- })), t.strike && (i = /* @__PURE__ */ s("s", { children: i })), t.underline && (i = /* @__PURE__ */ s("u", { children: i })), t.italic && (i = /* @__PURE__ */ s("em", { children: i })), t.bold && (i = /* @__PURE__ */ s("strong", { children: i })), t.href && (i = /* @__PURE__ */ s("a", {
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", {
581
608
  href: t.href,
582
609
  style: { color: "inherit" },
583
610
  children: i
584
- })), /* @__PURE__ */ s(e, { children: i }, n);
611
+ })), /* @__PURE__ */ c(e, { children: i }, n);
585
612
  }) : n;
586
613
  }
587
- function se({ parts: e, text: t, marks: n, href: r, style: i }) {
588
- return /* @__PURE__ */ s("span", {
589
- style: f(i),
590
- children: e?.length ? X(e, t) : oe(t, n, r)
614
+ function he({ parts: e, text: t, marks: n, href: r, style: i }) {
615
+ return /* @__PURE__ */ c("span", {
616
+ style: p(i),
617
+ children: e?.length ? X(e, t) : me(t, n, r)
591
618
  });
592
619
  }
593
- var ce = {
620
+ var ge = {
594
621
  h1: 40,
595
622
  h2: 32,
596
623
  h3: 26,
@@ -598,7 +625,7 @@ var ce = {
598
625
  h5: 19,
599
626
  h6: 16
600
627
  };
601
- function le({ align: e = "center", width: t } = {}) {
628
+ function _e({ align: e = "center", width: t } = {}) {
602
629
  let n = t ? `${t}%` : void 0;
603
630
  return e === "full" ? { width: "100%" } : e === "left" ? {
604
631
  float: "left",
@@ -621,7 +648,7 @@ function le({ align: e = "center", width: t } = {}) {
621
648
  marginRight: "auto"
622
649
  };
623
650
  }
624
- function ue(e = [], t, n) {
651
+ function ve(e = [], t, n) {
625
652
  let r = n ?? ((e, n) => X(e, n, t));
626
653
  return e.map((t, n) => {
627
654
  let i = {
@@ -630,7 +657,7 @@ function ue(e = [], t, n) {
630
657
  };
631
658
  if (t.type === "image") {
632
659
  if (!t.src) return null;
633
- let e = /* @__PURE__ */ s("img", {
660
+ let e = /* @__PURE__ */ c("img", {
634
661
  src: t.src,
635
662
  alt: t.alt || "",
636
663
  style: {
@@ -639,18 +666,18 @@ function ue(e = [], t, n) {
639
666
  borderRadius: 6
640
667
  }
641
668
  });
642
- return /* @__PURE__ */ c("figure", {
669
+ return /* @__PURE__ */ l("figure", {
643
670
  style: {
644
671
  marginLeft: 0,
645
672
  marginRight: 0,
646
673
  ...i,
647
- ...le(t)
674
+ ..._e(t)
648
675
  },
649
- children: [t.href ? /* @__PURE__ */ s("a", {
676
+ children: [t.href ? /* @__PURE__ */ c("a", {
650
677
  href: t.href,
651
678
  style: { display: "block" },
652
679
  children: e
653
- }) : e, t.caption && /* @__PURE__ */ s("figcaption", {
680
+ }) : e, t.caption && /* @__PURE__ */ c("figcaption", {
654
681
  style: {
655
682
  fontSize: 13,
656
683
  opacity: .65,
@@ -661,15 +688,15 @@ function ue(e = [], t, n) {
661
688
  })]
662
689
  }, n);
663
690
  }
664
- if (t.type === "video") return xe(t.url) ? /* @__PURE__ */ s("div", {
691
+ if (t.type === "video") return ke(t.url) ? /* @__PURE__ */ c("div", {
665
692
  style: {
666
693
  ...i,
667
- ...le({
694
+ ..._e({
668
695
  align: t.align,
669
696
  width: t.width ?? 100
670
697
  })
671
698
  },
672
- children: /* @__PURE__ */ s(Se, {
699
+ children: /* @__PURE__ */ c(Ae, {
673
700
  url: t.url,
674
701
  autoplay: t.autoplay,
675
702
  muted: t.muted,
@@ -678,147 +705,147 @@ function ue(e = [], t, n) {
678
705
  start: t.start
679
706
  })
680
707
  }, n) : null;
681
- if (t.type === "divider") return /* @__PURE__ */ s("hr", { style: {
708
+ if (t.type === "divider") return /* @__PURE__ */ c("hr", { style: {
682
709
  ...i,
683
710
  border: 0,
684
711
  borderTop: "1px solid rgba(148, 163, 184, 0.4)"
685
712
  } }, n);
686
713
  if (t.type === "ul" || t.type === "ol") {
687
714
  let e = t.type;
688
- return /* @__PURE__ */ s(e, {
715
+ return /* @__PURE__ */ c(e, {
689
716
  style: {
690
717
  ...i,
691
718
  paddingLeft: 24
692
719
  },
693
- children: (t.items ?? []).map((e, t) => /* @__PURE__ */ s("li", {
720
+ children: (t.items ?? []).map((e, t) => /* @__PURE__ */ c("li", {
694
721
  style: { marginBottom: 4 },
695
722
  children: r(e.parts, e.text)
696
723
  }, t))
697
724
  }, n);
698
725
  }
699
- if (t.type === "quote") return /* @__PURE__ */ s("blockquote", {
726
+ if (t.type === "quote") return /* @__PURE__ */ c("blockquote", {
700
727
  style: {
701
- ...fe,
728
+ ...be,
702
729
  ...i
703
730
  },
704
731
  children: r(t.parts, t.text)
705
732
  }, n);
706
- if (ce[t.type]) {
733
+ if (ge[t.type]) {
707
734
  let e = t.type;
708
- return /* @__PURE__ */ s(e, {
735
+ return /* @__PURE__ */ c(e, {
709
736
  style: {
710
- ...B,
711
- fontSize: ce[t.type],
737
+ ...K,
738
+ fontSize: ge[t.type],
712
739
  ...i
713
740
  },
714
741
  children: r(t.parts, t.text)
715
742
  }, n);
716
743
  }
717
- return /* @__PURE__ */ s("p", {
744
+ return /* @__PURE__ */ c("p", {
718
745
  style: {
719
- ...V,
746
+ ...q,
720
747
  ...i
721
748
  },
722
749
  children: r(t.parts, t.text)
723
750
  }, n);
724
751
  });
725
752
  }
726
- function de({ content: e, style: t, linked: n, nodeRef: r }) {
727
- return /* @__PURE__ */ s("div", {
753
+ function ye({ content: e, style: t, linked: n, nodeRef: r }) {
754
+ return /* @__PURE__ */ c("div", {
728
755
  ref: r,
729
756
  style: {
730
757
  display: "flow-root",
731
- ...f(t)
758
+ ...p(t)
732
759
  },
733
- children: ue(e, n)
760
+ children: ve(e, n)
734
761
  });
735
762
  }
736
- var fe = {
763
+ var be = {
737
764
  margin: 0,
738
765
  padding: "8px 0 8px 20px",
739
766
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
740
767
  };
741
- function pe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
742
- return /* @__PURE__ */ s("blockquote", {
768
+ function xe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
769
+ return /* @__PURE__ */ c("blockquote", {
743
770
  ref: i,
744
771
  style: {
745
- ...fe,
746
- ...f(n)
772
+ ...be,
773
+ ...p(n)
747
774
  },
748
775
  children: X(t, e, r)
749
776
  });
750
777
  }
751
- function me({ ordered: e, items: t = [], style: n, nodeRef: r }) {
752
- return /* @__PURE__ */ s(e ? "ol" : "ul", {
778
+ function Se({ ordered: e, items: t = [], style: n, nodeRef: r }) {
779
+ return /* @__PURE__ */ c(e ? "ol" : "ul", {
753
780
  ref: r,
754
781
  style: {
755
782
  margin: 0,
756
783
  paddingLeft: 24,
757
- ...f(n)
784
+ ...p(n)
758
785
  },
759
- children: t.map((e, t) => /* @__PURE__ */ s("li", {
786
+ children: t.map((e, t) => /* @__PURE__ */ c("li", {
760
787
  style: { marginBottom: 4 },
761
788
  children: X(e.parts, e.text)
762
789
  }, t))
763
790
  });
764
791
  }
765
- function he({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
766
- return /* @__PURE__ */ s("p", {
792
+ function Ce({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
793
+ return /* @__PURE__ */ c("p", {
767
794
  ref: i,
768
795
  style: {
769
- ...V,
770
- ...f(n)
796
+ ...q,
797
+ ...p(n)
771
798
  },
772
799
  children: X(t, e, r)
773
800
  });
774
801
  }
775
- var ge = {
802
+ var we = {
776
803
  color: "var(--page-accent, inherit)",
777
804
  textDecoration: "underline",
778
805
  textUnderlineOffset: 3,
779
806
  cursor: "pointer"
780
807
  };
781
- function _e({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
782
- return /* @__PURE__ */ s("a", {
808
+ function Te({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
809
+ return /* @__PURE__ */ c("a", {
783
810
  ref: o,
784
811
  href: n || "#",
785
812
  target: r || void 0,
786
813
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
787
814
  style: {
788
- ...ge,
789
- ...f(i)
815
+ ...we,
816
+ ...p(i)
790
817
  },
791
818
  children: X(t, e, a)
792
819
  });
793
820
  }
794
- function ve({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
795
- return /* @__PURE__ */ s("a", {
821
+ function Ee({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
822
+ return /* @__PURE__ */ c("a", {
796
823
  ref: o,
797
824
  href: n || "#",
798
825
  target: r || void 0,
799
826
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
800
827
  style: {
801
- ...H,
802
- ...f(i)
828
+ ...J,
829
+ ...p(i)
803
830
  },
804
831
  children: X(t, e, a)
805
832
  });
806
833
  }
807
- function ye({ src: e, alt: t, style: n, nodeRef: r }) {
808
- return e ? /* @__PURE__ */ s("img", {
834
+ function De({ src: e, alt: t, style: n, nodeRef: r }) {
835
+ return e ? /* @__PURE__ */ c("img", {
809
836
  ref: r,
810
837
  src: e,
811
838
  alt: t || "",
812
839
  style: {
813
840
  display: "block",
814
841
  maxWidth: "100%",
815
- ...f(n)
842
+ ...p(n)
816
843
  }
817
844
  }) : null;
818
845
  }
819
- function be({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: c }) {
820
- return e ? /* @__PURE__ */ s("video", {
821
- ref: c,
846
+ function Oe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
847
+ return e ? /* @__PURE__ */ c("video", {
848
+ ref: s,
822
849
  src: e,
823
850
  poster: t || void 0,
824
851
  controls: n,
@@ -830,24 +857,24 @@ function be({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
830
857
  display: "block",
831
858
  width: "100%",
832
859
  maxWidth: "100%",
833
- ...f(o)
860
+ ...p(o)
834
861
  }
835
862
  }) : null;
836
863
  }
837
- var xe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
838
- function Se({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: c }) {
839
- let l = xe(e);
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);
840
867
  if (!l) return null;
841
868
  let u = new URLSearchParams({ rel: "0" });
842
- 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__ */ s("div", {
843
- ref: c,
869
+ 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", {
870
+ ref: s,
844
871
  style: {
845
872
  position: "relative",
846
873
  width: "100%",
847
874
  paddingTop: "56.25%",
848
- ...f(o)
875
+ ...p(o)
849
876
  },
850
- children: /* @__PURE__ */ s("iframe", {
877
+ children: /* @__PURE__ */ c("iframe", {
851
878
  src: `https://www.youtube-nocookie.com/embed/${l}?${u}`,
852
879
  title: "YouTube video",
853
880
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
@@ -862,8 +889,8 @@ function Se({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
862
889
  })
863
890
  });
864
891
  }
865
- function Ce({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
866
- return e ? /* @__PURE__ */ s("iframe", {
892
+ function je({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
893
+ return e ? /* @__PURE__ */ c("iframe", {
867
894
  ref: i,
868
895
  src: e,
869
896
  title: t || "Embedded frame",
@@ -874,31 +901,31 @@ function Ce({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
874
901
  width: "100%",
875
902
  height: 300,
876
903
  border: 0,
877
- ...f(r)
904
+ ...p(r)
878
905
  }
879
906
  }) : null;
880
907
  }
881
- function we({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
882
- let [o, c] = a(null);
908
+ function Me({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
909
+ let [a, s] = o(null);
883
910
  return r(() => {
884
- o && (o.innerHTML = e || "", t && o.querySelectorAll("script").forEach((e) => {
911
+ a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
885
912
  let t = document.createElement("script");
886
913
  for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
887
914
  t.text = e.textContent, e.replaceWith(t);
888
915
  }));
889
916
  }, [
890
- o,
917
+ a,
891
918
  e,
892
919
  t
893
- ]), /* @__PURE__ */ s("div", {
920
+ ]), /* @__PURE__ */ c("div", {
894
921
  ref: (e) => {
895
- c(e), i && i(e);
922
+ s(e), i && i(e);
896
923
  },
897
- style: f(n)
924
+ style: p(n)
898
925
  });
899
926
  }
900
- function Te({ height: e, nodeRef: t }) {
901
- return /* @__PURE__ */ s("div", {
927
+ function Ne({ height: e, nodeRef: t }) {
928
+ return /* @__PURE__ */ c("div", {
902
929
  ref: t,
903
930
  style: {
904
931
  height: e || 32,
@@ -907,18 +934,18 @@ function Te({ height: e, nodeRef: t }) {
907
934
  }
908
935
  });
909
936
  }
910
- function Ee({ style: e, nodeRef: t }) {
911
- return /* @__PURE__ */ s("div", {
937
+ function Pe({ style: e, nodeRef: t }) {
938
+ return /* @__PURE__ */ c("div", {
912
939
  ref: t,
913
940
  style: {
914
941
  height: 1,
915
942
  alignSelf: "stretch",
916
943
  flexShrink: 0,
917
- ...f(e)
944
+ ...p(e)
918
945
  }
919
946
  });
920
947
  }
921
- var De = {
948
+ var Fe = {
922
949
  position: "absolute",
923
950
  top: "50%",
924
951
  transform: "translateY(-50%)",
@@ -935,7 +962,7 @@ var De = {
935
962
  alignItems: "center",
936
963
  justifyContent: "center",
937
964
  padding: 0
938
- }, Oe = {
965
+ }, Ie = {
939
966
  bottom: {
940
967
  inset: "auto 0 0 0",
941
968
  padding: "40px 24px 20px",
@@ -954,9 +981,9 @@ var De = {
954
981
  padding: 24,
955
982
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
956
983
  }
957
- }, ke = 48;
958
- function Ae({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, height: l = 320, swipe: u = !0, style: d, nodeRef: p }) {
959
- let [m, h] = a(0), [g, _] = a(!1), [v, y] = a(null), b = e ? Math.min(m, e - 1) : 0;
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 }) {
986
+ let [m, h] = o(0), [g, _] = o(!1), [v, y] = o(null), b = e ? Math.min(m, e - 1) : 0;
960
987
  if (r(() => {
961
988
  if (!n || g || v || e < 2) return;
962
989
  let t = setInterval(() => h((t) => (t + 1) % e), Math.max(2, Number(i) || 5) * 1e3);
@@ -971,10 +998,10 @@ function Ae({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
971
998
  let x = (t) => h((t + e) % e), S = () => {
972
999
  if (!v) return;
973
1000
  let { dx: e } = v;
974
- y(null), e < -48 ? x(b + 1) : e > ke && x(b - 1);
1001
+ y(null), e < -48 ? x(b + 1) : e > Le && x(b - 1);
975
1002
  };
976
- return /* @__PURE__ */ c("div", {
977
- ref: p,
1003
+ return /* @__PURE__ */ l("div", {
1004
+ ref: f,
978
1005
  onMouseEnter: () => _(!0),
979
1006
  onMouseLeave: () => _(!1),
980
1007
  onPointerDown: u && e > 1 ? (e) => {
@@ -996,16 +1023,16 @@ function Ae({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
996
1023
  touchAction: "pan-y",
997
1024
  userSelect: v ? "none" : void 0,
998
1025
  cursor: v ? "grabbing" : void 0,
999
- ...f(d)
1026
+ ...p(d)
1000
1027
  },
1001
- children: [/* @__PURE__ */ s("div", {
1028
+ children: [/* @__PURE__ */ c("div", {
1002
1029
  style: {
1003
1030
  display: "flex",
1004
- height: l,
1031
+ height: a,
1005
1032
  transform: `translateX(calc(${-b * 100}% + ${v?.dx ?? 0}px))`,
1006
1033
  transition: v ? "none" : "transform 450ms ease"
1007
1034
  },
1008
- children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ s("div", {
1035
+ children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ c("div", {
1009
1036
  style: {
1010
1037
  position: "relative",
1011
1038
  width: "100%",
@@ -1014,28 +1041,28 @@ function Ae({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1014
1041
  },
1015
1042
  children: t(n)
1016
1043
  }, n))
1017
- }), e > 1 && /* @__PURE__ */ c(o, { children: [
1018
- /* @__PURE__ */ s("button", {
1044
+ }), e > 1 && /* @__PURE__ */ l(s, { children: [
1045
+ /* @__PURE__ */ c("button", {
1019
1046
  type: "button",
1020
1047
  "aria-label": "Previous slide",
1021
1048
  style: {
1022
- ...De,
1049
+ ...Fe,
1023
1050
  left: 12
1024
1051
  },
1025
1052
  onClick: () => x(b - 1),
1026
1053
  children: "‹"
1027
1054
  }),
1028
- /* @__PURE__ */ s("button", {
1055
+ /* @__PURE__ */ c("button", {
1029
1056
  type: "button",
1030
1057
  "aria-label": "Next slide",
1031
1058
  style: {
1032
- ...De,
1059
+ ...Fe,
1033
1060
  right: 12
1034
1061
  },
1035
1062
  onClick: () => x(b + 1),
1036
1063
  children: "›"
1037
1064
  }),
1038
- /* @__PURE__ */ s("div", {
1065
+ /* @__PURE__ */ c("div", {
1039
1066
  style: {
1040
1067
  position: "absolute",
1041
1068
  bottom: 10,
@@ -1045,7 +1072,7 @@ function Ae({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1045
1072
  justifyContent: "center",
1046
1073
  gap: 6
1047
1074
  },
1048
- children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ s("button", {
1075
+ children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ c("button", {
1049
1076
  type: "button",
1050
1077
  "aria-label": `Go to slide ${t + 1}`,
1051
1078
  onClick: () => x(t),
@@ -1063,7 +1090,7 @@ function Ae({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1063
1090
  ] })]
1064
1091
  });
1065
1092
  }
1066
- var je = (e, t) => ({
1093
+ var ze = (e, t) => ({
1067
1094
  position: "absolute",
1068
1095
  inset: 0,
1069
1096
  backgroundImage: e ? `url(${e})` : "none",
@@ -1071,26 +1098,26 @@ var je = (e, t) => ({
1071
1098
  backgroundSize: "cover",
1072
1099
  backgroundPosition: "center"
1073
1100
  });
1074
- function Me({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1075
- return e.length ? /* @__PURE__ */ s(Ae, {
1101
+ function Be({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1102
+ return e.length ? /* @__PURE__ */ c(Re, {
1076
1103
  ...r,
1077
1104
  count: e.length,
1078
1105
  renderSlide: (r) => {
1079
1106
  let i = e[r];
1080
- return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", { style: je(i.image) }), (i.title || i.text) && /* @__PURE__ */ c("div", {
1107
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: ze(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
1081
1108
  style: {
1082
1109
  position: "absolute",
1083
1110
  color: "#fff",
1084
1111
  textAlign: n,
1085
- ...Oe[t] ?? Oe.bottom
1112
+ ...Ie[t] ?? Ie.bottom
1086
1113
  },
1087
- children: [i.title && /* @__PURE__ */ s("div", {
1114
+ children: [i.title && /* @__PURE__ */ c("div", {
1088
1115
  style: {
1089
1116
  fontSize: 22,
1090
1117
  fontWeight: 700
1091
1118
  },
1092
1119
  children: i.title
1093
- }), i.text && /* @__PURE__ */ s("div", {
1120
+ }), i.text && /* @__PURE__ */ c("div", {
1094
1121
  style: {
1095
1122
  fontSize: 14,
1096
1123
  opacity: .9,
@@ -1102,13 +1129,13 @@ function Me({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1102
1129
  }
1103
1130
  }) : null;
1104
1131
  }
1105
- function Ne({ slides: e = [], linked: t, ...n }) {
1106
- return e.length ? /* @__PURE__ */ s(Ae, {
1132
+ function Ve({ slides: e = [], linked: t, ...n }) {
1133
+ return e.length ? /* @__PURE__ */ c(Re, {
1107
1134
  ...n,
1108
1135
  count: e.length,
1109
1136
  renderSlide: (n) => {
1110
1137
  let r = e[n];
1111
- return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s("div", { style: je(r.image, r.color) }), /* @__PURE__ */ s("div", {
1138
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: ze(r.image, r.color) }), /* @__PURE__ */ c("div", {
1112
1139
  style: {
1113
1140
  position: "absolute",
1114
1141
  inset: 0,
@@ -1125,28 +1152,28 @@ var Z = {
1125
1152
  textDecoration: "none",
1126
1153
  fontSize: 14,
1127
1154
  opacity: .85
1128
- }, Pe = {
1155
+ }, He = {
1129
1156
  background: "var(--page-bg, #ffffff)",
1130
1157
  color: "var(--page-text, #111827)",
1131
1158
  border: "1px solid rgba(148, 163, 184, 0.25)",
1132
1159
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1133
1160
  zIndex: 60
1134
1161
  };
1135
- function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u = "auto", breakpoint: d = 768 }) {
1136
- let [p, m] = a(null), [h, g] = a(!1), [_, v] = a(!1), [y, b] = a(null);
1162
+ function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u = "auto", breakpoint: d = 768 }) {
1163
+ let [f, m] = o(null), [h, g] = o(!1), [_, v] = o(!1), [y, b] = o(null);
1137
1164
  r(() => {
1138
- if (!p) return;
1139
- let e = new ResizeObserver(() => g(p.offsetWidth < d));
1140
- return e.observe(p), () => e.disconnect();
1141
- }, [p, d]);
1142
- let x = u === "hamburger" || u === "auto" && h, S = (e, t) => /* @__PURE__ */ c("a", {
1165
+ if (!f) return;
1166
+ let e = new ResizeObserver(() => g(f.offsetWidth < d));
1167
+ return e.observe(f), () => e.disconnect();
1168
+ }, [f, d]);
1169
+ let x = u === "hamburger" || u === "auto" && h, S = (e, t) => /* @__PURE__ */ l("a", {
1143
1170
  href: e.href || "#",
1144
1171
  style: {
1145
1172
  ...Z,
1146
1173
  display: "block",
1147
1174
  ...t
1148
1175
  },
1149
- children: [e.label, e.desc && /* @__PURE__ */ s("span", {
1176
+ children: [e.label, e.desc && /* @__PURE__ */ c("span", {
1150
1177
  style: {
1151
1178
  display: "block",
1152
1179
  fontSize: 12,
@@ -1156,9 +1183,9 @@ function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
1156
1183
  children: e.desc
1157
1184
  })]
1158
1185
  }, e.key);
1159
- return /* @__PURE__ */ c("nav", {
1186
+ return /* @__PURE__ */ l("nav", {
1160
1187
  ref: (e) => {
1161
- m(e), l && l(e);
1188
+ m(e), s && s(e);
1162
1189
  },
1163
1190
  style: {
1164
1191
  display: "flex",
@@ -1168,10 +1195,10 @@ function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
1168
1195
  padding: "14px 24px",
1169
1196
  width: "100%",
1170
1197
  position: "relative",
1171
- ...f(o)
1198
+ ...p(a)
1172
1199
  },
1173
1200
  children: [
1174
- n && /* @__PURE__ */ s("img", {
1201
+ n && /* @__PURE__ */ c("img", {
1175
1202
  src: n,
1176
1203
  alt: t || "Logo",
1177
1204
  style: {
@@ -1179,7 +1206,7 @@ function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
1179
1206
  display: "block"
1180
1207
  }
1181
1208
  }),
1182
- t && /* @__PURE__ */ s("div", {
1209
+ t && /* @__PURE__ */ c("div", {
1183
1210
  style: {
1184
1211
  fontWeight: 700,
1185
1212
  fontSize: 18,
@@ -1187,8 +1214,8 @@ function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
1187
1214
  },
1188
1215
  children: t
1189
1216
  }),
1190
- /* @__PURE__ */ s("div", { style: { flexGrow: 1 } }),
1191
- x ? /* @__PURE__ */ s("button", {
1217
+ /* @__PURE__ */ c("div", { style: { flexGrow: 1 } }),
1218
+ x ? /* @__PURE__ */ c("button", {
1192
1219
  type: "button",
1193
1220
  "aria-label": _ ? "Close menu" : "Open menu",
1194
1221
  onClick: () => v(!_),
@@ -1202,7 +1229,7 @@ function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
1202
1229
  padding: 4
1203
1230
  },
1204
1231
  children: _ ? "✕" : "☰"
1205
- }) : /* @__PURE__ */ s("div", {
1232
+ }) : /* @__PURE__ */ c("div", {
1206
1233
  style: {
1207
1234
  display: "flex",
1208
1235
  gap: 20,
@@ -1211,20 +1238,20 @@ function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
1211
1238
  },
1212
1239
  children: i.map((e) => {
1213
1240
  let t = e.children ?? [];
1214
- if (!t.length) return /* @__PURE__ */ s("a", {
1241
+ if (!t.length) return /* @__PURE__ */ c("a", {
1215
1242
  href: e.href || "#",
1216
1243
  style: Z,
1217
1244
  children: e.label
1218
1245
  }, e.key);
1219
1246
  let n = e.type === "mega";
1220
- return /* @__PURE__ */ c("span", {
1247
+ return /* @__PURE__ */ l("span", {
1221
1248
  style: {
1222
1249
  position: n ? "static" : "relative",
1223
1250
  display: "inline-flex"
1224
1251
  },
1225
1252
  onMouseEnter: () => b(e.key),
1226
1253
  onMouseLeave: () => b(null),
1227
- children: [/* @__PURE__ */ c("a", {
1254
+ children: [/* @__PURE__ */ l("a", {
1228
1255
  href: e.href || "#",
1229
1256
  style: {
1230
1257
  ...Z,
@@ -1233,7 +1260,7 @@ function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
1233
1260
  children: [
1234
1261
  e.label,
1235
1262
  " ",
1236
- /* @__PURE__ */ s("span", {
1263
+ /* @__PURE__ */ c("span", {
1237
1264
  style: {
1238
1265
  fontSize: 9,
1239
1266
  opacity: .6
@@ -1241,9 +1268,9 @@ function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
1241
1268
  children: "▼"
1242
1269
  })
1243
1270
  ]
1244
- }), y === e.key && (n ? /* @__PURE__ */ s("div", {
1271
+ }), y === e.key && (n ? /* @__PURE__ */ c("div", {
1245
1272
  style: {
1246
- ...Pe,
1273
+ ...He,
1247
1274
  position: "absolute",
1248
1275
  left: 0,
1249
1276
  right: 0,
@@ -1257,9 +1284,9 @@ function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
1257
1284
  padding: "6px 8px",
1258
1285
  borderRadius: 6
1259
1286
  }))
1260
- }) : /* @__PURE__ */ s("div", {
1287
+ }) : /* @__PURE__ */ c("div", {
1261
1288
  style: {
1262
- ...Pe,
1289
+ ...He,
1263
1290
  position: "absolute",
1264
1291
  top: "100%",
1265
1292
  left: 0,
@@ -1277,7 +1304,7 @@ function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
1277
1304
  }, e.key);
1278
1305
  })
1279
1306
  }),
1280
- x && _ && /* @__PURE__ */ s("div", {
1307
+ x && _ && /* @__PURE__ */ c("div", {
1281
1308
  style: {
1282
1309
  flexBasis: "100%",
1283
1310
  width: "100%",
@@ -1285,7 +1312,7 @@ function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
1285
1312
  flexDirection: "column",
1286
1313
  paddingTop: 10
1287
1314
  },
1288
- children: i.map((t) => /* @__PURE__ */ c(e, { children: [/* @__PURE__ */ s("a", {
1315
+ children: i.map((t) => /* @__PURE__ */ l(e, { children: [/* @__PURE__ */ c("a", {
1289
1316
  href: t.href || "#",
1290
1317
  style: {
1291
1318
  ...Z,
@@ -1299,23 +1326,23 @@ function Fe({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
1299
1326
  ]
1300
1327
  });
1301
1328
  }
1302
- function Ie({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1303
- let [i, o] = a(0), l = e.length ? Math.min(i, e.length - 1) : 0;
1304
- return e.length ? /* @__PURE__ */ c("div", {
1329
+ function We({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1330
+ let [i, a] = o(0), s = e.length ? Math.min(i, e.length - 1) : 0;
1331
+ return e.length ? /* @__PURE__ */ l("div", {
1305
1332
  ref: r,
1306
1333
  style: {
1307
1334
  width: "100%",
1308
- ...f(n)
1335
+ ...p(n)
1309
1336
  },
1310
- children: [/* @__PURE__ */ s("div", {
1337
+ children: [/* @__PURE__ */ c("div", {
1311
1338
  style: {
1312
1339
  display: "flex",
1313
1340
  gap: 4,
1314
1341
  borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
1315
1342
  },
1316
- children: e.map((e, t) => /* @__PURE__ */ s("button", {
1343
+ children: e.map((e, t) => /* @__PURE__ */ c("button", {
1317
1344
  type: "button",
1318
- onClick: () => o(t),
1345
+ onClick: () => a(t),
1319
1346
  style: {
1320
1347
  background: "transparent",
1321
1348
  border: 0,
@@ -1324,39 +1351,39 @@ function Ie({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1324
1351
  fontFamily: "inherit",
1325
1352
  color: "inherit",
1326
1353
  cursor: "pointer",
1327
- opacity: t === l ? 1 : .6,
1328
- fontWeight: t === l ? 600 : 500,
1329
- boxShadow: t === l ? "inset 0 -2px 0 var(--page-accent, #111827)" : "none"
1354
+ opacity: t === s ? 1 : .6,
1355
+ fontWeight: t === s ? 600 : 500,
1356
+ boxShadow: t === s ? "inset 0 -2px 0 var(--page-accent, #111827)" : "none"
1330
1357
  },
1331
1358
  children: e.label || `Tab ${t + 1}`
1332
1359
  }, e.key))
1333
- }), e.map((e, n) => /* @__PURE__ */ s("div", {
1360
+ }), e.map((e, n) => /* @__PURE__ */ c("div", {
1334
1361
  style: {
1335
- display: n === l ? "flex" : "none",
1362
+ display: n === s ? "flex" : "none",
1336
1363
  flexDirection: "column"
1337
1364
  },
1338
1365
  children: t?.[e.key] ?? null
1339
1366
  }, e.key))]
1340
1367
  }) : null;
1341
1368
  }
1342
- function Le({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1343
- let [o, l] = a(() => new Set(e.length ? [e[0].key] : []));
1369
+ function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1370
+ let [a, s] = o(() => new Set(e.length ? [e[0].key] : []));
1344
1371
  if (!e.length) return null;
1345
- let u = (e) => l((t) => {
1372
+ let u = (e) => s((t) => {
1346
1373
  let r = new Set(n ? t : []);
1347
1374
  return t.has(e) ? r.delete(e) : r.add(e), r;
1348
1375
  });
1349
- return /* @__PURE__ */ s("div", {
1376
+ return /* @__PURE__ */ c("div", {
1350
1377
  ref: i,
1351
1378
  style: {
1352
1379
  width: "100%",
1353
- ...f(r)
1380
+ ...p(r)
1354
1381
  },
1355
1382
  children: e.map((n, r) => {
1356
- let i = o.has(n.key);
1357
- return /* @__PURE__ */ c("div", {
1383
+ let i = a.has(n.key);
1384
+ return /* @__PURE__ */ l("div", {
1358
1385
  style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
1359
- children: [/* @__PURE__ */ c("button", {
1386
+ children: [/* @__PURE__ */ l("button", {
1360
1387
  type: "button",
1361
1388
  onClick: () => u(n.key),
1362
1389
  style: {
@@ -1375,7 +1402,7 @@ function Le({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1375
1402
  textAlign: "left",
1376
1403
  cursor: "pointer"
1377
1404
  },
1378
- children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ s("span", {
1405
+ children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ c("span", {
1379
1406
  "aria-hidden": !0,
1380
1407
  style: {
1381
1408
  fontSize: 12,
@@ -1385,7 +1412,7 @@ function Le({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1385
1412
  },
1386
1413
  children: "▼"
1387
1414
  })]
1388
- }), /* @__PURE__ */ s("div", {
1415
+ }), /* @__PURE__ */ c("div", {
1389
1416
  style: {
1390
1417
  display: i ? "flex" : "none",
1391
1418
  flexDirection: "column"
@@ -1396,11 +1423,11 @@ function Le({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1396
1423
  })
1397
1424
  });
1398
1425
  }
1399
- var Re = {
1426
+ var Ke = {
1400
1427
  display: "flex",
1401
1428
  flexDirection: "column",
1402
1429
  gap: "12px"
1403
- }, ze = {
1430
+ }, qe = {
1404
1431
  fontSize: "14px",
1405
1432
  fontWeight: 500,
1406
1433
  color: "var(--page-text, #111827)"
@@ -1414,35 +1441,35 @@ var Re = {
1414
1441
  boxSizing: "border-box",
1415
1442
  backgroundColor: "#ffffff",
1416
1443
  color: "#111827"
1417
- }, Be = {
1444
+ }, Je = {
1418
1445
  display: "flex",
1419
1446
  alignItems: "center",
1420
1447
  gap: "8px",
1421
1448
  fontSize: "14px",
1422
1449
  color: "var(--page-text, #111827)"
1423
- }, Ve = (e) => e ? {
1450
+ }, Ye = (e) => e ? {
1424
1451
  readOnly: !0,
1425
1452
  tabIndex: -1,
1426
1453
  onMouseDown: (e) => e.preventDefault()
1427
1454
  } : {};
1428
- function He({ style: e, action: t, method: r, name: i, enctype: o, formSlug: l, nodeRef: u, inert: d, children: p, linked: m, show: h }) {
1429
- let { tenant: g, apiUrl: _ } = n(z), [v, y] = a("form"), b = d ? h || "form" : v;
1430
- return /* @__PURE__ */ c("div", {
1455
+ function Xe({ style: e, action: t, method: r, name: i, enctype: a, formSlug: s, nodeRef: u, inert: d, children: f, linked: m, show: h }) {
1456
+ let { tenant: g, apiUrl: _ } = n(B), [v, y] = o("form"), b = d ? h || "form" : v;
1457
+ return /* @__PURE__ */ l("div", {
1431
1458
  ref: u,
1432
- style: f(e),
1459
+ style: p(e),
1433
1460
  children: [
1434
- /* @__PURE__ */ s("form", {
1461
+ /* @__PURE__ */ c("form", {
1435
1462
  action: t || void 0,
1436
1463
  method: r || "post",
1437
1464
  name: i || void 0,
1438
- encType: o || void 0,
1465
+ encType: a || void 0,
1439
1466
  onSubmit: async (e) => {
1440
1467
  if (e.preventDefault(), !d) {
1441
- if (l) {
1468
+ if (s) {
1442
1469
  let t = {};
1443
1470
  for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
1444
1471
  try {
1445
- let e = await fetch(`${_ || "/api"}/forms/${l}/submit`, {
1472
+ let e = await fetch(`${_ || "/api"}/forms/${s}/submit`, {
1446
1473
  method: "post",
1447
1474
  headers: {
1448
1475
  "content-type": "application/json",
@@ -1472,16 +1499,16 @@ function He({ style: e, action: t, method: r, name: i, enctype: o, formSlug: l,
1472
1499
  }
1473
1500
  },
1474
1501
  style: {
1475
- ...Re,
1502
+ ...Ke,
1476
1503
  display: b === "success" ? "none" : "flex"
1477
1504
  },
1478
- children: p
1505
+ children: f
1479
1506
  }),
1480
- /* @__PURE__ */ s("div", {
1507
+ /* @__PURE__ */ c("div", {
1481
1508
  style: { display: b === "success" ? "block" : "none" },
1482
1509
  children: m?.success ?? null
1483
1510
  }),
1484
- /* @__PURE__ */ s("div", {
1511
+ /* @__PURE__ */ c("div", {
1485
1512
  style: {
1486
1513
  display: b === "error" ? "block" : "none",
1487
1514
  marginTop: 12
@@ -1491,18 +1518,18 @@ function He({ style: e, action: t, method: r, name: i, enctype: o, formSlug: l,
1491
1518
  ]
1492
1519
  });
1493
1520
  }
1494
- function Ue({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1495
- return /* @__PURE__ */ s("label", {
1521
+ function Ze({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1522
+ return /* @__PURE__ */ c("label", {
1496
1523
  ref: r,
1497
1524
  style: {
1498
- ...ze,
1499
- ...f(n)
1525
+ ...qe,
1526
+ ...p(n)
1500
1527
  },
1501
1528
  children: X(t, e, i)
1502
1529
  });
1503
1530
  }
1504
- function We({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1505
- return /* @__PURE__ */ s("input", {
1531
+ function Qe({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1532
+ return /* @__PURE__ */ c("input", {
1506
1533
  ref: a,
1507
1534
  type: e,
1508
1535
  name: t || void 0,
@@ -1510,13 +1537,13 @@ function We({ type: e = "text", name: t, placeholder: n, required: r, style: i,
1510
1537
  required: !o && !!r,
1511
1538
  style: {
1512
1539
  ...Q,
1513
- ...f(i)
1540
+ ...p(i)
1514
1541
  },
1515
- ...Ve(o)
1542
+ ...Ye(o)
1516
1543
  });
1517
1544
  }
1518
- function Ge({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1519
- return /* @__PURE__ */ s("textarea", {
1545
+ function $e({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1546
+ return /* @__PURE__ */ c("textarea", {
1520
1547
  ref: a,
1521
1548
  name: e || void 0,
1522
1549
  placeholder: t,
@@ -1525,25 +1552,25 @@ function Ge({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
1525
1552
  style: {
1526
1553
  ...Q,
1527
1554
  resize: "vertical",
1528
- ...f(i)
1555
+ ...p(i)
1529
1556
  },
1530
- ...Ve(o)
1557
+ ...Ye(o)
1531
1558
  });
1532
1559
  }
1533
- function Ke({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: l }) {
1534
- return /* @__PURE__ */ c("label", {
1560
+ function et({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1561
+ return /* @__PURE__ */ l("label", {
1535
1562
  ref: o,
1536
1563
  style: {
1537
- ...Be,
1538
- ...f(a)
1564
+ ...Je,
1565
+ ...p(a)
1539
1566
  },
1540
- children: [/* @__PURE__ */ s("input", {
1567
+ children: [/* @__PURE__ */ c("input", {
1541
1568
  type: e,
1542
1569
  name: n || void 0,
1543
1570
  value: r || void 0,
1544
- required: !l && !!i,
1545
- onClick: l ? (e) => e.preventDefault() : void 0,
1546
- tabIndex: l ? -1 : void 0,
1571
+ required: !s && !!i,
1572
+ onClick: s ? (e) => e.preventDefault() : void 0,
1573
+ tabIndex: s ? -1 : void 0,
1547
1574
  style: {
1548
1575
  margin: 0,
1549
1576
  accentColor: "var(--page-accent, #111827)"
@@ -1551,8 +1578,8 @@ function Ke({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1551
1578
  }), t]
1552
1579
  });
1553
1580
  }
1554
- function qe({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1555
- return /* @__PURE__ */ c("select", {
1581
+ function tt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1582
+ return /* @__PURE__ */ l("select", {
1556
1583
  ref: a,
1557
1584
  name: e || void 0,
1558
1585
  required: !o && !!r,
@@ -1562,43 +1589,43 @@ function qe({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1562
1589
  style: {
1563
1590
  ...Q,
1564
1591
  appearance: "auto",
1565
- ...f(i)
1592
+ ...p(i)
1566
1593
  },
1567
- children: [t !== "" && /* @__PURE__ */ s("option", {
1594
+ children: [t !== "" && /* @__PURE__ */ c("option", {
1568
1595
  value: "",
1569
1596
  disabled: !0,
1570
1597
  children: t ?? "Select…"
1571
- }), n.map((e, t) => /* @__PURE__ */ s("option", {
1598
+ }), n.map((e, t) => /* @__PURE__ */ c("option", {
1572
1599
  value: e,
1573
1600
  children: e
1574
1601
  }, t))]
1575
1602
  });
1576
1603
  }
1577
- function Je({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: o, inert: l }) {
1578
- let [u, d] = a(null);
1579
- return /* @__PURE__ */ c("label", {
1580
- ref: o,
1604
+ function nt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
1605
+ let [u, d] = o(null);
1606
+ return /* @__PURE__ */ l("label", {
1607
+ ref: a,
1581
1608
  style: {
1582
1609
  ...Q,
1583
1610
  display: "flex",
1584
1611
  alignItems: "center",
1585
1612
  gap: "8px",
1586
- cursor: l ? "default" : "pointer",
1613
+ cursor: s ? "default" : "pointer",
1587
1614
  borderStyle: "dashed",
1588
1615
  color: u ? "#111827" : "#6b7280",
1589
- ...f(i)
1616
+ ...p(i)
1590
1617
  },
1591
1618
  children: [
1592
- /* @__PURE__ */ s("input", {
1619
+ /* @__PURE__ */ c("input", {
1593
1620
  type: "file",
1594
1621
  name: e || void 0,
1595
1622
  accept: t || void 0,
1596
- required: !l && !!n,
1597
- disabled: !!l,
1623
+ required: !s && !!n,
1624
+ disabled: !!s,
1598
1625
  onChange: (e) => d(e.target.files?.[0]?.name ?? null),
1599
1626
  style: { display: "none" }
1600
1627
  }),
1601
- /* @__PURE__ */ s("span", {
1628
+ /* @__PURE__ */ c("span", {
1602
1629
  "aria-hidden": !0,
1603
1630
  children: "📎"
1604
1631
  }),
@@ -1606,185 +1633,527 @@ function Je({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
1606
1633
  ]
1607
1634
  });
1608
1635
  }
1609
- function Ye({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1610
- return /* @__PURE__ */ s("button", {
1636
+ function rt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1637
+ return /* @__PURE__ */ c("button", {
1611
1638
  ref: n,
1612
1639
  type: r ? "button" : "submit",
1613
1640
  style: {
1614
- ...H,
1641
+ ...J,
1615
1642
  border: 0,
1616
1643
  cursor: "pointer",
1617
1644
  alignSelf: "flex-start",
1618
- ...f(t)
1645
+ padding: "10px 22px",
1646
+ borderRadius: 8,
1647
+ fontSize: 15,
1648
+ fontWeight: 600,
1649
+ lineHeight: 1.4,
1650
+ fontFamily: "inherit",
1651
+ ...p(t)
1619
1652
  },
1620
1653
  children: e
1621
1654
  });
1622
1655
  }
1623
- function Xe({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1656
+ function it({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1624
1657
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1625
- return /* @__PURE__ */ s("div", {
1658
+ return /* @__PURE__ */ c("div", {
1626
1659
  ref: r,
1627
1660
  style: {
1628
1661
  display: "grid",
1629
1662
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
1630
1663
  gap: 16,
1631
1664
  width: "100%",
1632
- ...f(n)
1665
+ ...p(n)
1633
1666
  },
1634
- children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ s("div", {
1667
+ children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ c("div", {
1635
1668
  style: { minWidth: 0 },
1636
1669
  children: i?.[`cell-${t}`] ?? null
1637
1670
  }, t))
1638
1671
  });
1639
1672
  }
1640
- var Ze = {
1641
- PageRoot: ae,
1642
- Section: K,
1643
- Container: q,
1644
- Heading: J,
1645
- TextBlock: he,
1646
- ButtonBlock: ve,
1647
- ImageBlock: ye,
1648
- Spacer: Te,
1649
- Divider: Ee,
1650
- SliderBlock: Me,
1651
- CanvasSlider: Ne,
1652
- TabsBlock: Ie,
1653
- QuickStack: Xe,
1654
- AccordionBlock: Le,
1655
- NavbarBlock: Fe,
1656
- ListBlock: me,
1657
- TextSpan: se,
1658
- QuoteBlock: pe,
1659
- TextLink: _e,
1660
- RichTextBlock: de,
1661
- RichContentBlock: de,
1662
- VideoBlock: be,
1663
- YouTubeBlock: Se,
1664
- IframeBlock: Ce,
1665
- EmbedBlock: we,
1666
- FormBlock: He,
1667
- FormLabel: Ue,
1668
- FormInput: We,
1669
- FormTextarea: Ge,
1670
- FormCheckbox: (e) => /* @__PURE__ */ s(Ke, {
1673
+ function at({ 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 }) {
1674
+ let { tenant: _, apiUrl: v } = n(B), y = n(H), b = n(V)?.[e], [x, S] = o(null);
1675
+ if (r(() => {
1676
+ if (!e || b) return;
1677
+ let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}`;
1678
+ return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => t && S(Array.isArray(e?.payload) ? e.payload : [])).catch(() => t && S([])), () => {
1679
+ t = !1;
1680
+ };
1681
+ }, [
1682
+ e,
1683
+ _,
1684
+ v,
1685
+ b
1686
+ ]), !e) return null;
1687
+ let C = (b ?? x ?? []).slice(0, Math.max(1, Number(t) || 6)), w = Math.min(Math.max(Number(a) || 3, 1), 6), T = i === "list" ? {
1688
+ display: "flex",
1689
+ flexDirection: "column",
1690
+ gap: 20
1691
+ } : {
1692
+ display: "grid",
1693
+ gridTemplateColumns: `repeat(${w}, minmax(0, 1fr))`,
1694
+ gap: 24
1695
+ };
1696
+ return f && m && y?.render ? /* @__PURE__ */ c("div", {
1697
+ ref: g,
1698
+ style: {
1699
+ width: "100%",
1700
+ ...T,
1701
+ ...p(h)
1702
+ },
1703
+ children: C.map((e) => /* @__PURE__ */ c("div", {
1704
+ style: { minWidth: 0 },
1705
+ children: y.render(m, (t) => ae(t, e))
1706
+ }, e.id ?? e?.data?.slug))
1707
+ }) : /* @__PURE__ */ c("div", {
1708
+ ref: g,
1709
+ style: {
1710
+ width: "100%",
1711
+ ...T,
1712
+ ...p(h)
1713
+ },
1714
+ children: C.map((e) => {
1715
+ let t = s ? U(e?.data, s) : null, n = u ? G(U(e?.data, u)) : null, r = d ? U(e?.data, d) : null, a = Array.isArray(r) ? r : null, o = a || r == null ? null : G(r), f = i === "list";
1716
+ return /* @__PURE__ */ l("div", {
1717
+ style: {
1718
+ display: "flex",
1719
+ flexDirection: f ? "row" : "column",
1720
+ gap: f ? 20 : 12,
1721
+ alignItems: f ? "center" : "stretch",
1722
+ minWidth: 0
1723
+ },
1724
+ children: [t && /* @__PURE__ */ c("img", {
1725
+ src: t,
1726
+ alt: n ?? "",
1727
+ style: {
1728
+ width: f ? 160 : "100%",
1729
+ aspectRatio: "3 / 2",
1730
+ objectFit: "cover",
1731
+ borderRadius: 10,
1732
+ flexShrink: 0,
1733
+ display: "block"
1734
+ }
1735
+ }), /* @__PURE__ */ l("div", {
1736
+ style: { minWidth: 0 },
1737
+ children: [
1738
+ n && /* @__PURE__ */ c("h3", {
1739
+ style: {
1740
+ margin: 0,
1741
+ fontSize: 18,
1742
+ fontWeight: 700
1743
+ },
1744
+ children: n
1745
+ }),
1746
+ o && /* @__PURE__ */ c("p", {
1747
+ style: {
1748
+ margin: "6px 0 0",
1749
+ fontSize: 14,
1750
+ lineHeight: 1.55,
1751
+ opacity: .75
1752
+ },
1753
+ children: o
1754
+ }),
1755
+ a && /* @__PURE__ */ c("div", {
1756
+ style: {
1757
+ marginTop: 6,
1758
+ fontSize: 14,
1759
+ lineHeight: 1.55,
1760
+ opacity: .85
1761
+ },
1762
+ children: ve(a)
1763
+ })
1764
+ ]
1765
+ })]
1766
+ }, e.id ?? e?.data?.slug);
1767
+ })
1768
+ });
1769
+ }
1770
+ function ot({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
1771
+ return e.length ? /* @__PURE__ */ c("nav", {
1772
+ ref: r,
1773
+ "aria-label": "Breadcrumb",
1774
+ style: { ...p(n) },
1775
+ children: /* @__PURE__ */ c("ol", {
1776
+ style: {
1777
+ display: "flex",
1778
+ flexWrap: "wrap",
1779
+ alignItems: "center",
1780
+ gap: 8,
1781
+ listStyle: "none",
1782
+ margin: 0,
1783
+ padding: 0,
1784
+ fontSize: 14
1785
+ },
1786
+ children: e.map((n, r) => {
1787
+ let i = r === e.length - 1;
1788
+ return /* @__PURE__ */ l("li", {
1789
+ style: {
1790
+ display: "flex",
1791
+ alignItems: "center",
1792
+ gap: 8,
1793
+ minWidth: 0
1794
+ },
1795
+ children: [r > 0 && /* @__PURE__ */ c("span", {
1796
+ style: { opacity: .4 },
1797
+ "aria-hidden": !0,
1798
+ children: t
1799
+ }), i || !n.href ? /* @__PURE__ */ c("span", {
1800
+ style: {
1801
+ fontWeight: i ? 600 : 400,
1802
+ opacity: i ? 1 : .7
1803
+ },
1804
+ "aria-current": i ? "page" : void 0,
1805
+ children: n.label
1806
+ }) : /* @__PURE__ */ c("a", {
1807
+ href: n.href,
1808
+ style: {
1809
+ color: "inherit",
1810
+ opacity: .7,
1811
+ textDecoration: "none"
1812
+ },
1813
+ children: n.label
1814
+ })]
1815
+ }, r);
1816
+ })
1817
+ })
1818
+ }) : null;
1819
+ }
1820
+ function st({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
1821
+ 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) => ({
1822
+ display: "inline-flex",
1823
+ alignItems: "center",
1824
+ justifyContent: "center",
1825
+ minWidth: 36,
1826
+ height: 36,
1827
+ padding: "0 8px",
1828
+ borderRadius: 8,
1829
+ fontSize: 14,
1830
+ textDecoration: "none",
1831
+ color: e ? "var(--page-accent-text, #ffffff)" : "inherit",
1832
+ background: e ? "var(--page-accent, #111827)" : "transparent",
1833
+ border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
1834
+ });
1835
+ return /* @__PURE__ */ l("nav", {
1836
+ ref: a,
1837
+ "aria-label": "Pagination",
1838
+ style: {
1839
+ display: "flex",
1840
+ flexWrap: "wrap",
1841
+ gap: 8,
1842
+ alignItems: "center",
1843
+ ...p(i)
1844
+ },
1845
+ children: [
1846
+ n && /* @__PURE__ */ c("a", {
1847
+ href: s > 1 ? u(s - 1) : "#",
1848
+ "aria-label": "Previous",
1849
+ style: {
1850
+ ...d(!1),
1851
+ opacity: s > 1 ? 1 : .4
1852
+ },
1853
+ children: "‹"
1854
+ }),
1855
+ Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ c("a", {
1856
+ href: u(e),
1857
+ "aria-current": e === s ? "page" : void 0,
1858
+ style: d(e === s),
1859
+ children: e
1860
+ }, e)),
1861
+ n && /* @__PURE__ */ c("a", {
1862
+ href: s < o ? u(s + 1) : "#",
1863
+ "aria-label": "Next",
1864
+ style: {
1865
+ ...d(!1),
1866
+ opacity: s < o ? 1 : .4
1867
+ },
1868
+ children: "›"
1869
+ })
1870
+ ]
1871
+ });
1872
+ }
1873
+ function ct({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
1874
+ if (!t.length) return null;
1875
+ let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
1876
+ width: 32,
1877
+ height: 32,
1878
+ borderRadius: "50%",
1879
+ display: "flex",
1880
+ alignItems: "center",
1881
+ justifyContent: "center",
1882
+ fontSize: 14,
1883
+ fontWeight: 600,
1884
+ flexShrink: 0,
1885
+ color: e === "todo" ? "inherit" : "var(--page-accent-text, #ffffff)",
1886
+ background: e === "todo" ? "transparent" : "var(--page-accent, #111827)",
1887
+ border: e === "todo" ? "1px solid rgba(148, 163, 184, 0.5)" : "1px solid transparent",
1888
+ opacity: e === "todo" ? .6 : 1,
1889
+ boxShadow: e === "active" ? "0 0 0 4px rgba(99, 102, 241, 0.2)" : "none"
1890
+ }), u = (e) => ({
1891
+ flexGrow: 1,
1892
+ alignSelf: "center",
1893
+ background: e ? "var(--page-accent, #111827)" : "rgba(148, 163, 184, 0.4)",
1894
+ ...r ? {
1895
+ width: 2,
1896
+ minHeight: 24,
1897
+ marginLeft: 15,
1898
+ alignSelf: "auto"
1899
+ } : {
1900
+ height: 2,
1901
+ minWidth: 24
1902
+ }
1903
+ });
1904
+ return /* @__PURE__ */ c("div", {
1905
+ ref: a,
1906
+ style: {
1907
+ display: "flex",
1908
+ flexDirection: r ? "column" : "row",
1909
+ alignItems: r ? "stretch" : "flex-start",
1910
+ gap: r ? 4 : 8,
1911
+ ...p(i)
1912
+ },
1913
+ children: t.map((t, n) => {
1914
+ let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
1915
+ return /* @__PURE__ */ l(e, { children: [n > 0 && /* @__PURE__ */ c("div", {
1916
+ style: u(i <= o),
1917
+ "aria-hidden": !0
1918
+ }), /* @__PURE__ */ l("div", {
1919
+ style: {
1920
+ display: "flex",
1921
+ flexDirection: r ? "row" : "column",
1922
+ alignItems: "center",
1923
+ gap: 8,
1924
+ minWidth: 0,
1925
+ textAlign: r ? "left" : "center"
1926
+ },
1927
+ children: [/* @__PURE__ */ c("div", {
1928
+ style: s(a),
1929
+ children: a === "done" ? "✓" : i
1930
+ }), /* @__PURE__ */ l("div", {
1931
+ style: { minWidth: 0 },
1932
+ children: [/* @__PURE__ */ c("div", {
1933
+ style: {
1934
+ fontSize: 13,
1935
+ fontWeight: a === "active" ? 700 : 500,
1936
+ opacity: a === "todo" ? .6 : 1
1937
+ },
1938
+ children: t.label
1939
+ }), t.description && /* @__PURE__ */ c("div", {
1940
+ style: {
1941
+ fontSize: 12,
1942
+ opacity: .6
1943
+ },
1944
+ children: t.description
1945
+ })]
1946
+ })]
1947
+ })] }, n);
1948
+ })
1949
+ });
1950
+ }
1951
+ function lt({ columns: e = [], rows: t = [], striped: n = !0, bordered: r = !1, compact: i = !1, style: a, nodeRef: o }) {
1952
+ if (!e.length) return null;
1953
+ let s = i ? "6px 10px" : "10px 14px", u = "1px solid rgba(148, 163, 184, 0.35)", d = r ? { border: u } : { borderBottom: u };
1954
+ return /* @__PURE__ */ c("div", {
1955
+ ref: o,
1956
+ style: {
1957
+ width: "100%",
1958
+ overflowX: "auto",
1959
+ ...p(a)
1960
+ },
1961
+ children: /* @__PURE__ */ l("table", {
1962
+ style: {
1963
+ width: "100%",
1964
+ borderCollapse: "collapse",
1965
+ fontSize: 14,
1966
+ ...r ? { border: u } : {}
1967
+ },
1968
+ children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: e.map((e, t) => /* @__PURE__ */ c("th", {
1969
+ style: {
1970
+ textAlign: "left",
1971
+ fontWeight: 600,
1972
+ padding: s,
1973
+ background: "rgba(148, 163, 184, 0.12)",
1974
+ ...d
1975
+ },
1976
+ children: e.label ?? e
1977
+ }, t)) }) }), /* @__PURE__ */ c("tbody", { children: t.map((t, r) => /* @__PURE__ */ c("tr", {
1978
+ style: n && r % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
1979
+ children: e.map((e, n) => /* @__PURE__ */ c("td", {
1980
+ style: {
1981
+ padding: s,
1982
+ ...d
1983
+ },
1984
+ children: t?.[n] ?? ""
1985
+ }, n))
1986
+ }, r)) })]
1987
+ })
1988
+ });
1989
+ }
1990
+ var ut = {
1991
+ PageRoot: le,
1992
+ Section: ue,
1993
+ Container: de,
1994
+ Heading: fe,
1995
+ TextBlock: Ce,
1996
+ ButtonBlock: Ee,
1997
+ ImageBlock: De,
1998
+ Spacer: Ne,
1999
+ Divider: Pe,
2000
+ SliderBlock: Be,
2001
+ CanvasSlider: Ve,
2002
+ TabsBlock: We,
2003
+ QuickStack: it,
2004
+ CollectionList: at,
2005
+ BreadcrumbsBlock: ot,
2006
+ PaginationBlock: st,
2007
+ StepperBlock: ct,
2008
+ TableBlock: lt,
2009
+ AccordionBlock: Ge,
2010
+ NavbarBlock: Ue,
2011
+ ListBlock: Se,
2012
+ TextSpan: he,
2013
+ QuoteBlock: xe,
2014
+ TextLink: Te,
2015
+ RichTextBlock: ye,
2016
+ RichContentBlock: ye,
2017
+ VideoBlock: Oe,
2018
+ YouTubeBlock: Ae,
2019
+ IframeBlock: je,
2020
+ EmbedBlock: Me,
2021
+ FormBlock: Xe,
2022
+ FormLabel: Ze,
2023
+ FormInput: Qe,
2024
+ FormTextarea: $e,
2025
+ FormCheckbox: (e) => /* @__PURE__ */ c(et, {
1671
2026
  kind: "checkbox",
1672
2027
  ...e
1673
2028
  }),
1674
- FormRadio: (e) => /* @__PURE__ */ s(Ke, {
2029
+ FormRadio: (e) => /* @__PURE__ */ c(et, {
1675
2030
  kind: "radio",
1676
2031
  ...e
1677
2032
  }),
1678
- FormSelect: qe,
1679
- FormFile: Je,
1680
- FormSubmit: Ye
2033
+ FormSelect: tt,
2034
+ FormFile: nt,
2035
+ FormSubmit: rt
1681
2036
  };
1682
2037
  //#endregion
1683
2038
  //#region ../ui/src/components/builder/render.jsx
1684
- function $(t, n, r, i = /* @__PURE__ */ new Set()) {
1685
- let a = n[t];
1686
- if (!a || a.hidden) return null;
1687
- let o = a.type?.resolvedName;
1688
- if (o === "ComponentInstance") {
1689
- let n = a.props?.componentId, o = r?.[n];
1690
- if (!o?.template || i.has(n)) return null;
1691
- let c = new Set(i).add(n);
1692
- return /* @__PURE__ */ s(e, { children: $(o.template.rootId, o.template.nodes, r, c) }, t);
2039
+ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2040
+ let o = n[t];
2041
+ if (!o || o.hidden) return null;
2042
+ let s = o.type?.resolvedName, l = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
2043
+ if (s === "ComponentInstance") {
2044
+ let n = o.props?.componentId, s = r?.[n];
2045
+ if (!s?.template || i.has(n)) return null;
2046
+ let l = new Set(i).add(n);
2047
+ return /* @__PURE__ */ c(e, { children: $(s.template.rootId, s.template.nodes, r, l, a) }, t);
1693
2048
  }
1694
- let c = Ze[o];
1695
- if (!c) return null;
1696
- let l = (a.nodes ?? []).map((e) => $(e, n, r, i)).filter(Boolean), u = Object.entries(a.linkedNodes ?? {}), d = u.length ? Object.fromEntries(u.map(([e, t]) => [e, $(t, n, r, i)])) : void 0;
1697
- return /* @__PURE__ */ s(c, {
1698
- ...a.props,
1699
- linked: d,
2049
+ let u = ut[s];
2050
+ if (!u) return null;
2051
+ 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;
2052
+ return /* @__PURE__ */ c(u, {
2053
+ ...l,
2054
+ ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
2055
+ linked: p,
1700
2056
  nodeRef: (e) => {
1701
- e && (e.setAttribute("data-wb", t), g(e, a.props ?? {}));
2057
+ e && (e.setAttribute("data-wb", t), _(e, l));
1702
2058
  },
1703
- children: l.length ? l : void 0
2059
+ children: d.length ? d : void 0
1704
2060
  }, t);
1705
2061
  }
1706
2062
  //#endregion
1707
2063
  //#region ../ui/src/components/builder/PageRenderer.jsx
1708
- var Qe = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
1709
- function $e({ blocks: e, theme: t, components: n, mode: i = "auto", style: a, custom: o, tenant: l, apiUrl: u }) {
1710
- let d = o?.js?.trim();
2064
+ var dt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2065
+ function ft({ blocks: e, theme: t, components: n, mode: a = "auto", style: o, custom: s, tenant: u, apiUrl: d, datasets: f }) {
2066
+ let p = s?.js?.trim();
1711
2067
  if (r(() => {
1712
- if (!d) return;
2068
+ if (!p) return;
1713
2069
  let e = document.createElement("script");
1714
- return e.text = d, document.body.appendChild(e), () => e.remove();
1715
- }, [d]), !e?.ROOT) return null;
1716
- let f = {
2070
+ return e.text = p, document.body.appendChild(e), () => e.remove();
2071
+ }, [p]), !e?.ROOT) return null;
2072
+ let m = {
1717
2073
  minHeight: "100%",
1718
2074
  display: "flex",
1719
2075
  flexDirection: "column"
1720
- }, p = $("ROOT", e, n), m = C(e, n), h = ee(e, n), g = o?.css?.trim(), _ = R(e, n).map((e) => /* @__PURE__ */ s("link", {
2076
+ }, 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 = z(e, n).map((e) => /* @__PURE__ */ c("link", {
1721
2077
  rel: "stylesheet",
1722
2078
  precedence: "default",
1723
- href: I(e)
2079
+ href: re(e)
1724
2080
  }, e));
1725
- if (i !== "auto") return /* @__PURE__ */ s(z.Provider, {
2081
+ if (a !== "auto") return /* @__PURE__ */ c(B.Provider, {
1726
2082
  value: {
1727
- tenant: l || "",
1728
- apiUrl: u || "/api"
2083
+ tenant: u || "",
2084
+ apiUrl: d || "/api"
1729
2085
  },
1730
- children: /* @__PURE__ */ c("div", {
1731
- style: {
1732
- ...f,
1733
- ...te(t, i),
1734
- ...a
1735
- },
1736
- children: [
1737
- _,
1738
- m && /* @__PURE__ */ s("style", { children: m }),
1739
- h && /* @__PURE__ */ s("style", { children: h }),
1740
- g && /* @__PURE__ */ s("style", { children: g }),
1741
- p
1742
- ]
2086
+ children: /* @__PURE__ */ c(V.Provider, {
2087
+ value: f ?? null,
2088
+ children: /* @__PURE__ */ c(H.Provider, {
2089
+ value: g,
2090
+ children: /* @__PURE__ */ l("div", {
2091
+ style: {
2092
+ ...m,
2093
+ ...P(t, a),
2094
+ ...o
2095
+ },
2096
+ children: [
2097
+ b,
2098
+ _ && /* @__PURE__ */ c("style", { children: _ }),
2099
+ v && /* @__PURE__ */ c("style", { children: v }),
2100
+ y && /* @__PURE__ */ c("style", { children: y }),
2101
+ h
2102
+ ]
2103
+ })
2104
+ })
1743
2105
  })
1744
2106
  });
1745
- let v = A(t);
1746
- return /* @__PURE__ */ s(z.Provider, {
2107
+ let x = M(t);
2108
+ return /* @__PURE__ */ c(B.Provider, {
1747
2109
  value: {
1748
- tenant: l || "",
1749
- apiUrl: u || "/api"
2110
+ tenant: u || "",
2111
+ apiUrl: d || "/api"
1750
2112
  },
1751
- children: /* @__PURE__ */ c("div", {
1752
- className: "webim-page",
1753
- style: {
1754
- ...f,
1755
- ...M(t),
1756
- ...a
1757
- },
1758
- children: [
1759
- /* @__PURE__ */ s("style", { children: `.webim-page { ${Qe(j(v.light))} }
1760
- @media (prefers-color-scheme: dark) { .webim-page { ${Qe(j(v.dark))} } }` }),
1761
- _,
1762
- m && /* @__PURE__ */ s("style", { children: m }),
1763
- h && /* @__PURE__ */ s("style", { children: h }),
1764
- g && /* @__PURE__ */ s("style", { children: g }),
1765
- p
1766
- ]
2113
+ children: /* @__PURE__ */ c(V.Provider, {
2114
+ value: f ?? null,
2115
+ children: /* @__PURE__ */ c(H.Provider, {
2116
+ value: g,
2117
+ children: /* @__PURE__ */ l("div", {
2118
+ className: "webim-page",
2119
+ style: {
2120
+ ...m,
2121
+ ...ee(t),
2122
+ ...o
2123
+ },
2124
+ children: [
2125
+ /* @__PURE__ */ c("style", { children: `.webim-page { ${dt(N(x.light))} }
2126
+ @media (prefers-color-scheme: dark) { .webim-page { ${dt(N(x.dark))} } }` }),
2127
+ b,
2128
+ _ && /* @__PURE__ */ c("style", { children: _ }),
2129
+ v && /* @__PURE__ */ c("style", { children: v }),
2130
+ y && /* @__PURE__ */ c("style", { children: y }),
2131
+ h
2132
+ ]
2133
+ })
2134
+ })
1767
2135
  })
1768
2136
  });
1769
2137
  }
1770
2138
  //#endregion
1771
2139
  //#region src/WebimContent.jsx
1772
- function et({ bundle: e, mode: t = "auto", style: n }) {
1773
- return e?.blocks?.ROOT ? /* @__PURE__ */ s($e, {
2140
+ function pt({ bundle: e, mode: t = "auto", style: n }) {
2141
+ return e?.blocks?.ROOT ? /* @__PURE__ */ c(ft, {
1774
2142
  blocks: e.blocks,
1775
2143
  theme: e.theme,
1776
2144
  components: e.components,
1777
2145
  custom: e.custom,
1778
2146
  tenant: e.tenant,
1779
2147
  apiUrl: e.apiUrl,
2148
+ datasets: e.datasets,
1780
2149
  mode: t,
1781
2150
  style: n
1782
2151
  }) : null;
1783
2152
  }
1784
2153
  //#endregion
1785
2154
  //#region src/WebimPage.jsx
1786
- function tt({ apiUrl: e, tenant: t, slug: n, locale: o, preview: c, mode: l = "auto", style: u, fallback: d = null, errorFallback: f = null, onLoad: p, onError: m }) {
1787
- let [h, g] = a({ status: "loading" }), _ = i({
2155
+ function mt({ 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 }) {
2156
+ let [h, g] = o({ status: "loading" }), _ = a({
1788
2157
  onLoad: p,
1789
2158
  onError: m
1790
2159
  });
@@ -1793,12 +2162,12 @@ function tt({ apiUrl: e, tenant: t, slug: n, locale: o, preview: c, mode: l = "a
1793
2162
  onError: m
1794
2163
  }, r(() => {
1795
2164
  let r = !0;
1796
- return g({ status: "loading" }), P({
2165
+ return g({ status: "loading" }), L({
1797
2166
  apiUrl: e,
1798
2167
  tenant: t,
1799
2168
  slug: n,
1800
- locale: o,
1801
- preview: c
2169
+ locale: i,
2170
+ preview: s
1802
2171
  }).then((e) => {
1803
2172
  r && (g({
1804
2173
  status: "ready",
@@ -1816,13 +2185,13 @@ function tt({ apiUrl: e, tenant: t, slug: n, locale: o, preview: c, mode: l = "a
1816
2185
  e,
1817
2186
  t,
1818
2187
  n,
1819
- o,
1820
- c
1821
- ]), h.status === "loading" ? d : h.status === "error" ? typeof f == "function" ? f(h.error) : f : /* @__PURE__ */ s(et, {
2188
+ i,
2189
+ s
2190
+ ]), h.status === "loading" ? d : h.status === "error" ? typeof f == "function" ? f(h.error) : f : /* @__PURE__ */ c(pt, {
1822
2191
  bundle: h.bundle,
1823
2192
  mode: l,
1824
2193
  style: u
1825
2194
  });
1826
2195
  }
1827
2196
  //#endregion
1828
- export { $e as PageRenderer, et as WebimContent, tt as WebimPage, P as fetchPage, ue as renderRichContent, N as resolveTheme };
2197
+ export { ft as PageRenderer, pt as WebimContent, mt as WebimPage, L as fetchPage, ve as renderRichContent, F as resolveTheme };