webim-adapter 0.29.0 → 1.0.1

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.
@@ -162,108 +162,202 @@ function y(e, t) {
162
162
  return [...n].sort();
163
163
  }
164
164
  //#endregion
165
+ //#region ../ui/src/components/builder/animations.js
166
+ var b = [
167
+ "linear",
168
+ "ease",
169
+ "ease-in",
170
+ "ease-out",
171
+ "ease-in-out"
172
+ ], x = (e) => {
173
+ let t = String(e ?? "").trim();
174
+ if (!t) return null;
175
+ let n = Number(t);
176
+ return Number.isFinite(n) ? n : null;
177
+ };
178
+ function S(e) {
179
+ let t = [], n = [], r = x(e?.opacity), i = x(e?.x), a = x(e?.y), o = x(e?.scale), s = x(e?.rotate), c = x(e?.blur);
180
+ return r !== null && t.push(`opacity: ${r}`), i !== null && n.push(`translateX(${i}px)`), a !== null && n.push(`translateY(${a}px)`), o !== null && n.push(`scale(${o})`), s !== null && n.push(`rotate(${s}deg)`), n.length && t.push(`transform: ${n.join(" ")}`), c !== null && t.push(`filter: blur(${c}px)`), t.join("; ");
181
+ }
182
+ var C = (e) => `wb-anim-${String(e).replace(/[^\w-]/g, "")}`, w = (e) => `--wb-anim-${String(e).replace(/[^\w-]/g, "")}`;
183
+ function T(e, t) {
184
+ if (!e || !Array.isArray(t)) return;
185
+ let n = window.getComputedStyle(e), r = t.map((e) => n.getPropertyValue(w(e)).trim()).filter(Boolean);
186
+ r.length && (e.style.animation = "none", e.offsetWidth, e.style.animation = r.join(", "));
187
+ }
188
+ function E(e) {
189
+ return Array.isArray(e) ? e.map((e) => {
190
+ let t = String(e?.id ?? "").replace(/[^\w-]/g, "");
191
+ if (!t) return "";
192
+ let n = C(t), r = S(e.from), i = S(e.to);
193
+ if (!r && !i) return "";
194
+ let a = Math.max(0, x(e.duration) ?? 400), o = Math.max(0, x(e.delay) ?? 0), s = `${n} ${a}ms ${b.includes(e.easing) ? e.easing : "ease-out"} ${o}ms ${e.loop ? "infinite" : "1"} both`;
195
+ return [
196
+ `@keyframes ${n} { from { ${r} } to { ${i} } }`,
197
+ `:root { ${w(t)}: ${s}; }`,
198
+ `.${n} { animation: ${s}; }`
199
+ ].join("\n");
200
+ }).filter(Boolean).join("\n") : "";
201
+ }
202
+ //#endregion
165
203
  //#region ../ui/src/components/builder/styles.js
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 = [
204
+ var D = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), O = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, k = [
167
205
  "borderWidth",
168
206
  "borderStyle",
169
207
  "borderColor",
170
208
  "borderRadius",
171
209
  "gap"
172
210
  ];
