webim-adapter 2.0.3 → 2.1.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/CHANGELOG.md +5 -0
- package/build/webim-adapter.js +1072 -746
- package/build/webim-embed.js +16 -10
- package/build/webim-ssr.js +1147 -821
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -266,18 +266,18 @@ function A(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: oe, overlayOpacity: se } = t;
|
|
270
|
+
if (delete t.overlayColor, delete t.overlayOpacity, oe) {
|
|
271
|
+
let e = `color-mix(in srgb, ${oe} ${se ?? 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: ce } = t;
|
|
276
276
|
delete t.backgroundLayers;
|
|
277
|
-
let
|
|
278
|
-
if (
|
|
277
|
+
let le = (Array.isArray(ce) ? ce : []).filter((e) => e && e.on !== !1);
|
|
278
|
+
if (le.length) {
|
|
279
279
|
let e = [], n = [], r = [], i = [], a = [];
|
|
280
|
-
for (let t of
|
|
280
|
+
for (let t of le) 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;
|
|
@@ -475,14 +475,14 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
475
475
|
h4: 22,
|
|
476
476
|
h5: 19,
|
|
477
477
|
h6: 16
|
|
478
|
-
},
|
|
478
|
+
}, oe = {
|
|
479
479
|
font: "system",
|
|
480
480
|
headingFont: "inherit",
|
|
481
481
|
headings: q,
|
|
482
482
|
bodySize: 16,
|
|
483
483
|
light: ae.light,
|
|
484
484
|
dark: ae.dark
|
|
485
|
-
},
|
|
485
|
+
}, se = {
|
|
486
486
|
system: {
|
|
487
487
|
label: "System",
|
|
488
488
|
value: G
|
|
@@ -503,7 +503,7 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
503
503
|
label: "Mono",
|
|
504
504
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
505
505
|
}
|
|
506
|
-
},
|
|
506
|
+
}, ce = (e, t) => se[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), le = (e, ...t) => {
|
|
507
507
|
let n = Object.assign({}, e, ...t);
|
|
508
508
|
return n.primary = {
|
|
509
509
|
...e.primary,
|
|
@@ -519,21 +519,21 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
519
519
|
}), {})
|
|
520
520
|
}, n;
|
|
521
521
|
};
|
|
522
|
-
function
|
|
522
|
+
function ue(e) {
|
|
523
523
|
let { light: t, dark: n, font: r, headingFont: i, headings: a, bodySize: o, ...s } = e ?? {};
|
|
524
524
|
return {
|
|
525
|
-
font: r ??
|
|
526
|
-
headingFont: i ??
|
|
525
|
+
font: r ?? oe.font,
|
|
526
|
+
headingFont: i ?? oe.headingFont,
|
|
527
527
|
headings: {
|
|
528
528
|
...q,
|
|
529
529
|
...a ?? {}
|
|
530
530
|
},
|
|
531
531
|
bodySize: o ?? 16,
|
|
532
|
-
light:
|
|
533
|
-
dark:
|
|
532
|
+
light: le(ae.light, s, t),
|
|
533
|
+
dark: le(ae.dark, n)
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function J(e) {
|
|
537
537
|
return {
|
|
538
538
|
"--page-bg": e.background,
|
|
539
539
|
"--page-surface": e.surface ?? e.background,
|
|
@@ -552,12 +552,12 @@ function ue(e) {
|
|
|
552
552
|
};
|
|
553
553
|
}
|
|
554
554
|
function de(e) {
|
|
555
|
-
let t =
|
|
555
|
+
let t = ue(e);
|
|
556
556
|
return {
|
|
557
557
|
backgroundColor: "var(--page-bg)",
|
|
558
558
|
color: "var(--page-text)",
|
|
559
|
-
fontFamily:
|
|
560
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
559
|
+
fontFamily: ce(t.font, G),
|
|
560
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : ce(t.headingFont, "inherit"),
|
|
561
561
|
...pe(t.headings),
|
|
562
562
|
"--page-body-size": fe(t.bodySize, 16)
|
|
563
563
|
};
|
|
@@ -574,10 +574,10 @@ function pe(e) {
|
|
|
574
574
|
return t;
|
|
575
575
|
}
|
|
576
576
|
function me(e, t = "light") {
|
|
577
|
-
let n =
|
|
577
|
+
let n = ue(e);
|
|
578
578
|
return {
|
|
579
579
|
...de(e),
|
|
580
|
-
...
|
|
580
|
+
...J(n[t] ?? n.light)
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
583
|
function he(e, t) {
|
|
@@ -665,34 +665,301 @@ var be = /* @__PURE__ */ new Set([
|
|
|
665
665
|
"yi",
|
|
666
666
|
"dv",
|
|
667
667
|
"ckb"
|
|
668
|
-
]), Y = (e) => be.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", X = (e, t) => e === "ltr" || e === "rtl" ? e : t ? Y(t) : void 0, Z =
|
|
668
|
+
]), Y = (e) => be.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", X = (e, t) => e === "ltr" || e === "rtl" ? e : t ? Y(t) : void 0, Z = /^(https?:|mailto:|tel:)/i, xe = /^[a-z][a-z0-9+.-]*:/i;
|
|
669
|
+
function Se(e) {
|
|
670
|
+
let t = String(e ?? "").trim();
|
|
671
|
+
return t ? Z.test(t) || t.startsWith("//") ? t : xe.test(t) ? "" : t : "";
|
|
672
|
+
}
|
|
673
|
+
var Ce = /^\\([\\`*_{}[\]()#+\-.!~>|])/, we = /^(`+)([\s\S]*?[^`])\1(?!`)/, Te = /^!\[([^\]]*)\]\(\s*<?([^)\s>]*)>?(?:\s+"([^"]*)")?\s*\)/, Ee = /^\[((?:[^[\]]|\[[^\]]*\])*)\]\(\s*<?([^)\s>]*)>?(?:\s+"([^"]*)")?\s*\)/, De = /^<((?:https?:\/\/|mailto:)[^>\s]+)>/, Oe = /^https?:\/\/[^\s<>"'`]+[^\s<>"'`.,;:!?)\]}]/, ke = /^(\*\*|__)(?=\S)([\s\S]*?\S)\1/, Ae = /^~~(?=\S)([\s\S]*?\S)~~/, je = /^(\*|_)(?=\S)([\s\S]*?\S)\1/, Me = /[\\`*_~![<\n]|https?:\/\//, Ne = (e, t) => e.map((e) => e.br || e.image ? {
|
|
674
|
+
...e,
|
|
675
|
+
...t.href ? {
|
|
676
|
+
href: t.href,
|
|
677
|
+
target: t.target
|
|
678
|
+
} : null
|
|
679
|
+
} : {
|
|
680
|
+
...e,
|
|
681
|
+
...t
|
|
682
|
+
});
|
|
683
|
+
function Pe(e, t = {}) {
|
|
684
|
+
let n = String(e ?? ""), r = t.newTab ? "_blank" : void 0, i = [], a = "", o = 0, s = () => {
|
|
685
|
+
a && i.push({ text: a }), a = "";
|
|
686
|
+
}, c = (e) => {
|
|
687
|
+
s(), i.push(...e);
|
|
688
|
+
};
|
|
689
|
+
for (; o < n.length;) {
|
|
690
|
+
let e = n.slice(o), i = o > 0 ? n[o - 1] : "", s = Ce.exec(e);
|
|
691
|
+
if (s) {
|
|
692
|
+
a += s[1], o += s[0].length;
|
|
693
|
+
continue;
|
|
694
|
+
}
|
|
695
|
+
if (e[0] === "\n") {
|
|
696
|
+
/ {2,}$/.test(a) ? (a = a.replace(/ +$/, ""), c([{ br: !0 }])) : a.endsWith("\\") ? (a = a.slice(0, -1), c([{ br: !0 }])) : a += " ", o += 1;
|
|
697
|
+
continue;
|
|
698
|
+
}
|
|
699
|
+
if (s = we.exec(e), s) {
|
|
700
|
+
c([{
|
|
701
|
+
text: (/^ .* $/.test(s[2]) ? s[2].slice(1, -1) : s[2]).replace(/\n/g, " "),
|
|
702
|
+
code: !0
|
|
703
|
+
}]), o += s[0].length;
|
|
704
|
+
continue;
|
|
705
|
+
}
|
|
706
|
+
if (s = Te.exec(e), s) {
|
|
707
|
+
let e = Se(s[2]);
|
|
708
|
+
e ? c([{ image: {
|
|
709
|
+
src: e,
|
|
710
|
+
alt: s[1] || "",
|
|
711
|
+
title: s[3] || ""
|
|
712
|
+
} }]) : a += s[1], o += s[0].length;
|
|
713
|
+
continue;
|
|
714
|
+
}
|
|
715
|
+
if (s = Ee.exec(e), s) {
|
|
716
|
+
let e = Se(s[2]), n = Pe(s[1], t);
|
|
717
|
+
c(e ? Ne(n, {
|
|
718
|
+
href: e,
|
|
719
|
+
target: r
|
|
720
|
+
}) : n), o += s[0].length;
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
if (s = De.exec(e) ?? (/[\s(<]/.test(i) || o === 0 ? Oe.exec(e) : null), s) {
|
|
724
|
+
let e = s[1] ?? s[0], t = Se(e);
|
|
725
|
+
t ? c([{
|
|
726
|
+
text: e.replace(/^mailto:/i, ""),
|
|
727
|
+
href: t,
|
|
728
|
+
target: r
|
|
729
|
+
}]) : a += e, o += s[0].length;
|
|
730
|
+
continue;
|
|
731
|
+
}
|
|
732
|
+
if (s = ke.exec(e), s && (s[1] === "**" || !/\w/.test(i))) {
|
|
733
|
+
c(Ne(Pe(s[2], t), { bold: !0 })), o += s[0].length;
|
|
734
|
+
continue;
|
|
735
|
+
}
|
|
736
|
+
if (s = Ae.exec(e), s) {
|
|
737
|
+
c(Ne(Pe(s[1], t), { strike: !0 })), o += s[0].length;
|
|
738
|
+
continue;
|
|
739
|
+
}
|
|
740
|
+
if (s = je.exec(e), s && (s[1] === "*" || !/\w/.test(i) && !/\w/.test(n[o + s[0].length] ?? ""))) {
|
|
741
|
+
c(Ne(Pe(s[2], t), { italic: !0 })), o += s[0].length;
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
744
|
+
a += n[o], o += 1;
|
|
745
|
+
let l = n.slice(o).search(Me);
|
|
746
|
+
l > 0 ? (a += n.slice(o, o + l), o += l) : l === -1 && (a += n.slice(o), o = n.length);
|
|
747
|
+
}
|
|
748
|
+
return s(), i;
|
|
749
|
+
}
|
|
750
|
+
var Fe = /^[ \t]*$/, Ie = /^ {0,3}(`{3,}|~{3,})[ \t]*([^`\s]*)[ \t]*$/, Le = /^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/, Re = /^ {0,3}(?:(?:\*[ \t]*){3,}|(?:-[ \t]*){3,}|(?:_[ \t]*){3,})$/, ze = /^ {0,3}>[ \t]?(.*)$/, Be = /^( *)([-*+])[ \t]+(.*)$/, Ve = /^( *)(\d{1,9})[.)][ \t]+(.*)$/, He = /^ {0,3}(=+|-+)[ \t]*$/, Ue = /^\[([ xX])\][ \t]+(.*)$/, We = /^ {0,3}\|?(?:[ \t]*:?-+:?[ \t]*\|)+[ \t]*:?-*:?[ \t]*\|?[ \t]*$/, Ge = (e) => (/^[ \t]*/.exec(e)[0].match(/\t/g) || []).length * 3 + /^[ \t]*/.exec(e)[0].length;
|
|
751
|
+
function Ke(e) {
|
|
752
|
+
let t = Be.exec(e);
|
|
753
|
+
if (t) return {
|
|
754
|
+
indent: t[1].length,
|
|
755
|
+
ordered: !1,
|
|
756
|
+
text: t[3]
|
|
757
|
+
};
|
|
758
|
+
let n = Ve.exec(e);
|
|
759
|
+
return n ? {
|
|
760
|
+
indent: n[1].length,
|
|
761
|
+
ordered: !0,
|
|
762
|
+
start: Number(n[2]),
|
|
763
|
+
text: n[3]
|
|
764
|
+
} : null;
|
|
765
|
+
}
|
|
766
|
+
function qe(e) {
|
|
767
|
+
let t = [], n = "";
|
|
768
|
+
for (let r = 0; r < e.length; r++) e[r] === "\\" && e[r + 1] === "|" ? (n += "|", r += 1) : e[r] === "|" ? (t.push(n), n = "") : n += e[r];
|
|
769
|
+
return t.push(n), t.length && Fe.test(t[0]) && t.shift(), t.length && Fe.test(t[t.length - 1]) && t.pop(), t.map((e) => e.trim());
|
|
770
|
+
}
|
|
771
|
+
var Je = (e) => {
|
|
772
|
+
let t = e.trim(), n = t.startsWith(":"), r = t.endsWith(":");
|
|
773
|
+
return n && r ? "center" : r ? "right" : n ? "left" : null;
|
|
774
|
+
};
|
|
775
|
+
function Ye(e) {
|
|
776
|
+
let t = e.filter((e) => !(e.text && !e.text.trim()));
|
|
777
|
+
if (t.length === 1 && t[0].image && !t[0].href) {
|
|
778
|
+
let { src: e, alt: n, title: r } = t[0].image;
|
|
779
|
+
return [{
|
|
780
|
+
type: "image",
|
|
781
|
+
src: e,
|
|
782
|
+
alt: n,
|
|
783
|
+
caption: r || "",
|
|
784
|
+
align: "left",
|
|
785
|
+
wrap: !1
|
|
786
|
+
}];
|
|
787
|
+
}
|
|
788
|
+
return e.length ? [{
|
|
789
|
+
type: "p",
|
|
790
|
+
parts: e
|
|
791
|
+
}] : [];
|
|
792
|
+
}
|
|
793
|
+
function Xe(e) {
|
|
794
|
+
let t = String(e ?? "").replace(/\r\n?/g, "\n").replace(/^/, "").split("\n"), n = null;
|
|
795
|
+
return t.map((e) => {
|
|
796
|
+
let t = Ie.exec(e);
|
|
797
|
+
return n ? (t && t[1].startsWith(n[0]) && t[1].length >= n.length && (n = null), e) : t ? (n = t[1], e) : e.replace(/^[ \t]+/, (e) => e.replace(/\t/g, " "));
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
function Ze(e, t) {
|
|
801
|
+
let n = [], r = 0;
|
|
802
|
+
for (; r < e.length;) {
|
|
803
|
+
let i = e[r];
|
|
804
|
+
if (Fe.test(i)) {
|
|
805
|
+
r += 1;
|
|
806
|
+
continue;
|
|
807
|
+
}
|
|
808
|
+
let a = Ie.exec(i);
|
|
809
|
+
if (a) {
|
|
810
|
+
let t = [], i = r + 1;
|
|
811
|
+
for (; i < e.length;) {
|
|
812
|
+
let n = Ie.exec(e[i]);
|
|
813
|
+
if (n && n[1][0] === a[1][0] && n[1].length >= a[1].length && !n[2]) break;
|
|
814
|
+
t.push(e[i]), i += 1;
|
|
815
|
+
}
|
|
816
|
+
n.push({
|
|
817
|
+
type: "code",
|
|
818
|
+
lang: a[2] || "",
|
|
819
|
+
text: t.join("\n")
|
|
820
|
+
}), r = i + 1;
|
|
821
|
+
continue;
|
|
822
|
+
}
|
|
823
|
+
let o = Le.exec(i);
|
|
824
|
+
if (o) {
|
|
825
|
+
let e = (o[2] ?? "").replace(/[ \t]+#+[ \t]*$/, "");
|
|
826
|
+
n.push({
|
|
827
|
+
type: `h${o[1].length}`,
|
|
828
|
+
parts: Pe(e, t)
|
|
829
|
+
}), r += 1;
|
|
830
|
+
continue;
|
|
831
|
+
}
|
|
832
|
+
if (Re.test(i)) {
|
|
833
|
+
n.push({ type: "divider" }), r += 1;
|
|
834
|
+
continue;
|
|
835
|
+
}
|
|
836
|
+
if (ze.test(i)) {
|
|
837
|
+
let i = [];
|
|
838
|
+
for (; r < e.length;) {
|
|
839
|
+
let t = ze.exec(e[r]);
|
|
840
|
+
if (t) i.push(t[1]);
|
|
841
|
+
else if (!Fe.test(e[r]) && i.length && !Fe.test(i[i.length - 1])) i.push(e[r]);
|
|
842
|
+
else break;
|
|
843
|
+
r += 1;
|
|
844
|
+
}
|
|
845
|
+
let a = Ze(i, t);
|
|
846
|
+
n.push(a.length === 1 && a[0].type === "p" ? {
|
|
847
|
+
type: "quote",
|
|
848
|
+
parts: a[0].parts
|
|
849
|
+
} : {
|
|
850
|
+
type: "quote",
|
|
851
|
+
blocks: a
|
|
852
|
+
});
|
|
853
|
+
continue;
|
|
854
|
+
}
|
|
855
|
+
if (Ke(i)) {
|
|
856
|
+
r = Qe(e, r, n, t);
|
|
857
|
+
continue;
|
|
858
|
+
}
|
|
859
|
+
if (i.includes("|") && r + 1 < e.length && We.test(e[r + 1])) {
|
|
860
|
+
let a = qe(i), o = qe(e[r + 1]).map(Je), s = [a.map((e) => Pe(e, t))], c = r + 2;
|
|
861
|
+
for (; c < e.length && !Fe.test(e[c]) && e[c].includes("|");) {
|
|
862
|
+
let n = qe(e[c]);
|
|
863
|
+
s.push(a.map((e, r) => Pe(n[r] ?? "", t))), c += 1;
|
|
864
|
+
}
|
|
865
|
+
let l = {};
|
|
866
|
+
o.forEach((e, t) => {
|
|
867
|
+
e && s.forEach((n, r) => l[`${r}:${t}`] = { align: e });
|
|
868
|
+
}), n.push({
|
|
869
|
+
type: "table",
|
|
870
|
+
header: !0,
|
|
871
|
+
rows: s,
|
|
872
|
+
cellStyles: l
|
|
873
|
+
}), r = c;
|
|
874
|
+
continue;
|
|
875
|
+
}
|
|
876
|
+
let s = [i];
|
|
877
|
+
for (r += 1; r < e.length && !Fe.test(e[r]);) {
|
|
878
|
+
let i = e[r], a = He.exec(i);
|
|
879
|
+
if (a) {
|
|
880
|
+
n.push({
|
|
881
|
+
type: a[1][0] === "=" ? "h1" : "h2",
|
|
882
|
+
parts: Pe(s.join("\n"), t)
|
|
883
|
+
}), r += 1, s.length = 0;
|
|
884
|
+
break;
|
|
885
|
+
}
|
|
886
|
+
if (Ie.test(i) || Le.test(i) || Re.test(i) || ze.test(i) || Ke(i)) break;
|
|
887
|
+
s.push(i), r += 1;
|
|
888
|
+
}
|
|
889
|
+
s.length && n.push(...Ye(Pe(s.join("\n"), t)));
|
|
890
|
+
}
|
|
891
|
+
return n;
|
|
892
|
+
}
|
|
893
|
+
function Qe(e, t, n, r) {
|
|
894
|
+
let i = Ke(e[t]), a = i.indent, o = [], s = null, c = t;
|
|
895
|
+
for (; c < e.length;) {
|
|
896
|
+
let t = e[c], n = Ke(t);
|
|
897
|
+
if (n && n.indent <= a + 1) {
|
|
898
|
+
if (n.ordered !== i.ordered) break;
|
|
899
|
+
s = { lines: [n.text] }, o.push(s), c += 1;
|
|
900
|
+
continue;
|
|
901
|
+
}
|
|
902
|
+
if (Fe.test(t)) {
|
|
903
|
+
let t = c;
|
|
904
|
+
for (; t < e.length && Fe.test(e[t]);) t += 1;
|
|
905
|
+
if (!(t < e.length && (Ge(e[t]) >= a + 2 || Ke(e[t]) && Ke(e[t]).ordered === i.ordered))) break;
|
|
906
|
+
s?.lines.push(""), c = t;
|
|
907
|
+
continue;
|
|
908
|
+
}
|
|
909
|
+
if (!s) break;
|
|
910
|
+
if (Ge(t) >= a + 2) s.lines.push(t.slice(Math.min(t.length - t.trimStart().length, a + 2)));
|
|
911
|
+
else if (!n) s.lines.push(t.trim());
|
|
912
|
+
else break;
|
|
913
|
+
c += 1;
|
|
914
|
+
}
|
|
915
|
+
return n.push({
|
|
916
|
+
type: i.ordered ? "ol" : "ul",
|
|
917
|
+
...i.ordered && i.start !== 1 ? { start: i.start } : null,
|
|
918
|
+
items: o.map((e) => {
|
|
919
|
+
let t = Ue.exec(e.lines[0] ?? "");
|
|
920
|
+
t && (e.lines[0] = t[2]);
|
|
921
|
+
let n = Ze(e.lines, r), i = n[0]?.type === "p" ? n.shift() : null;
|
|
922
|
+
return {
|
|
923
|
+
parts: i ? i.parts : [],
|
|
924
|
+
...n.length ? { blocks: n } : null,
|
|
925
|
+
...t ? { task: t[1].toLowerCase() === "x" } : null
|
|
926
|
+
};
|
|
927
|
+
})
|
|
928
|
+
}), c;
|
|
929
|
+
}
|
|
930
|
+
function $e(e, t = {}) {
|
|
931
|
+
return String(e ?? "").trim() ? Ze(Xe(e), t) : [];
|
|
932
|
+
}
|
|
933
|
+
//#endregion
|
|
934
|
+
//#region ../ui/src/components/builder/views.jsx
|
|
935
|
+
var Q = t({
|
|
669
936
|
tenant: "",
|
|
670
937
|
apiUrl: "/api",
|
|
671
938
|
locale: "",
|
|
672
939
|
settings: null
|
|
673
|
-
}),
|
|
940
|
+
}), et = t(null), tt = (e) => {
|
|
674
941
|
let t = Number(e?.__page);
|
|
675
942
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
676
943
|
if (typeof window > "u") return 1;
|
|
677
944
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
678
945
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
679
|
-
},
|
|
946
|
+
}, nt = () => {
|
|
680
947
|
if (typeof window > "u") return {};
|
|
681
948
|
let e = {};
|
|
682
949
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
683
950
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
684
951
|
}), e;
|
|
685
|
-
},
|
|
952
|
+
}, rt = (e) => {
|
|
686
953
|
let t = {
|
|
687
954
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
688
|
-
...
|
|
955
|
+
...nt()
|
|
689
956
|
};
|
|
690
957
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
691
|
-
},
|
|
692
|
-
function
|
|
958
|
+
}, it = t(null), at = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
959
|
+
function ot(e, t) {
|
|
693
960
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
694
961
|
}
|
|
695
|
-
var
|
|
962
|
+
var st = (e) => {
|
|
696
963
|
let t = [];
|
|
697
964
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
698
965
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -702,39 +969,39 @@ var De = (e) => {
|
|
|
702
969
|
}
|
|
703
970
|
return t;
|
|
704
971
|
};
|
|
705
|
-
function
|
|
972
|
+
function ct(e) {
|
|
706
973
|
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(" ") : "";
|
|
707
974
|
}
|
|
708
|
-
function
|
|
709
|
-
let n = t?.data ?? {}, r =
|
|
975
|
+
function lt(e, t) {
|
|
976
|
+
let n = t?.data ?? {}, r = st(n);
|
|
710
977
|
if (!r.length) return e;
|
|
711
|
-
let i = RegExp(`:(${r.map(
|
|
978
|
+
let i = RegExp(`:(${r.map(at).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => ct(ot(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
712
979
|
return a(e);
|
|
713
980
|
}
|
|
714
|
-
var
|
|
981
|
+
var ut = {
|
|
715
982
|
margin: 0,
|
|
716
983
|
fontWeight: 700,
|
|
717
984
|
lineHeight: 1.2,
|
|
718
985
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
719
|
-
},
|
|
986
|
+
}, dt = q, ft = (e) => `var(--page-${e}, ${q[e] ?? q.h2}px)`, pt = {
|
|
720
987
|
margin: 0,
|
|
721
988
|
fontSize: "var(--page-body-size, 16px)"
|
|
722
|
-
},
|
|
989
|
+
}, mt = {
|
|
723
990
|
display: "inline-block",
|
|
724
991
|
textDecoration: "none",
|
|
725
992
|
cursor: "pointer",
|
|
726
993
|
backgroundColor: "var(--page-accent, #111827)",
|
|
727
994
|
color: "var(--page-accent-text, #ffffff)"
|
|
728
|
-
},
|
|
995
|
+
}, ht = {
|
|
729
996
|
flexGrow: 1,
|
|
730
997
|
display: "flex",
|
|
731
998
|
flexDirection: "column",
|
|
732
999
|
position: "relative"
|
|
733
|
-
},
|
|
1000
|
+
}, gt = {
|
|
734
1001
|
display: "flex",
|
|
735
1002
|
flexDirection: "column"
|
|
736
1003
|
};
|
|
737
|
-
function
|
|
1004
|
+
function _t({ style: e }) {
|
|
738
1005
|
let t = e?.backgroundVideo;
|
|
739
1006
|
if (!t) return null;
|
|
740
1007
|
let n = {
|
|
@@ -760,7 +1027,7 @@ function Le({ style: e }) {
|
|
|
760
1027
|
background: r
|
|
761
1028
|
} })] });
|
|
762
1029
|
}
|
|
763
|
-
var
|
|
1030
|
+
var vt = (e, t) => e?.backgroundVideo ? {
|
|
764
1031
|
position: "relative",
|
|
765
1032
|
...t,
|
|
766
1033
|
...A(e)
|
|
@@ -768,24 +1035,24 @@ var Re = (e, t) => e?.backgroundVideo ? {
|
|
|
768
1035
|
...t,
|
|
769
1036
|
...A(e)
|
|
770
1037
|
};
|
|
771
|
-
function
|
|
1038
|
+
function yt({ style: e, nodeRef: t, children: n }) {
|
|
772
1039
|
return /* @__PURE__ */ d("div", {
|
|
773
1040
|
ref: t,
|
|
774
1041
|
style: {
|
|
775
|
-
...
|
|
1042
|
+
...ht,
|
|
776
1043
|
...A(e)
|
|
777
1044
|
},
|
|
778
|
-
children: [/* @__PURE__ */ u(
|
|
1045
|
+
children: [/* @__PURE__ */ u(_t, { style: e }), n]
|
|
779
1046
|
});
|
|
780
1047
|
}
|
|
781
|
-
function
|
|
1048
|
+
function bt({ style: e, nodeRef: t, children: n }) {
|
|
782
1049
|
return /* @__PURE__ */ d("section", {
|
|
783
1050
|
ref: t,
|
|
784
|
-
style:
|
|
785
|
-
children: [/* @__PURE__ */ u(
|
|
1051
|
+
style: vt(e, gt),
|
|
1052
|
+
children: [/* @__PURE__ */ u(_t, { style: e }), n]
|
|
786
1053
|
});
|
|
787
1054
|
}
|
|
788
|
-
function
|
|
1055
|
+
function xt({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
789
1056
|
let i = t ? {
|
|
790
1057
|
position: "relative",
|
|
791
1058
|
minHeight: 240
|
|
@@ -794,33 +1061,43 @@ function Ve({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
794
1061
|
ref: n,
|
|
795
1062
|
style: i ? {
|
|
796
1063
|
...i,
|
|
797
|
-
...
|
|
798
|
-
} :
|
|
799
|
-
children: [/* @__PURE__ */ u(
|
|
1064
|
+
...vt(e)
|
|
1065
|
+
} : vt(e),
|
|
1066
|
+
children: [/* @__PURE__ */ u(_t, { style: e }), r]
|
|
800
1067
|
});
|
|
801
1068
|
}
|
|
802
|
-
function
|
|
1069
|
+
function St({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
803
1070
|
return /* @__PURE__ */ u(n, {
|
|
804
1071
|
ref: a,
|
|
805
1072
|
style: {
|
|
806
|
-
...
|
|
807
|
-
fontSize:
|
|
1073
|
+
...ut,
|
|
1074
|
+
fontSize: ft(n),
|
|
808
1075
|
...A(r)
|
|
809
1076
|
},
|
|
810
|
-
children:
|
|
1077
|
+
children: Et(t, e, i)
|
|
811
1078
|
});
|
|
812
1079
|
}
|
|
813
|
-
var
|
|
814
|
-
fontFamily:
|
|
1080
|
+
var Ct = {
|
|
1081
|
+
fontFamily: se.mono.value,
|
|
815
1082
|
background: "rgba(148, 163, 184, 0.18)",
|
|
816
1083
|
padding: "1px 5px",
|
|
817
1084
|
borderRadius: 4,
|
|
818
1085
|
fontSize: "0.9em"
|
|
1086
|
+
}, wt = {
|
|
1087
|
+
fontFamily: se.mono.value,
|
|
1088
|
+
background: "rgba(148, 163, 184, 0.16)",
|
|
1089
|
+
border: "1px solid rgba(148, 163, 184, 0.3)",
|
|
1090
|
+
borderRadius: 6,
|
|
1091
|
+
padding: "12px 14px",
|
|
1092
|
+
fontSize: "0.875em",
|
|
1093
|
+
lineHeight: 1.55,
|
|
1094
|
+
overflowX: "auto",
|
|
1095
|
+
whiteSpace: "pre"
|
|
819
1096
|
};
|
|
820
|
-
function
|
|
1097
|
+
function Tt(e, t = [], n, r) {
|
|
821
1098
|
let i = e;
|
|
822
1099
|
return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
|
|
823
|
-
style:
|
|
1100
|
+
style: Ct,
|
|
824
1101
|
children: i
|
|
825
1102
|
})), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n ? i = /* @__PURE__ */ u("a", {
|
|
826
1103
|
href: n,
|
|
@@ -836,13 +1113,22 @@ function We(e, t = [], n, r) {
|
|
|
836
1113
|
children: i
|
|
837
1114
|
})), i;
|
|
838
1115
|
}
|
|
839
|
-
function
|
|
1116
|
+
function Et(t, n, r) {
|
|
840
1117
|
return t?.length ? t.map((t, n) => {
|
|
841
1118
|
if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
|
|
842
|
-
if (t.parts) return /* @__PURE__ */ u(e, { children:
|
|
1119
|
+
if (t.parts) return /* @__PURE__ */ u(e, { children: Et(t.parts, "", r) }, n);
|
|
1120
|
+
if (t.br) return /* @__PURE__ */ u("br", {}, n);
|
|
843
1121
|
let i = t.text;
|
|
844
|
-
return t.
|
|
845
|
-
|
|
1122
|
+
return t.image && (i = /* @__PURE__ */ u("img", {
|
|
1123
|
+
src: t.image.src,
|
|
1124
|
+
alt: t.image.alt || "",
|
|
1125
|
+
title: t.image.title || void 0,
|
|
1126
|
+
style: {
|
|
1127
|
+
maxWidth: "100%",
|
|
1128
|
+
verticalAlign: "middle"
|
|
1129
|
+
}
|
|
1130
|
+
})), t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
|
|
1131
|
+
style: Ct,
|
|
846
1132
|
children: i
|
|
847
1133
|
})), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
|
|
848
1134
|
style: {
|
|
@@ -865,35 +1151,35 @@ function Ge(t, n, r) {
|
|
|
865
1151
|
})), /* @__PURE__ */ u(e, { children: i }, n);
|
|
866
1152
|
}) : n;
|
|
867
1153
|
}
|
|
868
|
-
function
|
|
1154
|
+
function Dt({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
869
1155
|
return /* @__PURE__ */ u("span", {
|
|
870
1156
|
style: A(a),
|
|
871
|
-
children: e?.length ?
|
|
1157
|
+
children: e?.length ? Et(e, t) : Tt(t, n, r, i)
|
|
872
1158
|
});
|
|
873
1159
|
}
|
|
874
|
-
var
|
|
1160
|
+
var Ot = [
|
|
875
1161
|
"left",
|
|
876
1162
|
"center",
|
|
877
1163
|
"right",
|
|
878
1164
|
"justify"
|
|
879
1165
|
];
|
|
880
|
-
function
|
|
1166
|
+
function kt(e, t, n) {
|
|
881
1167
|
let r = e && e.cellStyles;
|
|
882
1168
|
if (!r || typeof r != "object" || Array.isArray(r)) return {};
|
|
883
1169
|
let i = r[`${t}:${n}`];
|
|
884
1170
|
return i && typeof i == "object" && !Array.isArray(i) ? i : {};
|
|
885
1171
|
}
|
|
886
|
-
function
|
|
1172
|
+
function At(e, t) {
|
|
887
1173
|
let n = e || {}, r = typeof n.bold == "boolean" ? n.bold : !!t;
|
|
888
1174
|
return {
|
|
889
|
-
textAlign:
|
|
1175
|
+
textAlign: Ot.includes(n.align) ? n.align : "left",
|
|
890
1176
|
fontWeight: r ? 700 : 400,
|
|
891
1177
|
fontStyle: n.italic ? "italic" : void 0,
|
|
892
1178
|
color: typeof n.color == "string" && n.color ? n.color : void 0,
|
|
893
1179
|
backgroundColor: typeof n.bg == "string" && n.bg ? n.bg : void 0
|
|
894
1180
|
};
|
|
895
1181
|
}
|
|
896
|
-
function
|
|
1182
|
+
function jt({ align: e = "center", width: t, wrap: n } = {}) {
|
|
897
1183
|
let r = t ? `${t}%` : void 0;
|
|
898
1184
|
if (e === "full") return { width: "100%" };
|
|
899
1185
|
let i = e === "left" || e === "right";
|
|
@@ -927,18 +1213,18 @@ function Xe({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
927
1213
|
marginRight: "auto"
|
|
928
1214
|
};
|
|
929
1215
|
}
|
|
930
|
-
function
|
|
931
|
-
let r = n ?? ((e, n) =>
|
|
932
|
-
return e.map((
|
|
933
|
-
let
|
|
1216
|
+
function Mt(e = [], t, n) {
|
|
1217
|
+
let r = n ?? ((e, n) => Et(e, n, t));
|
|
1218
|
+
return e.map((n, i) => {
|
|
1219
|
+
let a = {
|
|
934
1220
|
marginTop: 0,
|
|
935
|
-
marginBottom:
|
|
1221
|
+
marginBottom: i === e.length - 1 ? 0 : 14
|
|
936
1222
|
};
|
|
937
|
-
if (
|
|
938
|
-
if (!
|
|
1223
|
+
if (n.type === "image") {
|
|
1224
|
+
if (!n.src) return null;
|
|
939
1225
|
let e = /* @__PURE__ */ u("img", {
|
|
940
|
-
src:
|
|
941
|
-
alt:
|
|
1226
|
+
src: n.src,
|
|
1227
|
+
alt: n.alt || "",
|
|
942
1228
|
style: {
|
|
943
1229
|
width: "100%",
|
|
944
1230
|
display: "block",
|
|
@@ -949,51 +1235,51 @@ function Ze(e = [], t, n) {
|
|
|
949
1235
|
style: {
|
|
950
1236
|
marginLeft: 0,
|
|
951
1237
|
marginRight: 0,
|
|
952
|
-
...
|
|
953
|
-
...
|
|
1238
|
+
...a,
|
|
1239
|
+
...jt(n)
|
|
954
1240
|
},
|
|
955
|
-
children: [
|
|
956
|
-
href:
|
|
957
|
-
target:
|
|
958
|
-
rel:
|
|
1241
|
+
children: [n.href ? /* @__PURE__ */ u("a", {
|
|
1242
|
+
href: n.href,
|
|
1243
|
+
target: n.target || void 0,
|
|
1244
|
+
rel: n.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
959
1245
|
style: { display: "block" },
|
|
960
1246
|
children: e
|
|
961
|
-
}) : e,
|
|
1247
|
+
}) : e, n.caption && /* @__PURE__ */ u("figcaption", {
|
|
962
1248
|
style: {
|
|
963
1249
|
fontSize: 13,
|
|
964
1250
|
opacity: .65,
|
|
965
1251
|
marginTop: 6,
|
|
966
1252
|
textAlign: "center"
|
|
967
1253
|
},
|
|
968
|
-
children:
|
|
1254
|
+
children: n.caption
|
|
969
1255
|
})]
|
|
970
|
-
},
|
|
1256
|
+
}, i);
|
|
971
1257
|
}
|
|
972
|
-
if (
|
|
1258
|
+
if (n.type === "video") return Wt(n.url) ? /* @__PURE__ */ u("div", {
|
|
973
1259
|
style: {
|
|
974
|
-
...
|
|
975
|
-
...
|
|
976
|
-
align:
|
|
977
|
-
wrap:
|
|
978
|
-
width:
|
|
1260
|
+
...a,
|
|
1261
|
+
...jt({
|
|
1262
|
+
align: n.align,
|
|
1263
|
+
wrap: n.wrap,
|
|
1264
|
+
width: n.width ?? 100
|
|
979
1265
|
})
|
|
980
1266
|
},
|
|
981
|
-
children: /* @__PURE__ */ u(
|
|
982
|
-
url:
|
|
983
|
-
autoplay:
|
|
984
|
-
muted:
|
|
985
|
-
loop:
|
|
986
|
-
controls:
|
|
987
|
-
start:
|
|
1267
|
+
children: /* @__PURE__ */ u(Gt, {
|
|
1268
|
+
url: n.url,
|
|
1269
|
+
autoplay: n.autoplay,
|
|
1270
|
+
muted: n.muted,
|
|
1271
|
+
loop: n.loop,
|
|
1272
|
+
controls: n.controls ?? !0,
|
|
1273
|
+
start: n.start
|
|
988
1274
|
})
|
|
989
|
-
},
|
|
990
|
-
if (
|
|
991
|
-
if (!(typeof
|
|
992
|
-
let e = Number.isFinite(Number(
|
|
1275
|
+
}, i) : null;
|
|
1276
|
+
if (n.type === "button") {
|
|
1277
|
+
if (!(typeof n.label == "string" && n.label.trim())) return null;
|
|
1278
|
+
let e = Number.isFinite(Number(n.radius)) ? Number(n.radius) : 8, t = ["center", "right"].includes(n.align) ? n.align : "left";
|
|
993
1279
|
return /* @__PURE__ */ u("div", {
|
|
994
1280
|
style: {
|
|
995
|
-
...
|
|
996
|
-
textAlign:
|
|
1281
|
+
...a,
|
|
1282
|
+
textAlign: t
|
|
997
1283
|
},
|
|
998
1284
|
children: /* @__PURE__ */ u("table", {
|
|
999
1285
|
role: "presentation",
|
|
@@ -1005,132 +1291,171 @@ function Ze(e = [], t, n) {
|
|
|
1005
1291
|
},
|
|
1006
1292
|
children: /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
1007
1293
|
style: {
|
|
1008
|
-
backgroundColor:
|
|
1294
|
+
backgroundColor: n.bg || "var(--page-accent, #4f46e5)",
|
|
1009
1295
|
borderRadius: e
|
|
1010
1296
|
},
|
|
1011
1297
|
children: /* @__PURE__ */ u("a", {
|
|
1012
|
-
href:
|
|
1013
|
-
target:
|
|
1014
|
-
rel:
|
|
1298
|
+
href: n.href || "#",
|
|
1299
|
+
target: n.target || void 0,
|
|
1300
|
+
rel: n.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
1015
1301
|
style: {
|
|
1016
1302
|
display: "inline-block",
|
|
1017
1303
|
padding: "13px 24px",
|
|
1018
|
-
color:
|
|
1304
|
+
color: n.color || "#ffffff",
|
|
1019
1305
|
fontSize: 15,
|
|
1020
1306
|
fontWeight: 600,
|
|
1021
1307
|
lineHeight: 1.2,
|
|
1022
1308
|
textDecoration: "none",
|
|
1023
1309
|
borderRadius: e
|
|
1024
1310
|
},
|
|
1025
|
-
children:
|
|
1311
|
+
children: n.label
|
|
1026
1312
|
})
|
|
1027
1313
|
}) }) })
|
|
1028
1314
|
})
|
|
1029
|
-
},
|
|
1315
|
+
}, i);
|
|
1030
1316
|
}
|
|
1031
|
-
if (
|
|
1032
|
-
...
|
|
1317
|
+
if (n.type === "divider") return /* @__PURE__ */ u("hr", { style: {
|
|
1318
|
+
...a,
|
|
1033
1319
|
border: 0,
|
|
1034
1320
|
borderTop: "1px solid rgba(148, 163, 184, 0.4)"
|
|
1035
|
-
} },
|
|
1036
|
-
if (
|
|
1037
|
-
let e = Array.isArray(
|
|
1321
|
+
} }, i);
|
|
1322
|
+
if (n.type === "table") {
|
|
1323
|
+
let e = Array.isArray(n.rows) ? n.rows.filter(Array.isArray) : [];
|
|
1038
1324
|
if (!e.length) return null;
|
|
1039
|
-
let
|
|
1040
|
-
border:
|
|
1325
|
+
let t = n.header !== !1, o = {
|
|
1326
|
+
border: n.borders === !1 ? void 0 : "1px solid rgba(148, 163, 184, 0.4)",
|
|
1041
1327
|
padding: "6px 10px",
|
|
1042
1328
|
verticalAlign: "top"
|
|
1043
|
-
},
|
|
1044
|
-
...
|
|
1045
|
-
...
|
|
1329
|
+
}, s = t ? e.slice(1) : e, c = Array.isArray(n.widths) ? n.widths : null, l = (e, t, r) => ({
|
|
1330
|
+
...o,
|
|
1331
|
+
...At(kt(n, e, t), r)
|
|
1046
1332
|
});
|
|
1047
1333
|
return /* @__PURE__ */ d("table", {
|
|
1048
1334
|
style: {
|
|
1049
|
-
...
|
|
1335
|
+
...a,
|
|
1050
1336
|
borderCollapse: "collapse",
|
|
1051
1337
|
width: "100%",
|
|
1052
1338
|
fontSize: "inherit",
|
|
1053
|
-
tableLayout:
|
|
1339
|
+
tableLayout: c ? "fixed" : void 0
|
|
1054
1340
|
},
|
|
1055
1341
|
children: [
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
style:
|
|
1059
|
-
children: e
|
|
1342
|
+
c && /* @__PURE__ */ u("colgroup", { children: c.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
|
|
1343
|
+
t && /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e[0].map((e, t) => /* @__PURE__ */ u("th", {
|
|
1344
|
+
style: l(0, t, !0),
|
|
1345
|
+
children: Array.isArray(e) ? r(e) : e
|
|
1060
1346
|
}, t)) }) }),
|
|
1061
|
-
/* @__PURE__ */ u("tbody", { children:
|
|
1062
|
-
style:
|
|
1063
|
-
children: e
|
|
1064
|
-
},
|
|
1347
|
+
/* @__PURE__ */ u("tbody", { children: s.map((e, n) => /* @__PURE__ */ u("tr", { children: e.map((e, i) => /* @__PURE__ */ u("td", {
|
|
1348
|
+
style: l(t ? n + 1 : n, i, !1),
|
|
1349
|
+
children: Array.isArray(e) ? r(e) : e
|
|
1350
|
+
}, i)) }, n)) })
|
|
1065
1351
|
]
|
|
1066
|
-
},
|
|
1352
|
+
}, i);
|
|
1067
1353
|
}
|
|
1068
|
-
if (
|
|
1069
|
-
let e =
|
|
1354
|
+
if (n.type === "ul" || n.type === "ol") {
|
|
1355
|
+
let e = n.type;
|
|
1070
1356
|
return /* @__PURE__ */ u(e, {
|
|
1071
1357
|
style: {
|
|
1072
|
-
...
|
|
1358
|
+
...a,
|
|
1073
1359
|
paddingLeft: 24
|
|
1074
1360
|
},
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1361
|
+
start: n.type === "ol" ? n.start : void 0,
|
|
1362
|
+
children: (n.items ?? []).map((e, n) => {
|
|
1363
|
+
let i = typeof e.task == "boolean";
|
|
1364
|
+
return /* @__PURE__ */ d("li", {
|
|
1365
|
+
style: {
|
|
1366
|
+
marginBottom: 4,
|
|
1367
|
+
...i && {
|
|
1368
|
+
listStyleType: "none",
|
|
1369
|
+
marginLeft: -18
|
|
1370
|
+
}
|
|
1371
|
+
},
|
|
1372
|
+
children: [
|
|
1373
|
+
i && /* @__PURE__ */ u("span", {
|
|
1374
|
+
style: { marginRight: 6 },
|
|
1375
|
+
children: e.task ? "☑" : "☐"
|
|
1376
|
+
}),
|
|
1377
|
+
r(e.parts, e.text),
|
|
1378
|
+
e.blocks?.length ? Mt(e.blocks, t, r) : null
|
|
1379
|
+
]
|
|
1380
|
+
}, n);
|
|
1381
|
+
})
|
|
1382
|
+
}, i);
|
|
1080
1383
|
}
|
|
1081
|
-
if (
|
|
1384
|
+
if (n.type === "quote") return /* @__PURE__ */ u("blockquote", {
|
|
1082
1385
|
style: {
|
|
1083
|
-
|
|
1084
|
-
...
|
|
1386
|
+
...Ft,
|
|
1387
|
+
...a
|
|
1085
1388
|
},
|
|
1086
|
-
children: r(
|
|
1087
|
-
},
|
|
1088
|
-
if (
|
|
1089
|
-
|
|
1389
|
+
children: n.blocks?.length ? Mt(n.blocks, t, r) : r(n.parts, n.text)
|
|
1390
|
+
}, i);
|
|
1391
|
+
if (n.type === "code") return /* @__PURE__ */ u("pre", {
|
|
1392
|
+
"data-lang": n.lang || void 0,
|
|
1393
|
+
style: {
|
|
1394
|
+
...a,
|
|
1395
|
+
...wt
|
|
1396
|
+
},
|
|
1397
|
+
children: /* @__PURE__ */ u("code", {
|
|
1398
|
+
style: { fontFamily: "inherit" },
|
|
1399
|
+
children: n.text
|
|
1400
|
+
})
|
|
1401
|
+
}, i);
|
|
1402
|
+
if (dt[n.type]) {
|
|
1403
|
+
let e = n.type;
|
|
1090
1404
|
return /* @__PURE__ */ u(e, {
|
|
1091
1405
|
style: {
|
|
1092
|
-
...
|
|
1093
|
-
fontSize:
|
|
1094
|
-
...
|
|
1406
|
+
...ut,
|
|
1407
|
+
fontSize: ft(n.type),
|
|
1408
|
+
...a
|
|
1095
1409
|
},
|
|
1096
|
-
children: r(
|
|
1097
|
-
},
|
|
1410
|
+
children: r(n.parts, n.text)
|
|
1411
|
+
}, i);
|
|
1098
1412
|
}
|
|
1099
1413
|
return /* @__PURE__ */ u("p", {
|
|
1100
1414
|
style: {
|
|
1101
|
-
...
|
|
1102
|
-
...
|
|
1415
|
+
...pt,
|
|
1416
|
+
...a
|
|
1103
1417
|
},
|
|
1104
|
-
children: r(
|
|
1105
|
-
},
|
|
1418
|
+
children: r(n.parts, n.text)
|
|
1419
|
+
}, i);
|
|
1106
1420
|
});
|
|
1107
1421
|
}
|
|
1108
|
-
function
|
|
1422
|
+
function Nt({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
1109
1423
|
return /* @__PURE__ */ u("div", {
|
|
1110
1424
|
ref: r,
|
|
1111
1425
|
style: {
|
|
1112
1426
|
display: "flow-root",
|
|
1113
1427
|
...A(t)
|
|
1114
1428
|
},
|
|
1115
|
-
children:
|
|
1429
|
+
children: Mt(e, n)
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
function Pt({ markdown: e, newTab: t, style: n, nodeRef: r }) {
|
|
1433
|
+
let i = o(() => $e(e, { newTab: t }), [e, t]);
|
|
1434
|
+
return /* @__PURE__ */ u("div", {
|
|
1435
|
+
ref: r,
|
|
1436
|
+
style: {
|
|
1437
|
+
display: "flow-root",
|
|
1438
|
+
...A(n)
|
|
1439
|
+
},
|
|
1440
|
+
children: Mt(i)
|
|
1116
1441
|
});
|
|
1117
1442
|
}
|
|
1118
|
-
var
|
|
1443
|
+
var Ft = {
|
|
1119
1444
|
margin: 0,
|
|
1120
1445
|
padding: "8px 0 8px 20px",
|
|
1121
1446
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
1122
1447
|
};
|
|
1123
|
-
function
|
|
1448
|
+
function It({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1124
1449
|
return /* @__PURE__ */ u("blockquote", {
|
|
1125
1450
|
ref: i,
|
|
1126
1451
|
style: {
|
|
1127
|
-
|
|
1452
|
+
...Ft,
|
|
1128
1453
|
...A(n)
|
|
1129
1454
|
},
|
|
1130
|
-
children:
|
|
1455
|
+
children: Et(t, e, r)
|
|
1131
1456
|
});
|
|
1132
1457
|
}
|
|
1133
|
-
function
|
|
1458
|
+
function Lt({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
1134
1459
|
return /* @__PURE__ */ u(e ? "ol" : "ul", {
|
|
1135
1460
|
ref: r,
|
|
1136
1461
|
style: {
|
|
@@ -1140,53 +1465,53 @@ function tt({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
1140
1465
|
},
|
|
1141
1466
|
children: t.map((e, t) => /* @__PURE__ */ u("li", {
|
|
1142
1467
|
style: { marginBottom: 4 },
|
|
1143
|
-
children:
|
|
1468
|
+
children: Et(e.parts, e.text)
|
|
1144
1469
|
}, t))
|
|
1145
1470
|
});
|
|
1146
1471
|
}
|
|
1147
|
-
function
|
|
1472
|
+
function Rt({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1148
1473
|
return /* @__PURE__ */ u("p", {
|
|
1149
1474
|
ref: i,
|
|
1150
1475
|
style: {
|
|
1151
|
-
...
|
|
1476
|
+
...pt,
|
|
1152
1477
|
...A(n)
|
|
1153
1478
|
},
|
|
1154
|
-
children:
|
|
1479
|
+
children: Et(t, e, r)
|
|
1155
1480
|
});
|
|
1156
1481
|
}
|
|
1157
|
-
var
|
|
1482
|
+
var zt = {
|
|
1158
1483
|
color: "var(--page-accent, inherit)",
|
|
1159
1484
|
textDecoration: "underline",
|
|
1160
1485
|
textUnderlineOffset: 3,
|
|
1161
1486
|
cursor: "pointer"
|
|
1162
1487
|
};
|
|
1163
|
-
function
|
|
1488
|
+
function Bt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1164
1489
|
return /* @__PURE__ */ u("a", {
|
|
1165
1490
|
ref: o,
|
|
1166
1491
|
href: n || "#",
|
|
1167
1492
|
target: r || void 0,
|
|
1168
1493
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1169
1494
|
style: {
|
|
1170
|
-
...
|
|
1495
|
+
...zt,
|
|
1171
1496
|
...A(i)
|
|
1172
1497
|
},
|
|
1173
|
-
children:
|
|
1498
|
+
children: Et(t, e, a)
|
|
1174
1499
|
});
|
|
1175
1500
|
}
|
|
1176
|
-
function
|
|
1501
|
+
function Vt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1177
1502
|
return /* @__PURE__ */ u("a", {
|
|
1178
1503
|
ref: o,
|
|
1179
1504
|
href: n || "#",
|
|
1180
1505
|
target: r || void 0,
|
|
1181
1506
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1182
1507
|
style: {
|
|
1183
|
-
...
|
|
1508
|
+
...mt,
|
|
1184
1509
|
...A(i)
|
|
1185
1510
|
},
|
|
1186
|
-
children:
|
|
1511
|
+
children: Et(t, e, a)
|
|
1187
1512
|
});
|
|
1188
1513
|
}
|
|
1189
|
-
function
|
|
1514
|
+
function Ht({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
1190
1515
|
return e ? /* @__PURE__ */ u("img", {
|
|
1191
1516
|
ref: r,
|
|
1192
1517
|
src: e,
|
|
@@ -1198,7 +1523,7 @@ function ot({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
1198
1523
|
}
|
|
1199
1524
|
}) : null;
|
|
1200
1525
|
}
|
|
1201
|
-
function
|
|
1526
|
+
function Ut({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
1202
1527
|
return e ? /* @__PURE__ */ u("video", {
|
|
1203
1528
|
ref: s,
|
|
1204
1529
|
src: e,
|
|
@@ -1216,9 +1541,9 @@ function st({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
1216
1541
|
}
|
|
1217
1542
|
}) : null;
|
|
1218
1543
|
}
|
|
1219
|
-
var
|
|
1220
|
-
function
|
|
1221
|
-
let c =
|
|
1544
|
+
var Wt = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
1545
|
+
function Gt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
1546
|
+
let c = Wt(e);
|
|
1222
1547
|
if (!c) return null;
|
|
1223
1548
|
let l = new URLSearchParams({ rel: "0" });
|
|
1224
1549
|
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", {
|
|
@@ -1244,7 +1569,7 @@ function lt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
1244
1569
|
})
|
|
1245
1570
|
});
|
|
1246
1571
|
}
|
|
1247
|
-
function
|
|
1572
|
+
function Kt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
1248
1573
|
return e ? /* @__PURE__ */ u("iframe", {
|
|
1249
1574
|
ref: i,
|
|
1250
1575
|
src: e,
|
|
@@ -1260,15 +1585,15 @@ function ut({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
1260
1585
|
}
|
|
1261
1586
|
}) : null;
|
|
1262
1587
|
}
|
|
1263
|
-
var
|
|
1264
|
-
function
|
|
1265
|
-
return `@scope ([data-wb-embed]) {\n${e.replace(
|
|
1588
|
+
var qt = /(^|[\s,>+~{}])(:root|html|body)(?=$|[\s,{.:#[>+~])/g;
|
|
1589
|
+
function Jt(e) {
|
|
1590
|
+
return `@scope ([data-wb-embed]) {\n${e.replace(qt, "$1:scope")}\n}`;
|
|
1266
1591
|
}
|
|
1267
|
-
function
|
|
1592
|
+
function Yt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRef: a }) {
|
|
1268
1593
|
let [o, s] = c(null);
|
|
1269
1594
|
return i(() => {
|
|
1270
1595
|
o && (o.innerHTML = e || "", n ? (o.setAttribute("data-wb-embed", ""), o.querySelectorAll("style").forEach((e) => {
|
|
1271
|
-
e.textContent =
|
|
1596
|
+
e.textContent = Jt(e.textContent || "");
|
|
1272
1597
|
})) : o.removeAttribute("data-wb-embed"), t && o.querySelectorAll("script").forEach((e) => {
|
|
1273
1598
|
let t = document.createElement("script");
|
|
1274
1599
|
for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
|
|
@@ -1286,7 +1611,7 @@ function pt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRe
|
|
|
1286
1611
|
style: A(r)
|
|
1287
1612
|
});
|
|
1288
1613
|
}
|
|
1289
|
-
function
|
|
1614
|
+
function Xt({ height: e, style: t, nodeRef: n }) {
|
|
1290
1615
|
return /* @__PURE__ */ u("div", {
|
|
1291
1616
|
ref: n,
|
|
1292
1617
|
style: {
|
|
@@ -1297,7 +1622,7 @@ function mt({ height: e, style: t, nodeRef: n }) {
|
|
|
1297
1622
|
}
|
|
1298
1623
|
});
|
|
1299
1624
|
}
|
|
1300
|
-
function
|
|
1625
|
+
function Zt({ style: e, nodeRef: t }) {
|
|
1301
1626
|
return /* @__PURE__ */ u("div", {
|
|
1302
1627
|
ref: t,
|
|
1303
1628
|
style: {
|
|
@@ -1308,7 +1633,7 @@ function ht({ style: e, nodeRef: t }) {
|
|
|
1308
1633
|
}
|
|
1309
1634
|
});
|
|
1310
1635
|
}
|
|
1311
|
-
function
|
|
1636
|
+
function Qt({ style: e, nodeRef: t }) {
|
|
1312
1637
|
return /* @__PURE__ */ u("div", {
|
|
1313
1638
|
ref: t,
|
|
1314
1639
|
style: {
|
|
@@ -1317,7 +1642,7 @@ function gt({ style: e, nodeRef: t }) {
|
|
|
1317
1642
|
}
|
|
1318
1643
|
});
|
|
1319
1644
|
}
|
|
1320
|
-
var
|
|
1645
|
+
var $t = {
|
|
1321
1646
|
position: "absolute",
|
|
1322
1647
|
top: "50%",
|
|
1323
1648
|
transform: "translateY(-50%)",
|
|
@@ -1334,7 +1659,7 @@ var _t = {
|
|
|
1334
1659
|
alignItems: "center",
|
|
1335
1660
|
justifyContent: "center",
|
|
1336
1661
|
padding: 0
|
|
1337
|
-
},
|
|
1662
|
+
}, en = {
|
|
1338
1663
|
bottom: {
|
|
1339
1664
|
inset: "auto 0 0 0",
|
|
1340
1665
|
padding: "40px 24px 20px",
|
|
@@ -1353,8 +1678,8 @@ var _t = {
|
|
|
1353
1678
|
padding: 24,
|
|
1354
1679
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1355
1680
|
}
|
|
1356
|
-
},
|
|
1357
|
-
function
|
|
1681
|
+
}, tn = 48;
|
|
1682
|
+
function nn({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
|
|
1358
1683
|
let [p, m] = c(0), [h, g] = c(!1), [_, v] = c(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1359
1684
|
if (i(() => {
|
|
1360
1685
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1370,7 +1695,7 @@ function bt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1370
1695
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1371
1696
|
if (!_) return;
|
|
1372
1697
|
let { dx: e } = _;
|
|
1373
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1698
|
+
v(null), e < -48 ? b(y + 1) : e > tn && b(y - 1);
|
|
1374
1699
|
};
|
|
1375
1700
|
return /* @__PURE__ */ d("div", {
|
|
1376
1701
|
ref: f,
|
|
@@ -1419,7 +1744,7 @@ function bt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1419
1744
|
type: "button",
|
|
1420
1745
|
"aria-label": "Previous slide",
|
|
1421
1746
|
style: {
|
|
1422
|
-
|
|
1747
|
+
...$t,
|
|
1423
1748
|
left: 12
|
|
1424
1749
|
},
|
|
1425
1750
|
onClick: () => b(y - 1),
|
|
@@ -1429,7 +1754,7 @@ function bt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1429
1754
|
type: "button",
|
|
1430
1755
|
"aria-label": "Next slide",
|
|
1431
1756
|
style: {
|
|
1432
|
-
|
|
1757
|
+
...$t,
|
|
1433
1758
|
right: 12
|
|
1434
1759
|
},
|
|
1435
1760
|
onClick: () => b(y + 1),
|
|
@@ -1463,7 +1788,7 @@ function bt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1463
1788
|
] })]
|
|
1464
1789
|
});
|
|
1465
1790
|
}
|
|
1466
|
-
var
|
|
1791
|
+
var rn = (e, t) => ({
|
|
1467
1792
|
position: "absolute",
|
|
1468
1793
|
inset: 0,
|
|
1469
1794
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1471,18 +1796,18 @@ var xt = (e, t) => ({
|
|
|
1471
1796
|
backgroundSize: "cover",
|
|
1472
1797
|
backgroundPosition: "center"
|
|
1473
1798
|
});
|
|
1474
|
-
function
|
|
1475
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1799
|
+
function an({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1800
|
+
return e.length ? /* @__PURE__ */ u(nn, {
|
|
1476
1801
|
...r,
|
|
1477
1802
|
count: e.length,
|
|
1478
1803
|
renderSlide: (r) => {
|
|
1479
1804
|
let i = e[r];
|
|
1480
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1805
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: rn(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
|
|
1481
1806
|
style: {
|
|
1482
1807
|
position: "absolute",
|
|
1483
1808
|
color: "#fff",
|
|
1484
1809
|
textAlign: n,
|
|
1485
|
-
...
|
|
1810
|
+
...en[t] ?? en.bottom
|
|
1486
1811
|
},
|
|
1487
1812
|
children: [i.title && /* @__PURE__ */ u("div", {
|
|
1488
1813
|
style: {
|
|
@@ -1502,13 +1827,13 @@ function St({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1502
1827
|
}
|
|
1503
1828
|
}) : null;
|
|
1504
1829
|
}
|
|
1505
|
-
function
|
|
1506
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1830
|
+
function on({ slides: e = [], linked: t, ...n }) {
|
|
1831
|
+
return e.length ? /* @__PURE__ */ u(nn, {
|
|
1507
1832
|
...n,
|
|
1508
1833
|
count: e.length,
|
|
1509
1834
|
renderSlide: (n) => {
|
|
1510
1835
|
let r = e[n];
|
|
1511
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1836
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: rn(r.image, r.color) }), /* @__PURE__ */ u("div", {
|
|
1512
1837
|
style: {
|
|
1513
1838
|
position: "absolute",
|
|
1514
1839
|
inset: 0,
|
|
@@ -1520,23 +1845,23 @@ function Ct({ slides: e = [], linked: t, ...n }) {
|
|
|
1520
1845
|
}
|
|
1521
1846
|
}) : null;
|
|
1522
1847
|
}
|
|
1523
|
-
var
|
|
1524
|
-
let r =
|
|
1848
|
+
var sn = 256, cn = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), ln = (e, t, n) => {
|
|
1849
|
+
let r = sn * 2 ** n;
|
|
1525
1850
|
return {
|
|
1526
1851
|
x: (Number(t) + 180) / 360 * r,
|
|
1527
|
-
y: (.5 -
|
|
1852
|
+
y: (.5 - cn(Number(e)) / (2 * Math.PI)) * r
|
|
1528
1853
|
};
|
|
1529
1854
|
}, $ = (e, t) => {
|
|
1530
1855
|
if (e === "" || e == null) return null;
|
|
1531
1856
|
let n = Number(e);
|
|
1532
1857
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1533
|
-
},
|
|
1534
|
-
function
|
|
1858
|
+
}, un = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1859
|
+
function dn(e, t, n = "directions", r = "") {
|
|
1535
1860
|
let i = `${e},${t}`;
|
|
1536
1861
|
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)}`;
|
|
1537
1862
|
}
|
|
1538
|
-
var
|
|
1539
|
-
function
|
|
1863
|
+
var fn = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1864
|
+
function pn({ 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 }) {
|
|
1540
1865
|
let _ = s(null), [v, y] = c(1200);
|
|
1541
1866
|
i(() => {
|
|
1542
1867
|
let e = _.current;
|
|
@@ -1546,7 +1871,7 @@ function At({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1546
1871
|
let n = new ResizeObserver(t);
|
|
1547
1872
|
return n.observe(e), () => n.disconnect();
|
|
1548
1873
|
}, []);
|
|
1549
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1874
|
+
let b = (Array.isArray(e) ? e : []).filter(un), x = un({
|
|
1550
1875
|
lat: t,
|
|
1551
1876
|
lng: n
|
|
1552
1877
|
}) ? {
|
|
@@ -1558,7 +1883,7 @@ function At({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1558
1883
|
} : null, S = Math.max(80, Number(a) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1559
1884
|
if (b.length < 2) return 13;
|
|
1560
1885
|
for (let e = 19; e >= 1; e--) {
|
|
1561
|
-
let t = b.map((t) =>
|
|
1886
|
+
let t = b.map((t) => ln($(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));
|
|
1562
1887
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1563
1888
|
}
|
|
1564
1889
|
return 1;
|
|
@@ -1582,12 +1907,12 @@ function At({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1582
1907
|
},
|
|
1583
1908
|
children: "Set the coordinates in Settings"
|
|
1584
1909
|
});
|
|
1585
|
-
let T =
|
|
1910
|
+
let T = ln(x.lat, x.lng, C), E = {
|
|
1586
1911
|
x: T.x - v / 2,
|
|
1587
1912
|
y: T.y - S / 2
|
|
1588
1913
|
}, D = [], O = [];
|
|
1589
|
-
for (let e = Math.floor(E.x /
|
|
1590
|
-
for (let e = Math.floor(E.y /
|
|
1914
|
+
for (let e = Math.floor(E.x / sn); e <= Math.floor((E.x + v) / sn); e++) D.push(e);
|
|
1915
|
+
for (let e = Math.floor(E.y / sn); e <= Math.floor((E.y + S) / sn); e++) O.push(e);
|
|
1591
1916
|
let k = 2 ** C;
|
|
1592
1917
|
return /* @__PURE__ */ d("div", {
|
|
1593
1918
|
ref: (e) => {
|
|
@@ -1610,22 +1935,22 @@ function At({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1610
1935
|
return e < 0 || e >= k ? null : /* @__PURE__ */ u("img", {
|
|
1611
1936
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1612
1937
|
alt: "",
|
|
1613
|
-
width:
|
|
1614
|
-
height:
|
|
1938
|
+
width: sn,
|
|
1939
|
+
height: sn,
|
|
1615
1940
|
loading: "lazy",
|
|
1616
1941
|
style: {
|
|
1617
1942
|
position: "absolute",
|
|
1618
|
-
left: Math.round(t *
|
|
1619
|
-
top: Math.round(e *
|
|
1620
|
-
width:
|
|
1621
|
-
height:
|
|
1943
|
+
left: Math.round(t * sn - E.x),
|
|
1944
|
+
top: Math.round(e * sn - E.y),
|
|
1945
|
+
width: sn,
|
|
1946
|
+
height: sn,
|
|
1622
1947
|
userSelect: "none",
|
|
1623
1948
|
pointerEvents: "none"
|
|
1624
1949
|
}
|
|
1625
1950
|
}, `${t}-${e}`);
|
|
1626
1951
|
})),
|
|
1627
1952
|
b.map((e, t) => {
|
|
1628
|
-
let n =
|
|
1953
|
+
let n = ln($(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 : dn($(e.lat, 90), $(e.lng, 180), l, e.title);
|
|
1629
1954
|
return /* @__PURE__ */ d(s ? "a" : "span", {
|
|
1630
1955
|
href: s || void 0,
|
|
1631
1956
|
target: s ? "_blank" : void 0,
|
|
@@ -1664,8 +1989,8 @@ function At({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1664
1989
|
viewBox: "0 0 24 24",
|
|
1665
1990
|
fill: a,
|
|
1666
1991
|
style: { display: "block" },
|
|
1667
|
-
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
1668
|
-
d:
|
|
1992
|
+
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), mn[e.icon] ? /* @__PURE__ */ u("path", {
|
|
1993
|
+
d: mn[e.icon],
|
|
1669
1994
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1670
1995
|
fill: "none",
|
|
1671
1996
|
stroke: "#fff",
|
|
@@ -1701,7 +2026,7 @@ function At({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1701
2026
|
})
|
|
1702
2027
|
]
|
|
1703
2028
|
}), f ? /* @__PURE__ */ u("a", {
|
|
1704
|
-
href:
|
|
2029
|
+
href: fn(x.lat, x.lng, C),
|
|
1705
2030
|
target: "_blank",
|
|
1706
2031
|
rel: "noopener noreferrer",
|
|
1707
2032
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1715,7 +2040,7 @@ function At({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1715
2040
|
}) : null]
|
|
1716
2041
|
});
|
|
1717
2042
|
}
|
|
1718
|
-
var
|
|
2043
|
+
var mn = {
|
|
1719
2044
|
check: "M4 12l5 5L20 6",
|
|
1720
2045
|
close: "M6 6l12 12M18 6L6 18",
|
|
1721
2046
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1812,8 +2137,8 @@ var jt = {
|
|
|
1812
2137
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1813
2138
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1814
2139
|
};
|
|
1815
|
-
function
|
|
1816
|
-
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [
|
|
2140
|
+
function hn({ 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 }) {
|
|
2141
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [mn[e] ?? mn.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
|
|
1817
2142
|
viewBox: "0 0 24 24",
|
|
1818
2143
|
width: g,
|
|
1819
2144
|
height: g,
|
|
@@ -1849,10 +2174,10 @@ function Mt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1849
2174
|
children: v
|
|
1850
2175
|
});
|
|
1851
2176
|
}
|
|
1852
|
-
function
|
|
1853
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
2177
|
+
function gn(e, t = {}, n = 0) {
|
|
2178
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : ct(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1854
2179
|
for (let e of r) {
|
|
1855
|
-
let n = e.data ?? e, r =
|
|
2180
|
+
let n = e.data ?? e, r = ot(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(ot(n, t.nameField)) : i(n.name), l = t.hrefField ? i(ot(n, t.hrefField)) : "";
|
|
1856
2181
|
for (let e of s) if (o.push({
|
|
1857
2182
|
src: e,
|
|
1858
2183
|
name: c,
|
|
@@ -1862,8 +2187,8 @@ function Nt(e, t = {}, n = 0) {
|
|
|
1862
2187
|
}
|
|
1863
2188
|
return o;
|
|
1864
2189
|
}
|
|
1865
|
-
function
|
|
1866
|
-
let { tenant: x, apiUrl: S } = r(
|
|
2190
|
+
function _n({ 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 }) {
|
|
2191
|
+
let { tenant: x, apiUrl: S } = r(Q), C = r(et)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
|
|
1867
2192
|
i(() => {
|
|
1868
2193
|
if (!t || C) return;
|
|
1869
2194
|
let e = !0;
|
|
@@ -1880,7 +2205,7 @@ function Pt({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
1880
2205
|
C
|
|
1881
2206
|
]);
|
|
1882
2207
|
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 ? (() => {
|
|
1883
|
-
let e =
|
|
2208
|
+
let e = gn(k, {
|
|
1884
2209
|
imageField: a,
|
|
1885
2210
|
nameField: o,
|
|
1886
2211
|
hrefField: s
|
|
@@ -2085,20 +2410,20 @@ function Pt({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
2085
2410
|
]
|
|
2086
2411
|
});
|
|
2087
2412
|
}
|
|
2088
|
-
var
|
|
2413
|
+
var vn = {
|
|
2089
2414
|
color: "inherit",
|
|
2090
2415
|
textDecoration: "none",
|
|
2091
2416
|
fontSize: 14,
|
|
2092
2417
|
opacity: .85
|
|
2093
|
-
},
|
|
2418
|
+
}, yn = {
|
|
2094
2419
|
background: "var(--page-surface, #f2f2f2)",
|
|
2095
2420
|
color: "var(--page-text, #111827)",
|
|
2096
2421
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
2097
2422
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
2098
2423
|
zIndex: 60
|
|
2099
2424
|
};
|
|
2100
|
-
function
|
|
2101
|
-
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 ? "" :
|
|
2425
|
+
function bn(e, t = {}, n = "dropdown") {
|
|
2426
|
+
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 ? "" : ct(e), o = r.map((e) => {
|
|
2102
2427
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
2103
2428
|
return {
|
|
2104
2429
|
key: e.id,
|
|
@@ -2139,8 +2464,8 @@ function Lt(e, t = {}, n = "dropdown") {
|
|
|
2139
2464
|
type: e.children.length ? n : "link"
|
|
2140
2465
|
}));
|
|
2141
2466
|
}
|
|
2142
|
-
function
|
|
2143
|
-
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(
|
|
2467
|
+
function xn({ 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" }) {
|
|
2468
|
+
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(Q), P = r(et)?.[g], [F, I] = c(null);
|
|
2144
2469
|
i(() => {
|
|
2145
2470
|
if (!g || P) return;
|
|
2146
2471
|
let e = !0;
|
|
@@ -2160,7 +2485,7 @@ function Rt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2160
2485
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2161
2486
|
return e.observe(C), () => e.disconnect();
|
|
2162
2487
|
}, [C, h]);
|
|
2163
|
-
let L = g ?
|
|
2488
|
+
let L = g ? bn(P ?? F ?? [], {
|
|
2164
2489
|
labelField: _,
|
|
2165
2490
|
hrefField: v,
|
|
2166
2491
|
imageField: y,
|
|
@@ -2189,7 +2514,7 @@ function Rt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2189
2514
|
return /* @__PURE__ */ d("a", {
|
|
2190
2515
|
href: e.href || "#",
|
|
2191
2516
|
style: {
|
|
2192
|
-
...
|
|
2517
|
+
...vn,
|
|
2193
2518
|
display: n ? "block" : "flex",
|
|
2194
2519
|
alignItems: n ? void 0 : "center",
|
|
2195
2520
|
gap: n ? void 0 : 10,
|
|
@@ -2286,7 +2611,7 @@ function Rt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2286
2611
|
let t = e.children ?? [];
|
|
2287
2612
|
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
2288
2613
|
href: e.href || "#",
|
|
2289
|
-
style:
|
|
2614
|
+
style: vn,
|
|
2290
2615
|
children: e.label
|
|
2291
2616
|
}, e.key);
|
|
2292
2617
|
let n = e.type === "mega";
|
|
@@ -2300,7 +2625,7 @@ function Rt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2300
2625
|
children: [/* @__PURE__ */ d("a", {
|
|
2301
2626
|
href: e.href || "#",
|
|
2302
2627
|
style: {
|
|
2303
|
-
...
|
|
2628
|
+
...vn,
|
|
2304
2629
|
cursor: "pointer"
|
|
2305
2630
|
},
|
|
2306
2631
|
children: [
|
|
@@ -2316,7 +2641,7 @@ function Rt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2316
2641
|
]
|
|
2317
2642
|
}), k === e.key && (n ? /* @__PURE__ */ u("div", {
|
|
2318
2643
|
style: {
|
|
2319
|
-
...
|
|
2644
|
+
...yn,
|
|
2320
2645
|
position: "absolute",
|
|
2321
2646
|
left: 0,
|
|
2322
2647
|
right: 0,
|
|
@@ -2332,7 +2657,7 @@ function Rt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2332
2657
|
}, !0))
|
|
2333
2658
|
}) : /* @__PURE__ */ u("div", {
|
|
2334
2659
|
style: {
|
|
2335
|
-
...
|
|
2660
|
+
...yn,
|
|
2336
2661
|
position: "absolute",
|
|
2337
2662
|
top: "100%",
|
|
2338
2663
|
left: 0,
|
|
@@ -2361,7 +2686,7 @@ function Rt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2361
2686
|
children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
2362
2687
|
href: t.href || "#",
|
|
2363
2688
|
style: {
|
|
2364
|
-
...
|
|
2689
|
+
...vn,
|
|
2365
2690
|
padding: "10px 4px",
|
|
2366
2691
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
2367
2692
|
opacity: 1
|
|
@@ -2372,7 +2697,7 @@ function Rt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2372
2697
|
]
|
|
2373
2698
|
});
|
|
2374
2699
|
}
|
|
2375
|
-
function
|
|
2700
|
+
function Sn({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2376
2701
|
let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2377
2702
|
return e.length ? /* @__PURE__ */ d("div", {
|
|
2378
2703
|
ref: r,
|
|
@@ -2412,13 +2737,13 @@ function zt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2412
2737
|
}, e.key))]
|
|
2413
2738
|
}) : null;
|
|
2414
2739
|
}
|
|
2415
|
-
function
|
|
2740
|
+
function Cn({ 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 }) {
|
|
2416
2741
|
let [g, _] = c(() => new Set(e.length ? [e[0].key] : []));
|
|
2417
2742
|
if (!e.length) return null;
|
|
2418
2743
|
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2419
2744
|
let n = Number(e);
|
|
2420
2745
|
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2421
|
-
}, b =
|
|
2746
|
+
}, b = mn[r], x = (e) => _((t) => {
|
|
2422
2747
|
let r = new Set(n ? t : []);
|
|
2423
2748
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2424
2749
|
});
|
|
@@ -2493,15 +2818,15 @@ function Bt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
|
|
|
2493
2818
|
})
|
|
2494
2819
|
});
|
|
2495
2820
|
}
|
|
2496
|
-
var
|
|
2821
|
+
var wn = {
|
|
2497
2822
|
display: "flex",
|
|
2498
2823
|
flexDirection: "column",
|
|
2499
2824
|
gap: "12px"
|
|
2500
|
-
},
|
|
2825
|
+
}, Tn = {
|
|
2501
2826
|
fontSize: "14px",
|
|
2502
2827
|
fontWeight: 500,
|
|
2503
2828
|
color: "var(--page-text, #111827)"
|
|
2504
|
-
},
|
|
2829
|
+
}, En = {
|
|
2505
2830
|
padding: "10px 12px",
|
|
2506
2831
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2507
2832
|
borderRadius: "6px",
|
|
@@ -2511,18 +2836,18 @@ var Vt = {
|
|
|
2511
2836
|
boxSizing: "border-box",
|
|
2512
2837
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2513
2838
|
color: "var(--page-text, #111827)"
|
|
2514
|
-
},
|
|
2839
|
+
}, Dn = {
|
|
2515
2840
|
display: "flex",
|
|
2516
2841
|
alignItems: "center",
|
|
2517
2842
|
gap: "8px",
|
|
2518
2843
|
fontSize: "14px",
|
|
2519
2844
|
color: "var(--page-text, #111827)"
|
|
2520
|
-
},
|
|
2845
|
+
}, On = (e) => e ? {
|
|
2521
2846
|
readOnly: !0,
|
|
2522
2847
|
tabIndex: -1,
|
|
2523
2848
|
onMouseDown: (e) => e.preventDefault()
|
|
2524
2849
|
} : {};
|
|
2525
|
-
function
|
|
2850
|
+
function kn(e, t) {
|
|
2526
2851
|
if (!e) return !0;
|
|
2527
2852
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2528
2853
|
switch (e.op) {
|
|
@@ -2536,11 +2861,11 @@ function Kt(e, t) {
|
|
|
2536
2861
|
default: return !1;
|
|
2537
2862
|
}
|
|
2538
2863
|
}
|
|
2539
|
-
var
|
|
2864
|
+
var An = {
|
|
2540
2865
|
display: "flex",
|
|
2541
2866
|
flexDirection: "column",
|
|
2542
2867
|
gap: 6
|
|
2543
|
-
},
|
|
2868
|
+
}, jn = {
|
|
2544
2869
|
font: "inherit",
|
|
2545
2870
|
fontSize: 15,
|
|
2546
2871
|
padding: "10px 12px",
|
|
@@ -2551,17 +2876,17 @@ var qt = {
|
|
|
2551
2876
|
width: "100%",
|
|
2552
2877
|
boxSizing: "border-box"
|
|
2553
2878
|
};
|
|
2554
|
-
function
|
|
2879
|
+
function Mn(e, t) {
|
|
2555
2880
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2556
2881
|
if (!e?.parentField) return n;
|
|
2557
2882
|
let r = t?.[e.parentField];
|
|
2558
2883
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2559
2884
|
}
|
|
2560
|
-
var
|
|
2561
|
-
function
|
|
2885
|
+
var Nn = "g-recaptcha-response", Pn = (e) => e?.type === "recaptcha" ? Nn : e?.name;
|
|
2886
|
+
function Fn({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2562
2887
|
let a = /* @__PURE__ */ d("span", {
|
|
2563
2888
|
style: {
|
|
2564
|
-
...
|
|
2889
|
+
...Tn,
|
|
2565
2890
|
fontSize: 14
|
|
2566
2891
|
},
|
|
2567
2892
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2570,7 +2895,7 @@ function Qt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2570
2895
|
required: e.required || void 0,
|
|
2571
2896
|
placeholder: e.placeholder || void 0,
|
|
2572
2897
|
disabled: r || void 0,
|
|
2573
|
-
style:
|
|
2898
|
+
style: jn,
|
|
2574
2899
|
value: t ?? "",
|
|
2575
2900
|
onChange: (t) => n(e.name, t.target.value)
|
|
2576
2901
|
};
|
|
@@ -2599,12 +2924,12 @@ function Qt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2599
2924
|
borderRadius: 8,
|
|
2600
2925
|
display: "block"
|
|
2601
2926
|
}
|
|
2602
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(
|
|
2927
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(Bn, {
|
|
2603
2928
|
theme: e.captchaTheme,
|
|
2604
2929
|
size: e.captchaSize,
|
|
2605
2930
|
inert: r,
|
|
2606
|
-
onChange: (e) => n(
|
|
2607
|
-
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(
|
|
2931
|
+
onChange: (e) => n(Nn, e)
|
|
2932
|
+
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Gt, {
|
|
2608
2933
|
url: e.src,
|
|
2609
2934
|
style: { width: "100%" }
|
|
2610
2935
|
}) : /* @__PURE__ */ u("video", {
|
|
@@ -2616,14 +2941,14 @@ function Qt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2616
2941
|
display: "block"
|
|
2617
2942
|
}
|
|
2618
2943
|
}) : null : /* @__PURE__ */ d("label", {
|
|
2619
|
-
style:
|
|
2944
|
+
style: An,
|
|
2620
2945
|
children: [
|
|
2621
2946
|
a,
|
|
2622
2947
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
|
|
2623
2948
|
...o,
|
|
2624
2949
|
rows: 4,
|
|
2625
2950
|
style: {
|
|
2626
|
-
...
|
|
2951
|
+
...jn,
|
|
2627
2952
|
resize: "vertical"
|
|
2628
2953
|
}
|
|
2629
2954
|
}) : e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
@@ -2632,7 +2957,7 @@ function Qt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2632
2957
|
children: [/* @__PURE__ */ u("option", {
|
|
2633
2958
|
value: "",
|
|
2634
2959
|
children: e.placeholder || "—"
|
|
2635
|
-
}),
|
|
2960
|
+
}), Mn(e, i).map((e, t) => /* @__PURE__ */ u("option", {
|
|
2636
2961
|
value: typeof e == "string" ? e : e.value,
|
|
2637
2962
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2638
2963
|
}, t))]
|
|
@@ -2679,8 +3004,8 @@ function Qt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2679
3004
|
]
|
|
2680
3005
|
});
|
|
2681
3006
|
}
|
|
2682
|
-
function
|
|
2683
|
-
let { tenant: y, apiUrl: b } = r(
|
|
3007
|
+
function In({ 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 }) {
|
|
3008
|
+
let { tenant: y, apiUrl: b } = r(Q), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
|
|
2684
3009
|
i(() => {
|
|
2685
3010
|
if (!f || !s) return;
|
|
2686
3011
|
let e = !0;
|
|
@@ -2701,11 +3026,11 @@ function $t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2701
3026
|
section: e,
|
|
2702
3027
|
fields: []
|
|
2703
3028
|
}) : j[j.length - 1].fields.push(e);
|
|
2704
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
3029
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || kn(e.section.condition, T)).map((e) => ({
|
|
2705
3030
|
...e,
|
|
2706
|
-
fields: e.fields.filter((e) =>
|
|
3031
|
+
fields: e.fields.filter((e) => kn(e.condition, T))
|
|
2707
3032
|
})), 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) => {
|
|
2708
|
-
let t = T[
|
|
3033
|
+
let t = T[Pn(e)];
|
|
2709
3034
|
return e.required && (t == null || t === "" || t === !1);
|
|
2710
3035
|
}), R = F >= N.length - 1, z = (e, t) => E((n) => {
|
|
2711
3036
|
let r = {
|
|
@@ -2761,11 +3086,11 @@ function $t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2761
3086
|
}
|
|
2762
3087
|
},
|
|
2763
3088
|
style: {
|
|
2764
|
-
...
|
|
3089
|
+
...wn,
|
|
2765
3090
|
display: k === "success" ? "none" : "flex"
|
|
2766
3091
|
},
|
|
2767
3092
|
children: f && s ? /* @__PURE__ */ d(l, { children: [
|
|
2768
|
-
P && /* @__PURE__ */ u(
|
|
3093
|
+
P && /* @__PURE__ */ u(hr, {
|
|
2769
3094
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2770
3095
|
active: F + 1,
|
|
2771
3096
|
style: { marginBottom: 8 }
|
|
@@ -2778,9 +3103,9 @@ function $t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2778
3103
|
},
|
|
2779
3104
|
children: N[F].section.help
|
|
2780
3105
|
}),
|
|
2781
|
-
I.map((e) => /* @__PURE__ */ u(
|
|
3106
|
+
I.map((e) => /* @__PURE__ */ u(Fn, {
|
|
2782
3107
|
field: e,
|
|
2783
|
-
value: T[
|
|
3108
|
+
value: T[Pn(e)],
|
|
2784
3109
|
values: T,
|
|
2785
3110
|
onChange: z,
|
|
2786
3111
|
inert: h
|
|
@@ -2797,7 +3122,7 @@ function $t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2797
3122
|
disabled: h || void 0,
|
|
2798
3123
|
onClick: () => O(F - 1),
|
|
2799
3124
|
style: {
|
|
2800
|
-
...
|
|
3125
|
+
...mt,
|
|
2801
3126
|
background: "transparent",
|
|
2802
3127
|
color: "inherit",
|
|
2803
3128
|
border: 0,
|
|
@@ -2810,7 +3135,7 @@ function $t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2810
3135
|
disabled: h || L.length > 0,
|
|
2811
3136
|
onClick: () => O(F + 1),
|
|
2812
3137
|
style: {
|
|
2813
|
-
...
|
|
3138
|
+
...mt,
|
|
2814
3139
|
border: 0,
|
|
2815
3140
|
padding: "10px 22px",
|
|
2816
3141
|
borderRadius: 8,
|
|
@@ -2824,7 +3149,7 @@ function $t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2824
3149
|
type: "submit",
|
|
2825
3150
|
disabled: h || void 0,
|
|
2826
3151
|
style: {
|
|
2827
|
-
...
|
|
3152
|
+
...mt,
|
|
2828
3153
|
border: 0,
|
|
2829
3154
|
padding: "10px 22px",
|
|
2830
3155
|
borderRadius: 8,
|
|
@@ -2851,10 +3176,10 @@ function $t({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2851
3176
|
]
|
|
2852
3177
|
});
|
|
2853
3178
|
}
|
|
2854
|
-
var
|
|
3179
|
+
var Ln = null, Rn = null, zn = (e) => {
|
|
2855
3180
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2856
|
-
if (
|
|
2857
|
-
if (
|
|
3181
|
+
if (Ln && Rn === t) return Ln;
|
|
3182
|
+
if (Ln && typeof window < "u") {
|
|
2858
3183
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2859
3184
|
delete window[e];
|
|
2860
3185
|
} catch {
|
|
@@ -2862,22 +3187,22 @@ var en = null, tn = null, nn = (e) => {
|
|
|
2862
3187
|
}
|
|
2863
3188
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2864
3189
|
}
|
|
2865
|
-
return
|
|
3190
|
+
return Rn = t, Ln = new Promise((e) => {
|
|
2866
3191
|
if (typeof window > "u") return;
|
|
2867
3192
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2868
3193
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2869
3194
|
let n = document.createElement("script");
|
|
2870
3195
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2871
|
-
}),
|
|
3196
|
+
}), Ln;
|
|
2872
3197
|
};
|
|
2873
|
-
function
|
|
2874
|
-
let p = r(
|
|
3198
|
+
function Bn({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
|
|
3199
|
+
let p = r(Q), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
|
|
2875
3200
|
if (_.current = f, i(() => {
|
|
2876
3201
|
if (l || !h || !g.current) return;
|
|
2877
3202
|
let e = !0, r = (t) => {
|
|
2878
3203
|
e && typeof _.current == "function" && _.current(t);
|
|
2879
3204
|
};
|
|
2880
|
-
return
|
|
3205
|
+
return zn(a).then((i) => {
|
|
2881
3206
|
if (!(!e || !g.current || !i?.render)) {
|
|
2882
3207
|
g.current.innerHTML = "", r("");
|
|
2883
3208
|
try {
|
|
@@ -2959,17 +3284,17 @@ function rn({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2959
3284
|
children: /* @__PURE__ */ u("div", { ref: g })
|
|
2960
3285
|
}) : null;
|
|
2961
3286
|
}
|
|
2962
|
-
function
|
|
3287
|
+
function Vn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2963
3288
|
return /* @__PURE__ */ u("label", {
|
|
2964
3289
|
ref: r,
|
|
2965
3290
|
style: {
|
|
2966
|
-
...
|
|
3291
|
+
...Tn,
|
|
2967
3292
|
...A(n)
|
|
2968
3293
|
},
|
|
2969
|
-
children:
|
|
3294
|
+
children: Et(t, e, i)
|
|
2970
3295
|
});
|
|
2971
3296
|
}
|
|
2972
|
-
function
|
|
3297
|
+
function Hn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2973
3298
|
return /* @__PURE__ */ u("input", {
|
|
2974
3299
|
ref: a,
|
|
2975
3300
|
type: e,
|
|
@@ -2977,13 +3302,13 @@ function on({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2977
3302
|
placeholder: n,
|
|
2978
3303
|
required: !o && !!r,
|
|
2979
3304
|
style: {
|
|
2980
|
-
...
|
|
3305
|
+
...En,
|
|
2981
3306
|
...A(i)
|
|
2982
3307
|
},
|
|
2983
|
-
...
|
|
3308
|
+
...On(o)
|
|
2984
3309
|
});
|
|
2985
3310
|
}
|
|
2986
|
-
function
|
|
3311
|
+
function Un({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2987
3312
|
return /* @__PURE__ */ u("textarea", {
|
|
2988
3313
|
ref: a,
|
|
2989
3314
|
name: e || void 0,
|
|
@@ -2991,18 +3316,18 @@ function sn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2991
3316
|
rows: n,
|
|
2992
3317
|
required: !o && !!r,
|
|
2993
3318
|
style: {
|
|
2994
|
-
...
|
|
3319
|
+
...En,
|
|
2995
3320
|
resize: "vertical",
|
|
2996
3321
|
...A(i)
|
|
2997
3322
|
},
|
|
2998
|
-
...
|
|
3323
|
+
...On(o)
|
|
2999
3324
|
});
|
|
3000
3325
|
}
|
|
3001
|
-
function
|
|
3326
|
+
function Wn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
3002
3327
|
return /* @__PURE__ */ d("label", {
|
|
3003
3328
|
ref: o,
|
|
3004
3329
|
style: {
|
|
3005
|
-
...
|
|
3330
|
+
...Dn,
|
|
3006
3331
|
...A(a)
|
|
3007
3332
|
},
|
|
3008
3333
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -3019,7 +3344,7 @@ function cn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
3019
3344
|
}), t]
|
|
3020
3345
|
});
|
|
3021
3346
|
}
|
|
3022
|
-
function
|
|
3347
|
+
function Gn({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
3023
3348
|
return /* @__PURE__ */ d("select", {
|
|
3024
3349
|
ref: a,
|
|
3025
3350
|
name: e || void 0,
|
|
@@ -3028,7 +3353,7 @@ function ln({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
3028
3353
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
3029
3354
|
tabIndex: o ? -1 : void 0,
|
|
3030
3355
|
style: {
|
|
3031
|
-
...
|
|
3356
|
+
...En,
|
|
3032
3357
|
appearance: "auto",
|
|
3033
3358
|
...A(i)
|
|
3034
3359
|
},
|
|
@@ -3042,12 +3367,12 @@ function ln({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
3042
3367
|
}, t))]
|
|
3043
3368
|
});
|
|
3044
3369
|
}
|
|
3045
|
-
function
|
|
3370
|
+
function Kn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
3046
3371
|
let [s, l] = c(null);
|
|
3047
3372
|
return /* @__PURE__ */ d("label", {
|
|
3048
3373
|
ref: a,
|
|
3049
3374
|
style: {
|
|
3050
|
-
...
|
|
3375
|
+
...En,
|
|
3051
3376
|
display: "flex",
|
|
3052
3377
|
alignItems: "center",
|
|
3053
3378
|
gap: "8px",
|
|
@@ -3074,12 +3399,12 @@ function un({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
3074
3399
|
]
|
|
3075
3400
|
});
|
|
3076
3401
|
}
|
|
3077
|
-
function
|
|
3402
|
+
function qn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
3078
3403
|
return /* @__PURE__ */ u("button", {
|
|
3079
3404
|
ref: n,
|
|
3080
3405
|
type: r ? "button" : "submit",
|
|
3081
3406
|
style: {
|
|
3082
|
-
...
|
|
3407
|
+
...mt,
|
|
3083
3408
|
border: 0,
|
|
3084
3409
|
cursor: "pointer",
|
|
3085
3410
|
alignSelf: "flex-start",
|
|
@@ -3094,7 +3419,7 @@ function dn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
3094
3419
|
children: e
|
|
3095
3420
|
});
|
|
3096
3421
|
}
|
|
3097
|
-
function
|
|
3422
|
+
function Jn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
3098
3423
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
3099
3424
|
return /* @__PURE__ */ u("div", {
|
|
3100
3425
|
ref: r,
|
|
@@ -3111,8 +3436,8 @@ function fn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
3111
3436
|
}, t))
|
|
3112
3437
|
});
|
|
3113
3438
|
}
|
|
3114
|
-
function
|
|
3115
|
-
let { tenant: v, apiUrl: y, locale: b } = r(
|
|
3439
|
+
function Yn({ 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: _ }) {
|
|
3440
|
+
let { tenant: v, apiUrl: y, locale: b } = r(Q), x = r(it), S = r(et), [, C] = c(0);
|
|
3116
3441
|
i(() => {
|
|
3117
3442
|
if (typeof window > "u") return;
|
|
3118
3443
|
let e = () => C((e) => e + 1);
|
|
@@ -3120,7 +3445,7 @@ function pn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3120
3445
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
3121
3446
|
};
|
|
3122
3447
|
}, []);
|
|
3123
|
-
let w =
|
|
3448
|
+
let w = rt(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? tt(S) : 1, [k, j] = c(null);
|
|
3124
3449
|
if (i(() => {
|
|
3125
3450
|
if (!e || D) return;
|
|
3126
3451
|
let n = !0, r = new URLSearchParams();
|
|
@@ -3165,7 +3490,7 @@ function pn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3165
3490
|
},
|
|
3166
3491
|
children: N.map((e) => /* @__PURE__ */ u("div", {
|
|
3167
3492
|
style: { minWidth: 0 },
|
|
3168
|
-
children: x.render(p, (t) =>
|
|
3493
|
+
children: x.render(p, (t) => lt(t, e))
|
|
3169
3494
|
}, e.id ?? e?.data?.slug))
|
|
3170
3495
|
}) : /* @__PURE__ */ u("div", {
|
|
3171
3496
|
ref: _,
|
|
@@ -3175,7 +3500,7 @@ function pn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3175
3500
|
...A(g)
|
|
3176
3501
|
},
|
|
3177
3502
|
children: N.map((e) => {
|
|
3178
|
-
let t = o ?
|
|
3503
|
+
let t = o ? ot(e?.data, o) : null, r = s ? ct(ot(e?.data, s)) : null, i = l ? ot(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : ct(i), f = n === "list";
|
|
3179
3504
|
return /* @__PURE__ */ d("div", {
|
|
3180
3505
|
style: {
|
|
3181
3506
|
display: "flex",
|
|
@@ -3222,7 +3547,7 @@ function pn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3222
3547
|
lineHeight: 1.55,
|
|
3223
3548
|
opacity: .85
|
|
3224
3549
|
},
|
|
3225
|
-
children:
|
|
3550
|
+
children: Mt(a)
|
|
3226
3551
|
})
|
|
3227
3552
|
]
|
|
3228
3553
|
})]
|
|
@@ -3230,8 +3555,8 @@ function pn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3230
3555
|
})
|
|
3231
3556
|
});
|
|
3232
3557
|
}
|
|
3233
|
-
function
|
|
3234
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3558
|
+
function Xn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3559
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : nt(), s = {
|
|
3235
3560
|
height: 34,
|
|
3236
3561
|
padding: "0 12px",
|
|
3237
3562
|
borderRadius: 8,
|
|
@@ -3279,7 +3604,7 @@ function mn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3279
3604
|
name: `f_${e.name}`,
|
|
3280
3605
|
defaultValue: o[e.name] ?? "",
|
|
3281
3606
|
style: s,
|
|
3282
|
-
...
|
|
3607
|
+
...On(i),
|
|
3283
3608
|
children: [/* @__PURE__ */ u("option", {
|
|
3284
3609
|
value: "",
|
|
3285
3610
|
children: e.label || e.name
|
|
@@ -3294,7 +3619,7 @@ function mn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3294
3619
|
name: `f_${e.name}`,
|
|
3295
3620
|
defaultValue: o[e.name] ?? "",
|
|
3296
3621
|
style: s,
|
|
3297
|
-
...
|
|
3622
|
+
...On(i),
|
|
3298
3623
|
children: [
|
|
3299
3624
|
/* @__PURE__ */ u("option", {
|
|
3300
3625
|
value: "",
|
|
@@ -3315,7 +3640,7 @@ function mn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3315
3640
|
defaultValue: o[e.name] ?? "",
|
|
3316
3641
|
placeholder: e.label || e.name,
|
|
3317
3642
|
style: s,
|
|
3318
|
-
...
|
|
3643
|
+
...On(i)
|
|
3319
3644
|
}, e.name)), /* @__PURE__ */ u("button", {
|
|
3320
3645
|
type: "submit",
|
|
3321
3646
|
style: {
|
|
@@ -3328,12 +3653,12 @@ function mn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3328
3653
|
fontWeight: 600,
|
|
3329
3654
|
cursor: i ? "default" : "pointer"
|
|
3330
3655
|
},
|
|
3331
|
-
...
|
|
3656
|
+
...On(i),
|
|
3332
3657
|
children: t
|
|
3333
3658
|
})]
|
|
3334
3659
|
});
|
|
3335
3660
|
}
|
|
3336
|
-
function
|
|
3661
|
+
function Zn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3337
3662
|
return e.length ? /* @__PURE__ */ u("nav", {
|
|
3338
3663
|
ref: r,
|
|
3339
3664
|
"aria-label": "Breadcrumb",
|
|
@@ -3383,8 +3708,8 @@ function hn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3383
3708
|
})
|
|
3384
3709
|
}) : null;
|
|
3385
3710
|
}
|
|
3386
|
-
function
|
|
3387
|
-
let { tenant: g, apiUrl: _ } = r(
|
|
3711
|
+
function Qn({ 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 }) {
|
|
3712
|
+
let { tenant: g, apiUrl: _ } = r(Q), v = r(et), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3388
3713
|
i(() => {
|
|
3389
3714
|
if (!o || Number.isFinite(x)) return;
|
|
3390
3715
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3403,7 +3728,7 @@ function gn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3403
3728
|
]);
|
|
3404
3729
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
3405
3730
|
if (o && C === null || o && f && !(C > 0)) return null;
|
|
3406
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3731
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? tt(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
3407
3732
|
if (o) {
|
|
3408
3733
|
if (typeof window < "u") {
|
|
3409
3734
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -3468,15 +3793,15 @@ function gn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3468
3793
|
]
|
|
3469
3794
|
});
|
|
3470
3795
|
}
|
|
3471
|
-
var
|
|
3796
|
+
var $n = "webim.page_mode", er = () => {
|
|
3472
3797
|
if (typeof window > "u") return "auto";
|
|
3473
3798
|
try {
|
|
3474
|
-
let e = window.localStorage.getItem(
|
|
3799
|
+
let e = window.localStorage.getItem($n);
|
|
3475
3800
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3476
3801
|
} catch {
|
|
3477
3802
|
return "auto";
|
|
3478
3803
|
}
|
|
3479
|
-
},
|
|
3804
|
+
}, tr = (e) => {
|
|
3480
3805
|
let t = {
|
|
3481
3806
|
width: 16,
|
|
3482
3807
|
height: 16,
|
|
@@ -3508,13 +3833,13 @@ var _n = "webim.page_mode", vn = () => {
|
|
|
3508
3833
|
rx: "2"
|
|
3509
3834
|
}), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
|
|
3510
3835
|
});
|
|
3511
|
-
},
|
|
3836
|
+
}, nr = {
|
|
3512
3837
|
light: "Light theme",
|
|
3513
3838
|
dark: "Dark theme",
|
|
3514
3839
|
auto: "Follow the device theme"
|
|
3515
3840
|
};
|
|
3516
|
-
function
|
|
3517
|
-
let [o, l] = c(a ? "auto" :
|
|
3841
|
+
function rr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
3842
|
+
let [o, l] = c(a ? "auto" : er), d = s(null), f = (e) => {
|
|
3518
3843
|
d.current = e, typeof r == "function" && r(e);
|
|
3519
3844
|
};
|
|
3520
3845
|
i(() => {
|
|
@@ -3522,7 +3847,7 @@ function xn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3522
3847
|
let e = d.current?.closest?.(".webim-page");
|
|
3523
3848
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3524
3849
|
try {
|
|
3525
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3850
|
+
o === "auto" ? window.localStorage.removeItem($n) : window.localStorage.setItem($n, o);
|
|
3526
3851
|
} catch {}
|
|
3527
3852
|
}, [o, a]);
|
|
3528
3853
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3557,8 +3882,8 @@ function xn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3557
3882
|
},
|
|
3558
3883
|
children: p.map((e) => /* @__PURE__ */ u("button", {
|
|
3559
3884
|
type: "button",
|
|
3560
|
-
title:
|
|
3561
|
-
"aria-label":
|
|
3885
|
+
title: nr[e],
|
|
3886
|
+
"aria-label": nr[e],
|
|
3562
3887
|
"aria-pressed": e === m,
|
|
3563
3888
|
onClick: a ? void 0 : () => l(e),
|
|
3564
3889
|
style: {
|
|
@@ -3569,15 +3894,15 @@ function xn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3569
3894
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3570
3895
|
opacity: e === m ? 1 : .7
|
|
3571
3896
|
},
|
|
3572
|
-
children:
|
|
3897
|
+
children: tr(e)
|
|
3573
3898
|
}, e))
|
|
3574
3899
|
});
|
|
3575
3900
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3576
3901
|
return /* @__PURE__ */ u("button", {
|
|
3577
3902
|
ref: f,
|
|
3578
3903
|
type: "button",
|
|
3579
|
-
title:
|
|
3580
|
-
"aria-label": `Theme: ${
|
|
3904
|
+
title: nr[m],
|
|
3905
|
+
"aria-label": `Theme: ${nr[m]} — switch to ${nr[g]}`,
|
|
3581
3906
|
onClick: a ? void 0 : () => l(g),
|
|
3582
3907
|
style: {
|
|
3583
3908
|
...h,
|
|
@@ -3586,10 +3911,10 @@ function xn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3586
3911
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3587
3912
|
...A(n)
|
|
3588
3913
|
},
|
|
3589
|
-
children:
|
|
3914
|
+
children: tr(m)
|
|
3590
3915
|
});
|
|
3591
3916
|
}
|
|
3592
|
-
function
|
|
3917
|
+
function ir(e) {
|
|
3593
3918
|
let t = e?.parentElement;
|
|
3594
3919
|
for (; t && t !== document.body;) {
|
|
3595
3920
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3598,7 +3923,7 @@ function Sn(e) {
|
|
|
3598
3923
|
}
|
|
3599
3924
|
return window;
|
|
3600
3925
|
}
|
|
3601
|
-
var
|
|
3926
|
+
var ar = (e) => e === window ? window.scrollY : e.scrollTop, or = {
|
|
3602
3927
|
"bottom-right": (e) => ({
|
|
3603
3928
|
right: e,
|
|
3604
3929
|
bottom: e
|
|
@@ -3612,11 +3937,11 @@ var Cn = (e) => e === window ? window.scrollY : e.scrollTop, wn = {
|
|
|
3612
3937
|
bottom: e,
|
|
3613
3938
|
transform: "translateX(-50%)"
|
|
3614
3939
|
})
|
|
3615
|
-
},
|
|
3940
|
+
}, sr = {
|
|
3616
3941
|
linear: (e) => e,
|
|
3617
3942
|
out: (e) => 1 - (1 - e) ** 3,
|
|
3618
3943
|
inout: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2
|
|
3619
|
-
},
|
|
3944
|
+
}, cr = (e) => {
|
|
3620
3945
|
let t = e.getBoundingClientRect(), n = e.parentElement;
|
|
3621
3946
|
for (; n && n !== document.body;) {
|
|
3622
3947
|
let e = getComputedStyle(n);
|
|
@@ -3624,12 +3949,12 @@ var Cn = (e) => e === window ? window.scrollY : e.scrollTop, wn = {
|
|
|
3624
3949
|
n = n.parentElement;
|
|
3625
3950
|
}
|
|
3626
3951
|
return !n || n === document.body ? Math.max(document.documentElement.scrollHeight - (t.bottom + window.scrollY), 0) : Math.max(n.scrollHeight - (t.bottom - n.getBoundingClientRect().top + n.scrollTop), 0);
|
|
3627
|
-
},
|
|
3952
|
+
}, lr = (e, t) => {
|
|
3628
3953
|
let n = typeof e == "number" ? e : parseFloat(e);
|
|
3629
3954
|
return Number.isFinite(n) ? n : t;
|
|
3630
3955
|
};
|
|
3631
|
-
function
|
|
3632
|
-
let i = Math.min(Math.max(Math.round(
|
|
3956
|
+
function ur(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
3957
|
+
let i = Math.min(Math.max(Math.round(lr(n, 0)), 0), 6);
|
|
3633
3958
|
try {
|
|
3634
3959
|
return new Intl.NumberFormat(t || void 0, {
|
|
3635
3960
|
minimumFractionDigits: i,
|
|
@@ -3640,8 +3965,8 @@ function On(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
|
3640
3965
|
return e.toFixed(i);
|
|
3641
3966
|
}
|
|
3642
3967
|
}
|
|
3643
|
-
function
|
|
3644
|
-
let { locale: C } = r(
|
|
3968
|
+
function dr({ from: e, to: t, duration: n, delay: a, decimals: o, prefix: l, suffix: f, separator: p, easing: m, trigger: h, offset: g, once: _, label: v, align: y, style: b, nodeRef: x, inert: S }) {
|
|
3969
|
+
let { locale: C } = r(Q), w = Math.max(lr(g, 0), 0), T = lr(e, 0), E = lr(t, 100), [D, O] = c(E), k = s(null), [j, M] = c(!1);
|
|
3645
3970
|
return i(() => {
|
|
3646
3971
|
let e = k.current;
|
|
3647
3972
|
if (S || !j || !e) {
|
|
@@ -3649,7 +3974,7 @@ function kn({ from: e, to: t, duration: n, delay: a, decimals: o, prefix: l, suf
|
|
|
3649
3974
|
return;
|
|
3650
3975
|
}
|
|
3651
3976
|
O(T);
|
|
3652
|
-
let t = Math.max(
|
|
3977
|
+
let t = Math.max(lr(n, 2e3), 0), r = Math.max(lr(a, 0), 0), i = sr[m] || sr.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, u = () => {
|
|
3653
3978
|
if (cancelAnimationFrame(s), clearTimeout(c), o || t === 0) {
|
|
3654
3979
|
O(E);
|
|
3655
3980
|
return;
|
|
@@ -3669,7 +3994,7 @@ function kn({ from: e, to: t, duration: n, delay: a, decimals: o, prefix: l, suf
|
|
|
3669
3994
|
let t = e.some((e) => e.isIntersecting);
|
|
3670
3995
|
t && (!l || _ === !1) ? (l = !0, u()) : !t && _ === !1 && (cancelAnimationFrame(s), clearTimeout(c), O(T));
|
|
3671
3996
|
}, {
|
|
3672
|
-
rootMargin: `0px 0px -${Math.min(w, Math.floor(
|
|
3997
|
+
rootMargin: `0px 0px -${Math.min(w, Math.floor(cr(e)))}px 0px`,
|
|
3673
3998
|
threshold: w > 0 ? 0 : .3
|
|
3674
3999
|
});
|
|
3675
4000
|
return d.observe(e), () => {
|
|
@@ -3709,7 +4034,7 @@ function kn({ from: e, to: t, duration: n, delay: a, decimals: o, prefix: l, suf
|
|
|
3709
4034
|
},
|
|
3710
4035
|
children: [
|
|
3711
4036
|
l || "",
|
|
3712
|
-
|
|
4037
|
+
ur(D, {
|
|
3713
4038
|
locale: C,
|
|
3714
4039
|
decimals: o,
|
|
3715
4040
|
separator: p
|
|
@@ -3727,7 +4052,7 @@ function kn({ from: e, to: t, duration: n, delay: a, decimals: o, prefix: l, suf
|
|
|
3727
4052
|
}) : null]
|
|
3728
4053
|
});
|
|
3729
4054
|
}
|
|
3730
|
-
function
|
|
4055
|
+
function fr({ 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 }) {
|
|
3731
4056
|
let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
|
|
3732
4057
|
b(e), typeof p == "function" && p(e);
|
|
3733
4058
|
};
|
|
@@ -3738,8 +4063,8 @@ function An({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3738
4063
|
}
|
|
3739
4064
|
if (!y) return;
|
|
3740
4065
|
let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
|
|
3741
|
-
let t =
|
|
3742
|
-
v(n ||
|
|
4066
|
+
let t = ir(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
4067
|
+
v(n || ar(t) > e);
|
|
3743
4068
|
};
|
|
3744
4069
|
return t(), document.addEventListener("scroll", t, {
|
|
3745
4070
|
capture: !0,
|
|
@@ -3753,7 +4078,7 @@ function An({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3753
4078
|
]);
|
|
3754
4079
|
let S = () => {
|
|
3755
4080
|
if (m) return;
|
|
3756
|
-
let e =
|
|
4081
|
+
let e = ir(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3757
4082
|
e === window ? window.scrollTo({
|
|
3758
4083
|
top: 0,
|
|
3759
4084
|
behavior: n
|
|
@@ -3761,7 +4086,7 @@ function An({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3761
4086
|
top: 0,
|
|
3762
4087
|
behavior: n
|
|
3763
4088
|
});
|
|
3764
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
4089
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = or[n] ? n : "bottom-right", D = h ? {
|
|
3765
4090
|
position: "fixed",
|
|
3766
4091
|
zIndex: 5,
|
|
3767
4092
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3774,7 +4099,7 @@ function An({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3774
4099
|
} : {
|
|
3775
4100
|
position: "fixed",
|
|
3776
4101
|
zIndex: 2147482e3,
|
|
3777
|
-
...
|
|
4102
|
+
...or[E](C)
|
|
3778
4103
|
};
|
|
3779
4104
|
return /* @__PURE__ */ d("button", {
|
|
3780
4105
|
ref: x,
|
|
@@ -3825,7 +4150,7 @@ function An({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3825
4150
|
}), w ? /* @__PURE__ */ u("span", { children: T }) : null]
|
|
3826
4151
|
});
|
|
3827
4152
|
}
|
|
3828
|
-
var
|
|
4153
|
+
var pr = {
|
|
3829
4154
|
facebook: {
|
|
3830
4155
|
label: "Facebook",
|
|
3831
4156
|
color: "#1877f2",
|
|
@@ -3892,8 +4217,8 @@ var jn = {
|
|
|
3892
4217
|
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"
|
|
3893
4218
|
}
|
|
3894
4219
|
};
|
|
3895
|
-
function
|
|
3896
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
4220
|
+
function mr({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
4221
|
+
let l = Array.isArray(e) ? e.filter((e) => e && pr[e.network]) : [];
|
|
3897
4222
|
if (!l.length) return null;
|
|
3898
4223
|
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;
|
|
3899
4224
|
return /* @__PURE__ */ u("div", {
|
|
@@ -3906,7 +4231,7 @@ function Mn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3906
4231
|
...A(o)
|
|
3907
4232
|
},
|
|
3908
4233
|
children: l.map((e, r) => {
|
|
3909
|
-
let i =
|
|
4234
|
+
let i = pr[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);
|
|
3910
4235
|
return /* @__PURE__ */ u("a", {
|
|
3911
4236
|
href: e.url || "#",
|
|
3912
4237
|
onClick: h,
|
|
@@ -3940,7 +4265,7 @@ function Mn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3940
4265
|
})
|
|
3941
4266
|
});
|
|
3942
4267
|
}
|
|
3943
|
-
function
|
|
4268
|
+
function hr({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3944
4269
|
if (!t.length) return null;
|
|
3945
4270
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
3946
4271
|
width: 32,
|
|
@@ -4018,7 +4343,7 @@ function Nn({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
4018
4343
|
})
|
|
4019
4344
|
});
|
|
4020
4345
|
}
|
|
4021
|
-
var
|
|
4346
|
+
var gr = {
|
|
4022
4347
|
small: {
|
|
4023
4348
|
w: 132,
|
|
4024
4349
|
h: 46,
|
|
@@ -4040,21 +4365,21 @@ var Pn = {
|
|
|
4040
4365
|
title: 12.5,
|
|
4041
4366
|
avatar: 46
|
|
4042
4367
|
}
|
|
4043
|
-
},
|
|
4044
|
-
|
|
4045
|
-
var
|
|
4368
|
+
}, _r = (e) => gr[e] ?? gr.medium;
|
|
4369
|
+
gr.medium.w, gr.medium.h;
|
|
4370
|
+
var vr = (e) => String(e?.group ?? "").trim(), yr = (e) => {
|
|
4046
4371
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
4047
4372
|
return e.forEach((e, r) => {
|
|
4048
|
-
let i =
|
|
4373
|
+
let i = vr(e) || `#${r}`;
|
|
4049
4374
|
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
4050
4375
|
}), t.flatMap((e) => n.get(e));
|
|
4051
4376
|
};
|
|
4052
|
-
function
|
|
4053
|
-
let i =
|
|
4377
|
+
function br(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
4378
|
+
let i = _r(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 = [];
|
|
4054
4379
|
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);
|
|
4055
|
-
d =
|
|
4056
|
-
for (let [e, t] of u) u.set(e,
|
|
4057
|
-
let f = (e, t) => o + (
|
|
4380
|
+
d = yr(d);
|
|
4381
|
+
for (let [e, t] of u) u.set(e, yr(t));
|
|
4382
|
+
let f = (e, t) => o + (vr(e) !== vr(t) && (vr(e) || vr(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
4058
4383
|
if (t.has(e.id)) return 0;
|
|
4059
4384
|
t.add(e.id);
|
|
4060
4385
|
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);
|
|
@@ -4070,7 +4395,7 @@ function Rn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
4070
4395
|
x: m,
|
|
4071
4396
|
y: b
|
|
4072
4397
|
});
|
|
4073
|
-
let x =
|
|
4398
|
+
let x = vr(e);
|
|
4074
4399
|
if (x) {
|
|
4075
4400
|
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
4076
4401
|
_.has(t) || _.set(t, {
|
|
@@ -4144,19 +4469,19 @@ function Rn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
4144
4469
|
horizontal: n
|
|
4145
4470
|
};
|
|
4146
4471
|
}
|
|
4147
|
-
var
|
|
4472
|
+
var xr = (e, t) => {
|
|
4148
4473
|
let n = String(e ?? "");
|
|
4149
4474
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
4150
|
-
},
|
|
4475
|
+
}, Sr = (e) => {
|
|
4151
4476
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
4152
4477
|
if (!t) return "#ffffff";
|
|
4153
4478
|
let n = t[1];
|
|
4154
4479
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
4155
4480
|
let r = parseInt(n, 16);
|
|
4156
4481
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
4157
|
-
},
|
|
4158
|
-
function
|
|
4159
|
-
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 ? "" :
|
|
4482
|
+
}, Cr = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
4483
|
+
function wr(e, t = {}) {
|
|
4484
|
+
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 ? "" : ct(e);
|
|
4160
4485
|
return n.map((e) => {
|
|
4161
4486
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
4162
4487
|
return {
|
|
@@ -4171,11 +4496,11 @@ function Hn(e, t = {}) {
|
|
|
4171
4496
|
};
|
|
4172
4497
|
});
|
|
4173
4498
|
}
|
|
4174
|
-
var
|
|
4499
|
+
var Tr = {
|
|
4175
4500
|
size: 36,
|
|
4176
4501
|
pad: 10
|
|
4177
4502
|
};
|
|
4178
|
-
function
|
|
4503
|
+
function Er({ node: e, onClose: t }) {
|
|
4179
4504
|
return i(() => {
|
|
4180
4505
|
let e = (e) => e.key === "Escape" && t();
|
|
4181
4506
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -4296,8 +4621,8 @@ function Wn({ node: e, onClose: t }) {
|
|
|
4296
4621
|
})
|
|
4297
4622
|
});
|
|
4298
4623
|
}
|
|
4299
|
-
function
|
|
4300
|
-
let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(
|
|
4624
|
+
function Dr({ 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 }) {
|
|
4625
|
+
let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(Q), O = r(et)?.[t], [k, j] = c(null);
|
|
4301
4626
|
i(() => {
|
|
4302
4627
|
if (!t || O) return;
|
|
4303
4628
|
let e = !0;
|
|
@@ -4313,7 +4638,7 @@ function Gn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4313
4638
|
D,
|
|
4314
4639
|
O
|
|
4315
4640
|
]);
|
|
4316
|
-
let M = t ?
|
|
4641
|
+
let M = t ? wr(O ?? k ?? [], {
|
|
4317
4642
|
nameField: n,
|
|
4318
4643
|
titleField: o,
|
|
4319
4644
|
photoField: s,
|
|
@@ -4321,7 +4646,7 @@ function Gn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4321
4646
|
cvField: p,
|
|
4322
4647
|
hrefField: m,
|
|
4323
4648
|
groupField: h
|
|
4324
|
-
}) : e, N =
|
|
4649
|
+
}) : e, N = _r(v), { boxes: P, links: F, groups: I, width: L, height: R } = br(M, {
|
|
4325
4650
|
size: v,
|
|
4326
4651
|
horizontal: y,
|
|
4327
4652
|
groupTitles: g
|
|
@@ -4379,8 +4704,8 @@ function Gn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4379
4704
|
fontSize: N.title + 1,
|
|
4380
4705
|
fontWeight: "600",
|
|
4381
4706
|
opacity: "0.55",
|
|
4382
|
-
fill: r ?
|
|
4383
|
-
children:
|
|
4707
|
+
fill: r ? Sr(e.color || _) : "var(--page-text, #111827)",
|
|
4708
|
+
children: xr(e.title, Math.floor(e.width / 7))
|
|
4384
4709
|
})] }, `group-${t}`);
|
|
4385
4710
|
}),
|
|
4386
4711
|
F.map((e, t) => /* @__PURE__ */ u("path", {
|
|
@@ -4390,7 +4715,7 @@ function Gn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4390
4715
|
strokeWidth: "1.5"
|
|
4391
4716
|
}, t)),
|
|
4392
4717
|
P.map(({ node: e, x: t, y: n }) => {
|
|
4393
|
-
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 ?
|
|
4718
|
+
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 ? Sr(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Sr(e.color2) : s, f = S && (Cr(e) || e.href), p = () => Cr(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Tr.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);
|
|
4394
4719
|
return /* @__PURE__ */ d("g", {
|
|
4395
4720
|
onClick: f ? p : void 0,
|
|
4396
4721
|
style: f ? { cursor: "pointer" } : void 0,
|
|
@@ -4454,13 +4779,13 @@ function Gn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4454
4779
|
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
4455
4780
|
id: `${C}-${e.id}`,
|
|
4456
4781
|
children: /* @__PURE__ */ u("circle", {
|
|
4457
|
-
cx: t +
|
|
4782
|
+
cx: t + Tr.pad + N.avatar / 2,
|
|
4458
4783
|
cy: n + N.h / 2,
|
|
4459
4784
|
r: N.avatar / 2
|
|
4460
4785
|
})
|
|
4461
4786
|
}), /* @__PURE__ */ u("image", {
|
|
4462
4787
|
href: e.photo,
|
|
4463
|
-
x: t +
|
|
4788
|
+
x: t + Tr.pad,
|
|
4464
4789
|
y: n + (N.h - N.avatar) / 2,
|
|
4465
4790
|
width: N.avatar,
|
|
4466
4791
|
height: N.avatar,
|
|
@@ -4474,7 +4799,7 @@ function Gn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4474
4799
|
fontSize: N.title,
|
|
4475
4800
|
fontWeight: "600",
|
|
4476
4801
|
fill: s,
|
|
4477
|
-
children:
|
|
4802
|
+
children: xr(e.title, g + 4)
|
|
4478
4803
|
}), e.name && /* @__PURE__ */ u("text", {
|
|
4479
4804
|
x: m,
|
|
4480
4805
|
y: n + _ + _ / 2 + N.name * .35,
|
|
@@ -4482,7 +4807,7 @@ function Gn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4482
4807
|
fontSize: N.name,
|
|
4483
4808
|
fontWeight: "600",
|
|
4484
4809
|
fill: c,
|
|
4485
|
-
children:
|
|
4810
|
+
children: xr(e.name, g)
|
|
4486
4811
|
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
4487
4812
|
x: m,
|
|
4488
4813
|
y: n + (v[1] ? N.h * .43 : N.h * .57),
|
|
@@ -4490,7 +4815,7 @@ function Gn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4490
4815
|
fontSize: N.name,
|
|
4491
4816
|
fontWeight: "600",
|
|
4492
4817
|
fill: s,
|
|
4493
|
-
children:
|
|
4818
|
+
children: xr(v[0], g)
|
|
4494
4819
|
}), v[1] && /* @__PURE__ */ u("text", {
|
|
4495
4820
|
x: m,
|
|
4496
4821
|
y: n + N.h * .73,
|
|
@@ -4498,19 +4823,19 @@ function Gn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4498
4823
|
fontSize: N.title,
|
|
4499
4824
|
opacity: "0.7",
|
|
4500
4825
|
fill: s,
|
|
4501
|
-
children:
|
|
4826
|
+
children: xr(v[1], g + 4)
|
|
4502
4827
|
})] })
|
|
4503
4828
|
]
|
|
4504
4829
|
}, e.id);
|
|
4505
4830
|
})
|
|
4506
4831
|
]
|
|
4507
|
-
}), w && /* @__PURE__ */ u(
|
|
4832
|
+
}), w && /* @__PURE__ */ u(Er, {
|
|
4508
4833
|
node: w,
|
|
4509
4834
|
onClose: () => T(null)
|
|
4510
4835
|
})]
|
|
4511
4836
|
});
|
|
4512
4837
|
}
|
|
4513
|
-
function
|
|
4838
|
+
function Or({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4514
4839
|
let [a, o] = c(!1), l = s(null);
|
|
4515
4840
|
return i(() => {
|
|
4516
4841
|
if (!a || !l.current) return;
|
|
@@ -4540,7 +4865,7 @@ function Kn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4540
4865
|
children: e ?? ""
|
|
4541
4866
|
});
|
|
4542
4867
|
}
|
|
4543
|
-
var
|
|
4868
|
+
var kr = 360, Ar = "\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", jr = (e, t) => e && t ? `cell-${e}-${t}` : "", Mr = (e) => {
|
|
4544
4869
|
if (!e || typeof e != "object") return e ?? "";
|
|
4545
4870
|
let t = String(e.text ?? "");
|
|
4546
4871
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ u("a", {
|
|
@@ -4551,7 +4876,7 @@ var qn = 360, Jn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4551
4876
|
children: t
|
|
4552
4877
|
}) : t;
|
|
4553
4878
|
};
|
|
4554
|
-
function
|
|
4879
|
+
function Nr({ 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 }) {
|
|
4555
4880
|
let F = s(null), I = s(null), [L, R] = c(null), [z, B] = c(null), V = (e, t) => () => R({
|
|
4556
4881
|
r: e,
|
|
4557
4882
|
c: t
|
|
@@ -4565,7 +4890,7 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4565
4890
|
}
|
|
4566
4891
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4567
4892
|
top: r.bottom - n.top + 4,
|
|
4568
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
4893
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - kr))
|
|
4569
4894
|
};
|
|
4570
4895
|
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4571
4896
|
}), i(() => {
|
|
@@ -4575,7 +4900,7 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4575
4900
|
};
|
|
4576
4901
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4577
4902
|
}, [P, L]);
|
|
4578
|
-
let { tenant: H, apiUrl: U } = r(
|
|
4903
|
+
let { tenant: H, apiUrl: U } = r(Q), ee = r(et), te = ee?.[h], ne = C ? tt(ee) : 1, [re, ie] = c(null);
|
|
4579
4904
|
if (i(() => {
|
|
4580
4905
|
if (!h || te) return;
|
|
4581
4906
|
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(ne - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
@@ -4594,17 +4919,17 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4594
4919
|
ne,
|
|
4595
4920
|
g
|
|
4596
4921
|
]), !e.length) return null;
|
|
4597
|
-
let W = Math.max(1, Number(g) || 10), G = h ? C ? te || h.startsWith("api:") ? (te ?? re ?? []).slice((ne - 1) * W, ne * W) : (re ?? []).slice(0, W) : (te ?? re ?? []).slice(0, W) : null, K = G ? G.map((t) => e.map((e) =>
|
|
4922
|
+
let W = Math.max(1, Number(g) || 10), G = h ? C ? te || h.startsWith("api:") ? (te ?? re ?? []).slice((ne - 1) * W, ne * W) : (re ?? []).slice(0, W) : (te ?? re ?? []).slice(0, W) : null, K = G ? G.map((t) => e.map((e) => ct(ot(t?.data, e.field)))) : t, ae = !!h && !(h && !te && re === null) && K.length === 0, q = b ? {
|
|
4598
4923
|
y: 6,
|
|
4599
4924
|
x: 10
|
|
4600
4925
|
} : {
|
|
4601
4926
|
y: 10,
|
|
4602
4927
|
x: 14
|
|
4603
|
-
},
|
|
4928
|
+
}, oe = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : q.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : q.x}px`, se = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, ce = y ? { border: se } : { borderBottom: se }, le = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), ue = [
|
|
4604
4929
|
"left",
|
|
4605
4930
|
"center",
|
|
4606
4931
|
"right"
|
|
4607
|
-
],
|
|
4932
|
+
], J = (t) => ue.includes(e[t]?.align) ? e[t].align : "", de = (e) => J(e) || (ue.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 ? {
|
|
4608
4933
|
...pe,
|
|
4609
4934
|
maxHeight: void 0
|
|
4610
4935
|
} : pe, _e = !!P && P.rows !== !1, ve = (t) => (r) => {
|
|
@@ -4612,7 +4937,7 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4612
4937
|
r.preventDefault(), r.stopPropagation();
|
|
4613
4938
|
let i = F.current, a = i ? i.clientWidth : 0;
|
|
4614
4939
|
if (!a) return;
|
|
4615
|
-
let o =
|
|
4940
|
+
let o = le ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4616
4941
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4617
4942
|
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, P.resize(i);
|
|
4618
4943
|
}, u = () => {
|
|
@@ -4621,7 +4946,7 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4621
4946
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4622
4947
|
}, ye = /* @__PURE__ */ new Set();
|
|
4623
4948
|
p && K.forEach((t, n) => e.forEach((e, t) => {
|
|
4624
|
-
let r = p[
|
|
4949
|
+
let r = p[jr(a[n], o[t])];
|
|
4625
4950
|
if (!r) return;
|
|
4626
4951
|
let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
|
|
4627
4952
|
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && ye.add(`${n + e},${t + r}`);
|
|
@@ -4644,7 +4969,7 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4644
4969
|
},
|
|
4645
4970
|
onClick: n,
|
|
4646
4971
|
children: e
|
|
4647
|
-
}, t), X = L && L.r < K.length && L.c < e.length ? L : null,
|
|
4972
|
+
}, t), X = L && L.r < K.length && L.c < e.length ? L : null, Z = (e, t) => P?.labels?.[e] ?? t, xe = X ? p?.[jr(a[X.r], o[X.c])] : null, Se = Math.max(1, Number(xe?.c) || 1), Ce = Math.max(1, Number(xe?.r) || 1);
|
|
4648
4973
|
return /* @__PURE__ */ d("div", {
|
|
4649
4974
|
ref: (e) => {
|
|
4650
4975
|
I.current = e, typeof N == "function" && N(e);
|
|
@@ -4655,7 +4980,7 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4655
4980
|
...ge
|
|
4656
4981
|
},
|
|
4657
4982
|
children: [
|
|
4658
|
-
P && /* @__PURE__ */ u("style", { children:
|
|
4983
|
+
P && /* @__PURE__ */ u("style", { children: Ar }),
|
|
4659
4984
|
P && X && z && /* @__PURE__ */ d("div", {
|
|
4660
4985
|
className: "wb-tedit-bar",
|
|
4661
4986
|
style: {
|
|
@@ -4668,21 +4993,21 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4668
4993
|
className: "wb-tedit-at",
|
|
4669
4994
|
children: `R${X.r + 1}·C${X.c + 1}`
|
|
4670
4995
|
}),
|
|
4671
|
-
Y("+↑",
|
|
4672
|
-
Y("+↓",
|
|
4673
|
-
Y("↑",
|
|
4674
|
-
Y("↓",
|
|
4675
|
-
Y("✕ row",
|
|
4996
|
+
Y("+↑", Z("rowAbove", "Insert row above"), () => P.addRow(X.r - 1)),
|
|
4997
|
+
Y("+↓", Z("rowBelow", "Insert row below"), () => P.addRow(X.r)),
|
|
4998
|
+
Y("↑", Z("rowUp", "Move row up"), () => P.moveRow(X.r, -1), X.r === 0),
|
|
4999
|
+
Y("↓", Z("rowDown", "Move row down"), () => P.moveRow(X.r, 1), X.r >= K.length - 1),
|
|
5000
|
+
Y("✕ row", Z("rowDelete", "Delete row"), () => P.dropRow(X.r), K.length <= 1),
|
|
4676
5001
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4677
|
-
Y("+←",
|
|
4678
|
-
Y("+→",
|
|
4679
|
-
Y("←",
|
|
4680
|
-
Y("→",
|
|
4681
|
-
Y("✕ col",
|
|
5002
|
+
Y("+←", Z("colLeft", "Insert column left"), () => P.addColumn(X.c - 1)),
|
|
5003
|
+
Y("+→", Z("colRight", "Insert column right"), () => P.addColumn(X.c)),
|
|
5004
|
+
Y("←", Z("colMoveLeft", "Move column left"), () => P.moveColumn(X.c, -1), X.c === 0),
|
|
5005
|
+
Y("→", Z("colMoveRight", "Move column right"), () => P.moveColumn(X.c, 1), X.c >= e.length - 1),
|
|
5006
|
+
Y("✕ col", Z("colDelete", "Delete column"), () => P.dropColumn(X.c), e.length <= 1),
|
|
4682
5007
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4683
|
-
Y("↔",
|
|
4684
|
-
Y("↕",
|
|
4685
|
-
Y("⤫",
|
|
5008
|
+
Y("↔", Z("mergeRight", "Merge with the cell on the right"), () => P.merge(X.r, X.c, "right"), X.c + Se >= e.length),
|
|
5009
|
+
Y("↕", Z("mergeDown", "Merge with the cell below"), () => P.merge(X.r, X.c, "down"), X.r + Ce >= K.length),
|
|
5010
|
+
Y("⤫", Z("split", "Split this cell"), () => P.split(X.r, X.c), Se === 1 && Ce === 1)
|
|
4686
5011
|
]
|
|
4687
5012
|
}),
|
|
4688
5013
|
/* @__PURE__ */ u("div", {
|
|
@@ -4701,17 +5026,17 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4701
5026
|
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
4702
5027
|
borderSpacing: 0,
|
|
4703
5028
|
fontSize: 14,
|
|
4704
|
-
...
|
|
4705
|
-
...y ? { border:
|
|
5029
|
+
...le ? { tableLayout: "fixed" } : null,
|
|
5030
|
+
...y ? { border: se } : {}
|
|
4706
5031
|
},
|
|
4707
5032
|
children: [
|
|
4708
|
-
|
|
5033
|
+
le && /* @__PURE__ */ u("colgroup", { children: n.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
|
|
4709
5034
|
_ === !1 ? null : /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((t, n) => /* @__PURE__ */ u("th", {
|
|
4710
5035
|
className: P ? "wb-tedit-head" : void 0,
|
|
4711
5036
|
style: {
|
|
4712
5037
|
textAlign: de(n),
|
|
4713
5038
|
fontWeight: 600,
|
|
4714
|
-
padding:
|
|
5039
|
+
padding: oe,
|
|
4715
5040
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4716
5041
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4717
5042
|
...T ? {
|
|
@@ -4719,26 +5044,26 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4719
5044
|
top: 0,
|
|
4720
5045
|
zIndex: 2
|
|
4721
5046
|
} : P ? { position: "relative" } : null,
|
|
4722
|
-
...
|
|
5047
|
+
...ce
|
|
4723
5048
|
},
|
|
4724
|
-
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
5049
|
+
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(Or, {
|
|
4725
5050
|
value: t.label ?? t,
|
|
4726
5051
|
onCommit: (e) => P.header(n, e),
|
|
4727
|
-
hint:
|
|
5052
|
+
hint: Z("editCell", "Double-click to edit"),
|
|
4728
5053
|
style: { paddingRight: 6 }
|
|
4729
5054
|
}), n < e.length - 1 && /* @__PURE__ */ u("span", {
|
|
4730
5055
|
className: "wb-tedit-grip",
|
|
4731
|
-
title:
|
|
5056
|
+
title: Z("colWidth", "Drag to resize the column"),
|
|
4732
5057
|
onPointerDown: ve(n)
|
|
4733
5058
|
})] }) : t.label ?? t
|
|
4734
5059
|
}, n)) }) }),
|
|
4735
5060
|
/* @__PURE__ */ d("tbody", { children: [ae && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
4736
5061
|
colSpan: e.length,
|
|
4737
5062
|
style: {
|
|
4738
|
-
padding:
|
|
5063
|
+
padding: oe,
|
|
4739
5064
|
textAlign: "center",
|
|
4740
5065
|
opacity: .6,
|
|
4741
|
-
...
|
|
5066
|
+
...ce
|
|
4742
5067
|
},
|
|
4743
5068
|
children: w || "No data yet"
|
|
4744
5069
|
}) }), K.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
@@ -4749,7 +5074,7 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4749
5074
|
},
|
|
4750
5075
|
children: e.map((e, r) => {
|
|
4751
5076
|
if (ye.has(`${n},${r}`)) return null;
|
|
4752
|
-
let i =
|
|
5077
|
+
let i = jr(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);
|
|
4753
5078
|
return /* @__PURE__ */ d("td", {
|
|
4754
5079
|
className: P ? `wb-tedit-cell${L?.r === n && L?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4755
5080
|
onMouseDownCapture: _e ? V(n, r) : void 0,
|
|
@@ -4757,14 +5082,14 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4757
5082
|
colSpan: l > 1 ? l : void 0,
|
|
4758
5083
|
rowSpan: f > 1 ? f : void 0,
|
|
4759
5084
|
style: {
|
|
4760
|
-
padding:
|
|
4761
|
-
...
|
|
5085
|
+
padding: oe,
|
|
5086
|
+
...J(r) ? { textAlign: J(r) } : null,
|
|
4762
5087
|
...P ? { position: "relative" } : null,
|
|
4763
|
-
...
|
|
5088
|
+
...ce
|
|
4764
5089
|
},
|
|
4765
|
-
children: [s ??
|
|
5090
|
+
children: [s ?? Mr(t?.[r]), P && _e && /* @__PURE__ */ u("span", {
|
|
4766
5091
|
className: "wb-tedit-rowgrip",
|
|
4767
|
-
title:
|
|
5092
|
+
title: Z("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4768
5093
|
onPointerDown: be(n),
|
|
4769
5094
|
onDoubleClick: () => P.resizeRow(n, 0)
|
|
4770
5095
|
})]
|
|
@@ -4777,7 +5102,7 @@ function Zn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4777
5102
|
]
|
|
4778
5103
|
});
|
|
4779
5104
|
}
|
|
4780
|
-
var
|
|
5105
|
+
var Pr = {
|
|
4781
5106
|
small: {
|
|
4782
5107
|
cell: 62,
|
|
4783
5108
|
font: 10.5,
|
|
@@ -4802,9 +5127,9 @@ var Qn = {
|
|
|
4802
5127
|
pad: 8,
|
|
4803
5128
|
gap: 4
|
|
4804
5129
|
}
|
|
4805
|
-
},
|
|
4806
|
-
function
|
|
4807
|
-
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 ? "" :
|
|
5130
|
+
}, Fr = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Ir = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Lr = 366;
|
|
5131
|
+
function Rr(e, t = {}) {
|
|
5132
|
+
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 ? "" : ct(e), a = (e) => {
|
|
4808
5133
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4809
5134
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4810
5135
|
};
|
|
@@ -4820,7 +5145,7 @@ function nr(e, t = {}) {
|
|
|
4820
5145
|
} : null;
|
|
4821
5146
|
}).filter(Boolean);
|
|
4822
5147
|
}
|
|
4823
|
-
function
|
|
5148
|
+
function zr(e) {
|
|
4824
5149
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4825
5150
|
let n = e?.start ? new Date(e.start) : null;
|
|
4826
5151
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4835,20 +5160,20 @@ function rr(e) {
|
|
|
4835
5160
|
};
|
|
4836
5161
|
}).filter(Boolean);
|
|
4837
5162
|
}
|
|
4838
|
-
function
|
|
5163
|
+
function Br(e) {
|
|
4839
5164
|
let t = /* @__PURE__ */ new Map();
|
|
4840
5165
|
for (let n of e) {
|
|
4841
|
-
let e =
|
|
5166
|
+
let e = Ir(n.start), r = n.end ? Ir(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Lr);
|
|
4842
5167
|
for (let r = 0; r <= i; r += 1) {
|
|
4843
|
-
let i =
|
|
5168
|
+
let i = Fr(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4844
5169
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4845
5170
|
}
|
|
4846
5171
|
}
|
|
4847
5172
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4848
5173
|
return t;
|
|
4849
5174
|
}
|
|
4850
|
-
function
|
|
4851
|
-
let { tenant: T, apiUrl: E, locale: D } = r(
|
|
5175
|
+
function Vr({ 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 }) {
|
|
5176
|
+
let { tenant: T, apiUrl: E, locale: D } = r(Q), O = r(et)?.[t], [k, j] = c(null), [M, N] = c(() => {
|
|
4852
5177
|
let e = /* @__PURE__ */ new Date();
|
|
4853
5178
|
return {
|
|
4854
5179
|
year: e.getFullYear(),
|
|
@@ -4870,13 +5195,13 @@ function ar({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4870
5195
|
E,
|
|
4871
5196
|
O
|
|
4872
5197
|
]);
|
|
4873
|
-
let P =
|
|
5198
|
+
let P = Pr[m] ?? Pr.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 ? Rr(O ?? k ?? [], {
|
|
4874
5199
|
titleField: n,
|
|
4875
5200
|
startField: a,
|
|
4876
5201
|
endField: o,
|
|
4877
5202
|
hrefField: s,
|
|
4878
5203
|
colorField: f
|
|
4879
|
-
}) :
|
|
5204
|
+
}) : zr(e), B = Br(z), V = D || void 0, H = (e, t) => {
|
|
4880
5205
|
let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
|
|
4881
5206
|
width: 6,
|
|
4882
5207
|
height: 6,
|
|
@@ -5008,10 +5333,10 @@ function ar({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
5008
5333
|
})]
|
|
5009
5334
|
});
|
|
5010
5335
|
}
|
|
5011
|
-
let re = new Date(M.year, M.month, 1), ie = y === "sunday" ? 0 : 1, W = (re.getDay() - ie + 7) % 7, G = new Date(M.year, M.month + 1, 0).getDate(), K = Math.ceil((W + G) / 7), ae =
|
|
5336
|
+
let re = new Date(M.year, M.month, 1), ie = y === "sunday" ? 0 : 1, W = (re.getDay() - ie + 7) % 7, G = new Date(M.year, M.month + 1, 0).getDate(), K = Math.ceil((W + G) / 7), ae = Fr(/* @__PURE__ */ new Date()), q = new Intl.DateTimeFormat(V, { weekday: "short" }), oe = [];
|
|
5012
5337
|
for (let e = 0; e < K * 7; e += 1) {
|
|
5013
|
-
let t = e - W + 1, n = t >= 1 && t <= G, r =
|
|
5014
|
-
|
|
5338
|
+
let t = e - W + 1, n = t >= 1 && t <= G, r = Fr(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ae;
|
|
5339
|
+
oe.push(/* @__PURE__ */ d("div", {
|
|
5015
5340
|
style: {
|
|
5016
5341
|
minHeight: P.cell,
|
|
5017
5342
|
borderTop: `1px solid ${I}`,
|
|
@@ -5069,30 +5394,30 @@ function ar({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
5069
5394
|
padding: `0 0 ${P.pad}px`
|
|
5070
5395
|
},
|
|
5071
5396
|
children: q.format(new Date(2024, 0, 7 + ie + t))
|
|
5072
|
-
}, `head-${t}`)),
|
|
5397
|
+
}, `head-${t}`)), oe]
|
|
5073
5398
|
}),
|
|
5074
5399
|
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
5075
5400
|
]
|
|
5076
5401
|
});
|
|
5077
5402
|
}
|
|
5078
|
-
var
|
|
5403
|
+
var Hr = {
|
|
5079
5404
|
small: 36,
|
|
5080
5405
|
medium: 56,
|
|
5081
5406
|
large: 88
|
|
5082
5407
|
};
|
|
5083
|
-
function
|
|
5084
|
-
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" :
|
|
5408
|
+
function Ur(e, t = {}) {
|
|
5409
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : ct(e);
|
|
5085
5410
|
return n.map((e) => {
|
|
5086
|
-
let n = e.data ?? e, i =
|
|
5411
|
+
let n = e.data ?? e, i = ot(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(ot(n, t.nameField)) : r(n.name);
|
|
5087
5412
|
return {
|
|
5088
5413
|
src: typeof o == "string" ? o.trim() : "",
|
|
5089
5414
|
alt: s,
|
|
5090
|
-
href: t.hrefField ? r(
|
|
5415
|
+
href: t.hrefField ? r(ot(n, t.hrefField)) : ""
|
|
5091
5416
|
};
|
|
5092
5417
|
}).filter((e) => e.src);
|
|
5093
5418
|
}
|
|
5094
|
-
function
|
|
5095
|
-
let { tenant: D, apiUrl: O } = r(
|
|
5419
|
+
function Wr({ 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 }) {
|
|
5420
|
+
let { tenant: D, apiUrl: O } = r(Q), k = r(et)?.[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), [te, ne] = c(!1);
|
|
5096
5421
|
i(() => {
|
|
5097
5422
|
if (!t || k) return;
|
|
5098
5423
|
let e = !0;
|
|
@@ -5131,11 +5456,11 @@ function cr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5131
5456
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
5132
5457
|
};
|
|
5133
5458
|
});
|
|
5134
|
-
let re = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ie = t ?
|
|
5459
|
+
let re = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ie = t ? Ur(k ?? j ?? [], {
|
|
5135
5460
|
imageField: n,
|
|
5136
5461
|
nameField: a,
|
|
5137
5462
|
hrefField: o
|
|
5138
|
-
}) : re, W =
|
|
5463
|
+
}) : re, W = Hr[p] ?? Hr.medium, G = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ae = f === "marquee" ? "step" : f, q = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), oe = Math.min(3e3, Math.max(100, Number(_) || 500)), se = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), ce = (L || W * 3) + G, le = F ? Math.max(1, Math.floor(F / ce)) : se, ue = Math.min(se, le), J = F ? Math.min(ce, F / ue) : ce;
|
|
5139
5464
|
if (!ie.length) return /* @__PURE__ */ u("div", {
|
|
5140
5465
|
ref: T,
|
|
5141
5466
|
style: {
|
|
@@ -5181,7 +5506,7 @@ function cr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5181
5506
|
children: C
|
|
5182
5507
|
}) : null
|
|
5183
5508
|
});
|
|
5184
|
-
let de = ie.length, fe = ae === "step" && de >
|
|
5509
|
+
let de = ie.length, fe = ae === "step" && de > ue, pe = ae === "slider", me = fe && !E && !U && !te, he = v === "right", ge = he ? de : 0, _e = fe ? [...ie, ...ie] : ie, ve = fe ? z * J : 0, ye = (e, t, n) => {
|
|
5185
5510
|
let r = /* @__PURE__ */ u("img", {
|
|
5186
5511
|
src: e.src,
|
|
5187
5512
|
alt: e.alt ?? "",
|
|
@@ -5193,7 +5518,7 @@ function cr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5193
5518
|
display: "block"
|
|
5194
5519
|
}
|
|
5195
5520
|
}), i = fe ? {
|
|
5196
|
-
width:
|
|
5521
|
+
width: J,
|
|
5197
5522
|
flex: "0 0 auto",
|
|
5198
5523
|
padding: `0 ${G / 2}px`,
|
|
5199
5524
|
justifyContent: "center"
|
|
@@ -5225,9 +5550,9 @@ function cr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5225
5550
|
display: "flex",
|
|
5226
5551
|
alignItems: "center",
|
|
5227
5552
|
...fe ? {
|
|
5228
|
-
width: _e.length *
|
|
5553
|
+
width: _e.length * J,
|
|
5229
5554
|
transform: `translateX(-${ve}px)`,
|
|
5230
|
-
transition: V ? `transform ${
|
|
5555
|
+
transition: V ? `transform ${oe}ms ease` : "none"
|
|
5231
5556
|
} : pe ? {
|
|
5232
5557
|
gap: G,
|
|
5233
5558
|
overflowX: "auto",
|
|
@@ -5258,7 +5583,7 @@ function cr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5258
5583
|
H(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
5259
5584
|
H(!0), B(n + e);
|
|
5260
5585
|
}));
|
|
5261
|
-
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show",
|
|
5586
|
+
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Z = X !== "off" && (pe ? F > 0 : fe), xe = (e) => /* @__PURE__ */ u("button", {
|
|
5262
5587
|
type: "button",
|
|
5263
5588
|
"aria-label": e < 0 ? "Previous logos" : "Next logos",
|
|
5264
5589
|
onClick: () => Y(e),
|
|
@@ -5303,27 +5628,27 @@ function cr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5303
5628
|
fe ? /* @__PURE__ */ d("div", {
|
|
5304
5629
|
style: {
|
|
5305
5630
|
position: "relative",
|
|
5306
|
-
width:
|
|
5631
|
+
width: ue * J,
|
|
5307
5632
|
maxWidth: "100%",
|
|
5308
5633
|
margin: "0 auto"
|
|
5309
5634
|
},
|
|
5310
5635
|
children: [
|
|
5311
|
-
|
|
5636
|
+
Z ? xe(-1) : null,
|
|
5312
5637
|
/* @__PURE__ */ u("div", {
|
|
5313
5638
|
style: { overflow: "hidden" },
|
|
5314
5639
|
children: be
|
|
5315
5640
|
}),
|
|
5316
|
-
|
|
5641
|
+
Z ? xe(1) : null
|
|
5317
5642
|
]
|
|
5318
5643
|
}) : /* @__PURE__ */ d(l, { children: [
|
|
5319
|
-
|
|
5644
|
+
Z ? xe(-1) : null,
|
|
5320
5645
|
be,
|
|
5321
|
-
|
|
5646
|
+
Z ? xe(1) : null
|
|
5322
5647
|
] }),
|
|
5323
|
-
/* @__PURE__ */ u(
|
|
5648
|
+
/* @__PURE__ */ u(Gr, {
|
|
5324
5649
|
running: me,
|
|
5325
|
-
every: q +
|
|
5326
|
-
slide:
|
|
5650
|
+
every: q + oe,
|
|
5651
|
+
slide: oe,
|
|
5327
5652
|
step: he ? -1 : 1,
|
|
5328
5653
|
index: z,
|
|
5329
5654
|
total: de,
|
|
@@ -5334,7 +5659,7 @@ function cr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5334
5659
|
]
|
|
5335
5660
|
});
|
|
5336
5661
|
}
|
|
5337
|
-
function
|
|
5662
|
+
function Gr({ running: e, every: t, slide: n, step: r, index: a, total: o, home: s, setIndex: c, setAnimate: l }) {
|
|
5338
5663
|
i(() => {
|
|
5339
5664
|
if (!e) return;
|
|
5340
5665
|
let n = setInterval(() => {
|
|
@@ -5370,13 +5695,13 @@ function lr({ running: e, every: t, slide: n, step: r, index: a, total: o, home:
|
|
|
5370
5695
|
l
|
|
5371
5696
|
]), null;
|
|
5372
5697
|
}
|
|
5373
|
-
var
|
|
5698
|
+
var Kr = {
|
|
5374
5699
|
small: 380,
|
|
5375
5700
|
medium: 560,
|
|
5376
5701
|
large: 820,
|
|
5377
5702
|
full: "100%"
|
|
5378
5703
|
};
|
|
5379
|
-
function
|
|
5704
|
+
function qr({ 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 }) {
|
|
5380
5705
|
let [C, w] = c(!1), T = s(null);
|
|
5381
5706
|
i(() => {
|
|
5382
5707
|
if (S || !e) return;
|
|
@@ -5401,7 +5726,7 @@ function dr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5401
5726
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
5402
5727
|
};
|
|
5403
5728
|
}, [S, C]);
|
|
5404
|
-
let E =
|
|
5729
|
+
let E = Kr[o] ?? Kr.medium, D = (e) => {
|
|
5405
5730
|
let t = {
|
|
5406
5731
|
padding: "9px 16px",
|
|
5407
5732
|
borderRadius: 6,
|
|
@@ -5570,7 +5895,7 @@ function dr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5570
5895
|
})]
|
|
5571
5896
|
});
|
|
5572
5897
|
}
|
|
5573
|
-
function
|
|
5898
|
+
function Jr({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: a = "left", panelWidth: o = "", offset: l = 8, editorOpen: f = !0, linked: p, style: m, nodeRef: h, inert: g = !1 }) {
|
|
5574
5899
|
let [_, v] = c(!1), y = s(null), b = s(null), x = r !== "click", S = () => {
|
|
5575
5900
|
b.current && clearTimeout(b.current), b.current = null;
|
|
5576
5901
|
}, C = () => {
|
|
@@ -5671,100 +5996,101 @@ function fr({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
|
|
|
5671
5996
|
}), E]
|
|
5672
5997
|
});
|
|
5673
5998
|
}
|
|
5674
|
-
var
|
|
5675
|
-
PageRoot:
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5999
|
+
var Yr = {
|
|
6000
|
+
PageRoot: yt,
|
|
6001
|
+
MarkdownBlock: Pt,
|
|
6002
|
+
CalendarBlock: Vr,
|
|
6003
|
+
LogoCarousel: Wr,
|
|
6004
|
+
DialogBlock: qr,
|
|
6005
|
+
DropdownBlock: Jr,
|
|
6006
|
+
Section: bt,
|
|
6007
|
+
Container: xt,
|
|
6008
|
+
Heading: St,
|
|
6009
|
+
TextBlock: Rt,
|
|
6010
|
+
ButtonBlock: Vt,
|
|
6011
|
+
ImageBlock: Ht,
|
|
6012
|
+
Spacer: Xt,
|
|
6013
|
+
Divider: Zt,
|
|
6014
|
+
BoxBlock: Qt,
|
|
6015
|
+
SliderBlock: an,
|
|
6016
|
+
CanvasSlider: on,
|
|
6017
|
+
TabsBlock: Sn,
|
|
6018
|
+
QuickStack: Jn,
|
|
6019
|
+
CollectionList: Yn,
|
|
6020
|
+
CollectionSearch: Xn,
|
|
6021
|
+
BreadcrumbsBlock: Zn,
|
|
6022
|
+
PaginationBlock: Qn,
|
|
6023
|
+
StepperBlock: hr,
|
|
6024
|
+
SocialLinksBlock: mr,
|
|
6025
|
+
ThemeModeBlock: rr,
|
|
6026
|
+
ScrollTopBlock: fr,
|
|
6027
|
+
CounterBlock: dr,
|
|
6028
|
+
OrgChartBlock: Dr,
|
|
6029
|
+
TableBlock: Nr,
|
|
6030
|
+
IconBlock: hn,
|
|
6031
|
+
MapBlock: pn,
|
|
6032
|
+
MasonryBlock: _n,
|
|
6033
|
+
AccordionBlock: Cn,
|
|
6034
|
+
NavbarBlock: xn,
|
|
6035
|
+
ListBlock: Lt,
|
|
6036
|
+
TextSpan: Dt,
|
|
6037
|
+
QuoteBlock: It,
|
|
6038
|
+
TextLink: Bt,
|
|
6039
|
+
RichTextBlock: Nt,
|
|
6040
|
+
RichContentBlock: Nt,
|
|
6041
|
+
VideoBlock: Ut,
|
|
6042
|
+
YouTubeBlock: Gt,
|
|
6043
|
+
IframeBlock: Kt,
|
|
6044
|
+
EmbedBlock: Yt,
|
|
6045
|
+
FormBlock: In,
|
|
6046
|
+
FormLabel: Vn,
|
|
6047
|
+
FormInput: Hn,
|
|
6048
|
+
FormTextarea: Un,
|
|
6049
|
+
FormCheckbox: (e) => /* @__PURE__ */ u(Wn, {
|
|
5724
6050
|
kind: "checkbox",
|
|
5725
6051
|
...e
|
|
5726
6052
|
}),
|
|
5727
|
-
FormRadio: (e) => /* @__PURE__ */ u(
|
|
6053
|
+
FormRadio: (e) => /* @__PURE__ */ u(Wn, {
|
|
5728
6054
|
kind: "radio",
|
|
5729
6055
|
...e
|
|
5730
6056
|
}),
|
|
5731
|
-
FormSelect:
|
|
5732
|
-
FormFile:
|
|
5733
|
-
FormRecaptcha:
|
|
5734
|
-
FormSubmit:
|
|
5735
|
-
},
|
|
6057
|
+
FormSelect: Gn,
|
|
6058
|
+
FormFile: Kn,
|
|
6059
|
+
FormRecaptcha: Bn,
|
|
6060
|
+
FormSubmit: qn
|
|
6061
|
+
}, Xr = {
|
|
5736
6062
|
id: "auth",
|
|
5737
6063
|
label: "Accounts",
|
|
5738
6064
|
category: "Apps",
|
|
5739
6065
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5740
6066
|
ssr: "shell",
|
|
5741
6067
|
settings: ["site.authRedirect"]
|
|
5742
|
-
},
|
|
6068
|
+
}, Zr = t({
|
|
5743
6069
|
user: null,
|
|
5744
6070
|
status: "idle",
|
|
5745
6071
|
ensure: () => {},
|
|
5746
6072
|
refresh: () => {},
|
|
5747
6073
|
signOut: () => {}
|
|
5748
6074
|
});
|
|
5749
|
-
function
|
|
6075
|
+
function Qr(e, t) {
|
|
5750
6076
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5751
6077
|
}
|
|
5752
|
-
function
|
|
6078
|
+
function $r(e) {
|
|
5753
6079
|
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);
|
|
5754
6080
|
return {
|
|
5755
6081
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5756
6082
|
url: i,
|
|
5757
6083
|
mePath: a,
|
|
5758
6084
|
logoutPath: o,
|
|
5759
|
-
meUrl:
|
|
5760
|
-
logoutUrl:
|
|
6085
|
+
meUrl: Qr(i, a),
|
|
6086
|
+
logoutUrl: Qr(i, o),
|
|
5761
6087
|
loginPage: r(n.loginPage),
|
|
5762
6088
|
userPath: r(n.userPath),
|
|
5763
6089
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5764
6090
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5765
6091
|
};
|
|
5766
6092
|
}
|
|
5767
|
-
function
|
|
6093
|
+
function ei(e, t) {
|
|
5768
6094
|
if (!t) return e ?? null;
|
|
5769
6095
|
let n = e;
|
|
5770
6096
|
for (let e of t.split(".")) {
|
|
@@ -5773,26 +6099,26 @@ function vr(e, t) {
|
|
|
5773
6099
|
}
|
|
5774
6100
|
return n ?? null;
|
|
5775
6101
|
}
|
|
5776
|
-
function
|
|
6102
|
+
function ti(e) {
|
|
5777
6103
|
try {
|
|
5778
6104
|
return window.localStorage.getItem(e) || "";
|
|
5779
6105
|
} catch {
|
|
5780
6106
|
return "";
|
|
5781
6107
|
}
|
|
5782
6108
|
}
|
|
5783
|
-
function
|
|
6109
|
+
function ni(e) {
|
|
5784
6110
|
try {
|
|
5785
6111
|
window.localStorage.removeItem(e);
|
|
5786
6112
|
} catch {}
|
|
5787
6113
|
}
|
|
5788
|
-
var
|
|
5789
|
-
let e = r(
|
|
6114
|
+
var ri = () => {
|
|
6115
|
+
let e = r(Zr);
|
|
5790
6116
|
return i(() => {
|
|
5791
6117
|
e.ensure();
|
|
5792
6118
|
}, [e]), e;
|
|
5793
6119
|
};
|
|
5794
|
-
function
|
|
5795
|
-
let f = r(
|
|
6120
|
+
function ii({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
|
|
6121
|
+
let f = r(Q), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => $r(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}`, {
|
|
5796
6122
|
...t,
|
|
5797
6123
|
credentials: "include",
|
|
5798
6124
|
headers: {
|
|
@@ -5804,9 +6130,9 @@ function Sr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5804
6130
|
if (a) return Promise.resolve(null);
|
|
5805
6131
|
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5806
6132
|
if (h.mode === "custom") {
|
|
5807
|
-
let e = h.auth === "bearer" ?
|
|
6133
|
+
let e = h.auth === "bearer" ? ti(h.tokenKey) : "";
|
|
5808
6134
|
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) => {
|
|
5809
|
-
let t =
|
|
6135
|
+
let t = ei(e, h.userPath);
|
|
5810
6136
|
return S(t && typeof t == "object" ? t : null);
|
|
5811
6137
|
}).catch(() => S(null));
|
|
5812
6138
|
}
|
|
@@ -5819,12 +6145,12 @@ function Sr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5819
6145
|
]), w = n(() => {
|
|
5820
6146
|
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5821
6147
|
if (h.mode === "custom") {
|
|
5822
|
-
let e = h.auth === "bearer" ?
|
|
6148
|
+
let e = h.auth === "bearer" ? ti(h.tokenKey) : "";
|
|
5823
6149
|
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5824
6150
|
method: "post",
|
|
5825
6151
|
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5826
6152
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5827
|
-
h.auth === "bearer" &&
|
|
6153
|
+
h.auth === "bearer" && ni(h.tokenKey), S(null);
|
|
5828
6154
|
});
|
|
5829
6155
|
}
|
|
5830
6156
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -5874,19 +6200,19 @@ function Sr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5874
6200
|
h.loginPage,
|
|
5875
6201
|
C,
|
|
5876
6202
|
w
|
|
5877
|
-
]), /* @__PURE__ */ u(
|
|
6203
|
+
]), /* @__PURE__ */ u(Zr.Provider, {
|
|
5878
6204
|
value: E,
|
|
5879
6205
|
children: e
|
|
5880
6206
|
});
|
|
5881
6207
|
}
|
|
5882
|
-
function
|
|
5883
|
-
let { status: n } =
|
|
6208
|
+
function ai({ when: e, children: t }) {
|
|
6209
|
+
let { status: n } = ri();
|
|
5884
6210
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5885
6211
|
}
|
|
5886
6212
|
//#endregion
|
|
5887
6213
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5888
|
-
function
|
|
5889
|
-
let { tenant: h, apiUrl: g, settings: _ } = r(
|
|
6214
|
+
function oi({ 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 }) {
|
|
6215
|
+
let { tenant: h, apiUrl: g, settings: _ } = r(Q), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
5890
6216
|
if (e.preventDefault(), f) return;
|
|
5891
6217
|
let n = new FormData(e.currentTarget);
|
|
5892
6218
|
C(!0), x("");
|
|
@@ -5934,20 +6260,20 @@ function wr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5934
6260
|
children: [
|
|
5935
6261
|
w ? /* @__PURE__ */ d("label", {
|
|
5936
6262
|
style: {
|
|
5937
|
-
...
|
|
6263
|
+
...Tn,
|
|
5938
6264
|
display: "grid",
|
|
5939
6265
|
gap: 6
|
|
5940
6266
|
},
|
|
5941
6267
|
children: [a, /* @__PURE__ */ u("input", {
|
|
5942
6268
|
name: "name",
|
|
5943
6269
|
type: "text",
|
|
5944
|
-
style:
|
|
5945
|
-
...
|
|
6270
|
+
style: En,
|
|
6271
|
+
...On(f)
|
|
5946
6272
|
})]
|
|
5947
6273
|
}) : null,
|
|
5948
6274
|
/* @__PURE__ */ d("label", {
|
|
5949
6275
|
style: {
|
|
5950
|
-
...
|
|
6276
|
+
...Tn,
|
|
5951
6277
|
display: "grid",
|
|
5952
6278
|
gap: 6
|
|
5953
6279
|
},
|
|
@@ -5955,13 +6281,13 @@ function wr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5955
6281
|
name: "email",
|
|
5956
6282
|
type: "email",
|
|
5957
6283
|
required: !f,
|
|
5958
|
-
style:
|
|
5959
|
-
...
|
|
6284
|
+
style: En,
|
|
6285
|
+
...On(f)
|
|
5960
6286
|
})]
|
|
5961
6287
|
}),
|
|
5962
6288
|
/* @__PURE__ */ d("label", {
|
|
5963
6289
|
style: {
|
|
5964
|
-
...
|
|
6290
|
+
...Tn,
|
|
5965
6291
|
display: "grid",
|
|
5966
6292
|
gap: 6
|
|
5967
6293
|
},
|
|
@@ -5969,15 +6295,15 @@ function wr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5969
6295
|
name: "password",
|
|
5970
6296
|
type: "password",
|
|
5971
6297
|
required: !f,
|
|
5972
|
-
style:
|
|
5973
|
-
...
|
|
6298
|
+
style: En,
|
|
6299
|
+
...On(f)
|
|
5974
6300
|
})]
|
|
5975
6301
|
}),
|
|
5976
6302
|
/* @__PURE__ */ u("button", {
|
|
5977
6303
|
type: f ? "button" : "submit",
|
|
5978
6304
|
disabled: S || void 0,
|
|
5979
6305
|
style: {
|
|
5980
|
-
...
|
|
6306
|
+
...mt,
|
|
5981
6307
|
border: 0,
|
|
5982
6308
|
padding: "10px 22px",
|
|
5983
6309
|
borderRadius: 8,
|
|
@@ -6009,8 +6335,8 @@ function wr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
6009
6335
|
]
|
|
6010
6336
|
});
|
|
6011
6337
|
}
|
|
6012
|
-
function
|
|
6013
|
-
let { user: c, status: l, signOut: f } =
|
|
6338
|
+
function si({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
6339
|
+
let { user: c, status: l, signOut: f } = ri(), p = a ? s || "user" : l, m = a ? {
|
|
6014
6340
|
name: "Ada Lovelace",
|
|
6015
6341
|
email: "ada@example.com"
|
|
6016
6342
|
} : c;
|
|
@@ -6031,7 +6357,7 @@ function Tr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
6031
6357
|
children: [
|
|
6032
6358
|
/* @__PURE__ */ d("span", {
|
|
6033
6359
|
style: {
|
|
6034
|
-
...
|
|
6360
|
+
...Tn,
|
|
6035
6361
|
fontWeight: 600
|
|
6036
6362
|
},
|
|
6037
6363
|
children: [
|
|
@@ -6042,7 +6368,7 @@ function Tr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
6042
6368
|
}),
|
|
6043
6369
|
n && m?.email ? /* @__PURE__ */ u("span", {
|
|
6044
6370
|
style: {
|
|
6045
|
-
...
|
|
6371
|
+
...Tn,
|
|
6046
6372
|
opacity: .7
|
|
6047
6373
|
},
|
|
6048
6374
|
children: m.email
|
|
@@ -6051,14 +6377,14 @@ function Tr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
6051
6377
|
type: "button",
|
|
6052
6378
|
onClick: a ? void 0 : f,
|
|
6053
6379
|
style: {
|
|
6054
|
-
...
|
|
6380
|
+
...mt,
|
|
6055
6381
|
border: 0,
|
|
6056
6382
|
padding: "8px 16px",
|
|
6057
6383
|
borderRadius: 8,
|
|
6058
6384
|
fontSize: 14,
|
|
6059
6385
|
cursor: a ? "default" : "pointer"
|
|
6060
6386
|
},
|
|
6061
|
-
...
|
|
6387
|
+
...On(a),
|
|
6062
6388
|
children: t
|
|
6063
6389
|
})
|
|
6064
6390
|
]
|
|
@@ -6075,40 +6401,40 @@ function Tr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
6075
6401
|
}
|
|
6076
6402
|
//#endregion
|
|
6077
6403
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
6078
|
-
var
|
|
6404
|
+
var ci = {
|
|
6079
6405
|
id: "consent",
|
|
6080
6406
|
label: "Cookie consent",
|
|
6081
6407
|
category: "Apps",
|
|
6082
6408
|
keys: ["CookieConsent"],
|
|
6083
6409
|
ssr: "shell",
|
|
6084
6410
|
settings: []
|
|
6085
|
-
},
|
|
6086
|
-
function
|
|
6411
|
+
}, li = "webim.cookie_consent";
|
|
6412
|
+
function ui() {
|
|
6087
6413
|
try {
|
|
6088
|
-
let e = window.localStorage.getItem(
|
|
6414
|
+
let e = window.localStorage.getItem(li), t = e ? JSON.parse(e) : null;
|
|
6089
6415
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
6090
6416
|
} catch {
|
|
6091
6417
|
return "";
|
|
6092
6418
|
}
|
|
6093
6419
|
}
|
|
6094
|
-
function
|
|
6420
|
+
function di(e) {
|
|
6095
6421
|
try {
|
|
6096
6422
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
6097
6423
|
} catch {}
|
|
6098
6424
|
}
|
|
6099
|
-
function
|
|
6425
|
+
function fi(e) {
|
|
6100
6426
|
try {
|
|
6101
|
-
window.localStorage.setItem(
|
|
6427
|
+
window.localStorage.setItem(li, JSON.stringify({
|
|
6102
6428
|
choice: e,
|
|
6103
6429
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
6104
6430
|
}));
|
|
6105
6431
|
} catch {}
|
|
6106
|
-
|
|
6432
|
+
di(e);
|
|
6107
6433
|
try {
|
|
6108
6434
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
6109
6435
|
} catch {}
|
|
6110
6436
|
}
|
|
6111
|
-
var
|
|
6437
|
+
var pi = {
|
|
6112
6438
|
bottom: {
|
|
6113
6439
|
left: 0,
|
|
6114
6440
|
right: 0,
|
|
@@ -6130,18 +6456,18 @@ var jr = {
|
|
|
6130
6456
|
maxWidth: 400
|
|
6131
6457
|
}
|
|
6132
6458
|
};
|
|
6133
|
-
function
|
|
6459
|
+
function mi({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
|
|
6134
6460
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
6135
6461
|
y(e), typeof m == "function" && m(e);
|
|
6136
6462
|
};
|
|
6137
6463
|
if (i(() => {
|
|
6138
6464
|
if (h) return;
|
|
6139
|
-
let e =
|
|
6140
|
-
e ?
|
|
6465
|
+
let e = ui();
|
|
6466
|
+
e ? di(e) : _(!0);
|
|
6141
6467
|
}, [h, v]), !g) return null;
|
|
6142
6468
|
let x = (e) => () => {
|
|
6143
|
-
h || (
|
|
6144
|
-
}, S =
|
|
6469
|
+
h || (fi(e), _(!1));
|
|
6470
|
+
}, S = pi[s] ?? pi.bottom, C = {
|
|
6145
6471
|
appearance: "none",
|
|
6146
6472
|
font: "inherit",
|
|
6147
6473
|
fontSize: 14,
|
|
@@ -6221,37 +6547,37 @@ function Mr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
6221
6547
|
}
|
|
6222
6548
|
//#endregion
|
|
6223
6549
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
6224
|
-
var
|
|
6550
|
+
var hi = {
|
|
6225
6551
|
id: "language",
|
|
6226
6552
|
label: "Language",
|
|
6227
6553
|
category: "Apps",
|
|
6228
6554
|
keys: ["SiteLanguagePicker"],
|
|
6229
6555
|
ssr: "prefetch",
|
|
6230
6556
|
settings: ["locales"]
|
|
6231
|
-
},
|
|
6557
|
+
}, gi = {
|
|
6232
6558
|
id: "search",
|
|
6233
6559
|
label: "Search",
|
|
6234
6560
|
category: "Apps",
|
|
6235
6561
|
keys: ["SiteSearch"],
|
|
6236
6562
|
ssr: "prefetch",
|
|
6237
6563
|
settings: []
|
|
6238
|
-
},
|
|
6239
|
-
function
|
|
6564
|
+
}, _i = 50, vi = 2e3;
|
|
6565
|
+
function yi() {
|
|
6240
6566
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
6241
6567
|
}
|
|
6242
|
-
function
|
|
6568
|
+
function bi(e, t) {
|
|
6243
6569
|
let n = e?.data ?? {}, r = [];
|
|
6244
6570
|
for (let e of Object.values(n)) {
|
|
6245
|
-
let t = e == null ? "" :
|
|
6246
|
-
if (t && r.push(t), r.join(" ").length >
|
|
6571
|
+
let t = e == null ? "" : ct(e);
|
|
6572
|
+
if (t && r.push(t), r.join(" ").length > vi) break;
|
|
6247
6573
|
}
|
|
6248
|
-
return r.join(" ").slice(0,
|
|
6574
|
+
return r.join(" ").slice(0, vi).toLocaleLowerCase(t || void 0);
|
|
6249
6575
|
}
|
|
6250
|
-
function
|
|
6251
|
-
let { tenant: b, apiUrl: x, locale: S } = r(
|
|
6576
|
+
function xi({ 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 }) {
|
|
6577
|
+
let { tenant: b, apiUrl: x, locale: S } = r(Q), [C, w] = c(() => yi()), [T, E] = c(() => yi()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
|
|
6252
6578
|
i(() => {
|
|
6253
6579
|
let e = () => {
|
|
6254
|
-
let e =
|
|
6580
|
+
let e = yi();
|
|
6255
6581
|
w(e), E(e);
|
|
6256
6582
|
};
|
|
6257
6583
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -6302,8 +6628,8 @@ function zr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6302
6628
|
});
|
|
6303
6629
|
}
|
|
6304
6630
|
else for (let t of e.rows) {
|
|
6305
|
-
if (!
|
|
6306
|
-
let n = t?.data ?? {}, r =
|
|
6631
|
+
if (!bi(t, S).includes(P)) continue;
|
|
6632
|
+
let n = t?.data ?? {}, r = ct(n.name) || "Untitled", i = ct(n.slug);
|
|
6307
6633
|
F.push({
|
|
6308
6634
|
key: `entry:${t.id}`,
|
|
6309
6635
|
title: r,
|
|
@@ -6311,7 +6637,7 @@ function zr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6311
6637
|
kind: "entry"
|
|
6312
6638
|
});
|
|
6313
6639
|
}
|
|
6314
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
6640
|
+
let I = F.slice(0, Math.min(Math.max(1, p), _i)), L = (e) => {
|
|
6315
6641
|
if (v) {
|
|
6316
6642
|
e.preventDefault(), w(T), j(!0);
|
|
6317
6643
|
return;
|
|
@@ -6393,7 +6719,7 @@ function zr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6393
6719
|
onChange: (e) => E(e.target.value),
|
|
6394
6720
|
onFocus: () => P && j(!0),
|
|
6395
6721
|
style: {
|
|
6396
|
-
...
|
|
6722
|
+
...En,
|
|
6397
6723
|
flexGrow: 1,
|
|
6398
6724
|
minWidth: 0
|
|
6399
6725
|
}
|
|
@@ -6451,21 +6777,21 @@ function zr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6451
6777
|
}
|
|
6452
6778
|
//#endregion
|
|
6453
6779
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
6454
|
-
function
|
|
6780
|
+
function Si(e) {
|
|
6455
6781
|
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());
|
|
6456
6782
|
return [...new Set(n.map((e) => e.trim()))];
|
|
6457
6783
|
}
|
|
6458
|
-
var
|
|
6459
|
-
function
|
|
6784
|
+
var Ci = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6785
|
+
function wi(e, t) {
|
|
6460
6786
|
let n = String(e ?? "").toUpperCase();
|
|
6461
6787
|
if (t === "code") return n;
|
|
6462
6788
|
let r = "";
|
|
6463
6789
|
try {
|
|
6464
|
-
r =
|
|
6790
|
+
r = Ci(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
6465
6791
|
} catch {}
|
|
6466
6792
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
6467
6793
|
}
|
|
6468
|
-
function
|
|
6794
|
+
function Ti(e, t) {
|
|
6469
6795
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
6470
6796
|
if (typeof window > "u") return n || "?";
|
|
6471
6797
|
try {
|
|
@@ -6475,8 +6801,8 @@ function Ur(e, t) {
|
|
|
6475
6801
|
return n || "/";
|
|
6476
6802
|
}
|
|
6477
6803
|
}
|
|
6478
|
-
function
|
|
6479
|
-
let c = r(
|
|
6804
|
+
function Ei({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
|
|
6805
|
+
let c = r(Q), l = Si(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
|
|
6480
6806
|
display: "inline-flex",
|
|
6481
6807
|
alignItems: "center",
|
|
6482
6808
|
gap: 8,
|
|
@@ -6511,7 +6837,7 @@ function Wr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6511
6837
|
style: { opacity: .4 },
|
|
6512
6838
|
children: n ?? "·"
|
|
6513
6839
|
}), /* @__PURE__ */ u("a", {
|
|
6514
|
-
href:
|
|
6840
|
+
href: Ti(e, e === f),
|
|
6515
6841
|
hrefLang: e,
|
|
6516
6842
|
"aria-current": e === p ? "true" : void 0,
|
|
6517
6843
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -6521,7 +6847,7 @@ function Wr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6521
6847
|
textDecoration: "none",
|
|
6522
6848
|
cursor: s ? "default" : "pointer"
|
|
6523
6849
|
},
|
|
6524
|
-
children:
|
|
6850
|
+
children: wi(e, t)
|
|
6525
6851
|
})]
|
|
6526
6852
|
}, e))]
|
|
6527
6853
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -6532,7 +6858,7 @@ function Wr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6532
6858
|
value: p,
|
|
6533
6859
|
onChange: s ? void 0 : (e) => {
|
|
6534
6860
|
let t = e.target.value;
|
|
6535
|
-
window.location.assign(
|
|
6861
|
+
window.location.assign(Ti(t, t === f));
|
|
6536
6862
|
},
|
|
6537
6863
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
6538
6864
|
style: {
|
|
@@ -6546,47 +6872,47 @@ function Wr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6546
6872
|
},
|
|
6547
6873
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
6548
6874
|
value: e,
|
|
6549
|
-
children:
|
|
6875
|
+
children: wi(e, t)
|
|
6550
6876
|
}, e))
|
|
6551
6877
|
})]
|
|
6552
6878
|
});
|
|
6553
6879
|
}
|
|
6554
6880
|
//#endregion
|
|
6555
6881
|
//#region ../ui/src/components/builder/apps/index.js
|
|
6556
|
-
var
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
],
|
|
6562
|
-
SiteLoginForm:
|
|
6563
|
-
SiteAccountMenu:
|
|
6564
|
-
SiteLanguagePicker:
|
|
6565
|
-
CookieConsent:
|
|
6566
|
-
SiteSearch:
|
|
6882
|
+
var Di = [
|
|
6883
|
+
Xr,
|
|
6884
|
+
hi,
|
|
6885
|
+
ci,
|
|
6886
|
+
gi
|
|
6887
|
+
], Oi = {
|
|
6888
|
+
SiteLoginForm: oi,
|
|
6889
|
+
SiteAccountMenu: si,
|
|
6890
|
+
SiteLanguagePicker: Ei,
|
|
6891
|
+
CookieConsent: mi,
|
|
6892
|
+
SiteSearch: xi
|
|
6567
6893
|
};
|
|
6568
|
-
new Set(
|
|
6894
|
+
new Set(Di.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
6569
6895
|
//#endregion
|
|
6570
6896
|
//#region ../ui/src/components/builder/three/runtime.js
|
|
6571
|
-
var
|
|
6897
|
+
var ki = "0.185.1", Ai = "4.2.0", ji = "https://cdn.jsdelivr.net/npm", Mi = `${ji}/three@${ki}/+esm`, Ni = `${ji}/@google/model-viewer@${Ai}/dist/model-viewer.min.js`, Pi = (e) => import(
|
|
6572
6898
|
/* @vite-ignore */
|
|
6573
6899
|
/* webpackIgnore: true */
|
|
6574
6900
|
e
|
|
6575
|
-
),
|
|
6576
|
-
function
|
|
6577
|
-
if (
|
|
6901
|
+
), Fi = /* @__PURE__ */ new Map();
|
|
6902
|
+
function Ii(e) {
|
|
6903
|
+
if (Fi.has(e)) return Fi.get(e);
|
|
6578
6904
|
if (typeof window > "u") return new Promise(() => {});
|
|
6579
|
-
let t =
|
|
6580
|
-
throw
|
|
6905
|
+
let t = Pi(e).catch((t) => {
|
|
6906
|
+
throw Fi.delete(e), t;
|
|
6581
6907
|
});
|
|
6582
|
-
return
|
|
6908
|
+
return Fi.set(e, t), t;
|
|
6583
6909
|
}
|
|
6584
|
-
var
|
|
6585
|
-
function
|
|
6586
|
-
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) :
|
|
6910
|
+
var Li = () => Ii(Mi), Ri = (e) => Ii(`${ji}/three@${ki}/examples/jsm/${e}/+esm`);
|
|
6911
|
+
function zi() {
|
|
6912
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Ii(Ni);
|
|
6587
6913
|
}
|
|
6588
|
-
var
|
|
6589
|
-
function
|
|
6914
|
+
var Bi = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Vi = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
6915
|
+
function Hi(e, t) {
|
|
6590
6916
|
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
6591
6917
|
n = requestAnimationFrame(o), i ||= e;
|
|
6592
6918
|
let a = r ? (e - r) / 1e3 : 0;
|
|
@@ -6605,7 +6931,7 @@ function oi(e, t) {
|
|
|
6605
6931
|
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
6606
6932
|
};
|
|
6607
6933
|
}
|
|
6608
|
-
function
|
|
6934
|
+
function Ui(e, t, n = {}) {
|
|
6609
6935
|
let r = {
|
|
6610
6936
|
radius: n.distance ?? 4,
|
|
6611
6937
|
polar: n.polar ?? Math.PI / 2.4,
|
|
@@ -6654,13 +6980,13 @@ function si(e, t, n = {}) {
|
|
|
6654
6980
|
}
|
|
6655
6981
|
//#endregion
|
|
6656
6982
|
//#region ../ui/src/components/builder/three/views.jsx
|
|
6657
|
-
var
|
|
6658
|
-
function
|
|
6983
|
+
var Wi = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Gi = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Ki = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, qi = (e) => typeof e == "string" && !!e.trim();
|
|
6984
|
+
function Ji({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
6659
6985
|
return /* @__PURE__ */ d("div", {
|
|
6660
6986
|
ref: r,
|
|
6661
6987
|
style: {
|
|
6662
6988
|
...A(i),
|
|
6663
|
-
minHeight:
|
|
6989
|
+
minHeight: Wi(n, 320),
|
|
6664
6990
|
display: "flex",
|
|
6665
6991
|
flexDirection: "column",
|
|
6666
6992
|
alignItems: "center",
|
|
@@ -6688,24 +7014,24 @@ function fi({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6688
7014
|
}) : null]
|
|
6689
7015
|
});
|
|
6690
7016
|
}
|
|
6691
|
-
function
|
|
7017
|
+
function Yi({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotateDelay: s, cameraControls: l, ar: d, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
|
|
6692
7018
|
let [y, b] = c(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = c(!1);
|
|
6693
7019
|
i(() => {
|
|
6694
7020
|
if (y || !e) return;
|
|
6695
7021
|
let t = !0;
|
|
6696
|
-
return
|
|
7022
|
+
return zi().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
6697
7023
|
t = !1;
|
|
6698
7024
|
};
|
|
6699
7025
|
}, [y, e]);
|
|
6700
7026
|
let C = {
|
|
6701
7027
|
display: "block",
|
|
6702
7028
|
width: "100%",
|
|
6703
|
-
minHeight:
|
|
6704
|
-
height:
|
|
7029
|
+
minHeight: Wi(r, 360),
|
|
7030
|
+
height: Wi(r, 360),
|
|
6705
7031
|
backgroundColor: a || "transparent",
|
|
6706
7032
|
...A(g)
|
|
6707
7033
|
};
|
|
6708
|
-
if (!e) return v ? /* @__PURE__ */ u(
|
|
7034
|
+
if (!e) return v ? /* @__PURE__ */ u(Ji, {
|
|
6709
7035
|
nodeRef: _,
|
|
6710
7036
|
style: g,
|
|
6711
7037
|
height: r,
|
|
@@ -6740,13 +7066,13 @@ function pi({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotate
|
|
|
6740
7066
|
poster: t || void 0,
|
|
6741
7067
|
style: C,
|
|
6742
7068
|
"camera-controls": w(!v && l !== !1),
|
|
6743
|
-
"auto-rotate": w(T && !
|
|
6744
|
-
"auto-rotate-delay": T ? String(
|
|
7069
|
+
"auto-rotate": w(T && !Bi()),
|
|
7070
|
+
"auto-rotate-delay": T ? String(Wi(s, 0)) : void 0,
|
|
6745
7071
|
"rotation-per-second": "18deg",
|
|
6746
7072
|
ar: w(!v && d === !0),
|
|
6747
7073
|
"ar-modes": "webxr scene-viewer quick-look",
|
|
6748
|
-
"shadow-intensity": String(
|
|
6749
|
-
exposure: String(
|
|
7074
|
+
"shadow-intensity": String(Gi(p, 100)),
|
|
7075
|
+
exposure: String(Gi(f, 100)),
|
|
6750
7076
|
"field-of-view": m ? `${Number(m)}deg` : void 0,
|
|
6751
7077
|
"environment-image": h && h !== "neutral" ? h : "neutral",
|
|
6752
7078
|
"interaction-prompt": v ? "none" : void 0,
|
|
@@ -6764,7 +7090,7 @@ function pi({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotate
|
|
|
6764
7090
|
}) : null
|
|
6765
7091
|
});
|
|
6766
7092
|
}
|
|
6767
|
-
var
|
|
7093
|
+
var Xi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), Zi = [
|
|
6768
7094
|
"precision highp float;",
|
|
6769
7095
|
"uniform vec2 u_res;",
|
|
6770
7096
|
"uniform float u_time;",
|
|
@@ -6787,7 +7113,7 @@ var mi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6787
7113
|
" return v;",
|
|
6788
7114
|
"}",
|
|
6789
7115
|
""
|
|
6790
|
-
].join("\n"),
|
|
7116
|
+
].join("\n"), Qi = {
|
|
6791
7117
|
gradient: [
|
|
6792
7118
|
"void main(){",
|
|
6793
7119
|
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
@@ -6839,7 +7165,7 @@ var mi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6839
7165
|
"}"
|
|
6840
7166
|
].join("\n")
|
|
6841
7167
|
};
|
|
6842
|
-
function
|
|
7168
|
+
function $i(e, t) {
|
|
6843
7169
|
let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
|
|
6844
7170
|
if (!n) return t;
|
|
6845
7171
|
let r = parseInt(n[1], 16);
|
|
@@ -6849,7 +7175,7 @@ function _i(e, t) {
|
|
|
6849
7175
|
(r & 255) / 255
|
|
6850
7176
|
];
|
|
6851
7177
|
}
|
|
6852
|
-
function
|
|
7178
|
+
function ea(e, t, n) {
|
|
6853
7179
|
let r = e.createShader(t);
|
|
6854
7180
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
6855
7181
|
let t = e.getShaderInfoLog(r);
|
|
@@ -6857,13 +7183,13 @@ function vi(e, t, n) {
|
|
|
6857
7183
|
}
|
|
6858
7184
|
return r;
|
|
6859
7185
|
}
|
|
6860
|
-
function
|
|
7186
|
+
function ta({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, scale: l, height: f, interactive: p, style: m, nodeRef: h, inert: g }) {
|
|
6861
7187
|
let _ = s(null), v = s(null), y = s(null), [b, x] = c("");
|
|
6862
7188
|
i(() => () => {
|
|
6863
7189
|
let e = y.current;
|
|
6864
7190
|
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
6865
7191
|
}, []);
|
|
6866
|
-
let S = typeof t == "string" && t.trim() ? t :
|
|
7192
|
+
let S = typeof t == "string" && t.trim() ? t : Qi[e] ?? Qi.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(a ?? ""), E = Gi(o, 100), D = Math.max(.05, Gi(l, 100));
|
|
6867
7193
|
return i(() => {
|
|
6868
7194
|
let e = _.current, t = v.current;
|
|
6869
7195
|
if (!e || !t) return;
|
|
@@ -6878,7 +7204,7 @@ function yi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6878
7204
|
}
|
|
6879
7205
|
let r = null;
|
|
6880
7206
|
try {
|
|
6881
|
-
let e =
|
|
7207
|
+
let e = ea(n, n.VERTEX_SHADER, Xi), t = ea(n, n.FRAGMENT_SHADER, Zi + S);
|
|
6882
7208
|
if (r = n.createProgram(), n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) throw Error(n.getProgramInfoLog(r) || "Link failed");
|
|
6883
7209
|
x("");
|
|
6884
7210
|
} catch (e) {
|
|
@@ -6914,28 +7240,28 @@ function yi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6914
7240
|
};
|
|
6915
7241
|
p !== !1 && t.addEventListener("pointermove", l);
|
|
6916
7242
|
let u = () => {
|
|
6917
|
-
let r =
|
|
7243
|
+
let r = Vi(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
6918
7244
|
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
6919
7245
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6920
7246
|
d?.observe(t), u();
|
|
6921
|
-
let f =
|
|
6922
|
-
a:
|
|
7247
|
+
let f = Bi(), m = {
|
|
7248
|
+
a: $i(C, [
|
|
6923
7249
|
.35,
|
|
6924
7250
|
.4,
|
|
6925
7251
|
.95
|
|
6926
7252
|
]),
|
|
6927
|
-
b:
|
|
7253
|
+
b: $i(w, [
|
|
6928
7254
|
.05,
|
|
6929
7255
|
.06,
|
|
6930
7256
|
.16
|
|
6931
7257
|
]),
|
|
6932
|
-
c:
|
|
7258
|
+
c: $i(T, [
|
|
6933
7259
|
.95,
|
|
6934
7260
|
.35,
|
|
6935
7261
|
.6
|
|
6936
7262
|
])
|
|
6937
7263
|
}, h = {};
|
|
6938
|
-
return h.stop =
|
|
7264
|
+
return h.stop = Hi(t, (t, r) => {
|
|
6939
7265
|
u(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (f ? 0 : r) * E), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, D), n.drawArrays(n.TRIANGLES, 0, 3), f && h.stop?.();
|
|
6940
7266
|
}), () => {
|
|
6941
7267
|
h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
|
|
@@ -6954,7 +7280,7 @@ function yi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6954
7280
|
},
|
|
6955
7281
|
style: {
|
|
6956
7282
|
position: "relative",
|
|
6957
|
-
minHeight:
|
|
7283
|
+
minHeight: Wi(f, 320),
|
|
6958
7284
|
overflow: "hidden",
|
|
6959
7285
|
...A(m)
|
|
6960
7286
|
},
|
|
@@ -6986,7 +7312,7 @@ function yi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6986
7312
|
}) : null]
|
|
6987
7313
|
});
|
|
6988
7314
|
}
|
|
6989
|
-
function
|
|
7315
|
+
function na(e, t) {
|
|
6990
7316
|
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
6991
7317
|
r.deleteAttribute("uv");
|
|
6992
7318
|
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
@@ -7002,23 +7328,23 @@ function bi(e, t) {
|
|
|
7002
7328
|
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
7003
7329
|
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
7004
7330
|
}
|
|
7005
|
-
var
|
|
7006
|
-
function
|
|
7007
|
-
if (
|
|
7008
|
-
let t =
|
|
7331
|
+
var ra = /* @__PURE__ */ new Map();
|
|
7332
|
+
function ia(e) {
|
|
7333
|
+
if (ra.has(e)) return ra.get(e);
|
|
7334
|
+
let t = Ri("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
|
|
7009
7335
|
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
7010
7336
|
})).catch((t) => {
|
|
7011
|
-
throw
|
|
7337
|
+
throw ra.delete(e), t;
|
|
7012
7338
|
});
|
|
7013
|
-
return
|
|
7339
|
+
return ra.set(e, t), t;
|
|
7014
7340
|
}
|
|
7015
|
-
function
|
|
7341
|
+
function aa(e, t) {
|
|
7016
7342
|
let n = new e.Box3().setFromObject(t);
|
|
7017
7343
|
if (n.isEmpty()) return t;
|
|
7018
7344
|
let r = n.getSize(new e.Vector3()), i = n.getCenter(new e.Vector3()), a = Math.max(r.x, r.y, r.z) || 1, o = new e.Group();
|
|
7019
7345
|
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
7020
7346
|
}
|
|
7021
|
-
var
|
|
7347
|
+
var oa = {
|
|
7022
7348
|
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
7023
7349
|
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
7024
7350
|
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
@@ -7027,50 +7353,50 @@ var wi = {
|
|
|
7027
7353
|
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
7028
7354
|
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
7029
7355
|
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
7030
|
-
},
|
|
7031
|
-
function
|
|
7032
|
-
let g = s(null), [_, v] = c(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = a !== !1 && !
|
|
7356
|
+
}, sa = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
7357
|
+
function ca({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: a, spinSpeed: o, controls: l, ground: d, height: f, style: p, nodeRef: m, inert: h }) {
|
|
7358
|
+
let g = s(null), [_, v] = c(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = a !== !1 && !Bi(), S = l !== !1 && !h;
|
|
7033
7359
|
return i(() => {
|
|
7034
7360
|
let e = g.current;
|
|
7035
7361
|
if (!e) return;
|
|
7036
7362
|
let i = !0, a = null;
|
|
7037
|
-
return
|
|
7363
|
+
return Li().then((s) => {
|
|
7038
7364
|
if (!i || !e) return;
|
|
7039
7365
|
let c = new s.WebGLRenderer({
|
|
7040
7366
|
antialias: !0,
|
|
7041
7367
|
alpha: !t
|
|
7042
7368
|
});
|
|
7043
|
-
c.setPixelRatio(
|
|
7369
|
+
c.setPixelRatio(Vi()), c.shadowMap.enabled = d !== !1, c.shadowMap.type = s.PCFSoftShadowMap, c.outputColorSpace = s.SRGBColorSpace, c.toneMapping = s.ACESFilmicToneMapping, c.domElement.style.display = "block", c.domElement.style.width = "100%", c.domElement.style.height = "100%", e.appendChild(c.domElement);
|
|
7044
7370
|
let l = new s.Scene();
|
|
7045
|
-
t && (l.background = new s.Color(t)), l.environment =
|
|
7046
|
-
let u = new s.PerspectiveCamera(
|
|
7047
|
-
distance:
|
|
7371
|
+
t && (l.background = new s.Color(t)), l.environment = na(s, c);
|
|
7372
|
+
let u = new s.PerspectiveCamera(sa(r, 45), 1, .1, 400), f = Ui(u, c.domElement, {
|
|
7373
|
+
distance: sa(n, 5),
|
|
7048
7374
|
enableZoom: S
|
|
7049
7375
|
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
7050
7376
|
p.position.set(4, 7, 5), p.castShadow = d !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, l.add(p, new s.AmbientLight(16777215, .35));
|
|
7051
7377
|
let m = [], h = new s.Group(), g = (e, t) => {
|
|
7052
|
-
let n =
|
|
7053
|
-
e.position.set(
|
|
7378
|
+
let n = sa(t.scale, 1);
|
|
7379
|
+
e.position.set(sa(t.x, 0), sa(t.y, 0), sa(t.z, 0)), e.rotation.set(Ki(t.rx), Ki(t.ry), Ki(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Ki(t.spin);
|
|
7054
7380
|
};
|
|
7055
7381
|
for (let e of y) {
|
|
7056
7382
|
if (e.shape === "model") {
|
|
7057
|
-
if (!
|
|
7383
|
+
if (!qi(e.src)) continue;
|
|
7058
7384
|
let t = new s.Group();
|
|
7059
|
-
g(t, e), h.add(t),
|
|
7385
|
+
g(t, e), h.add(t), ia(e.src).then((e) => {
|
|
7060
7386
|
if (!i) return;
|
|
7061
|
-
let n =
|
|
7387
|
+
let n = aa(s, e.clone(!0));
|
|
7062
7388
|
n.traverse((e) => {
|
|
7063
7389
|
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
7064
7390
|
}), t.add(n);
|
|
7065
7391
|
}, () => {});
|
|
7066
7392
|
continue;
|
|
7067
7393
|
}
|
|
7068
|
-
let t = (
|
|
7394
|
+
let t = (oa[e.shape] ?? oa.box)(s), n = new s.MeshStandardMaterial({
|
|
7069
7395
|
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
7070
|
-
metalness: Math.min(1, Math.max(0,
|
|
7071
|
-
roughness: Math.min(1, Math.max(0,
|
|
7072
|
-
transparent:
|
|
7073
|
-
opacity: Math.min(1, Math.max(0,
|
|
7396
|
+
metalness: Math.min(1, Math.max(0, Gi(e.metalness, 10))),
|
|
7397
|
+
roughness: Math.min(1, Math.max(0, Gi(e.roughness, 35))),
|
|
7398
|
+
transparent: Gi(e.opacity, 100) < 1,
|
|
7399
|
+
opacity: Math.min(1, Math.max(0, Gi(e.opacity, 100))),
|
|
7074
7400
|
flatShading: e.flat === !0,
|
|
7075
7401
|
wireframe: e.wireframe === !0,
|
|
7076
7402
|
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
@@ -7081,14 +7407,14 @@ function Ei({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7081
7407
|
let _ = null;
|
|
7082
7408
|
if (d !== !1) {
|
|
7083
7409
|
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
7084
|
-
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y =
|
|
7410
|
+
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = sa(d === !0 ? 0 : d, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
|
|
7085
7411
|
}
|
|
7086
7412
|
let v = () => {
|
|
7087
7413
|
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
7088
7414
|
c.setSize(t, n, !1), u.aspect = t / n, u.updateProjectionMatrix();
|
|
7089
7415
|
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
7090
7416
|
b?.observe(e), v();
|
|
7091
|
-
let C =
|
|
7417
|
+
let C = Ki(Number.isFinite(Number(o)) ? o : 20), w = Hi(e, (e) => {
|
|
7092
7418
|
f.autoSpin(x ? C : 0, e), f.update();
|
|
7093
7419
|
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
7094
7420
|
c.render(l, u);
|
|
@@ -7112,7 +7438,7 @@ function Ei({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7112
7438
|
o,
|
|
7113
7439
|
S,
|
|
7114
7440
|
d
|
|
7115
|
-
]), _ && h ? /* @__PURE__ */ u(
|
|
7441
|
+
]), _ && h ? /* @__PURE__ */ u(Ji, {
|
|
7116
7442
|
nodeRef: m,
|
|
7117
7443
|
style: p,
|
|
7118
7444
|
height: f,
|
|
@@ -7123,27 +7449,27 @@ function Ei({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7123
7449
|
g.current = e, typeof m == "function" && m(e);
|
|
7124
7450
|
},
|
|
7125
7451
|
style: {
|
|
7126
|
-
minHeight:
|
|
7127
|
-
height:
|
|
7452
|
+
minHeight: Wi(f, 380),
|
|
7453
|
+
height: Wi(f, 380),
|
|
7128
7454
|
overflow: "hidden",
|
|
7129
7455
|
touchAction: S ? "pan-y" : void 0,
|
|
7130
7456
|
...A(p)
|
|
7131
7457
|
}
|
|
7132
7458
|
});
|
|
7133
7459
|
}
|
|
7134
|
-
function
|
|
7460
|
+
function la({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o }) {
|
|
7135
7461
|
let l = s(null), [d, f] = c("");
|
|
7136
7462
|
return i(() => {
|
|
7137
7463
|
let t = l.current;
|
|
7138
7464
|
if (o || !t || typeof e != "string" || !e.trim()) return;
|
|
7139
7465
|
let r = !0, i = null;
|
|
7140
|
-
return
|
|
7466
|
+
return Li().then((a) => {
|
|
7141
7467
|
if (!r || !t) return;
|
|
7142
7468
|
let o = new a.WebGLRenderer({
|
|
7143
7469
|
antialias: !0,
|
|
7144
7470
|
alpha: !n
|
|
7145
7471
|
});
|
|
7146
|
-
o.setPixelRatio(
|
|
7472
|
+
o.setPixelRatio(Vi()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
7147
7473
|
let s = new a.Scene();
|
|
7148
7474
|
n && (s.background = new a.Color(n));
|
|
7149
7475
|
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
@@ -7166,7 +7492,7 @@ function Di({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7166
7492
|
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
7167
7493
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
7168
7494
|
d?.observe(t), u();
|
|
7169
|
-
let p = !1, m =
|
|
7495
|
+
let p = !1, m = Hi(t, (e, t) => {
|
|
7170
7496
|
if (!p && typeof l?.frame == "function") try {
|
|
7171
7497
|
l.frame(e, t);
|
|
7172
7498
|
} catch (e) {
|
|
@@ -7188,7 +7514,7 @@ function Di({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7188
7514
|
e,
|
|
7189
7515
|
o,
|
|
7190
7516
|
n
|
|
7191
|
-
]), o ? /* @__PURE__ */ u(
|
|
7517
|
+
]), o ? /* @__PURE__ */ u(Ji, {
|
|
7192
7518
|
nodeRef: a,
|
|
7193
7519
|
style: r,
|
|
7194
7520
|
height: t,
|
|
@@ -7199,8 +7525,8 @@ function Di({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7199
7525
|
l.current = e, typeof a == "function" && a(e);
|
|
7200
7526
|
},
|
|
7201
7527
|
style: {
|
|
7202
|
-
minHeight:
|
|
7203
|
-
height:
|
|
7528
|
+
minHeight: Wi(t, 380),
|
|
7529
|
+
height: Wi(t, 380),
|
|
7204
7530
|
overflow: "hidden",
|
|
7205
7531
|
position: "relative",
|
|
7206
7532
|
touchAction: "pan-y",
|
|
@@ -7223,40 +7549,40 @@ function Di({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7223
7549
|
}) : null
|
|
7224
7550
|
});
|
|
7225
7551
|
}
|
|
7226
|
-
var
|
|
7227
|
-
ModelViewerBlock:
|
|
7228
|
-
ShaderBlock:
|
|
7229
|
-
SceneBlock:
|
|
7230
|
-
ThreeCanvasBlock:
|
|
7231
|
-
},
|
|
7232
|
-
function
|
|
7233
|
-
if (
|
|
7552
|
+
var ua = {
|
|
7553
|
+
ModelViewerBlock: Yi,
|
|
7554
|
+
ShaderBlock: ta,
|
|
7555
|
+
SceneBlock: ca,
|
|
7556
|
+
ThreeCanvasBlock: la
|
|
7557
|
+
}, da = /* @__PURE__ */ new Map();
|
|
7558
|
+
function fa(e) {
|
|
7559
|
+
if (da.has(e)) return da.get(e);
|
|
7234
7560
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
7235
7561
|
/* @vite-ignore */
|
|
7236
7562
|
/* webpackIgnore: true */
|
|
7237
7563
|
t
|
|
7238
7564
|
).finally(() => URL.revokeObjectURL(t));
|
|
7239
|
-
return
|
|
7565
|
+
return da.set(e, n), n;
|
|
7240
7566
|
}
|
|
7241
|
-
function
|
|
7567
|
+
function pa(e) {
|
|
7242
7568
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
7243
7569
|
return n && typeof n == "object" ? n : {};
|
|
7244
7570
|
}
|
|
7245
7571
|
//#endregion
|
|
7246
7572
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
7247
|
-
async function
|
|
7248
|
-
let n = await
|
|
7573
|
+
async function ma(e, t) {
|
|
7574
|
+
let n = await fa(e);
|
|
7249
7575
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
7250
7576
|
}
|
|
7251
|
-
var
|
|
7577
|
+
var ha = {
|
|
7252
7578
|
padding: "10px 12px",
|
|
7253
7579
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
7254
7580
|
borderRadius: 8,
|
|
7255
7581
|
fontSize: 12,
|
|
7256
7582
|
opacity: .6
|
|
7257
7583
|
};
|
|
7258
|
-
function
|
|
7259
|
-
let c = r(
|
|
7584
|
+
function ga({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
7585
|
+
let c = r(Q), l = pa(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
7260
7586
|
tenant: c?.tenant ?? "",
|
|
7261
7587
|
apiUrl: c?.apiUrl ?? "/api",
|
|
7262
7588
|
locale: c?.locale ?? "",
|
|
@@ -7268,7 +7594,7 @@ function Pi({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7268
7594
|
let e = f.current;
|
|
7269
7595
|
if (!l?.code || !e) return;
|
|
7270
7596
|
let n = !0;
|
|
7271
|
-
return
|
|
7597
|
+
return ma(l.code, t).then((e) => {
|
|
7272
7598
|
if (!(!n || !e || !f.current)) {
|
|
7273
7599
|
p.current = e;
|
|
7274
7600
|
try {
|
|
@@ -7298,7 +7624,7 @@ function Pi({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7298
7624
|
}) : /* @__PURE__ */ d("div", {
|
|
7299
7625
|
ref: o,
|
|
7300
7626
|
style: {
|
|
7301
|
-
...
|
|
7627
|
+
...ha,
|
|
7302
7628
|
...A(a)
|
|
7303
7629
|
},
|
|
7304
7630
|
children: [
|
|
@@ -7310,13 +7636,13 @@ function Pi({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7310
7636
|
}
|
|
7311
7637
|
//#endregion
|
|
7312
7638
|
//#region ../ui/src/components/builder/render.jsx
|
|
7313
|
-
var
|
|
7314
|
-
...
|
|
7315
|
-
...Kr,
|
|
7639
|
+
var _a = {
|
|
7640
|
+
...Yr,
|
|
7316
7641
|
...Oi,
|
|
7317
|
-
|
|
7642
|
+
...ua,
|
|
7643
|
+
PluginBlock: ga
|
|
7318
7644
|
};
|
|
7319
|
-
function
|
|
7645
|
+
function va(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
7320
7646
|
let o = n[t];
|
|
7321
7647
|
if (!o || o.hidden) return null;
|
|
7322
7648
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -7324,11 +7650,11 @@ function Ii(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7324
7650
|
let n = o.props?.componentId, s = r?.[n];
|
|
7325
7651
|
if (!s?.template || i.has(n)) return null;
|
|
7326
7652
|
let c = new Set(i).add(n);
|
|
7327
|
-
return /* @__PURE__ */ u(e, { children:
|
|
7653
|
+
return /* @__PURE__ */ u(e, { children: va(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
7328
7654
|
}
|
|
7329
|
-
let l =
|
|
7655
|
+
let l = _a[s];
|
|
7330
7656
|
if (!l) return null;
|
|
7331
|
-
let d = (o.nodes ?? []).map((e) =>
|
|
7657
|
+
let d = (o.nodes ?? []).map((e) => va(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, va(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
7332
7658
|
...c,
|
|
7333
7659
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
7334
7660
|
linked: p,
|
|
@@ -7337,16 +7663,16 @@ function Ii(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7337
7663
|
},
|
|
7338
7664
|
children: d.length ? d : void 0
|
|
7339
7665
|
}, t);
|
|
7340
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
7666
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(ai, {
|
|
7341
7667
|
when: c.when,
|
|
7342
7668
|
children: m
|
|
7343
7669
|
}, t) : m;
|
|
7344
7670
|
}
|
|
7345
7671
|
//#endregion
|
|
7346
7672
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
7347
|
-
var
|
|
7348
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
7349
|
-
function
|
|
7673
|
+
var ya = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), ba = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(J(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
7674
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(J(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
7675
|
+
function xa({ 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 }) {
|
|
7350
7676
|
let b = s?.js?.trim();
|
|
7351
7677
|
if (i(() => {
|
|
7352
7678
|
if (!b) return;
|
|
@@ -7360,23 +7686,23 @@ function zi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7360
7686
|
minHeight: "100%",
|
|
7361
7687
|
display: "flex",
|
|
7362
7688
|
flexDirection: "column"
|
|
7363
|
-
}, w =
|
|
7689
|
+
}, w = va("ROOT", e, n), T = o(() => ({ render: (t, r) => va(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = W(e, n), O = ie(e, n), k = s?.css?.trim(), A = E(c), j = ue(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !se[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
|
|
7364
7690
|
rel: "stylesheet",
|
|
7365
7691
|
precedence: "default",
|
|
7366
7692
|
href: g(e)
|
|
7367
|
-
}, e)), P =
|
|
7368
|
-
return r === "auto" ? /* @__PURE__ */ u(
|
|
7693
|
+
}, e)), P = ba(j);
|
|
7694
|
+
return r === "auto" ? /* @__PURE__ */ u(Q.Provider, {
|
|
7369
7695
|
value: {
|
|
7370
7696
|
tenant: l || "",
|
|
7371
7697
|
apiUrl: f || "/api",
|
|
7372
7698
|
locale: m || "",
|
|
7373
7699
|
settings: _ ?? null
|
|
7374
7700
|
},
|
|
7375
|
-
children: /* @__PURE__ */ u(
|
|
7701
|
+
children: /* @__PURE__ */ u(ii, {
|
|
7376
7702
|
initialUser: v,
|
|
7377
|
-
children: /* @__PURE__ */ u(
|
|
7703
|
+
children: /* @__PURE__ */ u(et.Provider, {
|
|
7378
7704
|
value: p ?? null,
|
|
7379
|
-
children: /* @__PURE__ */ u(
|
|
7705
|
+
children: /* @__PURE__ */ u(it.Provider, {
|
|
7380
7706
|
value: T,
|
|
7381
7707
|
children: /* @__PURE__ */ d("div", {
|
|
7382
7708
|
...x,
|
|
@@ -7387,8 +7713,8 @@ function zi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7387
7713
|
...a
|
|
7388
7714
|
},
|
|
7389
7715
|
children: [
|
|
7390
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
7391
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
7716
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${ya(J(j.light))} }
|
|
7717
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${ya(J(j.dark))} } }` }),
|
|
7392
7718
|
/* @__PURE__ */ u("style", { children: P }),
|
|
7393
7719
|
N,
|
|
7394
7720
|
/* @__PURE__ */ u("style", { children: S }),
|
|
@@ -7401,18 +7727,18 @@ function zi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7401
7727
|
})
|
|
7402
7728
|
})
|
|
7403
7729
|
})
|
|
7404
|
-
}) : /* @__PURE__ */ u(
|
|
7730
|
+
}) : /* @__PURE__ */ u(Q.Provider, {
|
|
7405
7731
|
value: {
|
|
7406
7732
|
tenant: l || "",
|
|
7407
7733
|
apiUrl: f || "/api",
|
|
7408
7734
|
locale: m || "",
|
|
7409
7735
|
settings: _ ?? null
|
|
7410
7736
|
},
|
|
7411
|
-
children: /* @__PURE__ */ u(
|
|
7737
|
+
children: /* @__PURE__ */ u(ii, {
|
|
7412
7738
|
initialUser: v,
|
|
7413
|
-
children: /* @__PURE__ */ u(
|
|
7739
|
+
children: /* @__PURE__ */ u(et.Provider, {
|
|
7414
7740
|
value: p ?? null,
|
|
7415
|
-
children: /* @__PURE__ */ u(
|
|
7741
|
+
children: /* @__PURE__ */ u(it.Provider, {
|
|
7416
7742
|
value: T,
|
|
7417
7743
|
children: /* @__PURE__ */ d("div", {
|
|
7418
7744
|
...x,
|
|
@@ -7441,8 +7767,8 @@ function zi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7441
7767
|
}
|
|
7442
7768
|
//#endregion
|
|
7443
7769
|
//#region src/WebimContent.jsx
|
|
7444
|
-
function
|
|
7445
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
7770
|
+
function Sa({ bundle: e, mode: t = "auto", style: n }) {
|
|
7771
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(xa, {
|
|
7446
7772
|
blocks: e.blocks,
|
|
7447
7773
|
theme: e.theme,
|
|
7448
7774
|
components: e.components,
|
|
@@ -7460,7 +7786,7 @@ function Bi({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
7460
7786
|
}
|
|
7461
7787
|
//#endregion
|
|
7462
7788
|
//#region src/WebimPage.jsx
|
|
7463
|
-
function
|
|
7789
|
+
function Ca({ 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 }) {
|
|
7464
7790
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
7465
7791
|
onLoad: m,
|
|
7466
7792
|
onError: h
|
|
@@ -7497,11 +7823,11 @@ function Vi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
7497
7823
|
r,
|
|
7498
7824
|
a,
|
|
7499
7825
|
o
|
|
7500
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
7826
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Sa, {
|
|
7501
7827
|
bundle: g.bundle,
|
|
7502
7828
|
mode: l,
|
|
7503
7829
|
style: d
|
|
7504
7830
|
});
|
|
7505
7831
|
}
|
|
7506
7832
|
//#endregion
|
|
7507
|
-
export {
|
|
7833
|
+
export { xa as PageRenderer, Sa as WebimContent, Ca as WebimPage, ye as fetchPage, Mt as renderRichContent, he as resolveTheme };
|