webim-adapter 1.1.1 → 1.1.3

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.
@@ -259,36 +259,36 @@ function P(e) {
259
259
  color: O,
260
260
  inset: k
261
261
  })), A.length && (t.boxShadow = A.join(", "));
262
- let P = (e) => e.type === "blur" ? `blur(${M(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: V, filterSaturate: ee } = t;
262
+ let P = (e) => e.type === "blur" ? `blur(${M(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: ee, filterSaturate: V } = t;
263
263
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
264
264
  let H = F(I);
265
- R !== void 0 && H.push(`blur(${M(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), B !== void 0 && H.push(`brightness(${B}%)`), V !== void 0 && H.push(`contrast(${V}%)`), ee !== void 0 && H.push(`saturate(${ee}%)`), H.length && (t.filter = H.join(" "));
265
+ R !== void 0 && H.push(`blur(${M(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), B !== void 0 && H.push(`brightness(${B}%)`), ee !== void 0 && H.push(`contrast(${ee}%)`), V !== void 0 && H.push(`saturate(${V}%)`), H.length && (t.filter = H.join(" "));
266
266
  let te = F(L);
267
267
  te.length && (t.backdropFilter = te.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
268
- let { textStrokeWidth: U, textStrokeColor: W } = t;
269
- delete t.textStrokeWidth, delete t.textStrokeColor, (U !== void 0 || W !== void 0) && (t.WebkitTextStroke = `${M(U ?? 1)} ${W || "currentColor"}`);
270
- let { clipText: ne } = t;
271
- delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
272
- let { transitions: re, transitionDuration: ie, transitionEasing: ae, transitionProperty: G } = t, oe = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
268
+ let { textStrokeWidth: ne, textStrokeColor: re } = t;
269
+ delete t.textStrokeWidth, delete t.textStrokeColor, (ne !== void 0 || re !== void 0) && (t.WebkitTextStroke = `${M(ne ?? 1)} ${re || "currentColor"}`);
270
+ let { clipText: ie } = t;
271
+ delete t.clipText, ie && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
272
+ let { transitions: ae, transitionDuration: U, transitionEasing: oe, transitionProperty: se } = t, ce = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
273
273
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
274
- let se = (Array.isArray(re) ? re : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${oe(e.duration ?? 200)} ${e.easing || "ease"}`);
275
- if (ie !== void 0 && se.push(`${G || "all"} ${oe(ie)} ${ae || "ease"}`), se.length && (t.transition = se.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
274
+ let le = (Array.isArray(ae) ? ae : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ce(e.duration ?? 200)} ${e.easing || "ease"}`);
275
+ if (U !== void 0 && le.push(`${se || "all"} ${ce(U)} ${oe || "ease"}`), le.length && (t.transition = le.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
276
276
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
277
277
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
278
278
  }
279
279
  delete t.backgroundVideo;
280
- let { overlayColor: K, overlayOpacity: ce } = t;
281
- if (delete t.overlayColor, delete t.overlayOpacity, K) {
282
- let e = `color-mix(in srgb, ${K} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
280
+ let { overlayColor: W, overlayOpacity: ue } = t;
281
+ if (delete t.overlayColor, delete t.overlayOpacity, W) {
282
+ let e = `color-mix(in srgb, ${W} ${ue ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
283
283
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
284
284
  }
285
285
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
286
- let { backgroundLayers: le } = t;
286
+ let { backgroundLayers: G } = t;
287
287
  delete t.backgroundLayers;
288
- let ue = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
289
- if (ue.length) {
288
+ let de = (Array.isArray(G) ? G : []).filter((e) => e && e.on !== !1);
289
+ if (de.length) {
290
290
  let e = [], n = [], r = [], i = [], a = [];
291
- for (let t of ue) 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");
291
+ 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");
292
292
  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");
293
293
  else {
294
294
  if (!t.src) continue;
@@ -322,7 +322,7 @@ var F = {
322
322
  "submit",
323
323
  "keydown",
324
324
  "inview"
325
- ], B = ["load", "pagescroll"], V = [...z, ...B], ee = /^[A-Za-z_$][\w$]*$/;
325
+ ], B = ["load", "pagescroll"], ee = [...z, ...B], V = /^[A-Za-z_$][\w$]*$/;
326
326
  function H(e, t) {
327
327
  let n = String(t ?? "").trim();
328
328
  if (!n) return [e];
@@ -340,7 +340,7 @@ function te(e, t) {
340
340
  let n = [];
341
341
  for (let r of t ?? []) {
342
342
  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();
343
- if (!V.includes(t) || (i ? !a.length : !ee.test(o))) continue;
343
+ if (!ee.includes(t) || (i ? !a.length : !V.test(o))) continue;
344
344
  let s = (t) => {
345
345
  if (i) {
346
346
  for (let t of H(e, r?.target)) x(t, a);
@@ -366,7 +366,7 @@ function te(e, t) {
366
366
  }
367
367
  e.__webimEvents = n;
368
368
  }
369
- function U(e, t, n = []) {
369
+ function ne(e, t, n = []) {
370
370
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
371
371
  let r = R(t.classNames), i = R(e.getAttribute("data-wb-class"));
372
372
  for (let t of i) r.includes(t) || e.classList.remove(t);
@@ -380,15 +380,15 @@ function U(e, t, n = []) {
380
380
  }
381
381
  return a;
382
382
  }
383
- var W = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
384
- function ne(e, t, n, r = !1) {
385
- let i = Object.entries(P(t)).map(([e, t]) => `${W(e)}: ${t} !important;`).join(" ");
383
+ var re = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
384
+ function ie(e, t, n, r = !1) {
385
+ let i = Object.entries(P(t)).map(([e, t]) => `${re(e)}: ${t} !important;`).join(" ");
386
386
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
387
387
  }
388
- function re(e, t, n) {
389
- return Object.entries(F).map(([r, i]) => ne(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
388
+ function ae(e, t, n) {
389
+ return Object.entries(F).map(([r, i]) => ie(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
390
390
  }
391
- var ie = [
391
+ var U = [
392
392
  {
393
393
  key: "tablet",
394
394
  max: 991
@@ -401,17 +401,17 @@ var ie = [
401
401
  key: "mobile",
402
402
  max: 478
403
403
  }
404
- ], ae = (e) => Object.entries(P(e)).map(([e, t]) => `${W(e)}: ${t} !important;`).join(" ");
405
- function G(e, t) {
406
- return ie.map(({ key: n, max: r }) => {
407
- let i = t?.[n] ? ae(t[n]) : "";
404
+ ], oe = (e) => Object.entries(P(e)).map(([e, t]) => `${re(e)}: ${t} !important;`).join(" ");
405
+ function se(e, t) {
406
+ return U.map(({ key: n, max: r }) => {
407
+ let i = t?.[n] ? oe(t[n]) : "";
408
408
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
409
409
  }).filter(Boolean).join("\n");
410
410
  }
411
- function oe(e, t) {
411
+ function ce(e, t) {
412
412
  let n = [], r = (e) => {
413
413
  for (let [t, r] of Object.entries(e || {})) {
414
- let e = G(t, r.props);
414
+ let e = se(t, r.props);
415
415
  e && n.push(e);
416
416
  }
417
417
  };
@@ -419,10 +419,10 @@ function oe(e, t) {
419
419
  for (let e of Object.values(t || {})) r(e.template?.nodes);
420
420
  return n.join("\n");
421
421
  }
422
- function se(e, t) {
422
+ function le(e, t) {
423
423
  let n = [], r = (e) => {
424
424
  for (let [t, r] of Object.entries(e || {})) {
425
- let e = re(t, r.props);
425
+ let e = ae(t, r.props);
426
426
  e && n.push(e);
427
427
  }
428
428
  };
@@ -430,7 +430,15 @@ function se(e, t) {
430
430
  for (let e of Object.values(t || {})) r(e.template?.nodes);
431
431
  return n.join("\n");
432
432
  }
433
- var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", ce = {
433
+ var W = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", ue = {
434
+ fontFamily: W,
435
+ fontStyle: "normal",
436
+ fontWeight: 400,
437
+ letterSpacing: "normal",
438
+ textTransform: "none",
439
+ lineHeight: 1.4,
440
+ textShadow: "none"
441
+ }, G = {
434
442
  light: {
435
443
  background: "#f2f2f2",
436
444
  surface: "#f2f2f2",
@@ -471,23 +479,23 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
471
479
  contrastText: "#052e2b"
472
480
  }
473
481
  }
474
- }, le = {
482
+ }, de = {
475
483
  font: "system",
476
484
  headingFont: "inherit",
477
- light: ce.light,
478
- dark: ce.dark
479
- }, ue = {
485
+ light: G.light,
486
+ dark: G.dark
487
+ }, fe = {
480
488
  system: {
481
489
  label: "System",
482
- value: K
490
+ value: W
483
491
  },
484
492
  inter: {
485
493
  label: "Inter",
486
- value: `"Inter", ${K}`
494
+ value: `"Inter", ${W}`
487
495
  },
488
496
  outfit: {
489
497
  label: "Outfit",
490
- value: `"Outfit", ${K}`
498
+ value: `"Outfit", ${W}`
491
499
  },
492
500
  serif: {
493
501
  label: "Serif",
@@ -497,7 +505,7 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
497
505
  label: "Mono",
498
506
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
499
507
  }
500
- }, de = (e, t) => ue[e]?.value ?? k(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), fe = (e, ...t) => {
508
+ }, pe = (e, t) => fe[e]?.value ?? k(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), me = (e, ...t) => {
501
509
  let n = Object.assign({}, e, ...t);
502
510
  return n.primary = {
503
511
  ...e.primary,
@@ -513,20 +521,20 @@ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
513
521
  }), {})
514
522
  }, n;
515
523
  };
516
- function pe(e) {
524
+ function K(e) {
517
525
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
518
526
  return {
519
- font: r ?? le.font,
520
- headingFont: i ?? le.headingFont,
521
- light: fe(ce.light, a, t),
522
- dark: fe(ce.dark, n)
527
+ font: r ?? de.font,
528
+ headingFont: i ?? de.headingFont,
529
+ light: me(G.light, a, t),
530
+ dark: me(G.dark, n)
523
531
  };
524
532
  }
525
- function me(e) {
533
+ function q(e) {
526
534
  return {
527
535
  "--page-bg": e.background,
528
536
  "--page-surface": e.surface ?? e.background,
529
- "--page-border": e.border ?? ce.light.border,
537
+ "--page-border": e.border ?? G.light.border,
530
538
  "--page-text": e.text,
531
539
  "--page-accent": e.accent,
532
540
  "--page-accent-text": e.accentText,
@@ -541,19 +549,19 @@ function me(e) {
541
549
  };
542
550
  }
543
551
  function he(e) {
544
- let t = pe(e);
552
+ let t = K(e);
545
553
  return {
546
554
  backgroundColor: "var(--page-bg)",
547
555
  color: "var(--page-text)",
548
- fontFamily: de(t.font, K),
549
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : de(t.headingFont, "inherit")
556
+ fontFamily: pe(t.font, W),
557
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : pe(t.headingFont, "inherit")
550
558
  };
551
559
  }
552
560
  function ge(e, t = "light") {
553
- let n = pe(e);
561
+ let n = K(e);
554
562
  return {
555
563
  ...he(e),
556
- ...me(n[t] ?? n.light)
564
+ ...q(n[t] ?? n.light)
557
565
  };
558
566
  }
559
567
  function _e(e, t) {
@@ -564,7 +572,7 @@ function ve(e, t) {
564
572
  }
565
573
  //#endregion
566
574
  //#region ../ui/src/components/builder/views.jsx
567
- var q = n({
575
+ var J = n({
568
576
  tenant: "",
569
577
  apiUrl: "/api",
570
578
  locale: "",
@@ -587,11 +595,11 @@ var q = n({
587
595
  ...xe()
588
596
  };
589
597
  return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
590
- }, Ce = n(null), we = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
591
- function Te(e, t) {
598
+ }, Ce = n(null), Y = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
599
+ function X(e, t) {
592
600
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
593
601
  }
594
- var J = (e) => {
602
+ var Z = (e) => {
595
603
  let t = [];
596
604
  for (let [n, r] of Object.entries(e ?? {})) {
597
605
  if (!/^[\w-]+$/.test(n)) continue;
@@ -601,16 +609,16 @@ var J = (e) => {
601
609
  }
602
610
  return t;
603
611
  };
604
- function Y(e) {
612
+ function we(e) {
605
613
  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(" ") : "";
606
614
  }
607
- function X(e, t) {
608
- let n = t?.data ?? {}, r = J(n);
615
+ function Q(e, t) {
616
+ let n = t?.data ?? {}, r = Z(n);
609
617
  if (!r.length) return e;
610
- let i = RegExp(`:(${r.map(we).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Y(Te(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
618
+ let i = RegExp(`:(${r.map(Y).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => we(X(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
611
619
  return a(e);
612
620
  }
613
- var Z = {
621
+ var Te = {
614
622
  margin: 0,
615
623
  fontWeight: 700,
616
624
  lineHeight: 1.2,
@@ -699,14 +707,14 @@ function Fe({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a
699
707
  return /* @__PURE__ */ d(n, {
700
708
  ref: a,
701
709
  style: {
702
- ...Z,
710
+ ...Te,
703
711
  ...P(r)
704
712
  },
705
713
  children: Re(t, e, i)
706
714
  });
707
715
  }
708
716
  var Ie = {
709
- fontFamily: ue.mono.value,
717
+ fontFamily: fe.mono.value,
710
718
  background: "rgba(148, 163, 184, 0.18)",
711
719
  padding: "1px 5px",
712
720
  borderRadius: 4,
@@ -773,8 +781,29 @@ var Be = {
773
781
  h4: 22,
774
782
  h5: 19,
775
783
  h6: 16
776
- };
777
- function Ve({ align: e = "center", width: t, wrap: n } = {}) {
784
+ }, Ve = [
785
+ "left",
786
+ "center",
787
+ "right",
788
+ "justify"
789
+ ];
790
+ function He(e, t, n) {
791
+ let r = e && e.cellStyles;
792
+ if (!r || typeof r != "object" || Array.isArray(r)) return {};
793
+ let i = r[`${t}:${n}`];
794
+ return i && typeof i == "object" && !Array.isArray(i) ? i : {};
795
+ }
796
+ function Ue(e, t) {
797
+ let n = e || {}, r = typeof n.bold == "boolean" ? n.bold : !!t;
798
+ return {
799
+ textAlign: Ve.includes(n.align) ? n.align : "left",
800
+ fontWeight: r ? 700 : 400,
801
+ fontStyle: n.italic ? "italic" : void 0,
802
+ color: typeof n.color == "string" && n.color ? n.color : void 0,
803
+ backgroundColor: typeof n.bg == "string" && n.bg ? n.bg : void 0
804
+ };
805
+ }
806
+ function We({ align: e = "center", width: t, wrap: n } = {}) {
778
807
  let r = t ? `${t}%` : void 0;
779
808
  if (e === "full") return { width: "100%" };
780
809
  let i = e === "left" || e === "right";
@@ -808,7 +837,7 @@ function Ve({ align: e = "center", width: t, wrap: n } = {}) {
808
837
  marginRight: "auto"
809
838
  };
810
839
  }
811
- function He(e = [], t, n) {
840
+ function Ge(e = [], t, n) {
812
841
  let r = n ?? ((e, n) => Re(e, n, t));
813
842
  return e.map((t, n) => {
814
843
  let i = {
@@ -831,7 +860,7 @@ function He(e = [], t, n) {
831
860
  marginLeft: 0,
832
861
  marginRight: 0,
833
862
  ...i,
834
- ...Ve(t)
863
+ ...We(t)
835
864
  },
836
865
  children: [t.href ? /* @__PURE__ */ d("a", {
837
866
  href: t.href,
@@ -850,16 +879,16 @@ function He(e = [], t, n) {
850
879
  })]
851
880
  }, n);
852
881
  }
853
- if (t.type === "video") return $e(t.url) ? /* @__PURE__ */ d("div", {
882
+ if (t.type === "video") return nt(t.url) ? /* @__PURE__ */ d("div", {
854
883
  style: {
855
884
  ...i,
856
- ...Ve({
885
+ ...We({
857
886
  align: t.align,
858
887
  wrap: t.wrap,
859
888
  width: t.width ?? 100
860
889
  })
861
890
  },
862
- children: /* @__PURE__ */ d(et, {
891
+ children: /* @__PURE__ */ d(rt, {
863
892
  url: t.url,
864
893
  autoplay: t.autoplay,
865
894
  muted: t.muted,
@@ -920,9 +949,11 @@ function He(e = [], t, n) {
920
949
  let r = t.header !== !1, a = {
921
950
  border: t.borders === !1 ? void 0 : "1px solid rgba(148, 163, 184, 0.4)",
922
951
  padding: "6px 10px",
923
- textAlign: "left",
924
952
  verticalAlign: "top"
925
- }, o = r ? e.slice(1) : e, s = Array.isArray(t.widths) ? t.widths : null;
953
+ }, o = r ? e.slice(1) : e, s = Array.isArray(t.widths) ? t.widths : null, c = (e, n, r) => ({
954
+ ...a,
955
+ ...Ue(He(t, e, n), r)
956
+ });
926
957
  return /* @__PURE__ */ f("table", {
927
958
  style: {
928
959
  ...i,
@@ -934,16 +965,13 @@ function He(e = [], t, n) {
934
965
  children: [
935
966
  s && /* @__PURE__ */ d("colgroup", { children: s.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
936
967
  r && /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e[0].map((e, t) => /* @__PURE__ */ d("th", {
937
- style: {
938
- ...a,
939
- fontWeight: 700
940
- },
968
+ style: c(0, t, !0),
941
969
  children: e
942
970
  }, t)) }) }),
943
- /* @__PURE__ */ d("tbody", { children: o.map((e, t) => /* @__PURE__ */ d("tr", { children: e.map((e, t) => /* @__PURE__ */ d("td", {
944
- style: a,
971
+ /* @__PURE__ */ d("tbody", { children: o.map((e, t) => /* @__PURE__ */ d("tr", { children: e.map((e, n) => /* @__PURE__ */ d("td", {
972
+ style: c(r ? t + 1 : t, n, !1),
945
973
  children: e
946
- }, t)) }, t)) })
974
+ }, n)) }, t)) })
947
975
  ]
948
976
  }, n);
949
977
  }
@@ -962,7 +990,7 @@ function He(e = [], t, n) {
962
990
  }
963
991
  if (t.type === "quote") return /* @__PURE__ */ d("blockquote", {
964
992
  style: {
965
- ...We,
993
+ ...qe,
966
994
  ...i
967
995
  },
968
996
  children: r(t.parts, t.text)
@@ -971,7 +999,7 @@ function He(e = [], t, n) {
971
999
  let e = t.type;
972
1000
  return /* @__PURE__ */ d(e, {
973
1001
  style: {
974
- ...Z,
1002
+ ...Te,
975
1003
  fontSize: Be[t.type],
976
1004
  ...i
977
1005
  },
@@ -987,32 +1015,32 @@ function He(e = [], t, n) {
987
1015
  }, n);
988
1016
  });
989
1017
  }
990
- function Ue({ content: e, style: t, linked: n, nodeRef: r }) {
1018
+ function Ke({ content: e, style: t, linked: n, nodeRef: r }) {
991
1019
  return /* @__PURE__ */ d("div", {
992
1020
  ref: r,
993
1021
  style: {
994
1022
  display: "flow-root",
995
1023
  ...P(t)
996
1024
  },
997
- children: He(e, n)
1025
+ children: Ge(e, n)
998
1026
  });
999
1027
  }
1000
- var We = {
1028
+ var qe = {
1001
1029
  margin: 0,
1002
1030
  padding: "8px 0 8px 20px",
1003
1031
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
1004
1032
  };
1005
- function Ge({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1033
+ function Je({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1006
1034
  return /* @__PURE__ */ d("blockquote", {
1007
1035
  ref: i,
1008
1036
  style: {
1009
- ...We,
1037
+ ...qe,
1010
1038
  ...P(n)
1011
1039
  },
1012
1040
  children: Re(t, e, r)
1013
1041
  });
1014
1042
  }
1015
- function Ke({ ordered: e, items: t = [], style: n, nodeRef: r }) {
1043
+ function Ye({ ordered: e, items: t = [], style: n, nodeRef: r }) {
1016
1044
  return /* @__PURE__ */ d(e ? "ol" : "ul", {
1017
1045
  ref: r,
1018
1046
  style: {
@@ -1026,7 +1054,7 @@ function Ke({ ordered: e, items: t = [], style: n, nodeRef: r }) {
1026
1054
  }, t))
1027
1055
  });
1028
1056
  }
1029
- function qe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1057
+ function Xe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1030
1058
  return /* @__PURE__ */ d("p", {
1031
1059
  ref: i,
1032
1060
  style: {
@@ -1036,26 +1064,26 @@ function qe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
1036
1064
  children: Re(t, e, r)
1037
1065
  });
1038
1066
  }
1039
- var Je = {
1067
+ var Ze = {
1040
1068
  color: "var(--page-accent, inherit)",
1041
1069
  textDecoration: "underline",
1042
1070
  textUnderlineOffset: 3,
1043
1071
  cursor: "pointer"
1044
1072
  };
1045
- function Ye({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1073
+ function Qe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1046
1074
  return /* @__PURE__ */ d("a", {
1047
1075
  ref: o,
1048
1076
  href: n || "#",
1049
1077
  target: r || void 0,
1050
1078
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
1051
1079
  style: {
1052
- ...Je,
1080
+ ...Ze,
1053
1081
  ...P(i)
1054
1082
  },
1055
1083
  children: Re(t, e, a)
1056
1084
  });
1057
1085
  }
1058
- function Xe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1086
+ function $e({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
1059
1087
  return /* @__PURE__ */ d("a", {
1060
1088
  ref: o,
1061
1089
  href: n || "#",
@@ -1068,7 +1096,7 @@ function Xe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRe
1068
1096
  children: Re(t, e, a)
1069
1097
  });
1070
1098
  }
1071
- function Ze({ src: e, alt: t, style: n, nodeRef: r }) {
1099
+ function et({ src: e, alt: t, style: n, nodeRef: r }) {
1072
1100
  return e ? /* @__PURE__ */ d("img", {
1073
1101
  ref: r,
1074
1102
  src: e,
@@ -1080,7 +1108,7 @@ function Ze({ src: e, alt: t, style: n, nodeRef: r }) {
1080
1108
  }
1081
1109
  }) : null;
1082
1110
  }
1083
- function Qe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
1111
+ function tt({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
1084
1112
  return e ? /* @__PURE__ */ d("video", {
1085
1113
  ref: s,
1086
1114
  src: e,
@@ -1098,9 +1126,9 @@ function Qe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
1098
1126
  }
1099
1127
  }) : null;
1100
1128
  }
1101
- var $e = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
1102
- function et({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
1103
- let c = $e(e);
1129
+ var nt = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
1130
+ function rt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
1131
+ let c = nt(e);
1104
1132
  if (!c) return null;
1105
1133
  let l = new URLSearchParams({ rel: "0" });
1106
1134
  return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ d("div", {
@@ -1126,7 +1154,7 @@ function et({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
1126
1154
  })
1127
1155
  });
1128
1156
  }
1129
- function tt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
1157
+ function it({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
1130
1158
  return e ? /* @__PURE__ */ d("iframe", {
1131
1159
  ref: i,
1132
1160
  src: e,
@@ -1142,7 +1170,7 @@ function tt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
1142
1170
  }
1143
1171
  }) : null;
1144
1172
  }
1145
- function nt({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1173
+ function at({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1146
1174
  let [i, o] = l(null);
1147
1175
  return a(() => {
1148
1176
  i && (i.innerHTML = e || "", t && i.querySelectorAll("script").forEach((e) => {
@@ -1161,7 +1189,7 @@ function nt({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
1161
1189
  style: P(n)
1162
1190
  });
1163
1191
  }
1164
- function rt({ height: e, nodeRef: t }) {
1192
+ function ot({ height: e, nodeRef: t }) {
1165
1193
  return /* @__PURE__ */ d("div", {
1166
1194
  ref: t,
1167
1195
  style: {
@@ -1171,7 +1199,7 @@ function rt({ height: e, nodeRef: t }) {
1171
1199
  }
1172
1200
  });
1173
1201
  }
1174
- function it({ style: e, nodeRef: t }) {
1202
+ function st({ style: e, nodeRef: t }) {
1175
1203
  return /* @__PURE__ */ d("div", {
1176
1204
  ref: t,
1177
1205
  style: {
@@ -1182,7 +1210,7 @@ function it({ style: e, nodeRef: t }) {
1182
1210
  }
1183
1211
  });
1184
1212
  }
1185
- var at = {
1213
+ var ct = {
1186
1214
  position: "absolute",
1187
1215
  top: "50%",
1188
1216
  transform: "translateY(-50%)",
@@ -1199,7 +1227,7 @@ var at = {
1199
1227
  alignItems: "center",
1200
1228
  justifyContent: "center",
1201
1229
  padding: 0
1202
- }, ot = {
1230
+ }, lt = {
1203
1231
  bottom: {
1204
1232
  inset: "auto 0 0 0",
1205
1233
  padding: "40px 24px 20px",
@@ -1218,8 +1246,8 @@ var at = {
1218
1246
  padding: 24,
1219
1247
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1220
1248
  }
1221
- }, st = 48;
1222
- function ct({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
1249
+ }, ut = 48;
1250
+ function dt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
1223
1251
  let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
1224
1252
  if (a(() => {
1225
1253
  if (!n || h || _ || e < 2) return;
@@ -1235,7 +1263,7 @@ function ct({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1235
1263
  let b = (t) => m((t + e) % e), x = () => {
1236
1264
  if (!_) return;
1237
1265
  let { dx: e } = _;
1238
- v(null), e < -48 ? b(y + 1) : e > st && b(y - 1);
1266
+ v(null), e < -48 ? b(y + 1) : e > ut && b(y - 1);
1239
1267
  };
1240
1268
  return /* @__PURE__ */ f("div", {
1241
1269
  ref: c,
@@ -1283,7 +1311,7 @@ function ct({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1283
1311
  type: "button",
1284
1312
  "aria-label": "Previous slide",
1285
1313
  style: {
1286
- ...at,
1314
+ ...ct,
1287
1315
  left: 12
1288
1316
  },
1289
1317
  onClick: () => b(y - 1),
@@ -1293,7 +1321,7 @@ function ct({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1293
1321
  type: "button",
1294
1322
  "aria-label": "Next slide",
1295
1323
  style: {
1296
- ...at,
1324
+ ...ct,
1297
1325
  right: 12
1298
1326
  },
1299
1327
  onClick: () => b(y + 1),
@@ -1327,7 +1355,7 @@ function ct({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1327
1355
  ] })]
1328
1356
  });
1329
1357
  }
1330
- var lt = (e, t) => ({
1358
+ var ft = (e, t) => ({
1331
1359
  position: "absolute",
1332
1360
  inset: 0,
1333
1361
  backgroundImage: e ? `url(${e})` : "none",
@@ -1335,18 +1363,18 @@ var lt = (e, t) => ({
1335
1363
  backgroundSize: "cover",
1336
1364
  backgroundPosition: "center"
1337
1365
  });
1338
- function ut({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1339
- return e.length ? /* @__PURE__ */ d(ct, {
1366
+ function pt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1367
+ return e.length ? /* @__PURE__ */ d(dt, {
1340
1368
  ...r,
1341
1369
  count: e.length,
1342
1370
  renderSlide: (r) => {
1343
1371
  let i = e[r];
1344
- return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: lt(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
1372
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: ft(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
1345
1373
  style: {
1346
1374
  position: "absolute",
1347
1375
  color: "#fff",
1348
1376
  textAlign: n,
1349
- ...ot[t] ?? ot.bottom
1377
+ ...lt[t] ?? lt.bottom
1350
1378
  },
1351
1379
  children: [i.title && /* @__PURE__ */ d("div", {
1352
1380
  style: {
@@ -1366,13 +1394,13 @@ function ut({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1366
1394
  }
1367
1395
  }) : null;
1368
1396
  }
1369
- function dt({ slides: e = [], linked: t, ...n }) {
1370
- return e.length ? /* @__PURE__ */ d(ct, {
1397
+ function mt({ slides: e = [], linked: t, ...n }) {
1398
+ return e.length ? /* @__PURE__ */ d(dt, {
1371
1399
  ...n,
1372
1400
  count: e.length,
1373
1401
  renderSlide: (n) => {
1374
1402
  let r = e[n];
1375
- return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: lt(r.image, r.color) }), /* @__PURE__ */ d("div", {
1403
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: ft(r.image, r.color) }), /* @__PURE__ */ d("div", {
1376
1404
  style: {
1377
1405
  position: "absolute",
1378
1406
  inset: 0,
@@ -1384,23 +1412,23 @@ function dt({ slides: e = [], linked: t, ...n }) {
1384
1412
  }
1385
1413
  }) : null;
1386
1414
  }
1387
- var Q = 256, ft = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), pt = (e, t, n) => {
1388
- let r = Q * 2 ** n;
1415
+ var ht = 256, gt = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), _t = (e, t, n) => {
1416
+ let r = ht * 2 ** n;
1389
1417
  return {
1390
1418
  x: (Number(t) + 180) / 360 * r,
1391
- y: (.5 - ft(Number(e)) / (2 * Math.PI)) * r
1419
+ y: (.5 - gt(Number(e)) / (2 * Math.PI)) * r
1392
1420
  };
1393
1421
  }, $ = (e, t) => {
1394
1422
  if (e === "" || e == null) return null;
1395
1423
  let n = Number(e);
1396
1424
  return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
1397
- }, mt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
1398
- function ht(e, t, n = "directions", r = "") {
1425
+ }, vt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
1426
+ function yt(e, t, n = "directions", r = "") {
1399
1427
  let i = `${e},${t}`;
1400
1428
  return n === "place" ? `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r ? "&query_place_id=" : ""}` : `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`;
1401
1429
  }
1402
- var gt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
1403
- function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize: o = 22, pinLink: s = "directions", link: u = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
1430
+ var bt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
1431
+ function xt({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize: o = 22, pinLink: s = "directions", link: u = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
1404
1432
  let _ = c(null), [v, y] = l(1200);
1405
1433
  a(() => {
1406
1434
  let e = _.current;
@@ -1410,7 +1438,7 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1410
1438
  let n = new ResizeObserver(t);
1411
1439
  return n.observe(e), () => n.disconnect();
1412
1440
  }, []);
1413
- let b = (Array.isArray(e) ? e : []).filter(mt), x = mt({
1441
+ let b = (Array.isArray(e) ? e : []).filter(vt), x = vt({
1414
1442
  lat: t,
1415
1443
  lng: n
1416
1444
  }) ? {
@@ -1422,7 +1450,7 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1422
1450
  } : null, S = Math.max(80, Number(i) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
1423
1451
  if (b.length < 2) return 13;
1424
1452
  for (let e = 19; e >= 1; e--) {
1425
- let t = b.map((t) => pt($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
1453
+ let t = b.map((t) => _t($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
1426
1454
  if (n <= v * .8 && r <= S * .7) return e;
1427
1455
  }
1428
1456
  return 1;
@@ -1446,12 +1474,12 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1446
1474
  },
1447
1475
  children: "Set the coordinates in Settings"
1448
1476
  });
1449
- let T = pt(x.lat, x.lng, C), E = {
1477
+ let T = _t(x.lat, x.lng, C), E = {
1450
1478
  x: T.x - v / 2,
1451
1479
  y: T.y - S / 2
1452
1480
  }, D = [], O = [];
1453
- for (let e = Math.floor(E.x / Q); e <= Math.floor((E.x + v) / Q); e++) D.push(e);
1454
- for (let e = Math.floor(E.y / Q); e <= Math.floor((E.y + S) / Q); e++) O.push(e);
1481
+ for (let e = Math.floor(E.x / ht); e <= Math.floor((E.x + v) / ht); e++) D.push(e);
1482
+ for (let e = Math.floor(E.y / ht); e <= Math.floor((E.y + S) / ht); e++) O.push(e);
1455
1483
  let k = 2 ** C;
1456
1484
  return /* @__PURE__ */ f("div", {
1457
1485
  ref: (e) => {
@@ -1474,22 +1502,22 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1474
1502
  return e < 0 || e >= k ? null : /* @__PURE__ */ d("img", {
1475
1503
  src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
1476
1504
  alt: "",
1477
- width: Q,
1478
- height: Q,
1505
+ width: ht,
1506
+ height: ht,
1479
1507
  loading: "lazy",
1480
1508
  style: {
1481
1509
  position: "absolute",
1482
- left: Math.round(t * Q - E.x),
1483
- top: Math.round(e * Q - E.y),
1484
- width: Q,
1485
- height: Q,
1510
+ left: Math.round(t * ht - E.x),
1511
+ top: Math.round(e * ht - E.y),
1512
+ width: ht,
1513
+ height: ht,
1486
1514
  userSelect: "none",
1487
1515
  pointerEvents: "none"
1488
1516
  }
1489
1517
  }, `${t}-${e}`);
1490
1518
  })),
1491
1519
  b.map((e, t) => {
1492
- let n = pt($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", c = s === "none" || g ? null : ht($(e.lat, 90), $(e.lng, 180), s, e.title);
1520
+ let n = _t($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", c = s === "none" || g ? null : yt($(e.lat, 90), $(e.lng, 180), s, e.title);
1493
1521
  return /* @__PURE__ */ f(c ? "a" : "span", {
1494
1522
  href: c || void 0,
1495
1523
  target: c ? "_blank" : void 0,
@@ -1528,8 +1556,8 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1528
1556
  viewBox: "0 0 24 24",
1529
1557
  fill: a,
1530
1558
  style: { display: "block" },
1531
- children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), vt[e.icon] ? /* @__PURE__ */ d("path", {
1532
- d: vt[e.icon],
1559
+ children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), St[e.icon] ? /* @__PURE__ */ d("path", {
1560
+ d: St[e.icon],
1533
1561
  transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
1534
1562
  fill: "none",
1535
1563
  stroke: "#fff",
@@ -1565,7 +1593,7 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1565
1593
  })
1566
1594
  ]
1567
1595
  }), u ? /* @__PURE__ */ d("a", {
1568
- href: gt(x.lat, x.lng, C),
1596
+ href: bt(x.lat, x.lng, C),
1569
1597
  target: "_blank",
1570
1598
  rel: "noopener noreferrer",
1571
1599
  onClick: g ? (e) => e.preventDefault() : void 0,
@@ -1579,7 +1607,7 @@ function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
1579
1607
  }) : null]
1580
1608
  });
1581
1609
  }
1582
- var vt = {
1610
+ var St = {
1583
1611
  check: "M4 12l5 5L20 6",
1584
1612
  close: "M6 6l12 12M18 6L6 18",
1585
1613
  plus: "M12 5v14M5 12h14",
@@ -1676,8 +1704,8 @@ var vt = {
1676
1704
  droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
1677
1705
  leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
1678
1706
  };
1679
- function yt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: u, inert: f }) {
1680
- let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [vt[e] ?? vt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ d("svg", {
1707
+ function Ct({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: u, inert: f }) {
1708
+ let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [St[e] ?? St.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ d("svg", {
1681
1709
  viewBox: "0 0 24 24",
1682
1710
  width: g,
1683
1711
  height: g,
@@ -1713,10 +1741,10 @@ function yt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
1713
1741
  children: v
1714
1742
  });
1715
1743
  }
1716
- function bt(e, t = {}, n = 0) {
1717
- let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Y(e), a = Math.max(0, Number(n) || 0), o = [];
1744
+ function wt(e, t = {}, n = 0) {
1745
+ let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : we(e), a = Math.max(0, Number(n) || 0), o = [];
1718
1746
  for (let e of r) {
1719
- let n = e.data ?? e, r = Te(n, t.imageField), s = (Array.isArray(r) ? r : [r]).map((e) => e && typeof e == "object" ? e.url ?? e.src ?? "" : e).filter((e) => typeof e == "string" && e.trim()), c = t.nameField ? i(Te(n, t.nameField)) : i(n.name), l = t.hrefField ? i(Te(n, t.hrefField)) : "";
1747
+ let n = e.data ?? e, r = X(n, t.imageField), s = (Array.isArray(r) ? r : [r]).map((e) => e && typeof e == "object" ? e.url ?? e.src ?? "" : e).filter((e) => typeof e == "string" && e.trim()), c = t.nameField ? i(X(n, t.nameField)) : i(n.name), l = t.hrefField ? i(X(n, t.hrefField)) : "";
1720
1748
  for (let e of s) if (o.push({
1721
1749
  src: e,
1722
1750
  name: c,
@@ -1726,8 +1754,8 @@ function bt(e, t = {}, n = 0) {
1726
1754
  }
1727
1755
  return o;
1728
1756
  }
1729
- function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "", nameField: o = "", hrefField: s = "", limit: c = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
1730
- let { tenant: x, apiUrl: S } = i(q), C = i(ye)?.[t], [w, T] = l(null), [E, D] = l(() => /* @__PURE__ */ new Set());
1757
+ function Tt({ images: e = [], source: t = "", entry: n = "", imageField: r = "", nameField: o = "", hrefField: s = "", limit: c = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
1758
+ let { tenant: x, apiUrl: S } = i(J), C = i(ye)?.[t], [w, T] = l(null), [E, D] = l(() => /* @__PURE__ */ new Set());
1731
1759
  a(() => {
1732
1760
  if (!t || C) return;
1733
1761
  let e = !0;
@@ -1744,7 +1772,7 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
1744
1772
  C
1745
1773
  ]);
1746
1774
  let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, A = Math.max(0, Number(c) || 0), j = t ? (() => {
1747
- let e = bt(k, {
1775
+ let e = wt(k, {
1748
1776
  imageField: r,
1749
1777
  nameField: o,
1750
1778
  hrefField: s
@@ -1758,7 +1786,7 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
1758
1786
  };
1759
1787
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
1760
1788
  }, [B, N.length]);
1761
- let V = (e) => {
1789
+ let ee = (e) => {
1762
1790
  if (typeof e.name == "string" && e.name.trim()) return e.name;
1763
1791
  if (typeof e.alt == "string" && e.alt.trim()) return e.alt;
1764
1792
  try {
@@ -1794,7 +1822,7 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
1794
1822
  display: "block",
1795
1823
  borderRadius: "inherit"
1796
1824
  }
1797
- }), g && V(e) && /* @__PURE__ */ d("span", {
1825
+ }), g && ee(e) && /* @__PURE__ */ d("span", {
1798
1826
  style: {
1799
1827
  position: "absolute",
1800
1828
  insetInline: 0,
@@ -1808,7 +1836,7 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
1808
1836
  overflow: "hidden",
1809
1837
  textOverflow: "ellipsis"
1810
1838
  },
1811
- children: V(e)
1839
+ children: ee(e)
1812
1840
  })]
1813
1841
  }), i = e.href ? /* @__PURE__ */ d("a", {
1814
1842
  href: e.href,
@@ -1879,14 +1907,14 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
1879
1907
  boxShadow: "0 12px 48px rgba(0,0,0,0.5)"
1880
1908
  }
1881
1909
  }),
1882
- V(N[R]) && /* @__PURE__ */ d("div", {
1910
+ ee(N[R]) && /* @__PURE__ */ d("div", {
1883
1911
  style: {
1884
1912
  color: "#fff",
1885
1913
  fontSize: 14,
1886
1914
  marginTop: 12,
1887
1915
  opacity: .85
1888
1916
  },
1889
- children: V(N[R])
1917
+ children: ee(N[R])
1890
1918
  }),
1891
1919
  /* @__PURE__ */ d("button", {
1892
1920
  type: "button",
@@ -1949,20 +1977,20 @@ function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
1949
1977
  ]
1950
1978
  });
1951
1979
  }
1952
- var St = {
1980
+ var Et = {
1953
1981
  color: "inherit",
1954
1982
  textDecoration: "none",
1955
1983
  fontSize: 14,
1956
1984
  opacity: .85
1957
- }, Ct = {
1985
+ }, Dt = {
1958
1986
  background: "var(--page-surface, #f2f2f2)",
1959
1987
  color: "var(--page-text, #111827)",
1960
1988
  border: "1px solid rgba(148, 163, 184, 0.25)",
1961
1989
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1962
1990
  zIndex: 60
1963
1991
  };
1964
- function wt(e, t = {}, n = "dropdown") {
1965
- 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) => {
1992
+ function Ot(e, t = {}, n = "dropdown") {
1993
+ 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 ? "" : we(e), o = r.map((e) => {
1966
1994
  let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
1967
1995
  return {
1968
1996
  key: e.id,
@@ -2003,8 +2031,8 @@ function wt(e, t = {}, n = "dropdown") {
2003
2031
  type: e.children.length ? n : "link"
2004
2032
  }));
2005
2033
  }
2006
- function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], style: c, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
2007
- let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(q), N = i(ye)?.[g], [F, I] = l(null);
2034
+ function kt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], style: c, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
2035
+ let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(J), N = i(ye)?.[g], [F, I] = l(null);
2008
2036
  a(() => {
2009
2037
  if (!g || N) return;
2010
2038
  let e = !0;
@@ -2024,7 +2052,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2024
2052
  let e = new ResizeObserver(() => E(C.offsetWidth < h));
2025
2053
  return e.observe(C), () => e.disconnect();
2026
2054
  }, [C, h]);
2027
- let L = g ? wt(N ?? F ?? [], {
2055
+ let L = g ? Ot(N ?? F ?? [], {
2028
2056
  labelField: _,
2029
2057
  hrefField: v,
2030
2058
  imageField: y,
@@ -2053,7 +2081,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2053
2081
  return /* @__PURE__ */ f("a", {
2054
2082
  href: e.href || "#",
2055
2083
  style: {
2056
- ...St,
2084
+ ...Et,
2057
2085
  display: n ? "block" : "flex",
2058
2086
  alignItems: n ? void 0 : "center",
2059
2087
  gap: n ? void 0 : 10,
@@ -2150,7 +2178,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2150
2178
  let t = e.children ?? [];
2151
2179
  if (!t.length) return /* @__PURE__ */ d("a", {
2152
2180
  href: e.href || "#",
2153
- style: St,
2181
+ style: Et,
2154
2182
  children: e.label
2155
2183
  }, e.key);
2156
2184
  let n = e.type === "mega";
@@ -2164,7 +2192,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2164
2192
  children: [/* @__PURE__ */ f("a", {
2165
2193
  href: e.href || "#",
2166
2194
  style: {
2167
- ...St,
2195
+ ...Et,
2168
2196
  cursor: "pointer"
2169
2197
  },
2170
2198
  children: [
@@ -2180,7 +2208,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2180
2208
  ]
2181
2209
  }), k === e.key && (n ? /* @__PURE__ */ d("div", {
2182
2210
  style: {
2183
- ...Ct,
2211
+ ...Dt,
2184
2212
  position: "absolute",
2185
2213
  left: 0,
2186
2214
  right: 0,
@@ -2196,7 +2224,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2196
2224
  }, !0))
2197
2225
  }) : /* @__PURE__ */ d("div", {
2198
2226
  style: {
2199
- ...Ct,
2227
+ ...Dt,
2200
2228
  position: "absolute",
2201
2229
  top: "100%",
2202
2230
  left: 0,
@@ -2225,7 +2253,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2225
2253
  children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
2226
2254
  href: e.href || "#",
2227
2255
  style: {
2228
- ...St,
2256
+ ...Et,
2229
2257
  padding: "10px 4px",
2230
2258
  fontWeight: (e.children ?? []).length ? 600 : 400,
2231
2259
  opacity: 1
@@ -2236,7 +2264,7 @@ function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
2236
2264
  ]
2237
2265
  });
2238
2266
  }
2239
- function Et({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2267
+ function At({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2240
2268
  let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
2241
2269
  return e.length ? /* @__PURE__ */ f("div", {
2242
2270
  ref: r,
@@ -2276,13 +2304,13 @@ function Et({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2276
2304
  }, e.key))]
2277
2305
  }) : null;
2278
2306
  }
2279
- function Dt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: c, openColor: u, borderColor: p, style: m, nodeRef: h }) {
2307
+ function jt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: c, openColor: u, borderColor: p, style: m, nodeRef: h }) {
2280
2308
  let [g, _] = l(() => new Set(e.length ? [e[0].key] : []));
2281
2309
  if (!e.length) return null;
2282
2310
  let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
2283
2311
  let n = Number(e);
2284
2312
  return e === "" || e == null || !Number.isFinite(n) ? t : n;
2285
- }, b = vt[r], x = (e) => _((t) => {
2313
+ }, b = St[r], x = (e) => _((t) => {
2286
2314
  let r = new Set(n ? t : []);
2287
2315
  return t.has(e) ? r.delete(e) : r.add(e), r;
2288
2316
  });
@@ -2357,15 +2385,15 @@ function Dt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
2357
2385
  })
2358
2386
  });
2359
2387
  }
2360
- var Ot = {
2388
+ var Mt = {
2361
2389
  display: "flex",
2362
2390
  flexDirection: "column",
2363
2391
  gap: "12px"
2364
- }, kt = {
2392
+ }, Nt = {
2365
2393
  fontSize: "14px",
2366
2394
  fontWeight: 500,
2367
2395
  color: "var(--page-text, #111827)"
2368
- }, At = {
2396
+ }, Pt = {
2369
2397
  padding: "10px 12px",
2370
2398
  border: "1px solid var(--page-border, #d1d5db)",
2371
2399
  borderRadius: "6px",
@@ -2375,18 +2403,18 @@ var Ot = {
2375
2403
  boxSizing: "border-box",
2376
2404
  backgroundColor: "var(--page-surface, #f2f2f2)",
2377
2405
  color: "var(--page-text, #111827)"
2378
- }, jt = {
2406
+ }, Ft = {
2379
2407
  display: "flex",
2380
2408
  alignItems: "center",
2381
2409
  gap: "8px",
2382
2410
  fontSize: "14px",
2383
2411
  color: "var(--page-text, #111827)"
2384
- }, Mt = (e) => e ? {
2412
+ }, It = (e) => e ? {
2385
2413
  readOnly: !0,
2386
2414
  tabIndex: -1,
2387
2415
  onMouseDown: (e) => e.preventDefault()
2388
2416
  } : {};
2389
- function Nt(e, t) {
2417
+ function Lt(e, t) {
2390
2418
  if (!e) return !0;
2391
2419
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
2392
2420
  switch (e.op) {
@@ -2400,11 +2428,11 @@ function Nt(e, t) {
2400
2428
  default: return !1;
2401
2429
  }
2402
2430
  }
2403
- var Pt = {
2431
+ var Rt = {
2404
2432
  display: "flex",
2405
2433
  flexDirection: "column",
2406
2434
  gap: 6
2407
- }, Ft = {
2435
+ }, zt = {
2408
2436
  font: "inherit",
2409
2437
  fontSize: 15,
2410
2438
  padding: "10px 12px",
@@ -2415,17 +2443,17 @@ var Pt = {
2415
2443
  width: "100%",
2416
2444
  boxSizing: "border-box"
2417
2445
  };
2418
- function It(e, t) {
2446
+ function Bt(e, t) {
2419
2447
  let n = Array.isArray(e?.options) ? e.options : [];
2420
2448
  if (!e?.parentField) return n;
2421
2449
  let r = t?.[e.parentField];
2422
2450
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
2423
2451
  }
2424
- var Lt = "g-recaptcha-response", Rt = (e) => e?.type === "recaptcha" ? Lt : e?.name;
2425
- function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2452
+ var Vt = "g-recaptcha-response", Ht = (e) => e?.type === "recaptcha" ? Vt : e?.name;
2453
+ function Ut({ field: e, value: t, onChange: n, inert: r, values: i }) {
2426
2454
  let a = /* @__PURE__ */ f("span", {
2427
2455
  style: {
2428
- ...kt,
2456
+ ...Nt,
2429
2457
  fontSize: 14
2430
2458
  },
2431
2459
  children: [e.label, e.required ? " *" : ""]
@@ -2434,7 +2462,7 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2434
2462
  required: e.required || void 0,
2435
2463
  placeholder: e.placeholder || void 0,
2436
2464
  disabled: r || void 0,
2437
- style: Ft,
2465
+ style: zt,
2438
2466
  value: t ?? "",
2439
2467
  onChange: (t) => n(e.name, t.target.value)
2440
2468
  };
@@ -2463,12 +2491,12 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2463
2491
  borderRadius: 8,
2464
2492
  display: "block"
2465
2493
  }
2466
- }) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(Wt, {
2494
+ }) : null : e.type === "recaptcha" ? /* @__PURE__ */ d(Jt, {
2467
2495
  theme: e.captchaTheme,
2468
2496
  size: e.captchaSize,
2469
2497
  inert: r,
2470
- onChange: (e) => n(Lt, e)
2471
- }) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(et, {
2498
+ onChange: (e) => n(Vt, e)
2499
+ }) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(rt, {
2472
2500
  url: e.src,
2473
2501
  style: { width: "100%" }
2474
2502
  }) : /* @__PURE__ */ d("video", {
@@ -2480,14 +2508,14 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2480
2508
  display: "block"
2481
2509
  }
2482
2510
  }) : null : /* @__PURE__ */ f("label", {
2483
- style: Pt,
2511
+ style: Rt,
2484
2512
  children: [
2485
2513
  a,
2486
2514
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
2487
2515
  ...o,
2488
2516
  rows: 4,
2489
2517
  style: {
2490
- ...Ft,
2518
+ ...zt,
2491
2519
  resize: "vertical"
2492
2520
  }
2493
2521
  }) : e.type === "select" ? /* @__PURE__ */ f("select", {
@@ -2496,7 +2524,7 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2496
2524
  children: [/* @__PURE__ */ d("option", {
2497
2525
  value: "",
2498
2526
  children: e.placeholder || "—"
2499
- }), It(e, i).map((e, t) => /* @__PURE__ */ d("option", {
2527
+ }), Bt(e, i).map((e, t) => /* @__PURE__ */ d("option", {
2500
2528
  value: typeof e == "string" ? e : e.value,
2501
2529
  children: typeof e == "string" ? e : e.label ?? e.value
2502
2530
  }, t))]
@@ -2543,8 +2571,8 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2543
2571
  ]
2544
2572
  });
2545
2573
  }
2546
- function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
2547
- let { tenant: y, apiUrl: b } = i(q), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [D, O] = l(0), k = h ? v || "form" : x;
2574
+ function Wt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
2575
+ let { tenant: y, apiUrl: b } = i(J), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [D, O] = l(0), k = h ? v || "form" : x;
2548
2576
  a(() => {
2549
2577
  if (!c || !s) return;
2550
2578
  let e = !0;
@@ -2565,11 +2593,11 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
2565
2593
  section: e,
2566
2594
  fields: []
2567
2595
  }) : A[A.length - 1].fields.push(e);
2568
- let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Nt(e.section.condition, T)).map((e) => ({
2596
+ let j = A.filter((e) => e.section || e.fields.length), M = j.filter((e) => !e.section || Lt(e.section.condition, T)).map((e) => ({
2569
2597
  ...e,
2570
- fields: e.fields.filter((e) => Nt(e.condition, T))
2598
+ fields: e.fields.filter((e) => Lt(e.condition, T))
2571
2599
  })), N = j.length > 1, F = Math.min(D, Math.max(0, M.length - 1)), I = N ? M[F]?.fields ?? [] : M.flatMap((e) => e.fields), L = I.filter((e) => {
2572
- let t = T[Rt(e)];
2600
+ let t = T[Ht(e)];
2573
2601
  return e.required && (t == null || t === "" || t === !1);
2574
2602
  }), R = F >= M.length - 1, z = (e, t) => E((n) => {
2575
2603
  let r = {
@@ -2625,11 +2653,11 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
2625
2653
  }
2626
2654
  },
2627
2655
  style: {
2628
- ...Ot,
2656
+ ...Mt,
2629
2657
  display: k === "success" ? "none" : "flex"
2630
2658
  },
2631
2659
  children: c && s ? /* @__PURE__ */ f(u, { children: [
2632
- N && /* @__PURE__ */ d(hn, {
2660
+ N && /* @__PURE__ */ d(yn, {
2633
2661
  steps: M.map((e) => ({ label: e.section?.label ?? "Start" })),
2634
2662
  active: F + 1,
2635
2663
  style: { marginBottom: 8 }
@@ -2642,9 +2670,9 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
2642
2670
  },
2643
2671
  children: M[F].section.help
2644
2672
  }),
2645
- I.map((e) => /* @__PURE__ */ d(zt, {
2673
+ I.map((e) => /* @__PURE__ */ d(Ut, {
2646
2674
  field: e,
2647
- value: T[Rt(e)],
2675
+ value: T[Ht(e)],
2648
2676
  values: T,
2649
2677
  onChange: z,
2650
2678
  inert: h
@@ -2715,10 +2743,10 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
2715
2743
  ]
2716
2744
  });
2717
2745
  }
2718
- var Vt = null, Ht = null, Ut = (e) => {
2746
+ var Gt = null, Kt = null, qt = (e) => {
2719
2747
  let t = typeof e == "string" && e.trim() ? e.trim() : "";
2720
- if (Vt && Ht === t) return Vt;
2721
- if (Vt && typeof window < "u") {
2748
+ if (Gt && Kt === t) return Gt;
2749
+ if (Gt && typeof window < "u") {
2722
2750
  for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
2723
2751
  delete window[e];
2724
2752
  } catch {
@@ -2726,22 +2754,22 @@ var Vt = null, Ht = null, Ut = (e) => {
2726
2754
  }
2727
2755
  document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
2728
2756
  }
2729
- return Ht = t, Vt = new Promise((e) => {
2757
+ return Kt = t, Gt = new Promise((e) => {
2730
2758
  if (typeof window > "u") return;
2731
2759
  if (window.grecaptcha?.render) return e(window.grecaptcha);
2732
2760
  window.__webimRecaptchaReady = () => e(window.grecaptcha);
2733
2761
  let n = document.createElement("script");
2734
2762
  n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
2735
- }), Vt;
2763
+ }), Gt;
2736
2764
  };
2737
- function Wt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
2738
- let p = i(q), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = c(null), _ = c(u);
2765
+ function Jt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
2766
+ let p = i(J), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = c(null), _ = c(u);
2739
2767
  if (_.current = u, a(() => {
2740
2768
  if (l || !h || !g.current) return;
2741
2769
  let e = !0, i = (t) => {
2742
2770
  e && typeof _.current == "function" && _.current(t);
2743
2771
  };
2744
- return Ut(r).then((r) => {
2772
+ return qt(r).then((r) => {
2745
2773
  if (!(!e || !g.current || !r?.render)) {
2746
2774
  g.current.innerHTML = "", i("");
2747
2775
  try {
@@ -2823,17 +2851,17 @@ function Wt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert:
2823
2851
  children: /* @__PURE__ */ d("div", { ref: g })
2824
2852
  }) : null;
2825
2853
  }
2826
- function Gt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2854
+ function Yt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2827
2855
  return /* @__PURE__ */ d("label", {
2828
2856
  ref: r,
2829
2857
  style: {
2830
- ...kt,
2858
+ ...Nt,
2831
2859
  ...P(n)
2832
2860
  },
2833
2861
  children: Re(t, e, i)
2834
2862
  });
2835
2863
  }
2836
- function Kt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2864
+ function Xt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2837
2865
  return /* @__PURE__ */ d("input", {
2838
2866
  ref: a,
2839
2867
  type: e,
@@ -2841,13 +2869,13 @@ function Kt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
2841
2869
  placeholder: n,
2842
2870
  required: !o && !!r,
2843
2871
  style: {
2844
- ...At,
2872
+ ...Pt,
2845
2873
  ...P(i)
2846
2874
  },
2847
- ...Mt(o)
2875
+ ...It(o)
2848
2876
  });
2849
2877
  }
2850
- function qt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2878
+ function Zt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2851
2879
  return /* @__PURE__ */ d("textarea", {
2852
2880
  ref: a,
2853
2881
  name: e || void 0,
@@ -2855,18 +2883,18 @@ function qt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
2855
2883
  rows: n,
2856
2884
  required: !o && !!r,
2857
2885
  style: {
2858
- ...At,
2886
+ ...Pt,
2859
2887
  resize: "vertical",
2860
2888
  ...P(i)
2861
2889
  },
2862
- ...Mt(o)
2890
+ ...It(o)
2863
2891
  });
2864
2892
  }
2865
- function Jt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2893
+ function Qt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2866
2894
  return /* @__PURE__ */ f("label", {
2867
2895
  ref: o,
2868
2896
  style: {
2869
- ...jt,
2897
+ ...Ft,
2870
2898
  ...P(a)
2871
2899
  },
2872
2900
  children: [/* @__PURE__ */ d("input", {
@@ -2883,7 +2911,7 @@ function Jt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
2883
2911
  }), t]
2884
2912
  });
2885
2913
  }
2886
- function Yt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2914
+ function $t({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2887
2915
  return /* @__PURE__ */ f("select", {
2888
2916
  ref: a,
2889
2917
  name: e || void 0,
@@ -2892,7 +2920,7 @@ function Yt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2892
2920
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
2893
2921
  tabIndex: o ? -1 : void 0,
2894
2922
  style: {
2895
- ...At,
2923
+ ...Pt,
2896
2924
  appearance: "auto",
2897
2925
  ...P(i)
2898
2926
  },
@@ -2906,12 +2934,12 @@ function Yt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2906
2934
  }, t))]
2907
2935
  });
2908
2936
  }
2909
- function Xt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2937
+ function en({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2910
2938
  let [s, c] = l(null);
2911
2939
  return /* @__PURE__ */ f("label", {
2912
2940
  ref: a,
2913
2941
  style: {
2914
- ...At,
2942
+ ...Pt,
2915
2943
  display: "flex",
2916
2944
  alignItems: "center",
2917
2945
  gap: "8px",
@@ -2938,7 +2966,7 @@ function Xt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
2938
2966
  ]
2939
2967
  });
2940
2968
  }
2941
- function Zt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2969
+ function tn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2942
2970
  return /* @__PURE__ */ d("button", {
2943
2971
  ref: n,
2944
2972
  type: r ? "button" : "submit",
@@ -2958,7 +2986,7 @@ function Zt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
2958
2986
  children: e
2959
2987
  });
2960
2988
  }
2961
- function Qt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2989
+ function nn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2962
2990
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
2963
2991
  return /* @__PURE__ */ d("div", {
2964
2992
  ref: r,
@@ -2975,8 +3003,8 @@ function Qt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
2975
3003
  }, t))
2976
3004
  });
2977
3005
  }
2978
- function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
2979
- let { tenant: v, apiUrl: y, locale: b } = i(q), x = i(Ce), S = i(ye), [, C] = l(0);
3006
+ function rn({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
3007
+ let { tenant: v, apiUrl: y, locale: b } = i(J), x = i(Ce), S = i(ye), [, C] = l(0);
2980
3008
  a(() => {
2981
3009
  if (typeof window > "u") return;
2982
3010
  let e = () => C((e) => e + 1);
@@ -3029,7 +3057,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
3029
3057
  },
3030
3058
  children: M.map((e) => /* @__PURE__ */ d("div", {
3031
3059
  style: { minWidth: 0 },
3032
- children: x.render(p, (t) => X(t, e))
3060
+ children: x.render(p, (t) => Q(t, e))
3033
3061
  }, e.id ?? e?.data?.slug))
3034
3062
  }) : /* @__PURE__ */ d("div", {
3035
3063
  ref: _,
@@ -3039,7 +3067,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
3039
3067
  ...P(g)
3040
3068
  },
3041
3069
  children: M.map((e) => {
3042
- let t = o ? Te(e?.data, o) : null, r = s ? Y(Te(e?.data, s)) : null, i = c ? Te(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : Y(i), u = n === "list";
3070
+ let t = o ? X(e?.data, o) : null, r = s ? we(X(e?.data, s)) : null, i = c ? X(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : we(i), u = n === "list";
3043
3071
  return /* @__PURE__ */ f("div", {
3044
3072
  style: {
3045
3073
  display: "flex",
@@ -3086,7 +3114,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
3086
3114
  lineHeight: 1.55,
3087
3115
  opacity: .85
3088
3116
  },
3089
- children: He(a)
3117
+ children: Ge(a)
3090
3118
  })
3091
3119
  ]
3092
3120
  })]
@@ -3094,7 +3122,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
3094
3122
  })
3095
3123
  });
3096
3124
  }
3097
- function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
3125
+ function an({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
3098
3126
  let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : xe(), s = {
3099
3127
  height: 34,
3100
3128
  padding: "0 12px",
@@ -3143,7 +3171,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3143
3171
  name: `f_${e.name}`,
3144
3172
  defaultValue: o[e.name] ?? "",
3145
3173
  style: s,
3146
- ...Mt(i),
3174
+ ...It(i),
3147
3175
  children: [/* @__PURE__ */ d("option", {
3148
3176
  value: "",
3149
3177
  children: e.label || e.name
@@ -3158,7 +3186,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3158
3186
  name: `f_${e.name}`,
3159
3187
  defaultValue: o[e.name] ?? "",
3160
3188
  style: s,
3161
- ...Mt(i),
3189
+ ...It(i),
3162
3190
  children: [
3163
3191
  /* @__PURE__ */ d("option", {
3164
3192
  value: "",
@@ -3179,7 +3207,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3179
3207
  defaultValue: o[e.name] ?? "",
3180
3208
  placeholder: e.label || e.name,
3181
3209
  style: s,
3182
- ...Mt(i)
3210
+ ...It(i)
3183
3211
  }, e.name)), /* @__PURE__ */ d("button", {
3184
3212
  type: "submit",
3185
3213
  style: {
@@ -3192,12 +3220,12 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3192
3220
  fontWeight: 600,
3193
3221
  cursor: i ? "default" : "pointer"
3194
3222
  },
3195
- ...Mt(i),
3223
+ ...It(i),
3196
3224
  children: t
3197
3225
  })]
3198
3226
  });
3199
3227
  }
3200
- function tn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3228
+ function on({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3201
3229
  return e.length ? /* @__PURE__ */ d("nav", {
3202
3230
  ref: r,
3203
3231
  "aria-label": "Breadcrumb",
@@ -3247,8 +3275,8 @@ function tn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3247
3275
  })
3248
3276
  }) : null;
3249
3277
  }
3250
- function nn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, hideEmpty: u, inert: p, style: m, nodeRef: h }) {
3251
- let { tenant: g, apiUrl: _ } = i(q), v = i(ye), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
3278
+ function sn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, hideEmpty: u, inert: p, style: m, nodeRef: h }) {
3279
+ let { tenant: g, apiUrl: _ } = i(J), v = i(ye), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
3252
3280
  a(() => {
3253
3281
  if (!o || Number.isFinite(x)) return;
3254
3282
  let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
@@ -3332,15 +3360,15 @@ function nn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
3332
3360
  ]
3333
3361
  });
3334
3362
  }
3335
- var rn = "webim.page_mode", an = () => {
3363
+ var cn = "webim.page_mode", ln = () => {
3336
3364
  if (typeof window > "u") return "auto";
3337
3365
  try {
3338
- let e = window.localStorage.getItem(rn);
3366
+ let e = window.localStorage.getItem(cn);
3339
3367
  return e === "light" || e === "dark" ? e : "auto";
3340
3368
  } catch {
3341
3369
  return "auto";
3342
3370
  }
3343
- }, on = (e) => {
3371
+ }, un = (e) => {
3344
3372
  let t = {
3345
3373
  width: 16,
3346
3374
  height: 16,
@@ -3372,13 +3400,13 @@ var rn = "webim.page_mode", an = () => {
3372
3400
  rx: "2"
3373
3401
  }), /* @__PURE__ */ d("path", { d: "M8 21h8M12 17v4" })]
3374
3402
  });
3375
- }, sn = {
3403
+ }, dn = {
3376
3404
  light: "Light theme",
3377
3405
  dark: "Dark theme",
3378
3406
  auto: "Follow the device theme"
3379
3407
  };
3380
- function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3381
- let [o, s] = l(i ? "auto" : an), u = c(null), f = (e) => {
3408
+ function fn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3409
+ let [o, s] = l(i ? "auto" : ln), u = c(null), f = (e) => {
3382
3410
  u.current = e, typeof r == "function" && r(e);
3383
3411
  };
3384
3412
  a(() => {
@@ -3386,7 +3414,7 @@ function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3386
3414
  let e = u.current?.closest?.(".webim-page");
3387
3415
  e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
3388
3416
  try {
3389
- o === "auto" ? window.localStorage.removeItem(rn) : window.localStorage.setItem(rn, o);
3417
+ o === "auto" ? window.localStorage.removeItem(cn) : window.localStorage.setItem(cn, o);
3390
3418
  } catch {}
3391
3419
  }, [o, i]);
3392
3420
  let p = t === !1 ? ["light", "dark"] : [
@@ -3421,8 +3449,8 @@ function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3421
3449
  },
3422
3450
  children: p.map((e) => /* @__PURE__ */ d("button", {
3423
3451
  type: "button",
3424
- title: sn[e],
3425
- "aria-label": sn[e],
3452
+ title: dn[e],
3453
+ "aria-label": dn[e],
3426
3454
  "aria-pressed": e === m,
3427
3455
  onClick: i ? void 0 : () => s(e),
3428
3456
  style: {
@@ -3433,15 +3461,15 @@ function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3433
3461
  background: e === m ? "var(--page-accent, #111827)" : "transparent",
3434
3462
  opacity: e === m ? 1 : .7
3435
3463
  },
3436
- children: on(e)
3464
+ children: un(e)
3437
3465
  }, e))
3438
3466
  });
3439
3467
  let g = p[(p.indexOf(m) + 1) % p.length];
3440
3468
  return /* @__PURE__ */ d("button", {
3441
3469
  ref: f,
3442
3470
  type: "button",
3443
- title: sn[m],
3444
- "aria-label": `Theme: ${sn[m]} — switch to ${sn[g]}`,
3471
+ title: dn[m],
3472
+ "aria-label": `Theme: ${dn[m]} — switch to ${dn[g]}`,
3445
3473
  onClick: i ? void 0 : () => s(g),
3446
3474
  style: {
3447
3475
  ...h,
@@ -3450,10 +3478,10 @@ function cn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: i }) {
3450
3478
  border: "1px solid rgba(148, 163, 184, 0.4)",
3451
3479
  ...P(n)
3452
3480
  },
3453
- children: on(m)
3481
+ children: un(m)
3454
3482
  });
3455
3483
  }
3456
- function ln(e) {
3484
+ function pn(e) {
3457
3485
  let t = e?.parentElement;
3458
3486
  for (; t && t !== document.body;) {
3459
3487
  let e = getComputedStyle(t).overflowY;
@@ -3462,7 +3490,7 @@ function ln(e) {
3462
3490
  }
3463
3491
  return window;
3464
3492
  }
3465
- var un = (e) => e === window ? window.scrollY : e.scrollTop, dn = {
3493
+ var mn = (e) => e === window ? window.scrollY : e.scrollTop, hn = {
3466
3494
  "bottom-right": (e) => ({
3467
3495
  right: e,
3468
3496
  bottom: e
@@ -3477,7 +3505,7 @@ var un = (e) => e === window ? window.scrollY : e.scrollTop, dn = {
3477
3505
  transform: "translateX(-50%)"
3478
3506
  })
3479
3507
  };
3480
- function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: o, bg: s, fg: c, style: u, nodeRef: p, inert: m, frame: h, builder: g }) {
3508
+ function gn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth: o, bg: s, fg: c, style: u, nodeRef: p, inert: m, frame: h, builder: g }) {
3481
3509
  let [_, v] = l(!!m), [y, b] = l(null), x = (e) => {
3482
3510
  b(e), typeof p == "function" && p(e);
3483
3511
  };
@@ -3488,8 +3516,8 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
3488
3516
  }
3489
3517
  if (!y) return;
3490
3518
  let e = Number(i) >= 0 ? Number(i) : 300, t = () => {
3491
- let t = ln(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
3492
- v(n || un(t) > e);
3519
+ let t = pn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
3520
+ v(n || mn(t) > e);
3493
3521
  };
3494
3522
  return t(), document.addEventListener("scroll", t, {
3495
3523
  capture: !0,
@@ -3503,7 +3531,7 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
3503
3531
  ]);
3504
3532
  let S = () => {
3505
3533
  if (m) return;
3506
- let e = ln(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
3534
+ let e = pn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
3507
3535
  e === window ? window.scrollTo({
3508
3536
  top: 0,
3509
3537
  behavior: n
@@ -3511,7 +3539,7 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
3511
3539
  top: 0,
3512
3540
  behavior: n
3513
3541
  });
3514
- }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = dn[n] ? n : "bottom-right", D = h ? {
3542
+ }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = hn[n] ? n : "bottom-right", D = h ? {
3515
3543
  position: "fixed",
3516
3544
  zIndex: 5,
3517
3545
  bottom: (h.bottom ?? 0) + C,
@@ -3524,7 +3552,7 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
3524
3552
  } : {
3525
3553
  position: "fixed",
3526
3554
  zIndex: 2147482e3,
3527
- ...dn[E](C)
3555
+ ...hn[E](C)
3528
3556
  };
3529
3557
  return /* @__PURE__ */ f("button", {
3530
3558
  ref: x,
@@ -3575,7 +3603,7 @@ function fn({ variant: e, label: t, position: n, offset: r, showAfter: i, smooth
3575
3603
  }), w ? /* @__PURE__ */ d("span", { children: T }) : null]
3576
3604
  });
3577
3605
  }
3578
- var pn = {
3606
+ var _n = {
3579
3607
  facebook: {
3580
3608
  label: "Facebook",
3581
3609
  color: "#1877f2",
@@ -3642,8 +3670,8 @@ var pn = {
3642
3670
  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"
3643
3671
  }
3644
3672
  };
3645
- function mn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3646
- let l = Array.isArray(e) ? e.filter((e) => e && pn[e.network]) : [];
3673
+ function vn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3674
+ let l = Array.isArray(e) ? e.filter((e) => e && _n[e.network]) : [];
3647
3675
  if (!l.length) return null;
3648
3676
  let u = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(u * 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;
3649
3677
  return /* @__PURE__ */ d("div", {
@@ -3656,7 +3684,7 @@ function mn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
3656
3684
  ...P(o)
3657
3685
  },
3658
3686
  children: l.map((e, r) => {
3659
- let i = pn[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);
3687
+ let i = _n[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);
3660
3688
  return /* @__PURE__ */ d("a", {
3661
3689
  href: e.url || "#",
3662
3690
  onClick: h,
@@ -3690,7 +3718,7 @@ function mn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
3690
3718
  })
3691
3719
  });
3692
3720
  }
3693
- function hn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3721
+ function yn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3694
3722
  if (!e.length) return null;
3695
3723
  let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
3696
3724
  width: 32,
@@ -3768,7 +3796,7 @@ function hn({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
3768
3796
  })
3769
3797
  });
3770
3798
  }
3771
- var gn = {
3799
+ var bn = {
3772
3800
  small: {
3773
3801
  w: 132,
3774
3802
  h: 46,
@@ -3790,74 +3818,123 @@ var gn = {
3790
3818
  title: 12.5,
3791
3819
  avatar: 46
3792
3820
  }
3793
- }, _n = (e) => gn[e] ?? gn.medium;
3794
- gn.medium.w, gn.medium.h;
3795
- function vn(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3796
- let r = _n(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 = [];
3797
- 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);
3798
- let d = /* @__PURE__ */ new Map(), f = (e, t) => {
3821
+ }, xn = (e) => bn[e] ?? bn.medium;
3822
+ bn.medium.w, bn.medium.h;
3823
+ var Sn = (e) => String(e?.group ?? "").trim(), Cn = (e) => {
3824
+ let t = [], n = /* @__PURE__ */ new Map();
3825
+ return e.forEach((e, r) => {
3826
+ let i = Sn(e) || `#${r}`;
3827
+ n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
3828
+ }), t.flatMap((e) => n.get(e));
3829
+ };
3830
+ function wn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
3831
+ let i = xn(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
3832
+ for (let e of c) e.parent && l.has(e.parent) && e.parent !== e.id ? (u.has(e.parent) || u.set(e.parent, []), u.get(e.parent).push(e)) : d.push(e);
3833
+ d = Cn(d);
3834
+ for (let [e, t] of u) u.set(e, Cn(t));
3835
+ let f = (e, t) => o + (Sn(e) !== Sn(t) && (Sn(e) || Sn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
3799
3836
  if (t.has(e.id)) return 0;
3800
3837
  t.add(e.id);
3801
- let n = (l.get(e.id) ?? []).reduce((e, n, r) => e + f(n, t) + (r ? a : 0), 0), r = Math.max(i, n);
3802
- return d.set(e.id, r), r;
3838
+ let n = u.get(e.id) ?? [], r = n.reduce((e, r, i) => e + m(r, t) + (i ? f(n[i - 1], r) : 0), 0), i = Math.max(a, r);
3839
+ return p.set(e.id, i), i;
3803
3840
  };
3804
- u.forEach((e) => f(e, /* @__PURE__ */ new Set()));
3805
- let p = [], m = [], h = 0, g = (e, t, s, c) => {
3806
- if (c.has(e.id)) return;
3807
- c.add(e.id);
3808
- let u = t + ((d.get(e.id) ?? i) - i) / 2, f = s * o, _ = n ? f : u, v = n ? u : f;
3809
- p.push({
3841
+ d.forEach((e) => m(e, /* @__PURE__ */ new Set()));
3842
+ let h = [], g = [], _ = /* @__PURE__ */ new Map(), v = 0, y = (e, t, r, o) => {
3843
+ if (o.has(e.id)) return;
3844
+ o.add(e.id);
3845
+ let c = t + ((p.get(e.id) ?? a) - a) / 2, d = r * s, m = n ? d : c, b = n ? c : d;
3846
+ h.push({
3810
3847
  node: e,
3811
- x: _,
3812
- y: v
3813
- }), h = Math.max(h, f + (n ? r.w : r.h));
3814
- let y = t;
3815
- for (let t of l.get(e.id) ?? []) {
3816
- let e = y + ((d.get(t.id) ?? i) - i) / 2 + i / 2, l = (s + 1) * o;
3817
- m.push(n ? {
3848
+ x: m,
3849
+ y: b
3850
+ });
3851
+ let x = Sn(e);
3852
+ if (x) {
3853
+ let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
3854
+ _.has(t) || _.set(t, {
3855
+ title: x,
3856
+ color: "",
3857
+ members: []
3858
+ });
3859
+ let n = _.get(t);
3860
+ !n.color && e.groupColor && (n.color = e.groupColor), n.members.push({
3861
+ x: m,
3862
+ y: b
3863
+ });
3864
+ }
3865
+ v = Math.max(v, d + (n ? i.w : i.h));
3866
+ let S = t, C = u.get(e.id) ?? [];
3867
+ C.forEach((e, t) => {
3868
+ t && (S += f(C[t - 1], e));
3869
+ let l = S + ((p.get(e.id) ?? a) - a) / 2 + a / 2, u = (r + 1) * s;
3870
+ g.push(n ? {
3818
3871
  from: {
3819
- x: f + r.w,
3820
- y: u + r.h / 2
3872
+ x: d + i.w,
3873
+ y: c + i.h / 2
3821
3874
  },
3822
3875
  to: {
3823
- x: l,
3824
- y: e
3876
+ x: u,
3877
+ y: l
3825
3878
  }
3826
3879
  } : {
3827
3880
  from: {
3828
- x: u + r.w / 2,
3829
- y: f + r.h
3881
+ x: c + i.w / 2,
3882
+ y: d + i.h
3830
3883
  },
3831
3884
  to: {
3832
- x: e,
3833
- y: l
3885
+ x: l,
3886
+ y: u
3834
3887
  }
3835
- }), g(t, y, s + 1, c), y += (d.get(t.id) ?? i) + a;
3836
- }
3837
- }, _ = 0, v = /* @__PURE__ */ new Set();
3838
- for (let e of u) g(e, _, 0, v), _ += (d.get(e.id) ?? i) + a;
3839
- let y = Math.max(_ - a, i);
3888
+ }), y(e, S, r + 1, o), S += p.get(e.id) ?? a;
3889
+ });
3890
+ }, b = 0, x = /* @__PURE__ */ new Set();
3891
+ d.forEach((e, t) => {
3892
+ t && (b += f(d[t - 1], e)), y(e, b, 0, x), b += p.get(e.id) ?? a;
3893
+ });
3894
+ let S = Math.max(b, a), C = r === "hidden" ? 0 : 22, w = [..._.values()].map((e) => {
3895
+ let t = Math.min(...e.members.map((e) => e.x)) - 12, n = Math.max(...e.members.map((e) => e.x)) + i.w + 12, a = Math.min(...e.members.map((e) => e.y)) - 12 - (r === "bottom" ? 0 : C), o = Math.max(...e.members.map((e) => e.y)) + i.h + 12 + (r === "bottom" ? C : 0);
3896
+ return {
3897
+ x: t,
3898
+ y: a,
3899
+ width: n - t,
3900
+ height: o - a,
3901
+ title: e.title,
3902
+ color: e.color
3903
+ };
3904
+ }), T = n ? Math.max(v, i.w) : S, E = n ? S : Math.max(v, i.h), D = Math.max(0, ...w.map((e) => -e.x)), O = Math.max(0, ...w.map((e) => -e.y));
3905
+ if (w.length && (T = Math.max(T, ...w.map((e) => e.x + e.width)) + D, E = Math.max(E, ...w.map((e) => e.y + e.height)) + O, D || O)) {
3906
+ for (let e of h) e.x += D, e.y += O;
3907
+ for (let e of g) e.from = {
3908
+ x: e.from.x + D,
3909
+ y: e.from.y + O
3910
+ }, e.to = {
3911
+ x: e.to.x + D,
3912
+ y: e.to.y + O
3913
+ };
3914
+ for (let e of w) e.x += D, e.y += O;
3915
+ }
3840
3916
  return {
3841
- boxes: p,
3842
- links: m,
3843
- width: n ? Math.max(h, r.w) : y,
3844
- height: n ? y : Math.max(h, r.h),
3917
+ boxes: h,
3918
+ links: g,
3919
+ groups: w,
3920
+ width: T,
3921
+ height: E,
3845
3922
  horizontal: n
3846
3923
  };
3847
3924
  }
3848
- var yn = (e, t) => {
3925
+ var Tn = (e, t) => {
3849
3926
  let n = String(e ?? "");
3850
3927
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
3851
- }, bn = (e) => {
3928
+ }, En = (e) => {
3852
3929
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
3853
3930
  if (!t) return "#ffffff";
3854
3931
  let n = t[1];
3855
3932
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
3856
3933
  let r = parseInt(n, 16);
3857
3934
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
3858
- }, xn = (e) => !!(e?.cv?.trim?.() || e?.photo);
3859
- function Sn(e, t = {}) {
3860
- 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);
3935
+ }, Dn = (e) => !!(e?.cv?.trim?.() || e?.photo);
3936
+ function On(e, t = {}) {
3937
+ 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 ? "" : we(e);
3861
3938
  return n.map((e) => {
3862
3939
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
3863
3940
  return {
@@ -3867,15 +3944,16 @@ function Sn(e, t = {}) {
3867
3944
  photo: t.photoField && r(n[t.photoField]) || "",
3868
3945
  parent: t.parentField ? o : null,
3869
3946
  cv: t.cvField ? i(n[t.cvField]) : "",
3870
- href: t.hrefField ? i(n[t.hrefField]) : ""
3947
+ href: t.hrefField ? i(n[t.hrefField]) : "",
3948
+ group: t.groupField ? i(n[t.groupField]) : ""
3871
3949
  };
3872
3950
  });
3873
3951
  }
3874
- var Cn = {
3952
+ var kn = {
3875
3953
  size: 36,
3876
3954
  pad: 10
3877
3955
  };
3878
- function wn({ node: e, onClose: t }) {
3956
+ function An({ node: e, onClose: t }) {
3879
3957
  return a(() => {
3880
3958
  let e = (e) => e.key === "Escape" && t();
3881
3959
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -3996,36 +4074,38 @@ function wn({ node: e, onClose: t }) {
3996
4074
  })
3997
4075
  });
3998
4076
  }
3999
- function Tn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
4000
- let b = o(), [x, S] = l(null), { tenant: C, apiUrl: w } = i(q), T = i(ye)?.[t], [E, D] = l(null);
4077
+ function jn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
4078
+ let C = o(), [w, T] = l(null), { tenant: E, apiUrl: D } = i(J), O = i(ye)?.[t], [k, A] = l(null);
4001
4079
  a(() => {
4002
- if (!t || T) return;
4080
+ if (!t || O) return;
4003
4081
  let e = !0;
4004
- return fetch(`${w}/dynamic/${encodeURIComponent(t)}`, { headers: C ? { "x-tenant": C } : {} }).then((e) => e.json()).then((t) => {
4082
+ return fetch(`${D}/dynamic/${encodeURIComponent(t)}`, { headers: E ? { "x-tenant": E } : {} }).then((e) => e.json()).then((t) => {
4005
4083
  let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
4006
- e && D(n);
4007
- }).catch(() => e && D([])), () => {
4084
+ e && A(n);
4085
+ }).catch(() => e && A([])), () => {
4008
4086
  e = !1;
4009
4087
  };
4010
4088
  }, [
4011
4089
  t,
4012
- C,
4013
- w,
4014
- T
4090
+ E,
4091
+ D,
4092
+ O
4015
4093
  ]);
4016
- let O = t ? Sn(T ?? E ?? [], {
4094
+ let j = t ? On(O ?? k ?? [], {
4017
4095
  nameField: n,
4018
4096
  titleField: r,
4019
4097
  photoField: s,
4020
4098
  parentField: c,
4021
4099
  cvField: p,
4022
- hrefField: m
4023
- }) : e, k = _n(h), { boxes: A, links: j, width: M, height: N } = vn(O, {
4024
- size: h,
4025
- horizontal: g
4100
+ hrefField: m,
4101
+ groupField: h
4102
+ }) : e, M = xn(v), { boxes: N, links: F, groups: I, width: L, height: R } = wn(j, {
4103
+ size: v,
4104
+ horizontal: y,
4105
+ groupTitles: g
4026
4106
  });
4027
- if (!A.length) return !y && t ? /* @__PURE__ */ f("div", {
4028
- ref: v,
4107
+ if (!N.length) return !S && t ? /* @__PURE__ */ f("div", {
4108
+ ref: x,
4029
4109
  style: {
4030
4110
  padding: 18,
4031
4111
  border: "1px dashed rgba(148, 163, 184, 0.6)",
@@ -4033,7 +4113,7 @@ function Tn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4033
4113
  fontSize: 13,
4034
4114
  opacity: .7,
4035
4115
  textAlign: "center",
4036
- ...P(_)
4116
+ ...P(b)
4037
4117
  },
4038
4118
  children: [
4039
4119
  "Org Chart — no published entries in “",
@@ -4041,151 +4121,174 @@ function Tn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
4041
4121
  "” yet"
4042
4122
  ]
4043
4123
  }) : null;
4044
- let F = new Set(A.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
4124
+ let z = new Set(N.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
4045
4125
  return /* @__PURE__ */ f("div", {
4046
- ref: v,
4126
+ ref: x,
4047
4127
  style: {
4048
4128
  maxWidth: "100%",
4049
4129
  overflowX: "auto",
4050
- ...P(_)
4130
+ ...P(b)
4051
4131
  },
4052
4132
  children: [/* @__PURE__ */ f("svg", {
4053
- viewBox: `0 0 ${M} ${N}`,
4133
+ viewBox: `0 0 ${L} ${R}`,
4054
4134
  role: "img",
4055
4135
  "aria-label": "Organization chart",
4056
4136
  style: {
4057
4137
  display: "block",
4058
4138
  width: "100%",
4059
- maxWidth: M,
4139
+ maxWidth: L,
4060
4140
  height: "auto",
4061
4141
  margin: "0 auto"
4062
4142
  },
4063
- children: [j.map((e, t) => /* @__PURE__ */ d("path", {
4064
- d: g ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
4065
- fill: "none",
4066
- stroke: "rgba(148, 163, 184, 0.7)",
4067
- strokeWidth: "1.5"
4068
- }, t)), A.map(({ node: e, x: t, y: n }) => {
4069
- 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 ? bn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? bn(e.color2) : s, l = y && (xn(e) || e.href), p = () => xn(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Cn.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);
4070
- return /* @__PURE__ */ f("g", {
4071
- onClick: l ? p : void 0,
4072
- style: l ? { cursor: "pointer" } : void 0,
4073
- role: l ? "button" : void 0,
4074
- "aria-label": l ? `Open ${e.name || e.title}'s profile` : void 0,
4075
- children: [
4076
- i && e.gradient ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("linearGradient", {
4077
- id: `${b}-${e.id}-grad`,
4078
- x1: "0",
4079
- y1: "0",
4080
- x2: "0",
4081
- y2: "1",
4082
- children: [/* @__PURE__ */ d("stop", {
4083
- offset: "0%",
4084
- stopColor: e.color || "var(--page-accent, #4f46e5)"
4085
- }), /* @__PURE__ */ d("stop", {
4086
- offset: "100%",
4087
- stopColor: e.color2
4088
- })]
4089
- }), /* @__PURE__ */ d("rect", {
4090
- x: t,
4091
- y: n,
4092
- width: k.w,
4093
- height: k.h,
4094
- rx: "10",
4095
- fill: `url(#${b}-${e.id}-grad)`
4096
- })] }) : i ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
4097
- id: `${b}-${e.id}-box`,
4098
- children: /* @__PURE__ */ d("rect", {
4143
+ children: [
4144
+ I.map((e, t) => {
4145
+ let n = e.color || _ || "rgba(148, 163, 184, 0.16)", r = !!(e.color || _);
4146
+ return /* @__PURE__ */ f("g", { children: [/* @__PURE__ */ d("rect", {
4147
+ x: e.x,
4148
+ y: e.y,
4149
+ width: e.width,
4150
+ height: e.height,
4151
+ rx: "16",
4152
+ fill: n
4153
+ }), g !== "hidden" && e.title && /* @__PURE__ */ d("text", {
4154
+ x: e.x + e.width / 2,
4155
+ y: g === "bottom" ? e.y + e.height - 22 * .42 : e.y + 22 * .78,
4156
+ textAnchor: "middle",
4157
+ fontSize: M.title + 1,
4158
+ fontWeight: "600",
4159
+ opacity: "0.55",
4160
+ fill: r ? En(e.color || _) : "var(--page-text, #111827)",
4161
+ children: Tn(e.title, Math.floor(e.width / 7))
4162
+ })] }, `group-${t}`);
4163
+ }),
4164
+ F.map((e, t) => /* @__PURE__ */ d("path", {
4165
+ d: y ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
4166
+ fill: "none",
4167
+ stroke: "rgba(148, 163, 184, 0.7)",
4168
+ strokeWidth: "1.5"
4169
+ }, t)),
4170
+ N.map(({ node: e, x: t, y: n }) => {
4171
+ let r = z.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 ? En(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? En(e.color2) : s, l = S && (Dn(e) || e.href), p = () => Dn(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + kn.pad + M.avatar + 8 : t + M.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((M.w - M.avatar - 26) / 7) : Math.floor(M.w / 7.6), _ = M.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
4172
+ return /* @__PURE__ */ f("g", {
4173
+ onClick: l ? p : void 0,
4174
+ style: l ? { cursor: "pointer" } : void 0,
4175
+ role: l ? "button" : void 0,
4176
+ "aria-label": l ? `Open ${e.name || e.title}'s profile` : void 0,
4177
+ children: [
4178
+ i && e.gradient ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("linearGradient", {
4179
+ id: `${C}-${e.id}-grad`,
4180
+ x1: "0",
4181
+ y1: "0",
4182
+ x2: "0",
4183
+ y2: "1",
4184
+ children: [/* @__PURE__ */ d("stop", {
4185
+ offset: "0%",
4186
+ stopColor: e.color || "var(--page-accent, #4f46e5)"
4187
+ }), /* @__PURE__ */ d("stop", {
4188
+ offset: "100%",
4189
+ stopColor: e.color2
4190
+ })]
4191
+ }), /* @__PURE__ */ d("rect", {
4099
4192
  x: t,
4100
4193
  y: n,
4101
- width: k.w,
4102
- height: k.h,
4103
- rx: "10"
4104
- })
4105
- }), /* @__PURE__ */ f("g", {
4106
- clipPath: `url(#${b}-${e.id}-box)`,
4107
- children: [/* @__PURE__ */ d("rect", {
4194
+ width: M.w,
4195
+ height: M.h,
4196
+ rx: "10",
4197
+ fill: `url(#${C}-${e.id}-grad)`
4198
+ })] }) : i ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
4199
+ id: `${C}-${e.id}-box`,
4200
+ children: /* @__PURE__ */ d("rect", {
4201
+ x: t,
4202
+ y: n,
4203
+ width: M.w,
4204
+ height: M.h,
4205
+ rx: "10"
4206
+ })
4207
+ }), /* @__PURE__ */ f("g", {
4208
+ clipPath: `url(#${C}-${e.id}-box)`,
4209
+ children: [/* @__PURE__ */ d("rect", {
4210
+ x: t,
4211
+ y: n,
4212
+ width: M.w,
4213
+ height: _,
4214
+ fill: o
4215
+ }), /* @__PURE__ */ d("rect", {
4216
+ x: t,
4217
+ y: n + _,
4218
+ width: M.w,
4219
+ height: M.h - _,
4220
+ fill: e.color2
4221
+ })]
4222
+ })] }) : /* @__PURE__ */ d("rect", {
4108
4223
  x: t,
4109
4224
  y: n,
4110
- width: k.w,
4111
- height: _,
4112
- fill: o
4113
- }), /* @__PURE__ */ d("rect", {
4114
- x: t,
4115
- y: n + _,
4116
- width: k.w,
4117
- height: k.h - _,
4118
- fill: e.color2
4119
- })]
4120
- })] }) : /* @__PURE__ */ d("rect", {
4121
- x: t,
4122
- y: n,
4123
- width: k.w,
4124
- height: k.h,
4125
- rx: "10",
4126
- fill: o,
4127
- stroke: a ? "none" : "var(--page-accent, #4f46e5)",
4128
- strokeWidth: a ? 0 : 1.5
4129
- }),
4130
- e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
4131
- id: `${b}-${e.id}`,
4132
- children: /* @__PURE__ */ d("circle", {
4133
- cx: t + Cn.pad + k.avatar / 2,
4134
- cy: n + k.h / 2,
4135
- r: k.avatar / 2
4136
- })
4137
- }), /* @__PURE__ */ d("image", {
4138
- href: e.photo,
4139
- x: t + Cn.pad,
4140
- y: n + (k.h - k.avatar) / 2,
4141
- width: k.avatar,
4142
- height: k.avatar,
4143
- preserveAspectRatio: "xMidYMid slice",
4144
- clipPath: `url(#${b}-${e.id})`
4145
- })] }),
4146
- i && !e.gradient ? /* @__PURE__ */ f(u, { children: [e.title && /* @__PURE__ */ d("text", {
4147
- x: m,
4148
- y: n + _ / 2 + k.title * .35,
4149
- textAnchor: h,
4150
- fontSize: k.title,
4151
- fontWeight: "600",
4152
- fill: s,
4153
- children: yn(e.title, g + 4)
4154
- }), e.name && /* @__PURE__ */ d("text", {
4155
- x: m,
4156
- y: n + _ + _ / 2 + k.name * .35,
4157
- textAnchor: h,
4158
- fontSize: k.name,
4159
- fontWeight: "600",
4160
- fill: c,
4161
- children: yn(e.name, g)
4162
- })] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
4163
- x: m,
4164
- y: n + (v[1] ? k.h * .43 : k.h * .57),
4165
- textAnchor: h,
4166
- fontSize: k.name,
4167
- fontWeight: "600",
4168
- fill: s,
4169
- children: yn(v[0], g)
4170
- }), v[1] && /* @__PURE__ */ d("text", {
4171
- x: m,
4172
- y: n + k.h * .73,
4173
- textAnchor: h,
4174
- fontSize: k.title,
4175
- opacity: "0.7",
4176
- fill: s,
4177
- children: yn(v[1], g + 4)
4178
- })] })
4179
- ]
4180
- }, e.id);
4181
- })]
4182
- }), x && /* @__PURE__ */ d(wn, {
4183
- node: x,
4184
- onClose: () => S(null)
4225
+ width: M.w,
4226
+ height: M.h,
4227
+ rx: "10",
4228
+ fill: o,
4229
+ stroke: a ? "none" : "var(--page-accent, #4f46e5)",
4230
+ strokeWidth: a ? 0 : 1.5
4231
+ }),
4232
+ e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
4233
+ id: `${C}-${e.id}`,
4234
+ children: /* @__PURE__ */ d("circle", {
4235
+ cx: t + kn.pad + M.avatar / 2,
4236
+ cy: n + M.h / 2,
4237
+ r: M.avatar / 2
4238
+ })
4239
+ }), /* @__PURE__ */ d("image", {
4240
+ href: e.photo,
4241
+ x: t + kn.pad,
4242
+ y: n + (M.h - M.avatar) / 2,
4243
+ width: M.avatar,
4244
+ height: M.avatar,
4245
+ preserveAspectRatio: "xMidYMid slice",
4246
+ clipPath: `url(#${C}-${e.id})`
4247
+ })] }),
4248
+ i && !e.gradient ? /* @__PURE__ */ f(u, { children: [e.title && /* @__PURE__ */ d("text", {
4249
+ x: m,
4250
+ y: n + _ / 2 + M.title * .35,
4251
+ textAnchor: h,
4252
+ fontSize: M.title,
4253
+ fontWeight: "600",
4254
+ fill: s,
4255
+ children: Tn(e.title, g + 4)
4256
+ }), e.name && /* @__PURE__ */ d("text", {
4257
+ x: m,
4258
+ y: n + _ + _ / 2 + M.name * .35,
4259
+ textAnchor: h,
4260
+ fontSize: M.name,
4261
+ fontWeight: "600",
4262
+ fill: c,
4263
+ children: Tn(e.name, g)
4264
+ })] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
4265
+ x: m,
4266
+ y: n + (v[1] ? M.h * .43 : M.h * .57),
4267
+ textAnchor: h,
4268
+ fontSize: M.name,
4269
+ fontWeight: "600",
4270
+ fill: s,
4271
+ children: Tn(v[0], g)
4272
+ }), v[1] && /* @__PURE__ */ d("text", {
4273
+ x: m,
4274
+ y: n + M.h * .73,
4275
+ textAnchor: h,
4276
+ fontSize: M.title,
4277
+ opacity: "0.7",
4278
+ fill: s,
4279
+ children: Tn(v[1], g + 4)
4280
+ })] })
4281
+ ]
4282
+ }, e.id);
4283
+ })
4284
+ ]
4285
+ }), w && /* @__PURE__ */ d(An, {
4286
+ node: w,
4287
+ onClose: () => T(null)
4185
4288
  })]
4186
4289
  });
4187
4290
  }
4188
- function En({ value: e, onCommit: t, style: n, hint: r }) {
4291
+ function Mn({ value: e, onCommit: t, style: n, hint: r }) {
4189
4292
  let [i, o] = l(!1), s = c(null);
4190
4293
  return a(() => {
4191
4294
  if (!i || !s.current) return;
@@ -4215,7 +4318,7 @@ function En({ value: e, onCommit: t, style: n, hint: r }) {
4215
4318
  children: e ?? ""
4216
4319
  });
4217
4320
  }
4218
- var Dn = 360, On = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", kn = (e, t) => e && t ? `cell-${e}-${t}` : "", An = (e) => {
4321
+ var Nn = 360, Pn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", Fn = (e, t) => e && t ? `cell-${e}-${t}` : "", In = (e) => {
4219
4322
  if (!e || typeof e != "object") return e ?? "";
4220
4323
  let t = String(e.text ?? "");
4221
4324
  return typeof e.href == "string" && e.href ? /* @__PURE__ */ d("a", {
@@ -4226,8 +4329,8 @@ var Dn = 360, On = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
4226
4329
  children: t
4227
4330
  }) : t;
4228
4331
  };
4229
- function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: o = [], heights: s = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: A, style: j, nodeRef: M, edit: N }) {
4230
- let F = c(null), I = c(null), [L, R] = l(null), [z, B] = l(null), V = (e, t) => () => R({
4332
+ function Ln({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: o = [], heights: s = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: A, style: j, nodeRef: M, edit: N }) {
4333
+ let F = c(null), I = c(null), [L, R] = l(null), [z, B] = l(null), ee = (e, t) => () => R({
4231
4334
  r: e,
4232
4335
  c: t
4233
4336
  });
@@ -4240,7 +4343,7 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4240
4343
  }
4241
4344
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
4242
4345
  top: r.bottom - n.top + 4,
4243
- left: Math.max(0, Math.min(r.left - n.left, n.width - Dn))
4346
+ left: Math.max(0, Math.min(r.left - n.left, n.width - Nn))
4244
4347
  };
4245
4348
  (z?.top !== i.top || z?.left !== i.left) && B(i);
4246
4349
  }), a(() => {
@@ -4250,58 +4353,58 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4250
4353
  };
4251
4354
  return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
4252
4355
  }, [N, L]);
4253
- let { tenant: ee, apiUrl: H } = i(q), te = i(ye), U = te?.[h], W = C ? be(te) : 1, [ne, re] = l(null);
4356
+ let { tenant: V, apiUrl: H } = i(J), te = i(ye), ne = te?.[h], re = C ? be(te) : 1, [ie, ae] = l(null);
4254
4357
  if (a(() => {
4255
- if (!h || U) return;
4256
- let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(W - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${H}/data/${encodeURIComponent(h.slice(4))}` : `${H}/dynamic/${encodeURIComponent(h)}${n}`;
4257
- return fetch(r, { headers: ee ? { "x-tenant": ee } : {} }).then((e) => e.json()).then((t) => {
4358
+ if (!h || ne) return;
4359
+ let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(re - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${H}/data/${encodeURIComponent(h.slice(4))}` : `${H}/dynamic/${encodeURIComponent(h)}${n}`;
4360
+ return fetch(r, { headers: V ? { "x-tenant": V } : {} }).then((e) => e.json()).then((t) => {
4258
4361
  let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
4259
- return e && re(n);
4260
- }).catch(() => e && re([])), () => {
4362
+ return e && ae(n);
4363
+ }).catch(() => e && ae([])), () => {
4261
4364
  e = !1;
4262
4365
  };
4263
4366
  }, [
4264
4367
  h,
4265
- ee,
4368
+ V,
4266
4369
  H,
4267
- U,
4370
+ ne,
4268
4371
  C,
4269
- W,
4372
+ re,
4270
4373
  g
4271
4374
  ]), !e.length) return null;
4272
- let ie = Math.max(1, Number(g) || 10), ae = h ? C ? U || h.startsWith("api:") ? (U ?? ne ?? []).slice((W - 1) * ie, W * ie) : (ne ?? []).slice(0, ie) : (U ?? ne ?? []).slice(0, ie) : null, G = ae ? ae.map((t) => e.map((e) => Y(Te(t?.data, e.field)))) : t, oe = !!h && !(h && !U && ne === null) && G.length === 0, se = b ? {
4375
+ let U = Math.max(1, Number(g) || 10), oe = h ? C ? ne || h.startsWith("api:") ? (ne ?? ie ?? []).slice((re - 1) * U, re * U) : (ie ?? []).slice(0, U) : (ne ?? ie ?? []).slice(0, U) : null, se = oe ? oe.map((t) => e.map((e) => we(X(t?.data, e.field)))) : t, ce = !!h && !(h && !ne && ie === null) && se.length === 0, le = b ? {
4273
4376
  y: 6,
4274
4377
  x: 10
4275
4378
  } : {
4276
4379
  y: 10,
4277
4380
  x: 14
4278
- }, K = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : se.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : se.x}px`, ce = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, le = y ? { border: ce } : { borderBottom: ce }, ue = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), de = [
4381
+ }, W = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : le.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : le.x}px`, ue = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, G = y ? { border: ue } : { borderBottom: ue }, de = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), fe = [
4279
4382
  "left",
4280
4383
  "center",
4281
4384
  "right"
4282
- ], fe = (t) => de.includes(e[t]?.align) ? e[t].align : "", pe = (e) => fe(e) || (de.includes(O) ? O : "left"), me = Number.isFinite(Number(A)) && Number(A) > 0 ? Number(A) : 0, he = P(j), ge = !me && he && he.maxHeight !== void 0 ? he.maxHeight : 0, _e = me || ge, ve = ge ? {
4283
- ...he,
4385
+ ], pe = (t) => fe.includes(e[t]?.align) ? e[t].align : "", me = (e) => pe(e) || (fe.includes(O) ? O : "left"), K = Number.isFinite(Number(A)) && Number(A) > 0 ? Number(A) : 0, q = P(j), he = !K && q && q.maxHeight !== void 0 ? q.maxHeight : 0, ge = K || he, _e = he ? {
4386
+ ...q,
4284
4387
  maxHeight: void 0
4285
- } : he, xe = !!N && N.rows !== !1, Se = (t) => (r) => {
4388
+ } : q, ve = !!N && N.rows !== !1, xe = (t) => (r) => {
4286
4389
  if (!N?.resize || t >= e.length - 1) return;
4287
4390
  r.preventDefault(), r.stopPropagation();
4288
4391
  let i = F.current, a = i ? i.clientWidth : 0;
4289
4392
  if (!a) return;
4290
- let o = ue ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
4393
+ let o = de ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
4291
4394
  let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
4292
4395
  i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, N.resize(i);
4293
4396
  }, u = () => {
4294
4397
  window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
4295
4398
  };
4296
4399
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
4297
- }, Ce = /* @__PURE__ */ new Set();
4298
- p && G.forEach((t, n) => e.forEach((e, t) => {
4299
- let i = p[kn(r[n], o[t])];
4400
+ }, Se = /* @__PURE__ */ new Set();
4401
+ p && se.forEach((t, n) => e.forEach((e, t) => {
4402
+ let i = p[Fn(r[n], o[t])];
4300
4403
  if (!i) return;
4301
4404
  let a = Math.max(1, Number(i.c) || 1), s = Math.max(1, Number(i.r) || 1);
4302
- for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) && Ce.add(`${n + e},${t + r}`);
4405
+ for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) && Se.add(`${n + e},${t + r}`);
4303
4406
  }));
4304
- let we = (e) => (t) => {
4407
+ let Ce = (e) => (t) => {
4305
4408
  if (!N?.resizeRow) return;
4306
4409
  t.preventDefault(), t.stopPropagation();
4307
4410
  let n = t.currentTarget.closest("tr");
@@ -4310,7 +4413,7 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4310
4413
  window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
4311
4414
  };
4312
4415
  window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
4313
- }, J = (e, t, n, r) => r ? null : /* @__PURE__ */ d("span", {
4416
+ }, Y = (e, t, n, r) => r ? null : /* @__PURE__ */ d("span", {
4314
4417
  className: "wb-tedit-btn",
4315
4418
  role: "button",
4316
4419
  "data-hint": t,
@@ -4319,7 +4422,7 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4319
4422
  },
4320
4423
  onClick: n,
4321
4424
  children: e
4322
- }, t), X = L && L.r < G.length && L.c < e.length ? L : null, Z = (e, t) => N?.labels?.[e] ?? t, Ee = X ? p?.[kn(r[X.r], o[X.c])] : null, De = Math.max(1, Number(Ee?.c) || 1), Oe = Math.max(1, Number(Ee?.r) || 1);
4425
+ }, t), Z = L && L.r < se.length && L.c < e.length ? L : null, Q = (e, t) => N?.labels?.[e] ?? t, Te = Z ? p?.[Fn(r[Z.r], o[Z.c])] : null, Ee = Math.max(1, Number(Te?.c) || 1), De = Math.max(1, Number(Te?.r) || 1);
4323
4426
  return /* @__PURE__ */ f("div", {
4324
4427
  ref: (e) => {
4325
4428
  I.current = e, typeof M == "function" && M(e);
@@ -4327,11 +4430,11 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4327
4430
  style: {
4328
4431
  width: "100%",
4329
4432
  ...N ? { position: "relative" } : null,
4330
- ...ve
4433
+ ..._e
4331
4434
  },
4332
4435
  children: [
4333
- N && /* @__PURE__ */ d("style", { children: On }),
4334
- N && X && z && /* @__PURE__ */ f("div", {
4436
+ N && /* @__PURE__ */ d("style", { children: Pn }),
4437
+ N && Z && z && /* @__PURE__ */ f("div", {
4335
4438
  className: "wb-tedit-bar",
4336
4439
  style: {
4337
4440
  top: z.top,
@@ -4341,31 +4444,31 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4341
4444
  children: [
4342
4445
  /* @__PURE__ */ d("span", {
4343
4446
  className: "wb-tedit-at",
4344
- children: `R${X.r + 1}·C${X.c + 1}`
4447
+ children: `R${Z.r + 1}·C${Z.c + 1}`
4345
4448
  }),
4346
- J("+↑", Z("rowAbove", "Insert row above"), () => N.addRow(X.r - 1)),
4347
- J("+↓", Z("rowBelow", "Insert row below"), () => N.addRow(X.r)),
4348
- J("↑", Z("rowUp", "Move row up"), () => N.moveRow(X.r, -1), X.r === 0),
4349
- J("↓", Z("rowDown", "Move row down"), () => N.moveRow(X.r, 1), X.r >= G.length - 1),
4350
- J("✕ row", Z("rowDelete", "Delete row"), () => N.dropRow(X.r), G.length <= 1),
4449
+ Y("+↑", Q("rowAbove", "Insert row above"), () => N.addRow(Z.r - 1)),
4450
+ Y("+↓", Q("rowBelow", "Insert row below"), () => N.addRow(Z.r)),
4451
+ Y("↑", Q("rowUp", "Move row up"), () => N.moveRow(Z.r, -1), Z.r === 0),
4452
+ Y("↓", Q("rowDown", "Move row down"), () => N.moveRow(Z.r, 1), Z.r >= se.length - 1),
4453
+ Y("✕ row", Q("rowDelete", "Delete row"), () => N.dropRow(Z.r), se.length <= 1),
4351
4454
  /* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
4352
- J("+←", Z("colLeft", "Insert column left"), () => N.addColumn(X.c - 1)),
4353
- J("+→", Z("colRight", "Insert column right"), () => N.addColumn(X.c)),
4354
- J("←", Z("colMoveLeft", "Move column left"), () => N.moveColumn(X.c, -1), X.c === 0),
4355
- J("→", Z("colMoveRight", "Move column right"), () => N.moveColumn(X.c, 1), X.c >= e.length - 1),
4356
- J("✕ col", Z("colDelete", "Delete column"), () => N.dropColumn(X.c), e.length <= 1),
4455
+ Y("+←", Q("colLeft", "Insert column left"), () => N.addColumn(Z.c - 1)),
4456
+ Y("+→", Q("colRight", "Insert column right"), () => N.addColumn(Z.c)),
4457
+ Y("←", Q("colMoveLeft", "Move column left"), () => N.moveColumn(Z.c, -1), Z.c === 0),
4458
+ Y("→", Q("colMoveRight", "Move column right"), () => N.moveColumn(Z.c, 1), Z.c >= e.length - 1),
4459
+ Y("✕ col", Q("colDelete", "Delete column"), () => N.dropColumn(Z.c), e.length <= 1),
4357
4460
  /* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
4358
- J("↔", Z("mergeRight", "Merge with the cell on the right"), () => N.merge(X.r, X.c, "right"), X.c + De >= e.length),
4359
- J("↕", Z("mergeDown", "Merge with the cell below"), () => N.merge(X.r, X.c, "down"), X.r + Oe >= G.length),
4360
- J("⤫", Z("split", "Split this cell"), () => N.split(X.r, X.c), De === 1 && Oe === 1)
4461
+ Y("↔", Q("mergeRight", "Merge with the cell on the right"), () => N.merge(Z.r, Z.c, "right"), Z.c + Ee >= e.length),
4462
+ Y("↕", Q("mergeDown", "Merge with the cell below"), () => N.merge(Z.r, Z.c, "down"), Z.r + De >= se.length),
4463
+ Y("⤫", Q("split", "Split this cell"), () => N.split(Z.r, Z.c), Ee === 1 && De === 1)
4361
4464
  ]
4362
4465
  }),
4363
4466
  /* @__PURE__ */ d("div", {
4364
4467
  style: {
4365
4468
  width: "100%",
4366
4469
  overflowX: "auto",
4367
- ..._e ? {
4368
- maxHeight: _e,
4470
+ ...ge ? {
4471
+ maxHeight: ge,
4369
4472
  overflowY: "auto"
4370
4473
  } : null
4371
4474
  },
@@ -4376,17 +4479,17 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4376
4479
  borderCollapse: T && _ !== !1 ? "separate" : "collapse",
4377
4480
  borderSpacing: 0,
4378
4481
  fontSize: 14,
4379
- ...ue ? { tableLayout: "fixed" } : null,
4380
- ...y ? { border: ce } : {}
4482
+ ...de ? { tableLayout: "fixed" } : null,
4483
+ ...y ? { border: ue } : {}
4381
4484
  },
4382
4485
  children: [
4383
- ue && /* @__PURE__ */ d("colgroup", { children: n.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
4486
+ de && /* @__PURE__ */ d("colgroup", { children: n.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
4384
4487
  _ === !1 ? null : /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((t, n) => /* @__PURE__ */ d("th", {
4385
4488
  className: N ? "wb-tedit-head" : void 0,
4386
4489
  style: {
4387
- textAlign: pe(n),
4490
+ textAlign: me(n),
4388
4491
  fontWeight: 600,
4389
- padding: K,
4492
+ padding: W,
4390
4493
  ...typeof D == "string" && D ? { color: D } : null,
4391
4494
  background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
4392
4495
  ...T ? {
@@ -4394,53 +4497,53 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4394
4497
  top: 0,
4395
4498
  zIndex: 2
4396
4499
  } : N ? { position: "relative" } : null,
4397
- ...le
4500
+ ...G
4398
4501
  },
4399
- children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(En, {
4502
+ children: N ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(Mn, {
4400
4503
  value: t.label ?? t,
4401
4504
  onCommit: (e) => N.header(n, e),
4402
- hint: Z("editCell", "Double-click to edit"),
4505
+ hint: Q("editCell", "Double-click to edit"),
4403
4506
  style: { paddingRight: 6 }
4404
4507
  }), n < e.length - 1 && /* @__PURE__ */ d("span", {
4405
4508
  className: "wb-tedit-grip",
4406
- title: Z("colWidth", "Drag to resize the column"),
4407
- onPointerDown: Se(n)
4509
+ title: Q("colWidth", "Drag to resize the column"),
4510
+ onPointerDown: xe(n)
4408
4511
  })] }) : t.label ?? t
4409
4512
  }, n)) }) }),
4410
- /* @__PURE__ */ f("tbody", { children: [oe && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
4513
+ /* @__PURE__ */ f("tbody", { children: [ce && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
4411
4514
  colSpan: e.length,
4412
4515
  style: {
4413
- padding: K,
4516
+ padding: W,
4414
4517
  textAlign: "center",
4415
4518
  opacity: .6,
4416
- ...le
4519
+ ...G
4417
4520
  },
4418
4521
  children: w || "No data yet"
4419
- }) }), G.map((t, n) => /* @__PURE__ */ d("tr", {
4522
+ }) }), se.map((t, n) => /* @__PURE__ */ d("tr", {
4420
4523
  className: N ? "wb-tedit-row" : void 0,
4421
4524
  style: {
4422
4525
  ...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
4423
4526
  ...Number.isFinite(Number(s?.[n])) && s[n] > 0 ? { height: s[n] } : null
4424
4527
  },
4425
4528
  children: e.map((e, i) => {
4426
- if (Ce.has(`${n},${i}`)) return null;
4427
- let a = kn(r[n], o[i]), s = m?.[a], c = p?.[a], l = Math.max(1, Number(c?.c) || 1), u = Math.max(1, Number(c?.r) || 1);
4529
+ if (Se.has(`${n},${i}`)) return null;
4530
+ let a = Fn(r[n], o[i]), s = m?.[a], c = p?.[a], l = Math.max(1, Number(c?.c) || 1), u = Math.max(1, Number(c?.r) || 1);
4428
4531
  return /* @__PURE__ */ f("td", {
4429
4532
  className: N ? `wb-tedit-cell${L?.r === n && L?.c === i ? " wb-tedit-cellon" : ""}` : void 0,
4430
- onMouseDownCapture: xe ? V(n, i) : void 0,
4533
+ onMouseDownCapture: ve ? ee(n, i) : void 0,
4431
4534
  "data-cell": N ? `${n}-${i}` : void 0,
4432
4535
  colSpan: l > 1 ? l : void 0,
4433
4536
  rowSpan: u > 1 ? u : void 0,
4434
4537
  style: {
4435
- padding: K,
4436
- ...fe(i) ? { textAlign: fe(i) } : null,
4538
+ padding: W,
4539
+ ...pe(i) ? { textAlign: pe(i) } : null,
4437
4540
  ...N ? { position: "relative" } : null,
4438
- ...le
4541
+ ...G
4439
4542
  },
4440
- children: [s ?? An(t?.[i]), N && xe && /* @__PURE__ */ d("span", {
4543
+ children: [s ?? In(t?.[i]), N && ve && /* @__PURE__ */ d("span", {
4441
4544
  className: "wb-tedit-rowgrip",
4442
- title: Z("rowHeight", "Drag to set the row height — double-click to fit the content"),
4443
- onPointerDown: we(n),
4545
+ title: Q("rowHeight", "Drag to set the row height — double-click to fit the content"),
4546
+ onPointerDown: Ce(n),
4444
4547
  onDoubleClick: () => N.resizeRow(n, 0)
4445
4548
  })]
4446
4549
  }, i);
@@ -4452,7 +4555,7 @@ function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
4452
4555
  ]
4453
4556
  });
4454
4557
  }
4455
- var Mn = {
4558
+ var Rn = {
4456
4559
  small: {
4457
4560
  cell: 62,
4458
4561
  font: 10.5,
@@ -4477,9 +4580,9 @@ var Mn = {
4477
4580
  pad: 8,
4478
4581
  gap: 4
4479
4582
  }
4480
- }, Nn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Pn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Fn = 366;
4481
- function In(e, t = {}) {
4482
- 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) => {
4583
+ }, zn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Bn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Vn = 366;
4584
+ function Hn(e, t = {}) {
4585
+ 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 ? "" : we(e), a = (e) => {
4483
4586
  let t = i(r(e)), n = t ? new Date(t) : null;
4484
4587
  return n && !Number.isNaN(n.getTime()) ? n : null;
4485
4588
  };
@@ -4495,7 +4598,7 @@ function In(e, t = {}) {
4495
4598
  } : null;
4496
4599
  }).filter(Boolean);
4497
4600
  }
4498
- function Ln(e) {
4601
+ function Un(e) {
4499
4602
  return (Array.isArray(e) ? e : []).map((e, t) => {
4500
4603
  let n = e?.start ? new Date(e.start) : null;
4501
4604
  if (!n || Number.isNaN(n.getTime())) return null;
@@ -4510,20 +4613,20 @@ function Ln(e) {
4510
4613
  };
4511
4614
  }).filter(Boolean);
4512
4615
  }
4513
- function Rn(e) {
4616
+ function Wn(e) {
4514
4617
  let t = /* @__PURE__ */ new Map();
4515
4618
  for (let n of e) {
4516
- let e = Pn(n.start), r = n.end ? Pn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Fn);
4619
+ let e = Bn(n.start), r = n.end ? Bn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Vn);
4517
4620
  for (let r = 0; r <= i; r += 1) {
4518
- let i = Nn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
4621
+ let i = zn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
4519
4622
  t.has(i) || t.set(i, []), t.get(i).push(n);
4520
4623
  }
4521
4624
  }
4522
4625
  for (let e of t.values()) e.sort((e, t) => e.start - t.start);
4523
4626
  return t;
4524
4627
  }
4525
- function zn({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: o = "", hrefField: s = "", colorField: c = "", 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 }) {
4526
- let { tenant: T, apiUrl: E, locale: D } = i(q), O = i(ye)?.[t], [k, A] = l(null), [j, M] = l(() => {
4628
+ function Gn({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: o = "", hrefField: s = "", colorField: c = "", 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 }) {
4629
+ let { tenant: T, apiUrl: E, locale: D } = i(J), O = i(ye)?.[t], [k, A] = l(null), [j, M] = l(() => {
4527
4630
  let e = /* @__PURE__ */ new Date();
4528
4631
  return {
4529
4632
  year: e.getFullYear(),
@@ -4545,13 +4648,13 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
4545
4648
  E,
4546
4649
  O
4547
4650
  ]);
4548
- let N = Mn[m] ?? Mn.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 ? In(O ?? k ?? [], {
4651
+ let N = Rn[m] ?? Rn.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 ? Hn(O ?? k ?? [], {
4549
4652
  titleField: n,
4550
4653
  startField: r,
4551
4654
  endField: o,
4552
4655
  hrefField: s,
4553
4656
  colorField: c
4554
- }) : Ln(e), B = Rn(z), V = D || void 0, ee = (e, t) => {
4657
+ }) : Un(e), B = Wn(z), ee = D || void 0, V = (e, t) => {
4555
4658
  let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
4556
4659
  width: 6,
4557
4660
  height: 6,
@@ -4589,7 +4692,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
4589
4692
  title: e.title,
4590
4693
  children: n
4591
4694
  }, e.key);
4592
- }, H = new Intl.DateTimeFormat(V, {
4695
+ }, H = new Intl.DateTimeFormat(ee, {
4593
4696
  month: "long",
4594
4697
  year: "numeric"
4595
4698
  }).format(new Date(j.year, j.month, 1)), te = (e) => M((t) => {
@@ -4598,7 +4701,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
4598
4701
  year: n.getFullYear(),
4599
4702
  month: n.getMonth()
4600
4703
  };
4601
- }), U = (e, t) => /* @__PURE__ */ d("button", {
4704
+ }), ne = (e, t) => /* @__PURE__ */ d("button", {
4602
4705
  type: "button",
4603
4706
  "aria-label": e,
4604
4707
  onClick: () => te(t),
@@ -4613,7 +4716,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
4613
4716
  padding: "4px 8px"
4614
4717
  },
4615
4718
  children: t < 0 ? "‹" : "›"
4616
- }), W = /* @__PURE__ */ f("div", {
4719
+ }), re = /* @__PURE__ */ f("div", {
4617
4720
  style: {
4618
4721
  display: "flex",
4619
4722
  alignItems: "center",
@@ -4630,12 +4733,12 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
4630
4733
  },
4631
4734
  children: H
4632
4735
  }),
4633
- U("Previous month", -1),
4634
- U("Next month", 1)
4736
+ ne("Previous month", -1),
4737
+ ne("Next month", 1)
4635
4738
  ]
4636
4739
  });
4637
4740
  if (p === "list") {
4638
- let e = z.filter((e) => e.start.getFullYear() === j.year && e.start.getMonth() === j.month).sort((e, t) => e.start - t.start), t = new Intl.DateTimeFormat(V, {
4741
+ let e = z.filter((e) => e.start.getFullYear() === j.year && e.start.getMonth() === j.month).sort((e, t) => e.start - t.start), t = new Intl.DateTimeFormat(ee, {
4639
4742
  day: "numeric",
4640
4743
  month: "short",
4641
4744
  hour: "2-digit",
@@ -4647,7 +4750,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
4647
4750
  width: "100%",
4648
4751
  ...P(S)
4649
4752
  },
4650
- children: [W, e.length ? /* @__PURE__ */ d("div", {
4753
+ children: [re, e.length ? /* @__PURE__ */ d("div", {
4651
4754
  style: {
4652
4755
  display: "flex",
4653
4756
  flexDirection: "column",
@@ -4668,7 +4771,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
4668
4771
  minWidth: 96
4669
4772
  },
4670
4773
  children: t.format(e.start)
4671
- }), ee(e, {
4774
+ }), V(e, {
4672
4775
  flexGrow: 1,
4673
4776
  minWidth: 0
4674
4777
  })]
@@ -4683,10 +4786,10 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
4683
4786
  })]
4684
4787
  });
4685
4788
  }
4686
- let ne = new Date(j.year, j.month, 1), re = y === "sunday" ? 0 : 1, ie = (ne.getDay() - re + 7) % 7, ae = new Date(j.year, j.month + 1, 0).getDate(), G = Math.ceil((ie + ae) / 7), oe = Nn(/* @__PURE__ */ new Date()), se = new Intl.DateTimeFormat(V, { weekday: "short" }), K = [];
4687
- for (let e = 0; e < G * 7; e += 1) {
4688
- let t = e - ie + 1, n = t >= 1 && t <= ae, r = Nn(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === oe;
4689
- K.push(/* @__PURE__ */ f("div", {
4789
+ let ie = new Date(j.year, j.month, 1), ae = y === "sunday" ? 0 : 1, U = (ie.getDay() - ae + 7) % 7, oe = new Date(j.year, j.month + 1, 0).getDate(), se = Math.ceil((U + oe) / 7), ce = zn(/* @__PURE__ */ new Date()), le = new Intl.DateTimeFormat(ee, { weekday: "short" }), W = [];
4790
+ for (let e = 0; e < se * 7; e += 1) {
4791
+ let t = e - U + 1, n = t >= 1 && t <= oe, r = zn(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ce;
4792
+ W.push(/* @__PURE__ */ f("div", {
4690
4793
  style: {
4691
4794
  minHeight: N.cell,
4692
4795
  borderTop: `1px solid ${I}`,
@@ -4711,7 +4814,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
4711
4814
  },
4712
4815
  children: n ? t : new Date(j.year, j.month, t).getDate()
4713
4816
  }),
4714
- a.map((e) => ee(e)),
4817
+ a.map((e) => V(e)),
4715
4818
  i.length > a.length && /* @__PURE__ */ d("span", {
4716
4819
  style: {
4717
4820
  fontSize: N.font,
@@ -4729,7 +4832,7 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
4729
4832
  ...P(S)
4730
4833
  },
4731
4834
  children: [
4732
- W,
4835
+ re,
4733
4836
  /* @__PURE__ */ f("div", {
4734
4837
  style: {
4735
4838
  display: "grid",
@@ -4743,20 +4846,315 @@ function zn({ events: e = [], source: t = "", titleField: n = "", startField: r
4743
4846
  textAlign: "center",
4744
4847
  padding: `0 0 ${N.pad}px`
4745
4848
  },
4746
- children: se.format(new Date(2024, 0, 7 + re + t))
4747
- }, `head-${t}`)), K]
4849
+ children: le.format(new Date(2024, 0, 7 + ae + t))
4850
+ }, `head-${t}`)), W]
4748
4851
  }),
4749
4852
  /* @__PURE__ */ d("div", { style: { borderTop: `1px solid ${I}` } })
4750
4853
  ]
4751
4854
  });
4752
4855
  }
4753
- var Bn = {
4856
+ var Kn = {
4857
+ small: 36,
4858
+ medium: 56,
4859
+ large: 88
4860
+ };
4861
+ function qn(e, t = {}) {
4862
+ let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : we(e);
4863
+ return n.map((e) => {
4864
+ let n = e.data ?? e, i = X(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(X(n, t.nameField)) : r(n.name);
4865
+ return {
4866
+ src: typeof o == "string" ? o.trim() : "",
4867
+ alt: s,
4868
+ href: t.hrefField ? r(X(n, t.hrefField)) : ""
4869
+ };
4870
+ }).filter((e) => e.src);
4871
+ }
4872
+ function Jn({ logos: e = [], source: t = "", imageField: n = "", nameField: r = "", hrefField: o = "", variant: s = "step", size: p = "medium", perView: m = 5, gap: h = 48, hold: g = 3, slideMs: _ = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
4873
+ let { tenant: D, apiUrl: O } = i(J), k = i(ye)?.[t], [A, j] = l(null), M = c(null), N = c(null), [F, I] = l(0), [L, R] = l(0), [z, B] = l(0), [ee, V] = l(!0), [H, te] = l(!1), [ne, re] = l(!1);
4874
+ a(() => {
4875
+ if (!t || k) return;
4876
+ let e = !0;
4877
+ return fetch(`${O}/dynamic/${encodeURIComponent(t)}`, { headers: D ? { "x-tenant": D } : {} }).then((e) => e.json()).then((t) => {
4878
+ let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
4879
+ e && j(n);
4880
+ }).catch(() => e && j([])), () => {
4881
+ e = !1;
4882
+ };
4883
+ }, [
4884
+ t,
4885
+ D,
4886
+ O,
4887
+ k
4888
+ ]), a(() => {
4889
+ if (typeof window > "u" || !window.matchMedia) return;
4890
+ let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => re(e.matches);
4891
+ return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
4892
+ }, []), a(() => {
4893
+ let e = N.current;
4894
+ if (!e) return;
4895
+ let t = () => I(e.clientWidth);
4896
+ if (t(), typeof ResizeObserver > "u") return;
4897
+ let n = new ResizeObserver(t);
4898
+ return n.observe(e), () => n.disconnect();
4899
+ }, []), a(() => {
4900
+ let e = M.current;
4901
+ if (!e) return;
4902
+ let t = !0, n = () => {
4903
+ let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * U);
4904
+ t && n.length && R(Math.ceil(Math.max(...n)));
4905
+ };
4906
+ n();
4907
+ let r = [...e.querySelectorAll("img")].filter((e) => !e.complete);
4908
+ return r.forEach((e) => e.addEventListener("load", n)), () => {
4909
+ t = !1, r.forEach((e) => e.removeEventListener("load", n));
4910
+ };
4911
+ });
4912
+ let ie = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ae = t ? qn(k ?? A ?? [], {
4913
+ imageField: n,
4914
+ nameField: r,
4915
+ hrefField: o
4916
+ }) : ie, U = Kn[p] ?? Kn.medium, oe = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, se = s === "marquee" ? "step" : s, ce = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), le = Math.min(3e3, Math.max(100, Number(_) || 500)), W = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), G = (L || U * 3) + oe, de = F ? Math.max(1, Math.floor(F / G)) : W, fe = Math.min(W, de), pe = F ? Math.min(G, F / fe) : G;
4917
+ if (!ae.length) return /* @__PURE__ */ d("div", {
4918
+ ref: T,
4919
+ style: {
4920
+ width: "100%",
4921
+ ...P(w)
4922
+ },
4923
+ children: E ? /* @__PURE__ */ d("div", {
4924
+ style: {
4925
+ display: "flex",
4926
+ alignItems: "center",
4927
+ justifyContent: "center",
4928
+ flexWrap: "wrap",
4929
+ gap: oe
4930
+ },
4931
+ children: [
4932
+ 0,
4933
+ 1,
4934
+ 2,
4935
+ 3,
4936
+ 4
4937
+ ].map((e) => /* @__PURE__ */ d("div", {
4938
+ style: {
4939
+ height: U,
4940
+ width: U * 3,
4941
+ border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
4942
+ borderRadius: 6,
4943
+ display: "flex",
4944
+ alignItems: "center",
4945
+ justifyContent: "center",
4946
+ fontSize: Math.max(10, Math.round(U / 4)),
4947
+ opacity: .45,
4948
+ ...ue
4949
+ },
4950
+ children: "LOGO"
4951
+ }, e))
4952
+ }) : C ? /* @__PURE__ */ d("div", {
4953
+ style: {
4954
+ fontSize: 13,
4955
+ opacity: .6,
4956
+ textAlign: "center",
4957
+ padding: 16
4958
+ },
4959
+ children: C
4960
+ }) : null
4961
+ });
4962
+ let me = ae.length, K = se === "step" && me > fe, q = se === "slider", he = K && !E && !H && !ne, ge = v === "right", _e = ge ? me : 0, ve = K ? [...ae, ...ae] : ae, be = K ? z * pe : 0, xe = (e, t, n) => {
4963
+ let r = /* @__PURE__ */ d("img", {
4964
+ src: e.src,
4965
+ alt: e.alt ?? "",
4966
+ style: {
4967
+ height: U,
4968
+ width: "auto",
4969
+ maxWidth: "100%",
4970
+ objectFit: "contain",
4971
+ display: "block"
4972
+ }
4973
+ }), i = K ? {
4974
+ width: pe,
4975
+ flex: "0 0 auto",
4976
+ padding: `0 ${oe / 2}px`,
4977
+ justifyContent: "center"
4978
+ } : {};
4979
+ return e.href && !E ? /* @__PURE__ */ d("a", {
4980
+ href: e.href,
4981
+ className: "wb-logo",
4982
+ title: e.alt || void 0,
4983
+ style: i,
4984
+ ...S === !1 ? {} : {
4985
+ target: "_blank",
4986
+ rel: "noopener noreferrer"
4987
+ },
4988
+ ...n ? {
4989
+ "aria-hidden": "true",
4990
+ tabIndex: -1
4991
+ } : {},
4992
+ children: r
4993
+ }, `${n ? "c" : "o"}-${t}`) : /* @__PURE__ */ d("div", {
4994
+ className: "wb-logo",
4995
+ style: i,
4996
+ ...n ? { "aria-hidden": "true" } : {},
4997
+ children: r
4998
+ }, `${n ? "c" : "o"}-${t}`);
4999
+ }, Se = /* @__PURE__ */ d("div", {
5000
+ ref: M,
5001
+ className: "wb-logos-track",
5002
+ style: {
5003
+ display: "flex",
5004
+ alignItems: "center",
5005
+ ...K ? {
5006
+ width: ve.length * pe,
5007
+ transform: `translateX(-${be}px)`,
5008
+ transition: ee ? `transform ${le}ms ease` : "none"
5009
+ } : q ? {
5010
+ gap: oe,
5011
+ overflowX: "auto",
5012
+ scrollBehavior: "smooth",
5013
+ scrollSnapType: "x proximity"
5014
+ } : {
5015
+ gap: oe,
5016
+ flexWrap: "wrap",
5017
+ justifyContent: "center"
5018
+ }
5019
+ },
5020
+ children: ve.map((e, t) => xe(e, t, K && t >= me))
5021
+ }), Ce = (e) => {
5022
+ if (q) {
5023
+ let t = M.current;
5024
+ t && t.scrollBy({
5025
+ left: e * Math.max(120, t.clientWidth * .8),
5026
+ behavior: "smooth"
5027
+ });
5028
+ return;
5029
+ }
5030
+ let t = z + e;
5031
+ if (t >= 0 && t <= me) {
5032
+ V(!0), B(t);
5033
+ return;
5034
+ }
5035
+ let n = t < 0 ? me : 0;
5036
+ V(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
5037
+ V(!0), B(n + e);
5038
+ }));
5039
+ }, Y = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", X = Y !== "off" && (q ? F > 0 : K), Z = (e) => /* @__PURE__ */ d("button", {
5040
+ type: "button",
5041
+ "aria-label": e < 0 ? "Previous logos" : "Next logos",
5042
+ onClick: () => Ce(e),
5043
+ className: `wb-logos-arrow${Y === "hover" ? " wb-logos-arrow-shy" : ""}`,
5044
+ style: { [e < 0 ? "left" : "right"]: 0 },
5045
+ children: e < 0 ? "‹" : "›"
5046
+ });
5047
+ return /* @__PURE__ */ f("div", {
5048
+ ref: (e) => {
5049
+ N.current = e, T && T(e);
5050
+ },
5051
+ className: "wb-logos",
5052
+ style: {
5053
+ width: "100%",
5054
+ position: "relative",
5055
+ overflow: "hidden",
5056
+ ...P(w)
5057
+ },
5058
+ onMouseEnter: b === !1 ? void 0 : () => te(!0),
5059
+ onMouseLeave: b === !1 ? void 0 : () => te(!1),
5060
+ children: [
5061
+ /* @__PURE__ */ d("style", { children: `
5062
+ .wb-logos .wb-logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; box-sizing: border-box; }
5063
+ .wb-logos .wb-logo img { filter: ${x === !1 ? "none" : "grayscale(1)"}; opacity: ${x === !1 ? 1 : .7}; transition: filter .2s ease, opacity .2s ease; }
5064
+ .wb-logos .wb-logo:hover img { filter: none; opacity: 1; }
5065
+ .wb-logos .wb-logos-track::-webkit-scrollbar { display: none; }
5066
+ .wb-logos .wb-logos-track { scrollbar-width: none; }
5067
+ .wb-logos .wb-logo { scroll-snap-align: start; }
5068
+ /* Shy arrows fade in with the pointer — and with KEYBOARD focus, or they
5069
+ would be unreachable without a mouse. */
5070
+ .wb-logos .wb-logos-arrow-shy { opacity: 0; transition: opacity .18s ease; }
5071
+ .wb-logos:hover .wb-logos-arrow-shy,
5072
+ .wb-logos:focus-within .wb-logos-arrow-shy { opacity: 1; }
5073
+ .wb-logos-arrow {
5074
+ position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
5075
+ width: 30px; height: 30px; border-radius: 999px; cursor: pointer; line-height: 1; font-size: 18px;
5076
+ display: flex; align-items: center; justify-content: center;
5077
+ color: inherit; background: var(--page-surface, #f2f2f2);
5078
+ border: 1px solid var(--page-border, rgba(148, 163, 184, 0.5));
5079
+ }
5080
+ ` }),
5081
+ K ? /* @__PURE__ */ f("div", {
5082
+ style: {
5083
+ position: "relative",
5084
+ width: fe * pe,
5085
+ maxWidth: "100%",
5086
+ margin: "0 auto"
5087
+ },
5088
+ children: [
5089
+ X ? Z(-1) : null,
5090
+ /* @__PURE__ */ d("div", {
5091
+ style: { overflow: "hidden" },
5092
+ children: Se
5093
+ }),
5094
+ X ? Z(1) : null
5095
+ ]
5096
+ }) : /* @__PURE__ */ f(u, { children: [
5097
+ X ? Z(-1) : null,
5098
+ Se,
5099
+ X ? Z(1) : null
5100
+ ] }),
5101
+ /* @__PURE__ */ d(Yn, {
5102
+ running: he,
5103
+ every: ce + le,
5104
+ slide: le,
5105
+ step: ge ? -1 : 1,
5106
+ index: z,
5107
+ total: me,
5108
+ home: _e,
5109
+ setIndex: B,
5110
+ setAnimate: V
5111
+ })
5112
+ ]
5113
+ });
5114
+ }
5115
+ function Yn({ running: e, every: t, slide: n, step: r, index: i, total: o, home: s, setIndex: c, setAnimate: l }) {
5116
+ a(() => {
5117
+ if (!e) return;
5118
+ let n = setInterval(() => {
5119
+ l(!0), c((e) => e + r);
5120
+ }, t);
5121
+ return () => clearInterval(n);
5122
+ }, [
5123
+ e,
5124
+ t,
5125
+ r,
5126
+ c,
5127
+ l
5128
+ ]), a(() => {
5129
+ l(!1), c(s);
5130
+ }, [
5131
+ s,
5132
+ c,
5133
+ l
5134
+ ]);
5135
+ let u = r > 0 ? i >= o : i <= 0;
5136
+ return a(() => {
5137
+ if (!u || i === s) return;
5138
+ let e = setTimeout(() => {
5139
+ l(!1), c(s);
5140
+ }, n);
5141
+ return () => clearTimeout(e);
5142
+ }, [
5143
+ u,
5144
+ i,
5145
+ n,
5146
+ s,
5147
+ c,
5148
+ l
5149
+ ]), null;
5150
+ }
5151
+ var Xn = {
4754
5152
  small: 380,
4755
5153
  medium: 560,
4756
5154
  large: 820,
4757
5155
  full: "100%"
4758
5156
  };
4759
- function Vn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: o = "medium", title: s = "", showClose: u = !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 }) {
5157
+ function Zn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: o = "medium", title: s = "", showClose: u = !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 }) {
4760
5158
  let [C, w] = l(!1), T = c(null);
4761
5159
  a(() => {
4762
5160
  if (S || !e) return;
@@ -4781,7 +5179,7 @@ function Vn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
4781
5179
  document.removeEventListener("keydown", e), document.body.style.overflow = t;
4782
5180
  };
4783
5181
  }, [S, C]);
4784
- let E = Bn[o] ?? Bn.medium, D = (e) => {
5182
+ let E = Xn[o] ?? Xn.medium, D = (e) => {
4785
5183
  let t = {
4786
5184
  padding: "9px 16px",
4787
5185
  borderRadius: 6,
@@ -4950,84 +5348,125 @@ function Vn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
4950
5348
  })]
4951
5349
  });
4952
5350
  }
4953
- var Hn = {
5351
+ var Qn = {
4954
5352
  PageRoot: Me,
4955
- CalendarBlock: zn,
4956
- DialogBlock: Vn,
5353
+ CalendarBlock: Gn,
5354
+ LogoCarousel: Jn,
5355
+ DialogBlock: Zn,
4957
5356
  Section: Ne,
4958
5357
  Container: Pe,
4959
5358
  Heading: Fe,
4960
- TextBlock: qe,
4961
- ButtonBlock: Xe,
4962
- ImageBlock: Ze,
4963
- Spacer: rt,
4964
- Divider: it,
4965
- SliderBlock: ut,
4966
- CanvasSlider: dt,
4967
- TabsBlock: Et,
4968
- QuickStack: Qt,
4969
- CollectionList: $t,
4970
- CollectionSearch: en,
4971
- BreadcrumbsBlock: tn,
4972
- PaginationBlock: nn,
4973
- StepperBlock: hn,
4974
- SocialLinksBlock: mn,
4975
- ThemeModeBlock: cn,
4976
- ScrollTopBlock: fn,
4977
- OrgChartBlock: Tn,
4978
- TableBlock: jn,
4979
- IconBlock: yt,
4980
- MapBlock: _t,
4981
- MasonryBlock: xt,
4982
- AccordionBlock: Dt,
4983
- NavbarBlock: Tt,
4984
- ListBlock: Ke,
5359
+ TextBlock: Xe,
5360
+ ButtonBlock: $e,
5361
+ ImageBlock: et,
5362
+ Spacer: ot,
5363
+ Divider: st,
5364
+ SliderBlock: pt,
5365
+ CanvasSlider: mt,
5366
+ TabsBlock: At,
5367
+ QuickStack: nn,
5368
+ CollectionList: rn,
5369
+ CollectionSearch: an,
5370
+ BreadcrumbsBlock: on,
5371
+ PaginationBlock: sn,
5372
+ StepperBlock: yn,
5373
+ SocialLinksBlock: vn,
5374
+ ThemeModeBlock: fn,
5375
+ ScrollTopBlock: gn,
5376
+ OrgChartBlock: jn,
5377
+ TableBlock: Ln,
5378
+ IconBlock: Ct,
5379
+ MapBlock: xt,
5380
+ MasonryBlock: Tt,
5381
+ AccordionBlock: jt,
5382
+ NavbarBlock: kt,
5383
+ ListBlock: Ye,
4985
5384
  TextSpan: ze,
4986
- QuoteBlock: Ge,
4987
- TextLink: Ye,
4988
- RichTextBlock: Ue,
4989
- RichContentBlock: Ue,
4990
- VideoBlock: Qe,
4991
- YouTubeBlock: et,
4992
- IframeBlock: tt,
4993
- EmbedBlock: nt,
4994
- FormBlock: Bt,
4995
- FormLabel: Gt,
4996
- FormInput: Kt,
4997
- FormTextarea: qt,
4998
- FormCheckbox: (e) => /* @__PURE__ */ d(Jt, {
5385
+ QuoteBlock: Je,
5386
+ TextLink: Qe,
5387
+ RichTextBlock: Ke,
5388
+ RichContentBlock: Ke,
5389
+ VideoBlock: tt,
5390
+ YouTubeBlock: rt,
5391
+ IframeBlock: it,
5392
+ EmbedBlock: at,
5393
+ FormBlock: Wt,
5394
+ FormLabel: Yt,
5395
+ FormInput: Xt,
5396
+ FormTextarea: Zt,
5397
+ FormCheckbox: (e) => /* @__PURE__ */ d(Qt, {
4999
5398
  kind: "checkbox",
5000
5399
  ...e
5001
5400
  }),
5002
- FormRadio: (e) => /* @__PURE__ */ d(Jt, {
5401
+ FormRadio: (e) => /* @__PURE__ */ d(Qt, {
5003
5402
  kind: "radio",
5004
5403
  ...e
5005
5404
  }),
5006
- FormSelect: Yt,
5007
- FormFile: Xt,
5008
- FormRecaptcha: Wt,
5009
- FormSubmit: Zt
5010
- }, Un = {
5405
+ FormSelect: $t,
5406
+ FormFile: en,
5407
+ FormRecaptcha: Jt,
5408
+ FormSubmit: tn
5409
+ }, $n = {
5011
5410
  id: "auth",
5012
5411
  label: "Accounts",
5013
5412
  category: "Apps",
5014
5413
  keys: ["SiteLoginForm", "SiteAccountMenu"],
5015
5414
  ssr: "shell",
5016
5415
  settings: ["site.authRedirect"]
5017
- }, Wn = n({
5416
+ }, er = n({
5018
5417
  user: null,
5019
5418
  status: "idle",
5020
5419
  ensure: () => {},
5021
5420
  refresh: () => {},
5022
5421
  signOut: () => {}
5023
- }), Gn = () => {
5024
- let e = i(Wn);
5422
+ });
5423
+ function tr(e, t) {
5424
+ return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
5425
+ }
5426
+ function nr(e) {
5427
+ let t = e && typeof e == "object" ? e["site.session"] : null, n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (e) => typeof e == "string" ? e.trim() : "", i = r(n.url), a = r(n.mePath), o = r(n.logoutPath);
5428
+ return {
5429
+ mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
5430
+ url: i,
5431
+ mePath: a,
5432
+ logoutPath: o,
5433
+ meUrl: tr(i, a),
5434
+ logoutUrl: tr(i, o),
5435
+ loginPage: r(n.loginPage),
5436
+ userPath: r(n.userPath),
5437
+ auth: n.auth === "bearer" ? "bearer" : "cookies",
5438
+ tokenKey: r(n.tokenKey) || "webim_session_token"
5439
+ };
5440
+ }
5441
+ function rr(e, t) {
5442
+ if (!t) return e ?? null;
5443
+ let n = e;
5444
+ for (let e of t.split(".")) {
5445
+ if (!n || typeof n != "object") return null;
5446
+ n = n[e];
5447
+ }
5448
+ return n ?? null;
5449
+ }
5450
+ function ir(e) {
5451
+ try {
5452
+ return window.localStorage.getItem(e) || "";
5453
+ } catch {
5454
+ return "";
5455
+ }
5456
+ }
5457
+ function ar(e) {
5458
+ try {
5459
+ window.localStorage.removeItem(e);
5460
+ } catch {}
5461
+ }
5462
+ var or = () => {
5463
+ let e = i(er);
5025
5464
  return a(() => {
5026
5465
  e.ensure();
5027
5466
  }, [e]), e;
5028
5467
  };
5029
- function Kn({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
5030
- let f = i(q), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", [h, g] = l(t ?? null), [_, v] = l(t ? "user" : n ? "guest" : "idle"), y = c(!1), b = r((e, t) => fetch(`${p}${e}`, {
5468
+ function sr({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
5469
+ let f = i(J), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", h = s(() => nr(f?.settings), [f?.settings]), [g, _] = l(t ?? null), [v, y] = l(t ? "user" : n ? "guest" : "idle"), b = c(!1), x = r((e, t) => fetch(`${p}${e}`, {
5031
5470
  ...t,
5032
5471
  credentials: "include",
5033
5472
  headers: {
@@ -5035,61 +5474,93 @@ function Kn({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
5035
5474
  ...m ? { "x-tenant": m } : {},
5036
5475
  ...t?.headers
5037
5476
  }
5038
- }), [p, m]), x = r(() => n ? Promise.resolve(null) : b("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
5039
- let t = e?.payload ?? null;
5040
- return g(t), v(t ? "user" : "guest"), t;
5041
- }).catch(() => (g(null), v("guest"), null)), [b, n]), S = r(() => b("/site/logout", { method: "post" }).catch(() => {}).then(() => {
5042
- g(null), v("guest");
5043
- }), [b]), C = r(() => {
5044
- y.current || n || t || (y.current = !0, v("loading"), x());
5477
+ }), [p, m]), S = r((e) => (_(e), y(e ? "user" : "guest"), e), []), C = r(() => {
5478
+ if (n) return Promise.resolve(null);
5479
+ if (h.mode === "off") return Promise.resolve(S(null));
5480
+ if (h.mode === "custom") {
5481
+ let e = h.auth === "bearer" ? ir(h.tokenKey) : "";
5482
+ return !h.meUrl || h.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(h.meUrl, { ...h.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
5483
+ let t = rr(e, h.userPath);
5484
+ return S(t && typeof t == "object" ? t : null);
5485
+ }).catch(() => S(null));
5486
+ }
5487
+ return x("/site/me").then((e) => e.ok ? e.json() : null).then((e) => S(e?.payload ?? null)).catch(() => S(null));
5488
+ }, [
5489
+ x,
5490
+ h,
5491
+ n,
5492
+ S
5493
+ ]), w = r(() => {
5494
+ if (h.mode === "off") return S(null), Promise.resolve();
5495
+ if (h.mode === "custom") {
5496
+ let e = h.auth === "bearer" ? ir(h.tokenKey) : "";
5497
+ return (h.logoutUrl ? fetch(h.logoutUrl, {
5498
+ method: "post",
5499
+ ...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
5500
+ }).catch(() => {}) : Promise.resolve()).then(() => {
5501
+ h.auth === "bearer" && ar(h.tokenKey), S(null);
5502
+ });
5503
+ }
5504
+ return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
5505
+ S(null);
5506
+ });
5507
+ }, [
5508
+ x,
5509
+ h,
5510
+ S
5511
+ ]), T = r(() => {
5512
+ b.current || n || t || (b.current = !0, y("loading"), C());
5045
5513
  }, [
5046
5514
  n,
5047
5515
  t,
5048
- x
5049
- ]), w = s(() => ({
5050
- user: h,
5051
- status: _,
5052
- ensure: C,
5053
- refresh: x,
5054
- signOut: S
5516
+ C
5517
+ ]), E = s(() => ({
5518
+ user: g,
5519
+ status: v,
5520
+ ensure: T,
5521
+ refresh: C,
5522
+ signOut: w
5055
5523
  }), [
5056
- h,
5057
- _,
5524
+ g,
5525
+ v,
5526
+ T,
5058
5527
  C,
5059
- x,
5060
- S
5528
+ w
5061
5529
  ]);
5062
5530
  return a(() => {
5063
5531
  n || typeof window > "u" || (window.webim = {
5064
5532
  ...window.webim,
5065
- user: h,
5066
- status: _,
5067
- requireUser: () => y.current || t ? Promise.resolve(h) : x(),
5068
- signOut: S
5533
+ user: g,
5534
+ status: v,
5535
+ loginUrl: h.loginPage || null,
5536
+ requireUser: () => b.current || t ? Promise.resolve(g) : C(),
5537
+ refresh: C,
5538
+ signOut: w
5069
5539
  }, window.dispatchEvent(new CustomEvent("webim:session", { detail: {
5070
- user: h,
5071
- status: _
5540
+ user: g,
5541
+ status: v
5072
5542
  } })));
5073
5543
  }, [
5074
5544
  n,
5075
- h,
5076
- _,
5545
+ g,
5546
+ v,
5077
5547
  t,
5078
- x,
5079
- S
5080
- ]), /* @__PURE__ */ d(Wn.Provider, {
5081
- value: w,
5548
+ h.loginPage,
5549
+ C,
5550
+ w
5551
+ ]), /* @__PURE__ */ d(er.Provider, {
5552
+ value: E,
5082
5553
  children: e
5083
5554
  });
5084
5555
  }
5085
- function qn({ when: e, children: t }) {
5086
- let { status: n } = Gn();
5556
+ function cr({ when: e, children: t }) {
5557
+ let { status: n } = or();
5087
5558
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
5088
5559
  }
5089
5560
  //#endregion
5090
5561
  //#region ../ui/src/components/builder/apps/auth/views.jsx
5091
- function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
5092
- let { tenant: h, apiUrl: g, settings: _ } = i(q), [v, y] = l("form"), [b, x] = l(""), [S, C] = l(!1), w = e === "register", T = u ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
5562
+ function lr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
5563
+ let { tenant: h, apiUrl: g, settings: _ } = i(J), [v, y] = l("form"), [b, x] = l(""), [S, C] = l(!1), w = e === "register", T = u ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
5093
5564
  if (e.preventDefault(), u) return;
5094
5565
  let n = new FormData(e.currentTarget);
5095
5566
  C(!0), x("");
@@ -5137,20 +5608,20 @@ function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5137
5608
  children: [
5138
5609
  w ? /* @__PURE__ */ f("label", {
5139
5610
  style: {
5140
- ...kt,
5611
+ ...Nt,
5141
5612
  display: "grid",
5142
5613
  gap: 6
5143
5614
  },
5144
5615
  children: [a, /* @__PURE__ */ d("input", {
5145
5616
  name: "name",
5146
5617
  type: "text",
5147
- style: At,
5148
- ...Mt(u)
5618
+ style: Pt,
5619
+ ...It(u)
5149
5620
  })]
5150
5621
  }) : null,
5151
5622
  /* @__PURE__ */ f("label", {
5152
5623
  style: {
5153
- ...kt,
5624
+ ...Nt,
5154
5625
  display: "grid",
5155
5626
  gap: 6
5156
5627
  },
@@ -5158,13 +5629,13 @@ function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5158
5629
  name: "email",
5159
5630
  type: "email",
5160
5631
  required: !u,
5161
- style: At,
5162
- ...Mt(u)
5632
+ style: Pt,
5633
+ ...It(u)
5163
5634
  })]
5164
5635
  }),
5165
5636
  /* @__PURE__ */ f("label", {
5166
5637
  style: {
5167
- ...kt,
5638
+ ...Nt,
5168
5639
  display: "grid",
5169
5640
  gap: 6
5170
5641
  },
@@ -5172,8 +5643,8 @@ function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5172
5643
  name: "password",
5173
5644
  type: "password",
5174
5645
  required: !u,
5175
- style: At,
5176
- ...Mt(u)
5646
+ style: Pt,
5647
+ ...It(u)
5177
5648
  })]
5178
5649
  }),
5179
5650
  /* @__PURE__ */ d("button", {
@@ -5212,8 +5683,8 @@ function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5212
5683
  ]
5213
5684
  });
5214
5685
  }
5215
- function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
5216
- let { user: c, status: l, signOut: u } = Gn(), p = a ? s || "user" : l, m = a ? {
5686
+ function ur({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
5687
+ let { user: c, status: l, signOut: u } = or(), p = a ? s || "user" : l, m = a ? {
5217
5688
  name: "Ada Lovelace",
5218
5689
  email: "ada@example.com"
5219
5690
  } : c;
@@ -5234,7 +5705,7 @@ function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5234
5705
  children: [
5235
5706
  /* @__PURE__ */ f("span", {
5236
5707
  style: {
5237
- ...kt,
5708
+ ...Nt,
5238
5709
  fontWeight: 600
5239
5710
  },
5240
5711
  children: [
@@ -5245,7 +5716,7 @@ function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5245
5716
  }),
5246
5717
  n && m?.email ? /* @__PURE__ */ d("span", {
5247
5718
  style: {
5248
- ...kt,
5719
+ ...Nt,
5249
5720
  opacity: .7
5250
5721
  },
5251
5722
  children: m.email
@@ -5261,7 +5732,7 @@ function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5261
5732
  fontSize: 14,
5262
5733
  cursor: a ? "default" : "pointer"
5263
5734
  },
5264
- ...Mt(a),
5735
+ ...It(a),
5265
5736
  children: t
5266
5737
  })
5267
5738
  ]
@@ -5278,40 +5749,40 @@ function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5278
5749
  }
5279
5750
  //#endregion
5280
5751
  //#region ../ui/src/components/builder/apps/consent/manifest.js
5281
- var Xn = {
5752
+ var dr = {
5282
5753
  id: "consent",
5283
5754
  label: "Cookie consent",
5284
5755
  category: "Apps",
5285
5756
  keys: ["CookieConsent"],
5286
5757
  ssr: "shell",
5287
5758
  settings: []
5288
- }, Zn = "webim.cookie_consent";
5289
- function Qn() {
5759
+ }, fr = "webim.cookie_consent";
5760
+ function pr() {
5290
5761
  try {
5291
- let e = window.localStorage.getItem(Zn), t = e ? JSON.parse(e) : null;
5762
+ let e = window.localStorage.getItem(fr), t = e ? JSON.parse(e) : null;
5292
5763
  return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
5293
5764
  } catch {
5294
5765
  return "";
5295
5766
  }
5296
5767
  }
5297
- function $n(e) {
5768
+ function mr(e) {
5298
5769
  try {
5299
5770
  document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
5300
5771
  } catch {}
5301
5772
  }
5302
- function er(e) {
5773
+ function hr(e) {
5303
5774
  try {
5304
- window.localStorage.setItem(Zn, JSON.stringify({
5775
+ window.localStorage.setItem(fr, JSON.stringify({
5305
5776
  choice: e,
5306
5777
  at: (/* @__PURE__ */ new Date()).toISOString()
5307
5778
  }));
5308
5779
  } catch {}
5309
- $n(e);
5780
+ mr(e);
5310
5781
  try {
5311
5782
  window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
5312
5783
  } catch {}
5313
5784
  }
5314
- var tr = {
5785
+ var gr = {
5315
5786
  bottom: {
5316
5787
  left: 0,
5317
5788
  right: 0,
@@ -5333,18 +5804,18 @@ var tr = {
5333
5804
  maxWidth: 400
5334
5805
  }
5335
5806
  };
5336
- function nr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
5807
+ function _r({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
5337
5808
  let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
5338
5809
  y(e), typeof m == "function" && m(e);
5339
5810
  };
5340
5811
  if (a(() => {
5341
5812
  if (h) return;
5342
- let e = Qn();
5343
- e ? $n(e) : _(!0);
5813
+ let e = pr();
5814
+ e ? mr(e) : _(!0);
5344
5815
  }, [h, v]), !g) return null;
5345
5816
  let x = (e) => () => {
5346
- h || (er(e), _(!1));
5347
- }, S = tr[s] ?? tr.bottom, C = {
5817
+ h || (hr(e), _(!1));
5818
+ }, S = gr[s] ?? gr.bottom, C = {
5348
5819
  appearance: "none",
5349
5820
  font: "inherit",
5350
5821
  fontSize: 14,
@@ -5424,37 +5895,37 @@ function nr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
5424
5895
  }
5425
5896
  //#endregion
5426
5897
  //#region ../ui/src/components/builder/apps/language/manifest.js
5427
- var rr = {
5898
+ var vr = {
5428
5899
  id: "language",
5429
5900
  label: "Language",
5430
5901
  category: "Apps",
5431
5902
  keys: ["SiteLanguagePicker"],
5432
5903
  ssr: "prefetch",
5433
5904
  settings: ["locales"]
5434
- }, ir = {
5905
+ }, yr = {
5435
5906
  id: "search",
5436
5907
  label: "Search",
5437
5908
  category: "Apps",
5438
5909
  keys: ["SiteSearch"],
5439
5910
  ssr: "prefetch",
5440
5911
  settings: []
5441
- }, ar = 50, or = 2e3;
5442
- function sr() {
5912
+ }, br = 50, xr = 2e3;
5913
+ function Sr() {
5443
5914
  return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
5444
5915
  }
5445
- function cr(e, t) {
5916
+ function Cr(e, t) {
5446
5917
  let n = e?.data ?? {}, r = [];
5447
5918
  for (let e of Object.values(n)) {
5448
- let t = e == null ? "" : Y(e);
5449
- if (t && r.push(t), r.join(" ").length > or) break;
5919
+ let t = e == null ? "" : we(e);
5920
+ if (t && r.push(t), r.join(" ").length > xr) break;
5450
5921
  }
5451
- return r.join(" ").slice(0, or).toLocaleLowerCase(t || void 0);
5922
+ return r.join(" ").slice(0, xr).toLocaleLowerCase(t || void 0);
5452
5923
  }
5453
- function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: o = "inline", includePages: s = !0, collections: u = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
5454
- let { tenant: b, apiUrl: x, locale: S } = i(q), [C, w] = l(() => sr()), [T, E] = l(() => sr()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
5924
+ function wr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: o = "inline", includePages: s = !0, collections: u = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
5925
+ let { tenant: b, apiUrl: x, locale: S } = i(J), [C, w] = l(() => Sr()), [T, E] = l(() => Sr()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
5455
5926
  a(() => {
5456
5927
  let e = () => {
5457
- let e = sr();
5928
+ let e = Sr();
5458
5929
  w(e), E(e);
5459
5930
  };
5460
5931
  return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
@@ -5505,8 +5976,8 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
5505
5976
  });
5506
5977
  }
5507
5978
  else for (let t of e.rows) {
5508
- if (!cr(t, S).includes(N)) continue;
5509
- let n = t?.data ?? {}, r = Y(n.name) || "Untitled", i = Y(n.slug);
5979
+ if (!Cr(t, S).includes(N)) continue;
5980
+ let n = t?.data ?? {}, r = we(n.name) || "Untitled", i = we(n.slug);
5510
5981
  F.push({
5511
5982
  key: `entry:${t.id}`,
5512
5983
  title: r,
@@ -5514,7 +5985,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
5514
5985
  kind: "entry"
5515
5986
  });
5516
5987
  }
5517
- let I = F.slice(0, Math.min(Math.max(1, p), ar)), L = (e) => {
5988
+ let I = F.slice(0, Math.min(Math.max(1, p), br)), L = (e) => {
5518
5989
  if (v) {
5519
5990
  e.preventDefault(), w(T), A(!0);
5520
5991
  return;
@@ -5535,7 +6006,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
5535
6006
  title: "Spring collection",
5536
6007
  url: "/blog/spring",
5537
6008
  kind: "entry"
5538
- }] : null, z = R ?? I, B = !R && N && D && !I.length, V = !M || k && (z.length > 0 || B), ee = z.length > 0 && /* @__PURE__ */ d("ul", {
6009
+ }] : null, z = R ?? I, B = !R && N && D && !I.length, ee = !M || k && (z.length > 0 || B), V = z.length > 0 && /* @__PURE__ */ d("ul", {
5539
6010
  style: {
5540
6011
  listStyle: "none",
5541
6012
  margin: 0,
@@ -5596,7 +6067,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
5596
6067
  onChange: (e) => E(e.target.value),
5597
6068
  onFocus: () => N && A(!0),
5598
6069
  style: {
5599
- ...At,
6070
+ ...Pt,
5600
6071
  flexGrow: 1,
5601
6072
  minWidth: 0
5602
6073
  }
@@ -5623,7 +6094,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
5623
6094
  },
5624
6095
  children: h
5625
6096
  }),
5626
- V && /* @__PURE__ */ f("div", {
6097
+ ee && /* @__PURE__ */ f("div", {
5627
6098
  style: M ? {
5628
6099
  position: "absolute",
5629
6100
  top: "100%",
@@ -5639,7 +6110,7 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
5639
6110
  background: "var(--page-surface, #f2f2f2)",
5640
6111
  boxShadow: "0 12px 32px rgba(15, 23, 42, 0.18)"
5641
6112
  } : { marginTop: 14 },
5642
- children: [ee, B && /* @__PURE__ */ d("div", {
6113
+ children: [V, B && /* @__PURE__ */ d("div", {
5643
6114
  style: {
5644
6115
  fontSize: 14,
5645
6116
  opacity: .65,
@@ -5654,21 +6125,21 @@ function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
5654
6125
  }
5655
6126
  //#endregion
5656
6127
  //#region ../ui/src/components/builder/apps/language/views.jsx
5657
- function ur(e) {
6128
+ function Tr(e) {
5658
6129
  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());
5659
6130
  return [...new Set(n.map((e) => e.trim()))];
5660
6131
  }
5661
- var dr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
5662
- function fr(e, t) {
6132
+ var Er = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
6133
+ function Dr(e, t) {
5663
6134
  let n = String(e ?? "").toUpperCase();
5664
6135
  if (t === "code") return n;
5665
6136
  let r = "";
5666
6137
  try {
5667
- r = dr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
6138
+ r = Er(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
5668
6139
  } catch {}
5669
6140
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
5670
6141
  }
5671
- function pr(e, t) {
6142
+ function Or(e, t) {
5672
6143
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
5673
6144
  if (typeof window > "u") return n || "?";
5674
6145
  try {
@@ -5678,8 +6149,8 @@ function pr(e, t) {
5678
6149
  return n || "/";
5679
6150
  }
5680
6151
  }
5681
- function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
5682
- let c = i(q), l = ur(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
6152
+ function kr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
6153
+ let c = i(J), l = Tr(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
5683
6154
  display: "inline-flex",
5684
6155
  alignItems: "center",
5685
6156
  gap: 8,
@@ -5714,7 +6185,7 @@ function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
5714
6185
  style: { opacity: .4 },
5715
6186
  children: n ?? "·"
5716
6187
  }), /* @__PURE__ */ d("a", {
5717
- href: pr(e, e === u),
6188
+ href: Or(e, e === u),
5718
6189
  hrefLang: e,
5719
6190
  "aria-current": e === p ? "true" : void 0,
5720
6191
  onClick: s ? (e) => e.preventDefault() : void 0,
@@ -5724,7 +6195,7 @@ function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
5724
6195
  textDecoration: "none",
5725
6196
  cursor: s ? "default" : "pointer"
5726
6197
  },
5727
- children: fr(e, t)
6198
+ children: Dr(e, t)
5728
6199
  })]
5729
6200
  }, e))]
5730
6201
  }) : /* @__PURE__ */ f("div", {
@@ -5735,7 +6206,7 @@ function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
5735
6206
  value: p,
5736
6207
  onChange: s ? void 0 : (e) => {
5737
6208
  let t = e.target.value;
5738
- window.location.assign(pr(t, t === u));
6209
+ window.location.assign(Or(t, t === u));
5739
6210
  },
5740
6211
  onKeyDown: s ? (e) => e.preventDefault() : void 0,
5741
6212
  style: {
@@ -5749,57 +6220,57 @@ function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
5749
6220
  },
5750
6221
  children: l.map((e) => /* @__PURE__ */ d("option", {
5751
6222
  value: e,
5752
- children: fr(e, t)
6223
+ children: Dr(e, t)
5753
6224
  }, e))
5754
6225
  })]
5755
6226
  });
5756
6227
  }
5757
6228
  //#endregion
5758
6229
  //#region ../ui/src/components/builder/apps/index.js
5759
- var hr = [
5760
- Un,
5761
- rr,
5762
- Xn,
5763
- ir
5764
- ], gr = {
5765
- SiteLoginForm: Jn,
5766
- SiteAccountMenu: Yn,
5767
- SiteLanguagePicker: mr,
5768
- CookieConsent: nr,
5769
- SiteSearch: lr
6230
+ var Ar = [
6231
+ $n,
6232
+ vr,
6233
+ dr,
6234
+ yr
6235
+ ], jr = {
6236
+ SiteLoginForm: lr,
6237
+ SiteAccountMenu: ur,
6238
+ SiteLanguagePicker: kr,
6239
+ CookieConsent: _r,
6240
+ SiteSearch: wr
5770
6241
  };
5771
- new Set(hr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
6242
+ new Set(Ar.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
5772
6243
  //#endregion
5773
6244
  //#region ../ui/src/components/builder/plugins/runtime.js
5774
- var _r = /* @__PURE__ */ new Map();
5775
- function vr(e) {
5776
- if (_r.has(e)) return _r.get(e);
6245
+ var Mr = /* @__PURE__ */ new Map();
6246
+ function Nr(e) {
6247
+ if (Mr.has(e)) return Mr.get(e);
5777
6248
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
5778
6249
  /* @vite-ignore */
5779
6250
  /* webpackIgnore: true */
5780
6251
  t
5781
6252
  ).finally(() => URL.revokeObjectURL(t));
5782
- return _r.set(e, n), n;
6253
+ return Mr.set(e, n), n;
5783
6254
  }
5784
- function yr(e) {
6255
+ function Pr(e) {
5785
6256
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
5786
6257
  return n && typeof n == "object" ? n : {};
5787
6258
  }
5788
6259
  //#endregion
5789
6260
  //#region ../ui/src/components/builder/plugins/view.jsx
5790
- async function br(e, t) {
5791
- let n = await vr(e);
6261
+ async function Fr(e, t) {
6262
+ let n = await Nr(e);
5792
6263
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
5793
6264
  }
5794
- var xr = {
6265
+ var Ir = {
5795
6266
  padding: "10px 12px",
5796
6267
  border: "1px dashed rgba(148, 163, 184, 0.5)",
5797
6268
  borderRadius: 8,
5798
6269
  fontSize: 12,
5799
6270
  opacity: .6
5800
6271
  };
5801
- function Sr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
5802
- let s = i(q), l = yr(s?.settings)[e], u = c(null), p = c(null), m = {
6272
+ function Lr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
6273
+ let s = i(J), l = Pr(s?.settings)[e], u = c(null), p = c(null), m = {
5803
6274
  tenant: s?.tenant ?? "",
5804
6275
  apiUrl: s?.apiUrl ?? "/api",
5805
6276
  locale: s?.locale ?? "",
@@ -5811,7 +6282,7 @@ function Sr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
5811
6282
  let e = u.current;
5812
6283
  if (!l?.code || !e) return;
5813
6284
  let n = !0;
5814
- return br(l.code, t).then((e) => {
6285
+ return Fr(l.code, t).then((e) => {
5815
6286
  if (!(!n || !e || !u.current)) {
5816
6287
  p.current = e;
5817
6288
  try {
@@ -5841,7 +6312,7 @@ function Sr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
5841
6312
  }) : /* @__PURE__ */ f("div", {
5842
6313
  ref: o,
5843
6314
  style: {
5844
- ...xr,
6315
+ ...Ir,
5845
6316
  ...P(r)
5846
6317
  },
5847
6318
  children: [
@@ -5853,12 +6324,12 @@ function Sr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
5853
6324
  }
5854
6325
  //#endregion
5855
6326
  //#region ../ui/src/components/builder/render.jsx
5856
- var Cr = {
5857
- ...Hn,
5858
- ...gr,
5859
- PluginBlock: Sr
6327
+ var Rr = {
6328
+ ...Qn,
6329
+ ...jr,
6330
+ PluginBlock: Lr
5860
6331
  };
5861
- function wr(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
6332
+ function zr(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
5862
6333
  let o = n[e];
5863
6334
  if (!o || o.hidden) return null;
5864
6335
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -5866,29 +6337,29 @@ function wr(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
5866
6337
  let n = o.props?.componentId, s = r?.[n];
5867
6338
  if (!s?.template || i.has(n)) return null;
5868
6339
  let c = new Set(i).add(n);
5869
- return /* @__PURE__ */ d(t, { children: wr(s.template.rootId, s.template.nodes, r, c, a) }, e);
6340
+ return /* @__PURE__ */ d(t, { children: zr(s.template.rootId, s.template.nodes, r, c, a) }, e);
5870
6341
  }
5871
- let l = Cr[s];
6342
+ let l = Rr[s];
5872
6343
  if (!l) return null;
5873
- let u = (o.nodes ?? []).map((e) => wr(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, wr(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
6344
+ let u = (o.nodes ?? []).map((e) => zr(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, zr(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
5874
6345
  ...c,
5875
6346
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
5876
6347
  linked: p,
5877
6348
  nodeRef: (t) => {
5878
- t && (t.setAttribute("data-wb", e), U(t, c), te(t, a?.events === !1 ? [] : c.events));
6349
+ t && (t.setAttribute("data-wb", e), ne(t, c), te(t, a?.events === !1 ? [] : c.events));
5879
6350
  },
5880
6351
  children: u.length ? u : void 0
5881
6352
  }, e);
5882
- return c.when && c.when !== "always" ? /* @__PURE__ */ d(qn, {
6353
+ return c.when && c.when !== "always" ? /* @__PURE__ */ d(cr, {
5883
6354
  when: c.when,
5884
6355
  children: m
5885
6356
  }, e) : m;
5886
6357
  }
5887
6358
  //#endregion
5888
6359
  //#region ../ui/src/components/builder/PageRenderer.jsx
5889
- var Tr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Er = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(me(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
5890
- .webim-page[data-webim-mode="dark"] { ${Object.entries(me(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
5891
- function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, animations: c, tenant: l, apiUrl: u, datasets: p, locale: m, direction: g, settings: _, siteUser: v }) {
6360
+ var Br = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Vr = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(q(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
6361
+ .webim-page[data-webim-mode="dark"] { ${Object.entries(q(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
6362
+ function Hr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, animations: c, tenant: l, apiUrl: u, datasets: p, locale: m, direction: g, settings: _, siteUser: v }) {
5892
6363
  let y = o?.js?.trim();
5893
6364
  if (a(() => {
5894
6365
  if (!y) return;
@@ -5902,19 +6373,19 @@ function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
5902
6373
  minHeight: "100%",
5903
6374
  display: "flex",
5904
6375
  flexDirection: "column"
5905
- }, w = wr("ROOT", e, n), T = s(() => ({ render: (t, r) => wr(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = se(e, n), O = oe(e, n), k = o?.css?.trim(), j = S(c), M = pe(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !ue[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
6376
+ }, w = zr("ROOT", e, n), T = s(() => ({ render: (t, r) => zr(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = le(e, n), O = ce(e, n), k = o?.css?.trim(), j = S(c), M = K(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !fe[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
5906
6377
  rel: "stylesheet",
5907
6378
  precedence: "default",
5908
6379
  href: D(e)
5909
- }, e)), F = Er(M);
5910
- return r === "auto" ? /* @__PURE__ */ d(q.Provider, {
6380
+ }, e)), F = Vr(M);
6381
+ return r === "auto" ? /* @__PURE__ */ d(J.Provider, {
5911
6382
  value: {
5912
6383
  tenant: l || "",
5913
6384
  apiUrl: u || "/api",
5914
6385
  locale: m || "",
5915
6386
  settings: _ ?? null
5916
6387
  },
5917
- children: /* @__PURE__ */ d(Kn, {
6388
+ children: /* @__PURE__ */ d(sr, {
5918
6389
  initialUser: v,
5919
6390
  children: /* @__PURE__ */ d(ye.Provider, {
5920
6391
  value: p ?? null,
@@ -5929,8 +6400,8 @@ function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
5929
6400
  ...i
5930
6401
  },
5931
6402
  children: [
5932
- /* @__PURE__ */ d("style", { children: `.webim-page { ${Tr(me(M.light))} }
5933
- @media (prefers-color-scheme: dark) { .webim-page { ${Tr(me(M.dark))} } }` }),
6403
+ /* @__PURE__ */ d("style", { children: `.webim-page { ${Br(q(M.light))} }
6404
+ @media (prefers-color-scheme: dark) { .webim-page { ${Br(q(M.dark))} } }` }),
5934
6405
  /* @__PURE__ */ d("style", { children: F }),
5935
6406
  P,
5936
6407
  /* @__PURE__ */ d("style", { children: x }),
@@ -5943,14 +6414,14 @@ function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
5943
6414
  })
5944
6415
  })
5945
6416
  })
5946
- }) : /* @__PURE__ */ d(q.Provider, {
6417
+ }) : /* @__PURE__ */ d(J.Provider, {
5947
6418
  value: {
5948
6419
  tenant: l || "",
5949
6420
  apiUrl: u || "/api",
5950
6421
  locale: m || "",
5951
6422
  settings: _ ?? null
5952
6423
  },
5953
- children: /* @__PURE__ */ d(Kn, {
6424
+ children: /* @__PURE__ */ d(sr, {
5954
6425
  initialUser: v,
5955
6426
  children: /* @__PURE__ */ d(ye.Provider, {
5956
6427
  value: p ?? null,
@@ -5983,8 +6454,8 @@ function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
5983
6454
  }
5984
6455
  //#endregion
5985
6456
  //#region src/WebimContent.jsx
5986
- function Or({ bundle: e, mode: t = "auto", style: n }) {
5987
- return e?.blocks?.ROOT ? /* @__PURE__ */ d(Dr, {
6457
+ function Ur({ bundle: e, mode: t = "auto", style: n }) {
6458
+ return e?.blocks?.ROOT ? /* @__PURE__ */ d(Hr, {
5988
6459
  blocks: e.blocks,
5989
6460
  theme: e.theme,
5990
6461
  components: e.components,
@@ -6002,7 +6473,7 @@ function Or({ bundle: e, mode: t = "auto", style: n }) {
6002
6473
  }
6003
6474
  //#endregion
6004
6475
  //#region src/bundle.js
6005
- function kr({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
6476
+ function Wr({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
6006
6477
  let a = {
6007
6478
  ...t?.global ?? {},
6008
6479
  ...t?.tenant ?? {}
@@ -6028,18 +6499,18 @@ function kr({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
6028
6499
  }
6029
6500
  //#endregion
6030
6501
  //#region src/fetchPage.js
6031
- var Ar = async (e) => {
6502
+ var Gr = async (e) => {
6032
6503
  let t = await e.json().catch(() => null);
6033
6504
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
6034
6505
  return t?.payload ?? t;
6035
6506
  };
6036
- async function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
6507
+ async function Kr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
6037
6508
  if (!e) throw Error("fetchPage: apiUrl is required");
6038
6509
  if (!n) throw Error("fetchPage: slug is required");
6039
6510
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
6040
6511
  ...t ? { "x-tenant": t } : {},
6041
6512
  ...a ? { authorization: `Bearer ${a}` } : {}
6042
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Ar), c(`${l}/settings/public`, { headers: u }).then(Ar)]), p = kr({
6513
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Gr), c(`${l}/settings/public`, { headers: u }).then(Gr)]), p = Wr({
6043
6514
  page: d,
6044
6515
  settings: f,
6045
6516
  tenant: t,
@@ -6050,10 +6521,11 @@ async function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
6050
6521
  "OrgChartBlock",
6051
6522
  "NavbarBlock",
6052
6523
  "CalendarBlock",
6053
- "MasonryBlock"
6524
+ "MasonryBlock",
6525
+ "LogoCarousel"
6054
6526
  ].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
6055
6527
  if (m.length) {
6056
- 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(Ar).then((e) => {
6528
+ 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(Gr).then((e) => {
6057
6529
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
6058
6530
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
6059
6531
  }).catch(() => [[t, []]])));
@@ -6067,40 +6539,40 @@ async function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
6067
6539
  }
6068
6540
  //#endregion
6069
6541
  //#region src/ssr.jsx
6070
- var Mr = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
6542
+ var qr = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
6071
6543
  "&": "&amp;",
6072
6544
  "<": "&lt;",
6073
6545
  ">": "&gt;",
6074
6546
  "\"": "&quot;"
6075
6547
  })[e]);
6076
- function Nr(t, { mode: n = "auto", style: r } = {}) {
6077
- return e(/* @__PURE__ */ d(Or, {
6548
+ function Jr(t, { mode: n = "auto", style: r } = {}) {
6549
+ return e(/* @__PURE__ */ d(Ur, {
6078
6550
  bundle: t,
6079
6551
  mode: n,
6080
6552
  style: r
6081
6553
  }));
6082
6554
  }
6083
- function Pr(e, { mode: t = "auto", lang: n } = {}) {
6555
+ function Yr(e, { mode: t = "auto", lang: n } = {}) {
6084
6556
  let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
6085
6557
  "<meta charset=\"utf-8\"/>",
6086
6558
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
6087
- `<title>${Mr(o)}</title>`,
6088
- r.description && `<meta name="description" content="${Mr(r.description)}"/>`,
6089
- `<meta property="og:title" content="${Mr(o)}"/>`,
6090
- r.image && `<meta property="og:image" content="${Mr(r.image)}"/>`,
6559
+ `<title>${qr(o)}</title>`,
6560
+ r.description && `<meta name="description" content="${qr(r.description)}"/>`,
6561
+ `<meta property="og:title" content="${qr(o)}"/>`,
6562
+ r.image && `<meta property="og:image" content="${qr(r.image)}"/>`,
6091
6563
  r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
6092
6564
  "<style>html,body{margin:0;height:100%}</style>"
6093
6565
  ].filter(Boolean).join("\n");
6094
6566
  return `<!doctype html>
6095
- <html lang="${Mr(i)}"${a ? ` dir="${a}"` : ""}>
6567
+ <html lang="${qr(i)}"${a ? ` dir="${a}"` : ""}>
6096
6568
  <head>
6097
6569
  ${c}
6098
6570
  </head>
6099
6571
  <body>
6100
- ${Nr(e, { mode: t })}
6572
+ ${Jr(e, { mode: t })}
6101
6573
  ${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
6102
6574
  </body>
6103
6575
  </html>`;
6104
6576
  }
6105
6577
  //#endregion
6106
- export { kr as assembleBundle, jr as fetchPage, Nr as renderBundleHtml, Pr as renderPageDocument };
6578
+ export { Wr as assembleBundle, Kr as fetchPage, Jr as renderBundleHtml, Yr as renderPageDocument };