webim-adapter 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +358 -293
- package/build/webim-embed.js +9 -9
- package/build/webim-ssr.js +363 -298
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -48,36 +48,36 @@ function h(e) {
|
|
|
48
48
|
color: j,
|
|
49
49
|
inset: M
|
|
50
50
|
})), N.length && (t.boxShadow = N.join(", "));
|
|
51
|
-
let P = (e) => e.type === "blur" ? `blur(${p(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters:
|
|
51
|
+
let P = (e) => e.type === "blur" ? `blur(${p(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: ee, filterBlur: L, filterGrayscale: te, filterBrightness: R, filterContrast: z, filterSaturate: ne } = t;
|
|
52
52
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
53
53
|
let B = F(I);
|
|
54
|
-
|
|
55
|
-
let re = F(
|
|
54
|
+
L !== void 0 && B.push(`blur(${p(L)})`), te !== void 0 && B.push(`grayscale(${te}%)`), R !== void 0 && B.push(`brightness(${R}%)`), z !== void 0 && B.push(`contrast(${z}%)`), ne !== void 0 && B.push(`saturate(${ne}%)`), B.length && (t.filter = B.join(" "));
|
|
55
|
+
let re = F(ee);
|
|
56
56
|
re.length && (t.backdropFilter = re.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
57
57
|
let { textStrokeWidth: ie, textStrokeColor: ae } = t;
|
|
58
58
|
delete t.textStrokeWidth, delete t.textStrokeColor, (ie !== void 0 || ae !== void 0) && (t.WebkitTextStroke = `${p(ie ?? 1)} ${ae || "currentColor"}`);
|
|
59
59
|
let { clipText: oe } = t;
|
|
60
60
|
delete t.clipText, oe && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
61
|
-
let { transitions: se, transitionDuration: V, transitionEasing: H, transitionProperty:
|
|
61
|
+
let { transitions: se, transitionDuration: V, transitionEasing: H, transitionProperty: U } = t, W = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
62
62
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
63
|
-
let
|
|
64
|
-
if (V !== void 0 &&
|
|
63
|
+
let G = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${W(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
64
|
+
if (V !== void 0 && G.push(`${U || "all"} ${W(V)} ${H || "ease"}`), G.length && (t.transition = G.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
65
65
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
66
66
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
67
67
|
}
|
|
68
68
|
delete t.backgroundVideo;
|
|
69
|
-
let { overlayColor:
|
|
70
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
71
|
-
let e = `color-mix(in srgb, ${
|
|
69
|
+
let { overlayColor: K, overlayOpacity: ce } = t;
|
|
70
|
+
if (delete t.overlayColor, delete t.overlayOpacity, K) {
|
|
71
|
+
let e = `color-mix(in srgb, ${K} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
72
72
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
73
73
|
}
|
|
74
74
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
75
|
-
let { backgroundLayers:
|
|
75
|
+
let { backgroundLayers: q } = t;
|
|
76
76
|
delete t.backgroundLayers;
|
|
77
|
-
let
|
|
78
|
-
if (
|
|
77
|
+
let le = (Array.isArray(q) ? q : []).filter((e) => e && e.on !== !1);
|
|
78
|
+
if (le.length) {
|
|
79
79
|
let e = [], n = [], r = [], i = [], a = [];
|
|
80
|
-
for (let t of
|
|
80
|
+
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");
|
|
81
81
|
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");
|
|
82
82
|
else {
|
|
83
83
|
if (!t.src) continue;
|
|
@@ -272,19 +272,19 @@ function I(e) {
|
|
|
272
272
|
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : M(t.headingFont, "inherit")
|
|
273
273
|
};
|
|
274
274
|
}
|
|
275
|
-
function
|
|
275
|
+
function ee(e, t = "light") {
|
|
276
276
|
let n = P(e);
|
|
277
277
|
return {
|
|
278
278
|
...I(e),
|
|
279
279
|
...F(n[t] ?? n.light)
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function L(e, t) {
|
|
283
283
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
284
284
|
}
|
|
285
285
|
//#endregion
|
|
286
286
|
//#region src/bundle.js
|
|
287
|
-
function
|
|
287
|
+
function te({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
288
288
|
let a = {
|
|
289
289
|
...t?.global ?? {},
|
|
290
290
|
...t?.tenant ?? {}
|
|
@@ -294,7 +294,7 @@ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
294
294
|
title: e.title,
|
|
295
295
|
slug: e.slug,
|
|
296
296
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
297
|
-
theme:
|
|
297
|
+
theme: L(o, a.builder_themes?.themes),
|
|
298
298
|
components: a.builder_components?.components ?? {},
|
|
299
299
|
custom: o.custom,
|
|
300
300
|
seo: o.seo,
|
|
@@ -308,29 +308,36 @@ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
308
308
|
}
|
|
309
309
|
//#endregion
|
|
310
310
|
//#region src/fetchPage.js
|
|
311
|
-
var
|
|
311
|
+
var R = async (e) => {
|
|
312
312
|
let t = await e.json().catch(() => null);
|
|
313
313
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
314
314
|
return t?.payload ?? t;
|
|
315
315
|
};
|
|
316
|
-
async function
|
|
316
|
+
async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
317
317
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
318
318
|
if (!n) throw Error("fetchPage: slug is required");
|
|
319
|
-
let
|
|
319
|
+
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
320
320
|
...t ? { "x-tenant": t } : {},
|
|
321
321
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
322
|
-
}, [
|
|
323
|
-
page:
|
|
324
|
-
settings:
|
|
322
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(R), c(`${l}/settings/public`, { headers: u }).then(R)]), p = te({
|
|
323
|
+
page: d,
|
|
324
|
+
settings: f,
|
|
325
325
|
tenant: t,
|
|
326
|
-
apiUrl:
|
|
326
|
+
apiUrl: l,
|
|
327
327
|
locale: r
|
|
328
|
-
}),
|
|
329
|
-
if (
|
|
330
|
-
let e = (e) => e.startsWith("api:") ? `${
|
|
331
|
-
|
|
328
|
+
}), m = [...new Set(Object.values(p.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
|
|
329
|
+
if (m.length) {
|
|
330
|
+
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(R).then((e) => {
|
|
331
|
+
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
332
|
+
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
333
|
+
}).catch(() => [[t, []]])));
|
|
334
|
+
p.datasets = Object.fromEntries(t.flat());
|
|
332
335
|
}
|
|
333
|
-
|
|
336
|
+
let h = Number(o);
|
|
337
|
+
return Number.isFinite(h) && h >= 1 && (p.datasets = {
|
|
338
|
+
...p.datasets ?? {},
|
|
339
|
+
__page: Math.floor(h)
|
|
340
|
+
}), p;
|
|
334
341
|
}
|
|
335
342
|
new Map([
|
|
336
343
|
{
|
|
@@ -479,11 +486,17 @@ var ae = /* @__PURE__ */ new Set([
|
|
|
479
486
|
apiUrl: "/api",
|
|
480
487
|
locale: "",
|
|
481
488
|
settings: null
|
|
482
|
-
}), H = t(null),
|
|
483
|
-
|
|
489
|
+
}), H = t(null), U = (e) => {
|
|
490
|
+
let t = Number(e?.__page);
|
|
491
|
+
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
492
|
+
if (typeof window > "u") return 1;
|
|
493
|
+
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
494
|
+
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
495
|
+
}, W = t(null), G = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
496
|
+
function K(e, t) {
|
|
484
497
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
485
498
|
}
|
|
486
|
-
var
|
|
499
|
+
var ce = (e) => {
|
|
487
500
|
let t = [];
|
|
488
501
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
489
502
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -493,36 +506,36 @@ var ue = (e) => {
|
|
|
493
506
|
}
|
|
494
507
|
return t;
|
|
495
508
|
};
|
|
496
|
-
function
|
|
509
|
+
function q(e) {
|
|
497
510
|
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
|
|
498
511
|
}
|
|
499
|
-
function
|
|
500
|
-
let n = t?.data ?? {}, r =
|
|
512
|
+
function le(e, t) {
|
|
513
|
+
let n = t?.data ?? {}, r = ce(n);
|
|
501
514
|
if (!r.length) return e;
|
|
502
|
-
let i = RegExp(`:(${r.map(
|
|
515
|
+
let i = RegExp(`:(${r.map(G).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => q(K(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
503
516
|
return a(e);
|
|
504
517
|
}
|
|
505
|
-
var
|
|
518
|
+
var ue = {
|
|
506
519
|
margin: 0,
|
|
507
520
|
fontWeight: 700,
|
|
508
521
|
lineHeight: 1.2,
|
|
509
522
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
510
|
-
},
|
|
523
|
+
}, de = { margin: 0 }, J = {
|
|
511
524
|
display: "inline-block",
|
|
512
525
|
textDecoration: "none",
|
|
513
526
|
cursor: "pointer",
|
|
514
527
|
backgroundColor: "var(--page-accent, #111827)",
|
|
515
528
|
color: "var(--page-accent-text, #ffffff)"
|
|
516
|
-
},
|
|
529
|
+
}, fe = {
|
|
517
530
|
flexGrow: 1,
|
|
518
531
|
display: "flex",
|
|
519
532
|
flexDirection: "column",
|
|
520
533
|
position: "relative"
|
|
521
|
-
},
|
|
534
|
+
}, pe = {
|
|
522
535
|
display: "flex",
|
|
523
536
|
flexDirection: "column"
|
|
524
537
|
};
|
|
525
|
-
function
|
|
538
|
+
function me({ style: e }) {
|
|
526
539
|
let t = e?.backgroundVideo;
|
|
527
540
|
if (!t) return null;
|
|
528
541
|
let n = {
|
|
@@ -548,7 +561,7 @@ function he({ style: e }) {
|
|
|
548
561
|
background: r
|
|
549
562
|
} })] });
|
|
550
563
|
}
|
|
551
|
-
var
|
|
564
|
+
var he = (e, t) => e?.backgroundVideo ? {
|
|
552
565
|
position: "relative",
|
|
553
566
|
...t,
|
|
554
567
|
...h(e)
|
|
@@ -556,24 +569,24 @@ var ge = (e, t) => e?.backgroundVideo ? {
|
|
|
556
569
|
...t,
|
|
557
570
|
...h(e)
|
|
558
571
|
};
|
|
559
|
-
function
|
|
572
|
+
function ge({ style: e, nodeRef: t, children: n }) {
|
|
560
573
|
return /* @__PURE__ */ d("div", {
|
|
561
574
|
ref: t,
|
|
562
575
|
style: {
|
|
563
|
-
...
|
|
576
|
+
...fe,
|
|
564
577
|
...h(e)
|
|
565
578
|
},
|
|
566
|
-
children: [/* @__PURE__ */ u(
|
|
579
|
+
children: [/* @__PURE__ */ u(me, { style: e }), n]
|
|
567
580
|
});
|
|
568
581
|
}
|
|
569
|
-
function
|
|
582
|
+
function _e({ style: e, nodeRef: t, children: n }) {
|
|
570
583
|
return /* @__PURE__ */ d("section", {
|
|
571
584
|
ref: t,
|
|
572
|
-
style:
|
|
573
|
-
children: [/* @__PURE__ */ u(
|
|
585
|
+
style: he(e, pe),
|
|
586
|
+
children: [/* @__PURE__ */ u(me, { style: e }), n]
|
|
574
587
|
});
|
|
575
588
|
}
|
|
576
|
-
function
|
|
589
|
+
function ve({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
577
590
|
let i = t ? {
|
|
578
591
|
position: "relative",
|
|
579
592
|
minHeight: 240
|
|
@@ -582,32 +595,32 @@ function ye({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
582
595
|
ref: n,
|
|
583
596
|
style: i ? {
|
|
584
597
|
...i,
|
|
585
|
-
...
|
|
586
|
-
} :
|
|
587
|
-
children: [/* @__PURE__ */ u(
|
|
598
|
+
...he(e)
|
|
599
|
+
} : he(e),
|
|
600
|
+
children: [/* @__PURE__ */ u(me, { style: e }), r]
|
|
588
601
|
});
|
|
589
602
|
}
|
|
590
|
-
function
|
|
603
|
+
function ye({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
591
604
|
return /* @__PURE__ */ u(n, {
|
|
592
605
|
ref: a,
|
|
593
606
|
style: {
|
|
594
|
-
...
|
|
607
|
+
...ue,
|
|
595
608
|
...h(r)
|
|
596
609
|
},
|
|
597
|
-
children:
|
|
610
|
+
children: Y(t, e, i)
|
|
598
611
|
});
|
|
599
612
|
}
|
|
600
|
-
var
|
|
613
|
+
var be = {
|
|
601
614
|
fontFamily: j.mono.value,
|
|
602
615
|
background: "rgba(148, 163, 184, 0.18)",
|
|
603
616
|
padding: "1px 5px",
|
|
604
617
|
borderRadius: 4,
|
|
605
618
|
fontSize: "0.9em"
|
|
606
619
|
};
|
|
607
|
-
function
|
|
620
|
+
function xe(e, t = [], n, r) {
|
|
608
621
|
let i = e;
|
|
609
622
|
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", {
|
|
610
|
-
style:
|
|
623
|
+
style: be,
|
|
611
624
|
children: i
|
|
612
625
|
})), 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", {
|
|
613
626
|
href: n,
|
|
@@ -617,13 +630,13 @@ function Se(e, t = [], n, r) {
|
|
|
617
630
|
children: i
|
|
618
631
|
})), i;
|
|
619
632
|
}
|
|
620
|
-
function
|
|
633
|
+
function Y(t, n, r) {
|
|
621
634
|
return t?.length ? t.map((t, n) => {
|
|
622
635
|
if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
|
|
623
|
-
if (t.parts) return /* @__PURE__ */ u(e, { children:
|
|
636
|
+
if (t.parts) return /* @__PURE__ */ u(e, { children: Y(t.parts, "", r) }, n);
|
|
624
637
|
let i = t.text;
|
|
625
638
|
return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
|
|
626
|
-
style:
|
|
639
|
+
style: be,
|
|
627
640
|
children: i
|
|
628
641
|
})), 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", {
|
|
629
642
|
style: {
|
|
@@ -640,13 +653,13 @@ function q(t, n, r) {
|
|
|
640
653
|
})), /* @__PURE__ */ u(e, { children: i }, n);
|
|
641
654
|
}) : n;
|
|
642
655
|
}
|
|
643
|
-
function
|
|
656
|
+
function Se({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
644
657
|
return /* @__PURE__ */ u("span", {
|
|
645
658
|
style: h(a),
|
|
646
|
-
children: e?.length ?
|
|
659
|
+
children: e?.length ? Y(e, t) : xe(t, n, r, i)
|
|
647
660
|
});
|
|
648
661
|
}
|
|
649
|
-
var
|
|
662
|
+
var Ce = {
|
|
650
663
|
h1: 40,
|
|
651
664
|
h2: 32,
|
|
652
665
|
h3: 26,
|
|
@@ -654,7 +667,7 @@ var we = {
|
|
|
654
667
|
h5: 19,
|
|
655
668
|
h6: 16
|
|
656
669
|
};
|
|
657
|
-
function
|
|
670
|
+
function we({ align: e = "center", width: t, wrap: n } = {}) {
|
|
658
671
|
let r = t ? `${t}%` : void 0;
|
|
659
672
|
if (e === "full") return { width: "100%" };
|
|
660
673
|
let i = e === "left" || e === "right";
|
|
@@ -688,8 +701,8 @@ function Te({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
688
701
|
marginRight: "auto"
|
|
689
702
|
};
|
|
690
703
|
}
|
|
691
|
-
function
|
|
692
|
-
let r = n ?? ((e, n) =>
|
|
704
|
+
function Te(e = [], t, n) {
|
|
705
|
+
let r = n ?? ((e, n) => Y(e, n, t));
|
|
693
706
|
return e.map((t, n) => {
|
|
694
707
|
let i = {
|
|
695
708
|
marginTop: 0,
|
|
@@ -711,7 +724,7 @@ function Ee(e = [], t, n) {
|
|
|
711
724
|
marginLeft: 0,
|
|
712
725
|
marginRight: 0,
|
|
713
726
|
...i,
|
|
714
|
-
...
|
|
727
|
+
...we(t)
|
|
715
728
|
},
|
|
716
729
|
children: [t.href ? /* @__PURE__ */ u("a", {
|
|
717
730
|
href: t.href,
|
|
@@ -730,16 +743,16 @@ function Ee(e = [], t, n) {
|
|
|
730
743
|
})]
|
|
731
744
|
}, n);
|
|
732
745
|
}
|
|
733
|
-
if (t.type === "video") return
|
|
746
|
+
if (t.type === "video") return Ie(t.url) ? /* @__PURE__ */ u("div", {
|
|
734
747
|
style: {
|
|
735
748
|
...i,
|
|
736
|
-
...
|
|
749
|
+
...we({
|
|
737
750
|
align: t.align,
|
|
738
751
|
wrap: t.wrap,
|
|
739
752
|
width: t.width ?? 100
|
|
740
753
|
})
|
|
741
754
|
},
|
|
742
|
-
children: /* @__PURE__ */ u(
|
|
755
|
+
children: /* @__PURE__ */ u(Le, {
|
|
743
756
|
url: t.url,
|
|
744
757
|
autoplay: t.autoplay,
|
|
745
758
|
muted: t.muted,
|
|
@@ -768,17 +781,17 @@ function Ee(e = [], t, n) {
|
|
|
768
781
|
}
|
|
769
782
|
if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
|
|
770
783
|
style: {
|
|
771
|
-
...
|
|
784
|
+
...De,
|
|
772
785
|
...i
|
|
773
786
|
},
|
|
774
787
|
children: r(t.parts, t.text)
|
|
775
788
|
}, n);
|
|
776
|
-
if (
|
|
789
|
+
if (Ce[t.type]) {
|
|
777
790
|
let e = t.type;
|
|
778
791
|
return /* @__PURE__ */ u(e, {
|
|
779
792
|
style: {
|
|
780
|
-
...
|
|
781
|
-
fontSize:
|
|
793
|
+
...ue,
|
|
794
|
+
fontSize: Ce[t.type],
|
|
782
795
|
...i
|
|
783
796
|
},
|
|
784
797
|
children: r(t.parts, t.text)
|
|
@@ -786,39 +799,39 @@ function Ee(e = [], t, n) {
|
|
|
786
799
|
}
|
|
787
800
|
return /* @__PURE__ */ u("p", {
|
|
788
801
|
style: {
|
|
789
|
-
...
|
|
802
|
+
...de,
|
|
790
803
|
...i
|
|
791
804
|
},
|
|
792
805
|
children: r(t.parts, t.text)
|
|
793
806
|
}, n);
|
|
794
807
|
});
|
|
795
808
|
}
|
|
796
|
-
function
|
|
809
|
+
function Ee({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
797
810
|
return /* @__PURE__ */ u("div", {
|
|
798
811
|
ref: r,
|
|
799
812
|
style: {
|
|
800
813
|
display: "flow-root",
|
|
801
814
|
...h(t)
|
|
802
815
|
},
|
|
803
|
-
children:
|
|
816
|
+
children: Te(e, n)
|
|
804
817
|
});
|
|
805
818
|
}
|
|
806
|
-
var
|
|
819
|
+
var De = {
|
|
807
820
|
margin: 0,
|
|
808
821
|
padding: "8px 0 8px 20px",
|
|
809
822
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
810
823
|
};
|
|
811
|
-
function
|
|
824
|
+
function Oe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
812
825
|
return /* @__PURE__ */ u("blockquote", {
|
|
813
826
|
ref: i,
|
|
814
827
|
style: {
|
|
815
|
-
...
|
|
828
|
+
...De,
|
|
816
829
|
...h(n)
|
|
817
830
|
},
|
|
818
|
-
children:
|
|
831
|
+
children: Y(t, e, r)
|
|
819
832
|
});
|
|
820
833
|
}
|
|
821
|
-
function
|
|
834
|
+
function ke({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
822
835
|
return /* @__PURE__ */ u(e ? "ol" : "ul", {
|
|
823
836
|
ref: r,
|
|
824
837
|
style: {
|
|
@@ -828,53 +841,53 @@ function Ae({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
828
841
|
},
|
|
829
842
|
children: t.map((e, t) => /* @__PURE__ */ u("li", {
|
|
830
843
|
style: { marginBottom: 4 },
|
|
831
|
-
children:
|
|
844
|
+
children: Y(e.parts, e.text)
|
|
832
845
|
}, t))
|
|
833
846
|
});
|
|
834
847
|
}
|
|
835
|
-
function
|
|
848
|
+
function Ae({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
836
849
|
return /* @__PURE__ */ u("p", {
|
|
837
850
|
ref: i,
|
|
838
851
|
style: {
|
|
839
|
-
...
|
|
852
|
+
...de,
|
|
840
853
|
...h(n)
|
|
841
854
|
},
|
|
842
|
-
children:
|
|
855
|
+
children: Y(t, e, r)
|
|
843
856
|
});
|
|
844
857
|
}
|
|
845
|
-
var
|
|
858
|
+
var je = {
|
|
846
859
|
color: "var(--page-accent, inherit)",
|
|
847
860
|
textDecoration: "underline",
|
|
848
861
|
textUnderlineOffset: 3,
|
|
849
862
|
cursor: "pointer"
|
|
850
863
|
};
|
|
851
|
-
function
|
|
864
|
+
function Me({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
852
865
|
return /* @__PURE__ */ u("a", {
|
|
853
866
|
ref: o,
|
|
854
867
|
href: n || "#",
|
|
855
868
|
target: r || void 0,
|
|
856
869
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
857
870
|
style: {
|
|
858
|
-
...
|
|
871
|
+
...je,
|
|
859
872
|
...h(i)
|
|
860
873
|
},
|
|
861
|
-
children:
|
|
874
|
+
children: Y(t, e, a)
|
|
862
875
|
});
|
|
863
876
|
}
|
|
864
|
-
function
|
|
877
|
+
function Ne({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
865
878
|
return /* @__PURE__ */ u("a", {
|
|
866
879
|
ref: o,
|
|
867
880
|
href: n || "#",
|
|
868
881
|
target: r || void 0,
|
|
869
882
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
870
883
|
style: {
|
|
871
|
-
...
|
|
884
|
+
...J,
|
|
872
885
|
...h(i)
|
|
873
886
|
},
|
|
874
|
-
children:
|
|
887
|
+
children: Y(t, e, a)
|
|
875
888
|
});
|
|
876
889
|
}
|
|
877
|
-
function
|
|
890
|
+
function Pe({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
878
891
|
return e ? /* @__PURE__ */ u("img", {
|
|
879
892
|
ref: r,
|
|
880
893
|
src: e,
|
|
@@ -886,7 +899,7 @@ function Fe({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
886
899
|
}
|
|
887
900
|
}) : null;
|
|
888
901
|
}
|
|
889
|
-
function
|
|
902
|
+
function Fe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
890
903
|
return e ? /* @__PURE__ */ u("video", {
|
|
891
904
|
ref: s,
|
|
892
905
|
src: e,
|
|
@@ -904,9 +917,9 @@ function Ie({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
904
917
|
}
|
|
905
918
|
}) : null;
|
|
906
919
|
}
|
|
907
|
-
var
|
|
908
|
-
function
|
|
909
|
-
let c =
|
|
920
|
+
var Ie = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
921
|
+
function Le({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
922
|
+
let c = Ie(e);
|
|
910
923
|
if (!c) return null;
|
|
911
924
|
let l = new URLSearchParams({ rel: "0" });
|
|
912
925
|
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", {
|
|
@@ -932,7 +945,7 @@ function Re({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
932
945
|
})
|
|
933
946
|
});
|
|
934
947
|
}
|
|
935
|
-
function
|
|
948
|
+
function Re({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
936
949
|
return e ? /* @__PURE__ */ u("iframe", {
|
|
937
950
|
ref: i,
|
|
938
951
|
src: e,
|
|
@@ -948,7 +961,7 @@ function ze({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
948
961
|
}
|
|
949
962
|
}) : null;
|
|
950
963
|
}
|
|
951
|
-
function
|
|
964
|
+
function ze({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
952
965
|
let [a, o] = c(null);
|
|
953
966
|
return i(() => {
|
|
954
967
|
a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
|
|
@@ -967,7 +980,7 @@ function Be({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
967
980
|
style: h(n)
|
|
968
981
|
});
|
|
969
982
|
}
|
|
970
|
-
function
|
|
983
|
+
function Be({ height: e, nodeRef: t }) {
|
|
971
984
|
return /* @__PURE__ */ u("div", {
|
|
972
985
|
ref: t,
|
|
973
986
|
style: {
|
|
@@ -977,7 +990,7 @@ function Ve({ height: e, nodeRef: t }) {
|
|
|
977
990
|
}
|
|
978
991
|
});
|
|
979
992
|
}
|
|
980
|
-
function
|
|
993
|
+
function Ve({ style: e, nodeRef: t }) {
|
|
981
994
|
return /* @__PURE__ */ u("div", {
|
|
982
995
|
ref: t,
|
|
983
996
|
style: {
|
|
@@ -988,7 +1001,7 @@ function He({ style: e, nodeRef: t }) {
|
|
|
988
1001
|
}
|
|
989
1002
|
});
|
|
990
1003
|
}
|
|
991
|
-
var
|
|
1004
|
+
var He = {
|
|
992
1005
|
position: "absolute",
|
|
993
1006
|
top: "50%",
|
|
994
1007
|
transform: "translateY(-50%)",
|
|
@@ -1005,7 +1018,7 @@ var Ue = {
|
|
|
1005
1018
|
alignItems: "center",
|
|
1006
1019
|
justifyContent: "center",
|
|
1007
1020
|
padding: 0
|
|
1008
|
-
},
|
|
1021
|
+
}, Ue = {
|
|
1009
1022
|
bottom: {
|
|
1010
1023
|
inset: "auto 0 0 0",
|
|
1011
1024
|
padding: "40px 24px 20px",
|
|
@@ -1024,8 +1037,8 @@ var Ue = {
|
|
|
1024
1037
|
padding: 24,
|
|
1025
1038
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1026
1039
|
}
|
|
1027
|
-
},
|
|
1028
|
-
function
|
|
1040
|
+
}, We = 48;
|
|
1041
|
+
function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
|
|
1029
1042
|
let [p, m] = c(0), [g, _] = c(!1), [v, y] = c(null), b = e ? Math.min(p, e - 1) : 0;
|
|
1030
1043
|
if (i(() => {
|
|
1031
1044
|
if (!n || g || v || e < 2) return;
|
|
@@ -1041,7 +1054,7 @@ function Ke({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1041
1054
|
let x = (t) => m((t + e) % e), S = () => {
|
|
1042
1055
|
if (!v) return;
|
|
1043
1056
|
let { dx: e } = v;
|
|
1044
|
-
y(null), e < -48 ? x(b + 1) : e >
|
|
1057
|
+
y(null), e < -48 ? x(b + 1) : e > We && x(b - 1);
|
|
1045
1058
|
};
|
|
1046
1059
|
return /* @__PURE__ */ d("div", {
|
|
1047
1060
|
ref: f,
|
|
@@ -1089,7 +1102,7 @@ function Ke({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1089
1102
|
type: "button",
|
|
1090
1103
|
"aria-label": "Previous slide",
|
|
1091
1104
|
style: {
|
|
1092
|
-
...
|
|
1105
|
+
...He,
|
|
1093
1106
|
left: 12
|
|
1094
1107
|
},
|
|
1095
1108
|
onClick: () => x(b - 1),
|
|
@@ -1099,7 +1112,7 @@ function Ke({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1099
1112
|
type: "button",
|
|
1100
1113
|
"aria-label": "Next slide",
|
|
1101
1114
|
style: {
|
|
1102
|
-
...
|
|
1115
|
+
...He,
|
|
1103
1116
|
right: 12
|
|
1104
1117
|
},
|
|
1105
1118
|
onClick: () => x(b + 1),
|
|
@@ -1133,7 +1146,7 @@ function Ke({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1133
1146
|
] })]
|
|
1134
1147
|
});
|
|
1135
1148
|
}
|
|
1136
|
-
var
|
|
1149
|
+
var Ke = (e, t) => ({
|
|
1137
1150
|
position: "absolute",
|
|
1138
1151
|
inset: 0,
|
|
1139
1152
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1141,18 +1154,18 @@ var qe = (e, t) => ({
|
|
|
1141
1154
|
backgroundSize: "cover",
|
|
1142
1155
|
backgroundPosition: "center"
|
|
1143
1156
|
});
|
|
1144
|
-
function
|
|
1145
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1157
|
+
function qe({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1158
|
+
return e.length ? /* @__PURE__ */ u(Ge, {
|
|
1146
1159
|
...r,
|
|
1147
1160
|
count: e.length,
|
|
1148
1161
|
renderSlide: (r) => {
|
|
1149
1162
|
let i = e[r];
|
|
1150
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1163
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ke(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
|
|
1151
1164
|
style: {
|
|
1152
1165
|
position: "absolute",
|
|
1153
1166
|
color: "#fff",
|
|
1154
1167
|
textAlign: n,
|
|
1155
|
-
...
|
|
1168
|
+
...Ue[t] ?? Ue.bottom
|
|
1156
1169
|
},
|
|
1157
1170
|
children: [i.title && /* @__PURE__ */ u("div", {
|
|
1158
1171
|
style: {
|
|
@@ -1172,13 +1185,13 @@ function Je({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1172
1185
|
}
|
|
1173
1186
|
}) : null;
|
|
1174
1187
|
}
|
|
1175
|
-
function
|
|
1176
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1188
|
+
function Je({ slides: e = [], linked: t, ...n }) {
|
|
1189
|
+
return e.length ? /* @__PURE__ */ u(Ge, {
|
|
1177
1190
|
...n,
|
|
1178
1191
|
count: e.length,
|
|
1179
1192
|
renderSlide: (n) => {
|
|
1180
1193
|
let r = e[n];
|
|
1181
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1194
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ke(r.image, r.color) }), /* @__PURE__ */ u("div", {
|
|
1182
1195
|
style: {
|
|
1183
1196
|
position: "absolute",
|
|
1184
1197
|
inset: 0,
|
|
@@ -1190,7 +1203,7 @@ function Ye({ slides: e = [], linked: t, ...n }) {
|
|
|
1190
1203
|
}
|
|
1191
1204
|
}) : null;
|
|
1192
1205
|
}
|
|
1193
|
-
var
|
|
1206
|
+
var Ye = {
|
|
1194
1207
|
color: "inherit",
|
|
1195
1208
|
textDecoration: "none",
|
|
1196
1209
|
fontSize: 14,
|
|
@@ -1212,7 +1225,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1212
1225
|
let w = p === "hamburger" || p === "auto" && v, T = (e, t) => /* @__PURE__ */ d("a", {
|
|
1213
1226
|
href: e.href || "#",
|
|
1214
1227
|
style: {
|
|
1215
|
-
...
|
|
1228
|
+
...Ye,
|
|
1216
1229
|
display: "block",
|
|
1217
1230
|
...t
|
|
1218
1231
|
},
|
|
@@ -1300,7 +1313,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1300
1313
|
let t = e.children ?? [];
|
|
1301
1314
|
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
1302
1315
|
href: e.href || "#",
|
|
1303
|
-
style:
|
|
1316
|
+
style: Ye,
|
|
1304
1317
|
children: e.label
|
|
1305
1318
|
}, e.key);
|
|
1306
1319
|
let n = e.type === "mega";
|
|
@@ -1314,7 +1327,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1314
1327
|
children: [/* @__PURE__ */ d("a", {
|
|
1315
1328
|
href: e.href || "#",
|
|
1316
1329
|
style: {
|
|
1317
|
-
...
|
|
1330
|
+
...Ye,
|
|
1318
1331
|
cursor: "pointer"
|
|
1319
1332
|
},
|
|
1320
1333
|
children: [
|
|
@@ -1375,7 +1388,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1375
1388
|
children: o.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
1376
1389
|
href: t.href || "#",
|
|
1377
1390
|
style: {
|
|
1378
|
-
...
|
|
1391
|
+
...Ye,
|
|
1379
1392
|
padding: "10px 4px",
|
|
1380
1393
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
1381
1394
|
opacity: 1
|
|
@@ -1487,11 +1500,11 @@ var et = {
|
|
|
1487
1500
|
display: "flex",
|
|
1488
1501
|
flexDirection: "column",
|
|
1489
1502
|
gap: "12px"
|
|
1490
|
-
},
|
|
1503
|
+
}, X = {
|
|
1491
1504
|
fontSize: "14px",
|
|
1492
1505
|
fontWeight: 500,
|
|
1493
1506
|
color: "var(--page-text, #111827)"
|
|
1494
|
-
},
|
|
1507
|
+
}, Z = {
|
|
1495
1508
|
padding: "10px 12px",
|
|
1496
1509
|
border: "1px solid #d1d5db",
|
|
1497
1510
|
borderRadius: "6px",
|
|
@@ -1507,7 +1520,7 @@ var et = {
|
|
|
1507
1520
|
gap: "8px",
|
|
1508
1521
|
fontSize: "14px",
|
|
1509
1522
|
color: "var(--page-text, #111827)"
|
|
1510
|
-
},
|
|
1523
|
+
}, Q = (e) => e ? {
|
|
1511
1524
|
readOnly: !0,
|
|
1512
1525
|
tabIndex: -1,
|
|
1513
1526
|
onMouseDown: (e) => e.preventDefault()
|
|
@@ -1550,7 +1563,7 @@ function at(e, t) {
|
|
|
1550
1563
|
function ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
1551
1564
|
let a = /* @__PURE__ */ d("span", {
|
|
1552
1565
|
style: {
|
|
1553
|
-
...
|
|
1566
|
+
...X,
|
|
1554
1567
|
fontSize: 14
|
|
1555
1568
|
},
|
|
1556
1569
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -1588,7 +1601,7 @@ function ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1588
1601
|
borderRadius: 8,
|
|
1589
1602
|
display: "block"
|
|
1590
1603
|
}
|
|
1591
|
-
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(
|
|
1604
|
+
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Le, {
|
|
1592
1605
|
url: e.src,
|
|
1593
1606
|
style: { width: "100%" }
|
|
1594
1607
|
}) : /* @__PURE__ */ u("video", {
|
|
@@ -1688,10 +1701,10 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1688
1701
|
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || nt(e.section.condition, E)).map((e) => ({
|
|
1689
1702
|
...e,
|
|
1690
1703
|
fields: e.fields.filter((e) => nt(e.condition, E))
|
|
1691
|
-
})), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields),
|
|
1704
|
+
})), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), ee = I.filter((e) => {
|
|
1692
1705
|
let t = E[e.name];
|
|
1693
1706
|
return e.required && (t == null || t === "" || t === !1);
|
|
1694
|
-
}),
|
|
1707
|
+
}), L = F >= N.length - 1, te = (e, t) => D((n) => {
|
|
1695
1708
|
let r = {
|
|
1696
1709
|
...n,
|
|
1697
1710
|
[e]: t
|
|
@@ -1766,7 +1779,7 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1766
1779
|
field: e,
|
|
1767
1780
|
value: E[e.name],
|
|
1768
1781
|
values: E,
|
|
1769
|
-
onChange:
|
|
1782
|
+
onChange: te,
|
|
1770
1783
|
inert: g
|
|
1771
1784
|
}, e.name)),
|
|
1772
1785
|
/* @__PURE__ */ d("div", {
|
|
@@ -1781,7 +1794,7 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1781
1794
|
disabled: g || void 0,
|
|
1782
1795
|
onClick: () => k(F - 1),
|
|
1783
1796
|
style: {
|
|
1784
|
-
...
|
|
1797
|
+
...J,
|
|
1785
1798
|
background: "transparent",
|
|
1786
1799
|
color: "inherit",
|
|
1787
1800
|
border: 0,
|
|
@@ -1789,26 +1802,26 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1789
1802
|
cursor: "pointer"
|
|
1790
1803
|
},
|
|
1791
1804
|
children: "Back"
|
|
1792
|
-
}), P && !
|
|
1805
|
+
}), P && !L ? /* @__PURE__ */ u("button", {
|
|
1793
1806
|
type: "button",
|
|
1794
|
-
disabled: g ||
|
|
1807
|
+
disabled: g || ee.length > 0,
|
|
1795
1808
|
onClick: () => k(F + 1),
|
|
1796
1809
|
style: {
|
|
1797
|
-
...
|
|
1810
|
+
...J,
|
|
1798
1811
|
border: 0,
|
|
1799
1812
|
padding: "10px 22px",
|
|
1800
1813
|
borderRadius: 8,
|
|
1801
1814
|
fontSize: 15,
|
|
1802
1815
|
fontWeight: 600,
|
|
1803
1816
|
cursor: "pointer",
|
|
1804
|
-
opacity:
|
|
1817
|
+
opacity: ee.length ? .5 : 1
|
|
1805
1818
|
},
|
|
1806
1819
|
children: "Next"
|
|
1807
1820
|
}) : /* @__PURE__ */ u("button", {
|
|
1808
1821
|
type: "submit",
|
|
1809
1822
|
disabled: g || void 0,
|
|
1810
1823
|
style: {
|
|
1811
|
-
...
|
|
1824
|
+
...J,
|
|
1812
1825
|
border: 0,
|
|
1813
1826
|
padding: "10px 22px",
|
|
1814
1827
|
borderRadius: 8,
|
|
@@ -1929,10 +1942,10 @@ function dt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
|
1929
1942
|
return /* @__PURE__ */ u("label", {
|
|
1930
1943
|
ref: r,
|
|
1931
1944
|
style: {
|
|
1932
|
-
...
|
|
1945
|
+
...X,
|
|
1933
1946
|
...h(n)
|
|
1934
1947
|
},
|
|
1935
|
-
children:
|
|
1948
|
+
children: Y(t, e, i)
|
|
1936
1949
|
});
|
|
1937
1950
|
}
|
|
1938
1951
|
function ft({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
@@ -1943,10 +1956,10 @@ function ft({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
1943
1956
|
placeholder: n,
|
|
1944
1957
|
required: !o && !!r,
|
|
1945
1958
|
style: {
|
|
1946
|
-
...
|
|
1959
|
+
...Z,
|
|
1947
1960
|
...h(i)
|
|
1948
1961
|
},
|
|
1949
|
-
...
|
|
1962
|
+
...Q(o)
|
|
1950
1963
|
});
|
|
1951
1964
|
}
|
|
1952
1965
|
function pt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
@@ -1957,11 +1970,11 @@ function pt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
1957
1970
|
rows: n,
|
|
1958
1971
|
required: !o && !!r,
|
|
1959
1972
|
style: {
|
|
1960
|
-
...
|
|
1973
|
+
...Z,
|
|
1961
1974
|
resize: "vertical",
|
|
1962
1975
|
...h(i)
|
|
1963
1976
|
},
|
|
1964
|
-
...
|
|
1977
|
+
...Q(o)
|
|
1965
1978
|
});
|
|
1966
1979
|
}
|
|
1967
1980
|
function mt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
@@ -1994,7 +2007,7 @@ function ht({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
1994
2007
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
1995
2008
|
tabIndex: o ? -1 : void 0,
|
|
1996
2009
|
style: {
|
|
1997
|
-
...
|
|
2010
|
+
...Z,
|
|
1998
2011
|
appearance: "auto",
|
|
1999
2012
|
...h(i)
|
|
2000
2013
|
},
|
|
@@ -2013,7 +2026,7 @@ function gt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
2013
2026
|
return /* @__PURE__ */ d("label", {
|
|
2014
2027
|
ref: a,
|
|
2015
2028
|
style: {
|
|
2016
|
-
...
|
|
2029
|
+
...Z,
|
|
2017
2030
|
display: "flex",
|
|
2018
2031
|
alignItems: "center",
|
|
2019
2032
|
gap: "8px",
|
|
@@ -2045,7 +2058,7 @@ function _t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2045
2058
|
ref: n,
|
|
2046
2059
|
type: r ? "button" : "submit",
|
|
2047
2060
|
style: {
|
|
2048
|
-
...
|
|
2061
|
+
...J,
|
|
2049
2062
|
border: 0,
|
|
2050
2063
|
cursor: "pointer",
|
|
2051
2064
|
alignSelf: "flex-start",
|
|
@@ -2077,53 +2090,61 @@ function vt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2077
2090
|
}, t))
|
|
2078
2091
|
});
|
|
2079
2092
|
}
|
|
2080
|
-
function yt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p,
|
|
2081
|
-
let { tenant:
|
|
2093
|
+
function yt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, style: g, nodeRef: _ }) {
|
|
2094
|
+
let { tenant: v, apiUrl: y, locale: b } = r(V), x = r(W), S = r(H), C = S?.[e], w = m ? U(S) : 1, [T, E] = c(null);
|
|
2082
2095
|
if (i(() => {
|
|
2083
|
-
if (!e ||
|
|
2084
|
-
let
|
|
2085
|
-
|
|
2086
|
-
let
|
|
2087
|
-
|
|
2088
|
-
}
|
|
2089
|
-
|
|
2096
|
+
if (!e || C) return;
|
|
2097
|
+
let n = !0, r = new URLSearchParams();
|
|
2098
|
+
if (b && r.set("locale", b), m && !e.startsWith("api:")) {
|
|
2099
|
+
let e = Math.max(1, Number(t) || 6);
|
|
2100
|
+
r.set("offset", String((w - 1) * e)), r.set("limit", String(e));
|
|
2101
|
+
}
|
|
2102
|
+
let i = r.toString(), a = e.startsWith("api:") ? `${y}/data/${encodeURIComponent(e.slice(4))}` : `${y}/dynamic/${encodeURIComponent(e)}${i ? `?${i}` : ""}`;
|
|
2103
|
+
return fetch(a, { headers: v ? { "x-tenant": v } : {} }).then((e) => e.json()).then((e) => {
|
|
2104
|
+
let t = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
|
|
2105
|
+
return n && E(t.filter((e) => e && typeof e == "object"));
|
|
2106
|
+
}).catch(() => n && E([])), () => {
|
|
2107
|
+
n = !1;
|
|
2090
2108
|
};
|
|
2091
2109
|
}, [
|
|
2092
2110
|
e,
|
|
2093
|
-
_,
|
|
2094
2111
|
v,
|
|
2095
2112
|
y,
|
|
2096
|
-
|
|
2113
|
+
b,
|
|
2114
|
+
C,
|
|
2115
|
+
m,
|
|
2116
|
+
w,
|
|
2117
|
+
t
|
|
2097
2118
|
]), !e) return null;
|
|
2098
|
-
let
|
|
2119
|
+
let D = Math.max(1, Number(t) || 6), O = m ? C || e.startsWith("api:") ? (C ?? T ?? []).slice((w - 1) * D, w * D) : (T ?? []).slice(0, D) : (C ?? T ?? []).slice(0, D), k = Math.min(Math.max(Number(a) || 3, 1), 6), A = n === "list" ? {
|
|
2099
2120
|
display: "flex",
|
|
2100
2121
|
flexDirection: "column",
|
|
2101
2122
|
gap: 20
|
|
2102
2123
|
} : {
|
|
2103
2124
|
display: "grid",
|
|
2104
|
-
gridTemplateColumns: `repeat(${
|
|
2125
|
+
gridTemplateColumns: `repeat(${k}, minmax(0, 1fr))`,
|
|
2105
2126
|
gap: 24
|
|
2106
2127
|
};
|
|
2107
|
-
return f && p &&
|
|
2108
|
-
ref:
|
|
2128
|
+
return f && p && x?.render ? /* @__PURE__ */ u("div", {
|
|
2129
|
+
ref: _,
|
|
2109
2130
|
style: {
|
|
2110
2131
|
width: "100%",
|
|
2111
|
-
...
|
|
2112
|
-
...h(
|
|
2132
|
+
...A,
|
|
2133
|
+
...h(g)
|
|
2113
2134
|
},
|
|
2114
|
-
children:
|
|
2135
|
+
children: O.map((e) => /* @__PURE__ */ u("div", {
|
|
2115
2136
|
style: { minWidth: 0 },
|
|
2116
|
-
children:
|
|
2137
|
+
children: x.render(p, (t) => le(t, e))
|
|
2117
2138
|
}, e.id ?? e?.data?.slug))
|
|
2118
2139
|
}) : /* @__PURE__ */ u("div", {
|
|
2119
|
-
ref:
|
|
2140
|
+
ref: _,
|
|
2120
2141
|
style: {
|
|
2121
2142
|
width: "100%",
|
|
2122
|
-
...
|
|
2123
|
-
...h(
|
|
2143
|
+
...A,
|
|
2144
|
+
...h(g)
|
|
2124
2145
|
},
|
|
2125
|
-
children:
|
|
2126
|
-
let t = o ?
|
|
2146
|
+
children: O.map((e) => {
|
|
2147
|
+
let t = o ? K(e?.data, o) : null, r = s ? q(K(e?.data, s)) : null, i = l ? K(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : q(i), f = n === "list";
|
|
2127
2148
|
return /* @__PURE__ */ d("div", {
|
|
2128
2149
|
style: {
|
|
2129
2150
|
display: "flex",
|
|
@@ -2170,7 +2191,7 @@ function yt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2170
2191
|
lineHeight: 1.55,
|
|
2171
2192
|
opacity: .85
|
|
2172
2193
|
},
|
|
2173
|
-
children:
|
|
2194
|
+
children: Te(a)
|
|
2174
2195
|
})
|
|
2175
2196
|
]
|
|
2176
2197
|
})]
|
|
@@ -2228,8 +2249,36 @@ function bt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2228
2249
|
})
|
|
2229
2250
|
}) : null;
|
|
2230
2251
|
}
|
|
2231
|
-
function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href:
|
|
2232
|
-
let
|
|
2252
|
+
function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, style: f, nodeRef: p }) {
|
|
2253
|
+
let { tenant: m, apiUrl: g } = r(V), _ = r(H), [v, y] = c(null), b = o ? Number(_?.[`${o}:total`]) : NaN;
|
|
2254
|
+
i(() => {
|
|
2255
|
+
if (!o || Number.isFinite(b)) return;
|
|
2256
|
+
let e = !0, t = o.startsWith("api:") ? `${g}/data/${encodeURIComponent(o.slice(4))}` : `${g}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
2257
|
+
return fetch(t, { headers: m ? { "x-tenant": m } : {} }).then((e) => e.json()).then((t) => {
|
|
2258
|
+
if (!e) return;
|
|
2259
|
+
let n = t?.payload, r = Array.isArray(n) ? n.length : Number(n?.total?.filtered ?? n?.total?.all ?? (Array.isArray(n?.data) ? n.data.length : 0));
|
|
2260
|
+
y(Number.isFinite(r) ? r : 0);
|
|
2261
|
+
}).catch(() => e && y(0)), () => {
|
|
2262
|
+
e = !1;
|
|
2263
|
+
};
|
|
2264
|
+
}, [
|
|
2265
|
+
o,
|
|
2266
|
+
m,
|
|
2267
|
+
g,
|
|
2268
|
+
b
|
|
2269
|
+
]);
|
|
2270
|
+
let x = Math.max(1, Number(s) || 6), S = Number.isFinite(b) ? b : v;
|
|
2271
|
+
if (o && S === null) return null;
|
|
2272
|
+
let C = Math.min(Math.max(o ? Math.ceil(S / x) : Number(e) || 1, 1), 50), w = Math.min(Math.max(o ? U(_) : Number(t) || 1, 1), C), T = (e) => {
|
|
2273
|
+
if (o) {
|
|
2274
|
+
if (typeof window < "u") {
|
|
2275
|
+
let t = new URLSearchParams(window.location.search);
|
|
2276
|
+
return t.set("page", String(e)), `?${t.toString()}`;
|
|
2277
|
+
}
|
|
2278
|
+
return `?page=${e}`;
|
|
2279
|
+
}
|
|
2280
|
+
return a && a !== "#" ? a.replace("{page}", String(e)) : "#";
|
|
2281
|
+
}, E = l === "center" ? "center" : l === "right" ? "flex-end" : "flex-start", D = (e) => ({
|
|
2233
2282
|
display: "inline-flex",
|
|
2234
2283
|
alignItems: "center",
|
|
2235
2284
|
justifyContent: "center",
|
|
@@ -2244,37 +2293,38 @@ function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2244
2293
|
border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
|
|
2245
2294
|
});
|
|
2246
2295
|
return /* @__PURE__ */ d("nav", {
|
|
2247
|
-
ref:
|
|
2296
|
+
ref: p,
|
|
2248
2297
|
"aria-label": "Pagination",
|
|
2249
2298
|
style: {
|
|
2250
2299
|
display: "flex",
|
|
2251
2300
|
flexWrap: "wrap",
|
|
2252
2301
|
gap: 8,
|
|
2253
2302
|
alignItems: "center",
|
|
2254
|
-
|
|
2303
|
+
justifyContent: E,
|
|
2304
|
+
...h(f)
|
|
2255
2305
|
},
|
|
2256
2306
|
children: [
|
|
2257
2307
|
n && /* @__PURE__ */ u("a", {
|
|
2258
|
-
href:
|
|
2308
|
+
href: w > 1 ? T(w - 1) : "#",
|
|
2259
2309
|
"aria-label": "Previous",
|
|
2260
2310
|
style: {
|
|
2261
|
-
...
|
|
2262
|
-
opacity:
|
|
2311
|
+
...D(!1),
|
|
2312
|
+
opacity: w > 1 ? 1 : .4
|
|
2263
2313
|
},
|
|
2264
2314
|
children: "‹"
|
|
2265
2315
|
}),
|
|
2266
|
-
Array.from({ length:
|
|
2267
|
-
href:
|
|
2268
|
-
"aria-current": e ===
|
|
2269
|
-
style:
|
|
2316
|
+
Array.from({ length: C }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
|
|
2317
|
+
href: T(e),
|
|
2318
|
+
"aria-current": e === w ? "page" : void 0,
|
|
2319
|
+
style: D(e === w),
|
|
2270
2320
|
children: e
|
|
2271
2321
|
}, e)),
|
|
2272
2322
|
n && /* @__PURE__ */ u("a", {
|
|
2273
|
-
href:
|
|
2323
|
+
href: w < C ? T(w + 1) : "#",
|
|
2274
2324
|
"aria-label": "Next",
|
|
2275
2325
|
style: {
|
|
2276
|
-
...
|
|
2277
|
-
opacity:
|
|
2326
|
+
...D(!1),
|
|
2327
|
+
opacity: w < C ? 1 : .4
|
|
2278
2328
|
},
|
|
2279
2329
|
children: "›"
|
|
2280
2330
|
})
|
|
@@ -2436,19 +2486,19 @@ function Tt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
2436
2486
|
horizontal: n
|
|
2437
2487
|
};
|
|
2438
2488
|
}
|
|
2439
|
-
var
|
|
2489
|
+
var Et = (e, t) => {
|
|
2440
2490
|
let n = String(e ?? "");
|
|
2441
2491
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
2442
|
-
},
|
|
2492
|
+
}, Dt = (e) => {
|
|
2443
2493
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
2444
2494
|
if (!t) return "#ffffff";
|
|
2445
2495
|
let n = t[1];
|
|
2446
2496
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
2447
2497
|
let r = parseInt(n, 16);
|
|
2448
2498
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
2449
|
-
},
|
|
2450
|
-
function
|
|
2451
|
-
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 ? "" :
|
|
2499
|
+
}, Ot = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
2500
|
+
function kt(e, t = {}) {
|
|
2501
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : q(e);
|
|
2452
2502
|
return n.map((e) => {
|
|
2453
2503
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
2454
2504
|
return {
|
|
@@ -2462,11 +2512,11 @@ function Ot(e, t = {}) {
|
|
|
2462
2512
|
};
|
|
2463
2513
|
});
|
|
2464
2514
|
}
|
|
2465
|
-
var
|
|
2515
|
+
var At = {
|
|
2466
2516
|
size: 36,
|
|
2467
2517
|
pad: 10
|
|
2468
2518
|
};
|
|
2469
|
-
function
|
|
2519
|
+
function jt({ node: e, onClose: t }) {
|
|
2470
2520
|
return i(() => {
|
|
2471
2521
|
let e = (e) => e.key === "Escape" && t();
|
|
2472
2522
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -2584,7 +2634,7 @@ function At({ node: e, onClose: t }) {
|
|
|
2584
2634
|
})
|
|
2585
2635
|
});
|
|
2586
2636
|
}
|
|
2587
|
-
function
|
|
2637
|
+
function Mt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
|
|
2588
2638
|
let x = a(), [S, C] = c(null), { tenant: w, apiUrl: T } = r(V), E = r(H)?.[t], [D, O] = c(null);
|
|
2589
2639
|
i(() => {
|
|
2590
2640
|
if (!t || E) return;
|
|
@@ -2601,7 +2651,7 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
2601
2651
|
T,
|
|
2602
2652
|
E
|
|
2603
2653
|
]);
|
|
2604
|
-
let k = t ?
|
|
2654
|
+
let k = t ? kt(E ?? D ?? [], {
|
|
2605
2655
|
nameField: n,
|
|
2606
2656
|
titleField: o,
|
|
2607
2657
|
photoField: s,
|
|
@@ -2654,7 +2704,7 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
2654
2704
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
2655
2705
|
strokeWidth: "1.5"
|
|
2656
2706
|
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
2657
|
-
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ?
|
|
2707
|
+
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Dt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Dt(e.color2) : s, f = b && (Ot(e) || e.href), p = () => Ot(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + At.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
2658
2708
|
return /* @__PURE__ */ d("g", {
|
|
2659
2709
|
onClick: f ? p : void 0,
|
|
2660
2710
|
style: f ? { cursor: "pointer" } : void 0,
|
|
@@ -2718,13 +2768,13 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
2718
2768
|
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
2719
2769
|
id: `${x}-${e.id}`,
|
|
2720
2770
|
children: /* @__PURE__ */ u("circle", {
|
|
2721
|
-
cx: t +
|
|
2771
|
+
cx: t + At.pad + A.avatar / 2,
|
|
2722
2772
|
cy: n + A.h / 2,
|
|
2723
2773
|
r: A.avatar / 2
|
|
2724
2774
|
})
|
|
2725
2775
|
}), /* @__PURE__ */ u("image", {
|
|
2726
2776
|
href: e.photo,
|
|
2727
|
-
x: t +
|
|
2777
|
+
x: t + At.pad,
|
|
2728
2778
|
y: n + (A.h - A.avatar) / 2,
|
|
2729
2779
|
width: A.avatar,
|
|
2730
2780
|
height: A.avatar,
|
|
@@ -2738,7 +2788,7 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
2738
2788
|
fontSize: A.title,
|
|
2739
2789
|
fontWeight: "600",
|
|
2740
2790
|
fill: s,
|
|
2741
|
-
children:
|
|
2791
|
+
children: Et(e.title, g + 4)
|
|
2742
2792
|
}), e.name && /* @__PURE__ */ u("text", {
|
|
2743
2793
|
x: m,
|
|
2744
2794
|
y: n + _ + _ / 2 + A.name * .35,
|
|
@@ -2746,7 +2796,7 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
2746
2796
|
fontSize: A.name,
|
|
2747
2797
|
fontWeight: "600",
|
|
2748
2798
|
fill: c,
|
|
2749
|
-
children:
|
|
2799
|
+
children: Et(e.name, g)
|
|
2750
2800
|
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
2751
2801
|
x: m,
|
|
2752
2802
|
y: n + (v[1] ? A.h * .43 : A.h * .57),
|
|
@@ -2754,7 +2804,7 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
2754
2804
|
fontSize: A.name,
|
|
2755
2805
|
fontWeight: "600",
|
|
2756
2806
|
fill: s,
|
|
2757
|
-
children:
|
|
2807
|
+
children: Et(v[0], g)
|
|
2758
2808
|
}), v[1] && /* @__PURE__ */ u("text", {
|
|
2759
2809
|
x: m,
|
|
2760
2810
|
y: n + A.h * .73,
|
|
@@ -2762,100 +2812,115 @@ function jt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
2762
2812
|
fontSize: A.title,
|
|
2763
2813
|
opacity: "0.7",
|
|
2764
2814
|
fill: s,
|
|
2765
|
-
children:
|
|
2815
|
+
children: Et(v[1], g + 4)
|
|
2766
2816
|
})] })
|
|
2767
2817
|
]
|
|
2768
2818
|
}, e.id);
|
|
2769
2819
|
})]
|
|
2770
|
-
}), S && /* @__PURE__ */ u(
|
|
2820
|
+
}), S && /* @__PURE__ */ u(jt, {
|
|
2771
2821
|
node: S,
|
|
2772
2822
|
onClose: () => C(null)
|
|
2773
2823
|
})]
|
|
2774
2824
|
});
|
|
2775
2825
|
}
|
|
2776
|
-
function
|
|
2777
|
-
let { tenant:
|
|
2826
|
+
function Nt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, paged: f, emptyText: p, style: m, nodeRef: g }) {
|
|
2827
|
+
let { tenant: _, apiUrl: v } = r(V), y = r(H), b = y?.[n], x = f ? U(y) : 1, [S, C] = c(null);
|
|
2778
2828
|
if (i(() => {
|
|
2779
|
-
if (!n ||
|
|
2780
|
-
let e = !0, t = n.startsWith("api:") ? `${
|
|
2781
|
-
return fetch(
|
|
2829
|
+
if (!n || b) return;
|
|
2830
|
+
let e = !0, t = Math.max(1, Number(a) || 10), r = f && !n.startsWith("api:") ? `?offset=${(x - 1) * t}&limit=${t}` : "", i = n.startsWith("api:") ? `${v}/data/${encodeURIComponent(n.slice(4))}` : `${v}/dynamic/${encodeURIComponent(n)}${r}`;
|
|
2831
|
+
return fetch(i, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((t) => {
|
|
2832
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
2833
|
+
return e && C(n);
|
|
2834
|
+
}).catch(() => e && C([])), () => {
|
|
2782
2835
|
e = !1;
|
|
2783
2836
|
};
|
|
2784
2837
|
}, [
|
|
2785
2838
|
n,
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2839
|
+
_,
|
|
2840
|
+
v,
|
|
2841
|
+
b,
|
|
2842
|
+
f,
|
|
2843
|
+
x,
|
|
2844
|
+
a
|
|
2789
2845
|
]), !e.length) return null;
|
|
2790
|
-
let
|
|
2846
|
+
let w = Math.max(1, Number(a) || 10), T = n ? f ? b || n.startsWith("api:") ? (b ?? S ?? []).slice((x - 1) * w, x * w) : (S ?? []).slice(0, w) : (b ?? S ?? []).slice(0, w) : null, E = T ? T.map((t) => e.map((e) => q(K(t?.data, e.field)))) : t, D = !!n && !(n && !b && S === null) && E.length === 0, O = l ? "6px 10px" : "10px 14px", k = "1px solid rgba(148, 163, 184, 0.35)", A = s ? { border: k } : { borderBottom: k };
|
|
2791
2847
|
return /* @__PURE__ */ u("div", {
|
|
2792
|
-
ref:
|
|
2848
|
+
ref: g,
|
|
2793
2849
|
style: {
|
|
2794
2850
|
width: "100%",
|
|
2795
2851
|
overflowX: "auto",
|
|
2796
|
-
...h(
|
|
2852
|
+
...h(m)
|
|
2797
2853
|
},
|
|
2798
2854
|
children: /* @__PURE__ */ d("table", {
|
|
2799
2855
|
style: {
|
|
2800
2856
|
width: "100%",
|
|
2801
2857
|
borderCollapse: "collapse",
|
|
2802
2858
|
fontSize: 14,
|
|
2803
|
-
...s ? { border:
|
|
2859
|
+
...s ? { border: k } : {}
|
|
2804
2860
|
},
|
|
2805
2861
|
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("th", {
|
|
2806
2862
|
style: {
|
|
2807
2863
|
textAlign: "left",
|
|
2808
2864
|
fontWeight: 600,
|
|
2809
|
-
padding:
|
|
2865
|
+
padding: O,
|
|
2810
2866
|
background: "rgba(148, 163, 184, 0.12)",
|
|
2811
|
-
...
|
|
2867
|
+
...A
|
|
2812
2868
|
},
|
|
2813
2869
|
children: e.label ?? e
|
|
2814
|
-
}, t)) }) }), /* @__PURE__ */
|
|
2870
|
+
}, t)) }) }), /* @__PURE__ */ d("tbody", { children: [D && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
2871
|
+
colSpan: e.length,
|
|
2872
|
+
style: {
|
|
2873
|
+
padding: O,
|
|
2874
|
+
textAlign: "center",
|
|
2875
|
+
opacity: .6,
|
|
2876
|
+
...A
|
|
2877
|
+
},
|
|
2878
|
+
children: p || "No data yet"
|
|
2879
|
+
}) }), E.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
2815
2880
|
style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
2816
2881
|
children: e.map((e, n) => /* @__PURE__ */ u("td", {
|
|
2817
2882
|
style: {
|
|
2818
|
-
padding:
|
|
2819
|
-
...
|
|
2883
|
+
padding: O,
|
|
2884
|
+
...A
|
|
2820
2885
|
},
|
|
2821
2886
|
children: t?.[n] ?? ""
|
|
2822
2887
|
}, n))
|
|
2823
|
-
}, n)) })]
|
|
2888
|
+
}, n))] })]
|
|
2824
2889
|
})
|
|
2825
2890
|
});
|
|
2826
2891
|
}
|
|
2827
|
-
var
|
|
2828
|
-
PageRoot:
|
|
2829
|
-
Section:
|
|
2830
|
-
Container:
|
|
2831
|
-
Heading:
|
|
2832
|
-
TextBlock:
|
|
2833
|
-
ButtonBlock:
|
|
2834
|
-
ImageBlock:
|
|
2835
|
-
Spacer:
|
|
2836
|
-
Divider:
|
|
2837
|
-
SliderBlock:
|
|
2838
|
-
CanvasSlider:
|
|
2892
|
+
var Pt = {
|
|
2893
|
+
PageRoot: ge,
|
|
2894
|
+
Section: _e,
|
|
2895
|
+
Container: ve,
|
|
2896
|
+
Heading: ye,
|
|
2897
|
+
TextBlock: Ae,
|
|
2898
|
+
ButtonBlock: Ne,
|
|
2899
|
+
ImageBlock: Pe,
|
|
2900
|
+
Spacer: Be,
|
|
2901
|
+
Divider: Ve,
|
|
2902
|
+
SliderBlock: qe,
|
|
2903
|
+
CanvasSlider: Je,
|
|
2839
2904
|
TabsBlock: Qe,
|
|
2840
2905
|
QuickStack: vt,
|
|
2841
2906
|
CollectionList: yt,
|
|
2842
2907
|
BreadcrumbsBlock: bt,
|
|
2843
2908
|
PaginationBlock: xt,
|
|
2844
2909
|
StepperBlock: St,
|
|
2845
|
-
OrgChartBlock:
|
|
2846
|
-
TableBlock:
|
|
2910
|
+
OrgChartBlock: Mt,
|
|
2911
|
+
TableBlock: Nt,
|
|
2847
2912
|
AccordionBlock: $e,
|
|
2848
2913
|
NavbarBlock: Ze,
|
|
2849
|
-
ListBlock:
|
|
2850
|
-
TextSpan:
|
|
2851
|
-
QuoteBlock:
|
|
2852
|
-
TextLink:
|
|
2853
|
-
RichTextBlock:
|
|
2854
|
-
RichContentBlock:
|
|
2855
|
-
VideoBlock:
|
|
2856
|
-
YouTubeBlock:
|
|
2857
|
-
IframeBlock:
|
|
2858
|
-
EmbedBlock:
|
|
2914
|
+
ListBlock: ke,
|
|
2915
|
+
TextSpan: Se,
|
|
2916
|
+
QuoteBlock: Oe,
|
|
2917
|
+
TextLink: Me,
|
|
2918
|
+
RichTextBlock: Ee,
|
|
2919
|
+
RichContentBlock: Ee,
|
|
2920
|
+
VideoBlock: Fe,
|
|
2921
|
+
YouTubeBlock: Le,
|
|
2922
|
+
IframeBlock: Re,
|
|
2923
|
+
EmbedBlock: ze,
|
|
2859
2924
|
FormBlock: st,
|
|
2860
2925
|
FormLabel: dt,
|
|
2861
2926
|
FormInput: ft,
|
|
@@ -2872,26 +2937,26 @@ var Nt = {
|
|
|
2872
2937
|
FormFile: gt,
|
|
2873
2938
|
FormRecaptcha: ut,
|
|
2874
2939
|
FormSubmit: _t
|
|
2875
|
-
},
|
|
2940
|
+
}, Ft = {
|
|
2876
2941
|
id: "auth",
|
|
2877
2942
|
label: "Accounts",
|
|
2878
2943
|
category: "Apps",
|
|
2879
2944
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
2880
2945
|
ssr: "shell",
|
|
2881
2946
|
settings: ["apps.auth.redirect"]
|
|
2882
|
-
},
|
|
2947
|
+
}, It = t({
|
|
2883
2948
|
user: null,
|
|
2884
2949
|
status: "idle",
|
|
2885
2950
|
ensure: () => {},
|
|
2886
2951
|
refresh: () => {},
|
|
2887
2952
|
signOut: () => {}
|
|
2888
|
-
}),
|
|
2889
|
-
let e = r(
|
|
2953
|
+
}), Lt = () => {
|
|
2954
|
+
let e = r(It);
|
|
2890
2955
|
return i(() => {
|
|
2891
2956
|
e.ensure();
|
|
2892
2957
|
}, [e]), e;
|
|
2893
2958
|
};
|
|
2894
|
-
function
|
|
2959
|
+
function Rt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
|
|
2895
2960
|
let d = r(V), f = a || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : i ? "guest" : "idle"), v = s(!1), y = n((e, t) => fetch(`${f}${e}`, {
|
|
2896
2961
|
...t,
|
|
2897
2962
|
credentials: "include",
|
|
@@ -2924,18 +2989,18 @@ function Lt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l })
|
|
|
2924
2989
|
b,
|
|
2925
2990
|
x
|
|
2926
2991
|
]);
|
|
2927
|
-
return /* @__PURE__ */ u(
|
|
2992
|
+
return /* @__PURE__ */ u(It.Provider, {
|
|
2928
2993
|
value: C,
|
|
2929
2994
|
children: e
|
|
2930
2995
|
});
|
|
2931
2996
|
}
|
|
2932
|
-
function
|
|
2933
|
-
let { status: n } =
|
|
2997
|
+
function zt({ when: e, children: t }) {
|
|
2998
|
+
let { status: n } = Lt();
|
|
2934
2999
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
2935
3000
|
}
|
|
2936
3001
|
//#endregion
|
|
2937
3002
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
2938
|
-
function
|
|
3003
|
+
function Bt({ 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 }) {
|
|
2939
3004
|
let { tenant: g, apiUrl: _, settings: v } = r(V), [y, b] = c("form"), [x, S] = c(""), [C, w] = c(!1), T = e === "register", E = f ? m || "form" : y, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
|
|
2940
3005
|
if (e.preventDefault(), f) return;
|
|
2941
3006
|
let n = new FormData(e.currentTarget);
|
|
@@ -2984,20 +3049,20 @@ function zt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
2984
3049
|
children: [
|
|
2985
3050
|
T ? /* @__PURE__ */ d("label", {
|
|
2986
3051
|
style: {
|
|
2987
|
-
...
|
|
3052
|
+
...X,
|
|
2988
3053
|
display: "grid",
|
|
2989
3054
|
gap: 6
|
|
2990
3055
|
},
|
|
2991
3056
|
children: [a, /* @__PURE__ */ u("input", {
|
|
2992
3057
|
name: "name",
|
|
2993
3058
|
type: "text",
|
|
2994
|
-
style:
|
|
2995
|
-
...
|
|
3059
|
+
style: Z,
|
|
3060
|
+
...Q(f)
|
|
2996
3061
|
})]
|
|
2997
3062
|
}) : null,
|
|
2998
3063
|
/* @__PURE__ */ d("label", {
|
|
2999
3064
|
style: {
|
|
3000
|
-
...
|
|
3065
|
+
...X,
|
|
3001
3066
|
display: "grid",
|
|
3002
3067
|
gap: 6
|
|
3003
3068
|
},
|
|
@@ -3005,13 +3070,13 @@ function zt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3005
3070
|
name: "email",
|
|
3006
3071
|
type: "email",
|
|
3007
3072
|
required: !f,
|
|
3008
|
-
style:
|
|
3009
|
-
...
|
|
3073
|
+
style: Z,
|
|
3074
|
+
...Q(f)
|
|
3010
3075
|
})]
|
|
3011
3076
|
}),
|
|
3012
3077
|
/* @__PURE__ */ d("label", {
|
|
3013
3078
|
style: {
|
|
3014
|
-
...
|
|
3079
|
+
...X,
|
|
3015
3080
|
display: "grid",
|
|
3016
3081
|
gap: 6
|
|
3017
3082
|
},
|
|
@@ -3019,15 +3084,15 @@ function zt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3019
3084
|
name: "password",
|
|
3020
3085
|
type: "password",
|
|
3021
3086
|
required: !f,
|
|
3022
|
-
style:
|
|
3023
|
-
...
|
|
3087
|
+
style: Z,
|
|
3088
|
+
...Q(f)
|
|
3024
3089
|
})]
|
|
3025
3090
|
}),
|
|
3026
3091
|
/* @__PURE__ */ u("button", {
|
|
3027
3092
|
type: f ? "button" : "submit",
|
|
3028
3093
|
disabled: C || void 0,
|
|
3029
3094
|
style: {
|
|
3030
|
-
...
|
|
3095
|
+
...J,
|
|
3031
3096
|
border: 0,
|
|
3032
3097
|
padding: "10px 22px",
|
|
3033
3098
|
borderRadius: 8,
|
|
@@ -3059,8 +3124,8 @@ function zt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3059
3124
|
]
|
|
3060
3125
|
});
|
|
3061
3126
|
}
|
|
3062
|
-
function
|
|
3063
|
-
let { user: c, status: l, signOut: f } =
|
|
3127
|
+
function Vt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
3128
|
+
let { user: c, status: l, signOut: f } = Lt(), p = a ? s || "user" : l, m = a ? {
|
|
3064
3129
|
name: "Ada Lovelace",
|
|
3065
3130
|
email: "ada@example.com"
|
|
3066
3131
|
} : c;
|
|
@@ -3081,7 +3146,7 @@ function Bt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3081
3146
|
children: [
|
|
3082
3147
|
/* @__PURE__ */ d("span", {
|
|
3083
3148
|
style: {
|
|
3084
|
-
...
|
|
3149
|
+
...X,
|
|
3085
3150
|
fontWeight: 600
|
|
3086
3151
|
},
|
|
3087
3152
|
children: [
|
|
@@ -3092,7 +3157,7 @@ function Bt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3092
3157
|
}),
|
|
3093
3158
|
n && m?.email ? /* @__PURE__ */ u("span", {
|
|
3094
3159
|
style: {
|
|
3095
|
-
...
|
|
3160
|
+
...X,
|
|
3096
3161
|
opacity: .7
|
|
3097
3162
|
},
|
|
3098
3163
|
children: m.email
|
|
@@ -3101,14 +3166,14 @@ function Bt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3101
3166
|
type: "button",
|
|
3102
3167
|
onClick: a ? void 0 : f,
|
|
3103
3168
|
style: {
|
|
3104
|
-
...
|
|
3169
|
+
...J,
|
|
3105
3170
|
border: 0,
|
|
3106
3171
|
padding: "8px 16px",
|
|
3107
3172
|
borderRadius: 8,
|
|
3108
3173
|
fontSize: 14,
|
|
3109
3174
|
cursor: a ? "default" : "pointer"
|
|
3110
3175
|
},
|
|
3111
|
-
...
|
|
3176
|
+
...Q(a),
|
|
3112
3177
|
children: t
|
|
3113
3178
|
})
|
|
3114
3179
|
]
|
|
@@ -3125,16 +3190,16 @@ function Bt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3125
3190
|
}
|
|
3126
3191
|
//#endregion
|
|
3127
3192
|
//#region ../ui/src/components/builder/apps/index.js
|
|
3128
|
-
var
|
|
3129
|
-
SiteLoginForm:
|
|
3130
|
-
SiteAccountMenu:
|
|
3193
|
+
var Ht = [Ft], Ut = {
|
|
3194
|
+
SiteLoginForm: Bt,
|
|
3195
|
+
SiteAccountMenu: Vt
|
|
3131
3196
|
};
|
|
3132
|
-
new Set(
|
|
3197
|
+
new Set(Ht.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
3133
3198
|
//#endregion
|
|
3134
3199
|
//#region ../ui/src/components/builder/render.jsx
|
|
3135
|
-
var
|
|
3136
|
-
...
|
|
3137
|
-
...
|
|
3200
|
+
var Wt = {
|
|
3201
|
+
...Pt,
|
|
3202
|
+
...Ut
|
|
3138
3203
|
};
|
|
3139
3204
|
function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
3140
3205
|
let o = n[t];
|
|
@@ -3146,7 +3211,7 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3146
3211
|
let c = new Set(i).add(n);
|
|
3147
3212
|
return /* @__PURE__ */ u(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
3148
3213
|
}
|
|
3149
|
-
let l =
|
|
3214
|
+
let l = Wt[s];
|
|
3150
3215
|
if (!l) return null;
|
|
3151
3216
|
let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
3152
3217
|
...c,
|
|
@@ -3157,15 +3222,15 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3157
3222
|
},
|
|
3158
3223
|
children: d.length ? d : void 0
|
|
3159
3224
|
}, t);
|
|
3160
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
3225
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(zt, {
|
|
3161
3226
|
when: c.when,
|
|
3162
3227
|
children: m
|
|
3163
3228
|
}, t) : m;
|
|
3164
3229
|
}
|
|
3165
3230
|
//#endregion
|
|
3166
3231
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
3167
|
-
var
|
|
3168
|
-
function
|
|
3232
|
+
var Gt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
|
|
3233
|
+
function Kt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: g }) {
|
|
3169
3234
|
let _ = s?.js?.trim();
|
|
3170
3235
|
if (i(() => {
|
|
3171
3236
|
if (!_) return;
|
|
@@ -3191,18 +3256,18 @@ function Gt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
3191
3256
|
locale: p || "",
|
|
3192
3257
|
settings: h ?? null
|
|
3193
3258
|
},
|
|
3194
|
-
children: /* @__PURE__ */ u(
|
|
3259
|
+
children: /* @__PURE__ */ u(Rt, {
|
|
3195
3260
|
initialUser: g,
|
|
3196
3261
|
children: /* @__PURE__ */ u(H.Provider, {
|
|
3197
3262
|
value: f ?? null,
|
|
3198
|
-
children: /* @__PURE__ */ u(
|
|
3263
|
+
children: /* @__PURE__ */ u(W.Provider, {
|
|
3199
3264
|
value: S,
|
|
3200
3265
|
children: /* @__PURE__ */ d("div", {
|
|
3201
3266
|
...v,
|
|
3202
3267
|
className: "webim-page",
|
|
3203
3268
|
style: {
|
|
3204
3269
|
...b,
|
|
3205
|
-
...
|
|
3270
|
+
...ee(t, r),
|
|
3206
3271
|
...a
|
|
3207
3272
|
},
|
|
3208
3273
|
children: [
|
|
@@ -3226,11 +3291,11 @@ function Gt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
3226
3291
|
locale: p || "",
|
|
3227
3292
|
settings: h ?? null
|
|
3228
3293
|
},
|
|
3229
|
-
children: /* @__PURE__ */ u(
|
|
3294
|
+
children: /* @__PURE__ */ u(Rt, {
|
|
3230
3295
|
initialUser: g,
|
|
3231
3296
|
children: /* @__PURE__ */ u(H.Provider, {
|
|
3232
3297
|
value: f ?? null,
|
|
3233
|
-
children: /* @__PURE__ */ u(
|
|
3298
|
+
children: /* @__PURE__ */ u(W.Provider, {
|
|
3234
3299
|
value: S,
|
|
3235
3300
|
children: /* @__PURE__ */ d("div", {
|
|
3236
3301
|
...v,
|
|
@@ -3241,8 +3306,8 @@ function Gt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
3241
3306
|
...a
|
|
3242
3307
|
},
|
|
3243
3308
|
children: [
|
|
3244
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
3245
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
3309
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${Gt(F(k.light))} }
|
|
3310
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Gt(F(k.dark))} } }` }),
|
|
3246
3311
|
O,
|
|
3247
3312
|
/* @__PURE__ */ u("style", { children: y }),
|
|
3248
3313
|
C && /* @__PURE__ */ u("style", { children: C }),
|
|
@@ -3258,8 +3323,8 @@ function Gt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
3258
3323
|
}
|
|
3259
3324
|
//#endregion
|
|
3260
3325
|
//#region src/WebimContent.jsx
|
|
3261
|
-
function
|
|
3262
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
3326
|
+
function qt({ bundle: e, mode: t = "auto", style: n }) {
|
|
3327
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(Kt, {
|
|
3263
3328
|
blocks: e.blocks,
|
|
3264
3329
|
theme: e.theme,
|
|
3265
3330
|
components: e.components,
|
|
@@ -3276,7 +3341,7 @@ function Kt({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
3276
3341
|
}
|
|
3277
3342
|
//#endregion
|
|
3278
3343
|
//#region src/WebimPage.jsx
|
|
3279
|
-
function
|
|
3344
|
+
function Jt({ 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 }) {
|
|
3280
3345
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
3281
3346
|
onLoad: m,
|
|
3282
3347
|
onError: h
|
|
@@ -3286,7 +3351,7 @@ function qt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
3286
3351
|
onError: h
|
|
3287
3352
|
}, i(() => {
|
|
3288
3353
|
let i = !0;
|
|
3289
|
-
return _({ status: "loading" }),
|
|
3354
|
+
return _({ status: "loading" }), z({
|
|
3290
3355
|
apiUrl: e,
|
|
3291
3356
|
tenant: t,
|
|
3292
3357
|
slug: n,
|
|
@@ -3313,11 +3378,11 @@ function qt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
3313
3378
|
r,
|
|
3314
3379
|
a,
|
|
3315
3380
|
o
|
|
3316
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
3381
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(qt, {
|
|
3317
3382
|
bundle: g.bundle,
|
|
3318
3383
|
mode: l,
|
|
3319
3384
|
style: d
|
|
3320
3385
|
});
|
|
3321
3386
|
}
|
|
3322
3387
|
//#endregion
|
|
3323
|
-
export {
|
|
3388
|
+
export { Kt as PageRenderer, qt as WebimContent, Jt as WebimPage, z as fetchPage, Te as renderRichContent, L as resolveTheme };
|