webim-adapter 0.22.0 → 0.24.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,198 @@
1
1
  import { Fragment as e, createContext as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
2
2
  import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
3
+ var f = new Map([
4
+ {
5
+ family: "Bebas Neue",
6
+ fallback: "sans-serif",
7
+ weights: "400"
8
+ },
9
+ {
10
+ family: "Crimson Text",
11
+ fallback: "serif",
12
+ weights: "400;600;700"
13
+ },
14
+ {
15
+ family: "DM Sans",
16
+ fallback: "sans-serif",
17
+ weights: "100..1000"
18
+ },
19
+ {
20
+ family: "Fira Sans",
21
+ fallback: "sans-serif",
22
+ weights: "100;200;300;400;500;600;700;800;900"
23
+ },
24
+ {
25
+ family: "Inter",
26
+ fallback: "sans-serif",
27
+ weights: "100..900"
28
+ },
29
+ {
30
+ family: "JetBrains Mono",
31
+ fallback: "monospace",
32
+ weights: "100..800"
33
+ },
34
+ {
35
+ family: "Josefin Sans",
36
+ fallback: "sans-serif",
37
+ weights: "100..700"
38
+ },
39
+ {
40
+ family: "Karla",
41
+ fallback: "sans-serif",
42
+ weights: "200..800"
43
+ },
44
+ {
45
+ family: "Lato",
46
+ fallback: "sans-serif",
47
+ weights: "100;300;400;700;900"
48
+ },
49
+ {
50
+ family: "Lora",
51
+ fallback: "serif",
52
+ weights: "400..700"
53
+ },
54
+ {
55
+ family: "Manrope",
56
+ fallback: "sans-serif",
57
+ weights: "200..800"
58
+ },
59
+ {
60
+ family: "Merriweather",
61
+ fallback: "serif",
62
+ weights: "300..900"
63
+ },
64
+ {
65
+ family: "Montserrat",
66
+ fallback: "sans-serif",
67
+ weights: "100..900"
68
+ },
69
+ {
70
+ family: "Nunito",
71
+ fallback: "sans-serif",
72
+ weights: "200..1000"
73
+ },
74
+ {
75
+ family: "Open Sans",
76
+ fallback: "sans-serif",
77
+ weights: "300..800"
78
+ },
79
+ {
80
+ family: "Oswald",
81
+ fallback: "sans-serif",
82
+ weights: "200..700"
83
+ },
84
+ {
85
+ family: "Outfit",
86
+ fallback: "sans-serif",
87
+ weights: "100..900"
88
+ },
89
+ {
90
+ family: "Playfair Display",
91
+ fallback: "serif",
92
+ weights: "400..900"
93
+ },
94
+ {
95
+ family: "Poppins",
96
+ fallback: "sans-serif",
97
+ weights: "100;200;300;400;500;600;700;800;900"
98
+ },
99
+ {
100
+ family: "Quicksand",
101
+ fallback: "sans-serif",
102
+ weights: "300..700"
103
+ },
104
+ {
105
+ family: "Raleway",
106
+ fallback: "sans-serif",
107
+ weights: "100..900"
108
+ },
109
+ {
110
+ family: "Roboto",
111
+ fallback: "sans-serif",
112
+ weights: "100..900"
113
+ },
114
+ {
115
+ family: "Rubik",
116
+ fallback: "sans-serif",
117
+ weights: "300..900"
118
+ },
119
+ {
120
+ family: "Source Sans 3",
121
+ fallback: "sans-serif",
122
+ weights: "200..900"
123
+ },
124
+ {
125
+ family: "Space Grotesk",
126
+ fallback: "sans-serif",
127
+ weights: "300..700"
128
+ },
129
+ {
130
+ family: "Work Sans",
131
+ fallback: "sans-serif",
132
+ weights: "100..900"
133
+ }
134
+ ].map((e) => [e.family, e])), p = (e) => `"${e.family}", ${e.fallback}`, m = (e) => {
135
+ let t = f.get(e)?.weights;
136
+ return `family=${e.replace(/ /g, "+")}${t ? `:wght@${t}` : ""}`;
137
+ };
138
+ function h(e) {
139
+ return e.length ? `https://fonts.googleapis.com/css2?${e.map(m).join("&")}&display=swap` : null;
140
+ }
141
+ var g = (e) => h([e]), _ = (e) => {
142
+ let t = typeof e == "string" && e.match(/^"([^"]+)"/);
143
+ return t ? t[1] : null;
144
+ }, v = (e) => {
145
+ let t = f.get(e);
146
+ return t ? p(t) : null;
147
+ };
148
+ function y(e, t) {
149
+ let n = /* @__PURE__ */ new Set(), r = (e) => {
150
+ for (let t of Object.values(e || {})) for (let e of [
151
+ "style",
152
+ "hover",
153
+ "pressed",
154
+ "focused"
155
+ ]) {
156
+ let r = _(t.props?.[e]?.fontFamily);
157
+ r && n.add(r);
158
+ }
159
+ };
160
+ r(e);
161
+ for (let e of Object.values(t || {})) r(e.template?.nodes);
162
+ return [...n].sort();
163
+ }
164
+ //#endregion
3
165
  //#region ../ui/src/components/builder/styles.js