173
- function C(e) {
211
+ function A(e) {
174
212
  let t = {};
175
- for (let n of S) {
213
+ for (let n of k) {
176
214
  let r = e?.[n];
177
- r != null && r !== "" && (t[n] = b.has(n) ? x(r) : r);
215
+ r != null && r !== "" && (t[n] = D.has(n) ? O(r) : r);
178
216
  }
179
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || S.includes(n) || (t[n] = b.has(n) ? x(r) : r);
217
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || k.includes(n) || (t[n] = D.has(n) ? O(r) : r);
180
218
  let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
181
219
  delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
182
220
  let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
183
221
  delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
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)"}`);
222
+ let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${O(e.x ?? 0)} ${O(e.y ?? 0)} ${O(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
185
223
  [
186
224
  s,
187
225
  c,
188
226
  l,
189
227
  u
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;
228
+ ].some((e) => e !== void 0) && d.push(`${O(s ?? 0)} ${O(c ?? 0)} ${O(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
229
+ let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${O(e.x ?? 0)}, ${O(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: b } = t;
192
230
  delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
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;
231
+ let x = (Array.isArray(m) ? m : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
232
+ (h !== void 0 || g !== void 0) && x.push(`translate(${O(h ?? 0)}, ${O(g ?? 0)})`), _ !== void 0 && x.push(`scale(${_})`), v !== void 0 && x.push(`rotate(${f(v)})`), (y !== void 0 || b !== void 0) && x.push(`skew(${f(y ?? 0)}, ${f(b ?? 0)})`), x.length && (t.transform = x.join(" "));
233
+ let S = (e) => `${e.inset ? "inset " : ""}${O(e.x ?? 0)} ${O(e.y ?? 0)} ${O(e.blur ?? 0)} ${O(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: C, boxShadowX: w, boxShadowY: T, boxShadowBlur: E, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
196
234
  delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
197
- let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
235
+ let N = (Array.isArray(C) ? C : []).filter((e) => e && e.on !== !1).map(S);
198
236
  [
199
- D,
200
- O,
201
- k,
237
+ w,
238
+ T,
239
+ E,
202
240
  A,
203
241
  j,
204
242
  M
205
- ].some((e) => e !== void 0) && N.push(T({
206
- x: D,
207
- y: O,
208
- blur: k,
243
+ ].some((e) => e !== void 0) && N.push(S({
244
+ x: w,
245
+ y: T,
246
+ blur: E,
209
247
  spread: A,
210
248
  color: j,
211
249
  inset: M
212
250
  })), N.length && (t.boxShadow = N.join(", "));
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: ee, backdropFilters: I, filterBlur: L, filterGrayscale: R, filterBrightness: z, filterContrast: te, filterSaturate: ne } = t;
251
+ let P = (e) => e.type === "blur" ? `blur(${O(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: B, filterSaturate: V } = t;
214
252
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
215
- let B = F(ee);
216
- L !== void 0 && B.push(`blur(${x(L)})`), R !== void 0 && B.push(`grayscale(${R}%)`), z !== void 0 && B.push(`brightness(${z}%)`), te !== void 0 && B.push(`contrast(${te}%)`), ne !== void 0 && B.push(`saturate(${ne}%)`), B.length && (t.filter = B.join(" "));
217
- let V = F(I);
218
- V.length && (t.backdropFilter = V.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;
253
+ let H = F(I);
254
+ R !== void 0 && H.push(`blur(${O(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), ee !== void 0 && H.push(`brightness(${ee}%)`), B !== void 0 && H.push(`contrast(${B}%)`), V !== void 0 && H.push(`saturate(${V}%)`), H.length && (t.filter = H.join(" "));
255
+ let te = F(L);
256
+ te.length && (t.backdropFilter = te.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
257
+ let { textStrokeWidth: ne, textStrokeColor: re } = t;
258
+ delete t.textStrokeWidth, delete t.textStrokeColor, (ne !== void 0 || re !== void 0) && (t.WebkitTextStroke = `${O(ne ?? 1)} ${re || "currentColor"}`);
259
+ let { clipText: ie } = t;
260
+ delete t.clipText, ie && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
261
+ let { transitions: ae, transitionDuration: oe, transitionEasing: U, transitionProperty: W } = t, se = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
224
262
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
225
- let de = (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 && de.push(`${le || "all"} ${ue(se)} ${ce || "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) {
263
+ let G = (Array.isArray(ae) ? ae : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${se(e.duration ?? 200)} ${e.easing || "ease"}`);
264
+ if (oe !== void 0 && G.push(`${W || "all"} ${se(oe)} ${U || "ease"}`), G.length && (t.transition = G.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
227
265
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
228
266
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
229
267
  }
230
268
  delete t.backgroundVideo;
231
- let { overlayColor: fe, overlayOpacity: H } = t;
232
- if (delete t.overlayColor, delete t.overlayOpacity, fe) {
233
- let e = `color-mix(in srgb, ${fe} ${H ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
269
+ let { overlayColor: ce, overlayOpacity: le } = t;
270
+ if (delete t.overlayColor, delete t.overlayOpacity, ce) {
271
+ let e = `color-mix(in srgb, ${ce} ${le ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
234
272
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
235
273
  }
236
274
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
237
- let { backgroundLayers: U } = t;
275
+ let { backgroundLayers: ue } = t;
238
276
  delete t.backgroundLayers;
239
- let W = (Array.isArray(U) ? U : []).filter((e) => e && e.on !== !1);
240
- if (W.length) {
277
+ let K = (Array.isArray(ue) ? ue : []).filter((e) => e && e.on !== !1);
278
+ if (K.length) {
241
279
  let e = [], n = [], r = [], i = [], a = [];
242
- for (let t of W) 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");
280
+ for (let t of K) 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");
243
281
  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");
244
282
  else {
245
283
  if (!t.src) continue;
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");
284
+ e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${O(t.w ?? "auto")} ${O(t.h ?? "auto")}` : t.size || "cover"), r.push(`${O(t.posX ?? 0)} ${O(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
247
285
  }
248
286
  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(", "));
249
287
  }
250
288
  return t;
251
289
  }
252
- var w = {
290
+ var j = {
253
291
  hover: ":hover",
254
292
  pressed: ":active",
255
293
  focused: ":focus"
256
- }, T = /* @__PURE__ */ new Set([
294
+ }, M = /* @__PURE__ */ new Set([
257
295
  "style",
258
296
  "class",
259
297
  "id",
260
298
  "data-wb",
261
299
  "data-wb-class",
262
300
  "data-slot"
263
- ]), E = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !T.has(e.toLowerCase()), D = (e) => [...new Set(String(e ?? "").split(/\s+/).map((e) => e.replace(/^\./, "")).filter((e) => /^-?[_a-zA-Z][\w-]*$/.test(e)))];
264
- function O(e, t, n = []) {
301
+ ]), N = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !M.has(e.toLowerCase()), P = (e) => [...new Set(String(e ?? "").split(/\s+/).map((e) => e.replace(/^\./, "")).filter((e) => /^-?[_a-zA-Z][\w-]*$/.test(e)))], F = [
302
+ "click",
303
+ "dblclick",
304
+ "mouseenter",
305
+ "mouseleave",
306
+ "mousemove",
307
+ "focus",
308
+ "blur",
309
+ "input",
310
+ "change",
311
+ "submit",
312
+ "keydown",
313
+ "inview"
314
+ ], I = ["load", "pagescroll"], L = [...F, ...I], R = /^[A-Za-z_$][\w$]*$/;
315
+ function z(e, t) {
316
+ let n = String(t ?? "").trim();
317
+ if (!n) return [e];
318
+ let r = e.closest?.(".webim-page") ?? e.closest?.(".builder-canvas") ?? document, i = /^[A-Za-z_][\w-]*$/.test(n) ? [`#${n}`, n] : [n];
319
+ for (let e of i) try {
320
+ let t = Array.from(r.querySelectorAll(e));
321
+ if (t.length) return t;
322
+ } catch {
323
+ return [];
324
+ }
325
+ return [];
326
+ }
327
+ function ee(e, t) {
328
+ for (let t of e.__webimEvents ?? []) t();
329
+ let n = [];
330
+ for (let r of t ?? []) {
331
+ let t = String(r?.event ?? ""), i = r?.action === "animation", a = i ? (Array.isArray(r?.animations) ? r.animations : [r?.animation]).map((e) => String(e ?? "").trim()).filter(Boolean) : [], o = i ? "" : String(r?.handler ?? "").trim();
332
+ if (!L.includes(t) || (i ? !a.length : !R.test(o))) continue;
333
+ let s = (t) => {
334
+ if (i) {
335
+ for (let t of z(e, r?.target)) T(t, a);
336
+ return;
337
+ }
338
+ let n = window[o];
339
+ typeof n == "function" && n.call(e, t);
340
+ };
341
+ if (t === "inview") {
342
+ if (typeof IntersectionObserver > "u") continue;
343
+ let t = new IntersectionObserver((e) => {
344
+ for (let n of e) n.isIntersecting && (t.disconnect(), s(n));
345
+ });
346
+ t.observe(e), n.push(() => t.disconnect());
347
+ } else if (t === "load") if (document.readyState === "complete") {
348
+ let e = setTimeout(s, 0);
349
+ n.push(() => clearTimeout(e));
350
+ } else window.addEventListener("load", s, { once: !0 }), n.push(() => window.removeEventListener("load", s));
351
+ else t === "pagescroll" ? (document.addEventListener("scroll", s, {
352
+ capture: !0,
353
+ passive: !0
354
+ }), n.push(() => document.removeEventListener("scroll", s, { capture: !0 }))) : (e.addEventListener(t, s), n.push(() => e.removeEventListener(t, s)));
355
+ }
356
+ e.__webimEvents = n;
357
+ }
358
+ function B(e, t, n = []) {
265
359
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
266
- let r = D(t.classNames), i = D(e.getAttribute("data-wb-class"));
360
+ let r = P(t.classNames), i = P(e.getAttribute("data-wb-class"));
267
361
  for (let t of i) r.includes(t) || e.classList.remove(t);
268
362
  for (let t of r) e.classList.add(t);
269
363
  r.length ? e.setAttribute("data-wb-class", r.join(" ")) : e.removeAttribute("data-wb-class");
@@ -271,19 +365,19 @@ function O(e, t, n = []) {
271
365
  let a = [];
272
366
  for (let n of t.attributes ?? []) {
273
367
  let t = String(n?.name ?? "").trim();
274
- E(t) && (e.setAttribute(t, n.value ?? ""), a.push(t));
368
+ N(t) && (e.setAttribute(t, n.value ?? ""), a.push(t));
275
369
  }
276
370
  return a;
277
371
  }
278
- var k = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
279
- function A(e, t, n, r = !1) {
280
- let i = Object.entries(C(t)).map(([e, t]) => `${k(e)}: ${t} !important;`).join(" ");
372
+ var V = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
373
+ function H(e, t, n, r = !1) {
374
+ let i = Object.entries(A(t)).map(([e, t]) => `${V(e)}: ${t} !important;`).join(" ");
281
375
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
282
376
  }
283
- function j(e, t, n) {
284
- return Object.entries(w).map(([r, i]) => A(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
377
+ function te(e, t, n) {
378
+ return Object.entries(j).map(([r, i]) => H(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
285
379
  }
286
- var M = [
380
+ var ne = [
287
381
  {
288
382
  key: "tablet",
289
383
  max: 991
@@ -296,17 +390,17 @@ var M = [
296
390
  key: "mobile",
297
391
  max: 478
298
392
  }
299
- ], N = (e) => Object.entries(C(e)).map(([e, t]) => `${k(e)}: ${t} !important;`).join(" ");
300
- function P(e, t) {
301
- return M.map(({ key: n, max: r }) => {
302
- let i = t?.[n] ? N(t[n]) : "";
393
+ ], re = (e) => Object.entries(A(e)).map(([e, t]) => `${V(e)}: ${t} !important;`).join(" ");
394
+ function ie(e, t) {
395
+ return ne.map(({ key: n, max: r }) => {
396
+ let i = t?.[n] ? re(t[n]) : "";
303
397
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
304
398
  }).filter(Boolean).join("\n");
305
399
  }
306
- function F(e, t) {
400
+ function ae(e, t) {
307
401
  let n = [], r = (e) => {
308
402
  for (let [t, r] of Object.entries(e || {})) {
309
- let e = P(t, r.props);
403
+ let e = ie(t, r.props);
310
404
  e && n.push(e);
311
405
  }
312
406
  };
@@ -314,10 +408,10 @@ function F(e, t) {
314
408
  for (let e of Object.values(t || {})) r(e.template?.nodes);
315
409
  return n.join("\n");
316
410
  }
317
- function ee(e, t) {
411
+ function oe(e, t) {
318
412
  let n = [], r = (e) => {
319
413
  for (let [t, r] of Object.entries(e || {})) {
320
- let e = j(t, r.props);
414
+ let e = te(t, r.props);
321
415
  e && n.push(e);
322
416
  }
323
417
  };
@@ -325,7 +419,7 @@ function ee(e, t) {
325
419
  for (let e of Object.values(t || {})) r(e.template?.nodes);
326
420
  return n.join("\n");
327
421
  }
328
- var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", L = {
422
+ var U = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", W = {
329
423
  light: {
330
424
  background: "#f2f2f2",
331
425
  surface: "#f2f2f2",
@@ -366,23 +460,23 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
366
460
  contrastText: "#052e2b"
367
461
  }
368
462
  }
369
- }, R = {
463
+ }, se = {
370
464
  font: "system",
371
465
  headingFont: "inherit",
372
- light: L.light,
373
- dark: L.dark
374
- }, z = {
466
+ light: W.light,
467
+ dark: W.dark
468
+ }, G = {
375
469
  system: {
376
470
  label: "System",
377
- value: I
471
+ value: U
378
472
  },
379
473
  inter: {
380
474
  label: "Inter",
381
- value: `"Inter", ${I}`
475
+ value: `"Inter", ${U}`
382
476
  },
383
477
  outfit: {
384
478
  label: "Outfit",
385
- value: `"Outfit", ${I}`
479
+ value: `"Outfit", ${U}`
386
480
  },
387
481
  serif: {
388
482
  label: "Serif",
@@ -392,7 +486,7 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
392
486
  label: "Mono",
393
487
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
394
488
  }
395
- }, te = (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), ne = (e, ...t) => {
489
+ }, ce = (e, t) => G[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), le = (e, ...t) => {
396
490
  let n = Object.assign({}, e, ...t);
397
491
  return n.primary = {
398
492
  ...e.primary,
@@ -408,20 +502,20 @@ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
408
502
  }), {})
409
503
  }, n;
410
504
  };
411
- function B(e) {
505
+ function ue(e) {
412
506
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
413
507
  return {
414
- font: r ?? R.font,
415
- headingFont: i ?? R.headingFont,
416
- light: ne(L.light, a, t),
417
- dark: ne(L.dark, n)
508
+ font: r ?? se.font,
509
+ headingFont: i ?? se.headingFont,
510
+ light: le(W.light, a, t),
511
+ dark: le(W.dark, n)
418
512
  };
419
513
  }
420
- function V(e) {
514
+ function K(e) {
421
515
  return {
422
516
  "--page-bg": e.background,
423
517
  "--page-surface": e.surface ?? e.background,
424
- "--page-border": e.border ?? L.light.border,
518
+ "--page-border": e.border ?? W.light.border,
425
519
  "--page-text": e.text,
426
520
  "--page-accent": e.accent,
427
521
  "--page-accent-text": e.accentText,
@@ -435,31 +529,31 @@ function V(e) {
435
529
  "--page-secondary-contrast": e.secondary.contrastText
436
530
  };
437
531
  }
438
- function re(e) {
439
- let t = B(e);
532
+ function de(e) {
533
+ let t = ue(e);
440
534
  return {
441
535
  backgroundColor: "var(--page-bg)",
442
536
  color: "var(--page-text)",
443
- fontFamily: te(t.font, I),
444
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : te(t.headingFont, "inherit")
537
+ fontFamily: ce(t.font, U),
538
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : ce(t.headingFont, "inherit")
445
539
  };
446
540
  }
447
- function ie(e, t = "light") {
448
- let n = B(e);
541
+ function fe(e, t = "light") {
542
+ let n = ue(e);
449
543
  return {
450
- ...re(e),
451
- ...V(n[t] ?? n.light)
544
+ ...de(e),
545
+ ...K(n[t] ?? n.light)
452
546
  };
453
547
  }
454
- function ae(e, t) {
548
+ function pe(e, t) {
455
549
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
456
550
  }
457
- function oe(e, t) {
551
+ function me(e, t) {
458
552
  return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
459
553
  }
460
554
  //#endregion
461
555
  //#region src/bundle.js
462
- function se({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
556
+ function he({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
463
557
  let a = {
464
558
  ...t?.global ?? {},
465
559
  ...t?.tenant ?? {}
@@ -469,9 +563,10 @@ function se({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
469
563
  title: e.title,
470
564
  slug: e.slug,
471
565
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
472
- theme: ae(o, a.builder_themes?.themes),
566
+ theme: pe(o, a.builder_themes?.themes),
473
567
  components: a.builder_components?.components ?? {},
474
568
  custom: o.custom,
569
+ animations: o.animations,
475
570
  seo: o.seo,
476
571
  direction: o.direction,
477
572
  scheme: o.scheme,
@@ -484,26 +579,31 @@ function se({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
484
579
  }
485
580
  //#endregion
486
581
  //#region src/fetchPage.js
487
- var ce = async (e) => {
582
+ var ge = async (e) => {
488
583
  let t = await e.json().catch(() => null);
489
584
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
490
585
  return t?.payload ?? t;
491
586
  };
492
- async function le({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
587
+ async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
493
588
  if (!e) throw Error("fetchPage: apiUrl is required");
494
589
  if (!n) throw Error("fetchPage: slug is required");
495
590
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
496
591
  ...t ? { "x-tenant": t } : {},
497
592
  ...a ? { authorization: `Bearer ${a}` } : {}
498
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(ce), c(`${l}/settings/public`, { headers: u }).then(ce)]), p = se({
593
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(ge), c(`${l}/settings/public`, { headers: u }).then(ge)]), p = he({
499
594
  page: d,
500
595
  settings: f,
501
596
  tenant: t,
502
597
  apiUrl: l,
503
598
  locale: r
504
- }), 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))];
599
+ }), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : [
600
+ "TableBlock",
601
+ "OrgChartBlock",
602
+ "NavbarBlock",
603
+ "CalendarBlock"
604
+ ].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
505
605
  if (m.length) {
506
- 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(ce).then((e) => {
606
+ 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(ge).then((e) => {
507
607
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
508
608
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
509
609
  }).catch(() => [[t, []]])));
@@ -517,7 +617,7 @@ async function le({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
517
617
  }
518
618
  //#endregion
519
619
  //#region ../ui/src/components/builder/locale.js
520
- var ue = /* @__PURE__ */ new Set([
620
+ var ve = /* @__PURE__ */ new Set([
521
621
  "ar",
522
622
  "he",
523
623
  "fa",
@@ -528,34 +628,34 @@ var ue = /* @__PURE__ */ new Set([
528
628
  "yi",
529
629
  "dv",
530
630
  "ckb"
531
- ]), de = (e) => ue.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", fe = (e, t) => e === "ltr" || e === "rtl" ? e : t ? de(t) : void 0, H = t({
631
+ ]), ye = (e) => ve.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", be = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ye(t) : void 0, q = t({
532
632
  tenant: "",
533
633
  apiUrl: "/api",
534
634
  locale: "",
535
635
  settings: null
536
- }), U = t(null), W = (e) => {
636
+ }), J = t(null), xe = (e) => {
537
637
  let t = Number(e?.__page);
538
638
  if (Number.isFinite(t) && t >= 1) return Math.floor(t);
539
639
  if (typeof window > "u") return 1;
540
640
  let n = Number(new URLSearchParams(window.location.search).get("page"));
541
641
  return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
542
- }, pe = () => {
642
+ }, Se = () => {
543
643
  if (typeof window > "u") return {};
544
644
  let e = {};
545
645
  return new URLSearchParams(window.location.search).forEach((t, n) => {
546
646
  n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
547
647
  }), e;
548
- }, me = (e) => {
648
+ }, Ce = (e) => {
549
649
  let t = {
550
650
  ...e && typeof e == "object" && !Array.isArray(e) ? e : {},
551
- ...pe()
651
+ ...Se()
552
652
  };
553
653
  return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
554
- }, he = t(null), ge = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
555
- function G(e, t) {
654
+ }, we = t(null), Te = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
655
+ function Ee(e, t) {
556
656
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
557
657
  }
558
- var _e = (e) => {
658
+ var De = (e) => {
559
659
  let t = [];
560
660
  for (let [n, r] of Object.entries(e ?? {})) {
561
661
  if (!/^[\w-]+$/.test(n)) continue;
@@ -565,36 +665,36 @@ var _e = (e) => {
565
665
  }
566
666
  return t;
567
667
  };
568
- function K(e) {
668
+ function Y(e) {
569
669
  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(" ") : "";
570
670
  }
571
- function ve(e, t) {
572
- let n = t?.data ?? {}, r = _e(n);
671
+ function Oe(e, t) {
672
+ let n = t?.data ?? {}, r = De(n);
573
673
  if (!r.length) return e;
574
- let i = RegExp(`:(${r.map(ge).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(G(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
674
+ let i = RegExp(`:(${r.map(Te).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Y(Ee(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
575
675
  return a(e);
576
676
  }
577
- var ye = {
677
+ var ke = {
578
678
  margin: 0,
579
679
  fontWeight: 700,
580
680
  lineHeight: 1.2,
581
681
  fontFamily: "var(--page-heading-font, inherit)"
582
- }, be = { margin: 0 }, q = {
682
+ }, Ae = { margin: 0 }, X = {
583
683
  display: "inline-block",
584
684
  textDecoration: "none",
585
685
  cursor: "pointer",
586
686
  backgroundColor: "var(--page-accent, #111827)",
587
687
  color: "var(--page-accent-text, #ffffff)"
588
- }, xe = {
688
+ }, je = {
589
689
  flexGrow: 1,
590
690
  display: "flex",
591
691
  flexDirection: "column",
592
692
  position: "relative"
593
- }, Se = {
693
+ }, Me = {
594
694
  display: "flex",
595
695
  flexDirection: "column"
596
696
  };
597
- function Ce({ style: e }) {
697
+ function Ne({ style: e }) {
598
698
  let t = e?.backgroundVideo;
599
699
  if (!t) return null;
600
700
  let n = {
@@ -620,32 +720,32 @@ function Ce({ style: e }) {
620
720
  background: r
621
721
  } })] });
622
722
  }
623
- var we = (e, t) => e?.backgroundVideo ? {
723
+ var Pe = (e, t) => e?.backgroundVideo ? {
624
724
  position: "relative",
625
725
  ...t,
626
- ...C(e)
726
+ ...A(e)
627
727
  } : {
628
728
  ...t,
629
- ...C(e)
729
+ ...A(e)
630
730
  };
631
- function Te({ style: e, nodeRef: t, children: n }) {
731
+ function Fe({ style: e, nodeRef: t, children: n }) {
632
732
  return /* @__PURE__ */ d("div", {
633
733
  ref: t,
634
734
  style: {
635
- ...xe,
636
- ...C(e)
735
+ ...je,
736
+ ...A(e)
637
737
  },
638
- children: [/* @__PURE__ */ u(Ce, { style: e }), n]
738
+ children: [/* @__PURE__ */ u(Ne, { style: e }), n]
639
739
  });
640
740
  }
641
- function Ee({ style: e, nodeRef: t, children: n }) {
741
+ function Ie({ style: e, nodeRef: t, children: n }) {
642
742
  return /* @__PURE__ */ d("section", {
643
743
  ref: t,
644
- style: we(e, Se),
645
- children: [/* @__PURE__ */ u(Ce, { style: e }), n]
744
+ style: Pe(e, Me),
745
+ children: [/* @__PURE__ */ u(Ne, { style: e }), n]
646
746
  });
647
747
  }
648
- function De({ style: e, freeLayout: t, nodeRef: n, children: r }) {
748
+ function Le({ style: e, freeLayout: t, nodeRef: n, children: r }) {
649
749
  let i = t ? {
650
750
  position: "relative",
651
751
  minHeight: 240
@@ -654,32 +754,32 @@ function De({ style: e, freeLayout: t, nodeRef: n, children: r }) {
654
754
  ref: n,
655
755
  style: i ? {
656
756
  ...i,
657
- ...we(e)
658
- } : we(e),
659
- children: [/* @__PURE__ */ u(Ce, { style: e }), r]
757
+ ...Pe(e)
758
+ } : Pe(e),
759
+ children: [/* @__PURE__ */ u(Ne, { style: e }), r]
660
760
  });
661
761
  }
662
- function Oe({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
762
+ function Re({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
663
763
  return /* @__PURE__ */ u(n, {
664
764
  ref: a,
665
765
  style: {
666
- ...ye,
667
- ...C(r)
766
+ ...ke,
767
+ ...A(r)
668
768
  },
669
- children: J(t, e, i)
769
+ children: Z(t, e, i)
670
770
  });
671
771
  }
672
- var ke = {
673
- fontFamily: z.mono.value,
772
+ var ze = {
773
+ fontFamily: G.mono.value,
674
774
  background: "rgba(148, 163, 184, 0.18)",
675
775
  padding: "1px 5px",
676
776
  borderRadius: 4,
677
777
  fontSize: "0.9em"
678
778
  };
679
- function Ae(e, t = [], n, r) {
779
+ function Be(e, t = [], n, r) {
680
780
  let i = e;
681
781
  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", {
682
- style: ke,
782
+ style: ze,
683
783
  children: i
684
784
  })), 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", {
685
785
  href: n,
@@ -689,13 +789,13 @@ function Ae(e, t = [], n, r) {
689
789
  children: i
690
790
  })), i;
691
791
  }
692
- function J(t, n, r) {
792
+ function Z(t, n, r) {
693
793
  return t?.length ? t.map((t, n) => {
694
794
  if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
695
- if (t.parts) return /* @__PURE__ */ u(e, { children: J(t.parts, "", r) }, n);
795
+ if (t.parts) return /* @__PURE__ */ u(e, { children: Z(t.parts, "", r) }, n);
696
796
  let i = t.text;
697
797
  return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
698
- style: ke,
798
+ style: ze,
699
799
  children: i
700
800
  })), 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", {
701
801
  style: {
@@ -712,13 +812,13 @@ function J(t, n, r) {
712
812
  })), /* @__PURE__ */ u(e, { children: i }, n);
713
813
  }) : n;
714
814
  }
715
- function je({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
815
+ function Ve({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
716
816
  return /* @__PURE__ */ u("span", {
717
- style: C(a),
718
- children: e?.length ? J(e, t) : Ae(t, n, r, i)
817
+ style: A(a),
818
+ children: e?.length ? Z(e, t) : Be(t, n, r, i)
719
819
  });
720
820
  }
721
- var Me = {
821
+ var He = {
722
822
  h1: 40,
723
823
  h2: 32,
724
824
  h3: 26,
@@ -726,7 +826,7 @@ var Me = {
726
826
  h5: 19,
727
827
  h6: 16
728
828
  };
729
- function Ne({ align: e = "center", width: t, wrap: n } = {}) {
829
+ function Ue({ align: e = "center", width: t, wrap: n } = {}) {
730
830
  let r = t ? `${t}%` : void 0;
731
831
  if (e === "full") return { width: "100%" };
732
832
  let i = e === "left" || e === "right";
@@ -760,8 +860,8 @@ function Ne({ align: e = "center", width: t, wrap: n } = {}) {
760
860
  marginRight: "auto"
761
861
  };
762
862
  }
763
- function Pe(e = [], t, n) {
764
- let r = n ?? ((e, n) => J(e, n, t));
863
+ function We(e = [], t, n) {
864
+ let r = n ?? ((e, n) => Z(e, n, t));
765
865
  return e.map((t, n) => {
766
866
  let i = {
767
867
  marginTop: 0,
@@ -783,7 +883,7 @@ function Pe(e = [], t, n) {
783
883
  marginLeft: 0,
784
884
  marginRight: 0,
785
885
  ...i,
786
- ...Ne(t)
886
+ ...Ue(t)
787
887
  },
788
888
  children: [t.href ? /* @__PURE__ */ u("a", {
789
889
  href: t.href,
@@ -802,16 +902,16 @@ function Pe(e = [], t, n) {
802
902
  })]
803
903
  }, n);
804
904
  }
805
- if (t.type === "video") return Ge(t.url) ? /* @__PURE__ */ u("div", {
905
+ if (t.type === "video") return tt(t.url) ? /* @__PURE__ */ u("div", {
806
906
  style: {
807
907
  ...i,
808
- ...Ne({
908
+ ...Ue({
809
909
  align: t.align,
810
910
  wrap: t.wrap,
811
911
  width: t.width ?? 100
812
912
  })
813
913
  },
814
- children: /* @__PURE__ */ u(Ke, {
914
+ children: /* @__PURE__ */ u(nt, {
815
915
  url: t.url,
816
916
  autoplay: t.autoplay,
817
917
  muted: t.muted,
@@ -873,17 +973,17 @@ function Pe(e = [], t, n) {
873
973
  }
874
974
  if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
875
975
  style: {
876
- ...Ie,
976
+ ...Ke,
877
977
  ...i
878
978
  },
879
979
  children: r(t.parts, t.text)
880
980
  }, n);
881
- if (Me[t.type]) {
981
+ if (He[t.type]) {
882
982
  let e = t.type;
883
983
  return /* @__PURE__ */ u(e, {
884
984
  style: {
885
- ...ye,
886
- fontSize: Me[t.type],
985
+ ...ke,
986
+ fontSize: He[t.type],
887
987
  ...i
888
988
  },
889
989
  children: r(t.parts, t.text)
@@ -891,95 +991,95 @@ function Pe(e = [], t, n) {
891
991
  }
892
992
  return /* @__PURE__ */ u("p", {
893
993
  style: {
894
- ...be,
994
+ ...Ae,
895
995
  ...i
896
996
  },
897
997
  children: r(t.parts, t.text)
898
998
  }, n);
899
999
  });
900
1000
  }
901
- function Fe({ content: e, style: t, linked: n, nodeRef: r }) {
1001
+ function Ge({ content: e, style: t, linked: n, nodeRef: r }) {
902
1002
  return /* @__PURE__ */ u("div", {
903
1003
  ref: r,
904
1004
  style: {
905
1005
  display: "flow-root",
906
- ...C(t)
1006
+ ...A(t)
907
1007
  },
908
- children: Pe(e, n)
1008
+ children: We(e, n)
909
1009
  });
910
1010
  }
911
- var Ie = {
1011
+ var Ke = {
912
1012
  margin: 0,
913
1013
  padding: "8px 0 8px 20px",
914
1014
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
915
1015
  };
916
- function Le({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1016
+ function qe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
917
1017
  return /* @__PURE__ */ u("blockquote", {
918
1018
  ref: i,
919
1019
  style: {
920
- ...Ie,
921
- ...C(n)
1020
+ ...Ke,
1021
+ ...A(n)
922
1022
  },
923
- children: J(t, e, r)
1023
+ children: Z(t, e, r)
924
1024
  });
925
1025
  }
926
- function Re({ ordered: e, items: t = [], style: n, nodeRef: r }) {
1026
+ function Je({ ordered: e, items: t = [], style: n, nodeRef: r }) {
927
1027
  return /* @__PURE__ */ u(e ? "ol" : "ul", {
928
1028
  ref: r,
929
1029
  style: {
930
1030
  margin: 0,
931
1031
  paddingLeft: 24,
932
- ...C(n)
1032
+ ...A(n)
933
1033
  },
934
1034
  children: t.map((e, t) => /* @__PURE__ */ u("li", {
935
1035
  style: { marginBottom: 4 },
936
- children: J(e.parts, e.text)
1036
+ children: Z(e.parts, e.text)
937
1037
  }, t))
938
1038
  });
939
1039
  }
940
- function ze({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1040
+ function Ye({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
941
1041
  return /* @__PURE__ */ u("p", {
942
1042
  ref: i,
943
1043
  style: {
944
- ...be,
945
- ...C(n)
1044
+ ...Ae,
1045
+ ...A(n)
946
1046
  },
947
- children: J(t, e, r)
1047
+ children: Z(t, e, r)
948
1048
  });
949
1049
  }
950
- var Be = {
1050
+ var Xe = {
951
1051
  color: "var(--page-accent, inherit)",
952
1052
  textDecoration: "underline",
953
1053
  textUnderlineOffset: 3,
954
1054
  cursor: "pointer"
955
1055
  };
956
- function Ve({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1056
+ function Ze({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
957
1057
  return /* @__PURE__ */ u("a", {
958
1058
  ref: o,
959
1059
  href: n || "#",
960
1060
  target: r || void 0,
961
1061
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
962
1062
  style: {
963
- ...Be,
964
- ...C(i)
1063
+ ...Xe,
1064
+ ...A(i)
965
1065
  },
966
- children: J(t, e, a)
1066
+ children: Z(t, e, a)
967
1067
  });
968
1068
  }
969
- function He({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1069
+ function Qe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
970
1070
  return /* @__PURE__ */ u("a", {
971
1071
  ref: o,
972
1072
  href: n || "#",
973
1073
  target: r || void 0,
974
1074
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
975
1075
  style: {
976
- ...q,
977
- ...C(i)
1076
+ ...X,
1077
+ ...A(i)
978
1078
  },
979
- children: J(t, e, a)
1079
+ children: Z(t, e, a)
980
1080
  });
981
1081
  }
982
- function Ue({ src: e, alt: t, style: n, nodeRef: r }) {
1082
+ function $e({ src: e, alt: t, style: n, nodeRef: r }) {
983
1083
  return e ? /* @__PURE__ */ u("img", {
984
1084
  ref: r,
985
1085
  src: e,
@@ -987,11 +1087,11 @@ function Ue({ src: e, alt: t, style: n, nodeRef: r }) {
987
1087
  style: {
988
1088
  display: "block",
989
1089
  maxWidth: "100%",
990
- ...C(n)
1090
+ ...A(n)
991
1091
  }
992
1092
  }) : null;
993
1093
  }
994
- function We({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
1094
+ function et({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
995
1095
  return e ? /* @__PURE__ */ u("video", {
996
1096
  ref: s,
997
1097
  src: e,
@@ -1005,13 +1105,13 @@ function We({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
1005
1105
  display: "block",
1006
1106
  width: "100%",
1007
1107
  maxWidth: "100%",
1008
- ...C(o)
1108
+ ...A(o)
1009
1109
  }
1010
1110
  }) : null;
1011
1111
  }
1012
- var Ge = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
1013
- function Ke({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
1014
- let c = Ge(e);
1112
+ var tt = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
1113
+ function nt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
1114
+ let c = tt(e);
1015
1115
  if (!c) return null;
1016
1116
  let l = new URLSearchParams({ rel: "0" });
1017
1117
  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", {
@@ -1020,7 +1120,7 @@ function Ke({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
1020
1120
  position: "relative",
1021
1121
  width: "100%",
1022
1122
  paddingTop: "56.25%",
1023
- ...C(o)
1123
+ ...A(o)
1024
1124
  },
1025
1125
  children: /* @__PURE__ */ u("iframe", {
1026
1126
  src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
@@ -1037,7 +1137,7 @@ function Ke({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
1037
1137
  })
1038
1138
  });
1039
1139
  }
1040
- function qe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
1140
+ function rt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
1041
1141
  return e ? /* @__PURE__ */ u("iframe", {
1042
1142
  ref: i,
1043
1143
  src: e,
@@ -1049,11 +1149,11 @@ function qe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
1049
1149
  width: "100%",
1050
1150
  height: 300,
1051
1151
  border: 0,
1052
- ...C(r)
1152
+ ...A(r)
1053
1153
  }
1054
1154
  }) : null;
1055
1155
  }
1056
- function Je({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1156
+ function it({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1057
1157
  let [a, o] = c(null);
1058
1158
  return i(() => {
1059
1159
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
@@ -1069,10 +1169,10 @@ function Je({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1069
1169
  ref: (e) => {
1070
1170
  o(e), r && r(e);
1071
1171
  },
1072
- style: C(n)
1172
+ style: A(n)
1073
1173
  });
1074
1174
  }
1075
- function Ye({ height: e, nodeRef: t }) {
1175
+ function at({ height: e, nodeRef: t }) {
1076
1176
  return /* @__PURE__ */ u("div", {
1077
1177
  ref: t,
1078
1178
  style: {
@@ -1082,18 +1182,18 @@ function Ye({ height: e, nodeRef: t }) {
1082
1182
  }
1083
1183
  });
1084
1184
  }
1085
- function Xe({ style: e, nodeRef: t }) {
1185
+ function ot({ style: e, nodeRef: t }) {
1086
1186
  return /* @__PURE__ */ u("div", {
1087
1187
  ref: t,
1088
1188
  style: {
1089
1189
  height: 1,
1090
1190
  alignSelf: "stretch",
1091
1191
  flexShrink: 0,
1092
- ...C(e)
1192
+ ...A(e)
1093
1193
  }
1094
1194
  });
1095
1195
  }
1096
- var Ze = {
1196
+ var st = {
1097
1197
  position: "absolute",
1098
1198
  top: "50%",
1099
1199
  transform: "translateY(-50%)",
@@ -1110,7 +1210,7 @@ var Ze = {
1110
1210
  alignItems: "center",
1111
1211
  justifyContent: "center",
1112
1212
  padding: 0
1113
- }, Qe = {
1213
+ }, ct = {
1114
1214
  bottom: {
1115
1215
  inset: "auto 0 0 0",
1116
1216
  padding: "40px 24px 20px",
@@ -1129,8 +1229,8 @@ var Ze = {
1129
1229
  padding: 24,
1130
1230
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1131
1231
  }
1132
- }, $e = 48;
1133
- function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1232
+ }, lt = 48;
1233
+ function ut({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1134
1234
  let [p, m] = c(0), [h, g] = c(!1), [_, v] = c(null), y = e ? Math.min(p, e - 1) : 0;
1135
1235
  if (i(() => {
1136
1236
  if (!n || h || _ || e < 2) return;
@@ -1146,7 +1246,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1146
1246
  let b = (t) => m((t + e) % e), x = () => {
1147
1247
  if (!_) return;
1148
1248
  let { dx: e } = _;
1149
- v(null), e < -48 ? b(y + 1) : e > $e && b(y - 1);
1249
+ v(null), e < -48 ? b(y + 1) : e > lt && b(y - 1);
1150
1250
  };
1151
1251
  return /* @__PURE__ */ d("div", {
1152
1252
  ref: f,
@@ -1171,7 +1271,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1171
1271
  touchAction: "pan-y",
1172
1272
  userSelect: _ ? "none" : void 0,
1173
1273
  cursor: _ ? "grabbing" : void 0,
1174
- ...C(s)
1274
+ ...A(s)
1175
1275
  },
1176
1276
  children: [/* @__PURE__ */ u("div", {
1177
1277
  style: {
@@ -1194,7 +1294,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1194
1294
  type: "button",
1195
1295
  "aria-label": "Previous slide",
1196
1296
  style: {
1197
- ...Ze,
1297
+ ...st,
1198
1298
  left: 12
1199
1299
  },
1200
1300
  onClick: () => b(y - 1),
@@ -1204,7 +1304,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1204
1304
  type: "button",
1205
1305
  "aria-label": "Next slide",
1206
1306
  style: {
1207
- ...Ze,
1307
+ ...st,
1208
1308
  right: 12
1209
1309
  },
1210
1310
  onClick: () => b(y + 1),
@@ -1238,7 +1338,7 @@ function et({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1238
1338
  ] })]
1239
1339
  });
1240
1340
  }
1241
- var tt = (e, t) => ({
1341
+ var dt = (e, t) => ({
1242
1342
  position: "absolute",
1243
1343
  inset: 0,
1244
1344
  backgroundImage: e ? `url(${e})` : "none",
@@ -1246,18 +1346,18 @@ var tt = (e, t) => ({
1246
1346
  backgroundSize: "cover",
1247
1347
  backgroundPosition: "center"
1248
1348
  });
1249
- function nt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1250
- return e.length ? /* @__PURE__ */ u(et, {
1349
+ function ft({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1350
+ return e.length ? /* @__PURE__ */ u(ut, {
1251
1351
  ...r,
1252
1352
  count: e.length,
1253
1353
  renderSlide: (r) => {
1254
1354
  let i = e[r];
1255
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: tt(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1355
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: dt(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1256
1356
  style: {
1257
1357
  position: "absolute",
1258
1358
  color: "#fff",
1259
1359
  textAlign: n,
1260
- ...Qe[t] ?? Qe.bottom
1360
+ ...ct[t] ?? ct.bottom
1261
1361
  },
1262
1362
  children: [i.title && /* @__PURE__ */ u("div", {
1263
1363
  style: {
@@ -1277,13 +1377,13 @@ function nt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1277
1377
  }
1278
1378
  }) : null;
1279
1379
  }
1280
- function rt({ slides: e = [], linked: t, ...n }) {
1281
- return e.length ? /* @__PURE__ */ u(et, {
1380
+ function pt({ slides: e = [], linked: t, ...n }) {
1381
+ return e.length ? /* @__PURE__ */ u(ut, {
1282
1382
  ...n,
1283
1383
  count: e.length,
1284
1384
  renderSlide: (n) => {
1285
1385
  let r = e[n];
1286
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: tt(r.image, r.color) }), /* @__PURE__ */ u("div", {
1386
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: dt(r.image, r.color) }), /* @__PURE__ */ u("div", {
1287
1387
  style: {
1288
1388
  position: "absolute",
1289
1389
  inset: 0,
@@ -1295,7 +1395,7 @@ function rt({ slides: e = [], linked: t, ...n }) {
1295
1395
  }
1296
1396
  }) : null;
1297
1397
  }
1298
- function it({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lightbox: a = !0, style: o, nodeRef: s, inert: f }) {
1398
+ function mt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lightbox: a = !0, style: o, nodeRef: s, inert: f }) {
1299
1399
  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];
1300
1400
  i(() => {
1301
1401
  if (!v) return;
@@ -1320,7 +1420,7 @@ function it({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1320
1420
  columnCount: Math.min(Math.max(Number(t) || 3, 1), 8),
1321
1421
  columnGap: m,
1322
1422
  width: "100%",
1323
- ...C(o)
1423
+ ...A(o)
1324
1424
  },
1325
1425
  children: [
1326
1426
  p.map((e, t) => {
@@ -1494,45 +1594,136 @@ function it({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
1494
1594
  ]
1495
1595
  });
1496
1596
  }
1497
- var at = {
1597
+ var ht = {
1498
1598
  color: "inherit",
1499
1599
  textDecoration: "none",
1500
1600
  fontSize: 14,
1501
1601
  opacity: .85
1502
- }, ot = {
1602
+ }, gt = {
1503
1603
  background: "var(--page-surface, #f2f2f2)",
1504
1604
  color: "var(--page-text, #111827)",
1505
1605
  border: "1px solid rgba(148, 163, 184, 0.25)",
1506
1606
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1507
1607
  zIndex: 60
1508
1608
  };
1509
- function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], style: s, nodeRef: f, menu: p = "auto", breakpoint: m = 768 }) {
1510
- let [h, g] = c(null), [_, v] = c(!1), [y, b] = c(!1), [x, S] = c(null);
1609
+ function _t(e, t = {}, n = "dropdown") {
1610
+ let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" : Y(e), o = r.map((e) => {
1611
+ let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
1612
+ return {
1613
+ key: e.id,
1614
+ parent: (r && typeof r == "object" ? r.id : r) || null,
1615
+ label: a(n[t.labelField || "name"]) || a(n.name) || "Untitled",
1616
+ href: t.hrefField ? a(n[t.hrefField]) : "",
1617
+ image: t.imageField && i(n[t.imageField]) || "",
1618
+ desc: t.descField ? a(n[t.descField]) : ""
1619
+ };
1620
+ }), s = new Map(o.map((e) => [e.key, e])), c = (e) => {
1621
+ let t = /* @__PURE__ */ new Set(), n = e;
1622
+ for (; n.parent && s.has(n.parent) && !t.has(n.key);) t.add(n.key), n = s.get(n.parent);
1623
+ return n;
1624
+ }, l = [], u = /* @__PURE__ */ new Map();
1625
+ for (let e of o) {
1626
+ if (c(e) !== e) continue;
1627
+ let t = {
1628
+ key: e.key,
1629
+ label: e.label,
1630
+ href: e.href,
1631
+ image: e.image,
1632
+ children: []
1633
+ };
1634
+ u.set(e.key, t), l.push(t);
1635
+ }
1636
+ for (let e of o) {
1637
+ let t = c(e);
1638
+ t !== e && u.get(t.key)?.children.push({
1639
+ key: e.key,
1640
+ label: e.label,
1641
+ href: e.href,
1642
+ image: e.image,
1643
+ desc: e.desc
1644
+ });
1645
+ }
1646
+ return l.map((e) => ({
1647
+ ...e,
1648
+ type: e.children.length ? n : "link"
1649
+ }));
1650
+ }
1651
+ function vt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], style: f, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
1652
+ let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(q), P = r(J)?.[g], [F, I] = c(null);
1511
1653
  i(() => {
1512
- if (!h) return;
1513
- let e = new ResizeObserver(() => v(h.offsetWidth < m));
1514
- return e.observe(h), () => e.disconnect();
1515
- }, [h, m]);
1516
- let w = p === "hamburger" || p === "auto" && _, T = (e, t) => /* @__PURE__ */ d("a", {
1517
- href: e.href || "#",
1518
- style: {
1519
- ...at,
1520
- display: "block",
1521
- ...t
1522
- },
1523
- children: [e.label, e.desc && /* @__PURE__ */ u("span", {
1524
- style: {
1654
+ if (!g || P) return;
1655
+ let e = !0;
1656
+ return fetch(`${N}/dynamic/${encodeURIComponent(g)}`, { headers: M ? { "x-tenant": M } : {} }).then((e) => e.json()).then((t) => {
1657
+ let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
1658
+ e && I(n);
1659
+ }).catch(() => e && I([])), () => {
1660
+ e = !1;
1661
+ };
1662
+ }, [
1663
+ g,
1664
+ M,
1665
+ N,
1666
+ P
1667
+ ]), i(() => {
1668
+ if (!C) return;
1669
+ let e = new ResizeObserver(() => E(C.offsetWidth < h));
1670
+ return e.observe(C), () => e.disconnect();
1671
+ }, [C, h]);
1672
+ let L = g ? _t(P ?? F ?? [], {
1673
+ labelField: _,
1674
+ hrefField: v,
1675
+ imageField: y,
1676
+ descField: b,
1677
+ parentField: x
1678
+ }, S) : s, R = m === "hamburger" || m === "auto" && T, z = (e, t, n = !1) => {
1679
+ let r = e.image ? /* @__PURE__ */ u("img", {
1680
+ src: e.image,
1681
+ alt: "",
1682
+ style: n ? {
1683
+ width: "100%",
1684
+ aspectRatio: "16 / 9",
1685
+ objectFit: "cover",
1686
+ borderRadius: 6,
1525
1687
  display: "block",
1526
- fontSize: 12,
1527
- opacity: .6,
1528
- marginTop: 2
1688
+ marginBottom: 8
1689
+ } : {
1690
+ width: 22,
1691
+ height: 22,
1692
+ objectFit: "cover",
1693
+ borderRadius: 4,
1694
+ display: "block",
1695
+ flexShrink: 0
1696
+ }
1697
+ }) : null;
1698
+ return /* @__PURE__ */ d("a", {
1699
+ href: e.href || "#",
1700
+ style: {
1701
+ ...ht,
1702
+ display: n ? "block" : "flex",
1703
+ alignItems: n ? void 0 : "center",
1704
+ gap: n ? void 0 : 10,
1705
+ ...t
1529
1706
  },
1530
- children: e.desc
1531
- })]
1532
- }, e.key);
1707
+ children: [r, /* @__PURE__ */ d("span", {
1708
+ style: {
1709
+ display: "block",
1710
+ minWidth: 0
1711
+ },
1712
+ children: [e.label, e.desc && /* @__PURE__ */ u("span", {
1713
+ style: {
1714
+ display: "block",
1715
+ fontSize: 12,
1716
+ opacity: .6,
1717
+ marginTop: 2
1718
+ },
1719
+ children: e.desc
1720
+ })]
1721
+ })]
1722
+ }, e.key);
1723
+ };
1533
1724
  return /* @__PURE__ */ d("nav", {
1534
1725
  ref: (e) => {
1535
- g(e), f && f(e);
1726
+ w(e), p && p(e);
1536
1727
  },
1537
1728
  style: {
1538
1729
  display: "flex",
@@ -1542,7 +1733,7 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1542
1733
  padding: "14px 24px",
1543
1734
  width: "100%",
1544
1735
  position: "relative",
1545
- ...C(s)
1736
+ ...A(f)
1546
1737
  },
1547
1738
  children: [
1548
1739
  (n || t) && (() => {
@@ -1560,29 +1751,29 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1560
1751
  fontFamily: "var(--page-heading-font, inherit)"
1561
1752
  },
1562
1753
  children: t
1563
- })] }), i = {
1754
+ })] }), r = {
1564
1755
  display: "flex",
1565
1756
  alignItems: "center",
1566
1757
  gap: 10,
1567
1758
  color: "inherit",
1568
1759
  textDecoration: "none"
1569
1760
  };
1570
- return r ? /* @__PURE__ */ u("a", {
1571
- href: r,
1572
- target: a || void 0,
1573
- rel: a === "_blank" ? "noopener noreferrer" : void 0,
1574
- style: i,
1761
+ return a ? /* @__PURE__ */ u("a", {
1762
+ href: a,
1763
+ target: o || void 0,
1764
+ rel: o === "_blank" ? "noopener noreferrer" : void 0,
1765
+ style: r,
1575
1766
  children: e
1576
1767
  }) : /* @__PURE__ */ u("div", {
1577
- style: i,
1768
+ style: r,
1578
1769
  children: e
1579
1770
  });
1580
1771
  })(),
1581
1772
  /* @__PURE__ */ u("div", { style: { flexGrow: 1 } }),
1582
- w ? /* @__PURE__ */ u("button", {
1773
+ R ? /* @__PURE__ */ u("button", {
1583
1774
  type: "button",
1584
- "aria-label": y ? "Close menu" : "Open menu",
1585
- onClick: () => b(!y),
1775
+ "aria-label": D ? "Close menu" : "Open menu",
1776
+ onClick: () => O(!D),
1586
1777
  style: {
1587
1778
  background: "transparent",
1588
1779
  border: 0,
@@ -1592,7 +1783,7 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1592
1783
  lineHeight: 1,
1593
1784
  padding: 4
1594
1785
  },
1595
- children: y ? "✕" : "☰"
1786
+ children: D ? "✕" : "☰"
1596
1787
  }) : /* @__PURE__ */ u("div", {
1597
1788
  style: {
1598
1789
  display: "flex",
@@ -1600,11 +1791,11 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1600
1791
  alignItems: "center",
1601
1792
  flexWrap: "wrap"
1602
1793
  },
1603
- children: o.map((e) => {
1794
+ children: L.map((e) => {
1604
1795
  let t = e.children ?? [];
1605
1796
  if (!t.length) return /* @__PURE__ */ u("a", {
1606
1797
  href: e.href || "#",
1607
- style: at,
1798
+ style: ht,
1608
1799
  children: e.label
1609
1800
  }, e.key);
1610
1801
  let n = e.type === "mega";
@@ -1613,12 +1804,12 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1613
1804
  position: n ? "static" : "relative",
1614
1805
  display: "inline-flex"
1615
1806
  },
1616
- onMouseEnter: () => S(e.key),
1617
- onMouseLeave: () => S(null),
1807
+ onMouseEnter: () => j(e.key),
1808
+ onMouseLeave: () => j(null),
1618
1809
  children: [/* @__PURE__ */ d("a", {
1619
1810
  href: e.href || "#",
1620
1811
  style: {
1621
- ...at,
1812
+ ...ht,
1622
1813
  cursor: "pointer"
1623
1814
  },
1624
1815
  children: [
@@ -1632,9 +1823,9 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1632
1823
  children: "▼"
1633
1824
  })
1634
1825
  ]
1635
- }), x === e.key && (n ? /* @__PURE__ */ u("div", {
1826
+ }), k === e.key && (n ? /* @__PURE__ */ u("div", {
1636
1827
  style: {
1637
- ...ot,
1828
+ ...gt,
1638
1829
  position: "absolute",
1639
1830
  left: 0,
1640
1831
  right: 0,
@@ -1644,13 +1835,13 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1644
1835
  gridTemplateColumns: "repeat(auto-fit, minmax(170px, 1fr))",
1645
1836
  gap: 16
1646
1837
  },
1647
- children: t.map((e) => T(e, {
1648
- padding: "6px 8px",
1649
- borderRadius: 6
1650
- }))
1838
+ children: t.map((e) => z(e, {
1839
+ padding: 8,
1840
+ borderRadius: 8
1841
+ }, !0))
1651
1842
  }) : /* @__PURE__ */ u("div", {
1652
1843
  style: {
1653
- ...ot,
1844
+ ...gt,
1654
1845
  position: "absolute",
1655
1846
  top: "100%",
1656
1847
  left: 0,
@@ -1660,7 +1851,7 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1660
1851
  display: "flex",
1661
1852
  flexDirection: "column"
1662
1853
  },
1663
- children: t.map((e) => T(e, {
1854
+ children: t.map((e) => z(e, {
1664
1855
  padding: "8px 12px",
1665
1856
  borderRadius: 6
1666
1857
  }))
@@ -1668,7 +1859,7 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1668
1859
  }, e.key);
1669
1860
  })
1670
1861
  }),
1671
- w && y && /* @__PURE__ */ u("div", {
1862
+ R && D && /* @__PURE__ */ u("div", {
1672
1863
  style: {
1673
1864
  flexBasis: "100%",
1674
1865
  width: "100%",
@@ -1676,27 +1867,27 @@ function st({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
1676
1867
  flexDirection: "column",
1677
1868
  paddingTop: 10
1678
1869
  },
1679
- children: o.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
1870
+ children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
1680
1871
  href: t.href || "#",
1681
1872
  style: {
1682
- ...at,
1873
+ ...ht,
1683
1874
  padding: "10px 4px",
1684
1875
  fontWeight: (t.children ?? []).length ? 600 : 400,
1685
1876
  opacity: 1
1686
1877
  },
1687
1878
  children: t.label
1688
- }), (t.children ?? []).map((e) => T(e, { padding: "8px 4px 8px 22px" }))] }, t.key))
1879
+ }), (t.children ?? []).map((e) => z(e, { padding: "8px 4px 8px 22px" }))] }, t.key))
1689
1880
  })
1690
1881
  ]
1691
1882
  });
1692
1883
  }
1693
- function ct({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1884
+ function yt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1694
1885
  let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1695
1886
  return e.length ? /* @__PURE__ */ d("div", {
1696
1887
  ref: r,
1697
1888
  style: {
1698
1889
  width: "100%",
1699
- ...C(n)
1890
+ ...A(n)
1700
1891
  },
1701
1892
  children: [/* @__PURE__ */ u("div", {
1702
1893
  style: {
@@ -1730,7 +1921,7 @@ function ct({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1730
1921
  }, e.key))]
1731
1922
  }) : null;
1732
1923
  }
1733
- function lt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1924
+ function bt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1734
1925
  let [a, o] = c(() => new Set(e.length ? [e[0].key] : []));
1735
1926
  if (!e.length) return null;
1736
1927
  let s = (e) => o((t) => {
@@ -1741,7 +1932,7 @@ function lt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1741
1932
  ref: i,
1742
1933
  style: {
1743
1934
  width: "100%",
1744
- ...C(r)
1935
+ ...A(r)
1745
1936
  },
1746
1937
  children: e.map((n, r) => {
1747
1938
  let i = a.has(n.key);
@@ -1787,15 +1978,15 @@ function lt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1787
1978
  })
1788
1979
  });
1789
1980
  }
1790
- var ut = {
1981
+ var xt = {
1791
1982
  display: "flex",
1792
1983
  flexDirection: "column",
1793
1984
  gap: "12px"
1794
- }, Y = {
1985
+ }, St = {
1795
1986
  fontSize: "14px",
1796
1987
  fontWeight: 500,
1797
1988
  color: "var(--page-text, #111827)"
1798
- }, X = {
1989
+ }, Q = {
1799
1990
  padding: "10px 12px",
1800
1991
  border: "1px solid var(--page-border, #d1d5db)",
1801
1992
  borderRadius: "6px",
@@ -1805,18 +1996,18 @@ var ut = {
1805
1996
  boxSizing: "border-box",
1806
1997
  backgroundColor: "var(--page-surface, #f2f2f2)",
1807
1998
  color: "var(--page-text, #111827)"
1808
- }, dt = {
1999
+ }, Ct = {
1809
2000
  display: "flex",
1810
2001
  alignItems: "center",
1811
2002
  gap: "8px",
1812
2003
  fontSize: "14px",
1813
2004
  color: "var(--page-text, #111827)"
1814
- }, Z = (e) => e ? {
2005
+ }, $ = (e) => e ? {
1815
2006
  readOnly: !0,
1816
2007
  tabIndex: -1,
1817
2008
  onMouseDown: (e) => e.preventDefault()
1818
2009
  } : {};
1819
- function ft(e, t) {
2010
+ function wt(e, t) {
1820
2011
  if (!e) return !0;
1821
2012
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1822
2013
  switch (e.op) {
@@ -1830,11 +2021,11 @@ function ft(e, t) {
1830
2021
  default: return !1;
1831
2022
  }
1832
2023
  }
1833
- var pt = {
2024
+ var Tt = {
1834
2025
  display: "flex",
1835
2026
  flexDirection: "column",
1836
2027
  gap: 6
1837
- }, mt = {
2028
+ }, Et = {
1838
2029
  font: "inherit",
1839
2030
  fontSize: 15,
1840
2031
  padding: "10px 12px",
@@ -1845,16 +2036,16 @@ var pt = {
1845
2036
  width: "100%",
1846
2037
  boxSizing: "border-box"
1847
2038
  };
1848
- function ht(e, t) {
2039
+ function Dt(e, t) {
1849
2040
  let n = Array.isArray(e?.options) ? e.options : [];
1850
2041
  if (!e?.parentField) return n;
1851
2042
  let r = t?.[e.parentField];
1852
2043
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
1853
2044
  }
1854
- function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2045
+ function Ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
1855
2046
  let a = /* @__PURE__ */ d("span", {
1856
2047
  style: {
1857
- ...Y,
2048
+ ...St,
1858
2049
  fontSize: 14
1859
2050
  },
1860
2051
  children: [e.label, e.required ? " *" : ""]
@@ -1863,7 +2054,7 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1863
2054
  required: e.required || void 0,
1864
2055
  placeholder: e.placeholder || void 0,
1865
2056
  disabled: r || void 0,
1866
- style: mt,
2057
+ style: Et,
1867
2058
  value: t ?? "",
1868
2059
  onChange: (t) => n(e.name, t.target.value)
1869
2060
  };
@@ -1892,7 +2083,7 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1892
2083
  borderRadius: 8,
1893
2084
  display: "block"
1894
2085
  }
1895
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Ke, {
2086
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(nt, {
1896
2087
  url: e.src,
1897
2088
  style: { width: "100%" }
1898
2089
  }) : /* @__PURE__ */ u("video", {
@@ -1904,14 +2095,14 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1904
2095
  display: "block"
1905
2096
  }
1906
2097
  }) : null : /* @__PURE__ */ d("label", {
1907
- style: pt,
2098
+ style: Tt,
1908
2099
  children: [
1909
2100
  a,
1910
2101
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
1911
2102
  ...o,
1912
2103
  rows: 4,
1913
2104
  style: {
1914
- ...mt,
2105
+ ...Et,
1915
2106
  resize: "vertical"
1916
2107
  }
1917
2108
  }) : e.type === "select" ? /* @__PURE__ */ d("select", {
@@ -1920,7 +2111,7 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1920
2111
  children: [/* @__PURE__ */ u("option", {
1921
2112
  value: "",
1922
2113
  children: e.placeholder || "—"
1923
- }), ht(e, i).map((e, t) => /* @__PURE__ */ u("option", {
2114
+ }), Dt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
1924
2115
  value: typeof e == "string" ? e : e.value,
1925
2116
  children: typeof e == "string" ? e : e.label ?? e.value
1926
2117
  }, t))]
@@ -1967,12 +2158,12 @@ function gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1967
2158
  ]
1968
2159
  });
1969
2160
  }
1970
- function _t({ 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 }) {
1971
- 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;
2161
+ function kt({ 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 }) {
2162
+ let { tenant: y, apiUrl: b } = r(q), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
1972
2163
  i(() => {
1973
2164
  if (!f || !s) return;
1974
2165
  let e = !0;
1975
- 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)), () => {
2166
+ return fetch(`${b || "/api"}/forms/${encodeURIComponent(s)}`, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((t) => e && w(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && w(null)), () => {
1976
2167
  e = !1;
1977
2168
  };
1978
2169
  }, [
@@ -1985,27 +2176,27 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
1985
2176
  section: null,
1986
2177
  fields: []
1987
2178
  }];
1988
- for (let e of Array.isArray(w?.fields) ? w.fields : []) e.type === "section" ? j.push({
2179
+ for (let e of Array.isArray(C?.fields) ? C.fields : []) e.type === "section" ? j.push({
1989
2180
  section: e,
1990
2181
  fields: []
1991
2182
  }) : j[j.length - 1].fields.push(e);
1992
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || ft(e.section.condition, E)).map((e) => ({
2183
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || wt(e.section.condition, T)).map((e) => ({
1993
2184
  ...e,
1994
- fields: e.fields.filter((e) => ft(e.condition, E))
1995
- })), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), ee = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), I = ee.filter((e) => {
1996
- let t = E[e.name];
2185
+ fields: e.fields.filter((e) => wt(e.condition, T))
2186
+ })), P = M.length > 1, F = Math.min(D, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
2187
+ let t = T[e.name];
1997
2188
  return e.required && (t == null || t === "" || t === !1);
1998
- }), L = F >= N.length - 1, R = (e, t) => D((n) => {
2189
+ }), R = F >= N.length - 1, z = (e, t) => E((n) => {
1999
2190
  let r = {
2000
2191
  ...n,
2001
2192
  [e]: t
2002
2193
  };
2003
- for (let t of Array.isArray(w?.fields) ? w.fields : []) t?.parentField === e && delete r[t.name];
2194
+ for (let t of Array.isArray(C?.fields) ? C.fields : []) t?.parentField === e && delete r[t.name];
2004
2195
  return r;
2005
2196
  });
2006
2197
  return /* @__PURE__ */ d("div", {
2007
2198
  ref: m,
2008
- style: C(e),
2199
+ style: A(e),
2009
2200
  children: [
2010
2201
  /* @__PURE__ */ u("form", {
2011
2202
  action: t || void 0,
@@ -2016,7 +2207,7 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2016
2207
  if (e.preventDefault(), !h) {
2017
2208
  if (s) {
2018
2209
  let t = {};
2019
- if (f) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
2210
+ if (f) for (let [e, n] of Object.entries(T)) n != null && n !== "" && (t[e] = n);
2020
2211
  else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
2021
2212
  try {
2022
2213
  let e = await fetch(`${b || "/api"}/forms/${s}/submit`, {
@@ -2049,11 +2240,11 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2049
2240
  }
2050
2241
  },
2051
2242
  style: {
2052
- ...ut,
2053
- display: A === "success" ? "none" : "flex"
2243
+ ...xt,
2244
+ display: k === "success" ? "none" : "flex"
2054
2245
  },
2055
2246
  children: f && s ? /* @__PURE__ */ d(l, { children: [
2056
- P && /* @__PURE__ */ u(Ut, {
2247
+ P && /* @__PURE__ */ u(rn, {
2057
2248
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
2058
2249
  active: F + 1,
2059
2250
  style: { marginBottom: 8 }
@@ -2066,11 +2257,11 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2066
2257
  },
2067
2258
  children: N[F].section.help
2068
2259
  }),
2069
- ee.map((e) => /* @__PURE__ */ u(gt, {
2260
+ I.map((e) => /* @__PURE__ */ u(Ot, {
2070
2261
  field: e,
2071
- value: E[e.name],
2072
- values: E,
2073
- onChange: R,
2262
+ value: T[e.name],
2263
+ values: T,
2264
+ onChange: z,
2074
2265
  inert: h
2075
2266
  }, e.name)),
2076
2267
  /* @__PURE__ */ d("div", {
@@ -2083,9 +2274,9 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2083
2274
  children: [P && F > 0 && /* @__PURE__ */ u("button", {
2084
2275
  type: "button",
2085
2276
  disabled: h || void 0,
2086
- onClick: () => k(F - 1),
2277
+ onClick: () => O(F - 1),
2087
2278
  style: {
2088
- ...q,
2279
+ ...X,
2089
2280
  background: "transparent",
2090
2281
  color: "inherit",
2091
2282
  border: 0,
@@ -2093,26 +2284,26 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2093
2284
  cursor: "pointer"
2094
2285
  },
2095
2286
  children: "Back"
2096
- }), P && !L ? /* @__PURE__ */ u("button", {
2287
+ }), P && !R ? /* @__PURE__ */ u("button", {
2097
2288
  type: "button",
2098
- disabled: h || I.length > 0,
2099
- onClick: () => k(F + 1),
2289
+ disabled: h || L.length > 0,
2290
+ onClick: () => O(F + 1),
2100
2291
  style: {
2101
- ...q,
2292
+ ...X,
2102
2293
  border: 0,
2103
2294
  padding: "10px 22px",
2104
2295
  borderRadius: 8,
2105
2296
  fontSize: 15,
2106
2297
  fontWeight: 600,
2107
2298
  cursor: "pointer",
2108
- opacity: I.length ? .5 : 1
2299
+ opacity: L.length ? .5 : 1
2109
2300
  },
2110
2301
  children: "Next"
2111
2302
  }) : /* @__PURE__ */ u("button", {
2112
2303
  type: "submit",
2113
2304
  disabled: h || void 0,
2114
2305
  style: {
2115
- ...q,
2306
+ ...X,
2116
2307
  border: 0,
2117
2308
  padding: "10px 22px",
2118
2309
  borderRadius: 8,
@@ -2126,12 +2317,12 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2126
2317
  ] }) : g
2127
2318
  }),
2128
2319
  /* @__PURE__ */ u("div", {
2129
- style: { display: A === "success" ? "block" : "none" },
2320
+ style: { display: k === "success" ? "block" : "none" },
2130
2321
  children: _?.success ?? null
2131
2322
  }),
2132
2323
  /* @__PURE__ */ u("div", {
2133
2324
  style: {
2134
- display: A === "error" ? "block" : "none",
2325
+ display: k === "error" ? "block" : "none",
2135
2326
  marginTop: 12
2136
2327
  },
2137
2328
  children: _?.error ?? null
@@ -2139,10 +2330,10 @@ function _t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2139
2330
  ]
2140
2331
  });
2141
2332
  }
2142
- var Q = null, vt = null, yt = (e) => {
2333
+ var At = null, jt = null, Mt = (e) => {
2143
2334
  let t = typeof e == "string" && e.trim() ? e.trim() : "";
2144
- if (Q && vt === t) return Q;
2145
- if (Q && typeof window < "u") {
2335
+ if (At && jt === t) return At;
2336
+ if (At && typeof window < "u") {
2146
2337
  for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
2147
2338
  delete window[e];
2148
2339
  } catch {
@@ -2150,22 +2341,22 @@ var Q = null, vt = null, yt = (e) => {
2150
2341
  }
2151
2342
  document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
2152
2343
  }
2153
- return vt = t, Q = new Promise((e) => {
2344
+ return jt = t, At = new Promise((e) => {
2154
2345
  if (typeof window > "u") return;
2155
2346
  if (window.grecaptcha?.render) return e(window.grecaptcha);
2156
2347
  window.__webimRecaptchaReady = () => e(window.grecaptcha);
2157
2348
  let n = document.createElement("script");
2158
2349
  n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
2159
- }), Q;
2350
+ }), At;
2160
2351
  };
2161
- function bt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
2162
- 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);
2352
+ function Nt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
2353
+ let p = r(q), 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);
2163
2354
  if (_.current = f, i(() => {
2164
2355
  if (l || !h || !g.current) return;
2165
2356
  let e = !0, r = (t) => {
2166
2357
  e && typeof _.current == "function" && _.current(t);
2167
2358
  };
2168
- return yt(a).then((i) => {
2359
+ return Mt(a).then((i) => {
2169
2360
  if (!(!e || !g.current || !i?.render)) {
2170
2361
  g.current.innerHTML = "", r("");
2171
2362
  try {
@@ -2192,7 +2383,7 @@ function bt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
2192
2383
  let e = t === "dark";
2193
2384
  return /* @__PURE__ */ d("div", {
2194
2385
  ref: c,
2195
- style: C(o),
2386
+ style: A(o),
2196
2387
  children: [/* @__PURE__ */ d("div", {
2197
2388
  style: {
2198
2389
  width: n === "compact" ? 164 : 302,
@@ -2243,21 +2434,21 @@ function bt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
2243
2434
  }
2244
2435
  return h ? /* @__PURE__ */ u("div", {
2245
2436
  ref: c,
2246
- style: C(o),
2437
+ style: A(o),
2247
2438
  children: /* @__PURE__ */ u("div", { ref: g })
2248
2439
  }) : null;
2249
2440
  }
2250
- function xt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2441
+ function Pt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2251
2442
  return /* @__PURE__ */ u("label", {
2252
2443
  ref: r,
2253
2444
  style: {
2254
- ...Y,
2255
- ...C(n)
2445
+ ...St,
2446
+ ...A(n)
2256
2447
  },
2257
- children: J(t, e, i)
2448
+ children: Z(t, e, i)
2258
2449
  });
2259
2450
  }
2260
- function St({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2451
+ function Ft({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2261
2452
  return /* @__PURE__ */ u("input", {
2262
2453
  ref: a,
2263
2454
  type: e,
@@ -2265,13 +2456,13 @@ function St({ type: e = "text", name: t, placeholder: n, required: r, style: i,
2265
2456
  placeholder: n,
2266
2457
  required: !o && !!r,
2267
2458
  style: {
2268
- ...X,
2269
- ...C(i)
2459
+ ...Q,
2460
+ ...A(i)
2270
2461
  },
2271
- ...Z(o)
2462
+ ...$(o)
2272
2463
  });
2273
2464
  }
2274
- function Ct({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2465
+ function It({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2275
2466
  return /* @__PURE__ */ u("textarea", {
2276
2467
  ref: a,
2277
2468
  name: e || void 0,
@@ -2279,19 +2470,19 @@ function Ct({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
2279
2470
  rows: n,
2280
2471
  required: !o && !!r,
2281
2472
  style: {
2282
- ...X,
2473
+ ...Q,
2283
2474
  resize: "vertical",
2284
- ...C(i)
2475
+ ...A(i)
2285
2476
  },
2286
- ...Z(o)
2477
+ ...$(o)
2287
2478
  });
2288
2479
  }
2289
- function wt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2480
+ function Lt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2290
2481
  return /* @__PURE__ */ d("label", {
2291
2482
  ref: o,
2292
2483
  style: {
2293
- ...dt,
2294
- ...C(a)
2484
+ ...Ct,
2485
+ ...A(a)
2295
2486
  },
2296
2487
  children: [/* @__PURE__ */ u("input", {
2297
2488
  type: e,
@@ -2307,7 +2498,7 @@ function wt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
2307
2498
  }), t]
2308
2499
  });
2309
2500
  }
2310
- function Tt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2501
+ function Rt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2311
2502
  return /* @__PURE__ */ d("select", {
2312
2503
  ref: a,
2313
2504
  name: e || void 0,
@@ -2316,9 +2507,9 @@ function Tt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2316
2507
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
2317
2508
  tabIndex: o ? -1 : void 0,
2318
2509
  style: {
2319
- ...X,
2510
+ ...Q,
2320
2511
  appearance: "auto",
2321
- ...C(i)
2512
+ ...A(i)
2322
2513
  },
2323
2514
  children: [t !== "" && /* @__PURE__ */ u("option", {
2324
2515
  value: "",
@@ -2330,19 +2521,19 @@ function Tt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2330
2521
  }, t))]
2331
2522
  });
2332
2523
  }
2333
- function Et({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2524
+ function zt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2334
2525
  let [s, l] = c(null);
2335
2526
  return /* @__PURE__ */ d("label", {
2336
2527
  ref: a,
2337
2528
  style: {
2338
- ...X,
2529
+ ...Q,
2339
2530
  display: "flex",
2340
2531
  alignItems: "center",
2341
2532
  gap: "8px",
2342
2533
  cursor: o ? "default" : "pointer",
2343
2534
  borderStyle: "dashed",
2344
2535
  color: s ? "#111827" : "#6b7280",
2345
- ...C(i)
2536
+ ...A(i)
2346
2537
  },
2347
2538
  children: [
2348
2539
  /* @__PURE__ */ u("input", {
@@ -2362,12 +2553,12 @@ function Et({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
2362
2553
  ]
2363
2554
  });
2364
2555
  }
2365
- function Dt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2556
+ function Bt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2366
2557
  return /* @__PURE__ */ u("button", {
2367
2558
  ref: n,
2368
2559
  type: r ? "button" : "submit",
2369
2560
  style: {
2370
- ...q,
2561
+ ...X,
2371
2562
  border: 0,
2372
2563
  cursor: "pointer",
2373
2564
  alignSelf: "flex-start",
@@ -2377,12 +2568,12 @@ function Dt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2377
2568
  fontWeight: 600,
2378
2569
  lineHeight: 1.4,
2379
2570
  fontFamily: "inherit",
2380
- ...C(t)
2571
+ ...A(t)
2381
2572
  },
2382
2573
  children: e
2383
2574
  });
2384
2575
  }
2385
- function Ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2576
+ function Vt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2386
2577
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
2387
2578
  return /* @__PURE__ */ u("div", {
2388
2579
  ref: r,
@@ -2391,7 +2582,7 @@ function Ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2391
2582
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
2392
2583
  gap: 16,
2393
2584
  width: "100%",
2394
- ...C(n)
2585
+ ...A(n)
2395
2586
  },
2396
2587
  children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ u("div", {
2397
2588
  style: { minWidth: 0 },
@@ -2399,22 +2590,22 @@ function Ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2399
2590
  }, t))
2400
2591
  });
2401
2592
  }
2402
- function kt({ 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: _ }) {
2403
- let { tenant: v, apiUrl: y, locale: b } = r(H), x = r(he), S = r(U), [, w] = c(0);
2593
+ function Ht({ 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: _ }) {
2594
+ let { tenant: v, apiUrl: y, locale: b } = r(q), x = r(we), S = r(J), [, C] = c(0);
2404
2595
  i(() => {
2405
2596
  if (typeof window > "u") return;
2406
- let e = () => w((e) => e + 1);
2597
+ let e = () => C((e) => e + 1);
2407
2598
  return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
2408
2599
  window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
2409
2600
  };
2410
2601
  }, []);
2411
- let T = me(h), E = JSON.stringify(T), D = E !== "{}" && !e?.startsWith?.("api:"), O = D ? null : S?.[e], k = m ? W(S) : 1, [A, j] = c(null);
2602
+ let w = Ce(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? xe(S) : 1, [k, j] = c(null);
2412
2603
  if (i(() => {
2413
- if (!e || O) return;
2604
+ if (!e || D) return;
2414
2605
  let n = !0, r = new URLSearchParams();
2415
- if (b && r.set("locale", b), D && r.set("data_filter", E), m && !e.startsWith("api:")) {
2606
+ if (b && r.set("locale", b), E && r.set("data_filter", T), m && !e.startsWith("api:")) {
2416
2607
  let e = Math.max(1, Number(t) || 6);
2417
- r.set("offset", String((k - 1) * e)), r.set("limit", String(e));
2608
+ r.set("offset", String((O - 1) * e)), r.set("limit", String(e));
2418
2609
  }
2419
2610
  let i = r.toString(), a = e.startsWith("api:") ? `${y}/data/${encodeURIComponent(e.slice(4))}` : `${y}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
2420
2611
  return fetch(a, { headers: v ? { "x-tenant": v } : {} }).then((e) => e.json()).then((e) => {
@@ -2428,14 +2619,14 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2428
2619
  v,
2429
2620
  y,
2430
2621
  b,
2431
- O,
2622
+ D,
2432
2623
  m,
2433
- k,
2624
+ O,
2434
2625
  t,
2435
- D,
2436
- E
2626
+ E,
2627
+ T
2437
2628
  ]), !e) return null;
2438
- 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" ? {
2629
+ let M = Math.max(1, Number(t) || 6), N = m ? D || e.startsWith("api:") ? (D ?? k ?? []).slice((O - 1) * M, O * M) : (k ?? []).slice(0, M) : (D ?? k ?? []).slice(0, M), P = Math.min(Math.max(Number(a) || 3, 1), 6), F = n === "list" ? {
2439
2630
  display: "flex",
2440
2631
  flexDirection: "column",
2441
2632
  gap: 20
@@ -2449,21 +2640,21 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2449
2640
  style: {
2450
2641
  width: "100%",
2451
2642
  ...F,
2452
- ...C(g)
2643
+ ...A(g)
2453
2644
  },
2454
2645
  children: N.map((e) => /* @__PURE__ */ u("div", {
2455
2646
  style: { minWidth: 0 },
2456
- children: x.render(p, (t) => ve(t, e))
2647
+ children: x.render(p, (t) => Oe(t, e))
2457
2648
  }, e.id ?? e?.data?.slug))
2458
2649
  }) : /* @__PURE__ */ u("div", {
2459
2650
  ref: _,
2460
2651
  style: {
2461
2652
  width: "100%",
2462
2653
  ...F,
2463
- ...C(g)
2654
+ ...A(g)
2464
2655
  },
2465
2656
  children: N.map((e) => {
2466
- let t = o ? G(e?.data, o) : null, r = s ? K(G(e?.data, s)) : null, i = l ? G(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : K(i), f = n === "list";
2657
+ let t = o ? Ee(e?.data, o) : null, r = s ? Y(Ee(e?.data, s)) : null, i = l ? Ee(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : Y(i), f = n === "list";
2467
2658
  return /* @__PURE__ */ d("div", {
2468
2659
  style: {
2469
2660
  display: "flex",
@@ -2510,7 +2701,7 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2510
2701
  lineHeight: 1.55,
2511
2702
  opacity: .85
2512
2703
  },
2513
- children: Pe(a)
2704
+ children: We(a)
2514
2705
  })
2515
2706
  ]
2516
2707
  })]
@@ -2518,8 +2709,8 @@ function kt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2518
2709
  })
2519
2710
  });
2520
2711
  }
2521
- function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
2522
- let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : pe(), s = {
2712
+ function Ut({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
2713
+ let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Se(), s = {
2523
2714
  height: 34,
2524
2715
  padding: "0 12px",
2525
2716
  borderRadius: 8,
@@ -2561,13 +2752,13 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
2561
2752
  alignItems: "center",
2562
2753
  gap: 8,
2563
2754
  width: "100%",
2564
- ...C(n)
2755
+ ...A(n)
2565
2756
  },
2566
2757
  children: [a.map((e) => Array.isArray(e.options) && e.options.length > 0 || e.type === "option" || e.type === "select" ? /* @__PURE__ */ d("select", {
2567
2758
  name: `f_${e.name}`,
2568
2759
  defaultValue: o[e.name] ?? "",
2569
2760
  style: s,
2570
- ...Z(i),
2761
+ ...$(i),
2571
2762
  children: [/* @__PURE__ */ u("option", {
2572
2763
  value: "",
2573
2764
  children: e.label || e.name
@@ -2582,7 +2773,7 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
2582
2773
  name: `f_${e.name}`,
2583
2774
  defaultValue: o[e.name] ?? "",
2584
2775
  style: s,
2585
- ...Z(i),
2776
+ ...$(i),
2586
2777
  children: [
2587
2778
  /* @__PURE__ */ u("option", {
2588
2779
  value: "",
@@ -2603,7 +2794,7 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
2603
2794
  defaultValue: o[e.name] ?? "",
2604
2795
  placeholder: e.label || e.name,
2605
2796
  style: s,
2606
- ...Z(i)
2797
+ ...$(i)
2607
2798
  }, e.name)), /* @__PURE__ */ u("button", {
2608
2799
  type: "submit",
2609
2800
  style: {
@@ -2616,16 +2807,16 @@ function At({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
2616
2807
  fontWeight: 600,
2617
2808
  cursor: i ? "default" : "pointer"
2618
2809
  },
2619
- ...Z(i),
2810
+ ...$(i),
2620
2811
  children: t
2621
2812
  })]
2622
2813
  });
2623
2814
  }
2624
- function jt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2815
+ function Wt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2625
2816
  return e.length ? /* @__PURE__ */ u("nav", {
2626
2817
  ref: r,
2627
2818
  "aria-label": "Breadcrumb",
2628
- style: { ...C(n) },
2819
+ style: { ...A(n) },
2629
2820
  children: /* @__PURE__ */ u("ol", {
2630
2821
  style: {
2631
2822
  display: "flex",
@@ -2671,8 +2862,8 @@ function jt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2671
2862
  })
2672
2863
  }) : null;
2673
2864
  }
2674
- function Mt({ 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 }) {
2675
- let { tenant: g, apiUrl: _ } = r(H), v = r(U), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
2865
+ function Gt({ 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 }) {
2866
+ let { tenant: g, apiUrl: _ } = r(q), v = r(J), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
2676
2867
  i(() => {
2677
2868
  if (!o || Number.isFinite(x)) return;
2678
2869
  let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
@@ -2689,9 +2880,9 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
2689
2880
  _,
2690
2881
  x
2691
2882
  ]);
2692
- let S = Math.max(1, Number(s) || 6), w = Number.isFinite(x) ? x : y;
2693
- if (o && w === null || o && f && !(w > 0)) return null;
2694
- let T = Math.min(Math.max(o ? Math.ceil(w / S) : Number(e) || 1, 1), 50), E = Math.min(Math.max(o ? W(v) : Number(t) || 1, 1), T), D = (e) => {
2883
+ let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
2884
+ if (o && C === null || o && f && !(C > 0)) return null;
2885
+ let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? xe(v) : Number(t) || 1, 1), w), E = (e) => {
2695
2886
  if (o) {
2696
2887
  if (typeof window < "u") {
2697
2888
  let t = new URLSearchParams(window.location.search);
@@ -2700,7 +2891,7 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
2700
2891
  return `?page=${e}`;
2701
2892
  }
2702
2893
  return a && a !== "#" ? a.replace("{page}", String(e)) : "#";
2703
- }, O = l === "center" ? "center" : l === "right" ? "flex-end" : "flex-start", k = p ? (e) => e.preventDefault() : void 0, A = (e) => ({
2894
+ }, D = l === "center" ? "center" : l === "right" ? "flex-end" : "flex-start", O = p ? (e) => e.preventDefault() : void 0, k = (e) => ({
2704
2895
  display: "inline-flex",
2705
2896
  alignItems: "center",
2706
2897
  justifyContent: "center",
@@ -2722,49 +2913,49 @@ function Mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
2722
2913
  flexWrap: "wrap",
2723
2914
  gap: 8,
2724
2915
  alignItems: "center",
2725
- justifyContent: O,
2726
- ...C(m)
2916
+ justifyContent: D,
2917
+ ...A(m)
2727
2918
  },
2728
2919
  children: [
2729
2920
  n && /* @__PURE__ */ u("a", {
2730
- href: E > 1 ? D(E - 1) : "#",
2731
- onClick: k,
2921
+ href: T > 1 ? E(T - 1) : "#",
2922
+ onClick: O,
2732
2923
  "aria-label": "Previous",
2733
2924
  style: {
2734
- ...A(!1),
2735
- opacity: E > 1 ? 1 : .4
2925
+ ...k(!1),
2926
+ opacity: T > 1 ? 1 : .4
2736
2927
  },
2737
2928
  children: "‹"
2738
2929
  }),
2739
- Array.from({ length: T }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
2740
- href: D(e),
2741
- onClick: k,
2742
- "aria-current": e === E ? "page" : void 0,
2743
- style: A(e === E),
2930
+ Array.from({ length: w }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
2931
+ href: E(e),
2932
+ onClick: O,
2933
+ "aria-current": e === T ? "page" : void 0,
2934
+ style: k(e === T),
2744
2935
  children: e
2745
2936
  }, e)),
2746
2937
  n && /* @__PURE__ */ u("a", {
2747
- href: E < T ? D(E + 1) : "#",
2748
- onClick: k,
2938
+ href: T < w ? E(T + 1) : "#",
2939
+ onClick: O,
2749
2940
  "aria-label": "Next",
2750
2941
  style: {
2751
- ...A(!1),
2752
- opacity: E < T ? 1 : .4
2942
+ ...k(!1),
2943
+ opacity: T < w ? 1 : .4
2753
2944
  },
2754
2945
  children: "›"
2755
2946
  })
2756
2947
  ]
2757
2948
  });
2758
2949
  }
2759
- var Nt = "webim.page_mode", Pt = () => {
2950
+ var Kt = "webim.page_mode", qt = () => {
2760
2951
  if (typeof window > "u") return "auto";
2761
2952
  try {
2762
- let e = window.localStorage.getItem(Nt);
2953
+ let e = window.localStorage.getItem(Kt);
2763
2954
  return e === "light" || e === "dark" ? e : "auto";
2764
2955
  } catch {
2765
2956
  return "auto";
2766
2957
  }
2767
- }, Ft = (e) => {
2958
+ }, Jt = (e) => {
2768
2959
  let t = {
2769
2960
  width: 16,
2770
2961
  height: 16,
@@ -2796,13 +2987,13 @@ var Nt = "webim.page_mode", Pt = () => {
2796
2987
  rx: "2"
2797
2988
  }), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
2798
2989
  });
2799
- }, $ = {
2990
+ }, Yt = {
2800
2991
  light: "Light theme",
2801
2992
  dark: "Dark theme",
2802
2993
  auto: "Follow the device theme"
2803
2994
  };
2804
- function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
2805
- let [o, l] = c(a ? "auto" : Pt), d = s(null), f = (e) => {
2995
+ function Xt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
2996
+ let [o, l] = c(a ? "auto" : qt), d = s(null), f = (e) => {
2806
2997
  d.current = e, typeof r == "function" && r(e);
2807
2998
  };
2808
2999
  i(() => {
@@ -2810,7 +3001,7 @@ function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
2810
3001
  let e = d.current?.closest?.(".webim-page");
2811
3002
  e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
2812
3003
  try {
2813
- o === "auto" ? window.localStorage.removeItem(Nt) : window.localStorage.setItem(Nt, o);
3004
+ o === "auto" ? window.localStorage.removeItem(Kt) : window.localStorage.setItem(Kt, o);
2814
3005
  } catch {}
2815
3006
  }, [o, a]);
2816
3007
  let p = t === !1 ? ["light", "dark"] : [
@@ -2841,12 +3032,12 @@ function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
2841
3032
  padding: 3,
2842
3033
  borderRadius: 999,
2843
3034
  border: "1px solid rgba(148, 163, 184, 0.4)",
2844
- ...C(n)
3035
+ ...A(n)
2845
3036
  },
2846
3037
  children: p.map((e) => /* @__PURE__ */ u("button", {
2847
3038
  type: "button",
2848
- title: $[e],
2849
- "aria-label": $[e],
3039
+ title: Yt[e],
3040
+ "aria-label": Yt[e],
2850
3041
  "aria-pressed": e === m,
2851
3042
  onClick: a ? void 0 : () => l(e),
2852
3043
  style: {
@@ -2857,27 +3048,27 @@ function It({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
2857
3048
  background: e === m ? "var(--page-accent, #111827)" : "transparent",
2858
3049
  opacity: e === m ? 1 : .7
2859
3050
  },
2860
- children: Ft(e)
3051
+ children: Jt(e)
2861
3052
  }, e))
2862
3053
  });
2863
3054
  let g = p[(p.indexOf(m) + 1) % p.length];
2864
3055
  return /* @__PURE__ */ u("button", {
2865
3056
  ref: f,
2866
3057
  type: "button",
2867
- title: $[m],
2868
- "aria-label": `Theme: ${$[m]} — switch to ${$[g]}`,
3058
+ title: Yt[m],
3059
+ "aria-label": `Theme: ${Yt[m]} — switch to ${Yt[g]}`,
2869
3060
  onClick: a ? void 0 : () => l(g),
2870
3061
  style: {
2871
3062
  ...h,
2872
3063
  width: 36,
2873
3064
  height: 36,
2874
3065
  border: "1px solid rgba(148, 163, 184, 0.4)",
2875
- ...C(n)
3066
+ ...A(n)
2876
3067
  },
2877
- children: Ft(m)
3068
+ children: Jt(m)
2878
3069
  });
2879
3070
  }
2880
- function Lt(e) {
3071
+ function Zt(e) {
2881
3072
  let t = e?.parentElement;
2882
3073
  for (; t && t !== document.body;) {
2883
3074
  let e = getComputedStyle(t).overflowY;
@@ -2886,7 +3077,7 @@ function Lt(e) {
2886
3077
  }
2887
3078
  return window;
2888
3079
  }
2889
- var Rt = (e) => e === window ? window.scrollY : e.scrollTop, zt = {
3080
+ var Qt = (e) => e === window ? window.scrollY : e.scrollTop, $t = {
2890
3081
  "bottom-right": (e) => ({
2891
3082
  right: e,
2892
3083
  bottom: e
@@ -2901,7 +3092,7 @@ var Rt = (e) => e === window ? window.scrollY : e.scrollTop, zt = {
2901
3092
  transform: "translateX(-50%)"
2902
3093
  })
2903
3094
  };
2904
- function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
3095
+ function en({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
2905
3096
  let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
2906
3097
  b(e), typeof p == "function" && p(e);
2907
3098
  };
@@ -2912,8 +3103,8 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
2912
3103
  }
2913
3104
  if (!y) return;
2914
3105
  let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
2915
- let t = Lt(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
2916
- v(n || Rt(t) > e);
3106
+ let t = Zt(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
3107
+ v(n || Qt(t) > e);
2917
3108
  };
2918
3109
  return t(), document.addEventListener("scroll", t, {
2919
3110
  capture: !0,
@@ -2927,7 +3118,7 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
2927
3118
  ]);
2928
3119
  let S = () => {
2929
3120
  if (m) return;
2930
- let e = Lt(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
3121
+ let e = Zt(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
2931
3122
  e === window ? window.scrollTo({
2932
3123
  top: 0,
2933
3124
  behavior: n
@@ -2935,26 +3126,26 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
2935
3126
  top: 0,
2936
3127
  behavior: n
2937
3128
  });
2938
- }, w = Number(r) >= 0 ? Number(r) : 24, T = e === "pill", E = t || "Top", D = zt[n] ? n : "bottom-right", O = h ? {
3129
+ }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = $t[n] ? n : "bottom-right", D = h ? {
2939
3130
  position: "fixed",
2940
3131
  zIndex: 5,
2941
- bottom: (h.bottom ?? 0) + w,
2942
- ...D === "bottom-left" ? { left: (h.left ?? 0) + w } : null,
2943
- ...D === "bottom-right" ? { right: (h.right ?? 0) + w } : null,
2944
- ...D === "bottom-center" ? {
3132
+ bottom: (h.bottom ?? 0) + C,
3133
+ ...E === "bottom-left" ? { left: (h.left ?? 0) + C } : null,
3134
+ ...E === "bottom-right" ? { right: (h.right ?? 0) + C } : null,
3135
+ ...E === "bottom-center" ? {
2945
3136
  left: (h.left ?? 0) + (h.width ?? 0) / 2,
2946
3137
  transform: "translateX(-50%)"
2947
3138
  } : null
2948
3139
  } : {
2949
3140
  position: "fixed",
2950
3141
  zIndex: 2147482e3,
2951
- ...zt[D](w)
3142
+ ...$t[E](C)
2952
3143
  };
2953
3144
  return /* @__PURE__ */ d("button", {
2954
3145
  ref: x,
2955
3146
  type: "button",
2956
- title: E,
2957
- "aria-label": E,
3147
+ title: T,
3148
+ "aria-label": T,
2958
3149
  "aria-hidden": !_,
2959
3150
  tabIndex: _ ? 0 : -1,
2960
3151
  onClick: S,
@@ -2962,14 +3153,14 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
2962
3153
  display: "inline-flex",
2963
3154
  alignItems: "center",
2964
3155
  justifyContent: "center",
2965
- gap: T ? 8 : 0,
3156
+ gap: w ? 8 : 0,
2966
3157
  appearance: "none",
2967
3158
  font: "inherit",
2968
3159
  fontSize: 14,
2969
3160
  fontWeight: 600,
2970
- width: T ? "auto" : 44,
3161
+ width: w ? "auto" : 44,
2971
3162
  height: 44,
2972
- padding: T ? "0 18px" : 0,
3163
+ padding: w ? "0 18px" : 0,
2973
3164
  borderRadius: 999,
2974
3165
  border: "1px solid transparent",
2975
3166
  background: s || "var(--page-accent, #111827)",
@@ -2979,9 +3170,9 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
2979
3170
  opacity: +!!_,
2980
3171
  pointerEvents: _ ? "auto" : "none",
2981
3172
  transition: "opacity 160ms ease, transform 160ms ease",
2982
- ...O,
2983
- ...C(f),
2984
- ...O.transform ? { transform: O.transform } : null
3173
+ ...D,
3174
+ ...A(f),
3175
+ ...D.transform ? { transform: D.transform } : null
2985
3176
  },
2986
3177
  children: [/* @__PURE__ */ u("svg", {
2987
3178
  width: "18",
@@ -2996,10 +3187,10 @@ function Bt({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
2996
3187
  strokeLinecap: "round",
2997
3188
  strokeLinejoin: "round"
2998
3189
  })
2999
- }), T ? /* @__PURE__ */ u("span", { children: E }) : null]
3190
+ }), w ? /* @__PURE__ */ u("span", { children: T }) : null]
3000
3191
  });
3001
3192
  }
3002
- var Vt = {
3193
+ var tn = {
3003
3194
  facebook: {
3004
3195
  label: "Facebook",
3005
3196
  color: "#1877f2",
@@ -3066,8 +3257,8 @@ var Vt = {
3066
3257
  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"
3067
3258
  }
3068
3259
  };
3069
- function Ht({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3070
- let l = Array.isArray(e) ? e.filter((e) => e && Vt[e.network]) : [];
3260
+ function nn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3261
+ let l = Array.isArray(e) ? e.filter((e) => e && tn[e.network]) : [];
3071
3262
  if (!l.length) return null;
3072
3263
  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;
3073
3264
  return /* @__PURE__ */ u("div", {
@@ -3077,10 +3268,10 @@ function Ht({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
3077
3268
  flexWrap: "wrap",
3078
3269
  alignItems: "center",
3079
3270
  gap: p,
3080
- ...C(o)
3271
+ ...A(o)
3081
3272
  },
3082
3273
  children: l.map((e, r) => {
3083
- let i = Vt[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);
3274
+ let i = tn[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);
3084
3275
  return /* @__PURE__ */ u("a", {
3085
3276
  href: e.url || "#",
3086
3277
  onClick: h,
@@ -3114,7 +3305,7 @@ function Ht({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
3114
3305
  })
3115
3306
  });
3116
3307
  }
3117
- function Ut({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3308
+ function rn({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3118
3309
  if (!t.length) return null;
3119
3310
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
3120
3311
  width: 32,
@@ -3152,7 +3343,7 @@ function Ut({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
3152
3343
  flexDirection: r ? "column" : "row",
3153
3344
  alignItems: r ? "stretch" : "flex-start",
3154
3345
  gap: r ? 4 : 8,
3155
- ...C(i)
3346
+ ...A(i)
3156
3347
  },
3157
3348
  children: t.map((t, n) => {
3158
3349
  let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
@@ -3192,7 +3383,7 @@ function Ut({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
3192
3383
  })
3193
3384
  });
3194
3385
  }
3195
- var Wt = {
3386
+ var an = {
3196
3387
  small: {
3197
3388
  w: 132,
3198
3389
  h: 46,
@@ -3214,10 +3405,10 @@ var Wt = {
3214
3405
  title: 12.5,
3215
3406
  avatar: 46
3216
3407
  }
3217
- }, Gt = (e) => Wt[e] ?? Wt.medium;
3218
- Wt.medium.w, Wt.medium.h;
3219
- function Kt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3220
- let r = Gt(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 = [];
3408
+ }, on = (e) => an[e] ?? an.medium;
3409
+ an.medium.w, an.medium.h;
3410
+ function sn(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3411
+ let r = on(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 = [];
3221
3412
  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);
3222
3413
  let d = /* @__PURE__ */ new Map(), f = (e, t) => {
3223
3414
  if (t.has(e.id)) return 0;
@@ -3269,19 +3460,19 @@ function Kt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3269
3460
  horizontal: n
3270
3461
  };
3271
3462
  }
3272
- var qt = (e, t) => {
3463
+ var cn = (e, t) => {
3273
3464
  let n = String(e ?? "");
3274
3465
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
3275
- }, Jt = (e) => {
3466
+ }, ln = (e) => {
3276
3467
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
3277
3468
  if (!t) return "#ffffff";
3278
3469
  let n = t[1];
3279
3470
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
3280
3471
  let r = parseInt(n, 16);
3281
3472
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
3282
- }, Yt = (e) => !!(e?.cv?.trim?.() || e?.photo);
3283
- function Xt(e, t = {}) {
3284
- let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : K(e);
3473
+ }, un = (e) => !!(e?.cv?.trim?.() || e?.photo);
3474
+ function dn(e, t = {}) {
3475
+ 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 ? "" : Y(e);
3285
3476
  return n.map((e) => {
3286
3477
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
3287
3478
  return {
@@ -3295,11 +3486,11 @@ function Xt(e, t = {}) {
3295
3486
  };
3296
3487
  });
3297
3488
  }
3298
- var Zt = {
3489
+ var fn = {
3299
3490
  size: 36,
3300
3491
  pad: 10
3301
3492
  };
3302
- function Qt({ node: e, onClose: t }) {
3493
+ function pn({ node: e, onClose: t }) {
3303
3494
  return i(() => {
3304
3495
  let e = (e) => e.key === "Escape" && t();
3305
3496
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -3420,31 +3611,31 @@ function Qt({ node: e, onClose: t }) {
3420
3611
  })
3421
3612
  });
3422
3613
  }
3423
- function $t({ 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 }) {
3424
- let b = a(), [x, S] = c(null), { tenant: w, apiUrl: T } = r(H), E = r(U)?.[t], [D, O] = c(null);
3614
+ function mn({ 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 }) {
3615
+ let b = a(), [x, S] = c(null), { tenant: C, apiUrl: w } = r(q), T = r(J)?.[t], [E, D] = c(null);
3425
3616
  i(() => {
3426
- if (!t || E) return;
3617
+ if (!t || T) return;
3427
3618
  let e = !0;
3428
- return fetch(`${T}/dynamic/${encodeURIComponent(t)}`, { headers: w ? { "x-tenant": w } : {} }).then((e) => e.json()).then((t) => {
3619
+ return fetch(`${w}/dynamic/${encodeURIComponent(t)}`, { headers: C ? { "x-tenant": C } : {} }).then((e) => e.json()).then((t) => {
3429
3620
  let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
3430
- e && O(n);
3431
- }).catch(() => e && O([])), () => {
3621
+ e && D(n);
3622
+ }).catch(() => e && D([])), () => {
3432
3623
  e = !1;
3433
3624
  };
3434
3625
  }, [
3435
3626
  t,
3627
+ C,
3436
3628
  w,
3437
- T,
3438
- E
3629
+ T
3439
3630
  ]);
3440
- let k = t ? Xt(E ?? D ?? [], {
3631
+ let O = t ? dn(T ?? E ?? [], {
3441
3632
  nameField: n,
3442
3633
  titleField: o,
3443
3634
  photoField: s,
3444
3635
  parentField: f,
3445
3636
  cvField: p,
3446
3637
  hrefField: m
3447
- }) : e, A = Gt(h), { boxes: j, links: M, width: N, height: P } = Kt(k, {
3638
+ }) : e, k = on(h), { boxes: j, links: M, width: N, height: P } = sn(O, {
3448
3639
  size: h,
3449
3640
  horizontal: g
3450
3641
  });
@@ -3457,7 +3648,7 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3457
3648
  fontSize: 13,
3458
3649
  opacity: .7,
3459
3650
  textAlign: "center",
3460
- ...C(_)
3651
+ ...A(_)
3461
3652
  },
3462
3653
  children: [
3463
3654
  "Org Chart — no published entries in “",
@@ -3471,7 +3662,7 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3471
3662
  style: {
3472
3663
  maxWidth: "100%",
3473
3664
  overflowX: "auto",
3474
- ...C(_)
3665
+ ...A(_)
3475
3666
  },
3476
3667
  children: [/* @__PURE__ */ d("svg", {
3477
3668
  viewBox: `0 0 ${N} ${P}`,
@@ -3490,7 +3681,7 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3490
3681
  stroke: "rgba(148, 163, 184, 0.7)",
3491
3682
  strokeWidth: "1.5"
3492
3683
  }, t)), j.map(({ node: e, x: t, y: n }) => {
3493
- 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 ? Jt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Jt(e.color2) : s, f = y && (Yt(e) || e.href), p = () => Yt(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Zt.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);
3684
+ 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 ? ln(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? ln(e.color2) : s, f = y && (un(e) || e.href), p = () => un(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + fn.pad + k.avatar + 8 : t + k.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((k.w - k.avatar - 26) / 7) : Math.floor(k.w / 7.6), _ = k.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
3494
3685
  return /* @__PURE__ */ d("g", {
3495
3686
  onClick: f ? p : void 0,
3496
3687
  style: f ? { cursor: "pointer" } : void 0,
@@ -3513,8 +3704,8 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3513
3704
  }), /* @__PURE__ */ u("rect", {
3514
3705
  x: t,
3515
3706
  y: n,
3516
- width: A.w,
3517
- height: A.h,
3707
+ width: k.w,
3708
+ height: k.h,
3518
3709
  rx: "10",
3519
3710
  fill: `url(#${b}-${e.id}-grad)`
3520
3711
  })] }) : i ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
@@ -3522,8 +3713,8 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3522
3713
  children: /* @__PURE__ */ u("rect", {
3523
3714
  x: t,
3524
3715
  y: n,
3525
- width: A.w,
3526
- height: A.h,
3716
+ width: k.w,
3717
+ height: k.h,
3527
3718
  rx: "10"
3528
3719
  })
3529
3720
  }), /* @__PURE__ */ d("g", {
@@ -3531,21 +3722,21 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3531
3722
  children: [/* @__PURE__ */ u("rect", {
3532
3723
  x: t,
3533
3724
  y: n,
3534
- width: A.w,
3725
+ width: k.w,
3535
3726
  height: _,
3536
3727
  fill: o
3537
3728
  }), /* @__PURE__ */ u("rect", {
3538
3729
  x: t,
3539
3730
  y: n + _,
3540
- width: A.w,
3541
- height: A.h - _,
3731
+ width: k.w,
3732
+ height: k.h - _,
3542
3733
  fill: e.color2
3543
3734
  })]
3544
3735
  })] }) : /* @__PURE__ */ u("rect", {
3545
3736
  x: t,
3546
3737
  y: n,
3547
- width: A.w,
3548
- height: A.h,
3738
+ width: k.w,
3739
+ height: k.h,
3549
3740
  rx: "10",
3550
3741
  fill: o,
3551
3742
  stroke: a ? "none" : "var(--page-accent, #4f46e5)",
@@ -3554,63 +3745,63 @@ function $t({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
3554
3745
  e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
3555
3746
  id: `${b}-${e.id}`,
3556
3747
  children: /* @__PURE__ */ u("circle", {
3557
- cx: t + Zt.pad + A.avatar / 2,
3558
- cy: n + A.h / 2,
3559
- r: A.avatar / 2
3748
+ cx: t + fn.pad + k.avatar / 2,
3749
+ cy: n + k.h / 2,
3750
+ r: k.avatar / 2
3560
3751
  })
3561
3752
  }), /* @__PURE__ */ u("image", {
3562
3753
  href: e.photo,
3563
- x: t + Zt.pad,
3564
- y: n + (A.h - A.avatar) / 2,
3565
- width: A.avatar,
3566
- height: A.avatar,
3754
+ x: t + fn.pad,
3755
+ y: n + (k.h - k.avatar) / 2,
3756
+ width: k.avatar,
3757
+ height: k.avatar,
3567
3758
  preserveAspectRatio: "xMidYMid slice",
3568
3759
  clipPath: `url(#${b}-${e.id})`
3569
3760
  })] }),
3570
3761
  i && !e.gradient ? /* @__PURE__ */ d(l, { children: [e.title && /* @__PURE__ */ u("text", {
3571
3762
  x: m,
3572
- y: n + _ / 2 + A.title * .35,
3763
+ y: n + _ / 2 + k.title * .35,
3573
3764
  textAnchor: h,
3574
- fontSize: A.title,
3765
+ fontSize: k.title,
3575
3766
  fontWeight: "600",
3576
3767
  fill: s,
3577
- children: qt(e.title, g + 4)
3768
+ children: cn(e.title, g + 4)
3578
3769
  }), e.name && /* @__PURE__ */ u("text", {
3579
3770
  x: m,
3580
- y: n + _ + _ / 2 + A.name * .35,
3771
+ y: n + _ + _ / 2 + k.name * .35,
3581
3772
  textAnchor: h,
3582
- fontSize: A.name,
3773
+ fontSize: k.name,
3583
3774
  fontWeight: "600",
3584
3775
  fill: c,
3585
- children: qt(e.name, g)
3776
+ children: cn(e.name, g)
3586
3777
  })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
3587
3778
  x: m,
3588
- y: n + (v[1] ? A.h * .43 : A.h * .57),
3779
+ y: n + (v[1] ? k.h * .43 : k.h * .57),
3589
3780
  textAnchor: h,
3590
- fontSize: A.name,
3781
+ fontSize: k.name,
3591
3782
  fontWeight: "600",
3592
3783
  fill: s,
3593
- children: qt(v[0], g)
3784
+ children: cn(v[0], g)
3594
3785
  }), v[1] && /* @__PURE__ */ u("text", {
3595
3786
  x: m,
3596
- y: n + A.h * .73,
3787
+ y: n + k.h * .73,
3597
3788
  textAnchor: h,
3598
- fontSize: A.title,
3789
+ fontSize: k.title,
3599
3790
  opacity: "0.7",
3600
3791
  fill: s,
3601
- children: qt(v[1], g + 4)
3792
+ children: cn(v[1], g + 4)
3602
3793
  })] })
3603
3794
  ]
3604
3795
  }, e.id);
3605
3796
  })]
3606
- }), x && /* @__PURE__ */ u(Qt, {
3797
+ }), x && /* @__PURE__ */ u(pn, {
3607
3798
  node: x,
3608
3799
  onClose: () => S(null)
3609
3800
  })]
3610
3801
  });
3611
3802
  }
3612
- function en({ 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 }) {
3613
- let { tenant: g, apiUrl: _ } = r(H), v = r(U), y = v?.[n], b = f ? W(v) : 1, [x, S] = c(null);
3803
+ function hn({ 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 }) {
3804
+ let { tenant: g, apiUrl: _ } = r(q), v = r(J), y = v?.[n], b = f ? xe(v) : 1, [x, S] = c(null);
3614
3805
  if (i(() => {
3615
3806
  if (!n || y) return;
3616
3807
  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}`;
@@ -3629,45 +3820,45 @@ function en({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
3629
3820
  b,
3630
3821
  a
3631
3822
  ]), !e.length) return null;
3632
- 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) => K(G(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 };
3823
+ let C = Math.max(1, Number(a) || 10), w = n ? f ? y || n.startsWith("api:") ? (y ?? x ?? []).slice((b - 1) * C, b * C) : (x ?? []).slice(0, C) : (y ?? x ?? []).slice(0, C) : null, T = w ? w.map((t) => e.map((e) => Y(Ee(t?.data, e.field)))) : t, E = !!n && !(n && !y && x === null) && T.length === 0, D = l ? "6px 10px" : "10px 14px", O = "1px solid rgba(148, 163, 184, 0.35)", k = s ? { border: O } : { borderBottom: O };
3633
3824
  return /* @__PURE__ */ u("div", {
3634
3825
  ref: h,
3635
3826
  style: {
3636
3827
  width: "100%",
3637
3828
  overflowX: "auto",
3638
- ...C(m)
3829
+ ...A(m)
3639
3830
  },
3640
3831
  children: /* @__PURE__ */ d("table", {
3641
3832
  style: {
3642
3833
  width: "100%",
3643
3834
  borderCollapse: "collapse",
3644
3835
  fontSize: 14,
3645
- ...s ? { border: k } : {}
3836
+ ...s ? { border: O } : {}
3646
3837
  },
3647
3838
  children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("th", {
3648
3839
  style: {
3649
3840
  textAlign: "left",
3650
3841
  fontWeight: 600,
3651
- padding: O,
3842
+ padding: D,
3652
3843
  background: "rgba(148, 163, 184, 0.12)",
3653
- ...A
3844
+ ...k
3654
3845
  },
3655
3846
  children: e.label ?? e
3656
- }, t)) }) }), /* @__PURE__ */ d("tbody", { children: [D && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
3847
+ }, t)) }) }), /* @__PURE__ */ d("tbody", { children: [E && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
3657
3848
  colSpan: e.length,
3658
3849
  style: {
3659
- padding: O,
3850
+ padding: D,
3660
3851
  textAlign: "center",
3661
3852
  opacity: .6,
3662
- ...A
3853
+ ...k
3663
3854
  },
3664
3855
  children: p || "No data yet"
3665
- }) }), E.map((t, n) => /* @__PURE__ */ u("tr", {
3856
+ }) }), T.map((t, n) => /* @__PURE__ */ u("tr", {
3666
3857
  style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
3667
3858
  children: e.map((e, n) => /* @__PURE__ */ u("td", {
3668
3859
  style: {
3669
- padding: O,
3670
- ...A
3860
+ padding: D,
3861
+ ...k
3671
3862
  },
3672
3863
  children: t?.[n] ?? ""
3673
3864
  }, n))
@@ -3675,129 +3866,647 @@ function en({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
3675
3866
  })
3676
3867
  });
3677
3868
  }
3678
- var tn = {
3679
- PageRoot: Te,
3680
- Section: Ee,
3681
- Container: De,
3682
- Heading: Oe,
3683
- TextBlock: ze,
3684
- ButtonBlock: He,
3685
- ImageBlock: Ue,
3686
- Spacer: Ye,
3687
- Divider: Xe,
3688
- SliderBlock: nt,
3689
- CanvasSlider: rt,
3690
- TabsBlock: ct,
3691
- QuickStack: Ot,
3692
- CollectionList: kt,
3693
- CollectionSearch: At,
3694
- BreadcrumbsBlock: jt,
3695
- PaginationBlock: Mt,
3696
- StepperBlock: Ut,
3697
- SocialLinksBlock: Ht,
3698
- ThemeModeBlock: It,
3699
- ScrollTopBlock: Bt,
3700
- OrgChartBlock: $t,
3701
- TableBlock: en,
3702
- MasonryBlock: it,
3703
- AccordionBlock: lt,
3704
- NavbarBlock: st,
3705
- ListBlock: Re,
3706
- TextSpan: je,
3707
- QuoteBlock: Le,
3708
- TextLink: Ve,
3709
- RichTextBlock: Fe,
3710
- RichContentBlock: Fe,
3711
- VideoBlock: We,
3712
- YouTubeBlock: Ke,
3713
- IframeBlock: qe,
3714
- EmbedBlock: Je,
3715
- FormBlock: _t,
3716
- FormLabel: xt,
3717
- FormInput: St,
3718
- FormTextarea: Ct,
3719
- FormCheckbox: (e) => /* @__PURE__ */ u(wt, {
3869
+ var gn = {
3870
+ small: {
3871
+ cell: 62,
3872
+ font: 10.5,
3873
+ head: 11,
3874
+ title: 15,
3875
+ pad: 4,
3876
+ gap: 2
3877
+ },
3878
+ medium: {
3879
+ cell: 92,
3880
+ font: 12,
3881
+ head: 12,
3882
+ title: 18,
3883
+ pad: 6,
3884
+ gap: 3
3885
+ },
3886
+ large: {
3887
+ cell: 124,
3888
+ font: 13,
3889
+ head: 13,
3890
+ title: 22,
3891
+ pad: 8,
3892
+ gap: 4
3893
+ }
3894
+ }, _n = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, vn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), yn = 366;
3895
+ function bn(e, t = {}) {
3896
+ 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 ? "" : Y(e), a = (e) => {
3897
+ let t = i(r(e)), n = t ? new Date(t) : null;
3898
+ return n && !Number.isNaN(n.getTime()) ? n : null;
3899
+ };
3900
+ return n.map((e) => {
3901
+ let n = e.data ?? {}, o = a(n[t.startField]);
3902
+ return o ? {
3903
+ key: e.id,
3904
+ title: i(n[t.titleField || "name"]) || i(n.name) || "Untitled",
3905
+ start: o,
3906
+ end: a(n[t.endField]),
3907
+ href: t.hrefField ? i(n[t.hrefField]) : "",
3908
+ color: t.colorField ? i(r(n[t.colorField])) : ""
3909
+ } : null;
3910
+ }).filter(Boolean);
3911
+ }
3912
+ function xn(e) {
3913
+ return (Array.isArray(e) ? e : []).map((e, t) => {
3914
+ let n = e?.start ? new Date(e.start) : null;
3915
+ if (!n || Number.isNaN(n.getTime())) return null;
3916
+ let r = e?.end ? new Date(e.end) : null;
3917
+ return {
3918
+ key: e.key ?? `event-${t}`,
3919
+ title: e.title ?? "",
3920
+ start: n,
3921
+ end: r && !Number.isNaN(r.getTime()) ? r : null,
3922
+ href: e.href ?? "",
3923
+ color: e.color ?? ""
3924
+ };
3925
+ }).filter(Boolean);
3926
+ }
3927
+ function Sn(e) {
3928
+ let t = /* @__PURE__ */ new Map();
3929
+ for (let n of e) {
3930
+ let e = vn(n.start), r = n.end ? vn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), yn);
3931
+ for (let r = 0; r <= i; r += 1) {
3932
+ let i = _n(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
3933
+ t.has(i) || t.set(i, []), t.get(i).push(n);
3934
+ }
3935
+ }
3936
+ for (let e of t.values()) e.sort((e, t) => e.start - t.start);
3937
+ return t;
3938
+ }
3939
+ function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a = "", endField: o = "", hrefField: s = "", colorField: f = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
3940
+ let { tenant: T, apiUrl: E, locale: D } = r(q), O = r(J)?.[t], [k, j] = c(null), [M, N] = c(() => {
3941
+ let e = /* @__PURE__ */ new Date();
3942
+ return {
3943
+ year: e.getFullYear(),
3944
+ month: e.getMonth()
3945
+ };
3946
+ });
3947
+ i(() => {
3948
+ if (!t || O) return;
3949
+ let e = !0;
3950
+ return fetch(`${E}/dynamic/${encodeURIComponent(t)}`, { headers: T ? { "x-tenant": T } : {} }).then((e) => e.json()).then((t) => {
3951
+ let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
3952
+ e && j(n);
3953
+ }).catch(() => e && j([])), () => {
3954
+ e = !1;
3955
+ };
3956
+ }, [
3957
+ t,
3958
+ T,
3959
+ E,
3960
+ O
3961
+ ]);
3962
+ let P = gn[m] ?? gn.medium, F = h || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = g || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? bn(O ?? k ?? [], {
3963
+ titleField: n,
3964
+ startField: a,
3965
+ endField: o,
3966
+ hrefField: s,
3967
+ colorField: f
3968
+ }) : xn(e), ee = Sn(z), B = D || void 0, V = (e, t) => {
3969
+ let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
3970
+ width: 6,
3971
+ height: 6,
3972
+ borderRadius: "50%",
3973
+ background: e.color || R,
3974
+ flexShrink: 0,
3975
+ opacity: e.color ? 1 : .85
3976
+ } }), /* @__PURE__ */ u("span", {
3977
+ style: {
3978
+ overflow: "hidden",
3979
+ textOverflow: "ellipsis",
3980
+ whiteSpace: "nowrap"
3981
+ },
3982
+ children: e.title
3983
+ })] }), r = {
3984
+ display: "flex",
3985
+ alignItems: "center",
3986
+ gap: 5,
3987
+ background: e.color ? `color-mix(in srgb, ${e.color} 18%, transparent)` : L,
3988
+ color: e.color ? "inherit" : R,
3989
+ borderRadius: 4,
3990
+ padding: "2px 5px",
3991
+ fontSize: P.font,
3992
+ lineHeight: 1.35,
3993
+ textDecoration: "none",
3994
+ ...t
3995
+ };
3996
+ return e.href && w ? /* @__PURE__ */ u("a", {
3997
+ href: e.href,
3998
+ style: r,
3999
+ title: e.title,
4000
+ children: n
4001
+ }, e.key) : /* @__PURE__ */ u("div", {
4002
+ style: r,
4003
+ title: e.title,
4004
+ children: n
4005
+ }, e.key);
4006
+ }, H = new Intl.DateTimeFormat(B, {
4007
+ month: "long",
4008
+ year: "numeric"
4009
+ }).format(new Date(M.year, M.month, 1)), te = (e) => N((t) => {
4010
+ let n = new Date(t.year, t.month + e, 1);
4011
+ return {
4012
+ year: n.getFullYear(),
4013
+ month: n.getMonth()
4014
+ };
4015
+ }), ne = (e, t) => /* @__PURE__ */ u("button", {
4016
+ type: "button",
4017
+ "aria-label": e,
4018
+ onClick: () => te(t),
4019
+ style: {
4020
+ background: "transparent",
4021
+ border: `1px solid ${I}`,
4022
+ borderRadius: 6,
4023
+ color: "inherit",
4024
+ cursor: "pointer",
4025
+ fontSize: P.head,
4026
+ lineHeight: 1,
4027
+ padding: "4px 8px"
4028
+ },
4029
+ children: t < 0 ? "‹" : "›"
4030
+ }), re = /* @__PURE__ */ d("div", {
4031
+ style: {
4032
+ display: "flex",
4033
+ alignItems: "center",
4034
+ gap: 8,
4035
+ marginBottom: P.pad + 2
4036
+ },
4037
+ children: [
4038
+ /* @__PURE__ */ u("div", {
4039
+ style: {
4040
+ fontSize: P.title,
4041
+ fontWeight: 700,
4042
+ flexGrow: 1,
4043
+ fontFamily: "var(--page-heading-font, inherit)"
4044
+ },
4045
+ children: H
4046
+ }),
4047
+ ne("Previous month", -1),
4048
+ ne("Next month", 1)
4049
+ ]
4050
+ });
4051
+ if (p === "list") {
4052
+ let e = z.filter((e) => e.start.getFullYear() === M.year && e.start.getMonth() === M.month).sort((e, t) => e.start - t.start), t = new Intl.DateTimeFormat(B, {
4053
+ day: "numeric",
4054
+ month: "short",
4055
+ hour: "2-digit",
4056
+ minute: "2-digit"
4057
+ });
4058
+ return /* @__PURE__ */ d("div", {
4059
+ ref: C,
4060
+ style: {
4061
+ width: "100%",
4062
+ ...A(S)
4063
+ },
4064
+ children: [re, e.length ? /* @__PURE__ */ u("div", {
4065
+ style: {
4066
+ display: "flex",
4067
+ flexDirection: "column",
4068
+ gap: P.gap + 2
4069
+ },
4070
+ children: e.map((e) => /* @__PURE__ */ d("div", {
4071
+ style: {
4072
+ display: "flex",
4073
+ alignItems: "center",
4074
+ gap: 10,
4075
+ borderBottom: `1px solid ${I}`,
4076
+ paddingBottom: P.gap + 2
4077
+ },
4078
+ children: [/* @__PURE__ */ u("span", {
4079
+ style: {
4080
+ fontSize: P.font,
4081
+ opacity: .7,
4082
+ minWidth: 96
4083
+ },
4084
+ children: t.format(e.start)
4085
+ }), V(e, {
4086
+ flexGrow: 1,
4087
+ minWidth: 0
4088
+ })]
4089
+ }, e.key))
4090
+ }) : /* @__PURE__ */ u("div", {
4091
+ style: {
4092
+ fontSize: P.font,
4093
+ opacity: .6,
4094
+ padding: P.pad * 2
4095
+ },
4096
+ children: x
4097
+ })]
4098
+ });
4099
+ }
4100
+ let ie = new Date(M.year, M.month, 1), ae = y === "sunday" ? 0 : 1, oe = (ie.getDay() - ae + 7) % 7, U = new Date(M.year, M.month + 1, 0).getDate(), W = Math.ceil((oe + U) / 7), se = _n(/* @__PURE__ */ new Date()), G = new Intl.DateTimeFormat(B, { weekday: "short" }), ce = [];
4101
+ for (let e = 0; e < W * 7; e += 1) {
4102
+ let t = e - oe + 1, n = t >= 1 && t <= U, r = _n(new Date(M.year, M.month, t)), i = n ? ee.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === se;
4103
+ ce.push(/* @__PURE__ */ d("div", {
4104
+ style: {
4105
+ minHeight: P.cell,
4106
+ borderTop: `1px solid ${I}`,
4107
+ borderLeft: `1px solid ${I}`,
4108
+ padding: P.pad,
4109
+ display: "flex",
4110
+ flexDirection: "column",
4111
+ gap: P.gap,
4112
+ opacity: n ? 1 : .35,
4113
+ minWidth: 0
4114
+ },
4115
+ children: [
4116
+ /* @__PURE__ */ u("span", {
4117
+ style: {
4118
+ fontSize: P.font,
4119
+ fontWeight: o ? 700 : 400,
4120
+ alignSelf: "flex-start",
4121
+ borderRadius: "999px",
4122
+ padding: o ? "1px 6px" : 0,
4123
+ background: o ? F : "transparent",
4124
+ color: o ? R : "inherit"
4125
+ },
4126
+ children: n ? t : new Date(M.year, M.month, t).getDate()
4127
+ }),
4128
+ a.map((e) => V(e)),
4129
+ i.length > a.length && /* @__PURE__ */ u("span", {
4130
+ style: {
4131
+ fontSize: P.font,
4132
+ opacity: .6
4133
+ },
4134
+ children: `+${i.length - a.length}`
4135
+ })
4136
+ ]
4137
+ }, e));
4138
+ }
4139
+ return /* @__PURE__ */ d("div", {
4140
+ ref: C,
4141
+ style: {
4142
+ width: "100%",
4143
+ ...A(S)
4144
+ },
4145
+ children: [
4146
+ re,
4147
+ /* @__PURE__ */ d("div", {
4148
+ style: {
4149
+ display: "grid",
4150
+ gridTemplateColumns: "repeat(7, minmax(0, 1fr))"
4151
+ },
4152
+ children: [Array.from({ length: 7 }, (e, t) => /* @__PURE__ */ u("div", {
4153
+ style: {
4154
+ fontSize: P.head,
4155
+ fontWeight: 600,
4156
+ opacity: .7,
4157
+ textAlign: "center",
4158
+ padding: `0 0 ${P.pad}px`
4159
+ },
4160
+ children: G.format(new Date(2024, 0, 7 + ae + t))
4161
+ }, `head-${t}`)), ce]
4162
+ }),
4163
+ /* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
4164
+ ]
4165
+ });
4166
+ }
4167
+ var wn = {
4168
+ small: 380,
4169
+ medium: 560,
4170
+ large: 820,
4171
+ full: "100%"
4172
+ };
4173
+ function Tn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: a = 0, size: o = "medium", title: l = "", showClose: f = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
4174
+ let [C, w] = c(!1), T = s(null);
4175
+ i(() => {
4176
+ if (S || !e) return;
4177
+ let t = (t) => {
4178
+ t.target.closest?.(`a[href="#${e}"], [data-webim-open="${e}"]`) && (t.preventDefault(), w(!0));
4179
+ };
4180
+ return document.addEventListener("click", t), () => document.removeEventListener("click", t);
4181
+ }, [S, e]), i(() => {
4182
+ if (S || r !== "load") return;
4183
+ let e = setTimeout(() => w(!0), Math.max(0, Number(a) || 0) * 1e3);
4184
+ return () => clearTimeout(e);
4185
+ }, [
4186
+ S,
4187
+ r,
4188
+ a
4189
+ ]), i(() => {
4190
+ if (S || !C) return;
4191
+ let e = (e) => e.key === "Escape" && w(!1);
4192
+ document.addEventListener("keydown", e);
4193
+ let t = document.body.style.overflow;
4194
+ return document.body.style.overflow = "hidden", T.current?.focus?.(), () => {
4195
+ document.removeEventListener("keydown", e), document.body.style.overflow = t;
4196
+ };
4197
+ }, [S, C]);
4198
+ let E = wn[o] ?? wn.medium, D = (e) => {
4199
+ let t = {
4200
+ padding: "9px 16px",
4201
+ borderRadius: 6,
4202
+ cursor: "pointer",
4203
+ fontSize: 14,
4204
+ fontFamily: "inherit",
4205
+ textDecoration: "none",
4206
+ display: "inline-block",
4207
+ ...{
4208
+ primary: {
4209
+ background: "var(--page-accent, #4f46e5)",
4210
+ color: "var(--page-accent-text, #ffffff)",
4211
+ border: "1px solid transparent"
4212
+ },
4213
+ outline: {
4214
+ background: "transparent",
4215
+ color: "inherit",
4216
+ border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
4217
+ },
4218
+ text: {
4219
+ background: "transparent",
4220
+ color: "inherit",
4221
+ border: "1px solid transparent"
4222
+ },
4223
+ danger: {
4224
+ background: "#dc2626",
4225
+ color: "#ffffff",
4226
+ border: "1px solid transparent"
4227
+ }
4228
+ }[e.variant ?? "primary"] ?? {}
4229
+ };
4230
+ return e.href && !S ? /* @__PURE__ */ u("a", {
4231
+ href: e.href,
4232
+ target: e.target || void 0,
4233
+ rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
4234
+ style: t,
4235
+ children: e.label
4236
+ }, e.key) : /* @__PURE__ */ u("button", {
4237
+ type: "button",
4238
+ onClick: () => !S && w(!1),
4239
+ style: t,
4240
+ children: e.label
4241
+ }, e.key);
4242
+ }, O = Array.isArray(h) ? h : [], k = O.filter((e) => e.side === "left"), j = O.filter((e) => e.side !== "left"), M = g === !0 ? D({
4243
+ key: "__close",
4244
+ label: _ || "Close",
4245
+ variant: "outline"
4246
+ }) : null, N = k.length || j.length || M ? /* @__PURE__ */ d("div", {
4247
+ style: {
4248
+ display: "flex",
4249
+ alignItems: "center",
4250
+ gap: 8,
4251
+ padding: "14px 20px",
4252
+ borderTop: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
4253
+ justifyContent: k.length ? "space-between" : v === "left" ? "flex-start" : v === "center" ? "center" : "flex-end"
4254
+ },
4255
+ children: [k.length > 0 && /* @__PURE__ */ u("div", {
4256
+ style: {
4257
+ display: "flex",
4258
+ gap: 8
4259
+ },
4260
+ children: k.map(D)
4261
+ }), /* @__PURE__ */ d("div", {
4262
+ style: {
4263
+ display: "flex",
4264
+ gap: 8
4265
+ },
4266
+ children: [M, j.map(D)]
4267
+ })]
4268
+ }) : null, P = /* @__PURE__ */ d("div", {
4269
+ ref: T,
4270
+ role: "dialog",
4271
+ "aria-modal": S ? void 0 : "true",
4272
+ "aria-label": l || void 0,
4273
+ tabIndex: -1,
4274
+ onClick: (e) => e.stopPropagation(),
4275
+ style: {
4276
+ width: typeof E == "number" ? `min(${E}px, 100%)` : E,
4277
+ maxHeight: S ? void 0 : "85vh",
4278
+ overflowY: S ? void 0 : "auto",
4279
+ borderRadius: 12,
4280
+ background: "var(--page-surface, #ffffff)",
4281
+ color: "var(--page-text, #111827)",
4282
+ border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
4283
+ boxShadow: S ? "none" : "0 24px 64px rgba(15, 23, 42, 0.35)",
4284
+ outline: "none",
4285
+ ...A(b)
4286
+ },
4287
+ children: [
4288
+ (l || f !== !1) && /* @__PURE__ */ d("div", {
4289
+ style: {
4290
+ display: "flex",
4291
+ alignItems: "center",
4292
+ gap: 12,
4293
+ padding: "16px 20px",
4294
+ borderBottom: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
4295
+ },
4296
+ children: [/* @__PURE__ */ u("span", {
4297
+ style: {
4298
+ fontWeight: 700,
4299
+ fontSize: 17,
4300
+ flexGrow: 1,
4301
+ fontFamily: "var(--page-heading-font, inherit)"
4302
+ },
4303
+ children: l
4304
+ }), f !== !1 && /* @__PURE__ */ u("button", {
4305
+ type: "button",
4306
+ "aria-label": "Close",
4307
+ onClick: () => !S && w(!1),
4308
+ style: {
4309
+ background: "transparent",
4310
+ border: 0,
4311
+ color: "inherit",
4312
+ cursor: "pointer",
4313
+ fontSize: 20,
4314
+ lineHeight: 1,
4315
+ padding: 2,
4316
+ opacity: .7
4317
+ },
4318
+ children: "✕"
4319
+ })]
4320
+ }),
4321
+ /* @__PURE__ */ u("div", {
4322
+ style: { padding: 20 },
4323
+ children: y?.content
4324
+ }),
4325
+ N
4326
+ ]
4327
+ });
4328
+ return /* @__PURE__ */ d("div", {
4329
+ ref: x,
4330
+ id: e || void 0,
4331
+ style: S ? void 0 : { display: "contents" },
4332
+ children: [t === "button" && /* @__PURE__ */ u("button", {
4333
+ type: "button",
4334
+ onClick: () => !S && w(!0),
4335
+ style: {
4336
+ padding: "10px 18px",
4337
+ border: 0,
4338
+ borderRadius: 6,
4339
+ cursor: "pointer",
4340
+ fontSize: 15,
4341
+ fontFamily: "inherit",
4342
+ background: "var(--page-accent, #4f46e5)",
4343
+ color: "var(--page-accent-text, #ffffff)"
4344
+ },
4345
+ children: n
4346
+ }), S ? /* @__PURE__ */ u("div", {
4347
+ style: { marginTop: t === "button" ? 12 : 0 },
4348
+ children: P
4349
+ }) : C && /* @__PURE__ */ u("div", {
4350
+ onClick: p === !1 ? void 0 : () => w(!1),
4351
+ style: {
4352
+ position: "fixed",
4353
+ inset: 0,
4354
+ zIndex: 2147483e3,
4355
+ display: "flex",
4356
+ alignItems: m === "top" ? "flex-start" : "center",
4357
+ justifyContent: "center",
4358
+ padding: 20,
4359
+ paddingTop: m === "top" ? "8vh" : 20,
4360
+ background: "rgba(15, 23, 42, 0.55)",
4361
+ backdropFilter: "blur(2px)"
4362
+ },
4363
+ children: P
4364
+ })]
4365
+ });
4366
+ }
4367
+ var En = {
4368
+ PageRoot: Fe,
4369
+ CalendarBlock: Cn,
4370
+ DialogBlock: Tn,
4371
+ Section: Ie,
4372
+ Container: Le,
4373
+ Heading: Re,
4374
+ TextBlock: Ye,
4375
+ ButtonBlock: Qe,
4376
+ ImageBlock: $e,
4377
+ Spacer: at,
4378
+ Divider: ot,
4379
+ SliderBlock: ft,
4380
+ CanvasSlider: pt,
4381
+ TabsBlock: yt,
4382
+ QuickStack: Vt,
4383
+ CollectionList: Ht,
4384
+ CollectionSearch: Ut,
4385
+ BreadcrumbsBlock: Wt,
4386
+ PaginationBlock: Gt,
4387
+ StepperBlock: rn,
4388
+ SocialLinksBlock: nn,
4389
+ ThemeModeBlock: Xt,
4390
+ ScrollTopBlock: en,
4391
+ OrgChartBlock: mn,
4392
+ TableBlock: hn,
4393
+ MasonryBlock: mt,
4394
+ AccordionBlock: bt,
4395
+ NavbarBlock: vt,
4396
+ ListBlock: Je,
4397
+ TextSpan: Ve,
4398
+ QuoteBlock: qe,
4399
+ TextLink: Ze,
4400
+ RichTextBlock: Ge,
4401
+ RichContentBlock: Ge,
4402
+ VideoBlock: et,
4403
+ YouTubeBlock: nt,
4404
+ IframeBlock: rt,
4405
+ EmbedBlock: it,
4406
+ FormBlock: kt,
4407
+ FormLabel: Pt,
4408
+ FormInput: Ft,
4409
+ FormTextarea: It,
4410
+ FormCheckbox: (e) => /* @__PURE__ */ u(Lt, {
3720
4411
  kind: "checkbox",
3721
4412
  ...e
3722
4413
  }),
3723
- FormRadio: (e) => /* @__PURE__ */ u(wt, {
4414
+ FormRadio: (e) => /* @__PURE__ */ u(Lt, {
3724
4415
  kind: "radio",
3725
4416
  ...e
3726
4417
  }),
3727
- FormSelect: Tt,
3728
- FormFile: Et,
3729
- FormRecaptcha: bt,
3730
- FormSubmit: Dt
3731
- }, nn = {
4418
+ FormSelect: Rt,
4419
+ FormFile: zt,
4420
+ FormRecaptcha: Nt,
4421
+ FormSubmit: Bt
4422
+ }, Dn = {
3732
4423
  id: "auth",
3733
4424
  label: "Accounts",
3734
4425
  category: "Apps",
3735
4426
  keys: ["SiteLoginForm", "SiteAccountMenu"],
3736
4427
  ssr: "shell",
3737
4428
  settings: ["site.authRedirect"]
3738
- }, rn = t({
4429
+ }, On = t({
3739
4430
  user: null,
3740
4431
  status: "idle",
3741
4432
  ensure: () => {},
3742
4433
  refresh: () => {},
3743
4434
  signOut: () => {}
3744
- }), an = () => {
3745
- let e = r(rn);
4435
+ }), kn = () => {
4436
+ let e = r(On);
3746
4437
  return i(() => {
3747
4438
  e.ensure();
3748
4439
  }, [e]), e;
3749
4440
  };
3750
- function on({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
3751
- 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}`, {
4441
+ function An({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
4442
+ let f = r(q), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", [h, g] = c(t ?? null), [_, v] = c(t ? "user" : a ? "guest" : "idle"), y = s(!1), b = n((e, t) => fetch(`${p}${e}`, {
3752
4443
  ...t,
3753
4444
  credentials: "include",
3754
4445
  headers: {
3755
4446
  "content-type": "application/json",
3756
- ...p ? { "x-tenant": p } : {},
4447
+ ...m ? { "x-tenant": m } : {},
3757
4448
  ...t?.headers
3758
4449
  }
3759
- }), [f, p]), b = n(() => i ? Promise.resolve(null) : y("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
4450
+ }), [p, m]), x = n(() => a ? Promise.resolve(null) : b("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
3760
4451
  let t = e?.payload ?? null;
3761
- return h(t), _(t ? "user" : "guest"), t;
3762
- }).catch(() => (h(null), _("guest"), null)), [y, i]), x = n(() => y("/site/logout", { method: "post" }).catch(() => {}).then(() => {
3763
- h(null), _("guest");
3764
- }), [y]), S = n(() => {
3765
- v.current || i || t || (v.current = !0, _("loading"), b());
4452
+ return g(t), v(t ? "user" : "guest"), t;
4453
+ }).catch(() => (g(null), v("guest"), null)), [b, a]), S = n(() => b("/site/logout", { method: "post" }).catch(() => {}).then(() => {
4454
+ g(null), v("guest");
4455
+ }), [b]), C = n(() => {
4456
+ y.current || a || t || (y.current = !0, v("loading"), x());
3766
4457
  }, [
3767
- i,
4458
+ a,
3768
4459
  t,
3769
- b
3770
- ]), C = o(() => ({
3771
- user: m,
3772
- status: g,
3773
- ensure: S,
3774
- refresh: b,
3775
- signOut: x
3776
- }), [
3777
- m,
3778
- g,
3779
- S,
3780
- b,
3781
4460
  x
4461
+ ]), w = o(() => ({
4462
+ user: h,
4463
+ status: _,
4464
+ ensure: C,
4465
+ refresh: x,
4466
+ signOut: S
4467
+ }), [
4468
+ h,
4469
+ _,
4470
+ C,
4471
+ x,
4472
+ S
3782
4473
  ]);
3783
- return /* @__PURE__ */ u(rn.Provider, {
3784
- value: C,
4474
+ return i(() => {
4475
+ a || typeof window > "u" || (window.webim = {
4476
+ ...window.webim,
4477
+ user: h,
4478
+ status: _,
4479
+ requireUser: () => y.current || t ? Promise.resolve(h) : x(),
4480
+ signOut: S
4481
+ }, window.dispatchEvent(new CustomEvent("webim:session", { detail: {
4482
+ user: h,
4483
+ status: _
4484
+ } })));
4485
+ }, [
4486
+ a,
4487
+ h,
4488
+ _,
4489
+ t,
4490
+ x,
4491
+ S
4492
+ ]), /* @__PURE__ */ u(On.Provider, {
4493
+ value: w,
3785
4494
  children: e
3786
4495
  });
3787
4496
  }
3788
- function sn({ when: e, children: t }) {
3789
- let { status: n } = an();
4497
+ function jn({ when: e, children: t }) {
4498
+ let { status: n } = kn();
3790
4499
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
3791
4500
  }
3792
4501
  //#endregion
3793
4502
  //#region ../ui/src/components/builder/apps/auth/views.jsx
3794
- function cn({ 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 }) {
3795
- 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) => {
4503
+ function Mn({ 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 }) {
4504
+ let { tenant: h, apiUrl: g, settings: _ } = r(q), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
3796
4505
  if (e.preventDefault(), f) return;
3797
4506
  let n = new FormData(e.currentTarget);
3798
- w(!0), x("");
4507
+ C(!0), x("");
3799
4508
  try {
3800
- let e = await fetch(`${g || "/api"}/site/${T ? "register" : "login"}`, {
4509
+ let e = await fetch(`${g || "/api"}/site/${w ? "register" : "login"}`, {
3801
4510
  method: "post",
3802
4511
  headers: {
3803
4512
  "content-type": "application/json",
@@ -3807,19 +4516,19 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3807
4516
  body: JSON.stringify({
3808
4517
  email: n.get("email"),
3809
4518
  password: n.get("password"),
3810
- ...T ? { name: n.get("name") || "" } : {}
4519
+ ...w ? { name: n.get("name") || "" } : {}
3811
4520
  })
3812
4521
  }), r = await e.json().catch(() => null);
3813
4522
  if (!e.ok || r?.success === !1) {
3814
- x(r?.error?.message || "Sign-in failed"), y("error"), w(!1);
4523
+ x(r?.error?.message || "Sign-in failed"), y("error"), C(!1);
3815
4524
  return;
3816
4525
  }
3817
4526
  if (y("success"), typeof window < "u") {
3818
- let e = D(t) || D(new URLSearchParams(window.location.search).get("next")) || D(_?.["site.authRedirect"]) || D(_?.["apps.auth.redirect"]) || "/";
4527
+ let e = E(t) || E(new URLSearchParams(window.location.search).get("next")) || E(_?.["site.authRedirect"]) || E(_?.["apps.auth.redirect"]) || "/";
3819
4528
  window.location.assign(e);
3820
4529
  }
3821
4530
  } catch {
3822
- x("Sign-in failed"), y("error"), w(!1);
4531
+ x("Sign-in failed"), y("error"), C(!1);
3823
4532
  }
3824
4533
  };
3825
4534
  return /* @__PURE__ */ d("div", {
@@ -3828,32 +4537,32 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3828
4537
  display: "grid",
3829
4538
  gap: 12,
3830
4539
  maxWidth: 360,
3831
- ...C(s)
4540
+ ...A(s)
3832
4541
  },
3833
4542
  children: [
3834
4543
  /* @__PURE__ */ d("form", {
3835
- onSubmit: O,
4544
+ onSubmit: D,
3836
4545
  style: {
3837
- display: E === "form" ? "grid" : "none",
4546
+ display: T === "form" ? "grid" : "none",
3838
4547
  gap: 10
3839
4548
  },
3840
4549
  children: [
3841
- T ? /* @__PURE__ */ d("label", {
4550
+ w ? /* @__PURE__ */ d("label", {
3842
4551
  style: {
3843
- ...Y,
4552
+ ...St,
3844
4553
  display: "grid",
3845
4554
  gap: 6
3846
4555
  },
3847
4556
  children: [a, /* @__PURE__ */ u("input", {
3848
4557
  name: "name",
3849
4558
  type: "text",
3850
- style: X,
3851
- ...Z(f)
4559
+ style: Q,
4560
+ ...$(f)
3852
4561
  })]
3853
4562
  }) : null,
3854
4563
  /* @__PURE__ */ d("label", {
3855
4564
  style: {
3856
- ...Y,
4565
+ ...St,
3857
4566
  display: "grid",
3858
4567
  gap: 6
3859
4568
  },
@@ -3861,13 +4570,13 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3861
4570
  name: "email",
3862
4571
  type: "email",
3863
4572
  required: !f,
3864
- style: X,
3865
- ...Z(f)
4573
+ style: Q,
4574
+ ...$(f)
3866
4575
  })]
3867
4576
  }),
3868
4577
  /* @__PURE__ */ d("label", {
3869
4578
  style: {
3870
- ...Y,
4579
+ ...St,
3871
4580
  display: "grid",
3872
4581
  gap: 6
3873
4582
  },
@@ -3875,15 +4584,15 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3875
4584
  name: "password",
3876
4585
  type: "password",
3877
4586
  required: !f,
3878
- style: X,
3879
- ...Z(f)
4587
+ style: Q,
4588
+ ...$(f)
3880
4589
  })]
3881
4590
  }),
3882
4591
  /* @__PURE__ */ u("button", {
3883
4592
  type: f ? "button" : "submit",
3884
4593
  disabled: S || void 0,
3885
4594
  style: {
3886
- ...q,
4595
+ ...X,
3887
4596
  border: 0,
3888
4597
  padding: "10px 22px",
3889
4598
  borderRadius: 8,
@@ -3892,7 +4601,7 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3892
4601
  cursor: "pointer",
3893
4602
  opacity: S ? .6 : 1
3894
4603
  },
3895
- children: o || (T ? "Create account" : "Sign in")
4604
+ children: o || (w ? "Create account" : "Sign in")
3896
4605
  }),
3897
4606
  b ? /* @__PURE__ */ u("p", {
3898
4607
  style: {
@@ -3905,18 +4614,18 @@ function cn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
3905
4614
  ]
3906
4615
  }),
3907
4616
  /* @__PURE__ */ u("div", {
3908
- style: { display: E === "success" ? "block" : "none" },
4617
+ style: { display: T === "success" ? "block" : "none" },
3909
4618
  children: p?.success ?? null
3910
4619
  }),
3911
4620
  /* @__PURE__ */ u("div", {
3912
- style: { display: E === "error" ? "block" : "none" },
4621
+ style: { display: T === "error" ? "block" : "none" },
3913
4622
  children: p?.error ?? null
3914
4623
  })
3915
4624
  ]
3916
4625
  });
3917
4626
  }
3918
- function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
3919
- let { user: c, status: l, signOut: f } = an(), p = a ? s || "user" : l, m = a ? {
4627
+ function Nn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
4628
+ let { user: c, status: l, signOut: f } = kn(), p = a ? s || "user" : l, m = a ? {
3920
4629
  name: "Ada Lovelace",
3921
4630
  email: "ada@example.com"
3922
4631
  } : c;
@@ -3924,7 +4633,7 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3924
4633
  ref: i,
3925
4634
  style: {
3926
4635
  minHeight: 24,
3927
- ...C(r)
4636
+ ...A(r)
3928
4637
  }
3929
4638
  }) : p === "user" ? /* @__PURE__ */ d("div", {
3930
4639
  ref: i,
@@ -3932,12 +4641,12 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3932
4641
  display: "flex",
3933
4642
  alignItems: "center",
3934
4643
  gap: 10,
3935
- ...C(r)
4644
+ ...A(r)
3936
4645
  },
3937
4646
  children: [
3938
4647
  /* @__PURE__ */ d("span", {
3939
4648
  style: {
3940
- ...Y,
4649
+ ...St,
3941
4650
  fontWeight: 600
3942
4651
  },
3943
4652
  children: [
@@ -3948,7 +4657,7 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3948
4657
  }),
3949
4658
  n && m?.email ? /* @__PURE__ */ u("span", {
3950
4659
  style: {
3951
- ...Y,
4660
+ ...St,
3952
4661
  opacity: .7
3953
4662
  },
3954
4663
  children: m.email
@@ -3957,14 +4666,14 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3957
4666
  type: "button",
3958
4667
  onClick: a ? void 0 : f,
3959
4668
  style: {
3960
- ...q,
4669
+ ...X,
3961
4670
  border: 0,
3962
4671
  padding: "8px 16px",
3963
4672
  borderRadius: 8,
3964
4673
  fontSize: 14,
3965
4674
  cursor: a ? "default" : "pointer"
3966
4675
  },
3967
- ...Z(a),
4676
+ ...$(a),
3968
4677
  children: t
3969
4678
  })
3970
4679
  ]
@@ -3974,47 +4683,47 @@ function ln({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
3974
4683
  display: "flex",
3975
4684
  alignItems: "center",
3976
4685
  gap: 10,
3977
- ...C(r)
4686
+ ...A(r)
3978
4687
  },
3979
4688
  children: o?.signedOut ?? null
3980
4689
  });
3981
4690
  }
3982
4691
  //#endregion
3983
4692
  //#region ../ui/src/components/builder/apps/consent/manifest.js
3984
- var un = {
4693
+ var Pn = {
3985
4694
  id: "consent",
3986
4695
  label: "Cookie consent",
3987
4696
  category: "Apps",
3988
4697
  keys: ["CookieConsent"],
3989
4698
  ssr: "shell",
3990
4699
  settings: []
3991
- }, dn = "webim.cookie_consent";
3992
- function fn() {
4700
+ }, Fn = "webim.cookie_consent";
4701
+ function In() {
3993
4702
  try {
3994
- let e = window.localStorage.getItem(dn), t = e ? JSON.parse(e) : null;
4703
+ let e = window.localStorage.getItem(Fn), t = e ? JSON.parse(e) : null;
3995
4704
  return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
3996
4705
  } catch {
3997
4706
  return "";
3998
4707
  }
3999
4708
  }
4000
- function pn(e) {
4709
+ function Ln(e) {
4001
4710
  try {
4002
4711
  document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
4003
4712
  } catch {}
4004
4713
  }
4005
- function mn(e) {
4714
+ function Rn(e) {
4006
4715
  try {
4007
- window.localStorage.setItem(dn, JSON.stringify({
4716
+ window.localStorage.setItem(Fn, JSON.stringify({
4008
4717
  choice: e,
4009
4718
  at: (/* @__PURE__ */ new Date()).toISOString()
4010
4719
  }));
4011
4720
  } catch {}
4012
- pn(e);
4721
+ Ln(e);
4013
4722
  try {
4014
4723
  window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
4015
4724
  } catch {}
4016
4725
  }
4017
- var hn = {
4726
+ var zn = {
4018
4727
  bottom: {
4019
4728
  left: 0,
4020
4729
  right: 0,
@@ -4036,21 +4745,18 @@ var hn = {
4036
4745
  maxWidth: 400
4037
4746
  }
4038
4747
  };
4039
- function gn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
4748
+ function Bn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
4040
4749
  let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
4041
4750
  y(e), typeof m == "function" && m(e);
4042
4751
  };
4043
4752
  if (i(() => {
4044
4753
  if (h) return;
4045
- let e = fn();
4046
- if (e) {
4047
- let t = v?.closest?.(".webim-page");
4048
- t && t.setAttribute("data-webim-consent", e);
4049
- } else _(!0);
4754
+ let e = In();
4755
+ e ? Ln(e) : _(!0);
4050
4756
  }, [h, v]), !g) return null;
4051
4757
  let x = (e) => () => {
4052
- h || (mn(e, v), _(!1));
4053
- }, S = hn[s] ?? hn.bottom, w = {
4758
+ h || (Rn(e), _(!1));
4759
+ }, S = zn[s] ?? zn.bottom, C = {
4054
4760
  appearance: "none",
4055
4761
  font: "inherit",
4056
4762
  fontSize: 14,
@@ -4082,7 +4788,7 @@ function gn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
4082
4788
  boxShadow: "0 8px 30px rgba(15, 23, 42, 0.18)",
4083
4789
  fontSize: 14,
4084
4790
  lineHeight: 1.5,
4085
- ...C(p)
4791
+ ...A(p)
4086
4792
  },
4087
4793
  children: [/* @__PURE__ */ d("div", {
4088
4794
  style: {
@@ -4108,7 +4814,7 @@ function gn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
4108
4814
  type: "button",
4109
4815
  onClick: x("declined"),
4110
4816
  style: {
4111
- ...w,
4817
+ ...C,
4112
4818
  background: "transparent",
4113
4819
  color: "inherit",
4114
4820
  border: "1px solid var(--page-border, rgba(148, 163, 184, 0.6))"
@@ -4118,7 +4824,7 @@ function gn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
4118
4824
  type: "button",
4119
4825
  onClick: x("accepted"),
4120
4826
  style: {
4121
- ...w,
4827
+ ...C,
4122
4828
  background: "var(--page-accent, #111827)",
4123
4829
  color: "var(--page-accent-text, #ffffff)",
4124
4830
  border: "1px solid transparent"
@@ -4130,31 +4836,251 @@ function gn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
4130
4836
  }
4131
4837
  //#endregion
4132
4838
  //#region ../ui/src/components/builder/apps/language/manifest.js
4133
- var _n = {
4839
+ var Vn = {
4134
4840
  id: "language",
4135
4841
  label: "Language",
4136
4842
  category: "Apps",
4137
4843
  keys: ["SiteLanguagePicker"],
4138
4844
  ssr: "prefetch",
4139
4845
  settings: ["locales"]
4140
- };
4846
+ }, Hn = {
4847
+ id: "search",
4848
+ label: "Search",
4849
+ category: "Apps",
4850
+ keys: ["SiteSearch"],
4851
+ ssr: "prefetch",
4852
+ settings: []
4853
+ }, Un = 50, Wn = 2e3;
4854
+ function Gn() {
4855
+ return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
4856
+ }
4857
+ function Kn(e, t) {
4858
+ let n = e?.data ?? {}, r = [];
4859
+ for (let e of Object.values(n)) {
4860
+ let t = e == null ? "" : Y(e);
4861
+ if (t && r.push(t), r.join(" ").length > Wn) break;
4862
+ }
4863
+ return r.join(" ").slice(0, Wn).toLocaleLowerCase(t || void 0);
4864
+ }
4865
+ function qn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
4866
+ let { tenant: b, apiUrl: x, locale: S } = r(q), [C, w] = c(() => Gn()), [T, E] = c(() => Gn()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
4867
+ i(() => {
4868
+ let e = () => {
4869
+ let e = Gn();
4870
+ w(e), E(e);
4871
+ };
4872
+ return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
4873
+ window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
4874
+ };
4875
+ }, []), i(() => {
4876
+ if (!a) return;
4877
+ let e = setTimeout(() => {
4878
+ w(T), T.trim() && j(!0);
4879
+ }, 200);
4880
+ return () => clearTimeout(e);
4881
+ }, [a, T]), i(() => {
4882
+ if (!N) return;
4883
+ let e = (e) => {
4884
+ M.current && !M.current.contains(e.target) && j(!1);
4885
+ }, t = (e) => e.key === "Escape" && j(!1);
4886
+ return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
4887
+ document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
4888
+ };
4889
+ }, [N]), i(() => {
4890
+ let e = !0, t = b ? { "x-tenant": b } : {}, n = (e) => fetch(`${x}${e}`, { headers: t }).then((e) => e.json()).then((e) => e?.payload).catch(() => null), r = [l ? n("/site/pages").then((e) => ({
4891
+ kind: "page",
4892
+ rows: Array.isArray(e) ? e : []
4893
+ })) : null, ...(Array.isArray(f) ? f : []).filter(Boolean).map((e) => n(`/dynamic/${encodeURIComponent(e)}?all=1${S ? `&locale=${encodeURIComponent(S)}` : ""}`).then((t) => ({
4894
+ kind: "entry",
4895
+ slug: e,
4896
+ rows: Array.isArray(t) ? t : Array.isArray(t?.data) ? t.data : []
4897
+ })))].filter(Boolean);
4898
+ return Promise.all(r).then((t) => e && O(t)), () => {
4899
+ e = !1;
4900
+ };
4901
+ }, [
4902
+ x,
4903
+ b,
4904
+ S,
4905
+ l,
4906
+ JSON.stringify(f)
4907
+ ]);
4908
+ let P = C.trim().toLocaleLowerCase(S || void 0), F = [];
4909
+ if (P && D) for (let e of D) if (e.kind === "page") for (let t of e.rows) {
4910
+ if (t?.access && t.access !== "public") continue;
4911
+ let e = String(t?.title ?? "");
4912
+ `${e} ${t?.slug ?? ""}`.toLocaleLowerCase(S || void 0).includes(P) && F.push({
4913
+ key: `page:${t.slug}`,
4914
+ title: e || t.slug,
4915
+ url: `/${t.slug}`,
4916
+ kind: "page"
4917
+ });
4918
+ }
4919
+ else for (let t of e.rows) {
4920
+ if (!Kn(t, S).includes(P)) continue;
4921
+ let n = t?.data ?? {}, r = Y(n.name) || "Untitled", i = Y(n.slug);
4922
+ F.push({
4923
+ key: `entry:${t.id}`,
4924
+ title: r,
4925
+ url: i ? `/${e.slug}/${i}` : `/${e.slug}`,
4926
+ kind: "entry"
4927
+ });
4928
+ }
4929
+ let I = F.slice(0, Math.min(Math.max(1, p), Un)), L = (e) => {
4930
+ if (v) {
4931
+ e.preventDefault(), w(T), j(!0);
4932
+ return;
4933
+ }
4934
+ if (typeof window > "u" || !window.history?.pushState) return;
4935
+ e.preventDefault();
4936
+ let t = new URLSearchParams(window.location.search);
4937
+ T.trim() ? t.set("q", T.trim()) : t.delete("q"), t.delete("page");
4938
+ let n = t.toString();
4939
+ window.history.pushState({}, "", `${window.location.pathname}${n ? `?${n}` : ""}`), window.dispatchEvent(new Event("webim:urlchange")), j(!0);
4940
+ }, R = y && !P ? [{
4941
+ key: "sample-1",
4942
+ title: "About us",
4943
+ url: "/about",
4944
+ kind: "page"
4945
+ }, {
4946
+ key: "sample-2",
4947
+ title: "Spring collection",
4948
+ url: "/blog/spring",
4949
+ kind: "entry"
4950
+ }] : null, z = R ?? I, ee = !R && P && D && !I.length, B = !N || k && (z.length > 0 || ee), V = z.length > 0 && /* @__PURE__ */ u("ul", {
4951
+ style: {
4952
+ listStyle: "none",
4953
+ margin: 0,
4954
+ padding: 0,
4955
+ display: "flex",
4956
+ flexDirection: "column",
4957
+ gap: 2
4958
+ },
4959
+ children: z.map((e) => /* @__PURE__ */ u("li", { children: /* @__PURE__ */ d("a", {
4960
+ href: v ? void 0 : e.url,
4961
+ style: {
4962
+ display: "block",
4963
+ padding: "10px 12px",
4964
+ borderRadius: 6,
4965
+ color: "inherit",
4966
+ textDecoration: "none",
4967
+ border: N ? 0 : "1px solid var(--page-border, rgba(148, 163, 184, 0.35))"
4968
+ },
4969
+ children: [/* @__PURE__ */ u("span", {
4970
+ style: {
4971
+ display: "block",
4972
+ fontWeight: 600
4973
+ },
4974
+ children: e.title
4975
+ }), /* @__PURE__ */ u("span", {
4976
+ style: {
4977
+ display: "block",
4978
+ fontSize: 12,
4979
+ opacity: .6
4980
+ },
4981
+ children: e.url
4982
+ })]
4983
+ }) }, e.key))
4984
+ });
4985
+ return /* @__PURE__ */ u("div", {
4986
+ ref: _,
4987
+ style: {
4988
+ width: "100%",
4989
+ ...A(g)
4990
+ },
4991
+ children: /* @__PURE__ */ d("div", {
4992
+ ref: M,
4993
+ style: { position: "relative" },
4994
+ children: [
4995
+ /* @__PURE__ */ d("form", {
4996
+ method: "get",
4997
+ onSubmit: L,
4998
+ style: {
4999
+ display: "flex",
5000
+ gap: 8,
5001
+ alignItems: "center"
5002
+ },
5003
+ children: [/* @__PURE__ */ u("input", {
5004
+ type: "search",
5005
+ name: "q",
5006
+ value: T,
5007
+ placeholder: e,
5008
+ onChange: (e) => E(e.target.value),
5009
+ onFocus: () => P && j(!0),
5010
+ style: {
5011
+ ...Q,
5012
+ flexGrow: 1,
5013
+ minWidth: 0
5014
+ }
5015
+ }), n !== !1 && /* @__PURE__ */ u("button", {
5016
+ type: "submit",
5017
+ style: {
5018
+ padding: "10px 16px",
5019
+ border: 0,
5020
+ borderRadius: 6,
5021
+ cursor: "pointer",
5022
+ fontSize: 14,
5023
+ fontFamily: "inherit",
5024
+ background: "var(--page-accent, #4f46e5)",
5025
+ color: "var(--page-accent-text, #ffffff)"
5026
+ },
5027
+ children: t
5028
+ })]
5029
+ }),
5030
+ h && /* @__PURE__ */ u("div", {
5031
+ style: {
5032
+ fontSize: 13,
5033
+ opacity: .65,
5034
+ marginTop: 6
5035
+ },
5036
+ children: h
5037
+ }),
5038
+ B && /* @__PURE__ */ d("div", {
5039
+ style: N ? {
5040
+ position: "absolute",
5041
+ top: "100%",
5042
+ left: 0,
5043
+ right: 0,
5044
+ zIndex: 30,
5045
+ marginTop: 6,
5046
+ padding: 6,
5047
+ maxHeight: 320,
5048
+ overflowY: "auto",
5049
+ borderRadius: 8,
5050
+ border: "1px solid var(--page-border, rgba(148, 163, 184, 0.35))",
5051
+ background: "var(--page-surface, #f2f2f2)",
5052
+ boxShadow: "0 12px 32px rgba(15, 23, 42, 0.18)"
5053
+ } : { marginTop: 14 },
5054
+ children: [V, ee && /* @__PURE__ */ u("div", {
5055
+ style: {
5056
+ fontSize: 14,
5057
+ opacity: .65,
5058
+ padding: N ? "10px 12px" : 0
5059
+ },
5060
+ children: m
5061
+ })]
5062
+ })
5063
+ ]
5064
+ })
5065
+ });
5066
+ }
4141
5067
  //#endregion
4142
5068
  //#region ../ui/src/components/builder/apps/language/views.jsx
4143
- function vn(e) {
5069
+ function Jn(e) {
4144
5070
  let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
4145
5071
  return [...new Set(n.map((e) => e.trim()))];
4146
5072
  }
4147
- var yn = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
4148
- function bn(e, t) {
5073
+ var Yn = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
5074
+ function Xn(e, t) {
4149
5075
  let n = String(e ?? "").toUpperCase();
4150
5076
  if (t === "code") return n;
4151
5077
  let r = "";
4152
5078
  try {
4153
- r = yn(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
5079
+ r = Yn(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
4154
5080
  } catch {}
4155
5081
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
4156
5082
  }
4157
- function xn(e, t) {
5083
+ function Zn(e, t) {
4158
5084
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
4159
5085
  if (typeof window > "u") return n || "?";
4160
5086
  try {
@@ -4164,12 +5090,12 @@ function xn(e, t) {
4164
5090
  return n || "/";
4165
5091
  }
4166
5092
  }
4167
- function Sn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
4168
- let c = r(H), l = vn(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
5093
+ function Qn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
5094
+ let c = r(q), l = Jn(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
4169
5095
  display: "inline-flex",
4170
5096
  alignItems: "center",
4171
5097
  gap: 8,
4172
- ...C(a)
5098
+ ...A(a)
4173
5099
  };
4174
5100
  if (l.length < 2) return s ? /* @__PURE__ */ u("div", {
4175
5101
  ref: o,
@@ -4200,7 +5126,7 @@ function Sn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
4200
5126
  style: { opacity: .4 },
4201
5127
  children: n ?? "·"
4202
5128
  }), /* @__PURE__ */ u("a", {
4203
- href: xn(e, e === f),
5129
+ href: Zn(e, e === f),
4204
5130
  hrefLang: e,
4205
5131
  "aria-current": e === p ? "true" : void 0,
4206
5132
  onClick: s ? (e) => e.preventDefault() : void 0,
@@ -4210,7 +5136,7 @@ function Sn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
4210
5136
  textDecoration: "none",
4211
5137
  cursor: s ? "default" : "pointer"
4212
5138
  },
4213
- children: bn(e, t)
5139
+ children: Xn(e, t)
4214
5140
  })]
4215
5141
  }, e))]
4216
5142
  }) : /* @__PURE__ */ d("div", {
@@ -4221,7 +5147,7 @@ function Sn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
4221
5147
  value: p,
4222
5148
  onChange: s ? void 0 : (e) => {
4223
5149
  let t = e.target.value;
4224
- window.location.assign(xn(t, t === f));
5150
+ window.location.assign(Zn(t, t === f));
4225
5151
  },
4226
5152
  onKeyDown: s ? (e) => e.preventDefault() : void 0,
4227
5153
  style: {
@@ -4235,55 +5161,57 @@ function Sn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
4235
5161
  },
4236
5162
  children: l.map((e) => /* @__PURE__ */ u("option", {
4237
5163
  value: e,
4238
- children: bn(e, t)
5164
+ children: Xn(e, t)
4239
5165
  }, e))
4240
5166
  })]
4241
5167
  });
4242
5168
  }
4243
5169
  //#endregion
4244
5170
  //#region ../ui/src/components/builder/apps/index.js
4245
- var Cn = [
4246
- nn,
4247
- _n,
4248
- un
4249
- ], wn = {
4250
- SiteLoginForm: cn,
4251
- SiteAccountMenu: ln,
4252
- SiteLanguagePicker: Sn,
4253
- CookieConsent: gn
5171
+ var $n = [
5172
+ Dn,
5173
+ Vn,
5174
+ Pn,
5175
+ Hn
5176
+ ], er = {
5177
+ SiteLoginForm: Mn,
5178
+ SiteAccountMenu: Nn,
5179
+ SiteLanguagePicker: Qn,
5180
+ CookieConsent: Bn,
5181
+ SiteSearch: qn
4254
5182
  };
4255
- new Set(Cn.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
5183
+ new Set($n.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
4256
5184
  //#endregion
4257
5185
  //#region ../ui/src/components/builder/plugins/runtime.js
4258
- var Tn = /* @__PURE__ */ new Map();
4259
- function En(e) {
4260
- if (Tn.has(e)) return Tn.get(e);
5186
+ var tr = /* @__PURE__ */ new Map();
5187
+ function nr(e) {
5188
+ if (tr.has(e)) return tr.get(e);
4261
5189
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
4262
5190
  /* @vite-ignore */
4263
5191
  /* webpackIgnore: true */
4264
5192
  t
4265
5193
  ).finally(() => URL.revokeObjectURL(t));
4266
- return Tn.set(e, n), n;
5194
+ return tr.set(e, n), n;
4267
5195
  }
4268
- function Dn(e) {
5196
+ function rr(e) {
4269
5197
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
4270
5198
  return n && typeof n == "object" ? n : {};
4271
5199
  }
4272
5200
  //#endregion
4273
5201
  //#region ../ui/src/components/builder/plugins/view.jsx
4274
- async function On(e, t) {
4275
- let n = await En(e);
5202
+ async function ir(e, t) {
5203
+ let n = await nr(e);
4276
5204
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
4277
5205
  }
4278
- var kn = {
5206
+ var ar = {
4279
5207
  padding: "10px 12px",
4280
5208
  border: "1px dashed rgba(148, 163, 184, 0.5)",
4281
5209
  borderRadius: 8,
4282
5210
  fontSize: 12,
4283
5211
  opacity: .6
4284
5212
  };
4285
- function An({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
4286
- let c = r(H), l = Dn(c?.settings)[e], f = s(null), p = s(null), m = {
5213
+ function or({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
5214
+ let c = r(q), l = rr(c?.settings)[e], f = s(null), p = s(null), m = {
4287
5215
  tenant: c?.tenant ?? "",
4288
5216
  apiUrl: c?.apiUrl ?? "/api",
4289
5217
  locale: c?.locale ?? "",
@@ -4295,7 +5223,7 @@ function An({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
4295
5223
  let e = f.current;
4296
5224
  if (!l?.code || !e) return;
4297
5225
  let n = !0;
4298
- return On(l.code, t).then((e) => {
5226
+ return ir(l.code, t).then((e) => {
4299
5227
  if (!(!n || !e || !f.current)) {
4300
5228
  p.current = e;
4301
5229
  try {
@@ -4320,13 +5248,13 @@ function An({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
4320
5248
  } catch {}
4321
5249
  }, [g]), l ? /* @__PURE__ */ u("div", {
4322
5250
  ref: o,
4323
- style: C(a),
5251
+ style: A(a),
4324
5252
  children: /* @__PURE__ */ u("div", { ref: f })
4325
5253
  }) : /* @__PURE__ */ d("div", {
4326
5254
  ref: o,
4327
5255
  style: {
4328
- ...kn,
4329
- ...C(a)
5256
+ ...ar,
5257
+ ...A(a)
4330
5258
  },
4331
5259
  children: [
4332
5260
  "Plugin “",
@@ -4337,12 +5265,12 @@ function An({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
4337
5265
  }
4338
5266
  //#endregion
4339
5267
  //#region ../ui/src/components/builder/render.jsx
4340
- var jn = {
4341
- ...tn,
4342
- ...wn,
4343
- PluginBlock: An
5268
+ var sr = {
5269
+ ...En,
5270
+ ...er,
5271
+ PluginBlock: or
4344
5272
  };
4345
- function Mn(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
5273
+ function cr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
4346
5274
  let o = n[t];
4347
5275
  if (!o || o.hidden) return null;
4348
5276
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -4350,112 +5278,114 @@ function Mn(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
4350
5278
  let n = o.props?.componentId, s = r?.[n];
4351
5279
  if (!s?.template || i.has(n)) return null;
4352
5280
  let c = new Set(i).add(n);
4353
- return /* @__PURE__ */ u(e, { children: Mn(s.template.rootId, s.template.nodes, r, c, a) }, t);
5281
+ return /* @__PURE__ */ u(e, { children: cr(s.template.rootId, s.template.nodes, r, c, a) }, t);
4354
5282
  }
4355
- let l = jn[s];
5283
+ let l = sr[s];
4356
5284
  if (!l) return null;
4357
- let d = (o.nodes ?? []).map((e) => Mn(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Mn(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
5285
+ let d = (o.nodes ?? []).map((e) => cr(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, cr(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
4358
5286
  ...c,
4359
5287
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
4360
5288
  linked: p,
4361
5289
  nodeRef: (e) => {
4362
- e && (e.setAttribute("data-wb", t), O(e, c));
5290
+ e && (e.setAttribute("data-wb", t), B(e, c), ee(e, a?.events === !1 ? [] : c.events));
4363
5291
  },
4364
5292
  children: d.length ? d : void 0
4365
5293
  }, t);
4366
- return c.when && c.when !== "always" ? /* @__PURE__ */ u(sn, {
5294
+ return c.when && c.when !== "always" ? /* @__PURE__ */ u(jn, {
4367
5295
  when: c.when,
4368
5296
  children: m
4369
5297
  }, t) : m;
4370
5298
  }
4371
5299
  //#endregion
4372
5300
  //#region ../ui/src/components/builder/PageRenderer.jsx
4373
- var Nn = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Pn = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(V(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
4374
- .webim-page[data-webim-mode="dark"] { ${Object.entries(V(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
4375
- 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: _ }) {
4376
- let v = s?.js?.trim();
5301
+ var lr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), ur = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(K(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
5302
+ .webim-page[data-webim-mode="dark"] { ${Object.entries(K(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
5303
+ function dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, animations: c, tenant: l, apiUrl: f, datasets: p, locale: m, direction: h, settings: _, siteUser: v }) {
5304
+ let b = s?.js?.trim();
4377
5305
  if (i(() => {
4378
- if (!v) return;
5306
+ if (!b) return;
4379
5307
  let e = document.createElement("script");
4380
- return e.text = v, document.body.appendChild(e), () => e.remove();
4381
- }, [v]), !e?.ROOT) return null;
4382
- let b = {
4383
- lang: p || void 0,
4384
- dir: fe(m, p)
4385
- }, x = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", S = {
5308
+ return e.text = b, document.body.appendChild(e), () => e.remove();
5309
+ }, [b]), !e?.ROOT) return null;
5310
+ let x = {
5311
+ lang: m || void 0,
5312
+ dir: be(h, m)
5313
+ }, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
4386
5314
  minHeight: "100%",
4387
5315
  display: "flex",
4388
5316
  flexDirection: "column"
4389
- }, C = Mn("ROOT", e, n), w = o(() => ({ render: (t, r) => Mn(t, e, n, void 0, { mapProps: r }) }), [e, n]), T = ee(e, n), E = F(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", {
5317
+ }, w = cr("ROOT", e, n), T = o(() => ({ render: (t, r) => cr(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = oe(e, n), O = ae(e, n), k = s?.css?.trim(), A = E(c), j = ue(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !G[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
4390
5318
  rel: "stylesheet",
4391
5319
  precedence: "default",
4392
5320
  href: g(e)
4393
- }, e)), j = Pn(O);
4394
- return r === "auto" ? /* @__PURE__ */ u(H.Provider, {
5321
+ }, e)), P = ur(j);
5322
+ return r === "auto" ? /* @__PURE__ */ u(q.Provider, {
4395
5323
  value: {
4396
- tenant: c || "",
4397
- apiUrl: l || "/api",
4398
- locale: p || "",
4399
- settings: h ?? null
5324
+ tenant: l || "",
5325
+ apiUrl: f || "/api",
5326
+ locale: m || "",
5327
+ settings: _ ?? null
4400
5328
  },
4401
- children: /* @__PURE__ */ u(on, {
4402
- initialUser: _,
4403
- children: /* @__PURE__ */ u(U.Provider, {
4404
- value: f ?? null,
4405
- children: /* @__PURE__ */ u(he.Provider, {
4406
- value: w,
5329
+ children: /* @__PURE__ */ u(An, {
5330
+ initialUser: v,
5331
+ children: /* @__PURE__ */ u(J.Provider, {
5332
+ value: p ?? null,
5333
+ children: /* @__PURE__ */ u(we.Provider, {
5334
+ value: T,
4407
5335
  children: /* @__PURE__ */ d("div", {
4408
- ...b,
5336
+ ...x,
4409
5337
  className: "webim-page",
4410
5338
  style: {
4411
- ...S,
4412
- ...re(t),
5339
+ ...C,
5340
+ ...de(t),
4413
5341
  ...a
4414
5342
  },
4415
5343
  children: [
4416
- /* @__PURE__ */ u("style", { children: `.webim-page { ${Nn(V(O.light))} }
4417
- @media (prefers-color-scheme: dark) { .webim-page { ${Nn(V(O.dark))} } }` }),
4418
- /* @__PURE__ */ u("style", { children: j }),
4419
- A,
4420
- /* @__PURE__ */ u("style", { children: x }),
4421
- T && /* @__PURE__ */ u("style", { children: T }),
4422
- E && /* @__PURE__ */ u("style", { children: E }),
5344
+ /* @__PURE__ */ u("style", { children: `.webim-page { ${lr(K(j.light))} }
5345
+ @media (prefers-color-scheme: dark) { .webim-page { ${lr(K(j.dark))} } }` }),
5346
+ /* @__PURE__ */ u("style", { children: P }),
5347
+ N,
5348
+ /* @__PURE__ */ u("style", { children: S }),
4423
5349
  D && /* @__PURE__ */ u("style", { children: D }),
4424
- C
5350
+ O && /* @__PURE__ */ u("style", { children: O }),
5351
+ k && /* @__PURE__ */ u("style", { children: k }),
5352
+ w
4425
5353
  ]
4426
5354
  })
4427
5355
  })
4428
5356
  })
4429
5357
  })
4430
- }) : /* @__PURE__ */ u(H.Provider, {
5358
+ }) : /* @__PURE__ */ u(q.Provider, {
4431
5359
  value: {
4432
- tenant: c || "",
4433
- apiUrl: l || "/api",
4434
- locale: p || "",
4435
- settings: h ?? null
5360
+ tenant: l || "",
5361
+ apiUrl: f || "/api",
5362
+ locale: m || "",
5363
+ settings: _ ?? null
4436
5364
  },
4437
- children: /* @__PURE__ */ u(on, {
4438
- initialUser: _,
4439
- children: /* @__PURE__ */ u(U.Provider, {
4440
- value: f ?? null,
4441
- children: /* @__PURE__ */ u(he.Provider, {
4442
- value: w,
5365
+ children: /* @__PURE__ */ u(An, {
5366
+ initialUser: v,
5367
+ children: /* @__PURE__ */ u(J.Provider, {
5368
+ value: p ?? null,
5369
+ children: /* @__PURE__ */ u(we.Provider, {
5370
+ value: T,
4443
5371
  children: /* @__PURE__ */ d("div", {
4444
- ...b,
5372
+ ...x,
4445
5373
  className: "webim-page",
4446
5374
  style: {
4447
- ...S,
4448
- ...ie(t, r),
5375
+ ...C,
5376
+ ...fe(t, r),
4449
5377
  ...a
4450
5378
  },
4451
5379
  children: [
4452
- A,
4453
- /* @__PURE__ */ u("style", { children: j }),
4454
- /* @__PURE__ */ u("style", { children: x }),
4455
- T && /* @__PURE__ */ u("style", { children: T }),
4456
- E && /* @__PURE__ */ u("style", { children: E }),
5380
+ N,
5381
+ /* @__PURE__ */ u("style", { children: P }),
5382
+ /* @__PURE__ */ u("style", { children: S }),
4457
5383
  D && /* @__PURE__ */ u("style", { children: D }),
4458
- C
5384
+ O && /* @__PURE__ */ u("style", { children: O }),
5385
+ A && /* @__PURE__ */ u("style", { children: A }),
5386
+ A && /* @__PURE__ */ u("style", { children: A }),
5387
+ k && /* @__PURE__ */ u("style", { children: k }),
5388
+ w
4459
5389
  ]
4460
5390
  })
4461
5391
  })
@@ -4465,25 +5395,26 @@ function Fn({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
4465
5395
  }
4466
5396
  //#endregion
4467
5397
  //#region src/WebimContent.jsx
4468
- function In({ bundle: e, mode: t = "auto", style: n }) {
4469
- return e?.blocks?.ROOT ? /* @__PURE__ */ u(Fn, {
5398
+ function fr({ bundle: e, mode: t = "auto", style: n }) {
5399
+ return e?.blocks?.ROOT ? /* @__PURE__ */ u(dr, {
4470
5400
  blocks: e.blocks,
4471
5401
  theme: e.theme,
4472
5402
  components: e.components,
4473
5403
  custom: e.custom,
5404
+ animations: e.animations,
4474
5405
  tenant: e.tenant,
4475
5406
  apiUrl: e.apiUrl,
4476
5407
  datasets: e.datasets,
4477
5408
  locale: e.locale,
4478
5409
  direction: e.direction,
4479
5410
  settings: e.settings,
4480
- mode: oe(t, e.scheme),
5411
+ mode: me(t, e.scheme),
4481
5412
  style: n
4482
5413
  }) : null;
4483
5414
  }
4484
5415
  //#endregion
4485
5416
  //#region src/WebimPage.jsx
4486
- function Ln({ 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 }) {
5417
+ function pr({ 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 }) {
4487
5418
  let [g, _] = c({ status: "loading" }), v = s({
4488
5419
  onLoad: m,
4489
5420
  onError: h
@@ -4493,7 +5424,7 @@ function Ln({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
4493
5424
  onError: h
4494
5425
  }, i(() => {
4495
5426
  let i = !0;
4496
- return _({ status: "loading" }), le({
5427
+ return _({ status: "loading" }), _e({
4497
5428
  apiUrl: e,
4498
5429
  tenant: t,
4499
5430
  slug: n,
@@ -4520,11 +5451,11 @@ function Ln({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
4520
5451
  r,
4521
5452
  a,
4522
5453
  o
4523
- ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(In, {
5454
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(fr, {
4524
5455
  bundle: g.bundle,
4525
5456
  mode: l,
4526
5457
  style: d
4527
5458
  });
4528
5459
  }
4529
5460
  //#endregion
4530
- export { Fn as PageRenderer, In as WebimContent, Ln as WebimPage, le as fetchPage, Pe as renderRichContent, ae as resolveTheme };
5461
+ export { dr as PageRenderer, fr as WebimContent, pr as WebimPage, _e as fetchPage, We as renderRichContent, pe as resolveTheme };