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.
- package/build/webim-adapter.js +1190 -718
- package/build/webim-embed.js +32 -13
- package/build/webim-ssr.js +1227 -755
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -258,26 +258,26 @@ function A(e) {
|
|
|
258
258
|
delete t.textStrokeWidth, delete t.textStrokeColor, (W !== void 0 || te !== void 0) && (t.WebkitTextStroke = `${O(W ?? 1)} ${te || "currentColor"}`);
|
|
259
259
|
let { clipText: ne } = t;
|
|
260
260
|
delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
261
|
-
let { transitions:
|
|
261
|
+
let { transitions: G, transitionDuration: K, transitionEasing: q, transitionProperty: re } = t, ie = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
262
262
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
263
|
-
let
|
|
264
|
-
if (
|
|
263
|
+
let ae = (Array.isArray(G) ? G : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ie(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
264
|
+
if (K !== void 0 && ae.push(`${re || "all"} ${ie(K)} ${q || "ease"}`), ae.length && (t.transition = ae.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
265
265
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
266
266
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
267
267
|
}
|
|
268
268
|
delete t.backgroundVideo;
|
|
269
|
-
let { overlayColor:
|
|
270
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
271
|
-
let e = `color-mix(in srgb, ${
|
|
269
|
+
let { overlayColor: J, overlayOpacity: oe } = t;
|
|
270
|
+
if (delete t.overlayColor, delete t.overlayOpacity, J) {
|
|
271
|
+
let e = `color-mix(in srgb, ${J} ${oe ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
272
272
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
273
273
|
}
|
|
274
274
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
275
|
-
let { backgroundLayers:
|
|
275
|
+
let { backgroundLayers: se } = t;
|
|
276
276
|
delete t.backgroundLayers;
|
|
277
|
-
let
|
|
278
|
-
if (
|
|
277
|
+
let ce = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1);
|
|
278
|
+
if (ce.length) {
|
|
279
279
|
let e = [], n = [], r = [], i = [], a = [];
|
|
280
|
-
for (let t of
|
|
280
|
+
for (let t of ce) 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");
|
|
281
281
|
else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
282
282
|
else {
|
|
283
283
|
if (!t.src) continue;
|
|
@@ -397,7 +397,7 @@ function ne(e, t) {
|
|
|
397
397
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
398
398
|
}).filter(Boolean).join("\n");
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function G(e, t) {
|
|
401
401
|
let n = [], r = (e) => {
|
|
402
402
|
for (let [t, r] of Object.entries(e || {})) {
|
|
403
403
|
let e = ne(t, r.props);
|
|
@@ -408,7 +408,7 @@ function re(e, t) {
|
|
|
408
408
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
409
409
|
return n.join("\n");
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function K(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
414
|
let e = ee(t, r.props);
|
|
@@ -419,7 +419,15 @@ function ie(e, t) {
|
|
|
419
419
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
420
420
|
return n.join("\n");
|
|
421
421
|
}
|
|
422
|
-
var
|
|
422
|
+
var q = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", re = {
|
|
423
|
+
fontFamily: q,
|
|
424
|
+
fontStyle: "normal",
|
|
425
|
+
fontWeight: 400,
|
|
426
|
+
letterSpacing: "normal",
|
|
427
|
+
textTransform: "none",
|
|
428
|
+
lineHeight: 1.4,
|
|
429
|
+
textShadow: "none"
|
|
430
|
+
}, ie = {
|
|
423
431
|
light: {
|
|
424
432
|
background: "#f2f2f2",
|
|
425
433
|
surface: "#f2f2f2",
|
|
@@ -460,23 +468,23 @@ var ae = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ar
|
|
|
460
468
|
contrastText: "#052e2b"
|
|
461
469
|
}
|
|
462
470
|
}
|
|
463
|
-
},
|
|
471
|
+
}, ae = {
|
|
464
472
|
font: "system",
|
|
465
473
|
headingFont: "inherit",
|
|
466
|
-
light:
|
|
467
|
-
dark:
|
|
468
|
-
},
|
|
474
|
+
light: ie.light,
|
|
475
|
+
dark: ie.dark
|
|
476
|
+
}, J = {
|
|
469
477
|
system: {
|
|
470
478
|
label: "System",
|
|
471
|
-
value:
|
|
479
|
+
value: q
|
|
472
480
|
},
|
|
473
481
|
inter: {
|
|
474
482
|
label: "Inter",
|
|
475
|
-
value: `"Inter", ${
|
|
483
|
+
value: `"Inter", ${q}`
|
|
476
484
|
},
|
|
477
485
|
outfit: {
|
|
478
486
|
label: "Outfit",
|
|
479
|
-
value: `"Outfit", ${
|
|
487
|
+
value: `"Outfit", ${q}`
|
|
480
488
|
},
|
|
481
489
|
serif: {
|
|
482
490
|
label: "Serif",
|
|
@@ -486,7 +494,7 @@ var ae = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ar
|
|
|
486
494
|
label: "Mono",
|
|
487
495
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
488
496
|
}
|
|
489
|
-
},
|
|
497
|
+
}, oe = (e, t) => J[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), se = (e, ...t) => {
|
|
490
498
|
let n = Object.assign({}, e, ...t);
|
|
491
499
|
return n.primary = {
|
|
492
500
|
...e.primary,
|
|
@@ -502,20 +510,20 @@ var ae = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ar
|
|
|
502
510
|
}), {})
|
|
503
511
|
}, n;
|
|
504
512
|
};
|
|
505
|
-
function
|
|
513
|
+
function ce(e) {
|
|
506
514
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
507
515
|
return {
|
|
508
|
-
font: r ??
|
|
509
|
-
headingFont: i ??
|
|
510
|
-
light:
|
|
511
|
-
dark:
|
|
516
|
+
font: r ?? ae.font,
|
|
517
|
+
headingFont: i ?? ae.headingFont,
|
|
518
|
+
light: se(ie.light, a, t),
|
|
519
|
+
dark: se(ie.dark, n)
|
|
512
520
|
};
|
|
513
521
|
}
|
|
514
|
-
function
|
|
522
|
+
function le(e) {
|
|
515
523
|
return {
|
|
516
524
|
"--page-bg": e.background,
|
|
517
525
|
"--page-surface": e.surface ?? e.background,
|
|
518
|
-
"--page-border": e.border ??
|
|
526
|
+
"--page-border": e.border ?? ie.light.border,
|
|
519
527
|
"--page-text": e.text,
|
|
520
528
|
"--page-accent": e.accent,
|
|
521
529
|
"--page-accent-text": e.accentText,
|
|
@@ -529,31 +537,31 @@ function K(e) {
|
|
|
529
537
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
530
538
|
};
|
|
531
539
|
}
|
|
532
|
-
function
|
|
533
|
-
let t =
|
|
540
|
+
function ue(e) {
|
|
541
|
+
let t = ce(e);
|
|
534
542
|
return {
|
|
535
543
|
backgroundColor: "var(--page-bg)",
|
|
536
544
|
color: "var(--page-text)",
|
|
537
|
-
fontFamily:
|
|
538
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
545
|
+
fontFamily: oe(t.font, q),
|
|
546
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : oe(t.headingFont, "inherit")
|
|
539
547
|
};
|
|
540
548
|
}
|
|
541
|
-
function
|
|
542
|
-
let n =
|
|
549
|
+
function de(e, t = "light") {
|
|
550
|
+
let n = ce(e);
|
|
543
551
|
return {
|
|
544
|
-
...
|
|
545
|
-
...
|
|
552
|
+
...ue(e),
|
|
553
|
+
...le(n[t] ?? n.light)
|
|
546
554
|
};
|
|
547
555
|
}
|
|
548
|
-
function
|
|
556
|
+
function fe(e, t) {
|
|
549
557
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
550
558
|
}
|
|
551
|
-
function
|
|
559
|
+
function pe(e, t) {
|
|
552
560
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
553
561
|
}
|
|
554
562
|
//#endregion
|
|
555
563
|
//#region src/bundle.js
|
|
556
|
-
function
|
|
564
|
+
function me({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
557
565
|
let a = {
|
|
558
566
|
...t?.global ?? {},
|
|
559
567
|
...t?.tenant ?? {}
|
|
@@ -563,7 +571,7 @@ function he({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
563
571
|
title: e.title,
|
|
564
572
|
slug: e.slug,
|
|
565
573
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
566
|
-
theme:
|
|
574
|
+
theme: fe(o, a.builder_themes?.themes),
|
|
567
575
|
components: a.builder_components?.components ?? {},
|
|
568
576
|
custom: o.custom,
|
|
569
577
|
animations: o.animations,
|
|
@@ -579,18 +587,18 @@ function he({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
579
587
|
}
|
|
580
588
|
//#endregion
|
|
581
589
|
//#region src/fetchPage.js
|
|
582
|
-
var
|
|
590
|
+
var he = async (e) => {
|
|
583
591
|
let t = await e.json().catch(() => null);
|
|
584
592
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
585
593
|
return t?.payload ?? t;
|
|
586
594
|
};
|
|
587
|
-
async function
|
|
595
|
+
async function ge({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
588
596
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
589
597
|
if (!n) throw Error("fetchPage: slug is required");
|
|
590
598
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
591
599
|
...t ? { "x-tenant": t } : {},
|
|
592
600
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
593
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
601
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(he), c(`${l}/settings/public`, { headers: u }).then(he)]), p = me({
|
|
594
602
|
page: d,
|
|
595
603
|
settings: f,
|
|
596
604
|
tenant: t,
|
|
@@ -601,10 +609,11 @@ async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
601
609
|
"OrgChartBlock",
|
|
602
610
|
"NavbarBlock",
|
|
603
611
|
"CalendarBlock",
|
|
604
|
-
"MasonryBlock"
|
|
612
|
+
"MasonryBlock",
|
|
613
|
+
"LogoCarousel"
|
|
605
614
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
606
615
|
if (m.length) {
|
|
607
|
-
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(
|
|
616
|
+
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(he).then((e) => {
|
|
608
617
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
609
618
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
610
619
|
}).catch(() => [[t, []]])));
|
|
@@ -618,7 +627,7 @@ async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
618
627
|
}
|
|
619
628
|
//#endregion
|
|
620
629
|
//#region ../ui/src/components/builder/locale.js
|
|
621
|
-
var
|
|
630
|
+
var _e = /* @__PURE__ */ new Set([
|
|
622
631
|
"ar",
|
|
623
632
|
"he",
|
|
624
633
|
"fa",
|
|
@@ -629,34 +638,34 @@ var ve = /* @__PURE__ */ new Set([
|
|
|
629
638
|
"yi",
|
|
630
639
|
"dv",
|
|
631
640
|
"ckb"
|
|
632
|
-
]),
|
|
641
|
+
]), ve = (e) => _e.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", ye = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ve(t) : void 0, Y = t({
|
|
633
642
|
tenant: "",
|
|
634
643
|
apiUrl: "/api",
|
|
635
644
|
locale: "",
|
|
636
645
|
settings: null
|
|
637
|
-
}),
|
|
646
|
+
}), be = t(null), xe = (e) => {
|
|
638
647
|
let t = Number(e?.__page);
|
|
639
648
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
640
649
|
if (typeof window > "u") return 1;
|
|
641
650
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
642
651
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
643
|
-
},
|
|
652
|
+
}, Se = () => {
|
|
644
653
|
if (typeof window > "u") return {};
|
|
645
654
|
let e = {};
|
|
646
655
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
647
656
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
648
657
|
}), e;
|
|
649
|
-
},
|
|
658
|
+
}, X = (e) => {
|
|
650
659
|
let t = {
|
|
651
660
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
652
|
-
...
|
|
661
|
+
...Se()
|
|
653
662
|
};
|
|
654
663
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
655
|
-
},
|
|
656
|
-
function
|
|
664
|
+
}, Z = t(null), Q = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
665
|
+
function Ce(e, t) {
|
|
657
666
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
658
667
|
}
|
|
659
|
-
var
|
|
668
|
+
var we = (e) => {
|
|
660
669
|
let t = [];
|
|
661
670
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
662
671
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -666,13 +675,13 @@ var X = (e) => {
|
|
|
666
675
|
}
|
|
667
676
|
return t;
|
|
668
677
|
};
|
|
669
|
-
function
|
|
678
|
+
function Te(e) {
|
|
670
679
|
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(" ") : "";
|
|
671
680
|
}
|
|
672
681
|
function Ee(e, t) {
|
|
673
|
-
let n = t?.data ?? {}, r =
|
|
682
|
+
let n = t?.data ?? {}, r = we(n);
|
|
674
683
|
if (!r.length) return e;
|
|
675
|
-
let i = RegExp(`:(${r.map(
|
|
684
|
+
let i = RegExp(`:(${r.map(Q).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Te(Ce(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
676
685
|
return a(e);
|
|
677
686
|
}
|
|
678
687
|
var De = {
|
|
@@ -771,7 +780,7 @@ function Le({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a
|
|
|
771
780
|
});
|
|
772
781
|
}
|
|
773
782
|
var Re = {
|
|
774
|
-
fontFamily:
|
|
783
|
+
fontFamily: J.mono.value,
|
|
775
784
|
background: "rgba(148, 163, 184, 0.18)",
|
|
776
785
|
padding: "1px 5px",
|
|
777
786
|
borderRadius: 4,
|
|
@@ -838,8 +847,29 @@ var He = {
|
|
|
838
847
|
h4: 22,
|
|
839
848
|
h5: 19,
|
|
840
849
|
h6: 16
|
|
841
|
-
}
|
|
842
|
-
|
|
850
|
+
}, Ue = [
|
|
851
|
+
"left",
|
|
852
|
+
"center",
|
|
853
|
+
"right",
|
|
854
|
+
"justify"
|
|
855
|
+
];
|
|
856
|
+
function We(e, t, n) {
|
|
857
|
+
let r = e && e.cellStyles;
|
|
858
|
+
if (!r || typeof r != "object" || Array.isArray(r)) return {};
|
|
859
|
+
let i = r[`${t}:${n}`];
|
|
860
|
+
return i && typeof i == "object" && !Array.isArray(i) ? i : {};
|
|
861
|
+
}
|
|
862
|
+
function Ge(e, t) {
|
|
863
|
+
let n = e || {}, r = typeof n.bold == "boolean" ? n.bold : !!t;
|
|
864
|
+
return {
|
|
865
|
+
textAlign: Ue.includes(n.align) ? n.align : "left",
|
|
866
|
+
fontWeight: r ? 700 : 400,
|
|
867
|
+
fontStyle: n.italic ? "italic" : void 0,
|
|
868
|
+
color: typeof n.color == "string" && n.color ? n.color : void 0,
|
|
869
|
+
backgroundColor: typeof n.bg == "string" && n.bg ? n.bg : void 0
|
|
870
|
+
};
|
|
871
|
+
}
|
|
872
|
+
function Ke({ align: e = "center", width: t, wrap: n } = {}) {
|
|
843
873
|
let r = t ? `${t}%` : void 0;
|
|
844
874
|
if (e === "full") return { width: "100%" };
|
|
845
875
|
let i = e === "left" || e === "right";
|
|
@@ -873,7 +903,7 @@ function Ue({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
873
903
|
marginRight: "auto"
|
|
874
904
|
};
|
|
875
905
|
}
|
|
876
|
-
function
|
|
906
|
+
function qe(e = [], t, n) {
|
|
877
907
|
let r = n ?? ((e, n) => Be(e, n, t));
|
|
878
908
|
return e.map((t, n) => {
|
|
879
909
|
let i = {
|
|
@@ -896,7 +926,7 @@ function We(e = [], t, n) {
|
|
|
896
926
|
marginLeft: 0,
|
|
897
927
|
marginRight: 0,
|
|
898
928
|
...i,
|
|
899
|
-
...
|
|
929
|
+
...Ke(t)
|
|
900
930
|
},
|
|
901
931
|
children: [t.href ? /* @__PURE__ */ u("a", {
|
|
902
932
|
href: t.href,
|
|
@@ -915,16 +945,16 @@ function We(e = [], t, n) {
|
|
|
915
945
|
})]
|
|
916
946
|
}, n);
|
|
917
947
|
}
|
|
918
|
-
if (t.type === "video") return
|
|
948
|
+
if (t.type === "video") return it(t.url) ? /* @__PURE__ */ u("div", {
|
|
919
949
|
style: {
|
|
920
950
|
...i,
|
|
921
|
-
...
|
|
951
|
+
...Ke({
|
|
922
952
|
align: t.align,
|
|
923
953
|
wrap: t.wrap,
|
|
924
954
|
width: t.width ?? 100
|
|
925
955
|
})
|
|
926
956
|
},
|
|
927
|
-
children: /* @__PURE__ */ u(
|
|
957
|
+
children: /* @__PURE__ */ u(at, {
|
|
928
958
|
url: t.url,
|
|
929
959
|
autoplay: t.autoplay,
|
|
930
960
|
muted: t.muted,
|
|
@@ -985,9 +1015,11 @@ function We(e = [], t, n) {
|
|
|
985
1015
|
let r = t.header !== !1, a = {
|
|
986
1016
|
border: t.borders === !1 ? void 0 : "1px solid rgba(148, 163, 184, 0.4)",
|
|
987
1017
|
padding: "6px 10px",
|
|
988
|
-
textAlign: "left",
|
|
989
1018
|
verticalAlign: "top"
|
|
990
|
-
}, o = r ? e.slice(1) : e, s = Array.isArray(t.widths) ? t.widths : null
|
|
1019
|
+
}, o = r ? e.slice(1) : e, s = Array.isArray(t.widths) ? t.widths : null, c = (e, n, r) => ({
|
|
1020
|
+
...a,
|
|
1021
|
+
...Ge(We(t, e, n), r)
|
|
1022
|
+
});
|
|
991
1023
|
return /* @__PURE__ */ d("table", {
|
|
992
1024
|
style: {
|
|
993
1025
|
...i,
|
|
@@ -999,16 +1031,13 @@ function We(e = [], t, n) {
|
|
|
999
1031
|
children: [
|
|
1000
1032
|
s && /* @__PURE__ */ u("colgroup", { children: s.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
|
|
1001
1033
|
r && /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e[0].map((e, t) => /* @__PURE__ */ u("th", {
|
|
1002
|
-
style:
|
|
1003
|
-
...a,
|
|
1004
|
-
fontWeight: 700
|
|
1005
|
-
},
|
|
1034
|
+
style: c(0, t, !0),
|
|
1006
1035
|
children: e
|
|
1007
1036
|
}, t)) }) }),
|
|
1008
|
-
/* @__PURE__ */ u("tbody", { children: o.map((e, t) => /* @__PURE__ */ u("tr", { children: e.map((e,
|
|
1009
|
-
style:
|
|
1037
|
+
/* @__PURE__ */ u("tbody", { children: o.map((e, t) => /* @__PURE__ */ u("tr", { children: e.map((e, n) => /* @__PURE__ */ u("td", {
|
|
1038
|
+
style: c(r ? t + 1 : t, n, !1),
|
|
1010
1039
|
children: e
|
|
1011
|
-
},
|
|
1040
|
+
}, n)) }, t)) })
|
|
1012
1041
|
]
|
|
1013
1042
|
}, n);
|
|
1014
1043
|
}
|
|
@@ -1027,7 +1056,7 @@ function We(e = [], t, n) {
|
|
|
1027
1056
|
}
|
|
1028
1057
|
if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
|
|
1029
1058
|
style: {
|
|
1030
|
-
...
|
|
1059
|
+
...Ye,
|
|
1031
1060
|
...i
|
|
1032
1061
|
},
|
|
1033
1062
|
children: r(t.parts, t.text)
|
|
@@ -1052,32 +1081,32 @@ function We(e = [], t, n) {
|
|
|
1052
1081
|
}, n);
|
|
1053
1082
|
});
|
|
1054
1083
|
}
|
|
1055
|
-
function
|
|
1084
|
+
function Je({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
1056
1085
|
return /* @__PURE__ */ u("div", {
|
|
1057
1086
|
ref: r,
|
|
1058
1087
|
style: {
|
|
1059
1088
|
display: "flow-root",
|
|
1060
1089
|
...A(t)
|
|
1061
1090
|
},
|
|
1062
|
-
children:
|
|
1091
|
+
children: qe(e, n)
|
|
1063
1092
|
});
|
|
1064
1093
|
}
|
|
1065
|
-
var
|
|
1094
|
+
var Ye = {
|
|
1066
1095
|
margin: 0,
|
|
1067
1096
|
padding: "8px 0 8px 20px",
|
|
1068
1097
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
1069
1098
|
};
|
|
1070
|
-
function
|
|
1099
|
+
function Xe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1071
1100
|
return /* @__PURE__ */ u("blockquote", {
|
|
1072
1101
|
ref: i,
|
|
1073
1102
|
style: {
|
|
1074
|
-
...
|
|
1103
|
+
...Ye,
|
|
1075
1104
|
...A(n)
|
|
1076
1105
|
},
|
|
1077
1106
|
children: Be(t, e, r)
|
|
1078
1107
|
});
|
|
1079
1108
|
}
|
|
1080
|
-
function
|
|
1109
|
+
function Ze({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
1081
1110
|
return /* @__PURE__ */ u(e ? "ol" : "ul", {
|
|
1082
1111
|
ref: r,
|
|
1083
1112
|
style: {
|
|
@@ -1091,7 +1120,7 @@ function Je({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
1091
1120
|
}, t))
|
|
1092
1121
|
});
|
|
1093
1122
|
}
|
|
1094
|
-
function
|
|
1123
|
+
function Qe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1095
1124
|
return /* @__PURE__ */ u("p", {
|
|
1096
1125
|
ref: i,
|
|
1097
1126
|
style: {
|
|
@@ -1101,26 +1130,26 @@ function Ye({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
|
1101
1130
|
children: Be(t, e, r)
|
|
1102
1131
|
});
|
|
1103
1132
|
}
|
|
1104
|
-
var
|
|
1133
|
+
var $e = {
|
|
1105
1134
|
color: "var(--page-accent, inherit)",
|
|
1106
1135
|
textDecoration: "underline",
|
|
1107
1136
|
textUnderlineOffset: 3,
|
|
1108
1137
|
cursor: "pointer"
|
|
1109
1138
|
};
|
|
1110
|
-
function
|
|
1139
|
+
function et({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1111
1140
|
return /* @__PURE__ */ u("a", {
|
|
1112
1141
|
ref: o,
|
|
1113
1142
|
href: n || "#",
|
|
1114
1143
|
target: r || void 0,
|
|
1115
1144
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1116
1145
|
style: {
|
|
1117
|
-
|
|
1146
|
+
...$e,
|
|
1118
1147
|
...A(i)
|
|
1119
1148
|
},
|
|
1120
1149
|
children: Be(t, e, a)
|
|
1121
1150
|
});
|
|
1122
1151
|
}
|
|
1123
|
-
function
|
|
1152
|
+
function tt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1124
1153
|
return /* @__PURE__ */ u("a", {
|
|
1125
1154
|
ref: o,
|
|
1126
1155
|
href: n || "#",
|
|
@@ -1133,7 +1162,7 @@ function Qe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRe
|
|
|
1133
1162
|
children: Be(t, e, a)
|
|
1134
1163
|
});
|
|
1135
1164
|
}
|
|
1136
|
-
function
|
|
1165
|
+
function nt({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
1137
1166
|
return e ? /* @__PURE__ */ u("img", {
|
|
1138
1167
|
ref: r,
|
|
1139
1168
|
src: e,
|
|
@@ -1145,7 +1174,7 @@ function $e({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
1145
1174
|
}
|
|
1146
1175
|
}) : null;
|
|
1147
1176
|
}
|
|
1148
|
-
function
|
|
1177
|
+
function rt({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
1149
1178
|
return e ? /* @__PURE__ */ u("video", {
|
|
1150
1179
|
ref: s,
|
|
1151
1180
|
src: e,
|
|
@@ -1163,9 +1192,9 @@ function et({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
1163
1192
|
}
|
|
1164
1193
|
}) : null;
|
|
1165
1194
|
}
|
|
1166
|
-
var
|
|
1167
|
-
function
|
|
1168
|
-
let c =
|
|
1195
|
+
var it = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
1196
|
+
function at({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
1197
|
+
let c = it(e);
|
|
1169
1198
|
if (!c) return null;
|
|
1170
1199
|
let l = new URLSearchParams({ rel: "0" });
|
|
1171
1200
|
return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ u("div", {
|
|
@@ -1191,7 +1220,7 @@ function nt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
1191
1220
|
})
|
|
1192
1221
|
});
|
|
1193
1222
|
}
|
|
1194
|
-
function
|
|
1223
|
+
function ot({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
1195
1224
|
return e ? /* @__PURE__ */ u("iframe", {
|
|
1196
1225
|
ref: i,
|
|
1197
1226
|
src: e,
|
|
@@ -1207,7 +1236,7 @@ function rt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
1207
1236
|
}
|
|
1208
1237
|
}) : null;
|
|
1209
1238
|
}
|
|
1210
|
-
function
|
|
1239
|
+
function st({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
1211
1240
|
let [a, o] = c(null);
|
|
1212
1241
|
return i(() => {
|
|
1213
1242
|
a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
|
|
@@ -1226,7 +1255,7 @@ function it({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
1226
1255
|
style: A(n)
|
|
1227
1256
|
});
|
|
1228
1257
|
}
|
|
1229
|
-
function
|
|
1258
|
+
function ct({ height: e, nodeRef: t }) {
|
|
1230
1259
|
return /* @__PURE__ */ u("div", {
|
|
1231
1260
|
ref: t,
|
|
1232
1261
|
style: {
|
|
@@ -1236,7 +1265,7 @@ function at({ height: e, nodeRef: t }) {
|
|
|
1236
1265
|
}
|
|
1237
1266
|
});
|
|
1238
1267
|
}
|
|
1239
|
-
function
|
|
1268
|
+
function lt({ style: e, nodeRef: t }) {
|
|
1240
1269
|
return /* @__PURE__ */ u("div", {
|
|
1241
1270
|
ref: t,
|
|
1242
1271
|
style: {
|
|
@@ -1247,7 +1276,7 @@ function ot({ style: e, nodeRef: t }) {
|
|
|
1247
1276
|
}
|
|
1248
1277
|
});
|
|
1249
1278
|
}
|
|
1250
|
-
var
|
|
1279
|
+
var ut = {
|
|
1251
1280
|
position: "absolute",
|
|
1252
1281
|
top: "50%",
|
|
1253
1282
|
transform: "translateY(-50%)",
|
|
@@ -1264,7 +1293,7 @@ var st = {
|
|
|
1264
1293
|
alignItems: "center",
|
|
1265
1294
|
justifyContent: "center",
|
|
1266
1295
|
padding: 0
|
|
1267
|
-
},
|
|
1296
|
+
}, dt = {
|
|
1268
1297
|
bottom: {
|
|
1269
1298
|
inset: "auto 0 0 0",
|
|
1270
1299
|
padding: "40px 24px 20px",
|
|
@@ -1283,8 +1312,8 @@ var st = {
|
|
|
1283
1312
|
padding: 24,
|
|
1284
1313
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1285
1314
|
}
|
|
1286
|
-
},
|
|
1287
|
-
function
|
|
1315
|
+
}, ft = 48;
|
|
1316
|
+
function pt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
|
|
1288
1317
|
let [p, m] = c(0), [h, g] = c(!1), [_, v] = c(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1289
1318
|
if (i(() => {
|
|
1290
1319
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1300,7 +1329,7 @@ function ut({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1300
1329
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1301
1330
|
if (!_) return;
|
|
1302
1331
|
let { dx: e } = _;
|
|
1303
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1332
|
+
v(null), e < -48 ? b(y + 1) : e > ft && b(y - 1);
|
|
1304
1333
|
};
|
|
1305
1334
|
return /* @__PURE__ */ d("div", {
|
|
1306
1335
|
ref: f,
|
|
@@ -1348,7 +1377,7 @@ function ut({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1348
1377
|
type: "button",
|
|
1349
1378
|
"aria-label": "Previous slide",
|
|
1350
1379
|
style: {
|
|
1351
|
-
...
|
|
1380
|
+
...ut,
|
|
1352
1381
|
left: 12
|
|
1353
1382
|
},
|
|
1354
1383
|
onClick: () => b(y - 1),
|
|
@@ -1358,7 +1387,7 @@ function ut({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1358
1387
|
type: "button",
|
|
1359
1388
|
"aria-label": "Next slide",
|
|
1360
1389
|
style: {
|
|
1361
|
-
...
|
|
1390
|
+
...ut,
|
|
1362
1391
|
right: 12
|
|
1363
1392
|
},
|
|
1364
1393
|
onClick: () => b(y + 1),
|
|
@@ -1392,7 +1421,7 @@ function ut({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1392
1421
|
] })]
|
|
1393
1422
|
});
|
|
1394
1423
|
}
|
|
1395
|
-
var
|
|
1424
|
+
var mt = (e, t) => ({
|
|
1396
1425
|
position: "absolute",
|
|
1397
1426
|
inset: 0,
|
|
1398
1427
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1400,18 +1429,18 @@ var dt = (e, t) => ({
|
|
|
1400
1429
|
backgroundSize: "cover",
|
|
1401
1430
|
backgroundPosition: "center"
|
|
1402
1431
|
});
|
|
1403
|
-
function
|
|
1404
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1432
|
+
function ht({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1433
|
+
return e.length ? /* @__PURE__ */ u(pt, {
|
|
1405
1434
|
...r,
|
|
1406
1435
|
count: e.length,
|
|
1407
1436
|
renderSlide: (r) => {
|
|
1408
1437
|
let i = e[r];
|
|
1409
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1438
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: mt(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
|
|
1410
1439
|
style: {
|
|
1411
1440
|
position: "absolute",
|
|
1412
1441
|
color: "#fff",
|
|
1413
1442
|
textAlign: n,
|
|
1414
|
-
...
|
|
1443
|
+
...dt[t] ?? dt.bottom
|
|
1415
1444
|
},
|
|
1416
1445
|
children: [i.title && /* @__PURE__ */ u("div", {
|
|
1417
1446
|
style: {
|
|
@@ -1431,13 +1460,13 @@ function ft({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1431
1460
|
}
|
|
1432
1461
|
}) : null;
|
|
1433
1462
|
}
|
|
1434
|
-
function
|
|
1435
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1463
|
+
function gt({ slides: e = [], linked: t, ...n }) {
|
|
1464
|
+
return e.length ? /* @__PURE__ */ u(pt, {
|
|
1436
1465
|
...n,
|
|
1437
1466
|
count: e.length,
|
|
1438
1467
|
renderSlide: (n) => {
|
|
1439
1468
|
let r = e[n];
|
|
1440
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1469
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: mt(r.image, r.color) }), /* @__PURE__ */ u("div", {
|
|
1441
1470
|
style: {
|
|
1442
1471
|
position: "absolute",
|
|
1443
1472
|
inset: 0,
|
|
@@ -1449,23 +1478,23 @@ function pt({ slides: e = [], linked: t, ...n }) {
|
|
|
1449
1478
|
}
|
|
1450
1479
|
}) : null;
|
|
1451
1480
|
}
|
|
1452
|
-
var
|
|
1453
|
-
let r =
|
|
1481
|
+
var _t = 256, vt = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), yt = (e, t, n) => {
|
|
1482
|
+
let r = _t * 2 ** n;
|
|
1454
1483
|
return {
|
|
1455
1484
|
x: (Number(t) + 180) / 360 * r,
|
|
1456
|
-
y: (.5 -
|
|
1485
|
+
y: (.5 - vt(Number(e)) / (2 * Math.PI)) * r
|
|
1457
1486
|
};
|
|
1458
1487
|
}, $ = (e, t) => {
|
|
1459
1488
|
if (e === "" || e == null) return null;
|
|
1460
1489
|
let n = Number(e);
|
|
1461
1490
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1462
|
-
},
|
|
1463
|
-
function
|
|
1491
|
+
}, bt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1492
|
+
function xt(e, t, n = "directions", r = "") {
|
|
1464
1493
|
let i = `${e},${t}`;
|
|
1465
1494
|
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)}`;
|
|
1466
1495
|
}
|
|
1467
|
-
var
|
|
1468
|
-
function
|
|
1496
|
+
var St = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1497
|
+
function Ct({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize: o = 22, pinLink: l = "directions", link: f = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
|
|
1469
1498
|
let _ = s(null), [v, y] = c(1200);
|
|
1470
1499
|
i(() => {
|
|
1471
1500
|
let e = _.current;
|
|
@@ -1475,7 +1504,7 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1475
1504
|
let n = new ResizeObserver(t);
|
|
1476
1505
|
return n.observe(e), () => n.disconnect();
|
|
1477
1506
|
}, []);
|
|
1478
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1507
|
+
let b = (Array.isArray(e) ? e : []).filter(bt), x = bt({
|
|
1479
1508
|
lat: t,
|
|
1480
1509
|
lng: n
|
|
1481
1510
|
}) ? {
|
|
@@ -1487,7 +1516,7 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1487
1516
|
} : null, S = Math.max(80, Number(a) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1488
1517
|
if (b.length < 2) return 13;
|
|
1489
1518
|
for (let e = 19; e >= 1; e--) {
|
|
1490
|
-
let t = b.map((t) =>
|
|
1519
|
+
let t = b.map((t) => yt($(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));
|
|
1491
1520
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1492
1521
|
}
|
|
1493
1522
|
return 1;
|
|
@@ -1511,12 +1540,12 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1511
1540
|
},
|
|
1512
1541
|
children: "Set the coordinates in Settings"
|
|
1513
1542
|
});
|
|
1514
|
-
let T =
|
|
1543
|
+
let T = yt(x.lat, x.lng, C), E = {
|
|
1515
1544
|
x: T.x - v / 2,
|
|
1516
1545
|
y: T.y - S / 2
|
|
1517
1546
|
}, D = [], O = [];
|
|
1518
|
-
for (let e = Math.floor(E.x /
|
|
1519
|
-
for (let e = Math.floor(E.y /
|
|
1547
|
+
for (let e = Math.floor(E.x / _t); e <= Math.floor((E.x + v) / _t); e++) D.push(e);
|
|
1548
|
+
for (let e = Math.floor(E.y / _t); e <= Math.floor((E.y + S) / _t); e++) O.push(e);
|
|
1520
1549
|
let k = 2 ** C;
|
|
1521
1550
|
return /* @__PURE__ */ d("div", {
|
|
1522
1551
|
ref: (e) => {
|
|
@@ -1539,22 +1568,22 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1539
1568
|
return e < 0 || e >= k ? null : /* @__PURE__ */ u("img", {
|
|
1540
1569
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1541
1570
|
alt: "",
|
|
1542
|
-
width:
|
|
1543
|
-
height:
|
|
1571
|
+
width: _t,
|
|
1572
|
+
height: _t,
|
|
1544
1573
|
loading: "lazy",
|
|
1545
1574
|
style: {
|
|
1546
1575
|
position: "absolute",
|
|
1547
|
-
left: Math.round(t *
|
|
1548
|
-
top: Math.round(e *
|
|
1549
|
-
width:
|
|
1550
|
-
height:
|
|
1576
|
+
left: Math.round(t * _t - E.x),
|
|
1577
|
+
top: Math.round(e * _t - E.y),
|
|
1578
|
+
width: _t,
|
|
1579
|
+
height: _t,
|
|
1551
1580
|
userSelect: "none",
|
|
1552
1581
|
pointerEvents: "none"
|
|
1553
1582
|
}
|
|
1554
1583
|
}, `${t}-${e}`);
|
|
1555
1584
|
})),
|
|
1556
1585
|
b.map((e, t) => {
|
|
1557
|
-
let n =
|
|
1586
|
+
let n = yt($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", s = l === "none" || g ? null : xt($(e.lat, 90), $(e.lng, 180), l, e.title);
|
|
1558
1587
|
return /* @__PURE__ */ d(s ? "a" : "span", {
|
|
1559
1588
|
href: s || void 0,
|
|
1560
1589
|
target: s ? "_blank" : void 0,
|
|
@@ -1593,8 +1622,8 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1593
1622
|
viewBox: "0 0 24 24",
|
|
1594
1623
|
fill: a,
|
|
1595
1624
|
style: { display: "block" },
|
|
1596
|
-
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
1597
|
-
d:
|
|
1625
|
+
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), wt[e.icon] ? /* @__PURE__ */ u("path", {
|
|
1626
|
+
d: wt[e.icon],
|
|
1598
1627
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1599
1628
|
fill: "none",
|
|
1600
1629
|
stroke: "#fff",
|
|
@@ -1630,7 +1659,7 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1630
1659
|
})
|
|
1631
1660
|
]
|
|
1632
1661
|
}), f ? /* @__PURE__ */ u("a", {
|
|
1633
|
-
href:
|
|
1662
|
+
href: St(x.lat, x.lng, C),
|
|
1634
1663
|
target: "_blank",
|
|
1635
1664
|
rel: "noopener noreferrer",
|
|
1636
1665
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1644,7 +1673,7 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1644
1673
|
}) : null]
|
|
1645
1674
|
});
|
|
1646
1675
|
}
|
|
1647
|
-
var
|
|
1676
|
+
var wt = {
|
|
1648
1677
|
check: "M4 12l5 5L20 6",
|
|
1649
1678
|
close: "M6 6l12 12M18 6L6 18",
|
|
1650
1679
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1741,8 +1770,8 @@ var bt = {
|
|
|
1741
1770
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1742
1771
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1743
1772
|
};
|
|
1744
|
-
function
|
|
1745
|
-
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [
|
|
1773
|
+
function Tt({ 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: d, inert: f }) {
|
|
1774
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [wt[e] ?? wt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
|
|
1746
1775
|
viewBox: "0 0 24 24",
|
|
1747
1776
|
width: g,
|
|
1748
1777
|
height: g,
|
|
@@ -1778,10 +1807,10 @@ function xt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1778
1807
|
children: v
|
|
1779
1808
|
});
|
|
1780
1809
|
}
|
|
1781
|
-
function
|
|
1782
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
1810
|
+
function Et(e, t = {}, n = 0) {
|
|
1811
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Te(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1783
1812
|
for (let e of r) {
|
|
1784
|
-
let n = e.data ?? e, r =
|
|
1813
|
+
let n = e.data ?? e, r = Ce(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(Ce(n, t.nameField)) : i(n.name), l = t.hrefField ? i(Ce(n, t.hrefField)) : "";
|
|
1785
1814
|
for (let e of s) if (o.push({
|
|
1786
1815
|
src: e,
|
|
1787
1816
|
name: c,
|
|
@@ -1791,8 +1820,8 @@ function St(e, t = {}, n = 0) {
|
|
|
1791
1820
|
}
|
|
1792
1821
|
return o;
|
|
1793
1822
|
}
|
|
1794
|
-
function
|
|
1795
|
-
let { tenant: x, apiUrl: S } = r(
|
|
1823
|
+
function Dt({ images: e = [], source: t = "", entry: n = "", imageField: a = "", nameField: o = "", hrefField: s = "", limit: f = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
|
|
1824
|
+
let { tenant: x, apiUrl: S } = r(Y), C = r(be)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
|
|
1796
1825
|
i(() => {
|
|
1797
1826
|
if (!t || C) return;
|
|
1798
1827
|
let e = !0;
|
|
@@ -1809,7 +1838,7 @@ function Ct({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
1809
1838
|
C
|
|
1810
1839
|
]);
|
|
1811
1840
|
let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, j = Math.max(0, Number(f) || 0), M = t ? (() => {
|
|
1812
|
-
let e =
|
|
1841
|
+
let e = Et(k, {
|
|
1813
1842
|
imageField: a,
|
|
1814
1843
|
nameField: o,
|
|
1815
1844
|
hrefField: s
|
|
@@ -2014,20 +2043,20 @@ function Ct({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
2014
2043
|
]
|
|
2015
2044
|
});
|
|
2016
2045
|
}
|
|
2017
|
-
var
|
|
2046
|
+
var Ot = {
|
|
2018
2047
|
color: "inherit",
|
|
2019
2048
|
textDecoration: "none",
|
|
2020
2049
|
fontSize: 14,
|
|
2021
2050
|
opacity: .85
|
|
2022
|
-
},
|
|
2051
|
+
}, kt = {
|
|
2023
2052
|
background: "var(--page-surface, #f2f2f2)",
|
|
2024
2053
|
color: "var(--page-text, #111827)",
|
|
2025
2054
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
2026
2055
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
2027
2056
|
zIndex: 60
|
|
2028
2057
|
};
|
|
2029
|
-
function
|
|
2030
|
-
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 ? "" :
|
|
2058
|
+
function At(e, t = {}, n = "dropdown") {
|
|
2059
|
+
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 ? "" : Te(e), o = r.map((e) => {
|
|
2031
2060
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
2032
2061
|
return {
|
|
2033
2062
|
key: e.id,
|
|
@@ -2068,8 +2097,8 @@ function Et(e, t = {}, n = "dropdown") {
|
|
|
2068
2097
|
type: e.children.length ? n : "link"
|
|
2069
2098
|
}));
|
|
2070
2099
|
}
|
|
2071
|
-
function
|
|
2072
|
-
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(
|
|
2100
|
+
function jt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], style: f, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
|
|
2101
|
+
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(Y), P = r(be)?.[g], [F, I] = c(null);
|
|
2073
2102
|
i(() => {
|
|
2074
2103
|
if (!g || P) return;
|
|
2075
2104
|
let e = !0;
|
|
@@ -2089,7 +2118,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2089
2118
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2090
2119
|
return e.observe(C), () => e.disconnect();
|
|
2091
2120
|
}, [C, h]);
|
|
2092
|
-
let L = g ?
|
|
2121
|
+
let L = g ? At(P ?? F ?? [], {
|
|
2093
2122
|
labelField: _,
|
|
2094
2123
|
hrefField: v,
|
|
2095
2124
|
imageField: y,
|
|
@@ -2118,7 +2147,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2118
2147
|
return /* @__PURE__ */ d("a", {
|
|
2119
2148
|
href: e.href || "#",
|
|
2120
2149
|
style: {
|
|
2121
|
-
...
|
|
2150
|
+
...Ot,
|
|
2122
2151
|
display: n ? "block" : "flex",
|
|
2123
2152
|
alignItems: n ? void 0 : "center",
|
|
2124
2153
|
gap: n ? void 0 : 10,
|
|
@@ -2215,7 +2244,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2215
2244
|
let t = e.children ?? [];
|
|
2216
2245
|
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
2217
2246
|
href: e.href || "#",
|
|
2218
|
-
style:
|
|
2247
|
+
style: Ot,
|
|
2219
2248
|
children: e.label
|
|
2220
2249
|
}, e.key);
|
|
2221
2250
|
let n = e.type === "mega";
|
|
@@ -2229,7 +2258,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2229
2258
|
children: [/* @__PURE__ */ d("a", {
|
|
2230
2259
|
href: e.href || "#",
|
|
2231
2260
|
style: {
|
|
2232
|
-
...
|
|
2261
|
+
...Ot,
|
|
2233
2262
|
cursor: "pointer"
|
|
2234
2263
|
},
|
|
2235
2264
|
children: [
|
|
@@ -2245,7 +2274,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2245
2274
|
]
|
|
2246
2275
|
}), k === e.key && (n ? /* @__PURE__ */ u("div", {
|
|
2247
2276
|
style: {
|
|
2248
|
-
...
|
|
2277
|
+
...kt,
|
|
2249
2278
|
position: "absolute",
|
|
2250
2279
|
left: 0,
|
|
2251
2280
|
right: 0,
|
|
@@ -2261,7 +2290,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2261
2290
|
}, !0))
|
|
2262
2291
|
}) : /* @__PURE__ */ u("div", {
|
|
2263
2292
|
style: {
|
|
2264
|
-
...
|
|
2293
|
+
...kt,
|
|
2265
2294
|
position: "absolute",
|
|
2266
2295
|
top: "100%",
|
|
2267
2296
|
left: 0,
|
|
@@ -2290,7 +2319,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2290
2319
|
children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
2291
2320
|
href: t.href || "#",
|
|
2292
2321
|
style: {
|
|
2293
|
-
...
|
|
2322
|
+
...Ot,
|
|
2294
2323
|
padding: "10px 4px",
|
|
2295
2324
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
2296
2325
|
opacity: 1
|
|
@@ -2301,7 +2330,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2301
2330
|
]
|
|
2302
2331
|
});
|
|
2303
2332
|
}
|
|
2304
|
-
function
|
|
2333
|
+
function Mt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2305
2334
|
let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2306
2335
|
return e.length ? /* @__PURE__ */ d("div", {
|
|
2307
2336
|
ref: r,
|
|
@@ -2341,13 +2370,13 @@ function Ot({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2341
2370
|
}, e.key))]
|
|
2342
2371
|
}) : null;
|
|
2343
2372
|
}
|
|
2344
|
-
function
|
|
2373
|
+
function Nt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: l, openColor: f, borderColor: p, style: m, nodeRef: h }) {
|
|
2345
2374
|
let [g, _] = c(() => new Set(e.length ? [e[0].key] : []));
|
|
2346
2375
|
if (!e.length) return null;
|
|
2347
2376
|
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2348
2377
|
let n = Number(e);
|
|
2349
2378
|
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2350
|
-
}, b =
|
|
2379
|
+
}, b = wt[r], x = (e) => _((t) => {
|
|
2351
2380
|
let r = new Set(n ? t : []);
|
|
2352
2381
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2353
2382
|
});
|
|
@@ -2422,15 +2451,15 @@ function kt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
|
|
|
2422
2451
|
})
|
|
2423
2452
|
});
|
|
2424
2453
|
}
|
|
2425
|
-
var
|
|
2454
|
+
var Pt = {
|
|
2426
2455
|
display: "flex",
|
|
2427
2456
|
flexDirection: "column",
|
|
2428
2457
|
gap: "12px"
|
|
2429
|
-
},
|
|
2458
|
+
}, Ft = {
|
|
2430
2459
|
fontSize: "14px",
|
|
2431
2460
|
fontWeight: 500,
|
|
2432
2461
|
color: "var(--page-text, #111827)"
|
|
2433
|
-
},
|
|
2462
|
+
}, It = {
|
|
2434
2463
|
padding: "10px 12px",
|
|
2435
2464
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2436
2465
|
borderRadius: "6px",
|
|
@@ -2440,18 +2469,18 @@ var At = {
|
|
|
2440
2469
|
boxSizing: "border-box",
|
|
2441
2470
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2442
2471
|
color: "var(--page-text, #111827)"
|
|
2443
|
-
},
|
|
2472
|
+
}, Lt = {
|
|
2444
2473
|
display: "flex",
|
|
2445
2474
|
alignItems: "center",
|
|
2446
2475
|
gap: "8px",
|
|
2447
2476
|
fontSize: "14px",
|
|
2448
2477
|
color: "var(--page-text, #111827)"
|
|
2449
|
-
},
|
|
2478
|
+
}, Rt = (e) => e ? {
|
|
2450
2479
|
readOnly: !0,
|
|
2451
2480
|
tabIndex: -1,
|
|
2452
2481
|
onMouseDown: (e) => e.preventDefault()
|
|
2453
2482
|
} : {};
|
|
2454
|
-
function
|
|
2483
|
+
function zt(e, t) {
|
|
2455
2484
|
if (!e) return !0;
|
|
2456
2485
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2457
2486
|
switch (e.op) {
|
|
@@ -2465,11 +2494,11 @@ function Ft(e, t) {
|
|
|
2465
2494
|
default: return !1;
|
|
2466
2495
|
}
|
|
2467
2496
|
}
|
|
2468
|
-
var
|
|
2497
|
+
var Bt = {
|
|
2469
2498
|
display: "flex",
|
|
2470
2499
|
flexDirection: "column",
|
|
2471
2500
|
gap: 6
|
|
2472
|
-
},
|
|
2501
|
+
}, Vt = {
|
|
2473
2502
|
font: "inherit",
|
|
2474
2503
|
fontSize: 15,
|
|
2475
2504
|
padding: "10px 12px",
|
|
@@ -2480,17 +2509,17 @@ var It = {
|
|
|
2480
2509
|
width: "100%",
|
|
2481
2510
|
boxSizing: "border-box"
|
|
2482
2511
|
};
|
|
2483
|
-
function
|
|
2512
|
+
function Ht(e, t) {
|
|
2484
2513
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2485
2514
|
if (!e?.parentField) return n;
|
|
2486
2515
|
let r = t?.[e.parentField];
|
|
2487
2516
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2488
2517
|
}
|
|
2489
|
-
var
|
|
2490
|
-
function
|
|
2518
|
+
var Ut = "g-recaptcha-response", Wt = (e) => e?.type === "recaptcha" ? Ut : e?.name;
|
|
2519
|
+
function Gt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2491
2520
|
let a = /* @__PURE__ */ d("span", {
|
|
2492
2521
|
style: {
|
|
2493
|
-
...
|
|
2522
|
+
...Ft,
|
|
2494
2523
|
fontSize: 14
|
|
2495
2524
|
},
|
|
2496
2525
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2499,7 +2528,7 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2499
2528
|
required: e.required || void 0,
|
|
2500
2529
|
placeholder: e.placeholder || void 0,
|
|
2501
2530
|
disabled: r || void 0,
|
|
2502
|
-
style:
|
|
2531
|
+
style: Vt,
|
|
2503
2532
|
value: t ?? "",
|
|
2504
2533
|
onChange: (t) => n(e.name, t.target.value)
|
|
2505
2534
|
};
|
|
@@ -2528,12 +2557,12 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2528
2557
|
borderRadius: 8,
|
|
2529
2558
|
display: "block"
|
|
2530
2559
|
}
|
|
2531
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(
|
|
2560
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(Xt, {
|
|
2532
2561
|
theme: e.captchaTheme,
|
|
2533
2562
|
size: e.captchaSize,
|
|
2534
2563
|
inert: r,
|
|
2535
|
-
onChange: (e) => n(
|
|
2536
|
-
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(
|
|
2564
|
+
onChange: (e) => n(Ut, e)
|
|
2565
|
+
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(at, {
|
|
2537
2566
|
url: e.src,
|
|
2538
2567
|
style: { width: "100%" }
|
|
2539
2568
|
}) : /* @__PURE__ */ u("video", {
|
|
@@ -2545,14 +2574,14 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2545
2574
|
display: "block"
|
|
2546
2575
|
}
|
|
2547
2576
|
}) : null : /* @__PURE__ */ d("label", {
|
|
2548
|
-
style:
|
|
2577
|
+
style: Bt,
|
|
2549
2578
|
children: [
|
|
2550
2579
|
a,
|
|
2551
2580
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
|
|
2552
2581
|
...o,
|
|
2553
2582
|
rows: 4,
|
|
2554
2583
|
style: {
|
|
2555
|
-
...
|
|
2584
|
+
...Vt,
|
|
2556
2585
|
resize: "vertical"
|
|
2557
2586
|
}
|
|
2558
2587
|
}) : e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
@@ -2561,7 +2590,7 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2561
2590
|
children: [/* @__PURE__ */ u("option", {
|
|
2562
2591
|
value: "",
|
|
2563
2592
|
children: e.placeholder || "—"
|
|
2564
|
-
}),
|
|
2593
|
+
}), Ht(e, i).map((e, t) => /* @__PURE__ */ u("option", {
|
|
2565
2594
|
value: typeof e == "string" ? e : e.value,
|
|
2566
2595
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2567
2596
|
}, t))]
|
|
@@ -2608,8 +2637,8 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2608
2637
|
]
|
|
2609
2638
|
});
|
|
2610
2639
|
}
|
|
2611
|
-
function
|
|
2612
|
-
let { tenant: y, apiUrl: b } = r(
|
|
2640
|
+
function Kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
2641
|
+
let { tenant: y, apiUrl: b } = r(Y), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
|
|
2613
2642
|
i(() => {
|
|
2614
2643
|
if (!f || !s) return;
|
|
2615
2644
|
let e = !0;
|
|
@@ -2630,11 +2659,11 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2630
2659
|
section: e,
|
|
2631
2660
|
fields: []
|
|
2632
2661
|
}) : j[j.length - 1].fields.push(e);
|
|
2633
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
2662
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || zt(e.section.condition, T)).map((e) => ({
|
|
2634
2663
|
...e,
|
|
2635
|
-
fields: e.fields.filter((e) =>
|
|
2664
|
+
fields: e.fields.filter((e) => zt(e.condition, T))
|
|
2636
2665
|
})), P = M.length > 1, F = Math.min(D, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
2637
|
-
let t = T[
|
|
2666
|
+
let t = T[Wt(e)];
|
|
2638
2667
|
return e.required && (t == null || t === "" || t === !1);
|
|
2639
2668
|
}), R = F >= N.length - 1, z = (e, t) => E((n) => {
|
|
2640
2669
|
let r = {
|
|
@@ -2690,11 +2719,11 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2690
2719
|
}
|
|
2691
2720
|
},
|
|
2692
2721
|
style: {
|
|
2693
|
-
...
|
|
2722
|
+
...Pt,
|
|
2694
2723
|
display: k === "success" ? "none" : "flex"
|
|
2695
2724
|
},
|
|
2696
2725
|
children: f && s ? /* @__PURE__ */ d(l, { children: [
|
|
2697
|
-
P && /* @__PURE__ */ u(
|
|
2726
|
+
P && /* @__PURE__ */ u(xn, {
|
|
2698
2727
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2699
2728
|
active: F + 1,
|
|
2700
2729
|
style: { marginBottom: 8 }
|
|
@@ -2707,9 +2736,9 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2707
2736
|
},
|
|
2708
2737
|
children: N[F].section.help
|
|
2709
2738
|
}),
|
|
2710
|
-
I.map((e) => /* @__PURE__ */ u(
|
|
2739
|
+
I.map((e) => /* @__PURE__ */ u(Gt, {
|
|
2711
2740
|
field: e,
|
|
2712
|
-
value: T[
|
|
2741
|
+
value: T[Wt(e)],
|
|
2713
2742
|
values: T,
|
|
2714
2743
|
onChange: z,
|
|
2715
2744
|
inert: h
|
|
@@ -2780,10 +2809,10 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2780
2809
|
]
|
|
2781
2810
|
});
|
|
2782
2811
|
}
|
|
2783
|
-
var
|
|
2812
|
+
var qt = null, Jt = null, Yt = (e) => {
|
|
2784
2813
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2785
|
-
if (
|
|
2786
|
-
if (
|
|
2814
|
+
if (qt && Jt === t) return qt;
|
|
2815
|
+
if (qt && typeof window < "u") {
|
|
2787
2816
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2788
2817
|
delete window[e];
|
|
2789
2818
|
} catch {
|
|
@@ -2791,22 +2820,22 @@ var Ut = null, Wt = null, Gt = (e) => {
|
|
|
2791
2820
|
}
|
|
2792
2821
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2793
2822
|
}
|
|
2794
|
-
return
|
|
2823
|
+
return Jt = t, qt = new Promise((e) => {
|
|
2795
2824
|
if (typeof window > "u") return;
|
|
2796
2825
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2797
2826
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2798
2827
|
let n = document.createElement("script");
|
|
2799
2828
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2800
|
-
}),
|
|
2829
|
+
}), qt;
|
|
2801
2830
|
};
|
|
2802
|
-
function
|
|
2803
|
-
let p = r(
|
|
2831
|
+
function Xt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
|
|
2832
|
+
let p = r(Y), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
|
|
2804
2833
|
if (_.current = f, i(() => {
|
|
2805
2834
|
if (l || !h || !g.current) return;
|
|
2806
2835
|
let e = !0, r = (t) => {
|
|
2807
2836
|
e && typeof _.current == "function" && _.current(t);
|
|
2808
2837
|
};
|
|
2809
|
-
return
|
|
2838
|
+
return Yt(a).then((i) => {
|
|
2810
2839
|
if (!(!e || !g.current || !i?.render)) {
|
|
2811
2840
|
g.current.innerHTML = "", r("");
|
|
2812
2841
|
try {
|
|
@@ -2888,17 +2917,17 @@ function Kt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2888
2917
|
children: /* @__PURE__ */ u("div", { ref: g })
|
|
2889
2918
|
}) : null;
|
|
2890
2919
|
}
|
|
2891
|
-
function
|
|
2920
|
+
function Zt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2892
2921
|
return /* @__PURE__ */ u("label", {
|
|
2893
2922
|
ref: r,
|
|
2894
2923
|
style: {
|
|
2895
|
-
...
|
|
2924
|
+
...Ft,
|
|
2896
2925
|
...A(n)
|
|
2897
2926
|
},
|
|
2898
2927
|
children: Be(t, e, i)
|
|
2899
2928
|
});
|
|
2900
2929
|
}
|
|
2901
|
-
function
|
|
2930
|
+
function Qt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2902
2931
|
return /* @__PURE__ */ u("input", {
|
|
2903
2932
|
ref: a,
|
|
2904
2933
|
type: e,
|
|
@@ -2906,13 +2935,13 @@ function Jt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2906
2935
|
placeholder: n,
|
|
2907
2936
|
required: !o && !!r,
|
|
2908
2937
|
style: {
|
|
2909
|
-
...
|
|
2938
|
+
...It,
|
|
2910
2939
|
...A(i)
|
|
2911
2940
|
},
|
|
2912
|
-
...
|
|
2941
|
+
...Rt(o)
|
|
2913
2942
|
});
|
|
2914
2943
|
}
|
|
2915
|
-
function
|
|
2944
|
+
function $t({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2916
2945
|
return /* @__PURE__ */ u("textarea", {
|
|
2917
2946
|
ref: a,
|
|
2918
2947
|
name: e || void 0,
|
|
@@ -2920,18 +2949,18 @@ function Yt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2920
2949
|
rows: n,
|
|
2921
2950
|
required: !o && !!r,
|
|
2922
2951
|
style: {
|
|
2923
|
-
...
|
|
2952
|
+
...It,
|
|
2924
2953
|
resize: "vertical",
|
|
2925
2954
|
...A(i)
|
|
2926
2955
|
},
|
|
2927
|
-
...
|
|
2956
|
+
...Rt(o)
|
|
2928
2957
|
});
|
|
2929
2958
|
}
|
|
2930
|
-
function
|
|
2959
|
+
function en({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2931
2960
|
return /* @__PURE__ */ d("label", {
|
|
2932
2961
|
ref: o,
|
|
2933
2962
|
style: {
|
|
2934
|
-
...
|
|
2963
|
+
...Lt,
|
|
2935
2964
|
...A(a)
|
|
2936
2965
|
},
|
|
2937
2966
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -2948,7 +2977,7 @@ function Xt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2948
2977
|
}), t]
|
|
2949
2978
|
});
|
|
2950
2979
|
}
|
|
2951
|
-
function
|
|
2980
|
+
function tn({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2952
2981
|
return /* @__PURE__ */ d("select", {
|
|
2953
2982
|
ref: a,
|
|
2954
2983
|
name: e || void 0,
|
|
@@ -2957,7 +2986,7 @@ function Zt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2957
2986
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2958
2987
|
tabIndex: o ? -1 : void 0,
|
|
2959
2988
|
style: {
|
|
2960
|
-
...
|
|
2989
|
+
...It,
|
|
2961
2990
|
appearance: "auto",
|
|
2962
2991
|
...A(i)
|
|
2963
2992
|
},
|
|
@@ -2971,12 +3000,12 @@ function Zt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2971
3000
|
}, t))]
|
|
2972
3001
|
});
|
|
2973
3002
|
}
|
|
2974
|
-
function
|
|
3003
|
+
function nn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2975
3004
|
let [s, l] = c(null);
|
|
2976
3005
|
return /* @__PURE__ */ d("label", {
|
|
2977
3006
|
ref: a,
|
|
2978
3007
|
style: {
|
|
2979
|
-
...
|
|
3008
|
+
...It,
|
|
2980
3009
|
display: "flex",
|
|
2981
3010
|
alignItems: "center",
|
|
2982
3011
|
gap: "8px",
|
|
@@ -3003,7 +3032,7 @@ function Qt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
3003
3032
|
]
|
|
3004
3033
|
});
|
|
3005
3034
|
}
|
|
3006
|
-
function
|
|
3035
|
+
function rn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
3007
3036
|
return /* @__PURE__ */ u("button", {
|
|
3008
3037
|
ref: n,
|
|
3009
3038
|
type: r ? "button" : "submit",
|
|
@@ -3023,7 +3052,7 @@ function $t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
3023
3052
|
children: e
|
|
3024
3053
|
});
|
|
3025
3054
|
}
|
|
3026
|
-
function
|
|
3055
|
+
function an({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
3027
3056
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
3028
3057
|
return /* @__PURE__ */ u("div", {
|
|
3029
3058
|
ref: r,
|
|
@@ -3040,8 +3069,8 @@ function en({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
3040
3069
|
}, t))
|
|
3041
3070
|
});
|
|
3042
3071
|
}
|
|
3043
|
-
function
|
|
3044
|
-
let { tenant: v, apiUrl: y, locale: b } = r(
|
|
3072
|
+
function on({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
|
|
3073
|
+
let { tenant: v, apiUrl: y, locale: b } = r(Y), x = r(Z), S = r(be), [, C] = c(0);
|
|
3045
3074
|
i(() => {
|
|
3046
3075
|
if (typeof window > "u") return;
|
|
3047
3076
|
let e = () => C((e) => e + 1);
|
|
@@ -3049,7 +3078,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3049
3078
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
3050
3079
|
};
|
|
3051
3080
|
}, []);
|
|
3052
|
-
let w =
|
|
3081
|
+
let w = X(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? xe(S) : 1, [k, j] = c(null);
|
|
3053
3082
|
if (i(() => {
|
|
3054
3083
|
if (!e || D) return;
|
|
3055
3084
|
let n = !0, r = new URLSearchParams();
|
|
@@ -3104,7 +3133,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3104
3133
|
...A(g)
|
|
3105
3134
|
},
|
|
3106
3135
|
children: N.map((e) => {
|
|
3107
|
-
let t = o ?
|
|
3136
|
+
let t = o ? Ce(e?.data, o) : null, r = s ? Te(Ce(e?.data, s)) : null, i = l ? Ce(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : Te(i), f = n === "list";
|
|
3108
3137
|
return /* @__PURE__ */ d("div", {
|
|
3109
3138
|
style: {
|
|
3110
3139
|
display: "flex",
|
|
@@ -3151,7 +3180,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3151
3180
|
lineHeight: 1.55,
|
|
3152
3181
|
opacity: .85
|
|
3153
3182
|
},
|
|
3154
|
-
children:
|
|
3183
|
+
children: qe(a)
|
|
3155
3184
|
})
|
|
3156
3185
|
]
|
|
3157
3186
|
})]
|
|
@@ -3159,8 +3188,8 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3159
3188
|
})
|
|
3160
3189
|
});
|
|
3161
3190
|
}
|
|
3162
|
-
function
|
|
3163
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3191
|
+
function sn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3192
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Se(), s = {
|
|
3164
3193
|
height: 34,
|
|
3165
3194
|
padding: "0 12px",
|
|
3166
3195
|
borderRadius: 8,
|
|
@@ -3208,7 +3237,7 @@ function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3208
3237
|
name: `f_${e.name}`,
|
|
3209
3238
|
defaultValue: o[e.name] ?? "",
|
|
3210
3239
|
style: s,
|
|
3211
|
-
...
|
|
3240
|
+
...Rt(i),
|
|
3212
3241
|
children: [/* @__PURE__ */ u("option", {
|
|
3213
3242
|
value: "",
|
|
3214
3243
|
children: e.label || e.name
|
|
@@ -3223,7 +3252,7 @@ function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3223
3252
|
name: `f_${e.name}`,
|
|
3224
3253
|
defaultValue: o[e.name] ?? "",
|
|
3225
3254
|
style: s,
|
|
3226
|
-
...
|
|
3255
|
+
...Rt(i),
|
|
3227
3256
|
children: [
|
|
3228
3257
|
/* @__PURE__ */ u("option", {
|
|
3229
3258
|
value: "",
|
|
@@ -3244,7 +3273,7 @@ function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3244
3273
|
defaultValue: o[e.name] ?? "",
|
|
3245
3274
|
placeholder: e.label || e.name,
|
|
3246
3275
|
style: s,
|
|
3247
|
-
...
|
|
3276
|
+
...Rt(i)
|
|
3248
3277
|
}, e.name)), /* @__PURE__ */ u("button", {
|
|
3249
3278
|
type: "submit",
|
|
3250
3279
|
style: {
|
|
@@ -3257,12 +3286,12 @@ function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3257
3286
|
fontWeight: 600,
|
|
3258
3287
|
cursor: i ? "default" : "pointer"
|
|
3259
3288
|
},
|
|
3260
|
-
...
|
|
3289
|
+
...Rt(i),
|
|
3261
3290
|
children: t
|
|
3262
3291
|
})]
|
|
3263
3292
|
});
|
|
3264
3293
|
}
|
|
3265
|
-
function
|
|
3294
|
+
function cn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3266
3295
|
return e.length ? /* @__PURE__ */ u("nav", {
|
|
3267
3296
|
ref: r,
|
|
3268
3297
|
"aria-label": "Breadcrumb",
|
|
@@ -3312,8 +3341,8 @@ function rn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3312
3341
|
})
|
|
3313
3342
|
}) : null;
|
|
3314
3343
|
}
|
|
3315
|
-
function
|
|
3316
|
-
let { tenant: g, apiUrl: _ } = r(
|
|
3344
|
+
function ln({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: h }) {
|
|
3345
|
+
let { tenant: g, apiUrl: _ } = r(Y), v = r(be), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3317
3346
|
i(() => {
|
|
3318
3347
|
if (!o || Number.isFinite(x)) return;
|
|
3319
3348
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3332,7 +3361,7 @@ function an({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3332
3361
|
]);
|
|
3333
3362
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
3334
3363
|
if (o && C === null || o && f && !(C > 0)) return null;
|
|
3335
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3364
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? xe(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
3336
3365
|
if (o) {
|
|
3337
3366
|
if (typeof window < "u") {
|
|
3338
3367
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -3397,15 +3426,15 @@ function an({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3397
3426
|
]
|
|
3398
3427
|
});
|
|
3399
3428
|
}
|
|
3400
|
-
var
|
|
3429
|
+
var un = "webim.page_mode", dn = () => {
|
|
3401
3430
|
if (typeof window > "u") return "auto";
|
|
3402
3431
|
try {
|
|
3403
|
-
let e = window.localStorage.getItem(
|
|
3432
|
+
let e = window.localStorage.getItem(un);
|
|
3404
3433
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3405
3434
|
} catch {
|
|
3406
3435
|
return "auto";
|
|
3407
3436
|
}
|
|
3408
|
-
},
|
|
3437
|
+
}, fn = (e) => {
|
|
3409
3438
|
let t = {
|
|
3410
3439
|
width: 16,
|
|
3411
3440
|
height: 16,
|
|
@@ -3437,13 +3466,13 @@ var on = "webim.page_mode", sn = () => {
|
|
|
3437
3466
|
rx: "2"
|
|
3438
3467
|
}), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
|
|
3439
3468
|
});
|
|
3440
|
-
},
|
|
3469
|
+
}, pn = {
|
|
3441
3470
|
light: "Light theme",
|
|
3442
3471
|
dark: "Dark theme",
|
|
3443
3472
|
auto: "Follow the device theme"
|
|
3444
3473
|
};
|
|
3445
|
-
function
|
|
3446
|
-
let [o, l] = c(a ? "auto" :
|
|
3474
|
+
function mn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
3475
|
+
let [o, l] = c(a ? "auto" : dn), d = s(null), f = (e) => {
|
|
3447
3476
|
d.current = e, typeof r == "function" && r(e);
|
|
3448
3477
|
};
|
|
3449
3478
|
i(() => {
|
|
@@ -3451,7 +3480,7 @@ function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3451
3480
|
let e = d.current?.closest?.(".webim-page");
|
|
3452
3481
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3453
3482
|
try {
|
|
3454
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3483
|
+
o === "auto" ? window.localStorage.removeItem(un) : window.localStorage.setItem(un, o);
|
|
3455
3484
|
} catch {}
|
|
3456
3485
|
}, [o, a]);
|
|
3457
3486
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3486,8 +3515,8 @@ function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3486
3515
|
},
|
|
3487
3516
|
children: p.map((e) => /* @__PURE__ */ u("button", {
|
|
3488
3517
|
type: "button",
|
|
3489
|
-
title:
|
|
3490
|
-
"aria-label":
|
|
3518
|
+
title: pn[e],
|
|
3519
|
+
"aria-label": pn[e],
|
|
3491
3520
|
"aria-pressed": e === m,
|
|
3492
3521
|
onClick: a ? void 0 : () => l(e),
|
|
3493
3522
|
style: {
|
|
@@ -3498,15 +3527,15 @@ function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3498
3527
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3499
3528
|
opacity: e === m ? 1 : .7
|
|
3500
3529
|
},
|
|
3501
|
-
children:
|
|
3530
|
+
children: fn(e)
|
|
3502
3531
|
}, e))
|
|
3503
3532
|
});
|
|
3504
3533
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3505
3534
|
return /* @__PURE__ */ u("button", {
|
|
3506
3535
|
ref: f,
|
|
3507
3536
|
type: "button",
|
|
3508
|
-
title:
|
|
3509
|
-
"aria-label": `Theme: ${
|
|
3537
|
+
title: pn[m],
|
|
3538
|
+
"aria-label": `Theme: ${pn[m]} — switch to ${pn[g]}`,
|
|
3510
3539
|
onClick: a ? void 0 : () => l(g),
|
|
3511
3540
|
style: {
|
|
3512
3541
|
...h,
|
|
@@ -3515,10 +3544,10 @@ function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3515
3544
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3516
3545
|
...A(n)
|
|
3517
3546
|
},
|
|
3518
|
-
children:
|
|
3547
|
+
children: fn(m)
|
|
3519
3548
|
});
|
|
3520
3549
|
}
|
|
3521
|
-
function
|
|
3550
|
+
function hn(e) {
|
|
3522
3551
|
let t = e?.parentElement;
|
|
3523
3552
|
for (; t && t !== document.body;) {
|
|
3524
3553
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3527,7 +3556,7 @@ function dn(e) {
|
|
|
3527
3556
|
}
|
|
3528
3557
|
return window;
|
|
3529
3558
|
}
|
|
3530
|
-
var
|
|
3559
|
+
var gn = (e) => e === window ? window.scrollY : e.scrollTop, _n = {
|
|
3531
3560
|
"bottom-right": (e) => ({
|
|
3532
3561
|
right: e,
|
|
3533
3562
|
bottom: e
|
|
@@ -3542,7 +3571,7 @@ var fn = (e) => e === window ? window.scrollY : e.scrollTop, pn = {
|
|
|
3542
3571
|
transform: "translateX(-50%)"
|
|
3543
3572
|
})
|
|
3544
3573
|
};
|
|
3545
|
-
function
|
|
3574
|
+
function vn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
|
|
3546
3575
|
let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
|
|
3547
3576
|
b(e), typeof p == "function" && p(e);
|
|
3548
3577
|
};
|
|
@@ -3553,8 +3582,8 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3553
3582
|
}
|
|
3554
3583
|
if (!y) return;
|
|
3555
3584
|
let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
|
|
3556
|
-
let t =
|
|
3557
|
-
v(n ||
|
|
3585
|
+
let t = hn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
3586
|
+
v(n || gn(t) > e);
|
|
3558
3587
|
};
|
|
3559
3588
|
return t(), document.addEventListener("scroll", t, {
|
|
3560
3589
|
capture: !0,
|
|
@@ -3568,7 +3597,7 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3568
3597
|
]);
|
|
3569
3598
|
let S = () => {
|
|
3570
3599
|
if (m) return;
|
|
3571
|
-
let e =
|
|
3600
|
+
let e = hn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3572
3601
|
e === window ? window.scrollTo({
|
|
3573
3602
|
top: 0,
|
|
3574
3603
|
behavior: n
|
|
@@ -3576,7 +3605,7 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3576
3605
|
top: 0,
|
|
3577
3606
|
behavior: n
|
|
3578
3607
|
});
|
|
3579
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
3608
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = _n[n] ? n : "bottom-right", D = h ? {
|
|
3580
3609
|
position: "fixed",
|
|
3581
3610
|
zIndex: 5,
|
|
3582
3611
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3589,7 +3618,7 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3589
3618
|
} : {
|
|
3590
3619
|
position: "fixed",
|
|
3591
3620
|
zIndex: 2147482e3,
|
|
3592
|
-
...
|
|
3621
|
+
..._n[E](C)
|
|
3593
3622
|
};
|
|
3594
3623
|
return /* @__PURE__ */ d("button", {
|
|
3595
3624
|
ref: x,
|
|
@@ -3640,7 +3669,7 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3640
3669
|
}), w ? /* @__PURE__ */ u("span", { children: T }) : null]
|
|
3641
3670
|
});
|
|
3642
3671
|
}
|
|
3643
|
-
var
|
|
3672
|
+
var yn = {
|
|
3644
3673
|
facebook: {
|
|
3645
3674
|
label: "Facebook",
|
|
3646
3675
|
color: "#1877f2",
|
|
@@ -3707,8 +3736,8 @@ var hn = {
|
|
|
3707
3736
|
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"
|
|
3708
3737
|
}
|
|
3709
3738
|
};
|
|
3710
|
-
function
|
|
3711
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
3739
|
+
function bn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
3740
|
+
let l = Array.isArray(e) ? e.filter((e) => e && yn[e.network]) : [];
|
|
3712
3741
|
if (!l.length) return null;
|
|
3713
3742
|
let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
|
|
3714
3743
|
return /* @__PURE__ */ u("div", {
|
|
@@ -3721,7 +3750,7 @@ function gn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3721
3750
|
...A(o)
|
|
3722
3751
|
},
|
|
3723
3752
|
children: l.map((e, r) => {
|
|
3724
|
-
let i =
|
|
3753
|
+
let i = yn[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);
|
|
3725
3754
|
return /* @__PURE__ */ u("a", {
|
|
3726
3755
|
href: e.url || "#",
|
|
3727
3756
|
onClick: h,
|
|
@@ -3755,7 +3784,7 @@ function gn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3755
3784
|
})
|
|
3756
3785
|
});
|
|
3757
3786
|
}
|
|
3758
|
-
function
|
|
3787
|
+
function xn({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3759
3788
|
if (!t.length) return null;
|
|
3760
3789
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
3761
3790
|
width: 32,
|
|
@@ -3833,7 +3862,7 @@ function _n({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3833
3862
|
})
|
|
3834
3863
|
});
|
|
3835
3864
|
}
|
|
3836
|
-
var
|
|
3865
|
+
var Sn = {
|
|
3837
3866
|
small: {
|
|
3838
3867
|
w: 132,
|
|
3839
3868
|
h: 46,
|
|
@@ -3855,74 +3884,123 @@ var vn = {
|
|
|
3855
3884
|
title: 12.5,
|
|
3856
3885
|
avatar: 46
|
|
3857
3886
|
}
|
|
3858
|
-
},
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
let
|
|
3862
|
-
|
|
3863
|
-
|
|
3887
|
+
}, Cn = (e) => Sn[e] ?? Sn.medium;
|
|
3888
|
+
Sn.medium.w, Sn.medium.h;
|
|
3889
|
+
var wn = (e) => String(e?.group ?? "").trim(), Tn = (e) => {
|
|
3890
|
+
let t = [], n = /* @__PURE__ */ new Map();
|
|
3891
|
+
return e.forEach((e, r) => {
|
|
3892
|
+
let i = wn(e) || `#${r}`;
|
|
3893
|
+
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
3894
|
+
}), t.flatMap((e) => n.get(e));
|
|
3895
|
+
};
|
|
3896
|
+
function En(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
3897
|
+
let i = Cn(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 = [];
|
|
3898
|
+
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);
|
|
3899
|
+
d = Tn(d);
|
|
3900
|
+
for (let [e, t] of u) u.set(e, Tn(t));
|
|
3901
|
+
let f = (e, t) => o + (wn(e) !== wn(t) && (wn(e) || wn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
3864
3902
|
if (t.has(e.id)) return 0;
|
|
3865
3903
|
t.add(e.id);
|
|
3866
|
-
let n =
|
|
3867
|
-
return
|
|
3904
|
+
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);
|
|
3905
|
+
return p.set(e.id, i), i;
|
|
3868
3906
|
};
|
|
3869
|
-
|
|
3870
|
-
let
|
|
3871
|
-
if (
|
|
3872
|
-
|
|
3873
|
-
let
|
|
3874
|
-
|
|
3907
|
+
d.forEach((e) => m(e, /* @__PURE__ */ new Set()));
|
|
3908
|
+
let h = [], g = [], _ = /* @__PURE__ */ new Map(), v = 0, y = (e, t, r, o) => {
|
|
3909
|
+
if (o.has(e.id)) return;
|
|
3910
|
+
o.add(e.id);
|
|
3911
|
+
let c = t + ((p.get(e.id) ?? a) - a) / 2, d = r * s, m = n ? d : c, b = n ? c : d;
|
|
3912
|
+
h.push({
|
|
3875
3913
|
node: e,
|
|
3876
|
-
x:
|
|
3877
|
-
y:
|
|
3878
|
-
})
|
|
3879
|
-
let
|
|
3880
|
-
|
|
3881
|
-
let
|
|
3882
|
-
|
|
3914
|
+
x: m,
|
|
3915
|
+
y: b
|
|
3916
|
+
});
|
|
3917
|
+
let x = wn(e);
|
|
3918
|
+
if (x) {
|
|
3919
|
+
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
3920
|
+
_.has(t) || _.set(t, {
|
|
3921
|
+
title: x,
|
|
3922
|
+
color: "",
|
|
3923
|
+
members: []
|
|
3924
|
+
});
|
|
3925
|
+
let n = _.get(t);
|
|
3926
|
+
!n.color && e.groupColor && (n.color = e.groupColor), n.members.push({
|
|
3927
|
+
x: m,
|
|
3928
|
+
y: b
|
|
3929
|
+
});
|
|
3930
|
+
}
|
|
3931
|
+
v = Math.max(v, d + (n ? i.w : i.h));
|
|
3932
|
+
let S = t, C = u.get(e.id) ?? [];
|
|
3933
|
+
C.forEach((e, t) => {
|
|
3934
|
+
t && (S += f(C[t - 1], e));
|
|
3935
|
+
let l = S + ((p.get(e.id) ?? a) - a) / 2 + a / 2, u = (r + 1) * s;
|
|
3936
|
+
g.push(n ? {
|
|
3883
3937
|
from: {
|
|
3884
|
-
x:
|
|
3885
|
-
y:
|
|
3938
|
+
x: d + i.w,
|
|
3939
|
+
y: c + i.h / 2
|
|
3886
3940
|
},
|
|
3887
3941
|
to: {
|
|
3888
|
-
x:
|
|
3889
|
-
y:
|
|
3942
|
+
x: u,
|
|
3943
|
+
y: l
|
|
3890
3944
|
}
|
|
3891
3945
|
} : {
|
|
3892
3946
|
from: {
|
|
3893
|
-
x:
|
|
3894
|
-
y:
|
|
3947
|
+
x: c + i.w / 2,
|
|
3948
|
+
y: d + i.h
|
|
3895
3949
|
},
|
|
3896
3950
|
to: {
|
|
3897
|
-
x:
|
|
3898
|
-
y:
|
|
3951
|
+
x: l,
|
|
3952
|
+
y: u
|
|
3899
3953
|
}
|
|
3900
|
-
}),
|
|
3901
|
-
}
|
|
3902
|
-
},
|
|
3903
|
-
|
|
3904
|
-
|
|
3954
|
+
}), y(e, S, r + 1, o), S += p.get(e.id) ?? a;
|
|
3955
|
+
});
|
|
3956
|
+
}, b = 0, x = /* @__PURE__ */ new Set();
|
|
3957
|
+
d.forEach((e, t) => {
|
|
3958
|
+
t && (b += f(d[t - 1], e)), y(e, b, 0, x), b += p.get(e.id) ?? a;
|
|
3959
|
+
});
|
|
3960
|
+
let S = Math.max(b, a), C = r === "hidden" ? 0 : 22, w = [..._.values()].map((e) => {
|
|
3961
|
+
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);
|
|
3962
|
+
return {
|
|
3963
|
+
x: t,
|
|
3964
|
+
y: a,
|
|
3965
|
+
width: n - t,
|
|
3966
|
+
height: o - a,
|
|
3967
|
+
title: e.title,
|
|
3968
|
+
color: e.color
|
|
3969
|
+
};
|
|
3970
|
+
}), 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));
|
|
3971
|
+
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)) {
|
|
3972
|
+
for (let e of h) e.x += D, e.y += O;
|
|
3973
|
+
for (let e of g) e.from = {
|
|
3974
|
+
x: e.from.x + D,
|
|
3975
|
+
y: e.from.y + O
|
|
3976
|
+
}, e.to = {
|
|
3977
|
+
x: e.to.x + D,
|
|
3978
|
+
y: e.to.y + O
|
|
3979
|
+
};
|
|
3980
|
+
for (let e of w) e.x += D, e.y += O;
|
|
3981
|
+
}
|
|
3905
3982
|
return {
|
|
3906
|
-
boxes:
|
|
3907
|
-
links:
|
|
3908
|
-
|
|
3909
|
-
|
|
3983
|
+
boxes: h,
|
|
3984
|
+
links: g,
|
|
3985
|
+
groups: w,
|
|
3986
|
+
width: T,
|
|
3987
|
+
height: E,
|
|
3910
3988
|
horizontal: n
|
|
3911
3989
|
};
|
|
3912
3990
|
}
|
|
3913
|
-
var
|
|
3991
|
+
var Dn = (e, t) => {
|
|
3914
3992
|
let n = String(e ?? "");
|
|
3915
3993
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3916
|
-
},
|
|
3994
|
+
}, On = (e) => {
|
|
3917
3995
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3918
3996
|
if (!t) return "#ffffff";
|
|
3919
3997
|
let n = t[1];
|
|
3920
3998
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3921
3999
|
let r = parseInt(n, 16);
|
|
3922
4000
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3923
|
-
},
|
|
3924
|
-
function
|
|
3925
|
-
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 ? "" :
|
|
4001
|
+
}, kn = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
4002
|
+
function An(e, t = {}) {
|
|
4003
|
+
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 ? "" : Te(e);
|
|
3926
4004
|
return n.map((e) => {
|
|
3927
4005
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3928
4006
|
return {
|
|
@@ -3932,15 +4010,16 @@ function wn(e, t = {}) {
|
|
|
3932
4010
|
photo: t.photoField && r(n[t.photoField]) || "",
|
|
3933
4011
|
parent: t.parentField ? o : null,
|
|
3934
4012
|
cv: t.cvField ? i(n[t.cvField]) : "",
|
|
3935
|
-
href: t.hrefField ? i(n[t.hrefField]) : ""
|
|
4013
|
+
href: t.hrefField ? i(n[t.hrefField]) : "",
|
|
4014
|
+
group: t.groupField ? i(n[t.groupField]) : ""
|
|
3936
4015
|
};
|
|
3937
4016
|
});
|
|
3938
4017
|
}
|
|
3939
|
-
var
|
|
4018
|
+
var jn = {
|
|
3940
4019
|
size: 36,
|
|
3941
4020
|
pad: 10
|
|
3942
4021
|
};
|
|
3943
|
-
function
|
|
4022
|
+
function Mn({ node: e, onClose: t }) {
|
|
3944
4023
|
return i(() => {
|
|
3945
4024
|
let e = (e) => e.key === "Escape" && t();
|
|
3946
4025
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -4061,36 +4140,38 @@ function En({ node: e, onClose: t }) {
|
|
|
4061
4140
|
})
|
|
4062
4141
|
});
|
|
4063
4142
|
}
|
|
4064
|
-
function
|
|
4065
|
-
let
|
|
4143
|
+
function Nn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
|
|
4144
|
+
let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(Y), O = r(be)?.[t], [k, j] = c(null);
|
|
4066
4145
|
i(() => {
|
|
4067
|
-
if (!t ||
|
|
4146
|
+
if (!t || O) return;
|
|
4068
4147
|
let e = !0;
|
|
4069
|
-
return fetch(`${
|
|
4148
|
+
return fetch(`${D}/dynamic/${encodeURIComponent(t)}`, { headers: E ? { "x-tenant": E } : {} }).then((e) => e.json()).then((t) => {
|
|
4070
4149
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4071
|
-
e &&
|
|
4072
|
-
}).catch(() => e &&
|
|
4150
|
+
e && j(n);
|
|
4151
|
+
}).catch(() => e && j([])), () => {
|
|
4073
4152
|
e = !1;
|
|
4074
4153
|
};
|
|
4075
4154
|
}, [
|
|
4076
4155
|
t,
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4156
|
+
E,
|
|
4157
|
+
D,
|
|
4158
|
+
O
|
|
4080
4159
|
]);
|
|
4081
|
-
let
|
|
4160
|
+
let M = t ? An(O ?? k ?? [], {
|
|
4082
4161
|
nameField: n,
|
|
4083
4162
|
titleField: o,
|
|
4084
4163
|
photoField: s,
|
|
4085
4164
|
parentField: f,
|
|
4086
4165
|
cvField: p,
|
|
4087
|
-
hrefField: m
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4166
|
+
hrefField: m,
|
|
4167
|
+
groupField: h
|
|
4168
|
+
}) : e, N = Cn(v), { boxes: P, links: F, groups: I, width: L, height: R } = En(M, {
|
|
4169
|
+
size: v,
|
|
4170
|
+
horizontal: y,
|
|
4171
|
+
groupTitles: g
|
|
4091
4172
|
});
|
|
4092
|
-
if (!
|
|
4093
|
-
ref:
|
|
4173
|
+
if (!P.length) return !S && t ? /* @__PURE__ */ d("div", {
|
|
4174
|
+
ref: x,
|
|
4094
4175
|
style: {
|
|
4095
4176
|
padding: 18,
|
|
4096
4177
|
border: "1px dashed rgba(148, 163, 184, 0.6)",
|
|
@@ -4098,7 +4179,7 @@ function Dn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4098
4179
|
fontSize: 13,
|
|
4099
4180
|
opacity: .7,
|
|
4100
4181
|
textAlign: "center",
|
|
4101
|
-
...A(
|
|
4182
|
+
...A(b)
|
|
4102
4183
|
},
|
|
4103
4184
|
children: [
|
|
4104
4185
|
"Org Chart — no published entries in “",
|
|
@@ -4106,151 +4187,174 @@ function Dn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4106
4187
|
"” yet"
|
|
4107
4188
|
]
|
|
4108
4189
|
}) : null;
|
|
4109
|
-
let
|
|
4190
|
+
let z = new Set(P.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
|
|
4110
4191
|
return /* @__PURE__ */ d("div", {
|
|
4111
|
-
ref:
|
|
4192
|
+
ref: x,
|
|
4112
4193
|
style: {
|
|
4113
4194
|
maxWidth: "100%",
|
|
4114
4195
|
overflowX: "auto",
|
|
4115
|
-
...A(
|
|
4196
|
+
...A(b)
|
|
4116
4197
|
},
|
|
4117
4198
|
children: [/* @__PURE__ */ d("svg", {
|
|
4118
|
-
viewBox: `0 0 ${
|
|
4199
|
+
viewBox: `0 0 ${L} ${R}`,
|
|
4119
4200
|
role: "img",
|
|
4120
4201
|
"aria-label": "Organization chart",
|
|
4121
4202
|
style: {
|
|
4122
4203
|
display: "block",
|
|
4123
4204
|
width: "100%",
|
|
4124
|
-
maxWidth:
|
|
4205
|
+
maxWidth: L,
|
|
4125
4206
|
height: "auto",
|
|
4126
4207
|
margin: "0 auto"
|
|
4127
4208
|
},
|
|
4128
|
-
children: [
|
|
4129
|
-
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4139
|
-
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
children: /* @__PURE__ */
|
|
4209
|
+
children: [
|
|
4210
|
+
I.map((e, t) => {
|
|
4211
|
+
let n = e.color || _ || "rgba(148, 163, 184, 0.16)", r = !!(e.color || _);
|
|
4212
|
+
return /* @__PURE__ */ d("g", { children: [/* @__PURE__ */ u("rect", {
|
|
4213
|
+
x: e.x,
|
|
4214
|
+
y: e.y,
|
|
4215
|
+
width: e.width,
|
|
4216
|
+
height: e.height,
|
|
4217
|
+
rx: "16",
|
|
4218
|
+
fill: n
|
|
4219
|
+
}), g !== "hidden" && e.title && /* @__PURE__ */ u("text", {
|
|
4220
|
+
x: e.x + e.width / 2,
|
|
4221
|
+
y: g === "bottom" ? e.y + e.height - 22 * .42 : e.y + 22 * .78,
|
|
4222
|
+
textAnchor: "middle",
|
|
4223
|
+
fontSize: N.title + 1,
|
|
4224
|
+
fontWeight: "600",
|
|
4225
|
+
opacity: "0.55",
|
|
4226
|
+
fill: r ? On(e.color || _) : "var(--page-text, #111827)",
|
|
4227
|
+
children: Dn(e.title, Math.floor(e.width / 7))
|
|
4228
|
+
})] }, `group-${t}`);
|
|
4229
|
+
}),
|
|
4230
|
+
F.map((e, t) => /* @__PURE__ */ u("path", {
|
|
4231
|
+
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}`,
|
|
4232
|
+
fill: "none",
|
|
4233
|
+
stroke: "rgba(148, 163, 184, 0.7)",
|
|
4234
|
+
strokeWidth: "1.5"
|
|
4235
|
+
}, t)),
|
|
4236
|
+
P.map(({ node: e, x: t, y: n }) => {
|
|
4237
|
+
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 ? On(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? On(e.color2) : s, f = S && (kn(e) || e.href), p = () => kn(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + jn.pad + N.avatar + 8 : t + N.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((N.w - N.avatar - 26) / 7) : Math.floor(N.w / 7.6), _ = N.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
4238
|
+
return /* @__PURE__ */ d("g", {
|
|
4239
|
+
onClick: f ? p : void 0,
|
|
4240
|
+
style: f ? { cursor: "pointer" } : void 0,
|
|
4241
|
+
role: f ? "button" : void 0,
|
|
4242
|
+
"aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
|
|
4243
|
+
children: [
|
|
4244
|
+
i && e.gradient ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("linearGradient", {
|
|
4245
|
+
id: `${C}-${e.id}-grad`,
|
|
4246
|
+
x1: "0",
|
|
4247
|
+
y1: "0",
|
|
4248
|
+
x2: "0",
|
|
4249
|
+
y2: "1",
|
|
4250
|
+
children: [/* @__PURE__ */ u("stop", {
|
|
4251
|
+
offset: "0%",
|
|
4252
|
+
stopColor: e.color || "var(--page-accent, #4f46e5)"
|
|
4253
|
+
}), /* @__PURE__ */ u("stop", {
|
|
4254
|
+
offset: "100%",
|
|
4255
|
+
stopColor: e.color2
|
|
4256
|
+
})]
|
|
4257
|
+
}), /* @__PURE__ */ u("rect", {
|
|
4164
4258
|
x: t,
|
|
4165
4259
|
y: n,
|
|
4166
|
-
width:
|
|
4167
|
-
height:
|
|
4168
|
-
rx: "10"
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4260
|
+
width: N.w,
|
|
4261
|
+
height: N.h,
|
|
4262
|
+
rx: "10",
|
|
4263
|
+
fill: `url(#${C}-${e.id}-grad)`
|
|
4264
|
+
})] }) : i ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
4265
|
+
id: `${C}-${e.id}-box`,
|
|
4266
|
+
children: /* @__PURE__ */ u("rect", {
|
|
4267
|
+
x: t,
|
|
4268
|
+
y: n,
|
|
4269
|
+
width: N.w,
|
|
4270
|
+
height: N.h,
|
|
4271
|
+
rx: "10"
|
|
4272
|
+
})
|
|
4273
|
+
}), /* @__PURE__ */ d("g", {
|
|
4274
|
+
clipPath: `url(#${C}-${e.id}-box)`,
|
|
4275
|
+
children: [/* @__PURE__ */ u("rect", {
|
|
4276
|
+
x: t,
|
|
4277
|
+
y: n,
|
|
4278
|
+
width: N.w,
|
|
4279
|
+
height: _,
|
|
4280
|
+
fill: o
|
|
4281
|
+
}), /* @__PURE__ */ u("rect", {
|
|
4282
|
+
x: t,
|
|
4283
|
+
y: n + _,
|
|
4284
|
+
width: N.w,
|
|
4285
|
+
height: N.h - _,
|
|
4286
|
+
fill: e.color2
|
|
4287
|
+
})]
|
|
4288
|
+
})] }) : /* @__PURE__ */ u("rect", {
|
|
4173
4289
|
x: t,
|
|
4174
4290
|
y: n,
|
|
4175
|
-
width:
|
|
4176
|
-
height:
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4220
|
-
|
|
4221
|
-
|
|
4222
|
-
|
|
4223
|
-
|
|
4224
|
-
|
|
4225
|
-
|
|
4226
|
-
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4230
|
-
|
|
4231
|
-
|
|
4232
|
-
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
textAnchor: h,
|
|
4239
|
-
fontSize: k.title,
|
|
4240
|
-
opacity: "0.7",
|
|
4241
|
-
fill: s,
|
|
4242
|
-
children: xn(v[1], g + 4)
|
|
4243
|
-
})] })
|
|
4244
|
-
]
|
|
4245
|
-
}, e.id);
|
|
4246
|
-
})]
|
|
4247
|
-
}), x && /* @__PURE__ */ u(En, {
|
|
4248
|
-
node: x,
|
|
4249
|
-
onClose: () => S(null)
|
|
4291
|
+
width: N.w,
|
|
4292
|
+
height: N.h,
|
|
4293
|
+
rx: "10",
|
|
4294
|
+
fill: o,
|
|
4295
|
+
stroke: a ? "none" : "var(--page-accent, #4f46e5)",
|
|
4296
|
+
strokeWidth: a ? 0 : 1.5
|
|
4297
|
+
}),
|
|
4298
|
+
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
4299
|
+
id: `${C}-${e.id}`,
|
|
4300
|
+
children: /* @__PURE__ */ u("circle", {
|
|
4301
|
+
cx: t + jn.pad + N.avatar / 2,
|
|
4302
|
+
cy: n + N.h / 2,
|
|
4303
|
+
r: N.avatar / 2
|
|
4304
|
+
})
|
|
4305
|
+
}), /* @__PURE__ */ u("image", {
|
|
4306
|
+
href: e.photo,
|
|
4307
|
+
x: t + jn.pad,
|
|
4308
|
+
y: n + (N.h - N.avatar) / 2,
|
|
4309
|
+
width: N.avatar,
|
|
4310
|
+
height: N.avatar,
|
|
4311
|
+
preserveAspectRatio: "xMidYMid slice",
|
|
4312
|
+
clipPath: `url(#${C}-${e.id})`
|
|
4313
|
+
})] }),
|
|
4314
|
+
i && !e.gradient ? /* @__PURE__ */ d(l, { children: [e.title && /* @__PURE__ */ u("text", {
|
|
4315
|
+
x: m,
|
|
4316
|
+
y: n + _ / 2 + N.title * .35,
|
|
4317
|
+
textAnchor: h,
|
|
4318
|
+
fontSize: N.title,
|
|
4319
|
+
fontWeight: "600",
|
|
4320
|
+
fill: s,
|
|
4321
|
+
children: Dn(e.title, g + 4)
|
|
4322
|
+
}), e.name && /* @__PURE__ */ u("text", {
|
|
4323
|
+
x: m,
|
|
4324
|
+
y: n + _ + _ / 2 + N.name * .35,
|
|
4325
|
+
textAnchor: h,
|
|
4326
|
+
fontSize: N.name,
|
|
4327
|
+
fontWeight: "600",
|
|
4328
|
+
fill: c,
|
|
4329
|
+
children: Dn(e.name, g)
|
|
4330
|
+
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
4331
|
+
x: m,
|
|
4332
|
+
y: n + (v[1] ? N.h * .43 : N.h * .57),
|
|
4333
|
+
textAnchor: h,
|
|
4334
|
+
fontSize: N.name,
|
|
4335
|
+
fontWeight: "600",
|
|
4336
|
+
fill: s,
|
|
4337
|
+
children: Dn(v[0], g)
|
|
4338
|
+
}), v[1] && /* @__PURE__ */ u("text", {
|
|
4339
|
+
x: m,
|
|
4340
|
+
y: n + N.h * .73,
|
|
4341
|
+
textAnchor: h,
|
|
4342
|
+
fontSize: N.title,
|
|
4343
|
+
opacity: "0.7",
|
|
4344
|
+
fill: s,
|
|
4345
|
+
children: Dn(v[1], g + 4)
|
|
4346
|
+
})] })
|
|
4347
|
+
]
|
|
4348
|
+
}, e.id);
|
|
4349
|
+
})
|
|
4350
|
+
]
|
|
4351
|
+
}), w && /* @__PURE__ */ u(Mn, {
|
|
4352
|
+
node: w,
|
|
4353
|
+
onClose: () => T(null)
|
|
4250
4354
|
})]
|
|
4251
4355
|
});
|
|
4252
4356
|
}
|
|
4253
|
-
function
|
|
4357
|
+
function Pn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4254
4358
|
let [a, o] = c(!1), l = s(null);
|
|
4255
4359
|
return i(() => {
|
|
4256
4360
|
if (!a || !l.current) return;
|
|
@@ -4280,7 +4384,7 @@ function On({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4280
4384
|
children: e ?? ""
|
|
4281
4385
|
});
|
|
4282
4386
|
}
|
|
4283
|
-
var
|
|
4387
|
+
var Fn = 360, In = "\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", Ln = (e, t) => e && t ? `cell-${e}-${t}` : "", Rn = (e) => {
|
|
4284
4388
|
if (!e || typeof e != "object") return e ?? "";
|
|
4285
4389
|
let t = String(e.text ?? "");
|
|
4286
4390
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ u("a", {
|
|
@@ -4291,7 +4395,7 @@ var kn = 360, An = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4291
4395
|
children: t
|
|
4292
4396
|
}) : t;
|
|
4293
4397
|
};
|
|
4294
|
-
function
|
|
4398
|
+
function zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], colKeys: o = [], heights: f = [], 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: j, style: M, nodeRef: N, edit: P }) {
|
|
4295
4399
|
let F = s(null), I = s(null), [L, R] = c(null), [z, B] = c(null), V = (e, t) => () => R({
|
|
4296
4400
|
r: e,
|
|
4297
4401
|
c: t
|
|
@@ -4305,7 +4409,7 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4305
4409
|
}
|
|
4306
4410
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4307
4411
|
top: r.bottom - n.top + 4,
|
|
4308
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
4412
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - Fn))
|
|
4309
4413
|
};
|
|
4310
4414
|
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4311
4415
|
}), i(() => {
|
|
@@ -4315,14 +4419,14 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4315
4419
|
};
|
|
4316
4420
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4317
4421
|
}, [P, L]);
|
|
4318
|
-
let { tenant: H, apiUrl: U } = r(
|
|
4422
|
+
let { tenant: H, apiUrl: U } = r(Y), ee = r(be), W = ee?.[h], te = C ? xe(ee) : 1, [ne, G] = c(null);
|
|
4319
4423
|
if (i(() => {
|
|
4320
4424
|
if (!h || W) return;
|
|
4321
4425
|
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(te - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4322
4426
|
return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
|
|
4323
4427
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4324
|
-
return e &&
|
|
4325
|
-
}).catch(() => e &&
|
|
4428
|
+
return e && G(n);
|
|
4429
|
+
}).catch(() => e && G([])), () => {
|
|
4326
4430
|
e = !1;
|
|
4327
4431
|
};
|
|
4328
4432
|
}, [
|
|
@@ -4334,39 +4438,39 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4334
4438
|
te,
|
|
4335
4439
|
g
|
|
4336
4440
|
]), !e.length) return null;
|
|
4337
|
-
let
|
|
4441
|
+
let K = Math.max(1, Number(g) || 10), q = h ? C ? W || h.startsWith("api:") ? (W ?? ne ?? []).slice((te - 1) * K, te * K) : (ne ?? []).slice(0, K) : (W ?? ne ?? []).slice(0, K) : null, re = q ? q.map((t) => e.map((e) => Te(Ce(t?.data, e.field)))) : t, ie = !!h && !(h && !W && ne === null) && re.length === 0, ae = b ? {
|
|
4338
4442
|
y: 6,
|
|
4339
4443
|
x: 10
|
|
4340
4444
|
} : {
|
|
4341
4445
|
y: 10,
|
|
4342
4446
|
x: 14
|
|
4343
|
-
},
|
|
4447
|
+
}, J = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : ae.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : ae.x}px`, oe = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, se = y ? { border: oe } : { borderBottom: oe }, ce = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), le = [
|
|
4344
4448
|
"left",
|
|
4345
4449
|
"center",
|
|
4346
4450
|
"right"
|
|
4347
|
-
],
|
|
4348
|
-
...
|
|
4451
|
+
], ue = (t) => le.includes(e[t]?.align) ? e[t].align : "", de = (e) => ue(e) || (le.includes(O) ? O : "left"), fe = Number.isFinite(Number(j)) && Number(j) > 0 ? Number(j) : 0, pe = A(M), me = !fe && pe && pe.maxHeight !== void 0 ? pe.maxHeight : 0, he = fe || me, ge = me ? {
|
|
4452
|
+
...pe,
|
|
4349
4453
|
maxHeight: void 0
|
|
4350
|
-
} :
|
|
4454
|
+
} : pe, _e = !!P && P.rows !== !1, ve = (t) => (r) => {
|
|
4351
4455
|
if (!P?.resize || t >= e.length - 1) return;
|
|
4352
4456
|
r.preventDefault(), r.stopPropagation();
|
|
4353
4457
|
let i = F.current, a = i ? i.clientWidth : 0;
|
|
4354
4458
|
if (!a) return;
|
|
4355
|
-
let o =
|
|
4459
|
+
let o = ce ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4356
4460
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4357
4461
|
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, P.resize(i);
|
|
4358
4462
|
}, u = () => {
|
|
4359
4463
|
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
|
|
4360
4464
|
};
|
|
4361
4465
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4362
|
-
},
|
|
4363
|
-
p &&
|
|
4364
|
-
let r = p[
|
|
4466
|
+
}, ye = /* @__PURE__ */ new Set();
|
|
4467
|
+
p && re.forEach((t, n) => e.forEach((e, t) => {
|
|
4468
|
+
let r = p[Ln(a[n], o[t])];
|
|
4365
4469
|
if (!r) return;
|
|
4366
4470
|
let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
|
|
4367
|
-
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) &&
|
|
4471
|
+
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && ye.add(`${n + e},${t + r}`);
|
|
4368
4472
|
}));
|
|
4369
|
-
let
|
|
4473
|
+
let Se = (e) => (t) => {
|
|
4370
4474
|
if (!P?.resizeRow) return;
|
|
4371
4475
|
t.preventDefault(), t.stopPropagation();
|
|
4372
4476
|
let n = t.currentTarget.closest("tr");
|
|
@@ -4375,7 +4479,7 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4375
4479
|
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4376
4480
|
};
|
|
4377
4481
|
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4378
|
-
},
|
|
4482
|
+
}, X = (e, t, n, r) => r ? null : /* @__PURE__ */ u("span", {
|
|
4379
4483
|
className: "wb-tedit-btn",
|
|
4380
4484
|
role: "button",
|
|
4381
4485
|
"data-hint": t,
|
|
@@ -4384,7 +4488,7 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4384
4488
|
},
|
|
4385
4489
|
onClick: n,
|
|
4386
4490
|
children: e
|
|
4387
|
-
}, t),
|
|
4491
|
+
}, t), Z = L && L.r < re.length && L.c < e.length ? L : null, Q = (e, t) => P?.labels?.[e] ?? t, we = Z ? p?.[Ln(a[Z.r], o[Z.c])] : null, Ee = Math.max(1, Number(we?.c) || 1), De = Math.max(1, Number(we?.r) || 1);
|
|
4388
4492
|
return /* @__PURE__ */ d("div", {
|
|
4389
4493
|
ref: (e) => {
|
|
4390
4494
|
I.current = e, typeof N == "function" && N(e);
|
|
@@ -4392,11 +4496,11 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4392
4496
|
style: {
|
|
4393
4497
|
width: "100%",
|
|
4394
4498
|
...P ? { position: "relative" } : null,
|
|
4395
|
-
...
|
|
4499
|
+
...ge
|
|
4396
4500
|
},
|
|
4397
4501
|
children: [
|
|
4398
|
-
P && /* @__PURE__ */ u("style", { children:
|
|
4399
|
-
P &&
|
|
4502
|
+
P && /* @__PURE__ */ u("style", { children: In }),
|
|
4503
|
+
P && Z && z && /* @__PURE__ */ d("div", {
|
|
4400
4504
|
className: "wb-tedit-bar",
|
|
4401
4505
|
style: {
|
|
4402
4506
|
top: z.top,
|
|
@@ -4406,31 +4510,31 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4406
4510
|
children: [
|
|
4407
4511
|
/* @__PURE__ */ u("span", {
|
|
4408
4512
|
className: "wb-tedit-at",
|
|
4409
|
-
children: `R${
|
|
4513
|
+
children: `R${Z.r + 1}·C${Z.c + 1}`
|
|
4410
4514
|
}),
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4515
|
+
X("+↑", Q("rowAbove", "Insert row above"), () => P.addRow(Z.r - 1)),
|
|
4516
|
+
X("+↓", Q("rowBelow", "Insert row below"), () => P.addRow(Z.r)),
|
|
4517
|
+
X("↑", Q("rowUp", "Move row up"), () => P.moveRow(Z.r, -1), Z.r === 0),
|
|
4518
|
+
X("↓", Q("rowDown", "Move row down"), () => P.moveRow(Z.r, 1), Z.r >= re.length - 1),
|
|
4519
|
+
X("✕ row", Q("rowDelete", "Delete row"), () => P.dropRow(Z.r), re.length <= 1),
|
|
4416
4520
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4521
|
+
X("+←", Q("colLeft", "Insert column left"), () => P.addColumn(Z.c - 1)),
|
|
4522
|
+
X("+→", Q("colRight", "Insert column right"), () => P.addColumn(Z.c)),
|
|
4523
|
+
X("←", Q("colMoveLeft", "Move column left"), () => P.moveColumn(Z.c, -1), Z.c === 0),
|
|
4524
|
+
X("→", Q("colMoveRight", "Move column right"), () => P.moveColumn(Z.c, 1), Z.c >= e.length - 1),
|
|
4525
|
+
X("✕ col", Q("colDelete", "Delete column"), () => P.dropColumn(Z.c), e.length <= 1),
|
|
4422
4526
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4527
|
+
X("↔", Q("mergeRight", "Merge with the cell on the right"), () => P.merge(Z.r, Z.c, "right"), Z.c + Ee >= e.length),
|
|
4528
|
+
X("↕", Q("mergeDown", "Merge with the cell below"), () => P.merge(Z.r, Z.c, "down"), Z.r + De >= re.length),
|
|
4529
|
+
X("⤫", Q("split", "Split this cell"), () => P.split(Z.r, Z.c), Ee === 1 && De === 1)
|
|
4426
4530
|
]
|
|
4427
4531
|
}),
|
|
4428
4532
|
/* @__PURE__ */ u("div", {
|
|
4429
4533
|
style: {
|
|
4430
4534
|
width: "100%",
|
|
4431
4535
|
overflowX: "auto",
|
|
4432
|
-
...
|
|
4433
|
-
maxHeight:
|
|
4536
|
+
...he ? {
|
|
4537
|
+
maxHeight: he,
|
|
4434
4538
|
overflowY: "auto"
|
|
4435
4539
|
} : null
|
|
4436
4540
|
},
|
|
@@ -4441,17 +4545,17 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4441
4545
|
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
4442
4546
|
borderSpacing: 0,
|
|
4443
4547
|
fontSize: 14,
|
|
4444
|
-
...
|
|
4445
|
-
...y ? { border:
|
|
4548
|
+
...ce ? { tableLayout: "fixed" } : null,
|
|
4549
|
+
...y ? { border: oe } : {}
|
|
4446
4550
|
},
|
|
4447
4551
|
children: [
|
|
4448
|
-
|
|
4552
|
+
ce && /* @__PURE__ */ u("colgroup", { children: n.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
|
|
4449
4553
|
_ === !1 ? null : /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((t, n) => /* @__PURE__ */ u("th", {
|
|
4450
4554
|
className: P ? "wb-tedit-head" : void 0,
|
|
4451
4555
|
style: {
|
|
4452
|
-
textAlign:
|
|
4556
|
+
textAlign: de(n),
|
|
4453
4557
|
fontWeight: 600,
|
|
4454
|
-
padding:
|
|
4558
|
+
padding: J,
|
|
4455
4559
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4456
4560
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4457
4561
|
...T ? {
|
|
@@ -4459,53 +4563,53 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4459
4563
|
top: 0,
|
|
4460
4564
|
zIndex: 2
|
|
4461
4565
|
} : P ? { position: "relative" } : null,
|
|
4462
|
-
...
|
|
4566
|
+
...se
|
|
4463
4567
|
},
|
|
4464
|
-
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
4568
|
+
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(Pn, {
|
|
4465
4569
|
value: t.label ?? t,
|
|
4466
4570
|
onCommit: (e) => P.header(n, e),
|
|
4467
|
-
hint:
|
|
4571
|
+
hint: Q("editCell", "Double-click to edit"),
|
|
4468
4572
|
style: { paddingRight: 6 }
|
|
4469
4573
|
}), n < e.length - 1 && /* @__PURE__ */ u("span", {
|
|
4470
4574
|
className: "wb-tedit-grip",
|
|
4471
|
-
title:
|
|
4472
|
-
onPointerDown:
|
|
4575
|
+
title: Q("colWidth", "Drag to resize the column"),
|
|
4576
|
+
onPointerDown: ve(n)
|
|
4473
4577
|
})] }) : t.label ?? t
|
|
4474
4578
|
}, n)) }) }),
|
|
4475
|
-
/* @__PURE__ */ d("tbody", { children: [
|
|
4579
|
+
/* @__PURE__ */ d("tbody", { children: [ie && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
4476
4580
|
colSpan: e.length,
|
|
4477
4581
|
style: {
|
|
4478
|
-
padding:
|
|
4582
|
+
padding: J,
|
|
4479
4583
|
textAlign: "center",
|
|
4480
4584
|
opacity: .6,
|
|
4481
|
-
...
|
|
4585
|
+
...se
|
|
4482
4586
|
},
|
|
4483
4587
|
children: w || "No data yet"
|
|
4484
|
-
}) }),
|
|
4588
|
+
}) }), re.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
4485
4589
|
className: P ? "wb-tedit-row" : void 0,
|
|
4486
4590
|
style: {
|
|
4487
4591
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
4488
4592
|
...Number.isFinite(Number(f?.[n])) && f[n] > 0 ? { height: f[n] } : null
|
|
4489
4593
|
},
|
|
4490
4594
|
children: e.map((e, r) => {
|
|
4491
|
-
if (
|
|
4492
|
-
let i =
|
|
4595
|
+
if (ye.has(`${n},${r}`)) return null;
|
|
4596
|
+
let i = Ln(a[n], o[r]), s = m?.[i], c = p?.[i], l = Math.max(1, Number(c?.c) || 1), f = Math.max(1, Number(c?.r) || 1);
|
|
4493
4597
|
return /* @__PURE__ */ d("td", {
|
|
4494
4598
|
className: P ? `wb-tedit-cell${L?.r === n && L?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4495
|
-
onMouseDownCapture:
|
|
4599
|
+
onMouseDownCapture: _e ? V(n, r) : void 0,
|
|
4496
4600
|
"data-cell": P ? `${n}-${r}` : void 0,
|
|
4497
4601
|
colSpan: l > 1 ? l : void 0,
|
|
4498
4602
|
rowSpan: f > 1 ? f : void 0,
|
|
4499
4603
|
style: {
|
|
4500
|
-
padding:
|
|
4501
|
-
...
|
|
4604
|
+
padding: J,
|
|
4605
|
+
...ue(r) ? { textAlign: ue(r) } : null,
|
|
4502
4606
|
...P ? { position: "relative" } : null,
|
|
4503
|
-
...
|
|
4607
|
+
...se
|
|
4504
4608
|
},
|
|
4505
|
-
children: [s ??
|
|
4609
|
+
children: [s ?? Rn(t?.[r]), P && _e && /* @__PURE__ */ u("span", {
|
|
4506
4610
|
className: "wb-tedit-rowgrip",
|
|
4507
|
-
title:
|
|
4508
|
-
onPointerDown:
|
|
4611
|
+
title: Q("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4612
|
+
onPointerDown: Se(n),
|
|
4509
4613
|
onDoubleClick: () => P.resizeRow(n, 0)
|
|
4510
4614
|
})]
|
|
4511
4615
|
}, r);
|
|
@@ -4517,7 +4621,7 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4517
4621
|
]
|
|
4518
4622
|
});
|
|
4519
4623
|
}
|
|
4520
|
-
var
|
|
4624
|
+
var Bn = {
|
|
4521
4625
|
small: {
|
|
4522
4626
|
cell: 62,
|
|
4523
4627
|
font: 10.5,
|
|
@@ -4542,9 +4646,9 @@ var Pn = {
|
|
|
4542
4646
|
pad: 8,
|
|
4543
4647
|
gap: 4
|
|
4544
4648
|
}
|
|
4545
|
-
},
|
|
4546
|
-
function
|
|
4547
|
-
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 ? "" :
|
|
4649
|
+
}, Vn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Hn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Un = 366;
|
|
4650
|
+
function Wn(e, t = {}) {
|
|
4651
|
+
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 ? "" : Te(e), a = (e) => {
|
|
4548
4652
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4549
4653
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4550
4654
|
};
|
|
@@ -4560,7 +4664,7 @@ function Rn(e, t = {}) {
|
|
|
4560
4664
|
} : null;
|
|
4561
4665
|
}).filter(Boolean);
|
|
4562
4666
|
}
|
|
4563
|
-
function
|
|
4667
|
+
function Gn(e) {
|
|
4564
4668
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4565
4669
|
let n = e?.start ? new Date(e.start) : null;
|
|
4566
4670
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4575,20 +4679,20 @@ function zn(e) {
|
|
|
4575
4679
|
};
|
|
4576
4680
|
}).filter(Boolean);
|
|
4577
4681
|
}
|
|
4578
|
-
function
|
|
4682
|
+
function Kn(e) {
|
|
4579
4683
|
let t = /* @__PURE__ */ new Map();
|
|
4580
4684
|
for (let n of e) {
|
|
4581
|
-
let e =
|
|
4685
|
+
let e = Hn(n.start), r = n.end ? Hn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Un);
|
|
4582
4686
|
for (let r = 0; r <= i; r += 1) {
|
|
4583
|
-
let i =
|
|
4687
|
+
let i = Vn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4584
4688
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4585
4689
|
}
|
|
4586
4690
|
}
|
|
4587
4691
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4588
4692
|
return t;
|
|
4589
4693
|
}
|
|
4590
|
-
function
|
|
4591
|
-
let { tenant: T, apiUrl: E, locale: D } = r(
|
|
4694
|
+
function qn({ events: e = [], source: t = "", titleField: n = "", startField: a = "", endField: o = "", hrefField: s = "", colorField: f = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
|
|
4695
|
+
let { tenant: T, apiUrl: E, locale: D } = r(Y), O = r(be)?.[t], [k, j] = c(null), [M, N] = c(() => {
|
|
4592
4696
|
let e = /* @__PURE__ */ new Date();
|
|
4593
4697
|
return {
|
|
4594
4698
|
year: e.getFullYear(),
|
|
@@ -4610,13 +4714,13 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4610
4714
|
E,
|
|
4611
4715
|
O
|
|
4612
4716
|
]);
|
|
4613
|
-
let P =
|
|
4717
|
+
let P = Bn[m] ?? Bn.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 ? Wn(O ?? k ?? [], {
|
|
4614
4718
|
titleField: n,
|
|
4615
4719
|
startField: a,
|
|
4616
4720
|
endField: o,
|
|
4617
4721
|
hrefField: s,
|
|
4618
4722
|
colorField: f
|
|
4619
|
-
}) :
|
|
4723
|
+
}) : Gn(e), B = Kn(z), V = D || void 0, H = (e, t) => {
|
|
4620
4724
|
let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
|
|
4621
4725
|
width: 6,
|
|
4622
4726
|
height: 6,
|
|
@@ -4748,10 +4852,10 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4748
4852
|
})]
|
|
4749
4853
|
});
|
|
4750
4854
|
}
|
|
4751
|
-
let ne = new Date(M.year, M.month, 1),
|
|
4752
|
-
for (let e = 0; e <
|
|
4753
|
-
let t = e -
|
|
4754
|
-
|
|
4855
|
+
let ne = new Date(M.year, M.month, 1), G = y === "sunday" ? 0 : 1, K = (ne.getDay() - G + 7) % 7, q = new Date(M.year, M.month + 1, 0).getDate(), re = Math.ceil((K + q) / 7), ie = Vn(/* @__PURE__ */ new Date()), ae = new Intl.DateTimeFormat(V, { weekday: "short" }), J = [];
|
|
4856
|
+
for (let e = 0; e < re * 7; e += 1) {
|
|
4857
|
+
let t = e - K + 1, n = t >= 1 && t <= q, r = Vn(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
|
|
4858
|
+
J.push(/* @__PURE__ */ d("div", {
|
|
4755
4859
|
style: {
|
|
4756
4860
|
minHeight: P.cell,
|
|
4757
4861
|
borderTop: `1px solid ${I}`,
|
|
@@ -4808,20 +4912,315 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4808
4912
|
textAlign: "center",
|
|
4809
4913
|
padding: `0 0 ${P.pad}px`
|
|
4810
4914
|
},
|
|
4811
|
-
children:
|
|
4812
|
-
}, `head-${t}`)),
|
|
4915
|
+
children: ae.format(new Date(2024, 0, 7 + G + t))
|
|
4916
|
+
}, `head-${t}`)), J]
|
|
4813
4917
|
}),
|
|
4814
4918
|
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4815
4919
|
]
|
|
4816
4920
|
});
|
|
4817
4921
|
}
|
|
4818
|
-
var
|
|
4922
|
+
var Jn = {
|
|
4923
|
+
small: 36,
|
|
4924
|
+
medium: 56,
|
|
4925
|
+
large: 88
|
|
4926
|
+
};
|
|
4927
|
+
function Yn(e, t = {}) {
|
|
4928
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : Te(e);
|
|
4929
|
+
return n.map((e) => {
|
|
4930
|
+
let n = e.data ?? e, i = Ce(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(Ce(n, t.nameField)) : r(n.name);
|
|
4931
|
+
return {
|
|
4932
|
+
src: typeof o == "string" ? o.trim() : "",
|
|
4933
|
+
alt: s,
|
|
4934
|
+
href: t.hrefField ? r(Ce(n, t.hrefField)) : ""
|
|
4935
|
+
};
|
|
4936
|
+
}).filter((e) => e.src);
|
|
4937
|
+
}
|
|
4938
|
+
function Xn({ logos: e = [], source: t = "", imageField: n = "", nameField: a = "", hrefField: o = "", variant: f = "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 }) {
|
|
4939
|
+
let { tenant: D, apiUrl: O } = r(Y), k = r(be)?.[t], [j, M] = c(null), N = s(null), P = s(null), [F, I] = c(0), [L, R] = c(0), [z, B] = c(0), [V, H] = c(!0), [U, ee] = c(!1), [W, te] = c(!1);
|
|
4940
|
+
i(() => {
|
|
4941
|
+
if (!t || k) return;
|
|
4942
|
+
let e = !0;
|
|
4943
|
+
return fetch(`${O}/dynamic/${encodeURIComponent(t)}`, { headers: D ? { "x-tenant": D } : {} }).then((e) => e.json()).then((t) => {
|
|
4944
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4945
|
+
e && M(n);
|
|
4946
|
+
}).catch(() => e && M([])), () => {
|
|
4947
|
+
e = !1;
|
|
4948
|
+
};
|
|
4949
|
+
}, [
|
|
4950
|
+
t,
|
|
4951
|
+
D,
|
|
4952
|
+
O,
|
|
4953
|
+
k
|
|
4954
|
+
]), i(() => {
|
|
4955
|
+
if (typeof window > "u" || !window.matchMedia) return;
|
|
4956
|
+
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => te(e.matches);
|
|
4957
|
+
return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
|
|
4958
|
+
}, []), i(() => {
|
|
4959
|
+
let e = P.current;
|
|
4960
|
+
if (!e) return;
|
|
4961
|
+
let t = () => I(e.clientWidth);
|
|
4962
|
+
if (t(), typeof ResizeObserver > "u") return;
|
|
4963
|
+
let n = new ResizeObserver(t);
|
|
4964
|
+
return n.observe(e), () => n.disconnect();
|
|
4965
|
+
}, []), i(() => {
|
|
4966
|
+
let e = N.current;
|
|
4967
|
+
if (!e) return;
|
|
4968
|
+
let t = !0, n = () => {
|
|
4969
|
+
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * K);
|
|
4970
|
+
t && n.length && R(Math.ceil(Math.max(...n)));
|
|
4971
|
+
};
|
|
4972
|
+
n();
|
|
4973
|
+
let r = [...e.querySelectorAll("img")].filter((e) => !e.complete);
|
|
4974
|
+
return r.forEach((e) => e.addEventListener("load", n)), () => {
|
|
4975
|
+
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
4976
|
+
};
|
|
4977
|
+
});
|
|
4978
|
+
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], G = t ? Yn(k ?? j ?? [], {
|
|
4979
|
+
imageField: n,
|
|
4980
|
+
nameField: a,
|
|
4981
|
+
hrefField: o
|
|
4982
|
+
}) : ne, K = Jn[p] ?? Jn.medium, q = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ie = f === "marquee" ? "step" : f, ae = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), J = Math.min(3e3, Math.max(100, Number(_) || 500)), oe = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || K * 3) + q, ce = F ? Math.max(1, Math.floor(F / se)) : oe, le = Math.min(oe, ce), ue = F ? Math.min(se, F / le) : se;
|
|
4983
|
+
if (!G.length) return /* @__PURE__ */ u("div", {
|
|
4984
|
+
ref: T,
|
|
4985
|
+
style: {
|
|
4986
|
+
width: "100%",
|
|
4987
|
+
...A(w)
|
|
4988
|
+
},
|
|
4989
|
+
children: E ? /* @__PURE__ */ u("div", {
|
|
4990
|
+
style: {
|
|
4991
|
+
display: "flex",
|
|
4992
|
+
alignItems: "center",
|
|
4993
|
+
justifyContent: "center",
|
|
4994
|
+
flexWrap: "wrap",
|
|
4995
|
+
gap: q
|
|
4996
|
+
},
|
|
4997
|
+
children: [
|
|
4998
|
+
0,
|
|
4999
|
+
1,
|
|
5000
|
+
2,
|
|
5001
|
+
3,
|
|
5002
|
+
4
|
|
5003
|
+
].map((e) => /* @__PURE__ */ u("div", {
|
|
5004
|
+
style: {
|
|
5005
|
+
height: K,
|
|
5006
|
+
width: K * 3,
|
|
5007
|
+
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
5008
|
+
borderRadius: 6,
|
|
5009
|
+
display: "flex",
|
|
5010
|
+
alignItems: "center",
|
|
5011
|
+
justifyContent: "center",
|
|
5012
|
+
fontSize: Math.max(10, Math.round(K / 4)),
|
|
5013
|
+
opacity: .45,
|
|
5014
|
+
...re
|
|
5015
|
+
},
|
|
5016
|
+
children: "LOGO"
|
|
5017
|
+
}, e))
|
|
5018
|
+
}) : C ? /* @__PURE__ */ u("div", {
|
|
5019
|
+
style: {
|
|
5020
|
+
fontSize: 13,
|
|
5021
|
+
opacity: .6,
|
|
5022
|
+
textAlign: "center",
|
|
5023
|
+
padding: 16
|
|
5024
|
+
},
|
|
5025
|
+
children: C
|
|
5026
|
+
}) : null
|
|
5027
|
+
});
|
|
5028
|
+
let de = G.length, fe = ie === "step" && de > le, pe = ie === "slider", me = fe && !E && !U && !W, he = v === "right", ge = he ? de : 0, _e = fe ? [...G, ...G] : G, ve = fe ? z * ue : 0, ye = (e, t, n) => {
|
|
5029
|
+
let r = /* @__PURE__ */ u("img", {
|
|
5030
|
+
src: e.src,
|
|
5031
|
+
alt: e.alt ?? "",
|
|
5032
|
+
style: {
|
|
5033
|
+
height: K,
|
|
5034
|
+
width: "auto",
|
|
5035
|
+
maxWidth: "100%",
|
|
5036
|
+
objectFit: "contain",
|
|
5037
|
+
display: "block"
|
|
5038
|
+
}
|
|
5039
|
+
}), i = fe ? {
|
|
5040
|
+
width: ue,
|
|
5041
|
+
flex: "0 0 auto",
|
|
5042
|
+
padding: `0 ${q / 2}px`,
|
|
5043
|
+
justifyContent: "center"
|
|
5044
|
+
} : {};
|
|
5045
|
+
return e.href && !E ? /* @__PURE__ */ u("a", {
|
|
5046
|
+
href: e.href,
|
|
5047
|
+
className: "wb-logo",
|
|
5048
|
+
title: e.alt || void 0,
|
|
5049
|
+
style: i,
|
|
5050
|
+
...S === !1 ? {} : {
|
|
5051
|
+
target: "_blank",
|
|
5052
|
+
rel: "noopener noreferrer"
|
|
5053
|
+
},
|
|
5054
|
+
...n ? {
|
|
5055
|
+
"aria-hidden": "true",
|
|
5056
|
+
tabIndex: -1
|
|
5057
|
+
} : {},
|
|
5058
|
+
children: r
|
|
5059
|
+
}, `${n ? "c" : "o"}-${t}`) : /* @__PURE__ */ u("div", {
|
|
5060
|
+
className: "wb-logo",
|
|
5061
|
+
style: i,
|
|
5062
|
+
...n ? { "aria-hidden": "true" } : {},
|
|
5063
|
+
children: r
|
|
5064
|
+
}, `${n ? "c" : "o"}-${t}`);
|
|
5065
|
+
}, xe = /* @__PURE__ */ u("div", {
|
|
5066
|
+
ref: N,
|
|
5067
|
+
className: "wb-logos-track",
|
|
5068
|
+
style: {
|
|
5069
|
+
display: "flex",
|
|
5070
|
+
alignItems: "center",
|
|
5071
|
+
...fe ? {
|
|
5072
|
+
width: _e.length * ue,
|
|
5073
|
+
transform: `translateX(-${ve}px)`,
|
|
5074
|
+
transition: V ? `transform ${J}ms ease` : "none"
|
|
5075
|
+
} : pe ? {
|
|
5076
|
+
gap: q,
|
|
5077
|
+
overflowX: "auto",
|
|
5078
|
+
scrollBehavior: "smooth",
|
|
5079
|
+
scrollSnapType: "x proximity"
|
|
5080
|
+
} : {
|
|
5081
|
+
gap: q,
|
|
5082
|
+
flexWrap: "wrap",
|
|
5083
|
+
justifyContent: "center"
|
|
5084
|
+
}
|
|
5085
|
+
},
|
|
5086
|
+
children: _e.map((e, t) => ye(e, t, fe && t >= de))
|
|
5087
|
+
}), Se = (e) => {
|
|
5088
|
+
if (pe) {
|
|
5089
|
+
let t = N.current;
|
|
5090
|
+
t && t.scrollBy({
|
|
5091
|
+
left: e * Math.max(120, t.clientWidth * .8),
|
|
5092
|
+
behavior: "smooth"
|
|
5093
|
+
});
|
|
5094
|
+
return;
|
|
5095
|
+
}
|
|
5096
|
+
let t = z + e;
|
|
5097
|
+
if (t >= 0 && t <= de) {
|
|
5098
|
+
H(!0), B(t);
|
|
5099
|
+
return;
|
|
5100
|
+
}
|
|
5101
|
+
let n = t < 0 ? de : 0;
|
|
5102
|
+
H(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
5103
|
+
H(!0), B(n + e);
|
|
5104
|
+
}));
|
|
5105
|
+
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Z = X !== "off" && (pe ? F > 0 : fe), Q = (e) => /* @__PURE__ */ u("button", {
|
|
5106
|
+
type: "button",
|
|
5107
|
+
"aria-label": e < 0 ? "Previous logos" : "Next logos",
|
|
5108
|
+
onClick: () => Se(e),
|
|
5109
|
+
className: `wb-logos-arrow${X === "hover" ? " wb-logos-arrow-shy" : ""}`,
|
|
5110
|
+
style: { [e < 0 ? "left" : "right"]: 0 },
|
|
5111
|
+
children: e < 0 ? "‹" : "›"
|
|
5112
|
+
});
|
|
5113
|
+
return /* @__PURE__ */ d("div", {
|
|
5114
|
+
ref: (e) => {
|
|
5115
|
+
P.current = e, T && T(e);
|
|
5116
|
+
},
|
|
5117
|
+
className: "wb-logos",
|
|
5118
|
+
style: {
|
|
5119
|
+
width: "100%",
|
|
5120
|
+
position: "relative",
|
|
5121
|
+
overflow: "hidden",
|
|
5122
|
+
...A(w)
|
|
5123
|
+
},
|
|
5124
|
+
onMouseEnter: b === !1 ? void 0 : () => ee(!0),
|
|
5125
|
+
onMouseLeave: b === !1 ? void 0 : () => ee(!1),
|
|
5126
|
+
children: [
|
|
5127
|
+
/* @__PURE__ */ u("style", { children: `
|
|
5128
|
+
.wb-logos .wb-logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; box-sizing: border-box; }
|
|
5129
|
+
.wb-logos .wb-logo img { filter: ${x === !1 ? "none" : "grayscale(1)"}; opacity: ${x === !1 ? 1 : .7}; transition: filter .2s ease, opacity .2s ease; }
|
|
5130
|
+
.wb-logos .wb-logo:hover img { filter: none; opacity: 1; }
|
|
5131
|
+
.wb-logos .wb-logos-track::-webkit-scrollbar { display: none; }
|
|
5132
|
+
.wb-logos .wb-logos-track { scrollbar-width: none; }
|
|
5133
|
+
.wb-logos .wb-logo { scroll-snap-align: start; }
|
|
5134
|
+
/* Shy arrows fade in with the pointer — and with KEYBOARD focus, or they
|
|
5135
|
+
would be unreachable without a mouse. */
|
|
5136
|
+
.wb-logos .wb-logos-arrow-shy { opacity: 0; transition: opacity .18s ease; }
|
|
5137
|
+
.wb-logos:hover .wb-logos-arrow-shy,
|
|
5138
|
+
.wb-logos:focus-within .wb-logos-arrow-shy { opacity: 1; }
|
|
5139
|
+
.wb-logos-arrow {
|
|
5140
|
+
position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
|
|
5141
|
+
width: 30px; height: 30px; border-radius: 999px; cursor: pointer; line-height: 1; font-size: 18px;
|
|
5142
|
+
display: flex; align-items: center; justify-content: center;
|
|
5143
|
+
color: inherit; background: var(--page-surface, #f2f2f2);
|
|
5144
|
+
border: 1px solid var(--page-border, rgba(148, 163, 184, 0.5));
|
|
5145
|
+
}
|
|
5146
|
+
` }),
|
|
5147
|
+
fe ? /* @__PURE__ */ d("div", {
|
|
5148
|
+
style: {
|
|
5149
|
+
position: "relative",
|
|
5150
|
+
width: le * ue,
|
|
5151
|
+
maxWidth: "100%",
|
|
5152
|
+
margin: "0 auto"
|
|
5153
|
+
},
|
|
5154
|
+
children: [
|
|
5155
|
+
Z ? Q(-1) : null,
|
|
5156
|
+
/* @__PURE__ */ u("div", {
|
|
5157
|
+
style: { overflow: "hidden" },
|
|
5158
|
+
children: xe
|
|
5159
|
+
}),
|
|
5160
|
+
Z ? Q(1) : null
|
|
5161
|
+
]
|
|
5162
|
+
}) : /* @__PURE__ */ d(l, { children: [
|
|
5163
|
+
Z ? Q(-1) : null,
|
|
5164
|
+
xe,
|
|
5165
|
+
Z ? Q(1) : null
|
|
5166
|
+
] }),
|
|
5167
|
+
/* @__PURE__ */ u(Zn, {
|
|
5168
|
+
running: me,
|
|
5169
|
+
every: ae + J,
|
|
5170
|
+
slide: J,
|
|
5171
|
+
step: he ? -1 : 1,
|
|
5172
|
+
index: z,
|
|
5173
|
+
total: de,
|
|
5174
|
+
home: ge,
|
|
5175
|
+
setIndex: B,
|
|
5176
|
+
setAnimate: H
|
|
5177
|
+
})
|
|
5178
|
+
]
|
|
5179
|
+
});
|
|
5180
|
+
}
|
|
5181
|
+
function Zn({ running: e, every: t, slide: n, step: r, index: a, total: o, home: s, setIndex: c, setAnimate: l }) {
|
|
5182
|
+
i(() => {
|
|
5183
|
+
if (!e) return;
|
|
5184
|
+
let n = setInterval(() => {
|
|
5185
|
+
l(!0), c((e) => e + r);
|
|
5186
|
+
}, t);
|
|
5187
|
+
return () => clearInterval(n);
|
|
5188
|
+
}, [
|
|
5189
|
+
e,
|
|
5190
|
+
t,
|
|
5191
|
+
r,
|
|
5192
|
+
c,
|
|
5193
|
+
l
|
|
5194
|
+
]), i(() => {
|
|
5195
|
+
l(!1), c(s);
|
|
5196
|
+
}, [
|
|
5197
|
+
s,
|
|
5198
|
+
c,
|
|
5199
|
+
l
|
|
5200
|
+
]);
|
|
5201
|
+
let u = r > 0 ? a >= o : a <= 0;
|
|
5202
|
+
return i(() => {
|
|
5203
|
+
if (!u || a === s) return;
|
|
5204
|
+
let e = setTimeout(() => {
|
|
5205
|
+
l(!1), c(s);
|
|
5206
|
+
}, n);
|
|
5207
|
+
return () => clearTimeout(e);
|
|
5208
|
+
}, [
|
|
5209
|
+
u,
|
|
5210
|
+
a,
|
|
5211
|
+
n,
|
|
5212
|
+
s,
|
|
5213
|
+
c,
|
|
5214
|
+
l
|
|
5215
|
+
]), null;
|
|
5216
|
+
}
|
|
5217
|
+
var Qn = {
|
|
4819
5218
|
small: 380,
|
|
4820
5219
|
medium: 560,
|
|
4821
5220
|
large: 820,
|
|
4822
5221
|
full: "100%"
|
|
4823
5222
|
};
|
|
4824
|
-
function
|
|
5223
|
+
function $n({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: a = 0, size: o = "medium", title: l = "", showClose: f = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
|
|
4825
5224
|
let [C, w] = c(!1), T = s(null);
|
|
4826
5225
|
i(() => {
|
|
4827
5226
|
if (S || !e) return;
|
|
@@ -4846,7 +5245,7 @@ function Un({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4846
5245
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
4847
5246
|
};
|
|
4848
5247
|
}, [S, C]);
|
|
4849
|
-
let E =
|
|
5248
|
+
let E = Qn[o] ?? Qn.medium, D = (e) => {
|
|
4850
5249
|
let t = {
|
|
4851
5250
|
padding: "9px 16px",
|
|
4852
5251
|
borderRadius: 6,
|
|
@@ -5015,84 +5414,125 @@ function Un({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5015
5414
|
})]
|
|
5016
5415
|
});
|
|
5017
5416
|
}
|
|
5018
|
-
var
|
|
5417
|
+
var er = {
|
|
5019
5418
|
PageRoot: Pe,
|
|
5020
|
-
CalendarBlock:
|
|
5021
|
-
|
|
5419
|
+
CalendarBlock: qn,
|
|
5420
|
+
LogoCarousel: Xn,
|
|
5421
|
+
DialogBlock: $n,
|
|
5022
5422
|
Section: Fe,
|
|
5023
5423
|
Container: Ie,
|
|
5024
5424
|
Heading: Le,
|
|
5025
|
-
TextBlock:
|
|
5026
|
-
ButtonBlock:
|
|
5027
|
-
ImageBlock:
|
|
5028
|
-
Spacer:
|
|
5029
|
-
Divider:
|
|
5030
|
-
SliderBlock:
|
|
5031
|
-
CanvasSlider:
|
|
5032
|
-
TabsBlock:
|
|
5033
|
-
QuickStack:
|
|
5034
|
-
CollectionList:
|
|
5035
|
-
CollectionSearch:
|
|
5036
|
-
BreadcrumbsBlock:
|
|
5037
|
-
PaginationBlock:
|
|
5038
|
-
StepperBlock:
|
|
5039
|
-
SocialLinksBlock:
|
|
5040
|
-
ThemeModeBlock:
|
|
5041
|
-
ScrollTopBlock:
|
|
5042
|
-
OrgChartBlock:
|
|
5043
|
-
TableBlock:
|
|
5044
|
-
IconBlock:
|
|
5045
|
-
MapBlock:
|
|
5046
|
-
MasonryBlock:
|
|
5047
|
-
AccordionBlock:
|
|
5048
|
-
NavbarBlock:
|
|
5049
|
-
ListBlock:
|
|
5425
|
+
TextBlock: Qe,
|
|
5426
|
+
ButtonBlock: tt,
|
|
5427
|
+
ImageBlock: nt,
|
|
5428
|
+
Spacer: ct,
|
|
5429
|
+
Divider: lt,
|
|
5430
|
+
SliderBlock: ht,
|
|
5431
|
+
CanvasSlider: gt,
|
|
5432
|
+
TabsBlock: Mt,
|
|
5433
|
+
QuickStack: an,
|
|
5434
|
+
CollectionList: on,
|
|
5435
|
+
CollectionSearch: sn,
|
|
5436
|
+
BreadcrumbsBlock: cn,
|
|
5437
|
+
PaginationBlock: ln,
|
|
5438
|
+
StepperBlock: xn,
|
|
5439
|
+
SocialLinksBlock: bn,
|
|
5440
|
+
ThemeModeBlock: mn,
|
|
5441
|
+
ScrollTopBlock: vn,
|
|
5442
|
+
OrgChartBlock: Nn,
|
|
5443
|
+
TableBlock: zn,
|
|
5444
|
+
IconBlock: Tt,
|
|
5445
|
+
MapBlock: Ct,
|
|
5446
|
+
MasonryBlock: Dt,
|
|
5447
|
+
AccordionBlock: Nt,
|
|
5448
|
+
NavbarBlock: jt,
|
|
5449
|
+
ListBlock: Ze,
|
|
5050
5450
|
TextSpan: Ve,
|
|
5051
|
-
QuoteBlock:
|
|
5052
|
-
TextLink:
|
|
5053
|
-
RichTextBlock:
|
|
5054
|
-
RichContentBlock:
|
|
5055
|
-
VideoBlock:
|
|
5056
|
-
YouTubeBlock:
|
|
5057
|
-
IframeBlock:
|
|
5058
|
-
EmbedBlock:
|
|
5059
|
-
FormBlock:
|
|
5060
|
-
FormLabel:
|
|
5061
|
-
FormInput:
|
|
5062
|
-
FormTextarea:
|
|
5063
|
-
FormCheckbox: (e) => /* @__PURE__ */ u(
|
|
5451
|
+
QuoteBlock: Xe,
|
|
5452
|
+
TextLink: et,
|
|
5453
|
+
RichTextBlock: Je,
|
|
5454
|
+
RichContentBlock: Je,
|
|
5455
|
+
VideoBlock: rt,
|
|
5456
|
+
YouTubeBlock: at,
|
|
5457
|
+
IframeBlock: ot,
|
|
5458
|
+
EmbedBlock: st,
|
|
5459
|
+
FormBlock: Kt,
|
|
5460
|
+
FormLabel: Zt,
|
|
5461
|
+
FormInput: Qt,
|
|
5462
|
+
FormTextarea: $t,
|
|
5463
|
+
FormCheckbox: (e) => /* @__PURE__ */ u(en, {
|
|
5064
5464
|
kind: "checkbox",
|
|
5065
5465
|
...e
|
|
5066
5466
|
}),
|
|
5067
|
-
FormRadio: (e) => /* @__PURE__ */ u(
|
|
5467
|
+
FormRadio: (e) => /* @__PURE__ */ u(en, {
|
|
5068
5468
|
kind: "radio",
|
|
5069
5469
|
...e
|
|
5070
5470
|
}),
|
|
5071
|
-
FormSelect:
|
|
5072
|
-
FormFile:
|
|
5073
|
-
FormRecaptcha:
|
|
5074
|
-
FormSubmit:
|
|
5075
|
-
},
|
|
5471
|
+
FormSelect: tn,
|
|
5472
|
+
FormFile: nn,
|
|
5473
|
+
FormRecaptcha: Xt,
|
|
5474
|
+
FormSubmit: rn
|
|
5475
|
+
}, tr = {
|
|
5076
5476
|
id: "auth",
|
|
5077
5477
|
label: "Accounts",
|
|
5078
5478
|
category: "Apps",
|
|
5079
5479
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5080
5480
|
ssr: "shell",
|
|
5081
5481
|
settings: ["site.authRedirect"]
|
|
5082
|
-
},
|
|
5482
|
+
}, nr = t({
|
|
5083
5483
|
user: null,
|
|
5084
5484
|
status: "idle",
|
|
5085
5485
|
ensure: () => {},
|
|
5086
5486
|
refresh: () => {},
|
|
5087
5487
|
signOut: () => {}
|
|
5088
|
-
})
|
|
5089
|
-
|
|
5488
|
+
});
|
|
5489
|
+
function rr(e, t) {
|
|
5490
|
+
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5491
|
+
}
|
|
5492
|
+
function ir(e) {
|
|
5493
|
+
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);
|
|
5494
|
+
return {
|
|
5495
|
+
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5496
|
+
url: i,
|
|
5497
|
+
mePath: a,
|
|
5498
|
+
logoutPath: o,
|
|
5499
|
+
meUrl: rr(i, a),
|
|
5500
|
+
logoutUrl: rr(i, o),
|
|
5501
|
+
loginPage: r(n.loginPage),
|
|
5502
|
+
userPath: r(n.userPath),
|
|
5503
|
+
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5504
|
+
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5505
|
+
};
|
|
5506
|
+
}
|
|
5507
|
+
function ar(e, t) {
|
|
5508
|
+
if (!t) return e ?? null;
|
|
5509
|
+
let n = e;
|
|
5510
|
+
for (let e of t.split(".")) {
|
|
5511
|
+
if (!n || typeof n != "object") return null;
|
|
5512
|
+
n = n[e];
|
|
5513
|
+
}
|
|
5514
|
+
return n ?? null;
|
|
5515
|
+
}
|
|
5516
|
+
function or(e) {
|
|
5517
|
+
try {
|
|
5518
|
+
return window.localStorage.getItem(e) || "";
|
|
5519
|
+
} catch {
|
|
5520
|
+
return "";
|
|
5521
|
+
}
|
|
5522
|
+
}
|
|
5523
|
+
function sr(e) {
|
|
5524
|
+
try {
|
|
5525
|
+
window.localStorage.removeItem(e);
|
|
5526
|
+
} catch {}
|
|
5527
|
+
}
|
|
5528
|
+
var cr = () => {
|
|
5529
|
+
let e = r(nr);
|
|
5090
5530
|
return i(() => {
|
|
5091
5531
|
e.ensure();
|
|
5092
5532
|
}, [e]), e;
|
|
5093
5533
|
};
|
|
5094
|
-
function
|
|
5095
|
-
let f = r(
|
|
5534
|
+
function lr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
|
|
5535
|
+
let f = r(Y), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => ir(f?.settings), [f?.settings]), [g, _] = c(t ?? null), [v, y] = c(t ? "user" : a ? "guest" : "idle"), b = s(!1), x = n((e, t) => fetch(`${p}${e}`, {
|
|
5096
5536
|
...t,
|
|
5097
5537
|
credentials: "include",
|
|
5098
5538
|
headers: {
|
|
@@ -5100,61 +5540,93 @@ function Jn({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5100
5540
|
...m ? { "x-tenant": m } : {},
|
|
5101
5541
|
...t?.headers
|
|
5102
5542
|
}
|
|
5103
|
-
}), [p, m]),
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5543
|
+
}), [p, m]), S = n((e) => (_(e), y(e ? "user" : "guest"), e), []), C = n(() => {
|
|
5544
|
+
if (a) return Promise.resolve(null);
|
|
5545
|
+
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5546
|
+
if (h.mode === "custom") {
|
|
5547
|
+
let e = h.auth === "bearer" ? or(h.tokenKey) : "";
|
|
5548
|
+
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) => {
|
|
5549
|
+
let t = ar(e, h.userPath);
|
|
5550
|
+
return S(t && typeof t == "object" ? t : null);
|
|
5551
|
+
}).catch(() => S(null));
|
|
5552
|
+
}
|
|
5553
|
+
return x("/site/me").then((e) => e.ok ? e.json() : null).then((e) => S(e?.payload ?? null)).catch(() => S(null));
|
|
5554
|
+
}, [
|
|
5555
|
+
x,
|
|
5556
|
+
h,
|
|
5557
|
+
a,
|
|
5558
|
+
S
|
|
5559
|
+
]), w = n(() => {
|
|
5560
|
+
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5561
|
+
if (h.mode === "custom") {
|
|
5562
|
+
let e = h.auth === "bearer" ? or(h.tokenKey) : "";
|
|
5563
|
+
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5564
|
+
method: "post",
|
|
5565
|
+
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5566
|
+
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5567
|
+
h.auth === "bearer" && sr(h.tokenKey), S(null);
|
|
5568
|
+
});
|
|
5569
|
+
}
|
|
5570
|
+
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
5571
|
+
S(null);
|
|
5572
|
+
});
|
|
5573
|
+
}, [
|
|
5574
|
+
x,
|
|
5575
|
+
h,
|
|
5576
|
+
S
|
|
5577
|
+
]), T = n(() => {
|
|
5578
|
+
b.current || a || t || (b.current = !0, y("loading"), C());
|
|
5110
5579
|
}, [
|
|
5111
5580
|
a,
|
|
5112
5581
|
t,
|
|
5113
|
-
|
|
5114
|
-
]),
|
|
5115
|
-
user:
|
|
5116
|
-
status:
|
|
5117
|
-
ensure:
|
|
5118
|
-
refresh:
|
|
5119
|
-
signOut:
|
|
5582
|
+
C
|
|
5583
|
+
]), E = o(() => ({
|
|
5584
|
+
user: g,
|
|
5585
|
+
status: v,
|
|
5586
|
+
ensure: T,
|
|
5587
|
+
refresh: C,
|
|
5588
|
+
signOut: w
|
|
5120
5589
|
}), [
|
|
5121
|
-
|
|
5122
|
-
|
|
5590
|
+
g,
|
|
5591
|
+
v,
|
|
5592
|
+
T,
|
|
5123
5593
|
C,
|
|
5124
|
-
|
|
5125
|
-
S
|
|
5594
|
+
w
|
|
5126
5595
|
]);
|
|
5127
5596
|
return i(() => {
|
|
5128
5597
|
a || typeof window > "u" || (window.webim = {
|
|
5129
5598
|
...window.webim,
|
|
5130
|
-
user:
|
|
5131
|
-
status:
|
|
5132
|
-
|
|
5133
|
-
|
|
5599
|
+
user: g,
|
|
5600
|
+
status: v,
|
|
5601
|
+
loginUrl: h.loginPage || null,
|
|
5602
|
+
requireUser: () => b.current || t ? Promise.resolve(g) : C(),
|
|
5603
|
+
refresh: C,
|
|
5604
|
+
signOut: w
|
|
5134
5605
|
}, window.dispatchEvent(new CustomEvent("webim:session", { detail: {
|
|
5135
|
-
user:
|
|
5136
|
-
status:
|
|
5606
|
+
user: g,
|
|
5607
|
+
status: v
|
|
5137
5608
|
} })));
|
|
5138
5609
|
}, [
|
|
5139
5610
|
a,
|
|
5140
|
-
|
|
5141
|
-
|
|
5611
|
+
g,
|
|
5612
|
+
v,
|
|
5142
5613
|
t,
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5614
|
+
h.loginPage,
|
|
5615
|
+
C,
|
|
5616
|
+
w
|
|
5617
|
+
]), /* @__PURE__ */ u(nr.Provider, {
|
|
5618
|
+
value: E,
|
|
5147
5619
|
children: e
|
|
5148
5620
|
});
|
|
5149
5621
|
}
|
|
5150
|
-
function
|
|
5151
|
-
let { status: n } =
|
|
5622
|
+
function ur({ when: e, children: t }) {
|
|
5623
|
+
let { status: n } = cr();
|
|
5152
5624
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5153
5625
|
}
|
|
5154
5626
|
//#endregion
|
|
5155
5627
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5156
|
-
function
|
|
5157
|
-
let { tenant: h, apiUrl: g, settings: _ } = r(
|
|
5628
|
+
function dr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
|
|
5629
|
+
let { tenant: h, apiUrl: g, settings: _ } = r(Y), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
5158
5630
|
if (e.preventDefault(), f) return;
|
|
5159
5631
|
let n = new FormData(e.currentTarget);
|
|
5160
5632
|
C(!0), x("");
|
|
@@ -5202,20 +5674,20 @@ function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5202
5674
|
children: [
|
|
5203
5675
|
w ? /* @__PURE__ */ d("label", {
|
|
5204
5676
|
style: {
|
|
5205
|
-
...
|
|
5677
|
+
...Ft,
|
|
5206
5678
|
display: "grid",
|
|
5207
5679
|
gap: 6
|
|
5208
5680
|
},
|
|
5209
5681
|
children: [a, /* @__PURE__ */ u("input", {
|
|
5210
5682
|
name: "name",
|
|
5211
5683
|
type: "text",
|
|
5212
|
-
style:
|
|
5213
|
-
...
|
|
5684
|
+
style: It,
|
|
5685
|
+
...Rt(f)
|
|
5214
5686
|
})]
|
|
5215
5687
|
}) : null,
|
|
5216
5688
|
/* @__PURE__ */ d("label", {
|
|
5217
5689
|
style: {
|
|
5218
|
-
...
|
|
5690
|
+
...Ft,
|
|
5219
5691
|
display: "grid",
|
|
5220
5692
|
gap: 6
|
|
5221
5693
|
},
|
|
@@ -5223,13 +5695,13 @@ function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5223
5695
|
name: "email",
|
|
5224
5696
|
type: "email",
|
|
5225
5697
|
required: !f,
|
|
5226
|
-
style:
|
|
5227
|
-
...
|
|
5698
|
+
style: It,
|
|
5699
|
+
...Rt(f)
|
|
5228
5700
|
})]
|
|
5229
5701
|
}),
|
|
5230
5702
|
/* @__PURE__ */ d("label", {
|
|
5231
5703
|
style: {
|
|
5232
|
-
...
|
|
5704
|
+
...Ft,
|
|
5233
5705
|
display: "grid",
|
|
5234
5706
|
gap: 6
|
|
5235
5707
|
},
|
|
@@ -5237,8 +5709,8 @@ function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5237
5709
|
name: "password",
|
|
5238
5710
|
type: "password",
|
|
5239
5711
|
required: !f,
|
|
5240
|
-
style:
|
|
5241
|
-
...
|
|
5712
|
+
style: It,
|
|
5713
|
+
...Rt(f)
|
|
5242
5714
|
})]
|
|
5243
5715
|
}),
|
|
5244
5716
|
/* @__PURE__ */ u("button", {
|
|
@@ -5277,8 +5749,8 @@ function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5277
5749
|
]
|
|
5278
5750
|
});
|
|
5279
5751
|
}
|
|
5280
|
-
function
|
|
5281
|
-
let { user: c, status: l, signOut: f } =
|
|
5752
|
+
function fr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
5753
|
+
let { user: c, status: l, signOut: f } = cr(), p = a ? s || "user" : l, m = a ? {
|
|
5282
5754
|
name: "Ada Lovelace",
|
|
5283
5755
|
email: "ada@example.com"
|
|
5284
5756
|
} : c;
|
|
@@ -5299,7 +5771,7 @@ function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5299
5771
|
children: [
|
|
5300
5772
|
/* @__PURE__ */ d("span", {
|
|
5301
5773
|
style: {
|
|
5302
|
-
...
|
|
5774
|
+
...Ft,
|
|
5303
5775
|
fontWeight: 600
|
|
5304
5776
|
},
|
|
5305
5777
|
children: [
|
|
@@ -5310,7 +5782,7 @@ function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5310
5782
|
}),
|
|
5311
5783
|
n && m?.email ? /* @__PURE__ */ u("span", {
|
|
5312
5784
|
style: {
|
|
5313
|
-
...
|
|
5785
|
+
...Ft,
|
|
5314
5786
|
opacity: .7
|
|
5315
5787
|
},
|
|
5316
5788
|
children: m.email
|
|
@@ -5326,7 +5798,7 @@ function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5326
5798
|
fontSize: 14,
|
|
5327
5799
|
cursor: a ? "default" : "pointer"
|
|
5328
5800
|
},
|
|
5329
|
-
...
|
|
5801
|
+
...Rt(a),
|
|
5330
5802
|
children: t
|
|
5331
5803
|
})
|
|
5332
5804
|
]
|
|
@@ -5343,40 +5815,40 @@ function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5343
5815
|
}
|
|
5344
5816
|
//#endregion
|
|
5345
5817
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5346
|
-
var
|
|
5818
|
+
var pr = {
|
|
5347
5819
|
id: "consent",
|
|
5348
5820
|
label: "Cookie consent",
|
|
5349
5821
|
category: "Apps",
|
|
5350
5822
|
keys: ["CookieConsent"],
|
|
5351
5823
|
ssr: "shell",
|
|
5352
5824
|
settings: []
|
|
5353
|
-
},
|
|
5354
|
-
function
|
|
5825
|
+
}, mr = "webim.cookie_consent";
|
|
5826
|
+
function hr() {
|
|
5355
5827
|
try {
|
|
5356
|
-
let e = window.localStorage.getItem(
|
|
5828
|
+
let e = window.localStorage.getItem(mr), t = e ? JSON.parse(e) : null;
|
|
5357
5829
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5358
5830
|
} catch {
|
|
5359
5831
|
return "";
|
|
5360
5832
|
}
|
|
5361
5833
|
}
|
|
5362
|
-
function
|
|
5834
|
+
function gr(e) {
|
|
5363
5835
|
try {
|
|
5364
5836
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5365
5837
|
} catch {}
|
|
5366
5838
|
}
|
|
5367
|
-
function
|
|
5839
|
+
function _r(e) {
|
|
5368
5840
|
try {
|
|
5369
|
-
window.localStorage.setItem(
|
|
5841
|
+
window.localStorage.setItem(mr, JSON.stringify({
|
|
5370
5842
|
choice: e,
|
|
5371
5843
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5372
5844
|
}));
|
|
5373
5845
|
} catch {}
|
|
5374
|
-
|
|
5846
|
+
gr(e);
|
|
5375
5847
|
try {
|
|
5376
5848
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5377
5849
|
} catch {}
|
|
5378
5850
|
}
|
|
5379
|
-
var
|
|
5851
|
+
var vr = {
|
|
5380
5852
|
bottom: {
|
|
5381
5853
|
left: 0,
|
|
5382
5854
|
right: 0,
|
|
@@ -5398,18 +5870,18 @@ var rr = {
|
|
|
5398
5870
|
maxWidth: 400
|
|
5399
5871
|
}
|
|
5400
5872
|
};
|
|
5401
|
-
function
|
|
5873
|
+
function yr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
|
|
5402
5874
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
5403
5875
|
y(e), typeof m == "function" && m(e);
|
|
5404
5876
|
};
|
|
5405
5877
|
if (i(() => {
|
|
5406
5878
|
if (h) return;
|
|
5407
|
-
let e =
|
|
5408
|
-
e ?
|
|
5879
|
+
let e = hr();
|
|
5880
|
+
e ? gr(e) : _(!0);
|
|
5409
5881
|
}, [h, v]), !g) return null;
|
|
5410
5882
|
let x = (e) => () => {
|
|
5411
|
-
h || (
|
|
5412
|
-
}, S =
|
|
5883
|
+
h || (_r(e), _(!1));
|
|
5884
|
+
}, S = vr[s] ?? vr.bottom, C = {
|
|
5413
5885
|
appearance: "none",
|
|
5414
5886
|
font: "inherit",
|
|
5415
5887
|
fontSize: 14,
|
|
@@ -5489,37 +5961,37 @@ function ir({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
5489
5961
|
}
|
|
5490
5962
|
//#endregion
|
|
5491
5963
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
5492
|
-
var
|
|
5964
|
+
var br = {
|
|
5493
5965
|
id: "language",
|
|
5494
5966
|
label: "Language",
|
|
5495
5967
|
category: "Apps",
|
|
5496
5968
|
keys: ["SiteLanguagePicker"],
|
|
5497
5969
|
ssr: "prefetch",
|
|
5498
5970
|
settings: ["locales"]
|
|
5499
|
-
},
|
|
5971
|
+
}, xr = {
|
|
5500
5972
|
id: "search",
|
|
5501
5973
|
label: "Search",
|
|
5502
5974
|
category: "Apps",
|
|
5503
5975
|
keys: ["SiteSearch"],
|
|
5504
5976
|
ssr: "prefetch",
|
|
5505
5977
|
settings: []
|
|
5506
|
-
},
|
|
5507
|
-
function
|
|
5978
|
+
}, Sr = 50, Cr = 2e3;
|
|
5979
|
+
function wr() {
|
|
5508
5980
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
5509
5981
|
}
|
|
5510
|
-
function
|
|
5982
|
+
function Tr(e, t) {
|
|
5511
5983
|
let n = e?.data ?? {}, r = [];
|
|
5512
5984
|
for (let e of Object.values(n)) {
|
|
5513
|
-
let t = e == null ? "" :
|
|
5514
|
-
if (t && r.push(t), r.join(" ").length >
|
|
5985
|
+
let t = e == null ? "" : Te(e);
|
|
5986
|
+
if (t && r.push(t), r.join(" ").length > Cr) break;
|
|
5515
5987
|
}
|
|
5516
|
-
return r.join(" ").slice(0,
|
|
5988
|
+
return r.join(" ").slice(0, Cr).toLocaleLowerCase(t || void 0);
|
|
5517
5989
|
}
|
|
5518
|
-
function
|
|
5519
|
-
let { tenant: b, apiUrl: x, locale: S } = r(
|
|
5990
|
+
function Er({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
|
|
5991
|
+
let { tenant: b, apiUrl: x, locale: S } = r(Y), [C, w] = c(() => wr()), [T, E] = c(() => wr()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
|
|
5520
5992
|
i(() => {
|
|
5521
5993
|
let e = () => {
|
|
5522
|
-
let e =
|
|
5994
|
+
let e = wr();
|
|
5523
5995
|
w(e), E(e);
|
|
5524
5996
|
};
|
|
5525
5997
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -5570,8 +6042,8 @@ function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5570
6042
|
});
|
|
5571
6043
|
}
|
|
5572
6044
|
else for (let t of e.rows) {
|
|
5573
|
-
if (!
|
|
5574
|
-
let n = t?.data ?? {}, r =
|
|
6045
|
+
if (!Tr(t, S).includes(P)) continue;
|
|
6046
|
+
let n = t?.data ?? {}, r = Te(n.name) || "Untitled", i = Te(n.slug);
|
|
5575
6047
|
F.push({
|
|
5576
6048
|
key: `entry:${t.id}`,
|
|
5577
6049
|
title: r,
|
|
@@ -5579,7 +6051,7 @@ function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5579
6051
|
kind: "entry"
|
|
5580
6052
|
});
|
|
5581
6053
|
}
|
|
5582
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
6054
|
+
let I = F.slice(0, Math.min(Math.max(1, p), Sr)), L = (e) => {
|
|
5583
6055
|
if (v) {
|
|
5584
6056
|
e.preventDefault(), w(T), j(!0);
|
|
5585
6057
|
return;
|
|
@@ -5661,7 +6133,7 @@ function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5661
6133
|
onChange: (e) => E(e.target.value),
|
|
5662
6134
|
onFocus: () => P && j(!0),
|
|
5663
6135
|
style: {
|
|
5664
|
-
...
|
|
6136
|
+
...It,
|
|
5665
6137
|
flexGrow: 1,
|
|
5666
6138
|
minWidth: 0
|
|
5667
6139
|
}
|
|
@@ -5719,21 +6191,21 @@ function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5719
6191
|
}
|
|
5720
6192
|
//#endregion
|
|
5721
6193
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
5722
|
-
function
|
|
6194
|
+
function Dr(e) {
|
|
5723
6195
|
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());
|
|
5724
6196
|
return [...new Set(n.map((e) => e.trim()))];
|
|
5725
6197
|
}
|
|
5726
|
-
var
|
|
5727
|
-
function
|
|
6198
|
+
var Or = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6199
|
+
function kr(e, t) {
|
|
5728
6200
|
let n = String(e ?? "").toUpperCase();
|
|
5729
6201
|
if (t === "code") return n;
|
|
5730
6202
|
let r = "";
|
|
5731
6203
|
try {
|
|
5732
|
-
r =
|
|
6204
|
+
r = Or(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
5733
6205
|
} catch {}
|
|
5734
6206
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
5735
6207
|
}
|
|
5736
|
-
function
|
|
6208
|
+
function Ar(e, t) {
|
|
5737
6209
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
5738
6210
|
if (typeof window > "u") return n || "?";
|
|
5739
6211
|
try {
|
|
@@ -5743,8 +6215,8 @@ function hr(e, t) {
|
|
|
5743
6215
|
return n || "/";
|
|
5744
6216
|
}
|
|
5745
6217
|
}
|
|
5746
|
-
function
|
|
5747
|
-
let c = r(
|
|
6218
|
+
function jr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
|
|
6219
|
+
let c = r(Y), l = Dr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
|
|
5748
6220
|
display: "inline-flex",
|
|
5749
6221
|
alignItems: "center",
|
|
5750
6222
|
gap: 8,
|
|
@@ -5779,7 +6251,7 @@ function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5779
6251
|
style: { opacity: .4 },
|
|
5780
6252
|
children: n ?? "·"
|
|
5781
6253
|
}), /* @__PURE__ */ u("a", {
|
|
5782
|
-
href:
|
|
6254
|
+
href: Ar(e, e === f),
|
|
5783
6255
|
hrefLang: e,
|
|
5784
6256
|
"aria-current": e === p ? "true" : void 0,
|
|
5785
6257
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -5789,7 +6261,7 @@ function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5789
6261
|
textDecoration: "none",
|
|
5790
6262
|
cursor: s ? "default" : "pointer"
|
|
5791
6263
|
},
|
|
5792
|
-
children:
|
|
6264
|
+
children: kr(e, t)
|
|
5793
6265
|
})]
|
|
5794
6266
|
}, e))]
|
|
5795
6267
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -5800,7 +6272,7 @@ function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5800
6272
|
value: p,
|
|
5801
6273
|
onChange: s ? void 0 : (e) => {
|
|
5802
6274
|
let t = e.target.value;
|
|
5803
|
-
window.location.assign(
|
|
6275
|
+
window.location.assign(Ar(t, t === f));
|
|
5804
6276
|
},
|
|
5805
6277
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
5806
6278
|
style: {
|
|
@@ -5814,57 +6286,57 @@ function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5814
6286
|
},
|
|
5815
6287
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
5816
6288
|
value: e,
|
|
5817
|
-
children:
|
|
6289
|
+
children: kr(e, t)
|
|
5818
6290
|
}, e))
|
|
5819
6291
|
})]
|
|
5820
6292
|
});
|
|
5821
6293
|
}
|
|
5822
6294
|
//#endregion
|
|
5823
6295
|
//#region ../ui/src/components/builder/apps/index.js
|
|
5824
|
-
var
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
],
|
|
5830
|
-
SiteLoginForm:
|
|
5831
|
-
SiteAccountMenu:
|
|
5832
|
-
SiteLanguagePicker:
|
|
5833
|
-
CookieConsent:
|
|
5834
|
-
SiteSearch:
|
|
6296
|
+
var Mr = [
|
|
6297
|
+
tr,
|
|
6298
|
+
br,
|
|
6299
|
+
pr,
|
|
6300
|
+
xr
|
|
6301
|
+
], Nr = {
|
|
6302
|
+
SiteLoginForm: dr,
|
|
6303
|
+
SiteAccountMenu: fr,
|
|
6304
|
+
SiteLanguagePicker: jr,
|
|
6305
|
+
CookieConsent: yr,
|
|
6306
|
+
SiteSearch: Er
|
|
5835
6307
|
};
|
|
5836
|
-
new Set(
|
|
6308
|
+
new Set(Mr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
5837
6309
|
//#endregion
|
|
5838
6310
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
5839
|
-
var
|
|
5840
|
-
function
|
|
5841
|
-
if (
|
|
6311
|
+
var Pr = /* @__PURE__ */ new Map();
|
|
6312
|
+
function Fr(e) {
|
|
6313
|
+
if (Pr.has(e)) return Pr.get(e);
|
|
5842
6314
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
5843
6315
|
/* @vite-ignore */
|
|
5844
6316
|
/* webpackIgnore: true */
|
|
5845
6317
|
t
|
|
5846
6318
|
).finally(() => URL.revokeObjectURL(t));
|
|
5847
|
-
return
|
|
6319
|
+
return Pr.set(e, n), n;
|
|
5848
6320
|
}
|
|
5849
|
-
function
|
|
6321
|
+
function Ir(e) {
|
|
5850
6322
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
5851
6323
|
return n && typeof n == "object" ? n : {};
|
|
5852
6324
|
}
|
|
5853
6325
|
//#endregion
|
|
5854
6326
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
5855
|
-
async function
|
|
5856
|
-
let n = await
|
|
6327
|
+
async function Lr(e, t) {
|
|
6328
|
+
let n = await Fr(e);
|
|
5857
6329
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
5858
6330
|
}
|
|
5859
|
-
var
|
|
6331
|
+
var Rr = {
|
|
5860
6332
|
padding: "10px 12px",
|
|
5861
6333
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
5862
6334
|
borderRadius: 8,
|
|
5863
6335
|
fontSize: 12,
|
|
5864
6336
|
opacity: .6
|
|
5865
6337
|
};
|
|
5866
|
-
function
|
|
5867
|
-
let c = r(
|
|
6338
|
+
function zr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
6339
|
+
let c = r(Y), l = Ir(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
5868
6340
|
tenant: c?.tenant ?? "",
|
|
5869
6341
|
apiUrl: c?.apiUrl ?? "/api",
|
|
5870
6342
|
locale: c?.locale ?? "",
|
|
@@ -5876,7 +6348,7 @@ function wr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5876
6348
|
let e = f.current;
|
|
5877
6349
|
if (!l?.code || !e) return;
|
|
5878
6350
|
let n = !0;
|
|
5879
|
-
return
|
|
6351
|
+
return Lr(l.code, t).then((e) => {
|
|
5880
6352
|
if (!(!n || !e || !f.current)) {
|
|
5881
6353
|
p.current = e;
|
|
5882
6354
|
try {
|
|
@@ -5906,7 +6378,7 @@ function wr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5906
6378
|
}) : /* @__PURE__ */ d("div", {
|
|
5907
6379
|
ref: o,
|
|
5908
6380
|
style: {
|
|
5909
|
-
...
|
|
6381
|
+
...Rr,
|
|
5910
6382
|
...A(a)
|
|
5911
6383
|
},
|
|
5912
6384
|
children: [
|
|
@@ -5918,12 +6390,12 @@ function wr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5918
6390
|
}
|
|
5919
6391
|
//#endregion
|
|
5920
6392
|
//#region ../ui/src/components/builder/render.jsx
|
|
5921
|
-
var
|
|
5922
|
-
...
|
|
5923
|
-
...
|
|
5924
|
-
PluginBlock:
|
|
6393
|
+
var Br = {
|
|
6394
|
+
...er,
|
|
6395
|
+
...Nr,
|
|
6396
|
+
PluginBlock: zr
|
|
5925
6397
|
};
|
|
5926
|
-
function
|
|
6398
|
+
function Vr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
5927
6399
|
let o = n[t];
|
|
5928
6400
|
if (!o || o.hidden) return null;
|
|
5929
6401
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -5931,11 +6403,11 @@ function Er(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5931
6403
|
let n = o.props?.componentId, s = r?.[n];
|
|
5932
6404
|
if (!s?.template || i.has(n)) return null;
|
|
5933
6405
|
let c = new Set(i).add(n);
|
|
5934
|
-
return /* @__PURE__ */ u(e, { children:
|
|
6406
|
+
return /* @__PURE__ */ u(e, { children: Vr(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
5935
6407
|
}
|
|
5936
|
-
let l =
|
|
6408
|
+
let l = Br[s];
|
|
5937
6409
|
if (!l) return null;
|
|
5938
|
-
let d = (o.nodes ?? []).map((e) =>
|
|
6410
|
+
let d = (o.nodes ?? []).map((e) => Vr(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Vr(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
5939
6411
|
...c,
|
|
5940
6412
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
5941
6413
|
linked: p,
|
|
@@ -5944,16 +6416,16 @@ function Er(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5944
6416
|
},
|
|
5945
6417
|
children: d.length ? d : void 0
|
|
5946
6418
|
}, t);
|
|
5947
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
6419
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(ur, {
|
|
5948
6420
|
when: c.when,
|
|
5949
6421
|
children: m
|
|
5950
6422
|
}, t) : m;
|
|
5951
6423
|
}
|
|
5952
6424
|
//#endregion
|
|
5953
6425
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
5954
|
-
var
|
|
5955
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
5956
|
-
function
|
|
6426
|
+
var Hr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Ur = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(le(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
6427
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(le(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
6428
|
+
function Wr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, animations: c, tenant: l, apiUrl: f, datasets: p, locale: m, direction: h, settings: _, siteUser: v }) {
|
|
5957
6429
|
let b = s?.js?.trim();
|
|
5958
6430
|
if (i(() => {
|
|
5959
6431
|
if (!b) return;
|
|
@@ -5962,40 +6434,40 @@ function kr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5962
6434
|
}, [b]), !e?.ROOT) return null;
|
|
5963
6435
|
let x = {
|
|
5964
6436
|
lang: m || void 0,
|
|
5965
|
-
dir:
|
|
6437
|
+
dir: ye(h, m)
|
|
5966
6438
|
}, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
|
|
5967
6439
|
minHeight: "100%",
|
|
5968
6440
|
display: "flex",
|
|
5969
6441
|
flexDirection: "column"
|
|
5970
|
-
}, w =
|
|
6442
|
+
}, w = Vr("ROOT", e, n), T = o(() => ({ render: (t, r) => Vr(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = K(e, n), O = G(e, n), k = s?.css?.trim(), A = E(c), j = ce(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !J[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
|
|
5971
6443
|
rel: "stylesheet",
|
|
5972
6444
|
precedence: "default",
|
|
5973
6445
|
href: g(e)
|
|
5974
|
-
}, e)), P =
|
|
5975
|
-
return r === "auto" ? /* @__PURE__ */ u(
|
|
6446
|
+
}, e)), P = Ur(j);
|
|
6447
|
+
return r === "auto" ? /* @__PURE__ */ u(Y.Provider, {
|
|
5976
6448
|
value: {
|
|
5977
6449
|
tenant: l || "",
|
|
5978
6450
|
apiUrl: f || "/api",
|
|
5979
6451
|
locale: m || "",
|
|
5980
6452
|
settings: _ ?? null
|
|
5981
6453
|
},
|
|
5982
|
-
children: /* @__PURE__ */ u(
|
|
6454
|
+
children: /* @__PURE__ */ u(lr, {
|
|
5983
6455
|
initialUser: v,
|
|
5984
|
-
children: /* @__PURE__ */ u(
|
|
6456
|
+
children: /* @__PURE__ */ u(be.Provider, {
|
|
5985
6457
|
value: p ?? null,
|
|
5986
|
-
children: /* @__PURE__ */ u(
|
|
6458
|
+
children: /* @__PURE__ */ u(Z.Provider, {
|
|
5987
6459
|
value: T,
|
|
5988
6460
|
children: /* @__PURE__ */ d("div", {
|
|
5989
6461
|
...x,
|
|
5990
6462
|
className: "webim-page",
|
|
5991
6463
|
style: {
|
|
5992
6464
|
...C,
|
|
5993
|
-
...
|
|
6465
|
+
...ue(t),
|
|
5994
6466
|
...a
|
|
5995
6467
|
},
|
|
5996
6468
|
children: [
|
|
5997
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
5998
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
6469
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${Hr(le(j.light))} }
|
|
6470
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Hr(le(j.dark))} } }` }),
|
|
5999
6471
|
/* @__PURE__ */ u("style", { children: P }),
|
|
6000
6472
|
N,
|
|
6001
6473
|
/* @__PURE__ */ u("style", { children: S }),
|
|
@@ -6008,25 +6480,25 @@ function kr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
6008
6480
|
})
|
|
6009
6481
|
})
|
|
6010
6482
|
})
|
|
6011
|
-
}) : /* @__PURE__ */ u(
|
|
6483
|
+
}) : /* @__PURE__ */ u(Y.Provider, {
|
|
6012
6484
|
value: {
|
|
6013
6485
|
tenant: l || "",
|
|
6014
6486
|
apiUrl: f || "/api",
|
|
6015
6487
|
locale: m || "",
|
|
6016
6488
|
settings: _ ?? null
|
|
6017
6489
|
},
|
|
6018
|
-
children: /* @__PURE__ */ u(
|
|
6490
|
+
children: /* @__PURE__ */ u(lr, {
|
|
6019
6491
|
initialUser: v,
|
|
6020
|
-
children: /* @__PURE__ */ u(
|
|
6492
|
+
children: /* @__PURE__ */ u(be.Provider, {
|
|
6021
6493
|
value: p ?? null,
|
|
6022
|
-
children: /* @__PURE__ */ u(
|
|
6494
|
+
children: /* @__PURE__ */ u(Z.Provider, {
|
|
6023
6495
|
value: T,
|
|
6024
6496
|
children: /* @__PURE__ */ d("div", {
|
|
6025
6497
|
...x,
|
|
6026
6498
|
className: "webim-page",
|
|
6027
6499
|
style: {
|
|
6028
6500
|
...C,
|
|
6029
|
-
...
|
|
6501
|
+
...de(t, r),
|
|
6030
6502
|
...a
|
|
6031
6503
|
},
|
|
6032
6504
|
children: [
|
|
@@ -6048,8 +6520,8 @@ function kr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
6048
6520
|
}
|
|
6049
6521
|
//#endregion
|
|
6050
6522
|
//#region src/WebimContent.jsx
|
|
6051
|
-
function
|
|
6052
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
6523
|
+
function Gr({ bundle: e, mode: t = "auto", style: n }) {
|
|
6524
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(Wr, {
|
|
6053
6525
|
blocks: e.blocks,
|
|
6054
6526
|
theme: e.theme,
|
|
6055
6527
|
components: e.components,
|
|
@@ -6061,13 +6533,13 @@ function Ar({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
6061
6533
|
locale: e.locale,
|
|
6062
6534
|
direction: e.direction,
|
|
6063
6535
|
settings: e.settings,
|
|
6064
|
-
mode:
|
|
6536
|
+
mode: pe(t, e.scheme),
|
|
6065
6537
|
style: n
|
|
6066
6538
|
}) : null;
|
|
6067
6539
|
}
|
|
6068
6540
|
//#endregion
|
|
6069
6541
|
//#region src/WebimPage.jsx
|
|
6070
|
-
function
|
|
6542
|
+
function Kr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
|
|
6071
6543
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
6072
6544
|
onLoad: m,
|
|
6073
6545
|
onError: h
|
|
@@ -6077,7 +6549,7 @@ function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
6077
6549
|
onError: h
|
|
6078
6550
|
}, i(() => {
|
|
6079
6551
|
let i = !0;
|
|
6080
|
-
return _({ status: "loading" }),
|
|
6552
|
+
return _({ status: "loading" }), ge({
|
|
6081
6553
|
apiUrl: e,
|
|
6082
6554
|
tenant: t,
|
|
6083
6555
|
slug: n,
|
|
@@ -6104,11 +6576,11 @@ function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
6104
6576
|
r,
|
|
6105
6577
|
a,
|
|
6106
6578
|
o
|
|
6107
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
6579
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Gr, {
|
|
6108
6580
|
bundle: g.bundle,
|
|
6109
6581
|
mode: l,
|
|
6110
6582
|
style: d
|
|
6111
6583
|
});
|
|
6112
6584
|
}
|
|
6113
6585
|
//#endregion
|
|
6114
|
-
export {
|
|
6586
|
+
export { Wr as PageRenderer, Gr as WebimContent, Kr as WebimPage, ge as fetchPage, qe as renderRichContent, fe as resolveTheme };
|