4
- var f = /* @__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(".")), p = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, m = [
166
+ var b = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), x = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, S = [
5
167
  "borderWidth",
6
168
  "borderStyle",
7
169
  "borderColor",
8
170
  "borderRadius",
9
171
  "gap"
10
172
  ];
11
- function h(e) {
173
+ function C(e) {
12
174
  let t = {};
13
- for (let n of m) {
175
+ for (let n of S) {
14
176
  let r = e?.[n];
15
- r != null && r !== "" && (t[n] = f.has(n) ? p(r) : r);
177
+ r != null && r !== "" && (t[n] = b.has(n) ? x(r) : r);
16
178
  }
17
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || m.includes(n) || (t[n] = f.has(n) ? p(r) : r);
179
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || S.includes(n) || (t[n] = b.has(n) ? x(r) : r);
18
180
  let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
19
181
  delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
20
182
  let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
21
183
  delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
22
- let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${p(e.x ?? 0)} ${p(e.y ?? 0)} ${p(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
184
+ let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${x(e.x ?? 0)} ${x(e.y ?? 0)} ${x(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
23
185
  [
24
186
  s,
25
187
  c,
26
188
  l,
27
189
  u
28
- ].some((e) => e !== void 0) && d.push(`${p(s ?? 0)} ${p(c ?? 0)} ${p(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
29
- let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${p(e.x ?? 0)}, ${p(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;
190
+ ].some((e) => e !== void 0) && d.push(`${x(s ?? 0)} ${x(c ?? 0)} ${x(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
191
+ let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${x(e.x ?? 0)}, ${x(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${f(e.a ?? 0)})` : e.type === "skew" ? `skew(${f(e.x ?? 0)}, ${f(e.y ?? 0)})` : null, { transforms: m, translateX: h, translateY: g, scale: _, rotate: v, skewX: y, skewY: C } = t;
30
192
  delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
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(${p(v ?? 0)}, ${p(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 " : ""}${p(e.x ?? 0)} ${p(e.y ?? 0)} ${p(e.blur ?? 0)} ${p(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;
193
+ let w = (Array.isArray(m) ? m : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
194
+ (h !== void 0 || g !== void 0) && w.push(`translate(${x(h ?? 0)}, ${x(g ?? 0)})`), _ !== void 0 && w.push(`scale(${_})`), v !== void 0 && w.push(`rotate(${f(v)})`), (y !== void 0 || C !== void 0) && w.push(`skew(${f(y ?? 0)}, ${f(C ?? 0)})`), w.length && (t.transform = w.join(" "));
195
+ let T = (e) => `${e.inset ? "inset " : ""}${x(e.x ?? 0)} ${x(e.y ?? 0)} ${x(e.blur ?? 0)} ${x(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: E, boxShadowX: D, boxShadowY: O, boxShadowBlur: k, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
34
196
  delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
35
197
  let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
36
198
  [
@@ -48,76 +210,76 @@ function h(e) {
48
210
  color: j,
49
211
  inset: M
50
212
  })), N.length && (t.boxShadow = N.join(", "));
51
- let P = (e) => e.type === "blur" ? `blur(${p(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: ee, filterBlur: L, filterGrayscale: te, filterBrightness: R, filterContrast: ne, filterSaturate: re } = t;
213
+ let P = (e) => e.type === "blur" ? `blur(${x(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: ee, filterContrast: te, filterSaturate: B } = t;
52
214
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
53
- let z = F(I);
54
- L !== void 0 && z.push(`blur(${p(L)})`), te !== void 0 && z.push(`grayscale(${te}%)`), R !== void 0 && z.push(`brightness(${R}%)`), ne !== void 0 && z.push(`contrast(${ne}%)`), re !== void 0 && z.push(`saturate(${re}%)`), z.length && (t.filter = z.join(" "));
55
- let ie = F(ee);
56
- ie.length && (t.backdropFilter = ie.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
- let { textStrokeWidth: ae, textStrokeColor: oe } = t;
58
- delete t.textStrokeWidth, delete t.textStrokeColor, (ae !== void 0 || oe !== void 0) && (t.WebkitTextStroke = `${p(ae ?? 1)} ${oe || "currentColor"}`);
59
- let { clipText: se } = t;
60
- delete t.clipText, se && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
- let { transitions: ce, transitionDuration: B, transitionEasing: V, transitionProperty: le } = t, ue = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
215
+ let V = F(I);
216
+ R !== void 0 && V.push(`blur(${x(R)})`), z !== void 0 && V.push(`grayscale(${z}%)`), ee !== void 0 && V.push(`brightness(${ee}%)`), te !== void 0 && V.push(`contrast(${te}%)`), B !== void 0 && V.push(`saturate(${B}%)`), V.length && (t.filter = V.join(" "));
217
+ let ne = F(L);
218
+ ne.length && (t.backdropFilter = ne.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
219
+ let { textStrokeWidth: re, textStrokeColor: ie } = t;
220
+ delete t.textStrokeWidth, delete t.textStrokeColor, (re !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${x(re ?? 1)} ${ie || "currentColor"}`);
221
+ let { clipText: ae } = t;
222
+ delete t.clipText, ae && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
223
+ let { transitions: oe, transitionDuration: se, transitionEasing: ce, transitionProperty: le } = t, ue = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
62
224
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
63
- let de = (Array.isArray(ce) ? ce : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ue(e.duration ?? 200)} ${e.easing || "ease"}`);
64
- if (B !== void 0 && de.push(`${le || "all"} ${ue(B)} ${V || "ease"}`), de.length && (t.transition = de.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
225
+ let H = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ue(e.duration ?? 200)} ${e.easing || "ease"}`);
226
+ if (se !== void 0 && H.push(`${le || "all"} ${ue(se)} ${ce || "ease"}`), H.length && (t.transition = H.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
227
  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
228
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
67
229
  }
68
230
  delete t.backgroundVideo;
69
- let { overlayColor: H, overlayOpacity: fe } = t;
70
- if (delete t.overlayColor, delete t.overlayOpacity, H) {
71
- let e = `color-mix(in srgb, ${H} ${fe ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
231
+ let { overlayColor: U, overlayOpacity: de } = t;
232
+ if (delete t.overlayColor, delete t.overlayOpacity, U) {
233
+ let e = `color-mix(in srgb, ${U} ${de ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
72
234
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
73
235
  }
74
236
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
75
- let { backgroundLayers: U } = t;
237
+ let { backgroundLayers: fe } = t;
76
238
  delete t.backgroundLayers;
77
- let pe = (Array.isArray(U) ? U : []).filter((e) => e && e.on !== !1);
239
+ let pe = (Array.isArray(fe) ? fe : []).filter((e) => e && e.on !== !1);
78
240
  if (pe.length) {
79
241
  let e = [], n = [], r = [], i = [], a = [];
80
242
  for (let t of pe) 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
243
  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
244
  else {
83
245
  if (!t.src) continue;
84
- e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${p(t.w ?? "auto")} ${p(t.h ?? "auto")}` : t.size || "cover"), r.push(`${p(t.posX ?? 0)} ${p(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
246
+ e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${x(t.w ?? "auto")} ${x(t.h ?? "auto")}` : t.size || "cover"), r.push(`${x(t.posX ?? 0)} ${x(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
85
247
  }
86
248
  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
249
  }
88
250
  return t;
89
251
  }
90
- var g = {
252
+ var w = {
91
253
  hover: ":hover",
92
254
  pressed: ":active",
93
255
  focused: ":focus"
94
- }, _ = /* @__PURE__ */ new Set([
256
+ }, T = /* @__PURE__ */ new Set([
95
257
  "style",
96
258
  "class",
97
259
  "id",
98
260
  "data-wb",
99
261
  "data-wb-class",
100
262
  "data-slot"
101
- ]), v = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !_.has(e.toLowerCase());
102
- function y(e, t, n = []) {
263
+ ]), E = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !T.has(e.toLowerCase());
264
+ function D(e, t, n = []) {
103
265
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
104
266
  for (let t of n) e.removeAttribute(t);
105
267
  let r = [];
106
268
  for (let n of t.attributes ?? []) {
107
269
  let t = String(n?.name ?? "").trim();
108
- v(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
270
+ E(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
109
271
  }
110
272
  return r;
111
273
  }
112
- var b = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
113
- function x(e, t, n, r = !1) {
114
- let i = Object.entries(h(t)).map(([e, t]) => `${b(e)}: ${t} !important;`).join(" ");
274
+ var O = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
275
+ function k(e, t, n, r = !1) {
276
+ let i = Object.entries(C(t)).map(([e, t]) => `${O(e)}: ${t} !important;`).join(" ");
115
277
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
116
278
  }
117
- function S(e, t, n) {
118
- return Object.entries(g).map(([r, i]) => x(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
279
+ function A(e, t, n) {
280
+ return Object.entries(w).map(([r, i]) => k(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
119
281
  }
120
- var C = [
282
+ var j = [
121
283
  {
122
284
  key: "tablet",
123
285
  max: 991
@@ -130,17 +292,17 @@ var C = [
130
292
  key: "mobile",
131
293
  max: 478
132
294
  }
133
- ], w = (e) => Object.entries(h(e)).map(([e, t]) => `${b(e)}: ${t} !important;`).join(" ");
134
- function T(e, t) {
135
- return C.map(({ key: n, max: r }) => {
136
- let i = t?.[n] ? w(t[n]) : "";
295
+ ], M = (e) => Object.entries(C(e)).map(([e, t]) => `${O(e)}: ${t} !important;`).join(" ");
296
+ function N(e, t) {
297
+ return j.map(({ key: n, max: r }) => {
298
+ let i = t?.[n] ? M(t[n]) : "";
137
299
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
138
300
  }).filter(Boolean).join("\n");
139
301
  }
140
- function E(e, t) {
302
+ function P(e, t) {
141
303
  let n = [], r = (e) => {
142
304
  for (let [t, r] of Object.entries(e || {})) {
143
- let e = T(t, r.props);
305
+ let e = N(t, r.props);
144
306
  e && n.push(e);
145
307
  }
146
308
  };
@@ -148,10 +310,10 @@ function E(e, t) {
148
310
  for (let e of Object.values(t || {})) r(e.template?.nodes);
149
311
  return n.join("\n");
150
312
  }
151
- function D(e, t) {
313
+ function F(e, t) {
152
314
  let n = [], r = (e) => {
153
315
  for (let [t, r] of Object.entries(e || {})) {
154
- let e = S(t, r.props);
316
+ let e = A(t, r.props);
155
317
  e && n.push(e);
156
318
  }
157
319
  };
@@ -159,7 +321,7 @@ function D(e, t) {
159
321
  for (let e of Object.values(t || {})) r(e.template?.nodes);
160
322
  return n.join("\n");
161
323
  }
162
- var O = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", k = {
324
+ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", L = {
163
325
  light: {
164
326
  background: "#ffffff",
165
327
  text: "#111827",
@@ -196,23 +358,23 @@ var O = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
196
358
  contrastText: "#052e2b"
197
359
  }
198
360
  }
199
- }, A = {
361
+ }, R = {
200
362
  font: "system",
201
363
  headingFont: "inherit",
202
- light: k.light,
203
- dark: k.dark
204
- }, j = {
364
+ light: L.light,
365
+ dark: L.dark
366
+ }, z = {
205
367
  system: {
206
368
  label: "System",
207
- value: O
369
+ value: I
208
370
  },
209
371
  inter: {
210
372
  label: "Inter",
211
- value: `"Inter", ${O}`
373
+ value: `"Inter", ${I}`
212
374
  },
213
375
  outfit: {
214
376
  label: "Outfit",
215
- value: `"Outfit", ${O}`
377
+ value: `"Outfit", ${I}`
216
378
  },
217
379
  serif: {
218
380
  label: "Serif",
@@ -222,7 +384,7 @@ var O = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
222
384
  label: "Mono",
223
385
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
224
386
  }
225
- }, M = (e, t) => j[e]?.value ?? t, N = (e, ...t) => {
387
+ }, ee = (e, t) => z[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), te = (e, ...t) => {
226
388
  let n = Object.assign({}, e, ...t);
227
389
  return n.primary = {
228
390
  ...e.primary,
@@ -238,16 +400,16 @@ var O = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
238
400
  }), {})
239
401
  }, n;
240
402
  };
241
- function P(e) {
403
+ function B(e) {
242
404
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
243
405
  return {
244
- font: r ?? A.font,
245
- headingFont: i ?? A.headingFont,
246
- light: N(k.light, a, t),
247
- dark: N(k.dark, n)
406
+ font: r ?? R.font,
407
+ headingFont: i ?? R.headingFont,
408
+ light: te(L.light, a, t),
409
+ dark: te(L.dark, n)
248
410
  };
249
411
  }
250
- function F(e) {
412
+ function V(e) {
251
413
  return {
252
414
  "--page-bg": e.background,
253
415
  "--page-text": e.text,
@@ -263,28 +425,28 @@ function F(e) {
263
425
  "--page-secondary-contrast": e.secondary.contrastText
264
426
  };
265
427
  }
266
- function I(e) {
267
- let t = P(e);
428
+ function ne(e) {
429
+ let t = B(e);
268
430
  return {
269
431
  backgroundColor: "var(--page-bg)",
270
432
  color: "var(--page-text)",
271
- fontFamily: M(t.font, O),
272
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : M(t.headingFont, "inherit")
433
+ fontFamily: ee(t.font, I),
434
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : ee(t.headingFont, "inherit")
273
435
  };
274
436
  }
275
- function ee(e, t = "light") {
276
- let n = P(e);
437
+ function re(e, t = "light") {
438
+ let n = B(e);
277
439
  return {
278
- ...I(e),
279
- ...F(n[t] ?? n.light)
440
+ ...ne(e),
441
+ ...V(n[t] ?? n.light)
280
442
  };
281
443
  }
282
- function L(e, t) {
444
+ function ie(e, t) {
283
445
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
284
446
  }
285
447
  //#endregion
286
448
  //#region src/bundle.js
287
- function te({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
449
+ function ae({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
288
450
  let a = {
289
451
  ...t?.global ?? {},
290
452
  ...t?.tenant ?? {}
@@ -294,7 +456,7 @@ function te({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
294
456
  title: e.title,
295
457
  slug: e.slug,
296
458
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
297
- theme: L(o, a.builder_themes?.themes),
459
+ theme: ie(o, a.builder_themes?.themes),
298
460
  components: a.builder_components?.components ?? {},
299
461
  custom: o.custom,
300
462
  seo: o.seo,
@@ -308,18 +470,18 @@ function te({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
308
470
  }
309
471
  //#endregion
310
472
  //#region src/fetchPage.js
311
- var R = async (e) => {
473
+ var oe = async (e) => {
312
474
  let t = await e.json().catch(() => null);
313
475
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
314
476
  return t?.payload ?? t;
315
477
  };
316
- async function ne({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
478
+ async function se({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
317
479
  if (!e) throw Error("fetchPage: apiUrl is required");
318
480
  if (!n) throw Error("fetchPage: slug is required");
319
481
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
320
482
  ...t ? { "x-tenant": t } : {},
321
483
  ...a ? { authorization: `Bearer ${a}` } : {}
322
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(R), c(`${l}/settings/public`, { headers: u }).then(R)]), p = te({
484
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(oe), c(`${l}/settings/public`, { headers: u }).then(oe)]), p = ae({
323
485
  page: d,
324
486
  settings: f,
325
487
  tenant: t,
@@ -327,7 +489,7 @@ async function ne({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
327
489
  locale: r
328
490
  }), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
329
491
  if (m.length) {
330
- let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(R).then((e) => {
492
+ let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(oe).then((e) => {
331
493
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
332
494
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
333
495
  }).catch(() => [[t, []]])));
@@ -339,138 +501,9 @@ async function ne({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
339
501
  __page: Math.floor(h)
340
502
  }), p;
341
503
  }
342
- new Map([
343
- {
344
- family: "Bebas Neue",
345
- fallback: "sans-serif"
346
- },
347
- {
348
- family: "Crimson Text",
349
- fallback: "serif"
350
- },
351
- {
352
- family: "DM Sans",
353
- fallback: "sans-serif"
354
- },
355
- {
356
- family: "Fira Sans",
357
- fallback: "sans-serif"
358
- },
359
- {
360
- family: "Inter",
361
- fallback: "sans-serif"
362
- },
363
- {
364
- family: "JetBrains Mono",
365
- fallback: "monospace"
366
- },
367
- {
368
- family: "Josefin Sans",
369
- fallback: "sans-serif"
370
- },
371
- {
372
- family: "Karla",
373
- fallback: "sans-serif"
374
- },
375
- {
376
- family: "Lato",
377
- fallback: "sans-serif"
378
- },
379
- {
380
- family: "Lora",
381
- fallback: "serif"
382
- },
383
- {
384
- family: "Manrope",
385
- fallback: "sans-serif"
386
- },
387
- {
388
- family: "Merriweather",
389
- fallback: "serif"
390
- },
391
- {
392
- family: "Montserrat",
393
- fallback: "sans-serif"
394
- },
395
- {
396
- family: "Nunito",
397
- fallback: "sans-serif"
398
- },
399
- {
400
- family: "Open Sans",
401
- fallback: "sans-serif"
402
- },
403
- {
404
- family: "Oswald",
405
- fallback: "sans-serif"
406
- },
407
- {
408
- family: "Outfit",
409
- fallback: "sans-serif"
410
- },
411
- {
412
- family: "Playfair Display",
413
- fallback: "serif"
414
- },
415
- {
416
- family: "Poppins",
417
- fallback: "sans-serif"
418
- },
419
- {
420
- family: "Quicksand",
421
- fallback: "sans-serif"
422
- },
423
- {
424
- family: "Raleway",
425
- fallback: "sans-serif"
426
- },
427
- {
428
- family: "Roboto",
429
- fallback: "sans-serif"
430
- },
431
- {
432
- family: "Rubik",
433
- fallback: "sans-serif"
434
- },
435
- {
436
- family: "Source Sans 3",
437
- fallback: "sans-serif"
438
- },
439
- {
440
- family: "Space Grotesk",
441
- fallback: "sans-serif"
442
- },
443
- {
444
- family: "Work Sans",
445
- fallback: "sans-serif"
446
- }
447
- ].map((e) => [e.family, e]));
448
- function re(e) {
449
- return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
450
- }
451
- var z = (e) => re([e]), ie = (e) => {
452
- let t = typeof e == "string" && e.match(/^"([^"]+)"/);
453
- return t ? t[1] : null;
454
- };
455
- function ae(e, t) {
456
- let n = /* @__PURE__ */ new Set(), r = (e) => {
457
- for (let t of Object.values(e || {})) for (let e of [
458
- "style",
459
- "hover",
460
- "pressed",
461
- "focused"
462
- ]) {
463
- let r = ie(t.props?.[e]?.fontFamily);
464
- r && n.add(r);
465
- }
466
- };
467
- r(e);
468
- for (let e of Object.values(t || {})) r(e.template?.nodes);
469
- return [...n].sort();
470
- }
471
504
  //#endregion
472
505
  //#region ../ui/src/components/builder/locale.js
473
- var oe = /* @__PURE__ */ new Set([
506
+ var ce = /* @__PURE__ */ new Set([
474
507
  "ar",
475
508
  "he",
476
509
  "fa",
@@ -481,34 +514,34 @@ var oe = /* @__PURE__ */ new Set([
481
514
  "yi",
482
515
  "dv",
483
516
  "ckb"
484
- ]), se = (e) => oe.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", ce = (e, t) => e === "ltr" || e === "rtl" ? e : t ? se(t) : void 0, B = t({
517
+ ]), le = (e) => ce.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", ue = (e, t) => e === "ltr" || e === "rtl" ? e : t ? le(t) : void 0, H = t({
485
518
  tenant: "",
486
519
  apiUrl: "/api",
487
520
  locale: "",
488
521
  settings: null
489
- }), V = t(null), le = (e) => {
522
+ }), U = t(null), de = (e) => {
490
523
  let t = Number(e?.__page);
491
524
  if (Number.isFinite(t) && t >= 1) return Math.floor(t);
492
525
  if (typeof window > "u") return 1;
493
526
  let n = Number(new URLSearchParams(window.location.search).get("page"));
494
527
  return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
495
- }, ue = () => {
528
+ }, fe = () => {
496
529
  if (typeof window > "u") return {};
497
530
  let e = {};
498
531
  return new URLSearchParams(window.location.search).forEach((t, n) => {
499
532
  n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
500
533
  }), e;
501
- }, de = (e) => {
534
+ }, pe = (e) => {
502
535
  let t = {
503
536
  ...e && typeof e == "object" && !Array.isArray(e) ? e : {},
504
- ...ue()
537
+ ...fe()
505
538
  };
506
539
  return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
507
- }, H = t(null), fe = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
508
- function U(e, t) {
540
+ }, me = t(null), he = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
541
+ function W(e, t) {
509
542
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
510
543
  }
511
- var pe = (e) => {
544
+ var ge = (e) => {
512
545
  let t = [];
513
546
  for (let [n, r] of Object.entries(e ?? {})) {
514
547
  if (!/^[\w-]+$/.test(n)) continue;
@@ -518,36 +551,36 @@ var pe = (e) => {
518
551
  }
519
552
  return t;
520
553
  };
521
- function W(e) {
554
+ function G(e) {
522
555
  return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
523
556
  }
524
- function me(e, t) {
525
- let n = t?.data ?? {}, r = pe(n);
557
+ function _e(e, t) {
558
+ let n = t?.data ?? {}, r = ge(n);
526
559
  if (!r.length) return e;
527
- let i = RegExp(`:(${r.map(fe).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => W(U(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
560
+ let i = RegExp(`:(${r.map(he).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => G(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;
528
561
  return a(e);
529
562
  }
530
- var he = {
563
+ var ve = {
531
564
  margin: 0,
532
565
  fontWeight: 700,
533
566
  lineHeight: 1.2,
534
567
  fontFamily: "var(--page-heading-font, inherit)"
535
- }, ge = { margin: 0 }, G = {
568
+ }, ye = { margin: 0 }, K = {
536
569
  display: "inline-block",
537
570
  textDecoration: "none",
538
571
  cursor: "pointer",
539
572
  backgroundColor: "var(--page-accent, #111827)",
540
573
  color: "var(--page-accent-text, #ffffff)"
541
- }, _e = {
574
+ }, be = {
542
575
  flexGrow: 1,
543
576
  display: "flex",
544
577
  flexDirection: "column",
545
578
  position: "relative"
546
- }, ve = {
579
+ }, xe = {
547
580
  display: "flex",
548
581
  flexDirection: "column"
549
582
  };
550
- function ye({ style: e }) {
583
+ function Se({ style: e }) {
551
584
  let t = e?.backgroundVideo;
552
585
  if (!t) return null;
553
586
  let n = {
@@ -573,32 +606,32 @@ function ye({ style: e }) {
573
606
  background: r
574
607
  } })] });
575
608
  }
576
- var be = (e, t) => e?.backgroundVideo ? {
609
+ var Ce = (e, t) => e?.backgroundVideo ? {
577
610
  position: "relative",
578
611
  ...t,
579
- ...h(e)
612
+ ...C(e)
580
613
  } : {
581
614
  ...t,
582
- ...h(e)
615
+ ...C(e)
583
616
  };
584
- function xe({ style: e, nodeRef: t, children: n }) {
617
+ function we({ style: e, nodeRef: t, children: n }) {
585
618
  return /* @__PURE__ */ d("div", {
586
619
  ref: t,
587
620
  style: {
588
- ..._e,
589
- ...h(e)
621
+ ...be,
622
+ ...C(e)
590
623
  },
591
- children: [/* @__PURE__ */ u(ye, { style: e }), n]
624
+ children: [/* @__PURE__ */ u(Se, { style: e }), n]
592
625
  });
593
626
  }
594
- function Se({ style: e, nodeRef: t, children: n }) {
627
+ function Te({ style: e, nodeRef: t, children: n }) {
595
628
  return /* @__PURE__ */ d("section", {
596
629
  ref: t,
597
- style: be(e, ve),
598
- children: [/* @__PURE__ */ u(ye, { style: e }), n]
630
+ style: Ce(e, xe),
631
+ children: [/* @__PURE__ */ u(Se, { style: e }), n]
599
632
  });
600
633
  }
601
- function Ce({ style: e, freeLayout: t, nodeRef: n, children: r }) {
634
+ function Ee({ style: e, freeLayout: t, nodeRef: n, children: r }) {
602
635
  let i = t ? {
603
636
  position: "relative",
604
637
  minHeight: 240
@@ -607,32 +640,32 @@ function Ce({ style: e, freeLayout: t, nodeRef: n, children: r }) {
607
640
  ref: n,
608
641
  style: i ? {
609
642
  ...i,
610
- ...be(e)
611
- } : be(e),
612
- children: [/* @__PURE__ */ u(ye, { style: e }), r]
643
+ ...Ce(e)
644
+ } : Ce(e),
645
+ children: [/* @__PURE__ */ u(Se, { style: e }), r]
613
646
  });
614
647
  }
615
- function we({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
648
+ function De({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
616
649
  return /* @__PURE__ */ u(n, {
617
650
  ref: a,
618
651
  style: {
619
- ...he,
620
- ...h(r)
652
+ ...ve,
653
+ ...C(r)
621
654
  },
622
- children: K(t, e, i)
655
+ children: q(t, e, i)
623
656
  });
624
657
  }
625
- var Te = {
626
- fontFamily: j.mono.value,
658
+ var Oe = {
659
+ fontFamily: z.mono.value,
627
660
  background: "rgba(148, 163, 184, 0.18)",
628
661
  padding: "1px 5px",
629
662
  borderRadius: 4,
630
663
  fontSize: "0.9em"
631
664
  };
632
- function Ee(e, t = [], n, r) {
665
+ function ke(e, t = [], n, r) {
633
666
  let i = e;
634
667
  return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
635
- style: Te,
668
+ style: Oe,
636
669
  children: i
637
670
  })), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n && (i = /* @__PURE__ */ u("a", {
638
671
  href: n,
@@ -642,13 +675,13 @@ function Ee(e, t = [], n, r) {
642
675
  children: i
643
676
  })), i;
644
677
  }
645
- function K(t, n, r) {
678
+ function q(t, n, r) {
646
679
  return t?.length ? t.map((t, n) => {
647
680
  if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
648
- if (t.parts) return /* @__PURE__ */ u(e, { children: K(t.parts, "", r) }, n);
681
+ if (t.parts) return /* @__PURE__ */ u(e, { children: q(t.parts, "", r) }, n);
649
682
  let i = t.text;
650
683
  return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
651
- style: Te,
684
+ style: Oe,
652
685
  children: i
653
686
  })), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
654
687
  style: {
@@ -665,13 +698,13 @@ function K(t, n, r) {
665
698
  })), /* @__PURE__ */ u(e, { children: i }, n);
666
699
  }) : n;
667
700
  }
668
- function De({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
701
+ function Ae({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
669
702
  return /* @__PURE__ */ u("span", {
670
- style: h(a),
671
- children: e?.length ? K(e, t) : Ee(t, n, r, i)
703
+ style: C(a),
704
+ children: e?.length ? q(e, t) : ke(t, n, r, i)
672
705
  });
673
706
  }
674
- var Oe = {
707
+ var je = {
675
708
  h1: 40,
676
709
  h2: 32,
677
710
  h3: 26,
@@ -679,7 +712,7 @@ var Oe = {
679
712
  h5: 19,
680
713
  h6: 16
681
714
  };
682
- function ke({ align: e = "center", width: t, wrap: n } = {}) {
715
+ function Me({ align: e = "center", width: t, wrap: n } = {}) {
683
716
  let r = t ? `${t}%` : void 0;
684
717
  if (e === "full") return { width: "100%" };
685
718
  let i = e === "left" || e === "right";
@@ -713,8 +746,8 @@ function ke({ align: e = "center", width: t, wrap: n } = {}) {
713
746
  marginRight: "auto"
714
747
  };
715
748
  }
716
- function Ae(e = [], t, n) {
717
- let r = n ?? ((e, n) => K(e, n, t));
749
+ function Ne(e = [], t, n) {
750
+ let r = n ?? ((e, n) => q(e, n, t));
718
751
  return e.map((t, n) => {
719
752
  let i = {
720
753
  marginTop: 0,
@@ -736,7 +769,7 @@ function Ae(e = [], t, n) {
736
769
  marginLeft: 0,
737
770
  marginRight: 0,
738
771
  ...i,
739
- ...ke(t)
772
+ ...Me(t)
740
773
  },
741
774
  children: [t.href ? /* @__PURE__ */ u("a", {
742
775
  href: t.href,
@@ -755,16 +788,16 @@ function Ae(e = [], t, n) {
755
788
  })]
756
789
  }, n);
757
790
  }
758
- if (t.type === "video") return Ve(t.url) ? /* @__PURE__ */ u("div", {
791
+ if (t.type === "video") return We(t.url) ? /* @__PURE__ */ u("div", {
759
792
  style: {
760
793
  ...i,
761
- ...ke({
794
+ ...Me({
762
795
  align: t.align,
763
796
  wrap: t.wrap,
764
797
  width: t.width ?? 100
765
798
  })
766
799
  },
767
- children: /* @__PURE__ */ u(He, {
800
+ children: /* @__PURE__ */ u(Ge, {
768
801
  url: t.url,
769
802
  autoplay: t.autoplay,
770
803
  muted: t.muted,
@@ -826,17 +859,17 @@ function Ae(e = [], t, n) {
826
859
  }
827
860
  if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
828
861
  style: {
829
- ...Me,
862
+ ...Fe,
830
863
  ...i
831
864
  },
832
865
  children: r(t.parts, t.text)
833
866
  }, n);
834
- if (Oe[t.type]) {
867
+ if (je[t.type]) {
835
868
  let e = t.type;
836
869
  return /* @__PURE__ */ u(e, {
837
870
  style: {
838
- ...he,
839
- fontSize: Oe[t.type],
871
+ ...ve,
872
+ fontSize: je[t.type],
840
873
  ...i
841
874
  },
842
875
  children: r(t.parts, t.text)
@@ -844,95 +877,95 @@ function Ae(e = [], t, n) {
844
877
  }
845
878
  return /* @__PURE__ */ u("p", {
846
879
  style: {
847
- ...ge,
880
+ ...ye,
848
881
  ...i
849
882
  },
850
883
  children: r(t.parts, t.text)
851
884
  }, n);
852
885
  });
853
886
  }
854
- function je({ content: e, style: t, linked: n, nodeRef: r }) {
887
+ function Pe({ content: e, style: t, linked: n, nodeRef: r }) {
855
888
  return /* @__PURE__ */ u("div", {
856
889
  ref: r,
857
890
  style: {
858
891
  display: "flow-root",
859
- ...h(t)
892
+ ...C(t)
860
893
  },
861
- children: Ae(e, n)
894
+ children: Ne(e, n)
862
895
  });
863
896
  }
864
- var Me = {
897
+ var Fe = {
865
898
  margin: 0,
866
899
  padding: "8px 0 8px 20px",
867
900
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
868
901
  };
869
- function Ne({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
902
+ function Ie({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
870
903
  return /* @__PURE__ */ u("blockquote", {
871
904
  ref: i,
872
905
  style: {
873
- ...Me,
874
- ...h(n)
906
+ ...Fe,
907
+ ...C(n)
875
908
  },
876
- children: K(t, e, r)
909
+ children: q(t, e, r)
877
910
  });
878
911
  }
879
- function Pe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
912
+ function Le({ ordered: e, items: t = [], style: n, nodeRef: r }) {
880
913
  return /* @__PURE__ */ u(e ? "ol" : "ul", {
881
914
  ref: r,
882
915
  style: {
883
916
  margin: 0,
884
917
  paddingLeft: 24,
885
- ...h(n)
918
+ ...C(n)
886
919
  },
887
920
  children: t.map((e, t) => /* @__PURE__ */ u("li", {
888
921
  style: { marginBottom: 4 },
889
- children: K(e.parts, e.text)
922
+ children: q(e.parts, e.text)
890
923
  }, t))
891
924
  });
892
925
  }
893
- function Fe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
926
+ function Re({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
894
927
  return /* @__PURE__ */ u("p", {
895
928
  ref: i,
896
929
  style: {
897
- ...ge,
898
- ...h(n)
930
+ ...ye,
931
+ ...C(n)
899
932
  },
900
- children: K(t, e, r)
933
+ children: q(t, e, r)
901
934
  });
902
935
  }
903
- var Ie = {
936
+ var ze = {
904
937
  color: "var(--page-accent, inherit)",
905
938
  textDecoration: "underline",
906
939
  textUnderlineOffset: 3,
907
940
  cursor: "pointer"
908
941
  };
909
- function Le({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
942
+ function Be({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
910
943
  return /* @__PURE__ */ u("a", {
911
944
  ref: o,
912
945
  href: n || "#",
913
946
  target: r || void 0,
914
947
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
915
948
  style: {
916
- ...Ie,
917
- ...h(i)
949
+ ...ze,
950
+ ...C(i)
918
951
  },
919
- children: K(t, e, a)
952
+ children: q(t, e, a)
920
953
  });
921
954
  }
922
- function Re({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
955
+ function Ve({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
923
956
  return /* @__PURE__ */ u("a", {
924
957
  ref: o,
925
958
  href: n || "#",
926
959
  target: r || void 0,
927
960
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
928
961
  style: {
929
- ...G,
930
- ...h(i)
962
+ ...K,
963
+ ...C(i)
931
964
  },
932
- children: K(t, e, a)
965
+ children: q(t, e, a)
933
966
  });
934
967
  }
935
- function ze({ src: e, alt: t, style: n, nodeRef: r }) {
968
+ function He({ src: e, alt: t, style: n, nodeRef: r }) {
936
969
  return e ? /* @__PURE__ */ u("img", {
937
970
  ref: r,
938
971
  src: e,
@@ -940,11 +973,11 @@ function ze({ src: e, alt: t, style: n, nodeRef: r }) {
940
973
  style: {
941
974
  display: "block",
942
975
  maxWidth: "100%",
943
- ...h(n)
976
+ ...C(n)
944
977
  }
945
978
  }) : null;
946
979
  }
947
- function Be({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
980
+ function Ue({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
948
981
  return e ? /* @__PURE__ */ u("video", {
949
982
  ref: s,
950
983
  src: e,
@@ -958,13 +991,13 @@ function Be({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
958
991
  display: "block",
959
992
  width: "100%",
960
993
  maxWidth: "100%",
961
- ...h(o)
994
+ ...C(o)
962
995
  }
963
996
  }) : null;
964
997
  }
965
- var Ve = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
966
- function He({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
967
- let c = Ve(e);
998
+ var We = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
999
+ function Ge({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
1000
+ let c = We(e);
968
1001
  if (!c) return null;
969
1002
  let l = new URLSearchParams({ rel: "0" });
970
1003
  return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ u("div", {
@@ -973,7 +1006,7 @@ function He({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
973
1006
  position: "relative",
974
1007
  width: "100%",
975
1008
  paddingTop: "56.25%",
976
- ...h(o)
1009
+ ...C(o)
977
1010
  },
978
1011
  children: /* @__PURE__ */ u("iframe", {
979
1012
  src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
@@ -990,7 +1023,7 @@ function He({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
990
1023
  })
991
1024
  });
992
1025
  }
993
- function Ue({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
1026
+ function Ke({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
994
1027
  return e ? /* @__PURE__ */ u("iframe", {
995
1028
  ref: i,
996
1029
  src: e,
@@ -1002,11 +1035,11 @@ function Ue({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
1002
1035
  width: "100%",
1003
1036
  height: 300,
1004
1037
  border: 0,
1005
- ...h(r)
1038
+ ...C(r)
1006
1039
  }
1007
1040
  }) : null;
1008
1041
  }
1009
- function We({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1042
+ function qe({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1010
1043
  let [a, o] = c(null);
1011
1044
  return i(() => {
1012
1045
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
@@ -1022,10 +1055,10 @@ function We({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1022
1055
  ref: (e) => {
1023
1056
  o(e), r && r(e);
1024
1057
  },
1025
- style: h(n)
1058
+ style: C(n)
1026
1059
  });
1027
1060
  }
1028
- function Ge({ height: e, nodeRef: t }) {
1061
+ function Je({ height: e, nodeRef: t }) {
1029
1062
  return /* @__PURE__ */ u("div", {
1030
1063
  ref: t,
1031
1064
  style: {
@@ -1035,18 +1068,18 @@ function Ge({ height: e, nodeRef: t }) {
1035
1068
  }
1036
1069
  });
1037
1070
  }
1038
- function Ke({ style: e, nodeRef: t }) {
1071
+ function Ye({ style: e, nodeRef: t }) {
1039
1072
  return /* @__PURE__ */ u("div", {
1040
1073
  ref: t,
1041
1074
  style: {
1042
1075
  height: 1,
1043
1076
  alignSelf: "stretch",
1044
1077
  flexShrink: 0,
1045
- ...h(e)
1078
+ ...C(e)
1046
1079
  }
1047
1080
  });
1048
1081
  }
1049
- var qe = {
1082
+ var Xe = {
1050
1083
  position: "absolute",
1051
1084
  top: "50%",
1052
1085
  transform: "translateY(-50%)",
@@ -1063,7 +1096,7 @@ var qe = {
1063
1096
  alignItems: "center",
1064
1097
  justifyContent: "center",
1065
1098
  padding: 0
1066
- }, Je = {
1099
+ }, Ze = {
1067
1100
  bottom: {
1068
1101
  inset: "auto 0 0 0",
1069
1102
  padding: "40px 24px 20px",
@@ -1082,56 +1115,56 @@ var qe = {
1082
1115
  padding: 24,
1083
1116
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1084
1117
  }
1085
- }, Ye = 48;
1086
- function Xe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1087
- let [p, m] = c(0), [g, _] = c(!1), [v, y] = c(null), b = e ? Math.min(p, e - 1) : 0;
1118
+ }, Qe = 48;
1119
+ function $e({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1120
+ let [p, m] = c(0), [h, g] = c(!1), [_, v] = c(null), y = e ? Math.min(p, e - 1) : 0;
1088
1121
  if (i(() => {
1089
- if (!n || g || v || e < 2) return;
1122
+ if (!n || h || _ || e < 2) return;
1090
1123
  let t = setInterval(() => m((t) => (t + 1) % e), Math.max(2, Number(r) || 5) * 1e3);
1091
1124
  return () => clearInterval(t);
1092
1125
  }, [
1093
1126
  n,
1094
- g,
1095
- v,
1127
+ h,
1128
+ _,
1096
1129
  r,
1097
1130
  e
1098
1131
  ]), !e) return null;
1099
- let x = (t) => m((t + e) % e), S = () => {
1100
- if (!v) return;
1101
- let { dx: e } = v;
1102
- y(null), e < -48 ? x(b + 1) : e > Ye && x(b - 1);
1132
+ let b = (t) => m((t + e) % e), x = () => {
1133
+ if (!_) return;
1134
+ let { dx: e } = _;
1135
+ v(null), e < -48 ? b(y + 1) : e > Qe && b(y - 1);
1103
1136
  };
1104
1137
  return /* @__PURE__ */ d("div", {
1105
1138
  ref: f,
1106
- onMouseEnter: () => _(!0),
1107
- onMouseLeave: () => _(!1),
1139
+ onMouseEnter: () => g(!0),
1140
+ onMouseLeave: () => g(!1),
1108
1141
  onPointerDown: o && e > 1 ? (e) => {
1109
- e.pointerType === "mouse" && e.button !== 0 || e.target.closest("button") || (e.currentTarget.setPointerCapture(e.pointerId), y({
1142
+ e.pointerType === "mouse" && e.button !== 0 || e.target.closest("button") || (e.currentTarget.setPointerCapture(e.pointerId), v({
1110
1143
  startX: e.clientX,
1111
1144
  dx: 0
1112
1145
  }));
1113
1146
  } : void 0,
1114
- onPointerMove: v ? (e) => y((t) => t && {
1147
+ onPointerMove: _ ? (e) => v((t) => t && {
1115
1148
  ...t,
1116
1149
  dx: e.clientX - t.startX
1117
1150
  }) : void 0,
1118
- onPointerUp: S,
1119
- onPointerCancel: S,
1151
+ onPointerUp: x,
1152
+ onPointerCancel: x,
1120
1153
  style: {
1121
1154
  position: "relative",
1122
1155
  overflow: "hidden",
1123
1156
  width: "100%",
1124
1157
  touchAction: "pan-y",
1125
- userSelect: v ? "none" : void 0,
1126
- cursor: v ? "grabbing" : void 0,
1127
- ...h(s)
1158
+ userSelect: _ ? "none" : void 0,
1159
+ cursor: _ ? "grabbing" : void 0,
1160
+ ...C(s)
1128
1161
  },
1129
1162
  children: [/* @__PURE__ */ u("div", {
1130
1163
  style: {
1131
1164
  display: "flex",
1132
1165
  height: a,
1133
- transform: `translateX(calc(${-b * 100}% + ${v?.dx ?? 0}px))`,
1134
- transition: v ? "none" : "transform 450ms ease"
1166
+ transform: `translateX(calc(${-y * 100}% + ${_?.dx ?? 0}px))`,
1167
+ transition: _ ? "none" : "transform 450ms ease"
1135
1168
  },
1136
1169
  children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ u("div", {
1137
1170
  style: {
@@ -1147,20 +1180,20 @@ function Xe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1147
1180
  type: "button",
1148
1181
  "aria-label": "Previous slide",
1149
1182
  style: {
1150
- ...qe,
1183
+ ...Xe,
1151
1184
  left: 12
1152
1185
  },
1153
- onClick: () => x(b - 1),
1186
+ onClick: () => b(y - 1),
1154
1187
  children: "‹"
1155
1188
  }),
1156
1189
  /* @__PURE__ */ u("button", {
1157
1190
  type: "button",
1158
1191
  "aria-label": "Next slide",
1159
1192
  style: {
1160
- ...qe,
1193
+ ...Xe,
1161
1194
  right: 12
1162
1195
  },
1163
- onClick: () => x(b + 1),
1196
+ onClick: () => b(y + 1),
1164
1197
  children: "›"
1165
1198
  }),
1166
1199
  /* @__PURE__ */ u("div", {
@@ -1176,7 +1209,7 @@ function Xe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1176
1209
  children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ u("button", {
1177
1210
  type: "button",
1178
1211
  "aria-label": `Go to slide ${t + 1}`,
1179
- onClick: () => x(t),
1212
+ onClick: () => b(t),
1180
1213
  style: {
1181
1214
  width: 8,
1182
1215
  height: 8,
@@ -1184,14 +1217,14 @@ function Xe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1184
1217
  border: 0,
1185
1218
  padding: 0,
1186
1219
  cursor: "pointer",
1187
- background: t === b ? "#ffffff" : "rgba(255, 255, 255, 0.45)"
1220
+ background: t === y ? "#ffffff" : "rgba(255, 255, 255, 0.45)"
1188
1221
  }
1189
1222
  }, t))
1190
1223
  })
1191
1224
  ] })]
1192
1225
  });
1193
1226
  }
1194
- var Ze = (e, t) => ({
1227
+ var et = (e, t) => ({
1195
1228
  position: "absolute",
1196
1229
  inset: 0,
1197
1230
  backgroundImage: e ? `url(${e})` : "none",
@@ -1199,18 +1232,18 @@ var Ze = (e, t) => ({
1199
1232
  backgroundSize: "cover",
1200
1233
  backgroundPosition: "center"
1201
1234
  });
1202
- function Qe({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1203
- return e.length ? /* @__PURE__ */ u(Xe, {
1235
+ function tt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1236
+ return e.length ? /* @__PURE__ */ u($e, {
1204
1237
  ...r,
1205
1238
  count: e.length,
1206
1239
  renderSlide: (r) => {
1207
1240
  let i = e[r];
1208
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ze(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1241
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: et(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1209
1242
  style: {
1210
1243
  position: "absolute",
1211
1244
  color: "#fff",
1212
1245
  textAlign: n,
1213
- ...Je[t] ?? Je.bottom
1246
+ ...Ze[t] ?? Ze.bottom
1214
1247
  },
1215
1248
  children: [i.title && /* @__PURE__ */ u("div", {
1216
1249
  style: {
@@ -1230,13 +1263,13 @@ function Qe({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1230
1263
  }
1231
1264
  }) : null;
1232
1265
  }
1233
- function $e({ slides: e = [], linked: t, ...n }) {
1234
- return e.length ? /* @__PURE__ */ u(Xe, {
1266
+ function nt({ slides: e = [], linked: t, ...n }) {
1267
+ return e.length ? /* @__PURE__ */ u($e, {
1235
1268
  ...n,
1236
1269
  count: e.length,
1237
1270
  renderSlide: (n) => {
1238
1271
  let r = e[n];
1239
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ze(r.image, r.color) }), /* @__PURE__ */ u("div", {
1272
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: et(r.image, r.color) }), /* @__PURE__ */ u("div", {
1240
1273
  style: {
1241
1274
  position: "absolute",
1242
1275
  inset: 0,
@@ -1248,16 +1281,16 @@ function $e({ slides: e = [], linked: t, ...n }) {
1248
1281
  }
1249
1282
  }) : null;
1250
1283
  }
1251
- function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lightbox: a = !0, style: o, nodeRef: s, inert: f }) {
1252
- let p = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], m = Math.max(0, Number(n) || 0), g = f ? (e) => e.preventDefault() : void 0, [_, v] = c(null), y = a && !f && _ !== null && p[_];
1284
+ function rt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lightbox: a = !0, style: o, nodeRef: s, inert: f }) {
1285
+ let p = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], m = Math.max(0, Number(n) || 0), h = f ? (e) => e.preventDefault() : void 0, [g, _] = c(null), v = a && !f && g !== null && p[g];
1253
1286
  i(() => {
1254
- if (!y) return;
1287
+ if (!v) return;
1255
1288
  let e = (e) => {
1256
- e.key === "Escape" && v(null), e.key === "ArrowRight" && v((e) => (e + 1) % p.length), e.key === "ArrowLeft" && v((e) => (e - 1 + p.length) % p.length);
1289
+ e.key === "Escape" && _(null), e.key === "ArrowRight" && _((e) => (e + 1) % p.length), e.key === "ArrowLeft" && _((e) => (e - 1 + p.length) % p.length);
1257
1290
  };
1258
1291
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1259
- }, [y, p.length]);
1260
- let b = (e) => {
1292
+ }, [v, p.length]);
1293
+ let y = (e) => {
1261
1294
  if (typeof e.name == "string" && e.name.trim()) return e.name;
1262
1295
  if (typeof e.alt == "string" && e.alt.trim()) return e.alt;
1263
1296
  try {
@@ -1273,7 +1306,7 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1273
1306
  columnCount: Math.min(Math.max(Number(t) || 3, 1), 8),
1274
1307
  columnGap: m,
1275
1308
  width: "100%",
1276
- ...h(o)
1309
+ ...C(o)
1277
1310
  },
1278
1311
  children: [
1279
1312
  p.map((e, t) => {
@@ -1292,7 +1325,7 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1292
1325
  display: "block",
1293
1326
  borderRadius: "inherit"
1294
1327
  }
1295
- }), r && b(e) && /* @__PURE__ */ u("span", {
1328
+ }), r && y(e) && /* @__PURE__ */ u("span", {
1296
1329
  style: {
1297
1330
  position: "absolute",
1298
1331
  insetInline: 0,
@@ -1306,11 +1339,11 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1306
1339
  overflow: "hidden",
1307
1340
  textOverflow: "ellipsis"
1308
1341
  },
1309
- children: b(e)
1342
+ children: y(e)
1310
1343
  })]
1311
1344
  }), i = e.href ? /* @__PURE__ */ u("a", {
1312
1345
  href: e.href,
1313
- onClick: g,
1346
+ onClick: h,
1314
1347
  target: e.target || void 0,
1315
1348
  rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
1316
1349
  style: {
@@ -1321,8 +1354,8 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1321
1354
  }) : a && !f ? /* @__PURE__ */ u("span", {
1322
1355
  role: "button",
1323
1356
  tabIndex: 0,
1324
- onClick: () => v(t),
1325
- onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && v(t),
1357
+ onClick: () => _(t),
1358
+ onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && _(t),
1326
1359
  style: {
1327
1360
  display: "block",
1328
1361
  borderRadius: "inherit",
@@ -1350,10 +1383,10 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1350
1383
  },
1351
1384
  children: "Pick images in Settings to fill the gallery"
1352
1385
  }),
1353
- y && /* @__PURE__ */ d("div", {
1386
+ v && /* @__PURE__ */ d("div", {
1354
1387
  role: "dialog",
1355
1388
  "aria-modal": "true",
1356
- onClick: () => v(null),
1389
+ onClick: () => _(null),
1357
1390
  style: {
1358
1391
  position: "fixed",
1359
1392
  inset: 0,
@@ -1367,8 +1400,8 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1367
1400
  },
1368
1401
  children: [
1369
1402
  /* @__PURE__ */ u("img", {
1370
- src: p[_].src,
1371
- alt: p[_].alt ?? "",
1403
+ src: p[g].src,
1404
+ alt: p[g].alt ?? "",
1372
1405
  onClick: (e) => e.stopPropagation(),
1373
1406
  style: {
1374
1407
  maxWidth: "92vw",
@@ -1377,19 +1410,19 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1377
1410
  boxShadow: "0 12px 48px rgba(0,0,0,0.5)"
1378
1411
  }
1379
1412
  }),
1380
- b(p[_]) && /* @__PURE__ */ u("div", {
1413
+ y(p[g]) && /* @__PURE__ */ u("div", {
1381
1414
  style: {
1382
1415
  color: "#fff",
1383
1416
  fontSize: 14,
1384
1417
  marginTop: 12,
1385
1418
  opacity: .85
1386
1419
  },
1387
- children: b(p[_])
1420
+ children: y(p[g])
1388
1421
  }),
1389
1422
  /* @__PURE__ */ u("button", {
1390
1423
  type: "button",
1391
1424
  "aria-label": "Close",
1392
- onClick: () => v(null),
1425
+ onClick: () => _(null),
1393
1426
  style: {
1394
1427
  position: "absolute",
1395
1428
  top: 16,
@@ -1407,7 +1440,7 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1407
1440
  type: "button",
1408
1441
  "aria-label": "Previous",
1409
1442
  onClick: (e) => {
1410
- e.stopPropagation(), v((e) => (e - 1 + p.length) % p.length);
1443
+ e.stopPropagation(), _((e) => (e - 1 + p.length) % p.length);
1411
1444
  },
1412
1445
  style: {
1413
1446
  position: "absolute",
@@ -1426,7 +1459,7 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1426
1459
  type: "button",
1427
1460
  "aria-label": "Next",
1428
1461
  onClick: (e) => {
1429
- e.stopPropagation(), v((e) => (e + 1) % p.length);
1462
+ e.stopPropagation(), _((e) => (e + 1) % p.length);
1430
1463
  },
1431
1464
  style: {
1432
1465
  position: "absolute",
@@ -1447,29 +1480,29 @@ function et({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1447
1480
  ]
1448
1481
  });
1449
1482
  }
1450
- var tt = {
1483
+ var it = {
1451
1484
  color: "inherit",
1452
1485
  textDecoration: "none",
1453
1486
  fontSize: 14,
1454
1487
  opacity: .85
1455
- }, nt = {
1488
+ }, at = {
1456
1489
  background: "var(--page-bg, #ffffff)",
1457
1490
  color: "var(--page-text, #111827)",
1458
1491
  border: "1px solid rgba(148, 163, 184, 0.25)",
1459
1492
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1460
1493
  zIndex: 60
1461
1494
  };
1462
- function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], style: s, nodeRef: f, menu: p = "auto", breakpoint: m = 768 }) {
1463
- let [g, _] = c(null), [v, y] = c(!1), [b, x] = c(!1), [S, C] = c(null);
1495
+ function ot({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], style: s, nodeRef: f, menu: p = "auto", breakpoint: m = 768 }) {
1496
+ let [h, g] = c(null), [_, v] = c(!1), [y, b] = c(!1), [x, S] = c(null);
1464
1497
  i(() => {
1465
- if (!g) return;
1466
- let e = new ResizeObserver(() => y(g.offsetWidth < m));
1467
- return e.observe(g), () => e.disconnect();
1468
- }, [g, m]);
1469
- let w = p === "hamburger" || p === "auto" && v, T = (e, t) => /* @__PURE__ */ d("a", {
1498
+ if (!h) return;
1499
+ let e = new ResizeObserver(() => v(h.offsetWidth < m));
1500
+ return e.observe(h), () => e.disconnect();
1501
+ }, [h, m]);
1502
+ let w = p === "hamburger" || p === "auto" && _, T = (e, t) => /* @__PURE__ */ d("a", {
1470
1503
  href: e.href || "#",
1471
1504
  style: {
1472
- ...tt,
1505
+ ...it,
1473
1506
  display: "block",
1474
1507
  ...t
1475
1508
  },
@@ -1485,7 +1518,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1485
1518
  }, e.key);
1486
1519
  return /* @__PURE__ */ d("nav", {
1487
1520
  ref: (e) => {
1488
- _(e), f && f(e);
1521
+ g(e), f && f(e);
1489
1522
  },
1490
1523
  style: {
1491
1524
  display: "flex",
@@ -1495,7 +1528,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1495
1528
  padding: "14px 24px",
1496
1529
  width: "100%",
1497
1530
  position: "relative",
1498
- ...h(s)
1531
+ ...C(s)
1499
1532
  },
1500
1533
  children: [
1501
1534
  (n || t) && (() => {
@@ -1534,8 +1567,8 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1534
1567
  /* @__PURE__ */ u("div", { style: { flexGrow: 1 } }),
1535
1568
  w ? /* @__PURE__ */ u("button", {
1536
1569
  type: "button",
1537
- "aria-label": b ? "Close menu" : "Open menu",
1538
- onClick: () => x(!b),
1570
+ "aria-label": y ? "Close menu" : "Open menu",
1571
+ onClick: () => b(!y),
1539
1572
  style: {
1540
1573
  background: "transparent",
1541
1574
  border: 0,
@@ -1545,7 +1578,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1545
1578
  lineHeight: 1,
1546
1579
  padding: 4
1547
1580
  },
1548
- children: b ? "✕" : "☰"
1581
+ children: y ? "✕" : "☰"
1549
1582
  }) : /* @__PURE__ */ u("div", {
1550
1583
  style: {
1551
1584
  display: "flex",
@@ -1557,7 +1590,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1557
1590
  let t = e.children ?? [];
1558
1591
  if (!t.length) return /* @__PURE__ */ u("a", {
1559
1592
  href: e.href || "#",
1560
- style: tt,
1593
+ style: it,
1561
1594
  children: e.label
1562
1595
  }, e.key);
1563
1596
  let n = e.type === "mega";
@@ -1566,12 +1599,12 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1566
1599
  position: n ? "static" : "relative",
1567
1600
  display: "inline-flex"
1568
1601
  },
1569
- onMouseEnter: () => C(e.key),
1570
- onMouseLeave: () => C(null),
1602
+ onMouseEnter: () => S(e.key),
1603
+ onMouseLeave: () => S(null),
1571
1604
  children: [/* @__PURE__ */ d("a", {
1572
1605
  href: e.href || "#",
1573
1606
  style: {
1574
- ...tt,
1607
+ ...it,
1575
1608
  cursor: "pointer"
1576
1609
  },
1577
1610
  children: [
@@ -1585,9 +1618,9 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1585
1618
  children: "▼"
1586
1619
  })
1587
1620
  ]
1588
- }), S === e.key && (n ? /* @__PURE__ */ u("div", {
1621
+ }), x === e.key && (n ? /* @__PURE__ */ u("div", {
1589
1622
  style: {
1590
- ...nt,
1623
+ ...at,
1591
1624
  position: "absolute",
1592
1625
  left: 0,
1593
1626
  right: 0,
@@ -1603,7 +1636,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1603
1636
  }))
1604
1637
  }) : /* @__PURE__ */ u("div", {
1605
1638
  style: {
1606
- ...nt,
1639
+ ...at,
1607
1640
  position: "absolute",
1608
1641
  top: "100%",
1609
1642
  left: 0,
@@ -1621,7 +1654,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1621
1654
  }, e.key);
1622
1655
  })
1623
1656
  }),
1624
- w && b && /* @__PURE__ */ u("div", {
1657
+ w && y && /* @__PURE__ */ u("div", {
1625
1658
  style: {
1626
1659
  flexBasis: "100%",
1627
1660
  width: "100%",
@@ -1632,7 +1665,7 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1632
1665
  children: o.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
1633
1666
  href: t.href || "#",
1634
1667
  style: {
1635
- ...tt,
1668
+ ...it,
1636
1669
  padding: "10px 4px",
1637
1670
  fontWeight: (t.children ?? []).length ? 600 : 400,
1638
1671
  opacity: 1
@@ -1643,13 +1676,13 @@ function rt({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1643
1676
  ]
1644
1677
  });
1645
1678
  }
1646
- function it({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1679
+ function st({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1647
1680
  let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1648
1681
  return e.length ? /* @__PURE__ */ d("div", {
1649
1682
  ref: r,
1650
1683
  style: {
1651
1684
  width: "100%",
1652
- ...h(n)
1685
+ ...C(n)
1653
1686
  },
1654
1687
  children: [/* @__PURE__ */ u("div", {
1655
1688
  style: {
@@ -1683,7 +1716,7 @@ function it({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1683
1716
  }, e.key))]
1684
1717
  }) : null;
1685
1718
  }
1686
- function at({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1719
+ function ct({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1687
1720
  let [a, o] = c(() => new Set(e.length ? [e[0].key] : []));
1688
1721
  if (!e.length) return null;
1689
1722
  let s = (e) => o((t) => {
@@ -1694,7 +1727,7 @@ function at({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1694
1727
  ref: i,
1695
1728
  style: {
1696
1729
  width: "100%",
1697
- ...h(r)
1730
+ ...C(r)
1698
1731
  },
1699
1732
  children: e.map((n, r) => {
1700
1733
  let i = a.has(n.key);
@@ -1740,15 +1773,15 @@ function at({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1740
1773
  })
1741
1774
  });
1742
1775
  }
1743
- var ot = {
1776
+ var lt = {
1744
1777
  display: "flex",
1745
1778
  flexDirection: "column",
1746
1779
  gap: "12px"
1747
- }, q = {
1780
+ }, J = {
1748
1781
  fontSize: "14px",
1749
1782
  fontWeight: 500,
1750
1783
  color: "var(--page-text, #111827)"
1751
- }, J = {
1784
+ }, Y = {
1752
1785
  padding: "10px 12px",
1753
1786
  border: "1px solid #d1d5db",
1754
1787
  borderRadius: "6px",
@@ -1758,18 +1791,18 @@ var ot = {
1758
1791
  boxSizing: "border-box",
1759
1792
  backgroundColor: "#ffffff",
1760
1793
  color: "#111827"
1761
- }, st = {
1794
+ }, ut = {
1762
1795
  display: "flex",
1763
1796
  alignItems: "center",
1764
1797
  gap: "8px",
1765
1798
  fontSize: "14px",
1766
1799
  color: "var(--page-text, #111827)"
1767
- }, Y = (e) => e ? {
1800
+ }, X = (e) => e ? {
1768
1801
  readOnly: !0,
1769
1802
  tabIndex: -1,
1770
1803
  onMouseDown: (e) => e.preventDefault()
1771
1804
  } : {};
1772
- function ct(e, t) {
1805
+ function dt(e, t) {
1773
1806
  if (!e) return !0;
1774
1807
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1775
1808
  switch (e.op) {
@@ -1783,11 +1816,11 @@ function ct(e, t) {
1783
1816
  default: return !1;
1784
1817
  }
1785
1818
  }
1786
- var lt = {
1819
+ var ft = {
1787
1820
  display: "flex",
1788
1821
  flexDirection: "column",
1789
1822
  gap: 6
1790
- }, ut = {
1823
+ }, pt = {
1791
1824
  font: "inherit",
1792
1825
  fontSize: 15,
1793
1826
  padding: "10px 12px",
@@ -1798,16 +1831,16 @@ var lt = {
1798
1831
  width: "100%",
1799
1832
  boxSizing: "border-box"
1800
1833
  };
1801
- function dt(e, t) {
1834
+ function mt(e, t) {
1802
1835
  let n = Array.isArray(e?.options) ? e.options : [];
1803
1836
  if (!e?.parentField) return n;
1804
1837
  let r = t?.[e.parentField];
1805
1838
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
1806
1839
  }
1807
- function ft({ field: e, value: t, onChange: n, inert: r, values: i }) {
1840
+ function ht({ field: e, value: t, onChange: n, inert: r, values: i }) {
1808
1841
  let a = /* @__PURE__ */ d("span", {
1809
1842
  style: {
1810
- ...q,
1843
+ ...J,
1811
1844
  fontSize: 14
1812
1845
  },
1813
1846
  children: [e.label, e.required ? " *" : ""]
@@ -1816,7 +1849,7 @@ function ft({ field: e, value: t, onChange: n, inert: r, values: i }) {
1816
1849
  required: e.required || void 0,
1817
1850
  placeholder: e.placeholder || void 0,
1818
1851
  disabled: r || void 0,
1819
- style: ut,
1852
+ style: pt,
1820
1853
  value: t ?? "",
1821
1854
  onChange: (t) => n(e.name, t.target.value)
1822
1855
  };
@@ -1845,7 +1878,7 @@ function ft({ field: e, value: t, onChange: n, inert: r, values: i }) {
1845
1878
  borderRadius: 8,
1846
1879
  display: "block"
1847
1880
  }
1848
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(He, {
1881
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Ge, {
1849
1882
  url: e.src,
1850
1883
  style: { width: "100%" }
1851
1884
  }) : /* @__PURE__ */ u("video", {
@@ -1857,14 +1890,14 @@ function ft({ field: e, value: t, onChange: n, inert: r, values: i }) {
1857
1890
  display: "block"
1858
1891
  }
1859
1892
  }) : null : /* @__PURE__ */ d("label", {
1860
- style: lt,
1893
+ style: ft,
1861
1894
  children: [
1862
1895
  a,
1863
1896
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
1864
1897
  ...o,
1865
1898
  rows: 4,
1866
1899
  style: {
1867
- ...ut,
1900
+ ...pt,
1868
1901
  resize: "vertical"
1869
1902
  }
1870
1903
  }) : e.type === "select" ? /* @__PURE__ */ d("select", {
@@ -1873,7 +1906,7 @@ function ft({ field: e, value: t, onChange: n, inert: r, values: i }) {
1873
1906
  children: [/* @__PURE__ */ u("option", {
1874
1907
  value: "",
1875
1908
  children: e.placeholder || "—"
1876
- }), dt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
1909
+ }), mt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
1877
1910
  value: typeof e == "string" ? e : e.value,
1878
1911
  children: typeof e == "string" ? e : e.label ?? e.value
1879
1912
  }, t))]
@@ -1920,19 +1953,19 @@ function ft({ field: e, value: t, onChange: n, inert: r, values: i }) {
1920
1953
  ]
1921
1954
  });
1922
1955
  }
1923
- function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: g, children: _, linked: v, show: y }) {
1924
- let { tenant: b, apiUrl: x } = r(B), [S, C] = c("form"), [w, T] = c(null), [E, D] = c({}), [O, k] = c(0), A = g ? y || "form" : S;
1956
+ function gt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
1957
+ let { tenant: y, apiUrl: b } = r(H), [x, S] = c("form"), [w, T] = c(null), [E, D] = c({}), [O, k] = c(0), A = h ? v || "form" : x;
1925
1958
  i(() => {
1926
1959
  if (!f || !s) return;
1927
1960
  let e = !0;
1928
- return fetch(`${x || "/api"}/forms/${encodeURIComponent(s)}`, { headers: b ? { "x-tenant": b } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
1961
+ return fetch(`${b || "/api"}/forms/${encodeURIComponent(s)}`, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
1929
1962
  e = !1;
1930
1963
  };
1931
1964
  }, [
1932
1965
  f,
1933
1966
  s,
1934
- b,
1935
- x
1967
+ y,
1968
+ b
1936
1969
  ]);
1937
1970
  let j = [{
1938
1971
  section: null,
@@ -1942,13 +1975,13 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1942
1975
  section: e,
1943
1976
  fields: []
1944
1977
  }) : j[j.length - 1].fields.push(e);
1945
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || ct(e.section.condition, E)).map((e) => ({
1978
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || dt(e.section.condition, E)).map((e) => ({
1946
1979
  ...e,
1947
- fields: e.fields.filter((e) => ct(e.condition, E))
1948
- })), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), ee = I.filter((e) => {
1980
+ fields: e.fields.filter((e) => dt(e.condition, E))
1981
+ })), 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) => {
1949
1982
  let t = E[e.name];
1950
1983
  return e.required && (t == null || t === "" || t === !1);
1951
- }), L = F >= N.length - 1, te = (e, t) => D((n) => {
1984
+ }), R = F >= N.length - 1, z = (e, t) => D((n) => {
1952
1985
  let r = {
1953
1986
  ...n,
1954
1987
  [e]: t
@@ -1958,7 +1991,7 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1958
1991
  });
1959
1992
  return /* @__PURE__ */ d("div", {
1960
1993
  ref: m,
1961
- style: h(e),
1994
+ style: C(e),
1962
1995
  children: [
1963
1996
  /* @__PURE__ */ u("form", {
1964
1997
  action: t || void 0,
@@ -1966,28 +1999,28 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1966
1999
  name: a || void 0,
1967
2000
  encType: o || void 0,
1968
2001
  onSubmit: async (e) => {
1969
- if (e.preventDefault(), !g) {
2002
+ if (e.preventDefault(), !h) {
1970
2003
  if (s) {
1971
2004
  let t = {};
1972
2005
  if (f) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
1973
2006
  else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
1974
2007
  try {
1975
- let e = await fetch(`${x || "/api"}/forms/${s}/submit`, {
2008
+ let e = await fetch(`${b || "/api"}/forms/${s}/submit`, {
1976
2009
  method: "post",
1977
2010
  headers: {
1978
2011
  "content-type": "application/json",
1979
- ...b ? { "x-tenant": b } : {}
2012
+ ...y ? { "x-tenant": y } : {}
1980
2013
  },
1981
2014
  body: JSON.stringify(t)
1982
2015
  }), n = await e.json().catch(() => null);
1983
- C(e.ok && n?.success !== !1 ? "success" : "error");
2016
+ S(e.ok && n?.success !== !1 ? "success" : "error");
1984
2017
  } catch {
1985
- C("error");
2018
+ S("error");
1986
2019
  }
1987
2020
  return;
1988
2021
  }
1989
2022
  if (!t) {
1990
- C("success");
2023
+ S("success");
1991
2024
  return;
1992
2025
  }
1993
2026
  try {
@@ -1995,18 +2028,18 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1995
2028
  method: n || "post",
1996
2029
  body: new FormData(e.currentTarget)
1997
2030
  });
1998
- C(r.ok ? "success" : "error");
2031
+ S(r.ok ? "success" : "error");
1999
2032
  } catch {
2000
- C("error");
2033
+ S("error");
2001
2034
  }
2002
2035
  }
2003
2036
  },
2004
2037
  style: {
2005
- ...ot,
2038
+ ...lt,
2006
2039
  display: A === "success" ? "none" : "flex"
2007
2040
  },
2008
2041
  children: f && s ? /* @__PURE__ */ d(l, { children: [
2009
- P && /* @__PURE__ */ u(Ft, {
2042
+ P && /* @__PURE__ */ u(Rt, {
2010
2043
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
2011
2044
  active: F + 1,
2012
2045
  style: { marginBottom: 8 }
@@ -2019,12 +2052,12 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2019
2052
  },
2020
2053
  children: N[F].section.help
2021
2054
  }),
2022
- I.map((e) => /* @__PURE__ */ u(ft, {
2055
+ I.map((e) => /* @__PURE__ */ u(ht, {
2023
2056
  field: e,
2024
2057
  value: E[e.name],
2025
2058
  values: E,
2026
- onChange: te,
2027
- inert: g
2059
+ onChange: z,
2060
+ inert: h
2028
2061
  }, e.name)),
2029
2062
  /* @__PURE__ */ d("div", {
2030
2063
  style: {
@@ -2035,10 +2068,10 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2035
2068
  },
2036
2069
  children: [P && F > 0 && /* @__PURE__ */ u("button", {
2037
2070
  type: "button",
2038
- disabled: g || void 0,
2071
+ disabled: h || void 0,
2039
2072
  onClick: () => k(F - 1),
2040
2073
  style: {
2041
- ...G,
2074
+ ...K,
2042
2075
  background: "transparent",
2043
2076
  color: "inherit",
2044
2077
  border: 0,
@@ -2046,26 +2079,26 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2046
2079
  cursor: "pointer"
2047
2080
  },
2048
2081
  children: "Back"
2049
- }), P && !L ? /* @__PURE__ */ u("button", {
2082
+ }), P && !R ? /* @__PURE__ */ u("button", {
2050
2083
  type: "button",
2051
- disabled: g || ee.length > 0,
2084
+ disabled: h || L.length > 0,
2052
2085
  onClick: () => k(F + 1),
2053
2086
  style: {
2054
- ...G,
2087
+ ...K,
2055
2088
  border: 0,
2056
2089
  padding: "10px 22px",
2057
2090
  borderRadius: 8,
2058
2091
  fontSize: 15,
2059
2092
  fontWeight: 600,
2060
2093
  cursor: "pointer",
2061
- opacity: ee.length ? .5 : 1
2094
+ opacity: L.length ? .5 : 1
2062
2095
  },
2063
2096
  children: "Next"
2064
2097
  }) : /* @__PURE__ */ u("button", {
2065
2098
  type: "submit",
2066
- disabled: g || void 0,
2099
+ disabled: h || void 0,
2067
2100
  style: {
2068
- ...G,
2101
+ ...K,
2069
2102
  border: 0,
2070
2103
  padding: "10px 22px",
2071
2104
  borderRadius: 8,
@@ -2076,26 +2109,26 @@ function pt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2076
2109
  children: p || "Submit"
2077
2110
  })]
2078
2111
  })
2079
- ] }) : _
2112
+ ] }) : g
2080
2113
  }),
2081
2114
  /* @__PURE__ */ u("div", {
2082
2115
  style: { display: A === "success" ? "block" : "none" },
2083
- children: v?.success ?? null
2116
+ children: _?.success ?? null
2084
2117
  }),
2085
2118
  /* @__PURE__ */ u("div", {
2086
2119
  style: {
2087
2120
  display: A === "error" ? "block" : "none",
2088
2121
  marginTop: 12
2089
2122
  },
2090
- children: v?.error ?? null
2123
+ children: _?.error ?? null
2091
2124
  })
2092
2125
  ]
2093
2126
  });
2094
2127
  }
2095
- var X = null, mt = null, ht = (e) => {
2128
+ var Z = null, _t = null, vt = (e) => {
2096
2129
  let t = typeof e == "string" && e.trim() ? e.trim() : "";
2097
- if (X && mt === t) return X;
2098
- if (X && typeof window < "u") {
2130
+ if (Z && _t === t) return Z;
2131
+ if (Z && typeof window < "u") {
2099
2132
  for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
2100
2133
  delete window[e];
2101
2134
  } catch {
@@ -2103,27 +2136,27 @@ var X = null, mt = null, ht = (e) => {
2103
2136
  }
2104
2137
  document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
2105
2138
  }
2106
- return mt = t, X = new Promise((e) => {
2139
+ return _t = t, Z = new Promise((e) => {
2107
2140
  if (typeof window > "u") return;
2108
2141
  if (window.grecaptcha?.render) return e(window.grecaptcha);
2109
2142
  window.__webimRecaptchaReady = () => e(window.grecaptcha);
2110
2143
  let n = document.createElement("script");
2111
2144
  n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
2112
- }), X;
2145
+ }), Z;
2113
2146
  };
2114
- function gt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
2115
- let p = r(B), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", g = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), _ = s(null), v = s(f);
2116
- if (v.current = f, i(() => {
2117
- if (l || !g || !_.current) return;
2147
+ function yt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
2148
+ let p = r(H), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
2149
+ if (_.current = f, i(() => {
2150
+ if (l || !h || !g.current) return;
2118
2151
  let e = !0, r = (t) => {
2119
- e && typeof v.current == "function" && v.current(t);
2152
+ e && typeof _.current == "function" && _.current(t);
2120
2153
  };
2121
- return ht(a).then((i) => {
2122
- if (!(!e || !_.current || !i?.render)) {
2123
- _.current.innerHTML = "", r("");
2154
+ return vt(a).then((i) => {
2155
+ if (!(!e || !g.current || !i?.render)) {
2156
+ g.current.innerHTML = "", r("");
2124
2157
  try {
2125
- i.render(_.current, {
2126
- sitekey: g,
2158
+ i.render(g.current, {
2159
+ sitekey: h,
2127
2160
  theme: t === "dark" ? "dark" : "light",
2128
2161
  size: n === "compact" ? "compact" : "normal",
2129
2162
  callback: (e) => r(typeof e == "string" ? e : ""),
@@ -2137,7 +2170,7 @@ function gt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
2137
2170
  };
2138
2171
  }, [
2139
2172
  l,
2140
- g,
2173
+ h,
2141
2174
  t,
2142
2175
  n,
2143
2176
  a
@@ -2145,7 +2178,7 @@ function gt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
2145
2178
  let e = t === "dark";
2146
2179
  return /* @__PURE__ */ d("div", {
2147
2180
  ref: c,
2148
- style: h(o),
2181
+ style: C(o),
2149
2182
  children: [/* @__PURE__ */ d("div", {
2150
2183
  style: {
2151
2184
  width: n === "compact" ? 164 : 302,
@@ -2184,7 +2217,7 @@ function gt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
2184
2217
  children: "reCAPTCHA"
2185
2218
  })
2186
2219
  ]
2187
- }), !g && /* @__PURE__ */ u("div", {
2220
+ }), !h && /* @__PURE__ */ u("div", {
2188
2221
  style: {
2189
2222
  marginTop: 6,
2190
2223
  fontSize: 11,
@@ -2194,23 +2227,23 @@ function gt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
2194
2227
  })]
2195
2228
  });
2196
2229
  }
2197
- return g ? /* @__PURE__ */ u("div", {
2230
+ return h ? /* @__PURE__ */ u("div", {
2198
2231
  ref: c,
2199
- style: h(o),
2200
- children: /* @__PURE__ */ u("div", { ref: _ })
2232
+ style: C(o),
2233
+ children: /* @__PURE__ */ u("div", { ref: g })
2201
2234
  }) : null;
2202
2235
  }
2203
- function _t({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2236
+ function bt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2204
2237
  return /* @__PURE__ */ u("label", {
2205
2238
  ref: r,
2206
2239
  style: {
2207
- ...q,
2208
- ...h(n)
2240
+ ...J,
2241
+ ...C(n)
2209
2242
  },
2210
- children: K(t, e, i)
2243
+ children: q(t, e, i)
2211
2244
  });
2212
2245
  }
2213
- function vt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2246
+ function xt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2214
2247
  return /* @__PURE__ */ u("input", {
2215
2248
  ref: a,
2216
2249
  type: e,
@@ -2218,13 +2251,13 @@ function vt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
2218
2251
  placeholder: n,
2219
2252
  required: !o && !!r,
2220
2253
  style: {
2221
- ...J,
2222
- ...h(i)
2254
+ ...Y,
2255
+ ...C(i)
2223
2256
  },
2224
- ...Y(o)
2257
+ ...X(o)
2225
2258
  });
2226
2259
  }
2227
- function yt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2260
+ function St({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2228
2261
  return /* @__PURE__ */ u("textarea", {
2229
2262
  ref: a,
2230
2263
  name: e || void 0,
@@ -2232,19 +2265,19 @@ function yt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
2232
2265
  rows: n,
2233
2266
  required: !o && !!r,
2234
2267
  style: {
2235
- ...J,
2268
+ ...Y,
2236
2269
  resize: "vertical",
2237
- ...h(i)
2270
+ ...C(i)
2238
2271
  },
2239
- ...Y(o)
2272
+ ...X(o)
2240
2273
  });
2241
2274
  }
2242
- function bt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2275
+ function Ct({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2243
2276
  return /* @__PURE__ */ d("label", {
2244
2277
  ref: o,
2245
2278
  style: {
2246
- ...st,
2247
- ...h(a)
2279
+ ...ut,
2280
+ ...C(a)
2248
2281
  },
2249
2282
  children: [/* @__PURE__ */ u("input", {
2250
2283
  type: e,
@@ -2260,7 +2293,7 @@ function bt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
2260
2293
  }), t]
2261
2294
  });
2262
2295
  }
2263
- function xt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2296
+ function wt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2264
2297
  return /* @__PURE__ */ d("select", {
2265
2298
  ref: a,
2266
2299
  name: e || void 0,
@@ -2269,9 +2302,9 @@ function xt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2269
2302
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
2270
2303
  tabIndex: o ? -1 : void 0,
2271
2304
  style: {
2272
- ...J,
2305
+ ...Y,
2273
2306
  appearance: "auto",
2274
- ...h(i)
2307
+ ...C(i)
2275
2308
  },
2276
2309
  children: [t !== "" && /* @__PURE__ */ u("option", {
2277
2310
  value: "",
@@ -2283,19 +2316,19 @@ function xt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2283
2316
  }, t))]
2284
2317
  });
2285
2318
  }
2286
- function St({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2319
+ function Tt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2287
2320
  let [s, l] = c(null);
2288
2321
  return /* @__PURE__ */ d("label", {
2289
2322
  ref: a,
2290
2323
  style: {
2291
- ...J,
2324
+ ...Y,
2292
2325
  display: "flex",
2293
2326
  alignItems: "center",
2294
2327
  gap: "8px",
2295
2328
  cursor: o ? "default" : "pointer",
2296
2329
  borderStyle: "dashed",
2297
2330
  color: s ? "#111827" : "#6b7280",
2298
- ...h(i)
2331
+ ...C(i)
2299
2332
  },
2300
2333
  children: [
2301
2334
  /* @__PURE__ */ u("input", {
@@ -2315,12 +2348,12 @@ function St({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
2315
2348
  ]
2316
2349
  });
2317
2350
  }
2318
- function Ct({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2351
+ function Et({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2319
2352
  return /* @__PURE__ */ u("button", {
2320
2353
  ref: n,
2321
2354
  type: r ? "button" : "submit",
2322
2355
  style: {
2323
- ...G,
2356
+ ...K,
2324
2357
  border: 0,
2325
2358
  cursor: "pointer",
2326
2359
  alignSelf: "flex-start",
@@ -2330,12 +2363,12 @@ function Ct({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2330
2363
  fontWeight: 600,
2331
2364
  lineHeight: 1.4,
2332
2365
  fontFamily: "inherit",
2333
- ...h(t)
2366
+ ...C(t)
2334
2367
  },
2335
2368
  children: e
2336
2369
  });
2337
2370
  }
2338
- function wt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2371
+ function Dt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2339
2372
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
2340
2373
  return /* @__PURE__ */ u("div", {
2341
2374
  ref: r,
@@ -2344,7 +2377,7 @@ function wt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2344
2377
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
2345
2378
  gap: 16,
2346
2379
  width: "100%",
2347
- ...h(n)
2380
+ ...C(n)
2348
2381
  },
2349
2382
  children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ u("div", {
2350
2383
  style: { minWidth: 0 },
@@ -2352,63 +2385,71 @@ function wt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2352
2385
  }, t))
2353
2386
  });
2354
2387
  }
2355
- function Tt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: g, style: _, nodeRef: v }) {
2356
- let { tenant: y, apiUrl: b, locale: x } = r(B), S = r(H), C = r(V), w = de(g), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : C?.[e], O = m ? le(C) : 1, [k, A] = c(null);
2388
+ function Ot({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
2389
+ let { tenant: v, apiUrl: y, locale: b } = r(H), x = r(me), S = r(U), [, w] = c(0);
2390
+ i(() => {
2391
+ if (typeof window > "u") return;
2392
+ let e = () => w((e) => e + 1);
2393
+ return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
2394
+ window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
2395
+ };
2396
+ }, []);
2397
+ let T = pe(h), E = JSON.stringify(T), D = E !== "{}" && !e?.startsWith?.("api:"), O = D ? null : S?.[e], k = m ? de(S) : 1, [A, j] = c(null);
2357
2398
  if (i(() => {
2358
- if (!e || D) return;
2399
+ if (!e || O) return;
2359
2400
  let n = !0, r = new URLSearchParams();
2360
- if (x && r.set("locale", x), E && r.set("data_filter", T), m && !e.startsWith("api:")) {
2401
+ if (b && r.set("locale", b), D && r.set("data_filter", E), m && !e.startsWith("api:")) {
2361
2402
  let e = Math.max(1, Number(t) || 6);
2362
- r.set("offset", String((O - 1) * e)), r.set("limit", String(e));
2403
+ r.set("offset", String((k - 1) * e)), r.set("limit", String(e));
2363
2404
  }
2364
- let i = r.toString(), a = e.startsWith("api:") ? `${b}/data/${encodeURIComponent(e.slice(4))}` : `${b}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
2365
- return fetch(a, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((e) => {
2405
+ let i = r.toString(), a = e.startsWith("api:") ? `${y}/data/${encodeURIComponent(e.slice(4))}` : `${y}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
2406
+ return fetch(a, { headers: v ? { "x-tenant": v } : {} }).then((e) => e.json()).then((e) => {
2366
2407
  let t = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
2367
- return n && A(t.filter((e) => e && typeof e == "object"));
2368
- }).catch(() => n && A([])), () => {
2408
+ return n && j(t.filter((e) => e && typeof e == "object"));
2409
+ }).catch(() => n && j([])), () => {
2369
2410
  n = !1;
2370
2411
  };
2371
2412
  }, [
2372
2413
  e,
2414
+ v,
2373
2415
  y,
2374
2416
  b,
2375
- x,
2376
- D,
2377
- m,
2378
2417
  O,
2418
+ m,
2419
+ k,
2379
2420
  t,
2380
- E,
2381
- T
2421
+ D,
2422
+ E
2382
2423
  ]), !e) return null;
2383
- let j = Math.max(1, Number(t) || 6), M = m ? D || e.startsWith("api:") ? (D ?? k ?? []).slice((O - 1) * j, O * j) : (k ?? []).slice(0, j) : (D ?? k ?? []).slice(0, j), N = Math.min(Math.max(Number(a) || 3, 1), 6), P = n === "list" ? {
2424
+ let M = Math.max(1, Number(t) || 6), N = m ? O || e.startsWith("api:") ? (O ?? A ?? []).slice((k - 1) * M, k * M) : (A ?? []).slice(0, M) : (O ?? A ?? []).slice(0, M), P = Math.min(Math.max(Number(a) || 3, 1), 6), F = n === "list" ? {
2384
2425
  display: "flex",
2385
2426
  flexDirection: "column",
2386
2427
  gap: 20
2387
2428
  } : {
2388
2429
  display: "grid",
2389
- gridTemplateColumns: `repeat(${N}, minmax(0, 1fr))`,
2430
+ gridTemplateColumns: `repeat(${P}, minmax(0, 1fr))`,
2390
2431
  gap: 24
2391
2432
  };
2392
- return f && p && S?.render ? /* @__PURE__ */ u("div", {
2393
- ref: v,
2433
+ return f && p && x?.render ? /* @__PURE__ */ u("div", {
2434
+ ref: _,
2394
2435
  style: {
2395
2436
  width: "100%",
2396
- ...P,
2397
- ...h(_)
2437
+ ...F,
2438
+ ...C(g)
2398
2439
  },
2399
- children: M.map((e) => /* @__PURE__ */ u("div", {
2440
+ children: N.map((e) => /* @__PURE__ */ u("div", {
2400
2441
  style: { minWidth: 0 },
2401
- children: S.render(p, (t) => me(t, e))
2442
+ children: x.render(p, (t) => _e(t, e))
2402
2443
  }, e.id ?? e?.data?.slug))
2403
2444
  }) : /* @__PURE__ */ u("div", {
2404
- ref: v,
2445
+ ref: _,
2405
2446
  style: {
2406
2447
  width: "100%",
2407
- ...P,
2408
- ...h(_)
2448
+ ...F,
2449
+ ...C(g)
2409
2450
  },
2410
- children: M.map((e) => {
2411
- let t = o ? U(e?.data, o) : null, r = s ? W(U(e?.data, s)) : null, i = l ? U(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : W(i), f = n === "list";
2451
+ children: N.map((e) => {
2452
+ let t = o ? W(e?.data, o) : null, r = s ? G(W(e?.data, s)) : null, i = l ? W(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : G(i), f = n === "list";
2412
2453
  return /* @__PURE__ */ d("div", {
2413
2454
  style: {
2414
2455
  display: "flex",
@@ -2455,7 +2496,7 @@ function Tt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2455
2496
  lineHeight: 1.55,
2456
2497
  opacity: .85
2457
2498
  },
2458
- children: Ae(a)
2499
+ children: Ne(a)
2459
2500
  })
2460
2501
  ]
2461
2502
  })]
@@ -2463,8 +2504,8 @@ function Tt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2463
2504
  })
2464
2505
  });
2465
2506
  }
2466
- function Et({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
2467
- let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : ue(), s = {
2507
+ function kt({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
2508
+ let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : fe(), s = {
2468
2509
  height: 34,
2469
2510
  padding: "0 12px",
2470
2511
  borderRadius: 8,
@@ -2487,20 +2528,32 @@ function Et({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
2487
2528
  return /* @__PURE__ */ d("form", {
2488
2529
  ref: r,
2489
2530
  method: "get",
2490
- onSubmit: i ? (e) => e.preventDefault() : void 0,
2531
+ onSubmit: (e) => {
2532
+ if (i) {
2533
+ e.preventDefault();
2534
+ return;
2535
+ }
2536
+ if (typeof window > "u" || !window.history?.pushState) return;
2537
+ e.preventDefault();
2538
+ let t = new URLSearchParams(window.location.search);
2539
+ for (let e of [...t.keys()]) (e.startsWith("f_") || e === "page") && t.delete(e);
2540
+ for (let [n, r] of new FormData(e.currentTarget).entries()) n.startsWith("f_") && typeof r == "string" && r.trim() !== "" && t.set(n, r);
2541
+ let n = t.toString();
2542
+ window.history.pushState({}, "", `${window.location.pathname}${n ? `?${n}` : ""}`), window.dispatchEvent(new Event("webim:urlchange"));
2543
+ },
2491
2544
  style: {
2492
2545
  display: "flex",
2493
2546
  flexWrap: "wrap",
2494
2547
  alignItems: "center",
2495
2548
  gap: 8,
2496
2549
  width: "100%",
2497
- ...h(n)
2550
+ ...C(n)
2498
2551
  },
2499
2552
  children: [a.map((e) => Array.isArray(e.options) && e.options.length > 0 || e.type === "option" || e.type === "select" ? /* @__PURE__ */ d("select", {
2500
2553
  name: `f_${e.name}`,
2501
2554
  defaultValue: o[e.name] ?? "",
2502
2555
  style: s,
2503
- ...Y(i),
2556
+ ...X(i),
2504
2557
  children: [/* @__PURE__ */ u("option", {
2505
2558
  value: "",
2506
2559
  children: e.label || e.name
@@ -2515,7 +2568,7 @@ function Et({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
2515
2568
  name: `f_${e.name}`,
2516
2569
  defaultValue: o[e.name] ?? "",
2517
2570
  style: s,
2518
- ...Y(i),
2571
+ ...X(i),
2519
2572
  children: [
2520
2573
  /* @__PURE__ */ u("option", {
2521
2574
  value: "",
@@ -2536,7 +2589,7 @@ function Et({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
2536
2589
  defaultValue: o[e.name] ?? "",
2537
2590
  placeholder: e.label || e.name,
2538
2591
  style: s,
2539
- ...Y(i)
2592
+ ...X(i)
2540
2593
  }, e.name)), /* @__PURE__ */ u("button", {
2541
2594
  type: "submit",
2542
2595
  style: {
@@ -2549,16 +2602,16 @@ function Et({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
2549
2602
  fontWeight: 600,
2550
2603
  cursor: i ? "default" : "pointer"
2551
2604
  },
2552
- ...Y(i),
2605
+ ...X(i),
2553
2606
  children: t
2554
2607
  })]
2555
2608
  });
2556
2609
  }
2557
- function Dt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2610
+ function At({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2558
2611
  return e.length ? /* @__PURE__ */ u("nav", {
2559
2612
  ref: r,
2560
2613
  "aria-label": "Breadcrumb",
2561
- style: { ...h(n) },
2614
+ style: { ...C(n) },
2562
2615
  children: /* @__PURE__ */ u("ol", {
2563
2616
  style: {
2564
2617
  display: "flex",
@@ -2604,27 +2657,27 @@ function Dt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2604
2657
  })
2605
2658
  }) : null;
2606
2659
  }
2607
- function Ot({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: g }) {
2608
- let { tenant: _, apiUrl: v } = r(B), y = r(V), [b, x] = c(null), S = o ? Number(y?.[`${o}:total`]) : NaN;
2660
+ function jt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: h }) {
2661
+ let { tenant: g, apiUrl: _ } = r(H), v = r(U), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
2609
2662
  i(() => {
2610
- if (!o || Number.isFinite(S)) return;
2611
- let e = !0, t = o.startsWith("api:") ? `${v}/data/${encodeURIComponent(o.slice(4))}` : `${v}/dynamic/${encodeURIComponent(o)}?limit=1`;
2612
- return fetch(t, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((t) => {
2663
+ if (!o || Number.isFinite(x)) return;
2664
+ let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
2665
+ return fetch(t, { headers: g ? { "x-tenant": g } : {} }).then((e) => e.json()).then((t) => {
2613
2666
  if (!e) return;
2614
2667
  let n = t?.payload, r = Array.isArray(n) ? n.length : Number(n?.total?.filtered ?? n?.total?.all ?? (Array.isArray(n?.data) ? n.data.length : 0));
2615
- x(Number.isFinite(r) ? r : 0);
2616
- }).catch(() => e && x(0)), () => {
2668
+ b(Number.isFinite(r) ? r : 0);
2669
+ }).catch(() => e && b(0)), () => {
2617
2670
  e = !1;
2618
2671
  };
2619
2672
  }, [
2620
2673
  o,
2674
+ g,
2621
2675
  _,
2622
- v,
2623
- S
2676
+ x
2624
2677
  ]);
2625
- let C = Math.max(1, Number(s) || 6), w = Number.isFinite(S) ? S : b;
2678
+ let S = Math.max(1, Number(s) || 6), w = Number.isFinite(x) ? x : y;
2626
2679
  if (o && w === null || o && f && !(w > 0)) return null;
2627
- let T = Math.min(Math.max(o ? Math.ceil(w / C) : Number(e) || 1, 1), 50), E = Math.min(Math.max(o ? le(y) : Number(t) || 1, 1), T), D = (e) => {
2680
+ let T = Math.min(Math.max(o ? Math.ceil(w / S) : Number(e) || 1, 1), 50), E = Math.min(Math.max(o ? de(v) : Number(t) || 1, 1), T), D = (e) => {
2628
2681
  if (o) {
2629
2682
  if (typeof window < "u") {
2630
2683
  let t = new URLSearchParams(window.location.search);
@@ -2648,7 +2701,7 @@ function Ot({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
2648
2701
  border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
2649
2702
  });
2650
2703
  return /* @__PURE__ */ d("nav", {
2651
- ref: g,
2704
+ ref: h,
2652
2705
  "aria-label": "Pagination",
2653
2706
  style: {
2654
2707
  display: "flex",
@@ -2656,7 +2709,7 @@ function Ot({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
2656
2709
  gap: 8,
2657
2710
  alignItems: "center",
2658
2711
  justifyContent: O,
2659
- ...h(m)
2712
+ ...C(m)
2660
2713
  },
2661
2714
  children: [
2662
2715
  n && /* @__PURE__ */ u("a", {
@@ -2689,15 +2742,15 @@ function Ot({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
2689
2742
  ]
2690
2743
  });
2691
2744
  }
2692
- var kt = "webim.page_mode", At = () => {
2745
+ var Mt = "webim.page_mode", Nt = () => {
2693
2746
  if (typeof window > "u") return "auto";
2694
2747
  try {
2695
- let e = window.localStorage.getItem(kt);
2748
+ let e = window.localStorage.getItem(Mt);
2696
2749
  return e === "light" || e === "dark" ? e : "auto";
2697
2750
  } catch {
2698
2751
  return "auto";
2699
2752
  }
2700
- }, jt = (e) => {
2753
+ }, Pt = (e) => {
2701
2754
  let t = {
2702
2755
  width: 16,
2703
2756
  height: 16,
@@ -2729,13 +2782,13 @@ var kt = "webim.page_mode", At = () => {
2729
2782
  rx: "2"
2730
2783
  }), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
2731
2784
  });
2732
- }, Z = {
2785
+ }, Q = {
2733
2786
  light: "Light theme",
2734
2787
  dark: "Dark theme",
2735
2788
  auto: "Follow the device theme"
2736
2789
  };
2737
- function Mt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
2738
- let [o, l] = c(a ? "auto" : At), d = s(null), f = (e) => {
2790
+ function Ft({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
2791
+ let [o, l] = c(a ? "auto" : Nt), d = s(null), f = (e) => {
2739
2792
  d.current = e, typeof r == "function" && r(e);
2740
2793
  };
2741
2794
  i(() => {
@@ -2743,14 +2796,14 @@ function Mt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
2743
2796
  let e = d.current?.closest?.(".webim-page");
2744
2797
  e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
2745
2798
  try {
2746
- o === "auto" ? window.localStorage.removeItem(kt) : window.localStorage.setItem(kt, o);
2799
+ o === "auto" ? window.localStorage.removeItem(Mt) : window.localStorage.setItem(Mt, o);
2747
2800
  } catch {}
2748
2801
  }, [o, a]);
2749
2802
  let p = t === !1 ? ["light", "dark"] : [
2750
2803
  "light",
2751
2804
  "dark",
2752
2805
  "auto"
2753
- ], m = p.includes(o) ? o : p[0], g = {
2806
+ ], m = p.includes(o) ? o : p[0], h = {
2754
2807
  appearance: "none",
2755
2808
  border: 0,
2756
2809
  margin: 0,
@@ -2774,43 +2827,43 @@ function Mt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
2774
2827
  padding: 3,
2775
2828
  borderRadius: 999,
2776
2829
  border: "1px solid rgba(148, 163, 184, 0.4)",
2777
- ...h(n)
2830
+ ...C(n)
2778
2831
  },
2779
2832
  children: p.map((e) => /* @__PURE__ */ u("button", {
2780
2833
  type: "button",
2781
- title: Z[e],
2782
- "aria-label": Z[e],
2834
+ title: Q[e],
2835
+ "aria-label": Q[e],
2783
2836
  "aria-pressed": e === m,
2784
2837
  onClick: a ? void 0 : () => l(e),
2785
2838
  style: {
2786
- ...g,
2839
+ ...h,
2787
2840
  width: 28,
2788
2841
  height: 28,
2789
2842
  color: e === m ? "var(--page-accent-text, #ffffff)" : "inherit",
2790
2843
  background: e === m ? "var(--page-accent, #111827)" : "transparent",
2791
2844
  opacity: e === m ? 1 : .7
2792
2845
  },
2793
- children: jt(e)
2846
+ children: Pt(e)
2794
2847
  }, e))
2795
2848
  });
2796
- let _ = p[(p.indexOf(m) + 1) % p.length];
2849
+ let g = p[(p.indexOf(m) + 1) % p.length];
2797
2850
  return /* @__PURE__ */ u("button", {
2798
2851
  ref: f,
2799
2852
  type: "button",
2800
- title: Z[m],
2801
- "aria-label": `Theme: ${Z[m]} — switch to ${Z[_]}`,
2802
- onClick: a ? void 0 : () => l(_),
2853
+ title: Q[m],
2854
+ "aria-label": `Theme: ${Q[m]} — switch to ${Q[g]}`,
2855
+ onClick: a ? void 0 : () => l(g),
2803
2856
  style: {
2804
- ...g,
2857
+ ...h,
2805
2858
  width: 36,
2806
2859
  height: 36,
2807
2860
  border: "1px solid rgba(148, 163, 184, 0.4)",
2808
- ...h(n)
2861
+ ...C(n)
2809
2862
  },
2810
- children: jt(m)
2863
+ children: Pt(m)
2811
2864
  });
2812
2865
  }
2813
- var Nt = {
2866
+ var It = {
2814
2867
  facebook: {
2815
2868
  label: "Facebook",
2816
2869
  color: "#1877f2",
@@ -2877,10 +2930,10 @@ var Nt = {
2877
2930
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
2878
2931
  }
2879
2932
  };
2880
- function Pt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
2881
- let l = Array.isArray(e) ? e.filter((e) => e && Nt[e.network]) : [];
2933
+ function Lt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
2934
+ let l = Array.isArray(e) ? e.filter((e) => e && It[e.network]) : [];
2882
2935
  if (!l.length) return null;
2883
- let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, g = c ? (e) => e.preventDefault() : void 0;
2936
+ let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
2884
2937
  return /* @__PURE__ */ u("div", {
2885
2938
  ref: s,
2886
2939
  style: {
@@ -2888,13 +2941,13 @@ function Pt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
2888
2941
  flexWrap: "wrap",
2889
2942
  alignItems: "center",
2890
2943
  gap: p,
2891
- ...h(o)
2944
+ ...C(o)
2892
2945
  },
2893
2946
  children: l.map((e, r) => {
2894
- let i = Nt[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
2947
+ let i = It[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
2895
2948
  return /* @__PURE__ */ u("a", {
2896
2949
  href: e.url || "#",
2897
- onClick: g,
2950
+ onClick: h,
2898
2951
  "aria-label": e.label || i.label,
2899
2952
  title: e.label || i.label,
2900
2953
  ...a !== !1 && !c ? {
@@ -2925,7 +2978,7 @@ function Pt({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
2925
2978
  })
2926
2979
  });
2927
2980
  }
2928
- function Ft({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2981
+ function Rt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2929
2982
  if (!t.length) return null;
2930
2983
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
2931
2984
  width: 32,
@@ -2963,7 +3016,7 @@ function Ft({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2963
3016
  flexDirection: r ? "column" : "row",
2964
3017
  alignItems: r ? "stretch" : "flex-start",
2965
3018
  gap: r ? 4 : 8,
2966
- ...h(i)
3019
+ ...C(i)
2967
3020
  },
2968
3021
  children: t.map((t, n) => {
2969
3022
  let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
@@ -3003,7 +3056,7 @@ function Ft({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
3003
3056
  })
3004
3057
  });
3005
3058
  }
3006
- var Q = {
3059
+ var zt = {
3007
3060
  small: {
3008
3061
  w: 132,
3009
3062
  h: 46,
@@ -3025,10 +3078,10 @@ var Q = {
3025
3078
  title: 12.5,
3026
3079
  avatar: 46
3027
3080
  }
3028
- }, It = (e) => Q[e] ?? Q.medium;
3029
- Q.medium.w, Q.medium.h;
3030
- function Lt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3031
- let r = It(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 = [];
3081
+ }, Bt = (e) => zt[e] ?? zt.medium;
3082
+ zt.medium.w, zt.medium.h;
3083
+ function Vt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3084
+ let r = Bt(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 = [];
3032
3085
  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);
3033
3086
  let d = /* @__PURE__ */ new Map(), f = (e, t) => {
3034
3087
  if (t.has(e.id)) return 0;
@@ -3080,19 +3133,19 @@ function Lt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3080
3133
  horizontal: n
3081
3134
  };
3082
3135
  }
3083
- var Rt = (e, t) => {
3136
+ var Ht = (e, t) => {
3084
3137
  let n = String(e ?? "");
3085
3138
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
3086
- }, zt = (e) => {
3139
+ }, Ut = (e) => {
3087
3140
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
3088
3141
  if (!t) return "#ffffff";
3089
3142
  let n = t[1];
3090
3143
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
3091
3144
  let r = parseInt(n, 16);
3092
3145
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
3093
- }, Bt = (e) => !!(e?.cv?.trim?.() || e?.photo);
3094
- function Vt(e, t = {}) {
3095
- 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 ? "" : W(e);
3146
+ }, Wt = (e) => !!(e?.cv?.trim?.() || e?.photo);
3147
+ function Gt(e, t = {}) {
3148
+ 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 ? "" : G(e);
3096
3149
  return n.map((e) => {
3097
3150
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
3098
3151
  return {
@@ -3106,11 +3159,11 @@ function Vt(e, t = {}) {
3106
3159
  };
3107
3160
  });
3108
3161
  }
3109
- var Ht = {
3162
+ var Kt = {
3110
3163
  size: 36,
3111
3164
  pad: 10
3112
3165
  };
3113
- function Ut({ node: e, onClose: t }) {
3166
+ function qt({ node: e, onClose: t }) {
3114
3167
  return i(() => {
3115
3168
  let e = (e) => e.key === "Escape" && t();
3116
3169
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -3123,7 +3176,9 @@ function Ut({ node: e, onClose: t }) {
3123
3176
  position: "fixed",
3124
3177
  inset: 0,
3125
3178
  zIndex: 1e3,
3126
- background: "rgba(15, 23, 42, 0.55)",
3179
+ background: "rgba(2, 6, 23, 0.6)",
3180
+ backdropFilter: "blur(4px)",
3181
+ WebkitBackdropFilter: "blur(4px)",
3127
3182
  display: "flex",
3128
3183
  alignItems: "center",
3129
3184
  justifyContent: "center",
@@ -3134,6 +3189,7 @@ function Ut({ node: e, onClose: t }) {
3134
3189
  style: {
3135
3190
  background: "var(--page-bg, #ffffff)",
3136
3191
  color: "var(--page-text, #111827)",
3192
+ border: "1px solid rgba(148, 163, 184, 0.35)",
3137
3193
  borderRadius: 14,
3138
3194
  maxWidth: 420,
3139
3195
  width: "100%",
@@ -3141,7 +3197,7 @@ function Ut({ node: e, onClose: t }) {
3141
3197
  overflowY: "auto",
3142
3198
  padding: 24,
3143
3199
  position: "relative",
3144
- boxShadow: "0 24px 64px rgba(15, 23, 42, 0.35)"
3200
+ boxShadow: "0 24px 64px rgba(2, 6, 23, 0.5)"
3145
3201
  },
3146
3202
  children: [
3147
3203
  /* @__PURE__ */ u("button", {
@@ -3228,8 +3284,8 @@ function Ut({ node: e, onClose: t }) {
3228
3284
  })
3229
3285
  });
3230
3286
  }
3231
- function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
3232
- let x = a(), [S, C] = c(null), { tenant: w, apiUrl: T } = r(B), E = r(V)?.[t], [D, O] = c(null);
3287
+ function Jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
3288
+ let b = a(), [x, S] = c(null), { tenant: w, apiUrl: T } = r(H), E = r(U)?.[t], [D, O] = c(null);
3233
3289
  i(() => {
3234
3290
  if (!t || E) return;
3235
3291
  let e = !0;
@@ -3245,19 +3301,19 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3245
3301
  T,
3246
3302
  E
3247
3303
  ]);
3248
- let k = t ? Vt(E ?? D ?? [], {
3304
+ let k = t ? Gt(E ?? D ?? [], {
3249
3305
  nameField: n,
3250
3306
  titleField: o,
3251
3307
  photoField: s,
3252
3308
  parentField: f,
3253
3309
  cvField: p,
3254
3310
  hrefField: m
3255
- }) : e, A = It(g), { boxes: j, links: M, width: N, height: P } = Lt(k, {
3256
- size: g,
3257
- horizontal: _
3311
+ }) : e, A = Bt(h), { boxes: j, links: M, width: N, height: P } = Vt(k, {
3312
+ size: h,
3313
+ horizontal: g
3258
3314
  });
3259
- if (!j.length) return !b && t ? /* @__PURE__ */ d("div", {
3260
- ref: y,
3315
+ if (!j.length) return !y && t ? /* @__PURE__ */ d("div", {
3316
+ ref: v,
3261
3317
  style: {
3262
3318
  padding: 18,
3263
3319
  border: "1px dashed rgba(148, 163, 184, 0.6)",
@@ -3265,7 +3321,7 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3265
3321
  fontSize: 13,
3266
3322
  opacity: .7,
3267
3323
  textAlign: "center",
3268
- ...h(v)
3324
+ ...C(_)
3269
3325
  },
3270
3326
  children: [
3271
3327
  "Org Chart — no published entries in “",
@@ -3275,11 +3331,11 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3275
3331
  }) : null;
3276
3332
  let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
3277
3333
  return /* @__PURE__ */ d("div", {
3278
- ref: y,
3334
+ ref: v,
3279
3335
  style: {
3280
3336
  maxWidth: "100%",
3281
3337
  overflowX: "auto",
3282
- ...h(v)
3338
+ ...C(_)
3283
3339
  },
3284
3340
  children: [/* @__PURE__ */ d("svg", {
3285
3341
  viewBox: `0 0 ${N} ${P}`,
@@ -3293,12 +3349,12 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3293
3349
  margin: "0 auto"
3294
3350
  },
3295
3351
  children: [M.map((e, t) => /* @__PURE__ */ u("path", {
3296
- 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}`,
3352
+ d: g ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
3297
3353
  fill: "none",
3298
3354
  stroke: "rgba(148, 163, 184, 0.7)",
3299
3355
  strokeWidth: "1.5"
3300
3356
  }, t)), j.map(({ node: e, x: t, y: n }) => {
3301
- 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 ? zt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? zt(e.color2) : s, f = b && (Bt(e) || e.href), p = () => Bt(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Ht.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);
3357
+ 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 ? Ut(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Ut(e.color2) : s, f = y && (Wt(e) || e.href), p = () => Wt(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Kt.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);
3302
3358
  return /* @__PURE__ */ d("g", {
3303
3359
  onClick: f ? p : void 0,
3304
3360
  style: f ? { cursor: "pointer" } : void 0,
@@ -3306,7 +3362,7 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3306
3362
  "aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
3307
3363
  children: [
3308
3364
  i && e.gradient ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("linearGradient", {
3309
- id: `${x}-${e.id}-grad`,
3365
+ id: `${b}-${e.id}-grad`,
3310
3366
  x1: "0",
3311
3367
  y1: "0",
3312
3368
  x2: "0",
@@ -3324,9 +3380,9 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3324
3380
  width: A.w,
3325
3381
  height: A.h,
3326
3382
  rx: "10",
3327
- fill: `url(#${x}-${e.id}-grad)`
3383
+ fill: `url(#${b}-${e.id}-grad)`
3328
3384
  })] }) : i ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
3329
- id: `${x}-${e.id}-box`,
3385
+ id: `${b}-${e.id}-box`,
3330
3386
  children: /* @__PURE__ */ u("rect", {
3331
3387
  x: t,
3332
3388
  y: n,
@@ -3335,7 +3391,7 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3335
3391
  rx: "10"
3336
3392
  })
3337
3393
  }), /* @__PURE__ */ d("g", {
3338
- clipPath: `url(#${x}-${e.id}-box)`,
3394
+ clipPath: `url(#${b}-${e.id}-box)`,
3339
3395
  children: [/* @__PURE__ */ u("rect", {
3340
3396
  x: t,
3341
3397
  y: n,
@@ -3360,20 +3416,20 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3360
3416
  strokeWidth: a ? 0 : 1.5
3361
3417
  }),
3362
3418
  e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
3363
- id: `${x}-${e.id}`,
3419
+ id: `${b}-${e.id}`,
3364
3420
  children: /* @__PURE__ */ u("circle", {
3365
- cx: t + Ht.pad + A.avatar / 2,
3421
+ cx: t + Kt.pad + A.avatar / 2,
3366
3422
  cy: n + A.h / 2,
3367
3423
  r: A.avatar / 2
3368
3424
  })
3369
3425
  }), /* @__PURE__ */ u("image", {
3370
3426
  href: e.photo,
3371
- x: t + Ht.pad,
3427
+ x: t + Kt.pad,
3372
3428
  y: n + (A.h - A.avatar) / 2,
3373
3429
  width: A.avatar,
3374
3430
  height: A.avatar,
3375
3431
  preserveAspectRatio: "xMidYMid slice",
3376
- clipPath: `url(#${x}-${e.id})`
3432
+ clipPath: `url(#${b}-${e.id})`
3377
3433
  })] }),
3378
3434
  i && !e.gradient ? /* @__PURE__ */ d(l, { children: [e.title && /* @__PURE__ */ u("text", {
3379
3435
  x: m,
@@ -3382,7 +3438,7 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3382
3438
  fontSize: A.title,
3383
3439
  fontWeight: "600",
3384
3440
  fill: s,
3385
- children: Rt(e.title, g + 4)
3441
+ children: Ht(e.title, g + 4)
3386
3442
  }), e.name && /* @__PURE__ */ u("text", {
3387
3443
  x: m,
3388
3444
  y: n + _ + _ / 2 + A.name * .35,
@@ -3390,7 +3446,7 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3390
3446
  fontSize: A.name,
3391
3447
  fontWeight: "600",
3392
3448
  fill: c,
3393
- children: Rt(e.name, g)
3449
+ children: Ht(e.name, g)
3394
3450
  })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
3395
3451
  x: m,
3396
3452
  y: n + (v[1] ? A.h * .43 : A.h * .57),
@@ -3398,7 +3454,7 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3398
3454
  fontSize: A.name,
3399
3455
  fontWeight: "600",
3400
3456
  fill: s,
3401
- children: Rt(v[0], g)
3457
+ children: Ht(v[0], g)
3402
3458
  }), v[1] && /* @__PURE__ */ u("text", {
3403
3459
  x: m,
3404
3460
  y: n + A.h * .73,
@@ -3406,44 +3462,44 @@ function Wt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3406
3462
  fontSize: A.title,
3407
3463
  opacity: "0.7",
3408
3464
  fill: s,
3409
- children: Rt(v[1], g + 4)
3465
+ children: Ht(v[1], g + 4)
3410
3466
  })] })
3411
3467
  ]
3412
3468
  }, e.id);
3413
3469
  })]
3414
- }), S && /* @__PURE__ */ u(Ut, {
3415
- node: S,
3416
- onClose: () => C(null)
3470
+ }), x && /* @__PURE__ */ u(qt, {
3471
+ node: x,
3472
+ onClose: () => S(null)
3417
3473
  })]
3418
3474
  });
3419
3475
  }
3420
- function Gt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, paged: f, emptyText: p, style: m, nodeRef: g }) {
3421
- let { tenant: _, apiUrl: v } = r(B), y = r(V), b = y?.[n], x = f ? le(y) : 1, [S, C] = c(null);
3476
+ function Yt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, paged: f, emptyText: p, style: m, nodeRef: h }) {
3477
+ let { tenant: g, apiUrl: _ } = r(H), v = r(U), y = v?.[n], b = f ? de(v) : 1, [x, S] = c(null);
3422
3478
  if (i(() => {
3423
- if (!n || b) return;
3424
- let e = !0, t = Math.max(1, Number(a) || 10), r = f && !n.startsWith("api:") ? `?offset=${(x - 1) * t}&limit=${t}` : "", i = n.startsWith("api:") ? `${v}/data/${encodeURIComponent(n.slice(4))}` : `${v}/dynamic/${encodeURIComponent(n)}${r}`;
3425
- return fetch(i, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((t) => {
3479
+ if (!n || y) return;
3480
+ let e = !0, t = Math.max(1, Number(a) || 10), r = f && !n.startsWith("api:") ? `?offset=${(b - 1) * t}&limit=${t}` : "", i = n.startsWith("api:") ? `${_}/data/${encodeURIComponent(n.slice(4))}` : `${_}/dynamic/${encodeURIComponent(n)}${r}`;
3481
+ return fetch(i, { headers: g ? { "x-tenant": g } : {} }).then((e) => e.json()).then((t) => {
3426
3482
  let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
3427
- return e && C(n);
3428
- }).catch(() => e && C([])), () => {
3483
+ return e && S(n);
3484
+ }).catch(() => e && S([])), () => {
3429
3485
  e = !1;
3430
3486
  };
3431
3487
  }, [
3432
3488
  n,
3489
+ g,
3433
3490
  _,
3434
- v,
3435
- b,
3491
+ y,
3436
3492
  f,
3437
- x,
3493
+ b,
3438
3494
  a
3439
3495
  ]), !e.length) return null;
3440
- let w = Math.max(1, Number(a) || 10), T = n ? f ? b || n.startsWith("api:") ? (b ?? S ?? []).slice((x - 1) * w, x * w) : (S ?? []).slice(0, w) : (b ?? S ?? []).slice(0, w) : null, E = T ? T.map((t) => e.map((e) => W(U(t?.data, e.field)))) : t, D = !!n && !(n && !b && S === null) && E.length === 0, O = l ? "6px 10px" : "10px 14px", k = "1px solid rgba(148, 163, 184, 0.35)", A = s ? { border: k } : { borderBottom: k };
3496
+ let w = Math.max(1, Number(a) || 10), T = n ? f ? y || n.startsWith("api:") ? (y ?? x ?? []).slice((b - 1) * w, b * w) : (x ?? []).slice(0, w) : (y ?? x ?? []).slice(0, w) : null, E = T ? T.map((t) => e.map((e) => G(W(t?.data, e.field)))) : t, D = !!n && !(n && !y && x === null) && E.length === 0, O = l ? "6px 10px" : "10px 14px", k = "1px solid rgba(148, 163, 184, 0.35)", A = s ? { border: k } : { borderBottom: k };
3441
3497
  return /* @__PURE__ */ u("div", {
3442
- ref: g,
3498
+ ref: h,
3443
3499
  style: {
3444
3500
  width: "100%",
3445
3501
  overflowX: "auto",
3446
- ...h(m)
3502
+ ...C(m)
3447
3503
  },
3448
3504
  children: /* @__PURE__ */ d("table", {
3449
3505
  style: {
@@ -3483,79 +3539,79 @@ function Gt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
3483
3539
  })
3484
3540
  });
3485
3541
  }
3486
- var Kt = {
3487
- PageRoot: xe,
3488
- Section: Se,
3489
- Container: Ce,
3490
- Heading: we,
3491
- TextBlock: Fe,
3492
- ButtonBlock: Re,
3493
- ImageBlock: ze,
3494
- Spacer: Ge,
3495
- Divider: Ke,
3496
- SliderBlock: Qe,
3497
- CanvasSlider: $e,
3498
- TabsBlock: it,
3499
- QuickStack: wt,
3500
- CollectionList: Tt,
3501
- CollectionSearch: Et,
3502
- BreadcrumbsBlock: Dt,
3503
- PaginationBlock: Ot,
3504
- StepperBlock: Ft,
3505
- SocialLinksBlock: Pt,
3506
- ThemeModeBlock: Mt,
3507
- OrgChartBlock: Wt,
3508
- TableBlock: Gt,
3509
- MasonryBlock: et,
3510
- AccordionBlock: at,
3511
- NavbarBlock: rt,
3512
- ListBlock: Pe,
3513
- TextSpan: De,
3514
- QuoteBlock: Ne,
3515
- TextLink: Le,
3516
- RichTextBlock: je,
3517
- RichContentBlock: je,
3518
- VideoBlock: Be,
3519
- YouTubeBlock: He,
3520
- IframeBlock: Ue,
3521
- EmbedBlock: We,
3522
- FormBlock: pt,
3523
- FormLabel: _t,
3524
- FormInput: vt,
3525
- FormTextarea: yt,
3526
- FormCheckbox: (e) => /* @__PURE__ */ u(bt, {
3542
+ var Xt = {
3543
+ PageRoot: we,
3544
+ Section: Te,
3545
+ Container: Ee,
3546
+ Heading: De,
3547
+ TextBlock: Re,
3548
+ ButtonBlock: Ve,
3549
+ ImageBlock: He,
3550
+ Spacer: Je,
3551
+ Divider: Ye,
3552
+ SliderBlock: tt,
3553
+ CanvasSlider: nt,
3554
+ TabsBlock: st,
3555
+ QuickStack: Dt,
3556
+ CollectionList: Ot,
3557
+ CollectionSearch: kt,
3558
+ BreadcrumbsBlock: At,
3559
+ PaginationBlock: jt,
3560
+ StepperBlock: Rt,
3561
+ SocialLinksBlock: Lt,
3562
+ ThemeModeBlock: Ft,
3563
+ OrgChartBlock: Jt,
3564
+ TableBlock: Yt,
3565
+ MasonryBlock: rt,
3566
+ AccordionBlock: ct,
3567
+ NavbarBlock: ot,
3568
+ ListBlock: Le,
3569
+ TextSpan: Ae,
3570
+ QuoteBlock: Ie,
3571
+ TextLink: Be,
3572
+ RichTextBlock: Pe,
3573
+ RichContentBlock: Pe,
3574
+ VideoBlock: Ue,
3575
+ YouTubeBlock: Ge,
3576
+ IframeBlock: Ke,
3577
+ EmbedBlock: qe,
3578
+ FormBlock: gt,
3579
+ FormLabel: bt,
3580
+ FormInput: xt,
3581
+ FormTextarea: St,
3582
+ FormCheckbox: (e) => /* @__PURE__ */ u(Ct, {
3527
3583
  kind: "checkbox",
3528
3584
  ...e
3529
3585
  }),
3530
- FormRadio: (e) => /* @__PURE__ */ u(bt, {
3586
+ FormRadio: (e) => /* @__PURE__ */ u(Ct, {
3531
3587
  kind: "radio",
3532
3588
  ...e
3533
3589
  }),
3534
- FormSelect: xt,
3535
- FormFile: St,
3536
- FormRecaptcha: gt,
3537
- FormSubmit: Ct
3538
- }, qt = {
3590
+ FormSelect: wt,
3591
+ FormFile: Tt,
3592
+ FormRecaptcha: yt,
3593
+ FormSubmit: Et
3594
+ }, Zt = {
3539
3595
  id: "auth",
3540
3596
  label: "Accounts",
3541
3597
  category: "Apps",
3542
3598
  keys: ["SiteLoginForm", "SiteAccountMenu"],
3543
3599
  ssr: "shell",
3544
3600
  settings: ["site.authRedirect"]
3545
- }, Jt = t({
3601
+ }, Qt = t({
3546
3602
  user: null,
3547
3603
  status: "idle",
3548
3604
  ensure: () => {},
3549
3605
  refresh: () => {},
3550
3606
  signOut: () => {}
3551
- }), Yt = () => {
3552
- let e = r(Jt);
3607
+ }), $t = () => {
3608
+ let e = r(Qt);
3553
3609
  return i(() => {
3554
3610
  e.ensure();
3555
3611
  }, [e]), e;
3556
3612
  };
3557
- function Xt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
3558
- let d = r(B), f = a || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : i ? "guest" : "idle"), v = s(!1), y = n((e, t) => fetch(`${f}${e}`, {
3613
+ function en({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
3614
+ let d = r(H), f = a || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : i ? "guest" : "idle"), v = s(!1), y = n((e, t) => fetch(`${f}${e}`, {
3559
3615
  ...t,
3560
3616
  credentials: "include",
3561
3617
  headers: {
@@ -3587,28 +3643,28 @@ function Xt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l })
3587
3643
  b,
3588
3644
  x
3589
3645
  ]);
3590
- return /* @__PURE__ */ u(Jt.Provider, {
3646
+ return /* @__PURE__ */ u(Qt.Provider, {
3591
3647
  value: C,
3592
3648
  children: e
3593
3649
  });
3594
3650
  }
3595
- function Zt({ when: e, children: t }) {
3596
- let { status: n } = Yt();
3651
+ function tn({ when: e, children: t }) {
3652
+ let { status: n } = $t();
3597
3653
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
3598
3654
  }
3599
3655
  //#endregion
3600
3656
  //#region ../ui/src/components/builder/apps/auth/views.jsx
3601
- function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
3602
- let { tenant: g, apiUrl: _, settings: v } = r(B), [y, b] = c("form"), [x, S] = c(""), [C, w] = c(!1), T = e === "register", E = f ? m || "form" : y, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
3657
+ function nn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
3658
+ let { tenant: h, apiUrl: g, settings: _ } = r(H), [v, y] = c("form"), [b, x] = c(""), [S, w] = c(!1), T = e === "register", E = f ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
3603
3659
  if (e.preventDefault(), f) return;
3604
3660
  let n = new FormData(e.currentTarget);
3605
- w(!0), S("");
3661
+ w(!0), x("");
3606
3662
  try {
3607
- let e = await fetch(`${_ || "/api"}/site/${T ? "register" : "login"}`, {
3663
+ let e = await fetch(`${g || "/api"}/site/${T ? "register" : "login"}`, {
3608
3664
  method: "post",
3609
3665
  headers: {
3610
3666
  "content-type": "application/json",
3611
- ...g ? { "x-tenant": g } : {}
3667
+ ...h ? { "x-tenant": h } : {}
3612
3668
  },
3613
3669
  credentials: "same-origin",
3614
3670
  body: JSON.stringify({
@@ -3618,15 +3674,15 @@ function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3618
3674
  })
3619
3675
  }), r = await e.json().catch(() => null);
3620
3676
  if (!e.ok || r?.success === !1) {
3621
- S(r?.error?.message || "Sign-in failed"), b("error"), w(!1);
3677
+ x(r?.error?.message || "Sign-in failed"), y("error"), w(!1);
3622
3678
  return;
3623
3679
  }
3624
- if (b("success"), typeof window < "u") {
3625
- let e = D(t) || D(new URLSearchParams(window.location.search).get("next")) || D(v?.["site.authRedirect"]) || D(v?.["apps.auth.redirect"]) || "/";
3680
+ if (y("success"), typeof window < "u") {
3681
+ let e = D(t) || D(new URLSearchParams(window.location.search).get("next")) || D(_?.["site.authRedirect"]) || D(_?.["apps.auth.redirect"]) || "/";
3626
3682
  window.location.assign(e);
3627
3683
  }
3628
3684
  } catch {
3629
- S("Sign-in failed"), b("error"), w(!1);
3685
+ x("Sign-in failed"), y("error"), w(!1);
3630
3686
  }
3631
3687
  };
3632
3688
  return /* @__PURE__ */ d("div", {
@@ -3635,7 +3691,7 @@ function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3635
3691
  display: "grid",
3636
3692
  gap: 12,
3637
3693
  maxWidth: 360,
3638
- ...h(s)
3694
+ ...C(s)
3639
3695
  },
3640
3696
  children: [
3641
3697
  /* @__PURE__ */ d("form", {
@@ -3647,20 +3703,20 @@ function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3647
3703
  children: [
3648
3704
  T ? /* @__PURE__ */ d("label", {
3649
3705
  style: {
3650
- ...q,
3706
+ ...J,
3651
3707
  display: "grid",
3652
3708
  gap: 6
3653
3709
  },
3654
3710
  children: [a, /* @__PURE__ */ u("input", {
3655
3711
  name: "name",
3656
3712
  type: "text",
3657
- style: J,
3658
- ...Y(f)
3713
+ style: Y,
3714
+ ...X(f)
3659
3715
  })]
3660
3716
  }) : null,
3661
3717
  /* @__PURE__ */ d("label", {
3662
3718
  style: {
3663
- ...q,
3719
+ ...J,
3664
3720
  display: "grid",
3665
3721
  gap: 6
3666
3722
  },
@@ -3668,13 +3724,13 @@ function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3668
3724
  name: "email",
3669
3725
  type: "email",
3670
3726
  required: !f,
3671
- style: J,
3672
- ...Y(f)
3727
+ style: Y,
3728
+ ...X(f)
3673
3729
  })]
3674
3730
  }),
3675
3731
  /* @__PURE__ */ d("label", {
3676
3732
  style: {
3677
- ...q,
3733
+ ...J,
3678
3734
  display: "grid",
3679
3735
  gap: 6
3680
3736
  },
@@ -3682,32 +3738,32 @@ function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3682
3738
  name: "password",
3683
3739
  type: "password",
3684
3740
  required: !f,
3685
- style: J,
3686
- ...Y(f)
3741
+ style: Y,
3742
+ ...X(f)
3687
3743
  })]
3688
3744
  }),
3689
3745
  /* @__PURE__ */ u("button", {
3690
3746
  type: f ? "button" : "submit",
3691
- disabled: C || void 0,
3747
+ disabled: S || void 0,
3692
3748
  style: {
3693
- ...G,
3749
+ ...K,
3694
3750
  border: 0,
3695
3751
  padding: "10px 22px",
3696
3752
  borderRadius: 8,
3697
3753
  fontSize: 15,
3698
3754
  fontWeight: 600,
3699
3755
  cursor: "pointer",
3700
- opacity: C ? .6 : 1
3756
+ opacity: S ? .6 : 1
3701
3757
  },
3702
3758
  children: o || (T ? "Create account" : "Sign in")
3703
3759
  }),
3704
- x ? /* @__PURE__ */ u("p", {
3760
+ b ? /* @__PURE__ */ u("p", {
3705
3761
  style: {
3706
3762
  margin: 0,
3707
3763
  fontSize: 14,
3708
3764
  color: "#dc2626"
3709
3765
  },
3710
- children: x
3766
+ children: b
3711
3767
  }) : null
3712
3768
  ]
3713
3769
  }),
@@ -3722,8 +3778,8 @@ function Qt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3722
3778
  ]
3723
3779
  });
3724
3780
  }
3725
- function $t({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3726
- let { user: c, status: l, signOut: f } = Yt(), p = a ? s || "user" : l, m = a ? {
3781
+ function rn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3782
+ let { user: c, status: l, signOut: f } = $t(), p = a ? s || "user" : l, m = a ? {
3727
3783
  name: "Ada Lovelace",
3728
3784
  email: "ada@example.com"
3729
3785
  } : c;
@@ -3731,7 +3787,7 @@ function $t({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3731
3787
  ref: i,
3732
3788
  style: {
3733
3789
  minHeight: 24,
3734
- ...h(r)
3790
+ ...C(r)
3735
3791
  }
3736
3792
  }) : p === "user" ? /* @__PURE__ */ d("div", {
3737
3793
  ref: i,
@@ -3739,12 +3795,12 @@ function $t({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3739
3795
  display: "flex",
3740
3796
  alignItems: "center",
3741
3797
  gap: 10,
3742
- ...h(r)
3798
+ ...C(r)
3743
3799
  },
3744
3800
  children: [
3745
3801
  /* @__PURE__ */ d("span", {
3746
3802
  style: {
3747
- ...q,
3803
+ ...J,
3748
3804
  fontWeight: 600
3749
3805
  },
3750
3806
  children: [
@@ -3755,7 +3811,7 @@ function $t({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3755
3811
  }),
3756
3812
  n && m?.email ? /* @__PURE__ */ u("span", {
3757
3813
  style: {
3758
- ...q,
3814
+ ...J,
3759
3815
  opacity: .7
3760
3816
  },
3761
3817
  children: m.email
@@ -3764,14 +3820,14 @@ function $t({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3764
3820
  type: "button",
3765
3821
  onClick: a ? void 0 : f,
3766
3822
  style: {
3767
- ...G,
3823
+ ...K,
3768
3824
  border: 0,
3769
3825
  padding: "8px 16px",
3770
3826
  borderRadius: 8,
3771
3827
  fontSize: 14,
3772
3828
  cursor: a ? "default" : "pointer"
3773
3829
  },
3774
- ...Y(a),
3830
+ ...X(a),
3775
3831
  children: t
3776
3832
  })
3777
3833
  ]
@@ -3781,65 +3837,65 @@ function $t({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3781
3837
  display: "flex",
3782
3838
  alignItems: "center",
3783
3839
  gap: 10,
3784
- ...h(r)
3840
+ ...C(r)
3785
3841
  },
3786
3842
  children: o?.signedOut ?? null
3787
3843
  });
3788
3844
  }
3789
3845
  //#endregion
3790
3846
  //#region ../ui/src/components/builder/apps/index.js
3791
- var en = [qt], tn = {
3792
- SiteLoginForm: Qt,
3793
- SiteAccountMenu: $t
3847
+ var an = [Zt], on = {
3848
+ SiteLoginForm: nn,
3849
+ SiteAccountMenu: rn
3794
3850
  };
3795
- new Set(en.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3851
+ new Set(an.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
3796
3852
  //#endregion
3797
3853
  //#region ../ui/src/components/builder/plugins/runtime.js
3798
- var nn = /* @__PURE__ */ new Map();
3799
- function rn(e) {
3800
- if (nn.has(e)) return nn.get(e);
3854
+ var sn = /* @__PURE__ */ new Map();
3855
+ function cn(e) {
3856
+ if (sn.has(e)) return sn.get(e);
3801
3857
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
3802
3858
  /* @vite-ignore */
3803
3859
  /* webpackIgnore: true */
3804
3860
  t
3805
3861
  ).finally(() => URL.revokeObjectURL(t));
3806
- return nn.set(e, n), n;
3862
+ return sn.set(e, n), n;
3807
3863
  }
3808
- function an(e) {
3864
+ function ln(e) {
3809
3865
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
3810
3866
  return n && typeof n == "object" ? n : {};
3811
3867
  }
3812
3868
  //#endregion
3813
3869
  //#region ../ui/src/components/builder/plugins/view.jsx
3814
- async function on(e, t) {
3815
- let n = await rn(e);
3870
+ async function un(e, t) {
3871
+ let n = await cn(e);
3816
3872
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
3817
3873
  }
3818
- var sn = {
3874
+ var dn = {
3819
3875
  padding: "10px 12px",
3820
3876
  border: "1px dashed rgba(148, 163, 184, 0.5)",
3821
3877
  borderRadius: 8,
3822
3878
  fontSize: 12,
3823
3879
  opacity: .6
3824
3880
  };
3825
- function cn({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3826
- let c = r(B), l = an(c?.settings)[e], f = s(null), p = s(null), m = {
3881
+ function fn({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3882
+ let c = r(H), l = ln(c?.settings)[e], f = s(null), p = s(null), m = {
3827
3883
  tenant: c?.tenant ?? "",
3828
3884
  apiUrl: c?.apiUrl ?? "/api",
3829
3885
  locale: c?.locale ?? "",
3830
3886
  settings: c?.settings ?? null
3831
- }, g = s(m);
3832
- g.current = m;
3833
- let _ = JSON.stringify(n ?? {});
3887
+ }, h = s(m);
3888
+ h.current = m;
3889
+ let g = JSON.stringify(n ?? {});
3834
3890
  return i(() => {
3835
3891
  let e = f.current;
3836
3892
  if (!l?.code || !e) return;
3837
3893
  let n = !0;
3838
- return on(l.code, t).then((e) => {
3894
+ return un(l.code, t).then((e) => {
3839
3895
  if (!(!n || !e || !f.current)) {
3840
3896
  p.current = e;
3841
3897
  try {
3842
- e.mount(f.current, JSON.parse(_), g.current);
3898
+ e.mount(f.current, JSON.parse(g), h.current);
3843
3899
  } catch {
3844
3900
  p.current = null;
3845
3901
  }
@@ -3856,17 +3912,17 @@ function cn({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3856
3912
  }, [l?.code, t]), i(() => {
3857
3913
  let e = p.current, t = f.current;
3858
3914
  if (!(!e || !t)) try {
3859
- e.update ? e.update(t, JSON.parse(_), g.current) : (e.unmount?.(t), t.innerHTML = "", e.mount(t, JSON.parse(_), g.current));
3915
+ e.update ? e.update(t, JSON.parse(g), h.current) : (e.unmount?.(t), t.innerHTML = "", e.mount(t, JSON.parse(g), h.current));
3860
3916
  } catch {}
3861
- }, [_]), l ? /* @__PURE__ */ u("div", {
3917
+ }, [g]), l ? /* @__PURE__ */ u("div", {
3862
3918
  ref: o,
3863
- style: h(a),
3919
+ style: C(a),
3864
3920
  children: /* @__PURE__ */ u("div", { ref: f })
3865
3921
  }) : /* @__PURE__ */ d("div", {
3866
3922
  ref: o,
3867
3923
  style: {
3868
- ...sn,
3869
- ...h(a)
3924
+ ...dn,
3925
+ ...C(a)
3870
3926
  },
3871
3927
  children: [
3872
3928
  "Plugin “",
@@ -3877,10 +3933,10 @@ function cn({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
3877
3933
  }
3878
3934
  //#endregion
3879
3935
  //#region ../ui/src/components/builder/render.jsx
3880
- var ln = {
3881
- ...Kt,
3882
- ...tn,
3883
- PluginBlock: cn
3936
+ var pn = {
3937
+ ...Xt,
3938
+ ...on,
3939
+ PluginBlock: fn
3884
3940
  };
3885
3941
  function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3886
3942
  let o = n[t];
@@ -3892,110 +3948,110 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
3892
3948
  let c = new Set(i).add(n);
3893
3949
  return /* @__PURE__ */ u(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
3894
3950
  }
3895
- let l = ln[s];
3951
+ let l = pn[s];
3896
3952
  if (!l) return null;
3897
3953
  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, m = /* @__PURE__ */ u(l, {
3898
3954
  ...c,
3899
3955
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
3900
3956
  linked: p,
3901
3957
  nodeRef: (e) => {
3902
- e && (e.setAttribute("data-wb", t), y(e, c));
3958
+ e && (e.setAttribute("data-wb", t), D(e, c));
3903
3959
  },
3904
3960
  children: d.length ? d : void 0
3905
3961
  }, t);
3906
- return c.when && c.when !== "always" ? /* @__PURE__ */ u(Zt, {
3962
+ return c.when && c.when !== "always" ? /* @__PURE__ */ u(tn, {
3907
3963
  when: c.when,
3908
3964
  children: m
3909
3965
  }, t) : m;
3910
3966
  }
3911
3967
  //#endregion
3912
3968
  //#region ../ui/src/components/builder/PageRenderer.jsx
3913
- var un = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), dn = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(F(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
3914
- .webim-page[data-webim-mode="dark"] { ${Object.entries(F(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
3915
- function fn({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: g }) {
3916
- let _ = s?.js?.trim();
3969
+ var mn = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), hn = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(V(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
3970
+ .webim-page[data-webim-mode="dark"] { ${Object.entries(V(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
3971
+ function gn({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: _ }) {
3972
+ let v = s?.js?.trim();
3917
3973
  if (i(() => {
3918
- if (!_) return;
3974
+ if (!v) return;
3919
3975
  let e = document.createElement("script");
3920
- return e.text = _, document.body.appendChild(e), () => e.remove();
3921
- }, [_]), !e?.ROOT) return null;
3922
- let v = {
3976
+ return e.text = v, document.body.appendChild(e), () => e.remove();
3977
+ }, [v]), !e?.ROOT) return null;
3978
+ let b = {
3923
3979
  lang: p || void 0,
3924
- dir: ce(m, p)
3925
- }, y = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", b = {
3980
+ dir: ue(m, p)
3981
+ }, x = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", S = {
3926
3982
  minHeight: "100%",
3927
3983
  display: "flex",
3928
3984
  flexDirection: "column"
3929
- }, x = $("ROOT", e, n), S = o(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), C = D(e, n), w = E(e, n), T = s?.css?.trim(), O = ae(e, n).map((e) => /* @__PURE__ */ u("link", {
3985
+ }, C = $("ROOT", e, n), w = o(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), T = F(e, n), E = P(e, n), D = s?.css?.trim(), O = B(t), k = [O.font, O.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !z[e]), A = [.../* @__PURE__ */ new Set([...y(e, n), ...k])].map((e) => /* @__PURE__ */ u("link", {
3930
3986
  rel: "stylesheet",
3931
3987
  precedence: "default",
3932
- href: z(e)
3933
- }, e)), k = P(t), A = dn(k);
3934
- return r === "auto" ? /* @__PURE__ */ u(B.Provider, {
3988
+ href: g(e)
3989
+ }, e)), j = hn(O);
3990
+ return r === "auto" ? /* @__PURE__ */ u(H.Provider, {
3935
3991
  value: {
3936
3992
  tenant: c || "",
3937
3993
  apiUrl: l || "/api",
3938
3994
  locale: p || "",
3939
3995
  settings: h ?? null
3940
3996
  },
3941
- children: /* @__PURE__ */ u(Xt, {
3942
- initialUser: g,
3943
- children: /* @__PURE__ */ u(V.Provider, {
3997
+ children: /* @__PURE__ */ u(en, {
3998
+ initialUser: _,
3999
+ children: /* @__PURE__ */ u(U.Provider, {
3944
4000
  value: f ?? null,
3945
- children: /* @__PURE__ */ u(H.Provider, {
3946
- value: S,
4001
+ children: /* @__PURE__ */ u(me.Provider, {
4002
+ value: w,
3947
4003
  children: /* @__PURE__ */ d("div", {
3948
- ...v,
4004
+ ...b,
3949
4005
  className: "webim-page",
3950
4006
  style: {
3951
- ...b,
3952
- ...I(t),
4007
+ ...S,
4008
+ ...ne(t),
3953
4009
  ...a
3954
4010
  },
3955
4011
  children: [
3956
- /* @__PURE__ */ u("style", { children: `.webim-page { ${un(F(k.light))} }
3957
- @media (prefers-color-scheme: dark) { .webim-page { ${un(F(k.dark))} } }` }),
3958
- /* @__PURE__ */ u("style", { children: A }),
3959
- O,
3960
- /* @__PURE__ */ u("style", { children: y }),
3961
- C && /* @__PURE__ */ u("style", { children: C }),
3962
- w && /* @__PURE__ */ u("style", { children: w }),
4012
+ /* @__PURE__ */ u("style", { children: `.webim-page { ${mn(V(O.light))} }
4013
+ @media (prefers-color-scheme: dark) { .webim-page { ${mn(V(O.dark))} } }` }),
4014
+ /* @__PURE__ */ u("style", { children: j }),
4015
+ A,
4016
+ /* @__PURE__ */ u("style", { children: x }),
3963
4017
  T && /* @__PURE__ */ u("style", { children: T }),
3964
- x
4018
+ E && /* @__PURE__ */ u("style", { children: E }),
4019
+ D && /* @__PURE__ */ u("style", { children: D }),
4020
+ C
3965
4021
  ]
3966
4022
  })
3967
4023
  })
3968
4024
  })
3969
4025
  })
3970
- }) : /* @__PURE__ */ u(B.Provider, {
4026
+ }) : /* @__PURE__ */ u(H.Provider, {
3971
4027
  value: {
3972
4028
  tenant: c || "",
3973
4029
  apiUrl: l || "/api",
3974
4030
  locale: p || "",
3975
4031
  settings: h ?? null
3976
4032
  },
3977
- children: /* @__PURE__ */ u(Xt, {
3978
- initialUser: g,
3979
- children: /* @__PURE__ */ u(V.Provider, {
4033
+ children: /* @__PURE__ */ u(en, {
4034
+ initialUser: _,
4035
+ children: /* @__PURE__ */ u(U.Provider, {
3980
4036
  value: f ?? null,
3981
- children: /* @__PURE__ */ u(H.Provider, {
3982
- value: S,
4037
+ children: /* @__PURE__ */ u(me.Provider, {
4038
+ value: w,
3983
4039
  children: /* @__PURE__ */ d("div", {
3984
- ...v,
4040
+ ...b,
3985
4041
  className: "webim-page",
3986
4042
  style: {
3987
- ...b,
3988
- ...ee(t, r),
4043
+ ...S,
4044
+ ...re(t, r),
3989
4045
  ...a
3990
4046
  },
3991
4047
  children: [
3992
- O,
3993
- /* @__PURE__ */ u("style", { children: A }),
3994
- /* @__PURE__ */ u("style", { children: y }),
3995
- C && /* @__PURE__ */ u("style", { children: C }),
3996
- w && /* @__PURE__ */ u("style", { children: w }),
4048
+ A,
4049
+ /* @__PURE__ */ u("style", { children: j }),
4050
+ /* @__PURE__ */ u("style", { children: x }),
3997
4051
  T && /* @__PURE__ */ u("style", { children: T }),
3998
- x
4052
+ E && /* @__PURE__ */ u("style", { children: E }),
4053
+ D && /* @__PURE__ */ u("style", { children: D }),
4054
+ C
3999
4055
  ]
4000
4056
  })
4001
4057
  })
@@ -4005,8 +4061,8 @@ function fn({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
4005
4061
  }
4006
4062
  //#endregion
4007
4063
  //#region src/WebimContent.jsx
4008
- function pn({ bundle: e, mode: t = "auto", style: n }) {
4009
- return e?.blocks?.ROOT ? /* @__PURE__ */ u(fn, {
4064
+ function _n({ bundle: e, mode: t = "auto", style: n }) {
4065
+ return e?.blocks?.ROOT ? /* @__PURE__ */ u(gn, {
4010
4066
  blocks: e.blocks,
4011
4067
  theme: e.theme,
4012
4068
  components: e.components,
@@ -4023,7 +4079,7 @@ function pn({ bundle: e, mode: t = "auto", style: n }) {
4023
4079
  }
4024
4080
  //#endregion
4025
4081
  //#region src/WebimPage.jsx
4026
- function mn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
4082
+ function vn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
4027
4083
  let [g, _] = c({ status: "loading" }), v = s({
4028
4084
  onLoad: m,
4029
4085
  onError: h
@@ -4033,7 +4089,7 @@ function mn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
4033
4089
  onError: h
4034
4090
  }, i(() => {
4035
4091
  let i = !0;
4036
- return _({ status: "loading" }), ne({
4092
+ return _({ status: "loading" }), se({
4037
4093
  apiUrl: e,
4038
4094
  tenant: t,
4039
4095
  slug: n,
@@ -4060,11 +4116,11 @@ function mn({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
4060
4116
  r,
4061
4117
  a,
4062
4118
  o
4063
- ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(pn, {
4119
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(_n, {
4064
4120
  bundle: g.bundle,
4065
4121
  mode: l,
4066
4122
  style: d
4067
4123
  });
4068
4124
  }
4069
4125
  //#endregion
4070
- export { fn as PageRenderer, pn as WebimContent, mn as WebimPage, ne as fetchPage, Ae as renderRichContent, L as resolveTheme };
4126
+ export { gn as PageRenderer, _n as WebimContent, vn as WebimPage, se as fetchPage, Ne as renderRichContent, ie as resolveTheme };