webim-adapter 0.28.0 → 1.0.0

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