webim-adapter 1.0.3 → 1.1.1
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 +483 -378
- package/build/webim-embed.js +13 -13
- package/build/webim-ssr.js +634 -529
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -248,20 +248,20 @@ function A(e) {
|
|
|
248
248
|
color: j,
|
|
249
249
|
inset: M
|
|
250
250
|
})), N.length && (t.boxShadow = N.join(", "));
|
|
251
|
-
let P = (e) => e.type === "blur" ? `blur(${O(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: V, filterSaturate:
|
|
251
|
+
let P = (e) => e.type === "blur" ? `blur(${O(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: V, filterSaturate: H } = t;
|
|
252
252
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
253
|
-
let
|
|
254
|
-
R !== void 0 &&
|
|
255
|
-
let
|
|
256
|
-
|
|
257
|
-
let { textStrokeWidth:
|
|
258
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
259
|
-
let { clipText:
|
|
260
|
-
delete t.clipText,
|
|
261
|
-
let { transitions:
|
|
253
|
+
let U = F(I);
|
|
254
|
+
R !== void 0 && U.push(`blur(${O(R)})`), z !== void 0 && U.push(`grayscale(${z}%)`), B !== void 0 && U.push(`brightness(${B}%)`), V !== void 0 && U.push(`contrast(${V}%)`), H !== void 0 && U.push(`saturate(${H}%)`), U.length && (t.filter = U.join(" "));
|
|
255
|
+
let ee = F(L);
|
|
256
|
+
ee.length && (t.backdropFilter = ee.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
257
|
+
let { textStrokeWidth: W, textStrokeColor: te } = t;
|
|
258
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (W !== void 0 || te !== void 0) && (t.WebkitTextStroke = `${O(W ?? 1)} ${te || "currentColor"}`);
|
|
259
|
+
let { clipText: ne } = t;
|
|
260
|
+
delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
261
|
+
let { transitions: re, transitionDuration: ie, transitionEasing: ae, transitionProperty: G } = t, oe = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
262
262
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
263
|
-
let se = (Array.isArray(
|
|
264
|
-
if (
|
|
263
|
+
let se = (Array.isArray(re) ? re : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${oe(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
264
|
+
if (ie !== void 0 && se.push(`${G || "all"} ${oe(ie)} ${ae || "ease"}`), se.length && (t.transition = se.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
265
265
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
266
266
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
267
267
|
}
|
|
@@ -272,12 +272,12 @@ function A(e) {
|
|
|
272
272
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
273
273
|
}
|
|
274
274
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
275
|
-
let { backgroundLayers:
|
|
275
|
+
let { backgroundLayers: ue } = t;
|
|
276
276
|
delete t.backgroundLayers;
|
|
277
|
-
let
|
|
278
|
-
if (
|
|
277
|
+
let K = (Array.isArray(ue) ? ue : []).filter((e) => e && e.on !== !1);
|
|
278
|
+
if (K.length) {
|
|
279
279
|
let e = [], n = [], r = [], i = [], a = [];
|
|
280
|
-
for (let t of
|
|
280
|
+
for (let t of K) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
281
281
|
else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
282
282
|
else {
|
|
283
283
|
if (!t.src) continue;
|
|
@@ -369,15 +369,15 @@ function V(e, t, n = []) {
|
|
|
369
369
|
}
|
|
370
370
|
return a;
|
|
371
371
|
}
|
|
372
|
-
var
|
|
373
|
-
function
|
|
374
|
-
let i = Object.entries(A(t)).map(([e, t]) => `${
|
|
372
|
+
var H = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
373
|
+
function U(e, t, n, r = !1) {
|
|
374
|
+
let i = Object.entries(A(t)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
|
|
375
375
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
376
376
|
}
|
|
377
|
-
function
|
|
378
|
-
return Object.entries(j).map(([r, i]) =>
|
|
377
|
+
function ee(e, t, n) {
|
|
378
|
+
return Object.entries(j).map(([r, i]) => U(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
379
379
|
}
|
|
380
|
-
var
|
|
380
|
+
var W = [
|
|
381
381
|
{
|
|
382
382
|
key: "tablet",
|
|
383
383
|
max: 991
|
|
@@ -390,17 +390,17 @@ var U = [
|
|
|
390
390
|
key: "mobile",
|
|
391
391
|
max: 478
|
|
392
392
|
}
|
|
393
|
-
],
|
|
394
|
-
function
|
|
395
|
-
return
|
|
396
|
-
let i = t?.[n] ?
|
|
393
|
+
], te = (e) => Object.entries(A(e)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
|
|
394
|
+
function ne(e, t) {
|
|
395
|
+
return W.map(({ key: n, max: r }) => {
|
|
396
|
+
let i = t?.[n] ? te(t[n]) : "";
|
|
397
397
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
398
398
|
}).filter(Boolean).join("\n");
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function re(e, t) {
|
|
401
401
|
let n = [], r = (e) => {
|
|
402
402
|
for (let [t, r] of Object.entries(e || {})) {
|
|
403
|
-
let e =
|
|
403
|
+
let e = ne(t, r.props);
|
|
404
404
|
e && n.push(e);
|
|
405
405
|
}
|
|
406
406
|
};
|
|
@@ -408,10 +408,10 @@ function ie(e, t) {
|
|
|
408
408
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
409
409
|
return n.join("\n");
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function ie(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
|
-
let e =
|
|
414
|
+
let e = ee(t, r.props);
|
|
415
415
|
e && n.push(e);
|
|
416
416
|
}
|
|
417
417
|
};
|
|
@@ -419,7 +419,7 @@ function ae(e, t) {
|
|
|
419
419
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
420
420
|
return n.join("\n");
|
|
421
421
|
}
|
|
422
|
-
var
|
|
422
|
+
var ae = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", G = {
|
|
423
423
|
light: {
|
|
424
424
|
background: "#f2f2f2",
|
|
425
425
|
surface: "#f2f2f2",
|
|
@@ -468,15 +468,15 @@ var W = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
468
468
|
}, se = {
|
|
469
469
|
system: {
|
|
470
470
|
label: "System",
|
|
471
|
-
value:
|
|
471
|
+
value: ae
|
|
472
472
|
},
|
|
473
473
|
inter: {
|
|
474
474
|
label: "Inter",
|
|
475
|
-
value: `"Inter", ${
|
|
475
|
+
value: `"Inter", ${ae}`
|
|
476
476
|
},
|
|
477
477
|
outfit: {
|
|
478
478
|
label: "Outfit",
|
|
479
|
-
value: `"Outfit", ${
|
|
479
|
+
value: `"Outfit", ${ae}`
|
|
480
480
|
},
|
|
481
481
|
serif: {
|
|
482
482
|
label: "Serif",
|
|
@@ -502,7 +502,7 @@ var W = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
502
502
|
}), {})
|
|
503
503
|
}, n;
|
|
504
504
|
};
|
|
505
|
-
function
|
|
505
|
+
function ue(e) {
|
|
506
506
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
507
507
|
return {
|
|
508
508
|
font: r ?? oe.font,
|
|
@@ -511,7 +511,7 @@ function K(e) {
|
|
|
511
511
|
dark: le(G.dark, n)
|
|
512
512
|
};
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function K(e) {
|
|
515
515
|
return {
|
|
516
516
|
"--page-bg": e.background,
|
|
517
517
|
"--page-surface": e.surface ?? e.background,
|
|
@@ -529,31 +529,31 @@ function q(e) {
|
|
|
529
529
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
530
530
|
};
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
let t =
|
|
532
|
+
function de(e) {
|
|
533
|
+
let t = ue(e);
|
|
534
534
|
return {
|
|
535
535
|
backgroundColor: "var(--page-bg)",
|
|
536
536
|
color: "var(--page-text)",
|
|
537
|
-
fontFamily: ce(t.font,
|
|
537
|
+
fontFamily: ce(t.font, ae),
|
|
538
538
|
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : ce(t.headingFont, "inherit")
|
|
539
539
|
};
|
|
540
540
|
}
|
|
541
|
-
function
|
|
542
|
-
let n =
|
|
541
|
+
function fe(e, t = "light") {
|
|
542
|
+
let n = ue(e);
|
|
543
543
|
return {
|
|
544
|
-
...
|
|
545
|
-
...
|
|
544
|
+
...de(e),
|
|
545
|
+
...K(n[t] ?? n.light)
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function pe(e, t) {
|
|
549
549
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function me(e, t) {
|
|
552
552
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
553
553
|
}
|
|
554
554
|
//#endregion
|
|
555
555
|
//#region src/bundle.js
|
|
556
|
-
function
|
|
556
|
+
function he({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
557
557
|
let a = {
|
|
558
558
|
...t?.global ?? {},
|
|
559
559
|
...t?.tenant ?? {}
|
|
@@ -563,7 +563,7 @@ function pe({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
563
563
|
title: e.title,
|
|
564
564
|
slug: e.slug,
|
|
565
565
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
566
|
-
theme:
|
|
566
|
+
theme: pe(o, a.builder_themes?.themes),
|
|
567
567
|
components: a.builder_components?.components ?? {},
|
|
568
568
|
custom: o.custom,
|
|
569
569
|
animations: o.animations,
|
|
@@ -579,18 +579,18 @@ function pe({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
579
579
|
}
|
|
580
580
|
//#endregion
|
|
581
581
|
//#region src/fetchPage.js
|
|
582
|
-
var
|
|
582
|
+
var ge = async (e) => {
|
|
583
583
|
let t = await e.json().catch(() => null);
|
|
584
584
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
585
585
|
return t?.payload ?? t;
|
|
586
586
|
};
|
|
587
|
-
async function
|
|
587
|
+
async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
588
588
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
589
589
|
if (!n) throw Error("fetchPage: slug is required");
|
|
590
590
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
591
591
|
...t ? { "x-tenant": t } : {},
|
|
592
592
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
593
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
593
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(ge), c(`${l}/settings/public`, { headers: u }).then(ge)]), p = he({
|
|
594
594
|
page: d,
|
|
595
595
|
settings: f,
|
|
596
596
|
tenant: t,
|
|
@@ -604,7 +604,7 @@ async function he({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
604
604
|
"MasonryBlock"
|
|
605
605
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
606
606
|
if (m.length) {
|
|
607
|
-
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(
|
|
607
|
+
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(ge).then((e) => {
|
|
608
608
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
609
609
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
610
610
|
}).catch(() => [[t, []]])));
|
|
@@ -618,7 +618,7 @@ async function he({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
618
618
|
}
|
|
619
619
|
//#endregion
|
|
620
620
|
//#region ../ui/src/components/builder/locale.js
|
|
621
|
-
var
|
|
621
|
+
var ve = /* @__PURE__ */ new Set([
|
|
622
622
|
"ar",
|
|
623
623
|
"he",
|
|
624
624
|
"fa",
|
|
@@ -629,34 +629,34 @@ var ge = /* @__PURE__ */ new Set([
|
|
|
629
629
|
"yi",
|
|
630
630
|
"dv",
|
|
631
631
|
"ckb"
|
|
632
|
-
]),
|
|
632
|
+
]), ye = (e) => ve.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", be = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ye(t) : void 0, q = t({
|
|
633
633
|
tenant: "",
|
|
634
634
|
apiUrl: "/api",
|
|
635
635
|
locale: "",
|
|
636
636
|
settings: null
|
|
637
|
-
}),
|
|
637
|
+
}), xe = t(null), Se = (e) => {
|
|
638
638
|
let t = Number(e?.__page);
|
|
639
639
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
640
640
|
if (typeof window > "u") return 1;
|
|
641
641
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
642
642
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
643
|
-
},
|
|
643
|
+
}, Ce = () => {
|
|
644
644
|
if (typeof window > "u") return {};
|
|
645
645
|
let e = {};
|
|
646
646
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
647
647
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
648
648
|
}), e;
|
|
649
|
-
},
|
|
649
|
+
}, we = (e) => {
|
|
650
650
|
let t = {
|
|
651
651
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
652
|
-
...
|
|
652
|
+
...Ce()
|
|
653
653
|
};
|
|
654
654
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
655
|
-
},
|
|
655
|
+
}, J = t(null), Y = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
656
656
|
function Te(e, t) {
|
|
657
657
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
658
658
|
}
|
|
659
|
-
var
|
|
659
|
+
var X = (e) => {
|
|
660
660
|
let t = [];
|
|
661
661
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
662
662
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -666,36 +666,36 @@ var Ee = (e) => {
|
|
|
666
666
|
}
|
|
667
667
|
return t;
|
|
668
668
|
};
|
|
669
|
-
function
|
|
669
|
+
function Z(e) {
|
|
670
670
|
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
|
|
671
671
|
}
|
|
672
|
-
function
|
|
673
|
-
let n = t?.data ?? {}, r =
|
|
672
|
+
function Ee(e, t) {
|
|
673
|
+
let n = t?.data ?? {}, r = X(n);
|
|
674
674
|
if (!r.length) return e;
|
|
675
|
-
let i = RegExp(`:(${r.map(
|
|
675
|
+
let i = RegExp(`:(${r.map(Y).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Z(Te(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
676
676
|
return a(e);
|
|
677
677
|
}
|
|
678
|
-
var
|
|
678
|
+
var De = {
|
|
679
679
|
margin: 0,
|
|
680
680
|
fontWeight: 700,
|
|
681
681
|
lineHeight: 1.2,
|
|
682
682
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
683
|
-
},
|
|
683
|
+
}, Oe = { margin: 0 }, ke = {
|
|
684
684
|
display: "inline-block",
|
|
685
685
|
textDecoration: "none",
|
|
686
686
|
cursor: "pointer",
|
|
687
687
|
backgroundColor: "var(--page-accent, #111827)",
|
|
688
688
|
color: "var(--page-accent-text, #ffffff)"
|
|
689
|
-
},
|
|
689
|
+
}, Ae = {
|
|
690
690
|
flexGrow: 1,
|
|
691
691
|
display: "flex",
|
|
692
692
|
flexDirection: "column",
|
|
693
693
|
position: "relative"
|
|
694
|
-
},
|
|
694
|
+
}, je = {
|
|
695
695
|
display: "flex",
|
|
696
696
|
flexDirection: "column"
|
|
697
697
|
};
|
|
698
|
-
function
|
|
698
|
+
function Me({ style: e }) {
|
|
699
699
|
let t = e?.backgroundVideo;
|
|
700
700
|
if (!t) return null;
|
|
701
701
|
let n = {
|
|
@@ -721,7 +721,7 @@ function Ne({ style: e }) {
|
|
|
721
721
|
background: r
|
|
722
722
|
} })] });
|
|
723
723
|
}
|
|
724
|
-
var
|
|
724
|
+
var Ne = (e, t) => e?.backgroundVideo ? {
|
|
725
725
|
position: "relative",
|
|
726
726
|
...t,
|
|
727
727
|
...A(e)
|
|
@@ -729,24 +729,24 @@ var Pe = (e, t) => e?.backgroundVideo ? {
|
|
|
729
729
|
...t,
|
|
730
730
|
...A(e)
|
|
731
731
|
};
|
|
732
|
-
function
|
|
732
|
+
function Pe({ style: e, nodeRef: t, children: n }) {
|
|
733
733
|
return /* @__PURE__ */ d("div", {
|
|
734
734
|
ref: t,
|
|
735
735
|
style: {
|
|
736
|
-
...
|
|
736
|
+
...Ae,
|
|
737
737
|
...A(e)
|
|
738
738
|
},
|
|
739
|
-
children: [/* @__PURE__ */ u(
|
|
739
|
+
children: [/* @__PURE__ */ u(Me, { style: e }), n]
|
|
740
740
|
});
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function Fe({ style: e, nodeRef: t, children: n }) {
|
|
743
743
|
return /* @__PURE__ */ d("section", {
|
|
744
744
|
ref: t,
|
|
745
|
-
style:
|
|
746
|
-
children: [/* @__PURE__ */ u(
|
|
745
|
+
style: Ne(e, je),
|
|
746
|
+
children: [/* @__PURE__ */ u(Me, { style: e }), n]
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function Ie({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
750
750
|
let i = t ? {
|
|
751
751
|
position: "relative",
|
|
752
752
|
minHeight: 240
|
|
@@ -755,48 +755,54 @@ function Le({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
755
755
|
ref: n,
|
|
756
756
|
style: i ? {
|
|
757
757
|
...i,
|
|
758
|
-
...
|
|
759
|
-
} :
|
|
760
|
-
children: [/* @__PURE__ */ u(
|
|
758
|
+
...Ne(e)
|
|
759
|
+
} : Ne(e),
|
|
760
|
+
children: [/* @__PURE__ */ u(Me, { style: e }), r]
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function Le({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
764
764
|
return /* @__PURE__ */ u(n, {
|
|
765
765
|
ref: a,
|
|
766
766
|
style: {
|
|
767
|
-
...
|
|
767
|
+
...De,
|
|
768
768
|
...A(r)
|
|
769
769
|
},
|
|
770
|
-
children:
|
|
770
|
+
children: Be(t, e, i)
|
|
771
771
|
});
|
|
772
772
|
}
|
|
773
|
-
var
|
|
773
|
+
var Re = {
|
|
774
774
|
fontFamily: se.mono.value,
|
|
775
775
|
background: "rgba(148, 163, 184, 0.18)",
|
|
776
776
|
padding: "1px 5px",
|
|
777
777
|
borderRadius: 4,
|
|
778
778
|
fontSize: "0.9em"
|
|
779
779
|
};
|
|
780
|
-
function
|
|
780
|
+
function ze(e, t = [], n, r) {
|
|
781
781
|
let i = e;
|
|
782
782
|
return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
|
|
783
|
-
style:
|
|
783
|
+
style: Re,
|
|
784
784
|
children: i
|
|
785
|
-
})), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n
|
|
785
|
+
})), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n ? i = /* @__PURE__ */ u("a", {
|
|
786
786
|
href: n,
|
|
787
787
|
target: r || void 0,
|
|
788
788
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
789
|
-
style: {
|
|
789
|
+
style: {
|
|
790
|
+
color: "inherit",
|
|
791
|
+
...t.includes("nounderline") && { textDecoration: "none" }
|
|
792
|
+
},
|
|
793
|
+
children: i
|
|
794
|
+
}) : t.includes("nounderline") && (i = /* @__PURE__ */ u("span", {
|
|
795
|
+
style: { textDecoration: "none" },
|
|
790
796
|
children: i
|
|
791
797
|
})), i;
|
|
792
798
|
}
|
|
793
|
-
function
|
|
799
|
+
function Be(t, n, r) {
|
|
794
800
|
return t?.length ? t.map((t, n) => {
|
|
795
801
|
if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
|
|
796
|
-
if (t.parts) return /* @__PURE__ */ u(e, { children:
|
|
802
|
+
if (t.parts) return /* @__PURE__ */ u(e, { children: Be(t.parts, "", r) }, n);
|
|
797
803
|
let i = t.text;
|
|
798
804
|
return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
|
|
799
|
-
style:
|
|
805
|
+
style: Re,
|
|
800
806
|
children: i
|
|
801
807
|
})), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
|
|
802
808
|
style: {
|
|
@@ -804,11 +810,17 @@ function Z(t, n, r) {
|
|
|
804
810
|
...t.background && { backgroundColor: t.background }
|
|
805
811
|
},
|
|
806
812
|
children: i
|
|
807
|
-
})), t.href
|
|
813
|
+
})), t.href ? i = /* @__PURE__ */ u("a", {
|
|
808
814
|
href: t.href,
|
|
809
815
|
target: t.target || void 0,
|
|
810
816
|
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
811
|
-
style: {
|
|
817
|
+
style: {
|
|
818
|
+
color: t.color ?? "inherit",
|
|
819
|
+
...t.nounderline && { textDecoration: "none" }
|
|
820
|
+
},
|
|
821
|
+
children: i
|
|
822
|
+
}) : t.nounderline && (i = /* @__PURE__ */ u("span", {
|
|
823
|
+
style: { textDecoration: "none" },
|
|
812
824
|
children: i
|
|
813
825
|
})), /* @__PURE__ */ u(e, { children: i }, n);
|
|
814
826
|
}) : n;
|
|
@@ -816,7 +828,7 @@ function Z(t, n, r) {
|
|
|
816
828
|
function Ve({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
817
829
|
return /* @__PURE__ */ u("span", {
|
|
818
830
|
style: A(a),
|
|
819
|
-
children: e?.length ?
|
|
831
|
+
children: e?.length ? Be(e, t) : ze(t, n, r, i)
|
|
820
832
|
});
|
|
821
833
|
}
|
|
822
834
|
var He = {
|
|
@@ -862,7 +874,7 @@ function Ue({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
862
874
|
};
|
|
863
875
|
}
|
|
864
876
|
function We(e = [], t, n) {
|
|
865
|
-
let r = n ?? ((e, n) =>
|
|
877
|
+
let r = n ?? ((e, n) => Be(e, n, t));
|
|
866
878
|
return e.map((t, n) => {
|
|
867
879
|
let i = {
|
|
868
880
|
marginTop: 0,
|
|
@@ -921,6 +933,47 @@ function We(e = [], t, n) {
|
|
|
921
933
|
start: t.start
|
|
922
934
|
})
|
|
923
935
|
}, n) : null;
|
|
936
|
+
if (t.type === "button") {
|
|
937
|
+
if (!(typeof t.label == "string" && t.label.trim())) return null;
|
|
938
|
+
let e = Number.isFinite(Number(t.radius)) ? Number(t.radius) : 8, r = ["center", "right"].includes(t.align) ? t.align : "left";
|
|
939
|
+
return /* @__PURE__ */ u("div", {
|
|
940
|
+
style: {
|
|
941
|
+
...i,
|
|
942
|
+
textAlign: r
|
|
943
|
+
},
|
|
944
|
+
children: /* @__PURE__ */ u("table", {
|
|
945
|
+
role: "presentation",
|
|
946
|
+
cellPadding: 0,
|
|
947
|
+
cellSpacing: 0,
|
|
948
|
+
style: {
|
|
949
|
+
borderCollapse: "separate",
|
|
950
|
+
display: "inline-table"
|
|
951
|
+
},
|
|
952
|
+
children: /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
953
|
+
style: {
|
|
954
|
+
backgroundColor: t.bg || "var(--page-accent, #4f46e5)",
|
|
955
|
+
borderRadius: e
|
|
956
|
+
},
|
|
957
|
+
children: /* @__PURE__ */ u("a", {
|
|
958
|
+
href: t.href || "#",
|
|
959
|
+
target: t.target || void 0,
|
|
960
|
+
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
961
|
+
style: {
|
|
962
|
+
display: "inline-block",
|
|
963
|
+
padding: "13px 24px",
|
|
964
|
+
color: t.color || "#ffffff",
|
|
965
|
+
fontSize: 15,
|
|
966
|
+
fontWeight: 600,
|
|
967
|
+
lineHeight: 1.2,
|
|
968
|
+
textDecoration: "none",
|
|
969
|
+
borderRadius: e
|
|
970
|
+
},
|
|
971
|
+
children: t.label
|
|
972
|
+
})
|
|
973
|
+
}) }) })
|
|
974
|
+
})
|
|
975
|
+
}, n);
|
|
976
|
+
}
|
|
924
977
|
if (t.type === "divider") return /* @__PURE__ */ u("hr", { style: {
|
|
925
978
|
...i,
|
|
926
979
|
border: 0,
|
|
@@ -983,7 +1036,7 @@ function We(e = [], t, n) {
|
|
|
983
1036
|
let e = t.type;
|
|
984
1037
|
return /* @__PURE__ */ u(e, {
|
|
985
1038
|
style: {
|
|
986
|
-
...
|
|
1039
|
+
...De,
|
|
987
1040
|
fontSize: He[t.type],
|
|
988
1041
|
...i
|
|
989
1042
|
},
|
|
@@ -992,7 +1045,7 @@ function We(e = [], t, n) {
|
|
|
992
1045
|
}
|
|
993
1046
|
return /* @__PURE__ */ u("p", {
|
|
994
1047
|
style: {
|
|
995
|
-
...
|
|
1048
|
+
...Oe,
|
|
996
1049
|
...i
|
|
997
1050
|
},
|
|
998
1051
|
children: r(t.parts, t.text)
|
|
@@ -1021,7 +1074,7 @@ function qe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
|
1021
1074
|
...Ke,
|
|
1022
1075
|
...A(n)
|
|
1023
1076
|
},
|
|
1024
|
-
children:
|
|
1077
|
+
children: Be(t, e, r)
|
|
1025
1078
|
});
|
|
1026
1079
|
}
|
|
1027
1080
|
function Je({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
@@ -1034,7 +1087,7 @@ function Je({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
1034
1087
|
},
|
|
1035
1088
|
children: t.map((e, t) => /* @__PURE__ */ u("li", {
|
|
1036
1089
|
style: { marginBottom: 4 },
|
|
1037
|
-
children:
|
|
1090
|
+
children: Be(e.parts, e.text)
|
|
1038
1091
|
}, t))
|
|
1039
1092
|
});
|
|
1040
1093
|
}
|
|
@@ -1042,10 +1095,10 @@ function Ye({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
|
1042
1095
|
return /* @__PURE__ */ u("p", {
|
|
1043
1096
|
ref: i,
|
|
1044
1097
|
style: {
|
|
1045
|
-
...
|
|
1098
|
+
...Oe,
|
|
1046
1099
|
...A(n)
|
|
1047
1100
|
},
|
|
1048
|
-
children:
|
|
1101
|
+
children: Be(t, e, r)
|
|
1049
1102
|
});
|
|
1050
1103
|
}
|
|
1051
1104
|
var Xe = {
|
|
@@ -1064,7 +1117,7 @@ function Ze({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRe
|
|
|
1064
1117
|
...Xe,
|
|
1065
1118
|
...A(i)
|
|
1066
1119
|
},
|
|
1067
|
-
children:
|
|
1120
|
+
children: Be(t, e, a)
|
|
1068
1121
|
});
|
|
1069
1122
|
}
|
|
1070
1123
|
function Qe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
@@ -1074,10 +1127,10 @@ function Qe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRe
|
|
|
1074
1127
|
target: r || void 0,
|
|
1075
1128
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1076
1129
|
style: {
|
|
1077
|
-
...
|
|
1130
|
+
...ke,
|
|
1078
1131
|
...A(i)
|
|
1079
1132
|
},
|
|
1080
|
-
children:
|
|
1133
|
+
children: Be(t, e, a)
|
|
1081
1134
|
});
|
|
1082
1135
|
}
|
|
1083
1136
|
function $e({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
@@ -1726,7 +1779,7 @@ function xt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1726
1779
|
});
|
|
1727
1780
|
}
|
|
1728
1781
|
function St(e, t = {}, n = 0) {
|
|
1729
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
1782
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Z(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1730
1783
|
for (let e of r) {
|
|
1731
1784
|
let n = e.data ?? e, r = Te(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(Te(n, t.nameField)) : i(n.name), l = t.hrefField ? i(Te(n, t.hrefField)) : "";
|
|
1732
1785
|
for (let e of s) if (o.push({
|
|
@@ -1739,7 +1792,7 @@ function St(e, t = {}, n = 0) {
|
|
|
1739
1792
|
return o;
|
|
1740
1793
|
}
|
|
1741
1794
|
function Ct({ images: e = [], source: t = "", entry: n = "", imageField: a = "", nameField: o = "", hrefField: s = "", limit: f = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
|
|
1742
|
-
let { tenant: x, apiUrl: S } = r(
|
|
1795
|
+
let { tenant: x, apiUrl: S } = r(q), C = r(xe)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
|
|
1743
1796
|
i(() => {
|
|
1744
1797
|
if (!t || C) return;
|
|
1745
1798
|
let e = !0;
|
|
@@ -1974,7 +2027,7 @@ var wt = {
|
|
|
1974
2027
|
zIndex: 60
|
|
1975
2028
|
};
|
|
1976
2029
|
function Et(e, t = {}, n = "dropdown") {
|
|
1977
|
-
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 ? "" :
|
|
2030
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" : Z(e), o = r.map((e) => {
|
|
1978
2031
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
1979
2032
|
return {
|
|
1980
2033
|
key: e.id,
|
|
@@ -2016,7 +2069,7 @@ function Et(e, t = {}, n = "dropdown") {
|
|
|
2016
2069
|
}));
|
|
2017
2070
|
}
|
|
2018
2071
|
function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], style: f, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
|
|
2019
|
-
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(
|
|
2072
|
+
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(q), P = r(xe)?.[g], [F, I] = c(null);
|
|
2020
2073
|
i(() => {
|
|
2021
2074
|
if (!g || P) return;
|
|
2022
2075
|
let e = !0;
|
|
@@ -2288,55 +2341,79 @@ function Ot({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2288
2341
|
}, e.key))]
|
|
2289
2342
|
}) : null;
|
|
2290
2343
|
}
|
|
2291
|
-
function kt({ items: e = [], linked: t, multiple: n = !1,
|
|
2292
|
-
let [
|
|
2344
|
+
function kt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: l, openColor: f, borderColor: p, style: m, nodeRef: h }) {
|
|
2345
|
+
let [g, _] = c(() => new Set(e.length ? [e[0].key] : []));
|
|
2293
2346
|
if (!e.length) return null;
|
|
2294
|
-
let
|
|
2347
|
+
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2348
|
+
let n = Number(e);
|
|
2349
|
+
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2350
|
+
}, b = bt[r], x = (e) => _((t) => {
|
|
2295
2351
|
let r = new Set(n ? t : []);
|
|
2296
2352
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2297
2353
|
});
|
|
2298
2354
|
return /* @__PURE__ */ u("div", {
|
|
2299
|
-
ref:
|
|
2355
|
+
ref: h,
|
|
2300
2356
|
style: {
|
|
2301
2357
|
width: "100%",
|
|
2302
|
-
...A(
|
|
2358
|
+
...A(m)
|
|
2303
2359
|
},
|
|
2304
2360
|
children: e.map((n, r) => {
|
|
2305
|
-
let
|
|
2361
|
+
let c = g.has(n.key);
|
|
2306
2362
|
return /* @__PURE__ */ d("div", {
|
|
2307
|
-
style: { borderBottom: r < e.length - 1 ?
|
|
2363
|
+
style: { borderBottom: r < e.length - 1 ? `1px solid ${v(p, "rgba(148, 163, 184, 0.35)")}` : "none" },
|
|
2308
2364
|
children: [/* @__PURE__ */ d("button", {
|
|
2309
2365
|
type: "button",
|
|
2310
|
-
onClick: () =>
|
|
2366
|
+
onClick: () => x(n.key),
|
|
2311
2367
|
style: {
|
|
2312
2368
|
width: "100%",
|
|
2313
2369
|
display: "flex",
|
|
2314
2370
|
alignItems: "center",
|
|
2315
2371
|
justifyContent: "space-between",
|
|
2316
2372
|
gap: 12,
|
|
2317
|
-
background: "transparent",
|
|
2373
|
+
background: c ? v(l, v(o, "transparent")) : v(o, "transparent"),
|
|
2318
2374
|
border: 0,
|
|
2319
|
-
padding:
|
|
2375
|
+
padding: `${y(a, 14)}px ${y(i, 4)}px`,
|
|
2320
2376
|
fontSize: 15,
|
|
2321
2377
|
fontWeight: 600,
|
|
2322
2378
|
fontFamily: "inherit",
|
|
2323
|
-
color: "inherit",
|
|
2379
|
+
color: c ? v(f, v(s, "inherit")) : v(s, "inherit"),
|
|
2324
2380
|
textAlign: "left",
|
|
2325
|
-
cursor: "pointer"
|
|
2381
|
+
cursor: "pointer",
|
|
2382
|
+
transition: "background 180ms, color 180ms"
|
|
2326
2383
|
},
|
|
2327
|
-
children: [
|
|
2384
|
+
children: [/* @__PURE__ */ d("span", {
|
|
2385
|
+
style: {
|
|
2386
|
+
display: "flex",
|
|
2387
|
+
alignItems: "center",
|
|
2388
|
+
gap: 10,
|
|
2389
|
+
minWidth: 0
|
|
2390
|
+
},
|
|
2391
|
+
children: [b ? /* @__PURE__ */ u("svg", {
|
|
2392
|
+
viewBox: "0 0 24 24",
|
|
2393
|
+
width: 16,
|
|
2394
|
+
height: 16,
|
|
2395
|
+
fill: "none",
|
|
2396
|
+
stroke: "currentColor",
|
|
2397
|
+
strokeWidth: 2,
|
|
2398
|
+
strokeLinecap: "round",
|
|
2399
|
+
strokeLinejoin: "round",
|
|
2400
|
+
"aria-hidden": "true",
|
|
2401
|
+
style: { flexShrink: 0 },
|
|
2402
|
+
children: /* @__PURE__ */ u("path", { d: b })
|
|
2403
|
+
}) : null, n.title || `Item ${r + 1}`]
|
|
2404
|
+
}), /* @__PURE__ */ u("span", {
|
|
2328
2405
|
"aria-hidden": !0,
|
|
2329
2406
|
style: {
|
|
2330
2407
|
fontSize: 12,
|
|
2331
2408
|
opacity: .6,
|
|
2332
|
-
transform:
|
|
2409
|
+
transform: c ? "rotate(180deg)" : "none",
|
|
2333
2410
|
transition: "transform 180ms"
|
|
2334
2411
|
},
|
|
2335
2412
|
children: "▼"
|
|
2336
2413
|
})]
|
|
2337
2414
|
}), /* @__PURE__ */ u("div", {
|
|
2338
2415
|
style: {
|
|
2339
|
-
display:
|
|
2416
|
+
display: c ? "flex" : "none",
|
|
2340
2417
|
flexDirection: "column"
|
|
2341
2418
|
},
|
|
2342
2419
|
children: t?.[n.key] ?? null
|
|
@@ -2532,7 +2609,7 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2532
2609
|
});
|
|
2533
2610
|
}
|
|
2534
2611
|
function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
2535
|
-
let { tenant: y, apiUrl: b } = r(
|
|
2612
|
+
let { tenant: y, apiUrl: b } = r(q), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
|
|
2536
2613
|
i(() => {
|
|
2537
2614
|
if (!f || !s) return;
|
|
2538
2615
|
let e = !0;
|
|
@@ -2649,7 +2726,7 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2649
2726
|
disabled: h || void 0,
|
|
2650
2727
|
onClick: () => O(F - 1),
|
|
2651
2728
|
style: {
|
|
2652
|
-
...
|
|
2729
|
+
...ke,
|
|
2653
2730
|
background: "transparent",
|
|
2654
2731
|
color: "inherit",
|
|
2655
2732
|
border: 0,
|
|
@@ -2662,7 +2739,7 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2662
2739
|
disabled: h || L.length > 0,
|
|
2663
2740
|
onClick: () => O(F + 1),
|
|
2664
2741
|
style: {
|
|
2665
|
-
...
|
|
2742
|
+
...ke,
|
|
2666
2743
|
border: 0,
|
|
2667
2744
|
padding: "10px 22px",
|
|
2668
2745
|
borderRadius: 8,
|
|
@@ -2676,7 +2753,7 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2676
2753
|
type: "submit",
|
|
2677
2754
|
disabled: h || void 0,
|
|
2678
2755
|
style: {
|
|
2679
|
-
...
|
|
2756
|
+
...ke,
|
|
2680
2757
|
border: 0,
|
|
2681
2758
|
padding: "10px 22px",
|
|
2682
2759
|
borderRadius: 8,
|
|
@@ -2723,7 +2800,7 @@ var Ut = null, Wt = null, Gt = (e) => {
|
|
|
2723
2800
|
}), Ut;
|
|
2724
2801
|
};
|
|
2725
2802
|
function Kt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
|
|
2726
|
-
let p = r(
|
|
2803
|
+
let p = r(q), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
|
|
2727
2804
|
if (_.current = f, i(() => {
|
|
2728
2805
|
if (l || !h || !g.current) return;
|
|
2729
2806
|
let e = !0, r = (t) => {
|
|
@@ -2818,7 +2895,7 @@ function qt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
|
2818
2895
|
...jt,
|
|
2819
2896
|
...A(n)
|
|
2820
2897
|
},
|
|
2821
|
-
children:
|
|
2898
|
+
children: Be(t, e, i)
|
|
2822
2899
|
});
|
|
2823
2900
|
}
|
|
2824
2901
|
function Jt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
@@ -2931,7 +3008,7 @@ function $t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2931
3008
|
ref: n,
|
|
2932
3009
|
type: r ? "button" : "submit",
|
|
2933
3010
|
style: {
|
|
2934
|
-
...
|
|
3011
|
+
...ke,
|
|
2935
3012
|
border: 0,
|
|
2936
3013
|
cursor: "pointer",
|
|
2937
3014
|
alignSelf: "flex-start",
|
|
@@ -2964,7 +3041,7 @@ function en({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2964
3041
|
});
|
|
2965
3042
|
}
|
|
2966
3043
|
function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
|
|
2967
|
-
let { tenant: v, apiUrl: y, locale: b } = r(
|
|
3044
|
+
let { tenant: v, apiUrl: y, locale: b } = r(q), x = r(J), S = r(xe), [, C] = c(0);
|
|
2968
3045
|
i(() => {
|
|
2969
3046
|
if (typeof window > "u") return;
|
|
2970
3047
|
let e = () => C((e) => e + 1);
|
|
@@ -2972,7 +3049,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2972
3049
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
2973
3050
|
};
|
|
2974
3051
|
}, []);
|
|
2975
|
-
let w =
|
|
3052
|
+
let w = we(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? Se(S) : 1, [k, j] = c(null);
|
|
2976
3053
|
if (i(() => {
|
|
2977
3054
|
if (!e || D) return;
|
|
2978
3055
|
let n = !0, r = new URLSearchParams();
|
|
@@ -3017,7 +3094,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3017
3094
|
},
|
|
3018
3095
|
children: N.map((e) => /* @__PURE__ */ u("div", {
|
|
3019
3096
|
style: { minWidth: 0 },
|
|
3020
|
-
children: x.render(p, (t) =>
|
|
3097
|
+
children: x.render(p, (t) => Ee(t, e))
|
|
3021
3098
|
}, e.id ?? e?.data?.slug))
|
|
3022
3099
|
}) : /* @__PURE__ */ u("div", {
|
|
3023
3100
|
ref: _,
|
|
@@ -3027,7 +3104,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3027
3104
|
...A(g)
|
|
3028
3105
|
},
|
|
3029
3106
|
children: N.map((e) => {
|
|
3030
|
-
let t = o ? Te(e?.data, o) : null, r = s ?
|
|
3107
|
+
let t = o ? Te(e?.data, o) : null, r = s ? Z(Te(e?.data, s)) : null, i = l ? Te(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : Z(i), f = n === "list";
|
|
3031
3108
|
return /* @__PURE__ */ d("div", {
|
|
3032
3109
|
style: {
|
|
3033
3110
|
display: "flex",
|
|
@@ -3083,7 +3160,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3083
3160
|
});
|
|
3084
3161
|
}
|
|
3085
3162
|
function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3086
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3163
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Ce(), s = {
|
|
3087
3164
|
height: 34,
|
|
3088
3165
|
padding: "0 12px",
|
|
3089
3166
|
borderRadius: 8,
|
|
@@ -3236,7 +3313,7 @@ function rn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3236
3313
|
}) : null;
|
|
3237
3314
|
}
|
|
3238
3315
|
function an({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: h }) {
|
|
3239
|
-
let { tenant: g, apiUrl: _ } = r(
|
|
3316
|
+
let { tenant: g, apiUrl: _ } = r(q), v = r(xe), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3240
3317
|
i(() => {
|
|
3241
3318
|
if (!o || Number.isFinite(x)) return;
|
|
3242
3319
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3255,7 +3332,7 @@ function an({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3255
3332
|
]);
|
|
3256
3333
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
3257
3334
|
if (o && C === null || o && f && !(C > 0)) return null;
|
|
3258
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3335
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? Se(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
3259
3336
|
if (o) {
|
|
3260
3337
|
if (typeof window < "u") {
|
|
3261
3338
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -3845,7 +3922,7 @@ var xn = (e, t) => {
|
|
|
3845
3922
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3846
3923
|
}, Cn = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
3847
3924
|
function wn(e, t = {}) {
|
|
3848
|
-
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 ? "" :
|
|
3925
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : Z(e);
|
|
3849
3926
|
return n.map((e) => {
|
|
3850
3927
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3851
3928
|
return {
|
|
@@ -3985,7 +4062,7 @@ function En({ node: e, onClose: t }) {
|
|
|
3985
4062
|
});
|
|
3986
4063
|
}
|
|
3987
4064
|
function Dn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
|
|
3988
|
-
let b = a(), [x, S] = c(null), { tenant: C, apiUrl: w } = r(
|
|
4065
|
+
let b = a(), [x, S] = c(null), { tenant: C, apiUrl: w } = r(q), T = r(xe)?.[t], [E, D] = c(null);
|
|
3989
4066
|
i(() => {
|
|
3990
4067
|
if (!t || T) return;
|
|
3991
4068
|
let e = !0;
|
|
@@ -4203,85 +4280,102 @@ function On({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4203
4280
|
children: e ?? ""
|
|
4204
4281
|
});
|
|
4205
4282
|
}
|
|
4206
|
-
var kn = 360, An = "\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", jn = (e, t) => e && t ? `cell-${e}-${t}` : ""
|
|
4207
|
-
|
|
4208
|
-
let
|
|
4283
|
+
var kn = 360, An = "\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", jn = (e, t) => e && t ? `cell-${e}-${t}` : "", Mn = (e) => {
|
|
4284
|
+
if (!e || typeof e != "object") return e ?? "";
|
|
4285
|
+
let t = String(e.text ?? "");
|
|
4286
|
+
return typeof e.href == "string" && e.href ? /* @__PURE__ */ u("a", {
|
|
4287
|
+
href: e.href,
|
|
4288
|
+
target: "_blank",
|
|
4289
|
+
rel: "noopener noreferrer",
|
|
4290
|
+
style: { color: "var(--page-accent, #4f46e5)" },
|
|
4291
|
+
children: t
|
|
4292
|
+
}) : t;
|
|
4293
|
+
};
|
|
4294
|
+
function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], colKeys: o = [], heights: f = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: j, style: M, nodeRef: N, edit: P }) {
|
|
4295
|
+
let F = s(null), I = s(null), [L, R] = c(null), [z, B] = c(null), V = (e, t) => () => R({
|
|
4209
4296
|
r: e,
|
|
4210
4297
|
c: t
|
|
4211
4298
|
});
|
|
4212
4299
|
i(() => {
|
|
4213
|
-
if (!
|
|
4214
|
-
let e =
|
|
4300
|
+
if (!P) return;
|
|
4301
|
+
let e = I.current, t = L && e?.querySelector(`[data-cell="${L.r}-${L.c}"]`);
|
|
4215
4302
|
if (!t) {
|
|
4216
|
-
|
|
4303
|
+
z && B(null);
|
|
4217
4304
|
return;
|
|
4218
4305
|
}
|
|
4219
4306
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4220
4307
|
top: r.bottom - n.top + 4,
|
|
4221
4308
|
left: Math.max(0, Math.min(r.left - n.left, n.width - kn))
|
|
4222
4309
|
};
|
|
4223
|
-
(
|
|
4310
|
+
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4224
4311
|
}), i(() => {
|
|
4225
|
-
if (!
|
|
4312
|
+
if (!P || !L) return;
|
|
4226
4313
|
let e = (e) => {
|
|
4227
|
-
|
|
4314
|
+
I.current?.contains(e.target) || R(null);
|
|
4228
4315
|
};
|
|
4229
4316
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4230
|
-
}, [
|
|
4231
|
-
let { tenant:
|
|
4317
|
+
}, [P, L]);
|
|
4318
|
+
let { tenant: H, apiUrl: U } = r(q), ee = r(xe), W = ee?.[h], te = C ? Se(ee) : 1, [ne, re] = c(null);
|
|
4232
4319
|
if (i(() => {
|
|
4233
|
-
if (!h ||
|
|
4234
|
-
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(
|
|
4235
|
-
return fetch(r, { headers:
|
|
4320
|
+
if (!h || W) return;
|
|
4321
|
+
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(te - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4322
|
+
return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
|
|
4236
4323
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4237
|
-
return e &&
|
|
4238
|
-
}).catch(() => e &&
|
|
4324
|
+
return e && re(n);
|
|
4325
|
+
}).catch(() => e && re([])), () => {
|
|
4239
4326
|
e = !1;
|
|
4240
4327
|
};
|
|
4241
4328
|
}, [
|
|
4242
4329
|
h,
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4330
|
+
H,
|
|
4331
|
+
U,
|
|
4332
|
+
W,
|
|
4246
4333
|
C,
|
|
4247
|
-
|
|
4334
|
+
te,
|
|
4248
4335
|
g
|
|
4249
4336
|
]), !e.length) return null;
|
|
4250
|
-
let
|
|
4337
|
+
let ie = Math.max(1, Number(g) || 10), ae = h ? C ? W || h.startsWith("api:") ? (W ?? ne ?? []).slice((te - 1) * ie, te * ie) : (ne ?? []).slice(0, ie) : (W ?? ne ?? []).slice(0, ie) : null, G = ae ? ae.map((t) => e.map((e) => Z(Te(t?.data, e.field)))) : t, oe = !!h && !(h && !W && ne === null) && G.length === 0, se = b ? {
|
|
4251
4338
|
y: 6,
|
|
4252
4339
|
x: 10
|
|
4253
4340
|
} : {
|
|
4254
4341
|
y: 10,
|
|
4255
4342
|
x: 14
|
|
4256
|
-
},
|
|
4257
|
-
|
|
4343
|
+
}, ce = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : se.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : se.x}px`, le = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, ue = y ? { border: le } : { borderBottom: le }, K = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), de = [
|
|
4344
|
+
"left",
|
|
4345
|
+
"center",
|
|
4346
|
+
"right"
|
|
4347
|
+
], fe = (t) => de.includes(e[t]?.align) ? e[t].align : "", pe = (e) => fe(e) || (de.includes(O) ? O : "left"), me = Number.isFinite(Number(j)) && Number(j) > 0 ? Number(j) : 0, he = A(M), ge = !me && he && he.maxHeight !== void 0 ? he.maxHeight : 0, _e = me || ge, ve = ge ? {
|
|
4348
|
+
...he,
|
|
4349
|
+
maxHeight: void 0
|
|
4350
|
+
} : he, ye = !!P && P.rows !== !1, be = (t) => (r) => {
|
|
4351
|
+
if (!P?.resize || t >= e.length - 1) return;
|
|
4258
4352
|
r.preventDefault(), r.stopPropagation();
|
|
4259
|
-
let i =
|
|
4353
|
+
let i = F.current, a = i ? i.clientWidth : 0;
|
|
4260
4354
|
if (!a) return;
|
|
4261
|
-
let o =
|
|
4355
|
+
let o = K ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4262
4356
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4263
|
-
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10,
|
|
4357
|
+
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, P.resize(i);
|
|
4264
4358
|
}, u = () => {
|
|
4265
4359
|
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
|
|
4266
4360
|
};
|
|
4267
4361
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4268
|
-
},
|
|
4269
|
-
p &&
|
|
4362
|
+
}, Ce = /* @__PURE__ */ new Set();
|
|
4363
|
+
p && G.forEach((t, n) => e.forEach((e, t) => {
|
|
4270
4364
|
let r = p[jn(a[n], o[t])];
|
|
4271
4365
|
if (!r) return;
|
|
4272
4366
|
let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
|
|
4273
|
-
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) &&
|
|
4367
|
+
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && Ce.add(`${n + e},${t + r}`);
|
|
4274
4368
|
}));
|
|
4275
|
-
let
|
|
4276
|
-
if (!
|
|
4369
|
+
let we = (e) => (t) => {
|
|
4370
|
+
if (!P?.resizeRow) return;
|
|
4277
4371
|
t.preventDefault(), t.stopPropagation();
|
|
4278
4372
|
let n = t.currentTarget.closest("tr");
|
|
4279
4373
|
if (!n) return;
|
|
4280
|
-
let r = t.clientY, i = n.offsetHeight, a = (t) =>
|
|
4374
|
+
let r = t.clientY, i = n.offsetHeight, a = (t) => P.resizeRow(e, Math.max(20, Math.round(i + (t.clientY - r)))), o = () => {
|
|
4281
4375
|
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4282
4376
|
};
|
|
4283
4377
|
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4284
|
-
},
|
|
4378
|
+
}, J = (e, t, n, r) => r ? null : /* @__PURE__ */ u("span", {
|
|
4285
4379
|
className: "wb-tedit-btn",
|
|
4286
4380
|
role: "button",
|
|
4287
4381
|
"data-hint": t,
|
|
@@ -4290,118 +4384,129 @@ function Mn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4290
4384
|
},
|
|
4291
4385
|
onClick: n,
|
|
4292
4386
|
children: e
|
|
4293
|
-
}, t),
|
|
4387
|
+
}, t), Y = L && L.r < G.length && L.c < e.length ? L : null, X = (e, t) => P?.labels?.[e] ?? t, Ee = Y ? p?.[jn(a[Y.r], o[Y.c])] : null, De = Math.max(1, Number(Ee?.c) || 1), Oe = Math.max(1, Number(Ee?.r) || 1);
|
|
4294
4388
|
return /* @__PURE__ */ d("div", {
|
|
4295
4389
|
ref: (e) => {
|
|
4296
|
-
|
|
4390
|
+
I.current = e, typeof N == "function" && N(e);
|
|
4297
4391
|
},
|
|
4298
4392
|
style: {
|
|
4299
4393
|
width: "100%",
|
|
4300
|
-
...
|
|
4301
|
-
...
|
|
4394
|
+
...P ? { position: "relative" } : null,
|
|
4395
|
+
...ve
|
|
4302
4396
|
},
|
|
4303
4397
|
children: [
|
|
4304
|
-
|
|
4305
|
-
|
|
4398
|
+
P && /* @__PURE__ */ u("style", { children: An }),
|
|
4399
|
+
P && Y && z && /* @__PURE__ */ d("div", {
|
|
4306
4400
|
className: "wb-tedit-bar",
|
|
4307
4401
|
style: {
|
|
4308
|
-
top:
|
|
4309
|
-
left:
|
|
4402
|
+
top: z.top,
|
|
4403
|
+
left: z.left
|
|
4310
4404
|
},
|
|
4311
4405
|
onMouseDown: (e) => e.stopPropagation(),
|
|
4312
4406
|
children: [
|
|
4313
4407
|
/* @__PURE__ */ u("span", {
|
|
4314
4408
|
className: "wb-tedit-at",
|
|
4315
|
-
children: `R${
|
|
4409
|
+
children: `R${Y.r + 1}·C${Y.c + 1}`
|
|
4316
4410
|
}),
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4411
|
+
J("+↑", X("rowAbove", "Insert row above"), () => P.addRow(Y.r - 1)),
|
|
4412
|
+
J("+↓", X("rowBelow", "Insert row below"), () => P.addRow(Y.r)),
|
|
4413
|
+
J("↑", X("rowUp", "Move row up"), () => P.moveRow(Y.r, -1), Y.r === 0),
|
|
4414
|
+
J("↓", X("rowDown", "Move row down"), () => P.moveRow(Y.r, 1), Y.r >= G.length - 1),
|
|
4415
|
+
J("✕ row", X("rowDelete", "Delete row"), () => P.dropRow(Y.r), G.length <= 1),
|
|
4322
4416
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4417
|
+
J("+←", X("colLeft", "Insert column left"), () => P.addColumn(Y.c - 1)),
|
|
4418
|
+
J("+→", X("colRight", "Insert column right"), () => P.addColumn(Y.c)),
|
|
4419
|
+
J("←", X("colMoveLeft", "Move column left"), () => P.moveColumn(Y.c, -1), Y.c === 0),
|
|
4420
|
+
J("→", X("colMoveRight", "Move column right"), () => P.moveColumn(Y.c, 1), Y.c >= e.length - 1),
|
|
4421
|
+
J("✕ col", X("colDelete", "Delete column"), () => P.dropColumn(Y.c), e.length <= 1),
|
|
4328
4422
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4423
|
+
J("↔", X("mergeRight", "Merge with the cell on the right"), () => P.merge(Y.r, Y.c, "right"), Y.c + De >= e.length),
|
|
4424
|
+
J("↕", X("mergeDown", "Merge with the cell below"), () => P.merge(Y.r, Y.c, "down"), Y.r + Oe >= G.length),
|
|
4425
|
+
J("⤫", X("split", "Split this cell"), () => P.split(Y.r, Y.c), De === 1 && Oe === 1)
|
|
4332
4426
|
]
|
|
4333
4427
|
}),
|
|
4334
4428
|
/* @__PURE__ */ u("div", {
|
|
4335
4429
|
style: {
|
|
4336
4430
|
width: "100%",
|
|
4337
|
-
overflowX: "auto"
|
|
4431
|
+
overflowX: "auto",
|
|
4432
|
+
..._e ? {
|
|
4433
|
+
maxHeight: _e,
|
|
4434
|
+
overflowY: "auto"
|
|
4435
|
+
} : null
|
|
4338
4436
|
},
|
|
4339
4437
|
children: /* @__PURE__ */ d("table", {
|
|
4340
|
-
ref:
|
|
4438
|
+
ref: F,
|
|
4341
4439
|
style: {
|
|
4342
4440
|
width: "100%",
|
|
4343
|
-
borderCollapse: "collapse",
|
|
4441
|
+
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
4442
|
+
borderSpacing: 0,
|
|
4344
4443
|
fontSize: 14,
|
|
4345
|
-
...
|
|
4346
|
-
...y ? { border:
|
|
4444
|
+
...K ? { tableLayout: "fixed" } : null,
|
|
4445
|
+
...y ? { border: le } : {}
|
|
4347
4446
|
},
|
|
4348
4447
|
children: [
|
|
4349
|
-
|
|
4448
|
+
K && /* @__PURE__ */ u("colgroup", { children: n.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
|
|
4350
4449
|
_ === !1 ? null : /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((t, n) => /* @__PURE__ */ u("th", {
|
|
4351
|
-
className:
|
|
4450
|
+
className: P ? "wb-tedit-head" : void 0,
|
|
4352
4451
|
style: {
|
|
4353
|
-
textAlign:
|
|
4452
|
+
textAlign: pe(n),
|
|
4354
4453
|
fontWeight: 600,
|
|
4355
|
-
padding:
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
...
|
|
4454
|
+
padding: ce,
|
|
4455
|
+
...typeof D == "string" && D ? { color: D } : null,
|
|
4456
|
+
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4457
|
+
...T ? {
|
|
4458
|
+
position: "sticky",
|
|
4459
|
+
top: 0,
|
|
4460
|
+
zIndex: 2
|
|
4461
|
+
} : P ? { position: "relative" } : null,
|
|
4462
|
+
...ue
|
|
4359
4463
|
},
|
|
4360
|
-
children:
|
|
4464
|
+
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(On, {
|
|
4361
4465
|
value: t.label ?? t,
|
|
4362
|
-
onCommit: (e) =>
|
|
4363
|
-
hint:
|
|
4466
|
+
onCommit: (e) => P.header(n, e),
|
|
4467
|
+
hint: X("editCell", "Double-click to edit"),
|
|
4364
4468
|
style: { paddingRight: 6 }
|
|
4365
4469
|
}), n < e.length - 1 && /* @__PURE__ */ u("span", {
|
|
4366
4470
|
className: "wb-tedit-grip",
|
|
4367
|
-
title:
|
|
4368
|
-
onPointerDown:
|
|
4471
|
+
title: X("colWidth", "Drag to resize the column"),
|
|
4472
|
+
onPointerDown: be(n)
|
|
4369
4473
|
})] }) : t.label ?? t
|
|
4370
4474
|
}, n)) }) }),
|
|
4371
|
-
/* @__PURE__ */ d("tbody", { children: [
|
|
4475
|
+
/* @__PURE__ */ d("tbody", { children: [oe && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
4372
4476
|
colSpan: e.length,
|
|
4373
4477
|
style: {
|
|
4374
|
-
padding:
|
|
4478
|
+
padding: ce,
|
|
4375
4479
|
textAlign: "center",
|
|
4376
4480
|
opacity: .6,
|
|
4377
|
-
...
|
|
4481
|
+
...ue
|
|
4378
4482
|
},
|
|
4379
4483
|
children: w || "No data yet"
|
|
4380
|
-
}) }),
|
|
4381
|
-
className:
|
|
4484
|
+
}) }), G.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
4485
|
+
className: P ? "wb-tedit-row" : void 0,
|
|
4382
4486
|
style: {
|
|
4383
4487
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
4384
4488
|
...Number.isFinite(Number(f?.[n])) && f[n] > 0 ? { height: f[n] } : null
|
|
4385
4489
|
},
|
|
4386
4490
|
children: e.map((e, r) => {
|
|
4387
|
-
if (
|
|
4491
|
+
if (Ce.has(`${n},${r}`)) return null;
|
|
4388
4492
|
let i = jn(a[n], o[r]), s = m?.[i], c = p?.[i], l = Math.max(1, Number(c?.c) || 1), f = Math.max(1, Number(c?.r) || 1);
|
|
4389
4493
|
return /* @__PURE__ */ d("td", {
|
|
4390
|
-
className:
|
|
4391
|
-
onMouseDownCapture:
|
|
4392
|
-
"data-cell":
|
|
4494
|
+
className: P ? `wb-tedit-cell${L?.r === n && L?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4495
|
+
onMouseDownCapture: ye ? V(n, r) : void 0,
|
|
4496
|
+
"data-cell": P ? `${n}-${r}` : void 0,
|
|
4393
4497
|
colSpan: l > 1 ? l : void 0,
|
|
4394
4498
|
rowSpan: f > 1 ? f : void 0,
|
|
4395
4499
|
style: {
|
|
4396
|
-
padding:
|
|
4397
|
-
...
|
|
4398
|
-
...
|
|
4500
|
+
padding: ce,
|
|
4501
|
+
...fe(r) ? { textAlign: fe(r) } : null,
|
|
4502
|
+
...P ? { position: "relative" } : null,
|
|
4503
|
+
...ue
|
|
4399
4504
|
},
|
|
4400
|
-
children: [s ?? t?.[r]
|
|
4505
|
+
children: [s ?? Mn(t?.[r]), P && ye && /* @__PURE__ */ u("span", {
|
|
4401
4506
|
className: "wb-tedit-rowgrip",
|
|
4402
|
-
title:
|
|
4403
|
-
onPointerDown:
|
|
4404
|
-
onDoubleClick: () =>
|
|
4507
|
+
title: X("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4508
|
+
onPointerDown: we(n),
|
|
4509
|
+
onDoubleClick: () => P.resizeRow(n, 0)
|
|
4405
4510
|
})]
|
|
4406
4511
|
}, r);
|
|
4407
4512
|
})
|
|
@@ -4412,7 +4517,7 @@ function Mn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4412
4517
|
]
|
|
4413
4518
|
});
|
|
4414
4519
|
}
|
|
4415
|
-
var
|
|
4520
|
+
var Pn = {
|
|
4416
4521
|
small: {
|
|
4417
4522
|
cell: 62,
|
|
4418
4523
|
font: 10.5,
|
|
@@ -4437,9 +4542,9 @@ var Nn = {
|
|
|
4437
4542
|
pad: 8,
|
|
4438
4543
|
gap: 4
|
|
4439
4544
|
}
|
|
4440
|
-
},
|
|
4441
|
-
function
|
|
4442
|
-
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 ? "" :
|
|
4545
|
+
}, Fn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, In = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Ln = 366;
|
|
4546
|
+
function Rn(e, t = {}) {
|
|
4547
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : Z(e), a = (e) => {
|
|
4443
4548
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4444
4549
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4445
4550
|
};
|
|
@@ -4455,7 +4560,7 @@ function Ln(e, t = {}) {
|
|
|
4455
4560
|
} : null;
|
|
4456
4561
|
}).filter(Boolean);
|
|
4457
4562
|
}
|
|
4458
|
-
function
|
|
4563
|
+
function zn(e) {
|
|
4459
4564
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4460
4565
|
let n = e?.start ? new Date(e.start) : null;
|
|
4461
4566
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4470,20 +4575,20 @@ function Rn(e) {
|
|
|
4470
4575
|
};
|
|
4471
4576
|
}).filter(Boolean);
|
|
4472
4577
|
}
|
|
4473
|
-
function
|
|
4578
|
+
function Bn(e) {
|
|
4474
4579
|
let t = /* @__PURE__ */ new Map();
|
|
4475
4580
|
for (let n of e) {
|
|
4476
|
-
let e =
|
|
4581
|
+
let e = In(n.start), r = n.end ? In(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Ln);
|
|
4477
4582
|
for (let r = 0; r <= i; r += 1) {
|
|
4478
|
-
let i =
|
|
4583
|
+
let i = Fn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4479
4584
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4480
4585
|
}
|
|
4481
4586
|
}
|
|
4482
4587
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4483
4588
|
return t;
|
|
4484
4589
|
}
|
|
4485
|
-
function
|
|
4486
|
-
let { tenant: T, apiUrl: E, locale: D } = r(
|
|
4590
|
+
function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a = "", endField: o = "", hrefField: s = "", colorField: f = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
|
|
4591
|
+
let { tenant: T, apiUrl: E, locale: D } = r(q), O = r(xe)?.[t], [k, j] = c(null), [M, N] = c(() => {
|
|
4487
4592
|
let e = /* @__PURE__ */ new Date();
|
|
4488
4593
|
return {
|
|
4489
4594
|
year: e.getFullYear(),
|
|
@@ -4505,13 +4610,13 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4505
4610
|
E,
|
|
4506
4611
|
O
|
|
4507
4612
|
]);
|
|
4508
|
-
let P =
|
|
4613
|
+
let P = Pn[m] ?? Pn.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 ? Rn(O ?? k ?? [], {
|
|
4509
4614
|
titleField: n,
|
|
4510
4615
|
startField: a,
|
|
4511
4616
|
endField: o,
|
|
4512
4617
|
hrefField: s,
|
|
4513
4618
|
colorField: f
|
|
4514
|
-
}) :
|
|
4619
|
+
}) : zn(e), B = Bn(z), V = D || void 0, H = (e, t) => {
|
|
4515
4620
|
let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
|
|
4516
4621
|
width: 6,
|
|
4517
4622
|
height: 6,
|
|
@@ -4549,19 +4654,19 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4549
4654
|
title: e.title,
|
|
4550
4655
|
children: n
|
|
4551
4656
|
}, e.key);
|
|
4552
|
-
},
|
|
4657
|
+
}, U = new Intl.DateTimeFormat(V, {
|
|
4553
4658
|
month: "long",
|
|
4554
4659
|
year: "numeric"
|
|
4555
|
-
}).format(new Date(M.year, M.month, 1)),
|
|
4660
|
+
}).format(new Date(M.year, M.month, 1)), ee = (e) => N((t) => {
|
|
4556
4661
|
let n = new Date(t.year, t.month + e, 1);
|
|
4557
4662
|
return {
|
|
4558
4663
|
year: n.getFullYear(),
|
|
4559
4664
|
month: n.getMonth()
|
|
4560
4665
|
};
|
|
4561
|
-
}),
|
|
4666
|
+
}), W = (e, t) => /* @__PURE__ */ u("button", {
|
|
4562
4667
|
type: "button",
|
|
4563
4668
|
"aria-label": e,
|
|
4564
|
-
onClick: () =>
|
|
4669
|
+
onClick: () => ee(t),
|
|
4565
4670
|
style: {
|
|
4566
4671
|
background: "transparent",
|
|
4567
4672
|
border: `1px solid ${I}`,
|
|
@@ -4573,7 +4678,7 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4573
4678
|
padding: "4px 8px"
|
|
4574
4679
|
},
|
|
4575
4680
|
children: t < 0 ? "‹" : "›"
|
|
4576
|
-
}),
|
|
4681
|
+
}), te = /* @__PURE__ */ d("div", {
|
|
4577
4682
|
style: {
|
|
4578
4683
|
display: "flex",
|
|
4579
4684
|
alignItems: "center",
|
|
@@ -4588,10 +4693,10 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4588
4693
|
flexGrow: 1,
|
|
4589
4694
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
4590
4695
|
},
|
|
4591
|
-
children:
|
|
4696
|
+
children: U
|
|
4592
4697
|
}),
|
|
4593
|
-
|
|
4594
|
-
|
|
4698
|
+
W("Previous month", -1),
|
|
4699
|
+
W("Next month", 1)
|
|
4595
4700
|
]
|
|
4596
4701
|
});
|
|
4597
4702
|
if (p === "list") {
|
|
@@ -4607,7 +4712,7 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4607
4712
|
width: "100%",
|
|
4608
4713
|
...A(S)
|
|
4609
4714
|
},
|
|
4610
|
-
children: [
|
|
4715
|
+
children: [te, e.length ? /* @__PURE__ */ u("div", {
|
|
4611
4716
|
style: {
|
|
4612
4717
|
display: "flex",
|
|
4613
4718
|
flexDirection: "column",
|
|
@@ -4628,7 +4733,7 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4628
4733
|
minWidth: 96
|
|
4629
4734
|
},
|
|
4630
4735
|
children: t.format(e.start)
|
|
4631
|
-
}),
|
|
4736
|
+
}), H(e, {
|
|
4632
4737
|
flexGrow: 1,
|
|
4633
4738
|
minWidth: 0
|
|
4634
4739
|
})]
|
|
@@ -4643,9 +4748,9 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4643
4748
|
})]
|
|
4644
4749
|
});
|
|
4645
4750
|
}
|
|
4646
|
-
let
|
|
4751
|
+
let ne = new Date(M.year, M.month, 1), re = y === "sunday" ? 0 : 1, ie = (ne.getDay() - re + 7) % 7, ae = new Date(M.year, M.month + 1, 0).getDate(), G = Math.ceil((ie + ae) / 7), oe = Fn(/* @__PURE__ */ new Date()), se = new Intl.DateTimeFormat(V, { weekday: "short" }), ce = [];
|
|
4647
4752
|
for (let e = 0; e < G * 7; e += 1) {
|
|
4648
|
-
let t = e -
|
|
4753
|
+
let t = e - ie + 1, n = t >= 1 && t <= ae, r = Fn(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === oe;
|
|
4649
4754
|
ce.push(/* @__PURE__ */ d("div", {
|
|
4650
4755
|
style: {
|
|
4651
4756
|
minHeight: P.cell,
|
|
@@ -4671,7 +4776,7 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4671
4776
|
},
|
|
4672
4777
|
children: n ? t : new Date(M.year, M.month, t).getDate()
|
|
4673
4778
|
}),
|
|
4674
|
-
a.map((e) =>
|
|
4779
|
+
a.map((e) => H(e)),
|
|
4675
4780
|
i.length > a.length && /* @__PURE__ */ u("span", {
|
|
4676
4781
|
style: {
|
|
4677
4782
|
fontSize: P.font,
|
|
@@ -4689,7 +4794,7 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4689
4794
|
...A(S)
|
|
4690
4795
|
},
|
|
4691
4796
|
children: [
|
|
4692
|
-
|
|
4797
|
+
te,
|
|
4693
4798
|
/* @__PURE__ */ d("div", {
|
|
4694
4799
|
style: {
|
|
4695
4800
|
display: "grid",
|
|
@@ -4703,20 +4808,20 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4703
4808
|
textAlign: "center",
|
|
4704
4809
|
padding: `0 0 ${P.pad}px`
|
|
4705
4810
|
},
|
|
4706
|
-
children: se.format(new Date(2024, 0, 7 +
|
|
4811
|
+
children: se.format(new Date(2024, 0, 7 + re + t))
|
|
4707
4812
|
}, `head-${t}`)), ce]
|
|
4708
4813
|
}),
|
|
4709
4814
|
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4710
4815
|
]
|
|
4711
4816
|
});
|
|
4712
4817
|
}
|
|
4713
|
-
var
|
|
4818
|
+
var Hn = {
|
|
4714
4819
|
small: 380,
|
|
4715
4820
|
medium: 560,
|
|
4716
4821
|
large: 820,
|
|
4717
4822
|
full: "100%"
|
|
4718
4823
|
};
|
|
4719
|
-
function
|
|
4824
|
+
function Un({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: a = 0, size: o = "medium", title: l = "", showClose: f = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
|
|
4720
4825
|
let [C, w] = c(!1), T = s(null);
|
|
4721
4826
|
i(() => {
|
|
4722
4827
|
if (S || !e) return;
|
|
@@ -4741,7 +4846,7 @@ function Hn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4741
4846
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
4742
4847
|
};
|
|
4743
4848
|
}, [S, C]);
|
|
4744
|
-
let E =
|
|
4849
|
+
let E = Hn[o] ?? Hn.medium, D = (e) => {
|
|
4745
4850
|
let t = {
|
|
4746
4851
|
padding: "9px 16px",
|
|
4747
4852
|
borderRadius: 6,
|
|
@@ -4910,13 +5015,13 @@ function Hn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4910
5015
|
})]
|
|
4911
5016
|
});
|
|
4912
5017
|
}
|
|
4913
|
-
var
|
|
4914
|
-
PageRoot:
|
|
4915
|
-
CalendarBlock:
|
|
4916
|
-
DialogBlock:
|
|
4917
|
-
Section:
|
|
4918
|
-
Container:
|
|
4919
|
-
Heading:
|
|
5018
|
+
var Wn = {
|
|
5019
|
+
PageRoot: Pe,
|
|
5020
|
+
CalendarBlock: Vn,
|
|
5021
|
+
DialogBlock: Un,
|
|
5022
|
+
Section: Fe,
|
|
5023
|
+
Container: Ie,
|
|
5024
|
+
Heading: Le,
|
|
4920
5025
|
TextBlock: Ye,
|
|
4921
5026
|
ButtonBlock: Qe,
|
|
4922
5027
|
ImageBlock: $e,
|
|
@@ -4935,7 +5040,7 @@ var Un = {
|
|
|
4935
5040
|
ThemeModeBlock: un,
|
|
4936
5041
|
ScrollTopBlock: mn,
|
|
4937
5042
|
OrgChartBlock: Dn,
|
|
4938
|
-
TableBlock:
|
|
5043
|
+
TableBlock: Nn,
|
|
4939
5044
|
IconBlock: xt,
|
|
4940
5045
|
MapBlock: yt,
|
|
4941
5046
|
MasonryBlock: Ct,
|
|
@@ -4967,27 +5072,27 @@ var Un = {
|
|
|
4967
5072
|
FormFile: Qt,
|
|
4968
5073
|
FormRecaptcha: Kt,
|
|
4969
5074
|
FormSubmit: $t
|
|
4970
|
-
},
|
|
5075
|
+
}, Gn = {
|
|
4971
5076
|
id: "auth",
|
|
4972
5077
|
label: "Accounts",
|
|
4973
5078
|
category: "Apps",
|
|
4974
5079
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
4975
5080
|
ssr: "shell",
|
|
4976
5081
|
settings: ["site.authRedirect"]
|
|
4977
|
-
},
|
|
5082
|
+
}, Kn = t({
|
|
4978
5083
|
user: null,
|
|
4979
5084
|
status: "idle",
|
|
4980
5085
|
ensure: () => {},
|
|
4981
5086
|
refresh: () => {},
|
|
4982
5087
|
signOut: () => {}
|
|
4983
|
-
}),
|
|
4984
|
-
let e = r(
|
|
5088
|
+
}), qn = () => {
|
|
5089
|
+
let e = r(Kn);
|
|
4985
5090
|
return i(() => {
|
|
4986
5091
|
e.ensure();
|
|
4987
5092
|
}, [e]), e;
|
|
4988
5093
|
};
|
|
4989
|
-
function
|
|
4990
|
-
let f = r(
|
|
5094
|
+
function Jn({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
|
|
5095
|
+
let f = r(q), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", [h, g] = c(t ?? null), [_, v] = c(t ? "user" : a ? "guest" : "idle"), y = s(!1), b = n((e, t) => fetch(`${p}${e}`, {
|
|
4991
5096
|
...t,
|
|
4992
5097
|
credentials: "include",
|
|
4993
5098
|
headers: {
|
|
@@ -5037,19 +5142,19 @@ function qn({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5037
5142
|
t,
|
|
5038
5143
|
x,
|
|
5039
5144
|
S
|
|
5040
|
-
]), /* @__PURE__ */ u(
|
|
5145
|
+
]), /* @__PURE__ */ u(Kn.Provider, {
|
|
5041
5146
|
value: w,
|
|
5042
5147
|
children: e
|
|
5043
5148
|
});
|
|
5044
5149
|
}
|
|
5045
|
-
function
|
|
5046
|
-
let { status: n } =
|
|
5150
|
+
function Yn({ when: e, children: t }) {
|
|
5151
|
+
let { status: n } = qn();
|
|
5047
5152
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5048
5153
|
}
|
|
5049
5154
|
//#endregion
|
|
5050
5155
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5051
|
-
function
|
|
5052
|
-
let { tenant: h, apiUrl: g, settings: _ } = r(
|
|
5156
|
+
function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
|
|
5157
|
+
let { tenant: h, apiUrl: g, settings: _ } = r(q), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
5053
5158
|
if (e.preventDefault(), f) return;
|
|
5054
5159
|
let n = new FormData(e.currentTarget);
|
|
5055
5160
|
C(!0), x("");
|
|
@@ -5140,7 +5245,7 @@ function Yn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5140
5245
|
type: f ? "button" : "submit",
|
|
5141
5246
|
disabled: S || void 0,
|
|
5142
5247
|
style: {
|
|
5143
|
-
...
|
|
5248
|
+
...ke,
|
|
5144
5249
|
border: 0,
|
|
5145
5250
|
padding: "10px 22px",
|
|
5146
5251
|
borderRadius: 8,
|
|
@@ -5172,8 +5277,8 @@ function Yn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5172
5277
|
]
|
|
5173
5278
|
});
|
|
5174
5279
|
}
|
|
5175
|
-
function
|
|
5176
|
-
let { user: c, status: l, signOut: f } =
|
|
5280
|
+
function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
5281
|
+
let { user: c, status: l, signOut: f } = qn(), p = a ? s || "user" : l, m = a ? {
|
|
5177
5282
|
name: "Ada Lovelace",
|
|
5178
5283
|
email: "ada@example.com"
|
|
5179
5284
|
} : c;
|
|
@@ -5214,7 +5319,7 @@ function Xn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5214
5319
|
type: "button",
|
|
5215
5320
|
onClick: a ? void 0 : f,
|
|
5216
5321
|
style: {
|
|
5217
|
-
...
|
|
5322
|
+
...ke,
|
|
5218
5323
|
border: 0,
|
|
5219
5324
|
padding: "8px 16px",
|
|
5220
5325
|
borderRadius: 8,
|
|
@@ -5238,40 +5343,40 @@ function Xn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5238
5343
|
}
|
|
5239
5344
|
//#endregion
|
|
5240
5345
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5241
|
-
var
|
|
5346
|
+
var Qn = {
|
|
5242
5347
|
id: "consent",
|
|
5243
5348
|
label: "Cookie consent",
|
|
5244
5349
|
category: "Apps",
|
|
5245
5350
|
keys: ["CookieConsent"],
|
|
5246
5351
|
ssr: "shell",
|
|
5247
5352
|
settings: []
|
|
5248
|
-
},
|
|
5249
|
-
function
|
|
5353
|
+
}, $n = "webim.cookie_consent";
|
|
5354
|
+
function er() {
|
|
5250
5355
|
try {
|
|
5251
|
-
let e = window.localStorage.getItem(
|
|
5356
|
+
let e = window.localStorage.getItem($n), t = e ? JSON.parse(e) : null;
|
|
5252
5357
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5253
5358
|
} catch {
|
|
5254
5359
|
return "";
|
|
5255
5360
|
}
|
|
5256
5361
|
}
|
|
5257
|
-
function
|
|
5362
|
+
function tr(e) {
|
|
5258
5363
|
try {
|
|
5259
5364
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5260
5365
|
} catch {}
|
|
5261
5366
|
}
|
|
5262
|
-
function
|
|
5367
|
+
function nr(e) {
|
|
5263
5368
|
try {
|
|
5264
|
-
window.localStorage.setItem(
|
|
5369
|
+
window.localStorage.setItem($n, JSON.stringify({
|
|
5265
5370
|
choice: e,
|
|
5266
5371
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5267
5372
|
}));
|
|
5268
5373
|
} catch {}
|
|
5269
|
-
|
|
5374
|
+
tr(e);
|
|
5270
5375
|
try {
|
|
5271
5376
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5272
5377
|
} catch {}
|
|
5273
5378
|
}
|
|
5274
|
-
var
|
|
5379
|
+
var rr = {
|
|
5275
5380
|
bottom: {
|
|
5276
5381
|
left: 0,
|
|
5277
5382
|
right: 0,
|
|
@@ -5293,18 +5398,18 @@ var nr = {
|
|
|
5293
5398
|
maxWidth: 400
|
|
5294
5399
|
}
|
|
5295
5400
|
};
|
|
5296
|
-
function
|
|
5401
|
+
function ir({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
|
|
5297
5402
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
5298
5403
|
y(e), typeof m == "function" && m(e);
|
|
5299
5404
|
};
|
|
5300
5405
|
if (i(() => {
|
|
5301
5406
|
if (h) return;
|
|
5302
|
-
let e =
|
|
5303
|
-
e ?
|
|
5407
|
+
let e = er();
|
|
5408
|
+
e ? tr(e) : _(!0);
|
|
5304
5409
|
}, [h, v]), !g) return null;
|
|
5305
5410
|
let x = (e) => () => {
|
|
5306
|
-
h || (
|
|
5307
|
-
}, S =
|
|
5411
|
+
h || (nr(e), _(!1));
|
|
5412
|
+
}, S = rr[s] ?? rr.bottom, C = {
|
|
5308
5413
|
appearance: "none",
|
|
5309
5414
|
font: "inherit",
|
|
5310
5415
|
fontSize: 14,
|
|
@@ -5384,37 +5489,37 @@ function rr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
5384
5489
|
}
|
|
5385
5490
|
//#endregion
|
|
5386
5491
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
5387
|
-
var
|
|
5492
|
+
var ar = {
|
|
5388
5493
|
id: "language",
|
|
5389
5494
|
label: "Language",
|
|
5390
5495
|
category: "Apps",
|
|
5391
5496
|
keys: ["SiteLanguagePicker"],
|
|
5392
5497
|
ssr: "prefetch",
|
|
5393
5498
|
settings: ["locales"]
|
|
5394
|
-
},
|
|
5499
|
+
}, or = {
|
|
5395
5500
|
id: "search",
|
|
5396
5501
|
label: "Search",
|
|
5397
5502
|
category: "Apps",
|
|
5398
5503
|
keys: ["SiteSearch"],
|
|
5399
5504
|
ssr: "prefetch",
|
|
5400
5505
|
settings: []
|
|
5401
|
-
},
|
|
5402
|
-
function
|
|
5506
|
+
}, sr = 50, cr = 2e3;
|
|
5507
|
+
function lr() {
|
|
5403
5508
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
5404
5509
|
}
|
|
5405
|
-
function
|
|
5510
|
+
function ur(e, t) {
|
|
5406
5511
|
let n = e?.data ?? {}, r = [];
|
|
5407
5512
|
for (let e of Object.values(n)) {
|
|
5408
|
-
let t = e == null ? "" :
|
|
5409
|
-
if (t && r.push(t), r.join(" ").length >
|
|
5513
|
+
let t = e == null ? "" : Z(e);
|
|
5514
|
+
if (t && r.push(t), r.join(" ").length > cr) break;
|
|
5410
5515
|
}
|
|
5411
|
-
return r.join(" ").slice(0,
|
|
5516
|
+
return r.join(" ").slice(0, cr).toLocaleLowerCase(t || void 0);
|
|
5412
5517
|
}
|
|
5413
|
-
function
|
|
5414
|
-
let { tenant: b, apiUrl: x, locale: S } = r(
|
|
5518
|
+
function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
|
|
5519
|
+
let { tenant: b, apiUrl: x, locale: S } = r(q), [C, w] = c(() => lr()), [T, E] = c(() => lr()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
|
|
5415
5520
|
i(() => {
|
|
5416
5521
|
let e = () => {
|
|
5417
|
-
let e =
|
|
5522
|
+
let e = lr();
|
|
5418
5523
|
w(e), E(e);
|
|
5419
5524
|
};
|
|
5420
5525
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -5465,8 +5570,8 @@ function ur({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5465
5570
|
});
|
|
5466
5571
|
}
|
|
5467
5572
|
else for (let t of e.rows) {
|
|
5468
|
-
if (!
|
|
5469
|
-
let n = t?.data ?? {}, r =
|
|
5573
|
+
if (!ur(t, S).includes(P)) continue;
|
|
5574
|
+
let n = t?.data ?? {}, r = Z(n.name) || "Untitled", i = Z(n.slug);
|
|
5470
5575
|
F.push({
|
|
5471
5576
|
key: `entry:${t.id}`,
|
|
5472
5577
|
title: r,
|
|
@@ -5474,7 +5579,7 @@ function ur({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5474
5579
|
kind: "entry"
|
|
5475
5580
|
});
|
|
5476
5581
|
}
|
|
5477
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
5582
|
+
let I = F.slice(0, Math.min(Math.max(1, p), sr)), L = (e) => {
|
|
5478
5583
|
if (v) {
|
|
5479
5584
|
e.preventDefault(), w(T), j(!0);
|
|
5480
5585
|
return;
|
|
@@ -5495,7 +5600,7 @@ function ur({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5495
5600
|
title: "Spring collection",
|
|
5496
5601
|
url: "/blog/spring",
|
|
5497
5602
|
kind: "entry"
|
|
5498
|
-
}] : null, z = R ?? I, B = !R && P && D && !I.length, V = !N || k && (z.length > 0 || B),
|
|
5603
|
+
}] : null, z = R ?? I, B = !R && P && D && !I.length, V = !N || k && (z.length > 0 || B), H = z.length > 0 && /* @__PURE__ */ u("ul", {
|
|
5499
5604
|
style: {
|
|
5500
5605
|
listStyle: "none",
|
|
5501
5606
|
margin: 0,
|
|
@@ -5599,7 +5704,7 @@ function ur({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5599
5704
|
background: "var(--page-surface, #f2f2f2)",
|
|
5600
5705
|
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.18)"
|
|
5601
5706
|
} : { marginTop: 14 },
|
|
5602
|
-
children: [
|
|
5707
|
+
children: [H, B && /* @__PURE__ */ u("div", {
|
|
5603
5708
|
style: {
|
|
5604
5709
|
fontSize: 14,
|
|
5605
5710
|
opacity: .65,
|
|
@@ -5614,21 +5719,21 @@ function ur({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5614
5719
|
}
|
|
5615
5720
|
//#endregion
|
|
5616
5721
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
5617
|
-
function
|
|
5722
|
+
function fr(e) {
|
|
5618
5723
|
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());
|
|
5619
5724
|
return [...new Set(n.map((e) => e.trim()))];
|
|
5620
5725
|
}
|
|
5621
|
-
var
|
|
5622
|
-
function
|
|
5726
|
+
var pr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
5727
|
+
function mr(e, t) {
|
|
5623
5728
|
let n = String(e ?? "").toUpperCase();
|
|
5624
5729
|
if (t === "code") return n;
|
|
5625
5730
|
let r = "";
|
|
5626
5731
|
try {
|
|
5627
|
-
r =
|
|
5732
|
+
r = pr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
5628
5733
|
} catch {}
|
|
5629
5734
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
5630
5735
|
}
|
|
5631
|
-
function
|
|
5736
|
+
function hr(e, t) {
|
|
5632
5737
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
5633
5738
|
if (typeof window > "u") return n || "?";
|
|
5634
5739
|
try {
|
|
@@ -5638,8 +5743,8 @@ function mr(e, t) {
|
|
|
5638
5743
|
return n || "/";
|
|
5639
5744
|
}
|
|
5640
5745
|
}
|
|
5641
|
-
function
|
|
5642
|
-
let c = r(
|
|
5746
|
+
function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
|
|
5747
|
+
let c = r(q), l = fr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
|
|
5643
5748
|
display: "inline-flex",
|
|
5644
5749
|
alignItems: "center",
|
|
5645
5750
|
gap: 8,
|
|
@@ -5674,7 +5779,7 @@ function hr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5674
5779
|
style: { opacity: .4 },
|
|
5675
5780
|
children: n ?? "·"
|
|
5676
5781
|
}), /* @__PURE__ */ u("a", {
|
|
5677
|
-
href:
|
|
5782
|
+
href: hr(e, e === f),
|
|
5678
5783
|
hrefLang: e,
|
|
5679
5784
|
"aria-current": e === p ? "true" : void 0,
|
|
5680
5785
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -5684,7 +5789,7 @@ function hr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5684
5789
|
textDecoration: "none",
|
|
5685
5790
|
cursor: s ? "default" : "pointer"
|
|
5686
5791
|
},
|
|
5687
|
-
children:
|
|
5792
|
+
children: mr(e, t)
|
|
5688
5793
|
})]
|
|
5689
5794
|
}, e))]
|
|
5690
5795
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -5695,7 +5800,7 @@ function hr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5695
5800
|
value: p,
|
|
5696
5801
|
onChange: s ? void 0 : (e) => {
|
|
5697
5802
|
let t = e.target.value;
|
|
5698
|
-
window.location.assign(
|
|
5803
|
+
window.location.assign(hr(t, t === f));
|
|
5699
5804
|
},
|
|
5700
5805
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
5701
5806
|
style: {
|
|
@@ -5709,57 +5814,57 @@ function hr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5709
5814
|
},
|
|
5710
5815
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
5711
5816
|
value: e,
|
|
5712
|
-
children:
|
|
5817
|
+
children: mr(e, t)
|
|
5713
5818
|
}, e))
|
|
5714
5819
|
})]
|
|
5715
5820
|
});
|
|
5716
5821
|
}
|
|
5717
5822
|
//#endregion
|
|
5718
5823
|
//#region ../ui/src/components/builder/apps/index.js
|
|
5719
|
-
var
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
],
|
|
5725
|
-
SiteLoginForm:
|
|
5726
|
-
SiteAccountMenu:
|
|
5727
|
-
SiteLanguagePicker:
|
|
5728
|
-
CookieConsent:
|
|
5729
|
-
SiteSearch:
|
|
5824
|
+
var _r = [
|
|
5825
|
+
Gn,
|
|
5826
|
+
ar,
|
|
5827
|
+
Qn,
|
|
5828
|
+
or
|
|
5829
|
+
], vr = {
|
|
5830
|
+
SiteLoginForm: Xn,
|
|
5831
|
+
SiteAccountMenu: Zn,
|
|
5832
|
+
SiteLanguagePicker: gr,
|
|
5833
|
+
CookieConsent: ir,
|
|
5834
|
+
SiteSearch: dr
|
|
5730
5835
|
};
|
|
5731
|
-
new Set(
|
|
5836
|
+
new Set(_r.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
5732
5837
|
//#endregion
|
|
5733
5838
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
5734
|
-
var
|
|
5735
|
-
function
|
|
5736
|
-
if (
|
|
5839
|
+
var yr = /* @__PURE__ */ new Map();
|
|
5840
|
+
function br(e) {
|
|
5841
|
+
if (yr.has(e)) return yr.get(e);
|
|
5737
5842
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
5738
5843
|
/* @vite-ignore */
|
|
5739
5844
|
/* webpackIgnore: true */
|
|
5740
5845
|
t
|
|
5741
5846
|
).finally(() => URL.revokeObjectURL(t));
|
|
5742
|
-
return
|
|
5847
|
+
return yr.set(e, n), n;
|
|
5743
5848
|
}
|
|
5744
|
-
function
|
|
5849
|
+
function xr(e) {
|
|
5745
5850
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
5746
5851
|
return n && typeof n == "object" ? n : {};
|
|
5747
5852
|
}
|
|
5748
5853
|
//#endregion
|
|
5749
5854
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
5750
|
-
async function
|
|
5751
|
-
let n = await
|
|
5855
|
+
async function Sr(e, t) {
|
|
5856
|
+
let n = await br(e);
|
|
5752
5857
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
5753
5858
|
}
|
|
5754
|
-
var
|
|
5859
|
+
var Cr = {
|
|
5755
5860
|
padding: "10px 12px",
|
|
5756
5861
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
5757
5862
|
borderRadius: 8,
|
|
5758
5863
|
fontSize: 12,
|
|
5759
5864
|
opacity: .6
|
|
5760
5865
|
};
|
|
5761
|
-
function
|
|
5762
|
-
let c = r(
|
|
5866
|
+
function wr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
5867
|
+
let c = r(q), l = xr(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
5763
5868
|
tenant: c?.tenant ?? "",
|
|
5764
5869
|
apiUrl: c?.apiUrl ?? "/api",
|
|
5765
5870
|
locale: c?.locale ?? "",
|
|
@@ -5771,7 +5876,7 @@ function Cr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5771
5876
|
let e = f.current;
|
|
5772
5877
|
if (!l?.code || !e) return;
|
|
5773
5878
|
let n = !0;
|
|
5774
|
-
return
|
|
5879
|
+
return Sr(l.code, t).then((e) => {
|
|
5775
5880
|
if (!(!n || !e || !f.current)) {
|
|
5776
5881
|
p.current = e;
|
|
5777
5882
|
try {
|
|
@@ -5801,7 +5906,7 @@ function Cr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5801
5906
|
}) : /* @__PURE__ */ d("div", {
|
|
5802
5907
|
ref: o,
|
|
5803
5908
|
style: {
|
|
5804
|
-
...
|
|
5909
|
+
...Cr,
|
|
5805
5910
|
...A(a)
|
|
5806
5911
|
},
|
|
5807
5912
|
children: [
|
|
@@ -5813,12 +5918,12 @@ function Cr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5813
5918
|
}
|
|
5814
5919
|
//#endregion
|
|
5815
5920
|
//#region ../ui/src/components/builder/render.jsx
|
|
5816
|
-
var
|
|
5817
|
-
...
|
|
5818
|
-
...
|
|
5819
|
-
PluginBlock:
|
|
5921
|
+
var Tr = {
|
|
5922
|
+
...Wn,
|
|
5923
|
+
...vr,
|
|
5924
|
+
PluginBlock: wr
|
|
5820
5925
|
};
|
|
5821
|
-
function
|
|
5926
|
+
function Er(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
5822
5927
|
let o = n[t];
|
|
5823
5928
|
if (!o || o.hidden) return null;
|
|
5824
5929
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -5826,11 +5931,11 @@ function Tr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5826
5931
|
let n = o.props?.componentId, s = r?.[n];
|
|
5827
5932
|
if (!s?.template || i.has(n)) return null;
|
|
5828
5933
|
let c = new Set(i).add(n);
|
|
5829
|
-
return /* @__PURE__ */ u(e, { children:
|
|
5934
|
+
return /* @__PURE__ */ u(e, { children: Er(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
5830
5935
|
}
|
|
5831
|
-
let l =
|
|
5936
|
+
let l = Tr[s];
|
|
5832
5937
|
if (!l) return null;
|
|
5833
|
-
let d = (o.nodes ?? []).map((e) =>
|
|
5938
|
+
let d = (o.nodes ?? []).map((e) => Er(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Er(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
5834
5939
|
...c,
|
|
5835
5940
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
5836
5941
|
linked: p,
|
|
@@ -5839,16 +5944,16 @@ function Tr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5839
5944
|
},
|
|
5840
5945
|
children: d.length ? d : void 0
|
|
5841
5946
|
}, t);
|
|
5842
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
5947
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(Yn, {
|
|
5843
5948
|
when: c.when,
|
|
5844
5949
|
children: m
|
|
5845
5950
|
}, t) : m;
|
|
5846
5951
|
}
|
|
5847
5952
|
//#endregion
|
|
5848
5953
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
5849
|
-
var
|
|
5850
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
5851
|
-
function
|
|
5954
|
+
var Dr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Or = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(K(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
5955
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(K(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
5956
|
+
function kr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, animations: c, tenant: l, apiUrl: f, datasets: p, locale: m, direction: h, settings: _, siteUser: v }) {
|
|
5852
5957
|
let b = s?.js?.trim();
|
|
5853
5958
|
if (i(() => {
|
|
5854
5959
|
if (!b) return;
|
|
@@ -5857,40 +5962,40 @@ function Or({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5857
5962
|
}, [b]), !e?.ROOT) return null;
|
|
5858
5963
|
let x = {
|
|
5859
5964
|
lang: m || void 0,
|
|
5860
|
-
dir:
|
|
5965
|
+
dir: be(h, m)
|
|
5861
5966
|
}, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
|
|
5862
5967
|
minHeight: "100%",
|
|
5863
5968
|
display: "flex",
|
|
5864
5969
|
flexDirection: "column"
|
|
5865
|
-
}, w =
|
|
5970
|
+
}, w = Er("ROOT", e, n), T = o(() => ({ render: (t, r) => Er(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = ie(e, n), O = re(e, n), k = s?.css?.trim(), A = E(c), j = ue(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !se[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
|
|
5866
5971
|
rel: "stylesheet",
|
|
5867
5972
|
precedence: "default",
|
|
5868
5973
|
href: g(e)
|
|
5869
|
-
}, e)), P =
|
|
5870
|
-
return r === "auto" ? /* @__PURE__ */ u(
|
|
5974
|
+
}, e)), P = Or(j);
|
|
5975
|
+
return r === "auto" ? /* @__PURE__ */ u(q.Provider, {
|
|
5871
5976
|
value: {
|
|
5872
5977
|
tenant: l || "",
|
|
5873
5978
|
apiUrl: f || "/api",
|
|
5874
5979
|
locale: m || "",
|
|
5875
5980
|
settings: _ ?? null
|
|
5876
5981
|
},
|
|
5877
|
-
children: /* @__PURE__ */ u(
|
|
5982
|
+
children: /* @__PURE__ */ u(Jn, {
|
|
5878
5983
|
initialUser: v,
|
|
5879
|
-
children: /* @__PURE__ */ u(
|
|
5984
|
+
children: /* @__PURE__ */ u(xe.Provider, {
|
|
5880
5985
|
value: p ?? null,
|
|
5881
|
-
children: /* @__PURE__ */ u(
|
|
5986
|
+
children: /* @__PURE__ */ u(J.Provider, {
|
|
5882
5987
|
value: T,
|
|
5883
5988
|
children: /* @__PURE__ */ d("div", {
|
|
5884
5989
|
...x,
|
|
5885
5990
|
className: "webim-page",
|
|
5886
5991
|
style: {
|
|
5887
5992
|
...C,
|
|
5888
|
-
...
|
|
5993
|
+
...de(t),
|
|
5889
5994
|
...a
|
|
5890
5995
|
},
|
|
5891
5996
|
children: [
|
|
5892
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
5893
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
5997
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${Dr(K(j.light))} }
|
|
5998
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Dr(K(j.dark))} } }` }),
|
|
5894
5999
|
/* @__PURE__ */ u("style", { children: P }),
|
|
5895
6000
|
N,
|
|
5896
6001
|
/* @__PURE__ */ u("style", { children: S }),
|
|
@@ -5903,25 +6008,25 @@ function Or({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5903
6008
|
})
|
|
5904
6009
|
})
|
|
5905
6010
|
})
|
|
5906
|
-
}) : /* @__PURE__ */ u(
|
|
6011
|
+
}) : /* @__PURE__ */ u(q.Provider, {
|
|
5907
6012
|
value: {
|
|
5908
6013
|
tenant: l || "",
|
|
5909
6014
|
apiUrl: f || "/api",
|
|
5910
6015
|
locale: m || "",
|
|
5911
6016
|
settings: _ ?? null
|
|
5912
6017
|
},
|
|
5913
|
-
children: /* @__PURE__ */ u(
|
|
6018
|
+
children: /* @__PURE__ */ u(Jn, {
|
|
5914
6019
|
initialUser: v,
|
|
5915
|
-
children: /* @__PURE__ */ u(
|
|
6020
|
+
children: /* @__PURE__ */ u(xe.Provider, {
|
|
5916
6021
|
value: p ?? null,
|
|
5917
|
-
children: /* @__PURE__ */ u(
|
|
6022
|
+
children: /* @__PURE__ */ u(J.Provider, {
|
|
5918
6023
|
value: T,
|
|
5919
6024
|
children: /* @__PURE__ */ d("div", {
|
|
5920
6025
|
...x,
|
|
5921
6026
|
className: "webim-page",
|
|
5922
6027
|
style: {
|
|
5923
6028
|
...C,
|
|
5924
|
-
...
|
|
6029
|
+
...fe(t, r),
|
|
5925
6030
|
...a
|
|
5926
6031
|
},
|
|
5927
6032
|
children: [
|
|
@@ -5943,8 +6048,8 @@ function Or({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5943
6048
|
}
|
|
5944
6049
|
//#endregion
|
|
5945
6050
|
//#region src/WebimContent.jsx
|
|
5946
|
-
function
|
|
5947
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
6051
|
+
function Ar({ bundle: e, mode: t = "auto", style: n }) {
|
|
6052
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(kr, {
|
|
5948
6053
|
blocks: e.blocks,
|
|
5949
6054
|
theme: e.theme,
|
|
5950
6055
|
components: e.components,
|
|
@@ -5956,13 +6061,13 @@ function kr({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
5956
6061
|
locale: e.locale,
|
|
5957
6062
|
direction: e.direction,
|
|
5958
6063
|
settings: e.settings,
|
|
5959
|
-
mode:
|
|
6064
|
+
mode: me(t, e.scheme),
|
|
5960
6065
|
style: n
|
|
5961
6066
|
}) : null;
|
|
5962
6067
|
}
|
|
5963
6068
|
//#endregion
|
|
5964
6069
|
//#region src/WebimPage.jsx
|
|
5965
|
-
function
|
|
6070
|
+
function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
|
|
5966
6071
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
5967
6072
|
onLoad: m,
|
|
5968
6073
|
onError: h
|
|
@@ -5972,7 +6077,7 @@ function Ar({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
5972
6077
|
onError: h
|
|
5973
6078
|
}, i(() => {
|
|
5974
6079
|
let i = !0;
|
|
5975
|
-
return _({ status: "loading" }),
|
|
6080
|
+
return _({ status: "loading" }), _e({
|
|
5976
6081
|
apiUrl: e,
|
|
5977
6082
|
tenant: t,
|
|
5978
6083
|
slug: n,
|
|
@@ -5999,11 +6104,11 @@ function Ar({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
5999
6104
|
r,
|
|
6000
6105
|
a,
|
|
6001
6106
|
o
|
|
6002
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
6107
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Ar, {
|
|
6003
6108
|
bundle: g.bundle,
|
|
6004
6109
|
mode: l,
|
|
6005
6110
|
style: d
|
|
6006
6111
|
});
|
|
6007
6112
|
}
|
|
6008
6113
|
//#endregion
|
|
6009
|
-
export {
|
|
6114
|
+
export { kr as PageRenderer, Ar as WebimContent, jr as WebimPage, _e as fetchPage, We as renderRichContent, pe as resolveTheme };
|