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