webim-adapter 0.8.0 → 0.10.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,8 +1,8 @@
1
1
  import { renderToStaticMarkup as e } from "react-dom/server";
2
- import { Fragment as t, createContext as n, useContext as r, useEffect as i, useId as a, useMemo as o, useState as s } from "react";
3
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
2
+ import { Fragment as t, createContext as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s, useRef as c, useState as l } from "react";
3
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
4
4
  //#region ../ui/src/components/builder/locale.js
5
- var d = /* @__PURE__ */ new Set([
5
+ var p = /* @__PURE__ */ new Set([
6
6
  "ar",
7
7
  "he",
8
8
  "fa",
@@ -13,7 +13,7 @@ var d = /* @__PURE__ */ new Set([
13
13
  "yi",
14
14
  "dv",
15
15
  "ckb"
16
- ]), f = (e) => d.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", p = (e, t) => e === "ltr" || e === "rtl" ? e : t ? f(t) : void 0;
16
+ ]), m = (e) => p.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", h = (e, t) => e === "ltr" || e === "rtl" ? e : t ? m(t) : void 0;
17
17
  new Map([
18
18
  {
19
19
  family: "Bebas Neue",
@@ -120,14 +120,14 @@ new Map([
120
120
  fallback: "sans-serif"
121
121
  }
122
122
  ].map((e) => [e.family, e]));
123
- function m(e) {
123
+ function g(e) {
124
124
  return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
125
125
  }
126
- var h = (e) => m([e]), g = (e) => {
126
+ var _ = (e) => g([e]), v = (e) => {
127
127
  let t = typeof e == "string" && e.match(/^"([^"]+)"/);
128
128
  return t ? t[1] : null;
129
129
  };
130
- function _(e, t) {
130
+ function y(e, t) {
131
131
  let n = /* @__PURE__ */ new Set(), r = (e) => {
132
132
  for (let t of Object.values(e || {})) for (let e of [
133
133
  "style",
@@ -135,7 +135,7 @@ function _(e, t) {
135
135
  "pressed",
136
136
  "focused"
137
137
  ]) {
138
- let r = g(t.props?.[e]?.fontFamily);
138
+ let r = v(t.props?.[e]?.fontFamily);
139
139
  r && n.add(r);
140
140
  }
141
141
  };
@@ -145,36 +145,36 @@ function _(e, t) {
145
145
  }
146
146
  //#endregion
147
147
  //#region ../ui/src/components/builder/styles.js
148
- var v = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), y = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, b = [
148
+ var b = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), x = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, S = [
149
149
  "borderWidth",
150
150
  "borderStyle",
151
151
  "borderColor",
152
152
  "borderRadius",
153
153
  "gap"
154
154
  ];
155
- function x(e) {
155
+ function C(e) {
156
156
  let t = {};
157
- for (let n of b) {
157
+ for (let n of S) {
158
158
  let r = e?.[n];
159
- r != null && r !== "" && (t[n] = v.has(n) ? y(r) : r);
159
+ r != null && r !== "" && (t[n] = b.has(n) ? x(r) : r);
160
160
  }
161
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || b.includes(n) || (t[n] = v.has(n) ? y(r) : r);
161
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || S.includes(n) || (t[n] = b.has(n) ? x(r) : r);
162
162
  let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
163
163
  delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
164
164
  let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
165
165
  delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
166
- let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${y(e.x ?? 0)} ${y(e.y ?? 0)} ${y(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
166
+ let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${x(e.x ?? 0)} ${x(e.y ?? 0)} ${x(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
167
167
  [
168
168
  s,
169
169
  c,
170
170
  l,
171
171
  u
172
- ].some((e) => e !== void 0) && d.push(`${y(s ?? 0)} ${y(c ?? 0)} ${y(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
173
- let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${y(e.x ?? 0)}, ${y(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: m, translateX: h, translateY: g, scale: _, rotate: x, skewX: S, skewY: C } = t;
172
+ ].some((e) => e !== void 0) && d.push(`${x(s ?? 0)} ${x(c ?? 0)} ${x(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
173
+ let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${x(e.x ?? 0)}, ${x(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: m, translateX: h, translateY: g, scale: _, rotate: v, skewX: y, skewY: C } = t;
174
174
  delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
175
175
  let w = (Array.isArray(m) ? m : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
176
- (h !== void 0 || g !== void 0) && w.push(`translate(${y(h ?? 0)}, ${y(g ?? 0)})`), _ !== void 0 && w.push(`scale(${_})`), 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(" "));
177
- let T = (e) => `${e.inset ? "inset " : ""}${y(e.x ?? 0)} ${y(e.y ?? 0)} ${y(e.blur ?? 0)} ${y(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;
176
+ (h !== void 0 || g !== void 0) && w.push(`translate(${x(h ?? 0)}, ${x(g ?? 0)})`), _ !== void 0 && w.push(`scale(${_})`), v !== void 0 && w.push(`rotate(${f(v)})`), (y !== void 0 || C !== void 0) && w.push(`skew(${f(y ?? 0)}, ${f(C ?? 0)})`), w.length && (t.transform = w.join(" "));
177
+ let T = (e) => `${e.inset ? "inset " : ""}${x(e.x ?? 0)} ${x(e.y ?? 0)} ${x(e.blur ?? 0)} ${x(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;
178
178
  delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
179
179
  let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
180
180
  [
@@ -192,76 +192,76 @@ function x(e) {
192
192
  color: j,
193
193
  inset: M
194
194
  })), N.length && (t.boxShadow = N.join(", "));
195
- let P = (e) => e.type === "blur" ? `blur(${y(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: V, filterSaturate: ee } = t;
195
+ let P = (e) => e.type === "blur" ? `blur(${x(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: ee, filterContrast: te, filterSaturate: B } = t;
196
196
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
197
- let H = F(I);
198
- R !== void 0 && H.push(`blur(${y(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), B !== void 0 && H.push(`brightness(${B}%)`), V !== void 0 && H.push(`contrast(${V}%)`), ee !== void 0 && H.push(`saturate(${ee}%)`), H.length && (t.filter = H.join(" "));
199
- let te = F(L);
200
- te.length && (t.backdropFilter = te.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
201
- let { textStrokeWidth: U, textStrokeColor: W } = t;
202
- delete t.textStrokeWidth, delete t.textStrokeColor, (U !== void 0 || W !== void 0) && (t.WebkitTextStroke = `${y(U ?? 1)} ${W || "currentColor"}`);
203
- let { clipText: G } = t;
204
- delete t.clipText, G && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
205
- let { transitions: ne, transitionDuration: K, transitionEasing: re, transitionProperty: q } = t, ie = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
197
+ let V = F(I);
198
+ R !== void 0 && V.push(`blur(${x(R)})`), z !== void 0 && V.push(`grayscale(${z}%)`), ee !== void 0 && V.push(`brightness(${ee}%)`), te !== void 0 && V.push(`contrast(${te}%)`), B !== void 0 && V.push(`saturate(${B}%)`), V.length && (t.filter = V.join(" "));
199
+ let ne = F(L);
200
+ ne.length && (t.backdropFilter = ne.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
201
+ let { textStrokeWidth: re, textStrokeColor: ie } = t;
202
+ delete t.textStrokeWidth, delete t.textStrokeColor, (re !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${x(re ?? 1)} ${ie || "currentColor"}`);
203
+ let { clipText: H } = t;
204
+ delete t.clipText, H && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
205
+ let { transitions: U, transitionDuration: W, transitionEasing: ae, transitionProperty: G } = t, oe = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
206
206
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
207
- let J = (Array.isArray(ne) ? ne : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ie(e.duration ?? 200)} ${e.easing || "ease"}`);
208
- if (K !== void 0 && J.push(`${q || "all"} ${ie(K)} ${re || "ease"}`), J.length && (t.transition = J.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
207
+ let K = (Array.isArray(U) ? U : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${oe(e.duration ?? 200)} ${e.easing || "ease"}`);
208
+ if (W !== void 0 && K.push(`${G || "all"} ${oe(W)} ${ae || "ease"}`), K.length && (t.transition = K.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
209
209
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
210
210
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
211
211
  }
212
212
  delete t.backgroundVideo;
213
- let { overlayColor: Y, overlayOpacity: X } = t;
214
- if (delete t.overlayColor, delete t.overlayOpacity, Y) {
215
- let e = `color-mix(in srgb, ${Y} ${X ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
213
+ let { overlayColor: se, overlayOpacity: ce } = t;
214
+ if (delete t.overlayColor, delete t.overlayOpacity, se) {
215
+ let e = `color-mix(in srgb, ${se} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
216
216
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
217
217
  }
218
218
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
219
- let { backgroundLayers: ae } = t;
219
+ let { backgroundLayers: le } = t;
220
220
  delete t.backgroundLayers;
221
- let oe = (Array.isArray(ae) ? ae : []).filter((e) => e && e.on !== !1);
222
- if (oe.length) {
221
+ let q = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
222
+ if (q.length) {
223
223
  let e = [], n = [], r = [], i = [], a = [];
224
- for (let t of oe) 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");
224
+ for (let t of q) 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");
225
225
  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");
226
226
  else {
227
227
  if (!t.src) continue;
228
- e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${y(t.w ?? "auto")} ${y(t.h ?? "auto")}` : t.size || "cover"), r.push(`${y(t.posX ?? 0)} ${y(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
228
+ e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${x(t.w ?? "auto")} ${x(t.h ?? "auto")}` : t.size || "cover"), r.push(`${x(t.posX ?? 0)} ${x(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
229
229
  }
230
230
  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(", "));
231
231
  }
232
232
  return t;
233
233
  }
234
- var S = {
234
+ var w = {
235
235
  hover: ":hover",
236
236
  pressed: ":active",
237
237
  focused: ":focus"
238
- }, C = /* @__PURE__ */ new Set([
238
+ }, T = /* @__PURE__ */ new Set([
239
239
  "style",
240
240
  "class",
241
241
  "id",
242
242
  "data-wb",
243
243
  "data-wb-class",
244
244
  "data-slot"
245
- ]), w = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !C.has(e.toLowerCase());
246
- function T(e, t, n = []) {
245
+ ]), E = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !T.has(e.toLowerCase());
246
+ function D(e, t, n = []) {
247
247
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
248
248
  for (let t of n) e.removeAttribute(t);
249
249
  let r = [];
250
250
  for (let n of t.attributes ?? []) {
251
251
  let t = String(n?.name ?? "").trim();
252
- w(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
252
+ E(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
253
253
  }
254
254
  return r;
255
255
  }
256
- var E = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
257
- function D(e, t, n, r = !1) {
258
- let i = Object.entries(x(t)).map(([e, t]) => `${E(e)}: ${t} !important;`).join(" ");
256
+ var O = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
257
+ function k(e, t, n, r = !1) {
258
+ let i = Object.entries(C(t)).map(([e, t]) => `${O(e)}: ${t} !important;`).join(" ");
259
259
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
260
260
  }
261
- function O(e, t, n) {
262
- return Object.entries(S).map(([r, i]) => D(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
261
+ function A(e, t, n) {
262
+ return Object.entries(w).map(([r, i]) => k(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
263
263
  }
264
- var k = [
264
+ var j = [
265
265
  {
266
266
  key: "tablet",
267
267
  max: 991
@@ -274,17 +274,17 @@ var k = [
274
274
  key: "mobile",
275
275
  max: 478
276
276
  }
277
- ], A = (e) => Object.entries(x(e)).map(([e, t]) => `${E(e)}: ${t} !important;`).join(" ");
278
- function j(e, t) {
279
- return k.map(({ key: n, max: r }) => {
280
- let i = t?.[n] ? A(t[n]) : "";
277
+ ], M = (e) => Object.entries(C(e)).map(([e, t]) => `${O(e)}: ${t} !important;`).join(" ");
278
+ function N(e, t) {
279
+ return j.map(({ key: n, max: r }) => {
280
+ let i = t?.[n] ? M(t[n]) : "";
281
281
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
282
282
  }).filter(Boolean).join("\n");
283
283
  }
284
- function M(e, t) {
284
+ function P(e, t) {
285
285
  let n = [], r = (e) => {
286
286
  for (let [t, r] of Object.entries(e || {})) {
287
- let e = j(t, r.props);
287
+ let e = N(t, r.props);
288
288
  e && n.push(e);
289
289
  }
290
290
  };
@@ -292,10 +292,10 @@ function M(e, t) {
292
292
  for (let e of Object.values(t || {})) r(e.template?.nodes);
293
293
  return n.join("\n");
294
294
  }
295
- function N(e, t) {
295
+ function F(e, t) {
296
296
  let n = [], r = (e) => {
297
297
  for (let [t, r] of Object.entries(e || {})) {
298
- let e = O(t, r.props);
298
+ let e = A(t, r.props);
299
299
  e && n.push(e);
300
300
  }
301
301
  };
@@ -303,7 +303,7 @@ function N(e, t) {
303
303
  for (let e of Object.values(t || {})) r(e.template?.nodes);
304
304
  return n.join("\n");
305
305
  }
306
- var P = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", F = {
306
+ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", L = {
307
307
  light: {
308
308
  background: "#ffffff",
309
309
  text: "#111827",
@@ -340,23 +340,23 @@ var P = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
340
340
  contrastText: "#052e2b"
341
341
  }
342
342
  }
343
- }, I = {
343
+ }, R = {
344
344
  font: "system",
345
345
  headingFont: "inherit",
346
- light: F.light,
347
- dark: F.dark
348
- }, L = {
346
+ light: L.light,
347
+ dark: L.dark
348
+ }, z = {
349
349
  system: {
350
350
  label: "System",
351
- value: P
351
+ value: I
352
352
  },
353
353
  inter: {
354
354
  label: "Inter",
355
- value: `"Inter", ${P}`
355
+ value: `"Inter", ${I}`
356
356
  },
357
357
  outfit: {
358
358
  label: "Outfit",
359
- value: `"Outfit", ${P}`
359
+ value: `"Outfit", ${I}`
360
360
  },
361
361
  serif: {
362
362
  label: "Serif",
@@ -366,7 +366,7 @@ var P = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
366
366
  label: "Mono",
367
367
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
368
368
  }
369
- }, R = (e, t) => L[e]?.value ?? t, z = (e, ...t) => {
369
+ }, ee = (e, t) => z[e]?.value ?? t, te = (e, ...t) => {
370
370
  let n = Object.assign({}, e, ...t);
371
371
  return n.primary = {
372
372
  ...e.primary,
@@ -385,10 +385,10 @@ var P = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
385
385
  function B(e) {
386
386
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
387
387
  return {
388
- font: r ?? I.font,
389
- headingFont: i ?? I.headingFont,
390
- light: z(F.light, a, t),
391
- dark: z(F.dark, n)
388
+ font: r ?? R.font,
389
+ headingFont: i ?? R.headingFont,
390
+ light: te(L.light, a, t),
391
+ dark: te(L.dark, n)
392
392
  };
393
393
  }
394
394
  function V(e) {
@@ -407,36 +407,37 @@ function V(e) {
407
407
  "--page-secondary-contrast": e.secondary.contrastText
408
408
  };
409
409
  }
410
- function ee(e) {
410
+ function ne(e) {
411
411
  let t = B(e);
412
412
  return {
413
413
  backgroundColor: "var(--page-bg)",
414
414
  color: "var(--page-text)",
415
- fontFamily: R(t.font, P),
416
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : R(t.headingFont, "inherit")
415
+ fontFamily: ee(t.font, I),
416
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : ee(t.headingFont, "inherit")
417
417
  };
418
418
  }
419
- function H(e, t = "light") {
419
+ function re(e, t = "light") {
420
420
  let n = B(e);
421
421
  return {
422
- ...ee(e),
422
+ ...ne(e),
423
423
  ...V(n[t] ?? n.light)
424
424
  };
425
425
  }
426
- function te(e, t) {
426
+ function ie(e, t) {
427
427
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
428
428
  }
429
429
  //#endregion
430
430
  //#region ../ui/src/components/builder/views.jsx
431
- var U = n({
431
+ var H = n({
432
432
  tenant: "",
433
433
  apiUrl: "/api",
434
- locale: ""
435
- }), W = n(null), G = n(null), ne = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
436
- function K(e, t) {
434
+ locale: "",
435
+ settings: null
436
+ }), U = n(null), W = n(null), ae = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
437
+ function G(e, t) {
437
438
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
438
439
  }
439
- var re = (e) => {
440
+ var oe = (e) => {
440
441
  let t = [];
441
442
  for (let [n, r] of Object.entries(e ?? {})) {
442
443
  if (!/^[\w-]+$/.test(n)) continue;
@@ -446,36 +447,36 @@ var re = (e) => {
446
447
  }
447
448
  return t;
448
449
  };
449
- function q(e) {
450
+ function K(e) {
450
451
  return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
451
452
  }
452
- function ie(e, t) {
453
- let n = t?.data ?? {}, r = re(n);
453
+ function se(e, t) {
454
+ let n = t?.data ?? {}, r = oe(n);
454
455
  if (!r.length) return e;
455
- let i = RegExp(`:(${r.map(ne).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => q(K(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
456
+ let i = RegExp(`:(${r.map(ae).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(G(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
456
457
  return a(e);
457
458
  }
458
- var J = {
459
+ var ce = {
459
460
  margin: 0,
460
461
  fontWeight: 700,
461
462
  lineHeight: 1.2,
462
463
  fontFamily: "var(--page-heading-font, inherit)"
463
- }, Y = { margin: 0 }, X = {
464
+ }, le = { margin: 0 }, q = {
464
465
  display: "inline-block",
465
466
  textDecoration: "none",
466
467
  cursor: "pointer",
467
468
  backgroundColor: "var(--page-accent, #111827)",
468
469
  color: "var(--page-accent-text, #ffffff)"
469
- }, ae = {
470
+ }, ue = {
470
471
  flexGrow: 1,
471
472
  display: "flex",
472
473
  flexDirection: "column",
473
474
  position: "relative"
474
- }, oe = {
475
+ }, de = {
475
476
  display: "flex",
476
477
  flexDirection: "column"
477
478
  };
478
- function se({ style: e }) {
479
+ function fe({ style: e }) {
479
480
  let t = e?.backgroundVideo;
480
481
  if (!t) return null;
481
482
  let n = {
@@ -486,7 +487,7 @@ function se({ style: e }) {
486
487
  zIndex: -1,
487
488
  pointerEvents: "none"
488
489
  }, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
489
- return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("video", {
490
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("video", {
490
491
  src: t,
491
492
  autoPlay: !0,
492
493
  muted: !0,
@@ -496,73 +497,73 @@ function se({ style: e }) {
496
497
  ...n,
497
498
  objectFit: "cover"
498
499
  }
499
- }), r && /* @__PURE__ */ l("div", { style: {
500
+ }), r && /* @__PURE__ */ d("div", { style: {
500
501
  ...n,
501
502
  background: r
502
503
  } })] });
503
504
  }
504
- var ce = (e, t) => e?.backgroundVideo ? {
505
+ var pe = (e, t) => e?.backgroundVideo ? {
505
506
  position: "relative",
506
507
  ...t,
507
- ...x(e)
508
+ ...C(e)
508
509
  } : {
509
510
  ...t,
510
- ...x(e)
511
+ ...C(e)
511
512
  };
512
- function le({ style: e, nodeRef: t, children: n }) {
513
- return /* @__PURE__ */ u("div", {
513
+ function me({ style: e, nodeRef: t, children: n }) {
514
+ return /* @__PURE__ */ f("div", {
514
515
  ref: t,
515
516
  style: {
516
- ...ae,
517
- ...x(e)
517
+ ...ue,
518
+ ...C(e)
518
519
  },
519
- children: [/* @__PURE__ */ l(se, { style: e }), n]
520
+ children: [/* @__PURE__ */ d(fe, { style: e }), n]
520
521
  });
521
522
  }
522
- function ue({ style: e, nodeRef: t, children: n }) {
523
- return /* @__PURE__ */ u("section", {
523
+ function he({ style: e, nodeRef: t, children: n }) {
524
+ return /* @__PURE__ */ f("section", {
524
525
  ref: t,
525
- style: ce(e, oe),
526
- children: [/* @__PURE__ */ l(se, { style: e }), n]
526
+ style: pe(e, de),
527
+ children: [/* @__PURE__ */ d(fe, { style: e }), n]
527
528
  });
528
529
  }
529
- function de({ style: e, freeLayout: t, nodeRef: n, children: r }) {
530
+ function ge({ style: e, freeLayout: t, nodeRef: n, children: r }) {
530
531
  let i = t ? {
531
532
  position: "relative",
532
533
  minHeight: 240
533
534
  } : null;
534
- return /* @__PURE__ */ u("div", {
535
+ return /* @__PURE__ */ f("div", {
535
536
  ref: n,
536
537
  style: i ? {
537
538
  ...i,
538
- ...ce(e)
539
- } : ce(e),
540
- children: [/* @__PURE__ */ l(se, { style: e }), r]
539
+ ...pe(e)
540
+ } : pe(e),
541
+ children: [/* @__PURE__ */ d(fe, { style: e }), r]
541
542
  });
542
543
  }
543
- function fe({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
544
- return /* @__PURE__ */ l(n, {
544
+ function _e({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
545
+ return /* @__PURE__ */ d(n, {
545
546
  ref: a,
546
547
  style: {
547
- ...J,
548
- ...x(r)
548
+ ...ce,
549
+ ...C(r)
549
550
  },
550
- children: Z(t, e, i)
551
+ children: J(t, e, i)
551
552
  });
552
553
  }
553
- var pe = {
554
- fontFamily: L.mono.value,
554
+ var ve = {
555
+ fontFamily: z.mono.value,
555
556
  background: "rgba(148, 163, 184, 0.18)",
556
557
  padding: "1px 5px",
557
558
  borderRadius: 4,
558
559
  fontSize: "0.9em"
559
560
  };
560
- function me(e, t = [], n, r) {
561
+ function ye(e, t = [], n, r) {
561
562
  let i = e;
562
- return t.includes("sup") ? i = /* @__PURE__ */ l("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ l("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ l("code", {
563
- style: pe,
563
+ return t.includes("sup") ? i = /* @__PURE__ */ d("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ d("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ d("code", {
564
+ style: ve,
564
565
  children: i
565
- })), t.includes("strike") && (i = /* @__PURE__ */ l("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ l("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ l("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ l("strong", { children: i })), n && (i = /* @__PURE__ */ l("a", {
566
+ })), t.includes("strike") && (i = /* @__PURE__ */ d("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ d("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ d("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ d("strong", { children: i })), n && (i = /* @__PURE__ */ d("a", {
566
567
  href: n,
567
568
  target: r || void 0,
568
569
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
@@ -570,36 +571,36 @@ function me(e, t = [], n, r) {
570
571
  children: i
571
572
  })), i;
572
573
  }
573
- function Z(e, n, r) {
574
+ function J(e, n, r) {
574
575
  return e?.length ? e.map((e, n) => {
575
- if (e.slot) return /* @__PURE__ */ l(t, { children: r?.[e.slot] ?? null }, n);
576
- if (e.parts) return /* @__PURE__ */ l(t, { children: Z(e.parts, "", r) }, n);
576
+ if (e.slot) return /* @__PURE__ */ d(t, { children: r?.[e.slot] ?? null }, n);
577
+ if (e.parts) return /* @__PURE__ */ d(t, { children: J(e.parts, "", r) }, n);
577
578
  let i = e.text;
578
- return e.sup ? i = /* @__PURE__ */ l("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ l("sub", { children: i })), e.code && (i = /* @__PURE__ */ l("code", {
579
- style: pe,
579
+ return e.sup ? i = /* @__PURE__ */ d("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ d("sub", { children: i })), e.code && (i = /* @__PURE__ */ d("code", {
580
+ style: ve,
580
581
  children: i
581
- })), e.strike && (i = /* @__PURE__ */ l("s", { children: i })), e.underline && (i = /* @__PURE__ */ l("u", { children: i })), e.italic && (i = /* @__PURE__ */ l("em", { children: i })), e.bold && (i = /* @__PURE__ */ l("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ l("span", {
582
+ })), e.strike && (i = /* @__PURE__ */ d("s", { children: i })), e.underline && (i = /* @__PURE__ */ d("u", { children: i })), e.italic && (i = /* @__PURE__ */ d("em", { children: i })), e.bold && (i = /* @__PURE__ */ d("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ d("span", {
582
583
  style: {
583
584
  ...e.color && { color: e.color },
584
585
  ...e.background && { backgroundColor: e.background }
585
586
  },
586
587
  children: i
587
- })), e.href && (i = /* @__PURE__ */ l("a", {
588
+ })), e.href && (i = /* @__PURE__ */ d("a", {
588
589
  href: e.href,
589
590
  target: e.target || void 0,
590
591
  rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
591
592
  style: { color: e.color ?? "inherit" },
592
593
  children: i
593
- })), /* @__PURE__ */ l(t, { children: i }, n);
594
+ })), /* @__PURE__ */ d(t, { children: i }, n);
594
595
  }) : n;
595
596
  }
596
- function he({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
597
- return /* @__PURE__ */ l("span", {
598
- style: x(a),
599
- children: e?.length ? Z(e, t) : me(t, n, r, i)
597
+ function be({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
598
+ return /* @__PURE__ */ d("span", {
599
+ style: C(a),
600
+ children: e?.length ? J(e, t) : ye(t, n, r, i)
600
601
  });
601
602
  }
602
- var ge = {
603
+ var xe = {
603
604
  h1: 40,
604
605
  h2: 32,
605
606
  h3: 26,
@@ -607,7 +608,7 @@ var ge = {
607
608
  h5: 19,
608
609
  h6: 16
609
610
  };
610
- function _e({ align: e = "center", width: t, wrap: n } = {}) {
611
+ function Se({ align: e = "center", width: t, wrap: n } = {}) {
611
612
  let r = t ? `${t}%` : void 0;
612
613
  if (e === "full") return { width: "100%" };
613
614
  let i = e === "left" || e === "right";
@@ -641,8 +642,8 @@ function _e({ align: e = "center", width: t, wrap: n } = {}) {
641
642
  marginRight: "auto"
642
643
  };
643
644
  }
644
- function ve(e = [], t, n) {
645
- let r = n ?? ((e, n) => Z(e, n, t));
645
+ function Ce(e = [], t, n) {
646
+ let r = n ?? ((e, n) => J(e, n, t));
646
647
  return e.map((t, n) => {
647
648
  let i = {
648
649
  marginTop: 0,
@@ -650,7 +651,7 @@ function ve(e = [], t, n) {
650
651
  };
651
652
  if (t.type === "image") {
652
653
  if (!t.src) return null;
653
- let e = /* @__PURE__ */ l("img", {
654
+ let e = /* @__PURE__ */ d("img", {
654
655
  src: t.src,
655
656
  alt: t.alt || "",
656
657
  style: {
@@ -659,20 +660,20 @@ function ve(e = [], t, n) {
659
660
  borderRadius: 6
660
661
  }
661
662
  });
662
- return /* @__PURE__ */ u("figure", {
663
+ return /* @__PURE__ */ f("figure", {
663
664
  style: {
664
665
  marginLeft: 0,
665
666
  marginRight: 0,
666
667
  ...i,
667
- ..._e(t)
668
+ ...Se(t)
668
669
  },
669
- children: [t.href ? /* @__PURE__ */ l("a", {
670
+ children: [t.href ? /* @__PURE__ */ d("a", {
670
671
  href: t.href,
671
672
  target: t.target || void 0,
672
673
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
673
674
  style: { display: "block" },
674
675
  children: e
675
- }) : e, t.caption && /* @__PURE__ */ l("figcaption", {
676
+ }) : e, t.caption && /* @__PURE__ */ d("figcaption", {
676
677
  style: {
677
678
  fontSize: 13,
678
679
  opacity: .65,
@@ -683,16 +684,16 @@ function ve(e = [], t, n) {
683
684
  })]
684
685
  }, n);
685
686
  }
686
- if (t.type === "video") return ke(t.url) ? /* @__PURE__ */ l("div", {
687
+ if (t.type === "video") return Pe(t.url) ? /* @__PURE__ */ d("div", {
687
688
  style: {
688
689
  ...i,
689
- ..._e({
690
+ ...Se({
690
691
  align: t.align,
691
692
  wrap: t.wrap,
692
693
  width: t.width ?? 100
693
694
  })
694
695
  },
695
- children: /* @__PURE__ */ l(Ae, {
696
+ children: /* @__PURE__ */ d(Fe, {
696
697
  url: t.url,
697
698
  autoplay: t.autoplay,
698
699
  muted: t.muted,
@@ -701,146 +702,146 @@ function ve(e = [], t, n) {
701
702
  start: t.start
702
703
  })
703
704
  }, n) : null;
704
- if (t.type === "divider") return /* @__PURE__ */ l("hr", { style: {
705
+ if (t.type === "divider") return /* @__PURE__ */ d("hr", { style: {
705
706
  ...i,
706
707
  border: 0,
707
708
  borderTop: "1px solid rgba(148, 163, 184, 0.4)"
708
709
  } }, n);
709
710
  if (t.type === "ul" || t.type === "ol") {
710
711
  let e = t.type;
711
- return /* @__PURE__ */ l(e, {
712
+ return /* @__PURE__ */ d(e, {
712
713
  style: {
713
714
  ...i,
714
715
  paddingLeft: 24
715
716
  },
716
- children: (t.items ?? []).map((e, t) => /* @__PURE__ */ l("li", {
717
+ children: (t.items ?? []).map((e, t) => /* @__PURE__ */ d("li", {
717
718
  style: { marginBottom: 4 },
718
719
  children: r(e.parts, e.text)
719
720
  }, t))
720
721
  }, n);
721
722
  }
722
- if (t.type === "quote") return /* @__PURE__ */ l("blockquote", {
723
+ if (t.type === "quote") return /* @__PURE__ */ d("blockquote", {
723
724
  style: {
724
- ...be,
725
+ ...Te,
725
726
  ...i
726
727
  },
727
728
  children: r(t.parts, t.text)
728
729
  }, n);
729
- if (ge[t.type]) {
730
+ if (xe[t.type]) {
730
731
  let e = t.type;
731
- return /* @__PURE__ */ l(e, {
732
+ return /* @__PURE__ */ d(e, {
732
733
  style: {
733
- ...J,
734
- fontSize: ge[t.type],
734
+ ...ce,
735
+ fontSize: xe[t.type],
735
736
  ...i
736
737
  },
737
738
  children: r(t.parts, t.text)
738
739
  }, n);
739
740
  }
740
- return /* @__PURE__ */ l("p", {
741
+ return /* @__PURE__ */ d("p", {
741
742
  style: {
742
- ...Y,
743
+ ...le,
743
744
  ...i
744
745
  },
745
746
  children: r(t.parts, t.text)
746
747
  }, n);
747
748
  });
748
749
  }
749
- function ye({ content: e, style: t, linked: n, nodeRef: r }) {
750
- return /* @__PURE__ */ l("div", {
750
+ function we({ content: e, style: t, linked: n, nodeRef: r }) {
751
+ return /* @__PURE__ */ d("div", {
751
752
  ref: r,
752
753
  style: {
753
754
  display: "flow-root",
754
- ...x(t)
755
+ ...C(t)
755
756
  },
756
- children: ve(e, n)
757
+ children: Ce(e, n)
757
758
  });
758
759
  }
759
- var be = {
760
+ var Te = {
760
761
  margin: 0,
761
762
  padding: "8px 0 8px 20px",
762
763
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
763
764
  };
764
- function xe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
765
- return /* @__PURE__ */ l("blockquote", {
765
+ function Ee({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
766
+ return /* @__PURE__ */ d("blockquote", {
766
767
  ref: i,
767
768
  style: {
768
- ...be,
769
- ...x(n)
769
+ ...Te,
770
+ ...C(n)
770
771
  },
771
- children: Z(t, e, r)
772
+ children: J(t, e, r)
772
773
  });
773
774
  }
774
- function Se({ ordered: e, items: t = [], style: n, nodeRef: r }) {
775
- return /* @__PURE__ */ l(e ? "ol" : "ul", {
775
+ function De({ ordered: e, items: t = [], style: n, nodeRef: r }) {
776
+ return /* @__PURE__ */ d(e ? "ol" : "ul", {
776
777
  ref: r,
777
778
  style: {
778
779
  margin: 0,
779
780
  paddingLeft: 24,
780
- ...x(n)
781
+ ...C(n)
781
782
  },
782
- children: t.map((e, t) => /* @__PURE__ */ l("li", {
783
+ children: t.map((e, t) => /* @__PURE__ */ d("li", {
783
784
  style: { marginBottom: 4 },
784
- children: Z(e.parts, e.text)
785
+ children: J(e.parts, e.text)
785
786
  }, t))
786
787
  });
787
788
  }
788
- function Ce({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
789
- return /* @__PURE__ */ l("p", {
789
+ function Oe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
790
+ return /* @__PURE__ */ d("p", {
790
791
  ref: i,
791
792
  style: {
792
- ...Y,
793
- ...x(n)
793
+ ...le,
794
+ ...C(n)
794
795
  },
795
- children: Z(t, e, r)
796
+ children: J(t, e, r)
796
797
  });
797
798
  }
798
- var we = {
799
+ var ke = {
799
800
  color: "var(--page-accent, inherit)",
800
801
  textDecoration: "underline",
801
802
  textUnderlineOffset: 3,
802
803
  cursor: "pointer"
803
804
  };
804
- function Te({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
805
- return /* @__PURE__ */ l("a", {
805
+ function Ae({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
806
+ return /* @__PURE__ */ d("a", {
806
807
  ref: o,
807
808
  href: n || "#",
808
809
  target: r || void 0,
809
810
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
810
811
  style: {
811
- ...we,
812
- ...x(i)
812
+ ...ke,
813
+ ...C(i)
813
814
  },
814
- children: Z(t, e, a)
815
+ children: J(t, e, a)
815
816
  });
816
817
  }
817
- function Ee({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
818
- return /* @__PURE__ */ l("a", {
818
+ function je({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
819
+ return /* @__PURE__ */ d("a", {
819
820
  ref: o,
820
821
  href: n || "#",
821
822
  target: r || void 0,
822
823
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
823
824
  style: {
824
- ...X,
825
- ...x(i)
825
+ ...q,
826
+ ...C(i)
826
827
  },
827
- children: Z(t, e, a)
828
+ children: J(t, e, a)
828
829
  });
829
830
  }
830
- function De({ src: e, alt: t, style: n, nodeRef: r }) {
831
- return e ? /* @__PURE__ */ l("img", {
831
+ function Me({ src: e, alt: t, style: n, nodeRef: r }) {
832
+ return e ? /* @__PURE__ */ d("img", {
832
833
  ref: r,
833
834
  src: e,
834
835
  alt: t || "",
835
836
  style: {
836
837
  display: "block",
837
838
  maxWidth: "100%",
838
- ...x(n)
839
+ ...C(n)
839
840
  }
840
841
  }) : null;
841
842
  }
842
- function Oe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
843
- return e ? /* @__PURE__ */ l("video", {
843
+ function Ne({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
844
+ return e ? /* @__PURE__ */ d("video", {
844
845
  ref: s,
845
846
  src: e,
846
847
  poster: t || void 0,
@@ -853,25 +854,25 @@ function Oe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
853
854
  display: "block",
854
855
  width: "100%",
855
856
  maxWidth: "100%",
856
- ...x(o)
857
+ ...C(o)
857
858
  }
858
859
  }) : null;
859
860
  }
860
- var ke = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
861
- function Ae({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
862
- let c = ke(e);
861
+ var Pe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
862
+ function Fe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
863
+ let c = Pe(e);
863
864
  if (!c) return null;
864
- let u = new URLSearchParams({ rel: "0" });
865
- 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", c)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ l("div", {
865
+ let l = new URLSearchParams({ rel: "0" });
866
+ return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ d("div", {
866
867
  ref: s,
867
868
  style: {
868
869
  position: "relative",
869
870
  width: "100%",
870
871
  paddingTop: "56.25%",
871
- ...x(o)
872
+ ...C(o)
872
873
  },
873
- children: /* @__PURE__ */ l("iframe", {
874
- src: `https://www.youtube-nocookie.com/embed/${c}?${u}`,
874
+ children: /* @__PURE__ */ d("iframe", {
875
+ src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
875
876
  title: "YouTube video",
876
877
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
877
878
  allowFullScreen: !0,
@@ -885,8 +886,8 @@ function Ae({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
885
886
  })
886
887
  });
887
888
  }
888
- function je({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
889
- return e ? /* @__PURE__ */ l("iframe", {
889
+ function Ie({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
890
+ return e ? /* @__PURE__ */ d("iframe", {
890
891
  ref: i,
891
892
  src: e,
892
893
  title: t || "Embedded frame",
@@ -897,31 +898,31 @@ function je({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
897
898
  width: "100%",
898
899
  height: 300,
899
900
  border: 0,
900
- ...x(r)
901
+ ...C(r)
901
902
  }
902
903
  }) : null;
903
904
  }
904
- function Me({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
905
- let [a, o] = s(null);
906
- return i(() => {
907
- a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
905
+ function Le({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
906
+ let [i, o] = l(null);
907
+ return a(() => {
908
+ i && (i.innerHTML = e || "", t && i.querySelectorAll("script").forEach((e) => {
908
909
  let t = document.createElement("script");
909
910
  for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
910
911
  t.text = e.textContent, e.replaceWith(t);
911
912
  }));
912
913
  }, [
913
- a,
914
+ i,
914
915
  e,
915
916
  t
916
- ]), /* @__PURE__ */ l("div", {
917
+ ]), /* @__PURE__ */ d("div", {
917
918
  ref: (e) => {
918
919
  o(e), r && r(e);
919
920
  },
920
- style: x(n)
921
+ style: C(n)
921
922
  });
922
923
  }
923
- function Ne({ height: e, nodeRef: t }) {
924
- return /* @__PURE__ */ l("div", {
924
+ function Re({ height: e, nodeRef: t }) {
925
+ return /* @__PURE__ */ d("div", {
925
926
  ref: t,
926
927
  style: {
927
928
  height: e || 32,
@@ -930,18 +931,18 @@ function Ne({ height: e, nodeRef: t }) {
930
931
  }
931
932
  });
932
933
  }
933
- function Pe({ style: e, nodeRef: t }) {
934
- return /* @__PURE__ */ l("div", {
934
+ function ze({ style: e, nodeRef: t }) {
935
+ return /* @__PURE__ */ d("div", {
935
936
  ref: t,
936
937
  style: {
937
938
  height: 1,
938
939
  alignSelf: "stretch",
939
940
  flexShrink: 0,
940
- ...x(e)
941
+ ...C(e)
941
942
  }
942
943
  });
943
944
  }
944
- var Fe = {
945
+ var Be = {
945
946
  position: "absolute",
946
947
  top: "50%",
947
948
  transform: "translateY(-50%)",
@@ -958,7 +959,7 @@ var Fe = {
958
959
  alignItems: "center",
959
960
  justifyContent: "center",
960
961
  padding: 0
961
- }, Ie = {
962
+ }, Ve = {
962
963
  bottom: {
963
964
  inset: "auto 0 0 0",
964
965
  padding: "40px 24px 20px",
@@ -977,10 +978,10 @@ var Fe = {
977
978
  padding: 24,
978
979
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
979
980
  }
980
- }, Le = 48;
981
- function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: d, nodeRef: f }) {
982
- let [p, m] = s(0), [h, g] = s(!1), [_, v] = s(null), y = e ? Math.min(p, e - 1) : 0;
983
- if (i(() => {
981
+ }, He = 48;
982
+ function Ue({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
983
+ let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
984
+ if (a(() => {
984
985
  if (!n || h || _ || e < 2) return;
985
986
  let t = setInterval(() => m((t) => (t + 1) % e), Math.max(2, Number(r) || 5) * 1e3);
986
987
  return () => clearInterval(t);
@@ -991,13 +992,13 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
991
992
  r,
992
993
  e
993
994
  ]), !e) return null;
994
- let b = (t) => m((t + e) % e), S = () => {
995
+ let b = (t) => m((t + e) % e), x = () => {
995
996
  if (!_) return;
996
997
  let { dx: e } = _;
997
- v(null), e < -48 ? b(y + 1) : e > Le && b(y - 1);
998
+ v(null), e < -48 ? b(y + 1) : e > He && b(y - 1);
998
999
  };
999
- return /* @__PURE__ */ u("div", {
1000
- ref: f,
1000
+ return /* @__PURE__ */ f("div", {
1001
+ ref: c,
1001
1002
  onMouseEnter: () => g(!0),
1002
1003
  onMouseLeave: () => g(!1),
1003
1004
  onPointerDown: o && e > 1 ? (e) => {
@@ -1010,8 +1011,8 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1010
1011
  ...t,
1011
1012
  dx: e.clientX - t.startX
1012
1013
  }) : void 0,
1013
- onPointerUp: S,
1014
- onPointerCancel: S,
1014
+ onPointerUp: x,
1015
+ onPointerCancel: x,
1015
1016
  style: {
1016
1017
  position: "relative",
1017
1018
  overflow: "hidden",
@@ -1019,16 +1020,16 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1019
1020
  touchAction: "pan-y",
1020
1021
  userSelect: _ ? "none" : void 0,
1021
1022
  cursor: _ ? "grabbing" : void 0,
1022
- ...x(d)
1023
+ ...C(s)
1023
1024
  },
1024
- children: [/* @__PURE__ */ l("div", {
1025
+ children: [/* @__PURE__ */ d("div", {
1025
1026
  style: {
1026
1027
  display: "flex",
1027
- height: a,
1028
+ height: i,
1028
1029
  transform: `translateX(calc(${-y * 100}% + ${_?.dx ?? 0}px))`,
1029
1030
  transition: _ ? "none" : "transform 450ms ease"
1030
1031
  },
1031
- children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ l("div", {
1032
+ children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ d("div", {
1032
1033
  style: {
1033
1034
  position: "relative",
1034
1035
  width: "100%",
@@ -1037,28 +1038,28 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1037
1038
  },
1038
1039
  children: t(n)
1039
1040
  }, n))
1040
- }), e > 1 && /* @__PURE__ */ u(c, { children: [
1041
- /* @__PURE__ */ l("button", {
1041
+ }), e > 1 && /* @__PURE__ */ f(u, { children: [
1042
+ /* @__PURE__ */ d("button", {
1042
1043
  type: "button",
1043
1044
  "aria-label": "Previous slide",
1044
1045
  style: {
1045
- ...Fe,
1046
+ ...Be,
1046
1047
  left: 12
1047
1048
  },
1048
1049
  onClick: () => b(y - 1),
1049
1050
  children: "‹"
1050
1051
  }),
1051
- /* @__PURE__ */ l("button", {
1052
+ /* @__PURE__ */ d("button", {
1052
1053
  type: "button",
1053
1054
  "aria-label": "Next slide",
1054
1055
  style: {
1055
- ...Fe,
1056
+ ...Be,
1056
1057
  right: 12
1057
1058
  },
1058
1059
  onClick: () => b(y + 1),
1059
1060
  children: "›"
1060
1061
  }),
1061
- /* @__PURE__ */ l("div", {
1062
+ /* @__PURE__ */ d("div", {
1062
1063
  style: {
1063
1064
  position: "absolute",
1064
1065
  bottom: 10,
@@ -1068,7 +1069,7 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1068
1069
  justifyContent: "center",
1069
1070
  gap: 6
1070
1071
  },
1071
- children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ l("button", {
1072
+ children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ d("button", {
1072
1073
  type: "button",
1073
1074
  "aria-label": `Go to slide ${t + 1}`,
1074
1075
  onClick: () => b(t),
@@ -1086,7 +1087,7 @@ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1086
1087
  ] })]
1087
1088
  });
1088
1089
  }
1089
- var ze = (e, t) => ({
1090
+ var We = (e, t) => ({
1090
1091
  position: "absolute",
1091
1092
  inset: 0,
1092
1093
  backgroundImage: e ? `url(${e})` : "none",
@@ -1094,26 +1095,26 @@ var ze = (e, t) => ({
1094
1095
  backgroundSize: "cover",
1095
1096
  backgroundPosition: "center"
1096
1097
  });
1097
- function Be({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1098
- return e.length ? /* @__PURE__ */ l(Re, {
1098
+ function Ge({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1099
+ return e.length ? /* @__PURE__ */ d(Ue, {
1099
1100
  ...r,
1100
1101
  count: e.length,
1101
1102
  renderSlide: (r) => {
1102
1103
  let i = e[r];
1103
- return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: ze(i.image) }), (i.title || i.text) && /* @__PURE__ */ u("div", {
1104
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: We(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
1104
1105
  style: {
1105
1106
  position: "absolute",
1106
1107
  color: "#fff",
1107
1108
  textAlign: n,
1108
- ...Ie[t] ?? Ie.bottom
1109
+ ...Ve[t] ?? Ve.bottom
1109
1110
  },
1110
- children: [i.title && /* @__PURE__ */ l("div", {
1111
+ children: [i.title && /* @__PURE__ */ d("div", {
1111
1112
  style: {
1112
1113
  fontSize: 22,
1113
1114
  fontWeight: 700
1114
1115
  },
1115
1116
  children: i.title
1116
- }), i.text && /* @__PURE__ */ l("div", {
1117
+ }), i.text && /* @__PURE__ */ d("div", {
1117
1118
  style: {
1118
1119
  fontSize: 14,
1119
1120
  opacity: .9,
@@ -1125,13 +1126,13 @@ function Be({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1125
1126
  }
1126
1127
  }) : null;
1127
1128
  }
1128
- function Ve({ slides: e = [], linked: t, ...n }) {
1129
- return e.length ? /* @__PURE__ */ l(Re, {
1129
+ function Ke({ slides: e = [], linked: t, ...n }) {
1130
+ return e.length ? /* @__PURE__ */ d(Ue, {
1130
1131
  ...n,
1131
1132
  count: e.length,
1132
1133
  renderSlide: (n) => {
1133
1134
  let r = e[n];
1134
- return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: ze(r.image, r.color) }), /* @__PURE__ */ l("div", {
1135
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: We(r.image, r.color) }), /* @__PURE__ */ d("div", {
1135
1136
  style: {
1136
1137
  position: "absolute",
1137
1138
  inset: 0,
@@ -1143,33 +1144,33 @@ function Ve({ slides: e = [], linked: t, ...n }) {
1143
1144
  }
1144
1145
  }) : null;
1145
1146
  }
1146
- var He = {
1147
+ var qe = {
1147
1148
  color: "inherit",
1148
1149
  textDecoration: "none",
1149
1150
  fontSize: 14,
1150
1151
  opacity: .85
1151
- }, Ue = {
1152
+ }, Je = {
1152
1153
  background: "var(--page-bg, #ffffff)",
1153
1154
  color: "var(--page-text, #111827)",
1154
1155
  border: "1px solid rgba(148, 163, 184, 0.25)",
1155
1156
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1156
1157
  zIndex: 60
1157
1158
  };
1158
- function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c = "auto", breakpoint: d = 768 }) {
1159
- let [f, p] = s(null), [m, h] = s(!1), [g, _] = s(!1), [v, y] = s(null);
1160
- i(() => {
1161
- if (!f) return;
1162
- let e = new ResizeObserver(() => h(f.offsetWidth < d));
1163
- return e.observe(f), () => e.disconnect();
1164
- }, [f, d]);
1165
- let b = c === "hamburger" || c === "auto" && m, S = (e, t) => /* @__PURE__ */ u("a", {
1159
+ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s = "auto", breakpoint: c = 768 }) {
1160
+ let [u, p] = l(null), [m, h] = l(!1), [g, _] = l(!1), [v, y] = l(null);
1161
+ a(() => {
1162
+ if (!u) return;
1163
+ let e = new ResizeObserver(() => h(u.offsetWidth < c));
1164
+ return e.observe(u), () => e.disconnect();
1165
+ }, [u, c]);
1166
+ let b = s === "hamburger" || s === "auto" && m, x = (e, t) => /* @__PURE__ */ f("a", {
1166
1167
  href: e.href || "#",
1167
1168
  style: {
1168
- ...He,
1169
+ ...qe,
1169
1170
  display: "block",
1170
1171
  ...t
1171
1172
  },
1172
- children: [e.label, e.desc && /* @__PURE__ */ l("span", {
1173
+ children: [e.label, e.desc && /* @__PURE__ */ d("span", {
1173
1174
  style: {
1174
1175
  display: "block",
1175
1176
  fontSize: 12,
@@ -1179,7 +1180,7 @@ function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c =
1179
1180
  children: e.desc
1180
1181
  })]
1181
1182
  }, e.key);
1182
- return /* @__PURE__ */ u("nav", {
1183
+ return /* @__PURE__ */ f("nav", {
1183
1184
  ref: (e) => {
1184
1185
  p(e), o && o(e);
1185
1186
  },
@@ -1191,10 +1192,10 @@ function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c =
1191
1192
  padding: "14px 24px",
1192
1193
  width: "100%",
1193
1194
  position: "relative",
1194
- ...x(a)
1195
+ ...C(i)
1195
1196
  },
1196
1197
  children: [
1197
- n && /* @__PURE__ */ l("img", {
1198
+ n && /* @__PURE__ */ d("img", {
1198
1199
  src: n,
1199
1200
  alt: e || "Logo",
1200
1201
  style: {
@@ -1202,7 +1203,7 @@ function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c =
1202
1203
  display: "block"
1203
1204
  }
1204
1205
  }),
1205
- e && /* @__PURE__ */ l("div", {
1206
+ e && /* @__PURE__ */ d("div", {
1206
1207
  style: {
1207
1208
  fontWeight: 700,
1208
1209
  fontSize: 18,
@@ -1210,8 +1211,8 @@ function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c =
1210
1211
  },
1211
1212
  children: e
1212
1213
  }),
1213
- /* @__PURE__ */ l("div", { style: { flexGrow: 1 } }),
1214
- b ? /* @__PURE__ */ l("button", {
1214
+ /* @__PURE__ */ d("div", { style: { flexGrow: 1 } }),
1215
+ b ? /* @__PURE__ */ d("button", {
1215
1216
  type: "button",
1216
1217
  "aria-label": g ? "Close menu" : "Open menu",
1217
1218
  onClick: () => _(!g),
@@ -1225,7 +1226,7 @@ function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c =
1225
1226
  padding: 4
1226
1227
  },
1227
1228
  children: g ? "✕" : "☰"
1228
- }) : /* @__PURE__ */ l("div", {
1229
+ }) : /* @__PURE__ */ d("div", {
1229
1230
  style: {
1230
1231
  display: "flex",
1231
1232
  gap: 20,
@@ -1234,29 +1235,29 @@ function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c =
1234
1235
  },
1235
1236
  children: r.map((e) => {
1236
1237
  let t = e.children ?? [];
1237
- if (!t.length) return /* @__PURE__ */ l("a", {
1238
+ if (!t.length) return /* @__PURE__ */ d("a", {
1238
1239
  href: e.href || "#",
1239
- style: He,
1240
+ style: qe,
1240
1241
  children: e.label
1241
1242
  }, e.key);
1242
1243
  let n = e.type === "mega";
1243
- return /* @__PURE__ */ u("span", {
1244
+ return /* @__PURE__ */ f("span", {
1244
1245
  style: {
1245
1246
  position: n ? "static" : "relative",
1246
1247
  display: "inline-flex"
1247
1248
  },
1248
1249
  onMouseEnter: () => y(e.key),
1249
1250
  onMouseLeave: () => y(null),
1250
- children: [/* @__PURE__ */ u("a", {
1251
+ children: [/* @__PURE__ */ f("a", {
1251
1252
  href: e.href || "#",
1252
1253
  style: {
1253
- ...He,
1254
+ ...qe,
1254
1255
  cursor: "pointer"
1255
1256
  },
1256
1257
  children: [
1257
1258
  e.label,
1258
1259
  " ",
1259
- /* @__PURE__ */ l("span", {
1260
+ /* @__PURE__ */ d("span", {
1260
1261
  style: {
1261
1262
  fontSize: 9,
1262
1263
  opacity: .6
@@ -1264,9 +1265,9 @@ function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c =
1264
1265
  children: "▼"
1265
1266
  })
1266
1267
  ]
1267
- }), v === e.key && (n ? /* @__PURE__ */ l("div", {
1268
+ }), v === e.key && (n ? /* @__PURE__ */ d("div", {
1268
1269
  style: {
1269
- ...Ue,
1270
+ ...Je,
1270
1271
  position: "absolute",
1271
1272
  left: 0,
1272
1273
  right: 0,
@@ -1276,13 +1277,13 @@ function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c =
1276
1277
  gridTemplateColumns: "repeat(auto-fit, minmax(170px, 1fr))",
1277
1278
  gap: 16
1278
1279
  },
1279
- children: t.map((e) => S(e, {
1280
+ children: t.map((e) => x(e, {
1280
1281
  padding: "6px 8px",
1281
1282
  borderRadius: 6
1282
1283
  }))
1283
- }) : /* @__PURE__ */ l("div", {
1284
+ }) : /* @__PURE__ */ d("div", {
1284
1285
  style: {
1285
- ...Ue,
1286
+ ...Je,
1286
1287
  position: "absolute",
1287
1288
  top: "100%",
1288
1289
  left: 0,
@@ -1292,7 +1293,7 @@ function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c =
1292
1293
  display: "flex",
1293
1294
  flexDirection: "column"
1294
1295
  },
1295
- children: t.map((e) => S(e, {
1296
+ children: t.map((e) => x(e, {
1296
1297
  padding: "8px 12px",
1297
1298
  borderRadius: 6
1298
1299
  }))
@@ -1300,7 +1301,7 @@ function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c =
1300
1301
  }, e.key);
1301
1302
  })
1302
1303
  }),
1303
- b && g && /* @__PURE__ */ l("div", {
1304
+ b && g && /* @__PURE__ */ d("div", {
1304
1305
  style: {
1305
1306
  flexBasis: "100%",
1306
1307
  width: "100%",
@@ -1308,35 +1309,35 @@ function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c =
1308
1309
  flexDirection: "column",
1309
1310
  paddingTop: 10
1310
1311
  },
1311
- children: r.map((e) => /* @__PURE__ */ u(t, { children: [/* @__PURE__ */ l("a", {
1312
+ children: r.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
1312
1313
  href: e.href || "#",
1313
1314
  style: {
1314
- ...He,
1315
+ ...qe,
1315
1316
  padding: "10px 4px",
1316
1317
  fontWeight: (e.children ?? []).length ? 600 : 400,
1317
1318
  opacity: 1
1318
1319
  },
1319
1320
  children: e.label
1320
- }), (e.children ?? []).map((e) => S(e, { padding: "8px 4px 8px 22px" }))] }, e.key))
1321
+ }), (e.children ?? []).map((e) => x(e, { padding: "8px 4px 8px 22px" }))] }, e.key))
1321
1322
  })
1322
1323
  ]
1323
1324
  });
1324
1325
  }
1325
- function Ge({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1326
- let [i, a] = s(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1327
- return e.length ? /* @__PURE__ */ u("div", {
1326
+ function Xe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1327
+ let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1328
+ return e.length ? /* @__PURE__ */ f("div", {
1328
1329
  ref: r,
1329
1330
  style: {
1330
1331
  width: "100%",
1331
- ...x(n)
1332
+ ...C(n)
1332
1333
  },
1333
- children: [/* @__PURE__ */ l("div", {
1334
+ children: [/* @__PURE__ */ d("div", {
1334
1335
  style: {
1335
1336
  display: "flex",
1336
1337
  gap: 4,
1337
1338
  borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
1338
1339
  },
1339
- children: e.map((e, t) => /* @__PURE__ */ l("button", {
1340
+ children: e.map((e, t) => /* @__PURE__ */ d("button", {
1340
1341
  type: "button",
1341
1342
  onClick: () => a(t),
1342
1343
  style: {
@@ -1353,7 +1354,7 @@ function Ge({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1353
1354
  },
1354
1355
  children: e.label || `Tab ${t + 1}`
1355
1356
  }, e.key))
1356
- }), e.map((e, n) => /* @__PURE__ */ l("div", {
1357
+ }), e.map((e, n) => /* @__PURE__ */ d("div", {
1357
1358
  style: {
1358
1359
  display: n === o ? "flex" : "none",
1359
1360
  flexDirection: "column"
@@ -1362,26 +1363,26 @@ function Ge({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1362
1363
  }, e.key))]
1363
1364
  }) : null;
1364
1365
  }
1365
- function Ke({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1366
- let [a, o] = s(() => new Set(e.length ? [e[0].key] : []));
1366
+ function Ze({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1367
+ let [a, o] = l(() => new Set(e.length ? [e[0].key] : []));
1367
1368
  if (!e.length) return null;
1368
- let c = (e) => o((t) => {
1369
+ let s = (e) => o((t) => {
1369
1370
  let r = new Set(n ? t : []);
1370
1371
  return t.has(e) ? r.delete(e) : r.add(e), r;
1371
1372
  });
1372
- return /* @__PURE__ */ l("div", {
1373
+ return /* @__PURE__ */ d("div", {
1373
1374
  ref: i,
1374
1375
  style: {
1375
1376
  width: "100%",
1376
- ...x(r)
1377
+ ...C(r)
1377
1378
  },
1378
1379
  children: e.map((n, r) => {
1379
1380
  let i = a.has(n.key);
1380
- return /* @__PURE__ */ u("div", {
1381
+ return /* @__PURE__ */ f("div", {
1381
1382
  style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
1382
- children: [/* @__PURE__ */ u("button", {
1383
+ children: [/* @__PURE__ */ f("button", {
1383
1384
  type: "button",
1384
- onClick: () => c(n.key),
1385
+ onClick: () => s(n.key),
1385
1386
  style: {
1386
1387
  width: "100%",
1387
1388
  display: "flex",
@@ -1398,7 +1399,7 @@ function Ke({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1398
1399
  textAlign: "left",
1399
1400
  cursor: "pointer"
1400
1401
  },
1401
- children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ l("span", {
1402
+ children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ d("span", {
1402
1403
  "aria-hidden": !0,
1403
1404
  style: {
1404
1405
  fontSize: 12,
@@ -1408,7 +1409,7 @@ function Ke({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1408
1409
  },
1409
1410
  children: "▼"
1410
1411
  })]
1411
- }), /* @__PURE__ */ l("div", {
1412
+ }), /* @__PURE__ */ d("div", {
1412
1413
  style: {
1413
1414
  display: i ? "flex" : "none",
1414
1415
  flexDirection: "column"
@@ -1419,15 +1420,15 @@ function Ke({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1419
1420
  })
1420
1421
  });
1421
1422
  }
1422
- var qe = {
1423
+ var Qe = {
1423
1424
  display: "flex",
1424
1425
  flexDirection: "column",
1425
1426
  gap: "12px"
1426
- }, Je = {
1427
+ }, Y = {
1427
1428
  fontSize: "14px",
1428
1429
  fontWeight: 500,
1429
1430
  color: "var(--page-text, #111827)"
1430
- }, Ye = {
1431
+ }, X = {
1431
1432
  padding: "10px 12px",
1432
1433
  border: "1px solid #d1d5db",
1433
1434
  borderRadius: "6px",
@@ -1437,18 +1438,18 @@ var qe = {
1437
1438
  boxSizing: "border-box",
1438
1439
  backgroundColor: "#ffffff",
1439
1440
  color: "#111827"
1440
- }, Xe = {
1441
+ }, $e = {
1441
1442
  display: "flex",
1442
1443
  alignItems: "center",
1443
1444
  gap: "8px",
1444
1445
  fontSize: "14px",
1445
1446
  color: "var(--page-text, #111827)"
1446
- }, Ze = (e) => e ? {
1447
+ }, Z = (e) => e ? {
1447
1448
  readOnly: !0,
1448
1449
  tabIndex: -1,
1449
1450
  onMouseDown: (e) => e.preventDefault()
1450
1451
  } : {};
1451
- function Qe(e, t) {
1452
+ function et(e, t) {
1452
1453
  if (!e) return !0;
1453
1454
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1454
1455
  switch (e.op) {
@@ -1462,11 +1463,11 @@ function Qe(e, t) {
1462
1463
  default: return !1;
1463
1464
  }
1464
1465
  }
1465
- var $e = {
1466
+ var tt = {
1466
1467
  display: "flex",
1467
1468
  flexDirection: "column",
1468
1469
  gap: 6
1469
- }, et = {
1470
+ }, nt = {
1470
1471
  font: "inherit",
1471
1472
  fontSize: 15,
1472
1473
  padding: "10px 12px",
@@ -1477,16 +1478,16 @@ var $e = {
1477
1478
  width: "100%",
1478
1479
  boxSizing: "border-box"
1479
1480
  };
1480
- function tt(e, t) {
1481
+ function rt(e, t) {
1481
1482
  let n = Array.isArray(e?.options) ? e.options : [];
1482
1483
  if (!e?.parentField) return n;
1483
1484
  let r = t?.[e.parentField];
1484
1485
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
1485
1486
  }
1486
- function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1487
- let a = /* @__PURE__ */ u("span", {
1487
+ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
1488
+ let a = /* @__PURE__ */ f("span", {
1488
1489
  style: {
1489
- ...Je,
1490
+ ...Y,
1490
1491
  fontSize: 14
1491
1492
  },
1492
1493
  children: [e.label, e.required ? " *" : ""]
@@ -1495,11 +1496,11 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1495
1496
  required: e.required || void 0,
1496
1497
  placeholder: e.placeholder || void 0,
1497
1498
  disabled: r || void 0,
1498
- style: et,
1499
+ style: nt,
1499
1500
  value: t ?? "",
1500
1501
  onChange: (t) => n(e.name, t.target.value)
1501
1502
  };
1502
- return e.type === "display" ? /* @__PURE__ */ l(e.variant && e.variant !== "p" ? e.variant : "p", {
1503
+ return e.type === "display" ? /* @__PURE__ */ d(e.variant && e.variant !== "p" ? e.variant : "p", {
1503
1504
  style: {
1504
1505
  margin: 0,
1505
1506
  color: e.color || "inherit",
@@ -1516,7 +1517,7 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1516
1517
  lineHeight: 1.35
1517
1518
  },
1518
1519
  children: e.label
1519
- }) : e.type === "image" ? e.src ? /* @__PURE__ */ l("img", {
1520
+ }) : e.type === "image" ? e.src ? /* @__PURE__ */ d("img", {
1520
1521
  src: e.src,
1521
1522
  alt: e.label ?? "",
1522
1523
  style: {
@@ -1524,10 +1525,10 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1524
1525
  borderRadius: 8,
1525
1526
  display: "block"
1526
1527
  }
1527
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ l(Ae, {
1528
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(Fe, {
1528
1529
  url: e.src,
1529
1530
  style: { width: "100%" }
1530
- }) : /* @__PURE__ */ l("video", {
1531
+ }) : /* @__PURE__ */ d("video", {
1531
1532
  src: e.src,
1532
1533
  controls: !0,
1533
1534
  style: {
@@ -1535,28 +1536,28 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1535
1536
  borderRadius: 8,
1536
1537
  display: "block"
1537
1538
  }
1538
- }) : null : /* @__PURE__ */ u("label", {
1539
- style: $e,
1539
+ }) : null : /* @__PURE__ */ f("label", {
1540
+ style: tt,
1540
1541
  children: [
1541
1542
  a,
1542
- e.type === "textarea" || e.multiline ? /* @__PURE__ */ l("textarea", {
1543
+ e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
1543
1544
  ...o,
1544
1545
  rows: 4,
1545
1546
  style: {
1546
- ...et,
1547
+ ...nt,
1547
1548
  resize: "vertical"
1548
1549
  }
1549
- }) : e.type === "select" ? /* @__PURE__ */ u("select", {
1550
+ }) : e.type === "select" ? /* @__PURE__ */ f("select", {
1550
1551
  ...o,
1551
1552
  disabled: o.disabled || !!e.parentField && !i?.[e.parentField],
1552
- children: [/* @__PURE__ */ l("option", {
1553
+ children: [/* @__PURE__ */ d("option", {
1553
1554
  value: "",
1554
1555
  children: e.placeholder || "—"
1555
- }), tt(e, i).map((e, t) => /* @__PURE__ */ l("option", {
1556
+ }), rt(e, i).map((e, t) => /* @__PURE__ */ d("option", {
1556
1557
  value: typeof e == "string" ? e : e.value,
1557
1558
  children: typeof e == "string" ? e : e.label ?? e.value
1558
1559
  }, t))]
1559
- }) : e.type === "checkbox" ? /* @__PURE__ */ l("input", {
1560
+ }) : e.type === "checkbox" ? /* @__PURE__ */ d("input", {
1560
1561
  type: "checkbox",
1561
1562
  name: e.name,
1562
1563
  required: e.required || void 0,
@@ -1567,7 +1568,7 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1567
1568
  width: 18,
1568
1569
  height: 18
1569
1570
  }
1570
- }) : e.type === "upload" ? /* @__PURE__ */ l("input", {
1571
+ }) : e.type === "upload" ? /* @__PURE__ */ d("input", {
1571
1572
  type: "file",
1572
1573
  name: e.name,
1573
1574
  accept: e.accept || void 0,
@@ -1578,7 +1579,7 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1578
1579
  font: "inherit",
1579
1580
  fontSize: 14
1580
1581
  }
1581
- }) : /* @__PURE__ */ l("input", {
1582
+ }) : /* @__PURE__ */ d("input", {
1582
1583
  ...o,
1583
1584
  type: {
1584
1585
  email: "email",
@@ -1589,7 +1590,7 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1589
1590
  link: "url"
1590
1591
  }[e.type] ?? "text"
1591
1592
  }),
1592
- e.help && /* @__PURE__ */ l("span", {
1593
+ e.help && /* @__PURE__ */ d("span", {
1593
1594
  style: {
1594
1595
  fontSize: 12,
1595
1596
  opacity: .65
@@ -1599,17 +1600,17 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1599
1600
  ]
1600
1601
  });
1601
1602
  }
1602
- function rt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: d, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
1603
- let { tenant: y, apiUrl: b } = r(U), [S, C] = s("form"), [w, T] = s(null), [E, D] = s({}), [O, k] = s(0), A = h ? v || "form" : S;
1604
- i(() => {
1605
- if (!f || !d) return;
1603
+ function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
1604
+ let { tenant: y, apiUrl: b } = i(H), [x, S] = l("form"), [w, T] = l(null), [E, D] = l({}), [O, k] = l(0), A = h ? v || "form" : x;
1605
+ a(() => {
1606
+ if (!c || !s) return;
1606
1607
  let e = !0;
1607
- return fetch(`${b || "/api"}/forms/${encodeURIComponent(d)}`, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
1608
+ return fetch(`${b || "/api"}/forms/${encodeURIComponent(s)}`, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
1608
1609
  e = !1;
1609
1610
  };
1610
1611
  }, [
1611
- f,
1612
- d,
1612
+ c,
1613
+ s,
1613
1614
  y,
1614
1615
  b
1615
1616
  ]);
@@ -1621,9 +1622,9 @@ function rt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: d,
1621
1622
  section: e,
1622
1623
  fields: []
1623
1624
  }) : j[j.length - 1].fields.push(e);
1624
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Qe(e.section.condition, E)).map((e) => ({
1625
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || et(e.section.condition, E)).map((e) => ({
1625
1626
  ...e,
1626
- fields: e.fields.filter((e) => Qe(e.condition, E))
1627
+ fields: e.fields.filter((e) => et(e.condition, E))
1627
1628
  })), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
1628
1629
  let t = E[e.name];
1629
1630
  return e.required && (t == null || t === "" || t === !1);
@@ -1635,23 +1636,23 @@ function rt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: d,
1635
1636
  for (let t of Array.isArray(w?.fields) ? w.fields : []) t?.parentField === e && delete r[t.name];
1636
1637
  return r;
1637
1638
  });
1638
- return /* @__PURE__ */ u("div", {
1639
+ return /* @__PURE__ */ f("div", {
1639
1640
  ref: m,
1640
- style: x(e),
1641
+ style: C(e),
1641
1642
  children: [
1642
- /* @__PURE__ */ l("form", {
1643
+ /* @__PURE__ */ d("form", {
1643
1644
  action: t || void 0,
1644
1645
  method: n || "post",
1645
- name: a || void 0,
1646
+ name: r || void 0,
1646
1647
  encType: o || void 0,
1647
1648
  onSubmit: async (e) => {
1648
1649
  if (e.preventDefault(), !h) {
1649
- if (d) {
1650
+ if (s) {
1650
1651
  let t = {};
1651
- if (f) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
1652
+ if (c) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
1652
1653
  else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
1653
1654
  try {
1654
- let e = await fetch(`${b || "/api"}/forms/${d}/submit`, {
1655
+ let e = await fetch(`${b || "/api"}/forms/${s}/submit`, {
1655
1656
  method: "post",
1656
1657
  headers: {
1657
1658
  "content-type": "application/json",
@@ -1659,14 +1660,14 @@ function rt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: d,
1659
1660
  },
1660
1661
  body: JSON.stringify(t)
1661
1662
  }), n = await e.json().catch(() => null);
1662
- C(e.ok && n?.success !== !1 ? "success" : "error");
1663
+ S(e.ok && n?.success !== !1 ? "success" : "error");
1663
1664
  } catch {
1664
- C("error");
1665
+ S("error");
1665
1666
  }
1666
1667
  return;
1667
1668
  }
1668
1669
  if (!t) {
1669
- C("success");
1670
+ S("success");
1670
1671
  return;
1671
1672
  }
1672
1673
  try {
@@ -1674,23 +1675,23 @@ function rt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: d,
1674
1675
  method: n || "post",
1675
1676
  body: new FormData(e.currentTarget)
1676
1677
  });
1677
- C(r.ok ? "success" : "error");
1678
+ S(r.ok ? "success" : "error");
1678
1679
  } catch {
1679
- C("error");
1680
+ S("error");
1680
1681
  }
1681
1682
  }
1682
1683
  },
1683
1684
  style: {
1684
- ...qe,
1685
+ ...Qe,
1685
1686
  display: A === "success" ? "none" : "flex"
1686
1687
  },
1687
- children: f && d ? /* @__PURE__ */ u(c, { children: [
1688
- P && /* @__PURE__ */ l(ht, {
1688
+ children: c && s ? /* @__PURE__ */ f(u, { children: [
1689
+ P && /* @__PURE__ */ d(_t, {
1689
1690
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1690
1691
  active: F + 1,
1691
1692
  style: { marginBottom: 8 }
1692
1693
  }),
1693
- P && N[F]?.section?.help && /* @__PURE__ */ l("p", {
1694
+ P && N[F]?.section?.help && /* @__PURE__ */ d("p", {
1694
1695
  style: {
1695
1696
  margin: 0,
1696
1697
  fontSize: 14,
@@ -1698,26 +1699,26 @@ function rt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: d,
1698
1699
  },
1699
1700
  children: N[F].section.help
1700
1701
  }),
1701
- I.map((e) => /* @__PURE__ */ l(nt, {
1702
+ I.map((e) => /* @__PURE__ */ d(it, {
1702
1703
  field: e,
1703
1704
  value: E[e.name],
1704
1705
  values: E,
1705
1706
  onChange: z,
1706
1707
  inert: h
1707
1708
  }, e.name)),
1708
- /* @__PURE__ */ u("div", {
1709
+ /* @__PURE__ */ f("div", {
1709
1710
  style: {
1710
1711
  display: "flex",
1711
1712
  gap: 10,
1712
1713
  alignItems: "center",
1713
1714
  marginTop: 4
1714
1715
  },
1715
- children: [P && F > 0 && /* @__PURE__ */ l("button", {
1716
+ children: [P && F > 0 && /* @__PURE__ */ d("button", {
1716
1717
  type: "button",
1717
1718
  disabled: h || void 0,
1718
1719
  onClick: () => k(F - 1),
1719
1720
  style: {
1720
- ...X,
1721
+ ...q,
1721
1722
  background: "transparent",
1722
1723
  color: "inherit",
1723
1724
  border: 0,
@@ -1725,12 +1726,12 @@ function rt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: d,
1725
1726
  cursor: "pointer"
1726
1727
  },
1727
1728
  children: "Back"
1728
- }), P && !R ? /* @__PURE__ */ l("button", {
1729
+ }), P && !R ? /* @__PURE__ */ d("button", {
1729
1730
  type: "button",
1730
1731
  disabled: h || L.length > 0,
1731
1732
  onClick: () => k(F + 1),
1732
1733
  style: {
1733
- ...X,
1734
+ ...q,
1734
1735
  border: 0,
1735
1736
  padding: "10px 22px",
1736
1737
  borderRadius: 8,
@@ -1740,11 +1741,11 @@ function rt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: d,
1740
1741
  opacity: L.length ? .5 : 1
1741
1742
  },
1742
1743
  children: "Next"
1743
- }) : /* @__PURE__ */ l("button", {
1744
+ }) : /* @__PURE__ */ d("button", {
1744
1745
  type: "submit",
1745
1746
  disabled: h || void 0,
1746
1747
  style: {
1747
- ...X,
1748
+ ...q,
1748
1749
  border: 0,
1749
1750
  padding: "10px 22px",
1750
1751
  borderRadius: 8,
@@ -1757,11 +1758,11 @@ function rt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: d,
1757
1758
  })
1758
1759
  ] }) : g
1759
1760
  }),
1760
- /* @__PURE__ */ l("div", {
1761
+ /* @__PURE__ */ d("div", {
1761
1762
  style: { display: A === "success" ? "block" : "none" },
1762
1763
  children: _?.success ?? null
1763
1764
  }),
1764
- /* @__PURE__ */ l("div", {
1765
+ /* @__PURE__ */ d("div", {
1765
1766
  style: {
1766
1767
  display: A === "error" ? "block" : "none",
1767
1768
  marginTop: 12
@@ -1771,53 +1772,53 @@ function rt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: d,
1771
1772
  ]
1772
1773
  });
1773
1774
  }
1774
- function it({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1775
- return /* @__PURE__ */ l("label", {
1775
+ function ot({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1776
+ return /* @__PURE__ */ d("label", {
1776
1777
  ref: r,
1777
1778
  style: {
1778
- ...Je,
1779
- ...x(n)
1779
+ ...Y,
1780
+ ...C(n)
1780
1781
  },
1781
- children: Z(t, e, i)
1782
+ children: J(t, e, i)
1782
1783
  });
1783
1784
  }
1784
- function at({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1785
- return /* @__PURE__ */ l("input", {
1785
+ function st({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1786
+ return /* @__PURE__ */ d("input", {
1786
1787
  ref: a,
1787
1788
  type: e,
1788
1789
  name: t || void 0,
1789
1790
  placeholder: n,
1790
1791
  required: !o && !!r,
1791
1792
  style: {
1792
- ...Ye,
1793
- ...x(i)
1793
+ ...X,
1794
+ ...C(i)
1794
1795
  },
1795
- ...Ze(o)
1796
+ ...Z(o)
1796
1797
  });
1797
1798
  }
1798
- function ot({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1799
- return /* @__PURE__ */ l("textarea", {
1799
+ function ct({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1800
+ return /* @__PURE__ */ d("textarea", {
1800
1801
  ref: a,
1801
1802
  name: e || void 0,
1802
1803
  placeholder: t,
1803
1804
  rows: n,
1804
1805
  required: !o && !!r,
1805
1806
  style: {
1806
- ...Ye,
1807
+ ...X,
1807
1808
  resize: "vertical",
1808
- ...x(i)
1809
+ ...C(i)
1809
1810
  },
1810
- ...Ze(o)
1811
+ ...Z(o)
1811
1812
  });
1812
1813
  }
1813
- function st({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1814
- return /* @__PURE__ */ u("label", {
1814
+ function lt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1815
+ return /* @__PURE__ */ f("label", {
1815
1816
  ref: o,
1816
1817
  style: {
1817
- ...Xe,
1818
- ...x(a)
1818
+ ...$e,
1819
+ ...C(a)
1819
1820
  },
1820
- children: [/* @__PURE__ */ l("input", {
1821
+ children: [/* @__PURE__ */ d("input", {
1821
1822
  type: e,
1822
1823
  name: n || void 0,
1823
1824
  value: r || void 0,
@@ -1831,8 +1832,8 @@ function st({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1831
1832
  }), t]
1832
1833
  });
1833
1834
  }
1834
- function ct({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1835
- return /* @__PURE__ */ u("select", {
1835
+ function ut({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1836
+ return /* @__PURE__ */ f("select", {
1836
1837
  ref: a,
1837
1838
  name: e || void 0,
1838
1839
  required: !o && !!r,
@@ -1840,58 +1841,58 @@ function ct({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1840
1841
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
1841
1842
  tabIndex: o ? -1 : void 0,
1842
1843
  style: {
1843
- ...Ye,
1844
+ ...X,
1844
1845
  appearance: "auto",
1845
- ...x(i)
1846
+ ...C(i)
1846
1847
  },
1847
- children: [t !== "" && /* @__PURE__ */ l("option", {
1848
+ children: [t !== "" && /* @__PURE__ */ d("option", {
1848
1849
  value: "",
1849
1850
  disabled: !0,
1850
1851
  children: t ?? "Select…"
1851
- }), n.map((e, t) => /* @__PURE__ */ l("option", {
1852
+ }), n.map((e, t) => /* @__PURE__ */ d("option", {
1852
1853
  value: e,
1853
1854
  children: e
1854
1855
  }, t))]
1855
1856
  });
1856
1857
  }
1857
- function lt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
1858
- let [c, d] = s(null);
1859
- return /* @__PURE__ */ u("label", {
1858
+ function dt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
1859
+ let [s, c] = l(null);
1860
+ return /* @__PURE__ */ f("label", {
1860
1861
  ref: a,
1861
1862
  style: {
1862
- ...Ye,
1863
+ ...X,
1863
1864
  display: "flex",
1864
1865
  alignItems: "center",
1865
1866
  gap: "8px",
1866
1867
  cursor: o ? "default" : "pointer",
1867
1868
  borderStyle: "dashed",
1868
- color: c ? "#111827" : "#6b7280",
1869
- ...x(i)
1869
+ color: s ? "#111827" : "#6b7280",
1870
+ ...C(i)
1870
1871
  },
1871
1872
  children: [
1872
- /* @__PURE__ */ l("input", {
1873
+ /* @__PURE__ */ d("input", {
1873
1874
  type: "file",
1874
1875
  name: e || void 0,
1875
1876
  accept: t || void 0,
1876
1877
  required: !o && !!n,
1877
1878
  disabled: !!o,
1878
- onChange: (e) => d(e.target.files?.[0]?.name ?? null),
1879
+ onChange: (e) => c(e.target.files?.[0]?.name ?? null),
1879
1880
  style: { display: "none" }
1880
1881
  }),
1881
- /* @__PURE__ */ l("span", {
1882
+ /* @__PURE__ */ d("span", {
1882
1883
  "aria-hidden": !0,
1883
1884
  children: "📎"
1884
1885
  }),
1885
- c ?? r
1886
+ s ?? r
1886
1887
  ]
1887
1888
  });
1888
1889
  }
1889
- function ut({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1890
- return /* @__PURE__ */ l("button", {
1890
+ function ft({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1891
+ return /* @__PURE__ */ d("button", {
1891
1892
  ref: n,
1892
1893
  type: r ? "button" : "submit",
1893
1894
  style: {
1894
- ...X,
1895
+ ...q,
1895
1896
  border: 0,
1896
1897
  cursor: "pointer",
1897
1898
  alignSelf: "flex-start",
@@ -1901,37 +1902,37 @@ function ut({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1901
1902
  fontWeight: 600,
1902
1903
  lineHeight: 1.4,
1903
1904
  fontFamily: "inherit",
1904
- ...x(t)
1905
+ ...C(t)
1905
1906
  },
1906
1907
  children: e
1907
1908
  });
1908
1909
  }
1909
- function dt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1910
+ function pt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1910
1911
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1911
- return /* @__PURE__ */ l("div", {
1912
+ return /* @__PURE__ */ d("div", {
1912
1913
  ref: r,
1913
1914
  style: {
1914
1915
  display: "grid",
1915
1916
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
1916
1917
  gap: 16,
1917
1918
  width: "100%",
1918
- ...x(n)
1919
+ ...C(n)
1919
1920
  },
1920
- children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ l("div", {
1921
+ children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ d("div", {
1921
1922
  style: { minWidth: 0 },
1922
1923
  children: i?.[`cell-${t}`] ?? null
1923
1924
  }, t))
1924
1925
  });
1925
1926
  }
1926
- function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: c = "name", textField: d, custom: f, templateId: p, style: m, nodeRef: h }) {
1927
- let { tenant: g, apiUrl: _, locale: v } = r(U), y = r(G), b = r(W)?.[e], [S, C] = s(null);
1928
- if (i(() => {
1927
+ function mt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, style: m, nodeRef: h }) {
1928
+ let { tenant: g, apiUrl: _, locale: v } = i(H), y = i(W), b = i(U)?.[e], [x, S] = l(null);
1929
+ if (a(() => {
1929
1930
  if (!e || b) return;
1930
1931
  let t = !0, n = e.startsWith("api:") ? `${_}/data/${encodeURIComponent(e.slice(4))}` : `${_}/dynamic/${encodeURIComponent(e)}${v ? `?locale=${encodeURIComponent(v)}` : ""}`;
1931
1932
  return fetch(n, { headers: g ? { "x-tenant": g } : {} }).then((e) => e.json()).then((e) => {
1932
1933
  let n = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
1933
- return t && C(n.filter((e) => e && typeof e == "object"));
1934
- }).catch(() => t && C([])), () => {
1934
+ return t && S(n.filter((e) => e && typeof e == "object"));
1935
+ }).catch(() => t && S([])), () => {
1935
1936
  t = !1;
1936
1937
  };
1937
1938
  }, [
@@ -1941,7 +1942,7 @@ function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
1941
1942
  v,
1942
1943
  b
1943
1944
  ]), !e) return null;
1944
- let w = (b ?? S ?? []).slice(0, Math.max(1, Number(t) || 6)), T = Math.min(Math.max(Number(a) || 3, 1), 6), E = n === "list" ? {
1945
+ let w = (b ?? x ?? []).slice(0, Math.max(1, Number(t) || 6)), T = Math.min(Math.max(Number(r) || 3, 1), 6), E = n === "list" ? {
1945
1946
  display: "flex",
1946
1947
  flexDirection: "column",
1947
1948
  gap: 20
@@ -1950,49 +1951,49 @@ function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
1950
1951
  gridTemplateColumns: `repeat(${T}, minmax(0, 1fr))`,
1951
1952
  gap: 24
1952
1953
  };
1953
- return f && p && y?.render ? /* @__PURE__ */ l("div", {
1954
+ return u && p && y?.render ? /* @__PURE__ */ d("div", {
1954
1955
  ref: h,
1955
1956
  style: {
1956
1957
  width: "100%",
1957
1958
  ...E,
1958
- ...x(m)
1959
+ ...C(m)
1959
1960
  },
1960
- children: w.map((e) => /* @__PURE__ */ l("div", {
1961
+ children: w.map((e) => /* @__PURE__ */ d("div", {
1961
1962
  style: { minWidth: 0 },
1962
- children: y.render(p, (t) => ie(t, e))
1963
+ children: y.render(p, (t) => se(t, e))
1963
1964
  }, e.id ?? e?.data?.slug))
1964
- }) : /* @__PURE__ */ l("div", {
1965
+ }) : /* @__PURE__ */ d("div", {
1965
1966
  ref: h,
1966
1967
  style: {
1967
1968
  width: "100%",
1968
1969
  ...E,
1969
- ...x(m)
1970
+ ...C(m)
1970
1971
  },
1971
1972
  children: w.map((e) => {
1972
- let t = o ? K(e?.data, o) : null, r = c ? q(K(e?.data, c)) : null, i = d ? K(e?.data, d) : null, a = Array.isArray(i) ? i : null, s = a || i == null ? null : q(i), f = n === "list";
1973
- return /* @__PURE__ */ u("div", {
1973
+ let t = o ? G(e?.data, o) : null, r = s ? K(G(e?.data, s)) : null, i = c ? G(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : K(i), u = n === "list";
1974
+ return /* @__PURE__ */ f("div", {
1974
1975
  style: {
1975
1976
  display: "flex",
1976
- flexDirection: f ? "row" : "column",
1977
- gap: f ? 20 : 12,
1978
- alignItems: f ? "center" : "stretch",
1977
+ flexDirection: u ? "row" : "column",
1978
+ gap: u ? 20 : 12,
1979
+ alignItems: u ? "center" : "stretch",
1979
1980
  minWidth: 0
1980
1981
  },
1981
- children: [t && /* @__PURE__ */ l("img", {
1982
+ children: [t && /* @__PURE__ */ d("img", {
1982
1983
  src: t,
1983
1984
  alt: r ?? "",
1984
1985
  style: {
1985
- width: f ? 160 : "100%",
1986
+ width: u ? 160 : "100%",
1986
1987
  aspectRatio: "3 / 2",
1987
1988
  objectFit: "cover",
1988
1989
  borderRadius: 10,
1989
1990
  flexShrink: 0,
1990
1991
  display: "block"
1991
1992
  }
1992
- }), /* @__PURE__ */ u("div", {
1993
+ }), /* @__PURE__ */ f("div", {
1993
1994
  style: { minWidth: 0 },
1994
1995
  children: [
1995
- r && /* @__PURE__ */ l("h3", {
1996
+ r && /* @__PURE__ */ d("h3", {
1996
1997
  style: {
1997
1998
  margin: 0,
1998
1999
  fontSize: 18,
@@ -2000,23 +2001,23 @@ function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2000
2001
  },
2001
2002
  children: r
2002
2003
  }),
2003
- s && /* @__PURE__ */ l("p", {
2004
+ l && /* @__PURE__ */ d("p", {
2004
2005
  style: {
2005
2006
  margin: "6px 0 0",
2006
2007
  fontSize: 14,
2007
2008
  lineHeight: 1.55,
2008
2009
  opacity: .75
2009
2010
  },
2010
- children: s
2011
+ children: l
2011
2012
  }),
2012
- a && /* @__PURE__ */ l("div", {
2013
+ a && /* @__PURE__ */ d("div", {
2013
2014
  style: {
2014
2015
  marginTop: 6,
2015
2016
  fontSize: 14,
2016
2017
  lineHeight: 1.55,
2017
2018
  opacity: .85
2018
2019
  },
2019
- children: ve(a)
2020
+ children: Ce(a)
2020
2021
  })
2021
2022
  ]
2022
2023
  })]
@@ -2024,12 +2025,12 @@ function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2024
2025
  })
2025
2026
  });
2026
2027
  }
2027
- function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2028
- return e.length ? /* @__PURE__ */ l("nav", {
2028
+ function ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2029
+ return e.length ? /* @__PURE__ */ d("nav", {
2029
2030
  ref: r,
2030
2031
  "aria-label": "Breadcrumb",
2031
- style: { ...x(n) },
2032
- children: /* @__PURE__ */ l("ol", {
2032
+ style: { ...C(n) },
2033
+ children: /* @__PURE__ */ d("ol", {
2033
2034
  style: {
2034
2035
  display: "flex",
2035
2036
  flexWrap: "wrap",
@@ -2042,25 +2043,25 @@ function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2042
2043
  },
2043
2044
  children: e.map((n, r) => {
2044
2045
  let i = r === e.length - 1;
2045
- return /* @__PURE__ */ u("li", {
2046
+ return /* @__PURE__ */ f("li", {
2046
2047
  style: {
2047
2048
  display: "flex",
2048
2049
  alignItems: "center",
2049
2050
  gap: 8,
2050
2051
  minWidth: 0
2051
2052
  },
2052
- children: [r > 0 && /* @__PURE__ */ l("span", {
2053
+ children: [r > 0 && /* @__PURE__ */ d("span", {
2053
2054
  style: { opacity: .4 },
2054
2055
  "aria-hidden": !0,
2055
2056
  children: t
2056
- }), i || !n.href ? /* @__PURE__ */ l("span", {
2057
+ }), i || !n.href ? /* @__PURE__ */ d("span", {
2057
2058
  style: {
2058
2059
  fontWeight: i ? 600 : 400,
2059
2060
  opacity: i ? 1 : .7
2060
2061
  },
2061
2062
  "aria-current": i ? "page" : void 0,
2062
2063
  children: n.label
2063
- }) : /* @__PURE__ */ l("a", {
2064
+ }) : /* @__PURE__ */ d("a", {
2064
2065
  href: n.href,
2065
2066
  style: {
2066
2067
  color: "inherit",
@@ -2074,8 +2075,8 @@ function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2074
2075
  })
2075
2076
  }) : null;
2076
2077
  }
2077
- function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2078
- let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), c = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", d = (e) => ({
2078
+ function gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2079
+ let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), c = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", l = (e) => ({
2079
2080
  display: "inline-flex",
2080
2081
  alignItems: "center",
2081
2082
  justifyContent: "center",
@@ -2089,7 +2090,7 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2089
2090
  background: e ? "var(--page-accent, #111827)" : "transparent",
2090
2091
  border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
2091
2092
  });
2092
- return /* @__PURE__ */ u("nav", {
2093
+ return /* @__PURE__ */ f("nav", {
2093
2094
  ref: a,
2094
2095
  "aria-label": "Pagination",
2095
2096
  style: {
@@ -2097,29 +2098,29 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2097
2098
  flexWrap: "wrap",
2098
2099
  gap: 8,
2099
2100
  alignItems: "center",
2100
- ...x(i)
2101
+ ...C(i)
2101
2102
  },
2102
2103
  children: [
2103
- n && /* @__PURE__ */ l("a", {
2104
+ n && /* @__PURE__ */ d("a", {
2104
2105
  href: s > 1 ? c(s - 1) : "#",
2105
2106
  "aria-label": "Previous",
2106
2107
  style: {
2107
- ...d(!1),
2108
+ ...l(!1),
2108
2109
  opacity: s > 1 ? 1 : .4
2109
2110
  },
2110
2111
  children: "‹"
2111
2112
  }),
2112
- Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ l("a", {
2113
+ Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ d("a", {
2113
2114
  href: c(e),
2114
2115
  "aria-current": e === s ? "page" : void 0,
2115
- style: d(e === s),
2116
+ style: l(e === s),
2116
2117
  children: e
2117
2118
  }, e)),
2118
- n && /* @__PURE__ */ l("a", {
2119
+ n && /* @__PURE__ */ d("a", {
2119
2120
  href: s < o ? c(s + 1) : "#",
2120
2121
  "aria-label": "Next",
2121
2122
  style: {
2122
- ...d(!1),
2123
+ ...l(!1),
2123
2124
  opacity: s < o ? 1 : .4
2124
2125
  },
2125
2126
  children: "›"
@@ -2127,7 +2128,7 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2127
2128
  ]
2128
2129
  });
2129
2130
  }
2130
- function ht({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2131
+ function _t({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2131
2132
  if (!e.length) return null;
2132
2133
  let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
2133
2134
  width: 32,
@@ -2158,21 +2159,21 @@ function ht({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2158
2159
  minWidth: 24
2159
2160
  }
2160
2161
  });
2161
- return /* @__PURE__ */ l("div", {
2162
+ return /* @__PURE__ */ d("div", {
2162
2163
  ref: a,
2163
2164
  style: {
2164
2165
  display: "flex",
2165
2166
  flexDirection: r ? "column" : "row",
2166
2167
  alignItems: r ? "stretch" : "flex-start",
2167
2168
  gap: r ? 4 : 8,
2168
- ...x(i)
2169
+ ...C(i)
2169
2170
  },
2170
2171
  children: e.map((e, n) => {
2171
2172
  let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
2172
- return /* @__PURE__ */ u(t, { children: [n > 0 && /* @__PURE__ */ l("div", {
2173
+ return /* @__PURE__ */ f(t, { children: [n > 0 && /* @__PURE__ */ d("div", {
2173
2174
  style: c(i <= o),
2174
2175
  "aria-hidden": !0
2175
- }), /* @__PURE__ */ u("div", {
2176
+ }), /* @__PURE__ */ f("div", {
2176
2177
  style: {
2177
2178
  display: "flex",
2178
2179
  flexDirection: r ? "row" : "column",
@@ -2181,19 +2182,19 @@ function ht({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2181
2182
  minWidth: 0,
2182
2183
  textAlign: r ? "left" : "center"
2183
2184
  },
2184
- children: [/* @__PURE__ */ l("div", {
2185
+ children: [/* @__PURE__ */ d("div", {
2185
2186
  style: s(a),
2186
2187
  children: a === "done" ? "✓" : i
2187
- }), /* @__PURE__ */ u("div", {
2188
+ }), /* @__PURE__ */ f("div", {
2188
2189
  style: { minWidth: 0 },
2189
- children: [/* @__PURE__ */ l("div", {
2190
+ children: [/* @__PURE__ */ d("div", {
2190
2191
  style: {
2191
2192
  fontSize: 13,
2192
2193
  fontWeight: a === "active" ? 700 : 500,
2193
2194
  opacity: a === "todo" ? .6 : 1
2194
2195
  },
2195
2196
  children: e.label
2196
- }), e.description && /* @__PURE__ */ l("div", {
2197
+ }), e.description && /* @__PURE__ */ d("div", {
2197
2198
  style: {
2198
2199
  fontSize: 12,
2199
2200
  opacity: .6
@@ -2205,7 +2206,7 @@ function ht({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2205
2206
  })
2206
2207
  });
2207
2208
  }
2208
- var gt = {
2209
+ var vt = {
2209
2210
  small: {
2210
2211
  w: 132,
2211
2212
  h: 46,
@@ -2227,10 +2228,10 @@ var gt = {
2227
2228
  title: 12.5,
2228
2229
  avatar: 46
2229
2230
  }
2230
- }, _t = (e) => gt[e] ?? gt.medium;
2231
- gt.medium.w, gt.medium.h;
2232
- function vt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2233
- let r = _t(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
2231
+ }, yt = (e) => vt[e] ?? vt.medium;
2232
+ vt.medium.w, vt.medium.h;
2233
+ function bt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2234
+ let r = yt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
2234
2235
  for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
2235
2236
  let d = /* @__PURE__ */ new Map(), f = (e, t) => {
2236
2237
  if (t.has(e.id)) return 0;
@@ -2282,19 +2283,19 @@ function vt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2282
2283
  horizontal: n
2283
2284
  };
2284
2285
  }
2285
- var yt = (e, t) => {
2286
+ var xt = (e, t) => {
2286
2287
  let n = String(e ?? "");
2287
2288
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
2288
- }, bt = (e) => {
2289
+ }, St = (e) => {
2289
2290
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
2290
2291
  if (!t) return "#ffffff";
2291
2292
  let n = t[1];
2292
2293
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
2293
2294
  let r = parseInt(n, 16);
2294
2295
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
2295
- }, xt = (e) => !!(e?.cv?.trim?.() || e?.photo);
2296
- function St(e, t = {}) {
2297
- let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : q(e);
2296
+ }, Ct = (e) => !!(e?.cv?.trim?.() || e?.photo);
2297
+ function wt(e, t = {}) {
2298
+ let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : K(e);
2298
2299
  return n.map((e) => {
2299
2300
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
2300
2301
  return {
@@ -2308,15 +2309,15 @@ function St(e, t = {}) {
2308
2309
  };
2309
2310
  });
2310
2311
  }
2311
- var Ct = {
2312
+ var Tt = {
2312
2313
  size: 36,
2313
2314
  pad: 10
2314
2315
  };
2315
- function wt({ node: e, onClose: t }) {
2316
- return i(() => {
2316
+ function Et({ node: e, onClose: t }) {
2317
+ return a(() => {
2317
2318
  let e = (e) => e.key === "Escape" && t();
2318
2319
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
2319
- }, [t]), /* @__PURE__ */ l("div", {
2320
+ }, [t]), /* @__PURE__ */ d("div", {
2320
2321
  onClick: t,
2321
2322
  role: "dialog",
2322
2323
  "aria-modal": "true",
@@ -2331,7 +2332,7 @@ function wt({ node: e, onClose: t }) {
2331
2332
  justifyContent: "center",
2332
2333
  padding: 16
2333
2334
  },
2334
- children: /* @__PURE__ */ u("div", {
2335
+ children: /* @__PURE__ */ f("div", {
2335
2336
  onClick: (e) => e.stopPropagation(),
2336
2337
  style: {
2337
2338
  background: "var(--page-bg, #ffffff)",
@@ -2346,7 +2347,7 @@ function wt({ node: e, onClose: t }) {
2346
2347
  boxShadow: "0 24px 64px rgba(15, 23, 42, 0.35)"
2347
2348
  },
2348
2349
  children: [
2349
- /* @__PURE__ */ l("button", {
2350
+ /* @__PURE__ */ d("button", {
2350
2351
  type: "button",
2351
2352
  "aria-label": "Close",
2352
2353
  onClick: t,
@@ -2367,14 +2368,14 @@ function wt({ node: e, onClose: t }) {
2367
2368
  },
2368
2369
  children: "×"
2369
2370
  }),
2370
- /* @__PURE__ */ u("div", {
2371
+ /* @__PURE__ */ f("div", {
2371
2372
  style: {
2372
2373
  display: "flex",
2373
2374
  alignItems: "center",
2374
2375
  gap: 14,
2375
2376
  marginBottom: e.cv ? 14 : 0
2376
2377
  },
2377
- children: [e.photo && /* @__PURE__ */ l("img", {
2378
+ children: [e.photo && /* @__PURE__ */ d("img", {
2378
2379
  src: e.photo,
2379
2380
  alt: "",
2380
2381
  style: {
@@ -2384,15 +2385,15 @@ function wt({ node: e, onClose: t }) {
2384
2385
  objectFit: "cover",
2385
2386
  flexShrink: 0
2386
2387
  }
2387
- }), /* @__PURE__ */ u("div", {
2388
+ }), /* @__PURE__ */ f("div", {
2388
2389
  style: { minWidth: 0 },
2389
- children: [/* @__PURE__ */ l("div", {
2390
+ children: [/* @__PURE__ */ d("div", {
2390
2391
  style: {
2391
2392
  fontSize: 18,
2392
2393
  fontWeight: 700
2393
2394
  },
2394
2395
  children: e.name
2395
- }), e.title && /* @__PURE__ */ l("div", {
2396
+ }), e.title && /* @__PURE__ */ d("div", {
2396
2397
  style: {
2397
2398
  fontSize: 13,
2398
2399
  opacity: .65
@@ -2401,7 +2402,7 @@ function wt({ node: e, onClose: t }) {
2401
2402
  })]
2402
2403
  })]
2403
2404
  }),
2404
- e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ l("p", {
2405
+ e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ d("p", {
2405
2406
  style: {
2406
2407
  fontSize: 14,
2407
2408
  lineHeight: 1.6,
@@ -2409,7 +2410,7 @@ function wt({ node: e, onClose: t }) {
2409
2410
  },
2410
2411
  children: e
2411
2412
  }, t)),
2412
- e.href && /* @__PURE__ */ l("a", {
2413
+ e.href && /* @__PURE__ */ d("a", {
2413
2414
  href: e.href,
2414
2415
  target: "_blank",
2415
2416
  rel: "noopener noreferrer",
@@ -2430,9 +2431,9 @@ function wt({ node: e, onClose: t }) {
2430
2431
  })
2431
2432
  });
2432
2433
  }
2433
- function Tt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: d, parentField: f, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
2434
- let b = a(), [S, C] = s(null), { tenant: w, apiUrl: T } = r(U), E = r(W)?.[t], [D, O] = s(null);
2435
- i(() => {
2434
+ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
2435
+ let b = o(), [x, S] = l(null), { tenant: w, apiUrl: T } = i(H), E = i(U)?.[t], [D, O] = l(null);
2436
+ a(() => {
2436
2437
  if (!t || E) return;
2437
2438
  let e = !0;
2438
2439
  return fetch(`${T}/dynamic/${encodeURIComponent(t)}`, { headers: w ? { "x-tenant": w } : {} }).then((e) => e.json()).then((t) => {
@@ -2447,18 +2448,18 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2447
2448
  T,
2448
2449
  E
2449
2450
  ]);
2450
- let k = t ? St(E ?? D ?? [], {
2451
+ let k = t ? wt(E ?? D ?? [], {
2451
2452
  nameField: n,
2452
- titleField: o,
2453
- photoField: d,
2454
- parentField: f,
2453
+ titleField: r,
2454
+ photoField: s,
2455
+ parentField: c,
2455
2456
  cvField: p,
2456
2457
  hrefField: m
2457
- }) : e, A = _t(h), { boxes: j, links: M, width: N, height: P } = vt(k, {
2458
+ }) : e, A = yt(h), { boxes: j, links: M, width: N, height: P } = bt(k, {
2458
2459
  size: h,
2459
2460
  horizontal: g
2460
2461
  });
2461
- if (!j.length) return !y && t ? /* @__PURE__ */ u("div", {
2462
+ if (!j.length) return !y && t ? /* @__PURE__ */ f("div", {
2462
2463
  ref: v,
2463
2464
  style: {
2464
2465
  padding: 18,
@@ -2467,7 +2468,7 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2467
2468
  fontSize: 13,
2468
2469
  opacity: .7,
2469
2470
  textAlign: "center",
2470
- ...x(_)
2471
+ ...C(_)
2471
2472
  },
2472
2473
  children: [
2473
2474
  "Org Chart — no published entries in “",
@@ -2476,14 +2477,14 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2476
2477
  ]
2477
2478
  }) : null;
2478
2479
  let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
2479
- return /* @__PURE__ */ u("div", {
2480
+ return /* @__PURE__ */ f("div", {
2480
2481
  ref: v,
2481
2482
  style: {
2482
2483
  maxWidth: "100%",
2483
2484
  overflowX: "auto",
2484
- ...x(_)
2485
+ ...C(_)
2485
2486
  },
2486
- children: [/* @__PURE__ */ u("svg", {
2487
+ children: [/* @__PURE__ */ f("svg", {
2487
2488
  viewBox: `0 0 ${N} ${P}`,
2488
2489
  role: "img",
2489
2490
  "aria-label": "Organization chart",
@@ -2494,64 +2495,64 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2494
2495
  height: "auto",
2495
2496
  margin: "0 auto"
2496
2497
  },
2497
- children: [M.map((e, t) => /* @__PURE__ */ l("path", {
2498
+ children: [M.map((e, t) => /* @__PURE__ */ d("path", {
2498
2499
  d: g ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
2499
2500
  fill: "none",
2500
2501
  stroke: "rgba(148, 163, 184, 0.7)",
2501
2502
  strokeWidth: "1.5"
2502
2503
  }, t)), j.map(({ node: e, x: t, y: n }) => {
2503
- let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? bt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", d = i ? bt(e.color2) : s, f = y && (xt(e) || e.href), p = () => xt(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Ct.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
2504
- return /* @__PURE__ */ u("g", {
2505
- onClick: f ? p : void 0,
2506
- style: f ? { cursor: "pointer" } : void 0,
2507
- role: f ? "button" : void 0,
2508
- "aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
2504
+ let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? St(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? St(e.color2) : s, l = y && (Ct(e) || e.href), p = () => Ct(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Tt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
2505
+ return /* @__PURE__ */ f("g", {
2506
+ onClick: l ? p : void 0,
2507
+ style: l ? { cursor: "pointer" } : void 0,
2508
+ role: l ? "button" : void 0,
2509
+ "aria-label": l ? `Open ${e.name || e.title}'s profile` : void 0,
2509
2510
  children: [
2510
- i && e.gradient ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("linearGradient", {
2511
+ i && e.gradient ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("linearGradient", {
2511
2512
  id: `${b}-${e.id}-grad`,
2512
2513
  x1: "0",
2513
2514
  y1: "0",
2514
2515
  x2: "0",
2515
2516
  y2: "1",
2516
- children: [/* @__PURE__ */ l("stop", {
2517
+ children: [/* @__PURE__ */ d("stop", {
2517
2518
  offset: "0%",
2518
2519
  stopColor: e.color || "var(--page-accent, #4f46e5)"
2519
- }), /* @__PURE__ */ l("stop", {
2520
+ }), /* @__PURE__ */ d("stop", {
2520
2521
  offset: "100%",
2521
2522
  stopColor: e.color2
2522
2523
  })]
2523
- }), /* @__PURE__ */ l("rect", {
2524
+ }), /* @__PURE__ */ d("rect", {
2524
2525
  x: t,
2525
2526
  y: n,
2526
2527
  width: A.w,
2527
2528
  height: A.h,
2528
2529
  rx: "10",
2529
2530
  fill: `url(#${b}-${e.id}-grad)`
2530
- })] }) : i ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
2531
+ })] }) : i ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
2531
2532
  id: `${b}-${e.id}-box`,
2532
- children: /* @__PURE__ */ l("rect", {
2533
+ children: /* @__PURE__ */ d("rect", {
2533
2534
  x: t,
2534
2535
  y: n,
2535
2536
  width: A.w,
2536
2537
  height: A.h,
2537
2538
  rx: "10"
2538
2539
  })
2539
- }), /* @__PURE__ */ u("g", {
2540
+ }), /* @__PURE__ */ f("g", {
2540
2541
  clipPath: `url(#${b}-${e.id}-box)`,
2541
- children: [/* @__PURE__ */ l("rect", {
2542
+ children: [/* @__PURE__ */ d("rect", {
2542
2543
  x: t,
2543
2544
  y: n,
2544
2545
  width: A.w,
2545
2546
  height: _,
2546
2547
  fill: o
2547
- }), /* @__PURE__ */ l("rect", {
2548
+ }), /* @__PURE__ */ d("rect", {
2548
2549
  x: t,
2549
2550
  y: n + _,
2550
2551
  width: A.w,
2551
2552
  height: A.h - _,
2552
2553
  fill: e.color2
2553
2554
  })]
2554
- })] }) : /* @__PURE__ */ l("rect", {
2555
+ })] }) : /* @__PURE__ */ d("rect", {
2555
2556
  x: t,
2556
2557
  y: n,
2557
2558
  width: A.w,
@@ -2561,67 +2562,67 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
2561
2562
  stroke: a ? "none" : "var(--page-accent, #4f46e5)",
2562
2563
  strokeWidth: a ? 0 : 1.5
2563
2564
  }),
2564
- e.photo && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
2565
+ e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
2565
2566
  id: `${b}-${e.id}`,
2566
- children: /* @__PURE__ */ l("circle", {
2567
- cx: t + Ct.pad + A.avatar / 2,
2567
+ children: /* @__PURE__ */ d("circle", {
2568
+ cx: t + Tt.pad + A.avatar / 2,
2568
2569
  cy: n + A.h / 2,
2569
2570
  r: A.avatar / 2
2570
2571
  })
2571
- }), /* @__PURE__ */ l("image", {
2572
+ }), /* @__PURE__ */ d("image", {
2572
2573
  href: e.photo,
2573
- x: t + Ct.pad,
2574
+ x: t + Tt.pad,
2574
2575
  y: n + (A.h - A.avatar) / 2,
2575
2576
  width: A.avatar,
2576
2577
  height: A.avatar,
2577
2578
  preserveAspectRatio: "xMidYMid slice",
2578
2579
  clipPath: `url(#${b}-${e.id})`
2579
2580
  })] }),
2580
- i && !e.gradient ? /* @__PURE__ */ u(c, { children: [e.title && /* @__PURE__ */ l("text", {
2581
+ i && !e.gradient ? /* @__PURE__ */ f(u, { children: [e.title && /* @__PURE__ */ d("text", {
2581
2582
  x: m,
2582
2583
  y: n + _ / 2 + A.title * .35,
2583
2584
  textAnchor: h,
2584
2585
  fontSize: A.title,
2585
2586
  fontWeight: "600",
2586
2587
  fill: s,
2587
- children: yt(e.title, g + 4)
2588
- }), e.name && /* @__PURE__ */ l("text", {
2588
+ children: xt(e.title, g + 4)
2589
+ }), e.name && /* @__PURE__ */ d("text", {
2589
2590
  x: m,
2590
2591
  y: n + _ + _ / 2 + A.name * .35,
2591
2592
  textAnchor: h,
2592
2593
  fontSize: A.name,
2593
2594
  fontWeight: "600",
2594
- fill: d,
2595
- children: yt(e.name, g)
2596
- })] }) : /* @__PURE__ */ u(c, { children: [v[0] && /* @__PURE__ */ l("text", {
2595
+ fill: c,
2596
+ children: xt(e.name, g)
2597
+ })] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
2597
2598
  x: m,
2598
2599
  y: n + (v[1] ? A.h * .43 : A.h * .57),
2599
2600
  textAnchor: h,
2600
2601
  fontSize: A.name,
2601
2602
  fontWeight: "600",
2602
2603
  fill: s,
2603
- children: yt(v[0], g)
2604
- }), v[1] && /* @__PURE__ */ l("text", {
2604
+ children: xt(v[0], g)
2605
+ }), v[1] && /* @__PURE__ */ d("text", {
2605
2606
  x: m,
2606
2607
  y: n + A.h * .73,
2607
2608
  textAnchor: h,
2608
2609
  fontSize: A.title,
2609
2610
  opacity: "0.7",
2610
2611
  fill: s,
2611
- children: yt(v[1], g + 4)
2612
+ children: xt(v[1], g + 4)
2612
2613
  })] })
2613
2614
  ]
2614
2615
  }, e.id);
2615
2616
  })]
2616
- }), S && /* @__PURE__ */ l(wt, {
2617
- node: S,
2618
- onClose: () => C(null)
2617
+ }), x && /* @__PURE__ */ d(Et, {
2618
+ node: x,
2619
+ onClose: () => S(null)
2619
2620
  })]
2620
2621
  });
2621
2622
  }
2622
- function Et({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: c = !1, compact: d = !1, style: f, nodeRef: p }) {
2623
- let { tenant: m, apiUrl: h } = r(U), g = r(W)?.[n], [_, v] = s(null);
2624
- if (i(() => {
2623
+ function Ot({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: c = !1, style: u, nodeRef: p }) {
2624
+ let { tenant: m, apiUrl: h } = i(H), g = i(U)?.[n], [_, v] = l(null);
2625
+ if (a(() => {
2625
2626
  if (!n || g) return;
2626
2627
  let e = !0, t = n.startsWith("api:") ? `${h}/data/${encodeURIComponent(n.slice(4))}` : `${h}/dynamic/${encodeURIComponent(n)}`;
2627
2628
  return fetch(t, { headers: m ? { "x-tenant": m } : {} }).then((e) => e.json()).then((t) => e && v(Array.isArray(t?.payload) ? t.payload : [])).catch(() => e && v([])), () => {
@@ -2633,35 +2634,35 @@ function Et({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
2633
2634
  h,
2634
2635
  g
2635
2636
  ]), !e.length) return null;
2636
- let y = n ? (g ?? _ ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, b = y ? y.map((t) => e.map((e) => q(K(t?.data, e.field)))) : t, S = d ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = c ? { border: C } : { borderBottom: C };
2637
- return /* @__PURE__ */ l("div", {
2637
+ let y = n ? (g ?? _ ?? []).slice(0, Math.max(1, Number(r) || 10)) : null, b = y ? y.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, x = c ? "6px 10px" : "10px 14px", S = "1px solid rgba(148, 163, 184, 0.35)", w = s ? { border: S } : { borderBottom: S };
2638
+ return /* @__PURE__ */ d("div", {
2638
2639
  ref: p,
2639
2640
  style: {
2640
2641
  width: "100%",
2641
2642
  overflowX: "auto",
2642
- ...x(f)
2643
+ ...C(u)
2643
2644
  },
2644
- children: /* @__PURE__ */ u("table", {
2645
+ children: /* @__PURE__ */ f("table", {
2645
2646
  style: {
2646
2647
  width: "100%",
2647
2648
  borderCollapse: "collapse",
2648
2649
  fontSize: 14,
2649
- ...c ? { border: C } : {}
2650
+ ...s ? { border: S } : {}
2650
2651
  },
2651
- children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ l("tr", { children: e.map((e, t) => /* @__PURE__ */ l("th", {
2652
+ children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((e, t) => /* @__PURE__ */ d("th", {
2652
2653
  style: {
2653
2654
  textAlign: "left",
2654
2655
  fontWeight: 600,
2655
- padding: S,
2656
+ padding: x,
2656
2657
  background: "rgba(148, 163, 184, 0.12)",
2657
2658
  ...w
2658
2659
  },
2659
2660
  children: e.label ?? e
2660
- }, t)) }) }), /* @__PURE__ */ l("tbody", { children: b.map((t, n) => /* @__PURE__ */ l("tr", {
2661
+ }, t)) }) }), /* @__PURE__ */ d("tbody", { children: b.map((t, n) => /* @__PURE__ */ d("tr", {
2661
2662
  style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2662
- children: e.map((e, n) => /* @__PURE__ */ l("td", {
2663
+ children: e.map((e, n) => /* @__PURE__ */ d("td", {
2663
2664
  style: {
2664
- padding: S,
2665
+ padding: x,
2665
2666
  ...w
2666
2667
  },
2667
2668
  children: t?.[n] ?? ""
@@ -2670,56 +2671,317 @@ function Et({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
2670
2671
  })
2671
2672
  });
2672
2673
  }
2673
- var Dt = {
2674
- PageRoot: le,
2675
- Section: ue,
2676
- Container: de,
2677
- Heading: fe,
2678
- TextBlock: Ce,
2679
- ButtonBlock: Ee,
2680
- ImageBlock: De,
2681
- Spacer: Ne,
2682
- Divider: Pe,
2683
- SliderBlock: Be,
2684
- CanvasSlider: Ve,
2685
- TabsBlock: Ge,
2686
- QuickStack: dt,
2687
- CollectionList: ft,
2688
- BreadcrumbsBlock: pt,
2689
- PaginationBlock: mt,
2690
- StepperBlock: ht,
2691
- OrgChartBlock: Tt,
2692
- TableBlock: Et,
2693
- AccordionBlock: Ke,
2694
- NavbarBlock: We,
2695
- ListBlock: Se,
2696
- TextSpan: he,
2697
- QuoteBlock: xe,
2698
- TextLink: Te,
2699
- RichTextBlock: ye,
2700
- RichContentBlock: ye,
2701
- VideoBlock: Oe,
2702
- YouTubeBlock: Ae,
2703
- IframeBlock: je,
2704
- EmbedBlock: Me,
2705
- FormBlock: rt,
2706
- FormLabel: it,
2707
- FormInput: at,
2708
- FormTextarea: ot,
2709
- FormCheckbox: (e) => /* @__PURE__ */ l(st, {
2674
+ var kt = {
2675
+ PageRoot: me,
2676
+ Section: he,
2677
+ Container: ge,
2678
+ Heading: _e,
2679
+ TextBlock: Oe,
2680
+ ButtonBlock: je,
2681
+ ImageBlock: Me,
2682
+ Spacer: Re,
2683
+ Divider: ze,
2684
+ SliderBlock: Ge,
2685
+ CanvasSlider: Ke,
2686
+ TabsBlock: Xe,
2687
+ QuickStack: pt,
2688
+ CollectionList: mt,
2689
+ BreadcrumbsBlock: ht,
2690
+ PaginationBlock: gt,
2691
+ StepperBlock: _t,
2692
+ OrgChartBlock: Dt,
2693
+ TableBlock: Ot,
2694
+ AccordionBlock: Ze,
2695
+ NavbarBlock: Ye,
2696
+ ListBlock: De,
2697
+ TextSpan: be,
2698
+ QuoteBlock: Ee,
2699
+ TextLink: Ae,
2700
+ RichTextBlock: we,
2701
+ RichContentBlock: we,
2702
+ VideoBlock: Ne,
2703
+ YouTubeBlock: Fe,
2704
+ IframeBlock: Ie,
2705
+ EmbedBlock: Le,
2706
+ FormBlock: at,
2707
+ FormLabel: ot,
2708
+ FormInput: st,
2709
+ FormTextarea: ct,
2710
+ FormCheckbox: (e) => /* @__PURE__ */ d(lt, {
2710
2711
  kind: "checkbox",
2711
2712
  ...e
2712
2713
  }),
2713
- FormRadio: (e) => /* @__PURE__ */ l(st, {
2714
+ FormRadio: (e) => /* @__PURE__ */ d(lt, {
2714
2715
  kind: "radio",
2715
2716
  ...e
2716
2717
  }),
2717
- FormSelect: ct,
2718
- FormFile: lt,
2719
- FormSubmit: ut
2718
+ FormSelect: ut,
2719
+ FormFile: dt,
2720
+ FormSubmit: ft
2721
+ }, At = {
2722
+ id: "auth",
2723
+ label: "Accounts",
2724
+ category: "Apps",
2725
+ keys: ["SiteLoginForm", "SiteAccountMenu"],
2726
+ ssr: "shell",
2727
+ settings: ["apps.auth.redirect"]
2728
+ }, jt = n({
2729
+ user: null,
2730
+ status: "idle",
2731
+ ensure: () => {},
2732
+ refresh: () => {},
2733
+ signOut: () => {}
2734
+ }), Mt = () => {
2735
+ let e = i(jt);
2736
+ return a(() => {
2737
+ e.ensure();
2738
+ }, [e]), e;
2739
+ };
2740
+ function Nt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o }) {
2741
+ let u = i(H), f = a || u?.apiUrl || "/api", p = o || u?.tenant || "", [m, h] = l(t ?? null), [g, _] = l(t ? "user" : n ? "guest" : "idle"), v = c(!1), y = r((e, t) => fetch(`${f}${e}`, {
2742
+ ...t,
2743
+ credentials: "include",
2744
+ headers: {
2745
+ "content-type": "application/json",
2746
+ ...p ? { "x-tenant": p } : {},
2747
+ ...t?.headers
2748
+ }
2749
+ }), [f, p]), b = r(() => n ? Promise.resolve(null) : y("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
2750
+ let t = e?.payload ?? null;
2751
+ return h(t), _(t ? "user" : "guest"), t;
2752
+ }).catch(() => (h(null), _("guest"), null)), [y, n]), x = r(() => y("/site/logout", { method: "post" }).catch(() => {}).then(() => {
2753
+ h(null), _("guest");
2754
+ }), [y]), S = r(() => {
2755
+ v.current || n || t || (v.current = !0, _("loading"), b());
2756
+ }, [
2757
+ n,
2758
+ t,
2759
+ b
2760
+ ]), C = s(() => ({
2761
+ user: m,
2762
+ status: g,
2763
+ ensure: S,
2764
+ refresh: b,
2765
+ signOut: x
2766
+ }), [
2767
+ m,
2768
+ g,
2769
+ S,
2770
+ b,
2771
+ x
2772
+ ]);
2773
+ return /* @__PURE__ */ d(jt.Provider, {
2774
+ value: C,
2775
+ children: e
2776
+ });
2777
+ }
2778
+ function Pt({ when: e, children: t }) {
2779
+ let { status: n } = Mt();
2780
+ return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
2781
+ }
2782
+ //#endregion
2783
+ //#region ../ui/src/components/builder/apps/auth/views.jsx
2784
+ function Ft({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
2785
+ let { tenant: h, apiUrl: g, settings: _ } = i(H), [v, y] = l("form"), [b, x] = l(""), [S, w] = l(!1), T = e === "register", E = u ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
2786
+ if (e.preventDefault(), u) return;
2787
+ let n = new FormData(e.currentTarget);
2788
+ w(!0), x("");
2789
+ try {
2790
+ let e = await fetch(`${g || "/api"}/site/${T ? "register" : "login"}`, {
2791
+ method: "post",
2792
+ headers: {
2793
+ "content-type": "application/json",
2794
+ ...h ? { "x-tenant": h } : {}
2795
+ },
2796
+ credentials: "same-origin",
2797
+ body: JSON.stringify({
2798
+ email: n.get("email"),
2799
+ password: n.get("password"),
2800
+ ...T ? { name: n.get("name") || "" } : {}
2801
+ })
2802
+ }), r = await e.json().catch(() => null);
2803
+ if (!e.ok || r?.success === !1) {
2804
+ x(r?.error?.message || "Sign-in failed"), y("error"), w(!1);
2805
+ return;
2806
+ }
2807
+ if (y("success"), typeof window < "u") {
2808
+ let e = D(t) || D(new URLSearchParams(window.location.search).get("next")) || D(_?.["apps.auth.redirect"]) || "/";
2809
+ window.location.assign(e);
2810
+ }
2811
+ } catch {
2812
+ x("Sign-in failed"), y("error"), w(!1);
2813
+ }
2814
+ };
2815
+ return /* @__PURE__ */ f("div", {
2816
+ ref: c,
2817
+ style: {
2818
+ display: "grid",
2819
+ gap: 12,
2820
+ maxWidth: 360,
2821
+ ...C(s)
2822
+ },
2823
+ children: [
2824
+ /* @__PURE__ */ f("form", {
2825
+ onSubmit: O,
2826
+ style: {
2827
+ display: E === "form" ? "grid" : "none",
2828
+ gap: 10
2829
+ },
2830
+ children: [
2831
+ T ? /* @__PURE__ */ f("label", {
2832
+ style: {
2833
+ ...Y,
2834
+ display: "grid",
2835
+ gap: 6
2836
+ },
2837
+ children: [a, /* @__PURE__ */ d("input", {
2838
+ name: "name",
2839
+ type: "text",
2840
+ style: X,
2841
+ ...Z(u)
2842
+ })]
2843
+ }) : null,
2844
+ /* @__PURE__ */ f("label", {
2845
+ style: {
2846
+ ...Y,
2847
+ display: "grid",
2848
+ gap: 6
2849
+ },
2850
+ children: [n, /* @__PURE__ */ d("input", {
2851
+ name: "email",
2852
+ type: "email",
2853
+ required: !u,
2854
+ style: X,
2855
+ ...Z(u)
2856
+ })]
2857
+ }),
2858
+ /* @__PURE__ */ f("label", {
2859
+ style: {
2860
+ ...Y,
2861
+ display: "grid",
2862
+ gap: 6
2863
+ },
2864
+ children: [r, /* @__PURE__ */ d("input", {
2865
+ name: "password",
2866
+ type: "password",
2867
+ required: !u,
2868
+ style: X,
2869
+ ...Z(u)
2870
+ })]
2871
+ }),
2872
+ /* @__PURE__ */ d("button", {
2873
+ type: u ? "button" : "submit",
2874
+ disabled: S || void 0,
2875
+ style: {
2876
+ ...q,
2877
+ border: 0,
2878
+ padding: "10px 22px",
2879
+ borderRadius: 8,
2880
+ fontSize: 15,
2881
+ fontWeight: 600,
2882
+ cursor: "pointer",
2883
+ opacity: S ? .6 : 1
2884
+ },
2885
+ children: o || (T ? "Create account" : "Sign in")
2886
+ }),
2887
+ b ? /* @__PURE__ */ d("p", {
2888
+ style: {
2889
+ margin: 0,
2890
+ fontSize: 14,
2891
+ color: "#dc2626"
2892
+ },
2893
+ children: b
2894
+ }) : null
2895
+ ]
2896
+ }),
2897
+ /* @__PURE__ */ d("div", {
2898
+ style: { display: E === "success" ? "block" : "none" },
2899
+ children: p?.success ?? null
2900
+ }),
2901
+ /* @__PURE__ */ d("div", {
2902
+ style: { display: E === "error" ? "block" : "none" },
2903
+ children: p?.error ?? null
2904
+ })
2905
+ ]
2906
+ });
2907
+ }
2908
+ function It({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
2909
+ let { user: c, status: l, signOut: u } = Mt(), p = a ? s || "user" : l, m = a ? {
2910
+ name: "Ada Lovelace",
2911
+ email: "ada@example.com"
2912
+ } : c;
2913
+ return p === "loading" ? /* @__PURE__ */ d("div", {
2914
+ ref: i,
2915
+ style: {
2916
+ minHeight: 24,
2917
+ ...C(r)
2918
+ }
2919
+ }) : p === "user" ? /* @__PURE__ */ f("div", {
2920
+ ref: i,
2921
+ style: {
2922
+ display: "flex",
2923
+ alignItems: "center",
2924
+ gap: 10,
2925
+ ...C(r)
2926
+ },
2927
+ children: [
2928
+ /* @__PURE__ */ f("span", {
2929
+ style: {
2930
+ ...Y,
2931
+ fontWeight: 600
2932
+ },
2933
+ children: [
2934
+ e,
2935
+ " ",
2936
+ m?.name || m?.email || ""
2937
+ ]
2938
+ }),
2939
+ n && m?.email ? /* @__PURE__ */ d("span", {
2940
+ style: {
2941
+ ...Y,
2942
+ opacity: .7
2943
+ },
2944
+ children: m.email
2945
+ }) : null,
2946
+ /* @__PURE__ */ d("button", {
2947
+ type: "button",
2948
+ onClick: a ? void 0 : u,
2949
+ style: {
2950
+ ...q,
2951
+ border: 0,
2952
+ padding: "8px 16px",
2953
+ borderRadius: 8,
2954
+ fontSize: 14,
2955
+ cursor: a ? "default" : "pointer"
2956
+ },
2957
+ ...Z(a),
2958
+ children: t
2959
+ })
2960
+ ]
2961
+ }) : /* @__PURE__ */ d("div", {
2962
+ ref: i,
2963
+ style: {
2964
+ display: "flex",
2965
+ alignItems: "center",
2966
+ gap: 10,
2967
+ ...C(r)
2968
+ },
2969
+ children: o?.signedOut ?? null
2970
+ });
2971
+ }
2972
+ //#endregion
2973
+ //#region ../ui/src/components/builder/apps/index.js
2974
+ var Lt = [At], Rt = {
2975
+ SiteLoginForm: Ft,
2976
+ SiteAccountMenu: It
2720
2977
  };
2978
+ new Set(Lt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
2721
2979
  //#endregion
2722
2980
  //#region ../ui/src/components/builder/render.jsx
2981
+ var zt = {
2982
+ ...kt,
2983
+ ...Rt
2984
+ };
2723
2985
  function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2724
2986
  let o = n[e];
2725
2987
  if (!o || o.hidden) return null;
@@ -2728,99 +2990,110 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2728
2990
  let n = o.props?.componentId, s = r?.[n];
2729
2991
  if (!s?.template || i.has(n)) return null;
2730
2992
  let c = new Set(i).add(n);
2731
- return /* @__PURE__ */ l(t, { children: Q(s.template.rootId, s.template.nodes, r, c, a) }, e);
2993
+ return /* @__PURE__ */ d(t, { children: Q(s.template.rootId, s.template.nodes, r, c, a) }, e);
2732
2994
  }
2733
- let u = Dt[s];
2734
- if (!u) return null;
2735
- 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;
2736
- return /* @__PURE__ */ l(u, {
2995
+ let l = zt[s];
2996
+ if (!l) return null;
2997
+ let u = (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, m = /* @__PURE__ */ d(l, {
2737
2998
  ...c,
2738
2999
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
2739
3000
  linked: p,
2740
3001
  nodeRef: (t) => {
2741
- t && (t.setAttribute("data-wb", e), T(t, c));
3002
+ t && (t.setAttribute("data-wb", e), D(t, c));
2742
3003
  },
2743
- children: d.length ? d : void 0
3004
+ children: u.length ? u : void 0
2744
3005
  }, e);
3006
+ return c.when && c.when !== "always" ? /* @__PURE__ */ d(Pt, {
3007
+ when: c.when,
3008
+ children: m
3009
+ }, e) : m;
2745
3010
  }
2746
3011
  //#endregion
2747
3012
  //#region ../ui/src/components/builder/PageRenderer.jsx
2748
- var Ot = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2749
- function kt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: d, datasets: f, locale: m, direction: g }) {
2750
- let v = s?.js?.trim();
2751
- if (i(() => {
2752
- if (!v) return;
3013
+ var Bt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
3014
+ function Vt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, tenant: c, apiUrl: l, datasets: u, locale: p, direction: m, settings: g, siteUser: v }) {
3015
+ let b = o?.js?.trim();
3016
+ if (a(() => {
3017
+ if (!b) return;
2753
3018
  let e = document.createElement("script");
2754
- return e.text = v, document.body.appendChild(e), () => e.remove();
2755
- }, [v]), !e?.ROOT) return null;
2756
- let y = {
2757
- lang: m || void 0,
2758
- dir: p(g, m)
2759
- }, b = {
3019
+ return e.text = b, document.body.appendChild(e), () => e.remove();
3020
+ }, [b]), !e?.ROOT) return null;
3021
+ let x = {
3022
+ lang: p || void 0,
3023
+ dir: h(m, p)
3024
+ }, S = {
2760
3025
  minHeight: "100%",
2761
3026
  display: "flex",
2762
3027
  flexDirection: "column"
2763
- }, x = Q("ROOT", e, n), S = o(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), C = N(e, n), w = M(e, n), T = s?.css?.trim(), E = _(e, n).map((e) => /* @__PURE__ */ l("link", {
3028
+ }, C = Q("ROOT", e, n), w = s(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), T = F(e, n), E = P(e, n), D = o?.css?.trim(), O = y(e, n).map((e) => /* @__PURE__ */ d("link", {
2764
3029
  rel: "stylesheet",
2765
3030
  precedence: "default",
2766
- href: h(e)
3031
+ href: _(e)
2767
3032
  }, e));
2768
- if (r !== "auto") return /* @__PURE__ */ l(U.Provider, {
3033
+ if (r !== "auto") return /* @__PURE__ */ d(H.Provider, {
2769
3034
  value: {
2770
3035
  tenant: c || "",
2771
- apiUrl: d || "/api",
2772
- locale: m || ""
3036
+ apiUrl: l || "/api",
3037
+ locale: p || "",
3038
+ settings: g ?? null
2773
3039
  },
2774
- children: /* @__PURE__ */ l(W.Provider, {
2775
- value: f ?? null,
2776
- children: /* @__PURE__ */ l(G.Provider, {
2777
- value: S,
2778
- children: /* @__PURE__ */ u("div", {
2779
- ...y,
2780
- style: {
2781
- ...b,
2782
- ...H(t, r),
2783
- ...a
2784
- },
2785
- children: [
2786
- E,
2787
- C && /* @__PURE__ */ l("style", { children: C }),
2788
- w && /* @__PURE__ */ l("style", { children: w }),
2789
- T && /* @__PURE__ */ l("style", { children: T }),
2790
- x
2791
- ]
3040
+ children: /* @__PURE__ */ d(Nt, {
3041
+ initialUser: v,
3042
+ children: /* @__PURE__ */ d(U.Provider, {
3043
+ value: u ?? null,
3044
+ children: /* @__PURE__ */ d(W.Provider, {
3045
+ value: w,
3046
+ children: /* @__PURE__ */ f("div", {
3047
+ ...x,
3048
+ style: {
3049
+ ...S,
3050
+ ...re(t, r),
3051
+ ...i
3052
+ },
3053
+ children: [
3054
+ O,
3055
+ T && /* @__PURE__ */ d("style", { children: T }),
3056
+ E && /* @__PURE__ */ d("style", { children: E }),
3057
+ D && /* @__PURE__ */ d("style", { children: D }),
3058
+ C
3059
+ ]
3060
+ })
2792
3061
  })
2793
3062
  })
2794
3063
  })
2795
3064
  });
2796
- let D = B(t);
2797
- return /* @__PURE__ */ l(U.Provider, {
3065
+ let k = B(t);
3066
+ return /* @__PURE__ */ d(H.Provider, {
2798
3067
  value: {
2799
3068
  tenant: c || "",
2800
- apiUrl: d || "/api",
2801
- locale: m || ""
3069
+ apiUrl: l || "/api",
3070
+ locale: p || "",
3071
+ settings: g ?? null
2802
3072
  },
2803
- children: /* @__PURE__ */ l(W.Provider, {
2804
- value: f ?? null,
2805
- children: /* @__PURE__ */ l(G.Provider, {
2806
- value: S,
2807
- children: /* @__PURE__ */ u("div", {
2808
- ...y,
2809
- className: "webim-page",
2810
- style: {
2811
- ...b,
2812
- ...ee(t),
2813
- ...a
2814
- },
2815
- children: [
2816
- /* @__PURE__ */ l("style", { children: `.webim-page { ${Ot(V(D.light))} }
2817
- @media (prefers-color-scheme: dark) { .webim-page { ${Ot(V(D.dark))} } }` }),
2818
- E,
2819
- C && /* @__PURE__ */ l("style", { children: C }),
2820
- w && /* @__PURE__ */ l("style", { children: w }),
2821
- T && /* @__PURE__ */ l("style", { children: T }),
2822
- x
2823
- ]
3073
+ children: /* @__PURE__ */ d(Nt, {
3074
+ initialUser: v,
3075
+ children: /* @__PURE__ */ d(U.Provider, {
3076
+ value: u ?? null,
3077
+ children: /* @__PURE__ */ d(W.Provider, {
3078
+ value: w,
3079
+ children: /* @__PURE__ */ f("div", {
3080
+ ...x,
3081
+ className: "webim-page",
3082
+ style: {
3083
+ ...S,
3084
+ ...ne(t),
3085
+ ...i
3086
+ },
3087
+ children: [
3088
+ /* @__PURE__ */ d("style", { children: `.webim-page { ${Bt(V(k.light))} }
3089
+ @media (prefers-color-scheme: dark) { .webim-page { ${Bt(V(k.dark))} } }` }),
3090
+ O,
3091
+ T && /* @__PURE__ */ d("style", { children: T }),
3092
+ E && /* @__PURE__ */ d("style", { children: E }),
3093
+ D && /* @__PURE__ */ d("style", { children: D }),
3094
+ C
3095
+ ]
3096
+ })
2824
3097
  })
2825
3098
  })
2826
3099
  })
@@ -2828,8 +3101,8 @@ function kt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
2828
3101
  }
2829
3102
  //#endregion
2830
3103
  //#region src/WebimContent.jsx
2831
- function At({ bundle: e, mode: t = "auto", style: n }) {
2832
- return e?.blocks?.ROOT ? /* @__PURE__ */ l(kt, {
3104
+ function Ht({ bundle: e, mode: t = "auto", style: n }) {
3105
+ return e?.blocks?.ROOT ? /* @__PURE__ */ d(Vt, {
2833
3106
  blocks: e.blocks,
2834
3107
  theme: e.theme,
2835
3108
  components: e.components,
@@ -2839,13 +3112,14 @@ function At({ bundle: e, mode: t = "auto", style: n }) {
2839
3112
  datasets: e.datasets,
2840
3113
  locale: e.locale,
2841
3114
  direction: e.direction,
3115
+ settings: e.settings,
2842
3116
  mode: t,
2843
3117
  style: n
2844
3118
  }) : null;
2845
3119
  }
2846
3120
  //#endregion
2847
3121
  //#region src/bundle.js
2848
- function jt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
3122
+ function Ut({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2849
3123
  let a = {
2850
3124
  ...t?.global ?? {},
2851
3125
  ...t?.tenant ?? {}
@@ -2855,7 +3129,7 @@ function jt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2855
3129
  title: e.title,
2856
3130
  slug: e.slug,
2857
3131
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
2858
- theme: te(o, a.builder_themes?.themes),
3132
+ theme: ie(o, a.builder_themes?.themes),
2859
3133
  components: a.builder_components?.components ?? {},
2860
3134
  custom: o.custom,
2861
3135
  seo: o.seo,
@@ -2863,23 +3137,24 @@ function jt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2863
3137
  locale: i || a.locales?.default,
2864
3138
  locales: a.locales,
2865
3139
  tenant: n ?? "",
2866
- apiUrl: r ?? ""
3140
+ apiUrl: r ?? "",
3141
+ settings: a
2867
3142
  };
2868
3143
  }
2869
3144
  //#endregion
2870
3145
  //#region src/fetchPage.js
2871
- var Mt = async (e) => {
3146
+ var Wt = async (e) => {
2872
3147
  let t = await e.json().catch(() => null);
2873
3148
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
2874
3149
  return t?.payload ?? t;
2875
3150
  };
2876
- async function Nt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
3151
+ async function Gt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
2877
3152
  if (!e) throw Error("fetchPage: apiUrl is required");
2878
3153
  if (!n) throw Error("fetchPage: slug is required");
2879
3154
  let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
2880
3155
  ...t ? { "x-tenant": t } : {},
2881
3156
  ...a ? { authorization: `Bearer ${a}` } : {}
2882
- }, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(Mt), s(`${c}/settings/public`, { headers: l }).then(Mt)]), f = jt({
3157
+ }, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(Wt), s(`${c}/settings/public`, { headers: l }).then(Wt)]), f = Ut({
2883
3158
  page: u,
2884
3159
  settings: d,
2885
3160
  tenant: t,
@@ -2887,7 +3162,7 @@ async function Nt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
2887
3162
  locale: r
2888
3163
  }), p = [...new Set(Object.values(f.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
2889
3164
  if (p.length) {
2890
- let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(Mt).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
3165
+ let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(Wt).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
2891
3166
  f.datasets = Object.fromEntries(t);
2892
3167
  }
2893
3168
  return f;
@@ -2900,15 +3175,15 @@ var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
2900
3175
  ">": "&gt;",
2901
3176
  "\"": "&quot;"
2902
3177
  })[e]);
2903
- function Pt(t, { mode: n = "auto", style: r } = {}) {
2904
- return e(/* @__PURE__ */ l(At, {
3178
+ function Kt(t, { mode: n = "auto", style: r } = {}) {
3179
+ return e(/* @__PURE__ */ d(Ht, {
2905
3180
  bundle: t,
2906
3181
  mode: n,
2907
3182
  style: r
2908
3183
  }));
2909
3184
  }
2910
- function Ft(e, { mode: t = "auto", lang: n } = {}) {
2911
- let r = e.seo ?? {}, i = n || e.locale || "en", a = p(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
3185
+ function qt(e, { mode: t = "auto", lang: n } = {}) {
3186
+ let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
2912
3187
  "<meta charset=\"utf-8\"/>",
2913
3188
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
2914
3189
  `<title>${$(o)}</title>`,
@@ -2924,10 +3199,10 @@ function Ft(e, { mode: t = "auto", lang: n } = {}) {
2924
3199
  ${c}
2925
3200
  </head>
2926
3201
  <body>
2927
- ${Pt(e, { mode: t })}
3202
+ ${Kt(e, { mode: t })}
2928
3203
  ${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
2929
3204
  </body>
2930
3205
  </html>`;
2931
3206
  }
2932
3207
  //#endregion
2933
- export { jt as assembleBundle, Nt as fetchPage, Pt as renderBundleHtml, Ft as renderPageDocument };
3208
+ export { Ut as assembleBundle, Gt as fetchPage, Kt as renderBundleHtml, qt as renderPageDocument };