webim-adapter 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +358 -293
- package/build/webim-embed.js +9 -9
- package/build/webim-ssr.js +363 -298
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -202,26 +202,26 @@ function C(e) {
|
|
|
202
202
|
delete t.textStrokeWidth, delete t.textStrokeColor, (re !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${x(re ?? 1)} ${ie || "currentColor"}`);
|
|
203
203
|
let { clipText: H } = t;
|
|
204
204
|
delete t.clipText, H && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
205
|
-
let { transitions: U, transitionDuration: W, transitionEasing: ae, transitionProperty:
|
|
205
|
+
let { transitions: U, transitionDuration: W, transitionEasing: ae, transitionProperty: oe } = t, G = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
206
206
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
207
|
-
let
|
|
208
|
-
if (W !== void 0 &&
|
|
207
|
+
let se = (Array.isArray(U) ? U : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${G(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
208
|
+
if (W !== void 0 && se.push(`${oe || "all"} ${G(W)} ${ae || "ease"}`), se.length && (t.transition = se.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
209
209
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
210
210
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
211
211
|
}
|
|
212
212
|
delete t.backgroundVideo;
|
|
213
|
-
let { overlayColor:
|
|
214
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
215
|
-
let e = `color-mix(in srgb, ${
|
|
213
|
+
let { overlayColor: K, overlayOpacity: ce } = t;
|
|
214
|
+
if (delete t.overlayColor, delete t.overlayOpacity, K) {
|
|
215
|
+
let e = `color-mix(in srgb, ${K} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
216
216
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
217
217
|
}
|
|
218
218
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
219
219
|
let { backgroundLayers: le } = t;
|
|
220
220
|
delete t.backgroundLayers;
|
|
221
|
-
let
|
|
222
|
-
if (
|
|
221
|
+
let ue = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
|
|
222
|
+
if (ue.length) {
|
|
223
223
|
let e = [], n = [], r = [], i = [], a = [];
|
|
224
|
-
for (let t of
|
|
224
|
+
for (let t of ue) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
225
225
|
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");
|
|
226
226
|
else {
|
|
227
227
|
if (!t.src) continue;
|
|
@@ -433,11 +433,17 @@ var H = n({
|
|
|
433
433
|
apiUrl: "/api",
|
|
434
434
|
locale: "",
|
|
435
435
|
settings: null
|
|
436
|
-
}), U = n(null), W =
|
|
436
|
+
}), U = n(null), W = (e) => {
|
|
437
|
+
let t = Number(e?.__page);
|
|
438
|
+
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
439
|
+
if (typeof window > "u") return 1;
|
|
440
|
+
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
441
|
+
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
442
|
+
}, ae = n(null), oe = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
437
443
|
function G(e, t) {
|
|
438
444
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
439
445
|
}
|
|
440
|
-
var
|
|
446
|
+
var se = (e) => {
|
|
441
447
|
let t = [];
|
|
442
448
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
443
449
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -450,33 +456,33 @@ var oe = (e) => {
|
|
|
450
456
|
function K(e) {
|
|
451
457
|
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 ?? "") : 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(" ") : "";
|
|
452
458
|
}
|
|
453
|
-
function
|
|
454
|
-
let n = t?.data ?? {}, r =
|
|
459
|
+
function ce(e, t) {
|
|
460
|
+
let n = t?.data ?? {}, r = se(n);
|
|
455
461
|
if (!r.length) return e;
|
|
456
|
-
let i = RegExp(`:(${r.map(
|
|
462
|
+
let i = RegExp(`:(${r.map(oe).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(G(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
457
463
|
return a(e);
|
|
458
464
|
}
|
|
459
|
-
var
|
|
465
|
+
var le = {
|
|
460
466
|
margin: 0,
|
|
461
467
|
fontWeight: 700,
|
|
462
468
|
lineHeight: 1.2,
|
|
463
469
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
464
|
-
},
|
|
470
|
+
}, ue = { margin: 0 }, q = {
|
|
465
471
|
display: "inline-block",
|
|
466
472
|
textDecoration: "none",
|
|
467
473
|
cursor: "pointer",
|
|
468
474
|
backgroundColor: "var(--page-accent, #111827)",
|
|
469
475
|
color: "var(--page-accent-text, #ffffff)"
|
|
470
|
-
},
|
|
476
|
+
}, de = {
|
|
471
477
|
flexGrow: 1,
|
|
472
478
|
display: "flex",
|
|
473
479
|
flexDirection: "column",
|
|
474
480
|
position: "relative"
|
|
475
|
-
},
|
|
481
|
+
}, fe = {
|
|
476
482
|
display: "flex",
|
|
477
483
|
flexDirection: "column"
|
|
478
484
|
};
|
|
479
|
-
function
|
|
485
|
+
function pe({ style: e }) {
|
|
480
486
|
let t = e?.backgroundVideo;
|
|
481
487
|
if (!t) return null;
|
|
482
488
|
let n = {
|
|
@@ -502,7 +508,7 @@ function fe({ style: e }) {
|
|
|
502
508
|
background: r
|
|
503
509
|
} })] });
|
|
504
510
|
}
|
|
505
|
-
var
|
|
511
|
+
var me = (e, t) => e?.backgroundVideo ? {
|
|
506
512
|
position: "relative",
|
|
507
513
|
...t,
|
|
508
514
|
...C(e)
|
|
@@ -510,24 +516,24 @@ var pe = (e, t) => e?.backgroundVideo ? {
|
|
|
510
516
|
...t,
|
|
511
517
|
...C(e)
|
|
512
518
|
};
|
|
513
|
-
function
|
|
519
|
+
function he({ style: e, nodeRef: t, children: n }) {
|
|
514
520
|
return /* @__PURE__ */ f("div", {
|
|
515
521
|
ref: t,
|
|
516
522
|
style: {
|
|
517
|
-
...
|
|
523
|
+
...de,
|
|
518
524
|
...C(e)
|
|
519
525
|
},
|
|
520
|
-
children: [/* @__PURE__ */ d(
|
|
526
|
+
children: [/* @__PURE__ */ d(pe, { style: e }), n]
|
|
521
527
|
});
|
|
522
528
|
}
|
|
523
|
-
function
|
|
529
|
+
function ge({ style: e, nodeRef: t, children: n }) {
|
|
524
530
|
return /* @__PURE__ */ f("section", {
|
|
525
531
|
ref: t,
|
|
526
|
-
style:
|
|
527
|
-
children: [/* @__PURE__ */ d(
|
|
532
|
+
style: me(e, fe),
|
|
533
|
+
children: [/* @__PURE__ */ d(pe, { style: e }), n]
|
|
528
534
|
});
|
|
529
535
|
}
|
|
530
|
-
function
|
|
536
|
+
function _e({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
531
537
|
let i = t ? {
|
|
532
538
|
position: "relative",
|
|
533
539
|
minHeight: 240
|
|
@@ -536,32 +542,32 @@ function ge({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
536
542
|
ref: n,
|
|
537
543
|
style: i ? {
|
|
538
544
|
...i,
|
|
539
|
-
...
|
|
540
|
-
} :
|
|
541
|
-
children: [/* @__PURE__ */ d(
|
|
545
|
+
...me(e)
|
|
546
|
+
} : me(e),
|
|
547
|
+
children: [/* @__PURE__ */ d(pe, { style: e }), r]
|
|
542
548
|
});
|
|
543
549
|
}
|
|
544
|
-
function
|
|
550
|
+
function ve({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
545
551
|
return /* @__PURE__ */ d(n, {
|
|
546
552
|
ref: a,
|
|
547
553
|
style: {
|
|
548
|
-
...
|
|
554
|
+
...le,
|
|
549
555
|
...C(r)
|
|
550
556
|
},
|
|
551
557
|
children: J(t, e, i)
|
|
552
558
|
});
|
|
553
559
|
}
|
|
554
|
-
var
|
|
560
|
+
var ye = {
|
|
555
561
|
fontFamily: z.mono.value,
|
|
556
562
|
background: "rgba(148, 163, 184, 0.18)",
|
|
557
563
|
padding: "1px 5px",
|
|
558
564
|
borderRadius: 4,
|
|
559
565
|
fontSize: "0.9em"
|
|
560
566
|
};
|
|
561
|
-
function
|
|
567
|
+
function be(e, t = [], n, r) {
|
|
562
568
|
let i = e;
|
|
563
569
|
return t.includes("sup") ? i = /* @__PURE__ */ d("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ d("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ d("code", {
|
|
564
|
-
style:
|
|
570
|
+
style: ye,
|
|
565
571
|
children: i
|
|
566
572
|
})), t.includes("strike") && (i = /* @__PURE__ */ d("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ d("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ d("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ d("strong", { children: i })), n && (i = /* @__PURE__ */ d("a", {
|
|
567
573
|
href: n,
|
|
@@ -577,7 +583,7 @@ function J(e, n, r) {
|
|
|
577
583
|
if (e.parts) return /* @__PURE__ */ d(t, { children: J(e.parts, "", r) }, n);
|
|
578
584
|
let i = e.text;
|
|
579
585
|
return e.sup ? i = /* @__PURE__ */ d("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ d("sub", { children: i })), e.code && (i = /* @__PURE__ */ d("code", {
|
|
580
|
-
style:
|
|
586
|
+
style: ye,
|
|
581
587
|
children: i
|
|
582
588
|
})), e.strike && (i = /* @__PURE__ */ d("s", { children: i })), e.underline && (i = /* @__PURE__ */ d("u", { children: i })), e.italic && (i = /* @__PURE__ */ d("em", { children: i })), e.bold && (i = /* @__PURE__ */ d("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ d("span", {
|
|
583
589
|
style: {
|
|
@@ -594,13 +600,13 @@ function J(e, n, r) {
|
|
|
594
600
|
})), /* @__PURE__ */ d(t, { children: i }, n);
|
|
595
601
|
}) : n;
|
|
596
602
|
}
|
|
597
|
-
function
|
|
603
|
+
function xe({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
598
604
|
return /* @__PURE__ */ d("span", {
|
|
599
605
|
style: C(a),
|
|
600
|
-
children: e?.length ? J(e, t) :
|
|
606
|
+
children: e?.length ? J(e, t) : be(t, n, r, i)
|
|
601
607
|
});
|
|
602
608
|
}
|
|
603
|
-
var
|
|
609
|
+
var Se = {
|
|
604
610
|
h1: 40,
|
|
605
611
|
h2: 32,
|
|
606
612
|
h3: 26,
|
|
@@ -608,7 +614,7 @@ var xe = {
|
|
|
608
614
|
h5: 19,
|
|
609
615
|
h6: 16
|
|
610
616
|
};
|
|
611
|
-
function
|
|
617
|
+
function Ce({ align: e = "center", width: t, wrap: n } = {}) {
|
|
612
618
|
let r = t ? `${t}%` : void 0;
|
|
613
619
|
if (e === "full") return { width: "100%" };
|
|
614
620
|
let i = e === "left" || e === "right";
|
|
@@ -642,7 +648,7 @@ function Se({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
642
648
|
marginRight: "auto"
|
|
643
649
|
};
|
|
644
650
|
}
|
|
645
|
-
function
|
|
651
|
+
function we(e = [], t, n) {
|
|
646
652
|
let r = n ?? ((e, n) => J(e, n, t));
|
|
647
653
|
return e.map((t, n) => {
|
|
648
654
|
let i = {
|
|
@@ -665,7 +671,7 @@ function Ce(e = [], t, n) {
|
|
|
665
671
|
marginLeft: 0,
|
|
666
672
|
marginRight: 0,
|
|
667
673
|
...i,
|
|
668
|
-
...
|
|
674
|
+
...Ce(t)
|
|
669
675
|
},
|
|
670
676
|
children: [t.href ? /* @__PURE__ */ d("a", {
|
|
671
677
|
href: t.href,
|
|
@@ -684,16 +690,16 @@ function Ce(e = [], t, n) {
|
|
|
684
690
|
})]
|
|
685
691
|
}, n);
|
|
686
692
|
}
|
|
687
|
-
if (t.type === "video") return
|
|
693
|
+
if (t.type === "video") return Fe(t.url) ? /* @__PURE__ */ d("div", {
|
|
688
694
|
style: {
|
|
689
695
|
...i,
|
|
690
|
-
...
|
|
696
|
+
...Ce({
|
|
691
697
|
align: t.align,
|
|
692
698
|
wrap: t.wrap,
|
|
693
699
|
width: t.width ?? 100
|
|
694
700
|
})
|
|
695
701
|
},
|
|
696
|
-
children: /* @__PURE__ */ d(
|
|
702
|
+
children: /* @__PURE__ */ d(Ie, {
|
|
697
703
|
url: t.url,
|
|
698
704
|
autoplay: t.autoplay,
|
|
699
705
|
muted: t.muted,
|
|
@@ -722,17 +728,17 @@ function Ce(e = [], t, n) {
|
|
|
722
728
|
}
|
|
723
729
|
if (t.type === "quote") return /* @__PURE__ */ d("blockquote", {
|
|
724
730
|
style: {
|
|
725
|
-
...
|
|
731
|
+
...Ee,
|
|
726
732
|
...i
|
|
727
733
|
},
|
|
728
734
|
children: r(t.parts, t.text)
|
|
729
735
|
}, n);
|
|
730
|
-
if (
|
|
736
|
+
if (Se[t.type]) {
|
|
731
737
|
let e = t.type;
|
|
732
738
|
return /* @__PURE__ */ d(e, {
|
|
733
739
|
style: {
|
|
734
|
-
...
|
|
735
|
-
fontSize:
|
|
740
|
+
...le,
|
|
741
|
+
fontSize: Se[t.type],
|
|
736
742
|
...i
|
|
737
743
|
},
|
|
738
744
|
children: r(t.parts, t.text)
|
|
@@ -740,39 +746,39 @@ function Ce(e = [], t, n) {
|
|
|
740
746
|
}
|
|
741
747
|
return /* @__PURE__ */ d("p", {
|
|
742
748
|
style: {
|
|
743
|
-
...
|
|
749
|
+
...ue,
|
|
744
750
|
...i
|
|
745
751
|
},
|
|
746
752
|
children: r(t.parts, t.text)
|
|
747
753
|
}, n);
|
|
748
754
|
});
|
|
749
755
|
}
|
|
750
|
-
function
|
|
756
|
+
function Te({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
751
757
|
return /* @__PURE__ */ d("div", {
|
|
752
758
|
ref: r,
|
|
753
759
|
style: {
|
|
754
760
|
display: "flow-root",
|
|
755
761
|
...C(t)
|
|
756
762
|
},
|
|
757
|
-
children:
|
|
763
|
+
children: we(e, n)
|
|
758
764
|
});
|
|
759
765
|
}
|
|
760
|
-
var
|
|
766
|
+
var Ee = {
|
|
761
767
|
margin: 0,
|
|
762
768
|
padding: "8px 0 8px 20px",
|
|
763
769
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
764
770
|
};
|
|
765
|
-
function
|
|
771
|
+
function De({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
766
772
|
return /* @__PURE__ */ d("blockquote", {
|
|
767
773
|
ref: i,
|
|
768
774
|
style: {
|
|
769
|
-
...
|
|
775
|
+
...Ee,
|
|
770
776
|
...C(n)
|
|
771
777
|
},
|
|
772
778
|
children: J(t, e, r)
|
|
773
779
|
});
|
|
774
780
|
}
|
|
775
|
-
function
|
|
781
|
+
function Oe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
776
782
|
return /* @__PURE__ */ d(e ? "ol" : "ul", {
|
|
777
783
|
ref: r,
|
|
778
784
|
style: {
|
|
@@ -786,36 +792,36 @@ function De({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
786
792
|
}, t))
|
|
787
793
|
});
|
|
788
794
|
}
|
|
789
|
-
function
|
|
795
|
+
function ke({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
790
796
|
return /* @__PURE__ */ d("p", {
|
|
791
797
|
ref: i,
|
|
792
798
|
style: {
|
|
793
|
-
...
|
|
799
|
+
...ue,
|
|
794
800
|
...C(n)
|
|
795
801
|
},
|
|
796
802
|
children: J(t, e, r)
|
|
797
803
|
});
|
|
798
804
|
}
|
|
799
|
-
var
|
|
805
|
+
var Ae = {
|
|
800
806
|
color: "var(--page-accent, inherit)",
|
|
801
807
|
textDecoration: "underline",
|
|
802
808
|
textUnderlineOffset: 3,
|
|
803
809
|
cursor: "pointer"
|
|
804
810
|
};
|
|
805
|
-
function
|
|
811
|
+
function je({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
806
812
|
return /* @__PURE__ */ d("a", {
|
|
807
813
|
ref: o,
|
|
808
814
|
href: n || "#",
|
|
809
815
|
target: r || void 0,
|
|
810
816
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
811
817
|
style: {
|
|
812
|
-
...
|
|
818
|
+
...Ae,
|
|
813
819
|
...C(i)
|
|
814
820
|
},
|
|
815
821
|
children: J(t, e, a)
|
|
816
822
|
});
|
|
817
823
|
}
|
|
818
|
-
function
|
|
824
|
+
function Me({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
819
825
|
return /* @__PURE__ */ d("a", {
|
|
820
826
|
ref: o,
|
|
821
827
|
href: n || "#",
|
|
@@ -828,7 +834,7 @@ function je({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRe
|
|
|
828
834
|
children: J(t, e, a)
|
|
829
835
|
});
|
|
830
836
|
}
|
|
831
|
-
function
|
|
837
|
+
function Ne({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
832
838
|
return e ? /* @__PURE__ */ d("img", {
|
|
833
839
|
ref: r,
|
|
834
840
|
src: e,
|
|
@@ -840,7 +846,7 @@ function Me({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
840
846
|
}
|
|
841
847
|
}) : null;
|
|
842
848
|
}
|
|
843
|
-
function
|
|
849
|
+
function Pe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
844
850
|
return e ? /* @__PURE__ */ d("video", {
|
|
845
851
|
ref: s,
|
|
846
852
|
src: e,
|
|
@@ -858,9 +864,9 @@ function Ne({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
858
864
|
}
|
|
859
865
|
}) : null;
|
|
860
866
|
}
|
|
861
|
-
var
|
|
862
|
-
function
|
|
863
|
-
let c =
|
|
867
|
+
var Fe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
868
|
+
function Ie({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
869
|
+
let c = Fe(e);
|
|
864
870
|
if (!c) return null;
|
|
865
871
|
let l = new URLSearchParams({ rel: "0" });
|
|
866
872
|
return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ d("div", {
|
|
@@ -886,7 +892,7 @@ function Fe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
886
892
|
})
|
|
887
893
|
});
|
|
888
894
|
}
|
|
889
|
-
function
|
|
895
|
+
function Le({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
890
896
|
return e ? /* @__PURE__ */ d("iframe", {
|
|
891
897
|
ref: i,
|
|
892
898
|
src: e,
|
|
@@ -902,7 +908,7 @@ function Ie({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
902
908
|
}
|
|
903
909
|
}) : null;
|
|
904
910
|
}
|
|
905
|
-
function
|
|
911
|
+
function Re({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
906
912
|
let [i, o] = l(null);
|
|
907
913
|
return a(() => {
|
|
908
914
|
i && (i.innerHTML = e || "", t && i.querySelectorAll("script").forEach((e) => {
|
|
@@ -921,7 +927,7 @@ function Le({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
921
927
|
style: C(n)
|
|
922
928
|
});
|
|
923
929
|
}
|
|
924
|
-
function
|
|
930
|
+
function ze({ height: e, nodeRef: t }) {
|
|
925
931
|
return /* @__PURE__ */ d("div", {
|
|
926
932
|
ref: t,
|
|
927
933
|
style: {
|
|
@@ -931,7 +937,7 @@ function Re({ height: e, nodeRef: t }) {
|
|
|
931
937
|
}
|
|
932
938
|
});
|
|
933
939
|
}
|
|
934
|
-
function
|
|
940
|
+
function Be({ style: e, nodeRef: t }) {
|
|
935
941
|
return /* @__PURE__ */ d("div", {
|
|
936
942
|
ref: t,
|
|
937
943
|
style: {
|
|
@@ -942,7 +948,7 @@ function ze({ style: e, nodeRef: t }) {
|
|
|
942
948
|
}
|
|
943
949
|
});
|
|
944
950
|
}
|
|
945
|
-
var
|
|
951
|
+
var Ve = {
|
|
946
952
|
position: "absolute",
|
|
947
953
|
top: "50%",
|
|
948
954
|
transform: "translateY(-50%)",
|
|
@@ -959,7 +965,7 @@ var Be = {
|
|
|
959
965
|
alignItems: "center",
|
|
960
966
|
justifyContent: "center",
|
|
961
967
|
padding: 0
|
|
962
|
-
},
|
|
968
|
+
}, He = {
|
|
963
969
|
bottom: {
|
|
964
970
|
inset: "auto 0 0 0",
|
|
965
971
|
padding: "40px 24px 20px",
|
|
@@ -978,8 +984,8 @@ var Be = {
|
|
|
978
984
|
padding: 24,
|
|
979
985
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
980
986
|
}
|
|
981
|
-
},
|
|
982
|
-
function
|
|
987
|
+
}, Ue = 48;
|
|
988
|
+
function We({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
|
|
983
989
|
let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
|
|
984
990
|
if (a(() => {
|
|
985
991
|
if (!n || h || _ || e < 2) return;
|
|
@@ -995,7 +1001,7 @@ function Ue({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
995
1001
|
let b = (t) => m((t + e) % e), x = () => {
|
|
996
1002
|
if (!_) return;
|
|
997
1003
|
let { dx: e } = _;
|
|
998
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1004
|
+
v(null), e < -48 ? b(y + 1) : e > Ue && b(y - 1);
|
|
999
1005
|
};
|
|
1000
1006
|
return /* @__PURE__ */ f("div", {
|
|
1001
1007
|
ref: c,
|
|
@@ -1043,7 +1049,7 @@ function Ue({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1043
1049
|
type: "button",
|
|
1044
1050
|
"aria-label": "Previous slide",
|
|
1045
1051
|
style: {
|
|
1046
|
-
...
|
|
1052
|
+
...Ve,
|
|
1047
1053
|
left: 12
|
|
1048
1054
|
},
|
|
1049
1055
|
onClick: () => b(y - 1),
|
|
@@ -1053,7 +1059,7 @@ function Ue({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1053
1059
|
type: "button",
|
|
1054
1060
|
"aria-label": "Next slide",
|
|
1055
1061
|
style: {
|
|
1056
|
-
...
|
|
1062
|
+
...Ve,
|
|
1057
1063
|
right: 12
|
|
1058
1064
|
},
|
|
1059
1065
|
onClick: () => b(y + 1),
|
|
@@ -1087,7 +1093,7 @@ function Ue({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1087
1093
|
] })]
|
|
1088
1094
|
});
|
|
1089
1095
|
}
|
|
1090
|
-
var
|
|
1096
|
+
var Ge = (e, t) => ({
|
|
1091
1097
|
position: "absolute",
|
|
1092
1098
|
inset: 0,
|
|
1093
1099
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1095,18 +1101,18 @@ var We = (e, t) => ({
|
|
|
1095
1101
|
backgroundSize: "cover",
|
|
1096
1102
|
backgroundPosition: "center"
|
|
1097
1103
|
});
|
|
1098
|
-
function
|
|
1099
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1104
|
+
function Ke({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1105
|
+
return e.length ? /* @__PURE__ */ d(We, {
|
|
1100
1106
|
...r,
|
|
1101
1107
|
count: e.length,
|
|
1102
1108
|
renderSlide: (r) => {
|
|
1103
1109
|
let i = e[r];
|
|
1104
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1110
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: Ge(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
|
|
1105
1111
|
style: {
|
|
1106
1112
|
position: "absolute",
|
|
1107
1113
|
color: "#fff",
|
|
1108
1114
|
textAlign: n,
|
|
1109
|
-
...
|
|
1115
|
+
...He[t] ?? He.bottom
|
|
1110
1116
|
},
|
|
1111
1117
|
children: [i.title && /* @__PURE__ */ d("div", {
|
|
1112
1118
|
style: {
|
|
@@ -1126,13 +1132,13 @@ function Ge({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1126
1132
|
}
|
|
1127
1133
|
}) : null;
|
|
1128
1134
|
}
|
|
1129
|
-
function
|
|
1130
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1135
|
+
function qe({ slides: e = [], linked: t, ...n }) {
|
|
1136
|
+
return e.length ? /* @__PURE__ */ d(We, {
|
|
1131
1137
|
...n,
|
|
1132
1138
|
count: e.length,
|
|
1133
1139
|
renderSlide: (n) => {
|
|
1134
1140
|
let r = e[n];
|
|
1135
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1141
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: Ge(r.image, r.color) }), /* @__PURE__ */ d("div", {
|
|
1136
1142
|
style: {
|
|
1137
1143
|
position: "absolute",
|
|
1138
1144
|
inset: 0,
|
|
@@ -1144,19 +1150,19 @@ function Ke({ slides: e = [], linked: t, ...n }) {
|
|
|
1144
1150
|
}
|
|
1145
1151
|
}) : null;
|
|
1146
1152
|
}
|
|
1147
|
-
var
|
|
1153
|
+
var Je = {
|
|
1148
1154
|
color: "inherit",
|
|
1149
1155
|
textDecoration: "none",
|
|
1150
1156
|
fontSize: 14,
|
|
1151
1157
|
opacity: .85
|
|
1152
|
-
},
|
|
1158
|
+
}, Ye = {
|
|
1153
1159
|
background: "var(--page-bg, #ffffff)",
|
|
1154
1160
|
color: "var(--page-text, #111827)",
|
|
1155
1161
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1156
1162
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1157
1163
|
zIndex: 60
|
|
1158
1164
|
};
|
|
1159
|
-
function
|
|
1165
|
+
function Xe({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], style: s, nodeRef: c, menu: p = "auto", breakpoint: m = 768 }) {
|
|
1160
1166
|
let [h, g] = l(null), [_, v] = l(!1), [y, b] = l(!1), [x, S] = l(null);
|
|
1161
1167
|
a(() => {
|
|
1162
1168
|
if (!h) return;
|
|
@@ -1166,7 +1172,7 @@ function Ye({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1166
1172
|
let w = p === "hamburger" || p === "auto" && _, T = (e, t) => /* @__PURE__ */ f("a", {
|
|
1167
1173
|
href: e.href || "#",
|
|
1168
1174
|
style: {
|
|
1169
|
-
...
|
|
1175
|
+
...Je,
|
|
1170
1176
|
display: "block",
|
|
1171
1177
|
...t
|
|
1172
1178
|
},
|
|
@@ -1254,7 +1260,7 @@ function Ye({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1254
1260
|
let t = e.children ?? [];
|
|
1255
1261
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
1256
1262
|
href: e.href || "#",
|
|
1257
|
-
style:
|
|
1263
|
+
style: Je,
|
|
1258
1264
|
children: e.label
|
|
1259
1265
|
}, e.key);
|
|
1260
1266
|
let n = e.type === "mega";
|
|
@@ -1268,7 +1274,7 @@ function Ye({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1268
1274
|
children: [/* @__PURE__ */ f("a", {
|
|
1269
1275
|
href: e.href || "#",
|
|
1270
1276
|
style: {
|
|
1271
|
-
...
|
|
1277
|
+
...Je,
|
|
1272
1278
|
cursor: "pointer"
|
|
1273
1279
|
},
|
|
1274
1280
|
children: [
|
|
@@ -1284,7 +1290,7 @@ function Ye({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1284
1290
|
]
|
|
1285
1291
|
}), x === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
1286
1292
|
style: {
|
|
1287
|
-
...
|
|
1293
|
+
...Ye,
|
|
1288
1294
|
position: "absolute",
|
|
1289
1295
|
left: 0,
|
|
1290
1296
|
right: 0,
|
|
@@ -1300,7 +1306,7 @@ function Ye({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1300
1306
|
}))
|
|
1301
1307
|
}) : /* @__PURE__ */ d("div", {
|
|
1302
1308
|
style: {
|
|
1303
|
-
...
|
|
1309
|
+
...Ye,
|
|
1304
1310
|
position: "absolute",
|
|
1305
1311
|
top: "100%",
|
|
1306
1312
|
left: 0,
|
|
@@ -1329,7 +1335,7 @@ function Ye({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1329
1335
|
children: o.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
1330
1336
|
href: e.href || "#",
|
|
1331
1337
|
style: {
|
|
1332
|
-
...
|
|
1338
|
+
...Je,
|
|
1333
1339
|
padding: "10px 4px",
|
|
1334
1340
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
1335
1341
|
opacity: 1
|
|
@@ -1340,7 +1346,7 @@ function Ye({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], st
|
|
|
1340
1346
|
]
|
|
1341
1347
|
});
|
|
1342
1348
|
}
|
|
1343
|
-
function
|
|
1349
|
+
function Ze({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1344
1350
|
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1345
1351
|
return e.length ? /* @__PURE__ */ f("div", {
|
|
1346
1352
|
ref: r,
|
|
@@ -1380,7 +1386,7 @@ function Xe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1380
1386
|
}, e.key))]
|
|
1381
1387
|
}) : null;
|
|
1382
1388
|
}
|
|
1383
|
-
function
|
|
1389
|
+
function Qe({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1384
1390
|
let [a, o] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
1385
1391
|
if (!e.length) return null;
|
|
1386
1392
|
let s = (e) => o((t) => {
|
|
@@ -1437,7 +1443,7 @@ function Ze({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1437
1443
|
})
|
|
1438
1444
|
});
|
|
1439
1445
|
}
|
|
1440
|
-
var
|
|
1446
|
+
var $e = {
|
|
1441
1447
|
display: "flex",
|
|
1442
1448
|
flexDirection: "column",
|
|
1443
1449
|
gap: "12px"
|
|
@@ -1455,7 +1461,7 @@ var Qe = {
|
|
|
1455
1461
|
boxSizing: "border-box",
|
|
1456
1462
|
backgroundColor: "#ffffff",
|
|
1457
1463
|
color: "#111827"
|
|
1458
|
-
},
|
|
1464
|
+
}, et = {
|
|
1459
1465
|
display: "flex",
|
|
1460
1466
|
alignItems: "center",
|
|
1461
1467
|
gap: "8px",
|
|
@@ -1466,7 +1472,7 @@ var Qe = {
|
|
|
1466
1472
|
tabIndex: -1,
|
|
1467
1473
|
onMouseDown: (e) => e.preventDefault()
|
|
1468
1474
|
} : {};
|
|
1469
|
-
function
|
|
1475
|
+
function tt(e, t) {
|
|
1470
1476
|
if (!e) return !0;
|
|
1471
1477
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
1472
1478
|
switch (e.op) {
|
|
@@ -1480,11 +1486,11 @@ function et(e, t) {
|
|
|
1480
1486
|
default: return !1;
|
|
1481
1487
|
}
|
|
1482
1488
|
}
|
|
1483
|
-
var
|
|
1489
|
+
var nt = {
|
|
1484
1490
|
display: "flex",
|
|
1485
1491
|
flexDirection: "column",
|
|
1486
1492
|
gap: 6
|
|
1487
|
-
},
|
|
1493
|
+
}, rt = {
|
|
1488
1494
|
font: "inherit",
|
|
1489
1495
|
fontSize: 15,
|
|
1490
1496
|
padding: "10px 12px",
|
|
@@ -1495,13 +1501,13 @@ var tt = {
|
|
|
1495
1501
|
width: "100%",
|
|
1496
1502
|
boxSizing: "border-box"
|
|
1497
1503
|
};
|
|
1498
|
-
function
|
|
1504
|
+
function it(e, t) {
|
|
1499
1505
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
1500
1506
|
if (!e?.parentField) return n;
|
|
1501
1507
|
let r = t?.[e.parentField];
|
|
1502
1508
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
1503
1509
|
}
|
|
1504
|
-
function
|
|
1510
|
+
function at({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
1505
1511
|
let a = /* @__PURE__ */ f("span", {
|
|
1506
1512
|
style: {
|
|
1507
1513
|
...Y,
|
|
@@ -1513,7 +1519,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1513
1519
|
required: e.required || void 0,
|
|
1514
1520
|
placeholder: e.placeholder || void 0,
|
|
1515
1521
|
disabled: r || void 0,
|
|
1516
|
-
style:
|
|
1522
|
+
style: rt,
|
|
1517
1523
|
value: t ?? "",
|
|
1518
1524
|
onChange: (t) => n(e.name, t.target.value)
|
|
1519
1525
|
};
|
|
@@ -1542,7 +1548,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1542
1548
|
borderRadius: 8,
|
|
1543
1549
|
display: "block"
|
|
1544
1550
|
}
|
|
1545
|
-
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(
|
|
1551
|
+
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(Ie, {
|
|
1546
1552
|
url: e.src,
|
|
1547
1553
|
style: { width: "100%" }
|
|
1548
1554
|
}) : /* @__PURE__ */ d("video", {
|
|
@@ -1554,14 +1560,14 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1554
1560
|
display: "block"
|
|
1555
1561
|
}
|
|
1556
1562
|
}) : null : /* @__PURE__ */ f("label", {
|
|
1557
|
-
style:
|
|
1563
|
+
style: nt,
|
|
1558
1564
|
children: [
|
|
1559
1565
|
a,
|
|
1560
1566
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
|
|
1561
1567
|
...o,
|
|
1562
1568
|
rows: 4,
|
|
1563
1569
|
style: {
|
|
1564
|
-
...
|
|
1570
|
+
...rt,
|
|
1565
1571
|
resize: "vertical"
|
|
1566
1572
|
}
|
|
1567
1573
|
}) : e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
@@ -1570,7 +1576,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1570
1576
|
children: [/* @__PURE__ */ d("option", {
|
|
1571
1577
|
value: "",
|
|
1572
1578
|
children: e.placeholder || "—"
|
|
1573
|
-
}),
|
|
1579
|
+
}), it(e, i).map((e, t) => /* @__PURE__ */ d("option", {
|
|
1574
1580
|
value: typeof e == "string" ? e : e.value,
|
|
1575
1581
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
1576
1582
|
}, t))]
|
|
@@ -1617,7 +1623,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1617
1623
|
]
|
|
1618
1624
|
});
|
|
1619
1625
|
}
|
|
1620
|
-
function
|
|
1626
|
+
function ot({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
1621
1627
|
let { tenant: y, apiUrl: b } = i(H), [x, S] = l("form"), [w, T] = l(null), [E, D] = l({}), [O, k] = l(0), A = h ? v || "form" : x;
|
|
1622
1628
|
a(() => {
|
|
1623
1629
|
if (!c || !s) return;
|
|
@@ -1639,9 +1645,9 @@ function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1639
1645
|
section: e,
|
|
1640
1646
|
fields: []
|
|
1641
1647
|
}) : j[j.length - 1].fields.push(e);
|
|
1642
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
1648
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || tt(e.section.condition, E)).map((e) => ({
|
|
1643
1649
|
...e,
|
|
1644
|
-
fields: e.fields.filter((e) =>
|
|
1650
|
+
fields: e.fields.filter((e) => tt(e.condition, E))
|
|
1645
1651
|
})), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
1646
1652
|
let t = E[e.name];
|
|
1647
1653
|
return e.required && (t == null || t === "" || t === !1);
|
|
@@ -1699,11 +1705,11 @@ function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1699
1705
|
}
|
|
1700
1706
|
},
|
|
1701
1707
|
style: {
|
|
1702
|
-
|
|
1708
|
+
...$e,
|
|
1703
1709
|
display: A === "success" ? "none" : "flex"
|
|
1704
1710
|
},
|
|
1705
1711
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
1706
|
-
P && /* @__PURE__ */ d(
|
|
1712
|
+
P && /* @__PURE__ */ d(xt, {
|
|
1707
1713
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
1708
1714
|
active: F + 1,
|
|
1709
1715
|
style: { marginBottom: 8 }
|
|
@@ -1716,7 +1722,7 @@ function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1716
1722
|
},
|
|
1717
1723
|
children: N[F].section.help
|
|
1718
1724
|
}),
|
|
1719
|
-
I.map((e) => /* @__PURE__ */ d(
|
|
1725
|
+
I.map((e) => /* @__PURE__ */ d(at, {
|
|
1720
1726
|
field: e,
|
|
1721
1727
|
value: E[e.name],
|
|
1722
1728
|
values: E,
|
|
@@ -1789,19 +1795,19 @@ function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1789
1795
|
]
|
|
1790
1796
|
});
|
|
1791
1797
|
}
|
|
1792
|
-
var
|
|
1798
|
+
var st = null, ct = () => st || (st = new Promise((e) => {
|
|
1793
1799
|
if (typeof window > "u") return;
|
|
1794
1800
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
1795
1801
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
1796
1802
|
let t = document.createElement("script");
|
|
1797
1803
|
t.src = "https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit", t.async = !0, document.head.appendChild(t);
|
|
1798
|
-
}),
|
|
1799
|
-
function
|
|
1804
|
+
}), st);
|
|
1805
|
+
function lt({ siteKey: e, theme: t, size: n, style: r, nodeRef: o, inert: s }) {
|
|
1800
1806
|
let l = i(H), u = l?.settings && typeof l.settings == "object" ? l.settings["google.recaptchaKey"] : "", p = typeof e == "string" && e.trim() || (typeof u == "string" ? u.trim() : ""), m = c(null), h = c(!1);
|
|
1801
1807
|
if (a(() => {
|
|
1802
1808
|
if (s || !p || h.current || !m.current) return;
|
|
1803
1809
|
let e = !0;
|
|
1804
|
-
return
|
|
1810
|
+
return ct().then((r) => {
|
|
1805
1811
|
if (!(!e || h.current || !m.current || !r?.render)) {
|
|
1806
1812
|
h.current = !0;
|
|
1807
1813
|
try {
|
|
@@ -1879,7 +1885,7 @@ function ct({ siteKey: e, theme: t, size: n, style: r, nodeRef: o, inert: s }) {
|
|
|
1879
1885
|
children: /* @__PURE__ */ d("div", { ref: m })
|
|
1880
1886
|
}) : null;
|
|
1881
1887
|
}
|
|
1882
|
-
function
|
|
1888
|
+
function ut({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
1883
1889
|
return /* @__PURE__ */ d("label", {
|
|
1884
1890
|
ref: r,
|
|
1885
1891
|
style: {
|
|
@@ -1889,7 +1895,7 @@ function lt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
|
1889
1895
|
children: J(t, e, i)
|
|
1890
1896
|
});
|
|
1891
1897
|
}
|
|
1892
|
-
function
|
|
1898
|
+
function dt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1893
1899
|
return /* @__PURE__ */ d("input", {
|
|
1894
1900
|
ref: a,
|
|
1895
1901
|
type: e,
|
|
@@ -1903,7 +1909,7 @@ function ut({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
1903
1909
|
...Z(o)
|
|
1904
1910
|
});
|
|
1905
1911
|
}
|
|
1906
|
-
function
|
|
1912
|
+
function ft({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1907
1913
|
return /* @__PURE__ */ d("textarea", {
|
|
1908
1914
|
ref: a,
|
|
1909
1915
|
name: e || void 0,
|
|
@@ -1918,11 +1924,11 @@ function dt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
1918
1924
|
...Z(o)
|
|
1919
1925
|
});
|
|
1920
1926
|
}
|
|
1921
|
-
function
|
|
1927
|
+
function pt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
1922
1928
|
return /* @__PURE__ */ f("label", {
|
|
1923
1929
|
ref: o,
|
|
1924
1930
|
style: {
|
|
1925
|
-
|
|
1931
|
+
...et,
|
|
1926
1932
|
...C(a)
|
|
1927
1933
|
},
|
|
1928
1934
|
children: [/* @__PURE__ */ d("input", {
|
|
@@ -1939,7 +1945,7 @@ function ft({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
1939
1945
|
}), t]
|
|
1940
1946
|
});
|
|
1941
1947
|
}
|
|
1942
|
-
function
|
|
1948
|
+
function mt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
1943
1949
|
return /* @__PURE__ */ f("select", {
|
|
1944
1950
|
ref: a,
|
|
1945
1951
|
name: e || void 0,
|
|
@@ -1962,7 +1968,7 @@ function pt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
1962
1968
|
}, t))]
|
|
1963
1969
|
});
|
|
1964
1970
|
}
|
|
1965
|
-
function
|
|
1971
|
+
function ht({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
1966
1972
|
let [s, c] = l(null);
|
|
1967
1973
|
return /* @__PURE__ */ f("label", {
|
|
1968
1974
|
ref: a,
|
|
@@ -1994,7 +2000,7 @@ function mt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
1994
2000
|
]
|
|
1995
2001
|
});
|
|
1996
2002
|
}
|
|
1997
|
-
function
|
|
2003
|
+
function gt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
1998
2004
|
return /* @__PURE__ */ d("button", {
|
|
1999
2005
|
ref: n,
|
|
2000
2006
|
type: r ? "button" : "submit",
|
|
@@ -2014,7 +2020,7 @@ function ht({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2014
2020
|
children: e
|
|
2015
2021
|
});
|
|
2016
2022
|
}
|
|
2017
|
-
function
|
|
2023
|
+
function _t({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
2018
2024
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
2019
2025
|
return /* @__PURE__ */ d("div", {
|
|
2020
2026
|
ref: r,
|
|
@@ -2031,52 +2037,60 @@ function gt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2031
2037
|
}, t))
|
|
2032
2038
|
});
|
|
2033
2039
|
}
|
|
2034
|
-
function
|
|
2035
|
-
let { tenant:
|
|
2040
|
+
function vt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, style: h, nodeRef: g }) {
|
|
2041
|
+
let { tenant: _, apiUrl: v, locale: y } = i(H), b = i(ae), x = i(U), S = x?.[e], w = m ? W(x) : 1, [T, E] = l(null);
|
|
2036
2042
|
if (a(() => {
|
|
2037
|
-
if (!e ||
|
|
2038
|
-
let
|
|
2039
|
-
|
|
2040
|
-
let
|
|
2041
|
-
|
|
2042
|
-
}
|
|
2043
|
-
|
|
2043
|
+
if (!e || S) return;
|
|
2044
|
+
let n = !0, r = new URLSearchParams();
|
|
2045
|
+
if (y && r.set("locale", y), m && !e.startsWith("api:")) {
|
|
2046
|
+
let e = Math.max(1, Number(t) || 6);
|
|
2047
|
+
r.set("offset", String((w - 1) * e)), r.set("limit", String(e));
|
|
2048
|
+
}
|
|
2049
|
+
let i = r.toString(), a = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
|
|
2050
|
+
return fetch(a, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => {
|
|
2051
|
+
let t = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
|
|
2052
|
+
return n && E(t.filter((e) => e && typeof e == "object"));
|
|
2053
|
+
}).catch(() => n && E([])), () => {
|
|
2054
|
+
n = !1;
|
|
2044
2055
|
};
|
|
2045
2056
|
}, [
|
|
2046
2057
|
e,
|
|
2047
|
-
g,
|
|
2048
2058
|
_,
|
|
2049
2059
|
v,
|
|
2050
|
-
|
|
2060
|
+
y,
|
|
2061
|
+
S,
|
|
2062
|
+
m,
|
|
2063
|
+
w,
|
|
2064
|
+
t
|
|
2051
2065
|
]), !e) return null;
|
|
2052
|
-
let
|
|
2066
|
+
let D = Math.max(1, Number(t) || 6), O = m ? S || e.startsWith("api:") ? (S ?? T ?? []).slice((w - 1) * D, w * D) : (T ?? []).slice(0, D) : (S ?? T ?? []).slice(0, D), k = Math.min(Math.max(Number(r) || 3, 1), 6), A = n === "list" ? {
|
|
2053
2067
|
display: "flex",
|
|
2054
2068
|
flexDirection: "column",
|
|
2055
2069
|
gap: 20
|
|
2056
2070
|
} : {
|
|
2057
2071
|
display: "grid",
|
|
2058
|
-
gridTemplateColumns: `repeat(${
|
|
2072
|
+
gridTemplateColumns: `repeat(${k}, minmax(0, 1fr))`,
|
|
2059
2073
|
gap: 24
|
|
2060
2074
|
};
|
|
2061
|
-
return u && p &&
|
|
2062
|
-
ref:
|
|
2075
|
+
return u && p && b?.render ? /* @__PURE__ */ d("div", {
|
|
2076
|
+
ref: g,
|
|
2063
2077
|
style: {
|
|
2064
2078
|
width: "100%",
|
|
2065
|
-
...
|
|
2066
|
-
...C(
|
|
2079
|
+
...A,
|
|
2080
|
+
...C(h)
|
|
2067
2081
|
},
|
|
2068
|
-
children:
|
|
2082
|
+
children: O.map((e) => /* @__PURE__ */ d("div", {
|
|
2069
2083
|
style: { minWidth: 0 },
|
|
2070
|
-
children:
|
|
2084
|
+
children: b.render(p, (t) => ce(t, e))
|
|
2071
2085
|
}, e.id ?? e?.data?.slug))
|
|
2072
2086
|
}) : /* @__PURE__ */ d("div", {
|
|
2073
|
-
ref:
|
|
2087
|
+
ref: g,
|
|
2074
2088
|
style: {
|
|
2075
2089
|
width: "100%",
|
|
2076
|
-
...
|
|
2077
|
-
...C(
|
|
2090
|
+
...A,
|
|
2091
|
+
...C(h)
|
|
2078
2092
|
},
|
|
2079
|
-
children:
|
|
2093
|
+
children: O.map((e) => {
|
|
2080
2094
|
let t = o ? G(e?.data, o) : null, r = s ? K(G(e?.data, s)) : null, i = c ? G(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : K(i), u = n === "list";
|
|
2081
2095
|
return /* @__PURE__ */ f("div", {
|
|
2082
2096
|
style: {
|
|
@@ -2124,7 +2138,7 @@ function _t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2124
2138
|
lineHeight: 1.55,
|
|
2125
2139
|
opacity: .85
|
|
2126
2140
|
},
|
|
2127
|
-
children:
|
|
2141
|
+
children: we(a)
|
|
2128
2142
|
})
|
|
2129
2143
|
]
|
|
2130
2144
|
})]
|
|
@@ -2132,7 +2146,7 @@ function _t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2132
2146
|
})
|
|
2133
2147
|
});
|
|
2134
2148
|
}
|
|
2135
|
-
function
|
|
2149
|
+
function yt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
2136
2150
|
return e.length ? /* @__PURE__ */ d("nav", {
|
|
2137
2151
|
ref: r,
|
|
2138
2152
|
"aria-label": "Breadcrumb",
|
|
@@ -2182,8 +2196,36 @@ function vt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2182
2196
|
})
|
|
2183
2197
|
}) : null;
|
|
2184
2198
|
}
|
|
2185
|
-
function
|
|
2186
|
-
let
|
|
2199
|
+
function bt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, style: u, nodeRef: p }) {
|
|
2200
|
+
let { tenant: m, apiUrl: h } = i(H), g = i(U), [_, v] = l(null), y = o ? Number(g?.[`${o}:total`]) : NaN;
|
|
2201
|
+
a(() => {
|
|
2202
|
+
if (!o || Number.isFinite(y)) return;
|
|
2203
|
+
let e = !0, t = o.startsWith("api:") ? `${h}/data/${encodeURIComponent(o.slice(4))}` : `${h}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
2204
|
+
return fetch(t, { headers: m ? { "x-tenant": m } : {} }).then((e) => e.json()).then((t) => {
|
|
2205
|
+
if (!e) return;
|
|
2206
|
+
let n = t?.payload, r = Array.isArray(n) ? n.length : Number(n?.total?.filtered ?? n?.total?.all ?? (Array.isArray(n?.data) ? n.data.length : 0));
|
|
2207
|
+
v(Number.isFinite(r) ? r : 0);
|
|
2208
|
+
}).catch(() => e && v(0)), () => {
|
|
2209
|
+
e = !1;
|
|
2210
|
+
};
|
|
2211
|
+
}, [
|
|
2212
|
+
o,
|
|
2213
|
+
m,
|
|
2214
|
+
h,
|
|
2215
|
+
y
|
|
2216
|
+
]);
|
|
2217
|
+
let b = Math.max(1, Number(s) || 6), x = Number.isFinite(y) ? y : _;
|
|
2218
|
+
if (o && x === null) return null;
|
|
2219
|
+
let S = Math.min(Math.max(o ? Math.ceil(x / b) : Number(e) || 1, 1), 50), w = Math.min(Math.max(o ? W(g) : Number(t) || 1, 1), S), T = (e) => {
|
|
2220
|
+
if (o) {
|
|
2221
|
+
if (typeof window < "u") {
|
|
2222
|
+
let t = new URLSearchParams(window.location.search);
|
|
2223
|
+
return t.set("page", String(e)), `?${t.toString()}`;
|
|
2224
|
+
}
|
|
2225
|
+
return `?page=${e}`;
|
|
2226
|
+
}
|
|
2227
|
+
return r && r !== "#" ? r.replace("{page}", String(e)) : "#";
|
|
2228
|
+
}, E = c === "center" ? "center" : c === "right" ? "flex-end" : "flex-start", D = (e) => ({
|
|
2187
2229
|
display: "inline-flex",
|
|
2188
2230
|
alignItems: "center",
|
|
2189
2231
|
justifyContent: "center",
|
|
@@ -2198,44 +2240,45 @@ function yt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2198
2240
|
border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
|
|
2199
2241
|
});
|
|
2200
2242
|
return /* @__PURE__ */ f("nav", {
|
|
2201
|
-
ref:
|
|
2243
|
+
ref: p,
|
|
2202
2244
|
"aria-label": "Pagination",
|
|
2203
2245
|
style: {
|
|
2204
2246
|
display: "flex",
|
|
2205
2247
|
flexWrap: "wrap",
|
|
2206
2248
|
gap: 8,
|
|
2207
2249
|
alignItems: "center",
|
|
2208
|
-
|
|
2250
|
+
justifyContent: E,
|
|
2251
|
+
...C(u)
|
|
2209
2252
|
},
|
|
2210
2253
|
children: [
|
|
2211
2254
|
n && /* @__PURE__ */ d("a", {
|
|
2212
|
-
href:
|
|
2255
|
+
href: w > 1 ? T(w - 1) : "#",
|
|
2213
2256
|
"aria-label": "Previous",
|
|
2214
2257
|
style: {
|
|
2215
|
-
...
|
|
2216
|
-
opacity:
|
|
2258
|
+
...D(!1),
|
|
2259
|
+
opacity: w > 1 ? 1 : .4
|
|
2217
2260
|
},
|
|
2218
2261
|
children: "‹"
|
|
2219
2262
|
}),
|
|
2220
|
-
Array.from({ length:
|
|
2221
|
-
href:
|
|
2222
|
-
"aria-current": e ===
|
|
2223
|
-
style:
|
|
2263
|
+
Array.from({ length: S }, (e, t) => t + 1).map((e) => /* @__PURE__ */ d("a", {
|
|
2264
|
+
href: T(e),
|
|
2265
|
+
"aria-current": e === w ? "page" : void 0,
|
|
2266
|
+
style: D(e === w),
|
|
2224
2267
|
children: e
|
|
2225
2268
|
}, e)),
|
|
2226
2269
|
n && /* @__PURE__ */ d("a", {
|
|
2227
|
-
href:
|
|
2270
|
+
href: w < S ? T(w + 1) : "#",
|
|
2228
2271
|
"aria-label": "Next",
|
|
2229
2272
|
style: {
|
|
2230
|
-
...
|
|
2231
|
-
opacity:
|
|
2273
|
+
...D(!1),
|
|
2274
|
+
opacity: w < S ? 1 : .4
|
|
2232
2275
|
},
|
|
2233
2276
|
children: "›"
|
|
2234
2277
|
})
|
|
2235
2278
|
]
|
|
2236
2279
|
});
|
|
2237
2280
|
}
|
|
2238
|
-
function
|
|
2281
|
+
function xt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
2239
2282
|
if (!e.length) return null;
|
|
2240
2283
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
2241
2284
|
width: 32,
|
|
@@ -2313,7 +2356,7 @@ function bt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2313
2356
|
})
|
|
2314
2357
|
});
|
|
2315
2358
|
}
|
|
2316
|
-
var
|
|
2359
|
+
var St = {
|
|
2317
2360
|
small: {
|
|
2318
2361
|
w: 132,
|
|
2319
2362
|
h: 46,
|
|
@@ -2335,10 +2378,10 @@ var xt = {
|
|
|
2335
2378
|
title: 12.5,
|
|
2336
2379
|
avatar: 46
|
|
2337
2380
|
}
|
|
2338
|
-
},
|
|
2339
|
-
|
|
2340
|
-
function
|
|
2341
|
-
let r =
|
|
2381
|
+
}, Ct = (e) => St[e] ?? St.medium;
|
|
2382
|
+
St.medium.w, St.medium.h;
|
|
2383
|
+
function wt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
2384
|
+
let r = Ct(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
|
|
2342
2385
|
for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
|
|
2343
2386
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
2344
2387
|
if (t.has(e.id)) return 0;
|
|
@@ -2390,18 +2433,18 @@ function Ct(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
2390
2433
|
horizontal: n
|
|
2391
2434
|
};
|
|
2392
2435
|
}
|
|
2393
|
-
var
|
|
2436
|
+
var Tt = (e, t) => {
|
|
2394
2437
|
let n = String(e ?? "");
|
|
2395
2438
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
2396
|
-
},
|
|
2439
|
+
}, Et = (e) => {
|
|
2397
2440
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
2398
2441
|
if (!t) return "#ffffff";
|
|
2399
2442
|
let n = t[1];
|
|
2400
2443
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
2401
2444
|
let r = parseInt(n, 16);
|
|
2402
2445
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
2403
|
-
},
|
|
2404
|
-
function
|
|
2446
|
+
}, Dt = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
2447
|
+
function Ot(e, t = {}) {
|
|
2405
2448
|
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : K(e);
|
|
2406
2449
|
return n.map((e) => {
|
|
2407
2450
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
@@ -2416,11 +2459,11 @@ function Dt(e, t = {}) {
|
|
|
2416
2459
|
};
|
|
2417
2460
|
});
|
|
2418
2461
|
}
|
|
2419
|
-
var
|
|
2462
|
+
var kt = {
|
|
2420
2463
|
size: 36,
|
|
2421
2464
|
pad: 10
|
|
2422
2465
|
};
|
|
2423
|
-
function
|
|
2466
|
+
function At({ node: e, onClose: t }) {
|
|
2424
2467
|
return a(() => {
|
|
2425
2468
|
let e = (e) => e.key === "Escape" && t();
|
|
2426
2469
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -2538,7 +2581,7 @@ function kt({ node: e, onClose: t }) {
|
|
|
2538
2581
|
})
|
|
2539
2582
|
});
|
|
2540
2583
|
}
|
|
2541
|
-
function
|
|
2584
|
+
function jt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
|
|
2542
2585
|
let b = o(), [x, S] = l(null), { tenant: w, apiUrl: T } = i(H), E = i(U)?.[t], [D, O] = l(null);
|
|
2543
2586
|
a(() => {
|
|
2544
2587
|
if (!t || E) return;
|
|
@@ -2555,14 +2598,14 @@ function At({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2555
2598
|
T,
|
|
2556
2599
|
E
|
|
2557
2600
|
]);
|
|
2558
|
-
let k = t ?
|
|
2601
|
+
let k = t ? Ot(E ?? D ?? [], {
|
|
2559
2602
|
nameField: n,
|
|
2560
2603
|
titleField: r,
|
|
2561
2604
|
photoField: s,
|
|
2562
2605
|
parentField: c,
|
|
2563
2606
|
cvField: p,
|
|
2564
2607
|
hrefField: m
|
|
2565
|
-
}) : e, A =
|
|
2608
|
+
}) : e, A = Ct(h), { boxes: j, links: M, width: N, height: P } = wt(k, {
|
|
2566
2609
|
size: h,
|
|
2567
2610
|
horizontal: g
|
|
2568
2611
|
});
|
|
@@ -2608,7 +2651,7 @@ function At({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2608
2651
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
2609
2652
|
strokeWidth: "1.5"
|
|
2610
2653
|
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
2611
|
-
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ?
|
|
2654
|
+
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Et(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Et(e.color2) : s, l = y && (Dt(e) || e.href), p = () => Dt(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + kt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
2612
2655
|
return /* @__PURE__ */ f("g", {
|
|
2613
2656
|
onClick: l ? p : void 0,
|
|
2614
2657
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -2672,13 +2715,13 @@ function At({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2672
2715
|
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
2673
2716
|
id: `${b}-${e.id}`,
|
|
2674
2717
|
children: /* @__PURE__ */ d("circle", {
|
|
2675
|
-
cx: t +
|
|
2718
|
+
cx: t + kt.pad + A.avatar / 2,
|
|
2676
2719
|
cy: n + A.h / 2,
|
|
2677
2720
|
r: A.avatar / 2
|
|
2678
2721
|
})
|
|
2679
2722
|
}), /* @__PURE__ */ d("image", {
|
|
2680
2723
|
href: e.photo,
|
|
2681
|
-
x: t +
|
|
2724
|
+
x: t + kt.pad,
|
|
2682
2725
|
y: n + (A.h - A.avatar) / 2,
|
|
2683
2726
|
width: A.avatar,
|
|
2684
2727
|
height: A.avatar,
|
|
@@ -2692,7 +2735,7 @@ function At({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2692
2735
|
fontSize: A.title,
|
|
2693
2736
|
fontWeight: "600",
|
|
2694
2737
|
fill: s,
|
|
2695
|
-
children:
|
|
2738
|
+
children: Tt(e.title, g + 4)
|
|
2696
2739
|
}), e.name && /* @__PURE__ */ d("text", {
|
|
2697
2740
|
x: m,
|
|
2698
2741
|
y: n + _ + _ / 2 + A.name * .35,
|
|
@@ -2700,7 +2743,7 @@ function At({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2700
2743
|
fontSize: A.name,
|
|
2701
2744
|
fontWeight: "600",
|
|
2702
2745
|
fill: c,
|
|
2703
|
-
children:
|
|
2746
|
+
children: Tt(e.name, g)
|
|
2704
2747
|
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
2705
2748
|
x: m,
|
|
2706
2749
|
y: n + (v[1] ? A.h * .43 : A.h * .57),
|
|
@@ -2708,7 +2751,7 @@ function At({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2708
2751
|
fontSize: A.name,
|
|
2709
2752
|
fontWeight: "600",
|
|
2710
2753
|
fill: s,
|
|
2711
|
-
children:
|
|
2754
|
+
children: Tt(v[0], g)
|
|
2712
2755
|
}), v[1] && /* @__PURE__ */ d("text", {
|
|
2713
2756
|
x: m,
|
|
2714
2757
|
y: n + A.h * .73,
|
|
@@ -2716,136 +2759,151 @@ function At({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2716
2759
|
fontSize: A.title,
|
|
2717
2760
|
opacity: "0.7",
|
|
2718
2761
|
fill: s,
|
|
2719
|
-
children:
|
|
2762
|
+
children: Tt(v[1], g + 4)
|
|
2720
2763
|
})] })
|
|
2721
2764
|
]
|
|
2722
2765
|
}, e.id);
|
|
2723
2766
|
})]
|
|
2724
|
-
}), x && /* @__PURE__ */ d(
|
|
2767
|
+
}), x && /* @__PURE__ */ d(At, {
|
|
2725
2768
|
node: x,
|
|
2726
2769
|
onClose: () => S(null)
|
|
2727
2770
|
})]
|
|
2728
2771
|
});
|
|
2729
2772
|
}
|
|
2730
|
-
function
|
|
2731
|
-
let { tenant:
|
|
2773
|
+
function Mt({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: c = !1, paged: u, emptyText: p, style: m, nodeRef: h }) {
|
|
2774
|
+
let { tenant: g, apiUrl: _ } = i(H), v = i(U), y = v?.[n], b = u ? W(v) : 1, [x, S] = l(null);
|
|
2732
2775
|
if (a(() => {
|
|
2733
|
-
if (!n ||
|
|
2734
|
-
let e = !0, t = n.startsWith("api:") ? `${
|
|
2735
|
-
return fetch(
|
|
2776
|
+
if (!n || y) return;
|
|
2777
|
+
let e = !0, t = Math.max(1, Number(r) || 10), i = u && !n.startsWith("api:") ? `?offset=${(b - 1) * t}&limit=${t}` : "", a = n.startsWith("api:") ? `${_}/data/${encodeURIComponent(n.slice(4))}` : `${_}/dynamic/${encodeURIComponent(n)}${i}`;
|
|
2778
|
+
return fetch(a, { headers: g ? { "x-tenant": g } : {} }).then((e) => e.json()).then((t) => {
|
|
2779
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
2780
|
+
return e && S(n);
|
|
2781
|
+
}).catch(() => e && S([])), () => {
|
|
2736
2782
|
e = !1;
|
|
2737
2783
|
};
|
|
2738
2784
|
}, [
|
|
2739
2785
|
n,
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2786
|
+
g,
|
|
2787
|
+
_,
|
|
2788
|
+
y,
|
|
2789
|
+
u,
|
|
2790
|
+
b,
|
|
2791
|
+
r
|
|
2743
2792
|
]), !e.length) return null;
|
|
2744
|
-
let
|
|
2793
|
+
let w = Math.max(1, Number(r) || 10), T = n ? u ? y || n.startsWith("api:") ? (y ?? x ?? []).slice((b - 1) * w, b * w) : (x ?? []).slice(0, w) : (y ?? x ?? []).slice(0, w) : null, E = T ? T.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, D = !!n && !(n && !y && x === null) && E.length === 0, O = c ? "6px 10px" : "10px 14px", k = "1px solid rgba(148, 163, 184, 0.35)", A = s ? { border: k } : { borderBottom: k };
|
|
2745
2794
|
return /* @__PURE__ */ d("div", {
|
|
2746
|
-
ref:
|
|
2795
|
+
ref: h,
|
|
2747
2796
|
style: {
|
|
2748
2797
|
width: "100%",
|
|
2749
2798
|
overflowX: "auto",
|
|
2750
|
-
...C(
|
|
2799
|
+
...C(m)
|
|
2751
2800
|
},
|
|
2752
2801
|
children: /* @__PURE__ */ f("table", {
|
|
2753
2802
|
style: {
|
|
2754
2803
|
width: "100%",
|
|
2755
2804
|
borderCollapse: "collapse",
|
|
2756
2805
|
fontSize: 14,
|
|
2757
|
-
...s ? { border:
|
|
2806
|
+
...s ? { border: k } : {}
|
|
2758
2807
|
},
|
|
2759
2808
|
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((e, t) => /* @__PURE__ */ d("th", {
|
|
2760
2809
|
style: {
|
|
2761
2810
|
textAlign: "left",
|
|
2762
2811
|
fontWeight: 600,
|
|
2763
|
-
padding:
|
|
2812
|
+
padding: O,
|
|
2764
2813
|
background: "rgba(148, 163, 184, 0.12)",
|
|
2765
|
-
...
|
|
2814
|
+
...A
|
|
2766
2815
|
},
|
|
2767
2816
|
children: e.label ?? e
|
|
2768
|
-
}, t)) }) }), /* @__PURE__ */
|
|
2817
|
+
}, t)) }) }), /* @__PURE__ */ f("tbody", { children: [D && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
2818
|
+
colSpan: e.length,
|
|
2819
|
+
style: {
|
|
2820
|
+
padding: O,
|
|
2821
|
+
textAlign: "center",
|
|
2822
|
+
opacity: .6,
|
|
2823
|
+
...A
|
|
2824
|
+
},
|
|
2825
|
+
children: p || "No data yet"
|
|
2826
|
+
}) }), E.map((t, n) => /* @__PURE__ */ d("tr", {
|
|
2769
2827
|
style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
2770
2828
|
children: e.map((e, n) => /* @__PURE__ */ d("td", {
|
|
2771
2829
|
style: {
|
|
2772
|
-
padding:
|
|
2773
|
-
...
|
|
2830
|
+
padding: O,
|
|
2831
|
+
...A
|
|
2774
2832
|
},
|
|
2775
2833
|
children: t?.[n] ?? ""
|
|
2776
2834
|
}, n))
|
|
2777
|
-
}, n)) })]
|
|
2835
|
+
}, n))] })]
|
|
2778
2836
|
})
|
|
2779
2837
|
});
|
|
2780
2838
|
}
|
|
2781
|
-
var
|
|
2782
|
-
PageRoot:
|
|
2783
|
-
Section:
|
|
2784
|
-
Container:
|
|
2785
|
-
Heading:
|
|
2786
|
-
TextBlock:
|
|
2787
|
-
ButtonBlock:
|
|
2788
|
-
ImageBlock:
|
|
2789
|
-
Spacer:
|
|
2790
|
-
Divider:
|
|
2791
|
-
SliderBlock:
|
|
2792
|
-
CanvasSlider:
|
|
2793
|
-
TabsBlock:
|
|
2794
|
-
QuickStack:
|
|
2795
|
-
CollectionList:
|
|
2796
|
-
BreadcrumbsBlock:
|
|
2797
|
-
PaginationBlock:
|
|
2798
|
-
StepperBlock:
|
|
2799
|
-
OrgChartBlock:
|
|
2800
|
-
TableBlock:
|
|
2801
|
-
AccordionBlock:
|
|
2802
|
-
NavbarBlock:
|
|
2803
|
-
ListBlock:
|
|
2804
|
-
TextSpan:
|
|
2805
|
-
QuoteBlock:
|
|
2806
|
-
TextLink:
|
|
2807
|
-
RichTextBlock:
|
|
2808
|
-
RichContentBlock:
|
|
2809
|
-
VideoBlock:
|
|
2810
|
-
YouTubeBlock:
|
|
2811
|
-
IframeBlock:
|
|
2812
|
-
EmbedBlock:
|
|
2813
|
-
FormBlock:
|
|
2814
|
-
FormLabel:
|
|
2815
|
-
FormInput:
|
|
2816
|
-
FormTextarea:
|
|
2817
|
-
FormCheckbox: (e) => /* @__PURE__ */ d(
|
|
2839
|
+
var Nt = {
|
|
2840
|
+
PageRoot: he,
|
|
2841
|
+
Section: ge,
|
|
2842
|
+
Container: _e,
|
|
2843
|
+
Heading: ve,
|
|
2844
|
+
TextBlock: ke,
|
|
2845
|
+
ButtonBlock: Me,
|
|
2846
|
+
ImageBlock: Ne,
|
|
2847
|
+
Spacer: ze,
|
|
2848
|
+
Divider: Be,
|
|
2849
|
+
SliderBlock: Ke,
|
|
2850
|
+
CanvasSlider: qe,
|
|
2851
|
+
TabsBlock: Ze,
|
|
2852
|
+
QuickStack: _t,
|
|
2853
|
+
CollectionList: vt,
|
|
2854
|
+
BreadcrumbsBlock: yt,
|
|
2855
|
+
PaginationBlock: bt,
|
|
2856
|
+
StepperBlock: xt,
|
|
2857
|
+
OrgChartBlock: jt,
|
|
2858
|
+
TableBlock: Mt,
|
|
2859
|
+
AccordionBlock: Qe,
|
|
2860
|
+
NavbarBlock: Xe,
|
|
2861
|
+
ListBlock: Oe,
|
|
2862
|
+
TextSpan: xe,
|
|
2863
|
+
QuoteBlock: De,
|
|
2864
|
+
TextLink: je,
|
|
2865
|
+
RichTextBlock: Te,
|
|
2866
|
+
RichContentBlock: Te,
|
|
2867
|
+
VideoBlock: Pe,
|
|
2868
|
+
YouTubeBlock: Ie,
|
|
2869
|
+
IframeBlock: Le,
|
|
2870
|
+
EmbedBlock: Re,
|
|
2871
|
+
FormBlock: ot,
|
|
2872
|
+
FormLabel: ut,
|
|
2873
|
+
FormInput: dt,
|
|
2874
|
+
FormTextarea: ft,
|
|
2875
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(pt, {
|
|
2818
2876
|
kind: "checkbox",
|
|
2819
2877
|
...e
|
|
2820
2878
|
}),
|
|
2821
|
-
FormRadio: (e) => /* @__PURE__ */ d(
|
|
2879
|
+
FormRadio: (e) => /* @__PURE__ */ d(pt, {
|
|
2822
2880
|
kind: "radio",
|
|
2823
2881
|
...e
|
|
2824
2882
|
}),
|
|
2825
|
-
FormSelect:
|
|
2826
|
-
FormFile:
|
|
2827
|
-
FormRecaptcha:
|
|
2828
|
-
FormSubmit:
|
|
2829
|
-
},
|
|
2883
|
+
FormSelect: mt,
|
|
2884
|
+
FormFile: ht,
|
|
2885
|
+
FormRecaptcha: lt,
|
|
2886
|
+
FormSubmit: gt
|
|
2887
|
+
}, Pt = {
|
|
2830
2888
|
id: "auth",
|
|
2831
2889
|
label: "Accounts",
|
|
2832
2890
|
category: "Apps",
|
|
2833
2891
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
2834
2892
|
ssr: "shell",
|
|
2835
2893
|
settings: ["apps.auth.redirect"]
|
|
2836
|
-
},
|
|
2894
|
+
}, Ft = n({
|
|
2837
2895
|
user: null,
|
|
2838
2896
|
status: "idle",
|
|
2839
2897
|
ensure: () => {},
|
|
2840
2898
|
refresh: () => {},
|
|
2841
2899
|
signOut: () => {}
|
|
2842
|
-
}),
|
|
2843
|
-
let e = i(
|
|
2900
|
+
}), It = () => {
|
|
2901
|
+
let e = i(Ft);
|
|
2844
2902
|
return a(() => {
|
|
2845
2903
|
e.ensure();
|
|
2846
2904
|
}, [e]), e;
|
|
2847
2905
|
};
|
|
2848
|
-
function
|
|
2906
|
+
function Lt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o }) {
|
|
2849
2907
|
let u = i(H), f = a || u?.apiUrl || "/api", p = o || u?.tenant || "", [m, h] = l(t ?? null), [g, _] = l(t ? "user" : n ? "guest" : "idle"), v = c(!1), y = r((e, t) => fetch(`${f}${e}`, {
|
|
2850
2908
|
...t,
|
|
2851
2909
|
credentials: "include",
|
|
@@ -2878,18 +2936,18 @@ function It({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o })
|
|
|
2878
2936
|
b,
|
|
2879
2937
|
x
|
|
2880
2938
|
]);
|
|
2881
|
-
return /* @__PURE__ */ d(
|
|
2939
|
+
return /* @__PURE__ */ d(Ft.Provider, {
|
|
2882
2940
|
value: C,
|
|
2883
2941
|
children: e
|
|
2884
2942
|
});
|
|
2885
2943
|
}
|
|
2886
|
-
function
|
|
2887
|
-
let { status: n } =
|
|
2944
|
+
function Rt({ when: e, children: t }) {
|
|
2945
|
+
let { status: n } = It();
|
|
2888
2946
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
2889
2947
|
}
|
|
2890
2948
|
//#endregion
|
|
2891
2949
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
2892
|
-
function
|
|
2950
|
+
function zt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
|
|
2893
2951
|
let { tenant: h, apiUrl: g, settings: _ } = i(H), [v, y] = l("form"), [b, x] = l(""), [S, w] = l(!1), T = e === "register", E = u ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
|
|
2894
2952
|
if (e.preventDefault(), u) return;
|
|
2895
2953
|
let n = new FormData(e.currentTarget);
|
|
@@ -3013,8 +3071,8 @@ function Rt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3013
3071
|
]
|
|
3014
3072
|
});
|
|
3015
3073
|
}
|
|
3016
|
-
function
|
|
3017
|
-
let { user: c, status: l, signOut: u } =
|
|
3074
|
+
function Bt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
3075
|
+
let { user: c, status: l, signOut: u } = It(), p = a ? s || "user" : l, m = a ? {
|
|
3018
3076
|
name: "Ada Lovelace",
|
|
3019
3077
|
email: "ada@example.com"
|
|
3020
3078
|
} : c;
|
|
@@ -3079,16 +3137,16 @@ function zt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3079
3137
|
}
|
|
3080
3138
|
//#endregion
|
|
3081
3139
|
//#region ../ui/src/components/builder/apps/index.js
|
|
3082
|
-
var
|
|
3083
|
-
SiteLoginForm:
|
|
3084
|
-
SiteAccountMenu:
|
|
3140
|
+
var Vt = [Pt], Ht = {
|
|
3141
|
+
SiteLoginForm: zt,
|
|
3142
|
+
SiteAccountMenu: Bt
|
|
3085
3143
|
};
|
|
3086
|
-
new Set(
|
|
3144
|
+
new Set(Vt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
3087
3145
|
//#endregion
|
|
3088
3146
|
//#region ../ui/src/components/builder/render.jsx
|
|
3089
|
-
var
|
|
3090
|
-
...
|
|
3091
|
-
...
|
|
3147
|
+
var Ut = {
|
|
3148
|
+
...Nt,
|
|
3149
|
+
...Ht
|
|
3092
3150
|
};
|
|
3093
3151
|
function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
3094
3152
|
let o = n[e];
|
|
@@ -3100,7 +3158,7 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3100
3158
|
let c = new Set(i).add(n);
|
|
3101
3159
|
return /* @__PURE__ */ d(t, { children: Q(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
3102
3160
|
}
|
|
3103
|
-
let l =
|
|
3161
|
+
let l = Ut[s];
|
|
3104
3162
|
if (!l) return null;
|
|
3105
3163
|
let u = (o.nodes ?? []).map((e) => Q(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Q(t, n, r, i)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
3106
3164
|
...c,
|
|
@@ -3111,15 +3169,15 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3111
3169
|
},
|
|
3112
3170
|
children: u.length ? u : void 0
|
|
3113
3171
|
}, e);
|
|
3114
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
3172
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(Rt, {
|
|
3115
3173
|
when: c.when,
|
|
3116
3174
|
children: m
|
|
3117
3175
|
}, e) : m;
|
|
3118
3176
|
}
|
|
3119
3177
|
//#endregion
|
|
3120
3178
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
3121
|
-
var
|
|
3122
|
-
function
|
|
3179
|
+
var Wt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
|
|
3180
|
+
function Gt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, tenant: c, apiUrl: l, datasets: u, locale: p, direction: m, settings: g, siteUser: v }) {
|
|
3123
3181
|
let b = o?.js?.trim();
|
|
3124
3182
|
if (a(() => {
|
|
3125
3183
|
if (!b) return;
|
|
@@ -3145,11 +3203,11 @@ function Wt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3145
3203
|
locale: p || "",
|
|
3146
3204
|
settings: g ?? null
|
|
3147
3205
|
},
|
|
3148
|
-
children: /* @__PURE__ */ d(
|
|
3206
|
+
children: /* @__PURE__ */ d(Lt, {
|
|
3149
3207
|
initialUser: v,
|
|
3150
3208
|
children: /* @__PURE__ */ d(U.Provider, {
|
|
3151
3209
|
value: u ?? null,
|
|
3152
|
-
children: /* @__PURE__ */ d(
|
|
3210
|
+
children: /* @__PURE__ */ d(ae.Provider, {
|
|
3153
3211
|
value: T,
|
|
3154
3212
|
children: /* @__PURE__ */ f("div", {
|
|
3155
3213
|
...x,
|
|
@@ -3180,11 +3238,11 @@ function Wt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3180
3238
|
locale: p || "",
|
|
3181
3239
|
settings: g ?? null
|
|
3182
3240
|
},
|
|
3183
|
-
children: /* @__PURE__ */ d(
|
|
3241
|
+
children: /* @__PURE__ */ d(Lt, {
|
|
3184
3242
|
initialUser: v,
|
|
3185
3243
|
children: /* @__PURE__ */ d(U.Provider, {
|
|
3186
3244
|
value: u ?? null,
|
|
3187
|
-
children: /* @__PURE__ */ d(
|
|
3245
|
+
children: /* @__PURE__ */ d(ae.Provider, {
|
|
3188
3246
|
value: T,
|
|
3189
3247
|
children: /* @__PURE__ */ f("div", {
|
|
3190
3248
|
...x,
|
|
@@ -3195,8 +3253,8 @@ function Wt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3195
3253
|
...i
|
|
3196
3254
|
},
|
|
3197
3255
|
children: [
|
|
3198
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
3199
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
3256
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${Wt(V(A.light))} }
|
|
3257
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Wt(V(A.dark))} } }` }),
|
|
3200
3258
|
k,
|
|
3201
3259
|
/* @__PURE__ */ d("style", { children: S }),
|
|
3202
3260
|
E && /* @__PURE__ */ d("style", { children: E }),
|
|
@@ -3212,8 +3270,8 @@ function Wt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3212
3270
|
}
|
|
3213
3271
|
//#endregion
|
|
3214
3272
|
//#region src/WebimContent.jsx
|
|
3215
|
-
function
|
|
3216
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
3273
|
+
function Kt({ bundle: e, mode: t = "auto", style: n }) {
|
|
3274
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(Gt, {
|
|
3217
3275
|
blocks: e.blocks,
|
|
3218
3276
|
theme: e.theme,
|
|
3219
3277
|
components: e.components,
|
|
@@ -3230,7 +3288,7 @@ function Gt({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
3230
3288
|
}
|
|
3231
3289
|
//#endregion
|
|
3232
3290
|
//#region src/bundle.js
|
|
3233
|
-
function
|
|
3291
|
+
function qt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
3234
3292
|
let a = {
|
|
3235
3293
|
...t?.global ?? {},
|
|
3236
3294
|
...t?.tenant ?? {}
|
|
@@ -3254,29 +3312,36 @@ function Kt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
3254
3312
|
}
|
|
3255
3313
|
//#endregion
|
|
3256
3314
|
//#region src/fetchPage.js
|
|
3257
|
-
var
|
|
3315
|
+
var Jt = async (e) => {
|
|
3258
3316
|
let t = await e.json().catch(() => null);
|
|
3259
3317
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
3260
3318
|
return t?.payload ?? t;
|
|
3261
3319
|
};
|
|
3262
|
-
async function
|
|
3320
|
+
async function Yt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
3263
3321
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
3264
3322
|
if (!n) throw Error("fetchPage: slug is required");
|
|
3265
|
-
let
|
|
3323
|
+
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
3266
3324
|
...t ? { "x-tenant": t } : {},
|
|
3267
3325
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
3268
|
-
}, [
|
|
3269
|
-
page:
|
|
3270
|
-
settings:
|
|
3326
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Jt), c(`${l}/settings/public`, { headers: u }).then(Jt)]), p = qt({
|
|
3327
|
+
page: d,
|
|
3328
|
+
settings: f,
|
|
3271
3329
|
tenant: t,
|
|
3272
|
-
apiUrl:
|
|
3330
|
+
apiUrl: l,
|
|
3273
3331
|
locale: r
|
|
3274
|
-
}),
|
|
3275
|
-
if (
|
|
3276
|
-
let e = (e) => e.startsWith("api:") ? `${
|
|
3277
|
-
|
|
3332
|
+
}), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
|
|
3333
|
+
if (m.length) {
|
|
3334
|
+
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(Jt).then((e) => {
|
|
3335
|
+
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
3336
|
+
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
3337
|
+
}).catch(() => [[t, []]])));
|
|
3338
|
+
p.datasets = Object.fromEntries(t.flat());
|
|
3278
3339
|
}
|
|
3279
|
-
|
|
3340
|
+
let h = Number(o);
|
|
3341
|
+
return Number.isFinite(h) && h >= 1 && (p.datasets = {
|
|
3342
|
+
...p.datasets ?? {},
|
|
3343
|
+
__page: Math.floor(h)
|
|
3344
|
+
}), p;
|
|
3280
3345
|
}
|
|
3281
3346
|
//#endregion
|
|
3282
3347
|
//#region src/ssr.jsx
|
|
@@ -3286,14 +3351,14 @@ var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
|
3286
3351
|
">": ">",
|
|
3287
3352
|
"\"": """
|
|
3288
3353
|
})[e]);
|
|
3289
|
-
function
|
|
3290
|
-
return e(/* @__PURE__ */ d(
|
|
3354
|
+
function Xt(t, { mode: n = "auto", style: r } = {}) {
|
|
3355
|
+
return e(/* @__PURE__ */ d(Kt, {
|
|
3291
3356
|
bundle: t,
|
|
3292
3357
|
mode: n,
|
|
3293
3358
|
style: r
|
|
3294
3359
|
}));
|
|
3295
3360
|
}
|
|
3296
|
-
function
|
|
3361
|
+
function Zt(e, { mode: t = "auto", lang: n } = {}) {
|
|
3297
3362
|
let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
|
|
3298
3363
|
"<meta charset=\"utf-8\"/>",
|
|
3299
3364
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
@@ -3310,10 +3375,10 @@ function Xt(e, { mode: t = "auto", lang: n } = {}) {
|
|
|
3310
3375
|
${c}
|
|
3311
3376
|
</head>
|
|
3312
3377
|
<body>
|
|
3313
|
-
${
|
|
3378
|
+
${Xt(e, { mode: t })}
|
|
3314
3379
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
3315
3380
|
</body>
|
|
3316
3381
|
</html>`;
|
|
3317
3382
|
}
|
|
3318
3383
|
//#endregion
|
|
3319
|
-
export {
|
|
3384
|
+
export { qt as assembleBundle, Yt as fetchPage, Xt as renderBundleHtml, Zt as renderPageDocument };
|