webim-adapter 0.6.0 → 0.7.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,36 +1,36 @@
1
- import { Fragment as e, createContext as t, useContext as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
2
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
1
+ import { Fragment as e, createContext as t, useContext as n, useEffect as r, useId as i, useMemo as a, useRef as o, useState as s } from "react";
2
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
3
3
  //#region ../ui/src/components/builder/styles.js
4
- var u = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), d = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, f = [
4
+ var d = /* @__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(".")), f = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, p = [
5
5
  "borderWidth",
6
6
  "borderStyle",
7
7
  "borderColor",
8
8
  "borderRadius",
9
9
  "gap"
10
10
  ];
11
- function p(e) {
11
+ function m(e) {
12
12
  let t = {};
13
- for (let n of f) {
13
+ for (let n of p) {
14
14
  let r = e?.[n];
15
- r != null && r !== "" && (t[n] = u.has(n) ? d(r) : r);
15
+ r != null && r !== "" && (t[n] = d.has(n) ? f(r) : r);
16
16
  }
17
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || f.includes(n) || (t[n] = u.has(n) ? d(r) : r);
17
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || p.includes(n) || (t[n] = d.has(n) ? f(r) : r);
18
18
  let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
19
19
  delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
20
- let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: p } = t;
20
+ let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
21
21
  delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
22
- let m = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${d(e.x ?? 0)} ${d(e.y ?? 0)} ${d(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
22
+ let m = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${f(e.x ?? 0)} ${f(e.y ?? 0)} ${f(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
23
23
  [
24
24
  s,
25
25
  c,
26
26
  l,
27
- p
28
- ].some((e) => e !== void 0) && m.push(`${d(s ?? 0)} ${d(c ?? 0)} ${d(l ?? 0)} ${p || "rgba(0, 0, 0, 0.35)"}`), m.length && (t.textShadow = m.join(", "));
29
- let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${d(e.x ?? 0)}, ${d(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${h(e.a ?? 0)})` : e.type === "skew" ? `skew(${h(e.x ?? 0)}, ${h(e.y ?? 0)})` : null, { transforms: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY: C } = t;
27
+ u
28
+ ].some((e) => e !== void 0) && m.push(`${f(s ?? 0)} ${f(c ?? 0)} ${f(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), m.length && (t.textShadow = m.join(", "));
29
+ let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${f(e.x ?? 0)}, ${f(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${h(e.a ?? 0)})` : e.type === "skew" ? `skew(${h(e.x ?? 0)}, ${h(e.y ?? 0)})` : null, { transforms: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY: C } = t;
30
30
  delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
31
31
  let w = (Array.isArray(_) ? _ : []).filter((e) => e && e.on !== !1).map(g).filter(Boolean);
32
- (v !== void 0 || y !== void 0) && w.push(`translate(${d(v ?? 0)}, ${d(y ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), x !== void 0 && w.push(`rotate(${h(x)})`), (S !== void 0 || C !== void 0) && w.push(`skew(${h(S ?? 0)}, ${h(C ?? 0)})`), w.length && (t.transform = w.join(" "));
33
- let T = (e) => `${e.inset ? "inset " : ""}${d(e.x ?? 0)} ${d(e.y ?? 0)} ${d(e.blur ?? 0)} ${d(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: E, boxShadowX: D, boxShadowY: O, boxShadowBlur: k, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
32
+ (v !== void 0 || y !== void 0) && w.push(`translate(${f(v ?? 0)}, ${f(y ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), x !== void 0 && w.push(`rotate(${h(x)})`), (S !== void 0 || C !== void 0) && w.push(`skew(${h(S ?? 0)}, ${h(C ?? 0)})`), w.length && (t.transform = w.join(" "));
33
+ let T = (e) => `${e.inset ? "inset " : ""}${f(e.x ?? 0)} ${f(e.y ?? 0)} ${f(e.blur ?? 0)} ${f(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: E, boxShadowX: D, boxShadowY: O, boxShadowBlur: k, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
34
34
  delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
35
35
  let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
36
36
  [
@@ -48,76 +48,76 @@ function p(e) {
48
48
  color: j,
49
49
  inset: M
50
50
  })), N.length && (t.boxShadow = N.join(", "));
51
- let P = (e) => e.type === "blur" ? `blur(${d(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(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: ne } = t;
51
+ let P = (e) => e.type === "blur" ? `blur(${f(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(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: ee, filterGrayscale: R, filterBrightness: z, filterContrast: te, filterSaturate: ne } = t;
52
52
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
53
53
  let B = F(I);
54
- R !== void 0 && B.push(`blur(${d(R)})`), z !== void 0 && B.push(`grayscale(${z}%)`), ee !== void 0 && B.push(`brightness(${ee}%)`), te !== void 0 && B.push(`contrast(${te}%)`), ne !== void 0 && B.push(`saturate(${ne}%)`), B.length && (t.filter = B.join(" "));
54
+ ee !== void 0 && B.push(`blur(${f(ee)})`), R !== void 0 && B.push(`grayscale(${R}%)`), z !== void 0 && B.push(`brightness(${z}%)`), te !== void 0 && B.push(`contrast(${te}%)`), ne !== void 0 && B.push(`saturate(${ne}%)`), B.length && (t.filter = B.join(" "));
55
55
  let re = F(L);
56
56
  re.length && (t.backdropFilter = re.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
- let { textStrokeWidth: V, textStrokeColor: ie } = t;
58
- delete t.textStrokeWidth, delete t.textStrokeColor, (V !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${d(V ?? 1)} ${ie || "currentColor"}`);
59
- let { clipText: H } = t;
60
- delete t.clipText, H && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
- let { transitions: U, transitionDuration: W, transitionEasing: ae, transitionProperty: G } = t, oe = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
57
+ let { textStrokeWidth: ie, textStrokeColor: ae } = t;
58
+ delete t.textStrokeWidth, delete t.textStrokeColor, (ie !== void 0 || ae !== void 0) && (t.WebkitTextStroke = `${f(ie ?? 1)} ${ae || "currentColor"}`);
59
+ let { clipText: oe } = t;
60
+ delete t.clipText, oe && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
+ let { transitions: V, transitionDuration: H, transitionEasing: U, transitionProperty: se } = t, W = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
62
62
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
63
- let K = (Array.isArray(U) ? U : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${oe(e.duration ?? 200)} ${e.easing || "ease"}`);
64
- if (W !== void 0 && K.push(`${G || "all"} ${oe(W)} ${ae || "ease"}`), K.length && (t.transition = K.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
63
+ let G = (Array.isArray(V) ? V : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${W(e.duration ?? 200)} ${e.easing || "ease"}`);
64
+ if (H !== void 0 && G.push(`${se || "all"} ${W(H)} ${U || "ease"}`), G.length && (t.transition = G.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
65
65
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
66
66
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
67
67
  }
68
68
  delete t.backgroundVideo;
69
- let { overlayColor: se, overlayOpacity: q } = t;
70
- if (delete t.overlayColor, delete t.overlayOpacity, se) {
71
- let e = `color-mix(in srgb, ${se} ${q ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
69
+ let { overlayColor: K, overlayOpacity: ce } = t;
70
+ if (delete t.overlayColor, delete t.overlayOpacity, K) {
71
+ let e = `color-mix(in srgb, ${K} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
72
72
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
73
73
  }
74
74
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
75
- let { backgroundLayers: J } = t;
75
+ let { backgroundLayers: q } = t;
76
76
  delete t.backgroundLayers;
77
- let Y = (Array.isArray(J) ? J : []).filter((e) => e && e.on !== !1);
78
- if (Y.length) {
77
+ let J = (Array.isArray(q) ? q : []).filter((e) => e && e.on !== !1);
78
+ if (J.length) {
79
79
  let e = [], n = [], r = [], i = [], a = [];
80
- for (let t of Y) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
80
+ for (let t of J) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
81
81
  else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
82
82
  else {
83
83
  if (!t.src) continue;
84
- e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${d(t.w ?? "auto")} ${d(t.h ?? "auto")}` : t.size || "cover"), r.push(`${d(t.posX ?? 0)} ${d(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
84
+ e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${f(t.w ?? "auto")} ${f(t.h ?? "auto")}` : t.size || "cover"), r.push(`${f(t.posX ?? 0)} ${f(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
85
85
  }
86
86
  e.length && (t.backgroundImage && (e.push(t.backgroundImage), n.push(t.backgroundSize || "cover"), r.push(t.backgroundPosition || "center"), i.push(t.backgroundRepeat || "no-repeat"), a.push("scroll")), t.backgroundImage = e.join(", "), t.backgroundSize = n.join(", "), t.backgroundPosition = r.join(", "), t.backgroundRepeat = i.join(", "), t.backgroundAttachment = a.join(", "));
87
87
  }
88
88
  return t;
89
89
  }
90
- var m = {
90
+ var h = {
91
91
  hover: ":hover",
92
92
  pressed: ":active",
93
93
  focused: ":focus"
94
- }, h = /* @__PURE__ */ new Set([
94
+ }, g = /* @__PURE__ */ new Set([
95
95
  "style",
96
96
  "class",
97
97
  "id",
98
98
  "data-wb",
99
99
  "data-wb-class",
100
100
  "data-slot"
101
- ]), g = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !h.has(e.toLowerCase());
102
- function _(e, t, n = []) {
101
+ ]), _ = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !g.has(e.toLowerCase());
102
+ function v(e, t, n = []) {
103
103
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
104
104
  for (let t of n) e.removeAttribute(t);
105
105
  let r = [];
106
106
  for (let n of t.attributes ?? []) {
107
107
  let t = String(n?.name ?? "").trim();
108
- g(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
108
+ _(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
109
109
  }
110
110
  return r;
111
111
  }
112
- var v = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
113
- function y(e, t, n, r = !1) {
114
- let i = Object.entries(p(t)).map(([e, t]) => `${v(e)}: ${t} !important;`).join(" ");
112
+ var y = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
113
+ function b(e, t, n, r = !1) {
114
+ let i = Object.entries(m(t)).map(([e, t]) => `${y(e)}: ${t} !important;`).join(" ");
115
115
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
116
116
  }
117
- function b(e, t, n) {
118
- return Object.entries(m).map(([r, i]) => y(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
117
+ function x(e, t, n) {
118
+ return Object.entries(h).map(([r, i]) => b(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
119
119
  }
120
- var x = [
120
+ var S = [
121
121
  {
122
122
  key: "tablet",
123
123
  max: 991
@@ -130,17 +130,17 @@ var x = [
130
130
  key: "mobile",
131
131
  max: 478
132
132
  }
133
- ], S = (e) => Object.entries(p(e)).map(([e, t]) => `${v(e)}: ${t} !important;`).join(" ");
134
- function C(e, t) {
135
- return x.map(({ key: n, max: r }) => {
136
- let i = t?.[n] ? S(t[n]) : "";
133
+ ], C = (e) => Object.entries(m(e)).map(([e, t]) => `${y(e)}: ${t} !important;`).join(" ");
134
+ function w(e, t) {
135
+ return S.map(({ key: n, max: r }) => {
136
+ let i = t?.[n] ? C(t[n]) : "";
137
137
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
138
138
  }).filter(Boolean).join("\n");
139
139
  }
140
- function w(e, t) {
140
+ function T(e, t) {
141
141
  let n = [], r = (e) => {
142
142
  for (let [t, r] of Object.entries(e || {})) {
143
- let e = C(t, r.props);
143
+ let e = w(t, r.props);
144
144
  e && n.push(e);
145
145
  }
146
146
  };
@@ -148,10 +148,10 @@ function w(e, t) {
148
148
  for (let e of Object.values(t || {})) r(e.template?.nodes);
149
149
  return n.join("\n");
150
150
  }
151
- function T(e, t) {
151
+ function E(e, t) {
152
152
  let n = [], r = (e) => {
153
153
  for (let [t, r] of Object.entries(e || {})) {
154
- let e = b(t, r.props);
154
+ let e = x(t, r.props);
155
155
  e && n.push(e);
156
156
  }
157
157
  };
@@ -159,7 +159,7 @@ function T(e, t) {
159
159
  for (let e of Object.values(t || {})) r(e.template?.nodes);
160
160
  return n.join("\n");
161
161
  }
162
- var E = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", D = {
162
+ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", O = {
163
163
  light: {
164
164
  background: "#ffffff",
165
165
  text: "#111827",
@@ -196,23 +196,23 @@ var E = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
196
196
  contrastText: "#052e2b"
197
197
  }
198
198
  }
199
- }, O = {
199
+ }, k = {
200
200
  font: "system",
201
201
  headingFont: "inherit",
202
- light: D.light,
203
- dark: D.dark
204
- }, k = {
202
+ light: O.light,
203
+ dark: O.dark
204
+ }, A = {
205
205
  system: {
206
206
  label: "System",
207
- value: E
207
+ value: D
208
208
  },
209
209
  inter: {
210
210
  label: "Inter",
211
- value: `"Inter", ${E}`
211
+ value: `"Inter", ${D}`
212
212
  },
213
213
  outfit: {
214
214
  label: "Outfit",
215
- value: `"Outfit", ${E}`
215
+ value: `"Outfit", ${D}`
216
216
  },
217
217
  serif: {
218
218
  label: "Serif",
@@ -222,7 +222,7 @@ var E = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
222
222
  label: "Mono",
223
223
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
224
224
  }
225
- }, A = (e, t) => k[e]?.value ?? t, j = (e, ...t) => {
225
+ }, j = (e, t) => A[e]?.value ?? t, M = (e, ...t) => {
226
226
  let n = Object.assign({}, e, ...t);
227
227
  return n.primary = {
228
228
  ...e.primary,
@@ -238,16 +238,16 @@ var E = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
238
238
  }), {})
239
239
  }, n;
240
240
  };
241
- function M(e) {
241
+ function N(e) {
242
242
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
243
243
  return {
244
- font: r ?? O.font,
245
- headingFont: i ?? O.headingFont,
246
- light: j(D.light, a, t),
247
- dark: j(D.dark, n)
244
+ font: r ?? k.font,
245
+ headingFont: i ?? k.headingFont,
246
+ light: M(O.light, a, t),
247
+ dark: M(O.dark, n)
248
248
  };
249
249
  }
250
- function N(e) {
250
+ function P(e) {
251
251
  return {
252
252
  "--page-bg": e.background,
253
253
  "--page-text": e.text,
@@ -263,28 +263,28 @@ function N(e) {
263
263
  "--page-secondary-contrast": e.secondary.contrastText
264
264
  };
265
265
  }
266
- function P(e) {
267
- let t = M(e);
266
+ function F(e) {
267
+ let t = N(e);
268
268
  return {
269
269
  backgroundColor: "var(--page-bg)",
270
270
  color: "var(--page-text)",
271
- fontFamily: A(t.font, E),
272
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : A(t.headingFont, "inherit")
271
+ fontFamily: j(t.font, D),
272
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : j(t.headingFont, "inherit")
273
273
  };
274
274
  }
275
- function F(e, t = "light") {
276
- let n = M(e);
275
+ function I(e, t = "light") {
276
+ let n = N(e);
277
277
  return {
278
- ...P(e),
279
- ...N(n[t] ?? n.light)
278
+ ...F(e),
279
+ ...P(n[t] ?? n.light)
280
280
  };
281
281
  }
282
- function I(e, t) {
282
+ function L(e, t) {
283
283
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
284
284
  }
285
285
  //#endregion
286
286
  //#region src/bundle.js
287
- function L({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
287
+ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
288
288
  let a = {
289
289
  ...t?.global ?? {},
290
290
  ...t?.tenant ?? {}
@@ -294,7 +294,7 @@ function L({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
294
294
  title: e.title,
295
295
  slug: e.slug,
296
296
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
297
- theme: I(o, a.builder_themes?.themes),
297
+ theme: L(o, a.builder_themes?.themes),
298
298
  components: a.builder_components?.components ?? {},
299
299
  custom: o.custom,
300
300
  seo: o.seo,
@@ -312,21 +312,24 @@ var R = async (e) => {
312
312
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
313
313
  return t?.payload ?? t;
314
314
  };
315
- async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
315
+ async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
316
316
  if (!e) throw Error("fetchPage: apiUrl is required");
317
317
  if (!n) throw Error("fetchPage: slug is required");
318
- let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(R), o(`${s}/settings/public`, { headers: c }).then(R)]), d = L({
319
- page: l,
320
- settings: u,
318
+ let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
319
+ ...t ? { "x-tenant": t } : {},
320
+ ...a ? { authorization: `Bearer ${a}` } : {}
321
+ }, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(R), s(`${c}/settings/public`, { headers: l }).then(R)]), f = ee({
322
+ page: u,
323
+ settings: d,
321
324
  tenant: t,
322
- apiUrl: s,
325
+ apiUrl: c,
323
326
  locale: r
324
- }), f = [...new Set(Object.values(d.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" ? e.props?.source : null).filter(Boolean))];
325
- if (f.length) {
326
- let e = (e) => e.startsWith("api:") ? `${s}/data/${encodeURIComponent(e.slice(4))}` : `${s}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(f.map((t) => o(e(t), { headers: c }).then(R).then((e) => [t, Array.isArray(e) ? e : []]).catch(() => [t, []])));
327
- d.datasets = Object.fromEntries(t);
327
+ }), 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))];
328
+ if (p.length) {
329
+ 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(R).then((e) => [t, Array.isArray(e) ? e : []]).catch(() => [t, []])));
330
+ f.datasets = Object.fromEntries(t);
328
331
  }
329
- return d;
332
+ return f;
330
333
  }
331
334
  new Map([
332
335
  {
@@ -434,14 +437,14 @@ new Map([
434
437
  fallback: "sans-serif"
435
438
  }
436
439
  ].map((e) => [e.family, e]));
437
- function ee(e) {
440
+ function te(e) {
438
441
  return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
439
442
  }
440
- var te = (e) => ee([e]), ne = (e) => {
443
+ var ne = (e) => te([e]), B = (e) => {
441
444
  let t = typeof e == "string" && e.match(/^"([^"]+)"/);
442
445
  return t ? t[1] : null;
443
446
  };
444
- function B(e, t) {
447
+ function re(e, t) {
445
448
  let n = /* @__PURE__ */ new Set(), r = (e) => {
446
449
  for (let t of Object.values(e || {})) for (let e of [
447
450
  "style",
@@ -449,7 +452,7 @@ function B(e, t) {
449
452
  "pressed",
450
453
  "focused"
451
454
  ]) {
452
- let r = ne(t.props?.[e]?.fontFamily);
455
+ let r = B(t.props?.[e]?.fontFamily);
453
456
  r && n.add(r);
454
457
  }
455
458
  };
@@ -459,7 +462,7 @@ function B(e, t) {
459
462
  }
460
463
  //#endregion
461
464
  //#region ../ui/src/components/builder/locale.js
462
- var re = /* @__PURE__ */ new Set([
465
+ var ie = /* @__PURE__ */ new Set([
463
466
  "ar",
464
467
  "he",
465
468
  "fa",
@@ -470,14 +473,14 @@ var re = /* @__PURE__ */ new Set([
470
473
  "yi",
471
474
  "dv",
472
475
  "ckb"
473
- ]), V = (e) => re.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", ie = (e, t) => e === "ltr" || e === "rtl" ? e : t ? V(t) : void 0, H = t({
476
+ ]), ae = (e) => ie.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", oe = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ae(t) : void 0, V = t({
474
477
  tenant: "",
475
478
  apiUrl: "/api"
476
- }), U = t(null), W = t(null), ae = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
477
- function G(e, t) {
479
+ }), H = t(null), U = t(null), se = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
480
+ function W(e, t) {
478
481
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
479
482
  }
480
- var oe = (e) => {
483
+ var G = (e) => {
481
484
  let t = [];
482
485
  for (let [n, r] of Object.entries(e ?? {})) {
483
486
  if (!/^[\w-]+$/.test(n)) continue;
@@ -488,12 +491,12 @@ var oe = (e) => {
488
491
  return t;
489
492
  };
490
493
  function K(e) {
491
- return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : "").filter(Boolean).join(" ") : "";
494
+ return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("name" in e || "slug" in e) ? String(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.name != null || e.slug != null) ? String(e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
492
495
  }
493
- function se(e, t) {
494
- let n = t?.data ?? {}, r = oe(n);
496
+ function ce(e, t) {
497
+ let n = t?.data ?? {}, r = G(n);
495
498
  if (!r.length) return e;
496
- let i = RegExp(`:(${r.map(ae).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(G(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
499
+ let i = RegExp(`:(${r.map(se).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(W(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
497
500
  return a(e);
498
501
  }
499
502
  var q = {
@@ -507,16 +510,16 @@ var q = {
507
510
  cursor: "pointer",
508
511
  backgroundColor: "var(--page-accent, #111827)",
509
512
  color: "var(--page-accent-text, #ffffff)"
510
- }, ce = {
513
+ }, le = {
511
514
  flexGrow: 1,
512
515
  display: "flex",
513
516
  flexDirection: "column",
514
517
  position: "relative"
515
- }, le = {
518
+ }, ue = {
516
519
  display: "flex",
517
520
  flexDirection: "column"
518
521
  };
519
- function ue({ style: e }) {
522
+ function de({ style: e }) {
520
523
  let t = e?.backgroundVideo;
521
524
  if (!t) return null;
522
525
  let n = {
@@ -527,7 +530,7 @@ function ue({ style: e }) {
527
530
  zIndex: -1,
528
531
  pointerEvents: "none"
529
532
  }, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
530
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("video", {
533
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("video", {
531
534
  src: t,
532
535
  autoPlay: !0,
533
536
  muted: !0,
@@ -537,73 +540,73 @@ function ue({ style: e }) {
537
540
  ...n,
538
541
  objectFit: "cover"
539
542
  }
540
- }), r && /* @__PURE__ */ c("div", { style: {
543
+ }), r && /* @__PURE__ */ l("div", { style: {
541
544
  ...n,
542
545
  background: r
543
546
  } })] });
544
547
  }
545
- var de = (e, t) => e?.backgroundVideo ? {
548
+ var fe = (e, t) => e?.backgroundVideo ? {
546
549
  position: "relative",
547
550
  ...t,
548
- ...p(e)
551
+ ...m(e)
549
552
  } : {
550
553
  ...t,
551
- ...p(e)
554
+ ...m(e)
552
555
  };
553
- function fe({ style: e, nodeRef: t, children: n }) {
554
- return /* @__PURE__ */ l("div", {
556
+ function pe({ style: e, nodeRef: t, children: n }) {
557
+ return /* @__PURE__ */ u("div", {
555
558
  ref: t,
556
559
  style: {
557
- ...ce,
558
- ...p(e)
560
+ ...le,
561
+ ...m(e)
559
562
  },
560
- children: [/* @__PURE__ */ c(ue, { style: e }), n]
563
+ children: [/* @__PURE__ */ l(de, { style: e }), n]
561
564
  });
562
565
  }
563
- function pe({ style: e, nodeRef: t, children: n }) {
564
- return /* @__PURE__ */ l("section", {
566
+ function me({ style: e, nodeRef: t, children: n }) {
567
+ return /* @__PURE__ */ u("section", {
565
568
  ref: t,
566
- style: de(e, le),
567
- children: [/* @__PURE__ */ c(ue, { style: e }), n]
569
+ style: fe(e, ue),
570
+ children: [/* @__PURE__ */ l(de, { style: e }), n]
568
571
  });
569
572
  }
570
- function me({ style: e, freeLayout: t, nodeRef: n, children: r }) {
573
+ function he({ style: e, freeLayout: t, nodeRef: n, children: r }) {
571
574
  let i = t ? {
572
575
  position: "relative",
573
576
  minHeight: 240
574
577
  } : null;
575
- return /* @__PURE__ */ l("div", {
578
+ return /* @__PURE__ */ u("div", {
576
579
  ref: n,
577
580
  style: i ? {
578
581
  ...i,
579
- ...de(e)
580
- } : de(e),
581
- children: [/* @__PURE__ */ c(ue, { style: e }), r]
582
+ ...fe(e)
583
+ } : fe(e),
584
+ children: [/* @__PURE__ */ l(de, { style: e }), r]
582
585
  });
583
586
  }
584
- function he({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
585
- return /* @__PURE__ */ c(n, {
587
+ function ge({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
588
+ return /* @__PURE__ */ l(n, {
586
589
  ref: a,
587
590
  style: {
588
591
  ...q,
589
- ...p(r)
592
+ ...m(r)
590
593
  },
591
594
  children: X(t, e, i)
592
595
  });
593
596
  }
594
- var ge = {
595
- fontFamily: k.mono.value,
597
+ var _e = {
598
+ fontFamily: A.mono.value,
596
599
  background: "rgba(148, 163, 184, 0.18)",
597
600
  padding: "1px 5px",
598
601
  borderRadius: 4,
599
602
  fontSize: "0.9em"
600
603
  };
601
- function _e(e, t = [], n, r) {
604
+ function ve(e, t = [], n, r) {
602
605
  let i = e;
603
- return t.includes("sup") ? i = /* @__PURE__ */ c("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ c("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ c("code", {
604
- style: ge,
606
+ 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", {
607
+ style: _e,
605
608
  children: i
606
- })), t.includes("strike") && (i = /* @__PURE__ */ c("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ c("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ c("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ c("strong", { children: i })), n && (i = /* @__PURE__ */ c("a", {
609
+ })), 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", {
607
610
  href: n,
608
611
  target: r || void 0,
609
612
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
@@ -613,34 +616,34 @@ function _e(e, t = [], n, r) {
613
616
  }
614
617
  function X(t, n, r) {
615
618
  return t?.length ? t.map((t, n) => {
616
- if (t.slot) return /* @__PURE__ */ c(e, { children: r?.[t.slot] ?? null }, n);
617
- if (t.parts) return /* @__PURE__ */ c(e, { children: X(t.parts, "", r) }, n);
619
+ if (t.slot) return /* @__PURE__ */ l(e, { children: r?.[t.slot] ?? null }, n);
620
+ if (t.parts) return /* @__PURE__ */ l(e, { children: X(t.parts, "", r) }, n);
618
621
  let i = t.text;
619
- return t.sup ? i = /* @__PURE__ */ c("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ c("sub", { children: i })), t.code && (i = /* @__PURE__ */ c("code", {
620
- style: ge,
622
+ return t.sup ? i = /* @__PURE__ */ l("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ l("sub", { children: i })), t.code && (i = /* @__PURE__ */ l("code", {
623
+ style: _e,
621
624
  children: i
622
- })), t.strike && (i = /* @__PURE__ */ c("s", { children: i })), t.underline && (i = /* @__PURE__ */ c("u", { children: i })), t.italic && (i = /* @__PURE__ */ c("em", { children: i })), t.bold && (i = /* @__PURE__ */ c("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ c("span", {
625
+ })), t.strike && (i = /* @__PURE__ */ l("s", { children: i })), t.underline && (i = /* @__PURE__ */ l("u", { children: i })), t.italic && (i = /* @__PURE__ */ l("em", { children: i })), t.bold && (i = /* @__PURE__ */ l("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ l("span", {
623
626
  style: {
624
627
  ...t.color && { color: t.color },
625
628
  ...t.background && { backgroundColor: t.background }
626
629
  },
627
630
  children: i
628
- })), t.href && (i = /* @__PURE__ */ c("a", {
631
+ })), t.href && (i = /* @__PURE__ */ l("a", {
629
632
  href: t.href,
630
633
  target: t.target || void 0,
631
634
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
632
635
  style: { color: t.color ?? "inherit" },
633
636
  children: i
634
- })), /* @__PURE__ */ c(e, { children: i }, n);
637
+ })), /* @__PURE__ */ l(e, { children: i }, n);
635
638
  }) : n;
636
639
  }
637
- function ve({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
638
- return /* @__PURE__ */ c("span", {
639
- style: p(a),
640
- children: e?.length ? X(e, t) : _e(t, n, r, i)
640
+ function ye({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
641
+ return /* @__PURE__ */ l("span", {
642
+ style: m(a),
643
+ children: e?.length ? X(e, t) : ve(t, n, r, i)
641
644
  });
642
645
  }
643
- var ye = {
646
+ var be = {
644
647
  h1: 40,
645
648
  h2: 32,
646
649
  h3: 26,
@@ -648,7 +651,7 @@ var ye = {
648
651
  h5: 19,
649
652
  h6: 16
650
653
  };
651
- function be({ align: e = "center", width: t, wrap: n } = {}) {
654
+ function xe({ align: e = "center", width: t, wrap: n } = {}) {
652
655
  let r = t ? `${t}%` : void 0;
653
656
  if (e === "full") return { width: "100%" };
654
657
  let i = e === "left" || e === "right";
@@ -682,7 +685,7 @@ function be({ align: e = "center", width: t, wrap: n } = {}) {
682
685
  marginRight: "auto"
683
686
  };
684
687
  }
685
- function xe(e = [], t, n) {
688
+ function Se(e = [], t, n) {
686
689
  let r = n ?? ((e, n) => X(e, n, t));
687
690
  return e.map((t, n) => {
688
691
  let i = {
@@ -691,7 +694,7 @@ function xe(e = [], t, n) {
691
694
  };
692
695
  if (t.type === "image") {
693
696
  if (!t.src) return null;
694
- let e = /* @__PURE__ */ c("img", {
697
+ let e = /* @__PURE__ */ l("img", {
695
698
  src: t.src,
696
699
  alt: t.alt || "",
697
700
  style: {
@@ -700,20 +703,20 @@ function xe(e = [], t, n) {
700
703
  borderRadius: 6
701
704
  }
702
705
  });
703
- return /* @__PURE__ */ l("figure", {
706
+ return /* @__PURE__ */ u("figure", {
704
707
  style: {
705
708
  marginLeft: 0,
706
709
  marginRight: 0,
707
710
  ...i,
708
- ...be(t)
711
+ ...xe(t)
709
712
  },
710
- children: [t.href ? /* @__PURE__ */ c("a", {
713
+ children: [t.href ? /* @__PURE__ */ l("a", {
711
714
  href: t.href,
712
715
  target: t.target || void 0,
713
716
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
714
717
  style: { display: "block" },
715
718
  children: e
716
- }) : e, t.caption && /* @__PURE__ */ c("figcaption", {
719
+ }) : e, t.caption && /* @__PURE__ */ l("figcaption", {
717
720
  style: {
718
721
  fontSize: 13,
719
722
  opacity: .65,
@@ -724,16 +727,16 @@ function xe(e = [], t, n) {
724
727
  })]
725
728
  }, n);
726
729
  }
727
- if (t.type === "video") return Me(t.url) ? /* @__PURE__ */ c("div", {
730
+ if (t.type === "video") return Ne(t.url) ? /* @__PURE__ */ l("div", {
728
731
  style: {
729
732
  ...i,
730
- ...be({
733
+ ...xe({
731
734
  align: t.align,
732
735
  wrap: t.wrap,
733
736
  width: t.width ?? 100
734
737
  })
735
738
  },
736
- children: /* @__PURE__ */ c(Ne, {
739
+ children: /* @__PURE__ */ l(Pe, {
737
740
  url: t.url,
738
741
  autoplay: t.autoplay,
739
742
  muted: t.muted,
@@ -742,43 +745,43 @@ function xe(e = [], t, n) {
742
745
  start: t.start
743
746
  })
744
747
  }, n) : null;
745
- if (t.type === "divider") return /* @__PURE__ */ c("hr", { style: {
748
+ if (t.type === "divider") return /* @__PURE__ */ l("hr", { style: {
746
749
  ...i,
747
750
  border: 0,
748
751
  borderTop: "1px solid rgba(148, 163, 184, 0.4)"
749
752
  } }, n);
750
753
  if (t.type === "ul" || t.type === "ol") {
751
754
  let e = t.type;
752
- return /* @__PURE__ */ c(e, {
755
+ return /* @__PURE__ */ l(e, {
753
756
  style: {
754
757
  ...i,
755
758
  paddingLeft: 24
756
759
  },
757
- children: (t.items ?? []).map((e, t) => /* @__PURE__ */ c("li", {
760
+ children: (t.items ?? []).map((e, t) => /* @__PURE__ */ l("li", {
758
761
  style: { marginBottom: 4 },
759
762
  children: r(e.parts, e.text)
760
763
  }, t))
761
764
  }, n);
762
765
  }
763
- if (t.type === "quote") return /* @__PURE__ */ c("blockquote", {
766
+ if (t.type === "quote") return /* @__PURE__ */ l("blockquote", {
764
767
  style: {
765
- ...Ce,
768
+ ...we,
766
769
  ...i
767
770
  },
768
771
  children: r(t.parts, t.text)
769
772
  }, n);
770
- if (ye[t.type]) {
773
+ if (be[t.type]) {
771
774
  let e = t.type;
772
- return /* @__PURE__ */ c(e, {
775
+ return /* @__PURE__ */ l(e, {
773
776
  style: {
774
777
  ...q,
775
- fontSize: ye[t.type],
778
+ fontSize: be[t.type],
776
779
  ...i
777
780
  },
778
781
  children: r(t.parts, t.text)
779
782
  }, n);
780
783
  }
781
- return /* @__PURE__ */ c("p", {
784
+ return /* @__PURE__ */ l("p", {
782
785
  style: {
783
786
  ...J,
784
787
  ...i
@@ -787,101 +790,101 @@ function xe(e = [], t, n) {
787
790
  }, n);
788
791
  });
789
792
  }
790
- function Se({ content: e, style: t, linked: n, nodeRef: r }) {
791
- return /* @__PURE__ */ c("div", {
793
+ function Ce({ content: e, style: t, linked: n, nodeRef: r }) {
794
+ return /* @__PURE__ */ l("div", {
792
795
  ref: r,
793
796
  style: {
794
797
  display: "flow-root",
795
- ...p(t)
798
+ ...m(t)
796
799
  },
797
- children: xe(e, n)
800
+ children: Se(e, n)
798
801
  });
799
802
  }
800
- var Ce = {
803
+ var we = {
801
804
  margin: 0,
802
805
  padding: "8px 0 8px 20px",
803
806
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
804
807
  };
805
- function we({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
806
- return /* @__PURE__ */ c("blockquote", {
808
+ function Te({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
809
+ return /* @__PURE__ */ l("blockquote", {
807
810
  ref: i,
808
811
  style: {
809
- ...Ce,
810
- ...p(n)
812
+ ...we,
813
+ ...m(n)
811
814
  },
812
815
  children: X(t, e, r)
813
816
  });
814
817
  }
815
- function Te({ ordered: e, items: t = [], style: n, nodeRef: r }) {
816
- return /* @__PURE__ */ c(e ? "ol" : "ul", {
818
+ function Ee({ ordered: e, items: t = [], style: n, nodeRef: r }) {
819
+ return /* @__PURE__ */ l(e ? "ol" : "ul", {
817
820
  ref: r,
818
821
  style: {
819
822
  margin: 0,
820
823
  paddingLeft: 24,
821
- ...p(n)
824
+ ...m(n)
822
825
  },
823
- children: t.map((e, t) => /* @__PURE__ */ c("li", {
826
+ children: t.map((e, t) => /* @__PURE__ */ l("li", {
824
827
  style: { marginBottom: 4 },
825
828
  children: X(e.parts, e.text)
826
829
  }, t))
827
830
  });
828
831
  }
829
- function Ee({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
830
- return /* @__PURE__ */ c("p", {
832
+ function De({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
833
+ return /* @__PURE__ */ l("p", {
831
834
  ref: i,
832
835
  style: {
833
836
  ...J,
834
- ...p(n)
837
+ ...m(n)
835
838
  },
836
839
  children: X(t, e, r)
837
840
  });
838
841
  }
839
- var De = {
842
+ var Oe = {
840
843
  color: "var(--page-accent, inherit)",
841
844
  textDecoration: "underline",
842
845
  textUnderlineOffset: 3,
843
846
  cursor: "pointer"
844
847
  };
845
- function Oe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
846
- return /* @__PURE__ */ c("a", {
848
+ function ke({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
849
+ return /* @__PURE__ */ l("a", {
847
850
  ref: o,
848
851
  href: n || "#",
849
852
  target: r || void 0,
850
853
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
851
854
  style: {
852
- ...De,
853
- ...p(i)
855
+ ...Oe,
856
+ ...m(i)
854
857
  },
855
858
  children: X(t, e, a)
856
859
  });
857
860
  }
858
- function ke({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
859
- return /* @__PURE__ */ c("a", {
861
+ function Ae({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
862
+ return /* @__PURE__ */ l("a", {
860
863
  ref: o,
861
864
  href: n || "#",
862
865
  target: r || void 0,
863
866
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
864
867
  style: {
865
868
  ...Y,
866
- ...p(i)
869
+ ...m(i)
867
870
  },
868
871
  children: X(t, e, a)
869
872
  });
870
873
  }
871
- function Ae({ src: e, alt: t, style: n, nodeRef: r }) {
872
- return e ? /* @__PURE__ */ c("img", {
874
+ function je({ src: e, alt: t, style: n, nodeRef: r }) {
875
+ return e ? /* @__PURE__ */ l("img", {
873
876
  ref: r,
874
877
  src: e,
875
878
  alt: t || "",
876
879
  style: {
877
880
  display: "block",
878
881
  maxWidth: "100%",
879
- ...p(n)
882
+ ...m(n)
880
883
  }
881
884
  }) : null;
882
885
  }
883
- function je({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
884
- return e ? /* @__PURE__ */ c("video", {
886
+ function Me({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
887
+ return e ? /* @__PURE__ */ l("video", {
885
888
  ref: s,
886
889
  src: e,
887
890
  poster: t || void 0,
@@ -894,25 +897,25 @@ function je({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
894
897
  display: "block",
895
898
  width: "100%",
896
899
  maxWidth: "100%",
897
- ...p(o)
900
+ ...m(o)
898
901
  }
899
902
  }) : null;
900
903
  }
901
- var Me = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
902
- function Ne({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
903
- let l = Me(e);
904
- if (!l) return null;
904
+ var Ne = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
905
+ function Pe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
906
+ let c = Ne(e);
907
+ if (!c) return null;
905
908
  let u = new URLSearchParams({ rel: "0" });
906
- return t && u.set("autoplay", "1"), (n || t) && u.set("mute", "1"), i || u.set("controls", "0"), r && (u.set("loop", "1"), u.set("playlist", l)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ c("div", {
909
+ 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", {
907
910
  ref: s,
908
911
  style: {
909
912
  position: "relative",
910
913
  width: "100%",
911
914
  paddingTop: "56.25%",
912
- ...p(o)
915
+ ...m(o)
913
916
  },
914
- children: /* @__PURE__ */ c("iframe", {
915
- src: `https://www.youtube-nocookie.com/embed/${l}?${u}`,
917
+ children: /* @__PURE__ */ l("iframe", {
918
+ src: `https://www.youtube-nocookie.com/embed/${c}?${u}`,
916
919
  title: "YouTube video",
917
920
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
918
921
  allowFullScreen: !0,
@@ -926,8 +929,8 @@ function Ne({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
926
929
  })
927
930
  });
928
931
  }
929
- function Pe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
930
- return e ? /* @__PURE__ */ c("iframe", {
932
+ function Fe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
933
+ return e ? /* @__PURE__ */ l("iframe", {
931
934
  ref: i,
932
935
  src: e,
933
936
  title: t || "Embedded frame",
@@ -938,12 +941,12 @@ function Pe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
938
941
  width: "100%",
939
942
  height: 300,
940
943
  border: 0,
941
- ...p(r)
944
+ ...m(r)
942
945
  }
943
946
  }) : null;
944
947
  }
945
- function Fe({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
946
- let [a, s] = o(null);
948
+ function Ie({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
949
+ let [a, o] = s(null);
947
950
  return r(() => {
948
951
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
949
952
  let t = document.createElement("script");
@@ -954,15 +957,15 @@ function Fe({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
954
957
  a,
955
958
  e,
956
959
  t
957
- ]), /* @__PURE__ */ c("div", {
960
+ ]), /* @__PURE__ */ l("div", {
958
961
  ref: (e) => {
959
- s(e), i && i(e);
962
+ o(e), i && i(e);
960
963
  },
961
- style: p(n)
964
+ style: m(n)
962
965
  });
963
966
  }
964
- function Ie({ height: e, nodeRef: t }) {
965
- return /* @__PURE__ */ c("div", {
967
+ function Le({ height: e, nodeRef: t }) {
968
+ return /* @__PURE__ */ l("div", {
966
969
  ref: t,
967
970
  style: {
968
971
  height: e || 32,
@@ -971,18 +974,18 @@ function Ie({ height: e, nodeRef: t }) {
971
974
  }
972
975
  });
973
976
  }
974
- function Le({ style: e, nodeRef: t }) {
975
- return /* @__PURE__ */ c("div", {
977
+ function Re({ style: e, nodeRef: t }) {
978
+ return /* @__PURE__ */ l("div", {
976
979
  ref: t,
977
980
  style: {
978
981
  height: 1,
979
982
  alignSelf: "stretch",
980
983
  flexShrink: 0,
981
- ...p(e)
984
+ ...m(e)
982
985
  }
983
986
  });
984
987
  }
985
- var Re = {
988
+ var ze = {
986
989
  position: "absolute",
987
990
  top: "50%",
988
991
  transform: "translateY(-50%)",
@@ -999,7 +1002,7 @@ var Re = {
999
1002
  alignItems: "center",
1000
1003
  justifyContent: "center",
1001
1004
  padding: 0
1002
- }, ze = {
1005
+ }, Be = {
1003
1006
  bottom: {
1004
1007
  inset: "auto 0 0 0",
1005
1008
  padding: "40px 24px 20px",
@@ -1018,9 +1021,9 @@ var Re = {
1018
1021
  padding: 24,
1019
1022
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1020
1023
  }
1021
- }, Be = 48;
1022
- function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, height: a = 320, swipe: u = !0, style: d, nodeRef: f }) {
1023
- let [m, h] = o(0), [g, _] = o(!1), [v, y] = o(null), b = e ? Math.min(m, e - 1) : 0;
1024
+ }, Ve = 48;
1025
+ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, height: a = 320, swipe: o = !0, style: d, nodeRef: f }) {
1026
+ let [p, h] = s(0), [g, _] = s(!1), [v, y] = s(null), b = e ? Math.min(p, e - 1) : 0;
1024
1027
  if (r(() => {
1025
1028
  if (!n || g || v || e < 2) return;
1026
1029
  let t = setInterval(() => h((t) => (t + 1) % e), Math.max(2, Number(i) || 5) * 1e3);
@@ -1035,13 +1038,13 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1035
1038
  let x = (t) => h((t + e) % e), S = () => {
1036
1039
  if (!v) return;
1037
1040
  let { dx: e } = v;
1038
- y(null), e < -48 ? x(b + 1) : e > Be && x(b - 1);
1041
+ y(null), e < -48 ? x(b + 1) : e > Ve && x(b - 1);
1039
1042
  };
1040
- return /* @__PURE__ */ l("div", {
1043
+ return /* @__PURE__ */ u("div", {
1041
1044
  ref: f,
1042
1045
  onMouseEnter: () => _(!0),
1043
1046
  onMouseLeave: () => _(!1),
1044
- onPointerDown: u && e > 1 ? (e) => {
1047
+ onPointerDown: o && e > 1 ? (e) => {
1045
1048
  e.pointerType === "mouse" && e.button !== 0 || e.target.closest("button") || (e.currentTarget.setPointerCapture(e.pointerId), y({
1046
1049
  startX: e.clientX,
1047
1050
  dx: 0
@@ -1060,16 +1063,16 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1060
1063
  touchAction: "pan-y",
1061
1064
  userSelect: v ? "none" : void 0,
1062
1065
  cursor: v ? "grabbing" : void 0,
1063
- ...p(d)
1066
+ ...m(d)
1064
1067
  },
1065
- children: [/* @__PURE__ */ c("div", {
1068
+ children: [/* @__PURE__ */ l("div", {
1066
1069
  style: {
1067
1070
  display: "flex",
1068
1071
  height: a,
1069
1072
  transform: `translateX(calc(${-b * 100}% + ${v?.dx ?? 0}px))`,
1070
1073
  transition: v ? "none" : "transform 450ms ease"
1071
1074
  },
1072
- children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ c("div", {
1075
+ children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ l("div", {
1073
1076
  style: {
1074
1077
  position: "relative",
1075
1078
  width: "100%",
@@ -1078,28 +1081,28 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1078
1081
  },
1079
1082
  children: t(n)
1080
1083
  }, n))
1081
- }), e > 1 && /* @__PURE__ */ l(s, { children: [
1082
- /* @__PURE__ */ c("button", {
1084
+ }), e > 1 && /* @__PURE__ */ u(c, { children: [
1085
+ /* @__PURE__ */ l("button", {
1083
1086
  type: "button",
1084
1087
  "aria-label": "Previous slide",
1085
1088
  style: {
1086
- ...Re,
1089
+ ...ze,
1087
1090
  left: 12
1088
1091
  },
1089
1092
  onClick: () => x(b - 1),
1090
1093
  children: "‹"
1091
1094
  }),
1092
- /* @__PURE__ */ c("button", {
1095
+ /* @__PURE__ */ l("button", {
1093
1096
  type: "button",
1094
1097
  "aria-label": "Next slide",
1095
1098
  style: {
1096
- ...Re,
1099
+ ...ze,
1097
1100
  right: 12
1098
1101
  },
1099
1102
  onClick: () => x(b + 1),
1100
1103
  children: "›"
1101
1104
  }),
1102
- /* @__PURE__ */ c("div", {
1105
+ /* @__PURE__ */ l("div", {
1103
1106
  style: {
1104
1107
  position: "absolute",
1105
1108
  bottom: 10,
@@ -1109,7 +1112,7 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1109
1112
  justifyContent: "center",
1110
1113
  gap: 6
1111
1114
  },
1112
- children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ c("button", {
1115
+ children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ l("button", {
1113
1116
  type: "button",
1114
1117
  "aria-label": `Go to slide ${t + 1}`,
1115
1118
  onClick: () => x(t),
@@ -1127,7 +1130,7 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1127
1130
  ] })]
1128
1131
  });
1129
1132
  }
1130
- var He = (e, t) => ({
1133
+ var Ue = (e, t) => ({
1131
1134
  position: "absolute",
1132
1135
  inset: 0,
1133
1136
  backgroundImage: e ? `url(${e})` : "none",
@@ -1135,26 +1138,26 @@ var He = (e, t) => ({
1135
1138
  backgroundSize: "cover",
1136
1139
  backgroundPosition: "center"
1137
1140
  });
1138
- function Ue({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1139
- return e.length ? /* @__PURE__ */ c(Ve, {
1141
+ function We({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1142
+ return e.length ? /* @__PURE__ */ l(He, {
1140
1143
  ...r,
1141
1144
  count: e.length,
1142
1145
  renderSlide: (r) => {
1143
1146
  let i = e[r];
1144
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: He(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
1147
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: Ue(i.image) }), (i.title || i.text) && /* @__PURE__ */ u("div", {
1145
1148
  style: {
1146
1149
  position: "absolute",
1147
1150
  color: "#fff",
1148
1151
  textAlign: n,
1149
- ...ze[t] ?? ze.bottom
1152
+ ...Be[t] ?? Be.bottom
1150
1153
  },
1151
- children: [i.title && /* @__PURE__ */ c("div", {
1154
+ children: [i.title && /* @__PURE__ */ l("div", {
1152
1155
  style: {
1153
1156
  fontSize: 22,
1154
1157
  fontWeight: 700
1155
1158
  },
1156
1159
  children: i.title
1157
- }), i.text && /* @__PURE__ */ c("div", {
1160
+ }), i.text && /* @__PURE__ */ l("div", {
1158
1161
  style: {
1159
1162
  fontSize: 14,
1160
1163
  opacity: .9,
@@ -1166,13 +1169,13 @@ function Ue({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1166
1169
  }
1167
1170
  }) : null;
1168
1171
  }
1169
- function We({ slides: e = [], linked: t, ...n }) {
1170
- return e.length ? /* @__PURE__ */ c(Ve, {
1172
+ function Ge({ slides: e = [], linked: t, ...n }) {
1173
+ return e.length ? /* @__PURE__ */ l(He, {
1171
1174
  ...n,
1172
1175
  count: e.length,
1173
1176
  renderSlide: (n) => {
1174
1177
  let r = e[n];
1175
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: He(r.image, r.color) }), /* @__PURE__ */ c("div", {
1178
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: Ue(r.image, r.color) }), /* @__PURE__ */ l("div", {
1176
1179
  style: {
1177
1180
  position: "absolute",
1178
1181
  inset: 0,
@@ -1189,28 +1192,28 @@ var Z = {
1189
1192
  textDecoration: "none",
1190
1193
  fontSize: 14,
1191
1194
  opacity: .85
1192
- }, Ge = {
1195
+ }, Ke = {
1193
1196
  background: "var(--page-bg, #ffffff)",
1194
1197
  color: "var(--page-text, #111827)",
1195
1198
  border: "1px solid rgba(148, 163, 184, 0.25)",
1196
1199
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1197
1200
  zIndex: 60
1198
1201
  };
1199
- function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u = "auto", breakpoint: d = 768 }) {
1200
- let [f, m] = o(null), [h, g] = o(!1), [_, v] = o(!1), [y, b] = o(null);
1202
+ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c = "auto", breakpoint: d = 768 }) {
1203
+ let [f, p] = s(null), [h, g] = s(!1), [_, v] = s(!1), [y, b] = s(null);
1201
1204
  r(() => {
1202
1205
  if (!f) return;
1203
1206
  let e = new ResizeObserver(() => g(f.offsetWidth < d));
1204
1207
  return e.observe(f), () => e.disconnect();
1205
1208
  }, [f, d]);
1206
- let x = u === "hamburger" || u === "auto" && h, S = (e, t) => /* @__PURE__ */ l("a", {
1209
+ let x = c === "hamburger" || c === "auto" && h, S = (e, t) => /* @__PURE__ */ u("a", {
1207
1210
  href: e.href || "#",
1208
1211
  style: {
1209
1212
  ...Z,
1210
1213
  display: "block",
1211
1214
  ...t
1212
1215
  },
1213
- children: [e.label, e.desc && /* @__PURE__ */ c("span", {
1216
+ children: [e.label, e.desc && /* @__PURE__ */ l("span", {
1214
1217
  style: {
1215
1218
  display: "block",
1216
1219
  fontSize: 12,
@@ -1220,9 +1223,9 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1220
1223
  children: e.desc
1221
1224
  })]
1222
1225
  }, e.key);
1223
- return /* @__PURE__ */ l("nav", {
1226
+ return /* @__PURE__ */ u("nav", {
1224
1227
  ref: (e) => {
1225
- m(e), s && s(e);
1228
+ p(e), o && o(e);
1226
1229
  },
1227
1230
  style: {
1228
1231
  display: "flex",
@@ -1232,10 +1235,10 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1232
1235
  padding: "14px 24px",
1233
1236
  width: "100%",
1234
1237
  position: "relative",
1235
- ...p(a)
1238
+ ...m(a)
1236
1239
  },
1237
1240
  children: [
1238
- n && /* @__PURE__ */ c("img", {
1241
+ n && /* @__PURE__ */ l("img", {
1239
1242
  src: n,
1240
1243
  alt: t || "Logo",
1241
1244
  style: {
@@ -1243,7 +1246,7 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1243
1246
  display: "block"
1244
1247
  }
1245
1248
  }),
1246
- t && /* @__PURE__ */ c("div", {
1249
+ t && /* @__PURE__ */ l("div", {
1247
1250
  style: {
1248
1251
  fontWeight: 700,
1249
1252
  fontSize: 18,
@@ -1251,8 +1254,8 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1251
1254
  },
1252
1255
  children: t
1253
1256
  }),
1254
- /* @__PURE__ */ c("div", { style: { flexGrow: 1 } }),
1255
- x ? /* @__PURE__ */ c("button", {
1257
+ /* @__PURE__ */ l("div", { style: { flexGrow: 1 } }),
1258
+ x ? /* @__PURE__ */ l("button", {
1256
1259
  type: "button",
1257
1260
  "aria-label": _ ? "Close menu" : "Open menu",
1258
1261
  onClick: () => v(!_),
@@ -1266,7 +1269,7 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1266
1269
  padding: 4
1267
1270
  },
1268
1271
  children: _ ? "✕" : "☰"
1269
- }) : /* @__PURE__ */ c("div", {
1272
+ }) : /* @__PURE__ */ l("div", {
1270
1273
  style: {
1271
1274
  display: "flex",
1272
1275
  gap: 20,
@@ -1275,20 +1278,20 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1275
1278
  },
1276
1279
  children: i.map((e) => {
1277
1280
  let t = e.children ?? [];
1278
- if (!t.length) return /* @__PURE__ */ c("a", {
1281
+ if (!t.length) return /* @__PURE__ */ l("a", {
1279
1282
  href: e.href || "#",
1280
1283
  style: Z,
1281
1284
  children: e.label
1282
1285
  }, e.key);
1283
1286
  let n = e.type === "mega";
1284
- return /* @__PURE__ */ l("span", {
1287
+ return /* @__PURE__ */ u("span", {
1285
1288
  style: {
1286
1289
  position: n ? "static" : "relative",
1287
1290
  display: "inline-flex"
1288
1291
  },
1289
1292
  onMouseEnter: () => b(e.key),
1290
1293
  onMouseLeave: () => b(null),
1291
- children: [/* @__PURE__ */ l("a", {
1294
+ children: [/* @__PURE__ */ u("a", {
1292
1295
  href: e.href || "#",
1293
1296
  style: {
1294
1297
  ...Z,
@@ -1297,7 +1300,7 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1297
1300
  children: [
1298
1301
  e.label,
1299
1302
  " ",
1300
- /* @__PURE__ */ c("span", {
1303
+ /* @__PURE__ */ l("span", {
1301
1304
  style: {
1302
1305
  fontSize: 9,
1303
1306
  opacity: .6
@@ -1305,9 +1308,9 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1305
1308
  children: "▼"
1306
1309
  })
1307
1310
  ]
1308
- }), y === e.key && (n ? /* @__PURE__ */ c("div", {
1311
+ }), y === e.key && (n ? /* @__PURE__ */ l("div", {
1309
1312
  style: {
1310
- ...Ge,
1313
+ ...Ke,
1311
1314
  position: "absolute",
1312
1315
  left: 0,
1313
1316
  right: 0,
@@ -1321,9 +1324,9 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1321
1324
  padding: "6px 8px",
1322
1325
  borderRadius: 6
1323
1326
  }))
1324
- }) : /* @__PURE__ */ c("div", {
1327
+ }) : /* @__PURE__ */ l("div", {
1325
1328
  style: {
1326
- ...Ge,
1329
+ ...Ke,
1327
1330
  position: "absolute",
1328
1331
  top: "100%",
1329
1332
  left: 0,
@@ -1341,7 +1344,7 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1341
1344
  }, e.key);
1342
1345
  })
1343
1346
  }),
1344
- x && _ && /* @__PURE__ */ c("div", {
1347
+ x && _ && /* @__PURE__ */ l("div", {
1345
1348
  style: {
1346
1349
  flexBasis: "100%",
1347
1350
  width: "100%",
@@ -1349,7 +1352,7 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1349
1352
  flexDirection: "column",
1350
1353
  paddingTop: 10
1351
1354
  },
1352
- children: i.map((t) => /* @__PURE__ */ l(e, { children: [/* @__PURE__ */ c("a", {
1355
+ children: i.map((t) => /* @__PURE__ */ u(e, { children: [/* @__PURE__ */ l("a", {
1353
1356
  href: t.href || "#",
1354
1357
  style: {
1355
1358
  ...Z,
@@ -1363,21 +1366,21 @@ function Ke({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u =
1363
1366
  ]
1364
1367
  });
1365
1368
  }
1366
- function qe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1367
- let [i, a] = o(0), s = e.length ? Math.min(i, e.length - 1) : 0;
1368
- return e.length ? /* @__PURE__ */ l("div", {
1369
+ function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1370
+ let [i, a] = s(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1371
+ return e.length ? /* @__PURE__ */ u("div", {
1369
1372
  ref: r,
1370
1373
  style: {
1371
1374
  width: "100%",
1372
- ...p(n)
1375
+ ...m(n)
1373
1376
  },
1374
- children: [/* @__PURE__ */ c("div", {
1377
+ children: [/* @__PURE__ */ l("div", {
1375
1378
  style: {
1376
1379
  display: "flex",
1377
1380
  gap: 4,
1378
1381
  borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
1379
1382
  },
1380
- children: e.map((e, t) => /* @__PURE__ */ c("button", {
1383
+ children: e.map((e, t) => /* @__PURE__ */ l("button", {
1381
1384
  type: "button",
1382
1385
  onClick: () => a(t),
1383
1386
  style: {
@@ -1388,41 +1391,41 @@ function qe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1388
1391
  fontFamily: "inherit",
1389
1392
  color: "inherit",
1390
1393
  cursor: "pointer",
1391
- opacity: t === s ? 1 : .6,
1392
- fontWeight: t === s ? 600 : 500,
1393
- boxShadow: t === s ? "inset 0 -2px 0 var(--page-accent, #111827)" : "none"
1394
+ opacity: t === o ? 1 : .6,
1395
+ fontWeight: t === o ? 600 : 500,
1396
+ boxShadow: t === o ? "inset 0 -2px 0 var(--page-accent, #111827)" : "none"
1394
1397
  },
1395
1398
  children: e.label || `Tab ${t + 1}`
1396
1399
  }, e.key))
1397
- }), e.map((e, n) => /* @__PURE__ */ c("div", {
1400
+ }), e.map((e, n) => /* @__PURE__ */ l("div", {
1398
1401
  style: {
1399
- display: n === s ? "flex" : "none",
1402
+ display: n === o ? "flex" : "none",
1400
1403
  flexDirection: "column"
1401
1404
  },
1402
1405
  children: t?.[e.key] ?? null
1403
1406
  }, e.key))]
1404
1407
  }) : null;
1405
1408
  }
1406
- function Je({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1407
- let [a, s] = o(() => new Set(e.length ? [e[0].key] : []));
1409
+ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1410
+ let [a, o] = s(() => new Set(e.length ? [e[0].key] : []));
1408
1411
  if (!e.length) return null;
1409
- let u = (e) => s((t) => {
1412
+ let c = (e) => o((t) => {
1410
1413
  let r = new Set(n ? t : []);
1411
1414
  return t.has(e) ? r.delete(e) : r.add(e), r;
1412
1415
  });
1413
- return /* @__PURE__ */ c("div", {
1416
+ return /* @__PURE__ */ l("div", {
1414
1417
  ref: i,
1415
1418
  style: {
1416
1419
  width: "100%",
1417
- ...p(r)
1420
+ ...m(r)
1418
1421
  },
1419
1422
  children: e.map((n, r) => {
1420
1423
  let i = a.has(n.key);
1421
- return /* @__PURE__ */ l("div", {
1424
+ return /* @__PURE__ */ u("div", {
1422
1425
  style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
1423
- children: [/* @__PURE__ */ l("button", {
1426
+ children: [/* @__PURE__ */ u("button", {
1424
1427
  type: "button",
1425
- onClick: () => u(n.key),
1428
+ onClick: () => c(n.key),
1426
1429
  style: {
1427
1430
  width: "100%",
1428
1431
  display: "flex",
@@ -1439,7 +1442,7 @@ function Je({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1439
1442
  textAlign: "left",
1440
1443
  cursor: "pointer"
1441
1444
  },
1442
- children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ c("span", {
1445
+ children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ l("span", {
1443
1446
  "aria-hidden": !0,
1444
1447
  style: {
1445
1448
  fontSize: 12,
@@ -1449,7 +1452,7 @@ function Je({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1449
1452
  },
1450
1453
  children: "▼"
1451
1454
  })]
1452
- }), /* @__PURE__ */ c("div", {
1455
+ }), /* @__PURE__ */ l("div", {
1453
1456
  style: {
1454
1457
  display: i ? "flex" : "none",
1455
1458
  flexDirection: "column"
@@ -1460,11 +1463,11 @@ function Je({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1460
1463
  })
1461
1464
  });
1462
1465
  }
1463
- var Ye = {
1466
+ var Xe = {
1464
1467
  display: "flex",
1465
1468
  flexDirection: "column",
1466
1469
  gap: "12px"
1467
- }, Xe = {
1470
+ }, Ze = {
1468
1471
  fontSize: "14px",
1469
1472
  fontWeight: 500,
1470
1473
  color: "var(--page-text, #111827)"
@@ -1478,18 +1481,18 @@ var Ye = {
1478
1481
  boxSizing: "border-box",
1479
1482
  backgroundColor: "#ffffff",
1480
1483
  color: "#111827"
1481
- }, Ze = {
1484
+ }, Qe = {
1482
1485
  display: "flex",
1483
1486
  alignItems: "center",
1484
1487
  gap: "8px",
1485
1488
  fontSize: "14px",
1486
1489
  color: "var(--page-text, #111827)"
1487
- }, Qe = (e) => e ? {
1490
+ }, $e = (e) => e ? {
1488
1491
  readOnly: !0,
1489
1492
  tabIndex: -1,
1490
1493
  onMouseDown: (e) => e.preventDefault()
1491
1494
  } : {};
1492
- function $e(e, t) {
1495
+ function et(e, t) {
1493
1496
  if (!e) return !0;
1494
1497
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1495
1498
  switch (e.op) {
@@ -1503,11 +1506,11 @@ function $e(e, t) {
1503
1506
  default: return !1;
1504
1507
  }
1505
1508
  }
1506
- var et = {
1509
+ var tt = {
1507
1510
  display: "flex",
1508
1511
  flexDirection: "column",
1509
1512
  gap: 6
1510
- }, tt = {
1513
+ }, nt = {
1511
1514
  font: "inherit",
1512
1515
  fontSize: 15,
1513
1516
  padding: "10px 12px",
@@ -1518,10 +1521,10 @@ var et = {
1518
1521
  width: "100%",
1519
1522
  boxSizing: "border-box"
1520
1523
  };
1521
- function nt({ field: e, value: t, onChange: n, inert: r }) {
1522
- let i = /* @__PURE__ */ l("span", {
1524
+ function rt({ field: e, value: t, onChange: n, inert: r }) {
1525
+ let i = /* @__PURE__ */ u("span", {
1523
1526
  style: {
1524
- ...Xe,
1527
+ ...Ze,
1525
1528
  fontSize: 14
1526
1529
  },
1527
1530
  children: [e.label, e.required ? " *" : ""]
@@ -1530,11 +1533,11 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
1530
1533
  required: e.required || void 0,
1531
1534
  placeholder: e.placeholder || void 0,
1532
1535
  disabled: r || void 0,
1533
- style: tt,
1536
+ style: nt,
1534
1537
  value: t ?? "",
1535
1538
  onChange: (t) => n(e.name, t.target.value)
1536
1539
  };
1537
- return e.type === "display" ? /* @__PURE__ */ c(e.variant && e.variant !== "p" ? e.variant : "p", {
1540
+ return e.type === "display" ? /* @__PURE__ */ l(e.variant && e.variant !== "p" ? e.variant : "p", {
1538
1541
  style: {
1539
1542
  margin: 0,
1540
1543
  color: e.color || "inherit",
@@ -1551,7 +1554,7 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
1551
1554
  lineHeight: 1.35
1552
1555
  },
1553
1556
  children: e.label
1554
- }) : e.type === "image" ? e.src ? /* @__PURE__ */ c("img", {
1557
+ }) : e.type === "image" ? e.src ? /* @__PURE__ */ l("img", {
1555
1558
  src: e.src,
1556
1559
  alt: e.label ?? "",
1557
1560
  style: {
@@ -1559,10 +1562,10 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
1559
1562
  borderRadius: 8,
1560
1563
  display: "block"
1561
1564
  }
1562
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ c(Ne, {
1565
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ l(Pe, {
1563
1566
  url: e.src,
1564
1567
  style: { width: "100%" }
1565
- }) : /* @__PURE__ */ c("video", {
1568
+ }) : /* @__PURE__ */ l("video", {
1566
1569
  src: e.src,
1567
1570
  controls: !0,
1568
1571
  style: {
@@ -1570,27 +1573,27 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
1570
1573
  borderRadius: 8,
1571
1574
  display: "block"
1572
1575
  }
1573
- }) : null : /* @__PURE__ */ l("label", {
1574
- style: et,
1576
+ }) : null : /* @__PURE__ */ u("label", {
1577
+ style: tt,
1575
1578
  children: [
1576
1579
  i,
1577
- e.type === "textarea" || e.multiline ? /* @__PURE__ */ c("textarea", {
1580
+ e.type === "textarea" || e.multiline ? /* @__PURE__ */ l("textarea", {
1578
1581
  ...a,
1579
1582
  rows: 4,
1580
1583
  style: {
1581
- ...tt,
1584
+ ...nt,
1582
1585
  resize: "vertical"
1583
1586
  }
1584
- }) : e.type === "select" ? /* @__PURE__ */ l("select", {
1587
+ }) : e.type === "select" ? /* @__PURE__ */ u("select", {
1585
1588
  ...a,
1586
- children: [/* @__PURE__ */ c("option", {
1589
+ children: [/* @__PURE__ */ l("option", {
1587
1590
  value: "",
1588
1591
  children: e.placeholder || "—"
1589
- }), (e.options ?? []).map((e, t) => /* @__PURE__ */ c("option", {
1592
+ }), (e.options ?? []).map((e, t) => /* @__PURE__ */ l("option", {
1590
1593
  value: typeof e == "string" ? e : e.value,
1591
1594
  children: typeof e == "string" ? e : e.label ?? e.value
1592
1595
  }, t))]
1593
- }) : e.type === "checkbox" ? /* @__PURE__ */ c("input", {
1596
+ }) : e.type === "checkbox" ? /* @__PURE__ */ l("input", {
1594
1597
  type: "checkbox",
1595
1598
  name: e.name,
1596
1599
  required: e.required || void 0,
@@ -1601,7 +1604,7 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
1601
1604
  width: 18,
1602
1605
  height: 18
1603
1606
  }
1604
- }) : e.type === "upload" ? /* @__PURE__ */ c("input", {
1607
+ }) : e.type === "upload" ? /* @__PURE__ */ l("input", {
1605
1608
  type: "file",
1606
1609
  name: e.name,
1607
1610
  accept: e.accept || void 0,
@@ -1612,7 +1615,7 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
1612
1615
  font: "inherit",
1613
1616
  fontSize: 14
1614
1617
  }
1615
- }) : /* @__PURE__ */ c("input", {
1618
+ }) : /* @__PURE__ */ l("input", {
1616
1619
  ...a,
1617
1620
  type: {
1618
1621
  email: "email",
@@ -1623,7 +1626,7 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
1623
1626
  link: "url"
1624
1627
  }[e.type] ?? "text"
1625
1628
  }),
1626
- e.help && /* @__PURE__ */ c("span", {
1629
+ e.help && /* @__PURE__ */ l("span", {
1627
1630
  style: {
1628
1631
  fontSize: 12,
1629
1632
  opacity: .65
@@ -1633,8 +1636,8 @@ function nt({ field: e, value: t, onChange: n, inert: r }) {
1633
1636
  ]
1634
1637
  });
1635
1638
  }
1636
- function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d, auto: f, submitLabel: m, nodeRef: h, inert: g, children: _, linked: v, show: y }) {
1637
- let { tenant: b, apiUrl: x } = n(H), [S, C] = o("form"), [w, T] = o(null), [E, D] = o({}), [O, k] = o(0), A = g ? y || "form" : S;
1639
+ function it({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d, auto: f, submitLabel: p, nodeRef: h, inert: g, children: _, linked: v, show: y }) {
1640
+ let { tenant: b, apiUrl: x } = n(V), [S, C] = s("form"), [w, T] = s(null), [E, D] = s({}), [O, k] = s(0), A = g ? y || "form" : S;
1638
1641
  r(() => {
1639
1642
  if (!f || !d) return;
1640
1643
  let e = !0;
@@ -1655,25 +1658,25 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1655
1658
  section: e,
1656
1659
  fields: []
1657
1660
  }) : j[j.length - 1].fields.push(e);
1658
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || $e(e.section.condition, E)).map((e) => ({
1661
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || et(e.section.condition, E)).map((e) => ({
1659
1662
  ...e,
1660
- fields: e.fields.filter((e) => $e(e.condition, E))
1663
+ fields: e.fields.filter((e) => et(e.condition, E))
1661
1664
  })), 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) => {
1662
1665
  let t = E[e.name];
1663
1666
  return e.required && (t == null || t === "" || t === !1);
1664
- }), R = F >= N.length - 1, z = (e, t) => D((n) => ({
1667
+ }), ee = F >= N.length - 1, R = (e, t) => D((n) => ({
1665
1668
  ...n,
1666
1669
  [e]: t
1667
1670
  }));
1668
- return /* @__PURE__ */ l("div", {
1671
+ return /* @__PURE__ */ u("div", {
1669
1672
  ref: h,
1670
- style: p(e),
1673
+ style: m(e),
1671
1674
  children: [
1672
- /* @__PURE__ */ c("form", {
1675
+ /* @__PURE__ */ l("form", {
1673
1676
  action: t || void 0,
1674
1677
  method: i || "post",
1675
1678
  name: a || void 0,
1676
- encType: u || void 0,
1679
+ encType: o || void 0,
1677
1680
  onSubmit: async (e) => {
1678
1681
  if (e.preventDefault(), !g) {
1679
1682
  if (d) {
@@ -1711,16 +1714,16 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1711
1714
  }
1712
1715
  },
1713
1716
  style: {
1714
- ...Ye,
1717
+ ...Xe,
1715
1718
  display: A === "success" ? "none" : "flex"
1716
1719
  },
1717
- children: f && d ? /* @__PURE__ */ l(s, { children: [
1718
- P && /* @__PURE__ */ c(ht, {
1720
+ children: f && d ? /* @__PURE__ */ u(c, { children: [
1721
+ P && /* @__PURE__ */ l(gt, {
1719
1722
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1720
1723
  active: F + 1,
1721
1724
  style: { marginBottom: 8 }
1722
1725
  }),
1723
- P && N[F]?.section?.help && /* @__PURE__ */ c("p", {
1726
+ P && N[F]?.section?.help && /* @__PURE__ */ l("p", {
1724
1727
  style: {
1725
1728
  margin: 0,
1726
1729
  fontSize: 14,
@@ -1728,20 +1731,20 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1728
1731
  },
1729
1732
  children: N[F].section.help
1730
1733
  }),
1731
- I.map((e) => /* @__PURE__ */ c(nt, {
1734
+ I.map((e) => /* @__PURE__ */ l(rt, {
1732
1735
  field: e,
1733
1736
  value: E[e.name],
1734
- onChange: z,
1737
+ onChange: R,
1735
1738
  inert: g
1736
1739
  }, e.name)),
1737
- /* @__PURE__ */ l("div", {
1740
+ /* @__PURE__ */ u("div", {
1738
1741
  style: {
1739
1742
  display: "flex",
1740
1743
  gap: 10,
1741
1744
  alignItems: "center",
1742
1745
  marginTop: 4
1743
1746
  },
1744
- children: [P && F > 0 && /* @__PURE__ */ c("button", {
1747
+ children: [P && F > 0 && /* @__PURE__ */ l("button", {
1745
1748
  type: "button",
1746
1749
  disabled: g || void 0,
1747
1750
  onClick: () => k(F - 1),
@@ -1754,7 +1757,7 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1754
1757
  cursor: "pointer"
1755
1758
  },
1756
1759
  children: "Back"
1757
- }), P && !R ? /* @__PURE__ */ c("button", {
1760
+ }), P && !ee ? /* @__PURE__ */ l("button", {
1758
1761
  type: "button",
1759
1762
  disabled: g || L.length > 0,
1760
1763
  onClick: () => k(F + 1),
@@ -1769,7 +1772,7 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1769
1772
  opacity: L.length ? .5 : 1
1770
1773
  },
1771
1774
  children: "Next"
1772
- }) : /* @__PURE__ */ c("button", {
1775
+ }) : /* @__PURE__ */ l("button", {
1773
1776
  type: "submit",
1774
1777
  disabled: g || void 0,
1775
1778
  style: {
@@ -1781,16 +1784,16 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1781
1784
  fontWeight: 600,
1782
1785
  cursor: "pointer"
1783
1786
  },
1784
- children: m || "Submit"
1787
+ children: p || "Submit"
1785
1788
  })]
1786
1789
  })
1787
1790
  ] }) : _
1788
1791
  }),
1789
- /* @__PURE__ */ c("div", {
1792
+ /* @__PURE__ */ l("div", {
1790
1793
  style: { display: A === "success" ? "block" : "none" },
1791
1794
  children: v?.success ?? null
1792
1795
  }),
1793
- /* @__PURE__ */ c("div", {
1796
+ /* @__PURE__ */ l("div", {
1794
1797
  style: {
1795
1798
  display: A === "error" ? "block" : "none",
1796
1799
  marginTop: 12
@@ -1800,18 +1803,18 @@ function rt({ style: e, action: t, method: i, name: a, enctype: u, formSlug: d,
1800
1803
  ]
1801
1804
  });
1802
1805
  }
1803
- function it({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1804
- return /* @__PURE__ */ c("label", {
1806
+ function at({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1807
+ return /* @__PURE__ */ l("label", {
1805
1808
  ref: r,
1806
1809
  style: {
1807
- ...Xe,
1808
- ...p(n)
1810
+ ...Ze,
1811
+ ...m(n)
1809
1812
  },
1810
1813
  children: X(t, e, i)
1811
1814
  });
1812
1815
  }
1813
- function at({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1814
- return /* @__PURE__ */ c("input", {
1816
+ function ot({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1817
+ return /* @__PURE__ */ l("input", {
1815
1818
  ref: a,
1816
1819
  type: e,
1817
1820
  name: t || void 0,
@@ -1819,13 +1822,13 @@ function at({ type: e = "text", name: t, placeholder: n, required: r, style: i,
1819
1822
  required: !o && !!r,
1820
1823
  style: {
1821
1824
  ...Q,
1822
- ...p(i)
1825
+ ...m(i)
1823
1826
  },
1824
- ...Qe(o)
1827
+ ...$e(o)
1825
1828
  });
1826
1829
  }
1827
- function ot({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1828
- return /* @__PURE__ */ c("textarea", {
1830
+ function st({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1831
+ return /* @__PURE__ */ l("textarea", {
1829
1832
  ref: a,
1830
1833
  name: e || void 0,
1831
1834
  placeholder: t,
@@ -1834,19 +1837,19 @@ function ot({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
1834
1837
  style: {
1835
1838
  ...Q,
1836
1839
  resize: "vertical",
1837
- ...p(i)
1840
+ ...m(i)
1838
1841
  },
1839
- ...Qe(o)
1842
+ ...$e(o)
1840
1843
  });
1841
1844
  }
1842
- function st({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1843
- return /* @__PURE__ */ l("label", {
1845
+ function ct({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1846
+ return /* @__PURE__ */ u("label", {
1844
1847
  ref: o,
1845
1848
  style: {
1846
- ...Ze,
1847
- ...p(a)
1849
+ ...Qe,
1850
+ ...m(a)
1848
1851
  },
1849
- children: [/* @__PURE__ */ c("input", {
1852
+ children: [/* @__PURE__ */ l("input", {
1850
1853
  type: e,
1851
1854
  name: n || void 0,
1852
1855
  value: r || void 0,
@@ -1860,8 +1863,8 @@ function st({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1860
1863
  }), t]
1861
1864
  });
1862
1865
  }
1863
- function ct({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1864
- return /* @__PURE__ */ l("select", {
1866
+ function lt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1867
+ return /* @__PURE__ */ u("select", {
1865
1868
  ref: a,
1866
1869
  name: e || void 0,
1867
1870
  required: !o && !!r,
@@ -1871,52 +1874,52 @@ function ct({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1871
1874
  style: {
1872
1875
  ...Q,
1873
1876
  appearance: "auto",
1874
- ...p(i)
1877
+ ...m(i)
1875
1878
  },
1876
- children: [t !== "" && /* @__PURE__ */ c("option", {
1879
+ children: [t !== "" && /* @__PURE__ */ l("option", {
1877
1880
  value: "",
1878
1881
  disabled: !0,
1879
1882
  children: t ?? "Select…"
1880
- }), n.map((e, t) => /* @__PURE__ */ c("option", {
1883
+ }), n.map((e, t) => /* @__PURE__ */ l("option", {
1881
1884
  value: e,
1882
1885
  children: e
1883
1886
  }, t))]
1884
1887
  });
1885
1888
  }
1886
- function lt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
1887
- let [u, d] = o(null);
1888
- return /* @__PURE__ */ l("label", {
1889
+ function ut({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
1890
+ let [c, d] = s(null);
1891
+ return /* @__PURE__ */ u("label", {
1889
1892
  ref: a,
1890
1893
  style: {
1891
1894
  ...Q,
1892
1895
  display: "flex",
1893
1896
  alignItems: "center",
1894
1897
  gap: "8px",
1895
- cursor: s ? "default" : "pointer",
1898
+ cursor: o ? "default" : "pointer",
1896
1899
  borderStyle: "dashed",
1897
- color: u ? "#111827" : "#6b7280",
1898
- ...p(i)
1900
+ color: c ? "#111827" : "#6b7280",
1901
+ ...m(i)
1899
1902
  },
1900
1903
  children: [
1901
- /* @__PURE__ */ c("input", {
1904
+ /* @__PURE__ */ l("input", {
1902
1905
  type: "file",
1903
1906
  name: e || void 0,
1904
1907
  accept: t || void 0,
1905
- required: !s && !!n,
1906
- disabled: !!s,
1908
+ required: !o && !!n,
1909
+ disabled: !!o,
1907
1910
  onChange: (e) => d(e.target.files?.[0]?.name ?? null),
1908
1911
  style: { display: "none" }
1909
1912
  }),
1910
- /* @__PURE__ */ c("span", {
1913
+ /* @__PURE__ */ l("span", {
1911
1914
  "aria-hidden": !0,
1912
1915
  children: "📎"
1913
1916
  }),
1914
- u ?? r
1917
+ c ?? r
1915
1918
  ]
1916
1919
  });
1917
1920
  }
1918
- function ut({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1919
- return /* @__PURE__ */ c("button", {
1921
+ function dt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1922
+ return /* @__PURE__ */ l("button", {
1920
1923
  ref: n,
1921
1924
  type: r ? "button" : "submit",
1922
1925
  style: {
@@ -1930,30 +1933,30 @@ function ut({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1930
1933
  fontWeight: 600,
1931
1934
  lineHeight: 1.4,
1932
1935
  fontFamily: "inherit",
1933
- ...p(t)
1936
+ ...m(t)
1934
1937
  },
1935
1938
  children: e
1936
1939
  });
1937
1940
  }
1938
- function dt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1941
+ function ft({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1939
1942
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1940
- return /* @__PURE__ */ c("div", {
1943
+ return /* @__PURE__ */ l("div", {
1941
1944
  ref: r,
1942
1945
  style: {
1943
1946
  display: "grid",
1944
1947
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
1945
1948
  gap: 16,
1946
1949
  width: "100%",
1947
- ...p(n)
1950
+ ...m(n)
1948
1951
  },
1949
- children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ c("div", {
1952
+ children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ l("div", {
1950
1953
  style: { minWidth: 0 },
1951
1954
  children: i?.[`cell-${t}`] ?? null
1952
1955
  }, t))
1953
1956
  });
1954
1957
  }
1955
- function ft({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, imageField: s, titleField: u = "name", textField: d, custom: f, templateId: m, style: h, nodeRef: g }) {
1956
- let { tenant: _, apiUrl: v } = n(H), y = n(W), b = n(U)?.[e], [x, S] = o(null);
1958
+ function pt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, imageField: o, titleField: c = "name", textField: d, custom: f, templateId: p, style: h, nodeRef: g }) {
1959
+ let { tenant: _, apiUrl: v } = n(V), y = n(U), b = n(H)?.[e], [x, S] = s(null);
1957
1960
  if (r(() => {
1958
1961
  if (!e || b) return;
1959
1962
  let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}`;
@@ -1975,27 +1978,27 @@ function ft({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
1975
1978
  gridTemplateColumns: `repeat(${w}, minmax(0, 1fr))`,
1976
1979
  gap: 24
1977
1980
  };
1978
- return f && m && y?.render ? /* @__PURE__ */ c("div", {
1981
+ return f && p && y?.render ? /* @__PURE__ */ l("div", {
1979
1982
  ref: g,
1980
1983
  style: {
1981
1984
  width: "100%",
1982
1985
  ...T,
1983
- ...p(h)
1986
+ ...m(h)
1984
1987
  },
1985
- children: C.map((e) => /* @__PURE__ */ c("div", {
1988
+ children: C.map((e) => /* @__PURE__ */ l("div", {
1986
1989
  style: { minWidth: 0 },
1987
- children: y.render(m, (t) => se(t, e))
1990
+ children: y.render(p, (t) => ce(t, e))
1988
1991
  }, e.id ?? e?.data?.slug))
1989
- }) : /* @__PURE__ */ c("div", {
1992
+ }) : /* @__PURE__ */ l("div", {
1990
1993
  ref: g,
1991
1994
  style: {
1992
1995
  width: "100%",
1993
1996
  ...T,
1994
- ...p(h)
1997
+ ...m(h)
1995
1998
  },
1996
1999
  children: C.map((e) => {
1997
- let t = s ? G(e?.data, s) : null, n = u ? K(G(e?.data, u)) : null, r = d ? G(e?.data, d) : null, a = Array.isArray(r) ? r : null, o = a || r == null ? null : K(r), f = i === "list";
1998
- return /* @__PURE__ */ l("div", {
2000
+ let t = o ? W(e?.data, o) : null, n = c ? K(W(e?.data, c)) : null, r = d ? W(e?.data, d) : null, a = Array.isArray(r) ? r : null, s = a || r == null ? null : K(r), f = i === "list";
2001
+ return /* @__PURE__ */ u("div", {
1999
2002
  style: {
2000
2003
  display: "flex",
2001
2004
  flexDirection: f ? "row" : "column",
@@ -2003,7 +2006,7 @@ function ft({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2003
2006
  alignItems: f ? "center" : "stretch",
2004
2007
  minWidth: 0
2005
2008
  },
2006
- children: [t && /* @__PURE__ */ c("img", {
2009
+ children: [t && /* @__PURE__ */ l("img", {
2007
2010
  src: t,
2008
2011
  alt: n ?? "",
2009
2012
  style: {
@@ -2014,10 +2017,10 @@ function ft({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2014
2017
  flexShrink: 0,
2015
2018
  display: "block"
2016
2019
  }
2017
- }), /* @__PURE__ */ l("div", {
2020
+ }), /* @__PURE__ */ u("div", {
2018
2021
  style: { minWidth: 0 },
2019
2022
  children: [
2020
- n && /* @__PURE__ */ c("h3", {
2023
+ n && /* @__PURE__ */ l("h3", {
2021
2024
  style: {
2022
2025
  margin: 0,
2023
2026
  fontSize: 18,
@@ -2025,23 +2028,23 @@ function ft({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2025
2028
  },
2026
2029
  children: n
2027
2030
  }),
2028
- o && /* @__PURE__ */ c("p", {
2031
+ s && /* @__PURE__ */ l("p", {
2029
2032
  style: {
2030
2033
  margin: "6px 0 0",
2031
2034
  fontSize: 14,
2032
2035
  lineHeight: 1.55,
2033
2036
  opacity: .75
2034
2037
  },
2035
- children: o
2038
+ children: s
2036
2039
  }),
2037
- a && /* @__PURE__ */ c("div", {
2040
+ a && /* @__PURE__ */ l("div", {
2038
2041
  style: {
2039
2042
  marginTop: 6,
2040
2043
  fontSize: 14,
2041
2044
  lineHeight: 1.55,
2042
2045
  opacity: .85
2043
2046
  },
2044
- children: xe(a)
2047
+ children: Se(a)
2045
2048
  })
2046
2049
  ]
2047
2050
  })]
@@ -2049,12 +2052,12 @@ function ft({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2049
2052
  })
2050
2053
  });
2051
2054
  }
2052
- function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2053
- return e.length ? /* @__PURE__ */ c("nav", {
2055
+ function mt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2056
+ return e.length ? /* @__PURE__ */ l("nav", {
2054
2057
  ref: r,
2055
2058
  "aria-label": "Breadcrumb",
2056
- style: { ...p(n) },
2057
- children: /* @__PURE__ */ c("ol", {
2059
+ style: { ...m(n) },
2060
+ children: /* @__PURE__ */ l("ol", {
2058
2061
  style: {
2059
2062
  display: "flex",
2060
2063
  flexWrap: "wrap",
@@ -2067,25 +2070,25 @@ function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2067
2070
  },
2068
2071
  children: e.map((n, r) => {
2069
2072
  let i = r === e.length - 1;
2070
- return /* @__PURE__ */ l("li", {
2073
+ return /* @__PURE__ */ u("li", {
2071
2074
  style: {
2072
2075
  display: "flex",
2073
2076
  alignItems: "center",
2074
2077
  gap: 8,
2075
2078
  minWidth: 0
2076
2079
  },
2077
- children: [r > 0 && /* @__PURE__ */ c("span", {
2080
+ children: [r > 0 && /* @__PURE__ */ l("span", {
2078
2081
  style: { opacity: .4 },
2079
2082
  "aria-hidden": !0,
2080
2083
  children: t
2081
- }), i || !n.href ? /* @__PURE__ */ c("span", {
2084
+ }), i || !n.href ? /* @__PURE__ */ l("span", {
2082
2085
  style: {
2083
2086
  fontWeight: i ? 600 : 400,
2084
2087
  opacity: i ? 1 : .7
2085
2088
  },
2086
2089
  "aria-current": i ? "page" : void 0,
2087
2090
  children: n.label
2088
- }) : /* @__PURE__ */ c("a", {
2091
+ }) : /* @__PURE__ */ l("a", {
2089
2092
  href: n.href,
2090
2093
  style: {
2091
2094
  color: "inherit",
@@ -2099,8 +2102,8 @@ function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2099
2102
  })
2100
2103
  }) : null;
2101
2104
  }
2102
- function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2103
- let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), u = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", d = (e) => ({
2105
+ function ht({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2106
+ 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) => ({
2104
2107
  display: "inline-flex",
2105
2108
  alignItems: "center",
2106
2109
  justifyContent: "center",
@@ -2114,7 +2117,7 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2114
2117
  background: e ? "var(--page-accent, #111827)" : "transparent",
2115
2118
  border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
2116
2119
  });
2117
- return /* @__PURE__ */ l("nav", {
2120
+ return /* @__PURE__ */ u("nav", {
2118
2121
  ref: a,
2119
2122
  "aria-label": "Pagination",
2120
2123
  style: {
@@ -2122,11 +2125,11 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2122
2125
  flexWrap: "wrap",
2123
2126
  gap: 8,
2124
2127
  alignItems: "center",
2125
- ...p(i)
2128
+ ...m(i)
2126
2129
  },
2127
2130
  children: [
2128
- n && /* @__PURE__ */ c("a", {
2129
- href: s > 1 ? u(s - 1) : "#",
2131
+ n && /* @__PURE__ */ l("a", {
2132
+ href: s > 1 ? c(s - 1) : "#",
2130
2133
  "aria-label": "Previous",
2131
2134
  style: {
2132
2135
  ...d(!1),
@@ -2134,14 +2137,14 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2134
2137
  },
2135
2138
  children: "‹"
2136
2139
  }),
2137
- Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ c("a", {
2138
- href: u(e),
2140
+ Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ l("a", {
2141
+ href: c(e),
2139
2142
  "aria-current": e === s ? "page" : void 0,
2140
2143
  style: d(e === s),
2141
2144
  children: e
2142
2145
  }, e)),
2143
- n && /* @__PURE__ */ c("a", {
2144
- href: s < o ? u(s + 1) : "#",
2146
+ n && /* @__PURE__ */ l("a", {
2147
+ href: s < o ? c(s + 1) : "#",
2145
2148
  "aria-label": "Next",
2146
2149
  style: {
2147
2150
  ...d(!1),
@@ -2152,7 +2155,7 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2152
2155
  ]
2153
2156
  });
2154
2157
  }
2155
- function ht({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2158
+ function gt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2156
2159
  if (!t.length) return null;
2157
2160
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
2158
2161
  width: 32,
@@ -2169,7 +2172,7 @@ function ht({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2169
2172
  border: e === "todo" ? "1px solid rgba(148, 163, 184, 0.5)" : "1px solid transparent",
2170
2173
  opacity: e === "todo" ? .6 : 1,
2171
2174
  boxShadow: e === "active" ? "0 0 0 4px rgba(99, 102, 241, 0.2)" : "none"
2172
- }), u = (e) => ({
2175
+ }), c = (e) => ({
2173
2176
  flexGrow: 1,
2174
2177
  alignSelf: "center",
2175
2178
  background: e ? "var(--page-accent, #111827)" : "rgba(148, 163, 184, 0.4)",
@@ -2183,21 +2186,21 @@ function ht({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2183
2186
  minWidth: 24
2184
2187
  }
2185
2188
  });
2186
- return /* @__PURE__ */ c("div", {
2189
+ return /* @__PURE__ */ l("div", {
2187
2190
  ref: a,
2188
2191
  style: {
2189
2192
  display: "flex",
2190
2193
  flexDirection: r ? "column" : "row",
2191
2194
  alignItems: r ? "stretch" : "flex-start",
2192
2195
  gap: r ? 4 : 8,
2193
- ...p(i)
2196
+ ...m(i)
2194
2197
  },
2195
2198
  children: t.map((t, n) => {
2196
2199
  let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
2197
- return /* @__PURE__ */ l(e, { children: [n > 0 && /* @__PURE__ */ c("div", {
2198
- style: u(i <= o),
2200
+ return /* @__PURE__ */ u(e, { children: [n > 0 && /* @__PURE__ */ l("div", {
2201
+ style: c(i <= o),
2199
2202
  "aria-hidden": !0
2200
- }), /* @__PURE__ */ l("div", {
2203
+ }), /* @__PURE__ */ u("div", {
2201
2204
  style: {
2202
2205
  display: "flex",
2203
2206
  flexDirection: r ? "row" : "column",
@@ -2206,19 +2209,19 @@ function ht({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2206
2209
  minWidth: 0,
2207
2210
  textAlign: r ? "left" : "center"
2208
2211
  },
2209
- children: [/* @__PURE__ */ c("div", {
2212
+ children: [/* @__PURE__ */ l("div", {
2210
2213
  style: s(a),
2211
2214
  children: a === "done" ? "✓" : i
2212
- }), /* @__PURE__ */ l("div", {
2215
+ }), /* @__PURE__ */ u("div", {
2213
2216
  style: { minWidth: 0 },
2214
- children: [/* @__PURE__ */ c("div", {
2217
+ children: [/* @__PURE__ */ l("div", {
2215
2218
  style: {
2216
2219
  fontSize: 13,
2217
2220
  fontWeight: a === "active" ? 700 : 500,
2218
2221
  opacity: a === "todo" ? .6 : 1
2219
2222
  },
2220
2223
  children: t.label
2221
- }), t.description && /* @__PURE__ */ c("div", {
2224
+ }), t.description && /* @__PURE__ */ l("div", {
2222
2225
  style: {
2223
2226
  fontSize: 12,
2224
2227
  opacity: .6
@@ -2230,8 +2233,422 @@ function ht({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2230
2233
  })
2231
2234
  });
2232
2235
  }
2233
- function gt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped: s = !0, bordered: u = !1, compact: d = !1, style: f, nodeRef: m }) {
2234
- let { tenant: h, apiUrl: g } = n(H), _ = n(U)?.[i], [v, y] = o(null);
2236
+ var _t = {
2237
+ small: {
2238
+ w: 132,
2239
+ h: 46,
2240
+ name: 11.5,
2241
+ title: 10,
2242
+ avatar: 28
2243
+ },
2244
+ medium: {
2245
+ w: 168,
2246
+ h: 56,
2247
+ name: 13,
2248
+ title: 11,
2249
+ avatar: 36
2250
+ },
2251
+ large: {
2252
+ w: 210,
2253
+ h: 70,
2254
+ name: 15.5,
2255
+ title: 12.5,
2256
+ avatar: 46
2257
+ }
2258
+ }, vt = (e) => _t[e] ?? _t.medium;
2259
+ _t.medium.w, _t.medium.h;
2260
+ function yt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2261
+ let r = vt(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 = [];
2262
+ 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);
2263
+ let d = /* @__PURE__ */ new Map(), f = (e, t) => {
2264
+ if (t.has(e.id)) return 0;
2265
+ t.add(e.id);
2266
+ let n = (l.get(e.id) ?? []).reduce((e, n, r) => e + f(n, t) + (r ? a : 0), 0), r = Math.max(i, n);
2267
+ return d.set(e.id, r), r;
2268
+ };
2269
+ u.forEach((e) => f(e, /* @__PURE__ */ new Set()));
2270
+ let p = [], m = [], h = 0, g = (e, t, s, c) => {
2271
+ if (c.has(e.id)) return;
2272
+ c.add(e.id);
2273
+ let u = t + ((d.get(e.id) ?? i) - i) / 2, f = s * o, _ = n ? f : u, v = n ? u : f;
2274
+ p.push({
2275
+ node: e,
2276
+ x: _,
2277
+ y: v
2278
+ }), h = Math.max(h, f + (n ? r.w : r.h));
2279
+ let y = t;
2280
+ for (let t of l.get(e.id) ?? []) {
2281
+ let e = y + ((d.get(t.id) ?? i) - i) / 2 + i / 2, l = (s + 1) * o;
2282
+ m.push(n ? {
2283
+ from: {
2284
+ x: f + r.w,
2285
+ y: u + r.h / 2
2286
+ },
2287
+ to: {
2288
+ x: l,
2289
+ y: e
2290
+ }
2291
+ } : {
2292
+ from: {
2293
+ x: u + r.w / 2,
2294
+ y: f + r.h
2295
+ },
2296
+ to: {
2297
+ x: e,
2298
+ y: l
2299
+ }
2300
+ }), g(t, y, s + 1, c), y += (d.get(t.id) ?? i) + a;
2301
+ }
2302
+ }, _ = 0, v = /* @__PURE__ */ new Set();
2303
+ for (let e of u) g(e, _, 0, v), _ += (d.get(e.id) ?? i) + a;
2304
+ let y = Math.max(_ - a, i);
2305
+ return {
2306
+ boxes: p,
2307
+ links: m,
2308
+ width: n ? Math.max(h, r.w) : y,
2309
+ height: n ? y : Math.max(h, r.h),
2310
+ horizontal: n
2311
+ };
2312
+ }
2313
+ var bt = (e, t) => {
2314
+ let n = String(e ?? "");
2315
+ return n.length > t ? `${n.slice(0, t - 1)}…` : n;
2316
+ }, xt = (e) => {
2317
+ let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
2318
+ if (!t) return "#ffffff";
2319
+ let n = t[1];
2320
+ n.length === 3 && (n = [...n].map((e) => e + e).join(""));
2321
+ let r = parseInt(n, 16);
2322
+ return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
2323
+ }, St = (e) => !!(e?.cv?.trim?.() || e?.photo);
2324
+ function Ct(e, t = {}) {
2325
+ 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);
2326
+ return n.map((e) => {
2327
+ let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
2328
+ return {
2329
+ id: e.id,
2330
+ name: i(n[t.nameField || "name"]) || i(n.name) || "Untitled",
2331
+ title: t.titleField ? i(n[t.titleField]) : "",
2332
+ photo: t.photoField && r(n[t.photoField]) || "",
2333
+ parent: t.parentField ? o : null,
2334
+ cv: t.cvField ? i(n[t.cvField]) : "",
2335
+ href: t.hrefField ? i(n[t.hrefField]) : ""
2336
+ };
2337
+ });
2338
+ }
2339
+ var wt = {
2340
+ size: 36,
2341
+ pad: 10
2342
+ };
2343
+ function Tt({ node: e, onClose: t }) {
2344
+ return r(() => {
2345
+ let e = (e) => e.key === "Escape" && t();
2346
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
2347
+ }, [t]), /* @__PURE__ */ l("div", {
2348
+ onClick: t,
2349
+ role: "dialog",
2350
+ "aria-modal": "true",
2351
+ "aria-label": e.name,
2352
+ style: {
2353
+ position: "fixed",
2354
+ inset: 0,
2355
+ zIndex: 1e3,
2356
+ background: "rgba(15, 23, 42, 0.55)",
2357
+ display: "flex",
2358
+ alignItems: "center",
2359
+ justifyContent: "center",
2360
+ padding: 16
2361
+ },
2362
+ children: /* @__PURE__ */ u("div", {
2363
+ onClick: (e) => e.stopPropagation(),
2364
+ style: {
2365
+ background: "var(--page-bg, #ffffff)",
2366
+ color: "var(--page-text, #111827)",
2367
+ borderRadius: 14,
2368
+ maxWidth: 420,
2369
+ width: "100%",
2370
+ maxHeight: "80vh",
2371
+ overflowY: "auto",
2372
+ padding: 24,
2373
+ position: "relative",
2374
+ boxShadow: "0 24px 64px rgba(15, 23, 42, 0.35)"
2375
+ },
2376
+ children: [
2377
+ /* @__PURE__ */ l("button", {
2378
+ type: "button",
2379
+ "aria-label": "Close",
2380
+ onClick: t,
2381
+ style: {
2382
+ position: "absolute",
2383
+ top: 10,
2384
+ right: 10,
2385
+ width: 30,
2386
+ height: 30,
2387
+ border: 0,
2388
+ borderRadius: 8,
2389
+ background: "transparent",
2390
+ color: "inherit",
2391
+ fontSize: 18,
2392
+ lineHeight: 1,
2393
+ cursor: "pointer",
2394
+ opacity: .6
2395
+ },
2396
+ children: "×"
2397
+ }),
2398
+ /* @__PURE__ */ u("div", {
2399
+ style: {
2400
+ display: "flex",
2401
+ alignItems: "center",
2402
+ gap: 14,
2403
+ marginBottom: e.cv ? 14 : 0
2404
+ },
2405
+ children: [e.photo && /* @__PURE__ */ l("img", {
2406
+ src: e.photo,
2407
+ alt: "",
2408
+ style: {
2409
+ width: 72,
2410
+ height: 72,
2411
+ borderRadius: "50%",
2412
+ objectFit: "cover",
2413
+ flexShrink: 0
2414
+ }
2415
+ }), /* @__PURE__ */ u("div", {
2416
+ style: { minWidth: 0 },
2417
+ children: [/* @__PURE__ */ l("div", {
2418
+ style: {
2419
+ fontSize: 18,
2420
+ fontWeight: 700
2421
+ },
2422
+ children: e.name
2423
+ }), e.title && /* @__PURE__ */ l("div", {
2424
+ style: {
2425
+ fontSize: 13,
2426
+ opacity: .65
2427
+ },
2428
+ children: e.title
2429
+ })]
2430
+ })]
2431
+ }),
2432
+ e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ l("p", {
2433
+ style: {
2434
+ fontSize: 14,
2435
+ lineHeight: 1.6,
2436
+ margin: "0 0 10px"
2437
+ },
2438
+ children: e
2439
+ }, t)),
2440
+ e.href && /* @__PURE__ */ l("a", {
2441
+ href: e.href,
2442
+ target: "_blank",
2443
+ rel: "noopener noreferrer",
2444
+ style: {
2445
+ display: "inline-block",
2446
+ marginTop: 6,
2447
+ padding: "8px 14px",
2448
+ borderRadius: 8,
2449
+ fontSize: 13,
2450
+ fontWeight: 600,
2451
+ textDecoration: "none",
2452
+ background: "var(--page-accent, #4f46e5)",
2453
+ color: "var(--page-accent-text, #ffffff)"
2454
+ },
2455
+ children: "Open profile ↗"
2456
+ })
2457
+ ]
2458
+ })
2459
+ });
2460
+ }
2461
+ function Et({ nodes: e = [], source: t, nameField: a, titleField: o, photoField: d, parentField: f, cvField: p, hrefField: h, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
2462
+ let x = i(), [S, C] = s(null), { tenant: w, apiUrl: T } = n(V), E = n(H)?.[t], [D, O] = s(null);
2463
+ r(() => {
2464
+ if (!t || E) return;
2465
+ let e = !0;
2466
+ return fetch(`${T}/dynamic/${encodeURIComponent(t)}`, { headers: w ? { "x-tenant": w } : {} }).then((e) => e.json()).then((t) => {
2467
+ let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
2468
+ e && O(n);
2469
+ }).catch(() => e && O([])), () => {
2470
+ e = !1;
2471
+ };
2472
+ }, [
2473
+ t,
2474
+ w,
2475
+ T,
2476
+ E
2477
+ ]);
2478
+ let k = t ? Ct(E ?? D ?? [], {
2479
+ nameField: a,
2480
+ titleField: o,
2481
+ photoField: d,
2482
+ parentField: f,
2483
+ cvField: p,
2484
+ hrefField: h
2485
+ }) : e, A = vt(g), { boxes: j, links: M, width: N, height: P } = yt(k, {
2486
+ size: g,
2487
+ horizontal: _
2488
+ });
2489
+ if (!j.length) return !b && t ? /* @__PURE__ */ u("div", {
2490
+ ref: y,
2491
+ style: {
2492
+ padding: 18,
2493
+ border: "1px dashed rgba(148, 163, 184, 0.6)",
2494
+ borderRadius: 10,
2495
+ fontSize: 13,
2496
+ opacity: .7,
2497
+ textAlign: "center",
2498
+ ...m(v)
2499
+ },
2500
+ children: [
2501
+ "Org Chart — no published entries in “",
2502
+ t,
2503
+ "” yet"
2504
+ ]
2505
+ }) : null;
2506
+ let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
2507
+ return /* @__PURE__ */ u("div", {
2508
+ ref: y,
2509
+ style: {
2510
+ maxWidth: "100%",
2511
+ overflowX: "auto",
2512
+ ...m(v)
2513
+ },
2514
+ children: [/* @__PURE__ */ u("svg", {
2515
+ viewBox: `0 0 ${N} ${P}`,
2516
+ role: "img",
2517
+ "aria-label": "Organization chart",
2518
+ style: {
2519
+ display: "block",
2520
+ width: "100%",
2521
+ maxWidth: N,
2522
+ height: "auto",
2523
+ margin: "0 auto"
2524
+ },
2525
+ children: [M.map((e, t) => /* @__PURE__ */ l("path", {
2526
+ d: _ ? `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}`,
2527
+ fill: "none",
2528
+ stroke: "rgba(148, 163, 184, 0.7)",
2529
+ strokeWidth: "1.5"
2530
+ }, t)), j.map(({ node: e, x: t, y: n }) => {
2531
+ 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 ? xt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", d = i ? xt(e.color2) : s, f = b && (St(e) || e.href), p = () => St(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + wt.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);
2532
+ return /* @__PURE__ */ u("g", {
2533
+ onClick: f ? p : void 0,
2534
+ style: f ? { cursor: "pointer" } : void 0,
2535
+ role: f ? "button" : void 0,
2536
+ "aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
2537
+ children: [
2538
+ i && e.gradient ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("linearGradient", {
2539
+ id: `${x}-${e.id}-grad`,
2540
+ x1: "0",
2541
+ y1: "0",
2542
+ x2: "0",
2543
+ y2: "1",
2544
+ children: [/* @__PURE__ */ l("stop", {
2545
+ offset: "0%",
2546
+ stopColor: e.color || "var(--page-accent, #4f46e5)"
2547
+ }), /* @__PURE__ */ l("stop", {
2548
+ offset: "100%",
2549
+ stopColor: e.color2
2550
+ })]
2551
+ }), /* @__PURE__ */ l("rect", {
2552
+ x: t,
2553
+ y: n,
2554
+ width: A.w,
2555
+ height: A.h,
2556
+ rx: "10",
2557
+ fill: `url(#${x}-${e.id}-grad)`
2558
+ })] }) : i ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
2559
+ id: `${x}-${e.id}-box`,
2560
+ children: /* @__PURE__ */ l("rect", {
2561
+ x: t,
2562
+ y: n,
2563
+ width: A.w,
2564
+ height: A.h,
2565
+ rx: "10"
2566
+ })
2567
+ }), /* @__PURE__ */ u("g", {
2568
+ clipPath: `url(#${x}-${e.id}-box)`,
2569
+ children: [/* @__PURE__ */ l("rect", {
2570
+ x: t,
2571
+ y: n,
2572
+ width: A.w,
2573
+ height: _,
2574
+ fill: o
2575
+ }), /* @__PURE__ */ l("rect", {
2576
+ x: t,
2577
+ y: n + _,
2578
+ width: A.w,
2579
+ height: A.h - _,
2580
+ fill: e.color2
2581
+ })]
2582
+ })] }) : /* @__PURE__ */ l("rect", {
2583
+ x: t,
2584
+ y: n,
2585
+ width: A.w,
2586
+ height: A.h,
2587
+ rx: "10",
2588
+ fill: o,
2589
+ stroke: a ? "none" : "var(--page-accent, #4f46e5)",
2590
+ strokeWidth: a ? 0 : 1.5
2591
+ }),
2592
+ e.photo && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
2593
+ id: `${x}-${e.id}`,
2594
+ children: /* @__PURE__ */ l("circle", {
2595
+ cx: t + wt.pad + A.avatar / 2,
2596
+ cy: n + A.h / 2,
2597
+ r: A.avatar / 2
2598
+ })
2599
+ }), /* @__PURE__ */ l("image", {
2600
+ href: e.photo,
2601
+ x: t + wt.pad,
2602
+ y: n + (A.h - A.avatar) / 2,
2603
+ width: A.avatar,
2604
+ height: A.avatar,
2605
+ preserveAspectRatio: "xMidYMid slice",
2606
+ clipPath: `url(#${x}-${e.id})`
2607
+ })] }),
2608
+ i && !e.gradient ? /* @__PURE__ */ u(c, { children: [e.title && /* @__PURE__ */ l("text", {
2609
+ x: m,
2610
+ y: n + _ / 2 + A.title * .35,
2611
+ textAnchor: h,
2612
+ fontSize: A.title,
2613
+ fontWeight: "600",
2614
+ fill: s,
2615
+ children: bt(e.title, g + 4)
2616
+ }), e.name && /* @__PURE__ */ l("text", {
2617
+ x: m,
2618
+ y: n + _ + _ / 2 + A.name * .35,
2619
+ textAnchor: h,
2620
+ fontSize: A.name,
2621
+ fontWeight: "600",
2622
+ fill: d,
2623
+ children: bt(e.name, g)
2624
+ })] }) : /* @__PURE__ */ u(c, { children: [v[0] && /* @__PURE__ */ l("text", {
2625
+ x: m,
2626
+ y: n + (v[1] ? A.h * .43 : A.h * .57),
2627
+ textAnchor: h,
2628
+ fontSize: A.name,
2629
+ fontWeight: "600",
2630
+ fill: s,
2631
+ children: bt(v[0], g)
2632
+ }), v[1] && /* @__PURE__ */ l("text", {
2633
+ x: m,
2634
+ y: n + A.h * .73,
2635
+ textAnchor: h,
2636
+ fontSize: A.title,
2637
+ opacity: "0.7",
2638
+ fill: s,
2639
+ children: bt(v[1], g + 4)
2640
+ })] })
2641
+ ]
2642
+ }, e.id);
2643
+ })]
2644
+ }), S && /* @__PURE__ */ l(Tt, {
2645
+ node: S,
2646
+ onClose: () => C(null)
2647
+ })]
2648
+ });
2649
+ }
2650
+ function Dt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped: o = !0, bordered: c = !1, compact: d = !1, style: f, nodeRef: p }) {
2651
+ let { tenant: h, apiUrl: g } = n(V), _ = n(H)?.[i], [v, y] = s(null);
2235
2652
  if (r(() => {
2236
2653
  if (!i || _) return;
2237
2654
  let e = !0, t = i.startsWith("api:") ? `${g}/data/${encodeURIComponent(i.slice(4))}` : `${g}/dynamic/${encodeURIComponent(i)}`;
@@ -2244,22 +2661,22 @@ function gt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
2244
2661
  g,
2245
2662
  _
2246
2663
  ]), !e.length) return null;
2247
- let b = i ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, S = d ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = u ? { border: C } : { borderBottom: C };
2248
- return /* @__PURE__ */ c("div", {
2249
- ref: m,
2664
+ let b = i ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => K(W(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 };
2665
+ return /* @__PURE__ */ l("div", {
2666
+ ref: p,
2250
2667
  style: {
2251
2668
  width: "100%",
2252
2669
  overflowX: "auto",
2253
- ...p(f)
2670
+ ...m(f)
2254
2671
  },
2255
- children: /* @__PURE__ */ l("table", {
2672
+ children: /* @__PURE__ */ u("table", {
2256
2673
  style: {
2257
2674
  width: "100%",
2258
2675
  borderCollapse: "collapse",
2259
2676
  fontSize: 14,
2260
- ...u ? { border: C } : {}
2677
+ ...c ? { border: C } : {}
2261
2678
  },
2262
- children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: e.map((e, t) => /* @__PURE__ */ c("th", {
2679
+ children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ l("tr", { children: e.map((e, t) => /* @__PURE__ */ l("th", {
2263
2680
  style: {
2264
2681
  textAlign: "left",
2265
2682
  fontWeight: 600,
@@ -2268,9 +2685,9 @@ function gt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
2268
2685
  ...w
2269
2686
  },
2270
2687
  children: e.label ?? e
2271
- }, t)) }) }), /* @__PURE__ */ c("tbody", { children: x.map((t, n) => /* @__PURE__ */ c("tr", {
2272
- style: s && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2273
- children: e.map((e, n) => /* @__PURE__ */ c("td", {
2688
+ }, t)) }) }), /* @__PURE__ */ l("tbody", { children: x.map((t, n) => /* @__PURE__ */ l("tr", {
2689
+ style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2690
+ children: e.map((e, n) => /* @__PURE__ */ l("td", {
2274
2691
  style: {
2275
2692
  padding: S,
2276
2693
  ...w
@@ -2281,82 +2698,83 @@ function gt({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
2281
2698
  })
2282
2699
  });
2283
2700
  }
2284
- var _t = {
2285
- PageRoot: fe,
2286
- Section: pe,
2287
- Container: me,
2288
- Heading: he,
2289
- TextBlock: Ee,
2290
- ButtonBlock: ke,
2291
- ImageBlock: Ae,
2292
- Spacer: Ie,
2293
- Divider: Le,
2294
- SliderBlock: Ue,
2295
- CanvasSlider: We,
2296
- TabsBlock: qe,
2297
- QuickStack: dt,
2298
- CollectionList: ft,
2299
- BreadcrumbsBlock: pt,
2300
- PaginationBlock: mt,
2301
- StepperBlock: ht,
2302
- TableBlock: gt,
2303
- AccordionBlock: Je,
2304
- NavbarBlock: Ke,
2305
- ListBlock: Te,
2306
- TextSpan: ve,
2307
- QuoteBlock: we,
2308
- TextLink: Oe,
2309
- RichTextBlock: Se,
2310
- RichContentBlock: Se,
2311
- VideoBlock: je,
2312
- YouTubeBlock: Ne,
2313
- IframeBlock: Pe,
2314
- EmbedBlock: Fe,
2315
- FormBlock: rt,
2316
- FormLabel: it,
2317
- FormInput: at,
2318
- FormTextarea: ot,
2319
- FormCheckbox: (e) => /* @__PURE__ */ c(st, {
2701
+ var Ot = {
2702
+ PageRoot: pe,
2703
+ Section: me,
2704
+ Container: he,
2705
+ Heading: ge,
2706
+ TextBlock: De,
2707
+ ButtonBlock: Ae,
2708
+ ImageBlock: je,
2709
+ Spacer: Le,
2710
+ Divider: Re,
2711
+ SliderBlock: We,
2712
+ CanvasSlider: Ge,
2713
+ TabsBlock: Je,
2714
+ QuickStack: ft,
2715
+ CollectionList: pt,
2716
+ BreadcrumbsBlock: mt,
2717
+ PaginationBlock: ht,
2718
+ StepperBlock: gt,
2719
+ OrgChartBlock: Et,
2720
+ TableBlock: Dt,
2721
+ AccordionBlock: Ye,
2722
+ NavbarBlock: qe,
2723
+ ListBlock: Ee,
2724
+ TextSpan: ye,
2725
+ QuoteBlock: Te,
2726
+ TextLink: ke,
2727
+ RichTextBlock: Ce,
2728
+ RichContentBlock: Ce,
2729
+ VideoBlock: Me,
2730
+ YouTubeBlock: Pe,
2731
+ IframeBlock: Fe,
2732
+ EmbedBlock: Ie,
2733
+ FormBlock: it,
2734
+ FormLabel: at,
2735
+ FormInput: ot,
2736
+ FormTextarea: st,
2737
+ FormCheckbox: (e) => /* @__PURE__ */ l(ct, {
2320
2738
  kind: "checkbox",
2321
2739
  ...e
2322
2740
  }),
2323
- FormRadio: (e) => /* @__PURE__ */ c(st, {
2741
+ FormRadio: (e) => /* @__PURE__ */ l(ct, {
2324
2742
  kind: "radio",
2325
2743
  ...e
2326
2744
  }),
2327
- FormSelect: ct,
2328
- FormFile: lt,
2329
- FormSubmit: ut
2745
+ FormSelect: lt,
2746
+ FormFile: ut,
2747
+ FormSubmit: dt
2330
2748
  };
2331
2749
  //#endregion
2332
2750
  //#region ../ui/src/components/builder/render.jsx
2333
2751
  function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2334
2752
  let o = n[t];
2335
2753
  if (!o || o.hidden) return null;
2336
- let s = o.type?.resolvedName, l = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
2754
+ let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
2337
2755
  if (s === "ComponentInstance") {
2338
2756
  let n = o.props?.componentId, s = r?.[n];
2339
2757
  if (!s?.template || i.has(n)) return null;
2340
- let l = new Set(i).add(n);
2341
- return /* @__PURE__ */ c(e, { children: $(s.template.rootId, s.template.nodes, r, l, a) }, t);
2758
+ let c = new Set(i).add(n);
2759
+ return /* @__PURE__ */ l(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
2342
2760
  }
2343
- let u = _t[s];
2761
+ let u = Ot[s];
2344
2762
  if (!u) return null;
2345
2763
  let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0;
2346
- return /* @__PURE__ */ c(u, {
2347
- ...l,
2764
+ return /* @__PURE__ */ l(u, {
2765
+ ...c,
2348
2766
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
2349
2767
  linked: p,
2350
2768
  nodeRef: (e) => {
2351
- e && (e.setAttribute("data-wb", t), _(e, l));
2769
+ e && (e.setAttribute("data-wb", t), v(e, c));
2352
2770
  },
2353
2771
  children: d.length ? d : void 0
2354
2772
  }, t);
2355
2773
  }
2356
2774
  //#endregion
2357
2775
  //#region ../ui/src/components/builder/PageRenderer.jsx
2358
- var vt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2359
- function yt({ blocks: e, theme: t, components: n, mode: a = "auto", style: o, custom: s, tenant: u, apiUrl: d, datasets: f, locale: p, direction: m }) {
2776
+ var kt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2777
+ function At({ blocks: e, theme: t, components: n, mode: i = "auto", style: o, custom: s, tenant: c, apiUrl: d, datasets: f, locale: p, direction: m }) {
2360
2778
  let h = s?.js?.trim();
2361
2779
  if (r(() => {
2362
2780
  if (!h) return;
@@ -2365,68 +2783,68 @@ function yt({ blocks: e, theme: t, components: n, mode: a = "auto", style: o, cu
2365
2783
  }, [h]), !e?.ROOT) return null;
2366
2784
  let g = {
2367
2785
  lang: p || void 0,
2368
- dir: ie(m, p)
2786
+ dir: oe(m, p)
2369
2787
  }, _ = {
2370
2788
  minHeight: "100%",
2371
2789
  display: "flex",
2372
2790
  flexDirection: "column"
2373
- }, v = $("ROOT", e, n), y = i(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), b = T(e, n), x = w(e, n), S = s?.css?.trim(), C = B(e, n).map((e) => /* @__PURE__ */ c("link", {
2791
+ }, v = $("ROOT", e, n), y = a(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), b = E(e, n), x = T(e, n), S = s?.css?.trim(), C = re(e, n).map((e) => /* @__PURE__ */ l("link", {
2374
2792
  rel: "stylesheet",
2375
2793
  precedence: "default",
2376
- href: te(e)
2794
+ href: ne(e)
2377
2795
  }, e));
2378
- if (a !== "auto") return /* @__PURE__ */ c(H.Provider, {
2796
+ if (i !== "auto") return /* @__PURE__ */ l(V.Provider, {
2379
2797
  value: {
2380
- tenant: u || "",
2798
+ tenant: c || "",
2381
2799
  apiUrl: d || "/api"
2382
2800
  },
2383
- children: /* @__PURE__ */ c(U.Provider, {
2801
+ children: /* @__PURE__ */ l(H.Provider, {
2384
2802
  value: f ?? null,
2385
- children: /* @__PURE__ */ c(W.Provider, {
2803
+ children: /* @__PURE__ */ l(U.Provider, {
2386
2804
  value: y,
2387
- children: /* @__PURE__ */ l("div", {
2805
+ children: /* @__PURE__ */ u("div", {
2388
2806
  ...g,
2389
2807
  style: {
2390
2808
  ..._,
2391
- ...F(t, a),
2809
+ ...I(t, i),
2392
2810
  ...o
2393
2811
  },
2394
2812
  children: [
2395
2813
  C,
2396
- b && /* @__PURE__ */ c("style", { children: b }),
2397
- x && /* @__PURE__ */ c("style", { children: x }),
2398
- S && /* @__PURE__ */ c("style", { children: S }),
2814
+ b && /* @__PURE__ */ l("style", { children: b }),
2815
+ x && /* @__PURE__ */ l("style", { children: x }),
2816
+ S && /* @__PURE__ */ l("style", { children: S }),
2399
2817
  v
2400
2818
  ]
2401
2819
  })
2402
2820
  })
2403
2821
  })
2404
2822
  });
2405
- let E = M(t);
2406
- return /* @__PURE__ */ c(H.Provider, {
2823
+ let w = N(t);
2824
+ return /* @__PURE__ */ l(V.Provider, {
2407
2825
  value: {
2408
- tenant: u || "",
2826
+ tenant: c || "",
2409
2827
  apiUrl: d || "/api"
2410
2828
  },
2411
- children: /* @__PURE__ */ c(U.Provider, {
2829
+ children: /* @__PURE__ */ l(H.Provider, {
2412
2830
  value: f ?? null,
2413
- children: /* @__PURE__ */ c(W.Provider, {
2831
+ children: /* @__PURE__ */ l(U.Provider, {
2414
2832
  value: y,
2415
- children: /* @__PURE__ */ l("div", {
2833
+ children: /* @__PURE__ */ u("div", {
2416
2834
  ...g,
2417
2835
  className: "webim-page",
2418
2836
  style: {
2419
2837
  ..._,
2420
- ...P(t),
2838
+ ...F(t),
2421
2839
  ...o
2422
2840
  },
2423
2841
  children: [
2424
- /* @__PURE__ */ c("style", { children: `.webim-page { ${vt(N(E.light))} }
2425
- @media (prefers-color-scheme: dark) { .webim-page { ${vt(N(E.dark))} } }` }),
2842
+ /* @__PURE__ */ l("style", { children: `.webim-page { ${kt(P(w.light))} }
2843
+ @media (prefers-color-scheme: dark) { .webim-page { ${kt(P(w.dark))} } }` }),
2426
2844
  C,
2427
- b && /* @__PURE__ */ c("style", { children: b }),
2428
- x && /* @__PURE__ */ c("style", { children: x }),
2429
- S && /* @__PURE__ */ c("style", { children: S }),
2845
+ b && /* @__PURE__ */ l("style", { children: b }),
2846
+ x && /* @__PURE__ */ l("style", { children: x }),
2847
+ S && /* @__PURE__ */ l("style", { children: S }),
2430
2848
  v
2431
2849
  ]
2432
2850
  })
@@ -2436,8 +2854,8 @@ function yt({ blocks: e, theme: t, components: n, mode: a = "auto", style: o, cu
2436
2854
  }
2437
2855
  //#endregion
2438
2856
  //#region src/WebimContent.jsx
2439
- function bt({ bundle: e, mode: t = "auto", style: n }) {
2440
- return e?.blocks?.ROOT ? /* @__PURE__ */ c(yt, {
2857
+ function jt({ bundle: e, mode: t = "auto", style: n }) {
2858
+ return e?.blocks?.ROOT ? /* @__PURE__ */ l(At, {
2441
2859
  blocks: e.blocks,
2442
2860
  theme: e.theme,
2443
2861
  components: e.components,
@@ -2453,32 +2871,33 @@ function bt({ bundle: e, mode: t = "auto", style: n }) {
2453
2871
  }
2454
2872
  //#endregion
2455
2873
  //#region src/WebimPage.jsx
2456
- function xt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: s, mode: l = "auto", style: u, fallback: d = null, errorFallback: f = null, onLoad: p, onError: m }) {
2457
- let [h, g] = o({ status: "loading" }), _ = a({
2458
- onLoad: p,
2459
- onError: m
2874
+ function Mt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: a, token: c, mode: u = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
2875
+ let [g, _] = s({ status: "loading" }), v = o({
2876
+ onLoad: m,
2877
+ onError: h
2460
2878
  });
2461
- return _.current = {
2462
- onLoad: p,
2463
- onError: m
2879
+ return v.current = {
2880
+ onLoad: m,
2881
+ onError: h
2464
2882
  }, r(() => {
2465
2883
  let r = !0;
2466
- return g({ status: "loading" }), z({
2884
+ return _({ status: "loading" }), z({
2467
2885
  apiUrl: e,
2468
2886
  tenant: t,
2469
2887
  slug: n,
2470
2888
  locale: i,
2471
- preview: s
2889
+ preview: a,
2890
+ token: c
2472
2891
  }).then((e) => {
2473
- r && (g({
2892
+ r && (_({
2474
2893
  status: "ready",
2475
2894
  bundle: e
2476
- }), _.current.onLoad?.(e));
2895
+ }), v.current.onLoad?.(e));
2477
2896
  }).catch((e) => {
2478
- r && (g({
2897
+ r && (_({
2479
2898
  status: "error",
2480
2899
  error: e
2481
- }), _.current.onError?.(e));
2900
+ }), v.current.onError?.(e));
2482
2901
  }), () => {
2483
2902
  r = !1;
2484
2903
  };
@@ -2487,12 +2906,13 @@ function xt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: s, mode: l = "a
2487
2906
  t,
2488
2907
  n,
2489
2908
  i,
2490
- s
2491
- ]), h.status === "loading" ? d : h.status === "error" ? typeof f == "function" ? f(h.error) : f : /* @__PURE__ */ c(bt, {
2492
- bundle: h.bundle,
2493
- mode: l,
2494
- style: u
2909
+ a,
2910
+ c
2911
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ l(jt, {
2912
+ bundle: g.bundle,
2913
+ mode: u,
2914
+ style: d
2495
2915
  });
2496
2916
  }
2497
2917
  //#endregion
2498
- export { yt as PageRenderer, bt as WebimContent, xt as WebimPage, z as fetchPage, xe as renderRichContent, I as resolveTheme };
2918
+ export { At as PageRenderer, jt as WebimContent, Mt as WebimPage, z as fetchPage, Se as renderRichContent, L as resolveTheme };