webim-adapter 1.0.1 → 1.0.3
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 +1029 -481
- package/build/webim-bundle.js +223 -0
- package/build/webim-embed.js +64 -12
- package/build/webim-ssr.js +1043 -495
- package/bundle.d.ts +11 -0
- package/package.json +7 -2
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:
|
|
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: ee } = 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
253
|
let H = F(I);
|
|
254
|
-
R !== void 0 && H.push(`blur(${O(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`),
|
|
254
|
+
R !== void 0 && H.push(`blur(${O(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), B !== void 0 && H.push(`brightness(${B}%)`), V !== void 0 && H.push(`contrast(${V}%)`), ee !== void 0 && H.push(`saturate(${ee}%)`), H.length && (t.filter = H.join(" "));
|
|
255
255
|
let te = F(L);
|
|
256
256
|
te.length && (t.backdropFilter = te.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
257
|
-
let { textStrokeWidth:
|
|
258
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
259
|
-
let { clipText:
|
|
260
|
-
delete t.clipText,
|
|
261
|
-
let { transitions:
|
|
257
|
+
let { textStrokeWidth: U, textStrokeColor: ne } = t;
|
|
258
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (U !== void 0 || ne !== void 0) && (t.WebkitTextStroke = `${O(U ?? 1)} ${ne || "currentColor"}`);
|
|
259
|
+
let { clipText: re } = t;
|
|
260
|
+
delete t.clipText, re && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
261
|
+
let { transitions: ie, transitionDuration: ae, transitionEasing: W, 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
|
|
264
|
-
if (
|
|
263
|
+
let se = (Array.isArray(ie) ? ie : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${oe(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
264
|
+
if (ae !== void 0 && se.push(`${G || "all"} ${oe(ae)} ${W || "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: K } = t;
|
|
276
276
|
delete t.backgroundLayers;
|
|
277
|
-
let
|
|
278
|
-
if (
|
|
277
|
+
let q = (Array.isArray(K) ? K : []).filter((e) => e && e.on !== !1);
|
|
278
|
+
if (q.length) {
|
|
279
279
|
let e = [], n = [], r = [], i = [], a = [];
|
|
280
|
-
for (let t of
|
|
280
|
+
for (let t of q) 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;
|
|
@@ -324,7 +324,7 @@ function z(e, t) {
|
|
|
324
324
|
}
|
|
325
325
|
return [];
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function B(e, t) {
|
|
328
328
|
for (let t of e.__webimEvents ?? []) t();
|
|
329
329
|
let n = [];
|
|
330
330
|
for (let r of t ?? []) {
|
|
@@ -355,7 +355,7 @@ function ee(e, t) {
|
|
|
355
355
|
}
|
|
356
356
|
e.__webimEvents = n;
|
|
357
357
|
}
|
|
358
|
-
function
|
|
358
|
+
function V(e, t, n = []) {
|
|
359
359
|
t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
|
|
360
360
|
let r = P(t.classNames), i = P(e.getAttribute("data-wb-class"));
|
|
361
361
|
for (let t of i) r.includes(t) || e.classList.remove(t);
|
|
@@ -369,15 +369,15 @@ function B(e, t, n = []) {
|
|
|
369
369
|
}
|
|
370
370
|
return a;
|
|
371
371
|
}
|
|
372
|
-
var
|
|
372
|
+
var ee = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
373
373
|
function H(e, t, n, r = !1) {
|
|
374
|
-
let i = Object.entries(A(t)).map(([e, t]) => `${
|
|
374
|
+
let i = Object.entries(A(t)).map(([e, t]) => `${ee(e)}: ${t} !important;`).join(" ");
|
|
375
375
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
376
376
|
}
|
|
377
377
|
function te(e, t, n) {
|
|
378
378
|
return Object.entries(j).map(([r, i]) => H(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
379
379
|
}
|
|
380
|
-
var
|
|
380
|
+
var U = [
|
|
381
381
|
{
|
|
382
382
|
key: "tablet",
|
|
383
383
|
max: 991
|
|
@@ -390,17 +390,17 @@ var ne = [
|
|
|
390
390
|
key: "mobile",
|
|
391
391
|
max: 478
|
|
392
392
|
}
|
|
393
|
-
],
|
|
394
|
-
function
|
|
395
|
-
return
|
|
396
|
-
let i = t?.[n] ?
|
|
393
|
+
], ne = (e) => Object.entries(A(e)).map(([e, t]) => `${ee(e)}: ${t} !important;`).join(" ");
|
|
394
|
+
function re(e, t) {
|
|
395
|
+
return U.map(({ key: n, max: r }) => {
|
|
396
|
+
let i = t?.[n] ? ne(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 ie(e, t) {
|
|
401
401
|
let n = [], r = (e) => {
|
|
402
402
|
for (let [t, r] of Object.entries(e || {})) {
|
|
403
|
-
let e =
|
|
403
|
+
let e = re(t, r.props);
|
|
404
404
|
e && n.push(e);
|
|
405
405
|
}
|
|
406
406
|
};
|
|
@@ -408,7 +408,7 @@ function ae(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 ae(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
414
|
let e = te(t, r.props);
|
|
@@ -419,7 +419,7 @@ function oe(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 W = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", G = {
|
|
423
423
|
light: {
|
|
424
424
|
background: "#f2f2f2",
|
|
425
425
|
surface: "#f2f2f2",
|
|
@@ -460,23 +460,23 @@ var U = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
460
460
|
contrastText: "#052e2b"
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
},
|
|
463
|
+
}, oe = {
|
|
464
464
|
font: "system",
|
|
465
465
|
headingFont: "inherit",
|
|
466
|
-
light:
|
|
467
|
-
dark:
|
|
468
|
-
},
|
|
466
|
+
light: G.light,
|
|
467
|
+
dark: G.dark
|
|
468
|
+
}, se = {
|
|
469
469
|
system: {
|
|
470
470
|
label: "System",
|
|
471
|
-
value:
|
|
471
|
+
value: W
|
|
472
472
|
},
|
|
473
473
|
inter: {
|
|
474
474
|
label: "Inter",
|
|
475
|
-
value: `"Inter", ${
|
|
475
|
+
value: `"Inter", ${W}`
|
|
476
476
|
},
|
|
477
477
|
outfit: {
|
|
478
478
|
label: "Outfit",
|
|
479
|
-
value: `"Outfit", ${
|
|
479
|
+
value: `"Outfit", ${W}`
|
|
480
480
|
},
|
|
481
481
|
serif: {
|
|
482
482
|
label: "Serif",
|
|
@@ -486,7 +486,7 @@ var U = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
486
486
|
label: "Mono",
|
|
487
487
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
488
488
|
}
|
|
489
|
-
}, ce = (e, t) =>
|
|
489
|
+
}, ce = (e, t) => se[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), le = (e, ...t) => {
|
|
490
490
|
let n = Object.assign({}, e, ...t);
|
|
491
491
|
return n.primary = {
|
|
492
492
|
...e.primary,
|
|
@@ -502,20 +502,20 @@ var U = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
502
502
|
}), {})
|
|
503
503
|
}, n;
|
|
504
504
|
};
|
|
505
|
-
function
|
|
505
|
+
function K(e) {
|
|
506
506
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
507
507
|
return {
|
|
508
|
-
font: r ??
|
|
509
|
-
headingFont: i ??
|
|
510
|
-
light: le(
|
|
511
|
-
dark: le(
|
|
508
|
+
font: r ?? oe.font,
|
|
509
|
+
headingFont: i ?? oe.headingFont,
|
|
510
|
+
light: le(G.light, a, t),
|
|
511
|
+
dark: le(G.dark, n)
|
|
512
512
|
};
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function q(e) {
|
|
515
515
|
return {
|
|
516
516
|
"--page-bg": e.background,
|
|
517
517
|
"--page-surface": e.surface ?? e.background,
|
|
518
|
-
"--page-border": e.border ??
|
|
518
|
+
"--page-border": e.border ?? G.light.border,
|
|
519
519
|
"--page-text": e.text,
|
|
520
520
|
"--page-accent": e.accent,
|
|
521
521
|
"--page-accent-text": e.accentText,
|
|
@@ -529,31 +529,31 @@ function K(e) {
|
|
|
529
529
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
530
530
|
};
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
let t =
|
|
532
|
+
function J(e) {
|
|
533
|
+
let t = K(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, W),
|
|
538
538
|
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : ce(t.headingFont, "inherit")
|
|
539
539
|
};
|
|
540
540
|
}
|
|
541
|
-
function
|
|
542
|
-
let n =
|
|
541
|
+
function ue(e, t = "light") {
|
|
542
|
+
let n = K(e);
|
|
543
543
|
return {
|
|
544
|
-
...
|
|
545
|
-
...
|
|
544
|
+
...J(e),
|
|
545
|
+
...q(n[t] ?? n.light)
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function de(e, t) {
|
|
549
549
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function fe(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 pe({ 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 he({ 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: de(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 he({ 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 me = 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 he({ 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(me), c(`${l}/settings/public`, { headers: u }).then(me)]), p = pe({
|
|
594
594
|
page: d,
|
|
595
595
|
settings: f,
|
|
596
596
|
tenant: t,
|
|
@@ -600,10 +600,11 @@ async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
600
600
|
"TableBlock",
|
|
601
601
|
"OrgChartBlock",
|
|
602
602
|
"NavbarBlock",
|
|
603
|
-
"CalendarBlock"
|
|
603
|
+
"CalendarBlock",
|
|
604
|
+
"MasonryBlock"
|
|
604
605
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
605
606
|
if (m.length) {
|
|
606
|
-
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(me).then((e) => {
|
|
607
608
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
608
609
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
609
610
|
}).catch(() => [[t, []]])));
|
|
@@ -617,7 +618,7 @@ async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
617
618
|
}
|
|
618
619
|
//#endregion
|
|
619
620
|
//#region ../ui/src/components/builder/locale.js
|
|
620
|
-
var
|
|
621
|
+
var ge = /* @__PURE__ */ new Set([
|
|
621
622
|
"ar",
|
|
622
623
|
"he",
|
|
623
624
|
"fa",
|
|
@@ -628,34 +629,34 @@ var ve = /* @__PURE__ */ new Set([
|
|
|
628
629
|
"yi",
|
|
629
630
|
"dv",
|
|
630
631
|
"ckb"
|
|
631
|
-
]),
|
|
632
|
+
]), _e = (e) => ge.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", ve = (e, t) => e === "ltr" || e === "rtl" ? e : t ? _e(t) : void 0, Y = t({
|
|
632
633
|
tenant: "",
|
|
633
634
|
apiUrl: "/api",
|
|
634
635
|
locale: "",
|
|
635
636
|
settings: null
|
|
636
|
-
}),
|
|
637
|
+
}), ye = t(null), be = (e) => {
|
|
637
638
|
let t = Number(e?.__page);
|
|
638
639
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
639
640
|
if (typeof window > "u") return 1;
|
|
640
641
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
641
642
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
642
|
-
},
|
|
643
|
+
}, xe = () => {
|
|
643
644
|
if (typeof window > "u") return {};
|
|
644
645
|
let e = {};
|
|
645
646
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
646
647
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
647
648
|
}), e;
|
|
648
|
-
},
|
|
649
|
+
}, Se = (e) => {
|
|
649
650
|
let t = {
|
|
650
651
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
651
|
-
...
|
|
652
|
+
...xe()
|
|
652
653
|
};
|
|
653
654
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
654
|
-
},
|
|
655
|
-
function
|
|
655
|
+
}, Ce = t(null), we = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
656
|
+
function Te(e, t) {
|
|
656
657
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
657
658
|
}
|
|
658
|
-
var
|
|
659
|
+
var Ee = (e) => {
|
|
659
660
|
let t = [];
|
|
660
661
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
661
662
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -665,21 +666,21 @@ var De = (e) => {
|
|
|
665
666
|
}
|
|
666
667
|
return t;
|
|
667
668
|
};
|
|
668
|
-
function
|
|
669
|
+
function X(e) {
|
|
669
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(" ") : "";
|
|
670
671
|
}
|
|
671
|
-
function
|
|
672
|
-
let n = t?.data ?? {}, r =
|
|
672
|
+
function De(e, t) {
|
|
673
|
+
let n = t?.data ?? {}, r = Ee(n);
|
|
673
674
|
if (!r.length) return e;
|
|
674
|
-
let i = RegExp(`:(${r.map(
|
|
675
|
+
let i = RegExp(`:(${r.map(we).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => X(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;
|
|
675
676
|
return a(e);
|
|
676
677
|
}
|
|
677
|
-
var
|
|
678
|
+
var Oe = {
|
|
678
679
|
margin: 0,
|
|
679
680
|
fontWeight: 700,
|
|
680
681
|
lineHeight: 1.2,
|
|
681
682
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
682
|
-
},
|
|
683
|
+
}, ke = { margin: 0 }, Ae = {
|
|
683
684
|
display: "inline-block",
|
|
684
685
|
textDecoration: "none",
|
|
685
686
|
cursor: "pointer",
|
|
@@ -763,14 +764,14 @@ function Re({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a
|
|
|
763
764
|
return /* @__PURE__ */ u(n, {
|
|
764
765
|
ref: a,
|
|
765
766
|
style: {
|
|
766
|
-
...
|
|
767
|
+
...Oe,
|
|
767
768
|
...A(r)
|
|
768
769
|
},
|
|
769
770
|
children: Z(t, e, i)
|
|
770
771
|
});
|
|
771
772
|
}
|
|
772
773
|
var ze = {
|
|
773
|
-
fontFamily:
|
|
774
|
+
fontFamily: se.mono.value,
|
|
774
775
|
background: "rgba(148, 163, 184, 0.18)",
|
|
775
776
|
padding: "1px 5px",
|
|
776
777
|
borderRadius: 4,
|
|
@@ -982,7 +983,7 @@ function We(e = [], t, n) {
|
|
|
982
983
|
let e = t.type;
|
|
983
984
|
return /* @__PURE__ */ u(e, {
|
|
984
985
|
style: {
|
|
985
|
-
...
|
|
986
|
+
...Oe,
|
|
986
987
|
fontSize: He[t.type],
|
|
987
988
|
...i
|
|
988
989
|
},
|
|
@@ -991,7 +992,7 @@ function We(e = [], t, n) {
|
|
|
991
992
|
}
|
|
992
993
|
return /* @__PURE__ */ u("p", {
|
|
993
994
|
style: {
|
|
994
|
-
...
|
|
995
|
+
...ke,
|
|
995
996
|
...i
|
|
996
997
|
},
|
|
997
998
|
children: r(t.parts, t.text)
|
|
@@ -1041,7 +1042,7 @@ function Ye({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
|
1041
1042
|
return /* @__PURE__ */ u("p", {
|
|
1042
1043
|
ref: i,
|
|
1043
1044
|
style: {
|
|
1044
|
-
...
|
|
1045
|
+
...ke,
|
|
1045
1046
|
...A(n)
|
|
1046
1047
|
},
|
|
1047
1048
|
children: Z(t, e, r)
|
|
@@ -1073,7 +1074,7 @@ function Qe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRe
|
|
|
1073
1074
|
target: r || void 0,
|
|
1074
1075
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1075
1076
|
style: {
|
|
1076
|
-
...
|
|
1077
|
+
...Ae,
|
|
1077
1078
|
...A(i)
|
|
1078
1079
|
},
|
|
1079
1080
|
children: Z(t, e, a)
|
|
@@ -1395,16 +1396,381 @@ function pt({ slides: e = [], linked: t, ...n }) {
|
|
|
1395
1396
|
}
|
|
1396
1397
|
}) : null;
|
|
1397
1398
|
}
|
|
1398
|
-
|
|
1399
|
-
let
|
|
1399
|
+
var Q = 256, mt = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), ht = (e, t, n) => {
|
|
1400
|
+
let r = Q * 2 ** n;
|
|
1401
|
+
return {
|
|
1402
|
+
x: (Number(t) + 180) / 360 * r,
|
|
1403
|
+
y: (.5 - mt(Number(e)) / (2 * Math.PI)) * r
|
|
1404
|
+
};
|
|
1405
|
+
}, $ = (e, t) => {
|
|
1406
|
+
if (e === "" || e == null) return null;
|
|
1407
|
+
let n = Number(e);
|
|
1408
|
+
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1409
|
+
}, gt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1410
|
+
function _t(e, t, n = "directions", r = "") {
|
|
1411
|
+
let i = `${e},${t}`;
|
|
1412
|
+
return n === "place" ? `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r ? "&query_place_id=" : ""}` : `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`;
|
|
1413
|
+
}
|
|
1414
|
+
var vt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1415
|
+
function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize: o = 22, pinLink: l = "directions", link: f = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
|
|
1416
|
+
let _ = s(null), [v, y] = c(1200);
|
|
1400
1417
|
i(() => {
|
|
1401
|
-
|
|
1418
|
+
let e = _.current;
|
|
1419
|
+
if (!e || typeof ResizeObserver > "u") return;
|
|
1420
|
+
let t = () => y((t) => e.clientWidth && e.clientWidth !== t ? e.clientWidth : t);
|
|
1421
|
+
t();
|
|
1422
|
+
let n = new ResizeObserver(t);
|
|
1423
|
+
return n.observe(e), () => n.disconnect();
|
|
1424
|
+
}, []);
|
|
1425
|
+
let b = (Array.isArray(e) ? e : []).filter(gt), x = gt({
|
|
1426
|
+
lat: t,
|
|
1427
|
+
lng: n
|
|
1428
|
+
}) ? {
|
|
1429
|
+
lat: $(t, 90),
|
|
1430
|
+
lng: $(n, 180)
|
|
1431
|
+
} : b.length ? {
|
|
1432
|
+
lat: b.reduce((e, t) => e + $(t.lat, 90), 0) / b.length,
|
|
1433
|
+
lng: b.reduce((e, t) => e + $(t.lng, 180), 0) / b.length
|
|
1434
|
+
} : null, S = Math.max(80, Number(a) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1435
|
+
if (b.length < 2) return 13;
|
|
1436
|
+
for (let e = 19; e >= 1; e--) {
|
|
1437
|
+
let t = b.map((t) => ht($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
|
|
1438
|
+
if (n <= v * .8 && r <= S * .7) return e;
|
|
1439
|
+
}
|
|
1440
|
+
return 1;
|
|
1441
|
+
})(), w = {
|
|
1442
|
+
width: "100%",
|
|
1443
|
+
...A(m)
|
|
1444
|
+
};
|
|
1445
|
+
if (!x) return /* @__PURE__ */ u("div", {
|
|
1446
|
+
ref: (e) => {
|
|
1447
|
+
_.current = e, typeof h == "function" && h(e);
|
|
1448
|
+
},
|
|
1449
|
+
style: {
|
|
1450
|
+
...w,
|
|
1451
|
+
minHeight: 80,
|
|
1452
|
+
display: "grid",
|
|
1453
|
+
placeItems: "center",
|
|
1454
|
+
fontSize: 13,
|
|
1455
|
+
opacity: .6,
|
|
1456
|
+
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.4))",
|
|
1457
|
+
borderRadius: 8
|
|
1458
|
+
},
|
|
1459
|
+
children: "Set the coordinates in Settings"
|
|
1460
|
+
});
|
|
1461
|
+
let T = ht(x.lat, x.lng, C), E = {
|
|
1462
|
+
x: T.x - v / 2,
|
|
1463
|
+
y: T.y - S / 2
|
|
1464
|
+
}, D = [], O = [];
|
|
1465
|
+
for (let e = Math.floor(E.x / Q); e <= Math.floor((E.x + v) / Q); e++) D.push(e);
|
|
1466
|
+
for (let e = Math.floor(E.y / Q); e <= Math.floor((E.y + S) / Q); e++) O.push(e);
|
|
1467
|
+
let k = 2 ** C;
|
|
1468
|
+
return /* @__PURE__ */ d("div", {
|
|
1469
|
+
ref: (e) => {
|
|
1470
|
+
_.current = e, typeof h == "function" && h(e);
|
|
1471
|
+
},
|
|
1472
|
+
style: w,
|
|
1473
|
+
children: [/* @__PURE__ */ d("div", {
|
|
1474
|
+
role: "img",
|
|
1475
|
+
"aria-label": p || "Map",
|
|
1476
|
+
style: {
|
|
1477
|
+
position: "relative",
|
|
1478
|
+
height: S,
|
|
1479
|
+
overflow: "hidden",
|
|
1480
|
+
borderRadius: "inherit",
|
|
1481
|
+
background: "var(--page-surface, #e5e7eb)"
|
|
1482
|
+
},
|
|
1483
|
+
children: [
|
|
1484
|
+
O.map((e) => D.map((t) => {
|
|
1485
|
+
let n = (t % k + k) % k;
|
|
1486
|
+
return e < 0 || e >= k ? null : /* @__PURE__ */ u("img", {
|
|
1487
|
+
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1488
|
+
alt: "",
|
|
1489
|
+
width: Q,
|
|
1490
|
+
height: Q,
|
|
1491
|
+
loading: "lazy",
|
|
1492
|
+
style: {
|
|
1493
|
+
position: "absolute",
|
|
1494
|
+
left: Math.round(t * Q - E.x),
|
|
1495
|
+
top: Math.round(e * Q - E.y),
|
|
1496
|
+
width: Q,
|
|
1497
|
+
height: Q,
|
|
1498
|
+
userSelect: "none",
|
|
1499
|
+
pointerEvents: "none"
|
|
1500
|
+
}
|
|
1501
|
+
}, `${t}-${e}`);
|
|
1502
|
+
})),
|
|
1503
|
+
b.map((e, t) => {
|
|
1504
|
+
let n = ht($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", s = l === "none" || g ? null : _t($(e.lat, 90), $(e.lng, 180), l, e.title);
|
|
1505
|
+
return /* @__PURE__ */ d(s ? "a" : "span", {
|
|
1506
|
+
href: s || void 0,
|
|
1507
|
+
target: s ? "_blank" : void 0,
|
|
1508
|
+
rel: s ? "noopener noreferrer" : void 0,
|
|
1509
|
+
title: s && e.title || void 0,
|
|
1510
|
+
style: {
|
|
1511
|
+
position: "absolute",
|
|
1512
|
+
left: r,
|
|
1513
|
+
top: i,
|
|
1514
|
+
transform: "translate(-50%, -100%)",
|
|
1515
|
+
cursor: s ? "pointer" : "default",
|
|
1516
|
+
textDecoration: "none",
|
|
1517
|
+
color: "inherit"
|
|
1518
|
+
},
|
|
1519
|
+
children: [e.title ? /* @__PURE__ */ u("span", {
|
|
1520
|
+
style: {
|
|
1521
|
+
position: "absolute",
|
|
1522
|
+
left: "50%",
|
|
1523
|
+
bottom: "100%",
|
|
1524
|
+
transform: "translateX(-50%)",
|
|
1525
|
+
marginBottom: 4,
|
|
1526
|
+
padding: "3px 7px",
|
|
1527
|
+
borderRadius: 6,
|
|
1528
|
+
background: "var(--page-surface, #ffffff)",
|
|
1529
|
+
color: "var(--page-text, #111827)",
|
|
1530
|
+
border: "1px solid var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
1531
|
+
boxShadow: "0 2px 8px rgba(15, 23, 42, 0.25)",
|
|
1532
|
+
fontSize: 12,
|
|
1533
|
+
lineHeight: 1.35,
|
|
1534
|
+
whiteSpace: "nowrap"
|
|
1535
|
+
},
|
|
1536
|
+
children: e.title
|
|
1537
|
+
}) : null, /* @__PURE__ */ d("svg", {
|
|
1538
|
+
width: Math.max(10, Number(o) || 22),
|
|
1539
|
+
height: Math.max(10, Number(o) || 22),
|
|
1540
|
+
viewBox: "0 0 24 24",
|
|
1541
|
+
fill: a,
|
|
1542
|
+
style: { display: "block" },
|
|
1543
|
+
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), bt[e.icon] ? /* @__PURE__ */ u("path", {
|
|
1544
|
+
d: bt[e.icon],
|
|
1545
|
+
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1546
|
+
fill: "none",
|
|
1547
|
+
stroke: "#fff",
|
|
1548
|
+
strokeWidth: 4,
|
|
1549
|
+
strokeLinecap: "round",
|
|
1550
|
+
strokeLinejoin: "round"
|
|
1551
|
+
}) : /* @__PURE__ */ u("circle", {
|
|
1552
|
+
cx: "12",
|
|
1553
|
+
cy: "10.5",
|
|
1554
|
+
r: "2.6",
|
|
1555
|
+
fill: "#fff"
|
|
1556
|
+
})]
|
|
1557
|
+
})]
|
|
1558
|
+
}, t);
|
|
1559
|
+
}),
|
|
1560
|
+
/* @__PURE__ */ u("a", {
|
|
1561
|
+
href: "https://www.openstreetmap.org/copyright",
|
|
1562
|
+
target: "_blank",
|
|
1563
|
+
rel: "noopener noreferrer",
|
|
1564
|
+
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
1565
|
+
style: {
|
|
1566
|
+
position: "absolute",
|
|
1567
|
+
right: 4,
|
|
1568
|
+
bottom: 3,
|
|
1569
|
+
padding: "1px 5px",
|
|
1570
|
+
borderRadius: 4,
|
|
1571
|
+
background: "rgba(255, 255, 255, 0.75)",
|
|
1572
|
+
color: "#334155",
|
|
1573
|
+
fontSize: 10,
|
|
1574
|
+
textDecoration: "none"
|
|
1575
|
+
},
|
|
1576
|
+
children: "© OpenStreetMap"
|
|
1577
|
+
})
|
|
1578
|
+
]
|
|
1579
|
+
}), f ? /* @__PURE__ */ u("a", {
|
|
1580
|
+
href: vt(x.lat, x.lng, C),
|
|
1581
|
+
target: "_blank",
|
|
1582
|
+
rel: "noopener noreferrer",
|
|
1583
|
+
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
1584
|
+
style: {
|
|
1585
|
+
display: "inline-block",
|
|
1586
|
+
marginTop: 6,
|
|
1587
|
+
fontSize: 12,
|
|
1588
|
+
color: "var(--page-accent, inherit)"
|
|
1589
|
+
},
|
|
1590
|
+
children: "View larger map"
|
|
1591
|
+
}) : null]
|
|
1592
|
+
});
|
|
1593
|
+
}
|
|
1594
|
+
var bt = {
|
|
1595
|
+
check: "M4 12l5 5L20 6",
|
|
1596
|
+
close: "M6 6l12 12M18 6L6 18",
|
|
1597
|
+
plus: "M12 5v14M5 12h14",
|
|
1598
|
+
minus: "M5 12h14",
|
|
1599
|
+
"arrow-right": "M4 12h16M13 5l7 7-7 7",
|
|
1600
|
+
"arrow-left": "M20 12H4M11 5l-7 7 7 7",
|
|
1601
|
+
"arrow-up": "M12 20V4M5 11l7-7 7 7",
|
|
1602
|
+
"arrow-down": "M12 4v16M5 13l7 7 7-7",
|
|
1603
|
+
"chevron-right": "M9 5l7 7-7 7",
|
|
1604
|
+
"chevron-left": "M15 5l-7 7 7 7",
|
|
1605
|
+
"chevron-down": "M5 9l7 7 7-7",
|
|
1606
|
+
"chevron-up": "M5 15l7-7 7 7",
|
|
1607
|
+
menu: "M4 7h16M4 12h16M4 17h16",
|
|
1608
|
+
star: "M12 3.5l2.6 5.3 5.9.9-4.3 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.5 9.7l5.9-.9z",
|
|
1609
|
+
heart: "M12 20s-7-4.4-7-9a4 4 0 0 1 7-2.6A4 4 0 0 1 19 11c0 4.6-7 9-7 9z",
|
|
1610
|
+
home: "M4 11l8-7 8 7M6 10v9h12v-9",
|
|
1611
|
+
user: "M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 20c0-3.3 3.6-5 8-5s8 1.7 8 5",
|
|
1612
|
+
mail: "M3 6h18v12H3zM3 6l9 7 9-7",
|
|
1613
|
+
phone: "M6 3h4l2 5-3 2a12 12 0 0 0 5 5l2-3 5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 4 5a2 2 0 0 1 2-2z",
|
|
1614
|
+
search: "M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14zM20 20l-4.2-4.2",
|
|
1615
|
+
clock: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 7v5l3 2",
|
|
1616
|
+
calendar: "M4 6h16v14H4zM4 10h16M8 3v4M16 3v4",
|
|
1617
|
+
download: "M12 4v10M8 11l4 4 4-4M4 19h16",
|
|
1618
|
+
upload: "M12 20V10M8 13l4-4 4 4M4 5h16",
|
|
1619
|
+
play: "M8 5l11 7-11 7z",
|
|
1620
|
+
pause: "M9 5v14M15 5v14",
|
|
1621
|
+
info: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 11v5M12 8h.01",
|
|
1622
|
+
alert: "M12 4l9 16H3zM12 10v4M12 17h.01",
|
|
1623
|
+
lock: "M6 11h12v9H6zM9 11V8a3 3 0 0 1 6 0v3",
|
|
1624
|
+
chat: "M4 5h16v11H9l-5 4z",
|
|
1625
|
+
"map-pin": "M12 21s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11zM12 12a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z",
|
|
1626
|
+
camera: "M4 8h4l2-2h4l2 2h4v12H4zM12 17a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z",
|
|
1627
|
+
image: "M4 5h16v14H4zM8 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM6 17l5-5 4 4 2-2 3 3",
|
|
1628
|
+
file: "M7 3h7l4 4v14H7zM14 3v5h4",
|
|
1629
|
+
link: "M10 14a4 4 0 0 0 6 .5l2-2a4 4 0 0 0-6-6l-1 1M14 10a4 4 0 0 0-6-.5l-2 2a4 4 0 0 0 6 6l1-1",
|
|
1630
|
+
external: "M14 4h6v6M20 4l-9 9M18 14v5H5V6h5",
|
|
1631
|
+
trash: "M4 7h16M9 7V5h6v2M6 7l1 13h10l1-13",
|
|
1632
|
+
edit: "M4 20h4L19 9l-4-4L4 16z",
|
|
1633
|
+
filter: "M3 5h18l-7 8v6l-4-2v-4z",
|
|
1634
|
+
refresh: "M20 12a8 8 0 1 1-2.3-5.7M20 4v5h-5",
|
|
1635
|
+
globe: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM3 12h18M12 3c2.5 3 2.5 15 0 18M12 3c-2.5 3-2.5 15 0 18",
|
|
1636
|
+
bell: "M6 16V11a6 6 0 1 1 12 0v5l2 3H4zM10 22h4",
|
|
1637
|
+
tag: "M4 4h7l9 9-7 7-9-9zM8.5 8.5h.01",
|
|
1638
|
+
cart: "M4 5h2l2 10h10l2-7H7M9 20h.01M18 20h.01",
|
|
1639
|
+
card: "M3 6h18v12H3zM3 10h18",
|
|
1640
|
+
shield: "M12 3l8 3v6c0 5-4 8-8 9-4-1-8-4-8-9V6z",
|
|
1641
|
+
sun: "M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 2v2M12 20v2M4 12H2M22 12h-2M5 5l1.5 1.5M17.5 17.5L19 19M19 5l-1.5 1.5M6.5 17.5L5 19",
|
|
1642
|
+
moon: "M20 14a8 8 0 1 1-10-10 7 7 0 0 0 10 10z",
|
|
1643
|
+
settings: "M12 9.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM12 2l1 2.6 2.7-.6 1 2.5 2.6 1-.6 2.7L21 12l-2.3 1.8.6 2.7-2.6 1-1 2.5-2.7-.6L12 22l-1-2.6-2.7.6-1-2.5-2.6-1 .6-2.7L3 12l2.3-1.8-.6-2.7 2.6-1 1-2.5 2.7.6z",
|
|
1644
|
+
eye: "M2 12s4-7 10-7 10 7 10 7-4 7-10 7-10-7-10-7zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",
|
|
1645
|
+
"eye-off": "M4 4l16 16M9.5 9.6A3 3 0 0 0 12 15c.8 0 1.5-.3 2.1-.8M6.6 6.7C3.9 8.3 2 12 2 12s4 7 10 7c1.9 0 3.5-.5 4.9-1.2M14.1 5.4C13.4 5.1 12.7 5 12 5",
|
|
1646
|
+
share: "M8 12a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM21 6a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM21 18a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0zM7.8 10.8l8.4-3.6M7.8 13.2l8.4 3.6",
|
|
1647
|
+
send: "M21 3L3 10l7 3 3 7z",
|
|
1648
|
+
paperclip: "M20 11l-8.5 8.5a5 5 0 0 1-7-7L13 4a3.5 3.5 0 0 1 5 5l-8.5 8.5a2 2 0 0 1-3-3L15 6",
|
|
1649
|
+
video: "M3 7h11v10H3zM14 11l6-3v8l-6-3",
|
|
1650
|
+
music: "M9 18V6l10-2v12M9 18a2.5 2.5 0 1 1-2.5-2.5H9M19 16a2.5 2.5 0 1 1-2.5-2.5H19",
|
|
1651
|
+
mic: "M12 3a3 3 0 0 1 3 3v5a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3zM5 11a7 7 0 0 0 14 0M12 18v3",
|
|
1652
|
+
headphones: "M4 15v-3a8 8 0 1 1 16 0v3M4 15h3v5H5a1 1 0 0 1-1-1zM20 15h-3v5h2a1 1 0 0 0 1-1z",
|
|
1653
|
+
book: "M5 4h14v16H7a2 2 0 0 1-2-2zM7 4v14h12",
|
|
1654
|
+
bookmark: "M7 4h10v16l-5-4-5 4z",
|
|
1655
|
+
folder: "M4 6h5l2 2h9v10H4z",
|
|
1656
|
+
cloud: "M7 18a4 4 0 0 1 .5-8 5.5 5.5 0 0 1 10.4 1.5A3.5 3.5 0 0 1 17.5 18z",
|
|
1657
|
+
database: "M12 3c4.4 0 8 1.3 8 3s-3.6 3-8 3-8-1.3-8-3 3.6-3 8-3zM4 6v12c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12c0 1.7 3.6 3 8 3s8-1.3 8-3",
|
|
1658
|
+
server: "M4 4h16v6H4zM4 14h16v6H4zM8 7h.01M8 17h.01",
|
|
1659
|
+
code: "M9 8l-5 4 5 4M15 8l5 4-5 4",
|
|
1660
|
+
terminal: "M4 5h16v14H4zM8 10l3 2-3 2M13 14h4",
|
|
1661
|
+
wifi: "M5 12a10 10 0 0 1 14 0M8 15a6 6 0 0 1 8 0M12 19h.01",
|
|
1662
|
+
battery: "M3 8h15v8H3zM21 11v2",
|
|
1663
|
+
printer: "M7 8V4h10v4M7 16H4V8h16v8h-3M7 13h10v7H7z",
|
|
1664
|
+
gift: "M4 10h16v10H4zM3 6h18v4H3zM12 6v14M12 6c-2 0-4-1-4-2.5S9 2 10 3s2 3 2 3zM12 6c2 0 4-1 4-2.5S15 2 14 3s-2 3-2 3z",
|
|
1665
|
+
key: "M15 4a5 5 0 1 0-4.6 7L9 12.4V15H6.5L4 17.5V20h4l7-7A5 5 0 0 0 15 4z",
|
|
1666
|
+
compass: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM15 9l-2 5-5 2 2-5z",
|
|
1667
|
+
flag: "M5 21V4h13l-2 4 2 4H5",
|
|
1668
|
+
award: "M12 4a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM9 13l-1 7 4-2 4 2-1-7",
|
|
1669
|
+
chart: "M4 20V4M4 20h16M8 16v-5M12 16V8M16 16v-8",
|
|
1670
|
+
pie: "M12 3a9 9 0 1 0 9 9h-9z",
|
|
1671
|
+
trending: "M3 17l6-6 4 4 8-8M15 7h6v6",
|
|
1672
|
+
dollar: "M12 3v18M16 7.5C16 6 14.2 5 12 5S8 6 8 7.5 9.5 10 12 10.5s4 1.5 4 3-1.8 2.5-4 2.5-4-1-4-2.5",
|
|
1673
|
+
percent: "M5 19L19 5M7.5 5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5zM16.5 14a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z",
|
|
1674
|
+
truck: "M3 6h11v9H3zM14 9h4l3 3v3h-7zM7.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM17.5 18a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z",
|
|
1675
|
+
package: "M12 3l8 4v10l-8 4-8-4V7zM4 7l8 4 8-4M12 11v10",
|
|
1676
|
+
store: "M4 9h16v11H4zM4 9l1.5-5h13L20 9M9 20v-6h6v6",
|
|
1677
|
+
building: "M5 21V4h9v17M14 9h5v12M8 8h3M8 12h3M8 16h3M17 12h.01M17 16h.01",
|
|
1678
|
+
users: "M9 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 20c0-3.3 3.1-5 7-5s7 1.7 7 5M17 5a4 4 0 0 1 0 7.9M22 20c0-2.6-1.6-4.2-4-4.8",
|
|
1679
|
+
"thumbs-up": "M7 21V10h3l3-6a2 2 0 0 1 2 2v4h4l-2 11z",
|
|
1680
|
+
smile: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9 10h.01M15 10h.01M8.5 14.5a5 5 0 0 0 7 0",
|
|
1681
|
+
help: "M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.7M12 17h.01",
|
|
1682
|
+
checkbox: "M4 4h16v16H4zM8 12l3 3 5-5",
|
|
1683
|
+
list: "M8 6h13M8 12h13M8 18h13M3.5 6h.01M3.5 12h.01M3.5 18h.01",
|
|
1684
|
+
grid: "M4 4h7v7H4zM13 4h7v7h-7zM4 13h7v7H4zM13 13h7v7h-7z",
|
|
1685
|
+
layers: "M12 3l9 5-9 5-9-5zM3 13l9 5 9-5",
|
|
1686
|
+
zap: "M13 3L5 14h6l-1 7 8-11h-6z",
|
|
1687
|
+
flame: "M12 21a6 6 0 0 0 6-6c0-4-4-6-4-10 0 0-3 1.5-3 5 0 1.5-1 2-1.5 1.5C8 10 7.5 9 7.5 9A7.5 7.5 0 0 0 6 15a6 6 0 0 0 6 6z",
|
|
1688
|
+
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1689
|
+
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1690
|
+
};
|
|
1691
|
+
function xt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: d, inert: f }) {
|
|
1692
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [bt[e] ?? bt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
|
|
1693
|
+
viewBox: "0 0 24 24",
|
|
1694
|
+
width: g,
|
|
1695
|
+
height: g,
|
|
1696
|
+
fill: m ? _ : "none",
|
|
1697
|
+
stroke: m ? "none" : _,
|
|
1698
|
+
strokeWidth: m ? void 0 : Math.min(Math.max(Number(i) || 2, .5), 4),
|
|
1699
|
+
strokeLinecap: m ? void 0 : "round",
|
|
1700
|
+
strokeLinejoin: m ? void 0 : "round",
|
|
1701
|
+
role: c ? "img" : void 0,
|
|
1702
|
+
"aria-label": c || void 0,
|
|
1703
|
+
"aria-hidden": c ? void 0 : "true",
|
|
1704
|
+
style: { display: "block" },
|
|
1705
|
+
children: h.map((e, t) => /* @__PURE__ */ u("path", { d: e }, t))
|
|
1706
|
+
}), y = {
|
|
1707
|
+
display: "inline-flex",
|
|
1708
|
+
lineHeight: 0,
|
|
1709
|
+
...A(l)
|
|
1710
|
+
};
|
|
1711
|
+
return o ? /* @__PURE__ */ u("a", {
|
|
1712
|
+
ref: d,
|
|
1713
|
+
href: o,
|
|
1714
|
+
onClick: f ? (e) => e.preventDefault() : void 0,
|
|
1715
|
+
target: s || void 0,
|
|
1716
|
+
rel: s === "_blank" ? "noopener noreferrer" : void 0,
|
|
1717
|
+
style: {
|
|
1718
|
+
...y,
|
|
1719
|
+
color: "inherit"
|
|
1720
|
+
},
|
|
1721
|
+
children: v
|
|
1722
|
+
}) : /* @__PURE__ */ u("span", {
|
|
1723
|
+
ref: d,
|
|
1724
|
+
style: y,
|
|
1725
|
+
children: v
|
|
1726
|
+
});
|
|
1727
|
+
}
|
|
1728
|
+
function St(e, t = {}, n = 0) {
|
|
1729
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : X(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1730
|
+
for (let e of r) {
|
|
1731
|
+
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
|
+
for (let e of s) if (o.push({
|
|
1733
|
+
src: e,
|
|
1734
|
+
name: c,
|
|
1735
|
+
alt: c,
|
|
1736
|
+
href: l
|
|
1737
|
+
}), a && o.length >= a) return o;
|
|
1738
|
+
}
|
|
1739
|
+
return o;
|
|
1740
|
+
}
|
|
1741
|
+
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(Y), C = r(ye)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
|
|
1743
|
+
i(() => {
|
|
1744
|
+
if (!t || C) return;
|
|
1745
|
+
let e = !0;
|
|
1746
|
+
return fetch(`${S}/dynamic/${encodeURIComponent(t)}`, { headers: x ? { "x-tenant": x } : {} }).then((e) => e.json()).then((t) => {
|
|
1747
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
1748
|
+
e && T(n);
|
|
1749
|
+
}).catch(() => e && T([])), () => {
|
|
1750
|
+
e = !1;
|
|
1751
|
+
};
|
|
1752
|
+
}, [
|
|
1753
|
+
t,
|
|
1754
|
+
x,
|
|
1755
|
+
S,
|
|
1756
|
+
C
|
|
1757
|
+
]);
|
|
1758
|
+
let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, j = Math.max(0, Number(f) || 0), M = t ? (() => {
|
|
1759
|
+
let e = St(k, {
|
|
1760
|
+
imageField: a,
|
|
1761
|
+
nameField: o,
|
|
1762
|
+
hrefField: s
|
|
1763
|
+
}, 0).filter((e) => !E.has(e.src));
|
|
1764
|
+
return j ? e.slice(0, j) : e;
|
|
1765
|
+
})() : null, N = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], P = M ?? N, F = !!t && !C && w === null, I = Math.max(0, Number(h) || 0), L = b ? (e) => e.preventDefault() : void 0, [R, z] = c(null), B = _ && !b && R !== null && P[R];
|
|
1766
|
+
i(() => {
|
|
1767
|
+
if (!B) return;
|
|
1402
1768
|
let e = (e) => {
|
|
1403
|
-
e.key === "Escape" &&
|
|
1769
|
+
e.key === "Escape" && z(null), e.key === "ArrowRight" && z((e) => (e + 1) % P.length), e.key === "ArrowLeft" && z((e) => (e - 1 + P.length) % P.length);
|
|
1404
1770
|
};
|
|
1405
1771
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
1406
|
-
}, [
|
|
1407
|
-
let
|
|
1772
|
+
}, [B, P.length]);
|
|
1773
|
+
let V = (e) => {
|
|
1408
1774
|
if (typeof e.name == "string" && e.name.trim()) return e.name;
|
|
1409
1775
|
if (typeof e.alt == "string" && e.alt.trim()) return e.alt;
|
|
1410
1776
|
try {
|
|
@@ -1415,16 +1781,16 @@ function mt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1415
1781
|
}
|
|
1416
1782
|
};
|
|
1417
1783
|
return /* @__PURE__ */ d("div", {
|
|
1418
|
-
ref:
|
|
1784
|
+
ref: y,
|
|
1419
1785
|
style: {
|
|
1420
|
-
columnCount: Math.min(Math.max(Number(
|
|
1421
|
-
columnGap:
|
|
1786
|
+
columnCount: Math.min(Math.max(Number(m) || 3, 1), 8),
|
|
1787
|
+
columnGap: I,
|
|
1422
1788
|
width: "100%",
|
|
1423
|
-
...A(
|
|
1789
|
+
...A(v)
|
|
1424
1790
|
},
|
|
1425
1791
|
children: [
|
|
1426
|
-
|
|
1427
|
-
let
|
|
1792
|
+
P.map((e, n) => {
|
|
1793
|
+
let r = /* @__PURE__ */ d("span", {
|
|
1428
1794
|
style: {
|
|
1429
1795
|
position: "relative",
|
|
1430
1796
|
display: "block",
|
|
@@ -1434,12 +1800,13 @@ function mt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1434
1800
|
children: [/* @__PURE__ */ u("img", {
|
|
1435
1801
|
src: e.src,
|
|
1436
1802
|
alt: e.alt ?? "",
|
|
1803
|
+
onError: t ? () => D((t) => new Set(t).add(e.src)) : void 0,
|
|
1437
1804
|
style: {
|
|
1438
1805
|
width: "100%",
|
|
1439
1806
|
display: "block",
|
|
1440
1807
|
borderRadius: "inherit"
|
|
1441
1808
|
}
|
|
1442
|
-
}),
|
|
1809
|
+
}), g && V(e) && /* @__PURE__ */ u("span", {
|
|
1443
1810
|
style: {
|
|
1444
1811
|
position: "absolute",
|
|
1445
1812
|
insetInline: 0,
|
|
@@ -1453,41 +1820,41 @@ function mt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1453
1820
|
overflow: "hidden",
|
|
1454
1821
|
textOverflow: "ellipsis"
|
|
1455
1822
|
},
|
|
1456
|
-
children:
|
|
1823
|
+
children: V(e)
|
|
1457
1824
|
})]
|
|
1458
1825
|
}), i = e.href ? /* @__PURE__ */ u("a", {
|
|
1459
1826
|
href: e.href,
|
|
1460
|
-
onClick:
|
|
1827
|
+
onClick: L,
|
|
1461
1828
|
target: e.target || void 0,
|
|
1462
1829
|
rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
1463
1830
|
style: {
|
|
1464
1831
|
display: "block",
|
|
1465
1832
|
borderRadius: "inherit"
|
|
1466
1833
|
},
|
|
1467
|
-
children:
|
|
1468
|
-
}) :
|
|
1834
|
+
children: r
|
|
1835
|
+
}) : _ && !b ? /* @__PURE__ */ u("span", {
|
|
1469
1836
|
role: "button",
|
|
1470
1837
|
tabIndex: 0,
|
|
1471
|
-
onClick: () =>
|
|
1472
|
-
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") &&
|
|
1838
|
+
onClick: () => z(n),
|
|
1839
|
+
onKeyDown: (e) => (e.key === "Enter" || e.key === " ") && z(n),
|
|
1473
1840
|
style: {
|
|
1474
1841
|
display: "block",
|
|
1475
1842
|
borderRadius: "inherit",
|
|
1476
1843
|
cursor: "zoom-in"
|
|
1477
1844
|
},
|
|
1478
|
-
children:
|
|
1479
|
-
}) :
|
|
1845
|
+
children: r
|
|
1846
|
+
}) : r;
|
|
1480
1847
|
return /* @__PURE__ */ u("div", {
|
|
1481
1848
|
style: {
|
|
1482
1849
|
breakInside: "avoid",
|
|
1483
|
-
marginBottom:
|
|
1850
|
+
marginBottom: I,
|
|
1484
1851
|
borderRadius: "inherit",
|
|
1485
1852
|
overflow: "hidden"
|
|
1486
1853
|
},
|
|
1487
1854
|
children: i
|
|
1488
|
-
},
|
|
1855
|
+
}, n);
|
|
1489
1856
|
}),
|
|
1490
|
-
!
|
|
1857
|
+
!P.length && !F && /* @__PURE__ */ u("div", {
|
|
1491
1858
|
style: {
|
|
1492
1859
|
padding: "24px 12px",
|
|
1493
1860
|
fontSize: 13,
|
|
@@ -1495,12 +1862,12 @@ function mt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1495
1862
|
textAlign: "center",
|
|
1496
1863
|
columnSpan: "all"
|
|
1497
1864
|
},
|
|
1498
|
-
children: "Pick images in Settings to fill the gallery"
|
|
1865
|
+
children: t ? p || "No images yet" : "Pick images in Settings to fill the gallery"
|
|
1499
1866
|
}),
|
|
1500
|
-
|
|
1867
|
+
B && /* @__PURE__ */ d("div", {
|
|
1501
1868
|
role: "dialog",
|
|
1502
1869
|
"aria-modal": "true",
|
|
1503
|
-
onClick: () =>
|
|
1870
|
+
onClick: () => z(null),
|
|
1504
1871
|
style: {
|
|
1505
1872
|
position: "fixed",
|
|
1506
1873
|
inset: 0,
|
|
@@ -1514,8 +1881,8 @@ function mt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1514
1881
|
},
|
|
1515
1882
|
children: [
|
|
1516
1883
|
/* @__PURE__ */ u("img", {
|
|
1517
|
-
src:
|
|
1518
|
-
alt:
|
|
1884
|
+
src: P[R].src,
|
|
1885
|
+
alt: P[R].alt ?? "",
|
|
1519
1886
|
onClick: (e) => e.stopPropagation(),
|
|
1520
1887
|
style: {
|
|
1521
1888
|
maxWidth: "92vw",
|
|
@@ -1524,19 +1891,19 @@ function mt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1524
1891
|
boxShadow: "0 12px 48px rgba(0,0,0,0.5)"
|
|
1525
1892
|
}
|
|
1526
1893
|
}),
|
|
1527
|
-
|
|
1894
|
+
V(P[R]) && /* @__PURE__ */ u("div", {
|
|
1528
1895
|
style: {
|
|
1529
1896
|
color: "#fff",
|
|
1530
1897
|
fontSize: 14,
|
|
1531
1898
|
marginTop: 12,
|
|
1532
1899
|
opacity: .85
|
|
1533
1900
|
},
|
|
1534
|
-
children:
|
|
1901
|
+
children: V(P[R])
|
|
1535
1902
|
}),
|
|
1536
1903
|
/* @__PURE__ */ u("button", {
|
|
1537
1904
|
type: "button",
|
|
1538
1905
|
"aria-label": "Close",
|
|
1539
|
-
onClick: () =>
|
|
1906
|
+
onClick: () => z(null),
|
|
1540
1907
|
style: {
|
|
1541
1908
|
position: "absolute",
|
|
1542
1909
|
top: 16,
|
|
@@ -1550,11 +1917,11 @@ function mt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1550
1917
|
},
|
|
1551
1918
|
children: "×"
|
|
1552
1919
|
}),
|
|
1553
|
-
|
|
1920
|
+
P.length > 1 && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("button", {
|
|
1554
1921
|
type: "button",
|
|
1555
1922
|
"aria-label": "Previous",
|
|
1556
1923
|
onClick: (e) => {
|
|
1557
|
-
e.stopPropagation(),
|
|
1924
|
+
e.stopPropagation(), z((e) => (e - 1 + P.length) % P.length);
|
|
1558
1925
|
},
|
|
1559
1926
|
style: {
|
|
1560
1927
|
position: "absolute",
|
|
@@ -1573,7 +1940,7 @@ function mt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1573
1940
|
type: "button",
|
|
1574
1941
|
"aria-label": "Next",
|
|
1575
1942
|
onClick: (e) => {
|
|
1576
|
-
e.stopPropagation(),
|
|
1943
|
+
e.stopPropagation(), z((e) => (e + 1) % P.length);
|
|
1577
1944
|
},
|
|
1578
1945
|
style: {
|
|
1579
1946
|
position: "absolute",
|
|
@@ -1594,20 +1961,20 @@ function mt({ images: e = [], columns: t = 3, gap: n = 8, showNames: r = !1, lig
|
|
|
1594
1961
|
]
|
|
1595
1962
|
});
|
|
1596
1963
|
}
|
|
1597
|
-
var
|
|
1964
|
+
var wt = {
|
|
1598
1965
|
color: "inherit",
|
|
1599
1966
|
textDecoration: "none",
|
|
1600
1967
|
fontSize: 14,
|
|
1601
1968
|
opacity: .85
|
|
1602
|
-
},
|
|
1969
|
+
}, Tt = {
|
|
1603
1970
|
background: "var(--page-surface, #f2f2f2)",
|
|
1604
1971
|
color: "var(--page-text, #111827)",
|
|
1605
1972
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1606
1973
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1607
1974
|
zIndex: 60
|
|
1608
1975
|
};
|
|
1609
|
-
function
|
|
1610
|
-
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 ? "" :
|
|
1976
|
+
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 ? "" : X(e), o = r.map((e) => {
|
|
1611
1978
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
1612
1979
|
return {
|
|
1613
1980
|
key: e.id,
|
|
@@ -1648,8 +2015,8 @@ function _t(e, t = {}, n = "dropdown") {
|
|
|
1648
2015
|
type: e.children.length ? n : "link"
|
|
1649
2016
|
}));
|
|
1650
2017
|
}
|
|
1651
|
-
function
|
|
1652
|
-
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(
|
|
2018
|
+
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(Y), P = r(ye)?.[g], [F, I] = c(null);
|
|
1653
2020
|
i(() => {
|
|
1654
2021
|
if (!g || P) return;
|
|
1655
2022
|
let e = !0;
|
|
@@ -1669,7 +2036,7 @@ function vt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
1669
2036
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
1670
2037
|
return e.observe(C), () => e.disconnect();
|
|
1671
2038
|
}, [C, h]);
|
|
1672
|
-
let L = g ?
|
|
2039
|
+
let L = g ? Et(P ?? F ?? [], {
|
|
1673
2040
|
labelField: _,
|
|
1674
2041
|
hrefField: v,
|
|
1675
2042
|
imageField: y,
|
|
@@ -1698,7 +2065,7 @@ function vt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
1698
2065
|
return /* @__PURE__ */ d("a", {
|
|
1699
2066
|
href: e.href || "#",
|
|
1700
2067
|
style: {
|
|
1701
|
-
...
|
|
2068
|
+
...wt,
|
|
1702
2069
|
display: n ? "block" : "flex",
|
|
1703
2070
|
alignItems: n ? void 0 : "center",
|
|
1704
2071
|
gap: n ? void 0 : 10,
|
|
@@ -1795,7 +2162,7 @@ function vt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
1795
2162
|
let t = e.children ?? [];
|
|
1796
2163
|
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
1797
2164
|
href: e.href || "#",
|
|
1798
|
-
style:
|
|
2165
|
+
style: wt,
|
|
1799
2166
|
children: e.label
|
|
1800
2167
|
}, e.key);
|
|
1801
2168
|
let n = e.type === "mega";
|
|
@@ -1809,7 +2176,7 @@ function vt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
1809
2176
|
children: [/* @__PURE__ */ d("a", {
|
|
1810
2177
|
href: e.href || "#",
|
|
1811
2178
|
style: {
|
|
1812
|
-
...
|
|
2179
|
+
...wt,
|
|
1813
2180
|
cursor: "pointer"
|
|
1814
2181
|
},
|
|
1815
2182
|
children: [
|
|
@@ -1825,7 +2192,7 @@ function vt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
1825
2192
|
]
|
|
1826
2193
|
}), k === e.key && (n ? /* @__PURE__ */ u("div", {
|
|
1827
2194
|
style: {
|
|
1828
|
-
...
|
|
2195
|
+
...Tt,
|
|
1829
2196
|
position: "absolute",
|
|
1830
2197
|
left: 0,
|
|
1831
2198
|
right: 0,
|
|
@@ -1841,7 +2208,7 @@ function vt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
1841
2208
|
}, !0))
|
|
1842
2209
|
}) : /* @__PURE__ */ u("div", {
|
|
1843
2210
|
style: {
|
|
1844
|
-
...
|
|
2211
|
+
...Tt,
|
|
1845
2212
|
position: "absolute",
|
|
1846
2213
|
top: "100%",
|
|
1847
2214
|
left: 0,
|
|
@@ -1870,7 +2237,7 @@ function vt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
1870
2237
|
children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
1871
2238
|
href: t.href || "#",
|
|
1872
2239
|
style: {
|
|
1873
|
-
...
|
|
2240
|
+
...wt,
|
|
1874
2241
|
padding: "10px 4px",
|
|
1875
2242
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
1876
2243
|
opacity: 1
|
|
@@ -1881,7 +2248,7 @@ function vt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
1881
2248
|
]
|
|
1882
2249
|
});
|
|
1883
2250
|
}
|
|
1884
|
-
function
|
|
2251
|
+
function Ot({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1885
2252
|
let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1886
2253
|
return e.length ? /* @__PURE__ */ d("div", {
|
|
1887
2254
|
ref: r,
|
|
@@ -1921,7 +2288,7 @@ function yt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1921
2288
|
}, e.key))]
|
|
1922
2289
|
}) : null;
|
|
1923
2290
|
}
|
|
1924
|
-
function
|
|
2291
|
+
function kt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1925
2292
|
let [a, o] = c(() => new Set(e.length ? [e[0].key] : []));
|
|
1926
2293
|
if (!e.length) return null;
|
|
1927
2294
|
let s = (e) => o((t) => {
|
|
@@ -1978,15 +2345,15 @@ function bt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1978
2345
|
})
|
|
1979
2346
|
});
|
|
1980
2347
|
}
|
|
1981
|
-
var
|
|
2348
|
+
var At = {
|
|
1982
2349
|
display: "flex",
|
|
1983
2350
|
flexDirection: "column",
|
|
1984
2351
|
gap: "12px"
|
|
1985
|
-
},
|
|
2352
|
+
}, jt = {
|
|
1986
2353
|
fontSize: "14px",
|
|
1987
2354
|
fontWeight: 500,
|
|
1988
2355
|
color: "var(--page-text, #111827)"
|
|
1989
|
-
},
|
|
2356
|
+
}, Mt = {
|
|
1990
2357
|
padding: "10px 12px",
|
|
1991
2358
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
1992
2359
|
borderRadius: "6px",
|
|
@@ -1996,18 +2363,18 @@ var xt = {
|
|
|
1996
2363
|
boxSizing: "border-box",
|
|
1997
2364
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
1998
2365
|
color: "var(--page-text, #111827)"
|
|
1999
|
-
},
|
|
2366
|
+
}, Nt = {
|
|
2000
2367
|
display: "flex",
|
|
2001
2368
|
alignItems: "center",
|
|
2002
2369
|
gap: "8px",
|
|
2003
2370
|
fontSize: "14px",
|
|
2004
2371
|
color: "var(--page-text, #111827)"
|
|
2005
|
-
},
|
|
2372
|
+
}, Pt = (e) => e ? {
|
|
2006
2373
|
readOnly: !0,
|
|
2007
2374
|
tabIndex: -1,
|
|
2008
2375
|
onMouseDown: (e) => e.preventDefault()
|
|
2009
2376
|
} : {};
|
|
2010
|
-
function
|
|
2377
|
+
function Ft(e, t) {
|
|
2011
2378
|
if (!e) return !0;
|
|
2012
2379
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2013
2380
|
switch (e.op) {
|
|
@@ -2021,11 +2388,11 @@ function wt(e, t) {
|
|
|
2021
2388
|
default: return !1;
|
|
2022
2389
|
}
|
|
2023
2390
|
}
|
|
2024
|
-
var
|
|
2391
|
+
var It = {
|
|
2025
2392
|
display: "flex",
|
|
2026
2393
|
flexDirection: "column",
|
|
2027
2394
|
gap: 6
|
|
2028
|
-
},
|
|
2395
|
+
}, Lt = {
|
|
2029
2396
|
font: "inherit",
|
|
2030
2397
|
fontSize: 15,
|
|
2031
2398
|
padding: "10px 12px",
|
|
@@ -2036,16 +2403,17 @@ var Tt = {
|
|
|
2036
2403
|
width: "100%",
|
|
2037
2404
|
boxSizing: "border-box"
|
|
2038
2405
|
};
|
|
2039
|
-
function
|
|
2406
|
+
function Rt(e, t) {
|
|
2040
2407
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2041
2408
|
if (!e?.parentField) return n;
|
|
2042
2409
|
let r = t?.[e.parentField];
|
|
2043
2410
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2044
2411
|
}
|
|
2045
|
-
|
|
2412
|
+
var zt = "g-recaptcha-response", Bt = (e) => e?.type === "recaptcha" ? zt : e?.name;
|
|
2413
|
+
function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2046
2414
|
let a = /* @__PURE__ */ d("span", {
|
|
2047
2415
|
style: {
|
|
2048
|
-
...
|
|
2416
|
+
...jt,
|
|
2049
2417
|
fontSize: 14
|
|
2050
2418
|
},
|
|
2051
2419
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2054,7 +2422,7 @@ function Ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2054
2422
|
required: e.required || void 0,
|
|
2055
2423
|
placeholder: e.placeholder || void 0,
|
|
2056
2424
|
disabled: r || void 0,
|
|
2057
|
-
style:
|
|
2425
|
+
style: Lt,
|
|
2058
2426
|
value: t ?? "",
|
|
2059
2427
|
onChange: (t) => n(e.name, t.target.value)
|
|
2060
2428
|
};
|
|
@@ -2083,7 +2451,12 @@ function Ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2083
2451
|
borderRadius: 8,
|
|
2084
2452
|
display: "block"
|
|
2085
2453
|
}
|
|
2086
|
-
}) : null : e.type === "
|
|
2454
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(Kt, {
|
|
2455
|
+
theme: e.captchaTheme,
|
|
2456
|
+
size: e.captchaSize,
|
|
2457
|
+
inert: r,
|
|
2458
|
+
onChange: (e) => n(zt, e)
|
|
2459
|
+
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(nt, {
|
|
2087
2460
|
url: e.src,
|
|
2088
2461
|
style: { width: "100%" }
|
|
2089
2462
|
}) : /* @__PURE__ */ u("video", {
|
|
@@ -2095,14 +2468,14 @@ function Ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2095
2468
|
display: "block"
|
|
2096
2469
|
}
|
|
2097
2470
|
}) : null : /* @__PURE__ */ d("label", {
|
|
2098
|
-
style:
|
|
2471
|
+
style: It,
|
|
2099
2472
|
children: [
|
|
2100
2473
|
a,
|
|
2101
2474
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
|
|
2102
2475
|
...o,
|
|
2103
2476
|
rows: 4,
|
|
2104
2477
|
style: {
|
|
2105
|
-
...
|
|
2478
|
+
...Lt,
|
|
2106
2479
|
resize: "vertical"
|
|
2107
2480
|
}
|
|
2108
2481
|
}) : e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
@@ -2111,7 +2484,7 @@ function Ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2111
2484
|
children: [/* @__PURE__ */ u("option", {
|
|
2112
2485
|
value: "",
|
|
2113
2486
|
children: e.placeholder || "—"
|
|
2114
|
-
}),
|
|
2487
|
+
}), Rt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
|
|
2115
2488
|
value: typeof e == "string" ? e : e.value,
|
|
2116
2489
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2117
2490
|
}, t))]
|
|
@@ -2158,8 +2531,8 @@ function Ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2158
2531
|
]
|
|
2159
2532
|
});
|
|
2160
2533
|
}
|
|
2161
|
-
function
|
|
2162
|
-
let { tenant: y, apiUrl: b } = r(
|
|
2534
|
+
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(Y), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
|
|
2163
2536
|
i(() => {
|
|
2164
2537
|
if (!f || !s) return;
|
|
2165
2538
|
let e = !0;
|
|
@@ -2180,11 +2553,11 @@ function kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2180
2553
|
section: e,
|
|
2181
2554
|
fields: []
|
|
2182
2555
|
}) : j[j.length - 1].fields.push(e);
|
|
2183
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
2556
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Ft(e.section.condition, T)).map((e) => ({
|
|
2184
2557
|
...e,
|
|
2185
|
-
fields: e.fields.filter((e) =>
|
|
2558
|
+
fields: e.fields.filter((e) => Ft(e.condition, T))
|
|
2186
2559
|
})), P = M.length > 1, F = Math.min(D, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
2187
|
-
let t = T[e
|
|
2560
|
+
let t = T[Bt(e)];
|
|
2188
2561
|
return e.required && (t == null || t === "" || t === !1);
|
|
2189
2562
|
}), R = F >= N.length - 1, z = (e, t) => E((n) => {
|
|
2190
2563
|
let r = {
|
|
@@ -2240,11 +2613,11 @@ function kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2240
2613
|
}
|
|
2241
2614
|
},
|
|
2242
2615
|
style: {
|
|
2243
|
-
...
|
|
2616
|
+
...At,
|
|
2244
2617
|
display: k === "success" ? "none" : "flex"
|
|
2245
2618
|
},
|
|
2246
2619
|
children: f && s ? /* @__PURE__ */ d(l, { children: [
|
|
2247
|
-
P && /* @__PURE__ */ u(
|
|
2620
|
+
P && /* @__PURE__ */ u(_n, {
|
|
2248
2621
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2249
2622
|
active: F + 1,
|
|
2250
2623
|
style: { marginBottom: 8 }
|
|
@@ -2257,9 +2630,9 @@ function kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2257
2630
|
},
|
|
2258
2631
|
children: N[F].section.help
|
|
2259
2632
|
}),
|
|
2260
|
-
I.map((e) => /* @__PURE__ */ u(
|
|
2633
|
+
I.map((e) => /* @__PURE__ */ u(Vt, {
|
|
2261
2634
|
field: e,
|
|
2262
|
-
value: T[e
|
|
2635
|
+
value: T[Bt(e)],
|
|
2263
2636
|
values: T,
|
|
2264
2637
|
onChange: z,
|
|
2265
2638
|
inert: h
|
|
@@ -2276,7 +2649,7 @@ function kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2276
2649
|
disabled: h || void 0,
|
|
2277
2650
|
onClick: () => O(F - 1),
|
|
2278
2651
|
style: {
|
|
2279
|
-
...
|
|
2652
|
+
...Ae,
|
|
2280
2653
|
background: "transparent",
|
|
2281
2654
|
color: "inherit",
|
|
2282
2655
|
border: 0,
|
|
@@ -2289,7 +2662,7 @@ function kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2289
2662
|
disabled: h || L.length > 0,
|
|
2290
2663
|
onClick: () => O(F + 1),
|
|
2291
2664
|
style: {
|
|
2292
|
-
...
|
|
2665
|
+
...Ae,
|
|
2293
2666
|
border: 0,
|
|
2294
2667
|
padding: "10px 22px",
|
|
2295
2668
|
borderRadius: 8,
|
|
@@ -2303,7 +2676,7 @@ function kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2303
2676
|
type: "submit",
|
|
2304
2677
|
disabled: h || void 0,
|
|
2305
2678
|
style: {
|
|
2306
|
-
...
|
|
2679
|
+
...Ae,
|
|
2307
2680
|
border: 0,
|
|
2308
2681
|
padding: "10px 22px",
|
|
2309
2682
|
borderRadius: 8,
|
|
@@ -2330,10 +2703,10 @@ function kt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2330
2703
|
]
|
|
2331
2704
|
});
|
|
2332
2705
|
}
|
|
2333
|
-
var
|
|
2706
|
+
var Ut = null, Wt = null, Gt = (e) => {
|
|
2334
2707
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2335
|
-
if (
|
|
2336
|
-
if (
|
|
2708
|
+
if (Ut && Wt === t) return Ut;
|
|
2709
|
+
if (Ut && typeof window < "u") {
|
|
2337
2710
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2338
2711
|
delete window[e];
|
|
2339
2712
|
} catch {
|
|
@@ -2341,22 +2714,22 @@ var At = null, jt = null, Mt = (e) => {
|
|
|
2341
2714
|
}
|
|
2342
2715
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2343
2716
|
}
|
|
2344
|
-
return
|
|
2717
|
+
return Wt = t, Ut = new Promise((e) => {
|
|
2345
2718
|
if (typeof window > "u") return;
|
|
2346
2719
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2347
2720
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2348
2721
|
let n = document.createElement("script");
|
|
2349
2722
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2350
|
-
}),
|
|
2723
|
+
}), Ut;
|
|
2351
2724
|
};
|
|
2352
|
-
function
|
|
2353
|
-
let p = r(
|
|
2725
|
+
function Kt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
|
|
2726
|
+
let p = r(Y), 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);
|
|
2354
2727
|
if (_.current = f, i(() => {
|
|
2355
2728
|
if (l || !h || !g.current) return;
|
|
2356
2729
|
let e = !0, r = (t) => {
|
|
2357
2730
|
e && typeof _.current == "function" && _.current(t);
|
|
2358
2731
|
};
|
|
2359
|
-
return
|
|
2732
|
+
return Gt(a).then((i) => {
|
|
2360
2733
|
if (!(!e || !g.current || !i?.render)) {
|
|
2361
2734
|
g.current.innerHTML = "", r("");
|
|
2362
2735
|
try {
|
|
@@ -2438,17 +2811,17 @@ function Nt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2438
2811
|
children: /* @__PURE__ */ u("div", { ref: g })
|
|
2439
2812
|
}) : null;
|
|
2440
2813
|
}
|
|
2441
|
-
function
|
|
2814
|
+
function qt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2442
2815
|
return /* @__PURE__ */ u("label", {
|
|
2443
2816
|
ref: r,
|
|
2444
2817
|
style: {
|
|
2445
|
-
...
|
|
2818
|
+
...jt,
|
|
2446
2819
|
...A(n)
|
|
2447
2820
|
},
|
|
2448
2821
|
children: Z(t, e, i)
|
|
2449
2822
|
});
|
|
2450
2823
|
}
|
|
2451
|
-
function
|
|
2824
|
+
function Jt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2452
2825
|
return /* @__PURE__ */ u("input", {
|
|
2453
2826
|
ref: a,
|
|
2454
2827
|
type: e,
|
|
@@ -2456,13 +2829,13 @@ function Ft({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2456
2829
|
placeholder: n,
|
|
2457
2830
|
required: !o && !!r,
|
|
2458
2831
|
style: {
|
|
2459
|
-
...
|
|
2832
|
+
...Mt,
|
|
2460
2833
|
...A(i)
|
|
2461
2834
|
},
|
|
2462
|
-
|
|
2835
|
+
...Pt(o)
|
|
2463
2836
|
});
|
|
2464
2837
|
}
|
|
2465
|
-
function
|
|
2838
|
+
function Yt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2466
2839
|
return /* @__PURE__ */ u("textarea", {
|
|
2467
2840
|
ref: a,
|
|
2468
2841
|
name: e || void 0,
|
|
@@ -2470,18 +2843,18 @@ function It({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2470
2843
|
rows: n,
|
|
2471
2844
|
required: !o && !!r,
|
|
2472
2845
|
style: {
|
|
2473
|
-
...
|
|
2846
|
+
...Mt,
|
|
2474
2847
|
resize: "vertical",
|
|
2475
2848
|
...A(i)
|
|
2476
2849
|
},
|
|
2477
|
-
|
|
2850
|
+
...Pt(o)
|
|
2478
2851
|
});
|
|
2479
2852
|
}
|
|
2480
|
-
function
|
|
2853
|
+
function Xt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2481
2854
|
return /* @__PURE__ */ d("label", {
|
|
2482
2855
|
ref: o,
|
|
2483
2856
|
style: {
|
|
2484
|
-
...
|
|
2857
|
+
...Nt,
|
|
2485
2858
|
...A(a)
|
|
2486
2859
|
},
|
|
2487
2860
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -2498,7 +2871,7 @@ function Lt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2498
2871
|
}), t]
|
|
2499
2872
|
});
|
|
2500
2873
|
}
|
|
2501
|
-
function
|
|
2874
|
+
function Zt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2502
2875
|
return /* @__PURE__ */ d("select", {
|
|
2503
2876
|
ref: a,
|
|
2504
2877
|
name: e || void 0,
|
|
@@ -2507,7 +2880,7 @@ function Rt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2507
2880
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2508
2881
|
tabIndex: o ? -1 : void 0,
|
|
2509
2882
|
style: {
|
|
2510
|
-
...
|
|
2883
|
+
...Mt,
|
|
2511
2884
|
appearance: "auto",
|
|
2512
2885
|
...A(i)
|
|
2513
2886
|
},
|
|
@@ -2521,12 +2894,12 @@ function Rt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2521
2894
|
}, t))]
|
|
2522
2895
|
});
|
|
2523
2896
|
}
|
|
2524
|
-
function
|
|
2897
|
+
function Qt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2525
2898
|
let [s, l] = c(null);
|
|
2526
2899
|
return /* @__PURE__ */ d("label", {
|
|
2527
2900
|
ref: a,
|
|
2528
2901
|
style: {
|
|
2529
|
-
...
|
|
2902
|
+
...Mt,
|
|
2530
2903
|
display: "flex",
|
|
2531
2904
|
alignItems: "center",
|
|
2532
2905
|
gap: "8px",
|
|
@@ -2553,12 +2926,12 @@ function zt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
2553
2926
|
]
|
|
2554
2927
|
});
|
|
2555
2928
|
}
|
|
2556
|
-
function
|
|
2929
|
+
function $t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
2557
2930
|
return /* @__PURE__ */ u("button", {
|
|
2558
2931
|
ref: n,
|
|
2559
2932
|
type: r ? "button" : "submit",
|
|
2560
2933
|
style: {
|
|
2561
|
-
...
|
|
2934
|
+
...Ae,
|
|
2562
2935
|
border: 0,
|
|
2563
2936
|
cursor: "pointer",
|
|
2564
2937
|
alignSelf: "flex-start",
|
|
@@ -2573,7 +2946,7 @@ function Bt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2573
2946
|
children: e
|
|
2574
2947
|
});
|
|
2575
2948
|
}
|
|
2576
|
-
function
|
|
2949
|
+
function en({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
2577
2950
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
2578
2951
|
return /* @__PURE__ */ u("div", {
|
|
2579
2952
|
ref: r,
|
|
@@ -2590,8 +2963,8 @@ function Vt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2590
2963
|
}, t))
|
|
2591
2964
|
});
|
|
2592
2965
|
}
|
|
2593
|
-
function
|
|
2594
|
-
let { tenant: v, apiUrl: y, locale: b } = r(
|
|
2966
|
+
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(Y), x = r(Ce), S = r(ye), [, C] = c(0);
|
|
2595
2968
|
i(() => {
|
|
2596
2969
|
if (typeof window > "u") return;
|
|
2597
2970
|
let e = () => C((e) => e + 1);
|
|
@@ -2599,7 +2972,7 @@ function Ht({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2599
2972
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
2600
2973
|
};
|
|
2601
2974
|
}, []);
|
|
2602
|
-
let w =
|
|
2975
|
+
let w = Se(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? be(S) : 1, [k, j] = c(null);
|
|
2603
2976
|
if (i(() => {
|
|
2604
2977
|
if (!e || D) return;
|
|
2605
2978
|
let n = !0, r = new URLSearchParams();
|
|
@@ -2644,7 +3017,7 @@ function Ht({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2644
3017
|
},
|
|
2645
3018
|
children: N.map((e) => /* @__PURE__ */ u("div", {
|
|
2646
3019
|
style: { minWidth: 0 },
|
|
2647
|
-
children: x.render(p, (t) =>
|
|
3020
|
+
children: x.render(p, (t) => De(t, e))
|
|
2648
3021
|
}, e.id ?? e?.data?.slug))
|
|
2649
3022
|
}) : /* @__PURE__ */ u("div", {
|
|
2650
3023
|
ref: _,
|
|
@@ -2654,7 +3027,7 @@ function Ht({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2654
3027
|
...A(g)
|
|
2655
3028
|
},
|
|
2656
3029
|
children: N.map((e) => {
|
|
2657
|
-
let t = o ?
|
|
3030
|
+
let t = o ? Te(e?.data, o) : null, r = s ? X(Te(e?.data, s)) : null, i = l ? Te(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : X(i), f = n === "list";
|
|
2658
3031
|
return /* @__PURE__ */ d("div", {
|
|
2659
3032
|
style: {
|
|
2660
3033
|
display: "flex",
|
|
@@ -2709,8 +3082,8 @@ function Ht({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2709
3082
|
})
|
|
2710
3083
|
});
|
|
2711
3084
|
}
|
|
2712
|
-
function
|
|
2713
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3085
|
+
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 ? {} : xe(), s = {
|
|
2714
3087
|
height: 34,
|
|
2715
3088
|
padding: "0 12px",
|
|
2716
3089
|
borderRadius: 8,
|
|
@@ -2758,7 +3131,7 @@ function Ut({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2758
3131
|
name: `f_${e.name}`,
|
|
2759
3132
|
defaultValue: o[e.name] ?? "",
|
|
2760
3133
|
style: s,
|
|
2761
|
-
|
|
3134
|
+
...Pt(i),
|
|
2762
3135
|
children: [/* @__PURE__ */ u("option", {
|
|
2763
3136
|
value: "",
|
|
2764
3137
|
children: e.label || e.name
|
|
@@ -2773,7 +3146,7 @@ function Ut({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2773
3146
|
name: `f_${e.name}`,
|
|
2774
3147
|
defaultValue: o[e.name] ?? "",
|
|
2775
3148
|
style: s,
|
|
2776
|
-
|
|
3149
|
+
...Pt(i),
|
|
2777
3150
|
children: [
|
|
2778
3151
|
/* @__PURE__ */ u("option", {
|
|
2779
3152
|
value: "",
|
|
@@ -2794,7 +3167,7 @@ function Ut({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2794
3167
|
defaultValue: o[e.name] ?? "",
|
|
2795
3168
|
placeholder: e.label || e.name,
|
|
2796
3169
|
style: s,
|
|
2797
|
-
|
|
3170
|
+
...Pt(i)
|
|
2798
3171
|
}, e.name)), /* @__PURE__ */ u("button", {
|
|
2799
3172
|
type: "submit",
|
|
2800
3173
|
style: {
|
|
@@ -2807,12 +3180,12 @@ function Ut({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
2807
3180
|
fontWeight: 600,
|
|
2808
3181
|
cursor: i ? "default" : "pointer"
|
|
2809
3182
|
},
|
|
2810
|
-
|
|
3183
|
+
...Pt(i),
|
|
2811
3184
|
children: t
|
|
2812
3185
|
})]
|
|
2813
3186
|
});
|
|
2814
3187
|
}
|
|
2815
|
-
function
|
|
3188
|
+
function rn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
2816
3189
|
return e.length ? /* @__PURE__ */ u("nav", {
|
|
2817
3190
|
ref: r,
|
|
2818
3191
|
"aria-label": "Breadcrumb",
|
|
@@ -2862,8 +3235,8 @@ function Wt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2862
3235
|
})
|
|
2863
3236
|
}) : null;
|
|
2864
3237
|
}
|
|
2865
|
-
function
|
|
2866
|
-
let { tenant: g, apiUrl: _ } = r(
|
|
3238
|
+
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(Y), v = r(ye), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
2867
3240
|
i(() => {
|
|
2868
3241
|
if (!o || Number.isFinite(x)) return;
|
|
2869
3242
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -2882,7 +3255,7 @@ function Gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
2882
3255
|
]);
|
|
2883
3256
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
2884
3257
|
if (o && C === null || o && f && !(C > 0)) return null;
|
|
2885
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3258
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? be(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
2886
3259
|
if (o) {
|
|
2887
3260
|
if (typeof window < "u") {
|
|
2888
3261
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -2947,15 +3320,15 @@ function Gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
2947
3320
|
]
|
|
2948
3321
|
});
|
|
2949
3322
|
}
|
|
2950
|
-
var
|
|
3323
|
+
var on = "webim.page_mode", sn = () => {
|
|
2951
3324
|
if (typeof window > "u") return "auto";
|
|
2952
3325
|
try {
|
|
2953
|
-
let e = window.localStorage.getItem(
|
|
3326
|
+
let e = window.localStorage.getItem(on);
|
|
2954
3327
|
return e === "light" || e === "dark" ? e : "auto";
|
|
2955
3328
|
} catch {
|
|
2956
3329
|
return "auto";
|
|
2957
3330
|
}
|
|
2958
|
-
},
|
|
3331
|
+
}, cn = (e) => {
|
|
2959
3332
|
let t = {
|
|
2960
3333
|
width: 16,
|
|
2961
3334
|
height: 16,
|
|
@@ -2987,13 +3360,13 @@ var Kt = "webim.page_mode", qt = () => {
|
|
|
2987
3360
|
rx: "2"
|
|
2988
3361
|
}), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
|
|
2989
3362
|
});
|
|
2990
|
-
},
|
|
3363
|
+
}, ln = {
|
|
2991
3364
|
light: "Light theme",
|
|
2992
3365
|
dark: "Dark theme",
|
|
2993
3366
|
auto: "Follow the device theme"
|
|
2994
3367
|
};
|
|
2995
|
-
function
|
|
2996
|
-
let [o, l] = c(a ? "auto" :
|
|
3368
|
+
function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
3369
|
+
let [o, l] = c(a ? "auto" : sn), d = s(null), f = (e) => {
|
|
2997
3370
|
d.current = e, typeof r == "function" && r(e);
|
|
2998
3371
|
};
|
|
2999
3372
|
i(() => {
|
|
@@ -3001,7 +3374,7 @@ function Xt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3001
3374
|
let e = d.current?.closest?.(".webim-page");
|
|
3002
3375
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3003
3376
|
try {
|
|
3004
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3377
|
+
o === "auto" ? window.localStorage.removeItem(on) : window.localStorage.setItem(on, o);
|
|
3005
3378
|
} catch {}
|
|
3006
3379
|
}, [o, a]);
|
|
3007
3380
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3036,8 +3409,8 @@ function Xt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3036
3409
|
},
|
|
3037
3410
|
children: p.map((e) => /* @__PURE__ */ u("button", {
|
|
3038
3411
|
type: "button",
|
|
3039
|
-
title:
|
|
3040
|
-
"aria-label":
|
|
3412
|
+
title: ln[e],
|
|
3413
|
+
"aria-label": ln[e],
|
|
3041
3414
|
"aria-pressed": e === m,
|
|
3042
3415
|
onClick: a ? void 0 : () => l(e),
|
|
3043
3416
|
style: {
|
|
@@ -3048,15 +3421,15 @@ function Xt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3048
3421
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3049
3422
|
opacity: e === m ? 1 : .7
|
|
3050
3423
|
},
|
|
3051
|
-
children:
|
|
3424
|
+
children: cn(e)
|
|
3052
3425
|
}, e))
|
|
3053
3426
|
});
|
|
3054
3427
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3055
3428
|
return /* @__PURE__ */ u("button", {
|
|
3056
3429
|
ref: f,
|
|
3057
3430
|
type: "button",
|
|
3058
|
-
title:
|
|
3059
|
-
"aria-label": `Theme: ${
|
|
3431
|
+
title: ln[m],
|
|
3432
|
+
"aria-label": `Theme: ${ln[m]} — switch to ${ln[g]}`,
|
|
3060
3433
|
onClick: a ? void 0 : () => l(g),
|
|
3061
3434
|
style: {
|
|
3062
3435
|
...h,
|
|
@@ -3065,10 +3438,10 @@ function Xt({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3065
3438
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3066
3439
|
...A(n)
|
|
3067
3440
|
},
|
|
3068
|
-
children:
|
|
3441
|
+
children: cn(m)
|
|
3069
3442
|
});
|
|
3070
3443
|
}
|
|
3071
|
-
function
|
|
3444
|
+
function dn(e) {
|
|
3072
3445
|
let t = e?.parentElement;
|
|
3073
3446
|
for (; t && t !== document.body;) {
|
|
3074
3447
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3077,7 +3450,7 @@ function Zt(e) {
|
|
|
3077
3450
|
}
|
|
3078
3451
|
return window;
|
|
3079
3452
|
}
|
|
3080
|
-
var
|
|
3453
|
+
var fn = (e) => e === window ? window.scrollY : e.scrollTop, pn = {
|
|
3081
3454
|
"bottom-right": (e) => ({
|
|
3082
3455
|
right: e,
|
|
3083
3456
|
bottom: e
|
|
@@ -3092,7 +3465,7 @@ var Qt = (e) => e === window ? window.scrollY : e.scrollTop, $t = {
|
|
|
3092
3465
|
transform: "translateX(-50%)"
|
|
3093
3466
|
})
|
|
3094
3467
|
};
|
|
3095
|
-
function
|
|
3468
|
+
function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
|
|
3096
3469
|
let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
|
|
3097
3470
|
b(e), typeof p == "function" && p(e);
|
|
3098
3471
|
};
|
|
@@ -3103,8 +3476,8 @@ function en({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3103
3476
|
}
|
|
3104
3477
|
if (!y) return;
|
|
3105
3478
|
let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
|
|
3106
|
-
let t =
|
|
3107
|
-
v(n ||
|
|
3479
|
+
let t = dn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
3480
|
+
v(n || fn(t) > e);
|
|
3108
3481
|
};
|
|
3109
3482
|
return t(), document.addEventListener("scroll", t, {
|
|
3110
3483
|
capture: !0,
|
|
@@ -3118,7 +3491,7 @@ function en({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3118
3491
|
]);
|
|
3119
3492
|
let S = () => {
|
|
3120
3493
|
if (m) return;
|
|
3121
|
-
let e =
|
|
3494
|
+
let e = dn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3122
3495
|
e === window ? window.scrollTo({
|
|
3123
3496
|
top: 0,
|
|
3124
3497
|
behavior: n
|
|
@@ -3126,7 +3499,7 @@ function en({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3126
3499
|
top: 0,
|
|
3127
3500
|
behavior: n
|
|
3128
3501
|
});
|
|
3129
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
3502
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = pn[n] ? n : "bottom-right", D = h ? {
|
|
3130
3503
|
position: "fixed",
|
|
3131
3504
|
zIndex: 5,
|
|
3132
3505
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3139,7 +3512,7 @@ function en({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3139
3512
|
} : {
|
|
3140
3513
|
position: "fixed",
|
|
3141
3514
|
zIndex: 2147482e3,
|
|
3142
|
-
|
|
3515
|
+
...pn[E](C)
|
|
3143
3516
|
};
|
|
3144
3517
|
return /* @__PURE__ */ d("button", {
|
|
3145
3518
|
ref: x,
|
|
@@ -3190,7 +3563,7 @@ function en({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3190
3563
|
}), w ? /* @__PURE__ */ u("span", { children: T }) : null]
|
|
3191
3564
|
});
|
|
3192
3565
|
}
|
|
3193
|
-
var
|
|
3566
|
+
var hn = {
|
|
3194
3567
|
facebook: {
|
|
3195
3568
|
label: "Facebook",
|
|
3196
3569
|
color: "#1877f2",
|
|
@@ -3257,8 +3630,8 @@ var tn = {
|
|
|
3257
3630
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
|
|
3258
3631
|
}
|
|
3259
3632
|
};
|
|
3260
|
-
function
|
|
3261
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
3633
|
+
function gn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
3634
|
+
let l = Array.isArray(e) ? e.filter((e) => e && hn[e.network]) : [];
|
|
3262
3635
|
if (!l.length) return null;
|
|
3263
3636
|
let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
|
|
3264
3637
|
return /* @__PURE__ */ u("div", {
|
|
@@ -3271,7 +3644,7 @@ function nn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3271
3644
|
...A(o)
|
|
3272
3645
|
},
|
|
3273
3646
|
children: l.map((e, r) => {
|
|
3274
|
-
let i =
|
|
3647
|
+
let i = hn[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
|
|
3275
3648
|
return /* @__PURE__ */ u("a", {
|
|
3276
3649
|
href: e.url || "#",
|
|
3277
3650
|
onClick: h,
|
|
@@ -3305,7 +3678,7 @@ function nn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3305
3678
|
})
|
|
3306
3679
|
});
|
|
3307
3680
|
}
|
|
3308
|
-
function
|
|
3681
|
+
function _n({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3309
3682
|
if (!t.length) return null;
|
|
3310
3683
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
3311
3684
|
width: 32,
|
|
@@ -3383,7 +3756,7 @@ function rn({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3383
3756
|
})
|
|
3384
3757
|
});
|
|
3385
3758
|
}
|
|
3386
|
-
var
|
|
3759
|
+
var vn = {
|
|
3387
3760
|
small: {
|
|
3388
3761
|
w: 132,
|
|
3389
3762
|
h: 46,
|
|
@@ -3405,10 +3778,10 @@ var an = {
|
|
|
3405
3778
|
title: 12.5,
|
|
3406
3779
|
avatar: 46
|
|
3407
3780
|
}
|
|
3408
|
-
},
|
|
3409
|
-
|
|
3410
|
-
function
|
|
3411
|
-
let r =
|
|
3781
|
+
}, yn = (e) => vn[e] ?? vn.medium;
|
|
3782
|
+
vn.medium.w, vn.medium.h;
|
|
3783
|
+
function bn(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
3784
|
+
let r = yn(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
|
|
3412
3785
|
for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
|
|
3413
3786
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
3414
3787
|
if (t.has(e.id)) return 0;
|
|
@@ -3460,19 +3833,19 @@ function sn(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
3460
3833
|
horizontal: n
|
|
3461
3834
|
};
|
|
3462
3835
|
}
|
|
3463
|
-
var
|
|
3836
|
+
var xn = (e, t) => {
|
|
3464
3837
|
let n = String(e ?? "");
|
|
3465
3838
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3466
|
-
},
|
|
3839
|
+
}, Sn = (e) => {
|
|
3467
3840
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3468
3841
|
if (!t) return "#ffffff";
|
|
3469
3842
|
let n = t[1];
|
|
3470
3843
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3471
3844
|
let r = parseInt(n, 16);
|
|
3472
3845
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3473
|
-
},
|
|
3474
|
-
function
|
|
3475
|
-
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 ? "" :
|
|
3846
|
+
}, Cn = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
3847
|
+
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 ? "" : X(e);
|
|
3476
3849
|
return n.map((e) => {
|
|
3477
3850
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3478
3851
|
return {
|
|
@@ -3486,11 +3859,11 @@ function dn(e, t = {}) {
|
|
|
3486
3859
|
};
|
|
3487
3860
|
});
|
|
3488
3861
|
}
|
|
3489
|
-
var
|
|
3862
|
+
var Tn = {
|
|
3490
3863
|
size: 36,
|
|
3491
3864
|
pad: 10
|
|
3492
3865
|
};
|
|
3493
|
-
function
|
|
3866
|
+
function En({ node: e, onClose: t }) {
|
|
3494
3867
|
return i(() => {
|
|
3495
3868
|
let e = (e) => e.key === "Escape" && t();
|
|
3496
3869
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -3611,8 +3984,8 @@ function pn({ node: e, onClose: t }) {
|
|
|
3611
3984
|
})
|
|
3612
3985
|
});
|
|
3613
3986
|
}
|
|
3614
|
-
function
|
|
3615
|
-
let b = a(), [x, S] = c(null), { tenant: C, apiUrl: w } = r(
|
|
3987
|
+
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(Y), T = r(ye)?.[t], [E, D] = c(null);
|
|
3616
3989
|
i(() => {
|
|
3617
3990
|
if (!t || T) return;
|
|
3618
3991
|
let e = !0;
|
|
@@ -3628,14 +4001,14 @@ function mn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3628
4001
|
w,
|
|
3629
4002
|
T
|
|
3630
4003
|
]);
|
|
3631
|
-
let O = t ?
|
|
4004
|
+
let O = t ? wn(T ?? E ?? [], {
|
|
3632
4005
|
nameField: n,
|
|
3633
4006
|
titleField: o,
|
|
3634
4007
|
photoField: s,
|
|
3635
4008
|
parentField: f,
|
|
3636
4009
|
cvField: p,
|
|
3637
4010
|
hrefField: m
|
|
3638
|
-
}) : e, k =
|
|
4011
|
+
}) : e, k = yn(h), { boxes: j, links: M, width: N, height: P } = bn(O, {
|
|
3639
4012
|
size: h,
|
|
3640
4013
|
horizontal: g
|
|
3641
4014
|
});
|
|
@@ -3681,7 +4054,7 @@ function mn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3681
4054
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
3682
4055
|
strokeWidth: "1.5"
|
|
3683
4056
|
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
3684
|
-
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ?
|
|
4057
|
+
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Sn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Sn(e.color2) : s, f = y && (Cn(e) || e.href), p = () => Cn(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Tn.pad + k.avatar + 8 : t + k.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((k.w - k.avatar - 26) / 7) : Math.floor(k.w / 7.6), _ = k.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
3685
4058
|
return /* @__PURE__ */ d("g", {
|
|
3686
4059
|
onClick: f ? p : void 0,
|
|
3687
4060
|
style: f ? { cursor: "pointer" } : void 0,
|
|
@@ -3745,13 +4118,13 @@ function mn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3745
4118
|
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
3746
4119
|
id: `${b}-${e.id}`,
|
|
3747
4120
|
children: /* @__PURE__ */ u("circle", {
|
|
3748
|
-
cx: t +
|
|
4121
|
+
cx: t + Tn.pad + k.avatar / 2,
|
|
3749
4122
|
cy: n + k.h / 2,
|
|
3750
4123
|
r: k.avatar / 2
|
|
3751
4124
|
})
|
|
3752
4125
|
}), /* @__PURE__ */ u("image", {
|
|
3753
4126
|
href: e.photo,
|
|
3754
|
-
x: t +
|
|
4127
|
+
x: t + Tn.pad,
|
|
3755
4128
|
y: n + (k.h - k.avatar) / 2,
|
|
3756
4129
|
width: k.avatar,
|
|
3757
4130
|
height: k.avatar,
|
|
@@ -3765,7 +4138,7 @@ function mn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3765
4138
|
fontSize: k.title,
|
|
3766
4139
|
fontWeight: "600",
|
|
3767
4140
|
fill: s,
|
|
3768
|
-
children:
|
|
4141
|
+
children: xn(e.title, g + 4)
|
|
3769
4142
|
}), e.name && /* @__PURE__ */ u("text", {
|
|
3770
4143
|
x: m,
|
|
3771
4144
|
y: n + _ + _ / 2 + k.name * .35,
|
|
@@ -3773,7 +4146,7 @@ function mn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3773
4146
|
fontSize: k.name,
|
|
3774
4147
|
fontWeight: "600",
|
|
3775
4148
|
fill: c,
|
|
3776
|
-
children:
|
|
4149
|
+
children: xn(e.name, g)
|
|
3777
4150
|
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
3778
4151
|
x: m,
|
|
3779
4152
|
y: n + (v[1] ? k.h * .43 : k.h * .57),
|
|
@@ -3781,7 +4154,7 @@ function mn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3781
4154
|
fontSize: k.name,
|
|
3782
4155
|
fontWeight: "600",
|
|
3783
4156
|
fill: s,
|
|
3784
|
-
children:
|
|
4157
|
+
children: xn(v[0], g)
|
|
3785
4158
|
}), v[1] && /* @__PURE__ */ u("text", {
|
|
3786
4159
|
x: m,
|
|
3787
4160
|
y: n + k.h * .73,
|
|
@@ -3789,84 +4162,257 @@ function mn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
3789
4162
|
fontSize: k.title,
|
|
3790
4163
|
opacity: "0.7",
|
|
3791
4164
|
fill: s,
|
|
3792
|
-
children:
|
|
4165
|
+
children: xn(v[1], g + 4)
|
|
3793
4166
|
})] })
|
|
3794
4167
|
]
|
|
3795
4168
|
}, e.id);
|
|
3796
4169
|
})]
|
|
3797
|
-
}), x && /* @__PURE__ */ u(
|
|
4170
|
+
}), x && /* @__PURE__ */ u(En, {
|
|
3798
4171
|
node: x,
|
|
3799
4172
|
onClose: () => S(null)
|
|
3800
4173
|
})]
|
|
3801
4174
|
});
|
|
3802
4175
|
}
|
|
3803
|
-
function
|
|
3804
|
-
let
|
|
4176
|
+
function On({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4177
|
+
let [a, o] = c(!1), l = s(null);
|
|
4178
|
+
return i(() => {
|
|
4179
|
+
if (!a || !l.current) return;
|
|
4180
|
+
let e = l.current, t = document.createRange();
|
|
4181
|
+
e.focus(), t.selectNodeContents(e), t.collapse(!1);
|
|
4182
|
+
let n = window.getSelection();
|
|
4183
|
+
n.removeAllRanges(), n.addRange(t);
|
|
4184
|
+
}, [a]), /* @__PURE__ */ u("span", {
|
|
4185
|
+
ref: l,
|
|
4186
|
+
contentEditable: a,
|
|
4187
|
+
suppressContentEditableWarning: !0,
|
|
4188
|
+
title: a ? void 0 : r || "Double-click to edit",
|
|
4189
|
+
onDoubleClick: () => o(!0),
|
|
4190
|
+
onBlur: a ? (e) => {
|
|
4191
|
+
o(!1), t(e.currentTarget.textContent);
|
|
4192
|
+
} : void 0,
|
|
4193
|
+
onKeyDown: a ? (t) => {
|
|
4194
|
+
t.stopPropagation(), t.key === "Escape" && (t.currentTarget.textContent = e ?? "", t.currentTarget.blur()), t.key === "Enter" && (t.preventDefault(), t.currentTarget.blur());
|
|
4195
|
+
} : void 0,
|
|
4196
|
+
style: {
|
|
4197
|
+
display: "block",
|
|
4198
|
+
minHeight: "1em",
|
|
4199
|
+
outline: "none",
|
|
4200
|
+
cursor: a ? "text" : "inherit",
|
|
4201
|
+
...n
|
|
4202
|
+
},
|
|
4203
|
+
children: e ?? ""
|
|
4204
|
+
});
|
|
4205
|
+
}
|
|
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
|
+
function Mn({ 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, style: T, nodeRef: E, edit: D }) {
|
|
4208
|
+
let O = s(null), k = s(null), [j, M] = c(null), [N, P] = c(null), F = (e, t) => () => M({
|
|
4209
|
+
r: e,
|
|
4210
|
+
c: t
|
|
4211
|
+
});
|
|
4212
|
+
i(() => {
|
|
4213
|
+
if (!D) return;
|
|
4214
|
+
let e = k.current, t = j && e?.querySelector(`[data-cell="${j.r}-${j.c}"]`);
|
|
4215
|
+
if (!t) {
|
|
4216
|
+
N && P(null);
|
|
4217
|
+
return;
|
|
4218
|
+
}
|
|
4219
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4220
|
+
top: r.bottom - n.top + 4,
|
|
4221
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - kn))
|
|
4222
|
+
};
|
|
4223
|
+
(N?.top !== i.top || N?.left !== i.left) && P(i);
|
|
4224
|
+
}), i(() => {
|
|
4225
|
+
if (!D || !j) return;
|
|
4226
|
+
let e = (e) => {
|
|
4227
|
+
k.current?.contains(e.target) || M(null);
|
|
4228
|
+
};
|
|
4229
|
+
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4230
|
+
}, [D, j]);
|
|
4231
|
+
let { tenant: I, apiUrl: L } = r(Y), R = r(ye), z = R?.[h], B = C ? be(R) : 1, [V, ee] = c(null);
|
|
3805
4232
|
if (i(() => {
|
|
3806
|
-
if (!
|
|
3807
|
-
let e = !0, t = Math.max(1, Number(
|
|
3808
|
-
return fetch(
|
|
4233
|
+
if (!h || z) return;
|
|
4234
|
+
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(B - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${L}/data/${encodeURIComponent(h.slice(4))}` : `${L}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4235
|
+
return fetch(r, { headers: I ? { "x-tenant": I } : {} }).then((e) => e.json()).then((t) => {
|
|
3809
4236
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
3810
|
-
return e &&
|
|
3811
|
-
}).catch(() => e &&
|
|
4237
|
+
return e && ee(n);
|
|
4238
|
+
}).catch(() => e && ee([])), () => {
|
|
3812
4239
|
e = !1;
|
|
3813
4240
|
};
|
|
3814
4241
|
}, [
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
4242
|
+
h,
|
|
4243
|
+
I,
|
|
4244
|
+
L,
|
|
4245
|
+
z,
|
|
4246
|
+
C,
|
|
4247
|
+
B,
|
|
4248
|
+
g
|
|
3822
4249
|
]), !e.length) return null;
|
|
3823
|
-
let
|
|
3824
|
-
|
|
3825
|
-
|
|
4250
|
+
let H = Math.max(1, Number(g) || 10), te = h ? C ? z || h.startsWith("api:") ? (z ?? V ?? []).slice((B - 1) * H, B * H) : (V ?? []).slice(0, H) : (z ?? V ?? []).slice(0, H) : null, U = te ? te.map((t) => e.map((e) => X(Te(t?.data, e.field)))) : t, ne = !!h && !(h && !z && V === null) && U.length === 0, re = b ? {
|
|
4251
|
+
y: 6,
|
|
4252
|
+
x: 10
|
|
4253
|
+
} : {
|
|
4254
|
+
y: 10,
|
|
4255
|
+
x: 14
|
|
4256
|
+
}, ie = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : re.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : re.x}px`, ae = "1px solid rgba(148, 163, 184, 0.35)", W = y ? { border: ae } : { borderBottom: ae }, G = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), oe = !!D && D.rows !== !1, se = (t) => (r) => {
|
|
4257
|
+
if (!D?.resize || t >= e.length - 1) return;
|
|
4258
|
+
r.preventDefault(), r.stopPropagation();
|
|
4259
|
+
let i = O.current, a = i ? i.clientWidth : 0;
|
|
4260
|
+
if (!a) return;
|
|
4261
|
+
let o = G ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4262
|
+
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, D.resize(i);
|
|
4264
|
+
}, u = () => {
|
|
4265
|
+
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
|
|
4266
|
+
};
|
|
4267
|
+
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4268
|
+
}, ce = /* @__PURE__ */ new Set();
|
|
4269
|
+
p && U.forEach((t, n) => e.forEach((e, t) => {
|
|
4270
|
+
let r = p[jn(a[n], o[t])];
|
|
4271
|
+
if (!r) return;
|
|
4272
|
+
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) && ce.add(`${n + e},${t + r}`);
|
|
4274
|
+
}));
|
|
4275
|
+
let le = (e) => (t) => {
|
|
4276
|
+
if (!D?.resizeRow) return;
|
|
4277
|
+
t.preventDefault(), t.stopPropagation();
|
|
4278
|
+
let n = t.currentTarget.closest("tr");
|
|
4279
|
+
if (!n) return;
|
|
4280
|
+
let r = t.clientY, i = n.offsetHeight, a = (t) => D.resizeRow(e, Math.max(20, Math.round(i + (t.clientY - r)))), o = () => {
|
|
4281
|
+
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4282
|
+
};
|
|
4283
|
+
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4284
|
+
}, K = (e, t, n, r) => r ? null : /* @__PURE__ */ u("span", {
|
|
4285
|
+
className: "wb-tedit-btn",
|
|
4286
|
+
role: "button",
|
|
4287
|
+
"data-hint": t,
|
|
4288
|
+
onMouseDown: (e) => {
|
|
4289
|
+
e.preventDefault(), e.stopPropagation();
|
|
4290
|
+
},
|
|
4291
|
+
onClick: n,
|
|
4292
|
+
children: e
|
|
4293
|
+
}, t), q = j && j.r < U.length && j.c < e.length ? j : null, J = (e, t) => D?.labels?.[e] ?? t, ue = q ? p?.[jn(a[q.r], o[q.c])] : null, de = Math.max(1, Number(ue?.c) || 1), fe = Math.max(1, Number(ue?.r) || 1);
|
|
4294
|
+
return /* @__PURE__ */ d("div", {
|
|
4295
|
+
ref: (e) => {
|
|
4296
|
+
k.current = e, typeof E == "function" && E(e);
|
|
4297
|
+
},
|
|
3826
4298
|
style: {
|
|
3827
4299
|
width: "100%",
|
|
3828
|
-
|
|
3829
|
-
...A(
|
|
4300
|
+
...D ? { position: "relative" } : null,
|
|
4301
|
+
...A(T)
|
|
3830
4302
|
},
|
|
3831
|
-
children:
|
|
3832
|
-
style:
|
|
3833
|
-
|
|
3834
|
-
|
|
3835
|
-
fontSize: 14,
|
|
3836
|
-
...s ? { border: O } : {}
|
|
3837
|
-
},
|
|
3838
|
-
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("th", {
|
|
4303
|
+
children: [
|
|
4304
|
+
D && /* @__PURE__ */ u("style", { children: An }),
|
|
4305
|
+
D && q && N && /* @__PURE__ */ d("div", {
|
|
4306
|
+
className: "wb-tedit-bar",
|
|
3839
4307
|
style: {
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
padding: D,
|
|
3843
|
-
background: "rgba(148, 163, 184, 0.12)",
|
|
3844
|
-
...k
|
|
4308
|
+
top: N.top,
|
|
4309
|
+
left: N.left
|
|
3845
4310
|
},
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
4311
|
+
onMouseDown: (e) => e.stopPropagation(),
|
|
4312
|
+
children: [
|
|
4313
|
+
/* @__PURE__ */ u("span", {
|
|
4314
|
+
className: "wb-tedit-at",
|
|
4315
|
+
children: `R${q.r + 1}·C${q.c + 1}`
|
|
4316
|
+
}),
|
|
4317
|
+
K("+↑", J("rowAbove", "Insert row above"), () => D.addRow(q.r - 1)),
|
|
4318
|
+
K("+↓", J("rowBelow", "Insert row below"), () => D.addRow(q.r)),
|
|
4319
|
+
K("↑", J("rowUp", "Move row up"), () => D.moveRow(q.r, -1), q.r === 0),
|
|
4320
|
+
K("↓", J("rowDown", "Move row down"), () => D.moveRow(q.r, 1), q.r >= U.length - 1),
|
|
4321
|
+
K("✕ row", J("rowDelete", "Delete row"), () => D.dropRow(q.r), U.length <= 1),
|
|
4322
|
+
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4323
|
+
K("+←", J("colLeft", "Insert column left"), () => D.addColumn(q.c - 1)),
|
|
4324
|
+
K("+→", J("colRight", "Insert column right"), () => D.addColumn(q.c)),
|
|
4325
|
+
K("←", J("colMoveLeft", "Move column left"), () => D.moveColumn(q.c, -1), q.c === 0),
|
|
4326
|
+
K("→", J("colMoveRight", "Move column right"), () => D.moveColumn(q.c, 1), q.c >= e.length - 1),
|
|
4327
|
+
K("✕ col", J("colDelete", "Delete column"), () => D.dropColumn(q.c), e.length <= 1),
|
|
4328
|
+
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4329
|
+
K("↔", J("mergeRight", "Merge with the cell on the right"), () => D.merge(q.r, q.c, "right"), q.c + de >= e.length),
|
|
4330
|
+
K("↕", J("mergeDown", "Merge with the cell below"), () => D.merge(q.r, q.c, "down"), q.r + fe >= U.length),
|
|
4331
|
+
K("⤫", J("split", "Split this cell"), () => D.split(q.r, q.c), de === 1 && fe === 1)
|
|
4332
|
+
]
|
|
4333
|
+
}),
|
|
4334
|
+
/* @__PURE__ */ u("div", {
|
|
3849
4335
|
style: {
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
opacity: .6,
|
|
3853
|
-
...k
|
|
4336
|
+
width: "100%",
|
|
4337
|
+
overflowX: "auto"
|
|
3854
4338
|
},
|
|
3855
|
-
children:
|
|
3856
|
-
|
|
3857
|
-
style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
3858
|
-
children: e.map((e, n) => /* @__PURE__ */ u("td", {
|
|
4339
|
+
children: /* @__PURE__ */ d("table", {
|
|
4340
|
+
ref: O,
|
|
3859
4341
|
style: {
|
|
3860
|
-
|
|
3861
|
-
|
|
4342
|
+
width: "100%",
|
|
4343
|
+
borderCollapse: "collapse",
|
|
4344
|
+
fontSize: 14,
|
|
4345
|
+
...G ? { tableLayout: "fixed" } : null,
|
|
4346
|
+
...y ? { border: ae } : {}
|
|
3862
4347
|
},
|
|
3863
|
-
children:
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
4348
|
+
children: [
|
|
4349
|
+
G && /* @__PURE__ */ u("colgroup", { children: n.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
|
|
4350
|
+
_ === !1 ? null : /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((t, n) => /* @__PURE__ */ u("th", {
|
|
4351
|
+
className: D ? "wb-tedit-head" : void 0,
|
|
4352
|
+
style: {
|
|
4353
|
+
textAlign: "left",
|
|
4354
|
+
fontWeight: 600,
|
|
4355
|
+
padding: ie,
|
|
4356
|
+
background: "rgba(148, 163, 184, 0.12)",
|
|
4357
|
+
...D ? { position: "relative" } : null,
|
|
4358
|
+
...W
|
|
4359
|
+
},
|
|
4360
|
+
children: D ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(On, {
|
|
4361
|
+
value: t.label ?? t,
|
|
4362
|
+
onCommit: (e) => D.header(n, e),
|
|
4363
|
+
hint: J("editCell", "Double-click to edit"),
|
|
4364
|
+
style: { paddingRight: 6 }
|
|
4365
|
+
}), n < e.length - 1 && /* @__PURE__ */ u("span", {
|
|
4366
|
+
className: "wb-tedit-grip",
|
|
4367
|
+
title: J("colWidth", "Drag to resize the column"),
|
|
4368
|
+
onPointerDown: se(n)
|
|
4369
|
+
})] }) : t.label ?? t
|
|
4370
|
+
}, n)) }) }),
|
|
4371
|
+
/* @__PURE__ */ d("tbody", { children: [ne && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
4372
|
+
colSpan: e.length,
|
|
4373
|
+
style: {
|
|
4374
|
+
padding: ie,
|
|
4375
|
+
textAlign: "center",
|
|
4376
|
+
opacity: .6,
|
|
4377
|
+
...W
|
|
4378
|
+
},
|
|
4379
|
+
children: w || "No data yet"
|
|
4380
|
+
}) }), U.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
4381
|
+
className: D ? "wb-tedit-row" : void 0,
|
|
4382
|
+
style: {
|
|
4383
|
+
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
4384
|
+
...Number.isFinite(Number(f?.[n])) && f[n] > 0 ? { height: f[n] } : null
|
|
4385
|
+
},
|
|
4386
|
+
children: e.map((e, r) => {
|
|
4387
|
+
if (ce.has(`${n},${r}`)) return null;
|
|
4388
|
+
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
|
+
return /* @__PURE__ */ d("td", {
|
|
4390
|
+
className: D ? `wb-tedit-cell${j?.r === n && j?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4391
|
+
onMouseDownCapture: oe ? F(n, r) : void 0,
|
|
4392
|
+
"data-cell": D ? `${n}-${r}` : void 0,
|
|
4393
|
+
colSpan: l > 1 ? l : void 0,
|
|
4394
|
+
rowSpan: f > 1 ? f : void 0,
|
|
4395
|
+
style: {
|
|
4396
|
+
padding: ie,
|
|
4397
|
+
...D ? { position: "relative" } : null,
|
|
4398
|
+
...W
|
|
4399
|
+
},
|
|
4400
|
+
children: [s ?? t?.[r] ?? "", D && oe && /* @__PURE__ */ u("span", {
|
|
4401
|
+
className: "wb-tedit-rowgrip",
|
|
4402
|
+
title: J("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4403
|
+
onPointerDown: le(n),
|
|
4404
|
+
onDoubleClick: () => D.resizeRow(n, 0)
|
|
4405
|
+
})]
|
|
4406
|
+
}, r);
|
|
4407
|
+
})
|
|
4408
|
+
}, a[n] ?? n))] })
|
|
4409
|
+
]
|
|
4410
|
+
})
|
|
4411
|
+
})
|
|
4412
|
+
]
|
|
3867
4413
|
});
|
|
3868
4414
|
}
|
|
3869
|
-
var
|
|
4415
|
+
var Nn = {
|
|
3870
4416
|
small: {
|
|
3871
4417
|
cell: 62,
|
|
3872
4418
|
font: 10.5,
|
|
@@ -3891,9 +4437,9 @@ var gn = {
|
|
|
3891
4437
|
pad: 8,
|
|
3892
4438
|
gap: 4
|
|
3893
4439
|
}
|
|
3894
|
-
},
|
|
3895
|
-
function
|
|
3896
|
-
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 ? "" :
|
|
4440
|
+
}, Pn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Fn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), In = 366;
|
|
4441
|
+
function Ln(e, t = {}) {
|
|
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 ? "" : X(e), a = (e) => {
|
|
3897
4443
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
3898
4444
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
3899
4445
|
};
|
|
@@ -3909,7 +4455,7 @@ function bn(e, t = {}) {
|
|
|
3909
4455
|
} : null;
|
|
3910
4456
|
}).filter(Boolean);
|
|
3911
4457
|
}
|
|
3912
|
-
function
|
|
4458
|
+
function Rn(e) {
|
|
3913
4459
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
3914
4460
|
let n = e?.start ? new Date(e.start) : null;
|
|
3915
4461
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -3924,20 +4470,20 @@ function xn(e) {
|
|
|
3924
4470
|
};
|
|
3925
4471
|
}).filter(Boolean);
|
|
3926
4472
|
}
|
|
3927
|
-
function
|
|
4473
|
+
function zn(e) {
|
|
3928
4474
|
let t = /* @__PURE__ */ new Map();
|
|
3929
4475
|
for (let n of e) {
|
|
3930
|
-
let e =
|
|
4476
|
+
let e = Fn(n.start), r = n.end ? Fn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), In);
|
|
3931
4477
|
for (let r = 0; r <= i; r += 1) {
|
|
3932
|
-
let i =
|
|
4478
|
+
let i = Pn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
3933
4479
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
3934
4480
|
}
|
|
3935
4481
|
}
|
|
3936
4482
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
3937
4483
|
return t;
|
|
3938
4484
|
}
|
|
3939
|
-
function
|
|
3940
|
-
let { tenant: T, apiUrl: E, locale: D } = r(
|
|
4485
|
+
function Bn({ 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 }) {
|
|
4486
|
+
let { tenant: T, apiUrl: E, locale: D } = r(Y), O = r(ye)?.[t], [k, j] = c(null), [M, N] = c(() => {
|
|
3941
4487
|
let e = /* @__PURE__ */ new Date();
|
|
3942
4488
|
return {
|
|
3943
4489
|
year: e.getFullYear(),
|
|
@@ -3959,13 +4505,13 @@ function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
3959
4505
|
E,
|
|
3960
4506
|
O
|
|
3961
4507
|
]);
|
|
3962
|
-
let P =
|
|
4508
|
+
let P = Nn[m] ?? Nn.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 ? Ln(O ?? k ?? [], {
|
|
3963
4509
|
titleField: n,
|
|
3964
4510
|
startField: a,
|
|
3965
4511
|
endField: o,
|
|
3966
4512
|
hrefField: s,
|
|
3967
4513
|
colorField: f
|
|
3968
|
-
}) :
|
|
4514
|
+
}) : Rn(e), B = zn(z), V = D || void 0, ee = (e, t) => {
|
|
3969
4515
|
let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
|
|
3970
4516
|
width: 6,
|
|
3971
4517
|
height: 6,
|
|
@@ -4003,7 +4549,7 @@ function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4003
4549
|
title: e.title,
|
|
4004
4550
|
children: n
|
|
4005
4551
|
}, e.key);
|
|
4006
|
-
}, H = new Intl.DateTimeFormat(
|
|
4552
|
+
}, H = new Intl.DateTimeFormat(V, {
|
|
4007
4553
|
month: "long",
|
|
4008
4554
|
year: "numeric"
|
|
4009
4555
|
}).format(new Date(M.year, M.month, 1)), te = (e) => N((t) => {
|
|
@@ -4012,7 +4558,7 @@ function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4012
4558
|
year: n.getFullYear(),
|
|
4013
4559
|
month: n.getMonth()
|
|
4014
4560
|
};
|
|
4015
|
-
}),
|
|
4561
|
+
}), U = (e, t) => /* @__PURE__ */ u("button", {
|
|
4016
4562
|
type: "button",
|
|
4017
4563
|
"aria-label": e,
|
|
4018
4564
|
onClick: () => te(t),
|
|
@@ -4027,7 +4573,7 @@ function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4027
4573
|
padding: "4px 8px"
|
|
4028
4574
|
},
|
|
4029
4575
|
children: t < 0 ? "‹" : "›"
|
|
4030
|
-
}),
|
|
4576
|
+
}), ne = /* @__PURE__ */ d("div", {
|
|
4031
4577
|
style: {
|
|
4032
4578
|
display: "flex",
|
|
4033
4579
|
alignItems: "center",
|
|
@@ -4044,12 +4590,12 @@ function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4044
4590
|
},
|
|
4045
4591
|
children: H
|
|
4046
4592
|
}),
|
|
4047
|
-
|
|
4048
|
-
|
|
4593
|
+
U("Previous month", -1),
|
|
4594
|
+
U("Next month", 1)
|
|
4049
4595
|
]
|
|
4050
4596
|
});
|
|
4051
4597
|
if (p === "list") {
|
|
4052
|
-
let e = z.filter((e) => e.start.getFullYear() === M.year && e.start.getMonth() === M.month).sort((e, t) => e.start - t.start), t = new Intl.DateTimeFormat(
|
|
4598
|
+
let e = z.filter((e) => e.start.getFullYear() === M.year && e.start.getMonth() === M.month).sort((e, t) => e.start - t.start), t = new Intl.DateTimeFormat(V, {
|
|
4053
4599
|
day: "numeric",
|
|
4054
4600
|
month: "short",
|
|
4055
4601
|
hour: "2-digit",
|
|
@@ -4061,7 +4607,7 @@ function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4061
4607
|
width: "100%",
|
|
4062
4608
|
...A(S)
|
|
4063
4609
|
},
|
|
4064
|
-
children: [
|
|
4610
|
+
children: [ne, e.length ? /* @__PURE__ */ u("div", {
|
|
4065
4611
|
style: {
|
|
4066
4612
|
display: "flex",
|
|
4067
4613
|
flexDirection: "column",
|
|
@@ -4082,7 +4628,7 @@ function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4082
4628
|
minWidth: 96
|
|
4083
4629
|
},
|
|
4084
4630
|
children: t.format(e.start)
|
|
4085
|
-
}),
|
|
4631
|
+
}), ee(e, {
|
|
4086
4632
|
flexGrow: 1,
|
|
4087
4633
|
minWidth: 0
|
|
4088
4634
|
})]
|
|
@@ -4097,9 +4643,9 @@ function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4097
4643
|
})]
|
|
4098
4644
|
});
|
|
4099
4645
|
}
|
|
4100
|
-
let
|
|
4101
|
-
for (let e = 0; e <
|
|
4102
|
-
let t = e -
|
|
4646
|
+
let re = new Date(M.year, M.month, 1), ie = y === "sunday" ? 0 : 1, ae = (re.getDay() - ie + 7) % 7, W = new Date(M.year, M.month + 1, 0).getDate(), G = Math.ceil((ae + W) / 7), oe = Pn(/* @__PURE__ */ new Date()), se = new Intl.DateTimeFormat(V, { weekday: "short" }), ce = [];
|
|
4647
|
+
for (let e = 0; e < G * 7; e += 1) {
|
|
4648
|
+
let t = e - ae + 1, n = t >= 1 && t <= W, r = Pn(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === oe;
|
|
4103
4649
|
ce.push(/* @__PURE__ */ d("div", {
|
|
4104
4650
|
style: {
|
|
4105
4651
|
minHeight: P.cell,
|
|
@@ -4125,7 +4671,7 @@ function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4125
4671
|
},
|
|
4126
4672
|
children: n ? t : new Date(M.year, M.month, t).getDate()
|
|
4127
4673
|
}),
|
|
4128
|
-
a.map((e) =>
|
|
4674
|
+
a.map((e) => ee(e)),
|
|
4129
4675
|
i.length > a.length && /* @__PURE__ */ u("span", {
|
|
4130
4676
|
style: {
|
|
4131
4677
|
fontSize: P.font,
|
|
@@ -4143,7 +4689,7 @@ function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4143
4689
|
...A(S)
|
|
4144
4690
|
},
|
|
4145
4691
|
children: [
|
|
4146
|
-
|
|
4692
|
+
ne,
|
|
4147
4693
|
/* @__PURE__ */ d("div", {
|
|
4148
4694
|
style: {
|
|
4149
4695
|
display: "grid",
|
|
@@ -4157,20 +4703,20 @@ function Cn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4157
4703
|
textAlign: "center",
|
|
4158
4704
|
padding: `0 0 ${P.pad}px`
|
|
4159
4705
|
},
|
|
4160
|
-
children:
|
|
4706
|
+
children: se.format(new Date(2024, 0, 7 + ie + t))
|
|
4161
4707
|
}, `head-${t}`)), ce]
|
|
4162
4708
|
}),
|
|
4163
4709
|
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4164
4710
|
]
|
|
4165
4711
|
});
|
|
4166
4712
|
}
|
|
4167
|
-
var
|
|
4713
|
+
var Vn = {
|
|
4168
4714
|
small: 380,
|
|
4169
4715
|
medium: 560,
|
|
4170
4716
|
large: 820,
|
|
4171
4717
|
full: "100%"
|
|
4172
4718
|
};
|
|
4173
|
-
function
|
|
4719
|
+
function Hn({ 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 }) {
|
|
4174
4720
|
let [C, w] = c(!1), T = s(null);
|
|
4175
4721
|
i(() => {
|
|
4176
4722
|
if (S || !e) return;
|
|
@@ -4195,7 +4741,7 @@ function Tn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4195
4741
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
4196
4742
|
};
|
|
4197
4743
|
}, [S, C]);
|
|
4198
|
-
let E =
|
|
4744
|
+
let E = Vn[o] ?? Vn.medium, D = (e) => {
|
|
4199
4745
|
let t = {
|
|
4200
4746
|
padding: "9px 16px",
|
|
4201
4747
|
borderRadius: 6,
|
|
@@ -4364,10 +4910,10 @@ function Tn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4364
4910
|
})]
|
|
4365
4911
|
});
|
|
4366
4912
|
}
|
|
4367
|
-
var
|
|
4913
|
+
var Un = {
|
|
4368
4914
|
PageRoot: Fe,
|
|
4369
|
-
CalendarBlock:
|
|
4370
|
-
DialogBlock:
|
|
4915
|
+
CalendarBlock: Bn,
|
|
4916
|
+
DialogBlock: Hn,
|
|
4371
4917
|
Section: Ie,
|
|
4372
4918
|
Container: Le,
|
|
4373
4919
|
Heading: Re,
|
|
@@ -4378,21 +4924,23 @@ var En = {
|
|
|
4378
4924
|
Divider: ot,
|
|
4379
4925
|
SliderBlock: ft,
|
|
4380
4926
|
CanvasSlider: pt,
|
|
4381
|
-
TabsBlock:
|
|
4382
|
-
QuickStack:
|
|
4383
|
-
CollectionList:
|
|
4384
|
-
CollectionSearch:
|
|
4385
|
-
BreadcrumbsBlock:
|
|
4386
|
-
PaginationBlock:
|
|
4387
|
-
StepperBlock:
|
|
4388
|
-
SocialLinksBlock:
|
|
4389
|
-
ThemeModeBlock:
|
|
4390
|
-
ScrollTopBlock:
|
|
4391
|
-
OrgChartBlock:
|
|
4392
|
-
TableBlock:
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4927
|
+
TabsBlock: Ot,
|
|
4928
|
+
QuickStack: en,
|
|
4929
|
+
CollectionList: tn,
|
|
4930
|
+
CollectionSearch: nn,
|
|
4931
|
+
BreadcrumbsBlock: rn,
|
|
4932
|
+
PaginationBlock: an,
|
|
4933
|
+
StepperBlock: _n,
|
|
4934
|
+
SocialLinksBlock: gn,
|
|
4935
|
+
ThemeModeBlock: un,
|
|
4936
|
+
ScrollTopBlock: mn,
|
|
4937
|
+
OrgChartBlock: Dn,
|
|
4938
|
+
TableBlock: Mn,
|
|
4939
|
+
IconBlock: xt,
|
|
4940
|
+
MapBlock: yt,
|
|
4941
|
+
MasonryBlock: Ct,
|
|
4942
|
+
AccordionBlock: kt,
|
|
4943
|
+
NavbarBlock: Dt,
|
|
4396
4944
|
ListBlock: Je,
|
|
4397
4945
|
TextSpan: Ve,
|
|
4398
4946
|
QuoteBlock: qe,
|
|
@@ -4403,43 +4951,43 @@ var En = {
|
|
|
4403
4951
|
YouTubeBlock: nt,
|
|
4404
4952
|
IframeBlock: rt,
|
|
4405
4953
|
EmbedBlock: it,
|
|
4406
|
-
FormBlock:
|
|
4407
|
-
FormLabel:
|
|
4408
|
-
FormInput:
|
|
4409
|
-
FormTextarea:
|
|
4410
|
-
FormCheckbox: (e) => /* @__PURE__ */ u(
|
|
4954
|
+
FormBlock: Ht,
|
|
4955
|
+
FormLabel: qt,
|
|
4956
|
+
FormInput: Jt,
|
|
4957
|
+
FormTextarea: Yt,
|
|
4958
|
+
FormCheckbox: (e) => /* @__PURE__ */ u(Xt, {
|
|
4411
4959
|
kind: "checkbox",
|
|
4412
4960
|
...e
|
|
4413
4961
|
}),
|
|
4414
|
-
FormRadio: (e) => /* @__PURE__ */ u(
|
|
4962
|
+
FormRadio: (e) => /* @__PURE__ */ u(Xt, {
|
|
4415
4963
|
kind: "radio",
|
|
4416
4964
|
...e
|
|
4417
4965
|
}),
|
|
4418
|
-
FormSelect:
|
|
4419
|
-
FormFile:
|
|
4420
|
-
FormRecaptcha:
|
|
4421
|
-
FormSubmit:
|
|
4422
|
-
},
|
|
4966
|
+
FormSelect: Zt,
|
|
4967
|
+
FormFile: Qt,
|
|
4968
|
+
FormRecaptcha: Kt,
|
|
4969
|
+
FormSubmit: $t
|
|
4970
|
+
}, Wn = {
|
|
4423
4971
|
id: "auth",
|
|
4424
4972
|
label: "Accounts",
|
|
4425
4973
|
category: "Apps",
|
|
4426
4974
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
4427
4975
|
ssr: "shell",
|
|
4428
4976
|
settings: ["site.authRedirect"]
|
|
4429
|
-
},
|
|
4977
|
+
}, Gn = t({
|
|
4430
4978
|
user: null,
|
|
4431
4979
|
status: "idle",
|
|
4432
4980
|
ensure: () => {},
|
|
4433
4981
|
refresh: () => {},
|
|
4434
4982
|
signOut: () => {}
|
|
4435
|
-
}),
|
|
4436
|
-
let e = r(
|
|
4983
|
+
}), Kn = () => {
|
|
4984
|
+
let e = r(Gn);
|
|
4437
4985
|
return i(() => {
|
|
4438
4986
|
e.ensure();
|
|
4439
4987
|
}, [e]), e;
|
|
4440
4988
|
};
|
|
4441
|
-
function
|
|
4442
|
-
let f = r(
|
|
4989
|
+
function qn({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
|
|
4990
|
+
let f = r(Y), 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}`, {
|
|
4443
4991
|
...t,
|
|
4444
4992
|
credentials: "include",
|
|
4445
4993
|
headers: {
|
|
@@ -4489,19 +5037,19 @@ function An({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
4489
5037
|
t,
|
|
4490
5038
|
x,
|
|
4491
5039
|
S
|
|
4492
|
-
]), /* @__PURE__ */ u(
|
|
5040
|
+
]), /* @__PURE__ */ u(Gn.Provider, {
|
|
4493
5041
|
value: w,
|
|
4494
5042
|
children: e
|
|
4495
5043
|
});
|
|
4496
5044
|
}
|
|
4497
|
-
function
|
|
4498
|
-
let { status: n } =
|
|
5045
|
+
function Jn({ when: e, children: t }) {
|
|
5046
|
+
let { status: n } = Kn();
|
|
4499
5047
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
4500
5048
|
}
|
|
4501
5049
|
//#endregion
|
|
4502
5050
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
4503
|
-
function
|
|
4504
|
-
let { tenant: h, apiUrl: g, settings: _ } = r(
|
|
5051
|
+
function Yn({ 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 }) {
|
|
5052
|
+
let { tenant: h, apiUrl: g, settings: _ } = r(Y), [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) => {
|
|
4505
5053
|
if (e.preventDefault(), f) return;
|
|
4506
5054
|
let n = new FormData(e.currentTarget);
|
|
4507
5055
|
C(!0), x("");
|
|
@@ -4549,20 +5097,20 @@ function Mn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
4549
5097
|
children: [
|
|
4550
5098
|
w ? /* @__PURE__ */ d("label", {
|
|
4551
5099
|
style: {
|
|
4552
|
-
...
|
|
5100
|
+
...jt,
|
|
4553
5101
|
display: "grid",
|
|
4554
5102
|
gap: 6
|
|
4555
5103
|
},
|
|
4556
5104
|
children: [a, /* @__PURE__ */ u("input", {
|
|
4557
5105
|
name: "name",
|
|
4558
5106
|
type: "text",
|
|
4559
|
-
style:
|
|
4560
|
-
|
|
5107
|
+
style: Mt,
|
|
5108
|
+
...Pt(f)
|
|
4561
5109
|
})]
|
|
4562
5110
|
}) : null,
|
|
4563
5111
|
/* @__PURE__ */ d("label", {
|
|
4564
5112
|
style: {
|
|
4565
|
-
...
|
|
5113
|
+
...jt,
|
|
4566
5114
|
display: "grid",
|
|
4567
5115
|
gap: 6
|
|
4568
5116
|
},
|
|
@@ -4570,13 +5118,13 @@ function Mn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
4570
5118
|
name: "email",
|
|
4571
5119
|
type: "email",
|
|
4572
5120
|
required: !f,
|
|
4573
|
-
style:
|
|
4574
|
-
|
|
5121
|
+
style: Mt,
|
|
5122
|
+
...Pt(f)
|
|
4575
5123
|
})]
|
|
4576
5124
|
}),
|
|
4577
5125
|
/* @__PURE__ */ d("label", {
|
|
4578
5126
|
style: {
|
|
4579
|
-
...
|
|
5127
|
+
...jt,
|
|
4580
5128
|
display: "grid",
|
|
4581
5129
|
gap: 6
|
|
4582
5130
|
},
|
|
@@ -4584,15 +5132,15 @@ function Mn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
4584
5132
|
name: "password",
|
|
4585
5133
|
type: "password",
|
|
4586
5134
|
required: !f,
|
|
4587
|
-
style:
|
|
4588
|
-
|
|
5135
|
+
style: Mt,
|
|
5136
|
+
...Pt(f)
|
|
4589
5137
|
})]
|
|
4590
5138
|
}),
|
|
4591
5139
|
/* @__PURE__ */ u("button", {
|
|
4592
5140
|
type: f ? "button" : "submit",
|
|
4593
5141
|
disabled: S || void 0,
|
|
4594
5142
|
style: {
|
|
4595
|
-
...
|
|
5143
|
+
...Ae,
|
|
4596
5144
|
border: 0,
|
|
4597
5145
|
padding: "10px 22px",
|
|
4598
5146
|
borderRadius: 8,
|
|
@@ -4624,8 +5172,8 @@ function Mn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
4624
5172
|
]
|
|
4625
5173
|
});
|
|
4626
5174
|
}
|
|
4627
|
-
function
|
|
4628
|
-
let { user: c, status: l, signOut: f } =
|
|
5175
|
+
function Xn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
5176
|
+
let { user: c, status: l, signOut: f } = Kn(), p = a ? s || "user" : l, m = a ? {
|
|
4629
5177
|
name: "Ada Lovelace",
|
|
4630
5178
|
email: "ada@example.com"
|
|
4631
5179
|
} : c;
|
|
@@ -4646,7 +5194,7 @@ function Nn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
4646
5194
|
children: [
|
|
4647
5195
|
/* @__PURE__ */ d("span", {
|
|
4648
5196
|
style: {
|
|
4649
|
-
...
|
|
5197
|
+
...jt,
|
|
4650
5198
|
fontWeight: 600
|
|
4651
5199
|
},
|
|
4652
5200
|
children: [
|
|
@@ -4657,7 +5205,7 @@ function Nn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
4657
5205
|
}),
|
|
4658
5206
|
n && m?.email ? /* @__PURE__ */ u("span", {
|
|
4659
5207
|
style: {
|
|
4660
|
-
...
|
|
5208
|
+
...jt,
|
|
4661
5209
|
opacity: .7
|
|
4662
5210
|
},
|
|
4663
5211
|
children: m.email
|
|
@@ -4666,14 +5214,14 @@ function Nn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
4666
5214
|
type: "button",
|
|
4667
5215
|
onClick: a ? void 0 : f,
|
|
4668
5216
|
style: {
|
|
4669
|
-
...
|
|
5217
|
+
...Ae,
|
|
4670
5218
|
border: 0,
|
|
4671
5219
|
padding: "8px 16px",
|
|
4672
5220
|
borderRadius: 8,
|
|
4673
5221
|
fontSize: 14,
|
|
4674
5222
|
cursor: a ? "default" : "pointer"
|
|
4675
5223
|
},
|
|
4676
|
-
|
|
5224
|
+
...Pt(a),
|
|
4677
5225
|
children: t
|
|
4678
5226
|
})
|
|
4679
5227
|
]
|
|
@@ -4690,40 +5238,40 @@ function Nn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
4690
5238
|
}
|
|
4691
5239
|
//#endregion
|
|
4692
5240
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
4693
|
-
var
|
|
5241
|
+
var Zn = {
|
|
4694
5242
|
id: "consent",
|
|
4695
5243
|
label: "Cookie consent",
|
|
4696
5244
|
category: "Apps",
|
|
4697
5245
|
keys: ["CookieConsent"],
|
|
4698
5246
|
ssr: "shell",
|
|
4699
5247
|
settings: []
|
|
4700
|
-
},
|
|
4701
|
-
function
|
|
5248
|
+
}, Qn = "webim.cookie_consent";
|
|
5249
|
+
function $n() {
|
|
4702
5250
|
try {
|
|
4703
|
-
let e = window.localStorage.getItem(
|
|
5251
|
+
let e = window.localStorage.getItem(Qn), t = e ? JSON.parse(e) : null;
|
|
4704
5252
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
4705
5253
|
} catch {
|
|
4706
5254
|
return "";
|
|
4707
5255
|
}
|
|
4708
5256
|
}
|
|
4709
|
-
function
|
|
5257
|
+
function er(e) {
|
|
4710
5258
|
try {
|
|
4711
5259
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
4712
5260
|
} catch {}
|
|
4713
5261
|
}
|
|
4714
|
-
function
|
|
5262
|
+
function tr(e) {
|
|
4715
5263
|
try {
|
|
4716
|
-
window.localStorage.setItem(
|
|
5264
|
+
window.localStorage.setItem(Qn, JSON.stringify({
|
|
4717
5265
|
choice: e,
|
|
4718
5266
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
4719
5267
|
}));
|
|
4720
5268
|
} catch {}
|
|
4721
|
-
|
|
5269
|
+
er(e);
|
|
4722
5270
|
try {
|
|
4723
5271
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
4724
5272
|
} catch {}
|
|
4725
5273
|
}
|
|
4726
|
-
var
|
|
5274
|
+
var nr = {
|
|
4727
5275
|
bottom: {
|
|
4728
5276
|
left: 0,
|
|
4729
5277
|
right: 0,
|
|
@@ -4745,18 +5293,18 @@ var zn = {
|
|
|
4745
5293
|
maxWidth: 400
|
|
4746
5294
|
}
|
|
4747
5295
|
};
|
|
4748
|
-
function
|
|
5296
|
+
function rr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
|
|
4749
5297
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
4750
5298
|
y(e), typeof m == "function" && m(e);
|
|
4751
5299
|
};
|
|
4752
5300
|
if (i(() => {
|
|
4753
5301
|
if (h) return;
|
|
4754
|
-
let e =
|
|
4755
|
-
e ?
|
|
5302
|
+
let e = $n();
|
|
5303
|
+
e ? er(e) : _(!0);
|
|
4756
5304
|
}, [h, v]), !g) return null;
|
|
4757
5305
|
let x = (e) => () => {
|
|
4758
|
-
h || (
|
|
4759
|
-
}, S =
|
|
5306
|
+
h || (tr(e), _(!1));
|
|
5307
|
+
}, S = nr[s] ?? nr.bottom, C = {
|
|
4760
5308
|
appearance: "none",
|
|
4761
5309
|
font: "inherit",
|
|
4762
5310
|
fontSize: 14,
|
|
@@ -4836,37 +5384,37 @@ function Bn({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
4836
5384
|
}
|
|
4837
5385
|
//#endregion
|
|
4838
5386
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
4839
|
-
var
|
|
5387
|
+
var ir = {
|
|
4840
5388
|
id: "language",
|
|
4841
5389
|
label: "Language",
|
|
4842
5390
|
category: "Apps",
|
|
4843
5391
|
keys: ["SiteLanguagePicker"],
|
|
4844
5392
|
ssr: "prefetch",
|
|
4845
5393
|
settings: ["locales"]
|
|
4846
|
-
},
|
|
5394
|
+
}, ar = {
|
|
4847
5395
|
id: "search",
|
|
4848
5396
|
label: "Search",
|
|
4849
5397
|
category: "Apps",
|
|
4850
5398
|
keys: ["SiteSearch"],
|
|
4851
5399
|
ssr: "prefetch",
|
|
4852
5400
|
settings: []
|
|
4853
|
-
},
|
|
4854
|
-
function
|
|
5401
|
+
}, or = 50, sr = 2e3;
|
|
5402
|
+
function cr() {
|
|
4855
5403
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
4856
5404
|
}
|
|
4857
|
-
function
|
|
5405
|
+
function lr(e, t) {
|
|
4858
5406
|
let n = e?.data ?? {}, r = [];
|
|
4859
5407
|
for (let e of Object.values(n)) {
|
|
4860
|
-
let t = e == null ? "" :
|
|
4861
|
-
if (t && r.push(t), r.join(" ").length >
|
|
5408
|
+
let t = e == null ? "" : X(e);
|
|
5409
|
+
if (t && r.push(t), r.join(" ").length > sr) break;
|
|
4862
5410
|
}
|
|
4863
|
-
return r.join(" ").slice(0,
|
|
5411
|
+
return r.join(" ").slice(0, sr).toLocaleLowerCase(t || void 0);
|
|
4864
5412
|
}
|
|
4865
|
-
function
|
|
4866
|
-
let { tenant: b, apiUrl: x, locale: S } = r(
|
|
5413
|
+
function ur({ 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 }) {
|
|
5414
|
+
let { tenant: b, apiUrl: x, locale: S } = r(Y), [C, w] = c(() => cr()), [T, E] = c(() => cr()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
|
|
4867
5415
|
i(() => {
|
|
4868
5416
|
let e = () => {
|
|
4869
|
-
let e =
|
|
5417
|
+
let e = cr();
|
|
4870
5418
|
w(e), E(e);
|
|
4871
5419
|
};
|
|
4872
5420
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -4917,8 +5465,8 @@ function qn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
4917
5465
|
});
|
|
4918
5466
|
}
|
|
4919
5467
|
else for (let t of e.rows) {
|
|
4920
|
-
if (!
|
|
4921
|
-
let n = t?.data ?? {}, r =
|
|
5468
|
+
if (!lr(t, S).includes(P)) continue;
|
|
5469
|
+
let n = t?.data ?? {}, r = X(n.name) || "Untitled", i = X(n.slug);
|
|
4922
5470
|
F.push({
|
|
4923
5471
|
key: `entry:${t.id}`,
|
|
4924
5472
|
title: r,
|
|
@@ -4926,7 +5474,7 @@ function qn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
4926
5474
|
kind: "entry"
|
|
4927
5475
|
});
|
|
4928
5476
|
}
|
|
4929
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
5477
|
+
let I = F.slice(0, Math.min(Math.max(1, p), or)), L = (e) => {
|
|
4930
5478
|
if (v) {
|
|
4931
5479
|
e.preventDefault(), w(T), j(!0);
|
|
4932
5480
|
return;
|
|
@@ -4947,7 +5495,7 @@ function qn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
4947
5495
|
title: "Spring collection",
|
|
4948
5496
|
url: "/blog/spring",
|
|
4949
5497
|
kind: "entry"
|
|
4950
|
-
}] : null, z = R ?? I,
|
|
5498
|
+
}] : null, z = R ?? I, B = !R && P && D && !I.length, V = !N || k && (z.length > 0 || B), ee = z.length > 0 && /* @__PURE__ */ u("ul", {
|
|
4951
5499
|
style: {
|
|
4952
5500
|
listStyle: "none",
|
|
4953
5501
|
margin: 0,
|
|
@@ -5008,7 +5556,7 @@ function qn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5008
5556
|
onChange: (e) => E(e.target.value),
|
|
5009
5557
|
onFocus: () => P && j(!0),
|
|
5010
5558
|
style: {
|
|
5011
|
-
...
|
|
5559
|
+
...Mt,
|
|
5012
5560
|
flexGrow: 1,
|
|
5013
5561
|
minWidth: 0
|
|
5014
5562
|
}
|
|
@@ -5035,7 +5583,7 @@ function qn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5035
5583
|
},
|
|
5036
5584
|
children: h
|
|
5037
5585
|
}),
|
|
5038
|
-
|
|
5586
|
+
V && /* @__PURE__ */ d("div", {
|
|
5039
5587
|
style: N ? {
|
|
5040
5588
|
position: "absolute",
|
|
5041
5589
|
top: "100%",
|
|
@@ -5051,7 +5599,7 @@ function qn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5051
5599
|
background: "var(--page-surface, #f2f2f2)",
|
|
5052
5600
|
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.18)"
|
|
5053
5601
|
} : { marginTop: 14 },
|
|
5054
|
-
children: [
|
|
5602
|
+
children: [ee, B && /* @__PURE__ */ u("div", {
|
|
5055
5603
|
style: {
|
|
5056
5604
|
fontSize: 14,
|
|
5057
5605
|
opacity: .65,
|
|
@@ -5066,21 +5614,21 @@ function qn({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5066
5614
|
}
|
|
5067
5615
|
//#endregion
|
|
5068
5616
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
5069
|
-
function
|
|
5617
|
+
function dr(e) {
|
|
5070
5618
|
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());
|
|
5071
5619
|
return [...new Set(n.map((e) => e.trim()))];
|
|
5072
5620
|
}
|
|
5073
|
-
var
|
|
5074
|
-
function
|
|
5621
|
+
var fr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
5622
|
+
function pr(e, t) {
|
|
5075
5623
|
let n = String(e ?? "").toUpperCase();
|
|
5076
5624
|
if (t === "code") return n;
|
|
5077
5625
|
let r = "";
|
|
5078
5626
|
try {
|
|
5079
|
-
r =
|
|
5627
|
+
r = fr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
5080
5628
|
} catch {}
|
|
5081
5629
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
5082
5630
|
}
|
|
5083
|
-
function
|
|
5631
|
+
function mr(e, t) {
|
|
5084
5632
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
5085
5633
|
if (typeof window > "u") return n || "?";
|
|
5086
5634
|
try {
|
|
@@ -5090,8 +5638,8 @@ function Zn(e, t) {
|
|
|
5090
5638
|
return n || "/";
|
|
5091
5639
|
}
|
|
5092
5640
|
}
|
|
5093
|
-
function
|
|
5094
|
-
let c = r(
|
|
5641
|
+
function hr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
|
|
5642
|
+
let c = r(Y), l = dr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
|
|
5095
5643
|
display: "inline-flex",
|
|
5096
5644
|
alignItems: "center",
|
|
5097
5645
|
gap: 8,
|
|
@@ -5126,7 +5674,7 @@ function Qn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5126
5674
|
style: { opacity: .4 },
|
|
5127
5675
|
children: n ?? "·"
|
|
5128
5676
|
}), /* @__PURE__ */ u("a", {
|
|
5129
|
-
href:
|
|
5677
|
+
href: mr(e, e === f),
|
|
5130
5678
|
hrefLang: e,
|
|
5131
5679
|
"aria-current": e === p ? "true" : void 0,
|
|
5132
5680
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -5136,7 +5684,7 @@ function Qn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5136
5684
|
textDecoration: "none",
|
|
5137
5685
|
cursor: s ? "default" : "pointer"
|
|
5138
5686
|
},
|
|
5139
|
-
children:
|
|
5687
|
+
children: pr(e, t)
|
|
5140
5688
|
})]
|
|
5141
5689
|
}, e))]
|
|
5142
5690
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -5147,7 +5695,7 @@ function Qn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5147
5695
|
value: p,
|
|
5148
5696
|
onChange: s ? void 0 : (e) => {
|
|
5149
5697
|
let t = e.target.value;
|
|
5150
|
-
window.location.assign(
|
|
5698
|
+
window.location.assign(mr(t, t === f));
|
|
5151
5699
|
},
|
|
5152
5700
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
5153
5701
|
style: {
|
|
@@ -5161,57 +5709,57 @@ function Qn({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5161
5709
|
},
|
|
5162
5710
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
5163
5711
|
value: e,
|
|
5164
|
-
children:
|
|
5712
|
+
children: pr(e, t)
|
|
5165
5713
|
}, e))
|
|
5166
5714
|
})]
|
|
5167
5715
|
});
|
|
5168
5716
|
}
|
|
5169
5717
|
//#endregion
|
|
5170
5718
|
//#region ../ui/src/components/builder/apps/index.js
|
|
5171
|
-
var
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
],
|
|
5177
|
-
SiteLoginForm:
|
|
5178
|
-
SiteAccountMenu:
|
|
5179
|
-
SiteLanguagePicker:
|
|
5180
|
-
CookieConsent:
|
|
5181
|
-
SiteSearch:
|
|
5719
|
+
var gr = [
|
|
5720
|
+
Wn,
|
|
5721
|
+
ir,
|
|
5722
|
+
Zn,
|
|
5723
|
+
ar
|
|
5724
|
+
], _r = {
|
|
5725
|
+
SiteLoginForm: Yn,
|
|
5726
|
+
SiteAccountMenu: Xn,
|
|
5727
|
+
SiteLanguagePicker: hr,
|
|
5728
|
+
CookieConsent: rr,
|
|
5729
|
+
SiteSearch: ur
|
|
5182
5730
|
};
|
|
5183
|
-
new Set(
|
|
5731
|
+
new Set(gr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
5184
5732
|
//#endregion
|
|
5185
5733
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
5186
|
-
var
|
|
5187
|
-
function
|
|
5188
|
-
if (
|
|
5734
|
+
var vr = /* @__PURE__ */ new Map();
|
|
5735
|
+
function yr(e) {
|
|
5736
|
+
if (vr.has(e)) return vr.get(e);
|
|
5189
5737
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
5190
5738
|
/* @vite-ignore */
|
|
5191
5739
|
/* webpackIgnore: true */
|
|
5192
5740
|
t
|
|
5193
5741
|
).finally(() => URL.revokeObjectURL(t));
|
|
5194
|
-
return
|
|
5742
|
+
return vr.set(e, n), n;
|
|
5195
5743
|
}
|
|
5196
|
-
function
|
|
5744
|
+
function br(e) {
|
|
5197
5745
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
5198
5746
|
return n && typeof n == "object" ? n : {};
|
|
5199
5747
|
}
|
|
5200
5748
|
//#endregion
|
|
5201
5749
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
5202
|
-
async function
|
|
5203
|
-
let n = await
|
|
5750
|
+
async function xr(e, t) {
|
|
5751
|
+
let n = await yr(e);
|
|
5204
5752
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
5205
5753
|
}
|
|
5206
|
-
var
|
|
5754
|
+
var Sr = {
|
|
5207
5755
|
padding: "10px 12px",
|
|
5208
5756
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
5209
5757
|
borderRadius: 8,
|
|
5210
5758
|
fontSize: 12,
|
|
5211
5759
|
opacity: .6
|
|
5212
5760
|
};
|
|
5213
|
-
function
|
|
5214
|
-
let c = r(
|
|
5761
|
+
function Cr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
5762
|
+
let c = r(Y), l = br(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
5215
5763
|
tenant: c?.tenant ?? "",
|
|
5216
5764
|
apiUrl: c?.apiUrl ?? "/api",
|
|
5217
5765
|
locale: c?.locale ?? "",
|
|
@@ -5223,7 +5771,7 @@ function or({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5223
5771
|
let e = f.current;
|
|
5224
5772
|
if (!l?.code || !e) return;
|
|
5225
5773
|
let n = !0;
|
|
5226
|
-
return
|
|
5774
|
+
return xr(l.code, t).then((e) => {
|
|
5227
5775
|
if (!(!n || !e || !f.current)) {
|
|
5228
5776
|
p.current = e;
|
|
5229
5777
|
try {
|
|
@@ -5253,7 +5801,7 @@ function or({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5253
5801
|
}) : /* @__PURE__ */ d("div", {
|
|
5254
5802
|
ref: o,
|
|
5255
5803
|
style: {
|
|
5256
|
-
...
|
|
5804
|
+
...Sr,
|
|
5257
5805
|
...A(a)
|
|
5258
5806
|
},
|
|
5259
5807
|
children: [
|
|
@@ -5265,12 +5813,12 @@ function or({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5265
5813
|
}
|
|
5266
5814
|
//#endregion
|
|
5267
5815
|
//#region ../ui/src/components/builder/render.jsx
|
|
5268
|
-
var
|
|
5269
|
-
...
|
|
5270
|
-
...
|
|
5271
|
-
PluginBlock:
|
|
5816
|
+
var wr = {
|
|
5817
|
+
...Un,
|
|
5818
|
+
..._r,
|
|
5819
|
+
PluginBlock: Cr
|
|
5272
5820
|
};
|
|
5273
|
-
function
|
|
5821
|
+
function Tr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
5274
5822
|
let o = n[t];
|
|
5275
5823
|
if (!o || o.hidden) return null;
|
|
5276
5824
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -5278,29 +5826,29 @@ function cr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5278
5826
|
let n = o.props?.componentId, s = r?.[n];
|
|
5279
5827
|
if (!s?.template || i.has(n)) return null;
|
|
5280
5828
|
let c = new Set(i).add(n);
|
|
5281
|
-
return /* @__PURE__ */ u(e, { children:
|
|
5829
|
+
return /* @__PURE__ */ u(e, { children: Tr(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
5282
5830
|
}
|
|
5283
|
-
let l =
|
|
5831
|
+
let l = wr[s];
|
|
5284
5832
|
if (!l) return null;
|
|
5285
|
-
let d = (o.nodes ?? []).map((e) =>
|
|
5833
|
+
let d = (o.nodes ?? []).map((e) => Tr(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Tr(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
5286
5834
|
...c,
|
|
5287
5835
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
5288
5836
|
linked: p,
|
|
5289
5837
|
nodeRef: (e) => {
|
|
5290
|
-
e && (e.setAttribute("data-wb", t),
|
|
5838
|
+
e && (e.setAttribute("data-wb", t), V(e, c), B(e, a?.events === !1 ? [] : c.events));
|
|
5291
5839
|
},
|
|
5292
5840
|
children: d.length ? d : void 0
|
|
5293
5841
|
}, t);
|
|
5294
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
5842
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(Jn, {
|
|
5295
5843
|
when: c.when,
|
|
5296
5844
|
children: m
|
|
5297
5845
|
}, t) : m;
|
|
5298
5846
|
}
|
|
5299
5847
|
//#endregion
|
|
5300
5848
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
5301
|
-
var
|
|
5302
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
5303
|
-
function
|
|
5849
|
+
var Er = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Dr = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(q(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
5850
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(q(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
5851
|
+
function Or({ 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 }) {
|
|
5304
5852
|
let b = s?.js?.trim();
|
|
5305
5853
|
if (i(() => {
|
|
5306
5854
|
if (!b) return;
|
|
@@ -5309,40 +5857,40 @@ function dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5309
5857
|
}, [b]), !e?.ROOT) return null;
|
|
5310
5858
|
let x = {
|
|
5311
5859
|
lang: m || void 0,
|
|
5312
|
-
dir:
|
|
5860
|
+
dir: ve(h, m)
|
|
5313
5861
|
}, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
|
|
5314
5862
|
minHeight: "100%",
|
|
5315
5863
|
display: "flex",
|
|
5316
5864
|
flexDirection: "column"
|
|
5317
|
-
}, w =
|
|
5865
|
+
}, w = Tr("ROOT", e, n), T = o(() => ({ render: (t, r) => Tr(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = ae(e, n), O = ie(e, n), k = s?.css?.trim(), A = E(c), j = K(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", {
|
|
5318
5866
|
rel: "stylesheet",
|
|
5319
5867
|
precedence: "default",
|
|
5320
5868
|
href: g(e)
|
|
5321
|
-
}, e)), P =
|
|
5322
|
-
return r === "auto" ? /* @__PURE__ */ u(
|
|
5869
|
+
}, e)), P = Dr(j);
|
|
5870
|
+
return r === "auto" ? /* @__PURE__ */ u(Y.Provider, {
|
|
5323
5871
|
value: {
|
|
5324
5872
|
tenant: l || "",
|
|
5325
5873
|
apiUrl: f || "/api",
|
|
5326
5874
|
locale: m || "",
|
|
5327
5875
|
settings: _ ?? null
|
|
5328
5876
|
},
|
|
5329
|
-
children: /* @__PURE__ */ u(
|
|
5877
|
+
children: /* @__PURE__ */ u(qn, {
|
|
5330
5878
|
initialUser: v,
|
|
5331
|
-
children: /* @__PURE__ */ u(
|
|
5879
|
+
children: /* @__PURE__ */ u(ye.Provider, {
|
|
5332
5880
|
value: p ?? null,
|
|
5333
|
-
children: /* @__PURE__ */ u(
|
|
5881
|
+
children: /* @__PURE__ */ u(Ce.Provider, {
|
|
5334
5882
|
value: T,
|
|
5335
5883
|
children: /* @__PURE__ */ d("div", {
|
|
5336
5884
|
...x,
|
|
5337
5885
|
className: "webim-page",
|
|
5338
5886
|
style: {
|
|
5339
5887
|
...C,
|
|
5340
|
-
...
|
|
5888
|
+
...J(t),
|
|
5341
5889
|
...a
|
|
5342
5890
|
},
|
|
5343
5891
|
children: [
|
|
5344
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
5345
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
5892
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${Er(q(j.light))} }
|
|
5893
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Er(q(j.dark))} } }` }),
|
|
5346
5894
|
/* @__PURE__ */ u("style", { children: P }),
|
|
5347
5895
|
N,
|
|
5348
5896
|
/* @__PURE__ */ u("style", { children: S }),
|
|
@@ -5355,25 +5903,25 @@ function dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5355
5903
|
})
|
|
5356
5904
|
})
|
|
5357
5905
|
})
|
|
5358
|
-
}) : /* @__PURE__ */ u(
|
|
5906
|
+
}) : /* @__PURE__ */ u(Y.Provider, {
|
|
5359
5907
|
value: {
|
|
5360
5908
|
tenant: l || "",
|
|
5361
5909
|
apiUrl: f || "/api",
|
|
5362
5910
|
locale: m || "",
|
|
5363
5911
|
settings: _ ?? null
|
|
5364
5912
|
},
|
|
5365
|
-
children: /* @__PURE__ */ u(
|
|
5913
|
+
children: /* @__PURE__ */ u(qn, {
|
|
5366
5914
|
initialUser: v,
|
|
5367
|
-
children: /* @__PURE__ */ u(
|
|
5915
|
+
children: /* @__PURE__ */ u(ye.Provider, {
|
|
5368
5916
|
value: p ?? null,
|
|
5369
|
-
children: /* @__PURE__ */ u(
|
|
5917
|
+
children: /* @__PURE__ */ u(Ce.Provider, {
|
|
5370
5918
|
value: T,
|
|
5371
5919
|
children: /* @__PURE__ */ d("div", {
|
|
5372
5920
|
...x,
|
|
5373
5921
|
className: "webim-page",
|
|
5374
5922
|
style: {
|
|
5375
5923
|
...C,
|
|
5376
|
-
...
|
|
5924
|
+
...ue(t, r),
|
|
5377
5925
|
...a
|
|
5378
5926
|
},
|
|
5379
5927
|
children: [
|
|
@@ -5395,8 +5943,8 @@ function dr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5395
5943
|
}
|
|
5396
5944
|
//#endregion
|
|
5397
5945
|
//#region src/WebimContent.jsx
|
|
5398
|
-
function
|
|
5399
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
5946
|
+
function kr({ bundle: e, mode: t = "auto", style: n }) {
|
|
5947
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(Or, {
|
|
5400
5948
|
blocks: e.blocks,
|
|
5401
5949
|
theme: e.theme,
|
|
5402
5950
|
components: e.components,
|
|
@@ -5408,13 +5956,13 @@ function fr({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
5408
5956
|
locale: e.locale,
|
|
5409
5957
|
direction: e.direction,
|
|
5410
5958
|
settings: e.settings,
|
|
5411
|
-
mode:
|
|
5959
|
+
mode: fe(t, e.scheme),
|
|
5412
5960
|
style: n
|
|
5413
5961
|
}) : null;
|
|
5414
5962
|
}
|
|
5415
5963
|
//#endregion
|
|
5416
5964
|
//#region src/WebimPage.jsx
|
|
5417
|
-
function
|
|
5965
|
+
function Ar({ 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 }) {
|
|
5418
5966
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
5419
5967
|
onLoad: m,
|
|
5420
5968
|
onError: h
|
|
@@ -5424,7 +5972,7 @@ function pr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
5424
5972
|
onError: h
|
|
5425
5973
|
}, i(() => {
|
|
5426
5974
|
let i = !0;
|
|
5427
|
-
return _({ status: "loading" }),
|
|
5975
|
+
return _({ status: "loading" }), he({
|
|
5428
5976
|
apiUrl: e,
|
|
5429
5977
|
tenant: t,
|
|
5430
5978
|
slug: n,
|
|
@@ -5451,11 +5999,11 @@ function pr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
5451
5999
|
r,
|
|
5452
6000
|
a,
|
|
5453
6001
|
o
|
|
5454
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
6002
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(kr, {
|
|
5455
6003
|
bundle: g.bundle,
|
|
5456
6004
|
mode: l,
|
|
5457
6005
|
style: d
|
|
5458
6006
|
});
|
|
5459
6007
|
}
|
|
5460
6008
|
//#endregion
|
|
5461
|
-
export {
|
|
6009
|
+
export { Or as PageRenderer, kr as WebimContent, Ar as WebimPage, he as fetchPage, We as renderRichContent, de as resolveTheme };
|