webim-adapter 1.0.3 → 1.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/build/webim-adapter.js +445 -376
- package/build/webim-embed.js +10 -10
- package/build/webim-ssr.js +595 -526
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -263,32 +263,32 @@ function P(e) {
|
|
|
263
263
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
264
264
|
let H = F(I);
|
|
265
265
|
R !== void 0 && H.push(`blur(${M(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), B !== void 0 && H.push(`brightness(${B}%)`), V !== void 0 && H.push(`contrast(${V}%)`), ee !== void 0 && H.push(`saturate(${ee}%)`), H.length && (t.filter = H.join(" "));
|
|
266
|
-
let
|
|
267
|
-
|
|
268
|
-
let { textStrokeWidth:
|
|
269
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
270
|
-
let { clipText:
|
|
271
|
-
delete t.clipText,
|
|
272
|
-
let { transitions:
|
|
266
|
+
let U = F(L);
|
|
267
|
+
U.length && (t.backdropFilter = U.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
268
|
+
let { textStrokeWidth: te, textStrokeColor: W } = t;
|
|
269
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (te !== void 0 || W !== void 0) && (t.WebkitTextStroke = `${M(te ?? 1)} ${W || "currentColor"}`);
|
|
270
|
+
let { clipText: ne } = t;
|
|
271
|
+
delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
272
|
+
let { transitions: re, transitionDuration: ie, transitionEasing: G, transitionProperty: ae } = t, oe = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
273
273
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
274
|
-
let
|
|
275
|
-
if (
|
|
274
|
+
let se = (Array.isArray(re) ? re : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${oe(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
275
|
+
if (ie !== void 0 && se.push(`${ae || "all"} ${oe(ie)} ${G || "ease"}`), se.length && (t.transition = se.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
276
276
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
277
277
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
278
278
|
}
|
|
279
279
|
delete t.backgroundVideo;
|
|
280
|
-
let { overlayColor:
|
|
281
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
282
|
-
let e = `color-mix(in srgb, ${
|
|
280
|
+
let { overlayColor: K, overlayOpacity: ce } = t;
|
|
281
|
+
if (delete t.overlayColor, delete t.overlayOpacity, K) {
|
|
282
|
+
let e = `color-mix(in srgb, ${K} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
283
283
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
284
284
|
}
|
|
285
285
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
286
|
-
let { backgroundLayers:
|
|
286
|
+
let { backgroundLayers: le } = t;
|
|
287
287
|
delete t.backgroundLayers;
|
|
288
|
-
let
|
|
289
|
-
if (
|
|
288
|
+
let ue = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
|
|
289
|
+
if (ue.length) {
|
|
290
290
|
let e = [], n = [], r = [], i = [], a = [];
|
|
291
|
-
for (let t of
|
|
291
|
+
for (let t of ue) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
292
292
|
else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
293
293
|
else {
|
|
294
294
|
if (!t.src) continue;
|
|
@@ -335,7 +335,7 @@ function H(e, t) {
|
|
|
335
335
|
}
|
|
336
336
|
return [];
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function U(e, t) {
|
|
339
339
|
for (let t of e.__webimEvents ?? []) t();
|
|
340
340
|
let n = [];
|
|
341
341
|
for (let r of t ?? []) {
|
|
@@ -366,7 +366,7 @@ function te(e, t) {
|
|
|
366
366
|
}
|
|
367
367
|
e.__webimEvents = n;
|
|
368
368
|
}
|
|
369
|
-
function
|
|
369
|
+
function te(e, t, n = []) {
|
|
370
370
|
t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
|
|
371
371
|
let r = R(t.classNames), i = R(e.getAttribute("data-wb-class"));
|
|
372
372
|
for (let t of i) r.includes(t) || e.classList.remove(t);
|
|
@@ -380,15 +380,15 @@ function U(e, t, n = []) {
|
|
|
380
380
|
}
|
|
381
381
|
return a;
|
|
382
382
|
}
|
|
383
|
-
var
|
|
384
|
-
function
|
|
385
|
-
let i = Object.entries(P(t)).map(([e, t]) => `${
|
|
383
|
+
var W = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
384
|
+
function ne(e, t, n, r = !1) {
|
|
385
|
+
let i = Object.entries(P(t)).map(([e, t]) => `${W(e)}: ${t} !important;`).join(" ");
|
|
386
386
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
return Object.entries(F).map(([r, i]) =>
|
|
388
|
+
function re(e, t, n) {
|
|
389
|
+
return Object.entries(F).map(([r, i]) => ne(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
390
390
|
}
|
|
391
|
-
var
|
|
391
|
+
var ie = [
|
|
392
392
|
{
|
|
393
393
|
key: "tablet",
|
|
394
394
|
max: 991
|
|
@@ -401,17 +401,17 @@ var ae = [
|
|
|
401
401
|
key: "mobile",
|
|
402
402
|
max: 478
|
|
403
403
|
}
|
|
404
|
-
],
|
|
405
|
-
function
|
|
406
|
-
return
|
|
407
|
-
let i = t?.[n] ?
|
|
404
|
+
], G = (e) => Object.entries(P(e)).map(([e, t]) => `${W(e)}: ${t} !important;`).join(" ");
|
|
405
|
+
function ae(e, t) {
|
|
406
|
+
return ie.map(({ key: n, max: r }) => {
|
|
407
|
+
let i = t?.[n] ? G(t[n]) : "";
|
|
408
408
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
409
409
|
}).filter(Boolean).join("\n");
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function oe(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
|
-
let e =
|
|
414
|
+
let e = ae(t, r.props);
|
|
415
415
|
e && n.push(e);
|
|
416
416
|
}
|
|
417
417
|
};
|
|
@@ -419,10 +419,10 @@ function ce(e, t) {
|
|
|
419
419
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
420
420
|
return n.join("\n");
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function se(e, t) {
|
|
423
423
|
let n = [], r = (e) => {
|
|
424
424
|
for (let [t, r] of Object.entries(e || {})) {
|
|
425
|
-
let e =
|
|
425
|
+
let e = re(t, r.props);
|
|
426
426
|
e && n.push(e);
|
|
427
427
|
}
|
|
428
428
|
};
|
|
@@ -430,7 +430,7 @@ function le(e, t) {
|
|
|
430
430
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
431
431
|
return n.join("\n");
|
|
432
432
|
}
|
|
433
|
-
var
|
|
433
|
+
var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", ce = {
|
|
434
434
|
light: {
|
|
435
435
|
background: "#f2f2f2",
|
|
436
436
|
surface: "#f2f2f2",
|
|
@@ -471,23 +471,23 @@ var W = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
471
471
|
contrastText: "#052e2b"
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
},
|
|
474
|
+
}, le = {
|
|
475
475
|
font: "system",
|
|
476
476
|
headingFont: "inherit",
|
|
477
|
-
light:
|
|
478
|
-
dark:
|
|
479
|
-
},
|
|
477
|
+
light: ce.light,
|
|
478
|
+
dark: ce.dark
|
|
479
|
+
}, ue = {
|
|
480
480
|
system: {
|
|
481
481
|
label: "System",
|
|
482
|
-
value:
|
|
482
|
+
value: K
|
|
483
483
|
},
|
|
484
484
|
inter: {
|
|
485
485
|
label: "Inter",
|
|
486
|
-
value: `"Inter", ${
|
|
486
|
+
value: `"Inter", ${K}`
|
|
487
487
|
},
|
|
488
488
|
outfit: {
|
|
489
489
|
label: "Outfit",
|
|
490
|
-
value: `"Outfit", ${
|
|
490
|
+
value: `"Outfit", ${K}`
|
|
491
491
|
},
|
|
492
492
|
serif: {
|
|
493
493
|
label: "Serif",
|
|
@@ -497,7 +497,7 @@ var W = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
497
497
|
label: "Mono",
|
|
498
498
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
499
499
|
}
|
|
500
|
-
},
|
|
500
|
+
}, de = (e, t) => ue[e]?.value ?? k(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), fe = (e, ...t) => {
|
|
501
501
|
let n = Object.assign({}, e, ...t);
|
|
502
502
|
return n.primary = {
|
|
503
503
|
...e.primary,
|
|
@@ -513,20 +513,20 @@ var W = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
513
513
|
}), {})
|
|
514
514
|
}, n;
|
|
515
515
|
};
|
|
516
|
-
function
|
|
516
|
+
function pe(e) {
|
|
517
517
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
518
518
|
return {
|
|
519
|
-
font: r ??
|
|
520
|
-
headingFont: i ??
|
|
521
|
-
light:
|
|
522
|
-
dark:
|
|
519
|
+
font: r ?? le.font,
|
|
520
|
+
headingFont: i ?? le.headingFont,
|
|
521
|
+
light: fe(ce.light, a, t),
|
|
522
|
+
dark: fe(ce.dark, n)
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function me(e) {
|
|
526
526
|
return {
|
|
527
527
|
"--page-bg": e.background,
|
|
528
528
|
"--page-surface": e.surface ?? e.background,
|
|
529
|
-
"--page-border": e.border ??
|
|
529
|
+
"--page-border": e.border ?? ce.light.border,
|
|
530
530
|
"--page-text": e.text,
|
|
531
531
|
"--page-accent": e.accent,
|
|
532
532
|
"--page-accent-text": e.accentText,
|
|
@@ -540,58 +540,58 @@ function pe(e) {
|
|
|
540
540
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
|
-
function
|
|
544
|
-
let t =
|
|
543
|
+
function he(e) {
|
|
544
|
+
let t = pe(e);
|
|
545
545
|
return {
|
|
546
546
|
backgroundColor: "var(--page-bg)",
|
|
547
547
|
color: "var(--page-text)",
|
|
548
|
-
fontFamily:
|
|
549
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
548
|
+
fontFamily: de(t.font, K),
|
|
549
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : de(t.headingFont, "inherit")
|
|
550
550
|
};
|
|
551
551
|
}
|
|
552
|
-
function
|
|
553
|
-
let n =
|
|
552
|
+
function ge(e, t = "light") {
|
|
553
|
+
let n = pe(e);
|
|
554
554
|
return {
|
|
555
|
-
...
|
|
556
|
-
...
|
|
555
|
+
...he(e),
|
|
556
|
+
...me(n[t] ?? n.light)
|
|
557
557
|
};
|
|
558
558
|
}
|
|
559
|
-
function
|
|
559
|
+
function _e(e, t) {
|
|
560
560
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
561
561
|
}
|
|
562
|
-
function
|
|
562
|
+
function ve(e, t) {
|
|
563
563
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
564
564
|
}
|
|
565
565
|
//#endregion
|
|
566
566
|
//#region ../ui/src/components/builder/views.jsx
|
|
567
|
-
var
|
|
567
|
+
var q = n({
|
|
568
568
|
tenant: "",
|
|
569
569
|
apiUrl: "/api",
|
|
570
570
|
locale: "",
|
|
571
571
|
settings: null
|
|
572
|
-
}),
|
|
572
|
+
}), ye = n(null), be = (e) => {
|
|
573
573
|
let t = Number(e?.__page);
|
|
574
574
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
575
575
|
if (typeof window > "u") return 1;
|
|
576
576
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
577
577
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
578
|
-
},
|
|
578
|
+
}, xe = () => {
|
|
579
579
|
if (typeof window > "u") return {};
|
|
580
580
|
let e = {};
|
|
581
581
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
582
582
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
583
583
|
}), e;
|
|
584
|
-
},
|
|
584
|
+
}, Se = (e) => {
|
|
585
585
|
let t = {
|
|
586
586
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
587
|
-
...
|
|
587
|
+
...xe()
|
|
588
588
|
};
|
|
589
589
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
590
|
-
},
|
|
590
|
+
}, Ce = n(null), J = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
591
591
|
function we(e, t) {
|
|
592
592
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
593
593
|
}
|
|
594
|
-
var
|
|
594
|
+
var Y = (e) => {
|
|
595
595
|
let t = [];
|
|
596
596
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
597
597
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -601,36 +601,36 @@ var Te = (e) => {
|
|
|
601
601
|
}
|
|
602
602
|
return t;
|
|
603
603
|
};
|
|
604
|
-
function
|
|
604
|
+
function X(e) {
|
|
605
605
|
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
|
|
606
606
|
}
|
|
607
|
-
function
|
|
608
|
-
let n = t?.data ?? {}, r =
|
|
607
|
+
function Z(e, t) {
|
|
608
|
+
let n = t?.data ?? {}, r = Y(n);
|
|
609
609
|
if (!r.length) return e;
|
|
610
|
-
let i = RegExp(`:(${r.map(
|
|
610
|
+
let i = RegExp(`:(${r.map(J).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => X(we(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
611
611
|
return a(e);
|
|
612
612
|
}
|
|
613
|
-
var
|
|
613
|
+
var Te = {
|
|
614
614
|
margin: 0,
|
|
615
615
|
fontWeight: 700,
|
|
616
616
|
lineHeight: 1.2,
|
|
617
617
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
618
|
-
},
|
|
618
|
+
}, Ee = { margin: 0 }, De = {
|
|
619
619
|
display: "inline-block",
|
|
620
620
|
textDecoration: "none",
|
|
621
621
|
cursor: "pointer",
|
|
622
622
|
backgroundColor: "var(--page-accent, #111827)",
|
|
623
623
|
color: "var(--page-accent-text, #ffffff)"
|
|
624
|
-
},
|
|
624
|
+
}, Oe = {
|
|
625
625
|
flexGrow: 1,
|
|
626
626
|
display: "flex",
|
|
627
627
|
flexDirection: "column",
|
|
628
628
|
position: "relative"
|
|
629
|
-
},
|
|
629
|
+
}, ke = {
|
|
630
630
|
display: "flex",
|
|
631
631
|
flexDirection: "column"
|
|
632
632
|
};
|
|
633
|
-
function
|
|
633
|
+
function Ae({ style: e }) {
|
|
634
634
|
let t = e?.backgroundVideo;
|
|
635
635
|
if (!t) return null;
|
|
636
636
|
let n = {
|
|
@@ -656,7 +656,7 @@ function Me({ style: e }) {
|
|
|
656
656
|
background: r
|
|
657
657
|
} })] });
|
|
658
658
|
}
|
|
659
|
-
var
|
|
659
|
+
var je = (e, t) => e?.backgroundVideo ? {
|
|
660
660
|
position: "relative",
|
|
661
661
|
...t,
|
|
662
662
|
...P(e)
|
|
@@ -664,24 +664,24 @@ var Ne = (e, t) => e?.backgroundVideo ? {
|
|
|
664
664
|
...t,
|
|
665
665
|
...P(e)
|
|
666
666
|
};
|
|
667
|
-
function
|
|
667
|
+
function Me({ style: e, nodeRef: t, children: n }) {
|
|
668
668
|
return /* @__PURE__ */ f("div", {
|
|
669
669
|
ref: t,
|
|
670
670
|
style: {
|
|
671
|
-
...
|
|
671
|
+
...Oe,
|
|
672
672
|
...P(e)
|
|
673
673
|
},
|
|
674
|
-
children: [/* @__PURE__ */ d(
|
|
674
|
+
children: [/* @__PURE__ */ d(Ae, { style: e }), n]
|
|
675
675
|
});
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function Ne({ style: e, nodeRef: t, children: n }) {
|
|
678
678
|
return /* @__PURE__ */ f("section", {
|
|
679
679
|
ref: t,
|
|
680
|
-
style:
|
|
681
|
-
children: [/* @__PURE__ */ d(
|
|
680
|
+
style: je(e, ke),
|
|
681
|
+
children: [/* @__PURE__ */ d(Ae, { style: e }), n]
|
|
682
682
|
});
|
|
683
683
|
}
|
|
684
|
-
function
|
|
684
|
+
function Pe({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
685
685
|
let i = t ? {
|
|
686
686
|
position: "relative",
|
|
687
687
|
minHeight: 240
|
|
@@ -690,32 +690,32 @@ function Ie({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
690
690
|
ref: n,
|
|
691
691
|
style: i ? {
|
|
692
692
|
...i,
|
|
693
|
-
...
|
|
694
|
-
} :
|
|
695
|
-
children: [/* @__PURE__ */ d(
|
|
693
|
+
...je(e)
|
|
694
|
+
} : je(e),
|
|
695
|
+
children: [/* @__PURE__ */ d(Ae, { style: e }), r]
|
|
696
696
|
});
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function Fe({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
699
699
|
return /* @__PURE__ */ d(n, {
|
|
700
700
|
ref: a,
|
|
701
701
|
style: {
|
|
702
|
-
...
|
|
702
|
+
...Te,
|
|
703
703
|
...P(r)
|
|
704
704
|
},
|
|
705
|
-
children:
|
|
705
|
+
children: Re(t, e, i)
|
|
706
706
|
});
|
|
707
707
|
}
|
|
708
|
-
var
|
|
709
|
-
fontFamily:
|
|
708
|
+
var Ie = {
|
|
709
|
+
fontFamily: ue.mono.value,
|
|
710
710
|
background: "rgba(148, 163, 184, 0.18)",
|
|
711
711
|
padding: "1px 5px",
|
|
712
712
|
borderRadius: 4,
|
|
713
713
|
fontSize: "0.9em"
|
|
714
714
|
};
|
|
715
|
-
function
|
|
715
|
+
function Le(e, t = [], n, r) {
|
|
716
716
|
let i = e;
|
|
717
717
|
return t.includes("sup") ? i = /* @__PURE__ */ d("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ d("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ d("code", {
|
|
718
|
-
style:
|
|
718
|
+
style: Ie,
|
|
719
719
|
children: i
|
|
720
720
|
})), t.includes("strike") && (i = /* @__PURE__ */ d("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ d("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ d("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ d("strong", { children: i })), n && (i = /* @__PURE__ */ d("a", {
|
|
721
721
|
href: n,
|
|
@@ -725,13 +725,13 @@ function ze(e, t = [], n, r) {
|
|
|
725
725
|
children: i
|
|
726
726
|
})), i;
|
|
727
727
|
}
|
|
728
|
-
function
|
|
728
|
+
function Re(e, n, r) {
|
|
729
729
|
return e?.length ? e.map((e, n) => {
|
|
730
730
|
if (e.slot) return /* @__PURE__ */ d(t, { children: r?.[e.slot] ?? null }, n);
|
|
731
|
-
if (e.parts) return /* @__PURE__ */ d(t, { children:
|
|
731
|
+
if (e.parts) return /* @__PURE__ */ d(t, { children: Re(e.parts, "", r) }, n);
|
|
732
732
|
let i = e.text;
|
|
733
733
|
return e.sup ? i = /* @__PURE__ */ d("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ d("sub", { children: i })), e.code && (i = /* @__PURE__ */ d("code", {
|
|
734
|
-
style:
|
|
734
|
+
style: Ie,
|
|
735
735
|
children: i
|
|
736
736
|
})), e.strike && (i = /* @__PURE__ */ d("s", { children: i })), e.underline && (i = /* @__PURE__ */ d("u", { children: i })), e.italic && (i = /* @__PURE__ */ d("em", { children: i })), e.bold && (i = /* @__PURE__ */ d("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ d("span", {
|
|
737
737
|
style: {
|
|
@@ -748,13 +748,13 @@ function X(e, n, r) {
|
|
|
748
748
|
})), /* @__PURE__ */ d(t, { children: i }, n);
|
|
749
749
|
}) : n;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function ze({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
752
752
|
return /* @__PURE__ */ d("span", {
|
|
753
753
|
style: P(a),
|
|
754
|
-
children: e?.length ?
|
|
754
|
+
children: e?.length ? Re(e, t) : Le(t, n, r, i)
|
|
755
755
|
});
|
|
756
756
|
}
|
|
757
|
-
var
|
|
757
|
+
var Be = {
|
|
758
758
|
h1: 40,
|
|
759
759
|
h2: 32,
|
|
760
760
|
h3: 26,
|
|
@@ -762,7 +762,7 @@ var Ve = {
|
|
|
762
762
|
h5: 19,
|
|
763
763
|
h6: 16
|
|
764
764
|
};
|
|
765
|
-
function
|
|
765
|
+
function Ve({ align: e = "center", width: t, wrap: n } = {}) {
|
|
766
766
|
let r = t ? `${t}%` : void 0;
|
|
767
767
|
if (e === "full") return { width: "100%" };
|
|
768
768
|
let i = e === "left" || e === "right";
|
|
@@ -796,8 +796,8 @@ function He({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
796
796
|
marginRight: "auto"
|
|
797
797
|
};
|
|
798
798
|
}
|
|
799
|
-
function
|
|
800
|
-
let r = n ?? ((e, n) =>
|
|
799
|
+
function He(e = [], t, n) {
|
|
800
|
+
let r = n ?? ((e, n) => Re(e, n, t));
|
|
801
801
|
return e.map((t, n) => {
|
|
802
802
|
let i = {
|
|
803
803
|
marginTop: 0,
|
|
@@ -819,7 +819,7 @@ function Ue(e = [], t, n) {
|
|
|
819
819
|
marginLeft: 0,
|
|
820
820
|
marginRight: 0,
|
|
821
821
|
...i,
|
|
822
|
-
...
|
|
822
|
+
...Ve(t)
|
|
823
823
|
},
|
|
824
824
|
children: [t.href ? /* @__PURE__ */ d("a", {
|
|
825
825
|
href: t.href,
|
|
@@ -838,16 +838,16 @@ function Ue(e = [], t, n) {
|
|
|
838
838
|
})]
|
|
839
839
|
}, n);
|
|
840
840
|
}
|
|
841
|
-
if (t.type === "video") return
|
|
841
|
+
if (t.type === "video") return $e(t.url) ? /* @__PURE__ */ d("div", {
|
|
842
842
|
style: {
|
|
843
843
|
...i,
|
|
844
|
-
...
|
|
844
|
+
...Ve({
|
|
845
845
|
align: t.align,
|
|
846
846
|
wrap: t.wrap,
|
|
847
847
|
width: t.width ?? 100
|
|
848
848
|
})
|
|
849
849
|
},
|
|
850
|
-
children: /* @__PURE__ */ d(
|
|
850
|
+
children: /* @__PURE__ */ d(et, {
|
|
851
851
|
url: t.url,
|
|
852
852
|
autoplay: t.autoplay,
|
|
853
853
|
muted: t.muted,
|
|
@@ -856,6 +856,47 @@ function Ue(e = [], t, n) {
|
|
|
856
856
|
start: t.start
|
|
857
857
|
})
|
|
858
858
|
}, n) : null;
|
|
859
|
+
if (t.type === "button") {
|
|
860
|
+
if (!(typeof t.label == "string" && t.label.trim())) return null;
|
|
861
|
+
let e = Number.isFinite(Number(t.radius)) ? Number(t.radius) : 8, r = ["center", "right"].includes(t.align) ? t.align : "left";
|
|
862
|
+
return /* @__PURE__ */ d("div", {
|
|
863
|
+
style: {
|
|
864
|
+
...i,
|
|
865
|
+
textAlign: r
|
|
866
|
+
},
|
|
867
|
+
children: /* @__PURE__ */ d("table", {
|
|
868
|
+
role: "presentation",
|
|
869
|
+
cellPadding: 0,
|
|
870
|
+
cellSpacing: 0,
|
|
871
|
+
style: {
|
|
872
|
+
borderCollapse: "separate",
|
|
873
|
+
display: "inline-table"
|
|
874
|
+
},
|
|
875
|
+
children: /* @__PURE__ */ d("tbody", { children: /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
876
|
+
style: {
|
|
877
|
+
backgroundColor: t.bg || "var(--page-accent, #4f46e5)",
|
|
878
|
+
borderRadius: e
|
|
879
|
+
},
|
|
880
|
+
children: /* @__PURE__ */ d("a", {
|
|
881
|
+
href: t.href || "#",
|
|
882
|
+
target: t.target || void 0,
|
|
883
|
+
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
884
|
+
style: {
|
|
885
|
+
display: "inline-block",
|
|
886
|
+
padding: "13px 24px",
|
|
887
|
+
color: t.color || "#ffffff",
|
|
888
|
+
fontSize: 15,
|
|
889
|
+
fontWeight: 600,
|
|
890
|
+
lineHeight: 1.2,
|
|
891
|
+
textDecoration: "none",
|
|
892
|
+
borderRadius: e
|
|
893
|
+
},
|
|
894
|
+
children: t.label
|
|
895
|
+
})
|
|
896
|
+
}) }) })
|
|
897
|
+
})
|
|
898
|
+
}, n);
|
|
899
|
+
}
|
|
859
900
|
if (t.type === "divider") return /* @__PURE__ */ d("hr", { style: {
|
|
860
901
|
...i,
|
|
861
902
|
border: 0,
|
|
@@ -909,17 +950,17 @@ function Ue(e = [], t, n) {
|
|
|
909
950
|
}
|
|
910
951
|
if (t.type === "quote") return /* @__PURE__ */ d("blockquote", {
|
|
911
952
|
style: {
|
|
912
|
-
...
|
|
953
|
+
...We,
|
|
913
954
|
...i
|
|
914
955
|
},
|
|
915
956
|
children: r(t.parts, t.text)
|
|
916
957
|
}, n);
|
|
917
|
-
if (
|
|
958
|
+
if (Be[t.type]) {
|
|
918
959
|
let e = t.type;
|
|
919
960
|
return /* @__PURE__ */ d(e, {
|
|
920
961
|
style: {
|
|
921
|
-
...
|
|
922
|
-
fontSize:
|
|
962
|
+
...Te,
|
|
963
|
+
fontSize: Be[t.type],
|
|
923
964
|
...i
|
|
924
965
|
},
|
|
925
966
|
children: r(t.parts, t.text)
|
|
@@ -927,39 +968,39 @@ function Ue(e = [], t, n) {
|
|
|
927
968
|
}
|
|
928
969
|
return /* @__PURE__ */ d("p", {
|
|
929
970
|
style: {
|
|
930
|
-
...
|
|
971
|
+
...Ee,
|
|
931
972
|
...i
|
|
932
973
|
},
|
|
933
974
|
children: r(t.parts, t.text)
|
|
934
975
|
}, n);
|
|
935
976
|
});
|
|
936
977
|
}
|
|
937
|
-
function
|
|
978
|
+
function Ue({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
938
979
|
return /* @__PURE__ */ d("div", {
|
|
939
980
|
ref: r,
|
|
940
981
|
style: {
|
|
941
982
|
display: "flow-root",
|
|
942
983
|
...P(t)
|
|
943
984
|
},
|
|
944
|
-
children:
|
|
985
|
+
children: He(e, n)
|
|
945
986
|
});
|
|
946
987
|
}
|
|
947
|
-
var
|
|
988
|
+
var We = {
|
|
948
989
|
margin: 0,
|
|
949
990
|
padding: "8px 0 8px 20px",
|
|
950
991
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
951
992
|
};
|
|
952
|
-
function
|
|
993
|
+
function Ge({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
953
994
|
return /* @__PURE__ */ d("blockquote", {
|
|
954
995
|
ref: i,
|
|
955
996
|
style: {
|
|
956
|
-
...
|
|
997
|
+
...We,
|
|
957
998
|
...P(n)
|
|
958
999
|
},
|
|
959
|
-
children:
|
|
1000
|
+
children: Re(t, e, r)
|
|
960
1001
|
});
|
|
961
1002
|
}
|
|
962
|
-
function
|
|
1003
|
+
function Ke({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
963
1004
|
return /* @__PURE__ */ d(e ? "ol" : "ul", {
|
|
964
1005
|
ref: r,
|
|
965
1006
|
style: {
|
|
@@ -969,53 +1010,53 @@ function qe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
969
1010
|
},
|
|
970
1011
|
children: t.map((e, t) => /* @__PURE__ */ d("li", {
|
|
971
1012
|
style: { marginBottom: 4 },
|
|
972
|
-
children:
|
|
1013
|
+
children: Re(e.parts, e.text)
|
|
973
1014
|
}, t))
|
|
974
1015
|
});
|
|
975
1016
|
}
|
|
976
|
-
function
|
|
1017
|
+
function qe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
977
1018
|
return /* @__PURE__ */ d("p", {
|
|
978
1019
|
ref: i,
|
|
979
1020
|
style: {
|
|
980
|
-
...
|
|
1021
|
+
...Ee,
|
|
981
1022
|
...P(n)
|
|
982
1023
|
},
|
|
983
|
-
children:
|
|
1024
|
+
children: Re(t, e, r)
|
|
984
1025
|
});
|
|
985
1026
|
}
|
|
986
|
-
var
|
|
1027
|
+
var Je = {
|
|
987
1028
|
color: "var(--page-accent, inherit)",
|
|
988
1029
|
textDecoration: "underline",
|
|
989
1030
|
textUnderlineOffset: 3,
|
|
990
1031
|
cursor: "pointer"
|
|
991
1032
|
};
|
|
992
|
-
function
|
|
1033
|
+
function Ye({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
993
1034
|
return /* @__PURE__ */ d("a", {
|
|
994
1035
|
ref: o,
|
|
995
1036
|
href: n || "#",
|
|
996
1037
|
target: r || void 0,
|
|
997
1038
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
998
1039
|
style: {
|
|
999
|
-
...
|
|
1040
|
+
...Je,
|
|
1000
1041
|
...P(i)
|
|
1001
1042
|
},
|
|
1002
|
-
children:
|
|
1043
|
+
children: Re(t, e, a)
|
|
1003
1044
|
});
|
|
1004
1045
|
}
|
|
1005
|
-
function
|
|
1046
|
+
function Xe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1006
1047
|
return /* @__PURE__ */ d("a", {
|
|
1007
1048
|
ref: o,
|
|
1008
1049
|
href: n || "#",
|
|
1009
1050
|
target: r || void 0,
|
|
1010
1051
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1011
1052
|
style: {
|
|
1012
|
-
...
|
|
1053
|
+
...De,
|
|
1013
1054
|
...P(i)
|
|
1014
1055
|
},
|
|
1015
|
-
children:
|
|
1056
|
+
children: Re(t, e, a)
|
|
1016
1057
|
});
|
|
1017
1058
|
}
|
|
1018
|
-
function
|
|
1059
|
+
function Ze({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
1019
1060
|
return e ? /* @__PURE__ */ d("img", {
|
|
1020
1061
|
ref: r,
|
|
1021
1062
|
src: e,
|
|
@@ -1027,7 +1068,7 @@ function Qe({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
1027
1068
|
}
|
|
1028
1069
|
}) : null;
|
|
1029
1070
|
}
|
|
1030
|
-
function
|
|
1071
|
+
function Qe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
1031
1072
|
return e ? /* @__PURE__ */ d("video", {
|
|
1032
1073
|
ref: s,
|
|
1033
1074
|
src: e,
|
|
@@ -1045,9 +1086,9 @@ function $e({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
1045
1086
|
}
|
|
1046
1087
|
}) : null;
|
|
1047
1088
|
}
|
|
1048
|
-
var
|
|
1049
|
-
function
|
|
1050
|
-
let c =
|
|
1089
|
+
var $e = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
1090
|
+
function et({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
1091
|
+
let c = $e(e);
|
|
1051
1092
|
if (!c) return null;
|
|
1052
1093
|
let l = new URLSearchParams({ rel: "0" });
|
|
1053
1094
|
return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ d("div", {
|
|
@@ -1073,7 +1114,7 @@ function tt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
1073
1114
|
})
|
|
1074
1115
|
});
|
|
1075
1116
|
}
|
|
1076
|
-
function
|
|
1117
|
+
function tt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
1077
1118
|
return e ? /* @__PURE__ */ d("iframe", {
|
|
1078
1119
|
ref: i,
|
|
1079
1120
|
src: e,
|
|
@@ -1089,7 +1130,7 @@ function nt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
1089
1130
|
}
|
|
1090
1131
|
}) : null;
|
|
1091
1132
|
}
|
|
1092
|
-
function
|
|
1133
|
+
function nt({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
1093
1134
|
let [i, o] = l(null);
|
|
1094
1135
|
return a(() => {
|
|
1095
1136
|
i && (i.innerHTML = e || "", t && i.querySelectorAll("script").forEach((e) => {
|
|
@@ -1108,7 +1149,7 @@ function rt({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
1108
1149
|
style: P(n)
|
|
1109
1150
|
});
|
|
1110
1151
|
}
|
|
1111
|
-
function
|
|
1152
|
+
function rt({ height: e, nodeRef: t }) {
|
|
1112
1153
|
return /* @__PURE__ */ d("div", {
|
|
1113
1154
|
ref: t,
|
|
1114
1155
|
style: {
|
|
@@ -1118,7 +1159,7 @@ function it({ height: e, nodeRef: t }) {
|
|
|
1118
1159
|
}
|
|
1119
1160
|
});
|
|
1120
1161
|
}
|
|
1121
|
-
function
|
|
1162
|
+
function it({ style: e, nodeRef: t }) {
|
|
1122
1163
|
return /* @__PURE__ */ d("div", {
|
|
1123
1164
|
ref: t,
|
|
1124
1165
|
style: {
|
|
@@ -1129,7 +1170,7 @@ function at({ style: e, nodeRef: t }) {
|
|
|
1129
1170
|
}
|
|
1130
1171
|
});
|
|
1131
1172
|
}
|
|
1132
|
-
var
|
|
1173
|
+
var at = {
|
|
1133
1174
|
position: "absolute",
|
|
1134
1175
|
top: "50%",
|
|
1135
1176
|
transform: "translateY(-50%)",
|
|
@@ -1146,7 +1187,7 @@ var ot = {
|
|
|
1146
1187
|
alignItems: "center",
|
|
1147
1188
|
justifyContent: "center",
|
|
1148
1189
|
padding: 0
|
|
1149
|
-
},
|
|
1190
|
+
}, ot = {
|
|
1150
1191
|
bottom: {
|
|
1151
1192
|
inset: "auto 0 0 0",
|
|
1152
1193
|
padding: "40px 24px 20px",
|
|
@@ -1165,8 +1206,8 @@ var ot = {
|
|
|
1165
1206
|
padding: 24,
|
|
1166
1207
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1167
1208
|
}
|
|
1168
|
-
},
|
|
1169
|
-
function
|
|
1209
|
+
}, st = 48;
|
|
1210
|
+
function ct({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
|
|
1170
1211
|
let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1171
1212
|
if (a(() => {
|
|
1172
1213
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1182,7 +1223,7 @@ function lt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1182
1223
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1183
1224
|
if (!_) return;
|
|
1184
1225
|
let { dx: e } = _;
|
|
1185
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1226
|
+
v(null), e < -48 ? b(y + 1) : e > st && b(y - 1);
|
|
1186
1227
|
};
|
|
1187
1228
|
return /* @__PURE__ */ f("div", {
|
|
1188
1229
|
ref: c,
|
|
@@ -1230,7 +1271,7 @@ function lt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1230
1271
|
type: "button",
|
|
1231
1272
|
"aria-label": "Previous slide",
|
|
1232
1273
|
style: {
|
|
1233
|
-
...
|
|
1274
|
+
...at,
|
|
1234
1275
|
left: 12
|
|
1235
1276
|
},
|
|
1236
1277
|
onClick: () => b(y - 1),
|
|
@@ -1240,7 +1281,7 @@ function lt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1240
1281
|
type: "button",
|
|
1241
1282
|
"aria-label": "Next slide",
|
|
1242
1283
|
style: {
|
|
1243
|
-
...
|
|
1284
|
+
...at,
|
|
1244
1285
|
right: 12
|
|
1245
1286
|
},
|
|
1246
1287
|
onClick: () => b(y + 1),
|
|
@@ -1274,7 +1315,7 @@ function lt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1274
1315
|
] })]
|
|
1275
1316
|
});
|
|
1276
1317
|
}
|
|
1277
|
-
var
|
|
1318
|
+
var lt = (e, t) => ({
|
|
1278
1319
|
position: "absolute",
|
|
1279
1320
|
inset: 0,
|
|
1280
1321
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1282,18 +1323,18 @@ var ut = (e, t) => ({
|
|
|
1282
1323
|
backgroundSize: "cover",
|
|
1283
1324
|
backgroundPosition: "center"
|
|
1284
1325
|
});
|
|
1285
|
-
function
|
|
1286
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1326
|
+
function ut({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1327
|
+
return e.length ? /* @__PURE__ */ d(ct, {
|
|
1287
1328
|
...r,
|
|
1288
1329
|
count: e.length,
|
|
1289
1330
|
renderSlide: (r) => {
|
|
1290
1331
|
let i = e[r];
|
|
1291
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1332
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: lt(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
|
|
1292
1333
|
style: {
|
|
1293
1334
|
position: "absolute",
|
|
1294
1335
|
color: "#fff",
|
|
1295
1336
|
textAlign: n,
|
|
1296
|
-
...
|
|
1337
|
+
...ot[t] ?? ot.bottom
|
|
1297
1338
|
},
|
|
1298
1339
|
children: [i.title && /* @__PURE__ */ d("div", {
|
|
1299
1340
|
style: {
|
|
@@ -1313,13 +1354,13 @@ function dt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1313
1354
|
}
|
|
1314
1355
|
}) : null;
|
|
1315
1356
|
}
|
|
1316
|
-
function
|
|
1317
|
-
return e.length ? /* @__PURE__ */ d(
|
|
1357
|
+
function dt({ slides: e = [], linked: t, ...n }) {
|
|
1358
|
+
return e.length ? /* @__PURE__ */ d(ct, {
|
|
1318
1359
|
...n,
|
|
1319
1360
|
count: e.length,
|
|
1320
1361
|
renderSlide: (n) => {
|
|
1321
1362
|
let r = e[n];
|
|
1322
|
-
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style:
|
|
1363
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: lt(r.image, r.color) }), /* @__PURE__ */ d("div", {
|
|
1323
1364
|
style: {
|
|
1324
1365
|
position: "absolute",
|
|
1325
1366
|
inset: 0,
|
|
@@ -1331,23 +1372,23 @@ function ft({ slides: e = [], linked: t, ...n }) {
|
|
|
1331
1372
|
}
|
|
1332
1373
|
}) : null;
|
|
1333
1374
|
}
|
|
1334
|
-
var
|
|
1335
|
-
let r =
|
|
1375
|
+
var Q = 256, ft = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), pt = (e, t, n) => {
|
|
1376
|
+
let r = Q * 2 ** n;
|
|
1336
1377
|
return {
|
|
1337
1378
|
x: (Number(t) + 180) / 360 * r,
|
|
1338
|
-
y: (.5 -
|
|
1379
|
+
y: (.5 - ft(Number(e)) / (2 * Math.PI)) * r
|
|
1339
1380
|
};
|
|
1340
|
-
},
|
|
1381
|
+
}, $ = (e, t) => {
|
|
1341
1382
|
if (e === "" || e == null) return null;
|
|
1342
1383
|
let n = Number(e);
|
|
1343
1384
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1344
|
-
},
|
|
1345
|
-
function
|
|
1385
|
+
}, mt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1386
|
+
function ht(e, t, n = "directions", r = "") {
|
|
1346
1387
|
let i = `${e},${t}`;
|
|
1347
1388
|
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)}`;
|
|
1348
1389
|
}
|
|
1349
|
-
var
|
|
1350
|
-
function
|
|
1390
|
+
var gt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1391
|
+
function _t({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize: o = 22, pinLink: s = "directions", link: u = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
|
|
1351
1392
|
let _ = c(null), [v, y] = l(1200);
|
|
1352
1393
|
a(() => {
|
|
1353
1394
|
let e = _.current;
|
|
@@ -1357,19 +1398,19 @@ function vt({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1357
1398
|
let n = new ResizeObserver(t);
|
|
1358
1399
|
return n.observe(e), () => n.disconnect();
|
|
1359
1400
|
}, []);
|
|
1360
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1401
|
+
let b = (Array.isArray(e) ? e : []).filter(mt), x = mt({
|
|
1361
1402
|
lat: t,
|
|
1362
1403
|
lng: n
|
|
1363
1404
|
}) ? {
|
|
1364
|
-
lat:
|
|
1365
|
-
lng:
|
|
1405
|
+
lat: $(t, 90),
|
|
1406
|
+
lng: $(n, 180)
|
|
1366
1407
|
} : b.length ? {
|
|
1367
|
-
lat: b.reduce((e, t) => e +
|
|
1368
|
-
lng: b.reduce((e, t) => e +
|
|
1369
|
-
} : null, S = Math.max(80, Number(i) || 320), C =
|
|
1408
|
+
lat: b.reduce((e, t) => e + $(t.lat, 90), 0) / b.length,
|
|
1409
|
+
lng: b.reduce((e, t) => e + $(t.lng, 180), 0) / b.length
|
|
1410
|
+
} : null, S = Math.max(80, Number(i) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1370
1411
|
if (b.length < 2) return 13;
|
|
1371
1412
|
for (let e = 19; e >= 1; e--) {
|
|
1372
|
-
let t = b.map((t) =>
|
|
1413
|
+
let t = b.map((t) => pt($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
|
|
1373
1414
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1374
1415
|
}
|
|
1375
1416
|
return 1;
|
|
@@ -1393,12 +1434,12 @@ function vt({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1393
1434
|
},
|
|
1394
1435
|
children: "Set the coordinates in Settings"
|
|
1395
1436
|
});
|
|
1396
|
-
let T =
|
|
1437
|
+
let T = pt(x.lat, x.lng, C), E = {
|
|
1397
1438
|
x: T.x - v / 2,
|
|
1398
1439
|
y: T.y - S / 2
|
|
1399
1440
|
}, D = [], O = [];
|
|
1400
|
-
for (let e = Math.floor(E.x /
|
|
1401
|
-
for (let e = Math.floor(E.y /
|
|
1441
|
+
for (let e = Math.floor(E.x / Q); e <= Math.floor((E.x + v) / Q); e++) D.push(e);
|
|
1442
|
+
for (let e = Math.floor(E.y / Q); e <= Math.floor((E.y + S) / Q); e++) O.push(e);
|
|
1402
1443
|
let k = 2 ** C;
|
|
1403
1444
|
return /* @__PURE__ */ f("div", {
|
|
1404
1445
|
ref: (e) => {
|
|
@@ -1421,22 +1462,22 @@ function vt({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1421
1462
|
return e < 0 || e >= k ? null : /* @__PURE__ */ d("img", {
|
|
1422
1463
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1423
1464
|
alt: "",
|
|
1424
|
-
width:
|
|
1425
|
-
height:
|
|
1465
|
+
width: Q,
|
|
1466
|
+
height: Q,
|
|
1426
1467
|
loading: "lazy",
|
|
1427
1468
|
style: {
|
|
1428
1469
|
position: "absolute",
|
|
1429
|
-
left: Math.round(t *
|
|
1430
|
-
top: Math.round(e *
|
|
1431
|
-
width:
|
|
1432
|
-
height:
|
|
1470
|
+
left: Math.round(t * Q - E.x),
|
|
1471
|
+
top: Math.round(e * Q - E.y),
|
|
1472
|
+
width: Q,
|
|
1473
|
+
height: Q,
|
|
1433
1474
|
userSelect: "none",
|
|
1434
1475
|
pointerEvents: "none"
|
|
1435
1476
|
}
|
|
1436
1477
|
}, `${t}-${e}`);
|
|
1437
1478
|
})),
|
|
1438
1479
|
b.map((e, t) => {
|
|
1439
|
-
let n =
|
|
1480
|
+
let n = pt($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", c = s === "none" || g ? null : ht($(e.lat, 90), $(e.lng, 180), s, e.title);
|
|
1440
1481
|
return /* @__PURE__ */ f(c ? "a" : "span", {
|
|
1441
1482
|
href: c || void 0,
|
|
1442
1483
|
target: c ? "_blank" : void 0,
|
|
@@ -1475,8 +1516,8 @@ function vt({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1475
1516
|
viewBox: "0 0 24 24",
|
|
1476
1517
|
fill: a,
|
|
1477
1518
|
style: { display: "block" },
|
|
1478
|
-
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
1479
|
-
d:
|
|
1519
|
+
children: [/* @__PURE__ */ d("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), vt[e.icon] ? /* @__PURE__ */ d("path", {
|
|
1520
|
+
d: vt[e.icon],
|
|
1480
1521
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1481
1522
|
fill: "none",
|
|
1482
1523
|
stroke: "#fff",
|
|
@@ -1512,7 +1553,7 @@ function vt({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1512
1553
|
})
|
|
1513
1554
|
]
|
|
1514
1555
|
}), u ? /* @__PURE__ */ d("a", {
|
|
1515
|
-
href:
|
|
1556
|
+
href: gt(x.lat, x.lng, C),
|
|
1516
1557
|
target: "_blank",
|
|
1517
1558
|
rel: "noopener noreferrer",
|
|
1518
1559
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1526,7 +1567,7 @@ function vt({ markers: e, lat: t, lng: n, zoom: r = "", height: i = 320, pinSize
|
|
|
1526
1567
|
}) : null]
|
|
1527
1568
|
});
|
|
1528
1569
|
}
|
|
1529
|
-
var
|
|
1570
|
+
var vt = {
|
|
1530
1571
|
check: "M4 12l5 5L20 6",
|
|
1531
1572
|
close: "M6 6l12 12M18 6L6 18",
|
|
1532
1573
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1623,8 +1664,8 @@ var yt = {
|
|
|
1623
1664
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1624
1665
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1625
1666
|
};
|
|
1626
|
-
function
|
|
1627
|
-
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [
|
|
1667
|
+
function yt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: u, inert: f }) {
|
|
1668
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [vt[e] ?? vt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ d("svg", {
|
|
1628
1669
|
viewBox: "0 0 24 24",
|
|
1629
1670
|
width: g,
|
|
1630
1671
|
height: g,
|
|
@@ -1660,8 +1701,8 @@ function bt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1660
1701
|
children: v
|
|
1661
1702
|
});
|
|
1662
1703
|
}
|
|
1663
|
-
function
|
|
1664
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
1704
|
+
function bt(e, t = {}, n = 0) {
|
|
1705
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : X(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1665
1706
|
for (let e of r) {
|
|
1666
1707
|
let n = e.data ?? e, r = we(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(we(n, t.nameField)) : i(n.name), l = t.hrefField ? i(we(n, t.hrefField)) : "";
|
|
1667
1708
|
for (let e of s) if (o.push({
|
|
@@ -1673,8 +1714,8 @@ function xt(e, t = {}, n = 0) {
|
|
|
1673
1714
|
}
|
|
1674
1715
|
return o;
|
|
1675
1716
|
}
|
|
1676
|
-
function
|
|
1677
|
-
let { tenant: x, apiUrl: S } = i(
|
|
1717
|
+
function xt({ images: e = [], source: t = "", entry: n = "", imageField: r = "", nameField: o = "", hrefField: s = "", limit: c = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
|
|
1718
|
+
let { tenant: x, apiUrl: S } = i(q), C = i(ye)?.[t], [w, T] = l(null), [E, D] = l(() => /* @__PURE__ */ new Set());
|
|
1678
1719
|
a(() => {
|
|
1679
1720
|
if (!t || C) return;
|
|
1680
1721
|
let e = !0;
|
|
@@ -1691,7 +1732,7 @@ function St({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1691
1732
|
C
|
|
1692
1733
|
]);
|
|
1693
1734
|
let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, A = Math.max(0, Number(c) || 0), j = t ? (() => {
|
|
1694
|
-
let e =
|
|
1735
|
+
let e = bt(k, {
|
|
1695
1736
|
imageField: r,
|
|
1696
1737
|
nameField: o,
|
|
1697
1738
|
hrefField: s
|
|
@@ -1896,20 +1937,20 @@ function St({ images: e = [], source: t = "", entry: n = "", imageField: r = "",
|
|
|
1896
1937
|
]
|
|
1897
1938
|
});
|
|
1898
1939
|
}
|
|
1899
|
-
var
|
|
1940
|
+
var St = {
|
|
1900
1941
|
color: "inherit",
|
|
1901
1942
|
textDecoration: "none",
|
|
1902
1943
|
fontSize: 14,
|
|
1903
1944
|
opacity: .85
|
|
1904
|
-
},
|
|
1945
|
+
}, Ct = {
|
|
1905
1946
|
background: "var(--page-surface, #f2f2f2)",
|
|
1906
1947
|
color: "var(--page-text, #111827)",
|
|
1907
1948
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1908
1949
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1909
1950
|
zIndex: 60
|
|
1910
1951
|
};
|
|
1911
|
-
function
|
|
1912
|
-
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 ? "" :
|
|
1952
|
+
function wt(e, t = {}, n = "dropdown") {
|
|
1953
|
+
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 ? "" : X(e), o = r.map((e) => {
|
|
1913
1954
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
1914
1955
|
return {
|
|
1915
1956
|
key: e.id,
|
|
@@ -1950,8 +1991,8 @@ function Tt(e, t = {}, n = "dropdown") {
|
|
|
1950
1991
|
type: e.children.length ? n : "link"
|
|
1951
1992
|
}));
|
|
1952
1993
|
}
|
|
1953
|
-
function
|
|
1954
|
-
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(
|
|
1994
|
+
function Tt({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], style: c, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
|
|
1995
|
+
let [C, w] = l(null), [T, E] = l(!1), [D, O] = l(!1), [k, A] = l(null), { tenant: j, apiUrl: M } = i(q), N = i(ye)?.[g], [F, I] = l(null);
|
|
1955
1996
|
a(() => {
|
|
1956
1997
|
if (!g || N) return;
|
|
1957
1998
|
let e = !0;
|
|
@@ -1971,7 +2012,7 @@ function Et({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
1971
2012
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
1972
2013
|
return e.observe(C), () => e.disconnect();
|
|
1973
2014
|
}, [C, h]);
|
|
1974
|
-
let L = g ?
|
|
2015
|
+
let L = g ? wt(N ?? F ?? [], {
|
|
1975
2016
|
labelField: _,
|
|
1976
2017
|
hrefField: v,
|
|
1977
2018
|
imageField: y,
|
|
@@ -2000,7 +2041,7 @@ function Et({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2000
2041
|
return /* @__PURE__ */ f("a", {
|
|
2001
2042
|
href: e.href || "#",
|
|
2002
2043
|
style: {
|
|
2003
|
-
...
|
|
2044
|
+
...St,
|
|
2004
2045
|
display: n ? "block" : "flex",
|
|
2005
2046
|
alignItems: n ? void 0 : "center",
|
|
2006
2047
|
gap: n ? void 0 : 10,
|
|
@@ -2097,7 +2138,7 @@ function Et({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2097
2138
|
let t = e.children ?? [];
|
|
2098
2139
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
2099
2140
|
href: e.href || "#",
|
|
2100
|
-
style:
|
|
2141
|
+
style: St,
|
|
2101
2142
|
children: e.label
|
|
2102
2143
|
}, e.key);
|
|
2103
2144
|
let n = e.type === "mega";
|
|
@@ -2111,7 +2152,7 @@ function Et({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2111
2152
|
children: [/* @__PURE__ */ f("a", {
|
|
2112
2153
|
href: e.href || "#",
|
|
2113
2154
|
style: {
|
|
2114
|
-
...
|
|
2155
|
+
...St,
|
|
2115
2156
|
cursor: "pointer"
|
|
2116
2157
|
},
|
|
2117
2158
|
children: [
|
|
@@ -2127,7 +2168,7 @@ function Et({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2127
2168
|
]
|
|
2128
2169
|
}), k === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
2129
2170
|
style: {
|
|
2130
|
-
...
|
|
2171
|
+
...Ct,
|
|
2131
2172
|
position: "absolute",
|
|
2132
2173
|
left: 0,
|
|
2133
2174
|
right: 0,
|
|
@@ -2143,7 +2184,7 @@ function Et({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2143
2184
|
}, !0))
|
|
2144
2185
|
}) : /* @__PURE__ */ d("div", {
|
|
2145
2186
|
style: {
|
|
2146
|
-
...
|
|
2187
|
+
...Ct,
|
|
2147
2188
|
position: "absolute",
|
|
2148
2189
|
top: "100%",
|
|
2149
2190
|
left: 0,
|
|
@@ -2172,7 +2213,7 @@ function Et({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2172
2213
|
children: L.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
2173
2214
|
href: e.href || "#",
|
|
2174
2215
|
style: {
|
|
2175
|
-
...
|
|
2216
|
+
...St,
|
|
2176
2217
|
padding: "10px 4px",
|
|
2177
2218
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
2178
2219
|
opacity: 1
|
|
@@ -2183,7 +2224,7 @@ function Et({ brand: e, logo: n, brandHref: r, brandTarget: o, links: s = [], st
|
|
|
2183
2224
|
]
|
|
2184
2225
|
});
|
|
2185
2226
|
}
|
|
2186
|
-
function
|
|
2227
|
+
function Et({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2187
2228
|
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2188
2229
|
return e.length ? /* @__PURE__ */ f("div", {
|
|
2189
2230
|
ref: r,
|
|
@@ -2223,7 +2264,7 @@ function Dt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2223
2264
|
}, e.key))]
|
|
2224
2265
|
}) : null;
|
|
2225
2266
|
}
|
|
2226
|
-
function
|
|
2267
|
+
function Dt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
2227
2268
|
let [a, o] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
2228
2269
|
if (!e.length) return null;
|
|
2229
2270
|
let s = (e) => o((t) => {
|
|
@@ -2280,15 +2321,15 @@ function Ot({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
2280
2321
|
})
|
|
2281
2322
|
});
|
|
2282
2323
|
}
|
|
2283
|
-
var
|
|
2324
|
+
var Ot = {
|
|
2284
2325
|
display: "flex",
|
|
2285
2326
|
flexDirection: "column",
|
|
2286
2327
|
gap: "12px"
|
|
2287
|
-
},
|
|
2328
|
+
}, kt = {
|
|
2288
2329
|
fontSize: "14px",
|
|
2289
2330
|
fontWeight: 500,
|
|
2290
2331
|
color: "var(--page-text, #111827)"
|
|
2291
|
-
},
|
|
2332
|
+
}, At = {
|
|
2292
2333
|
padding: "10px 12px",
|
|
2293
2334
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2294
2335
|
borderRadius: "6px",
|
|
@@ -2298,13 +2339,13 @@ var kt = {
|
|
|
2298
2339
|
boxSizing: "border-box",
|
|
2299
2340
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2300
2341
|
color: "var(--page-text, #111827)"
|
|
2301
|
-
},
|
|
2342
|
+
}, jt = {
|
|
2302
2343
|
display: "flex",
|
|
2303
2344
|
alignItems: "center",
|
|
2304
2345
|
gap: "8px",
|
|
2305
2346
|
fontSize: "14px",
|
|
2306
2347
|
color: "var(--page-text, #111827)"
|
|
2307
|
-
},
|
|
2348
|
+
}, Mt = (e) => e ? {
|
|
2308
2349
|
readOnly: !0,
|
|
2309
2350
|
tabIndex: -1,
|
|
2310
2351
|
onMouseDown: (e) => e.preventDefault()
|
|
@@ -2348,7 +2389,7 @@ var Lt = "g-recaptcha-response", Rt = (e) => e?.type === "recaptcha" ? Lt : e?.n
|
|
|
2348
2389
|
function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2349
2390
|
let a = /* @__PURE__ */ f("span", {
|
|
2350
2391
|
style: {
|
|
2351
|
-
...
|
|
2392
|
+
...kt,
|
|
2352
2393
|
fontSize: 14
|
|
2353
2394
|
},
|
|
2354
2395
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2391,7 +2432,7 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2391
2432
|
size: e.captchaSize,
|
|
2392
2433
|
inert: r,
|
|
2393
2434
|
onChange: (e) => n(Lt, e)
|
|
2394
|
-
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(
|
|
2435
|
+
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(et, {
|
|
2395
2436
|
url: e.src,
|
|
2396
2437
|
style: { width: "100%" }
|
|
2397
2438
|
}) : /* @__PURE__ */ d("video", {
|
|
@@ -2467,7 +2508,7 @@ function zt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2467
2508
|
});
|
|
2468
2509
|
}
|
|
2469
2510
|
function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
2470
|
-
let { tenant: y, apiUrl: b } = i(
|
|
2511
|
+
let { tenant: y, apiUrl: b } = i(q), [x, S] = l("form"), [C, w] = l(null), [T, E] = l({}), [D, O] = l(0), k = h ? v || "form" : x;
|
|
2471
2512
|
a(() => {
|
|
2472
2513
|
if (!c || !s) return;
|
|
2473
2514
|
let e = !0;
|
|
@@ -2548,7 +2589,7 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2548
2589
|
}
|
|
2549
2590
|
},
|
|
2550
2591
|
style: {
|
|
2551
|
-
...
|
|
2592
|
+
...Ot,
|
|
2552
2593
|
display: k === "success" ? "none" : "flex"
|
|
2553
2594
|
},
|
|
2554
2595
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
@@ -2584,7 +2625,7 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2584
2625
|
disabled: h || void 0,
|
|
2585
2626
|
onClick: () => O(F - 1),
|
|
2586
2627
|
style: {
|
|
2587
|
-
...
|
|
2628
|
+
...De,
|
|
2588
2629
|
background: "transparent",
|
|
2589
2630
|
color: "inherit",
|
|
2590
2631
|
border: 0,
|
|
@@ -2597,7 +2638,7 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2597
2638
|
disabled: h || L.length > 0,
|
|
2598
2639
|
onClick: () => O(F + 1),
|
|
2599
2640
|
style: {
|
|
2600
|
-
...
|
|
2641
|
+
...De,
|
|
2601
2642
|
border: 0,
|
|
2602
2643
|
padding: "10px 22px",
|
|
2603
2644
|
borderRadius: 8,
|
|
@@ -2611,7 +2652,7 @@ function Bt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
2611
2652
|
type: "submit",
|
|
2612
2653
|
disabled: h || void 0,
|
|
2613
2654
|
style: {
|
|
2614
|
-
...
|
|
2655
|
+
...De,
|
|
2615
2656
|
border: 0,
|
|
2616
2657
|
padding: "10px 22px",
|
|
2617
2658
|
borderRadius: 8,
|
|
@@ -2658,7 +2699,7 @@ var Vt = null, Ht = null, Ut = (e) => {
|
|
|
2658
2699
|
}), Vt;
|
|
2659
2700
|
};
|
|
2660
2701
|
function Wt({ siteKey: e, theme: t, size: n, hl: r, style: o, nodeRef: s, inert: l, onChange: u }) {
|
|
2661
|
-
let p = i(
|
|
2702
|
+
let p = i(q), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = c(null), _ = c(u);
|
|
2662
2703
|
if (_.current = u, a(() => {
|
|
2663
2704
|
if (l || !h || !g.current) return;
|
|
2664
2705
|
let e = !0, i = (t) => {
|
|
@@ -2750,10 +2791,10 @@ function Gt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
|
2750
2791
|
return /* @__PURE__ */ d("label", {
|
|
2751
2792
|
ref: r,
|
|
2752
2793
|
style: {
|
|
2753
|
-
...
|
|
2794
|
+
...kt,
|
|
2754
2795
|
...P(n)
|
|
2755
2796
|
},
|
|
2756
|
-
children:
|
|
2797
|
+
children: Re(t, e, i)
|
|
2757
2798
|
});
|
|
2758
2799
|
}
|
|
2759
2800
|
function Kt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
@@ -2764,10 +2805,10 @@ function Kt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2764
2805
|
placeholder: n,
|
|
2765
2806
|
required: !o && !!r,
|
|
2766
2807
|
style: {
|
|
2767
|
-
...
|
|
2808
|
+
...At,
|
|
2768
2809
|
...P(i)
|
|
2769
2810
|
},
|
|
2770
|
-
|
|
2811
|
+
...Mt(o)
|
|
2771
2812
|
});
|
|
2772
2813
|
}
|
|
2773
2814
|
function qt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
@@ -2778,18 +2819,18 @@ function qt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2778
2819
|
rows: n,
|
|
2779
2820
|
required: !o && !!r,
|
|
2780
2821
|
style: {
|
|
2781
|
-
...
|
|
2822
|
+
...At,
|
|
2782
2823
|
resize: "vertical",
|
|
2783
2824
|
...P(i)
|
|
2784
2825
|
},
|
|
2785
|
-
|
|
2826
|
+
...Mt(o)
|
|
2786
2827
|
});
|
|
2787
2828
|
}
|
|
2788
2829
|
function Jt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2789
2830
|
return /* @__PURE__ */ f("label", {
|
|
2790
2831
|
ref: o,
|
|
2791
2832
|
style: {
|
|
2792
|
-
...
|
|
2833
|
+
...jt,
|
|
2793
2834
|
...P(a)
|
|
2794
2835
|
},
|
|
2795
2836
|
children: [/* @__PURE__ */ d("input", {
|
|
@@ -2815,7 +2856,7 @@ function Yt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2815
2856
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2816
2857
|
tabIndex: o ? -1 : void 0,
|
|
2817
2858
|
style: {
|
|
2818
|
-
...
|
|
2859
|
+
...At,
|
|
2819
2860
|
appearance: "auto",
|
|
2820
2861
|
...P(i)
|
|
2821
2862
|
},
|
|
@@ -2834,7 +2875,7 @@ function Xt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
2834
2875
|
return /* @__PURE__ */ f("label", {
|
|
2835
2876
|
ref: a,
|
|
2836
2877
|
style: {
|
|
2837
|
-
...
|
|
2878
|
+
...At,
|
|
2838
2879
|
display: "flex",
|
|
2839
2880
|
alignItems: "center",
|
|
2840
2881
|
gap: "8px",
|
|
@@ -2866,7 +2907,7 @@ function Zt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2866
2907
|
ref: n,
|
|
2867
2908
|
type: r ? "button" : "submit",
|
|
2868
2909
|
style: {
|
|
2869
|
-
...
|
|
2910
|
+
...De,
|
|
2870
2911
|
border: 0,
|
|
2871
2912
|
cursor: "pointer",
|
|
2872
2913
|
alignSelf: "flex-start",
|
|
@@ -2899,7 +2940,7 @@ function Qt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2899
2940
|
});
|
|
2900
2941
|
}
|
|
2901
2942
|
function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
|
|
2902
|
-
let { tenant: v, apiUrl: y, locale: b } = i(
|
|
2943
|
+
let { tenant: v, apiUrl: y, locale: b } = i(q), x = i(Ce), S = i(ye), [, C] = l(0);
|
|
2903
2944
|
a(() => {
|
|
2904
2945
|
if (typeof window > "u") return;
|
|
2905
2946
|
let e = () => C((e) => e + 1);
|
|
@@ -2907,7 +2948,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2907
2948
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
2908
2949
|
};
|
|
2909
2950
|
}, []);
|
|
2910
|
-
let w =
|
|
2951
|
+
let w = Se(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? be(S) : 1, [k, A] = l(null);
|
|
2911
2952
|
if (a(() => {
|
|
2912
2953
|
if (!e || D) return;
|
|
2913
2954
|
let n = !0, r = new URLSearchParams();
|
|
@@ -2952,7 +2993,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2952
2993
|
},
|
|
2953
2994
|
children: M.map((e) => /* @__PURE__ */ d("div", {
|
|
2954
2995
|
style: { minWidth: 0 },
|
|
2955
|
-
children: x.render(p, (t) =>
|
|
2996
|
+
children: x.render(p, (t) => Z(t, e))
|
|
2956
2997
|
}, e.id ?? e?.data?.slug))
|
|
2957
2998
|
}) : /* @__PURE__ */ d("div", {
|
|
2958
2999
|
ref: _,
|
|
@@ -2962,7 +3003,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2962
3003
|
...P(g)
|
|
2963
3004
|
},
|
|
2964
3005
|
children: M.map((e) => {
|
|
2965
|
-
let t = o ? we(e?.data, o) : null, r = s ?
|
|
3006
|
+
let t = o ? we(e?.data, o) : null, r = s ? X(we(e?.data, s)) : null, i = c ? we(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : X(i), u = n === "list";
|
|
2966
3007
|
return /* @__PURE__ */ f("div", {
|
|
2967
3008
|
style: {
|
|
2968
3009
|
display: "flex",
|
|
@@ -3009,7 +3050,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3009
3050
|
lineHeight: 1.55,
|
|
3010
3051
|
opacity: .85
|
|
3011
3052
|
},
|
|
3012
|
-
children:
|
|
3053
|
+
children: He(a)
|
|
3013
3054
|
})
|
|
3014
3055
|
]
|
|
3015
3056
|
})]
|
|
@@ -3018,7 +3059,7 @@ function $t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
3018
3059
|
});
|
|
3019
3060
|
}
|
|
3020
3061
|
function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3021
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3062
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : xe(), s = {
|
|
3022
3063
|
height: 34,
|
|
3023
3064
|
padding: "0 12px",
|
|
3024
3065
|
borderRadius: 8,
|
|
@@ -3066,7 +3107,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3066
3107
|
name: `f_${e.name}`,
|
|
3067
3108
|
defaultValue: o[e.name] ?? "",
|
|
3068
3109
|
style: s,
|
|
3069
|
-
|
|
3110
|
+
...Mt(i),
|
|
3070
3111
|
children: [/* @__PURE__ */ d("option", {
|
|
3071
3112
|
value: "",
|
|
3072
3113
|
children: e.label || e.name
|
|
@@ -3081,7 +3122,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3081
3122
|
name: `f_${e.name}`,
|
|
3082
3123
|
defaultValue: o[e.name] ?? "",
|
|
3083
3124
|
style: s,
|
|
3084
|
-
|
|
3125
|
+
...Mt(i),
|
|
3085
3126
|
children: [
|
|
3086
3127
|
/* @__PURE__ */ d("option", {
|
|
3087
3128
|
value: "",
|
|
@@ -3102,7 +3143,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3102
3143
|
defaultValue: o[e.name] ?? "",
|
|
3103
3144
|
placeholder: e.label || e.name,
|
|
3104
3145
|
style: s,
|
|
3105
|
-
|
|
3146
|
+
...Mt(i)
|
|
3106
3147
|
}, e.name)), /* @__PURE__ */ d("button", {
|
|
3107
3148
|
type: "submit",
|
|
3108
3149
|
style: {
|
|
@@ -3115,7 +3156,7 @@ function en({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3115
3156
|
fontWeight: 600,
|
|
3116
3157
|
cursor: i ? "default" : "pointer"
|
|
3117
3158
|
},
|
|
3118
|
-
|
|
3159
|
+
...Mt(i),
|
|
3119
3160
|
children: t
|
|
3120
3161
|
})]
|
|
3121
3162
|
});
|
|
@@ -3171,7 +3212,7 @@ function tn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3171
3212
|
}) : null;
|
|
3172
3213
|
}
|
|
3173
3214
|
function nn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", source: o, pageSize: s = 6, align: c, hideEmpty: u, inert: p, style: m, nodeRef: h }) {
|
|
3174
|
-
let { tenant: g, apiUrl: _ } = i(
|
|
3215
|
+
let { tenant: g, apiUrl: _ } = i(q), v = i(ye), [y, b] = l(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3175
3216
|
a(() => {
|
|
3176
3217
|
if (!o || Number.isFinite(x)) return;
|
|
3177
3218
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3190,7 +3231,7 @@ function nn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sou
|
|
|
3190
3231
|
]);
|
|
3191
3232
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
3192
3233
|
if (o && C === null || o && u && !(C > 0)) return null;
|
|
3193
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3234
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? be(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
3194
3235
|
if (o) {
|
|
3195
3236
|
if (typeof window < "u") {
|
|
3196
3237
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -3780,7 +3821,7 @@ var yn = (e, t) => {
|
|
|
3780
3821
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3781
3822
|
}, xn = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
3782
3823
|
function Sn(e, t = {}) {
|
|
3783
|
-
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 ? "" :
|
|
3824
|
+
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 ? "" : X(e);
|
|
3784
3825
|
return n.map((e) => {
|
|
3785
3826
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3786
3827
|
return {
|
|
@@ -3920,7 +3961,7 @@ function wn({ node: e, onClose: t }) {
|
|
|
3920
3961
|
});
|
|
3921
3962
|
}
|
|
3922
3963
|
function Tn({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
|
|
3923
|
-
let b = o(), [x, S] = l(null), { tenant: C, apiUrl: w } = i(
|
|
3964
|
+
let b = o(), [x, S] = l(null), { tenant: C, apiUrl: w } = i(q), T = i(ye)?.[t], [E, D] = l(null);
|
|
3924
3965
|
a(() => {
|
|
3925
3966
|
if (!t || T) return;
|
|
3926
3967
|
let e = !0;
|
|
@@ -4138,85 +4179,102 @@ function En({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4138
4179
|
children: e ?? ""
|
|
4139
4180
|
});
|
|
4140
4181
|
}
|
|
4141
|
-
var Dn = 360, On = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", kn = (e, t) => e && t ? `cell-${e}-${t}` : ""
|
|
4142
|
-
|
|
4143
|
-
let
|
|
4182
|
+
var Dn = 360, On = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", kn = (e, t) => e && t ? `cell-${e}-${t}` : "", An = (e) => {
|
|
4183
|
+
if (!e || typeof e != "object") return e ?? "";
|
|
4184
|
+
let t = String(e.text ?? "");
|
|
4185
|
+
return typeof e.href == "string" && e.href ? /* @__PURE__ */ d("a", {
|
|
4186
|
+
href: e.href,
|
|
4187
|
+
target: "_blank",
|
|
4188
|
+
rel: "noopener noreferrer",
|
|
4189
|
+
style: { color: "var(--page-accent, #4f46e5)" },
|
|
4190
|
+
children: t
|
|
4191
|
+
}) : t;
|
|
4192
|
+
};
|
|
4193
|
+
function jn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], colKeys: o = [], heights: s = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, maxHeight: k, style: A, nodeRef: j, edit: M }) {
|
|
4194
|
+
let N = c(null), F = c(null), [I, L] = l(null), [R, z] = l(null), B = (e, t) => () => L({
|
|
4144
4195
|
r: e,
|
|
4145
4196
|
c: t
|
|
4146
4197
|
});
|
|
4147
4198
|
a(() => {
|
|
4148
|
-
if (!
|
|
4149
|
-
let e =
|
|
4199
|
+
if (!M) return;
|
|
4200
|
+
let e = F.current, t = I && e?.querySelector(`[data-cell="${I.r}-${I.c}"]`);
|
|
4150
4201
|
if (!t) {
|
|
4151
|
-
|
|
4202
|
+
R && z(null);
|
|
4152
4203
|
return;
|
|
4153
4204
|
}
|
|
4154
4205
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4155
4206
|
top: r.bottom - n.top + 4,
|
|
4156
4207
|
left: Math.max(0, Math.min(r.left - n.left, n.width - Dn))
|
|
4157
4208
|
};
|
|
4158
|
-
(
|
|
4209
|
+
(R?.top !== i.top || R?.left !== i.left) && z(i);
|
|
4159
4210
|
}), a(() => {
|
|
4160
|
-
if (!
|
|
4211
|
+
if (!M || !I) return;
|
|
4161
4212
|
let e = (e) => {
|
|
4162
|
-
|
|
4213
|
+
F.current?.contains(e.target) || L(null);
|
|
4163
4214
|
};
|
|
4164
4215
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4165
|
-
}, [
|
|
4166
|
-
let { tenant:
|
|
4216
|
+
}, [M, I]);
|
|
4217
|
+
let { tenant: V, apiUrl: ee } = i(q), H = i(ye), U = H?.[h], te = C ? be(H) : 1, [W, ne] = l(null);
|
|
4167
4218
|
if (a(() => {
|
|
4168
|
-
if (!h ||
|
|
4169
|
-
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(
|
|
4170
|
-
return fetch(r, { headers:
|
|
4219
|
+
if (!h || U) return;
|
|
4220
|
+
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(te - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${ee}/data/${encodeURIComponent(h.slice(4))}` : `${ee}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4221
|
+
return fetch(r, { headers: V ? { "x-tenant": V } : {} }).then((e) => e.json()).then((t) => {
|
|
4171
4222
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4172
|
-
return e &&
|
|
4173
|
-
}).catch(() => e &&
|
|
4223
|
+
return e && ne(n);
|
|
4224
|
+
}).catch(() => e && ne([])), () => {
|
|
4174
4225
|
e = !1;
|
|
4175
4226
|
};
|
|
4176
4227
|
}, [
|
|
4177
4228
|
h,
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4229
|
+
V,
|
|
4230
|
+
ee,
|
|
4231
|
+
U,
|
|
4181
4232
|
C,
|
|
4182
|
-
|
|
4233
|
+
te,
|
|
4183
4234
|
g
|
|
4184
4235
|
]), !e.length) return null;
|
|
4185
|
-
let
|
|
4236
|
+
let re = Math.max(1, Number(g) || 10), ie = h ? C ? U || h.startsWith("api:") ? (U ?? W ?? []).slice((te - 1) * re, te * re) : (W ?? []).slice(0, re) : (U ?? W ?? []).slice(0, re) : null, G = ie ? ie.map((t) => e.map((e) => X(we(t?.data, e.field)))) : t, ae = !!h && !(h && !U && W === null) && G.length === 0, oe = b ? {
|
|
4186
4237
|
y: 6,
|
|
4187
4238
|
x: 10
|
|
4188
4239
|
} : {
|
|
4189
4240
|
y: 10,
|
|
4190
4241
|
x: 14
|
|
4191
|
-
},
|
|
4192
|
-
|
|
4242
|
+
}, se = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : oe.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : oe.x}px`, K = "1px solid rgba(148, 163, 184, 0.35)", ce = y ? { border: K } : { borderBottom: K }, le = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), ue = [
|
|
4243
|
+
"left",
|
|
4244
|
+
"center",
|
|
4245
|
+
"right"
|
|
4246
|
+
], de = (t) => ue.includes(e[t]?.align) ? e[t].align : "", fe = (e) => de(e) || (ue.includes(O) ? O : "left"), pe = Number.isFinite(Number(k)) && Number(k) > 0 ? Number(k) : 0, me = P(A), he = !pe && me && me.maxHeight !== void 0 ? me.maxHeight : 0, ge = pe || he, _e = he ? {
|
|
4247
|
+
...me,
|
|
4248
|
+
maxHeight: void 0
|
|
4249
|
+
} : me, ve = !!M && M.rows !== !1, xe = (t) => (r) => {
|
|
4250
|
+
if (!M?.resize || t >= e.length - 1) return;
|
|
4193
4251
|
r.preventDefault(), r.stopPropagation();
|
|
4194
|
-
let i =
|
|
4252
|
+
let i = N.current, a = i ? i.clientWidth : 0;
|
|
4195
4253
|
if (!a) return;
|
|
4196
|
-
let o =
|
|
4254
|
+
let o = le ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4197
4255
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4198
|
-
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10,
|
|
4256
|
+
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, M.resize(i);
|
|
4199
4257
|
}, u = () => {
|
|
4200
4258
|
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
|
|
4201
4259
|
};
|
|
4202
4260
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4203
|
-
},
|
|
4204
|
-
p &&
|
|
4261
|
+
}, Se = /* @__PURE__ */ new Set();
|
|
4262
|
+
p && G.forEach((t, n) => e.forEach((e, t) => {
|
|
4205
4263
|
let i = p[kn(r[n], o[t])];
|
|
4206
4264
|
if (!i) return;
|
|
4207
4265
|
let a = Math.max(1, Number(i.c) || 1), s = Math.max(1, Number(i.r) || 1);
|
|
4208
|
-
for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) &&
|
|
4266
|
+
for (let e = 0; e < s; e++) for (let r = 0; r < a; r++) (e || r) && Se.add(`${n + e},${t + r}`);
|
|
4209
4267
|
}));
|
|
4210
|
-
let
|
|
4211
|
-
if (!
|
|
4268
|
+
let Ce = (e) => (t) => {
|
|
4269
|
+
if (!M?.resizeRow) return;
|
|
4212
4270
|
t.preventDefault(), t.stopPropagation();
|
|
4213
4271
|
let n = t.currentTarget.closest("tr");
|
|
4214
4272
|
if (!n) return;
|
|
4215
|
-
let r = t.clientY, i = n.offsetHeight, a = (t) =>
|
|
4273
|
+
let r = t.clientY, i = n.offsetHeight, a = (t) => M.resizeRow(e, Math.max(20, Math.round(i + (t.clientY - r)))), o = () => {
|
|
4216
4274
|
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4217
4275
|
};
|
|
4218
4276
|
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4219
|
-
},
|
|
4277
|
+
}, J = (e, t, n, r) => r ? null : /* @__PURE__ */ d("span", {
|
|
4220
4278
|
className: "wb-tedit-btn",
|
|
4221
4279
|
role: "button",
|
|
4222
4280
|
"data-hint": t,
|
|
@@ -4225,118 +4283,129 @@ function An({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4225
4283
|
},
|
|
4226
4284
|
onClick: n,
|
|
4227
4285
|
children: e
|
|
4228
|
-
}, t),
|
|
4286
|
+
}, t), Y = I && I.r < G.length && I.c < e.length ? I : null, Z = (e, t) => M?.labels?.[e] ?? t, Te = Y ? p?.[kn(r[Y.r], o[Y.c])] : null, Ee = Math.max(1, Number(Te?.c) || 1), De = Math.max(1, Number(Te?.r) || 1);
|
|
4229
4287
|
return /* @__PURE__ */ f("div", {
|
|
4230
4288
|
ref: (e) => {
|
|
4231
|
-
|
|
4289
|
+
F.current = e, typeof j == "function" && j(e);
|
|
4232
4290
|
},
|
|
4233
4291
|
style: {
|
|
4234
4292
|
width: "100%",
|
|
4235
|
-
...
|
|
4236
|
-
...
|
|
4293
|
+
...M ? { position: "relative" } : null,
|
|
4294
|
+
..._e
|
|
4237
4295
|
},
|
|
4238
4296
|
children: [
|
|
4239
|
-
|
|
4240
|
-
|
|
4297
|
+
M && /* @__PURE__ */ d("style", { children: On }),
|
|
4298
|
+
M && Y && R && /* @__PURE__ */ f("div", {
|
|
4241
4299
|
className: "wb-tedit-bar",
|
|
4242
4300
|
style: {
|
|
4243
|
-
top:
|
|
4244
|
-
left:
|
|
4301
|
+
top: R.top,
|
|
4302
|
+
left: R.left
|
|
4245
4303
|
},
|
|
4246
4304
|
onMouseDown: (e) => e.stopPropagation(),
|
|
4247
4305
|
children: [
|
|
4248
4306
|
/* @__PURE__ */ d("span", {
|
|
4249
4307
|
className: "wb-tedit-at",
|
|
4250
|
-
children: `R${
|
|
4308
|
+
children: `R${Y.r + 1}·C${Y.c + 1}`
|
|
4251
4309
|
}),
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4310
|
+
J("+↑", Z("rowAbove", "Insert row above"), () => M.addRow(Y.r - 1)),
|
|
4311
|
+
J("+↓", Z("rowBelow", "Insert row below"), () => M.addRow(Y.r)),
|
|
4312
|
+
J("↑", Z("rowUp", "Move row up"), () => M.moveRow(Y.r, -1), Y.r === 0),
|
|
4313
|
+
J("↓", Z("rowDown", "Move row down"), () => M.moveRow(Y.r, 1), Y.r >= G.length - 1),
|
|
4314
|
+
J("✕ row", Z("rowDelete", "Delete row"), () => M.dropRow(Y.r), G.length <= 1),
|
|
4257
4315
|
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4261
|
-
|
|
4262
|
-
|
|
4316
|
+
J("+←", Z("colLeft", "Insert column left"), () => M.addColumn(Y.c - 1)),
|
|
4317
|
+
J("+→", Z("colRight", "Insert column right"), () => M.addColumn(Y.c)),
|
|
4318
|
+
J("←", Z("colMoveLeft", "Move column left"), () => M.moveColumn(Y.c, -1), Y.c === 0),
|
|
4319
|
+
J("→", Z("colMoveRight", "Move column right"), () => M.moveColumn(Y.c, 1), Y.c >= e.length - 1),
|
|
4320
|
+
J("✕ col", Z("colDelete", "Delete column"), () => M.dropColumn(Y.c), e.length <= 1),
|
|
4263
4321
|
/* @__PURE__ */ d("span", { className: "wb-tedit-sep" }),
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4322
|
+
J("↔", Z("mergeRight", "Merge with the cell on the right"), () => M.merge(Y.r, Y.c, "right"), Y.c + Ee >= e.length),
|
|
4323
|
+
J("↕", Z("mergeDown", "Merge with the cell below"), () => M.merge(Y.r, Y.c, "down"), Y.r + De >= G.length),
|
|
4324
|
+
J("⤫", Z("split", "Split this cell"), () => M.split(Y.r, Y.c), Ee === 1 && De === 1)
|
|
4267
4325
|
]
|
|
4268
4326
|
}),
|
|
4269
4327
|
/* @__PURE__ */ d("div", {
|
|
4270
4328
|
style: {
|
|
4271
4329
|
width: "100%",
|
|
4272
|
-
overflowX: "auto"
|
|
4330
|
+
overflowX: "auto",
|
|
4331
|
+
...ge ? {
|
|
4332
|
+
maxHeight: ge,
|
|
4333
|
+
overflowY: "auto"
|
|
4334
|
+
} : null
|
|
4273
4335
|
},
|
|
4274
4336
|
children: /* @__PURE__ */ f("table", {
|
|
4275
|
-
ref:
|
|
4337
|
+
ref: N,
|
|
4276
4338
|
style: {
|
|
4277
4339
|
width: "100%",
|
|
4278
|
-
borderCollapse: "collapse",
|
|
4340
|
+
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
4341
|
+
borderSpacing: 0,
|
|
4279
4342
|
fontSize: 14,
|
|
4280
|
-
...
|
|
4281
|
-
...y ? { border:
|
|
4343
|
+
...le ? { tableLayout: "fixed" } : null,
|
|
4344
|
+
...y ? { border: K } : {}
|
|
4282
4345
|
},
|
|
4283
4346
|
children: [
|
|
4284
|
-
|
|
4347
|
+
le && /* @__PURE__ */ d("colgroup", { children: n.map((e, t) => /* @__PURE__ */ d("col", { style: { width: `${e}%` } }, t)) }),
|
|
4285
4348
|
_ === !1 ? null : /* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((t, n) => /* @__PURE__ */ d("th", {
|
|
4286
|
-
className:
|
|
4349
|
+
className: M ? "wb-tedit-head" : void 0,
|
|
4287
4350
|
style: {
|
|
4288
|
-
textAlign:
|
|
4351
|
+
textAlign: fe(n),
|
|
4289
4352
|
fontWeight: 600,
|
|
4290
|
-
padding:
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
...
|
|
4353
|
+
padding: se,
|
|
4354
|
+
...typeof D == "string" && D ? { color: D } : null,
|
|
4355
|
+
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4356
|
+
...T ? {
|
|
4357
|
+
position: "sticky",
|
|
4358
|
+
top: 0,
|
|
4359
|
+
zIndex: 2
|
|
4360
|
+
} : M ? { position: "relative" } : null,
|
|
4361
|
+
...ce
|
|
4294
4362
|
},
|
|
4295
|
-
children:
|
|
4363
|
+
children: M ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(En, {
|
|
4296
4364
|
value: t.label ?? t,
|
|
4297
|
-
onCommit: (e) =>
|
|
4298
|
-
hint:
|
|
4365
|
+
onCommit: (e) => M.header(n, e),
|
|
4366
|
+
hint: Z("editCell", "Double-click to edit"),
|
|
4299
4367
|
style: { paddingRight: 6 }
|
|
4300
4368
|
}), n < e.length - 1 && /* @__PURE__ */ d("span", {
|
|
4301
4369
|
className: "wb-tedit-grip",
|
|
4302
|
-
title:
|
|
4303
|
-
onPointerDown:
|
|
4370
|
+
title: Z("colWidth", "Drag to resize the column"),
|
|
4371
|
+
onPointerDown: xe(n)
|
|
4304
4372
|
})] }) : t.label ?? t
|
|
4305
4373
|
}, n)) }) }),
|
|
4306
|
-
/* @__PURE__ */ f("tbody", { children: [
|
|
4374
|
+
/* @__PURE__ */ f("tbody", { children: [ae && /* @__PURE__ */ d("tr", { children: /* @__PURE__ */ d("td", {
|
|
4307
4375
|
colSpan: e.length,
|
|
4308
4376
|
style: {
|
|
4309
|
-
padding:
|
|
4377
|
+
padding: se,
|
|
4310
4378
|
textAlign: "center",
|
|
4311
4379
|
opacity: .6,
|
|
4312
|
-
...
|
|
4380
|
+
...ce
|
|
4313
4381
|
},
|
|
4314
4382
|
children: w || "No data yet"
|
|
4315
|
-
}) }),
|
|
4316
|
-
className:
|
|
4383
|
+
}) }), G.map((t, n) => /* @__PURE__ */ d("tr", {
|
|
4384
|
+
className: M ? "wb-tedit-row" : void 0,
|
|
4317
4385
|
style: {
|
|
4318
4386
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
4319
4387
|
...Number.isFinite(Number(s?.[n])) && s[n] > 0 ? { height: s[n] } : null
|
|
4320
4388
|
},
|
|
4321
4389
|
children: e.map((e, i) => {
|
|
4322
|
-
if (
|
|
4390
|
+
if (Se.has(`${n},${i}`)) return null;
|
|
4323
4391
|
let a = kn(r[n], o[i]), s = m?.[a], c = p?.[a], l = Math.max(1, Number(c?.c) || 1), u = Math.max(1, Number(c?.r) || 1);
|
|
4324
4392
|
return /* @__PURE__ */ f("td", {
|
|
4325
|
-
className:
|
|
4326
|
-
onMouseDownCapture:
|
|
4327
|
-
"data-cell":
|
|
4393
|
+
className: M ? `wb-tedit-cell${I?.r === n && I?.c === i ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4394
|
+
onMouseDownCapture: ve ? B(n, i) : void 0,
|
|
4395
|
+
"data-cell": M ? `${n}-${i}` : void 0,
|
|
4328
4396
|
colSpan: l > 1 ? l : void 0,
|
|
4329
4397
|
rowSpan: u > 1 ? u : void 0,
|
|
4330
4398
|
style: {
|
|
4331
|
-
padding:
|
|
4332
|
-
...
|
|
4333
|
-
...
|
|
4399
|
+
padding: se,
|
|
4400
|
+
...de(i) ? { textAlign: de(i) } : null,
|
|
4401
|
+
...M ? { position: "relative" } : null,
|
|
4402
|
+
...ce
|
|
4334
4403
|
},
|
|
4335
|
-
children: [s ?? t?.[i]
|
|
4404
|
+
children: [s ?? An(t?.[i]), M && ve && /* @__PURE__ */ d("span", {
|
|
4336
4405
|
className: "wb-tedit-rowgrip",
|
|
4337
|
-
title:
|
|
4338
|
-
onPointerDown:
|
|
4339
|
-
onDoubleClick: () =>
|
|
4406
|
+
title: Z("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4407
|
+
onPointerDown: Ce(n),
|
|
4408
|
+
onDoubleClick: () => M.resizeRow(n, 0)
|
|
4340
4409
|
})]
|
|
4341
4410
|
}, i);
|
|
4342
4411
|
})
|
|
@@ -4347,7 +4416,7 @@ function An({ columns: e = [], rows: t = [], widths: n = [], rowKeys: r = [], co
|
|
|
4347
4416
|
]
|
|
4348
4417
|
});
|
|
4349
4418
|
}
|
|
4350
|
-
var
|
|
4419
|
+
var Mn = {
|
|
4351
4420
|
small: {
|
|
4352
4421
|
cell: 62,
|
|
4353
4422
|
font: 10.5,
|
|
@@ -4372,9 +4441,9 @@ var jn = {
|
|
|
4372
4441
|
pad: 8,
|
|
4373
4442
|
gap: 4
|
|
4374
4443
|
}
|
|
4375
|
-
},
|
|
4376
|
-
function
|
|
4377
|
-
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 ? "" :
|
|
4444
|
+
}, Nn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Pn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Fn = 366;
|
|
4445
|
+
function In(e, t = {}) {
|
|
4446
|
+
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 ? "" : X(e), a = (e) => {
|
|
4378
4447
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4379
4448
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4380
4449
|
};
|
|
@@ -4390,7 +4459,7 @@ function Fn(e, t = {}) {
|
|
|
4390
4459
|
} : null;
|
|
4391
4460
|
}).filter(Boolean);
|
|
4392
4461
|
}
|
|
4393
|
-
function
|
|
4462
|
+
function Ln(e) {
|
|
4394
4463
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4395
4464
|
let n = e?.start ? new Date(e.start) : null;
|
|
4396
4465
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4405,20 +4474,20 @@ function In(e) {
|
|
|
4405
4474
|
};
|
|
4406
4475
|
}).filter(Boolean);
|
|
4407
4476
|
}
|
|
4408
|
-
function
|
|
4477
|
+
function Rn(e) {
|
|
4409
4478
|
let t = /* @__PURE__ */ new Map();
|
|
4410
4479
|
for (let n of e) {
|
|
4411
|
-
let e =
|
|
4480
|
+
let e = Pn(n.start), r = n.end ? Pn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Fn);
|
|
4412
4481
|
for (let r = 0; r <= i; r += 1) {
|
|
4413
|
-
let i =
|
|
4482
|
+
let i = Nn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4414
4483
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4415
4484
|
}
|
|
4416
4485
|
}
|
|
4417
4486
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4418
4487
|
return t;
|
|
4419
4488
|
}
|
|
4420
|
-
function
|
|
4421
|
-
let { tenant: T, apiUrl: E, locale: D } = i(
|
|
4489
|
+
function zn({ events: e = [], source: t = "", titleField: n = "", startField: r = "", endField: o = "", hrefField: s = "", colorField: c = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
|
|
4490
|
+
let { tenant: T, apiUrl: E, locale: D } = i(q), O = i(ye)?.[t], [k, A] = l(null), [j, M] = l(() => {
|
|
4422
4491
|
let e = /* @__PURE__ */ new Date();
|
|
4423
4492
|
return {
|
|
4424
4493
|
year: e.getFullYear(),
|
|
@@ -4440,13 +4509,13 @@ function Rn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4440
4509
|
E,
|
|
4441
4510
|
O
|
|
4442
4511
|
]);
|
|
4443
|
-
let N =
|
|
4512
|
+
let N = Mn[m] ?? Mn.medium, F = h || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = g || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? In(O ?? k ?? [], {
|
|
4444
4513
|
titleField: n,
|
|
4445
4514
|
startField: r,
|
|
4446
4515
|
endField: o,
|
|
4447
4516
|
hrefField: s,
|
|
4448
4517
|
colorField: c
|
|
4449
|
-
}) :
|
|
4518
|
+
}) : Ln(e), B = Rn(z), V = D || void 0, ee = (e, t) => {
|
|
4450
4519
|
let n = /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("span", { style: {
|
|
4451
4520
|
width: 6,
|
|
4452
4521
|
height: 6,
|
|
@@ -4487,16 +4556,16 @@ function Rn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4487
4556
|
}, H = new Intl.DateTimeFormat(V, {
|
|
4488
4557
|
month: "long",
|
|
4489
4558
|
year: "numeric"
|
|
4490
|
-
}).format(new Date(j.year, j.month, 1)),
|
|
4559
|
+
}).format(new Date(j.year, j.month, 1)), U = (e) => M((t) => {
|
|
4491
4560
|
let n = new Date(t.year, t.month + e, 1);
|
|
4492
4561
|
return {
|
|
4493
4562
|
year: n.getFullYear(),
|
|
4494
4563
|
month: n.getMonth()
|
|
4495
4564
|
};
|
|
4496
|
-
}),
|
|
4565
|
+
}), te = (e, t) => /* @__PURE__ */ d("button", {
|
|
4497
4566
|
type: "button",
|
|
4498
4567
|
"aria-label": e,
|
|
4499
|
-
onClick: () =>
|
|
4568
|
+
onClick: () => U(t),
|
|
4500
4569
|
style: {
|
|
4501
4570
|
background: "transparent",
|
|
4502
4571
|
border: `1px solid ${I}`,
|
|
@@ -4508,7 +4577,7 @@ function Rn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4508
4577
|
padding: "4px 8px"
|
|
4509
4578
|
},
|
|
4510
4579
|
children: t < 0 ? "‹" : "›"
|
|
4511
|
-
}),
|
|
4580
|
+
}), W = /* @__PURE__ */ f("div", {
|
|
4512
4581
|
style: {
|
|
4513
4582
|
display: "flex",
|
|
4514
4583
|
alignItems: "center",
|
|
@@ -4525,8 +4594,8 @@ function Rn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4525
4594
|
},
|
|
4526
4595
|
children: H
|
|
4527
4596
|
}),
|
|
4528
|
-
|
|
4529
|
-
|
|
4597
|
+
te("Previous month", -1),
|
|
4598
|
+
te("Next month", 1)
|
|
4530
4599
|
]
|
|
4531
4600
|
});
|
|
4532
4601
|
if (p === "list") {
|
|
@@ -4542,7 +4611,7 @@ function Rn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4542
4611
|
width: "100%",
|
|
4543
4612
|
...P(S)
|
|
4544
4613
|
},
|
|
4545
|
-
children: [
|
|
4614
|
+
children: [W, e.length ? /* @__PURE__ */ d("div", {
|
|
4546
4615
|
style: {
|
|
4547
4616
|
display: "flex",
|
|
4548
4617
|
flexDirection: "column",
|
|
@@ -4578,10 +4647,10 @@ function Rn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4578
4647
|
})]
|
|
4579
4648
|
});
|
|
4580
4649
|
}
|
|
4581
|
-
let
|
|
4582
|
-
for (let e = 0; e <
|
|
4583
|
-
let t = e -
|
|
4584
|
-
|
|
4650
|
+
let ne = new Date(j.year, j.month, 1), re = y === "sunday" ? 0 : 1, ie = (ne.getDay() - re + 7) % 7, G = new Date(j.year, j.month + 1, 0).getDate(), ae = Math.ceil((ie + G) / 7), oe = Nn(/* @__PURE__ */ new Date()), se = new Intl.DateTimeFormat(V, { weekday: "short" }), K = [];
|
|
4651
|
+
for (let e = 0; e < ae * 7; e += 1) {
|
|
4652
|
+
let t = e - ie + 1, n = t >= 1 && t <= G, r = Nn(new Date(j.year, j.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === oe;
|
|
4653
|
+
K.push(/* @__PURE__ */ f("div", {
|
|
4585
4654
|
style: {
|
|
4586
4655
|
minHeight: N.cell,
|
|
4587
4656
|
borderTop: `1px solid ${I}`,
|
|
@@ -4624,7 +4693,7 @@ function Rn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4624
4693
|
...P(S)
|
|
4625
4694
|
},
|
|
4626
4695
|
children: [
|
|
4627
|
-
|
|
4696
|
+
W,
|
|
4628
4697
|
/* @__PURE__ */ f("div", {
|
|
4629
4698
|
style: {
|
|
4630
4699
|
display: "grid",
|
|
@@ -4638,20 +4707,20 @@ function Rn({ events: e = [], source: t = "", titleField: n = "", startField: r
|
|
|
4638
4707
|
textAlign: "center",
|
|
4639
4708
|
padding: `0 0 ${N.pad}px`
|
|
4640
4709
|
},
|
|
4641
|
-
children:
|
|
4642
|
-
}, `head-${t}`)),
|
|
4710
|
+
children: se.format(new Date(2024, 0, 7 + re + t))
|
|
4711
|
+
}, `head-${t}`)), K]
|
|
4643
4712
|
}),
|
|
4644
4713
|
/* @__PURE__ */ d("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4645
4714
|
]
|
|
4646
4715
|
});
|
|
4647
4716
|
}
|
|
4648
|
-
var
|
|
4717
|
+
var Bn = {
|
|
4649
4718
|
small: 380,
|
|
4650
4719
|
medium: 560,
|
|
4651
4720
|
large: 820,
|
|
4652
4721
|
full: "100%"
|
|
4653
4722
|
};
|
|
4654
|
-
function
|
|
4723
|
+
function Vn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: i = 0, size: o = "medium", title: s = "", showClose: u = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
|
|
4655
4724
|
let [C, w] = l(!1), T = c(null);
|
|
4656
4725
|
a(() => {
|
|
4657
4726
|
if (S || !e) return;
|
|
@@ -4676,7 +4745,7 @@ function Bn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4676
4745
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
4677
4746
|
};
|
|
4678
4747
|
}, [S, C]);
|
|
4679
|
-
let E =
|
|
4748
|
+
let E = Bn[o] ?? Bn.medium, D = (e) => {
|
|
4680
4749
|
let t = {
|
|
4681
4750
|
padding: "9px 16px",
|
|
4682
4751
|
borderRadius: 6,
|
|
@@ -4845,21 +4914,21 @@ function Bn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4845
4914
|
})]
|
|
4846
4915
|
});
|
|
4847
4916
|
}
|
|
4848
|
-
var
|
|
4849
|
-
PageRoot:
|
|
4850
|
-
CalendarBlock:
|
|
4851
|
-
DialogBlock:
|
|
4852
|
-
Section:
|
|
4853
|
-
Container:
|
|
4854
|
-
Heading:
|
|
4855
|
-
TextBlock:
|
|
4856
|
-
ButtonBlock:
|
|
4857
|
-
ImageBlock:
|
|
4858
|
-
Spacer:
|
|
4859
|
-
Divider:
|
|
4860
|
-
SliderBlock:
|
|
4861
|
-
CanvasSlider:
|
|
4862
|
-
TabsBlock:
|
|
4917
|
+
var Hn = {
|
|
4918
|
+
PageRoot: Me,
|
|
4919
|
+
CalendarBlock: zn,
|
|
4920
|
+
DialogBlock: Vn,
|
|
4921
|
+
Section: Ne,
|
|
4922
|
+
Container: Pe,
|
|
4923
|
+
Heading: Fe,
|
|
4924
|
+
TextBlock: qe,
|
|
4925
|
+
ButtonBlock: Xe,
|
|
4926
|
+
ImageBlock: Ze,
|
|
4927
|
+
Spacer: rt,
|
|
4928
|
+
Divider: it,
|
|
4929
|
+
SliderBlock: ut,
|
|
4930
|
+
CanvasSlider: dt,
|
|
4931
|
+
TabsBlock: Et,
|
|
4863
4932
|
QuickStack: Qt,
|
|
4864
4933
|
CollectionList: $t,
|
|
4865
4934
|
CollectionSearch: en,
|
|
@@ -4870,22 +4939,22 @@ var Vn = {
|
|
|
4870
4939
|
ThemeModeBlock: cn,
|
|
4871
4940
|
ScrollTopBlock: fn,
|
|
4872
4941
|
OrgChartBlock: Tn,
|
|
4873
|
-
TableBlock:
|
|
4874
|
-
IconBlock:
|
|
4875
|
-
MapBlock:
|
|
4876
|
-
MasonryBlock:
|
|
4877
|
-
AccordionBlock:
|
|
4878
|
-
NavbarBlock:
|
|
4879
|
-
ListBlock:
|
|
4880
|
-
TextSpan:
|
|
4881
|
-
QuoteBlock:
|
|
4882
|
-
TextLink:
|
|
4883
|
-
RichTextBlock:
|
|
4884
|
-
RichContentBlock:
|
|
4885
|
-
VideoBlock:
|
|
4886
|
-
YouTubeBlock:
|
|
4887
|
-
IframeBlock:
|
|
4888
|
-
EmbedBlock:
|
|
4942
|
+
TableBlock: jn,
|
|
4943
|
+
IconBlock: yt,
|
|
4944
|
+
MapBlock: _t,
|
|
4945
|
+
MasonryBlock: xt,
|
|
4946
|
+
AccordionBlock: Dt,
|
|
4947
|
+
NavbarBlock: Tt,
|
|
4948
|
+
ListBlock: Ke,
|
|
4949
|
+
TextSpan: ze,
|
|
4950
|
+
QuoteBlock: Ge,
|
|
4951
|
+
TextLink: Ye,
|
|
4952
|
+
RichTextBlock: Ue,
|
|
4953
|
+
RichContentBlock: Ue,
|
|
4954
|
+
VideoBlock: Qe,
|
|
4955
|
+
YouTubeBlock: et,
|
|
4956
|
+
IframeBlock: tt,
|
|
4957
|
+
EmbedBlock: nt,
|
|
4889
4958
|
FormBlock: Bt,
|
|
4890
4959
|
FormLabel: Gt,
|
|
4891
4960
|
FormInput: Kt,
|
|
@@ -4902,27 +4971,27 @@ var Vn = {
|
|
|
4902
4971
|
FormFile: Xt,
|
|
4903
4972
|
FormRecaptcha: Wt,
|
|
4904
4973
|
FormSubmit: Zt
|
|
4905
|
-
},
|
|
4974
|
+
}, Un = {
|
|
4906
4975
|
id: "auth",
|
|
4907
4976
|
label: "Accounts",
|
|
4908
4977
|
category: "Apps",
|
|
4909
4978
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
4910
4979
|
ssr: "shell",
|
|
4911
4980
|
settings: ["site.authRedirect"]
|
|
4912
|
-
},
|
|
4981
|
+
}, Wn = n({
|
|
4913
4982
|
user: null,
|
|
4914
4983
|
status: "idle",
|
|
4915
4984
|
ensure: () => {},
|
|
4916
4985
|
refresh: () => {},
|
|
4917
4986
|
signOut: () => {}
|
|
4918
|
-
}),
|
|
4919
|
-
let e = i(
|
|
4987
|
+
}), Gn = () => {
|
|
4988
|
+
let e = i(Wn);
|
|
4920
4989
|
return a(() => {
|
|
4921
4990
|
e.ensure();
|
|
4922
4991
|
}, [e]), e;
|
|
4923
4992
|
};
|
|
4924
|
-
function
|
|
4925
|
-
let f = i(
|
|
4993
|
+
function Kn({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u }) {
|
|
4994
|
+
let f = i(q), p = o || f?.apiUrl || "/api", m = u || f?.tenant || "", [h, g] = l(t ?? null), [_, v] = l(t ? "user" : n ? "guest" : "idle"), y = c(!1), b = r((e, t) => fetch(`${p}${e}`, {
|
|
4926
4995
|
...t,
|
|
4927
4996
|
credentials: "include",
|
|
4928
4997
|
headers: {
|
|
@@ -4972,19 +5041,19 @@ function Gn({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: u })
|
|
|
4972
5041
|
t,
|
|
4973
5042
|
x,
|
|
4974
5043
|
S
|
|
4975
|
-
]), /* @__PURE__ */ d(
|
|
5044
|
+
]), /* @__PURE__ */ d(Wn.Provider, {
|
|
4976
5045
|
value: w,
|
|
4977
5046
|
children: e
|
|
4978
5047
|
});
|
|
4979
5048
|
}
|
|
4980
|
-
function
|
|
4981
|
-
let { status: n } =
|
|
5049
|
+
function qn({ when: e, children: t }) {
|
|
5050
|
+
let { status: n } = Gn();
|
|
4982
5051
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
4983
5052
|
}
|
|
4984
5053
|
//#endregion
|
|
4985
5054
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
4986
|
-
function
|
|
4987
|
-
let { tenant: h, apiUrl: g, settings: _ } = i(
|
|
5055
|
+
function Jn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
|
|
5056
|
+
let { tenant: h, apiUrl: g, settings: _ } = i(q), [v, y] = l("form"), [b, x] = l(""), [S, C] = l(!1), w = e === "register", T = u ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
4988
5057
|
if (e.preventDefault(), u) return;
|
|
4989
5058
|
let n = new FormData(e.currentTarget);
|
|
4990
5059
|
C(!0), x("");
|
|
@@ -5032,20 +5101,20 @@ function qn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5032
5101
|
children: [
|
|
5033
5102
|
w ? /* @__PURE__ */ f("label", {
|
|
5034
5103
|
style: {
|
|
5035
|
-
...
|
|
5104
|
+
...kt,
|
|
5036
5105
|
display: "grid",
|
|
5037
5106
|
gap: 6
|
|
5038
5107
|
},
|
|
5039
5108
|
children: [a, /* @__PURE__ */ d("input", {
|
|
5040
5109
|
name: "name",
|
|
5041
5110
|
type: "text",
|
|
5042
|
-
style:
|
|
5043
|
-
|
|
5111
|
+
style: At,
|
|
5112
|
+
...Mt(u)
|
|
5044
5113
|
})]
|
|
5045
5114
|
}) : null,
|
|
5046
5115
|
/* @__PURE__ */ f("label", {
|
|
5047
5116
|
style: {
|
|
5048
|
-
...
|
|
5117
|
+
...kt,
|
|
5049
5118
|
display: "grid",
|
|
5050
5119
|
gap: 6
|
|
5051
5120
|
},
|
|
@@ -5053,13 +5122,13 @@ function qn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5053
5122
|
name: "email",
|
|
5054
5123
|
type: "email",
|
|
5055
5124
|
required: !u,
|
|
5056
|
-
style:
|
|
5057
|
-
|
|
5125
|
+
style: At,
|
|
5126
|
+
...Mt(u)
|
|
5058
5127
|
})]
|
|
5059
5128
|
}),
|
|
5060
5129
|
/* @__PURE__ */ f("label", {
|
|
5061
5130
|
style: {
|
|
5062
|
-
...
|
|
5131
|
+
...kt,
|
|
5063
5132
|
display: "grid",
|
|
5064
5133
|
gap: 6
|
|
5065
5134
|
},
|
|
@@ -5067,15 +5136,15 @@ function qn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5067
5136
|
name: "password",
|
|
5068
5137
|
type: "password",
|
|
5069
5138
|
required: !u,
|
|
5070
|
-
style:
|
|
5071
|
-
|
|
5139
|
+
style: At,
|
|
5140
|
+
...Mt(u)
|
|
5072
5141
|
})]
|
|
5073
5142
|
}),
|
|
5074
5143
|
/* @__PURE__ */ d("button", {
|
|
5075
5144
|
type: u ? "button" : "submit",
|
|
5076
5145
|
disabled: S || void 0,
|
|
5077
5146
|
style: {
|
|
5078
|
-
...
|
|
5147
|
+
...De,
|
|
5079
5148
|
border: 0,
|
|
5080
5149
|
padding: "10px 22px",
|
|
5081
5150
|
borderRadius: 8,
|
|
@@ -5107,8 +5176,8 @@ function qn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5107
5176
|
]
|
|
5108
5177
|
});
|
|
5109
5178
|
}
|
|
5110
|
-
function
|
|
5111
|
-
let { user: c, status: l, signOut: u } =
|
|
5179
|
+
function Yn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
5180
|
+
let { user: c, status: l, signOut: u } = Gn(), p = a ? s || "user" : l, m = a ? {
|
|
5112
5181
|
name: "Ada Lovelace",
|
|
5113
5182
|
email: "ada@example.com"
|
|
5114
5183
|
} : c;
|
|
@@ -5129,7 +5198,7 @@ function Jn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5129
5198
|
children: [
|
|
5130
5199
|
/* @__PURE__ */ f("span", {
|
|
5131
5200
|
style: {
|
|
5132
|
-
...
|
|
5201
|
+
...kt,
|
|
5133
5202
|
fontWeight: 600
|
|
5134
5203
|
},
|
|
5135
5204
|
children: [
|
|
@@ -5140,7 +5209,7 @@ function Jn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5140
5209
|
}),
|
|
5141
5210
|
n && m?.email ? /* @__PURE__ */ d("span", {
|
|
5142
5211
|
style: {
|
|
5143
|
-
...
|
|
5212
|
+
...kt,
|
|
5144
5213
|
opacity: .7
|
|
5145
5214
|
},
|
|
5146
5215
|
children: m.email
|
|
@@ -5149,14 +5218,14 @@ function Jn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5149
5218
|
type: "button",
|
|
5150
5219
|
onClick: a ? void 0 : u,
|
|
5151
5220
|
style: {
|
|
5152
|
-
...
|
|
5221
|
+
...De,
|
|
5153
5222
|
border: 0,
|
|
5154
5223
|
padding: "8px 16px",
|
|
5155
5224
|
borderRadius: 8,
|
|
5156
5225
|
fontSize: 14,
|
|
5157
5226
|
cursor: a ? "default" : "pointer"
|
|
5158
5227
|
},
|
|
5159
|
-
|
|
5228
|
+
...Mt(a),
|
|
5160
5229
|
children: t
|
|
5161
5230
|
})
|
|
5162
5231
|
]
|
|
@@ -5173,40 +5242,40 @@ function Jn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5173
5242
|
}
|
|
5174
5243
|
//#endregion
|
|
5175
5244
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5176
|
-
var
|
|
5245
|
+
var Xn = {
|
|
5177
5246
|
id: "consent",
|
|
5178
5247
|
label: "Cookie consent",
|
|
5179
5248
|
category: "Apps",
|
|
5180
5249
|
keys: ["CookieConsent"],
|
|
5181
5250
|
ssr: "shell",
|
|
5182
5251
|
settings: []
|
|
5183
|
-
},
|
|
5184
|
-
function
|
|
5252
|
+
}, Zn = "webim.cookie_consent";
|
|
5253
|
+
function Qn() {
|
|
5185
5254
|
try {
|
|
5186
|
-
let e = window.localStorage.getItem(
|
|
5255
|
+
let e = window.localStorage.getItem(Zn), t = e ? JSON.parse(e) : null;
|
|
5187
5256
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5188
5257
|
} catch {
|
|
5189
5258
|
return "";
|
|
5190
5259
|
}
|
|
5191
5260
|
}
|
|
5192
|
-
function
|
|
5261
|
+
function $n(e) {
|
|
5193
5262
|
try {
|
|
5194
5263
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5195
5264
|
} catch {}
|
|
5196
5265
|
}
|
|
5197
|
-
function
|
|
5266
|
+
function er(e) {
|
|
5198
5267
|
try {
|
|
5199
|
-
window.localStorage.setItem(
|
|
5268
|
+
window.localStorage.setItem(Zn, JSON.stringify({
|
|
5200
5269
|
choice: e,
|
|
5201
5270
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5202
5271
|
}));
|
|
5203
5272
|
} catch {}
|
|
5204
|
-
|
|
5273
|
+
$n(e);
|
|
5205
5274
|
try {
|
|
5206
5275
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5207
5276
|
} catch {}
|
|
5208
5277
|
}
|
|
5209
|
-
var
|
|
5278
|
+
var tr = {
|
|
5210
5279
|
bottom: {
|
|
5211
5280
|
left: 0,
|
|
5212
5281
|
right: 0,
|
|
@@ -5228,18 +5297,18 @@ var er = {
|
|
|
5228
5297
|
maxWidth: 400
|
|
5229
5298
|
}
|
|
5230
5299
|
};
|
|
5231
|
-
function
|
|
5300
|
+
function nr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: i, linkHref: o, position: s, linked: c, style: p, nodeRef: m, inert: h }) {
|
|
5232
5301
|
let [g, _] = l(!!h), [v, y] = l(null), b = (e) => {
|
|
5233
5302
|
y(e), typeof m == "function" && m(e);
|
|
5234
5303
|
};
|
|
5235
5304
|
if (a(() => {
|
|
5236
5305
|
if (h) return;
|
|
5237
|
-
let e =
|
|
5238
|
-
e ?
|
|
5306
|
+
let e = Qn();
|
|
5307
|
+
e ? $n(e) : _(!0);
|
|
5239
5308
|
}, [h, v]), !g) return null;
|
|
5240
5309
|
let x = (e) => () => {
|
|
5241
|
-
h || (
|
|
5242
|
-
}, S =
|
|
5310
|
+
h || (er(e), _(!1));
|
|
5311
|
+
}, S = tr[s] ?? tr.bottom, C = {
|
|
5243
5312
|
appearance: "none",
|
|
5244
5313
|
font: "inherit",
|
|
5245
5314
|
fontSize: 14,
|
|
@@ -5319,37 +5388,37 @@ function tr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
5319
5388
|
}
|
|
5320
5389
|
//#endregion
|
|
5321
5390
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
5322
|
-
var
|
|
5391
|
+
var rr = {
|
|
5323
5392
|
id: "language",
|
|
5324
5393
|
label: "Language",
|
|
5325
5394
|
category: "Apps",
|
|
5326
5395
|
keys: ["SiteLanguagePicker"],
|
|
5327
5396
|
ssr: "prefetch",
|
|
5328
5397
|
settings: ["locales"]
|
|
5329
|
-
},
|
|
5398
|
+
}, ir = {
|
|
5330
5399
|
id: "search",
|
|
5331
5400
|
label: "Search",
|
|
5332
5401
|
category: "Apps",
|
|
5333
5402
|
keys: ["SiteSearch"],
|
|
5334
5403
|
ssr: "prefetch",
|
|
5335
5404
|
settings: []
|
|
5336
|
-
},
|
|
5337
|
-
function
|
|
5405
|
+
}, ar = 50, or = 2e3;
|
|
5406
|
+
function sr() {
|
|
5338
5407
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
5339
5408
|
}
|
|
5340
|
-
function
|
|
5409
|
+
function cr(e, t) {
|
|
5341
5410
|
let n = e?.data ?? {}, r = [];
|
|
5342
5411
|
for (let e of Object.values(n)) {
|
|
5343
|
-
let t = e == null ? "" :
|
|
5344
|
-
if (t && r.push(t), r.join(" ").length >
|
|
5412
|
+
let t = e == null ? "" : X(e);
|
|
5413
|
+
if (t && r.push(t), r.join(" ").length > or) break;
|
|
5345
5414
|
}
|
|
5346
|
-
return r.join(" ").slice(0,
|
|
5415
|
+
return r.join(" ").slice(0, or).toLocaleLowerCase(t || void 0);
|
|
5347
5416
|
}
|
|
5348
|
-
function
|
|
5349
|
-
let { tenant: b, apiUrl: x, locale: S } = i(
|
|
5417
|
+
function lr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: r = !1, layout: o = "inline", includePages: s = !0, collections: u = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
|
|
5418
|
+
let { tenant: b, apiUrl: x, locale: S } = i(q), [C, w] = l(() => sr()), [T, E] = l(() => sr()), [D, O] = l(null), [k, A] = l(!1), j = c(null), M = o === "popup";
|
|
5350
5419
|
a(() => {
|
|
5351
5420
|
let e = () => {
|
|
5352
|
-
let e =
|
|
5421
|
+
let e = sr();
|
|
5353
5422
|
w(e), E(e);
|
|
5354
5423
|
};
|
|
5355
5424
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -5400,8 +5469,8 @@ function cr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5400
5469
|
});
|
|
5401
5470
|
}
|
|
5402
5471
|
else for (let t of e.rows) {
|
|
5403
|
-
if (!
|
|
5404
|
-
let n = t?.data ?? {}, r =
|
|
5472
|
+
if (!cr(t, S).includes(N)) continue;
|
|
5473
|
+
let n = t?.data ?? {}, r = X(n.name) || "Untitled", i = X(n.slug);
|
|
5405
5474
|
F.push({
|
|
5406
5475
|
key: `entry:${t.id}`,
|
|
5407
5476
|
title: r,
|
|
@@ -5409,7 +5478,7 @@ function cr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5409
5478
|
kind: "entry"
|
|
5410
5479
|
});
|
|
5411
5480
|
}
|
|
5412
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
5481
|
+
let I = F.slice(0, Math.min(Math.max(1, p), ar)), L = (e) => {
|
|
5413
5482
|
if (v) {
|
|
5414
5483
|
e.preventDefault(), w(T), A(!0);
|
|
5415
5484
|
return;
|
|
@@ -5491,7 +5560,7 @@ function cr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5491
5560
|
onChange: (e) => E(e.target.value),
|
|
5492
5561
|
onFocus: () => N && A(!0),
|
|
5493
5562
|
style: {
|
|
5494
|
-
...
|
|
5563
|
+
...At,
|
|
5495
5564
|
flexGrow: 1,
|
|
5496
5565
|
minWidth: 0
|
|
5497
5566
|
}
|
|
@@ -5549,21 +5618,21 @@ function cr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5549
5618
|
}
|
|
5550
5619
|
//#endregion
|
|
5551
5620
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
5552
|
-
function
|
|
5621
|
+
function ur(e) {
|
|
5553
5622
|
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());
|
|
5554
5623
|
return [...new Set(n.map((e) => e.trim()))];
|
|
5555
5624
|
}
|
|
5556
|
-
var
|
|
5557
|
-
function
|
|
5625
|
+
var dr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
5626
|
+
function fr(e, t) {
|
|
5558
5627
|
let n = String(e ?? "").toUpperCase();
|
|
5559
5628
|
if (t === "code") return n;
|
|
5560
5629
|
let r = "";
|
|
5561
5630
|
try {
|
|
5562
|
-
r =
|
|
5631
|
+
r = dr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
5563
5632
|
} catch {}
|
|
5564
5633
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
5565
5634
|
}
|
|
5566
|
-
function
|
|
5635
|
+
function pr(e, t) {
|
|
5567
5636
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
5568
5637
|
if (typeof window > "u") return n || "?";
|
|
5569
5638
|
try {
|
|
@@ -5573,8 +5642,8 @@ function fr(e, t) {
|
|
|
5573
5642
|
return n || "/";
|
|
5574
5643
|
}
|
|
5575
5644
|
}
|
|
5576
|
-
function
|
|
5577
|
-
let c = i(
|
|
5645
|
+
function mr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef: o, inert: s }) {
|
|
5646
|
+
let c = i(q), l = ur(c?.settings), u = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : u, m = {
|
|
5578
5647
|
display: "inline-flex",
|
|
5579
5648
|
alignItems: "center",
|
|
5580
5649
|
gap: 8,
|
|
@@ -5609,7 +5678,7 @@ function pr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5609
5678
|
style: { opacity: .4 },
|
|
5610
5679
|
children: n ?? "·"
|
|
5611
5680
|
}), /* @__PURE__ */ d("a", {
|
|
5612
|
-
href:
|
|
5681
|
+
href: pr(e, e === u),
|
|
5613
5682
|
hrefLang: e,
|
|
5614
5683
|
"aria-current": e === p ? "true" : void 0,
|
|
5615
5684
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -5619,7 +5688,7 @@ function pr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5619
5688
|
textDecoration: "none",
|
|
5620
5689
|
cursor: s ? "default" : "pointer"
|
|
5621
5690
|
},
|
|
5622
|
-
children:
|
|
5691
|
+
children: fr(e, t)
|
|
5623
5692
|
})]
|
|
5624
5693
|
}, e))]
|
|
5625
5694
|
}) : /* @__PURE__ */ f("div", {
|
|
@@ -5630,7 +5699,7 @@ function pr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5630
5699
|
value: p,
|
|
5631
5700
|
onChange: s ? void 0 : (e) => {
|
|
5632
5701
|
let t = e.target.value;
|
|
5633
|
-
window.location.assign(
|
|
5702
|
+
window.location.assign(pr(t, t === u));
|
|
5634
5703
|
},
|
|
5635
5704
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
5636
5705
|
style: {
|
|
@@ -5644,57 +5713,57 @@ function pr({ variant: e, display: t, separator: n, label: r, style: a, nodeRef:
|
|
|
5644
5713
|
},
|
|
5645
5714
|
children: l.map((e) => /* @__PURE__ */ d("option", {
|
|
5646
5715
|
value: e,
|
|
5647
|
-
children:
|
|
5716
|
+
children: fr(e, t)
|
|
5648
5717
|
}, e))
|
|
5649
5718
|
})]
|
|
5650
5719
|
});
|
|
5651
5720
|
}
|
|
5652
5721
|
//#endregion
|
|
5653
5722
|
//#region ../ui/src/components/builder/apps/index.js
|
|
5654
|
-
var
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
],
|
|
5660
|
-
SiteLoginForm:
|
|
5661
|
-
SiteAccountMenu:
|
|
5662
|
-
SiteLanguagePicker:
|
|
5663
|
-
CookieConsent:
|
|
5664
|
-
SiteSearch:
|
|
5723
|
+
var hr = [
|
|
5724
|
+
Un,
|
|
5725
|
+
rr,
|
|
5726
|
+
Xn,
|
|
5727
|
+
ir
|
|
5728
|
+
], gr = {
|
|
5729
|
+
SiteLoginForm: Jn,
|
|
5730
|
+
SiteAccountMenu: Yn,
|
|
5731
|
+
SiteLanguagePicker: mr,
|
|
5732
|
+
CookieConsent: nr,
|
|
5733
|
+
SiteSearch: lr
|
|
5665
5734
|
};
|
|
5666
|
-
new Set(
|
|
5735
|
+
new Set(hr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
5667
5736
|
//#endregion
|
|
5668
5737
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
5669
|
-
var
|
|
5670
|
-
function
|
|
5671
|
-
if (
|
|
5738
|
+
var _r = /* @__PURE__ */ new Map();
|
|
5739
|
+
function vr(e) {
|
|
5740
|
+
if (_r.has(e)) return _r.get(e);
|
|
5672
5741
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
5673
5742
|
/* @vite-ignore */
|
|
5674
5743
|
/* webpackIgnore: true */
|
|
5675
5744
|
t
|
|
5676
5745
|
).finally(() => URL.revokeObjectURL(t));
|
|
5677
|
-
return
|
|
5746
|
+
return _r.set(e, n), n;
|
|
5678
5747
|
}
|
|
5679
|
-
function
|
|
5748
|
+
function yr(e) {
|
|
5680
5749
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
5681
5750
|
return n && typeof n == "object" ? n : {};
|
|
5682
5751
|
}
|
|
5683
5752
|
//#endregion
|
|
5684
5753
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
5685
|
-
async function
|
|
5686
|
-
let n = await
|
|
5754
|
+
async function br(e, t) {
|
|
5755
|
+
let n = await vr(e);
|
|
5687
5756
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
5688
5757
|
}
|
|
5689
|
-
var
|
|
5758
|
+
var xr = {
|
|
5690
5759
|
padding: "10px 12px",
|
|
5691
5760
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
5692
5761
|
borderRadius: 8,
|
|
5693
5762
|
fontSize: 12,
|
|
5694
5763
|
opacity: .6
|
|
5695
5764
|
};
|
|
5696
|
-
function
|
|
5697
|
-
let s = i(
|
|
5765
|
+
function Sr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
5766
|
+
let s = i(q), l = yr(s?.settings)[e], u = c(null), p = c(null), m = {
|
|
5698
5767
|
tenant: s?.tenant ?? "",
|
|
5699
5768
|
apiUrl: s?.apiUrl ?? "/api",
|
|
5700
5769
|
locale: s?.locale ?? "",
|
|
@@ -5706,7 +5775,7 @@ function xr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
5706
5775
|
let e = u.current;
|
|
5707
5776
|
if (!l?.code || !e) return;
|
|
5708
5777
|
let n = !0;
|
|
5709
|
-
return
|
|
5778
|
+
return br(l.code, t).then((e) => {
|
|
5710
5779
|
if (!(!n || !e || !u.current)) {
|
|
5711
5780
|
p.current = e;
|
|
5712
5781
|
try {
|
|
@@ -5736,7 +5805,7 @@ function xr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
5736
5805
|
}) : /* @__PURE__ */ f("div", {
|
|
5737
5806
|
ref: o,
|
|
5738
5807
|
style: {
|
|
5739
|
-
...
|
|
5808
|
+
...xr,
|
|
5740
5809
|
...P(r)
|
|
5741
5810
|
},
|
|
5742
5811
|
children: [
|
|
@@ -5748,12 +5817,12 @@ function xr({ pluginId: e, blockId: t, props: n, style: r, nodeRef: o }) {
|
|
|
5748
5817
|
}
|
|
5749
5818
|
//#endregion
|
|
5750
5819
|
//#region ../ui/src/components/builder/render.jsx
|
|
5751
|
-
var
|
|
5752
|
-
...
|
|
5753
|
-
...
|
|
5754
|
-
PluginBlock:
|
|
5820
|
+
var Cr = {
|
|
5821
|
+
...Hn,
|
|
5822
|
+
...gr,
|
|
5823
|
+
PluginBlock: Sr
|
|
5755
5824
|
};
|
|
5756
|
-
function
|
|
5825
|
+
function wr(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
5757
5826
|
let o = n[e];
|
|
5758
5827
|
if (!o || o.hidden) return null;
|
|
5759
5828
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -5761,29 +5830,29 @@ function Cr(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5761
5830
|
let n = o.props?.componentId, s = r?.[n];
|
|
5762
5831
|
if (!s?.template || i.has(n)) return null;
|
|
5763
5832
|
let c = new Set(i).add(n);
|
|
5764
|
-
return /* @__PURE__ */ d(t, { children:
|
|
5833
|
+
return /* @__PURE__ */ d(t, { children: wr(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
5765
5834
|
}
|
|
5766
|
-
let l =
|
|
5835
|
+
let l = Cr[s];
|
|
5767
5836
|
if (!l) return null;
|
|
5768
|
-
let u = (o.nodes ?? []).map((e) =>
|
|
5837
|
+
let u = (o.nodes ?? []).map((e) => wr(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, wr(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
5769
5838
|
...c,
|
|
5770
5839
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
5771
5840
|
linked: p,
|
|
5772
5841
|
nodeRef: (t) => {
|
|
5773
|
-
t && (t.setAttribute("data-wb", e),
|
|
5842
|
+
t && (t.setAttribute("data-wb", e), te(t, c), U(t, a?.events === !1 ? [] : c.events));
|
|
5774
5843
|
},
|
|
5775
5844
|
children: u.length ? u : void 0
|
|
5776
5845
|
}, e);
|
|
5777
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
5846
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(qn, {
|
|
5778
5847
|
when: c.when,
|
|
5779
5848
|
children: m
|
|
5780
5849
|
}, e) : m;
|
|
5781
5850
|
}
|
|
5782
5851
|
//#endregion
|
|
5783
5852
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
5784
|
-
var
|
|
5785
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
5786
|
-
function
|
|
5853
|
+
var Tr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Er = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(me(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
5854
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(me(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
5855
|
+
function Dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, animations: c, tenant: l, apiUrl: u, datasets: p, locale: m, direction: g, settings: _, siteUser: v }) {
|
|
5787
5856
|
let y = o?.js?.trim();
|
|
5788
5857
|
if (a(() => {
|
|
5789
5858
|
if (!y) return;
|
|
@@ -5797,35 +5866,35 @@ function Er({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5797
5866
|
minHeight: "100%",
|
|
5798
5867
|
display: "flex",
|
|
5799
5868
|
flexDirection: "column"
|
|
5800
|
-
}, w =
|
|
5869
|
+
}, w = wr("ROOT", e, n), T = s(() => ({ render: (t, r) => wr(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = se(e, n), O = oe(e, n), k = o?.css?.trim(), j = S(c), M = pe(t), N = [M.font, M.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !ue[e]), P = [.../* @__PURE__ */ new Set([...A(e, n), ...N])].map((e) => /* @__PURE__ */ d("link", {
|
|
5801
5870
|
rel: "stylesheet",
|
|
5802
5871
|
precedence: "default",
|
|
5803
5872
|
href: D(e)
|
|
5804
|
-
}, e)), F =
|
|
5805
|
-
return r === "auto" ? /* @__PURE__ */ d(
|
|
5873
|
+
}, e)), F = Er(M);
|
|
5874
|
+
return r === "auto" ? /* @__PURE__ */ d(q.Provider, {
|
|
5806
5875
|
value: {
|
|
5807
5876
|
tenant: l || "",
|
|
5808
5877
|
apiUrl: u || "/api",
|
|
5809
5878
|
locale: m || "",
|
|
5810
5879
|
settings: _ ?? null
|
|
5811
5880
|
},
|
|
5812
|
-
children: /* @__PURE__ */ d(
|
|
5881
|
+
children: /* @__PURE__ */ d(Kn, {
|
|
5813
5882
|
initialUser: v,
|
|
5814
|
-
children: /* @__PURE__ */ d(
|
|
5883
|
+
children: /* @__PURE__ */ d(ye.Provider, {
|
|
5815
5884
|
value: p ?? null,
|
|
5816
|
-
children: /* @__PURE__ */ d(
|
|
5885
|
+
children: /* @__PURE__ */ d(Ce.Provider, {
|
|
5817
5886
|
value: T,
|
|
5818
5887
|
children: /* @__PURE__ */ f("div", {
|
|
5819
5888
|
...b,
|
|
5820
5889
|
className: "webim-page",
|
|
5821
5890
|
style: {
|
|
5822
5891
|
...C,
|
|
5823
|
-
...
|
|
5892
|
+
...he(t),
|
|
5824
5893
|
...i
|
|
5825
5894
|
},
|
|
5826
5895
|
children: [
|
|
5827
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
5828
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
5896
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${Tr(me(M.light))} }
|
|
5897
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Tr(me(M.dark))} } }` }),
|
|
5829
5898
|
/* @__PURE__ */ d("style", { children: F }),
|
|
5830
5899
|
P,
|
|
5831
5900
|
/* @__PURE__ */ d("style", { children: x }),
|
|
@@ -5838,25 +5907,25 @@ function Er({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5838
5907
|
})
|
|
5839
5908
|
})
|
|
5840
5909
|
})
|
|
5841
|
-
}) : /* @__PURE__ */ d(
|
|
5910
|
+
}) : /* @__PURE__ */ d(q.Provider, {
|
|
5842
5911
|
value: {
|
|
5843
5912
|
tenant: l || "",
|
|
5844
5913
|
apiUrl: u || "/api",
|
|
5845
5914
|
locale: m || "",
|
|
5846
5915
|
settings: _ ?? null
|
|
5847
5916
|
},
|
|
5848
|
-
children: /* @__PURE__ */ d(
|
|
5917
|
+
children: /* @__PURE__ */ d(Kn, {
|
|
5849
5918
|
initialUser: v,
|
|
5850
|
-
children: /* @__PURE__ */ d(
|
|
5919
|
+
children: /* @__PURE__ */ d(ye.Provider, {
|
|
5851
5920
|
value: p ?? null,
|
|
5852
|
-
children: /* @__PURE__ */ d(
|
|
5921
|
+
children: /* @__PURE__ */ d(Ce.Provider, {
|
|
5853
5922
|
value: T,
|
|
5854
5923
|
children: /* @__PURE__ */ f("div", {
|
|
5855
5924
|
...b,
|
|
5856
5925
|
className: "webim-page",
|
|
5857
5926
|
style: {
|
|
5858
5927
|
...C,
|
|
5859
|
-
...
|
|
5928
|
+
...ge(t, r),
|
|
5860
5929
|
...i
|
|
5861
5930
|
},
|
|
5862
5931
|
children: [
|
|
@@ -5878,8 +5947,8 @@ function Er({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
5878
5947
|
}
|
|
5879
5948
|
//#endregion
|
|
5880
5949
|
//#region src/WebimContent.jsx
|
|
5881
|
-
function
|
|
5882
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
5950
|
+
function Or({ bundle: e, mode: t = "auto", style: n }) {
|
|
5951
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(Dr, {
|
|
5883
5952
|
blocks: e.blocks,
|
|
5884
5953
|
theme: e.theme,
|
|
5885
5954
|
components: e.components,
|
|
@@ -5891,13 +5960,13 @@ function Dr({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
5891
5960
|
locale: e.locale,
|
|
5892
5961
|
direction: e.direction,
|
|
5893
5962
|
settings: e.settings,
|
|
5894
|
-
mode:
|
|
5963
|
+
mode: ve(t, e.scheme),
|
|
5895
5964
|
style: n
|
|
5896
5965
|
}) : null;
|
|
5897
5966
|
}
|
|
5898
5967
|
//#endregion
|
|
5899
5968
|
//#region src/bundle.js
|
|
5900
|
-
function
|
|
5969
|
+
function kr({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
5901
5970
|
let a = {
|
|
5902
5971
|
...t?.global ?? {},
|
|
5903
5972
|
...t?.tenant ?? {}
|
|
@@ -5907,7 +5976,7 @@ function Or({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
5907
5976
|
title: e.title,
|
|
5908
5977
|
slug: e.slug,
|
|
5909
5978
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
5910
|
-
theme:
|
|
5979
|
+
theme: _e(o, a.builder_themes?.themes),
|
|
5911
5980
|
components: a.builder_components?.components ?? {},
|
|
5912
5981
|
custom: o.custom,
|
|
5913
5982
|
animations: o.animations,
|
|
@@ -5923,18 +5992,18 @@ function Or({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
5923
5992
|
}
|
|
5924
5993
|
//#endregion
|
|
5925
5994
|
//#region src/fetchPage.js
|
|
5926
|
-
var
|
|
5995
|
+
var Ar = async (e) => {
|
|
5927
5996
|
let t = await e.json().catch(() => null);
|
|
5928
5997
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
5929
5998
|
return t?.payload ?? t;
|
|
5930
5999
|
};
|
|
5931
|
-
async function
|
|
6000
|
+
async function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
5932
6001
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
5933
6002
|
if (!n) throw Error("fetchPage: slug is required");
|
|
5934
6003
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
5935
6004
|
...t ? { "x-tenant": t } : {},
|
|
5936
6005
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
5937
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
6006
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(Ar), c(`${l}/settings/public`, { headers: u }).then(Ar)]), p = kr({
|
|
5938
6007
|
page: d,
|
|
5939
6008
|
settings: f,
|
|
5940
6009
|
tenant: t,
|
|
@@ -5948,7 +6017,7 @@ async function Ar({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
5948
6017
|
"MasonryBlock"
|
|
5949
6018
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
5950
6019
|
if (m.length) {
|
|
5951
|
-
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(
|
|
6020
|
+
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(Ar).then((e) => {
|
|
5952
6021
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
5953
6022
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
5954
6023
|
}).catch(() => [[t, []]])));
|
|
@@ -5962,40 +6031,40 @@ async function Ar({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
5962
6031
|
}
|
|
5963
6032
|
//#endregion
|
|
5964
6033
|
//#region src/ssr.jsx
|
|
5965
|
-
var
|
|
6034
|
+
var Mr = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
5966
6035
|
"&": "&",
|
|
5967
6036
|
"<": "<",
|
|
5968
6037
|
">": ">",
|
|
5969
6038
|
"\"": """
|
|
5970
6039
|
})[e]);
|
|
5971
|
-
function
|
|
5972
|
-
return e(/* @__PURE__ */ d(
|
|
6040
|
+
function Nr(t, { mode: n = "auto", style: r } = {}) {
|
|
6041
|
+
return e(/* @__PURE__ */ d(Or, {
|
|
5973
6042
|
bundle: t,
|
|
5974
6043
|
mode: n,
|
|
5975
6044
|
style: r
|
|
5976
6045
|
}));
|
|
5977
6046
|
}
|
|
5978
|
-
function
|
|
6047
|
+
function Pr(e, { mode: t = "auto", lang: n } = {}) {
|
|
5979
6048
|
let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
|
|
5980
6049
|
"<meta charset=\"utf-8\"/>",
|
|
5981
6050
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
5982
|
-
`<title>${
|
|
5983
|
-
r.description && `<meta name="description" content="${
|
|
5984
|
-
`<meta property="og:title" content="${
|
|
5985
|
-
r.image && `<meta property="og:image" content="${
|
|
6051
|
+
`<title>${Mr(o)}</title>`,
|
|
6052
|
+
r.description && `<meta name="description" content="${Mr(r.description)}"/>`,
|
|
6053
|
+
`<meta property="og:title" content="${Mr(o)}"/>`,
|
|
6054
|
+
r.image && `<meta property="og:image" content="${Mr(r.image)}"/>`,
|
|
5986
6055
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
5987
6056
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
5988
6057
|
].filter(Boolean).join("\n");
|
|
5989
6058
|
return `<!doctype html>
|
|
5990
|
-
<html lang="${
|
|
6059
|
+
<html lang="${Mr(i)}"${a ? ` dir="${a}"` : ""}>
|
|
5991
6060
|
<head>
|
|
5992
6061
|
${c}
|
|
5993
6062
|
</head>
|
|
5994
6063
|
<body>
|
|
5995
|
-
${
|
|
6064
|
+
${Nr(e, { mode: t })}
|
|
5996
6065
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
5997
6066
|
</body>
|
|
5998
6067
|
</html>`;
|
|
5999
6068
|
}
|
|
6000
6069
|
//#endregion
|
|
6001
|
-
export {
|
|
6070
|
+
export { kr as assembleBundle, jr as fetchPage, Nr as renderBundleHtml, Pr as renderPageDocument };
|